From c99ba06d89523b896ed9784f2d7799670ec4ab84 Mon Sep 17 00:00:00 2001 From: chenhao Date: Fri, 28 Nov 2025 09:35:09 +0800 Subject: [PATCH] =?UTF-8?q?feat(purchase-order):=20=E4=BC=98=E5=8C=96?= =?UTF-8?q?=E9=87=87=E8=B4=AD=E8=AE=A2=E5=8D=95=E5=AE=A1=E6=89=B9=E4=B8=8E?= =?UTF-8?q?=E4=BA=A7=E5=93=81=E9=80=89=E6=8B=A9=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在流程实例审批回调中增加公司领导审批处理逻辑 - 移除重复的审批通过处理代码块 - 修复采购订单详情页 purchaserMobile 字段重复显示问题 - 为产品选择组件新增厂商编码参数传递 - 增加当前厂商编码变量并完善相关校验逻辑 - 更新含税金额计算方法,加入税额字段自动计算 - 优化总金额计算方式,确保数据同步更新 - 强化产品选择前的类型与厂商必选校验规则 --- .../components/PurchaseOrderDetail.vue | 19 +++++++++++------ .../views/system/product/selectProduct.vue | 13 +++++++++++- .../impl/OmsPurchaseOrderServiceImpl.java | 21 +++++++------------ 3 files changed, 33 insertions(+), 20 deletions(-) diff --git a/oms_web/oms_vue/src/views/purchaseorder/components/PurchaseOrderDetail.vue b/oms_web/oms_vue/src/views/purchaseorder/components/PurchaseOrderDetail.vue index dcdbb5ac..9e9b2792 100644 --- a/oms_web/oms_vue/src/views/purchaseorder/components/PurchaseOrderDetail.vue +++ b/oms_web/oms_vue/src/views/purchaseorder/components/PurchaseOrderDetail.vue @@ -76,9 +76,6 @@ {{ form.purchaserMobile }} - - {{ form.purchaserMobile }} - @@ -181,7 +178,7 @@ - + @@ -210,6 +207,7 @@ export default { editingProductIndex: -1, // 当前编辑的产品类型 currentProductType: null, + currentVendorCode: null, // 产品类型字典 productTypeOptions: [], // 制造商选项 @@ -273,7 +271,8 @@ export default { computed: { totalAmountWithTax() { const total = this.form.omsPurchaseOrderItemList?.reduce((acc, cur) => acc + (cur.amountTotal || 0), 0); - return preciseCurrencyRound(total) || 0; + this.form.totalAmount=preciseCurrencyRound(total) || 0; + return this.form.totalAmount; }, totalAmountWithoutTax() { const total = this.form.omsPurchaseOrderItemList?.reduce((acc, cur) => { @@ -344,6 +343,10 @@ export default { this.$modal.msgWarning("请先选择产品类型"); return; } + if (!this.currentVendorCode){ + this.$modal.msgWarning("请先选择制造商"); + return; + } this.editingProductIndex = index; this.currentProductType = this.form.omsPurchaseOrderItemList[index].productType; this.productSelectOpen = true; @@ -389,9 +392,11 @@ export default { /** 计算含税小计 */ calculateRowTotal(row) { if (row.quantity != null && row.price != null) { - row.amountTotal = Math.round(row.quantity * row.price * 100) / 100; + row.amountTotal = preciseCurrencyRound(row.quantity * row.price); + row.taxTotal = row.amountTotal - preciseCurrencyRound(row.amountTotal / (1 + row.taxRate)); } else { row.amountTotal = 0; + row.taxTotal = 0; } }, /** 获取厂商列表 */ @@ -405,9 +410,11 @@ export default { if (vendorId) { this.selectedVendor = this.vendorOptions.find(item => item.vendorId === vendorId) || {}; this.form.warehouseId = this.selectedVendor.warehouseId + this.currentVendorCode=this.selectedVendor.vendorCode; } else { this.selectedVendor = {}; this.form.warehouseId = null; + this.currentVendorCode = null; } }, /** 处理采购员选择 */ diff --git a/oms_web/oms_vue/src/views/system/product/selectProduct.vue b/oms_web/oms_vue/src/views/system/product/selectProduct.vue index 5624edfb..800ed946 100644 --- a/oms_web/oms_vue/src/views/system/product/selectProduct.vue +++ b/oms_web/oms_vue/src/views/system/product/selectProduct.vue @@ -60,6 +60,10 @@ export default { productType: { type: String, default: '', + }, + vendorCode: { + type: String, + default: '', } }, data() { @@ -76,7 +80,8 @@ export default { pageSize: 10, productCode: null, model: null, - type: this.productType // Pass productType to query params + type: this.productType, // Pass productType to query params + vendorCode:null }, }; }, @@ -92,6 +97,12 @@ export default { if (this.visible) { this.getList(); } + }, + vendorCode(val) { + this.queryParams.vendorCode = val; + if (this.visible) { + this.getList(); + } } }, methods: { diff --git a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OmsPurchaseOrderServiceImpl.java b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OmsPurchaseOrderServiceImpl.java index 591f7b24..bb09f5b7 100644 --- a/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OmsPurchaseOrderServiceImpl.java +++ b/ruoyi-sip/src/main/java/com/ruoyi/sip/service/impl/OmsPurchaseOrderServiceImpl.java @@ -343,6 +343,14 @@ public class OmsPurchaseOrderServiceImpl implements IOmsPurchaseOrderService, To @Override public boolean multiInstanceApproveCallback(String activityName, ProcessInstance processInstance) { + String flowBusinessKey = processInstance.getBusinessKey(); + String[] split = flowBusinessKey.split("#"); + String businessKey = split.length > 1 ? split[1] : split[0]; + Map processVariables = processInstance.getProcessVariables(); + Integer approveBtn = (Integer) processVariables.get("approveBtn"); + if ("公司领导".equals(activityName) && approveBtn == 1) { + handleCompanyLeaderApproval(businessKey); + } return TodoCommonTemplate.super.multiInstanceApproveCallback(activityName, processInstance); } @@ -381,19 +389,6 @@ public class OmsPurchaseOrderServiceImpl implements IOmsPurchaseOrderService, To // 审批驳回处理 if (approveBtn.equals(0)) { handleRejectOrder( businessKey); - } else if (approveBtn.equals(1)) { - - // 审批通过处理 - if ("公司领导".equals(taskName)) { - handleCompanyLeaderApproval(businessKey); -// //黄雪秋处理 流程状态更改 -// if (ShiroUtils.getUserId().equals(118L)) { -// handleCompanyLeaderApproval(businessKey); -// } - - } - - } return TodoCommonTemplate.super.todoApproveCallback(todo);