diff --git a/src/api/quotation/quoteOfBom.js b/src/api/quotation/quoteOfBom.js index b1744a6..b2943a3 100644 --- a/src/api/quotation/quoteOfBom.js +++ b/src/api/quotation/quoteOfBom.js @@ -7,3 +7,4 @@ export const searchQuoteBomList = (data)=>createAPI(`/quote/bom/list`,'post',dat export const searchQuoteBomHeader = (data)=>createAPI(`/quote/bom/header`,'get',data); export const searchQuoteBOMVersion = (data)=>createAPI(`/quote/bom/version/list`,'post',data); export const searchQuoteBOMAlternativeNo = (data)=>createAPI(`/quote/bom/version/list`,'post',data); +export const searchQuoteBOMAllCost = (data)=>createAPI(`/quote/bom/detail/list`,'post',data); diff --git a/src/views/modules/part/routingManagement.vue b/src/views/modules/part/routingManagement.vue index 03f7fcb..984fc4a 100644 --- a/src/views/modules/part/routingManagement.vue +++ b/src/views/modules/part/routingManagement.vue @@ -1400,7 +1400,7 @@ export default { columnProp: 'efficiencyFactor', headerAlign: 'center', align: 'right', - columnLabel: '机器效率', + columnLabel: '效率%', columnHidden: false, columnImage: false, columnSortable: false, @@ -1472,7 +1472,7 @@ export default { columnProp: 'laborRunFactor', headerAlign: 'center', align: 'right', - columnLabel: '人工效率', + columnLabel: '人工生产速度', columnHidden: false, columnImage: false, columnSortable: false, @@ -1490,7 +1490,7 @@ export default { columnProp: 'laborSetupTime', headerAlign: 'center', align: 'right', - columnLabel: '人工生产速度', + columnLabel: '人工调机时长', columnHidden: false, columnImage: false, columnSortable: false, diff --git a/src/views/modules/quotation/sellForQuotation/quotationDetail/billOfMateriel.vue b/src/views/modules/quotation/sellForQuotation/quotationDetail/billOfMateriel.vue index bf36642..74a0575 100644 --- a/src/views/modules/quotation/sellForQuotation/quotationDetail/billOfMateriel.vue +++ b/src/views/modules/quotation/sellForQuotation/quotationDetail/billOfMateriel.vue @@ -17,6 +17,18 @@ export default { height:{ type:Number, default:400, + }, + updateTree:{ + type:Number, + default: 0, + }, + loadingStatus:{ + type:Boolean, + default:false, + }, + totalCost:{ + type:Number, + default:-1, } }, data(){ @@ -221,6 +233,7 @@ export default { quoteDetailId:this.detail.quotationDetailId } this.treeLoading = true + this.$emit("update:loadingStatus",this.treeLoading) getBomTreeStructure(params).then(({data})=>{ if (data && data.code === 0){ this.bomTreeStructure = data.rows; @@ -232,9 +245,11 @@ export default { this.$message.warning(data.msg) } this.treeLoading = false; + this.$emit("update:loadingStatus",this.treeLoading) }).catch((error)=>{ this.$message.error(error) this.treeLoading = false; + this.$emit("update:loadingStatus",this.treeLoading) }) }, changeSelect(val){ @@ -293,8 +308,11 @@ export default { id:this.selectBom[4], quoteDetailId:this.detail.quotationDetailId } + this.searchQuoteBomListPost(params) + }, + searchQuoteBomListPost(params){ this.dataListLoading = true; - this.bomDetailList=[]; + this.$emit("update:loadingStatus",this.dataListLoading) searchQuoteBomList(params).then(({data})=>{ if (data && data.code === 0){ this.bomDetailList = data.rows @@ -303,12 +321,15 @@ export default { this.$message.warning(data.msg) } this.dataListLoading = false; + this.$emit("update:loadingStatus",this.dataListLoading) }).catch((error)=>{ this.dataListLoading = false; + this.$emit("update:loadingStatus",this.dataListLoading) this.$message.error(error) }) }, computedQuoteBomCost(){ + this.$emit("update:loadingStatus",true) for (let i = 0; i < this.bomDetailList.length; i++) { let bomDetail = this.bomDetailList[i] // 单位成本 @@ -324,16 +345,18 @@ export default { let needNum = componentScrap.div(num).add(qtyPerAssembly.mul(new Decimal(100).sub(shrinkageFactor)).div(new Decimal(100))) bomDetail.quoteUnitCost = new Decimal(needNum.mul(unitCost).toFixed(16,Decimal.ROUND_HALF_UP)).toSignificantDigits().toNumber() } + this.$emit("update:totalCost",this.getQuoteBomCost()) + this.$emit("update:loadingStatus",false) }, getQuoteBomCost(){ - this.searchQuoteBomList(); + // this.searchQuoteBomList(); return this.bomDetailList.reduce((total, currentValue) => { return total + new Decimal(currentValue.quoteUnitCost).toNumber(); }, 0) }, nodeClick(val){ - console.log(val) this.selectBom = val.value.split("-") + this.bomDetailList=[]; this.$nextTick(()=>{ this.$refs.tree.setCurrentKey(`${this.selectBom[0]}-${this.selectBom[1]}-${this.selectBom[2]}-${this.selectBom[3]}-${this.selectBom[4]}-${this.selectBom[5]}`) }) @@ -391,7 +414,7 @@ export default { } }, versionRowStyle({row}){ - if (row.version === this.versionData.version && row.bomType === this.versionData.bomType){ + if (row.version === parseInt(this.versionData.version) && row.bomType === this.versionData.bomType){ return {'background-color': '#E8F7F6', cursor: 'pointer'} } }, @@ -430,6 +453,7 @@ export default { this.selectBom[5] = data.row.parentId; this.$message.success(data.msg) this.getInventoryPartBom(); + this.$emit("update:updateTree",this.updateTree+1) this.handoffVersion = false }else { this.$message.warning(data.msg) @@ -445,7 +469,7 @@ export default {