From cb77562cdfe57d05522dad463f5d1c5e83763639 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Tue, 18 Nov 2025 15:15:05 +0800 Subject: [PATCH] =?UTF-8?q?refactor(wms):=20=E4=BC=98=E5=8C=96=E9=92=A2?= =?UTF-8?q?=E5=8D=B7=E6=93=8D=E4=BD=9C=E7=95=8C=E9=9D=A2=E7=BB=84=E4=BB=B6?= =?UTF-8?q?=E5=92=8C=E4=BA=A4=E4=BA=92=E9=80=BB=E8=BE=91?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 替换通用选择器为专用组件,优化按钮加载状态 统一操作后的页面返回延迟时间 --- klp-ui/src/views/wms/coil/actflow.vue | 21 ++++++++++-- klp-ui/src/views/wms/coil/merge.vue | 48 ++++++++++----------------- klp-ui/src/views/wms/coil/split.vue | 33 +++++++++--------- klp-ui/src/views/wms/coil/typing.vue | 19 ++++++++--- 4 files changed, 68 insertions(+), 53 deletions(-) diff --git a/klp-ui/src/views/wms/coil/actflow.vue b/klp-ui/src/views/wms/coil/actflow.vue index 3ff8f09f..a0953a97 100644 --- a/klp-ui/src/views/wms/coil/actflow.vue +++ b/klp-ui/src/views/wms/coil/actflow.vue @@ -52,6 +52,8 @@ icon="el-icon-refresh" size="mini" @click="handleRefresh" + :disabled="buttonLoading" + v-loading="buttonLoading" >刷新 @@ -137,6 +139,8 @@ type="primary" icon="el-icon-edit" @click="handleProcess(scope.row)" + v-loading="buttonLoading" + :disabled="buttonLoading" >操作 继续 @@ -286,6 +292,7 @@ export default { return { // 遮罩层 loading: true, + buttonLoading: false, // 选中数组 ids: [], // 非单个禁用 @@ -359,11 +366,13 @@ export default { /** 查询待操作列表 */ getList() { this.loading = true; + this.buttonLoading = true; listPendingAction(this.queryParams).then(response => { console.log('response.rows', response.rows); this.actionList = response.rows; this.total = response.total; + this.buttonLoading = false; this.loading = false; }); }, @@ -429,6 +438,7 @@ export default { }, /** 提交按钮 */ submitForm() { + this.buttonLoading = true; this.$refs['form'].validate(valid => { if (valid) { if (this.form.actionId != null) { @@ -436,12 +446,14 @@ export default { this.$message.success('修改成功'); this.open = false; this.getList(); + this.buttonLoading = false; }); } else { addPendingAction(this.form).then(response => { this.$message.success('新增成功'); this.open = false; this.getList(); + this.buttonLoading = false; }); } } @@ -468,10 +480,12 @@ export default { console.log('操作类型:', row.actionType); console.log('钢卷ID:', row.coilId); + this.buttonLoading = true; + this.$forceUpdate(); const actionType = parseInt(row.actionType); // 特殊处理:发货和移库操作不需要跳转 - if (actionType === 4 || actionType === 5) { + if (actionType === 4 || actionType === 5 || actionType === 401 || actionType === 402) { this.$message.info(actionType === 4 ? '发货操作已在移动端完成' : '移库操作已在移动端完成'); return; } @@ -516,10 +530,11 @@ export default { actionId: row.actionId } }); + this.buttonLoading = false; }).catch(error => { console.error('更新状态失败:', error); this.$message.error('更新状态失败: ' + (error.message || error)); - }); + }) }, /** 取消操作 */ handleCancel(row) { diff --git a/klp-ui/src/views/wms/coil/merge.vue b/klp-ui/src/views/wms/coil/merge.vue index aff85417..da11e168 100644 --- a/klp-ui/src/views/wms/coil/merge.vue +++ b/klp-ui/src/views/wms/coil/merge.vue @@ -7,7 +7,7 @@ 钢卷合卷
- 保存合卷 + 保存合卷 {{ readonly ? '返回' : '取消' }}
@@ -74,8 +74,8 @@ @click="selectPendingCoil(pending, index)">
{{ pending.currentCoilNo }}
- 扫码时间: - {{ formatTime(pending.scanTime) }} + 更新时间: + {{ formatTime(pending.updateTime) }}
@@ -163,11 +163,11 @@ - - - + + +
请先选择物料类型
@@ -225,12 +225,17 @@ import { listProductWithBom } from '@/api/wms/product'; import { listPendingAction, completeAction } from '@/api/wms/pendingAction'; import CoilSelector from '@/components/CoilSelector'; import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect"; +import RawMaterialSelector from "@/components/KLPService/RawMaterialSelect"; +import ProductSelector from "@/components/KLPService/ProductSelect"; + export default { name: 'MergeCoil', components: { CoilSelector, - ActualWarehouseSelect + ActualWarehouseSelect, + RawMaterialSelector, + ProductSelector }, data() { return { @@ -252,6 +257,7 @@ export default { packingStatus: '', trimmingRequirement: '' }, + buttonLoading: false, loading: false, // 钢卷选择器可见性 coilSelectorVisible: false, @@ -370,23 +376,6 @@ export default { } }, methods: { - // 处理材料类型变化 - handleMaterialTypeChange(value) { - // 清空物品选择 - this.$set(this.targetCoil, 'itemId', null); - - // 根据材料类型设置物品类型 - if (value === '成品') { - this.$set(this.targetCoil, 'itemType', 'product'); - // 清空列表,等待用户搜索 - this.productList = []; - } else if (value === '原料' || value === '废品') { - this.$set(this.targetCoil, 'itemType', 'raw_material'); - // 清空列表,等待用户搜索 - this.rawMaterialList = []; - } - }, - // 加载第一个钢卷(从待操作进入时) async loadFirstCoil(coilId) { try { @@ -409,7 +398,6 @@ export default { productName: data.productName || (data.product ? data.product.productName : ''), specification: data.rawMaterial?.specification || data.product?.specification || '', bomItems: data.bomItemList || [], - }, { coilId: null, @@ -450,13 +438,13 @@ export default { // 分别查询待处理和处理中的记录 const responses = await Promise.all([ listPendingAction({ - actionType: 1, // 合卷操作 + actionType: 200, // 合卷操作 actionStatus: 0, // 待处理 pageNum: 1, pageSize: 1000 }), listPendingAction({ - actionType: 1, // 合卷操作 + actionType: 200, // 合卷操作 actionStatus: 1, // 处理中 pageNum: 1, pageSize: 1000 @@ -753,7 +741,7 @@ export default { // 延迟返回,让用户看到成功提示 setTimeout(() => { this.$router.back(); - }, 1000); + }, 100); } else { this.$message.error(response.msg || '合卷保存失败'); } diff --git a/klp-ui/src/views/wms/coil/split.vue b/klp-ui/src/views/wms/coil/split.vue index 98c986e5..ed1dc55a 100644 --- a/klp-ui/src/views/wms/coil/split.vue +++ b/klp-ui/src/views/wms/coil/split.vue @@ -121,37 +121,34 @@ - + - + - + - + - - - + + +
请先选择物料类型
@@ -205,12 +202,16 @@ import { listProductWithBom } from '@/api/wms/product'; import { completeAction } from '@/api/wms/pendingAction'; import CoilSelector from '@/components/CoilSelector'; import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect"; +import RawMaterialSelect from "@/components/KLPService/RawMaterialSelect"; +import ProductSelect from "@/components/KLPService/ProductSelect"; export default { name: 'SplitCoil', components: { CoilSelector, - ActualWarehouseSelect + ActualWarehouseSelect, + RawMaterialSelect, + ProductSelect, }, data() { return { @@ -618,7 +619,7 @@ export default { // 延迟返回,让用户看到成功提示 setTimeout(() => { this.$router.back(); - }, 1000); + }, 100); } else { this.$message.error(response.msg || '分条保存失败'); } diff --git a/klp-ui/src/views/wms/coil/typing.vue b/klp-ui/src/views/wms/coil/typing.vue index 46076acd..0117db6c 100644 --- a/klp-ui/src/views/wms/coil/typing.vue +++ b/klp-ui/src/views/wms/coil/typing.vue @@ -130,11 +130,18 @@ - - + --> + + +
请先选择物料类型
@@ -221,11 +228,15 @@ import { listWarehouse } from '@/api/wms/warehouse'; import { listRawMaterialWithBom } from '@/api/wms/rawMaterial'; import { listProductWithBom } from '@/api/wms/product'; import ActualWarehouseSelect from "@/components/KLPService/ActualWarehouseSelect"; +import RawMaterialSelect from "@/components/KLPService/RawMaterialSelect"; +import ProductSelect from "@/components/KLPService/ProductSelect"; export default { name: 'TypingCoil', components: { - ActualWarehouseSelect + ActualWarehouseSelect, + RawMaterialSelect, + ProductSelect, }, data() { return { @@ -627,7 +638,7 @@ export default { // 延迟返回 setTimeout(() => { this.$router.back(); - }, 1000); + }, 100); } else { this.$message.error(response.msg || '更新失败'); }