Browse Source

2024-03-22 报价BOM修改

master
zelian_wu 3 years ago
parent
commit
a37dc298bb
  1. 1
      src/api/quotation/quoteOfBom.js
  2. 6
      src/views/modules/part/routingManagement.vue
  3. 34
      src/views/modules/quotation/sellForQuotation/quotationDetail/billOfMateriel.vue
  4. 44
      src/views/modules/quotation/sellForQuotation/quotationDetail/costPrice.vue
  5. 13
      src/views/modules/quotation/sellForQuotation/quotationDetail/propertyTemplates.vue
  6. 164
      src/views/modules/quotation/sellForQuotation/quotationDetail/quoteRouting.vue
  7. 9
      src/views/modules/quotation/sellForQuotation/quotationDetail/toolQuotation.vue
  8. 51
      src/views/modules/quotation/sellForQuotation/quoteDetail.vue

1
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 searchQuoteBomHeader = (data)=>createAPI(`/quote/bom/header`,'get',data);
export const searchQuoteBOMVersion = (data)=>createAPI(`/quote/bom/version/list`,'post',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 searchQuoteBOMAlternativeNo = (data)=>createAPI(`/quote/bom/version/list`,'post',data);
export const searchQuoteBOMAllCost = (data)=>createAPI(`/quote/bom/detail/list`,'post',data);

6
src/views/modules/part/routingManagement.vue

@ -1400,7 +1400,7 @@ export default {
columnProp: 'efficiencyFactor', columnProp: 'efficiencyFactor',
headerAlign: 'center', headerAlign: 'center',
align: 'right', align: 'right',
columnLabel: '机器效率',
columnLabel: '效率%',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
columnSortable: false, columnSortable: false,
@ -1472,7 +1472,7 @@ export default {
columnProp: 'laborRunFactor', columnProp: 'laborRunFactor',
headerAlign: 'center', headerAlign: 'center',
align: 'right', align: 'right',
columnLabel: '人工效率',
columnLabel: '人工生产速度',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
columnSortable: false, columnSortable: false,
@ -1490,7 +1490,7 @@ export default {
columnProp: 'laborSetupTime', columnProp: 'laborSetupTime',
headerAlign: 'center', headerAlign: 'center',
align: 'right', align: 'right',
columnLabel: '人工生产速度',
columnLabel: '人工调机时长',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
columnSortable: false, columnSortable: false,

34
src/views/modules/quotation/sellForQuotation/quotationDetail/billOfMateriel.vue

@ -17,6 +17,18 @@ export default {
height:{ height:{
type:Number, type:Number,
default:400, default:400,
},
updateTree:{
type:Number,
default: 0,
},
loadingStatus:{
type:Boolean,
default:false,
},
totalCost:{
type:Number,
default:-1,
} }
}, },
data(){ data(){
@ -221,6 +233,7 @@ export default {
quoteDetailId:this.detail.quotationDetailId quoteDetailId:this.detail.quotationDetailId
} }
this.treeLoading = true this.treeLoading = true
this.$emit("update:loadingStatus",this.treeLoading)
getBomTreeStructure(params).then(({data})=>{ getBomTreeStructure(params).then(({data})=>{
if (data && data.code === 0){ if (data && data.code === 0){
this.bomTreeStructure = data.rows; this.bomTreeStructure = data.rows;
@ -232,9 +245,11 @@ export default {
this.$message.warning(data.msg) this.$message.warning(data.msg)
} }
this.treeLoading = false; this.treeLoading = false;
this.$emit("update:loadingStatus",this.treeLoading)
}).catch((error)=>{ }).catch((error)=>{
this.$message.error(error) this.$message.error(error)
this.treeLoading = false; this.treeLoading = false;
this.$emit("update:loadingStatus",this.treeLoading)
}) })
}, },
changeSelect(val){ changeSelect(val){
@ -293,8 +308,11 @@ export default {
id:this.selectBom[4], id:this.selectBom[4],
quoteDetailId:this.detail.quotationDetailId quoteDetailId:this.detail.quotationDetailId
} }
this.searchQuoteBomListPost(params)
},
searchQuoteBomListPost(params){
this.dataListLoading = true; this.dataListLoading = true;
this.bomDetailList=[];
this.$emit("update:loadingStatus",this.dataListLoading)
searchQuoteBomList(params).then(({data})=>{ searchQuoteBomList(params).then(({data})=>{
if (data && data.code === 0){ if (data && data.code === 0){
this.bomDetailList = data.rows this.bomDetailList = data.rows
@ -303,12 +321,15 @@ export default {
this.$message.warning(data.msg) this.$message.warning(data.msg)
} }
this.dataListLoading = false; this.dataListLoading = false;
this.$emit("update:loadingStatus",this.dataListLoading)
}).catch((error)=>{ }).catch((error)=>{
this.dataListLoading = false; this.dataListLoading = false;
this.$emit("update:loadingStatus",this.dataListLoading)
this.$message.error(error) this.$message.error(error)
}) })
}, },
computedQuoteBomCost(){ computedQuoteBomCost(){
this.$emit("update:loadingStatus",true)
for (let i = 0; i < this.bomDetailList.length; i++) { for (let i = 0; i < this.bomDetailList.length; i++) {
let bomDetail = this.bomDetailList[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))) 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() 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(){ getQuoteBomCost(){
this.searchQuoteBomList();
// this.searchQuoteBomList();
return this.bomDetailList.reduce((total, currentValue) => { return this.bomDetailList.reduce((total, currentValue) => {
return total + new Decimal(currentValue.quoteUnitCost).toNumber(); return total + new Decimal(currentValue.quoteUnitCost).toNumber();
}, 0) }, 0)
}, },
nodeClick(val){ nodeClick(val){
console.log(val)
this.selectBom = val.value.split("-") this.selectBom = val.value.split("-")
this.bomDetailList=[];
this.$nextTick(()=>{ this.$nextTick(()=>{
this.$refs.tree.setCurrentKey(`${this.selectBom[0]}-${this.selectBom[1]}-${this.selectBom[2]}-${this.selectBom[3]}-${this.selectBom[4]}-${this.selectBom[5]}`) 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}){ 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'} return {'background-color': '#E8F7F6', cursor: 'pointer'}
} }
}, },
@ -430,6 +453,7 @@ export default {
this.selectBom[5] = data.row.parentId; this.selectBom[5] = data.row.parentId;
this.$message.success(data.msg) this.$message.success(data.msg)
this.getInventoryPartBom(); this.getInventoryPartBom();
this.$emit("update:updateTree",this.updateTree+1)
this.handoffVersion = false this.handoffVersion = false
}else { }else {
this.$message.warning(data.msg) this.$message.warning(data.msg)
@ -445,7 +469,7 @@ export default {
<template> <template>
<div> <div>
<div style="margin-bottom: 5px"> <div style="margin-bottom: 5px">
<el-link style="cursor:pointer;" v-if="this.selectBom.length >= 5" @click="clickVersionCheck">切换版本</el-link>
<el-link style="cursor:pointer;" v-if="this.selectBom.length === 6 && bomTreeStructure.length >= 0" @click="clickVersionCheck">切换版本</el-link>
</div> </div>
<el-container> <el-container>
<el-aside width="24%" style="padding: 0;" :style="{height: height}" v-loading="treeLoading"> <el-aside width="24%" style="padding: 0;" :style="{height: height}" v-loading="treeLoading">

44
src/views/modules/quotation/sellForQuotation/quotationDetail/costPrice.vue

@ -12,14 +12,32 @@ export default {
type: Number, type: Number,
default: 400, default: 400,
}, },
loadingStatus:{
type:Boolean,
default: false,
},
bomCost:{
type:Number,
default:0,
},
toolCost:{
type:Number,
default:0,
},
packCost:{
type:Number,
default:0,
},
shippingCost:{
type:Number,
default:0,
},
}, },
data() { data() {
return { return {
bomCost:0,
machineCost:0, machineCost:0,
fabricateCost:0, fabricateCost:0,
labourCost:0, labourCost:0,
toolCost:0,
packCost:0, packCost:0,
shippingCost:0, shippingCost:0,
rules: { rules: {
@ -90,20 +108,10 @@ export default {
} }
} }
}, },
setCost(bomCost,machineCost,fabricateCost,labourCost,toolCost,packCost,shippingCost){
this.bomCost = bomCost;
this.machineCost = machineCost;
this.fabricateCost = fabricateCost;
this.labourCost = labourCost;
this.toolCost = toolCost;
this.packCost = packCost;
this.shippingCost = shippingCost;
},
computeCost(){ computeCost(){
// this.$message.success(`${this.bomCost},${this.machineCost},${this.fabricateCost},${this.labourCost},${this.toolCost},${this.packCost},${this.shippingCost}`)
//材料成本 //材料成本
this.copyDetail.computePartCost = this.bomCost
this.copyDetail.adjustPartCost = this.bomCost
this.copyDetail.computePartCost = new Decimal(this.bomCost).mul(new Decimal(this.detail.quotationDetailQuantity))
this.copyDetail.adjustPartCost = new Decimal(this.bomCost).mul(new Decimal(this.detail.quotationDetailQuantity))
// 机器成本 // 机器成本
this.copyDetail.computeMachineCost = this.machineCost this.copyDetail.computeMachineCost = this.machineCost
this.copyDetail.adjustMachineCost = this.machineCost this.copyDetail.adjustMachineCost = this.machineCost
@ -114,10 +122,10 @@ export default {
this.copyDetail.computeLabourCost = this.labourCost this.copyDetail.computeLabourCost = this.labourCost
this.copyDetail.adjustLabourCost = this.labourCost this.copyDetail.adjustLabourCost = this.labourCost
// 工具成本 // 工具成本
this.copyDetail.computeToolCost = this.toolCost
this.copyDetail.adjustToolCost = this.toolCost
this.copyDetail.computeToolCost = new Decimal(this.toolCost).mul(new Decimal(this.detail.quotationDetailQuantity))
this.copyDetail.adjustToolCost = new Decimal(this.toolCost).mul(new Decimal(this.detail.quotationDetailQuantity))
// 其他成本 // 其他成本
this.copyDetail.detailOtherCost = new Decimal(this.shippingCost).add(new Decimal(this.packCost)).toSignificantDigits().toNumber()
this.copyDetail.detailOtherCost = new Decimal(this.shippingCost).add(new Decimal(this.packCost)).mul(new Decimal(this.detail.quotationDetailQuantity)).toSignificantDigits().toNumber()
// 管理成本 // 管理成本
this.copyDetail.detailManageCost = 0; this.copyDetail.detailManageCost = 0;
// 利润率 // 利润率
@ -177,7 +185,7 @@ export default {
<template> <template>
<div> <div>
<div> <div>
<el-button type="primary" @click="computeCost"> 计 算</el-button>
<el-button type="primary" :loading="loadingStatus" @click="computeCost"> 计 算 </el-button>
</div> </div>
<!--系统自动计算结果--> <!--系统自动计算结果-->
<el-form :model="copyDetail" ref="costForm" :rules="rules" label-position="top" label-width="120px"> <el-form :model="copyDetail" ref="costForm" :rules="rules" label-position="top" label-width="120px">

13
src/views/modules/quotation/sellForQuotation/quotationDetail/propertyTemplates.vue

@ -12,7 +12,15 @@ export default {
height:{ height:{
type:Number, type:Number,
default:400, default:400,
}
},
packCost:{
type:Number,
default:0,
},
shippingCost:{
type:Number,
default:0,
},
}, },
data(){ data(){
return{ return{
@ -158,6 +166,9 @@ export default {
getItemModal(params).then(({data})=>{ getItemModal(params).then(({data})=>{
if (data && data.code === 0){ if (data && data.code === 0){
this.propertyTemplatesItemList = data.rows; this.propertyTemplatesItemList = data.rows;
// 价格
this.$emit("update:packCost",this.getPackInfoCost())
this.$emit("update:shippingCost",this.getShippingInfoCost())
}else { }else {
this.$message.warning(data.msg) this.$message.warning(data.msg)
} }

164
src/views/modules/quotation/sellForQuotation/quotationDetail/quoteRouting.vue

@ -24,6 +24,7 @@ export default {
}, },
data(){ data(){
return{ return{
dataListLoading:false,
routingAlternativeList:[], routingAlternativeList:[],
routingVersionList:[], routingVersionList:[],
handoffVersion:false, handoffVersion:false,
@ -71,6 +72,91 @@ export default {
status: true, status: true,
fixed: '', fixed: '',
columnWidth: 100, columnWidth: 100,
},{
userId: this.$store.state.user.name,
functionId: 102003,
serialNumber: '102003Table5PartNo',
tableId: "102003Table5",
tableName: "报价工艺信息",
columnProp: 'partNo',
headerAlign: "center",
align: "left",
columnLabel: '物料编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},{
userId: this.$store.state.user.name,
functionId: 102003,
serialNumber: '102003Table5PartDesc',
tableId: "102003Table5",
tableName: "报价工艺信息",
columnProp: 'partDesc',
headerAlign: "center",
align: "left",
columnLabel: '物料描述',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 200,
},{
userId: this.$store.state.user.name,
functionId: 102003,
serialNumber: '102003Table5Version',
tableId: "102003Table5",
tableName: "报价工艺信息",
columnProp: 'version',
headerAlign: "center",
align: "center",
columnLabel: '版本',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80,
},{
userId: this.$store.state.user.name,
functionId: 102003,
serialNumber: '102003Table5AlternativeNo',
tableId: "102003Table5",
tableName: "报价工艺信息",
columnProp: 'alternativeNo',
headerAlign: "center",
align: "left",
columnLabel: '替代编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 100,
},{
userId: this.$store.state.user.name,
functionId: 102003,
serialNumber: '102003Table5AlternativeDesc',
tableId: "102003Table5",
tableName: "报价工艺信息",
columnProp: 'alternativeDesc',
headerAlign: "center",
align: "left",
columnLabel: '替代描述',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120,
},{ },{
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
functionId: 102003, functionId: 102003,
@ -114,7 +200,7 @@ export default {
columnProp: 'efficiencyFactor', columnProp: 'efficiencyFactor',
headerAlign: "center", headerAlign: "center",
align: "right", align: "right",
columnLabel: '机器效率',
columnLabel: '效率%',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
columnSortable: false, columnSortable: false,
@ -182,7 +268,7 @@ export default {
columnProp: 'laborRunFactor', columnProp: 'laborRunFactor',
headerAlign: "center", headerAlign: "center",
align: "right", align: "right",
columnLabel: '人工效率',
columnLabel: '人工生产速度',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
columnSortable: false, columnSortable: false,
@ -199,7 +285,7 @@ export default {
columnProp: 'laborSetupTime', columnProp: 'laborSetupTime',
headerAlign: "center", headerAlign: "center",
align: "right", align: "right",
columnLabel: '人工生产速度',
columnLabel: '人工调机时长',
columnHidden: false, columnHidden: false,
columnImage: false, columnImage: false,
columnSortable: false, columnSortable: false,
@ -299,22 +385,26 @@ export default {
}, },
methods:{ methods:{
nodeClick(val){ nodeClick(val){
this.selectRouting = val.value.split("-")
this.$nextTick(()=>{ this.$nextTick(()=>{
this.$refs.tree.setCurrentKey(`${this.selectRouting[0]}-${this.selectRouting[1]}`)
this.$refs.tree.setCurrentKey(`${this.selectRouting[0]}-${this.selectRouting[1]}-${this.selectRouting[2]}-${this.selectRouting[3]}-${this.selectRouting[4]}-${this.selectRouting[5]}`)
}) })
this.searchQuoteRoutingList()
}, },
getRoutingTreeStructure(){ getRoutingTreeStructure(){
let params = { let params = {
site:this.detail.site, site:this.detail.site,
testPartNo:this.detail.productNo
testPartNo:this.detail.productNo,
quoteDetailId:this.detail.quotationDetailId
} }
this.treeLoading = true; this.treeLoading = true;
getRoutingTreeStructure(params).then(({data})=>{ getRoutingTreeStructure(params).then(({data})=>{
if (data && data.code === 0){ if (data && data.code === 0){
this.routingTreeStructure = data.rows; this.routingTreeStructure = data.rows;
this.$nextTick(()=>{ this.$nextTick(()=>{
this.$refs.tree.setCurrentKey(`${this.selectRouting[0]}-${this.selectRouting[1]}`)
this.$refs.tree.setCurrentKey(`${this.selectRouting[0]}-${this.selectRouting[1]}-${this.selectRouting[2]}-${this.selectRouting[3]}-${this.selectRouting[4]}-${this.selectRouting[5]}`)
}) })
this.searchQuoteRoutingList();
}else { }else {
this.$message.warning(data.msg) this.$message.warning(data.msg)
} }
@ -338,7 +428,7 @@ export default {
}).catch(() => { }).catch(() => {
this.selectRouting = JSON.parse(JSON.stringify(this.copyRouting)) this.selectRouting = JSON.parse(JSON.stringify(this.copyRouting))
this.$nextTick(()=>{ this.$nextTick(()=>{
this.$refs.tree.setCurrentKey(`${this.selectRouting[0]}-${this.selectRouting[1]}`)
this.$refs.tree.setCurrentKey(`${this.selectRouting[0]}-${this.selectRouting[1]}-${this.selectRouting[2]}-${this.selectRouting[3]}-${this.selectRouting[4]}-${this.selectRouting[5]}`)
}) })
}); });
}, },
@ -369,18 +459,21 @@ export default {
} }
this.selectRouting = JSON.parse(JSON.stringify(val)) this.selectRouting = JSON.parse(JSON.stringify(val))
this.getRoutingTreeStructure(); this.getRoutingTreeStructure();
this.searchQuoteRoutingList();
}, },
searchQuoteRoutingList(){ searchQuoteRoutingList(){
let params = { let params = {
site:this.$store.state.user.site, site:this.$store.state.user.site,
testPartNo: this.detail.productNo,
partNo: this.selectRouting[3],
version:this.selectRouting[0], version:this.selectRouting[0],
routingType:this.selectRouting[1],
alternativeNo:this.selectRouting[2],
routingType:this.selectRouting[2],
alternativeNo:this.selectRouting[1],
id:this.selectRouting[4],
quoteDetailId:this.detail.quotationDetailId quoteDetailId:this.detail.quotationDetailId
} }
this.routingDetailList = [];
this.dataListLoading = true;
searchQuoteRoutingList(params).then(({data})=>{ searchQuoteRoutingList(params).then(({data})=>{
this.dataListLoading = false;
if (data && data.code === 0){ if (data && data.code === 0){
this.routingDetailList = data.rows this.routingDetailList = data.rows
this.computedQuoteRoutingCost(); this.computedQuoteRoutingCost();
@ -388,6 +481,7 @@ export default {
this.$message.warning(data.msg) this.$message.warning(data.msg)
} }
}).catch((error)=>{ }).catch((error)=>{
this.dataListLoading = false;
this.$message.error(error) this.$message.error(error)
}) })
}, },
@ -414,7 +508,7 @@ export default {
} }
}, },
alternativeRowStyle({row}){ alternativeRowStyle({row}){
if (row.version === this.selectRouting[0] && row.routingType === this.selectRouting[1] && row.alternativeNo === this.selectRouting[2]){
if (row.version === this.versionData.version && row.routingType === this.versionData.routingType && row.alternativeNo === this.versionData.alternativeNo){
return {'background-color': '#E8F7F6', cursor: 'pointer'} return {'background-color': '#E8F7F6', cursor: 'pointer'}
} }
}, },
@ -425,9 +519,9 @@ export default {
}, },
clickAlternative(row){ clickAlternative(row){
let params = { let params = {
id:this.selectRouting[4],
site:this.$store.state.user.site, site:this.$store.state.user.site,
testPartNo: this.detail.productNo,
partNo: this.detail.productNo,
partNo: row.partNo,
version:row.version, version:row.version,
routingType:row.routingType, routingType:row.routingType,
alternativeNo:row.alternativeNo, alternativeNo:row.alternativeNo,
@ -435,13 +529,7 @@ export default {
} }
updateQuoteRoutingList(params).then(({data})=>{ updateQuoteRoutingList(params).then(({data})=>{
if (data && data.code === 0){ if (data && data.code === 0){
this.selectRouting[0] = row.version;
this.selectRouting[1] = row.routingType;
this.selectRouting[2] = row.alternativeNo;
this.$message.success(data.msg) this.$message.success(data.msg)
this.$nextTick(()=>{
this.$refs.tree.setCurrentKey(`${this.selectRouting[0]}-${this.selectRouting[1]}`)
})
this.searchQuoteRoutingList(); this.searchQuoteRoutingList();
this.handoffVersion = false this.handoffVersion = false
}else { }else {
@ -452,30 +540,41 @@ export default {
}) })
}, },
clickVersionCheck(){ clickVersionCheck(){
this.handoffVersion = true;
this.routingVersionList = [];
this.versionData = {
version:this.selectRouting[0],
routingType:this.selectRouting[1]
}
this.routingAlternativeList = []
this.routingVersionList = []
this.versionData = {};
this.searchQuoteRoutingVersion(); this.searchQuoteRoutingVersion();
}, },
searchQuoteRoutingVersion(){ searchQuoteRoutingVersion(){
let params = { let params = {
site:this.detail.site, site:this.detail.site,
quoteDetailId:this.detail.quotationDetailId, quoteDetailId:this.detail.quotationDetailId,
partNo:this.detail.productNo,
partNo:this.selectRouting[3],
id:this.selectRouting[4]
} }
this.routingVersionList = []; this.routingVersionList = [];
searchQuoteRoutingAlternativeNo(params).then(({data})=>{ searchQuoteRoutingAlternativeNo(params).then(({data})=>{
if (data && data.code === 0){ if (data && data.code === 0){
this.routingVersionList = data.rows; this.routingVersionList = data.rows;
this.selectionVersion();//默认选择项
this.handoffVersion = true;
if (data.row !== undefined && data.row !== null){
this.versionData = {
partNo:data.row.partNo,
site:data.row.site,
version:data.row.version,
routingType:data.row.routingType,
alternativeNo:data.row.alternativeNo
}
}else {
this.selectionVersion();//默认选择项
}
// 查询替代 // 查询替代
this.searchRoutingAlternative(this.versionData); this.searchRoutingAlternative(this.versionData);
}else { }else {
this.$message.warning(data.msg) this.$message.warning(data.msg)
} }
}).catch((error)=>{
this.$message.error(error)
}) })
}, },
selectionVersion(){ selectionVersion(){
@ -514,7 +613,7 @@ export default {
<template> <template>
<div> <div>
<div style="margin-bottom: 5px"><el-link @click="clickVersionCheck">切换版本</el-link></div>
<div style="margin-bottom: 5px"><el-link style="cursor:pointer;" v-if="this.selectRouting.length === 6" @click="clickVersionCheck">切换版本</el-link></div>
<el-container> <el-container>
<el-aside width="24%" style="padding: 0;" :style="{height: height}" v-loading="treeLoading"> <el-aside width="24%" style="padding: 0;" :style="{height: height}" v-loading="treeLoading">
<el-tree :data="routingTreeStructure" <el-tree :data="routingTreeStructure"
@ -528,7 +627,8 @@ export default {
</el-aside> </el-aside>
<el-main style="padding: 0"> <el-main style="padding: 0">
<el-table :data="routingDetailList" :height="height" <el-table :data="routingDetailList" :height="height"
stripe border style="margin-top: 10px">
stripe border element-loading-text = "数据正在加载中"
v-loading="dataListLoading">
<el-table-column <el-table-column
v-for="(item,index) in columnDetailList" :key="index" v-for="(item,index) in columnDetailList" :key="index"
:sortable="item.columnSortable" :sortable="item.columnSortable"
@ -547,7 +647,7 @@ export default {
</el-table> </el-table>
</el-main> </el-main>
</el-container> </el-container>
<el-dialog :visible.sync="handoffVersion" title="工艺版本切换" append-to-body>
<el-dialog :visible.sync="handoffVersion" title="工艺版本切换" v-drag append-to-body>
<el-table :data="routingVersionList" :row-style="versionRowStyle" ref="routingVersionTable" style="margin-top: 8px" border :height="240" @row-click="clickVersionTable"> <el-table :data="routingVersionList" :row-style="versionRowStyle" ref="routingVersionTable" style="margin-top: 8px" border :height="240" @row-click="clickVersionTable">
<el-table-column label="物料编码" prop="partNo" header-align="center" align="center" show-overflow-tooltip min-width="140"/> <el-table-column label="物料编码" prop="partNo" header-align="center" align="center" show-overflow-tooltip min-width="140"/>
<el-table-column label="物料描述" prop="partDesc" header-align="center" align="left" show-overflow-tooltip min-width="200"/> <el-table-column label="物料描述" prop="partDesc" header-align="center" align="left" show-overflow-tooltip min-width="200"/>
@ -563,7 +663,7 @@ export default {
<el-table-column label="类型" prop="routingType" header-align="center" align="center" show-overflow-tooltip min-width="100"/> <el-table-column label="类型" prop="routingType" header-align="center" align="center" show-overflow-tooltip min-width="100"/>
<el-table-column label="操作" min-width="80" header-align="center" align="center"> <el-table-column label="操作" min-width="80" header-align="center" align="center">
<template slot-scope="{row,$index}"> <template slot-scope="{row,$index}">
<span style="color: #888;cursor:no-drop;" v-if="row.version === selectRouting[0] && row.routingType === selectRouting[1] && row.alternativeNo === selectRouting[2]">选择</span>
<span style="color: #888;cursor:no-drop;" v-if="row.version === versionData.version && row.routingType === versionData.routingType && row.alternativeNo === versionData.alternativeNo">选择</span>
<el-link style="cursor:pointer;" v-else @click="clickAlternative(row)">选择</el-link> <el-link style="cursor:pointer;" v-else @click="clickAlternative(row)">选择</el-link>
</template> </template>
</el-table-column> </el-table-column>

9
src/views/modules/quotation/sellForQuotation/quotationDetail/toolQuotation.vue

@ -17,6 +17,10 @@ export default {
height:{ height:{
type:Number, type:Number,
default:400, default:400,
},
totalCost: {
type:Number,
default:0,
} }
}, },
data(){ data(){
@ -220,7 +224,7 @@ export default {
}, },
methods:{ methods:{
getQuotationToolList(){ getQuotationToolList(){
this.initQuotationToolData();
// this.initQuotationToolData();
// 计算成本 // 计算成本
return this.quotationToolList.reduce((total, currentValue) => { return this.quotationToolList.reduce((total, currentValue) => {
return total + new Decimal(currentValue.quotationUnitCost).toNumber(); return total + new Decimal(currentValue.quotationUnitCost).toNumber();
@ -235,6 +239,9 @@ export default {
this.initQuotationToolLoading = false; this.initQuotationToolLoading = false;
if (data && data.code === 200) { if (data && data.code === 200) {
this.quotationToolList = data.data; this.quotationToolList = data.data;
this.$emit("update:totalCost",this.getQuotationToolList());
}else {
this.$message.warning(data.msg)
} }
}).catch((error)=>{ }).catch((error)=>{
this.initQuotationToolLoading = false; this.initQuotationToolLoading = false;

51
src/views/modules/quotation/sellForQuotation/quoteDetail.vue

@ -26,6 +26,10 @@ export default {
watch:{ watch:{
header:function (){ header:function (){
this.initData() this.initData()
},
update(){
// 当bom触发修改版本时触发
this.searchQuoteRoutingHeader();
} }
}, },
data(){ data(){
@ -53,6 +57,12 @@ export default {
}) })
}; };
return{ return{
BOMCost:0,
ToolCost:0,
packInfoCost:0,
shippingInfoCost:0,
loadingStatus:false,
update:0,
index:'', index:'',
insertQuotationDetailLoading:false, insertQuotationDetailLoading:false,
projectPartDialogFlag:false, projectPartDialogFlag:false,
@ -843,7 +853,6 @@ export default {
this.$refs.property.getPropertyTemplatesItem();// 属性 this.$refs.property.getPropertyTemplatesItem();// 属性
this.$refs.tool.initQuotationToolData();//刀具 this.$refs.tool.initQuotationToolData();//刀具
this.searchQuoteBomList();//bom this.searchQuoteBomList();//bom
this.searchQuoteRoutingHeader();// routing
}) })
}, },
searchQuoteRoutingHeader(){ searchQuoteRoutingHeader(){
@ -858,8 +867,11 @@ export default {
let arr = []; let arr = [];
if (row){ if (row){
arr[0] = row.version; arr[0] = row.version;
arr[1] = row.routingType;
arr[2] = row.alternativeNo;
arr[1] = row.alternativeNo;
arr[2] = row.routingType;
arr[3] = row.partNo;
arr[4] = row.id;
arr[5] = row.parentId;
} }
this.$refs.routing.setSelectRouting(arr); this.$refs.routing.setSelectRouting(arr);
}else { }else {
@ -875,11 +887,12 @@ export default {
quoteDetailId:this.quotationDetail.quotationDetailId, quoteDetailId:this.quotationDetail.quotationDetailId,
testPartNo:this.quotationDetail.productNo testPartNo:this.quotationDetail.productNo
} }
this.loadingStatus = true
searchQuoteBomHeader(params).then(({data})=>{ searchQuoteBomHeader(params).then(({data})=>{
if (data && data.code === 0){ if (data && data.code === 0){
let row = data.row let row = data.row
let arr = []; let arr = [];
if (row){
if (row !== null){
arr[0] = row.version; arr[0] = row.version;
arr[1] = row.alternativeNo; arr[1] = row.alternativeNo;
arr[2] = row.bomType; arr[2] = row.bomType;
@ -888,10 +901,13 @@ export default {
arr[5] = row.parentId; arr[5] = row.parentId;
} }
this.$refs.bom.setSelectBom(arr); this.$refs.bom.setSelectBom(arr);
this.searchQuoteRoutingHeader();// routing
}else { }else {
this.$message.warning(data.msg) this.$message.warning(data.msg)
} }
this.loadingStatus = false
}).catch((error)=>{ }).catch((error)=>{
this.loadingStatus = false
this.$message.error(error) this.$message.error(error)
}) })
}, },
@ -919,20 +935,9 @@ export default {
}, },
tabClick(tab){ tabClick(tab){
if (this.activeName === 'cost'){ if (this.activeName === 'cost'){
this.setQuoteCost();
this.searchQuoteBomList();
} }
}, },
setQuoteCost(){
let bomCost = new Decimal(this.$refs.bom.getQuoteBomCost()).mul(new Decimal(this.quotationDetail.quotationDetailQuantity))
let toolCost = new Decimal(this.$refs.tool.getQuotationToolList()).mul(new Decimal(this.quotationDetail.quotationDetailQuantity))
let packCost = new Decimal(this.$refs.property.getPackInfoCost()).mul(new Decimal(this.quotationDetail.quotationDetailQuantity))
let shippingCost = new Decimal(this.$refs.property.getShippingInfoCost()).mul(new Decimal(this.quotationDetail.quotationDetailQuantity))
this.$nextTick(()=>{
this.$refs.cost
.setCost(bomCost,0,0,0,toolCost,
packCost,shippingCost)
})
},
editQuotationDetailStatus(row,status){ editQuotationDetailStatus(row,status){
let params = JSON.parse(JSON.stringify(row)) let params = JSON.parse(JSON.stringify(row))
params.quotationDetailStatus = status; params.quotationDetailStatus = status;
@ -1080,19 +1085,25 @@ export default {
</el-form> </el-form>
<el-tabs v-model="activeName" @tab-click="tabClick" :style="{height:`${fullscreen?740:500}px`}" border stripe> <el-tabs v-model="activeName" @tab-click="tabClick" :style="{height:`${fullscreen?740:500}px`}" border stripe>
<el-tab-pane name="bom" label="材料"> <el-tab-pane name="bom" label="材料">
<bill-of-materiel ref="bom" v-if="quotationDetailFlag" :height="fullscreen?655:415" :detail="quotationDetail"></bill-of-materiel>
<bill-of-materiel ref="bom" :total-cost.sync="BOMCost" :loading-status.sync="loadingStatus" :updateTree.sync="update" v-if="quotationDetailFlag" :height="fullscreen?655:415" :detail="quotationDetail"></bill-of-materiel>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="routing" label="工艺"> <el-tab-pane name="routing" label="工艺">
<quote-routing ref="routing" v-if="quotationDetailFlag" :height="fullscreen?655:415" :detail="quotationDetail"></quote-routing> <quote-routing ref="routing" v-if="quotationDetailFlag" :height="fullscreen?655:415" :detail="quotationDetail"></quote-routing>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="tool" label="工具"> <el-tab-pane name="tool" label="工具">
<tool-quotation ref="tool" v-if="quotationDetailFlag" :height="fullscreen?660:420" :detail="quotationDetail"></tool-quotation>
<tool-quotation ref="tool" :total-cost.sync="ToolCost" v-if="quotationDetailFlag" :height="fullscreen?660:420" :detail="quotationDetail"></tool-quotation>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="property" label="成品属性"> <el-tab-pane name="property" label="成品属性">
<property-templates ref="property" v-if="quotationDetailFlag" :height="fullscreen?660:420" :detail="quotationDetail" ></property-templates>
<property-templates ref="property" :pack-cost.sync="packInfoCost" :shipping-cost.sync="shippingInfoCost" v-if="quotationDetailFlag" :height="fullscreen?660:420" :detail="quotationDetail" ></property-templates>
</el-tab-pane> </el-tab-pane>
<el-tab-pane name="cost" label="成本&价格"> <el-tab-pane name="cost" label="成本&价格">
<cost-price ref="cost" v-if="quotationDetailFlag" :height="fullscreen?660:420" :detail="quotationDetail"></cost-price>
<cost-price ref="cost" :tool-cost.sync="ToolCost"
:bom-cost.sync="BOMCost"
:pack-cost.sync="packInfoCost" :shipping-cost.sync="shippingInfoCost"
:loading-status.sync="loadingStatus"
v-if="quotationDetailFlag"
:height="fullscreen?660:420"
:detail="quotationDetail"></cost-price>
</el-tab-pane> </el-tab-pane>
</el-tabs> </el-tabs>
<div slot="footer" style="padding-top: 10px"> <div slot="footer" style="padding-top: 10px">

Loading…
Cancel
Save