Merge remote-tracking branch 'origin/0.8.X' into 0.8.X
This commit is contained in:
@@ -44,6 +44,10 @@ public class EqpAuxiliaryMaterial extends BaseEntity {
|
||||
* 关联设备ID(可为空,通用辅料)
|
||||
*/
|
||||
private Long equipmentId;
|
||||
/**
|
||||
* 机组(如:1#机组、2#机组、公用机组等)
|
||||
*/
|
||||
private String unitTeam;
|
||||
/**
|
||||
* 当前库存数量
|
||||
*/
|
||||
|
||||
@@ -44,6 +44,10 @@ public class EqpSparePart extends BaseEntity {
|
||||
* 关联设备ID(可为空,通用备件)
|
||||
*/
|
||||
private Long equipmentId;
|
||||
/**
|
||||
* 机组(如:1#机组、2#机组、公用机组等)
|
||||
*/
|
||||
private String unitTeam;
|
||||
/**
|
||||
* 当前库存数量
|
||||
*/
|
||||
|
||||
@@ -47,6 +47,11 @@ public class EqpAuxiliaryMaterialBo extends BaseEntity {
|
||||
*/
|
||||
private Long equipmentId;
|
||||
|
||||
/**
|
||||
* 机组(如:1#机组、2#机组、公用机组等)
|
||||
*/
|
||||
private String unitTeam;
|
||||
|
||||
/**
|
||||
* 当前库存数量
|
||||
*/
|
||||
|
||||
@@ -47,6 +47,11 @@ public class EqpSparePartBo extends BaseEntity {
|
||||
*/
|
||||
private Long equipmentId;
|
||||
|
||||
/**
|
||||
* 机组(如:1#机组、2#机组、公用机组等)
|
||||
*/
|
||||
private String unitTeam;
|
||||
|
||||
/**
|
||||
* 当前库存数量
|
||||
*/
|
||||
|
||||
@@ -56,6 +56,12 @@ public class EqpAuxiliaryMaterialVo {
|
||||
@ExcelDictFormat(readConverterExp = "可=为空,通用辅料")
|
||||
private Long equipmentId;
|
||||
|
||||
/**
|
||||
* 机组(如:1#机组、2#机组、公用机组等)
|
||||
*/
|
||||
@ExcelProperty(value = "机组")
|
||||
private String unitTeam;
|
||||
|
||||
/**
|
||||
* 当前库存数量
|
||||
*/
|
||||
|
||||
@@ -56,6 +56,12 @@ public class EqpSparePartVo {
|
||||
@ExcelDictFormat(readConverterExp = "可=为空,通用备件")
|
||||
private Long equipmentId;
|
||||
|
||||
/**
|
||||
* 机组(如:1#机组、2#机组、公用机组等)
|
||||
*/
|
||||
@ExcelProperty(value = "机组")
|
||||
private String unitTeam;
|
||||
|
||||
/**
|
||||
* 当前库存数量
|
||||
*/
|
||||
|
||||
@@ -66,6 +66,7 @@ public class EqpAuxiliaryMaterialServiceImpl implements IEqpAuxiliaryMaterialSer
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getAuxiliaryModel()), EqpAuxiliaryMaterial::getAuxiliaryModel, bo.getAuxiliaryModel());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getUnit()), EqpAuxiliaryMaterial::getUnit, bo.getUnit());
|
||||
lqw.eq(bo.getEquipmentId() != null, EqpAuxiliaryMaterial::getEquipmentId, bo.getEquipmentId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getUnitTeam()), EqpAuxiliaryMaterial::getUnitTeam, bo.getUnitTeam());
|
||||
lqw.eq(bo.getQuantity() != null, EqpAuxiliaryMaterial::getQuantity, bo.getQuantity());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@@ -58,6 +58,7 @@ public class EqpSparePartServiceImpl implements IEqpSparePartService {
|
||||
qw.eq(StringUtils.isNotBlank(bo.getModel()), "sp.model", bo.getModel());
|
||||
qw.eq(StringUtils.isNotBlank(bo.getUnit()), "sp.unit", bo.getUnit());
|
||||
qw.eq(bo.getEquipmentId() != null, "sp.equipment_id", bo.getEquipmentId());
|
||||
qw.like(StringUtils.isNotBlank(bo.getUnitTeam()), "sp.unit_team", bo.getUnitTeam());
|
||||
qw.eq(bo.getQuantity() != null, "sp.quantity", bo.getQuantity());
|
||||
//逻辑删除
|
||||
qw.eq("sp.del_flag", 0);
|
||||
@@ -81,6 +82,7 @@ public class EqpSparePartServiceImpl implements IEqpSparePartService {
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getModel()), EqpSparePart::getModel, bo.getModel());
|
||||
lqw.eq(StringUtils.isNotBlank(bo.getUnit()), EqpSparePart::getUnit, bo.getUnit());
|
||||
lqw.eq(bo.getEquipmentId() != null, EqpSparePart::getEquipmentId, bo.getEquipmentId());
|
||||
lqw.like(StringUtils.isNotBlank(bo.getUnitTeam()), EqpSparePart::getUnitTeam, bo.getUnitTeam());
|
||||
lqw.eq(bo.getQuantity() != null, EqpSparePart::getQuantity, bo.getQuantity());
|
||||
return lqw;
|
||||
}
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<result property="auxiliaryModel" column="auxiliary_model"/>
|
||||
<result property="unit" column="unit"/>
|
||||
<result property="equipmentId" column="equipment_id"/>
|
||||
<result property="unitTeam" column="unit_team"/>
|
||||
<result property="quantity" column="quantity"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
|
||||
@@ -11,6 +11,7 @@
|
||||
<result property="model" column="model"/>
|
||||
<result property="unit" column="unit"/>
|
||||
<result property="equipmentId" column="equipment_id"/>
|
||||
<result property="unitTeam" column="unit_team"/>
|
||||
<result property="quantity" column="quantity"/>
|
||||
<result property="createBy" column="create_by"/>
|
||||
<result property="updateBy" column="update_by"/>
|
||||
@@ -27,6 +28,7 @@
|
||||
sp.model,
|
||||
sp.unit,
|
||||
sp.equipment_id,
|
||||
sp.unit_team,
|
||||
em.equipment_name AS equipmentName,
|
||||
sp.quantity,
|
||||
sp.remark
|
||||
|
||||
@@ -55,3 +55,14 @@ export function withdrawApproval(approvalId) {
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
/**
|
||||
* 按业务ID查询审批信息(用于用印等业务)
|
||||
*/
|
||||
export function getApprovalByBizId(bizId) {
|
||||
return request({
|
||||
url: '/wms/approval/getByBizId',
|
||||
method: 'get',
|
||||
params: { bizId }
|
||||
})
|
||||
}
|
||||
|
||||
@@ -219,7 +219,12 @@ export default {
|
||||
multiple: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
// 是否禁用O卷
|
||||
disableO: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -489,6 +494,10 @@ export default {
|
||||
this.$message.warning('您没有权限选择此钢卷');
|
||||
return; // 终止后续逻辑
|
||||
}
|
||||
if (this.disableO && row.qualityStatus == 'O') {
|
||||
this.$message.warning('O卷不能选择');
|
||||
return;
|
||||
}
|
||||
this.handleSelect(row);
|
||||
},
|
||||
|
||||
|
||||
@@ -99,7 +99,16 @@ export default {
|
||||
},
|
||||
supplierCoilNo() {
|
||||
return this.coilInfo.supplierCoilNo || '-'
|
||||
}
|
||||
},
|
||||
length() {
|
||||
return this.coilInfo.length || '-'
|
||||
},
|
||||
actualLength() {
|
||||
return this.coilInfo.actualLength || '-'
|
||||
},
|
||||
actualWidth() {
|
||||
return this.coilInfo.actualWidth || '-'
|
||||
},
|
||||
},
|
||||
methods: {
|
||||
getCoilInfo() {
|
||||
|
||||
@@ -48,6 +48,10 @@ import KLPTable from '@/components/KLPUI/KLPTable/index.vue'
|
||||
import MemoInput from '@/components/MemoInput/index.vue'
|
||||
import CurrentCoilNo from '@/components/KLPService/Renderer/CurrentCoilNo.vue'
|
||||
|
||||
// 初始化所有列
|
||||
import { initAllColumns } from '@/views/wms/report/js/column.js'
|
||||
|
||||
|
||||
|
||||
// 全局方法挂载
|
||||
Vue.prototype.getDicts = getDicts
|
||||
@@ -83,6 +87,9 @@ Vue.use(VueKonva);
|
||||
Vue.use(dashboardBigPlugin)
|
||||
DictData.install()
|
||||
|
||||
// 初始化所有列
|
||||
initAllColumns()
|
||||
|
||||
/**
|
||||
* If you don't want to use mock-server
|
||||
* you want to use MockJs for mock api
|
||||
|
||||
@@ -125,6 +125,19 @@ export const constantRoutes = [
|
||||
meta: { title: '工厂总日历' }
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
path: '/wms/seal',
|
||||
component: Layout,
|
||||
hidden: true,
|
||||
children: [
|
||||
{
|
||||
path: 'sealDetail/:bizId',
|
||||
component: () => import('@/views/wms/seal/sealDetail'),
|
||||
name: 'WmsSealDetail',
|
||||
meta: { title: '用印详情' }
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
|
||||
@@ -33,11 +33,9 @@
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="关联设备" prop="equipmentId">
|
||||
<el-select v-model="queryParams.equipmentId" placeholder="请选择关联设备" filterable>
|
||||
<el-option v-for="item in equipmentList" :key="item.equipmentId" :label="item.equipmentName" :value="item.equipmentId" />
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="机组" prop="unitTeam">
|
||||
<dict-select v-model="queryParams.unitTeam" dict-type="sys_lines" placeholder="请选择机组" filterable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
@@ -91,6 +89,7 @@
|
||||
<el-table-column label="辅料名称" align="center" prop="auxiliaryName" />
|
||||
<el-table-column label="辅料品类" align="center" prop="materialCategory" />
|
||||
<el-table-column label="辅料品牌" align="center" prop="auxiliaryModel" />
|
||||
<el-table-column label="机组" align="center" prop="unitTeam" />
|
||||
<el-table-column label="计量单位" align="center" prop="unit" />
|
||||
<!-- <el-table-column label="关联设备" align="center" prop="equipmentName" /> -->
|
||||
<el-table-column label="当前库存" align="center" prop="quantity" />
|
||||
@@ -147,11 +146,9 @@
|
||||
<el-form-item label="计量单位" prop="unit">
|
||||
<el-input v-model="form.unit" placeholder="请输入计量单位" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="关联设备ID" prop="equipmentId">
|
||||
<el-select v-model="form.equipmentId" placeholder="请选择关联设备ID" filterable>
|
||||
<el-option v-for="item in equipmentList" :key="item.equipmentId" :label="item.equipmentName" :value="item.equipmentId" />
|
||||
</el-select>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="机组" prop="unitTeam">
|
||||
<dict-select v-model="form.unitTeam" dict-type="sys_lines" placeholder="请选择机组" filterable />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入内容" />
|
||||
</el-form-item>
|
||||
@@ -196,11 +193,13 @@
|
||||
import { listAuxiliaryMaterial, getAuxiliaryMaterial, delAuxiliaryMaterial, addAuxiliaryMaterial, updateAuxiliaryMaterial } from "@/api/mes/eqp/auxiliaryMaterial";
|
||||
import { changeStock } from "@/api/mes/eqp/auxiliaryMaterialChange";
|
||||
import auxiliaryChange from '../components/pages/auxiliaryChange.vue';
|
||||
import dictSelect from '@/components/DictSelect';
|
||||
|
||||
export default {
|
||||
name: "Auxiliary",
|
||||
components: {
|
||||
auxiliaryChange
|
||||
auxiliaryChange,
|
||||
dictSelect
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -38,6 +38,9 @@
|
||||
<el-option v-for="item in equipmentList" :key="item.equipmentId" :label="item.equipmentName" :value="item.equipmentId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="机组" prop="unitTeam">
|
||||
<dict-select v-model="queryParams.unitTeam" dict-type="sys_lines" placeholder="请选择机组" filterable />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
@@ -92,6 +95,7 @@
|
||||
<el-table-column label="物料品类" align="center" prop="materialCategory" />
|
||||
<el-table-column label="备件型号" align="center" prop="model" />
|
||||
<el-table-column label="计量单位" align="center" prop="unit" />
|
||||
<el-table-column label="机组" align="center" prop="unitTeam" />
|
||||
<el-table-column label="关联设备" align="center" prop="equipmentName" />
|
||||
<el-table-column label="当前库存" align="center" prop="quantity" />
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
@@ -147,6 +151,9 @@
|
||||
<el-form-item label="计量单位" prop="unit">
|
||||
<el-input v-model="form.unit" placeholder="请输入计量单位" />
|
||||
</el-form-item>
|
||||
<el-form-item label="机组" prop="unitTeam">
|
||||
<dict-select v-model="form.unitTeam" dict-type="sys_lines" placeholder="请选择机组" filterable />
|
||||
</el-form-item>
|
||||
<el-form-item label="关联设备ID" prop="equipmentId">
|
||||
<el-select v-model="form.equipmentId" placeholder="请选择关联设备ID" filterable>
|
||||
<el-option v-for="item in equipmentList" :key="item.equipmentId" :label="item.equipmentName" :value="item.equipmentId" />
|
||||
@@ -197,11 +204,14 @@ import { listSparePart, getSparePart, delSparePart, addSparePart, updateSparePar
|
||||
import { listEquipmentManagement } from "@/api/mes/eqp/equipmentManagement";
|
||||
import { changeStock } from "@/api/mes/eqp/sparePartsChange";
|
||||
import partChange from '../components/pages/partChange.vue';
|
||||
import dictSelect from '@/components/DictSelect';
|
||||
|
||||
|
||||
export default {
|
||||
name: "SparePart",
|
||||
components: {
|
||||
partChange
|
||||
partChange,
|
||||
dictSelect
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
|
||||
@@ -111,38 +111,7 @@
|
||||
|
||||
<!-- 添加或修改钢卷异常信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="钢卷ID" prop="coilId" v-if="!form.abnormalId && showCoilSelector">
|
||||
<coil-selector v-model="form.coilId"></coil-selector>
|
||||
</el-form-item>
|
||||
<el-form-item label="位置" prop="position">
|
||||
<el-radio-group v-model="form.position">
|
||||
<el-radio-button v-for="dict in dict.type.coil_abnormal_position" :key="dict.value" :label="dict.value">{{
|
||||
dict.label }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="长度坐标" prop="lengthCoord">
|
||||
<!-- <el-input v-model="form.lengthCoord" placeholder="请输入长度坐标" /> -->
|
||||
<el-input v-model="form.startPosition" placeholder="请输入开始位置" />
|
||||
<el-input v-model="form.endPosition" placeholder="请输入结束位置" />
|
||||
<!-- <el-input v-model="form.length" placeholder="请输入缺陷长度" /> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="缺陷代码" prop="defectCode">
|
||||
<el-radio-group v-model="form.defectCode">
|
||||
<el-radio-button v-for="dict in dict.type.coil_abnormal_code" :key="dict.value" :label="dict.value">{{
|
||||
dict.label }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="程度" prop="degree">
|
||||
<el-radio-group v-model="form.degree">
|
||||
<el-radio-button v-for="dict in dict.type.coil_abnormal_degree" :key="dict.value" :label="dict.value">{{
|
||||
dict.label }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input type="textarea" v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<abnormal-form ref="abnormalForm" v-model="form" :show-coil-selector="showCoilSelector"></abnormal-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
@@ -173,6 +142,7 @@ import { listMaterialCoil } from "@/api/wms/coil";
|
||||
import CoilSelector from '@/components/CoilSelector'
|
||||
import CoilNo from '@/components/KLPService/Renderer/CoilNo'
|
||||
import CoilList from "./components/CoilList.vue";
|
||||
import AbnormalForm from './components/AbnormalForm';
|
||||
|
||||
export default {
|
||||
name: "CoilAbnormal",
|
||||
@@ -180,7 +150,8 @@ export default {
|
||||
components: {
|
||||
CoilSelector,
|
||||
CoilNo,
|
||||
CoilList
|
||||
CoilList,
|
||||
AbnormalForm
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -294,7 +265,9 @@ export default {
|
||||
updateTime: undefined,
|
||||
updateBy: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
if (this.$refs.abnormalForm) {
|
||||
this.$refs.abnormalForm.resetFields();
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
@@ -340,7 +313,7 @@ export default {
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
this.$refs["abnormalForm"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.abnormalId != null) {
|
||||
|
||||
@@ -98,62 +98,12 @@
|
||||
|
||||
<!-- 添加或修改钢卷异常信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="钢卷ID" prop="coilId" v-if="!form.abnormalId">
|
||||
<coil-selector v-model="form.coilId"></coil-selector>
|
||||
</el-form-item>
|
||||
<el-form-item label="位置" prop="position">
|
||||
<el-radio-group v-model="form.position">
|
||||
<el-radio-button v-for="dict in dict.type.coil_abnormal_position" :key="dict.value" :label="dict.value">{{
|
||||
dict.label }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="开始位置" prop="startPosition">
|
||||
<el-input v-model="form.startPosition" prop="startPosition" />
|
||||
</el-form-item>
|
||||
<el-form-item label="结束位置" prop="endPosition">
|
||||
<el-input v-model="form.endPosition" prop="endPosition" />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="缺陷长度" prop="length">
|
||||
<el-input v-model="form.length" placeholder="请输入缺陷长度" />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="缺陷代码" prop="defectCode">
|
||||
<el-radio-group v-model="form.defectCode">
|
||||
<el-radio-button v-for="dict in dict.type.coil_abnormal_code" :key="dict.value" :label="dict.value">{{
|
||||
dict.label }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="程度" prop="degree">
|
||||
<el-radio-group v-model="form.degree">
|
||||
<el-radio-button v-for="dict in dict.type.coil_abnormal_degree" :key="dict.value" :label="dict.value">{{
|
||||
dict.label }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input type="textarea" v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<abnormal-form ref="abnormalForm" v-model="form" :show-coil-selector="!$route.query.coilId"></abnormal-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 异常判级对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="judgeOpen" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="判级" prop="judgeLevel">
|
||||
<el-radio-group v-model="form.judgeLevel">
|
||||
<el-radio-button v-for="dict in dict.type.coil_abnormal_level" :key="dict.value" :label="dict.value">{{
|
||||
dict.label }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitJudge">确 定</el-button>
|
||||
<el-button @click="judgeOpen = false">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -161,13 +111,15 @@
|
||||
import { listCoilAbnormal, getCoilAbnormal, delCoilAbnormal, addCoilAbnormal, updateCoilAbnormal, judgeAbnormalLevel } from "@/api/wms/coilAbnormal";
|
||||
import CoilSelector from '@/components/CoilSelector'
|
||||
import CoilNo from '@/components/KLPService/Renderer/CoilNo'
|
||||
import AbnormalForm from './components/AbnormalForm'
|
||||
|
||||
export default {
|
||||
name: "CoilAbnormal",
|
||||
dicts: ['coil_abnormal_code', 'coil_abnormal_position', 'coil_abnormal_degree', 'coil_abnormal_level'],
|
||||
components: {
|
||||
CoilSelector,
|
||||
CoilNo
|
||||
CoilNo,
|
||||
AbnormalForm
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -205,9 +157,6 @@ export default {
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
},
|
||||
judgeOpen: false,
|
||||
};
|
||||
},
|
||||
@@ -259,7 +208,9 @@ export default {
|
||||
updateTime: undefined,
|
||||
updateBy: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
if (this.$refs.abnormalForm) {
|
||||
this.$refs.abnormalForm.resetFields();
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
@@ -297,7 +248,7 @@ export default {
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
this.$refs["abnormalForm"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.abnormalId != null) {
|
||||
|
||||
113
klp-ui/src/views/wms/coil/components/AbnormalForm.vue
Normal file
113
klp-ui/src/views/wms/coil/components/AbnormalForm.vue
Normal file
@@ -0,0 +1,113 @@
|
||||
<template>
|
||||
<el-form ref="form" :model="formData" :rules="rules" label-width="80px">
|
||||
<el-form-item label="钢卷ID" prop="coilId" v-if="!formData.abnormalId && showCoilSelector">
|
||||
<coil-selector v-model="formData.coilId"></coil-selector>
|
||||
</el-form-item>
|
||||
<el-form-item label="位置" prop="position">
|
||||
<el-radio-group v-model="formData.position">
|
||||
<el-radio-button v-for="dict in dict.type.coil_abnormal_position" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="开始位置" prop="startPosition">
|
||||
<el-input v-model="formData.startPosition" type="number" placeholder="请输入开始位置" />
|
||||
</el-form-item>
|
||||
<el-form-item label="结束位置" prop="endPosition">
|
||||
<el-input v-model="formData.endPosition" type="number" placeholder="请输入结束位置" />
|
||||
</el-form-item>
|
||||
<el-form-item label="缺陷代码" prop="defectCode">
|
||||
<el-radio-group v-model="formData.defectCode">
|
||||
<el-radio-button v-for="dict in dict.type.coil_abnormal_code" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="程度" prop="degree">
|
||||
<el-radio-group v-model="formData.degree">
|
||||
<el-radio-button v-for="dict in dict.type.coil_abnormal_degree" :key="dict.value" :label="dict.value">{{ dict.label }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input type="textarea" v-model="formData.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import CoilSelector from '@/components/CoilSelector'
|
||||
|
||||
export default {
|
||||
name: "AbnormalForm",
|
||||
components: {
|
||||
CoilSelector
|
||||
},
|
||||
props: {
|
||||
value: {
|
||||
type: Object,
|
||||
default: () => ({})
|
||||
},
|
||||
showCoilSelector: {
|
||||
type: Boolean,
|
||||
default: false
|
||||
}
|
||||
},
|
||||
dicts: ['coil_abnormal_code', 'coil_abnormal_position', 'coil_abnormal_degree', 'coil_abnormal_level'],
|
||||
data() {
|
||||
return {
|
||||
rules: {
|
||||
position: [
|
||||
{ required: true, message: '请选择位置', trigger: 'change' }
|
||||
],
|
||||
startPosition: [
|
||||
{ required: true, message: '请输入开始位置', trigger: 'blur' },
|
||||
// { type: 'number', message: '请输入数字', trigger: 'blur' }
|
||||
],
|
||||
endPosition: [
|
||||
{ required: true, message: '请输入结束位置', trigger: 'blur' },
|
||||
// { type: 'number', message: '请输入数字', trigger: 'blur' }
|
||||
],
|
||||
defectCode: [
|
||||
{ required: true, message: '请选择缺陷代码', trigger: 'change' }
|
||||
],
|
||||
degree: [
|
||||
{ required: true, message: '请选择程度', trigger: 'change' }
|
||||
]
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
formData: {
|
||||
get() {
|
||||
return this.value || {};
|
||||
},
|
||||
set(newVal) {
|
||||
this.$emit('input', { ...newVal });
|
||||
}
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
/** 表单验证 */
|
||||
validate(callback) {
|
||||
return this.$refs.form.validate(callback);
|
||||
},
|
||||
/** 重置表单 */
|
||||
resetFields() {
|
||||
this.$refs.form.resetFields();
|
||||
this.formData = {
|
||||
abnormalId: undefined,
|
||||
coilId: undefined,
|
||||
position: undefined,
|
||||
startPosition: undefined,
|
||||
endPosition: undefined,
|
||||
length: undefined,
|
||||
defectCode: undefined,
|
||||
degree: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
},
|
||||
/** 计算缺陷长度 */
|
||||
calculateLength() {
|
||||
if (this.formData.startPosition && this.formData.endPosition) {
|
||||
this.formData.length = this.formData.endPosition - this.formData.startPosition;
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
</script>
|
||||
@@ -230,11 +230,61 @@
|
||||
<el-input v-model="targetCoil.formattedDuration" placeholder="自动计算" disabled />
|
||||
</el-form-item>
|
||||
</div>
|
||||
|
||||
<div class="form-row">
|
||||
<el-form-item label="异常信息" class="form-item-full">
|
||||
<div class="abnormal-container">
|
||||
<div
|
||||
v-for="(abnormal, index) in abnormals"
|
||||
:key="index"
|
||||
class="abnormal-item"
|
||||
@click="editAbnormal(index)"
|
||||
>
|
||||
<div class="abnormal-content">
|
||||
<div class="abnormal-info">
|
||||
<div class="abnormal-position">{{ getAbnormalPositionText(abnormal.position) }}</div>
|
||||
<div class="abnormal-code">{{ getAbnormalCodeText(abnormal.defectCode) }}</div>
|
||||
</div>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="mini"
|
||||
icon="el-icon-close"
|
||||
class="abnormal-delete"
|
||||
@click.stop="deleteAbnormal(index)"
|
||||
></el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="abnormal-add"
|
||||
@click="addAbnormal"
|
||||
>
|
||||
<i class="el-icon-plus"></i>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</div>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 异常表单弹窗 -->
|
||||
<el-dialog
|
||||
:title="currentAbnormalIndex === -1 ? '新增异常' : '编辑异常'"
|
||||
:visible.sync="abnormalDialogVisible"
|
||||
width="600px"
|
||||
>
|
||||
<abnormal-form
|
||||
ref="abnormalForm"
|
||||
v-model="abnormalForm"
|
||||
:show-coil-selector="false"
|
||||
></abnormal-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="abnormalDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="saveAbnormal">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -247,6 +297,7 @@ import RawMaterialSelector from "@/components/KLPService/RawMaterialSelect";
|
||||
import ProductSelector from "@/components/KLPService/ProductSelect";
|
||||
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import TimeInput from "@/components/TimeInput";
|
||||
import AbnormalForm from './components/AbnormalForm';
|
||||
import { generateCoilNoPrefix } from "@/utils/coil/coilNo";
|
||||
|
||||
export default {
|
||||
@@ -257,9 +308,10 @@ export default {
|
||||
RawMaterialSelector,
|
||||
ProductSelector,
|
||||
WarehouseSelect,
|
||||
TimeInput
|
||||
TimeInput,
|
||||
AbnormalForm
|
||||
},
|
||||
dicts: ['coil_quality_status'],
|
||||
dicts: ['coil_quality_status', 'coil_abnormal_position', 'coil_abnormal_code', 'coil_abnormal_degree'],
|
||||
data() {
|
||||
const currentCoilNoPrefix = generateCoilNoPrefix()
|
||||
return {
|
||||
@@ -332,7 +384,24 @@ export default {
|
||||
pendingLoading: false,
|
||||
// 待操作ID
|
||||
actionId: null,
|
||||
currentAction: {}
|
||||
currentAction: {},
|
||||
// 异常信息
|
||||
abnormals: [],
|
||||
// 异常表单弹窗
|
||||
abnormalDialogVisible: false,
|
||||
// 当前编辑的异常索引
|
||||
currentAbnormalIndex: -1,
|
||||
// 异常表单数据
|
||||
abnormalForm: {
|
||||
coilId: null,
|
||||
position: null,
|
||||
startPosition: 0,
|
||||
endPosition: 0,
|
||||
length: 0,
|
||||
defectCode: null,
|
||||
degree: null,
|
||||
remark: null
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -681,6 +750,7 @@ export default {
|
||||
...this.targetCoil,
|
||||
enterCoilNo: enterCoilNos, // 拼接的入场钢卷号
|
||||
hasMergeSplit: 2, // 2表示合卷
|
||||
abnormals: this.abnormals,
|
||||
newCoils: this.sourceCoils.map(item => ({
|
||||
coilId: item.coilId,
|
||||
enterCoilNo: item.enterCoilNo,
|
||||
@@ -836,6 +906,78 @@ export default {
|
||||
// closePage 关闭当前页面
|
||||
closePage() {
|
||||
this.$router.back();
|
||||
},
|
||||
|
||||
// 新增异常
|
||||
addAbnormal() {
|
||||
this.currentAbnormalIndex = -1;
|
||||
this.abnormalForm = {
|
||||
coilId: null,
|
||||
position: null,
|
||||
startPosition: 0,
|
||||
endPosition: 0,
|
||||
length: 0,
|
||||
defectCode: null,
|
||||
degree: null,
|
||||
remark: null
|
||||
};
|
||||
this.abnormalDialogVisible = true;
|
||||
},
|
||||
|
||||
// 编辑异常
|
||||
editAbnormal(index) {
|
||||
this.currentAbnormalIndex = index;
|
||||
this.abnormalForm = { ...this.abnormals[index] };
|
||||
this.abnormalDialogVisible = true;
|
||||
},
|
||||
|
||||
// 保存异常
|
||||
saveAbnormal() {
|
||||
this.$refs.abnormalForm.validate(valid => {
|
||||
if (valid) {
|
||||
// 计算缺陷长度
|
||||
this.abnormalForm.length = this.abnormalForm.endPosition - this.abnormalForm.startPosition;
|
||||
|
||||
if (this.currentAbnormalIndex === -1) {
|
||||
// 新增异常
|
||||
this.abnormals.push({ ...this.abnormalForm });
|
||||
} else {
|
||||
// 编辑异常
|
||||
this.abnormals[this.currentAbnormalIndex] = { ...this.abnormalForm };
|
||||
}
|
||||
|
||||
this.abnormalDialogVisible = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 删除异常
|
||||
deleteAbnormal(index) {
|
||||
this.$confirm('确定要删除这个异常信息吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.abnormals.splice(index, 1);
|
||||
});
|
||||
},
|
||||
|
||||
// 获取异常位置文本
|
||||
getAbnormalPositionText(position) {
|
||||
if (!position) return '';
|
||||
const dict = this.dict.type.coil_abnormal_position;
|
||||
if (!dict) return position;
|
||||
const item = dict.find(item => item.value === position);
|
||||
return item ? item.label : position;
|
||||
},
|
||||
|
||||
// 获取异常代码文本
|
||||
getAbnormalCodeText(code) {
|
||||
if (!code) return '';
|
||||
const dict = this.dict.type.coil_abnormal_code;
|
||||
if (!dict) return code;
|
||||
const item = dict.find(item => item.value === code);
|
||||
return item ? item.label : code;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1256,4 +1398,86 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
.abnormal-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.abnormal-item {
|
||||
width: 120px;
|
||||
height: 80px;
|
||||
background-color: #fff1f0;
|
||||
border: 1px solid #ff4d4f;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
position: relative;
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0 2px 8px rgba(255, 77, 79, 0.2);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.abnormal-content {
|
||||
padding: 8px;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.abnormal-info {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.abnormal-position {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: #ff4d4f;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.abnormal-code {
|
||||
font-size: 11px;
|
||||
color: #666;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.abnormal-delete {
|
||||
position: absolute;
|
||||
top: -8px;
|
||||
right: -8px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.abnormal-add {
|
||||
width: 120px;
|
||||
height: 80px;
|
||||
border: 2px dashed #ff4d4f;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
color: #ff4d4f;
|
||||
font-size: 24px;
|
||||
|
||||
&:hover {
|
||||
background-color: #fff1f0;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -58,35 +58,7 @@
|
||||
|
||||
<!-- 添加或修改钢卷异常信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="600px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="位置" prop="position">
|
||||
<el-radio-group v-model="form.position">
|
||||
<el-radio-button v-for="dict in dict.type.coil_abnormal_position" :key="dict.value" :label="dict.value">{{
|
||||
dict.label }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="长度坐标" prop="lengthCoord">
|
||||
<!-- <el-input v-model="form.lengthCoord" placeholder="请输入长度坐标" /> -->
|
||||
<el-input v-model="form.startPosition" placeholder="请输入开始位置" />
|
||||
<el-input v-model="form.endPosition" placeholder="请输入结束位置" />
|
||||
<!-- <el-input v-model="form.length" placeholder="请输入缺陷长度" /> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="缺陷代码" prop="defectCode">
|
||||
<el-radio-group v-model="form.defectCode">
|
||||
<el-radio-button v-for="dict in dict.type.coil_abnormal_code" :key="dict.value" :label="dict.value">{{
|
||||
dict.label }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="程度" prop="degree">
|
||||
<el-radio-group v-model="form.degree">
|
||||
<el-radio-button v-for="dict in dict.type.coil_abnormal_degree" :key="dict.value" :label="dict.value">{{
|
||||
dict.label }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input type="textarea" v-model="form.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<abnormal-form ref="abnormalForm" v-model="form" :show-coil-selector="false"></abnormal-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
@@ -97,10 +69,14 @@
|
||||
|
||||
<script>
|
||||
import { listCoilAbnormal, getCoilAbnormal, delCoilAbnormal, addCoilAbnormal, updateCoilAbnormal } from "@/api/wms/coilAbnormal";
|
||||
import AbnormalForm from '../components/AbnormalForm';
|
||||
|
||||
export default {
|
||||
name: "CoilAbnormal",
|
||||
dicts: ['coil_abnormal_code', 'coil_abnormal_position', 'coil_abnormal_degree'],
|
||||
components: {
|
||||
AbnormalForm
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
@@ -137,9 +113,6 @@ export default {
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
// 表单校验
|
||||
rules: {
|
||||
},
|
||||
judgeOpen: false,
|
||||
};
|
||||
},
|
||||
@@ -197,7 +170,9 @@ export default {
|
||||
updateTime: undefined,
|
||||
updateBy: undefined
|
||||
};
|
||||
this.resetForm("form");
|
||||
if (this.$refs.abnormalForm) {
|
||||
this.$refs.abnormalForm.resetFields();
|
||||
}
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
@@ -229,7 +204,7 @@ export default {
|
||||
},
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
this.$refs["abnormalForm"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.form.abnormalId != null) {
|
||||
|
||||
@@ -439,36 +439,7 @@
|
||||
</el-row>
|
||||
|
||||
<el-dialog title="新增异常" :visible.sync="exceptionDialogVisible" width="600px">
|
||||
<el-form ref="exceptionForm" :model="exceptionForm" label-width="80px">
|
||||
<el-form-item label="位置" prop="position">
|
||||
<el-radio-group v-model="exceptionForm.position">
|
||||
<el-radio-button v-for="dict in dict.type.coil_abnormal_position" :key="dict.value" :label="dict.value">{{
|
||||
dict.label }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="长度坐标" prop="lengthCoord">
|
||||
<div style="display: flex; gap: 10px;">
|
||||
<el-input v-model="exceptionForm.startPosition" placeholder="请输入开始位置" />
|
||||
-
|
||||
<el-input v-model="exceptionForm.endPosition" placeholder="请输入结束位置" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="缺陷代码" prop="defectCode">
|
||||
<el-radio-group v-model="exceptionForm.defectCode">
|
||||
<el-radio-button v-for="dict in dict.type.coil_abnormal_code" :key="dict.value" :label="dict.value">{{
|
||||
dict.label }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="程度" prop="degree">
|
||||
<el-radio-group v-model="exceptionForm.degree">
|
||||
<el-radio-button v-for="dict in dict.type.coil_abnormal_degree" :key="dict.value" :label="dict.value">{{
|
||||
dict.label }}</el-radio-button>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input type="textarea" v-model="exceptionForm.remark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<abnormal-form ref="abnormalForm" v-model="exceptionForm" :show-coil-selector="false"></abnormal-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button type="info" @click="handleAbnormal">查看异常</el-button>
|
||||
<el-button type="primary" @click="confirmException">确 定</el-button>
|
||||
@@ -499,6 +470,7 @@ import RawMaterialInfo from '@/components/KLPService/Renderer/RawMaterialInfo'
|
||||
import { addCoilAbnormal } from '@/api/wms/coilAbnormal'
|
||||
import LabelRender from './LabelRender/index.vue'
|
||||
import StepSplit from './stepSplit.vue'
|
||||
import AbnormalForm from '../components/AbnormalForm'
|
||||
import { getCoilTagPrintType } from '@/views/wms/coil/js/coilPrint'
|
||||
|
||||
export default {
|
||||
@@ -522,7 +494,8 @@ export default {
|
||||
ProductInfo,
|
||||
RawMaterialInfo,
|
||||
LabelRender,
|
||||
StepSplit
|
||||
StepSplit,
|
||||
AbnormalForm
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
@@ -982,19 +955,22 @@ export default {
|
||||
this.exceptionDialogVisible = true
|
||||
},
|
||||
confirmException() {
|
||||
addCoilAbnormal({
|
||||
...this.exceptionForm,
|
||||
length: this.exceptionForm.endPosition - this.exceptionForm.startPosition,
|
||||
}).then(response => {
|
||||
this.$message.success('异常记录添加成功')
|
||||
this.cancelException();
|
||||
// 重置表单
|
||||
this.getMaterialCoil()
|
||||
}).catch(error => {
|
||||
console.error('异常记录添加失败:', error)
|
||||
this.$message.error('异常记录添加失败: ' + (error.message || error))
|
||||
})
|
||||
|
||||
this.$refs["abnormalForm"].validate(valid => {
|
||||
if (valid) {
|
||||
addCoilAbnormal({
|
||||
...this.exceptionForm,
|
||||
length: this.exceptionForm.endPosition - this.exceptionForm.startPosition,
|
||||
}).then(response => {
|
||||
this.$message.success('异常记录添加成功')
|
||||
this.cancelException();
|
||||
// 重置表单
|
||||
this.getMaterialCoil()
|
||||
}).catch(error => {
|
||||
console.error('异常记录添加失败:', error)
|
||||
this.$message.error('异常记录添加失败: ' + (error.message || error))
|
||||
})
|
||||
}
|
||||
});
|
||||
},
|
||||
handleAbnormal() {
|
||||
this.$router.push({
|
||||
|
||||
@@ -162,6 +162,37 @@
|
||||
<el-input v-model="splitForm.remark" placeholder="请输入备注" type="textarea" />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="异常信息">
|
||||
<div class="abnormal-container">
|
||||
<div
|
||||
v-for="(abnormal, index) in abnormals"
|
||||
:key="index"
|
||||
class="abnormal-item"
|
||||
@click="editAbnormal(index)"
|
||||
>
|
||||
<div class="abnormal-content">
|
||||
<div class="abnormal-info">
|
||||
<div class="abnormal-position">{{ getAbnormalPositionText(abnormal.position) }}</div>
|
||||
<div class="abnormal-code">{{ getAbnormalCodeText(abnormal.defectCode) }}</div>
|
||||
</div>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="mini"
|
||||
icon="el-icon-close"
|
||||
class="abnormal-delete"
|
||||
@click.stop="deleteAbnormal(index)"
|
||||
></el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="abnormal-add"
|
||||
@click="addAbnormal"
|
||||
>
|
||||
<i class="el-icon-plus"></i>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item>
|
||||
<el-button :loading="buttonLoading" type="primary" @click="addSplit">提交分条</el-button>
|
||||
<el-button :loading="buttonLoading" @click="resetSplitForm">重置</el-button>
|
||||
@@ -210,6 +241,24 @@
|
||||
</div>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
<!-- 异常表单弹窗 -->
|
||||
<el-dialog
|
||||
:title="currentAbnormalIndex === -1 ? '新增异常' : '编辑异常'"
|
||||
:visible.sync="abnormalDialogVisible"
|
||||
width="600px"
|
||||
append-to-body
|
||||
>
|
||||
<abnormal-form
|
||||
ref="abnormalForm"
|
||||
v-model="abnormalForm"
|
||||
:show-coil-selector="false"
|
||||
></abnormal-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="abnormalDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="saveAbnormal">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -221,6 +270,7 @@ import RawMaterialSelect from "@/components/KLPService/RawMaterialSelect";
|
||||
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect";
|
||||
import TimeInput from "@/components/TimeInput";
|
||||
import AbnormalForm from '../components/AbnormalForm';
|
||||
import { generateCoilNoPrefix } from "@/utils/coil/coilNo";
|
||||
|
||||
export default {
|
||||
@@ -245,8 +295,9 @@ export default {
|
||||
WarehouseSelect,
|
||||
ActualWarehouseSelect,
|
||||
TimeInput,
|
||||
AbnormalForm
|
||||
},
|
||||
dicts: ['coil_quality_status'],
|
||||
dicts: ['coil_quality_status', 'coil_abnormal_position', 'coil_abnormal_code', 'coil_abnormal_degree'],
|
||||
data() {
|
||||
const currentCoilNoPrefix = generateCoilNoPrefix()
|
||||
return {
|
||||
@@ -327,7 +378,24 @@ export default {
|
||||
warehouseId: [{ required: true, message: '请选择所在库位', trigger: 'change' }],
|
||||
},
|
||||
buttonLoading: false,
|
||||
currentAction: {}
|
||||
currentAction: {},
|
||||
// 异常信息
|
||||
abnormals: [],
|
||||
// 异常表单弹窗
|
||||
abnormalDialogVisible: false,
|
||||
// 当前编辑的异常索引
|
||||
currentAbnormalIndex: -1,
|
||||
// 异常表单数据
|
||||
abnormalForm: {
|
||||
coilId: null,
|
||||
position: null,
|
||||
startPosition: 0,
|
||||
endPosition: 0,
|
||||
length: 0,
|
||||
defectCode: null,
|
||||
degree: null,
|
||||
remark: null
|
||||
}
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -470,6 +538,8 @@ export default {
|
||||
formattedDuration: '',
|
||||
parentCoilId: this.coilId,
|
||||
}
|
||||
// 重置异常信息
|
||||
this.abnormals = [];
|
||||
},
|
||||
|
||||
// 材料类型变更处理
|
||||
@@ -506,12 +576,19 @@ export default {
|
||||
// 区分新增/编辑:有coilId则为编辑,否则为新增
|
||||
let res
|
||||
this.buttonLoading = true
|
||||
|
||||
// 添加异常信息到表单数据
|
||||
const splitData = {
|
||||
...this.splitForm,
|
||||
abnormals: this.abnormals
|
||||
};
|
||||
|
||||
if (this.splitForm.coilId) {
|
||||
// 编辑分条:调用更新接口
|
||||
res = await updateMaterialCoilSimple(this.splitForm)
|
||||
res = await updateMaterialCoilSimple(splitData)
|
||||
} else {
|
||||
// 新增分条:调用创建接口
|
||||
res = await createSpecialChild(this.coilId, this.actionId, this.splitForm)
|
||||
res = await createSpecialChild(this.coilId, this.actionId, splitData)
|
||||
}
|
||||
|
||||
this.$message.success(this.splitForm.coilId ? '编辑分条成功' : '新增分条成功')
|
||||
@@ -614,6 +691,78 @@ export default {
|
||||
this.$set(this.splitForm, 'productionDuration', '');
|
||||
this.$set(this.splitForm, 'formattedDuration', '');
|
||||
}
|
||||
},
|
||||
|
||||
// 新增异常
|
||||
addAbnormal() {
|
||||
this.currentAbnormalIndex = -1;
|
||||
this.abnormalForm = {
|
||||
coilId: this.splitForm.coilId || null,
|
||||
position: null,
|
||||
startPosition: 0,
|
||||
endPosition: 0,
|
||||
length: 0,
|
||||
defectCode: null,
|
||||
degree: null,
|
||||
remark: null
|
||||
};
|
||||
this.abnormalDialogVisible = true;
|
||||
},
|
||||
|
||||
// 编辑异常
|
||||
editAbnormal(index) {
|
||||
this.currentAbnormalIndex = index;
|
||||
this.abnormalForm = { ...this.abnormals[index] };
|
||||
this.abnormalDialogVisible = true;
|
||||
},
|
||||
|
||||
// 保存异常
|
||||
saveAbnormal() {
|
||||
this.$refs.abnormalForm.validate(valid => {
|
||||
if (valid) {
|
||||
// 计算缺陷长度
|
||||
this.abnormalForm.length = this.abnormalForm.endPosition - this.abnormalForm.startPosition;
|
||||
|
||||
if (this.currentAbnormalIndex === -1) {
|
||||
// 新增异常
|
||||
this.abnormals.push({ ...this.abnormalForm });
|
||||
} else {
|
||||
// 编辑异常
|
||||
this.abnormals[this.currentAbnormalIndex] = { ...this.abnormalForm };
|
||||
}
|
||||
|
||||
this.abnormalDialogVisible = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 删除异常
|
||||
deleteAbnormal(index) {
|
||||
this.$confirm('确定要删除这个异常信息吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.abnormals.splice(index, 1);
|
||||
});
|
||||
},
|
||||
|
||||
// 获取异常位置文本
|
||||
getAbnormalPositionText(position) {
|
||||
if (!position) return '';
|
||||
const dict = this.dict.type.coil_abnormal_position;
|
||||
if (!dict) return position;
|
||||
const item = dict.find(item => item.value === position);
|
||||
return item ? item.label : position;
|
||||
},
|
||||
|
||||
// 获取异常代码文本
|
||||
getAbnormalCodeText(code) {
|
||||
if (!code) return '';
|
||||
const dict = this.dict.type.coil_abnormal_code;
|
||||
if (!dict) return code;
|
||||
const item = dict.find(item => item.value === code);
|
||||
return item ? item.label : code;
|
||||
}
|
||||
},
|
||||
}
|
||||
@@ -643,4 +792,85 @@ export default {
|
||||
height: 100%;
|
||||
min-height: 400px;
|
||||
}
|
||||
|
||||
.abnormal-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.abnormal-item {
|
||||
width: 120px;
|
||||
height: 80px;
|
||||
background-color: #fff1f0;
|
||||
border: 1px solid #ff4d4f;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
position: relative;
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0 2px 8px rgba(255, 77, 79, 0.2);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.abnormal-content {
|
||||
padding: 8px;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.abnormal-info {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.abnormal-position {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: #ff4d4f;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.abnormal-code {
|
||||
font-size: 11px;
|
||||
color: #666;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.abnormal-delete {
|
||||
position: absolute;
|
||||
top: -8px;
|
||||
right: -8px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.abnormal-add {
|
||||
width: 120px;
|
||||
height: 80px;
|
||||
border: 2px dashed #ff4d4f;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
color: #ff4d4f;
|
||||
font-size: 24px;
|
||||
|
||||
&:hover {
|
||||
background-color: #fff1f0;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
@@ -230,12 +230,59 @@
|
||||
<el-form-item label="备注">
|
||||
<el-input v-model="item.remark" placeholder="请输入备注" :disabled="readonly" />
|
||||
</el-form-item>
|
||||
<el-form-item label="异常信息">
|
||||
<div class="abnormal-container">
|
||||
<div
|
||||
v-for="(abnormal, abnormalIndex) in item.abnormals"
|
||||
:key="abnormalIndex"
|
||||
class="abnormal-item"
|
||||
@click="editAbnormal(index, abnormalIndex)"
|
||||
>
|
||||
<div class="abnormal-content">
|
||||
<div class="abnormal-info">
|
||||
<div class="abnormal-position">{{ getAbnormalPositionText(abnormal.position) }}</div>
|
||||
<div class="abnormal-code">{{ getAbnormalCodeText(abnormal.defectCode) }}</div>
|
||||
</div>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="mini"
|
||||
icon="el-icon-close"
|
||||
class="abnormal-delete"
|
||||
@click.stop="deleteAbnormal(index, abnormalIndex)"
|
||||
></el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="abnormal-add"
|
||||
@click="addAbnormal(index)"
|
||||
>
|
||||
<i class="el-icon-plus"></i>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 异常表单弹窗 -->
|
||||
<el-dialog
|
||||
:title="currentAbnormalIndex === -1 ? '新增异常' : '编辑异常'"
|
||||
:visible.sync="abnormalDialogVisible"
|
||||
width="600px"
|
||||
>
|
||||
<abnormal-form
|
||||
ref="abnormalForm"
|
||||
v-model="abnormalForm"
|
||||
:show-coil-selector="false"
|
||||
></abnormal-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="abnormalDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="saveAbnormal">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -248,6 +295,7 @@ import RawMaterialSelect from "@/components/KLPService/RawMaterialSelect";
|
||||
import ProductSelect from "@/components/KLPService/ProductSelect";
|
||||
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import TimeInput from "@/components/TimeInput";
|
||||
import AbnormalForm from './components/AbnormalForm';
|
||||
import { generateCoilNoPrefix } from "@/utils/coil/coilNo";
|
||||
|
||||
export default {
|
||||
@@ -258,8 +306,9 @@ export default {
|
||||
ProductSelect,
|
||||
WarehouseSelect,
|
||||
TimeInput,
|
||||
AbnormalForm
|
||||
},
|
||||
dicts: ['coil_quality_status'],
|
||||
dicts: ['coil_quality_status', 'coil_abnormal_position', 'coil_abnormal_code', 'coil_abnormal_degree'],
|
||||
data() {
|
||||
const currentCoilNoPrefix = generateCoilNoPrefix()
|
||||
return {
|
||||
@@ -304,6 +353,7 @@ export default {
|
||||
productionEndTime: '',
|
||||
productionDuration: '',
|
||||
formattedDuration: '',
|
||||
abnormals: []
|
||||
}
|
||||
],
|
||||
loading: false,
|
||||
@@ -319,7 +369,24 @@ export default {
|
||||
readonly: false,
|
||||
// 待操作ID
|
||||
actionId: null,
|
||||
currentAction: {}
|
||||
currentAction: {},
|
||||
// 异常表单弹窗
|
||||
abnormalDialogVisible: false,
|
||||
// 当前编辑的子卷索引
|
||||
currentSubCoilIndex: -1,
|
||||
// 当前编辑的异常索引
|
||||
currentAbnormalIndex: -1,
|
||||
// 异常表单数据
|
||||
abnormalForm: {
|
||||
coilId: null,
|
||||
position: null,
|
||||
startPosition: 0,
|
||||
endPosition: 0,
|
||||
length: 0,
|
||||
defectCode: null,
|
||||
degree: null,
|
||||
remark: null
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -502,6 +569,7 @@ export default {
|
||||
productionEndTime: '',
|
||||
productionDuration: '',
|
||||
formattedDuration: '',
|
||||
abnormals: []
|
||||
});
|
||||
},
|
||||
|
||||
@@ -684,6 +752,80 @@ export default {
|
||||
this.$set(item, 'productionDuration', '');
|
||||
this.$set(item, 'formattedDuration', '');
|
||||
}
|
||||
},
|
||||
|
||||
// 新增异常
|
||||
addAbnormal(subCoilIndex) {
|
||||
this.currentSubCoilIndex = subCoilIndex;
|
||||
this.currentAbnormalIndex = -1;
|
||||
this.abnormalForm = {
|
||||
coilId: null,
|
||||
position: null,
|
||||
startPosition: 0,
|
||||
endPosition: 0,
|
||||
length: 0,
|
||||
defectCode: null,
|
||||
degree: null,
|
||||
remark: null
|
||||
};
|
||||
this.abnormalDialogVisible = true;
|
||||
},
|
||||
|
||||
// 编辑异常
|
||||
editAbnormal(subCoilIndex, abnormalIndex) {
|
||||
this.currentSubCoilIndex = subCoilIndex;
|
||||
this.currentAbnormalIndex = abnormalIndex;
|
||||
this.abnormalForm = { ...this.splitList[subCoilIndex].abnormals[abnormalIndex] };
|
||||
this.abnormalDialogVisible = true;
|
||||
},
|
||||
|
||||
// 保存异常
|
||||
saveAbnormal() {
|
||||
this.$refs.abnormalForm.validate(valid => {
|
||||
if (valid) {
|
||||
// 计算缺陷长度
|
||||
this.abnormalForm.length = this.abnormalForm.endPosition - this.abnormalForm.startPosition;
|
||||
|
||||
if (this.currentAbnormalIndex === -1) {
|
||||
// 新增异常
|
||||
this.splitList[this.currentSubCoilIndex].abnormals.push({ ...this.abnormalForm });
|
||||
} else {
|
||||
// 编辑异常
|
||||
this.splitList[this.currentSubCoilIndex].abnormals[this.currentAbnormalIndex] = { ...this.abnormalForm };
|
||||
}
|
||||
|
||||
this.abnormalDialogVisible = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 删除异常
|
||||
deleteAbnormal(subCoilIndex, abnormalIndex) {
|
||||
this.$confirm('确定要删除这个异常信息吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.splitList[subCoilIndex].abnormals.splice(abnormalIndex, 1);
|
||||
});
|
||||
},
|
||||
|
||||
// 获取异常位置文本
|
||||
getAbnormalPositionText(position) {
|
||||
if (!position) return '';
|
||||
const dict = this.dict.type.coil_abnormal_position;
|
||||
if (!dict) return position;
|
||||
const item = dict.find(item => item.value === position);
|
||||
return item ? item.label : position;
|
||||
},
|
||||
|
||||
// 获取异常代码文本
|
||||
getAbnormalCodeText(code) {
|
||||
if (!code) return '';
|
||||
const dict = this.dict.type.coil_abnormal_code;
|
||||
if (!dict) return code;
|
||||
const item = dict.find(item => item.value === code);
|
||||
return item ? item.label : code;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1040,4 +1182,86 @@ export default {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 异常信息样式
|
||||
.abnormal-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.abnormal-item {
|
||||
width: 120px;
|
||||
height: 80px;
|
||||
background-color: #fff1f0;
|
||||
border: 1px solid #ff4d4f;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
position: relative;
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0 2px 8px rgba(255, 77, 79, 0.2);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.abnormal-content {
|
||||
padding: 8px;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.abnormal-info {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.abnormal-position {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: #ff4d4f;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.abnormal-code {
|
||||
font-size: 11px;
|
||||
color: #666;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.abnormal-delete {
|
||||
position: absolute;
|
||||
top: -8px;
|
||||
right: -8px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.abnormal-add {
|
||||
width: 120px;
|
||||
height: 80px;
|
||||
border: 2px dashed #ff4d4f;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
color: #ff4d4f;
|
||||
font-size: 24px;
|
||||
|
||||
&:hover {
|
||||
background-color: #fff1f0;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -208,6 +208,37 @@
|
||||
<el-input v-model="updateForm.remark" type="textarea" :rows="4" placeholder="请输入备注信息(非必填)" maxlength="500"
|
||||
show-word-limit />
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="异常信息">
|
||||
<div class="abnormal-container">
|
||||
<div
|
||||
v-for="(abnormal, index) in abnormals"
|
||||
:key="index"
|
||||
class="abnormal-item"
|
||||
@click="editAbnormal(index)"
|
||||
>
|
||||
<div class="abnormal-content">
|
||||
<div class="abnormal-info">
|
||||
<div class="abnormal-position">{{ getAbnormalPositionText(abnormal.position) }}</div>
|
||||
<div class="abnormal-code">{{ getAbnormalCodeText(abnormal.defectCode) }}</div>
|
||||
</div>
|
||||
<el-button
|
||||
type="danger"
|
||||
size="mini"
|
||||
icon="el-icon-close"
|
||||
class="abnormal-delete"
|
||||
@click.stop="deleteAbnormal(index)"
|
||||
></el-button>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="abnormal-add"
|
||||
@click="addAbnormal"
|
||||
>
|
||||
<i class="el-icon-plus"></i>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
|
||||
@@ -225,16 +256,28 @@
|
||||
{{ scope.row.exitWeight ? scope.row.exitWeight + ' t' : '—' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<!-- <el-table-column prop="exitLength" label="出口长度(m)" width="120">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.exitLength ? scope.row.exitLength + ' m' : '—' }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column prop="team" label="班组" width="80"></el-table-column>
|
||||
</el-table>
|
||||
</el-card>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- 异常表单弹窗 -->
|
||||
<el-dialog
|
||||
:title="currentAbnormalIndex === -1 ? '新增异常' : '编辑异常'"
|
||||
:visible.sync="abnormalDialogVisible"
|
||||
width="600px"
|
||||
>
|
||||
<abnormal-form
|
||||
ref="abnormalForm"
|
||||
v-model="abnormalForm"
|
||||
:show-coil-selector="false"
|
||||
></abnormal-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button @click="abnormalDialogVisible = false">取 消</el-button>
|
||||
<el-button type="primary" @click="saveAbnormal">确 定</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -250,6 +293,7 @@ import RawMaterialSelect from "@/components/KLPService/RawMaterialSelect";
|
||||
import ProductSelect from "@/components/KLPService/ProductSelect";
|
||||
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import TimeInput from "@/components/TimeInput";
|
||||
import AbnormalForm from './components/AbnormalForm';
|
||||
import { generateCoilNoPrefix } from "@/utils/coil/coilNo";
|
||||
|
||||
export default {
|
||||
@@ -260,8 +304,9 @@ export default {
|
||||
ProductSelect,
|
||||
WarehouseSelect,
|
||||
TimeInput,
|
||||
AbnormalForm
|
||||
},
|
||||
dicts: ['coil_quality_status'],
|
||||
dicts: ['coil_quality_status', 'coil_abnormal_position', 'coil_abnormal_code', 'coil_abnormal_degree'],
|
||||
data() {
|
||||
return {
|
||||
loading: false,
|
||||
@@ -378,7 +423,24 @@ export default {
|
||||
productList: [],
|
||||
itemSearchLoading: false,
|
||||
// 酸连轧最近记录
|
||||
acidRecentRecords: []
|
||||
acidRecentRecords: [],
|
||||
// 异常信息
|
||||
abnormals: [],
|
||||
// 异常表单弹窗
|
||||
abnormalDialogVisible: false,
|
||||
// 当前编辑的异常索引
|
||||
currentAbnormalIndex: -1,
|
||||
// 异常表单数据
|
||||
abnormalForm: {
|
||||
coilId: null,
|
||||
position: null,
|
||||
startPosition: 0,
|
||||
endPosition: 0,
|
||||
length: 0,
|
||||
defectCode: null,
|
||||
degree: null,
|
||||
remark: null
|
||||
}
|
||||
};
|
||||
},
|
||||
computed: {
|
||||
@@ -813,6 +875,7 @@ export default {
|
||||
coilId: this.currentInfo.coilId,
|
||||
enterCoilNo: this.currentInfo.enterCoilNo,
|
||||
supplierCoilNo: this.currentInfo.supplierCoilNo,
|
||||
abnormals: this.abnormals,
|
||||
// 注意:不要传newCoils,否则会走批量更新逻辑
|
||||
};
|
||||
|
||||
@@ -890,6 +953,78 @@ export default {
|
||||
// 取消操作
|
||||
handleCancel() {
|
||||
this.$router.back();
|
||||
},
|
||||
|
||||
// 新增异常
|
||||
addAbnormal() {
|
||||
this.currentAbnormalIndex = -1;
|
||||
this.abnormalForm = {
|
||||
coilId: this.currentInfo.coilId,
|
||||
position: null,
|
||||
startPosition: 0,
|
||||
endPosition: 0,
|
||||
length: 0,
|
||||
defectCode: null,
|
||||
degree: null,
|
||||
remark: null
|
||||
};
|
||||
this.abnormalDialogVisible = true;
|
||||
},
|
||||
|
||||
// 编辑异常
|
||||
editAbnormal(index) {
|
||||
this.currentAbnormalIndex = index;
|
||||
this.abnormalForm = { ...this.abnormals[index] };
|
||||
this.abnormalDialogVisible = true;
|
||||
},
|
||||
|
||||
// 保存异常
|
||||
saveAbnormal() {
|
||||
this.$refs.abnormalForm.validate(valid => {
|
||||
if (valid) {
|
||||
// 计算缺陷长度
|
||||
this.abnormalForm.length = this.abnormalForm.endPosition - this.abnormalForm.startPosition;
|
||||
|
||||
if (this.currentAbnormalIndex === -1) {
|
||||
// 新增异常
|
||||
this.abnormals.push({ ...this.abnormalForm });
|
||||
} else {
|
||||
// 编辑异常
|
||||
this.abnormals[this.currentAbnormalIndex] = { ...this.abnormalForm };
|
||||
}
|
||||
|
||||
this.abnormalDialogVisible = false;
|
||||
}
|
||||
});
|
||||
},
|
||||
|
||||
// 删除异常
|
||||
deleteAbnormal(index) {
|
||||
this.$confirm('确定要删除这个异常信息吗?', '提示', {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.abnormals.splice(index, 1);
|
||||
});
|
||||
},
|
||||
|
||||
// 获取异常位置文本
|
||||
getAbnormalPositionText(position) {
|
||||
if (!position) return '';
|
||||
const dict = this.dict.type.coil_abnormal_position;
|
||||
if (!dict) return position;
|
||||
const item = dict.find(item => item.value === position);
|
||||
return item ? item.label : position;
|
||||
},
|
||||
|
||||
// 获取异常代码文本
|
||||
getAbnormalCodeText(code) {
|
||||
if (!code) return '';
|
||||
const dict = this.dict.type.coil_abnormal_code;
|
||||
if (!dict) return code;
|
||||
const item = dict.find(item => item.value === code);
|
||||
return item ? item.label : code;
|
||||
}
|
||||
}
|
||||
};
|
||||
@@ -1116,4 +1251,86 @@ export default {
|
||||
color: #66b1ff;
|
||||
}
|
||||
}
|
||||
|
||||
// 异常信息样式
|
||||
.abnormal-container {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
gap: 10px;
|
||||
margin-top: 5px;
|
||||
}
|
||||
|
||||
.abnormal-item {
|
||||
width: 120px;
|
||||
height: 80px;
|
||||
background-color: #fff1f0;
|
||||
border: 1px solid #ff4d4f;
|
||||
border-radius: 4px;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
position: relative;
|
||||
|
||||
&:hover {
|
||||
box-shadow: 0 2px 8px rgba(255, 77, 79, 0.2);
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
|
||||
.abnormal-content {
|
||||
padding: 8px;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
flex-direction: column;
|
||||
justify-content: space-between;
|
||||
}
|
||||
|
||||
.abnormal-info {
|
||||
flex: 1;
|
||||
}
|
||||
|
||||
.abnormal-position {
|
||||
font-size: 12px;
|
||||
font-weight: 500;
|
||||
color: #ff4d4f;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
|
||||
.abnormal-code {
|
||||
font-size: 11px;
|
||||
color: #666;
|
||||
line-height: 1.3;
|
||||
}
|
||||
|
||||
.abnormal-delete {
|
||||
position: absolute;
|
||||
top: -8px;
|
||||
right: -8px;
|
||||
width: 20px;
|
||||
height: 20px;
|
||||
padding: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
border-radius: 50%;
|
||||
background-color: #fff;
|
||||
}
|
||||
}
|
||||
|
||||
.abnormal-add {
|
||||
width: 120px;
|
||||
height: 80px;
|
||||
border: 2px dashed #ff4d4f;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
transition: all 0.3s ease;
|
||||
color: #ff4d4f;
|
||||
font-size: 24px;
|
||||
|
||||
&:hover {
|
||||
background-color: #fff1f0;
|
||||
transform: translateY(-2px);
|
||||
}
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
<template>
|
||||
<el-tabs class="app-container" v-model="activeTab">
|
||||
<el-tab-pane label="优品卷" name="third">
|
||||
<el-tab-pane label="O卷" name="third">
|
||||
<BasePage :qrcode="qrcode" :querys="querys3" :labelType="labelType" :hideWarehouseQuery="hideWarehouseQuery"
|
||||
:hideType="hideType" />
|
||||
</el-tab-pane>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<coil-selector dialogWidth="1200px" :use-trigger="true" multiple @confirm="handleBatchAdd"
|
||||
:filters="{ selectType: 'product', status: 0, excludeBound: true, orderBy: true }" :orderBy="true">
|
||||
:filters="{ selectType: 'product', status: 0, excludeBound: true, orderBy: true }" :orderBy="true" :disableO="true">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini">批量新增</el-button>
|
||||
</coil-selector>
|
||||
</el-col>
|
||||
@@ -72,7 +72,7 @@
|
||||
<div style="display: flex; gap: 10px;">
|
||||
<coil-selector dialogWidth="1200px" v-model="form.coilId" :use-trigger="true"
|
||||
:filters="{ selectType: 'product', status: 0, excludeBound: true, orderBy: true }" @select="handleSelect"
|
||||
:orderBy="true" />
|
||||
:orderBy="true" :disableO="true"/>
|
||||
<el-checkbox v-model="autoFillForm" label="自动填写表单信息" />
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
@@ -331,7 +331,7 @@ export default {
|
||||
// 2. 循环处理每个时段,逐个发送请求
|
||||
for (let i = 0; i < list.length; i++) {
|
||||
const item = list[i];
|
||||
const approvalType = parseInt(item.leaveDays) > 3 ? 'multi' : 'single';
|
||||
const approvalType = parseInt(item.leaveDays) > 72 ? 'multi' : 'single';
|
||||
const singleRequestData = {
|
||||
...commonFields,
|
||||
startTime: item.startTime,
|
||||
|
||||
@@ -1,22 +1,44 @@
|
||||
<template>
|
||||
<div class="app-container">
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="68px">
|
||||
<el-form-item label="转正时间" prop="changeTime">
|
||||
<el-date-picker clearable v-model="queryParams.changeTime" type="date" value-format="yyyy-MM-dd"
|
||||
placeholder="请选择转正时间">
|
||||
</el-date-picker>
|
||||
<el-form :model="queryParams" ref="queryForm" size="small" :inline="true" v-show="showSearch" label-width="60px">
|
||||
<el-form-item label="部门" prop="deptId">
|
||||
<el-select v-model="queryParams.dept" placeholder="请选择部门" clearable @keyup.enter.native="handleQuery">
|
||||
<el-option v-for="item in deptList" :value="item.deptName" :label="item.deptName" :key="item.deptId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="异动原因" prop="changeReason">
|
||||
<el-input
|
||||
v-model="queryParams.changeReason"
|
||||
placeholder="请输入异动原因"
|
||||
clearable
|
||||
@keyup.enter.native="handleQuery"
|
||||
/>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="负责人" prop="changeHandler">
|
||||
<el-input v-model="queryParams.changeHandler" placeholder="请输入负责人" clearable
|
||||
@keyup.enter.native="handleQuery" />
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入姓名" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="身份证号" prop="idCard">
|
||||
<el-input v-model="queryParams.idCard" placeholder="请输入身份证号" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="年龄" prop="age">
|
||||
<el-input v-model="queryParams.age" placeholder="请输入年龄" clearable @keyup.enter.native="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="性别" prop="gender">
|
||||
<el-select v-model="queryParams.gender" placeholder="请选择性别" clearable @change="handleQuery">
|
||||
<el-option label="男" value="男" />
|
||||
<el-option label="女" value="女" />
|
||||
</el-select>
|
||||
<!-- <el-input v-model="queryParams.gender" placeholder="请输入性别" clearable @keyup.enter.native="handleQuery" /> -->
|
||||
</el-form-item>
|
||||
<el-form-item label="学历" prop="education">
|
||||
<el-select v-model="queryParams.education" placeholder="请选择学历" clearable @change="handleQuery">
|
||||
<el-option v-for="item in dict.type.hrm_employee_education" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="转正情况" prop="isRegular">
|
||||
<el-select v-model="queryParams.isRegular" placeholder="请选择转正情况" clearable @change="handleQuery">
|
||||
<el-option label="已转正" value="1" />
|
||||
<el-option label="未转正" value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="在职情况" prop="isLeave">
|
||||
<el-select v-model="queryParams.isLeave" placeholder="请选择在职情况" clearable @change="handleQuery">
|
||||
<el-option label="已离职" value="1" />
|
||||
<el-option label="在职" value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
@@ -25,9 +47,9 @@
|
||||
</el-form>
|
||||
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="el-icon-edit" size="mini" @click="handleSupplement">转正</el-button>
|
||||
</el-col>
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="el-icon-plus" size="mini" @click="handleAdd">入职</el-button>
|
||||
</el-col> -->
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="el-icon-edit" size="mini" :disabled="single"
|
||||
@click="handleUpdate">修改</el-button>
|
||||
@@ -42,24 +64,48 @@
|
||||
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
|
||||
</el-row>
|
||||
|
||||
<el-table v-loading="loading" :data="employeeEntryList" @selection-change="handleSelectionChange">
|
||||
<el-table v-loading="loading" :data="employeeInfoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<!-- <el-table-column label="异动记录主键ID" align="center" prop="changeId" v-if="true"/> -->
|
||||
<el-table-column label="员工姓名" align="center" prop="wmsEmployeeInfo.name" />
|
||||
<el-table-column label="岗位工种" align="center" prop="wmsEmployeeInfo.jobType" />
|
||||
<el-table-column label="转正时间" align="center" prop="changeTime" width="180">
|
||||
<el-table-column label="主键ID" align="center" prop="infoId" v-if="false" />
|
||||
<el-table-column label="部门" align="center" prop="dept" />
|
||||
<el-table-column label="岗位工种" align="center" prop="jobType" />
|
||||
<el-table-column label="姓名" align="center" prop="name" />
|
||||
<el-table-column label="身份证号" align="center" prop="idCard" />
|
||||
<el-table-column label="年龄" align="center" prop="age" />
|
||||
<el-table-column label="性别" align="center" prop="gender" />
|
||||
<el-table-column label="学历" align="center" prop="education" />
|
||||
<!-- <el-table-column label="家庭住址" align="center" prop="homeAddress" /> -->
|
||||
<el-table-column label="联系电话" align="center" prop="phone" />
|
||||
<el-table-column label="入职时间" align="center" prop="entryTime" width="180">
|
||||
<template slot-scope="scope">
|
||||
<span>{{ parseTime(scope.row.changeTime, '{y}-{m}-{d}') }}</span>
|
||||
<span>{{ parseTime(scope.row.entryTime, '{y}-{m}-{d}') }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="转正原因" align="center" prop="changeReason" />
|
||||
<el-table-column label="负责人" align="center" prop="changeHandler" />
|
||||
<!-- <el-table-column label="附件" align="center" prop="attachment" /> -->
|
||||
<el-table-column label="在职天数" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="getRegularStatus(scope.row.entryTime, scope.row.isRegular).type">
|
||||
{{ getRegularStatus(scope.row.entryTime, scope.row.isRegular).days }}天
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="转正时间" align="center" prop="regularTime" />
|
||||
<el-table-column label="紧急联系人" align="center" prop="emergencyContact" />
|
||||
<el-table-column label="关系" align="center" prop="relationship" />
|
||||
<el-table-column label="紧急联系电话" align="center" prop="emergencyContactPhone" />
|
||||
<el-table-column label="备注" align="center" prop="remark" />
|
||||
<el-table-column label="在职状态" align="center">
|
||||
<template slot-scope="scope">
|
||||
<el-tag :type="scope.row.isLeave === 0 ? 'success' : 'danger'">
|
||||
{{ scope.row.isLeave === 0 ? '在职' : '已离职' }}
|
||||
</el-tag>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" type="text" icon="el-icon-edit" @click="handleUpdate(scope.row)">修改</el-button>
|
||||
<el-button size="mini" type="text" icon="el-icon-delete" @click="handleDelete(scope.row)">删除</el-button>
|
||||
<el-button v-if="scope.row.isLeave === 0 && scope.row.isRegular === 0" size="mini" type="text" icon="el-icon-check"
|
||||
@click="handleResignation(scope.row)">转正</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -67,48 +113,189 @@
|
||||
<pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum" :limit.sync="queryParams.pageSize"
|
||||
@pagination="getList" />
|
||||
|
||||
<!-- 员工转正记录对话框 -->
|
||||
<el-dialog :title="supplementTitle" :visible.sync="supplementOpen" width="500px" append-to-body>
|
||||
<el-form ref="supplementForm" :model="supplementForm" :rules="supplementRules" label-width="80px">
|
||||
<el-form-item label="转正员工" prop="infoId">
|
||||
<EmployeeSelector v-model="supplementForm.infoId" keyField="infoId" placeholder="请选择转正员工" />
|
||||
<!-- 添加或修改员工信息对话框 -->
|
||||
<el-dialog :title="title" :visible.sync="open" width="800px" append-to-body>
|
||||
<el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
||||
<!-- 公司内信息 -->
|
||||
<el-card class="mb-4" shadow="never">
|
||||
<template slot="header">
|
||||
<div class="card-header">
|
||||
<span>在职信息</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="部门" prop="dept">
|
||||
<!-- <el-input v-model="form.dept" placeholder="请输入部门" /> -->
|
||||
<el-select v-model="form.dept" placeholder="请选择部门">
|
||||
<el-option v-for="item in deptList" :value="item.deptName" :label="item.deptName"
|
||||
:key="item.deptId" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="岗位工种" prop="jobType">
|
||||
<el-input v-model="form.jobType" placeholder="请输入岗位工种" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="入职时间" prop="entryTime">
|
||||
<el-date-picker clearable v-model="form.entryTime" type="datetime" value-format="yyyy-MM-dd HH:mm:ss"
|
||||
placeholder="请选择入职时间" style="width: 100%;">
|
||||
</el-date-picker>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.infoRemark" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<!-- 员工个人信息 -->
|
||||
<el-card class="mb-4" shadow="never">
|
||||
<template slot="header">
|
||||
<div class="card-header">
|
||||
<span>员工信息</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="姓名" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入姓名" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="身份证号" prop="idCard">
|
||||
<el-input v-model="form.idCard" placeholder="请输入身份证号" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="年龄" prop="age">
|
||||
<el-input v-model="form.age" placeholder="请输入年龄" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="性别" prop="gender">
|
||||
<!-- <el-input v-model="form.gender" placeholder="请输入性别" /> -->
|
||||
<el-radio-group v-model="form.gender" size="small" mode="button">
|
||||
<el-radio label="男">男</el-radio>
|
||||
<el-radio label="女">女</el-radio>
|
||||
</el-radio-group>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="学历" prop="education">
|
||||
<!-- <el-input v-model="form.education" placeholder="请输入学历" /> -->
|
||||
<el-select v-model="form.education" placeholder="请选择学历">
|
||||
<el-option v-for="item in dict.type.hrm_employee_education" :key="item.value" :label="item.label"
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="联系电话" prop="phone">
|
||||
<el-input v-model="form.phone" placeholder="请输入联系电话" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="家庭住址" prop="homeAddress">
|
||||
<el-input v-model="form.homeAddress" placeholder="请输入家庭住址" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<!-- 紧急联系信息 -->
|
||||
<el-card class="mb-4" shadow="never">
|
||||
<template slot="header">
|
||||
<div class="card-header">
|
||||
<span>紧急联系信息</span>
|
||||
</div>
|
||||
</template>
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="12">
|
||||
<el-form-item label="紧急联系人" prop="emergencyContact">
|
||||
<el-input v-model="form.emergencyContact" placeholder="请输入紧急联系人" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="12">
|
||||
<el-form-item label="关系" prop="relationship">
|
||||
<el-input v-model="form.relationship" placeholder="请输入关系" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24">
|
||||
<el-form-item label="紧急联系电话" prop="emergencyContactPhone">
|
||||
<el-input v-model="form.emergencyContactPhone" placeholder="请输入紧急联系人电话" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
|
||||
<!-- 备注和附件 -->
|
||||
<el-card class="mb-4" shadow="hover">
|
||||
<el-row :gutter="20">
|
||||
<el-col :span="24">
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
<el-col :span="24" v-if="!form.infoId">
|
||||
<el-form-item label="附件" prop="attachment">
|
||||
<file-upload v-model="attachment"></file-upload>
|
||||
</el-form-item>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
|
||||
<!-- 员工转正对话框 -->
|
||||
<el-dialog :title="resignationTitle" :visible.sync="resignationOpen" width="500px" append-to-body>
|
||||
<el-form ref="resignationForm" :model="resignationForm" :rules="resignationRules" label-width="80px">
|
||||
<el-form-item label="员工姓名" prop="name">
|
||||
<el-input v-model="resignationForm.name" disabled />
|
||||
</el-form-item>
|
||||
<!-- <el-form-item label="异动类型" prop="changeType">
|
||||
<el-input v-model="resignationForm.changeType" disabled />
|
||||
</el-form-item> -->
|
||||
<el-form-item label="转正时间" prop="changeTime">
|
||||
<el-date-picker clearable v-model="supplementForm.changeTime" type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择转正时间">
|
||||
</el-date-picker>
|
||||
<el-date-picker clearable v-model="resignationForm.changeTime" type="datetime"
|
||||
value-format="yyyy-MM-dd HH:mm:ss" placeholder="请选择转正时间" />
|
||||
</el-form-item>
|
||||
<el-form-item label="转正原因" prop="changeReason">
|
||||
<el-input v-model="supplementForm.changeReason" placeholder="请输入转正原因" />
|
||||
<el-form-item label="转正原因" prop="changeReason" required>
|
||||
<el-input v-model="resignationForm.changeReason" type="textarea" placeholder="请输入转正原因" />
|
||||
</el-form-item>
|
||||
<el-form-item label="负责人" prop="changeHandler">
|
||||
<el-input v-model="supplementForm.changeHandler" placeholder="请输入负责人" disabled />
|
||||
<el-input v-model="resignationForm.changeHandler" disabled />
|
||||
</el-form-item>
|
||||
<el-form-item label="附件" prop="attachment">
|
||||
<file-upload v-model="supplementAttachment" />
|
||||
<file-upload v-model="resignationAttachment"></file-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="supplementForm.remark" placeholder="请输入备注" />
|
||||
<el-input v-model="resignationForm.remark" type="textarea" placeholder="请输入备注" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<div slot="footer" class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitSupplementForm">确 定</el-button>
|
||||
<el-button @click="cancelSupplement">取 消</el-button>
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitResignation">确 定</el-button>
|
||||
<el-button @click="cancelResignation">取 消</el-button>
|
||||
</div>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import { listEmployeeChange, getEmployeeChange, delEmployeeChange, updateEmployeeChange, employeeRegular } from "@/api/wms/employeeChange";
|
||||
import { listEmployeeInfo, getEmployeeInfo, delEmployeeInfo, updateEmployeeInfo } from "@/api/wms/employeeInfo";
|
||||
import { listDept } from "@/api/wms/dept";
|
||||
import EmployeeSelector from "@/components/EmployeeSelector";
|
||||
import { employeeEntry, employeeLeave, employeeRegular } from '@/api/wms/employeeChange'
|
||||
|
||||
export default {
|
||||
name: "employeeRegular",
|
||||
components: {
|
||||
EmployeeSelector
|
||||
},
|
||||
name: "EmployeeInfo",
|
||||
data() {
|
||||
return {
|
||||
// 按钮loading
|
||||
@@ -125,8 +312,8 @@ export default {
|
||||
showSearch: true,
|
||||
// 总条数
|
||||
total: 0,
|
||||
// 员工转正表格数据
|
||||
employeeEntryList: [],
|
||||
// 员工信息表格数据
|
||||
employeeInfoList: [],
|
||||
// 弹出层标题
|
||||
title: "",
|
||||
// 是否显示弹出层
|
||||
@@ -135,12 +322,13 @@ export default {
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
infoId: undefined,
|
||||
changeType: 2,
|
||||
changeTime: undefined,
|
||||
changeReason: undefined,
|
||||
changeHandler: undefined,
|
||||
attachment: undefined,
|
||||
dept: undefined,
|
||||
jobType: undefined,
|
||||
name: undefined,
|
||||
idCard: undefined,
|
||||
age: undefined,
|
||||
gender: undefined,
|
||||
education: undefined,
|
||||
},
|
||||
// 表单参数
|
||||
form: {},
|
||||
@@ -151,22 +339,28 @@ export default {
|
||||
attachment: undefined,
|
||||
// 部门列表
|
||||
deptList: [],
|
||||
// 补录对话框相关
|
||||
supplementTitle: "补录员工转正记录",
|
||||
supplementOpen: false,
|
||||
supplementForm: {
|
||||
changeId: undefined,
|
||||
// 转正对话框相关
|
||||
resignationTitle: "员工转正",
|
||||
resignationOpen: false,
|
||||
resignationForm: {
|
||||
infoId: undefined,
|
||||
changeType: 2,
|
||||
name: undefined,
|
||||
changeType: "2",
|
||||
changeTime: undefined,
|
||||
changeReason: undefined,
|
||||
changeHandler: undefined,
|
||||
attachment: undefined,
|
||||
remark: undefined
|
||||
},
|
||||
supplementRules: {
|
||||
resignationRules: {
|
||||
changeTime: [
|
||||
{
|
||||
required: true,
|
||||
message: "请选择转正时间",
|
||||
trigger: "change"
|
||||
}
|
||||
],
|
||||
},
|
||||
supplementAttachment: undefined
|
||||
resignationAttachment: undefined
|
||||
};
|
||||
},
|
||||
dicts: ['hrm_employee_education'],
|
||||
@@ -175,11 +369,11 @@ export default {
|
||||
this.getDeptList();
|
||||
},
|
||||
methods: {
|
||||
/** 查询员工转正记录列表 */
|
||||
/** 查询员工信息列表 */
|
||||
getList() {
|
||||
this.loading = true;
|
||||
listEmployeeChange(this.queryParams).then(response => {
|
||||
this.employeeEntryList = response.rows;
|
||||
listEmployeeInfo(this.queryParams).then(response => {
|
||||
this.employeeInfoList = response.rows;
|
||||
this.total = response.total;
|
||||
this.loading = false;
|
||||
});
|
||||
@@ -194,11 +388,6 @@ export default {
|
||||
this.open = false;
|
||||
this.reset();
|
||||
},
|
||||
// 取消补录按钮操作
|
||||
cancelSupplement() {
|
||||
this.supplementOpen = false;
|
||||
this.resetSupplementForm();
|
||||
},
|
||||
// 表单重置
|
||||
reset() {
|
||||
this.form = {
|
||||
@@ -222,26 +411,9 @@ export default {
|
||||
updateBy: undefined,
|
||||
updateTime: undefined,
|
||||
delFlag: undefined,
|
||||
remark: undefined,
|
||||
infoRemark: undefined
|
||||
};
|
||||
this.attachment = undefined;
|
||||
this.resetForm("form");
|
||||
},
|
||||
// 补录表单重置
|
||||
resetSupplementForm() {
|
||||
this.supplementForm = {
|
||||
changeId: undefined,
|
||||
infoId: undefined,
|
||||
changeType: 2,
|
||||
changeTime: undefined,
|
||||
changeReason: undefined,
|
||||
changeHandler: undefined,
|
||||
attachment: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
this.supplementAttachment = undefined;
|
||||
this.resetForm("supplementForm");
|
||||
this.resetForm("form");
|
||||
},
|
||||
/** 搜索按钮操作 */
|
||||
handleQuery() {
|
||||
@@ -255,62 +427,51 @@ export default {
|
||||
},
|
||||
// 多选框选中数据
|
||||
handleSelectionChange(selection) {
|
||||
this.ids = selection.map(item => item.changeId)
|
||||
this.ids = selection.map(item => item.infoId)
|
||||
this.single = selection.length !== 1
|
||||
this.multiple = !selection.length
|
||||
},
|
||||
/** 新增按钮操作 */
|
||||
handleAdd() {
|
||||
this.reset();
|
||||
this.form.changeHandler = this.$store.getters.nickName;
|
||||
this.open = true;
|
||||
this.title = "员工转正";
|
||||
this.title = "员工入职";
|
||||
},
|
||||
/** 修改按钮操作 */
|
||||
handleUpdate(row) {
|
||||
this.loading = true;
|
||||
this.resetSupplementForm();
|
||||
const changeId = row.changeId || this.ids
|
||||
getEmployeeChange(changeId).then(response => {
|
||||
this.reset();
|
||||
const infoId = row.infoId || this.ids
|
||||
getEmployeeInfo(infoId).then(response => {
|
||||
this.loading = false;
|
||||
this.supplementForm = response.data;
|
||||
this.supplementAttachment = response.data.attachment;
|
||||
this.supplementOpen = true;
|
||||
this.supplementTitle = "修改员工转正记录";
|
||||
this.form = response.data;
|
||||
this.open = true;
|
||||
this.title = "修改员工信息";
|
||||
});
|
||||
},
|
||||
/** 补录按钮操作 */
|
||||
handleSupplement() {
|
||||
this.resetSupplementForm();
|
||||
this.supplementForm.changeHandler = this.$store.getters.nickName;
|
||||
this.supplementOpen = true;
|
||||
this.supplementTitle = "补录员工转正记录";
|
||||
},
|
||||
/** 提交补录表单 */
|
||||
submitSupplementForm() {
|
||||
this.$refs["supplementForm"].validate(valid => {
|
||||
/** 提交按钮 */
|
||||
submitForm() {
|
||||
this.$refs["form"].validate(valid => {
|
||||
if (valid) {
|
||||
this.buttonLoading = true;
|
||||
if (this.supplementForm.changeId != null) {
|
||||
updateEmployeeChange(this.supplementForm).then(response => {
|
||||
if (this.form.infoId != null) {
|
||||
updateEmployeeInfo(this.form).then(response => {
|
||||
this.$modal.msgSuccess("修改成功");
|
||||
this.supplementOpen = false;
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
} else {
|
||||
employeeRegular({
|
||||
changeType: 2,
|
||||
infoId: this.supplementForm.infoId,
|
||||
changeTime: this.supplementForm.changeTime,
|
||||
changeHandler: this.supplementForm.changeHandler,
|
||||
changeReason: this.supplementForm.changeReason,
|
||||
attachment: this.supplementAttachment,
|
||||
remark: this.supplementForm.remark
|
||||
employeeEntry({
|
||||
changeType: 0,
|
||||
changeTime: this.form.entryTime,
|
||||
changeHandler: this.$store.getters.nickName,
|
||||
attachment: this.attachment,
|
||||
...this.form
|
||||
}).then(response => {
|
||||
this.$modal.msgSuccess("员工转正记录补录成功");
|
||||
this.supplementOpen = false;
|
||||
this.$modal.msgSuccess("员工入职成功");
|
||||
this.open = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
@@ -321,10 +482,10 @@ export default {
|
||||
},
|
||||
/** 删除按钮操作 */
|
||||
handleDelete(row) {
|
||||
const changeIds = row.changeId || this.ids;
|
||||
this.$modal.confirm('是否确认删除员工转正记录编号为"' + changeIds + '"的数据项?').then(() => {
|
||||
const infoIds = row.infoId || this.ids;
|
||||
this.$modal.confirm('是否确认删除员工信息编号为"' + infoIds + '"的数据项?').then(() => {
|
||||
this.loading = true;
|
||||
return delEmployeeChange(changeIds);
|
||||
return delEmployeeInfo(infoIds);
|
||||
}).then(() => {
|
||||
this.loading = false;
|
||||
this.getList();
|
||||
@@ -336,9 +497,98 @@ export default {
|
||||
},
|
||||
/** 导出按钮操作 */
|
||||
handleExport() {
|
||||
this.download('system/employeeChange/export', {
|
||||
this.download('wms/employeeInfo/export', {
|
||||
...this.queryParams
|
||||
}, `employeeChange_${new Date().getTime()}.xlsx`)
|
||||
}, `employeeInfo_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
/** 转正按钮操作 */
|
||||
handleResignation(row) {
|
||||
// 获取北京时间(UTC+8)
|
||||
const now = new Date();
|
||||
const formattedDate = this.parseTime(now, '{y}-{m}-{d} {h}:{i}:{s}')
|
||||
|
||||
this.resignationForm = {
|
||||
infoId: row.infoId,
|
||||
name: row.name,
|
||||
changeType: "2",
|
||||
changeTime: formattedDate,
|
||||
changeReason: undefined,
|
||||
changeHandler: this.$store.getters.nickName,
|
||||
remark: undefined
|
||||
};
|
||||
this.resignationAttachment = undefined;
|
||||
this.resignationOpen = true;
|
||||
},
|
||||
/** 取消转正按钮操作 */
|
||||
cancelResignation() {
|
||||
this.resignationOpen = false;
|
||||
this.resignationForm = {
|
||||
infoId: undefined,
|
||||
name: undefined,
|
||||
changeType: "2",
|
||||
changeTime: undefined,
|
||||
changeReason: undefined,
|
||||
changeHandler: undefined,
|
||||
remark: undefined
|
||||
};
|
||||
this.resignationAttachment = undefined;
|
||||
this.resetForm("resignationForm");
|
||||
},
|
||||
/** 提交转正表单 */
|
||||
submitResignation() {
|
||||
this.$refs["resignationForm"].validate(valid => {
|
||||
if (valid) {
|
||||
this.$modal.confirm('是否确认提交员工转正申请?').then(() => {
|
||||
this.buttonLoading = true;
|
||||
employeeRegular({
|
||||
changeType: 2,
|
||||
changeTime: this.resignationForm.changeTime,
|
||||
changeReason: this.resignationForm.changeReason,
|
||||
changeHandler: this.resignationForm.changeHandler,
|
||||
attachment: this.resignationAttachment,
|
||||
remark: this.resignationForm.remark,
|
||||
infoId: this.resignationForm.infoId
|
||||
}).then(response => {
|
||||
this.$modal.msgSuccess("员工转正成功");
|
||||
this.resignationOpen = false;
|
||||
this.getList();
|
||||
}).finally(() => {
|
||||
this.buttonLoading = false;
|
||||
});
|
||||
});
|
||||
}
|
||||
});
|
||||
},
|
||||
/** 计算入职天数和转正状态 */
|
||||
getRegularStatus(entryTime, isRegular) {
|
||||
if (!entryTime) return { days: 0, type: '', status: 0 };
|
||||
|
||||
const entryDate = new Date(entryTime);
|
||||
const now = new Date();
|
||||
const diffTime = now - entryDate;
|
||||
const diffDays = Math.floor(diffTime / (1000 * 60 * 60 * 24));
|
||||
|
||||
let type = '';
|
||||
let status = isRegular || 0;
|
||||
|
||||
if (status === 0) {
|
||||
// 未转正
|
||||
if (diffDays < 60) {
|
||||
// 2个月内未转正
|
||||
type = 'warning';
|
||||
} else if (diffDays < 90) {
|
||||
// 3个月内未转正
|
||||
type = 'info';
|
||||
} else if (diffDays >= 90) {
|
||||
// 3个月以上未转正
|
||||
type = 'warning';
|
||||
}
|
||||
} else {
|
||||
// 已转正
|
||||
type = 'success';
|
||||
}
|
||||
|
||||
return { days: diffDays, type, status };
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
@@ -28,6 +28,18 @@
|
||||
:value="item.value" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="转正情况" prop="isRegular">
|
||||
<el-select v-model="queryParams.isRegular" placeholder="请选择转正情况" clearable @change="handleQuery">
|
||||
<el-option label="已转正" value="1" />
|
||||
<el-option label="未转正" value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="在职情况" prop="isLeave">
|
||||
<el-select v-model="queryParams.isLeave" placeholder="请选择在职情况" clearable @change="handleQuery">
|
||||
<el-option label="已离职" value="1" />
|
||||
<el-option label="在职" value="0" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
|
||||
|
||||
@@ -126,24 +126,26 @@
|
||||
>
|
||||
详情
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.taskStatus === 'pending'"
|
||||
size="small"
|
||||
icon="el-icon-check"
|
||||
@click="handleApprove(scope.row)"
|
||||
:loading="buttonLoading"
|
||||
>
|
||||
同意
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.taskStatus === 'pending'"
|
||||
size="small"
|
||||
icon="el-icon-close"
|
||||
@click="handleReject(scope.row)"
|
||||
:loading="buttonLoading"
|
||||
>
|
||||
驳回
|
||||
</el-button>
|
||||
<template v-if="scope.row.applyType !== 'seal'">
|
||||
<el-button
|
||||
v-if="scope.row.taskStatus === 'pending'"
|
||||
size="small"
|
||||
icon="el-icon-check"
|
||||
@click="handleApprove(scope.row)"
|
||||
:loading="buttonLoading"
|
||||
>
|
||||
同意
|
||||
</el-button>
|
||||
<el-button
|
||||
v-if="scope.row.taskStatus === 'pending'"
|
||||
size="small"
|
||||
icon="el-icon-close"
|
||||
@click="handleReject(scope.row)"
|
||||
:loading="buttonLoading"
|
||||
>
|
||||
驳回
|
||||
</el-button>
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -274,7 +276,8 @@ export default {
|
||||
applyType: item.approval.applyType,
|
||||
approverName: item.approval.approverName,
|
||||
taskId: item.task.taskId,
|
||||
...item.detail, // 合并请假/外出的详情字段
|
||||
bizId: item.approval.applyId,
|
||||
...item.detail,
|
||||
}
|
||||
})
|
||||
this.total = res.total
|
||||
@@ -323,7 +326,13 @@ export default {
|
||||
|
||||
// 查看详情
|
||||
handleDetail(row) {
|
||||
this.currentDetail = { ...row } // 深拷贝避免原数据被修改
|
||||
if (row.applyType === 'seal') {
|
||||
this.$router.push({
|
||||
path: `/wms/seal/sealDetail/${row.bizId}`
|
||||
})
|
||||
return
|
||||
}
|
||||
this.currentDetail = { ...row }
|
||||
this.detailDialogVisible = true
|
||||
},
|
||||
|
||||
@@ -427,6 +436,7 @@ export default {
|
||||
const textMap = {
|
||||
'leave': '请假',
|
||||
'out': '外出',
|
||||
'seal': '用印',
|
||||
}
|
||||
return textMap[type] || '未知类型'
|
||||
},
|
||||
|
||||
97
klp-ui/src/views/wms/report/components/coilTable/index.vue
Normal file
97
klp-ui/src/views/wms/report/components/coilTable/index.vue
Normal file
@@ -0,0 +1,97 @@
|
||||
<template>
|
||||
<div class="coil-table">
|
||||
<!-- 其他props -->
|
||||
<el-table :data="tableData" style="width: 100%" height="calc(100vh - 320px)" border>
|
||||
<el-table-column v-for="column in columns" :key="column.prop" :prop="column.prop" :label="column.title" :width="column.width" :align="column.align">
|
||||
<template slot-scope="scope">
|
||||
<!-- 特殊 prop 渲染逻辑 -->
|
||||
<template v-if="column.prop === 'enterCoilNo'">
|
||||
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
|
||||
</template>
|
||||
<template v-else-if="column.prop === 'currentCoilNo'">
|
||||
<current-coil-no :current-coil-no="scope.row.currentCoilNo"></current-coil-no>
|
||||
</template>
|
||||
<template v-else-if="column.prop === 'itemId'">
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
|
||||
</template>
|
||||
<template v-else-if="column.prop === 'status'">
|
||||
{{ scope.row.status === 0 ? '在库' : '已出库' }}
|
||||
</template>
|
||||
<!-- 默认渲染 -->
|
||||
<template v-else>
|
||||
{{ scope.row[column.prop] }}
|
||||
</template>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-pagination
|
||||
v-if="showPagination"
|
||||
layout="total, sizes, prev, pager, next, jumper"
|
||||
:total="total"
|
||||
:page-size.sync="pageSize"
|
||||
@size-change="handleSizeChange"
|
||||
@current-change="handleCurrentChange"
|
||||
/>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
import ProductInfo from "@/components/KLPService/Renderer/ProductInfo";
|
||||
import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo";
|
||||
import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue";
|
||||
|
||||
export default {
|
||||
name: 'CoilTable',
|
||||
components: {
|
||||
ProductInfo,
|
||||
RawMaterialInfo,
|
||||
CoilNo,
|
||||
},
|
||||
props: {
|
||||
columns: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
data: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
pageNum: 1,
|
||||
pageSize: 1000,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 内部实现前端分页逻辑
|
||||
tableData() {
|
||||
return this.data.slice((this.pageNum - 1) * this.pageSize, this.pageNum * this.pageSize)
|
||||
},
|
||||
// 计算总页数
|
||||
totalPage() {
|
||||
return Math.ceil(this.data.length / this.pageSize)
|
||||
},
|
||||
// 计算总条数
|
||||
total() {
|
||||
return this.data.length
|
||||
},
|
||||
// 是否展示分页组件
|
||||
showPagination() {
|
||||
return this.totalPage > 1
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 分页大小改变时触发
|
||||
handleSizeChange(val) {
|
||||
this.pageSize = val
|
||||
this.pageNum = 1
|
||||
},
|
||||
// 分页当前页改变时触发
|
||||
handleCurrentChange(val) {
|
||||
this.pageNum = val
|
||||
},
|
||||
}
|
||||
}
|
||||
</script>
|
||||
275
klp-ui/src/views/wms/report/components/setting/columns.vue
Normal file
275
klp-ui/src/views/wms/report/components/setting/columns.vue
Normal file
@@ -0,0 +1,275 @@
|
||||
<template>
|
||||
<div>
|
||||
<el-table :data="displayColumns" style="width: 100%" border row-key="prop" height="400">
|
||||
<el-table-column label="操作" width="180">
|
||||
<template slot-scope="scope">
|
||||
<el-button size="mini" @click="moveUp(scope.$index)" :disabled="scope.$index === 0 || scope.row._isEmpty">上移</el-button>
|
||||
<el-button size="mini" @click="moveDown(scope.$index)"
|
||||
:disabled="scope.$index === displayColumns.length - 1 || scope.row._isEmpty">下移</el-button>
|
||||
<el-button size="mini" type="danger" @click="removeColumn(scope.$index)" :disabled="scope.row._isEmpty">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="prop" label="字段名称">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.prop" filterable @change="(value) => propChange(value, scope.row)" size="small">
|
||||
<el-option v-for="item in optionalProps" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="title" label="表头名称">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.title" @blur="saveColumns" size="small" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="width" label="宽度(不填则均分剩余宽度)">
|
||||
<template slot-scope="scope">
|
||||
<el-input v-model="scope.row.width" @blur="saveColumns" size="small" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column prop="align" label="对齐方式">
|
||||
<template slot-scope="scope">
|
||||
<el-select v-model="scope.row.align" @change="saveColumns" size="small">
|
||||
<el-option label="左对齐" value="left" />
|
||||
<el-option label="居中" value="center" />
|
||||
<el-option label="右对齐" value="right" />
|
||||
</el-select>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
export default {
|
||||
name: "ColumnsSetting",
|
||||
props: {
|
||||
// 拼接key
|
||||
reportType: {
|
||||
type: String,
|
||||
default: 'coil-report-loss',
|
||||
},
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
storageKey: 'preference-tableColumns',
|
||||
columns: [
|
||||
{
|
||||
title: "入场钢卷号",
|
||||
prop: "enterCoilNo",
|
||||
width: "100",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "当前钢卷号",
|
||||
prop: "currentCoilNo",
|
||||
width: "100",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "操作完成时间",
|
||||
prop: "actionCompleteTime",
|
||||
width: "100",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "生产开始时间",
|
||||
prop: "productionStartTime",
|
||||
width: "100",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "生产结束时间",
|
||||
prop: "productionEndTime",
|
||||
width: "100",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "逻辑库区",
|
||||
prop: "warehouseName",
|
||||
width: "100",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "产品类型",
|
||||
prop: "itemId",
|
||||
width: "100",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "宽度",
|
||||
prop: "computedWidth",
|
||||
width: "100",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "厚度",
|
||||
prop: "computedThickness",
|
||||
width: "100",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "重量",
|
||||
prop: "netWeight",
|
||||
width: "100",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "长度",
|
||||
prop: "length",
|
||||
width: "100",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "生产线速度",
|
||||
prop: "productionSpeed",
|
||||
width: "100",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "备注",
|
||||
prop: "remark",
|
||||
width: "100",
|
||||
align: "center",
|
||||
},
|
||||
],
|
||||
// 可选的prop
|
||||
optionalProps: [
|
||||
{ label: '入场钢卷号', value: 'enterCoilNo' },
|
||||
{ label: '当前钢卷号', value: 'currentCoilNo' },
|
||||
{ label: '逻辑库区', value: 'warehouseName' },
|
||||
{ label: '实际库区', value: 'actualWarehouseName' },
|
||||
{ label: '产品类型', value: 'itemId' },
|
||||
{ label: '品名', value: 'itemName' },
|
||||
{ label: '宽度', value: 'computedWidth' },
|
||||
{ label: '厚度', value: 'computedThickness' },
|
||||
{ label: '规格', value: 'specification' },
|
||||
{ label: '材质', value: 'material' },
|
||||
{ label: '厂家', value: 'manufacturer' },
|
||||
{ label: '表面处理', value: 'surfaceTreatmentDesc' },
|
||||
{ label: '镀层质量', value: 'zincLayer' },
|
||||
{ label: '长度', value: 'length' },
|
||||
{ label: '毛重', value: 'grossWeight' },
|
||||
{ label: '净重', value: 'netWeight' },
|
||||
{ label: '创建时间', value: 'createTime' },
|
||||
{ label: '创建人', value: 'createBy' },
|
||||
{ label: '更新时间', value: 'updateTime' },
|
||||
{ label: '更新人', value: 'updateByName' },
|
||||
{ label: '备注', value: 'remark' },
|
||||
{ label: '生产开始时间', value: 'productionStartTime' },
|
||||
{ label: '生产结束时间', value: 'productionEndTime' },
|
||||
{ label: '生产耗时', value: 'productionDuration' },
|
||||
{ label: '出库状态', value: 'status' },
|
||||
{ label: '操作完成时间', value: 'actionCompleteTime' },
|
||||
{ label: "生产线速度", value: "productionSpeed" },
|
||||
{ label: '发货绑定车牌号', value: 'bindLicensePlate' },
|
||||
{ label: '发货绑定目标客户', value: 'bindConsigneeUnit' },
|
||||
{ label: '发货绑定单位', value: 'bindSenderUnit' },
|
||||
{ label: '发货绑定负责人', value: 'bindPrincipal' },
|
||||
{ label: '发货时间', value: 'exportTime' },
|
||||
],
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
reportType: {
|
||||
handler(newVal, oldVal) {
|
||||
this.loadColumns()
|
||||
},
|
||||
immediate: true
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
// 完整的storageKey
|
||||
completeStorageKey() {
|
||||
return this.storageKey + '-' + this.reportType
|
||||
},
|
||||
// 显示的列数据
|
||||
displayColumns() {
|
||||
// 复制原始列数据
|
||||
const displayData = [...this.columns]
|
||||
// 添加一个空行
|
||||
displayData.push({
|
||||
title: "",
|
||||
prop: "",
|
||||
width: "100",
|
||||
align: "center",
|
||||
_isEmpty: true
|
||||
})
|
||||
return displayData
|
||||
}
|
||||
},
|
||||
mounted() {
|
||||
this.loadColumns()
|
||||
// this.$nextTick(() => {
|
||||
// this.initDragSort()
|
||||
// })
|
||||
},
|
||||
methods: {
|
||||
moveUp(index) {
|
||||
if (index > 0 && !this.displayColumns[index]._isEmpty) {
|
||||
const temp = this.columns[index]
|
||||
this.columns.splice(index, 1)
|
||||
this.columns.splice(index - 1, 0, temp)
|
||||
this.saveColumns()
|
||||
}
|
||||
},
|
||||
moveDown(index) {
|
||||
if (index < this.columns.length - 1 && !this.displayColumns[index]._isEmpty) {
|
||||
const temp = this.columns[index]
|
||||
this.columns.splice(index, 1)
|
||||
this.columns.splice(index + 1, 0, temp)
|
||||
this.saveColumns()
|
||||
}
|
||||
},
|
||||
removeColumn(index) {
|
||||
if (!this.displayColumns[index]._isEmpty) {
|
||||
this.columns.splice(index, 1)
|
||||
this.saveColumns()
|
||||
}
|
||||
},
|
||||
saveColumns() {
|
||||
// 只存储非空行
|
||||
const nonEmptyColumns = this.columns.filter(col => col.prop && col.title)
|
||||
localStorage.setItem(this.completeStorageKey, JSON.stringify(nonEmptyColumns))
|
||||
},
|
||||
propChange(propValue, row) {
|
||||
// 查找对应的label
|
||||
const item = this.optionalProps.find(item => item.value === propValue)
|
||||
if (item) {
|
||||
row.title = item.label
|
||||
} else {
|
||||
row.title = propValue
|
||||
}
|
||||
|
||||
// 如果是空行且已经填写了prop,则添加到实际列中
|
||||
if (row._isEmpty && propValue) {
|
||||
const newColumn = {
|
||||
title: row.title,
|
||||
prop: row.prop,
|
||||
width: row.width,
|
||||
align: row.align
|
||||
}
|
||||
this.columns.push(newColumn)
|
||||
this.saveColumns()
|
||||
} else {
|
||||
this.saveColumns()
|
||||
}
|
||||
},
|
||||
loadColumns() {
|
||||
const savedColumns = localStorage.getItem(this.completeStorageKey)
|
||||
if (savedColumns) {
|
||||
this.columns = JSON.parse(savedColumns)
|
||||
}
|
||||
},
|
||||
},
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped>
|
||||
.el-table {
|
||||
margin-top: 20px;
|
||||
}
|
||||
|
||||
.el-table__row {
|
||||
cursor: move;
|
||||
}
|
||||
</style>
|
||||
@@ -41,6 +41,7 @@
|
||||
<el-form-item prop="endTime">
|
||||
<el-button type="primary" @click="getList">查询</el-button>
|
||||
<el-button type="primary" @click="exportData">导出</el-button>
|
||||
<el-button type="primary" @click="settingVisible = true">列设置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
@@ -53,57 +54,14 @@
|
||||
|
||||
<el-descriptions title="明细信息" :column="3" border>
|
||||
</el-descriptions>
|
||||
<el-table :data="list" border height="calc(100vh - 320px)">
|
||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.currentCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<!-- <el-table-column label="逻辑库位" align="center" prop="warehouseName" /> -->
|
||||
<!-- <el-table-column label="实际库区" align="center" prop="actualWarehouseName" /> -->
|
||||
<el-table-column label="产品类型" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="宽度(米)" align="center" prop="computedWidth" width="70" />
|
||||
<el-table-column label="厚度(米)" align="center" prop="computedThickness" width="70"/>
|
||||
<el-table-column label="重量(吨)" align="center" prop="netWeight" />
|
||||
<el-table-column label="长度(米)" align="center" prop="length" />
|
||||
<!-- <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip /> -->
|
||||
<el-table-column label="发货时间" align="center" prop="exportTime" />
|
||||
<!-- <el-table-column label="出库状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status === 0 ? '在库' : '已出库' }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<coil-table :columns="deliveryColumns" :data="list"></coil-table>
|
||||
|
||||
<el-table-column label="更新人" align="center" prop="updateByName" />
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" />
|
||||
<el-table-column label="车牌号" align="center" prop="bindLicensePlate" />
|
||||
<el-table-column label="目标客户" align="center" prop="bindConsigneeUnit" />
|
||||
<el-table-column label="发货单位" align="center" prop="bindSenderUnit" />
|
||||
<el-table-column label="负责人" align="center" prop="bindPrincipal">
|
||||
<template slot-scope="scope">
|
||||
<el-popover trigger="hover" width="200">
|
||||
<template slot="reference">
|
||||
<span style="color: #409eff;">{{ scope.row.bindPrincipal }}</span>
|
||||
</template>
|
||||
<el-descriptions :column="2">
|
||||
<el-descriptions-item label="负责人">{{ scope.row.bindPrincipal }}</el-descriptions-item>
|
||||
<el-descriptions-item label="手机号">{{ scope.row.bindPrincipalPhone }}</el-descriptions-item>
|
||||
</el-descriptions>
|
||||
</el-popover>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
<el-dialog title="列设置" :visible.sync="settingVisible" width="50%">
|
||||
<el-radio-group v-model="activeColumnConfig">
|
||||
<el-radio-button label="coil-report-delivery">发货明细配置</el-radio-button>
|
||||
</el-radio-group>
|
||||
<columns-setting :reportType="activeColumnConfig"></columns-setting>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -115,6 +73,8 @@ import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue";
|
||||
import MemoInput from "@/components/MemoInput";
|
||||
import MutiSelect from "@/components/MutiSelect";
|
||||
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -123,7 +83,9 @@ export default {
|
||||
CoilNo,
|
||||
MemoInput,
|
||||
MutiSelect,
|
||||
WarehouseSelect
|
||||
WarehouseSelect,
|
||||
ColumnsSetting,
|
||||
CoilTable,
|
||||
},
|
||||
dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'],
|
||||
data() {
|
||||
@@ -149,6 +111,8 @@ export default {
|
||||
const startTime = `${yesYear}-${yesMonth}-${yesDay} 07:00:00`
|
||||
const endTime = `${nowYear}-${nowMonth}-${nowDay} 07:00:00`
|
||||
return {
|
||||
activeColumnConfig: 'coil-report-delivery',
|
||||
settingVisible: false,
|
||||
list: [],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@@ -168,6 +132,8 @@ export default {
|
||||
includeBindInfo: true,
|
||||
},
|
||||
loading: false,
|
||||
|
||||
deliveryColumns: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -184,6 +150,14 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 加载列设置
|
||||
loadColumns() {
|
||||
this.deliveryColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-delivery') || '[]') || []
|
||||
},
|
||||
// 统一查询入口
|
||||
handleQuery() {
|
||||
this.getList()
|
||||
},
|
||||
getList() {
|
||||
this.loading = true
|
||||
listCoilWithIds({
|
||||
@@ -212,6 +186,7 @@ export default {
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
this.loadColumns()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
293
klp-ui/src/views/wms/report/js/column.js
Normal file
293
klp-ui/src/views/wms/report/js/column.js
Normal file
@@ -0,0 +1,293 @@
|
||||
const defaultColumns = {
|
||||
// 消耗报表明细表格
|
||||
"coil-report-loss": [
|
||||
{
|
||||
title: "入场钢卷号",
|
||||
prop: "enterCoilNo",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "当前钢卷号",
|
||||
prop: "currentCoilNo",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "操作完成时间",
|
||||
prop: "actionCompleteTime",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "生产开始时间",
|
||||
prop: "productionStartTime",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "生产结束时间",
|
||||
prop: "productionEndTime",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "逻辑库区",
|
||||
prop: "warehouseName",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "产品类型",
|
||||
prop: "itemId",
|
||||
width: "150",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "宽度",
|
||||
prop: "computedWidth",
|
||||
width: "70",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "厚度",
|
||||
prop: "computedThickness",
|
||||
width: "70",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "重量",
|
||||
prop: "netWeight",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "长度",
|
||||
prop: "length",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "生产线速度",
|
||||
prop: "productionSpeed",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "备注",
|
||||
prop: "remark",
|
||||
align: "center",
|
||||
},
|
||||
],
|
||||
// 产出报表明细表格
|
||||
"coil-report-output": [
|
||||
{
|
||||
title: "入场钢卷号",
|
||||
prop: "enterCoilNo",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "当前钢卷号",
|
||||
prop: "currentCoilNo",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "生产时间",
|
||||
prop: "createTime",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "逻辑库区",
|
||||
prop: "warehouseName",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "产品类型",
|
||||
prop: "itemId",
|
||||
width: "150",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "宽度",
|
||||
prop: "computedWidth",
|
||||
width: "70",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "厚度",
|
||||
prop: "computedThickness",
|
||||
width: "70",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "重量",
|
||||
prop: "netWeight",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "长度",
|
||||
prop: "length",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "在库状态",
|
||||
prop: "status",
|
||||
align: "center",
|
||||
},
|
||||
],
|
||||
// 收货明细表格
|
||||
"coil-report-receive": [
|
||||
{
|
||||
title: "入场钢卷号",
|
||||
prop: "enterCoilNo",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "当前钢卷号",
|
||||
prop: "currentCoilNo",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "生产时间",
|
||||
prop: "createTime",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "逻辑库区",
|
||||
prop: "warehouseName",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "产品类型",
|
||||
prop: "itemId",
|
||||
width: "150",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "宽度",
|
||||
prop: "computedWidth",
|
||||
width: "70",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "厚度",
|
||||
prop: "computedThickness",
|
||||
width: "70",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "重量",
|
||||
prop: "netWeight",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "长度",
|
||||
prop: "length",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "在库状态",
|
||||
prop: "status",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "更新人",
|
||||
prop: "updateByName",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "更新时间",
|
||||
prop: "updateTime",
|
||||
align: "center",
|
||||
},
|
||||
],
|
||||
// 发货明细表格
|
||||
"coil-report-delivery": [
|
||||
{
|
||||
title: "入场钢卷号",
|
||||
prop: "enterCoilNo",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "当前钢卷号",
|
||||
prop: "currentCoilNo",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "逻辑库区",
|
||||
prop: "warehouseName",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "产品类型",
|
||||
prop: "itemId",
|
||||
width: "150",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "宽度",
|
||||
prop: "computedWidth",
|
||||
width: "70",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "厚度",
|
||||
prop: "computedThickness",
|
||||
width: "70",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "重量",
|
||||
prop: "netWeight",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "长度",
|
||||
prop: "length",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "在库状态",
|
||||
prop: "status",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "发货时间",
|
||||
prop: "exportTime",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "车牌号",
|
||||
prop: "bindLicensePlate",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "目标客户",
|
||||
prop: "bindConsigneeUnit",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "发货单位",
|
||||
prop: "bindSenderUnit",
|
||||
align: "center",
|
||||
},
|
||||
{
|
||||
title: "发货负责人",
|
||||
prop: "bindPrincipal",
|
||||
align: "center",
|
||||
},
|
||||
]
|
||||
}
|
||||
|
||||
export const initColumns = (key) => {
|
||||
// 如果没有存储,初始化默认列
|
||||
if (!localStorage.getItem('preference-tableColumns-' + key)) {
|
||||
localStorage.setItem('preference-tableColumns-' + key, JSON.stringify(defaultColumns[key]))
|
||||
}
|
||||
}
|
||||
|
||||
export const resetColumns = (key) => {
|
||||
localStorage.removeItem('preference-tableColumns-' + key)
|
||||
initColumns(key)
|
||||
}
|
||||
|
||||
export const initAllColumns = () => {
|
||||
Object.keys(defaultColumns).forEach(key => initColumns(key))
|
||||
}
|
||||
|
||||
export const resetAllColumns = () => {
|
||||
Object.keys(defaultColumns).forEach(key => resetColumns(key))
|
||||
}
|
||||
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
<el-button type="primary" @click="getList">查询</el-button>
|
||||
<el-button type="primary" @click="exportData">导出产出钢卷</el-button>
|
||||
<el-button type="primary" @click="exportLossData">导出消耗钢卷</el-button>
|
||||
<el-button type="primary" @click="settingVisible = true">列设置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
@@ -66,72 +67,20 @@
|
||||
</el-descriptions>
|
||||
<el-tabs v-model="activeTab">
|
||||
<el-tab-pane label="投入钢卷" name="loss">
|
||||
<el-table :data="lossList" border height="calc(100vh - 320px)">
|
||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.currentCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="逻辑库位" align="center" prop="warehouseName" />
|
||||
<!-- <el-table-column label="实际库区" align="center" prop="actualWarehouseName" /> -->
|
||||
<el-table-column label="产品类型" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="宽度(米)" align="center" prop="computedWidth" width="70" />
|
||||
<el-table-column label="厚度(米)" align="center" prop="computedThickness" width="70" />
|
||||
<el-table-column label="重量 (吨)" align="center" prop="netWeight" />
|
||||
<el-table-column label="长度 (米)" align="center" prop="length" />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="更新人" align="center" prop="updateByName" />
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" />
|
||||
</el-table>
|
||||
<coil-table :data="lossList" :columns="lossColumns" :loading="loading" height="calc(100vh - 360px)" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="产出钢卷" name="output">
|
||||
<el-table :data="outList" border height="calc(100vh - 320px)">
|
||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.currentCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="逻辑库位" align="center" prop="warehouseName" />
|
||||
<el-table-column label="实际库区" align="center" prop="actualWarehouseName" />
|
||||
<el-table-column label="产品类型" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="宽度(米)" align="center" prop="computedWidth" width="70" />
|
||||
<el-table-column label="厚度(米)" align="center" prop="computedThickness" width="70" />
|
||||
<el-table-column label="重量 (吨)" align="center" prop="netWeight" />
|
||||
<el-table-column label="长度 (米)" align="center" prop="length" />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="出库状态" align="center" prop="status">
|
||||
<!-- 0在库,1已出库 -->
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status === 0 ? '在库' : '已出库' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新人" align="center" prop="updateByName" />
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" />
|
||||
</el-table>
|
||||
<coil-table :data="outList" :columns="outputColumns" :loading="loading" height="calc(100vh - 360px)" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<el-dialog title="列设置" :visible.sync="settingVisible" width="50%">
|
||||
<el-radio-group v-model="activeColumnConfig">
|
||||
<el-radio-button label="coil-report-loss">投入明细配置</el-radio-button>
|
||||
<el-radio-button label="coil-report-output">产出明细配置</el-radio-button>
|
||||
</el-radio-group>
|
||||
<columns-setting :reportType="activeColumnConfig"></columns-setting>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -146,6 +95,8 @@ import ProductInfo from "@/components/KLPService/Renderer/ProductInfo";
|
||||
import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo";
|
||||
import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue";
|
||||
import { calcSummary } from "@/views/wms/report/js/calc";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable";
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns";
|
||||
|
||||
export default {
|
||||
name: 'MergeTemplate',
|
||||
@@ -161,6 +112,8 @@ export default {
|
||||
ProductInfo,
|
||||
RawMaterialInfo,
|
||||
CoilNo,
|
||||
CoilTable,
|
||||
ColumnsSetting
|
||||
},
|
||||
dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'],
|
||||
data() {
|
||||
@@ -214,6 +167,8 @@ export default {
|
||||
lossList: [],
|
||||
outList: [],
|
||||
activeTab: 'loss',
|
||||
activeColumnConfig: 'coil-report-loss',
|
||||
settingVisible: false,
|
||||
loading: false,
|
||||
queryParams: {
|
||||
startTime: start,
|
||||
@@ -227,7 +182,9 @@ export default {
|
||||
itemManufacturer: '',
|
||||
pageSize: 9999,
|
||||
pageNum: 1,
|
||||
}
|
||||
},
|
||||
lossColumns: [],
|
||||
outputColumns: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -237,6 +194,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.handleQuery()
|
||||
this.loadColumns()
|
||||
},
|
||||
methods: {
|
||||
handleQuery() {
|
||||
@@ -271,8 +229,24 @@ export default {
|
||||
listCoilWithIds({ ...this.queryParams, coilIds: lossIds.join(',') || '' }),
|
||||
listCoilWithIds({ ...this.queryParams, coilIds: outIds.join(',') || '' }),
|
||||
]);
|
||||
this.lossList = lossRes.rows;
|
||||
this.outList = outRes.rows;
|
||||
this.lossList = lossRes.rows.map(item => {
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
const [thickness, width] = item.specification.split('*')
|
||||
return {
|
||||
...item,
|
||||
computedThickness: parseFloat(thickness),
|
||||
computedWidth: parseFloat(width),
|
||||
}
|
||||
});
|
||||
this.outList = outRes.rows.map(item => {
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
const [thickness, width] = item.specification.split('*')
|
||||
return {
|
||||
...item,
|
||||
computedThickness: parseFloat(thickness),
|
||||
computedWidth: parseFloat(width),
|
||||
}
|
||||
});
|
||||
this.loading = false;
|
||||
},
|
||||
// 导出
|
||||
@@ -294,6 +268,11 @@ export default {
|
||||
coilIds: this.lossList.map(item => item.coilId).join(',')
|
||||
}, `materialCoil_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
// 加载列设置
|
||||
loadColumns() {
|
||||
this.lossColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-loss') || '[]') || []
|
||||
this.outputColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-output') || '[]') || []
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -48,6 +48,7 @@
|
||||
<el-form-item prop="endTime">
|
||||
<el-button type="primary" @click="getList">查询</el-button>
|
||||
<el-button type="primary" @click="exportData">导出</el-button>
|
||||
<el-button type="primary" @click="settingVisible = true">列设置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
@@ -60,40 +61,14 @@
|
||||
|
||||
<el-descriptions title="明细信息" :column="3" border>
|
||||
</el-descriptions>
|
||||
<el-table :data="list" border height="calc(100vh - 320px)">
|
||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.currentCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="逻辑库位" align="center" prop="warehouseName" />
|
||||
<el-table-column label="实际库区" align="center" prop="actualWarehouseName" />
|
||||
<el-table-column label="产品类型" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="宽度(米)" align="center" prop="computedWidth" width="70" />
|
||||
<el-table-column label="厚度(米)" align="center" prop="computedThickness" width="70"/>
|
||||
<el-table-column label="重量 (吨)" align="center" prop="netWeight" />
|
||||
<el-table-column label="长度 (米)" align="center" prop="length" />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="出库状态" align="center" prop="status">
|
||||
<!-- 0在库,1已出库 -->
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status === 0 ? '在库' : '已出库' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新人" align="center" prop="updateByName" />
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" />
|
||||
</el-table>
|
||||
<coil-table :columns="receiveColumns" :data="list"></coil-table>
|
||||
|
||||
<el-dialog title="列设置" :visible.sync="settingVisible" width="50%">
|
||||
<el-radio-group v-model="activeColumnConfig">
|
||||
<el-radio-button label="coil-report-receive">收货明细配置</el-radio-button>
|
||||
</el-radio-group>
|
||||
<columns-setting :reportType="activeColumnConfig"></columns-setting>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -109,6 +84,8 @@ import MemoInput from "@/components/MemoInput";
|
||||
import MutiSelect from "@/components/MutiSelect";
|
||||
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import { listDeliveryPlan } from '@/api/wms/deliveryPlan'
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
|
||||
|
||||
export default {
|
||||
components: {
|
||||
@@ -118,6 +95,8 @@ export default {
|
||||
MemoInput,
|
||||
MutiSelect,
|
||||
WarehouseSelect,
|
||||
ColumnsSetting,
|
||||
CoilTable,
|
||||
},
|
||||
dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'],
|
||||
data() {
|
||||
@@ -143,6 +122,8 @@ export default {
|
||||
const startTime = `${yesYear}-${yesMonth}-${yesDay} 07:00:00`
|
||||
const endTime = `${nowYear}-${nowMonth}-${nowDay} 07:00:00`
|
||||
return {
|
||||
activeColumnConfig: 'coil-report-receive',
|
||||
settingVisible: false,
|
||||
list: [],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@@ -162,6 +143,8 @@ export default {
|
||||
},
|
||||
planList: [],
|
||||
loading: false,
|
||||
|
||||
receiveColumns: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -178,6 +161,14 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 加载列设置
|
||||
loadColumns() {
|
||||
this.receiveColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-receive') || '[]') || []
|
||||
},
|
||||
// 统一查询入口
|
||||
handleQuery() {
|
||||
this.getList()
|
||||
},
|
||||
remoteMethod(query) {
|
||||
listDeliveryPlan({ planName: query, pageNum: 1, pageSize: 5, planType: 1 }).then(res => {
|
||||
this.planList = res.rows
|
||||
@@ -233,6 +224,7 @@ export default {
|
||||
mounted() {
|
||||
this.getList()
|
||||
this.remoteMethod('')
|
||||
this.loadColumns()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
<el-button type="primary" @click="handleQuery">查询</el-button> <!-- 统一改为handleQuery -->
|
||||
<el-button type="primary" @click="exportData">导出产出钢卷</el-button>
|
||||
<el-button type="primary" @click="exportLossData">导出消耗钢卷</el-button>
|
||||
<el-button type="primary" @click="settingVisible = true">列设置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
@@ -73,73 +74,20 @@
|
||||
</el-descriptions>
|
||||
<el-tabs v-model="activeTab">
|
||||
<el-tab-pane label="投入钢卷" name="loss">
|
||||
<el-table :data="lossList" border height="calc(100vh - 320px)">
|
||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.currentCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="逻辑库位" align="center" prop="warehouseName" />
|
||||
<!-- <el-table-column label="实际库区" align="center" prop="actualWarehouseName" /> -->
|
||||
<el-table-column label="产品类型" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="宽度(米)" align="center" prop="computedWidth" width="70" />
|
||||
<el-table-column label="厚度(米)" align="center" prop="computedThickness" width="70" />
|
||||
<el-table-column label="重量 (吨)" align="center" prop="netWeight" />
|
||||
<el-table-column label="长度 (米)" align="center" prop="length" />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="更新人" align="center" prop="updateByName" />
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" />
|
||||
</el-table>
|
||||
<coil-table :columns="lossColumns" :data="lossList"></coil-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="产出钢卷" name="output">
|
||||
<el-table :data="list" border height="calc(100vh - 320px)">
|
||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.currentCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="逻辑库位" align="center" prop="warehouseName" />
|
||||
<el-table-column label="实际库区" align="center" prop="actualWarehouseName" />
|
||||
<el-table-column label="产品类型" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="宽度(米)" align="center" prop="computedWidth" width="70" />
|
||||
<el-table-column label="厚度(米)" align="center" prop="computedThickness" width="70" />
|
||||
<el-table-column label="重量 (吨)" align="center" prop="netWeight" />
|
||||
<el-table-column label="长度 (米)" align="center" prop="length" />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="出库状态" align="center" prop="status">
|
||||
<!-- 0在库,1已出库 -->
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status === 0 ? '在库' : '已出库' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新人" align="center" prop="updateByName" />
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" />
|
||||
</el-table>
|
||||
<coil-table :columns="outputColumns" :data="list"></coil-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<el-dialog title="列设置" :visible.sync="settingVisible" width="50%">
|
||||
<el-radio-group v-model="activeColumnConfig">
|
||||
<el-radio-button label="coil-report-loss">投入明细配置</el-radio-button>
|
||||
<el-radio-button label="coil-report-output">产出明细配置</el-radio-button>
|
||||
</el-radio-group>
|
||||
<columns-setting :reportType="activeColumnConfig"></columns-setting>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -155,6 +103,8 @@ import MemoInput from "@/components/MemoInput";
|
||||
import MutiSelect from "@/components/MutiSelect";
|
||||
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import { calcSummary, calcAbSummary } from "@/views/wms/report/js/calc";
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
|
||||
|
||||
export default {
|
||||
name: 'DayTemplate',
|
||||
@@ -165,6 +115,8 @@ export default {
|
||||
MemoInput,
|
||||
MutiSelect,
|
||||
WarehouseSelect,
|
||||
ColumnsSetting,
|
||||
CoilTable,
|
||||
},
|
||||
props: {
|
||||
actionTypes: {
|
||||
@@ -205,6 +157,8 @@ export default {
|
||||
|
||||
return {
|
||||
activeTab: 'loss',
|
||||
activeColumnConfig: 'coil-report-loss',
|
||||
settingVisible: false,
|
||||
list: [],
|
||||
lossList: [],
|
||||
queryParams: {
|
||||
@@ -233,7 +187,10 @@ export default {
|
||||
'2019583429955104769',
|
||||
'2019583137616310273',
|
||||
],
|
||||
getDayTimeRange // 挂载时间范围生成函数
|
||||
getDayTimeRange, // 挂载时间范围生成函数
|
||||
|
||||
lossColumns: [],
|
||||
outputColumns: [],
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -255,6 +212,11 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 加载列设置
|
||||
loadColumns() {
|
||||
this.lossColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-loss') || '[]') || []
|
||||
this.outputColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-output') || '[]') || []
|
||||
},
|
||||
// 日期变更处理:更新开始/结束时间
|
||||
handleDateChange(date) {
|
||||
if (!date) return
|
||||
@@ -372,6 +334,7 @@ export default {
|
||||
mounted() {
|
||||
this.getList()
|
||||
this.getLossList()
|
||||
this.loadColumns()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -47,6 +47,7 @@
|
||||
<el-form-item prop="endTime">
|
||||
<el-button type="primary" @click="getList">查询</el-button>
|
||||
<el-button type="primary" @click="exportData">导出</el-button>
|
||||
<el-button type="primary" @click="settingVisible = true">列设置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
@@ -59,39 +60,14 @@
|
||||
|
||||
<el-descriptions title="明细信息" :column="3" border>
|
||||
</el-descriptions>
|
||||
<el-table :data="list" border height="calc(100vh - 320px)">
|
||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.currentCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="逻辑库位" align="center" prop="warehouseName" />
|
||||
<!-- <el-table-column label="实际库区" align="center" prop="actualWarehouseName" /> -->
|
||||
<el-table-column label="产品类型" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="宽度(米)" align="center" prop="computedWidth" width="70" />
|
||||
<el-table-column label="厚度(米)" align="center" prop="computedThickness" width="70"/>
|
||||
<el-table-column label="重量 (吨)" align="center" prop="netWeight" />
|
||||
<el-table-column label="长度 (米)" align="center" prop="length" />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<!-- <el-table-column label="出库状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status === 0 ? '在库' : '已出库' }}
|
||||
</template>
|
||||
</el-table-column> -->
|
||||
<el-table-column label="更新人" align="center" prop="updateByName" />
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" />
|
||||
</el-table>
|
||||
<coil-table :columns="lossColumns" :data="list"></coil-table>
|
||||
|
||||
<el-dialog title="列设置" :visible.sync="settingVisible" width="50%">
|
||||
<el-radio-group v-model="activeColumnConfig">
|
||||
<el-radio-button label="coil-report-loss">消耗明细配置</el-radio-button>
|
||||
</el-radio-group>
|
||||
<columns-setting :reportType="activeColumnConfig"></columns-setting>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -107,6 +83,8 @@ import MemoInput from "@/components/MemoInput";
|
||||
import MutiSelect from "@/components/MutiSelect";
|
||||
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import { listDeliveryPlan } from '@/api/wms/deliveryPlan'
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
|
||||
|
||||
export default {
|
||||
name: 'LossTemplate',
|
||||
@@ -117,6 +95,8 @@ export default {
|
||||
MemoInput,
|
||||
MutiSelect,
|
||||
WarehouseSelect,
|
||||
ColumnsSetting,
|
||||
CoilTable,
|
||||
},
|
||||
props: {
|
||||
actionTypes: {
|
||||
@@ -152,6 +132,8 @@ export default {
|
||||
const startTime = `${yesYear}-${yesMonth}-${yesDay} 07:00:00`
|
||||
const endTime = `${nowYear}-${nowMonth}-${nowDay} 07:00:00`
|
||||
return {
|
||||
activeColumnConfig: 'coil-report-loss',
|
||||
settingVisible: false,
|
||||
list: [],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@@ -171,6 +153,8 @@ export default {
|
||||
},
|
||||
planList: [],
|
||||
loading: false,
|
||||
|
||||
lossColumns: [],
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -187,6 +171,14 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 加载列设置
|
||||
loadColumns() {
|
||||
this.lossColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-loss') || '[]') || []
|
||||
},
|
||||
// 统一查询入口
|
||||
handleQuery() {
|
||||
this.getList()
|
||||
},
|
||||
remoteMethod(query) {
|
||||
listDeliveryPlan({ planName: query, pageNum: 1, pageSize: 5, planType: 1 }).then(res => {
|
||||
this.planList = res.rows
|
||||
@@ -207,8 +199,8 @@ export default {
|
||||
})
|
||||
}))
|
||||
const actions = resultList.flatMap(item => item.rows)
|
||||
const coilIds = actions.map(item => item.coilId).join(',')
|
||||
if (!coilIds) {
|
||||
const actionIds = actions.map(item => item.actionId).join(',')
|
||||
if (!actionIds) {
|
||||
this.$message({
|
||||
message: '暂无数据',
|
||||
type: 'warning',
|
||||
@@ -217,15 +209,26 @@ export default {
|
||||
this.loading = false
|
||||
return
|
||||
}
|
||||
// const coilIds = actions.map(item => item.coilId).join(',')
|
||||
// if (!coilIds) {
|
||||
// this.$message({
|
||||
// message: '暂无数据',
|
||||
// type: 'warning',
|
||||
// })
|
||||
// this.list = []
|
||||
// this.loading = false
|
||||
// return
|
||||
// }
|
||||
listCoilWithIds({
|
||||
...this.queryParams,
|
||||
byCreateTimeStart: undefined,
|
||||
byCreateTimeEnd: undefined,
|
||||
coilIds: coilIds,
|
||||
actionIds: actionIds,
|
||||
// coilIds: coilIds,
|
||||
}).then(res => {
|
||||
this.list = res.rows.map(item => {
|
||||
// 计算宽度和厚度,将规格按照*分割,*前的是厚度,*后的是宽度
|
||||
const [thickness, width] = item.specification.split('*')
|
||||
const [thickness, width] = item.specification?.split('*') || [undefined, undefined]
|
||||
return {
|
||||
...item,
|
||||
computedThickness: parseFloat(thickness),
|
||||
@@ -245,6 +248,7 @@ export default {
|
||||
mounted() {
|
||||
this.getList()
|
||||
this.remoteMethod('')
|
||||
this.loadColumns()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -38,6 +38,7 @@
|
||||
<el-button type="primary" @click="getList">查询</el-button>
|
||||
<el-button type="primary" @click="exportData">导出产出钢卷</el-button>
|
||||
<el-button type="primary" @click="exportLossData">导出消耗钢卷</el-button>
|
||||
<el-button type="primary" @click="settingVisible = true">列设置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
@@ -66,72 +67,20 @@
|
||||
</el-descriptions>
|
||||
<el-tabs v-model="activeTab">
|
||||
<el-tab-pane label="投入钢卷" name="loss">
|
||||
<el-table :data="lossList" border height="calc(100vh - 320px)">
|
||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.currentCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="逻辑库位" align="center" prop="warehouseName" />
|
||||
<!-- <el-table-column label="实际库区" align="center" prop="actualWarehouseName" /> -->
|
||||
<el-table-column label="产品类型" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="宽度(米)" align="center" prop="computedWidth" width="70" />
|
||||
<el-table-column label="厚度(米)" align="center" prop="computedThickness" width="70" />
|
||||
<el-table-column label="重量 (吨)" align="center" prop="netWeight" />
|
||||
<el-table-column label="长度 (米)" align="center" prop="length" />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="更新人" align="center" prop="updateByName" />
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" />
|
||||
</el-table>
|
||||
<coil-table :data="lossList" :columns="lossColumns" :loading="loading" height="calc(100vh - 360px)" />
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="产出钢卷" name="output">
|
||||
<el-table :data="outList" border height="calc(100vh - 320px)">
|
||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.currentCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="逻辑库位" align="center" prop="warehouseName" />
|
||||
<el-table-column label="实际库区" align="center" prop="actualWarehouseName" />
|
||||
<el-table-column label="产品类型" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="宽度(米)" align="center" prop="computedWidth" width="70" />
|
||||
<el-table-column label="厚度(米)" align="center" prop="computedThickness" width="70" />
|
||||
<el-table-column label="重量 (吨)" align="center" prop="netWeight" />
|
||||
<el-table-column label="长度 (米)" align="center" prop="length" />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="出库状态" align="center" prop="status">
|
||||
<!-- 0在库,1已出库 -->
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status === 0 ? '在库' : '已出库' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新人" align="center" prop="updateByName" />
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" />
|
||||
</el-table>
|
||||
<coil-table :data="outList" :columns="outputColumns" :loading="loading" height="calc(100vh - 360px)" />
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<el-dialog title="列设置" :visible.sync="settingVisible" width="50%">
|
||||
<el-radio-group v-model="activeColumnConfig">
|
||||
<el-radio-button label="coil-report-loss">投入明细配置</el-radio-button>
|
||||
<el-radio-button label="coil-report-output">产出明细配置</el-radio-button>
|
||||
</el-radio-group>
|
||||
<columns-setting :reportType="activeColumnConfig"></columns-setting>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -146,6 +95,8 @@ import ProductInfo from "@/components/KLPService/Renderer/ProductInfo";
|
||||
import RawMaterialInfo from "@/components/KLPService/Renderer/RawMaterialInfo";
|
||||
import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue";
|
||||
import { calcSummary } from "@/views/wms/report/js/calc";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable";
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns";
|
||||
|
||||
export default {
|
||||
name: 'MergeTemplate',
|
||||
@@ -161,6 +112,8 @@ export default {
|
||||
ProductInfo,
|
||||
RawMaterialInfo,
|
||||
CoilNo,
|
||||
CoilTable,
|
||||
ColumnsSetting
|
||||
},
|
||||
dicts: ['product_coil_status', 'coil_material', 'coil_itemname', 'coil_manufacturer'],
|
||||
data() {
|
||||
@@ -214,6 +167,8 @@ export default {
|
||||
lossList: [],
|
||||
outList: [],
|
||||
activeTab: 'loss',
|
||||
activeColumnConfig: 'coil-report-loss',
|
||||
settingVisible: false,
|
||||
loading: false,
|
||||
queryParams: {
|
||||
startTime: start,
|
||||
@@ -227,7 +182,9 @@ export default {
|
||||
itemManufacturer: '',
|
||||
pageSize: 9999,
|
||||
pageNum: 1,
|
||||
}
|
||||
},
|
||||
lossColumns: [],
|
||||
outColumns: []
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
@@ -237,6 +194,7 @@ export default {
|
||||
},
|
||||
created() {
|
||||
this.handleQuery()
|
||||
this.loadColumns()
|
||||
},
|
||||
methods: {
|
||||
handleQuery() {
|
||||
@@ -302,6 +260,11 @@ export default {
|
||||
coilIds: this.lossList.map(item => item.coilId).join(',')
|
||||
}, `materialCoil_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
// 加载列设置
|
||||
loadColumns() {
|
||||
this.lossColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-loss') || '[]') || []
|
||||
this.outputColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-output') || '[]') || []
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
<el-button type="primary" @click="handleQuery">查询</el-button>
|
||||
<el-button type="primary" @click="exportData">导出产出钢卷</el-button>
|
||||
<el-button type="primary" @click="exportLossData">导出消耗钢卷</el-button>
|
||||
<el-button type="primary" @click="settingVisible = true">列设置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
@@ -73,73 +74,20 @@
|
||||
</el-descriptions>
|
||||
<el-tabs v-model="activeTab">
|
||||
<el-tab-pane label="投入钢卷" name="loss">
|
||||
<el-table :data="lossList" border height="calc(100vh - 320px)">
|
||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.currentCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="逻辑库位" align="center" prop="warehouseName" />
|
||||
<!-- <el-table-column label="实际库区" align="center" prop="actualWarehouseName" /> -->
|
||||
<el-table-column label="产品类型" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="宽度(米)" align="center" prop="computedWidth" width="70" />
|
||||
<el-table-column label="厚度(米)" align="center" prop="computedThickness" width="70" />
|
||||
<el-table-column label="重量 (吨)" align="center" prop="netWeight" />
|
||||
<el-table-column label="长度 (米)" align="center" prop="length" />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="更新人" align="center" prop="updateByName" />
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" />
|
||||
</el-table>
|
||||
<coil-table :columns="lossColumns" :data="lossList"></coil-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="产出钢卷" name="output">
|
||||
<el-table :data="list" border height="calc(100vh - 320px)">
|
||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.currentCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="逻辑库位" align="center" prop="warehouseName" />
|
||||
<el-table-column label="实际库区" align="center" prop="actualWarehouseName" />
|
||||
<el-table-column label="产品类型" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="宽度(米)" align="center" prop="computedWidth" width="70" />
|
||||
<el-table-column label="厚度(米)" align="center" prop="computedThickness" width="70" />
|
||||
<el-table-column label="重量 (吨)" align="center" prop="netWeight" />
|
||||
<el-table-column label="长度 (米)" align="center" prop="length" />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="出库状态" align="center" prop="status">
|
||||
<!-- 0在库,1已出库 -->
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status === 0 ? '在库' : '已出库' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新人" align="center" prop="updateByName" />
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" />
|
||||
</el-table>
|
||||
<coil-table :columns="outputColumns" :data="list"></coil-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<el-dialog title="列设置" :visible.sync="settingVisible" width="50%">
|
||||
<el-radio-group v-model="activeColumnConfig">
|
||||
<el-radio-button label="coil-report-loss">投入明细配置</el-radio-button>
|
||||
<el-radio-button label="coil-report-output">产出明细配置</el-radio-button>
|
||||
</el-radio-group>
|
||||
<columns-setting :reportType="activeColumnConfig"></columns-setting>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -155,6 +103,8 @@ import MemoInput from "@/components/MemoInput";
|
||||
import MutiSelect from "@/components/MutiSelect";
|
||||
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import { calcSummary, calcAbSummary } from "@/views/wms/report/js/calc";
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
|
||||
|
||||
export default {
|
||||
name: 'MonthTemplate',
|
||||
@@ -165,6 +115,8 @@ export default {
|
||||
MemoInput,
|
||||
MutiSelect,
|
||||
WarehouseSelect,
|
||||
ColumnsSetting,
|
||||
CoilTable,
|
||||
},
|
||||
props: {
|
||||
actionTypes: {
|
||||
@@ -235,6 +187,8 @@ export default {
|
||||
|
||||
return {
|
||||
activeTab: 'loss',
|
||||
activeColumnConfig: 'coil-report-loss',
|
||||
settingVisible: false,
|
||||
list: [],
|
||||
lossList: [],
|
||||
queryParams: {
|
||||
@@ -263,7 +217,10 @@ export default {
|
||||
'2019583429955104769',
|
||||
'2019583137616310273',
|
||||
],
|
||||
getDayTimeRange // 挂载时间范围生成函数
|
||||
getDayTimeRange, // 挂载时间范围生成函数
|
||||
|
||||
lossColumns: [],
|
||||
outputColumns: [],
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -285,6 +242,11 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 加载列设置
|
||||
loadColumns() {
|
||||
this.lossColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-loss') || '[]') || []
|
||||
this.outputColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-output') || '[]') || []
|
||||
},
|
||||
// 日期变更处理:更新开始/结束时间
|
||||
handleDateChange(date) {
|
||||
if (!date) return
|
||||
@@ -402,6 +364,7 @@ export default {
|
||||
mounted() {
|
||||
this.getList()
|
||||
this.getLossList()
|
||||
this.loadColumns()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -44,6 +44,7 @@
|
||||
<el-form-item prop="endTime">
|
||||
<el-button type="primary" @click="getList">查询</el-button>
|
||||
<el-button type="primary" @click="exportData">导出</el-button>
|
||||
<el-button type="primary" @click="settingVisible = true">列设置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
@@ -56,40 +57,14 @@
|
||||
|
||||
<el-descriptions title="明细信息" :column="3" border>
|
||||
</el-descriptions>
|
||||
<el-table :data="list" border height="calc(100vh - 320px)">
|
||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.currentCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="逻辑库位" align="center" prop="warehouseName" />
|
||||
<el-table-column label="实际库区" align="center" prop="actualWarehouseName" />
|
||||
<el-table-column label="产品类型" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="宽度(米)" align="center" prop="computedWidth" width="70" />
|
||||
<el-table-column label="厚度(米)" align="center" prop="computedThickness" width="70" />
|
||||
<el-table-column label="重量 (吨)" align="center" prop="netWeight" />
|
||||
<el-table-column label="长度 (米)" align="center" prop="length" />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="出库状态" align="center" prop="status">
|
||||
<!-- 0在库,1已出库 -->
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status === 0 ? '在库' : '已出库' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新人" align="center" prop="updateByName" />
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" />
|
||||
</el-table>
|
||||
<coil-table :columns="outputColumns" :data="list"></coil-table>
|
||||
|
||||
<el-dialog title="列设置" :visible.sync="settingVisible" width="50%">
|
||||
<el-radio-group v-model="activeColumnConfig">
|
||||
<el-radio-button label="coil-report-output">产出明细配置</el-radio-button>
|
||||
</el-radio-group>
|
||||
<columns-setting :reportType="activeColumnConfig"></columns-setting>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -101,7 +76,8 @@ import CoilNo from "@/components/KLPService/Renderer/CoilNo.vue";
|
||||
import MemoInput from "@/components/MemoInput";
|
||||
import MutiSelect from "@/components/MutiSelect";
|
||||
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
|
||||
|
||||
export default {
|
||||
name: 'OutTemplate',
|
||||
@@ -112,6 +88,8 @@ export default {
|
||||
MemoInput,
|
||||
MutiSelect,
|
||||
WarehouseSelect,
|
||||
ColumnsSetting,
|
||||
CoilTable,
|
||||
},
|
||||
props: {
|
||||
baseQueryParams: {
|
||||
@@ -147,6 +125,8 @@ export default {
|
||||
const startTime = `${yesYear}-${yesMonth}-${yesDay} 07:00:00`
|
||||
const endTime = `${nowYear}-${nowMonth}-${nowDay} 07:00:00`
|
||||
return {
|
||||
activeColumnConfig: 'coil-report-output',
|
||||
settingVisible: false,
|
||||
list: [],
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
@@ -173,6 +153,8 @@ export default {
|
||||
'2019583429955104769',
|
||||
'2019583137616310273',
|
||||
],
|
||||
|
||||
outputColumns: [],
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -200,6 +182,14 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 加载列设置
|
||||
loadColumns() {
|
||||
this.outputColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-output') || '[]') || []
|
||||
},
|
||||
// 统一查询入口
|
||||
handleQuery() {
|
||||
this.getList()
|
||||
},
|
||||
getList() {
|
||||
this.loading = true
|
||||
Promise.all([
|
||||
@@ -242,6 +232,10 @@ export default {
|
||||
}, `materialCoil_${new Date().getTime()}.xlsx`)
|
||||
},
|
||||
},
|
||||
mounted() {
|
||||
this.getList()
|
||||
this.loadColumns()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
|
||||
@@ -49,6 +49,7 @@
|
||||
<el-button type="primary" @click="handleQuery">查询</el-button>
|
||||
<el-button type="primary" @click="exportData">导出产出钢卷</el-button>
|
||||
<el-button type="primary" @click="exportLossData">导出消耗钢卷</el-button>
|
||||
<el-button type="primary" @click="settingVisible = true">列设置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
@@ -85,71 +86,20 @@
|
||||
</el-descriptions>
|
||||
<el-tabs v-model="activeTab">
|
||||
<el-tab-pane label="投入钢卷" name="loss">
|
||||
<el-table :data="lossList" border height="calc(100vh - 320px)">
|
||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.currentCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="逻辑库位" align="center" prop="warehouseName" />
|
||||
<el-table-column label="产品类型" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="宽度(米)" align="center" prop="computedWidth" width="70" />
|
||||
<el-table-column label="厚度(米)" align="center" prop="computedThickness" width="70" />
|
||||
<el-table-column label="重量 (吨)" align="center" prop="netWeight" />
|
||||
<el-table-column label="长度 (米)" align="center" prop="length" />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="更新人" align="center" prop="updateByName" />
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" />
|
||||
</el-table>
|
||||
<coil-table :columns="lossColumns" :data="lossList"></coil-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="产出钢卷" name="output">
|
||||
<el-table :data="list" border height="calc(100vh - 320px)">
|
||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.currentCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="班组" align="center" prop="team" />
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="逻辑库位" align="center" prop="warehouseName" />
|
||||
<el-table-column label="实际库区" align="center" prop="actualWarehouseName" />
|
||||
<el-table-column label="产品类型" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="宽度(米)" align="center" prop="computedWidth" width="70" />
|
||||
<el-table-column label="厚度(米)" align="center" prop="computedThickness" width="70" />
|
||||
<el-table-column label="重量 (吨)" align="center" prop="netWeight" />
|
||||
<el-table-column label="长度 (米)" align="center" prop="length" />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="出库状态" align="center" prop="status">
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status === 0 ? '在库' : '已出库' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新人" align="center" prop="updateByName" />
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" />
|
||||
</el-table>
|
||||
<coil-table :columns="outputColumns" :data="list"></coil-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<el-dialog title="列设置" :visible.sync="settingVisible" width="50%">
|
||||
<el-radio-group v-model="activeColumnConfig">
|
||||
<el-radio-button label="coil-report-loss">投入明细配置</el-radio-button>
|
||||
<el-radio-button label="coil-report-output">产出明细配置</el-radio-button>
|
||||
</el-radio-group>
|
||||
<columns-setting :reportType="activeColumnConfig"></columns-setting>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -163,6 +113,8 @@ import MemoInput from "@/components/MemoInput";
|
||||
import MutiSelect from "@/components/MutiSelect";
|
||||
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import { calcSummary, calcAbSummary, calcTeamSummary } from "@/views/wms/report/js/calc";
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
|
||||
|
||||
export default {
|
||||
name: 'TeamTemplate',
|
||||
@@ -172,7 +124,9 @@ export default {
|
||||
CoilNo,
|
||||
MemoInput,
|
||||
MutiSelect,
|
||||
WarehouseSelect
|
||||
WarehouseSelect,
|
||||
ColumnsSetting,
|
||||
CoilTable,
|
||||
},
|
||||
props: {
|
||||
actionTypes: {
|
||||
@@ -209,6 +163,8 @@ export default {
|
||||
|
||||
return {
|
||||
activeTab: 'loss',
|
||||
activeColumnConfig: 'coil-report-loss',
|
||||
settingVisible: false,
|
||||
list: [],
|
||||
lossList: [],
|
||||
queryParams: {
|
||||
@@ -238,7 +194,10 @@ export default {
|
||||
'2019583429955104769',
|
||||
'2019583137616310273'
|
||||
],
|
||||
getDayTimeRange
|
||||
getDayTimeRange,
|
||||
|
||||
lossColumns: [],
|
||||
outputColumns: [],
|
||||
};
|
||||
},
|
||||
watch: {
|
||||
@@ -277,6 +236,11 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 加载列设置
|
||||
loadColumns() {
|
||||
this.lossColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-loss') || '[]') || []
|
||||
this.outputColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-output') || '[]') || []
|
||||
},
|
||||
handleQuery() {
|
||||
this.getList();
|
||||
this.getLossList();
|
||||
@@ -386,6 +350,7 @@ export default {
|
||||
mounted() {
|
||||
this.getList();
|
||||
this.getLossList();
|
||||
this.loadColumns();
|
||||
}
|
||||
};
|
||||
</script>
|
||||
|
||||
@@ -39,6 +39,7 @@
|
||||
<el-button type="primary" @click="handleQuery">查询</el-button>
|
||||
<el-button type="primary" @click="exportData">导出产出钢卷</el-button>
|
||||
<el-button type="primary" @click="exportLossData">导出消耗钢卷</el-button>
|
||||
<el-button type="primary" @click="settingVisible = true">列设置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-row>
|
||||
@@ -73,73 +74,20 @@
|
||||
</el-descriptions>
|
||||
<el-tabs v-model="activeTab">
|
||||
<el-tab-pane label="投入钢卷" name="loss">
|
||||
<el-table :data="lossList" border height="calc(100vh - 320px)">
|
||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.currentCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="逻辑库位" align="center" prop="warehouseName" />
|
||||
<!-- <el-table-column label="实际库区" align="center" prop="actualWarehouseName" /> -->
|
||||
<el-table-column label="产品类型" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="宽度(米)" align="center" prop="computedWidth" width="70" />
|
||||
<el-table-column label="厚度(米)" align="center" prop="computedThickness" width="70" />
|
||||
<el-table-column label="重量 (吨)" align="center" prop="netWeight" />
|
||||
<el-table-column label="长度 (米)" align="center" prop="length" />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="更新人" align="center" prop="updateByName" />
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" />
|
||||
</el-table>
|
||||
<coil-table :columns="lossColumns" :data="lossList"></coil-table>
|
||||
</el-tab-pane>
|
||||
<el-tab-pane label="产出钢卷" name="output">
|
||||
<el-table :data="list" border height="calc(100vh - 320px)">
|
||||
<el-table-column label="入场钢卷号" align="center" prop="enterCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.enterCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="当前钢卷号" align="center" prop="currentCoilNo">
|
||||
<template slot-scope="scope">
|
||||
<coil-no :coil-no="scope.row.currentCoilNo"></coil-no>
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="创建时间" align="center" prop="createTime" />
|
||||
<el-table-column label="逻辑库位" align="center" prop="warehouseName" />
|
||||
<el-table-column label="实际库区" align="center" prop="actualWarehouseName" />
|
||||
<el-table-column label="产品类型" align="center" width="150">
|
||||
<template slot-scope="scope">
|
||||
<ProductInfo v-if="scope.row.itemType == 'product'" :product="scope.row.product" />
|
||||
<RawMaterialInfo v-else-if="scope.row.itemType === 'raw_material'" :material="scope.row.rawMaterial" />
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="宽度(米)" align="center" prop="computedWidth" width="70" />
|
||||
<el-table-column label="厚度(米)" align="center" prop="computedThickness" width="70" />
|
||||
<el-table-column label="重量 (吨)" align="center" prop="netWeight" />
|
||||
<el-table-column label="长度 (米)" align="center" prop="length" />
|
||||
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
|
||||
<el-table-column label="出库状态" align="center" prop="status">
|
||||
<!-- 0在库,1已出库 -->
|
||||
<template slot-scope="scope">
|
||||
{{ scope.row.status === 0 ? '在库' : '已出库' }}
|
||||
</template>
|
||||
</el-table-column>
|
||||
<el-table-column label="更新人" align="center" prop="updateByName" />
|
||||
<el-table-column label="更新时间" align="center" prop="updateTime" />
|
||||
</el-table>
|
||||
<coil-table :columns="outputColumns" :data="list"></coil-table>
|
||||
</el-tab-pane>
|
||||
</el-tabs>
|
||||
|
||||
<el-dialog title="列设置" :visible.sync="settingVisible" width="50%">
|
||||
<el-radio-group v-model="activeColumnConfig">
|
||||
<el-radio-button label="coil-report-loss">投入明细配置</el-radio-button>
|
||||
<el-radio-button label="coil-report-output">产出明细配置</el-radio-button>
|
||||
</el-radio-group>
|
||||
<columns-setting :reportType="activeColumnConfig"></columns-setting>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -155,6 +103,8 @@ import MemoInput from "@/components/MemoInput";
|
||||
import MutiSelect from "@/components/MutiSelect";
|
||||
import WarehouseSelect from "@/components/KLPService/WarehouseSelect";
|
||||
import { calcSummary, calcAbSummary } from "@/views/wms/report/js/calc";
|
||||
import ColumnsSetting from "@/views/wms/report/components/setting/columns.vue";
|
||||
import CoilTable from "@/views/wms/report/components/coilTable/index.vue";
|
||||
|
||||
export default {
|
||||
name: 'YearTemplate',
|
||||
@@ -165,6 +115,8 @@ export default {
|
||||
MemoInput,
|
||||
MutiSelect,
|
||||
WarehouseSelect,
|
||||
ColumnsSetting,
|
||||
CoilTable,
|
||||
},
|
||||
props: {
|
||||
actionTypes: {
|
||||
@@ -214,6 +166,8 @@ export default {
|
||||
|
||||
return {
|
||||
activeTab: 'loss',
|
||||
activeColumnConfig: 'coil-report-loss',
|
||||
settingVisible: false,
|
||||
list: [],
|
||||
lossList: [],
|
||||
queryParams: {
|
||||
@@ -242,7 +196,10 @@ export default {
|
||||
'2019583429955104769',
|
||||
'2019583137616310273',
|
||||
],
|
||||
getDayTimeRange // 挂载时间范围生成函数
|
||||
getDayTimeRange, // 挂载时间范围生成函数
|
||||
|
||||
lossColumns: [],
|
||||
outputColumns: [],
|
||||
}
|
||||
},
|
||||
watch: {
|
||||
@@ -264,6 +221,11 @@ export default {
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
// 加载列设置
|
||||
loadColumns() {
|
||||
this.lossColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-loss') || '[]') || []
|
||||
this.outputColumns = JSON.parse(localStorage.getItem('preference-tableColumns-coil-report-output') || '[]') || []
|
||||
},
|
||||
// 日期变更处理:更新开始/结束时间
|
||||
handleDateChange(date) {
|
||||
if (!date) return
|
||||
@@ -381,6 +343,7 @@ export default {
|
||||
mounted() {
|
||||
this.getList()
|
||||
this.getLossList()
|
||||
this.loadColumns()
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
<el-card class="form-card" shadow="never">
|
||||
<div slot="header" class="card-header">
|
||||
<span>用印申请</span>
|
||||
|
||||
|
||||
</div>
|
||||
<el-form ref="formRef" :model="form" :rules="rules" label-width="120px" size="small" class="metal-form">
|
||||
<div class="form-summary">
|
||||
@@ -223,7 +223,12 @@ export default {
|
||||
})
|
||||
},
|
||||
goDetail(row) {
|
||||
this.$router.push({ path: '/job/sealDetail', query: { bizId: row.bizId } })
|
||||
// if (row.applyType === 'seal') {
|
||||
this.$router.push({
|
||||
path: `/wms/seal/sealDetail/${row.bizId}`
|
||||
})
|
||||
return
|
||||
// }
|
||||
},
|
||||
canPreviewReceipt(row) {
|
||||
return row.status === 'approved' && row.receiptFileIds
|
||||
|
||||
@@ -150,6 +150,7 @@
|
||||
|
||||
<script>
|
||||
import { getSealReq, rejectSealReq, approveSealReq, stampSealJava } from '@/api/wms/seal'
|
||||
import { getApprovalByBizId } from '@/api/wms/approval'
|
||||
import { listByIds } from '@/api/system/oss'
|
||||
import PdfStamper from '@/components/PdfStamper/index.vue'
|
||||
|
||||
@@ -168,6 +169,7 @@ export default {
|
||||
stamping: false,
|
||||
actionSubmitting: false,
|
||||
actionRemark: '',
|
||||
approvalInfo: null,
|
||||
stampForm: {
|
||||
pageNo: 1,
|
||||
stampImageUrl: '',
|
||||
@@ -191,8 +193,18 @@ export default {
|
||||
return this.seal.empId ? `员工ID:${this.seal.empId}` : '-'
|
||||
},
|
||||
canApprove() {
|
||||
if (!this.approvalInfo || !this.approvalInfo.task) {
|
||||
return false
|
||||
}
|
||||
const currentUserId = this.$store.getters.id
|
||||
return this.seal.status === 'running' && String(this.seal.approverId) === String(currentUserId)
|
||||
const task = this.approvalInfo.task
|
||||
console.log('canApprove check:', {
|
||||
currentUserId,
|
||||
approverId: task.approverId,
|
||||
status: this.seal.status,
|
||||
taskStatus: task.taskStatus
|
||||
})
|
||||
return this.seal.status === 'running' && task.taskStatus === 'pending' && Number(task.approverId) === Number(currentUserId)
|
||||
}
|
||||
},
|
||||
created() {
|
||||
@@ -223,12 +235,20 @@ export default {
|
||||
try {
|
||||
const res = await getSealReq(bizId)
|
||||
this.seal = res.data || {}
|
||||
this.seal.approverId = this.seal.approverId || this.seal.approver_id || this.seal.approverUserId
|
||||
await this.loadAttachments()
|
||||
await this.loadApprovalInfo()
|
||||
} finally {
|
||||
this.loading = false
|
||||
}
|
||||
},
|
||||
async loadApprovalInfo() {
|
||||
try {
|
||||
const res = await getApprovalByBizId(this.currentBizId)
|
||||
this.approvalInfo = res.data || null
|
||||
} catch (e) {
|
||||
this.approvalInfo = null
|
||||
}
|
||||
},
|
||||
async loadAttachments() {
|
||||
const fileIds = this.seal.applyFileIds
|
||||
if (!fileIds) {
|
||||
@@ -353,6 +373,10 @@ export default {
|
||||
}
|
||||
},
|
||||
async reject() {
|
||||
if (!this.canApprove) {
|
||||
this.$message.warning('你不是当前审批人')
|
||||
return
|
||||
}
|
||||
this.actionSubmitting = true
|
||||
try {
|
||||
await rejectSealReq(this.currentBizId, this.actionRemark)
|
||||
|
||||
@@ -156,4 +156,14 @@ public class WmsApprovalController extends BaseController {
|
||||
@RequestParam Long approvalId) {
|
||||
return R.ok(iWmsApprovalService.cancelApproval(approvalId));
|
||||
}
|
||||
|
||||
/**
|
||||
* 按业务ID查询审批信息(用于用印等业务)
|
||||
*
|
||||
* @param bizId 业务ID
|
||||
*/
|
||||
@GetMapping("/getByBizId")
|
||||
public R<Map<String, Object>> getByBizId(@RequestParam Long bizId) {
|
||||
return R.ok(iWmsApprovalService.queryByBizId(bizId));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,11 +5,16 @@ import java.util.List;
|
||||
import java.util.Map;
|
||||
import java.util.Arrays;
|
||||
import java.util.stream.Collectors;
|
||||
import java.util.HashMap;
|
||||
|
||||
import com.alibaba.excel.EasyExcel;
|
||||
import com.alibaba.excel.ExcelWriter;
|
||||
import com.alibaba.excel.write.metadata.WriteSheet;
|
||||
import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
|
||||
import com.klp.domain.vo.*;
|
||||
import com.klp.domain.WmsCoilPendingAction;
|
||||
import com.klp.mapper.WmsCoilPendingActionMapper;
|
||||
import com.klp.service.IWmsCoilPendingActionService;
|
||||
import lombok.RequiredArgsConstructor;
|
||||
import javax.servlet.http.HttpServletResponse;
|
||||
import javax.validation.constraints.*;
|
||||
@@ -43,6 +48,8 @@ import com.klp.common.core.page.TableDataInfo;
|
||||
public class WmsMaterialCoilController extends BaseController {
|
||||
|
||||
private final IWmsMaterialCoilService iWmsMaterialCoilService;
|
||||
private final IWmsCoilPendingActionService coilPendingActionService;
|
||||
private final WmsCoilPendingActionMapper coilPendingActionMapper;
|
||||
|
||||
/**
|
||||
* 查询钢卷物料表列表
|
||||
@@ -101,9 +108,49 @@ public class WmsMaterialCoilController extends BaseController {
|
||||
* 查询钢卷物料表列表(POST请求,支持大量coilIds查询)
|
||||
* 功能与GET /list相同,但使用POST请求体传递参数,避免URL长度限制
|
||||
* 特别适合需要查询大量coilIds的场景
|
||||
* 如果coilIds为空且actionIds不为空,则根据actionIds查询wms_coil_pending_action表获取coilIds和完成时间
|
||||
*/
|
||||
@PostMapping("/listByPost")
|
||||
public TableDataInfo<WmsMaterialCoilVo> listByPost(@RequestBody WmsMaterialCoilBo bo, PageQuery pageQuery) {
|
||||
if ((bo.getCoilIds() == null || bo.getCoilIds().isEmpty())
|
||||
&& bo.getActionIds() != null && !bo.getActionIds().isEmpty()) {
|
||||
String[] actionIdArr = bo.getActionIds().split(",");
|
||||
java.util.List<Long> actionIdList = Arrays.stream(actionIdArr)
|
||||
.map(String::trim)
|
||||
.filter(s -> !s.isEmpty())
|
||||
.map(Long::parseLong)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
LambdaQueryWrapper<WmsCoilPendingAction> queryWrapper = new LambdaQueryWrapper<>();
|
||||
queryWrapper.in(WmsCoilPendingAction::getActionId, actionIdList);
|
||||
|
||||
java.util.List<com.klp.domain.WmsCoilPendingAction> actions =
|
||||
coilPendingActionMapper.selectList(queryWrapper);
|
||||
|
||||
if (actions != null && !actions.isEmpty()) {
|
||||
Map<Long, java.util.Date> coilIdCompleteTimeMap = new HashMap<>();
|
||||
List<Long> coilIdsList = actions.stream()
|
||||
.map(com.klp.domain.WmsCoilPendingAction::getCoilId)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
for (com.klp.domain.WmsCoilPendingAction action : actions) {
|
||||
coilIdCompleteTimeMap.put(action.getCoilId(), action.getCompleteTime());
|
||||
}
|
||||
|
||||
bo.setCoilIds(coilIdsList.stream()
|
||||
.map(String::valueOf)
|
||||
.collect(Collectors.joining(",")));
|
||||
|
||||
TableDataInfo<WmsMaterialCoilVo> result = iWmsMaterialCoilService.queryPageList(bo, pageQuery);
|
||||
|
||||
for (WmsMaterialCoilVo vo : result.getRows()) {
|
||||
if (coilIdCompleteTimeMap.containsKey(vo.getCoilId())) {
|
||||
vo.setActionCompleteTime(coilIdCompleteTimeMap.get(vo.getCoilId()));
|
||||
}
|
||||
}
|
||||
return result;
|
||||
}
|
||||
}
|
||||
return iWmsMaterialCoilService.queryPageList(bo, pageQuery);
|
||||
}
|
||||
|
||||
|
||||
@@ -27,7 +27,7 @@ public class WmsApproval extends BaseEntity {
|
||||
@TableId(value = "approval_id")
|
||||
private Long approvalId;
|
||||
/**
|
||||
* 申请类型(leave=请假,out=外出)
|
||||
* 申请类型(leave=请假,out=外出,seal=用印)
|
||||
*/
|
||||
private String applyType;
|
||||
/**
|
||||
|
||||
@@ -25,7 +25,7 @@ public class WmsApprovalBo extends BaseEntity {
|
||||
private Long approvalId;
|
||||
|
||||
/**
|
||||
* 申请类型(leave=请假,out=外出)
|
||||
* 申请类型(leave=请假,out=外出,seal=用印)
|
||||
*/
|
||||
private String applyType;
|
||||
|
||||
|
||||
@@ -309,5 +309,15 @@ public class WmsMaterialCoilBo extends BaseEntity {
|
||||
* 预留宽度(单位:毫米)
|
||||
*/
|
||||
private BigDecimal reservedWidth;
|
||||
|
||||
/**
|
||||
* 操作记录ID列表(逗号分隔,用于根据actionIds查询钢卷)
|
||||
*/
|
||||
private String actionIds;
|
||||
|
||||
/**
|
||||
* 钢卷异常信息列表(用于更新钢卷时同时插入异常信息)
|
||||
*/
|
||||
private List<WmsCoilAbnormalBo> abnormals;
|
||||
}
|
||||
|
||||
|
||||
@@ -28,10 +28,10 @@ public class WmsApprovalVo {
|
||||
private Long approvalId;
|
||||
|
||||
/**
|
||||
* 申请类型(leave=请假,out=外出)
|
||||
* 申请类型(leave=请假,out=外出,seal=用印)
|
||||
*/
|
||||
@ExcelProperty(value = "申请类型", converter = ExcelDictConvert.class)
|
||||
@ExcelDictFormat(readConverterExp = "l=eave=请假,out=外出")
|
||||
@ExcelDictFormat(readConverterExp = "leave=请假,out=外出,seal=用印")
|
||||
private String applyType;
|
||||
|
||||
/**
|
||||
|
||||
@@ -468,5 +468,11 @@ public class WmsMaterialCoilVo extends BaseEntity {
|
||||
* 预留宽度(单位:毫米)
|
||||
*/
|
||||
private BigDecimal reservedWidth;
|
||||
|
||||
/**
|
||||
* 操作完成时间(从wms_coil_pending_action表查询到的完成时间)
|
||||
*/
|
||||
@JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss")
|
||||
private Date actionCompleteTime;
|
||||
}
|
||||
|
||||
|
||||
@@ -47,4 +47,6 @@ public class WmsSealReqVo implements Serializable {
|
||||
private Date createTime;
|
||||
private String updateBy;
|
||||
private Date updateTime;
|
||||
|
||||
private String applicantName;
|
||||
}
|
||||
|
||||
@@ -73,4 +73,12 @@ public interface IWmsApprovalService {
|
||||
* @return 操作结果
|
||||
*/
|
||||
Map<String, Object> cancelApproval(Long approvalId);
|
||||
|
||||
/**
|
||||
* 按业务ID查询审批信息(用于用印等业务)
|
||||
*
|
||||
* @param bizId 业务ID
|
||||
* @return 审批信息包含任务详情
|
||||
*/
|
||||
Map<String, Object> queryByBizId(Long bizId);
|
||||
}
|
||||
|
||||
@@ -549,4 +549,25 @@ public class WmsApprovalServiceImpl implements IWmsApprovalService {
|
||||
return result;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Map<String, Object> queryByBizId(Long bizId) {
|
||||
Map<String, Object> result = new HashMap<>();
|
||||
if (bizId == null) {
|
||||
return result;
|
||||
}
|
||||
LambdaQueryWrapper<WmsApproval> lqw = Wrappers.lambdaQuery();
|
||||
lqw.eq(WmsApproval::getApplyId, bizId);
|
||||
lqw.eq(WmsApproval::getApplyType, "seal");
|
||||
lqw.eq(WmsApproval::getDelFlag, 0);
|
||||
WmsApprovalVo approval = baseMapper.selectVoOne(lqw);
|
||||
if (approval == null) {
|
||||
return result;
|
||||
}
|
||||
result.put("approval", approval);
|
||||
result.put("applyType", approval.getApplyType());
|
||||
List<WmsApprovalTaskVo> tasks = approvalTaskService.queryByApprovalId(approval.getApprovalId());
|
||||
result.put("task", tasks != null && !tasks.isEmpty() ? tasks.get(0) : null);
|
||||
return result;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -7,6 +7,7 @@ import com.baomidou.mybatisplus.core.toolkit.Wrappers;
|
||||
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
|
||||
import com.klp.common.core.page.TableDataInfo;
|
||||
import com.klp.common.core.domain.PageQuery;
|
||||
import com.klp.common.core.service.UserService;
|
||||
import com.klp.common.utils.StringUtils;
|
||||
import com.klp.domain.WmsApprovalTask;
|
||||
import com.klp.domain.bo.WmsApprovalTaskBo;
|
||||
@@ -14,6 +15,8 @@ import com.klp.domain.vo.WmsApprovalTaskVo;
|
||||
import com.klp.domain.vo.WmsApprovalVo;
|
||||
import com.klp.domain.vo.WmsLeaveRequestVo;
|
||||
import com.klp.domain.vo.WmsOutRequestVo;
|
||||
import com.klp.domain.vo.WmsSealReqVo;
|
||||
import com.klp.mapper.WmsSealReqMapper;
|
||||
import com.klp.mapper.WmsApprovalTaskMapper;
|
||||
import com.klp.mapper.WmsApprovalMapper;
|
||||
import com.klp.mapper.WmsLeaveRequestMapper;
|
||||
@@ -40,7 +43,9 @@ public class WmsApprovalTaskServiceImpl implements IWmsApprovalTaskService {
|
||||
private final WmsApprovalMapper approvalMapper;
|
||||
private final WmsLeaveRequestMapper leaveRequestMapper;
|
||||
private final WmsOutRequestMapper outRequestMapper;
|
||||
private final ISysUserService userService;
|
||||
private final WmsSealReqMapper sealRequestMapper;
|
||||
private final UserService userService;
|
||||
private final ISysUserService sysUserService;
|
||||
|
||||
@Override
|
||||
public WmsApprovalTaskVo queryById(Long taskId) {
|
||||
@@ -73,6 +78,7 @@ public class WmsApprovalTaskServiceImpl implements IWmsApprovalTaskService {
|
||||
|
||||
// 收集所有applyId,按类型分别查询
|
||||
Set<String> userNames = new HashSet<>();
|
||||
Set<Long> empIds = new HashSet<>();
|
||||
Map<String, Object> detailMap = new HashMap<>();
|
||||
|
||||
for (WmsApprovalTaskVo task : taskList) {
|
||||
@@ -97,6 +103,12 @@ public class WmsApprovalTaskServiceImpl implements IWmsApprovalTaskService {
|
||||
if (outDetail != null && StringUtils.isNotBlank(outDetail.getCreateBy())) {
|
||||
userNames.add(outDetail.getCreateBy());
|
||||
}
|
||||
} else if ("seal".equalsIgnoreCase(applyType)) {
|
||||
WmsSealReqVo sealDetail = sealRequestMapper.selectVoById(applyId);
|
||||
detailMap.put("seal_" + applyId, sealDetail);
|
||||
if (sealDetail != null && sealDetail.getEmpId() != null) {
|
||||
empIds.add(sealDetail.getEmpId());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -104,7 +116,18 @@ public class WmsApprovalTaskServiceImpl implements IWmsApprovalTaskService {
|
||||
// 批量查询昵称
|
||||
Map<String, String> nickMap = Collections.emptyMap();
|
||||
if (!userNames.isEmpty()) {
|
||||
nickMap = userService.selectNickNameMapByUserNames(new ArrayList<>(userNames));
|
||||
nickMap = sysUserService.selectNickNameMapByUserNames(new ArrayList<>(userNames));
|
||||
}
|
||||
|
||||
// 批量查询empId对应的昵称(用于用印申请)
|
||||
Map<Long, String> empNickMap = new HashMap<>();
|
||||
if (!empIds.isEmpty()) {
|
||||
for (Long empId : empIds) {
|
||||
String nickName = userService.selectNickNameById(empId);
|
||||
if (StringUtils.isNotBlank(nickName)) {
|
||||
empNickMap.put(empId, nickName);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 组装返回结果
|
||||
@@ -139,6 +162,15 @@ public class WmsApprovalTaskServiceImpl implements IWmsApprovalTaskService {
|
||||
item.put("detail", outDetail);
|
||||
item.put("applyType", "out");
|
||||
}
|
||||
} else if ("seal".equalsIgnoreCase(applyType)) {
|
||||
WmsSealReqVo sealDetail = (WmsSealReqVo) detailMap.get("seal_" + applyId);
|
||||
if (sealDetail != null) {
|
||||
if (sealDetail.getEmpId() != null) {
|
||||
sealDetail.setApplicantName(empNickMap.getOrDefault(sealDetail.getEmpId(), String.valueOf(sealDetail.getEmpId())));
|
||||
}
|
||||
item.put("detail", sealDetail);
|
||||
item.put("applyType", "seal");
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -42,6 +42,7 @@ import com.klp.service.IWmsRawMaterialService;
|
||||
import com.klp.service.IWmsBomItemService;
|
||||
import com.klp.service.IWmsCoilPendingActionService;
|
||||
import com.klp.service.IWmsProductService;
|
||||
import com.klp.service.IWmsCoilAbnormalService;
|
||||
import com.fasterxml.jackson.databind.ObjectMapper;
|
||||
|
||||
import java.util.*;
|
||||
@@ -78,6 +79,7 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
// private final WmsRawMaterialMapper rawMaterialMapper;
|
||||
private final WmsDeliveryWaybillDetailMapper deliveryWaybillDetailMapper;
|
||||
private final WmsCoilWarehouseOperationLogMapper wmsCoilWarehouseOperationLogMapper;
|
||||
private final IWmsCoilAbnormalService coilAbnormalService;
|
||||
|
||||
/**
|
||||
* 查询钢卷物料表
|
||||
@@ -1323,6 +1325,14 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
// 有新库区,算入库
|
||||
recordWarehouseOperationLog(newCoil.getCoilId(), newActualWarehouseId, 2, 1, "单个更新-加工入库");
|
||||
}
|
||||
|
||||
// 插入钢卷异常信息
|
||||
if (bo.getAbnormals() != null && !bo.getAbnormals().isEmpty()) {
|
||||
for (WmsCoilAbnormalBo abnormalBo : bo.getAbnormals()) {
|
||||
abnormalBo.setCoilId(newCoil.getCoilId());
|
||||
coilAbnormalService.insertByBo(abnormalBo);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return flag;
|
||||
@@ -1536,6 +1546,14 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
|
||||
// 更新实际库区的启用状态
|
||||
updateActualWarehouseEnableStatus(oldCoil.getActualWarehouseId(), newCoilBo.getActualWarehouseId());
|
||||
|
||||
// 插入子钢卷的异常信息
|
||||
if (newCoilBo.getAbnormals() != null && !newCoilBo.getAbnormals().isEmpty()) {
|
||||
for (WmsCoilAbnormalBo abnormalBo : newCoilBo.getAbnormals()) {
|
||||
abnormalBo.setCoilId(newCoil.getCoilId());
|
||||
coilAbnormalService.insertByBo(abnormalBo);
|
||||
}
|
||||
}
|
||||
}
|
||||
// 更新所有子钢卷二维码中的分卷步骤child_coil_ids
|
||||
List<Long> newCoilIds = newCoils.stream()
|
||||
@@ -1682,6 +1700,15 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
if (mergeNewActualWarehouseId != null && mergeNewActualWarehouseId != -1L) {
|
||||
recordWarehouseOperationLog(newCoil.getCoilId(), mergeNewActualWarehouseId, 2, 1, "合卷操作-加工入库");
|
||||
}
|
||||
|
||||
// 插入合卷钢卷的异常信息
|
||||
if (bo.getAbnormals() != null && !bo.getAbnormals().isEmpty()) {
|
||||
for (WmsCoilAbnormalBo abnormalBo : bo.getAbnormals()) {
|
||||
abnormalBo.setCoilId(newCoil.getCoilId());
|
||||
coilAbnormalService.insertByBo(abnormalBo);
|
||||
}
|
||||
}
|
||||
|
||||
// 合卷完成后,设置新钢卷ID到bo对象中,方便外部获取
|
||||
bo.setMergedCoilId(newCoil.getCoilId());
|
||||
}
|
||||
@@ -4130,6 +4157,14 @@ public class WmsMaterialCoilServiceImpl implements IWmsMaterialCoilService {
|
||||
childCoil.setParentCoilId(String.valueOf(parentCoilId));
|
||||
baseMapper.insert(childCoil);
|
||||
|
||||
// 插入子钢卷的异常信息
|
||||
if (childCoilBo.getAbnormals() != null && !childCoilBo.getAbnormals().isEmpty()) {
|
||||
for (WmsCoilAbnormalBo abnormalBo : childCoilBo.getAbnormals()) {
|
||||
abnormalBo.setCoilId(childCoil.getCoilId());
|
||||
coilAbnormalService.insertByBo(abnormalBo);
|
||||
}
|
||||
}
|
||||
|
||||
updateActualWarehouseEnableStatus(null, childCoilBo.getActualWarehouseId());
|
||||
|
||||
// 8. 更新二维码中的coilId
|
||||
|
||||
Reference in New Issue
Block a user