From 9ca64029a2330538c6015d35caf54380a1f2c19b Mon Sep 17 00:00:00 2001 From: qiankanghui Date: Sat, 10 Oct 2026 14:45:54 +0800 Subject: [PATCH] =?UTF-8?q?feat(order):=20=E5=9C=A8=E8=AE=A2=E5=8D=95?= =?UTF-8?q?=E6=A8=A1=E5=9D=97=E4=B8=AD=E6=B7=BB=E5=8A=A0=E4=BE=9B=E5=BA=94?= =?UTF-8?q?=E5=95=86=E4=BB=B7=E6=A0=BC=E8=A1=A8=E5=8A=9F=E8=83=BD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 在PO订单页面添加查看价格表按钮 - 新增供应商可供物料价格表弹窗组件 - 实现按供应商和物料编码查询阶梯价格功能 - 添加价格表表格展示数量范围、单价、价格日期等信息 - 在表格操作列中添加查看价格按钮 - 实现价格表数据加载和错误处理逻辑 - 移除SKU管理中的冗余提示信息 --- src/views/modules/order/poOrder.vue | 122 +++++++++++++++++++++ src/views/modules/srmPart/partInfoList.vue | 4 +- 2 files changed, 124 insertions(+), 2 deletions(-) diff --git a/src/views/modules/order/poOrder.vue b/src/views/modules/order/poOrder.vue index cea94de..4f61376 100644 --- a/src/views/modules/order/poOrder.vue +++ b/src/views/modules/order/poOrder.vue @@ -24,6 +24,7 @@ 取消 新增 + 查看价格表 + + + + + + +
+ 供应商:{{ supplierPartPriceDialogSupplierNo }} + 物料编码:{{ supplierPartPriceDialogPartNo }} +
+ + + + + + + + + + +
@@ -953,6 +1002,12 @@ export default { supplierPartDialogSupplierNo: '', supplierPartDialogSite: '', supplierPartDialogItemFilter: '', + // 供应商可供物料价格表弹窗状态 + supplierPartPriceDialogVisible: false, + supplierPartPriceDialogLoading: false, + supplierPartPriceDialogRows: [], + supplierPartPriceDialogPartNo: '', + supplierPartPriceDialogSupplierNo: '', addPriceLookupTimer: null, addPriceLookupSeq: 0, selectedCustomerScope: null, @@ -4052,6 +4107,73 @@ export default { this.supplierPartDialogSite = '' this.supplierPartDialogItemFilter = '' }, + // 打开供应商可供物料价格表弹窗:按当前供应商 + 行物料编码查当前生效阶梯价 + openSupplierPartPriceDialog (row) { + if (!row) { + return + } + const site = this.supplierPartDialogSite + const supplierCode = this.supplierPartDialogSupplierNo + const partNo = String(row.partNo || '').trim() + if (!site || !supplierCode || !partNo) { + this.$message.warning('缺少供应商或物料编码,无法查询价格') + return + } + this.loadSupplierPartPriceDialog({ site, supplierCode, partNo }) + }, + // 主页面:查看当前选中行(供应商 + 物料)的价格表 + openCurrentRowPriceDialog () { + const row = this.currentRow + if (!row) { + this.$message.warning('请先选择一行数据') + return + } + const site = String(row.site || this.$store.state.user.site || '').trim() + const supplierCode = String(row.supplierNo || row.supplier_no || row.supplierCode || row.supplier_code || '').trim() + const partNo = String(row.partNo || row.part_no || '').trim() + if (!site || !supplierCode || !partNo) { + this.$message.warning('当前行缺少供应商或物料编码,无法查询价格') + return + } + this.loadSupplierPartPriceDialog({ site, supplierCode, partNo }) + }, + // 共用的阶梯价加载:拉取当前生效阶梯价并渲染到价格弹窗 + loadSupplierPartPriceDialog ({ site, supplierCode, partNo }) { + this.supplierPartPriceDialogPartNo = partNo + this.supplierPartPriceDialogSupplierNo = supplierCode + this.supplierPartPriceDialogRows = [] + this.supplierPartPriceDialogVisible = true + this.supplierPartPriceDialogLoading = true + listPoCurrentTierPrice({ + site, + supplierCode, + partNo + }).then(({ data }) => { + if (data && data.code === 0) { + this.supplierPartPriceDialogRows = (data.rows || []).map(item => ({ + qtyStart: (item.qtyStart === null || item.qtyStart === undefined) ? '' : item.qtyStart, + qtyEnd: (item.qtyEnd === null || item.qtyEnd === undefined) ? '' : item.qtyEnd, + unitPrice: (item.unitPrice === null || item.unitPrice === undefined) ? '' : item.unitPrice, + priceDate: item.priceDate || '', + remark: item.remark || '' + })) + return + } + this.supplierPartPriceDialogRows = [] + this.$message.error((data && data.msg) || '获取供应商价格表失败') + }).catch(() => { + this.supplierPartPriceDialogRows = [] + this.$message.error('获取供应商价格表失败') + }).finally(() => { + this.supplierPartPriceDialogLoading = false + }) + }, + resetSupplierPartPriceDialog () { + this.supplierPartPriceDialogLoading = false + this.supplierPartPriceDialogRows = [] + this.supplierPartPriceDialogPartNo = '' + this.supplierPartPriceDialogSupplierNo = '' + }, resolveAddOrderTypeByCustomer () { const customerOrderType = this.selectedCustomerScope && this.selectedCustomerScope.orderType diff --git a/src/views/modules/srmPart/partInfoList.vue b/src/views/modules/srmPart/partInfoList.vue index 4feb35f..21fd2f4 100644 --- a/src/views/modules/srmPart/partInfoList.vue +++ b/src/views/modules/srmPart/partInfoList.vue @@ -1863,11 +1863,11 @@ export default { msg = `SKU ${sku} 已在 SKU 管理中维护基准料号 ${data.dbBasePartNo},与本次的基准料号不一致。` } if (skipNavigation) { - this.$message.error(`${msg}基准料号与 SKU 需一一对应,请先到 SKU 管理页手动维护后再指定。`) + this.$message.error(`${msg}请先到 SKU 管理页手动维护后再指定。`) return } this.$confirm( - `${msg}基准料号与 SKU 需一一对应,是否前往 SKU 管理页手动维护?前往后将不再保存本次新增。`, + `${msg}是否前往 SKU 管理页手动维护?前往后将不再保存本次新增。`, 'SKU与基准料号冲突', { confirmButtonText: '是',