From 348eb137a8352b289636b6d2b653f44dbc6b585e Mon Sep 17 00:00:00 2001 From: jiangpeng Date: Thu, 11 Jun 2026 17:55:33 +0800 Subject: [PATCH] =?UTF-8?q?fix=EF=BC=9A=E7=94=A8=E6=88=B7=E7=99=BB?= =?UTF-8?q?=E5=BD=95=E5=92=8C=E4=BF=AE=E6=94=B9=E5=AF=86=E7=A0=81=E7=9B=B8?= =?UTF-8?q?=E5=85=B3=E8=B0=83=E6=95=B4=EF=BC=8C=E5=A4=84=E7=90=86=E4=BA=86?= =?UTF-8?q?=E4=B8=80=E4=BA=9B=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../src/views/inventory/execution/index.vue | 119 ++++++++++-------- oms_web/oms_vue/src/views/login.vue | 6 +- .../src/views/monitor/logininfor/index.vue | 8 +- .../components/PurchaseOrderSelectDialog.vue | 2 +- .../controller/system/SysLoginController.java | 6 +- .../resources/static/i18n/messages.properties | 4 +- .../shiro/service/SysLoginService.java | 4 +- 7 files changed, 79 insertions(+), 70 deletions(-) diff --git a/oms_web/oms_vue/src/views/inventory/execution/index.vue b/oms_web/oms_vue/src/views/inventory/execution/index.vue index 6318b329..7eac2f21 100644 --- a/oms_web/oms_vue/src/views/inventory/execution/index.vue +++ b/oms_web/oms_vue/src/views/inventory/execution/index.vue @@ -274,8 +274,9 @@
已备货: {{ item.bhNum !== undefined && item.bhNum !== null ? item.bhNum : '-' }} - 缺货: {{ item.orderNum !== undefined && item.orderNum !== null ? item.orderNum-(item.bhNum||0): '-'}} - 备货完成 + 缺货: {{ Number(item.orderNum) - Number(item.bhNum || 0) }} + 超配: {{ Number(item.bhNum) - Number(item.orderNum) }} + 备货完成
@@ -755,21 +756,15 @@ export default { this.stockingDetailLoading = true; productMatchList(row.orderCode).then(response => { const list = response.data || []; - return Promise.all(list.map(item => this.loadAllBindData(row.orderCode, item).then(allBindList => { - const bindPageNum = 1; - const bindPageSize = this.stockingBindPageSize; - const startIndex = (bindPageNum - 1) * bindPageSize; - const endIndex = startIndex + bindPageSize; - const bindList = allBindList.slice(startIndex, endIndex); - + return Promise.all(list.map(item => this.loadBindData(row.orderCode, item, 1, this.stockingBindPageSize).then(bindData => { return { ...item, originalTotalPhNum: item.phNum, - allBindList: allBindList, - bindList: bindList, - bindTotal: allBindList.length, - bindPageNum: bindPageNum, - bindPageSize: bindPageSize + allBindList: bindData.rows, + bindList: bindData.rows, + bindTotal: bindData.total, + bindPageNum: 1, + bindPageSize: this.stockingBindPageSize }; }))); }).then(list => { @@ -819,36 +814,46 @@ export default { return Math.min(maxPhysical, maxAllowedByOrder); }, - loadAllBindData(orderCode, item) { + loadBindData(orderCode, item, pageNum, pageSize) { return productMatchBindList(orderCode, item.productCode, { - pageNum: 1, - pageSize: 9999, + pageNum: pageNum, + pageSize: pageSize, orderByColumn: 't5.bindNum desc,t6.createTime', isAsc: 'desc' }).then(bindResponse => { - return (bindResponse.rows || []).map(bindItem => ({ - ...bindItem, - phNum: this.getDraftBindNum(item.productCode, bindItem.purchaseId, bindItem.phNum), - originalPhNum: bindItem.originalPhNum !== undefined ? bindItem.originalPhNum : bindItem.phNum, - originalKyNum: bindItem.originalKyNum !== undefined ? bindItem.originalKyNum : bindItem.kyNum - })); + return { + rows: (bindResponse.rows || []).map(bindItem => ({ + ...bindItem, + phNum: this.getDraftBindNum(item.productCode, bindItem.purchaseId, bindItem.phNum), + originalPhNum: bindItem.originalPhNum !== undefined ? bindItem.originalPhNum : bindItem.phNum, + originalKyNum: bindItem.originalKyNum !== undefined ? bindItem.originalKyNum : bindItem.kyNum + })), + total: bindResponse.total || 0 + }; }).catch(() => { - return []; + return { rows: [], total: 0 }; }); }, handleBindPageChange(item) { - const startIndex = (item.bindPageNum - 1) * item.bindPageSize; - const endIndex = startIndex + item.bindPageSize; - const bindList = (item.allBindList || []).slice(startIndex, endIndex); - - this.stockingDetailList = this.stockingDetailList.map(currentItem => { - if (currentItem.productCode === item.productCode) { - return { - ...currentItem, - bindList: bindList - }; - } - return currentItem; + this.loadBindData(this.stockingDetailRow.orderCode, item, item.bindPageNum, item.bindPageSize).then(bindData => { + this.stockingDetailList = this.stockingDetailList.map(currentItem => { + if (currentItem.productCode === item.productCode) { + const loadedBindMap = {}; + (currentItem.allBindList || []).forEach(bindItem => { + loadedBindMap[String(bindItem.purchaseId)] = bindItem; + }); + bindData.rows.forEach(bindItem => { + loadedBindMap[String(bindItem.purchaseId)] = bindItem; + }); + return { + ...currentItem, + allBindList: Object.values(loadedBindMap), + bindList: bindData.rows, + bindTotal: bindData.total + }; + } + return currentItem; + }); }); }, handleBindNumChange(row, item) { @@ -871,20 +876,20 @@ export default { this.updateItemTotalPhNum(item); }, calculateCurrentTotalPhNum(item) { - if (!item || !item.productCode || !item.allBindList) return 0; + if (!item || !item.productCode) return 0; - let total = 0; - item.allBindList.forEach(bindItem => { + const baseTotal = item.originalTotalPhNum === '' || item.originalTotalPhNum === null || item.originalTotalPhNum === undefined ? 0 : Number(item.originalTotalPhNum); + const changedDiff = (item.allBindList || []).reduce((total, bindItem) => { const key = this.getBindDraftKey(item.productCode, bindItem.purchaseId); - if (this.stockingBindDraftMap && this.stockingBindDraftMap[key] !== undefined) { - total += Number(this.stockingBindDraftMap[key]); - } else { - const phNum = bindItem.phNum === '' || bindItem.phNum === null || bindItem.phNum === undefined ? 0 : Number(bindItem.phNum); - total += phNum; + if (!this.stockingBindDraftMap || this.stockingBindDraftMap[key] === undefined) { + return total; } - }); + const currentPhNum = Number(this.stockingBindDraftMap[key]); + const originalPhNum = bindItem.originalPhNum === '' || bindItem.originalPhNum === null || bindItem.originalPhNum === undefined ? 0 : Number(bindItem.originalPhNum); + return total + currentPhNum - originalPhNum; + }, 0); - return total; + return baseTotal + changedDiff; }, findBindItemByPurchaseId(productCode, purchaseId) { const product = this.stockingDetailList.find(item => item.productCode === productCode); @@ -1132,19 +1137,23 @@ export default { if (!targetItem) { return; } - this.loadAllBindData(this.stockingDetailRow.orderCode, targetItem).then(allBindList => { - const bindPageNum = targetItem.bindPageNum || 1; - const bindPageSize = targetItem.bindPageSize || this.stockingBindPageSize; - const startIndex = (bindPageNum - 1) * bindPageSize; - const endIndex = startIndex + bindPageSize; - const bindList = allBindList.slice(startIndex, endIndex); + const bindPageNum = targetItem.bindPageNum || 1; + const bindPageSize = targetItem.bindPageSize || this.stockingBindPageSize; + this.loadBindData(this.stockingDetailRow.orderCode, targetItem, bindPageNum, bindPageSize).then(bindData => { this.stockingDetailList = this.stockingDetailList.map(item => { if (item.productCode === productCode) { + const loadedBindMap = {}; + (item.allBindList || []).forEach(bindItem => { + loadedBindMap[String(bindItem.purchaseId)] = bindItem; + }); + bindData.rows.forEach(bindItem => { + loadedBindMap[String(bindItem.purchaseId)] = bindItem; + }); return { ...item, - allBindList: allBindList, - bindList: bindList, - bindTotal: allBindList.length + allBindList: Object.values(loadedBindMap), + bindList: bindData.rows, + bindTotal: bindData.total }; } return item; diff --git a/oms_web/oms_vue/src/views/login.vue b/oms_web/oms_vue/src/views/login.vue index a01e94f0..dcb2a68b 100644 --- a/oms_web/oms_vue/src/views/login.vue +++ b/oms_web/oms_vue/src/views/login.vue @@ -66,8 +66,8 @@ append-to-body > - - + + @@ -124,7 +124,7 @@ export default { emailCodeTimer: null, resetPwdRules: { username: [ - { required: true, trigger: "blur", message: "请输入用户名" } + { required: true, trigger: "blur", message: "请输入账号" } ], newPassword: [ { required: true, trigger: "blur", message: "请输入新密码" }, diff --git a/oms_web/oms_vue/src/views/monitor/logininfor/index.vue b/oms_web/oms_vue/src/views/monitor/logininfor/index.vue index bbec8739..539a8c4e 100644 --- a/oms_web/oms_vue/src/views/monitor/logininfor/index.vue +++ b/oms_web/oms_vue/src/views/monitor/logininfor/index.vue @@ -10,10 +10,10 @@ @keyup.enter.native="handleQuery" /> - + - + @@ -145,7 +145,7 @@ export default { single: true, // 非多个禁用 multiple: true, - // 选择用户名 + // 选择账号 selectName: "", // 显示搜索条件 showSearch: true, diff --git a/oms_web/oms_vue/src/views/purchaseorder/components/PurchaseOrderSelectDialog.vue b/oms_web/oms_vue/src/views/purchaseorder/components/PurchaseOrderSelectDialog.vue index 2bd624e1..28a437d5 100644 --- a/oms_web/oms_vue/src/views/purchaseorder/components/PurchaseOrderSelectDialog.vue +++ b/oms_web/oms_vue/src/views/purchaseorder/components/PurchaseOrderSelectDialog.vue @@ -2,7 +2,7 @@
- + UserConstants.USERNAME_MAX_LENGTH) {