diff --git a/src/api/quote/quoteDetail.js b/src/api/quote/quoteDetail.js index 230176c..827b64e 100644 --- a/src/api/quote/quoteDetail.js +++ b/src/api/quote/quoteDetail.js @@ -11,3 +11,5 @@ export const updateQuoteDetail = (data) => createAPI(`/quote/detail/update`,'pos export const deleteQuoteDetail = (data) => createAPI(`/quote/detail/remove/${data.id}`,'post',data) export const queryQuoteDetailAllCost = (data) => createAPI(`/quote/detail/cost`,'post',data) + +export const queryQuoteDetailYield = (data) => createAPI(`/quote/detail/yield`,'post',data) diff --git a/src/views/modules/quote/detail/primary/quoteDetailBom.vue b/src/views/modules/quote/detail/primary/quoteDetailBom.vue index 162a095..0b1b96e 100644 --- a/src/views/modules/quote/detail/primary/quoteDetailBom.vue +++ b/src/views/modules/quote/detail/primary/quoteDetailBom.vue @@ -195,10 +195,10 @@ export default { { userId: this.$store.state.user.name, functionId: 5011, - serialNumber: '5011Table4UnitPrice', + serialNumber: '5011Table4ActualPrice', tableId: "5011Table4", tableName: "报价材料信息", - columnProp: 'unitPrice', + columnProp: 'actualPrice', headerAlign: "center", align: "right", columnLabel: '单位实际成本', @@ -219,22 +219,22 @@ export default { columnProp: 'quotePrice', headerAlign: "center", align: "right", - columnLabel: '材料总成本', + columnLabel: '材料标准总成本', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: 'right', - columnWidth: 90, + columnWidth: 100, }, { userId: this.$store.state.user.name, functionId: 5011, - serialNumber: '5011Table4QuotePrice', + serialNumber: '5011Table4ActualQuotePrice', tableId: "5011Table4", tableName: "报价材料信息", - columnProp: 'quotePrice', + columnProp: 'actualQuotePrice', headerAlign: "center", align: "right", columnLabel: '材料实际总成本', @@ -244,7 +244,7 @@ export default { sortLv: 0, status: true, fixed: 'right', - columnWidth: 90, + columnWidth: 100, }, ], props:{ @@ -316,23 +316,32 @@ export default { handleCheckedVersion(){ this.handleQueryQuoteDetailBomTreeVersion(); let node = this.$refs.tree.getCurrentNode(); - this.bomEngChgLevel = { - partNo: node.partNo, - bomType: node.bomType, - buNo: node.buNo, - site: node.site, - engChgLevel: node.engChgLevel, - alternativeNo: node.alternativeNo, + if (node){ + this.bomEngChgLevel = { + partNo: node.partNo, + bomType: node.bomType, + buNo: node.buNo, + site: node.site, + engChgLevel: node.engChgLevel, + alternativeNo: node.alternativeNo, + } } this.versionVisible = true }, handleQueryQuoteDetailBomTreeVersion(){ let node = this.$refs.tree.getCurrentNode(); let params = { - site:node.site, - partNo:node.partNo, - bomType:node.bomType, - buNo:node.buNo, + site:this.quoteDetail.site, + partNo:this.quoteDetail.partNo, + buNo:this.quoteDetail.buNo, + } + if (node){ + params = { + site:node.site, + partNo:node.partNo, + bomType:node.bomType, + buNo:node.buNo, + } } queryQuoteDetailBomTreeLevel(params).then(({data})=>{ if (data && data.code === 0){ diff --git a/src/views/modules/quote/detail/primary/quoteDetailCost.vue b/src/views/modules/quote/detail/primary/quoteDetailCost.vue index 928b45c..805d274 100644 --- a/src/views/modules/quote/detail/primary/quoteDetailCost.vue +++ b/src/views/modules/quote/detail/primary/quoteDetailCost.vue @@ -15,9 +15,13 @@ export default { }, data(){ return { + computeLoading:false, rules:{ adjustPartCost: [ - { required: true, message: "请输入材料成本", trigger: ["blur","change"] } + { required: true, message: "请输入材料标准成本", trigger: ["blur","change"] } + ], + adjustBomUnYield: [ + { required: true, message: "请输入材料实际成本", trigger: ["blur","change"] } ], adjustMachineCost: [ { required: true, message: "请输入机器成本", trigger: ["blur","change"] } @@ -50,6 +54,7 @@ export default { computeTotalCost(){ this.quoteDetail.totalCost = this.quoteDetail.adjustPartCost + + this.quoteDetail.adjustBomUnYield + this.quoteDetail.adjustMachineCost + this.quoteDetail.adjustFabricateCost + this.quoteDetail.adjustLabourCost + @@ -77,8 +82,13 @@ export default { let params = { ...this.quoteDetail } + this.computeLoading = true queryQuoteDetailAllCost(params).then(({data})=>{ if (data && data.code === 0){ + this.quoteDetail.partCost = data.row.unitQuotePrice; + this.quoteDetail.adjustPartCost = data.row.unitQuotePrice; + this.quoteDetail.bomUnYield = data.row.actualQuotePrice; + this.quoteDetail.adjustBomUnYield = data.row.actualQuotePrice; this.quoteDetail.toolCost = data.row.toolCost; this.quoteDetail.adjustToolCost = data.row.toolCost; this.quoteDetail.packCost = data.row.packCost; @@ -87,8 +97,10 @@ export default { }else { this.$message.warning(data.msg); } + this.computeLoading = false }).catch((error)=>{ this.$message.error(error); + this.computeLoading = false }) } }, @@ -99,6 +111,12 @@ export default { } this.computeTotalCost(); }, + 'quoteDetail.adjustBomUnYield'(newValue, oldValue){ + if (newValue === undefined || newValue === null){ + this.quoteDetail.adjustPartCost = 0; + } + this.computeTotalCost(); + }, 'quoteDetail.adjustMachineCost'(newValue, oldValue){ if (newValue === undefined || newValue === null){ this.quoteDetail.adjustMachineCost = 0; @@ -154,7 +172,7 @@ export default {