From 3e0d0b1fdfcceb5b5c2884124d1026fe190a6902 Mon Sep 17 00:00:00 2001 From: qiezi <15576055375@163.com> Date: Wed, 21 May 2025 16:36:02 +0800 Subject: [PATCH] 2025-05-21 --- .../quote/detail/primary/quoteDetailCost.vue | 28 +++++++++++++------ 1 file changed, 19 insertions(+), 9 deletions(-) diff --git a/src/views/modules/quote/detail/primary/quoteDetailCost.vue b/src/views/modules/quote/detail/primary/quoteDetailCost.vue index aab1205..6e9fcde 100644 --- a/src/views/modules/quote/detail/primary/quoteDetailCost.vue +++ b/src/views/modules/quote/detail/primary/quoteDetailCost.vue @@ -132,14 +132,24 @@ export default { // this.quoteDetail.totalCost += this.quoteDetail.otherCost; // } // 计算成本 - this.computedTotalPartCost(); - // let val = 0; - // let editInput = this.editInput.toLowerCase(); - // if (editInput === 'va'){ - // val = this.quoteDetail.quoteProfitRate - // } - this.computeProfitAmount(); - this.computeCurrencyTotalCost(); + this.computedTotalPartCost();//计算总物料成本和其他额外成本 + this.computeMarkup();// 计算利润 + this.computeProfitAmount(); // 计算 CNY + this.computeCurrencyTotalCost();//计算外汇成本 + }, + computeMarkup(){ + let val = 0; + let editInput = this.editInput.toLowerCase(); + if (editInput === 'va'){ + val = this.quoteDetail.quoteProfitRate + }else if (editInput === 'contribution'){ + val = this.quoteDetail.quoteProfitAmount + }else if (editInput === 'margin'){ + val = this.quoteDetail.quoteTaxRate + }else if (editInput === 'price'){ + val = this.quoteDetail.quoteTaxTotalPrice + } + this.computePriceByRate(val,editInput) }, computeProfitAmount(){ this.quoteDetail.profitAmount = @@ -236,7 +246,7 @@ export default { } }, computePriceByRate(val,type){ - if (val === undefined || val === null || val <=0){ + if (val === undefined || val === null){ return; } let value = 0;