From e8a1c61729d8e00bc9e449892933635e4cfeff80 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E7=A0=82=E7=B3=96?= Date: Mon, 26 Jan 2026 09:51:50 +0800 Subject: [PATCH] =?UTF-8?q?fix(wms):=20=E4=BF=AE=E5=A4=8D=E5=88=86?= =?UTF-8?q?=E6=9D=A1=E6=93=8D=E4=BD=9C=E4=B8=AD=E7=9A=84=E8=A1=A8=E5=8D=95?= =?UTF-8?q?=E9=AA=8C=E8=AF=81=E5=92=8C=E8=B6=85=E6=97=B6=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复分条操作中的表单验证逻辑,将验证提前到try块外以避免潜在错误。同时为特殊分条完成接口增加超时设置,并添加加载状态提示以改善用户体验。调整了未知状态标签的缩进格式。 --- klp-ui/src/api/wms/coil.js | 1 + .../src/views/wms/coil/panels/stepSplit.vue | 22 +++++++++++++------ 2 files changed, 16 insertions(+), 7 deletions(-) diff --git a/klp-ui/src/api/wms/coil.js b/klp-ui/src/api/wms/coil.js index 0de20e16..6b12c206 100644 --- a/klp-ui/src/api/wms/coil.js +++ b/klp-ui/src/api/wms/coil.js @@ -281,6 +281,7 @@ export function completeSpecialSplit(pendingActionId) { return request({ url: '/wms/materialCoil/specialSplit/complete', method: 'post', + timeout: 100000, params: { pendingActionId } diff --git a/klp-ui/src/views/wms/coil/panels/stepSplit.vue b/klp-ui/src/views/wms/coil/panels/stepSplit.vue index 830ef885..e73f666f 100644 --- a/klp-ui/src/views/wms/coil/panels/stepSplit.vue +++ b/klp-ui/src/views/wms/coil/panels/stepSplit.vue @@ -49,7 +49,7 @@
历史卷
-
+
未知状态
@@ -458,12 +458,13 @@ export default { // 新增/编辑分条 async addSplit() { + // 表单验证 + const valid = await this.$refs.splitFormRef.validate() + console.log('valid', valid) + if (!valid) { + return + } try { - // 表单验证 - const valid = await this.$refs.splitFormRef.validate() - if (!valid) { - return - } // 区分新增/编辑:有coilId则为编辑,否则为新增 let res this.buttonLoading = true @@ -483,6 +484,7 @@ export default { this.getSplitList() } catch (error) { // 表单验证失败时的提示 + console.log('error', error) if (error.name !== 'ValidationError') { this.$message.error((this.splitForm.coilId ? '编辑' : '新增') + '分条异常:' + error.message) } @@ -498,9 +500,13 @@ export default { cancelButtonText: '取消', type: 'warning', }).then(async () => { + const loading = this.$loading({ + lock: true, + text: '正在记录分条操作...', + background: 'rgba(0, 0, 0, 0.7)', + }) try { this.buttonLoading = true - // 1. 完成分条主流程 const splitRes = await completeSpecialSplit(this.actionId) if (splitRes.code !== 200) { @@ -523,6 +529,8 @@ export default { if (error.message !== 'cancel') { // 排除取消确认的情况 this.$message.error('完成分条异常:' + error.message) } + } finally { + loading.close() } }) },