From e45ef1d44ccff9db71eb0a2dbbbe1ce67bf1a526 Mon Sep 17 00:00:00 2001 From: KongDuo Date: Fri, 19 May 2023 14:37:52 +0800 Subject: [PATCH] =?UTF-8?q?=E7=82=BC=E5=8E=82=E4=B8=8B=E5=8D=95=E7=A1=AE?= =?UTF-8?q?=E8=AE=A4?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/order/components/confirmSubmit.vue | 30 +++++++++++++------- 1 file changed, 19 insertions(+), 11 deletions(-) diff --git a/src/views/order/components/confirmSubmit.vue b/src/views/order/components/confirmSubmit.vue index 407ad89..b0eadf2 100644 --- a/src/views/order/components/confirmSubmit.vue +++ b/src/views/order/components/confirmSubmit.vue @@ -51,15 +51,21 @@ - - - - + + + + + + + + + + @@ -78,6 +84,7 @@ export default { }, data() { return { + newCostPrice: '', newSalePrice: '', undergoChanges: false, tableData: [ @@ -116,15 +123,15 @@ export default { }, methods: { openDrawer() { - let { productId, salePrice } = this.controlWindows.addInfo + let { productId, salePrice, floorPrice } = this.controlWindows.addInfo if (productId) { serve.getRefineryProduct(productId).then(res => { - let { salePrice2company } = res.data - if (salePrice2company != salePrice) { + let data = res.data; + if (data.salePrice2company != salePrice || data.floorPrice != floorPrice) { console.log('价格发生变化了捏') // 新的价格 - this.newSalePrice = salePrice2company - + this.newSalePrice = data.salePrice2company + this.newCostPrice = data.floorPrice this.policyPopulation() } else console.log('芜湖 没变') }) @@ -136,6 +143,7 @@ export default { this.tableData[index].isChecked = true } }, + // 策略选择 policyPopulation() { let { salePrice, floorPrice, preQuantity, preAmount } = this.controlWindows.addInfo // console.log(salePrice, preQuantity, preAmount) @@ -145,14 +153,14 @@ export default { // 以提货量为准 Object.assign(this.tableData[1], { salePrice: this.newSalePrice, - floorPrice: this.newSalePrice, + floorPrice: this.newCostPrice, preQuantity, preAmount: +this.newSalePrice * +preQuantity }) // 以订单金额为准 Object.assign(this.tableData[2], { salePrice: this.newSalePrice, - floorPrice: this.newSalePrice, + floorPrice: this.newCostPrice, preQuantity: +preAmount / +this.newSalePrice, preAmount }) -- 2.36.2