diff --git a/klp-ui/src/views/wms/coil/merge.vue b/klp-ui/src/views/wms/coil/merge.vue
index 49233365..9e3c6703 100644
--- a/klp-ui/src/views/wms/coil/merge.vue
+++ b/klp-ui/src/views/wms/coil/merge.vue
@@ -176,8 +176,8 @@
吨
-
暂无变更历史
@@ -247,9 +190,13 @@ import { completeAction } from '@/api/wms/pendingAction'; import { listWarehouse } from '@/api/wms/warehouse'; import { listRawMaterial } from '@/api/wms/rawMaterial'; import { listProduct } from '@/api/wms/product'; +import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect"; export default { name: 'TypingCoil', + components: { + ActualWarehouseSelect + }, data() { return { loading: false, @@ -267,7 +214,7 @@ export default { grossWeight: null, netWeight: null, warehouseId: null, - nextWarehouseId: null, + warehouseId: null, nextWarehouseName: '', status: 0, remark: '' @@ -280,7 +227,8 @@ export default { itemId: null, grossWeight: null, netWeight: null, - nextWarehouseId: null, + warehouseId: null, + actualWarehouseId: null, remark: '' }, rules: { @@ -304,8 +252,11 @@ export default { { required: true, message: '请输入净重', trigger: 'blur' }, { type: 'number', message: '净重必须为数字', trigger: 'blur' } ], - nextWarehouseId: [ + warehouseId: [ { required: true, message: '请选择目标库区', trigger: 'change' } + ], + actualWarehouseId: [ + { required: true, message: '请选择真实库区', trigger: 'change' } ] }, warehouseList: [], @@ -348,20 +299,20 @@ export default { async created() { // 先加载库区列表 await this.loadWarehouses(); - + // 从路由参数获取coilId和actionId const coilId = this.$route.query.coilId; const actionId = this.$route.query.actionId; const readonly = this.$route.query.readonly; - + if (coilId) { await this.loadCoilInfo(coilId); } - + if (actionId) { this.actionId = actionId; } - + // 设置只读模式 if (readonly === 'true' || readonly === true) { this.readonly = true; @@ -375,7 +326,7 @@ export default { const response = await getMaterialCoil(coilId); if (response.code === 200 && response.data) { const data = response.data; - + // 填充当前信息(左侧) this.currentInfo = { coilId: data.coilId, @@ -389,23 +340,23 @@ export default { grossWeight: data.grossWeight, netWeight: data.netWeight, warehouseId: data.warehouseId, - nextWarehouseId: data.nextWarehouseId, - nextWarehouseName: this.getWarehouseName(data.nextWarehouseId), + actualWarehouseId: data.actualWarehouseId, + nextWarehouseName: this.getWarehouseName(data.warehouseId), remark: data.remark || '' }; - + console.log('当前信息加载完成:', this.currentInfo); - + // 重新获取库区名称(确保warehouseList已加载) - if (data.nextWarehouseId) { - this.currentInfo.nextWarehouseName = this.getWarehouseName(data.nextWarehouseId); + if (data.warehouseId) { + this.currentInfo.nextWarehouseName = this.getWarehouseName(data.warehouseId); } - + // 加载对应类型的物品列表 if (data.itemType) { await this.loadItemList(data.itemType); } - + // 加载变更历史 this.loadHistory(); } @@ -457,7 +408,7 @@ export default { // 加载物品列表(根据类型) async loadItemList(itemType) { if (!itemType) return; - + try { this.itemSearchLoading = true; if (itemType === 'raw_material') { @@ -484,23 +435,23 @@ export default { this.$message.warning('请先选择物品类型'); return; } - + try { this.itemSearchLoading = true; if (this.updateForm.itemType === 'raw_material') { - const response = await listRawMaterial({ + const response = await listRawMaterial({ rawMaterialName: query, - pageNum: 1, - pageSize: 50 + pageNum: 1, + pageSize: 50 }); if (response.code === 200) { this.rawMaterialList = response.rows || []; } } else if (this.updateForm.itemType === 'product') { - const response = await listProduct({ + const response = await listProduct({ productName: query, - pageNum: 1, - pageSize: 50 + pageNum: 1, + pageSize: 50 }); if (response.code === 200) { this.productList = response.rows || []; @@ -523,14 +474,14 @@ export default { if (!this.currentInfo.enterCoilNo) { return; } - + try { this.historyLoading = true; const response = await getMaterialCoilTrace({ enterCoilNo: this.currentInfo.enterCoilNo, currentCoilNo: this.currentInfo.currentCoilNo || undefined }); - + if (response.code === 200 && response.data) { this.historySteps = response.data.steps || []; } @@ -550,17 +501,17 @@ export default { itemId: this.currentInfo.itemId, grossWeight: parseFloat(this.currentInfo.grossWeight) || null, netWeight: parseFloat(this.currentInfo.netWeight) || null, - nextWarehouseId: this.currentInfo.nextWarehouseId, + warehouseId: this.currentInfo.warehouseId, remark: this.currentInfo.remark }; - + console.log('复制的表单数据:', this.updateForm); - + // 加载对应的物品列表 if (this.updateForm.itemType) { this.loadItemList(this.updateForm.itemType); } - + this.$message.success('已复制当前信息'); }, @@ -571,9 +522,15 @@ export default { return false; } + const loadingInstance = this.$loading({ + lock: true, + text: '正在更新钢卷信息,请稍后...', + background: 'rgba(0, 0, 0, 0.7)' + }) + try { this.loading = true; - + // 构造更新数据(使用标准update接口,会创建历史版本) const updateData = { coilId: this.currentInfo.coilId, @@ -585,23 +542,24 @@ export default { itemId: this.updateForm.itemId, grossWeight: this.updateForm.grossWeight, netWeight: this.updateForm.netWeight, - warehouseId: this.currentInfo.warehouseId, // 当前库区ID(保持不变) - nextWarehouseId: this.updateForm.nextWarehouseId, // 目标库区ID + // warehouseId: this.currentInfo.warehouseId, // 当前库区ID(保持不变) + actualWarehouseId: this.updateForm.actualWarehouseId, // 真实库区ID + warehouseId: this.updateForm.warehouseId, // 目标库区ID remark: this.updateForm.remark }; - + console.log('提交的更新数据:', updateData); - + const response = await updateMaterialCoil(updateData); - + if (response.code === 200) { this.$message.success('钢卷信息更新成功'); - + // 如果是从待操作列表进来的,标记操作为完成 if (this.actionId) { await completeAction(this.actionId); } - + // 延迟返回 setTimeout(() => { this.$router.back(); @@ -614,6 +572,7 @@ export default { console.error(error); } finally { this.loading = false; + loadingInstance.close(); } }); }, @@ -652,7 +611,7 @@ export default { display: flex; align-items: center; gap: 8px; - + i { color: #0066cc; font-size: 20px; @@ -687,7 +646,7 @@ export default { flex: 1; display: flex; flex-direction: column; - + ::v-deep .el-card__body { flex: 1; display: flex; @@ -706,7 +665,7 @@ export default { align-items: center; justify-content: space-between; font-weight: 500; - + i { color: #0066cc; margin-right: 5px; @@ -719,18 +678,18 @@ export default { display: flex; align-items: flex-start; margin-bottom: 12px; - + &:last-child { margin-bottom: 0; } - + .info-label { color: #909399; font-size: 14px; min-width: 110px; flex-shrink: 0; } - + .info-value { color: #303133; font-size: 14px; @@ -746,17 +705,17 @@ export default { ::v-deep .el-card__body { max-height: 400px; overflow-y: auto; - + &::-webkit-scrollbar { width: 6px; } - + &::-webkit-scrollbar-thumb { background: #dcdfe6; border-radius: 3px; } } - + ::v-deep .el-timeline { padding-left: 10px; } @@ -768,12 +727,12 @@ export default { color: #303133; margin-bottom: 8px; } - + .history-detail { font-size: 13px; color: #606266; margin-bottom: 4px; - + .detail-label { color: #909399; margin-right: 5px; @@ -785,13 +744,13 @@ export default { text-align: center; padding: 40px 0; color: #909399; - + i { font-size: 48px; margin-bottom: 10px; display: block; } - + p { margin: 0; } @@ -801,21 +760,21 @@ export default { .form-card { ::v-deep .el-input-number { width: 100%; - + .el-input__inner { text-align: left; } } - + ::v-deep .el-form-item { margin-bottom: 20px; } - + // 修复数字输入框的样式 ::v-deep input[type="number"] { appearance: textfield; -moz-appearance: textfield; - + &::-webkit-outer-spin-button, &::-webkit-inner-spin-button { -webkit-appearance: none; @@ -835,7 +794,7 @@ export default { ::v-deep .el-button--primary.el-button--small.is-plain, ::v-deep .el-button--text { color: #409eff; - + &:hover { color: #66b1ff; }