diff --git a/klp-ui/src/views/wms/coil/actflow.vue b/klp-ui/src/views/wms/coil/actflow.vue index a3ff917c..91a99028 100644 --- a/klp-ui/src/views/wms/coil/actflow.vue +++ b/klp-ui/src/views/wms/coil/actflow.vue @@ -70,11 +70,9 @@ - + @@ -191,7 +189,7 @@ - + @@ -398,27 +396,27 @@ export default { console.log('操作类型:', row.actionType); console.log('钢卷ID:', row.coilId); + const actionType = parseInt(row.actionType); + // 特殊处理:发货和移库操作不需要跳转 - if (row.actionType === 4 || row.actionType === '4') { - this.$message.info('发货操作已在移动端完成'); - return; - } - if (row.actionType === 5 || row.actionType === '5') { - this.$message.info('移库操作已在移动端完成'); + if (actionType === 4 || actionType === 5) { + this.$message.info(actionType === 4 ? '发货操作已在移动端完成' : '移库操作已在移动端完成'); return; } // 根据操作类型跳转到不同页面 let path = ''; - // 注意:action_type字典中 1=合卷, 2=分卷, 3=更新 - if (row.actionType === 1 || row.actionType === '1') { - // 合卷 - path = '/wms/merge'; - } else if (row.actionType === 2 || row.actionType === '2') { - // 分卷 + + // 分条操作:100-199 + if (actionType >= 100 && actionType <= 199) { path = '/wms/split'; - } else if (row.actionType === 3 || row.actionType === '3') { - // 更新 + } + // 合卷操作:200-299 + else if (actionType >= 200 && actionType <= 299) { + path = '/wms/merge'; + } + // 其他操作类型 + else if (actionType === 3) { path = '/wms/typing'; } @@ -497,6 +495,32 @@ export default { handleCoilSelect(coil) { this.form.coilId = coil.coilId; this.form.currentCoilNo = coil.currentCoilNo; + }, + /** 获取操作类型文本 */ + getActionTypeText(actionType) { + const type = parseInt(actionType); + if (type >= 100 && type <= 199) { + return '分条操作'; + } else if (type >= 200 && type <= 299) { + return '合卷操作'; + } else if (type === 3) { + return '更新信息'; + } else if (type === 4) { + return '发货操作'; + } else if (type === 5) { + return '移库操作'; + } + return '未知操作'; + }, + /** 获取状态文本 */ + getStatusText(status) { + const statusMap = { + 0: '待处理', + 1: '处理中', + 2: '已完成', + 3: '已取消' + }; + return statusMap[status] || '未知'; } } }; diff --git a/klp-ui/src/views/wms/coil/merge.vue b/klp-ui/src/views/wms/coil/merge.vue index 06d645cd..65456b19 100644 --- a/klp-ui/src/views/wms/coil/merge.vue +++ b/klp-ui/src/views/wms/coil/merge.vue @@ -147,22 +147,25 @@ - - - - + + + + + - + + + ', newVal); + + // 先清空物品选择 + this.$set(this.targetCoil, 'itemId', null); + + // 设置物料类型 + if (newVal === '成品') { + this.$set(this.targetCoil, 'itemType', 'product'); + console.log('✅ 设置 itemType = product'); + } else if (newVal === '原料' || newVal === '废品') { + this.$set(this.targetCoil, 'itemType', 'raw_material'); + console.log('✅ 设置 itemType = raw_material'); + } + + console.log('📊 当前 targetCoil:', { + materialType: this.targetCoil.materialType, + itemType: this.targetCoil.itemType, + itemId: this.targetCoil.itemId + }); + + console.log('📦 数据列表:', { + rawMaterialList: this.rawMaterialList.length, + productList: this.productList.length + }); + }, // 监听物品类型变化,加载对应的列表 'targetCoil.itemType'(newVal, oldVal) { - if (newVal !== oldVal) { + if (newVal !== oldVal && newVal) { this.targetCoil.itemId = null; // 清空物品ID this.loadItemList(newVal); } } }, async created() { + console.log('🚀 merge.vue created 钩子执行'); + // 加载库区列表 await this.loadWarehouses(); + // 🔥 页面加载时直接加载所有原料和产品列表 + await this.loadAllItems(); + // 从路由参数获取coilId、actionId和readonly const coilId = this.$route.query.coilId; const actionId = this.$route.query.actionId; @@ -567,9 +623,38 @@ export default { } }, + // 页面加载时一次性加载所有原料和产品列表 + async loadAllItems() { + console.log('🔥 merge.vue 开始加载所有物品列表'); + try { + // 同时加载原料和产品 + const [rawMaterialRes, productRes] = await Promise.all([ + listRawMaterial({ pageNum: 1, pageSize: 99999, withBom: true }), + listProduct({ pageNum: 1, pageSize: 99999, withBom: true }) + ]); + + if (rawMaterialRes.code === 200) { + this.rawMaterialList = rawMaterialRes.rows || []; + console.log('✅ merge.vue 原材料列表加载成功,数量:', this.rawMaterialList.length); + } + + if (productRes.code === 200) { + this.productList = productRes.rows || []; + console.log('✅ merge.vue 产品列表加载成功,数量:', this.productList.length); + } + } catch (error) { + console.error('❌ merge.vue 加载物品列表失败', error); + } + }, + // 加载物品列表(根据类型) async loadItemList(itemType) { - if (!itemType) return; + if (!itemType) { + console.log('merge.vue loadItemList: itemType 为空'); + return; + } + + console.log('merge.vue 开始加载物品列表,类型:', itemType); try { this.itemSearchLoading = true; @@ -579,8 +664,10 @@ export default { pageSize: 100, withBom: true }); + console.log('merge.vue 原材料列表响应:', response); if (response.code === 200) { this.rawMaterialList = response.rows || []; + console.log('merge.vue 原材料列表加载成功,数量:', this.rawMaterialList.length); } } else if (itemType === 'product') { const response = await listProduct({ @@ -588,12 +675,14 @@ export default { pageSize: 100, withBom: true }); + console.log('merge.vue 产品列表响应:', response); if (response.code === 200) { this.productList = response.rows || []; + console.log('merge.vue 产品列表加载成功,数量:', this.productList.length); } } } catch (error) { - console.error('加载物品列表失败', error); + console.error('merge.vue 加载物品列表失败', error); } finally { this.itemSearchLoading = false; } @@ -602,7 +691,7 @@ export default { // 搜索物品 async searchItems(query) { if (!this.targetCoil.itemType) { - this.$message.warning('请先选择物品类型'); + this.$message.warning('请先选择材料类型'); return; } @@ -745,6 +834,7 @@ export default { enterCoilNo: enterCoilNos, // 拼接的入场钢卷号 currentCoilNo: this.targetCoil.currentCoilNo, team: this.targetCoil.team, + materialType: this.targetCoil.materialType, itemType: this.targetCoil.itemType, itemId: this.targetCoil.itemId, grossWeight: this.targetCoil.grossWeight, diff --git a/klp-ui/src/views/wms/coil/panels/base.vue b/klp-ui/src/views/wms/coil/panels/base.vue index 737ad33e..4cb29bd6 100644 --- a/klp-ui/src/views/wms/coil/panels/base.vue +++ b/klp-ui/src/views/wms/coil/panels/base.vue @@ -73,11 +73,7 @@ - - - +