|
|
@ -15,9 +15,13 @@ export default { |
|
|
}, |
|
|
}, |
|
|
data(){ |
|
|
data(){ |
|
|
return { |
|
|
return { |
|
|
|
|
|
computeLoading:false, |
|
|
rules:{ |
|
|
rules:{ |
|
|
adjustPartCost: [ |
|
|
adjustPartCost: [ |
|
|
{ required: true, message: "请输入材料成本", trigger: ["blur","change"] } |
|
|
|
|
|
|
|
|
{ required: true, message: "请输入材料标准成本", trigger: ["blur","change"] } |
|
|
|
|
|
], |
|
|
|
|
|
adjustBomUnYield: [ |
|
|
|
|
|
{ required: true, message: "请输入材料实际成本", trigger: ["blur","change"] } |
|
|
], |
|
|
], |
|
|
adjustMachineCost: [ |
|
|
adjustMachineCost: [ |
|
|
{ required: true, message: "请输入机器成本", trigger: ["blur","change"] } |
|
|
{ required: true, message: "请输入机器成本", trigger: ["blur","change"] } |
|
|
@ -50,6 +54,7 @@ export default { |
|
|
computeTotalCost(){ |
|
|
computeTotalCost(){ |
|
|
this.quoteDetail.totalCost = |
|
|
this.quoteDetail.totalCost = |
|
|
this.quoteDetail.adjustPartCost + |
|
|
this.quoteDetail.adjustPartCost + |
|
|
|
|
|
this.quoteDetail.adjustBomUnYield + |
|
|
this.quoteDetail.adjustMachineCost + |
|
|
this.quoteDetail.adjustMachineCost + |
|
|
this.quoteDetail.adjustFabricateCost + |
|
|
this.quoteDetail.adjustFabricateCost + |
|
|
this.quoteDetail.adjustLabourCost + |
|
|
this.quoteDetail.adjustLabourCost + |
|
|
@ -77,8 +82,13 @@ export default { |
|
|
let params = { |
|
|
let params = { |
|
|
...this.quoteDetail |
|
|
...this.quoteDetail |
|
|
} |
|
|
} |
|
|
|
|
|
this.computeLoading = true |
|
|
queryQuoteDetailAllCost(params).then(({data})=>{ |
|
|
queryQuoteDetailAllCost(params).then(({data})=>{ |
|
|
if (data && data.code === 0){ |
|
|
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.toolCost = data.row.toolCost; |
|
|
this.quoteDetail.adjustToolCost = data.row.toolCost; |
|
|
this.quoteDetail.adjustToolCost = data.row.toolCost; |
|
|
this.quoteDetail.packCost = data.row.packCost; |
|
|
this.quoteDetail.packCost = data.row.packCost; |
|
|
@ -87,8 +97,10 @@ export default { |
|
|
}else { |
|
|
}else { |
|
|
this.$message.warning(data.msg); |
|
|
this.$message.warning(data.msg); |
|
|
} |
|
|
} |
|
|
|
|
|
this.computeLoading = false |
|
|
}).catch((error)=>{ |
|
|
}).catch((error)=>{ |
|
|
this.$message.error(error); |
|
|
this.$message.error(error); |
|
|
|
|
|
this.computeLoading = false |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}, |
|
|
}, |
|
|
@ -99,6 +111,12 @@ export default { |
|
|
} |
|
|
} |
|
|
this.computeTotalCost(); |
|
|
this.computeTotalCost(); |
|
|
}, |
|
|
}, |
|
|
|
|
|
'quoteDetail.adjustBomUnYield'(newValue, oldValue){ |
|
|
|
|
|
if (newValue === undefined || newValue === null){ |
|
|
|
|
|
this.quoteDetail.adjustPartCost = 0; |
|
|
|
|
|
} |
|
|
|
|
|
this.computeTotalCost(); |
|
|
|
|
|
}, |
|
|
'quoteDetail.adjustMachineCost'(newValue, oldValue){ |
|
|
'quoteDetail.adjustMachineCost'(newValue, oldValue){ |
|
|
if (newValue === undefined || newValue === null){ |
|
|
if (newValue === undefined || newValue === null){ |
|
|
this.quoteDetail.adjustMachineCost = 0; |
|
|
this.quoteDetail.adjustMachineCost = 0; |
|
|
@ -154,7 +172,7 @@ export default { |
|
|
|
|
|
|
|
|
<template> |
|
|
<template> |
|
|
<div> |
|
|
<div> |
|
|
<el-button type="primary" @click="handleQueryAllCost"> 计 算</el-button> |
|
|
|
|
|
|
|
|
<el-button :loading="computeLoading" type="primary" @click="handleQueryAllCost"> 计 算</el-button> |
|
|
<!--系统自动计算结果--> |
|
|
<!--系统自动计算结果--> |
|
|
<el-form :model="quoteDetail" ref="costForm" :rules="rules" label-position="top" label-width="120px"> |
|
|
<el-form :model="quoteDetail" ref="costForm" :rules="rules" label-position="top" label-width="120px"> |
|
|
<fieldset |
|
|
<fieldset |
|
|
@ -168,9 +186,9 @@ export default { |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="4"> |
|
|
<el-col :span="4"> |
|
|
<el-form-item label="材料实际成本:" prop="partCost" :show-message="false"> |
|
|
|
|
|
|
|
|
<el-form-item label="材料实际成本:" prop="bomUnYield" :show-message="false"> |
|
|
<el-input-number style="width: 100%; " :controls="false" |
|
|
<el-input-number style="width: 100%; " :controls="false" |
|
|
v-model="quoteDetail.partCost" :precision="4" disabled/> |
|
|
|
|
|
|
|
|
v-model="quoteDetail.bomUnYield" :precision="4" disabled/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="4"> |
|
|
<el-col :span="4"> |
|
|
@ -210,9 +228,9 @@ export default { |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="4"> |
|
|
<el-col :span="4"> |
|
|
<el-form-item label="材料实际成本:" prop="adjustPartCost" :show-message="false"> |
|
|
|
|
|
|
|
|
<el-form-item label="材料实际成本:" prop="adjustBomUnYield" :show-message="false"> |
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
v-model="quoteDetail.adjustPartCost" :step="0" :precision="4" :min="0"/> |
|
|
|
|
|
|
|
|
v-model="quoteDetail.adjustBomUnYield" :step="0" :precision="4" :min="0"/> |
|
|
</el-form-item> |
|
|
</el-form-item> |
|
|
</el-col> |
|
|
</el-col> |
|
|
<el-col :span="4"> |
|
|
<el-col :span="4"> |
|
|
|