diff --git a/src/views/modules/quote/detail/primary/quoteDetailCost.vue b/src/views/modules/quote/detail/primary/quoteDetailCost.vue index 2610b9d..4b1482b 100644 --- a/src/views/modules/quote/detail/primary/quoteDetailCost.vue +++ b/src/views/modules/quote/detail/primary/quoteDetailCost.vue @@ -42,19 +42,28 @@ export default { { required: true, message: "请输入其他成本", trigger: ["blur","change"] } ], profitRate: [ - { required: true, message: "请输入利润率", trigger: ["blur","change"] } + { required: true, message: "请输入标准利润率", trigger: ["blur","change"] } + ], + quoteProfitRate: [ + { required: true, message: "请输入报价利润率", trigger: ["blur","change"] } ], taxRate: [ - { required: true, message: "请输入税率", trigger: ["blur","change"] } + { required: true, message: "请输入标准税率", trigger: ["blur","change"] } + ], + quoteTaxRate: [ + { required: true, message: "请输入报价税率", trigger: ["blur","change"] } ], }, + + showQuoteCost:true, + isShowCost:false, } }, methods:{ computeTotalCost(){ + // 标准总成本 this.quoteDetail.totalCost = this.quoteDetail.adjustPartCost + - this.quoteDetail.adjustBomUnYield + this.quoteDetail.adjustMachineCost + this.quoteDetail.adjustFabricateCost + this.quoteDetail.adjustLabourCost + @@ -63,11 +72,28 @@ export default { this.quoteDetail.otherCost; this.computeProfitAmount(); }, + computeQuoteTotalCost(){ + // 报价总成本 + this.quoteDetail.quoteTotalCost = + this.quoteDetail.adjustBomUnYield + + this.quoteDetail.adjustMachineCost + + this.quoteDetail.adjustFabricateCost + + this.quoteDetail.adjustLabourCost + + this.quoteDetail.adjustToolCost + + this.quoteDetail.manageCost + + this.quoteDetail.otherCost; + this.computeQuoteProfitAmount(); + }, computeProfitAmount(){ this.quoteDetail.profitAmount = this.quoteDetail.totalCost * (this.quoteDetail.profitRate / 100); this.computeTaxCost(); }, + computeQuoteProfitAmount(){ + this.quoteDetail.quoteProfitAmount = + this.quoteDetail.quoteTotalCost * (this.quoteDetail.quoteProfitRate / 100); + this.computeQuoteTaxCost(); + }, computeTaxCost(){ this.quoteDetail.totalPrice = this.quoteDetail.totalCost + this.quoteDetail.profitAmount; @@ -78,6 +104,16 @@ export default { this.quoteDetail.taxUnitPrice = this.quoteDetail.taxTotalPrice / this.quoteDetail.qty; }, + computeQuoteTaxCost(){ + this.quoteDetail.quoteTotalPrice = + this.quoteDetail.quoteTotalCost + this.quoteDetail.quoteProfitAmount; + this.quoteDetail.quoteUnitPrice = + this.quoteDetail.quoteTotalPrice / this.quoteDetail.qty; + this.quoteDetail.quoteTaxTotalPrice = + this.quoteDetail.quoteTotalPrice + this.quoteDetail.quoteTotalPrice * (this.quoteDetail.quoteTaxRate / 100); + this.quoteDetail.quoteTaxUnitPrice = + this.quoteDetail.quoteTaxTotalPrice / this.quoteDetail.qty; + }, handleQueryAllCost(){ let params = { ...this.quoteDetail @@ -121,43 +157,49 @@ export default { if (newValue === undefined || newValue === null){ this.quoteDetail.adjustPartCost = 0; } - this.computeTotalCost(); + this.computeQuoteTotalCost(); }, 'quoteDetail.adjustMachineCost'(newValue, oldValue){ if (newValue === undefined || newValue === null){ this.quoteDetail.adjustMachineCost = 0; } this.computeTotalCost(); + this.computeQuoteTotalCost(); }, 'quoteDetail.adjustFabricateCost'(newValue, oldValue){ if (newValue === undefined || newValue === null){ this.quoteDetail.adjustFabricateCost = 0; } this.computeTotalCost(); + this.computeQuoteTotalCost(); }, 'quoteDetail.adjustLabourCost'(newValue, oldValue){ if (newValue === undefined || newValue === null){ this.quoteDetail.adjustLabourCost = 0; } this.computeTotalCost(); + this.computeQuoteTotalCost(); }, 'quoteDetail.adjustToolCost'(newValue, oldValue){ if (newValue === undefined || newValue === null){ this.quoteDetail.adjustToolCost = 0; } this.computeTotalCost(); + this.computeQuoteTotalCost(); }, 'quoteDetail.manageCost'(newValue, oldValue){ if (newValue === undefined || newValue === null){ this.quoteDetail.manageCost = 0; } this.computeTotalCost(); + this.computeQuoteTotalCost(); }, 'quoteDetail.otherCost'(newValue, oldValue){ if (newValue === undefined || newValue === null){ this.quoteDetail.otherCost = 0; } this.computeTotalCost(); + this.computeQuoteTotalCost(); }, 'quoteDetail.profitRate'(newValue, oldValue){ if (newValue === undefined || newValue === null){ @@ -165,12 +207,24 @@ export default { } this.computeProfitAmount(); }, + 'quoteDetail.quoteProfitRate'(newValue, oldValue){ + if (newValue === undefined || newValue === null){ + this.quoteDetail.quoteProfitRate = 0; + } + this.computeQuoteProfitAmount(); + }, 'quoteDetail.taxRate'(newValue, oldValue){ if (newValue === undefined || newValue === null){ this.quoteDetail.taxRate = 0; } this.computeTaxCost(); }, + 'quoteDetail.quoteTaxRate'(newValue, oldValue){ + if (newValue === undefined || newValue === null){ + this.quoteDetail.quoteTaxRate = 0; + } + this.computeQuoteTaxCost(); + }, } } @@ -179,19 +233,26 @@ export default {