diff --git a/src/views/modules/quotation/toBeQuoted.vue b/src/views/modules/quotation/toBeQuoted.vue index 6b7eaef..15453b5 100644 --- a/src/views/modules/quotation/toBeQuoted.vue +++ b/src/views/modules/quotation/toBeQuoted.vue @@ -605,7 +605,7 @@ export default { this.saveBatchQuotationLoading = true; batchSaveQuote(list).then(({data})=>{ this.saveBatchQuotationLoading = false; - if (data.code === 0){ + if (data && data.code === 0){ this.$message.success(data.msg); this.quoteVisible = false; this.$refs.quotationTable.clearSelection(); diff --git a/src/views/modules/quote/detail/primary/quoteDetailCost.vue b/src/views/modules/quote/detail/primary/quoteDetailCost.vue index 5587de3..560b653 100644 --- a/src/views/modules/quote/detail/primary/quoteDetailCost.vue +++ b/src/views/modules/quote/detail/primary/quoteDetailCost.vue @@ -37,11 +37,17 @@ export default { adjustToolCost: [ { required: true, message: "请输入工具成本", trigger: ["blur","change"] } ], + adjustTestCost: [ + { required: true, message: "请输入测试成本", trigger: ["blur","change"] } + ], + adjustElseCost: [ + { required: true, message: "请输入其他成本", trigger: ["blur","change"] } + ], manageCost: [ { required: true, message: "请输入管理成本", trigger: ["blur","change"] } ], otherCost: [ - { required: true, message: "请输入其他成本", trigger: ["blur","change"] } + { required: true, message: "请输入包装&运输成本", trigger: ["blur","change"] } ], profitRate: [ { required: true, message: "请输入利润率", trigger: ["blur","change"] } @@ -65,7 +71,7 @@ export default { tagNo:undefined, type:undefined, - allCheckedLabel:['工具','测试','其他','包装','运输'], + allCheckedLabel:['工具','测试','其他','包装&运输'], // selectionChecked:[], checkAll:false, @@ -96,9 +102,19 @@ export default { this.quoteDetail.adjustMachineCost + this.quoteDetail.adjustFabricateCost + this.quoteDetail.adjustLabourCost + - this.quoteDetail.adjustToolCost + - this.quoteDetail.manageCost + - this.quoteDetail.otherCost; + this.quoteDetail.manageCost; + if (this.selectionChecked.includes('其他')){ + this.quoteDetail.totalCost += this.quoteDetail.adjustElseCost; + } + if (this.selectionChecked.includes('工具')){ + this.quoteDetail.totalCost += this.quoteDetail.adjustToolCost; + } + if (this.selectionChecked.includes('测试')){ + this.quoteDetail.totalCost += this.quoteDetail.adjustTestCost; + } + if (this.selectionChecked.includes('包装&运输')){ + this.quoteDetail.totalCost += this.quoteDetail.otherCost; + } this.computeCurrencyTotalCost(); this.computeProfitAmount(); }, @@ -109,9 +125,19 @@ export default { this.quoteDetail.adjustMachineCost + this.quoteDetail.adjustFabricateCost + this.quoteDetail.adjustLabourCost + - this.quoteDetail.adjustToolCost + - this.quoteDetail.manageCost + - this.quoteDetail.otherCost; + this.quoteDetail.manageCost; + if (this.selectionChecked.includes('其他')){ + this.quoteDetail.quoteTotalCost += this.quoteDetail.adjustElseCost; + } + if (this.selectionChecked.includes('工具')){ + this.quoteDetail.quoteTotalCost += this.quoteDetail.adjustToolCost; + } + if (this.selectionChecked.includes('测试')){ + this.quoteDetail.quoteTotalCost += this.quoteDetail.adjustTestCost; + } + if (this.selectionChecked.includes('包装&运输')){ + this.quoteDetail.quoteTotalCost += this.quoteDetail.otherCost; + } this.computeQuoteCurrencyTotalCost(); this.computeQuoteProfitAmount(); }, @@ -164,6 +190,10 @@ export default { this.quoteDetail.adjustFabricateCost = data.row.manufactureCost; this.quoteDetail.toolCost = data.row.toolCost; this.quoteDetail.adjustToolCost = data.row.toolCost; + this.quoteDetail.testCost = data.row.testCost; + this.quoteDetail.adjustTestCost = data.row.testCost; + this.quoteDetail.elseCost = data.row.elseCost; + this.quoteDetail.adjustElseCost = data.row.elseCost; this.quoteDetail.packCost = data.row.packCost; this.quoteDetail.shippingCost = data.row.shippingCost; this.quoteDetail.otherCost = data.row.otherCost; @@ -239,6 +269,20 @@ export default { this.computeTotalCost(); this.computeQuoteTotalCost(); }, + 'quoteDetail.adjustTestCost'(newValue, oldValue){ + if (newValue === undefined || newValue === null){ + this.quoteDetail.adjustTestCost = 0; + } + this.computeTotalCost(); + this.computeQuoteTotalCost(); + }, + 'quoteDetail.adjustElseCost'(newValue, oldValue){ + if (newValue === undefined || newValue === null){ + this.quoteDetail.adjustElseCost = 0; + } + this.computeTotalCost(); + this.computeQuoteTotalCost(); + }, 'quoteDetail.manageCost'(newValue, oldValue){ if (newValue === undefined || newValue === null){ this.quoteDetail.manageCost = 0; @@ -319,12 +363,15 @@ export default { }else { this.checkAll = false; } - } + }, }, computed:{ selectionChecked:{ set(newVal){ this.selection = newVal.join(',') + this.quoteDetail.calculatedItems = this.selection; + this.computeTotalCost(); + this.computeQuoteTotalCost(); }, get(){ if (this.selection === '' || this.selection === undefined || this.selection === null){ @@ -335,6 +382,9 @@ export default { } }, mounted() { + if (this.quoteDetail.calculatedItems){ + this.selection = this.quoteDetail.calculatedItems; + } this.$nextTick(()=>{ this.computeProfitAmount() this.computeQuoteProfitAmount() @@ -345,27 +395,21 @@ export default {