|
|
|
@ -42,19 +42,28 @@ export default { |
|
|
|
{ required: true, message: "请输入其他成本", trigger: ["blur","change"] } |
|
|
|
], |
|
|
|
profitRate: [ |
|
|
|
{ required: true, message: "请输入利润率", trigger: ["blur","change"] } |
|
|
|
{ required: true, message: "请输入标准利润率", trigger: ["blur","change"] } |
|
|
|
], |
|
|
|
quoteProfitRate: [ |
|
|
|
{ required: true, message: "请输入报价利润率", trigger: ["blur","change"] } |
|
|
|
], |
|
|
|
taxRate: [ |
|
|
|
{ required: true, message: "请输入税率", trigger: ["blur","change"] } |
|
|
|
{ required: true, message: "请输入标准税率", trigger: ["blur","change"] } |
|
|
|
], |
|
|
|
quoteTaxRate: [ |
|
|
|
{ required: true, message: "请输入报价税率", trigger: ["blur","change"] } |
|
|
|
], |
|
|
|
}, |
|
|
|
|
|
|
|
showQuoteCost:true, |
|
|
|
isShowCost:false, |
|
|
|
} |
|
|
|
}, |
|
|
|
methods:{ |
|
|
|
computeTotalCost(){ |
|
|
|
// 标准总成本 |
|
|
|
this.quoteDetail.totalCost = |
|
|
|
this.quoteDetail.adjustPartCost + |
|
|
|
this.quoteDetail.adjustBomUnYield + |
|
|
|
this.quoteDetail.adjustMachineCost + |
|
|
|
this.quoteDetail.adjustFabricateCost + |
|
|
|
this.quoteDetail.adjustLabourCost + |
|
|
|
@ -63,11 +72,28 @@ export default { |
|
|
|
this.quoteDetail.otherCost; |
|
|
|
this.computeProfitAmount(); |
|
|
|
}, |
|
|
|
computeQuoteTotalCost(){ |
|
|
|
// 报价总成本 |
|
|
|
this.quoteDetail.quoteTotalCost = |
|
|
|
this.quoteDetail.adjustBomUnYield + |
|
|
|
this.quoteDetail.adjustMachineCost + |
|
|
|
this.quoteDetail.adjustFabricateCost + |
|
|
|
this.quoteDetail.adjustLabourCost + |
|
|
|
this.quoteDetail.adjustToolCost + |
|
|
|
this.quoteDetail.manageCost + |
|
|
|
this.quoteDetail.otherCost; |
|
|
|
this.computeQuoteProfitAmount(); |
|
|
|
}, |
|
|
|
computeProfitAmount(){ |
|
|
|
this.quoteDetail.profitAmount = |
|
|
|
this.quoteDetail.totalCost * (this.quoteDetail.profitRate / 100); |
|
|
|
this.computeTaxCost(); |
|
|
|
}, |
|
|
|
computeQuoteProfitAmount(){ |
|
|
|
this.quoteDetail.quoteProfitAmount = |
|
|
|
this.quoteDetail.quoteTotalCost * (this.quoteDetail.quoteProfitRate / 100); |
|
|
|
this.computeQuoteTaxCost(); |
|
|
|
}, |
|
|
|
computeTaxCost(){ |
|
|
|
this.quoteDetail.totalPrice = |
|
|
|
this.quoteDetail.totalCost + this.quoteDetail.profitAmount; |
|
|
|
@ -78,6 +104,16 @@ export default { |
|
|
|
this.quoteDetail.taxUnitPrice = |
|
|
|
this.quoteDetail.taxTotalPrice / this.quoteDetail.qty; |
|
|
|
}, |
|
|
|
computeQuoteTaxCost(){ |
|
|
|
this.quoteDetail.quoteTotalPrice = |
|
|
|
this.quoteDetail.quoteTotalCost + this.quoteDetail.quoteProfitAmount; |
|
|
|
this.quoteDetail.quoteUnitPrice = |
|
|
|
this.quoteDetail.quoteTotalPrice / this.quoteDetail.qty; |
|
|
|
this.quoteDetail.quoteTaxTotalPrice = |
|
|
|
this.quoteDetail.quoteTotalPrice + this.quoteDetail.quoteTotalPrice * (this.quoteDetail.quoteTaxRate / 100); |
|
|
|
this.quoteDetail.quoteTaxUnitPrice = |
|
|
|
this.quoteDetail.quoteTaxTotalPrice / this.quoteDetail.qty; |
|
|
|
}, |
|
|
|
handleQueryAllCost(){ |
|
|
|
let params = { |
|
|
|
...this.quoteDetail |
|
|
|
@ -121,43 +157,49 @@ export default { |
|
|
|
if (newValue === undefined || newValue === null){ |
|
|
|
this.quoteDetail.adjustPartCost = 0; |
|
|
|
} |
|
|
|
this.computeTotalCost(); |
|
|
|
this.computeQuoteTotalCost(); |
|
|
|
}, |
|
|
|
'quoteDetail.adjustMachineCost'(newValue, oldValue){ |
|
|
|
if (newValue === undefined || newValue === null){ |
|
|
|
this.quoteDetail.adjustMachineCost = 0; |
|
|
|
} |
|
|
|
this.computeTotalCost(); |
|
|
|
this.computeQuoteTotalCost(); |
|
|
|
}, |
|
|
|
'quoteDetail.adjustFabricateCost'(newValue, oldValue){ |
|
|
|
if (newValue === undefined || newValue === null){ |
|
|
|
this.quoteDetail.adjustFabricateCost = 0; |
|
|
|
} |
|
|
|
this.computeTotalCost(); |
|
|
|
this.computeQuoteTotalCost(); |
|
|
|
}, |
|
|
|
'quoteDetail.adjustLabourCost'(newValue, oldValue){ |
|
|
|
if (newValue === undefined || newValue === null){ |
|
|
|
this.quoteDetail.adjustLabourCost = 0; |
|
|
|
} |
|
|
|
this.computeTotalCost(); |
|
|
|
this.computeQuoteTotalCost(); |
|
|
|
}, |
|
|
|
'quoteDetail.adjustToolCost'(newValue, oldValue){ |
|
|
|
if (newValue === undefined || newValue === null){ |
|
|
|
this.quoteDetail.adjustToolCost = 0; |
|
|
|
} |
|
|
|
this.computeTotalCost(); |
|
|
|
this.computeQuoteTotalCost(); |
|
|
|
}, |
|
|
|
'quoteDetail.manageCost'(newValue, oldValue){ |
|
|
|
if (newValue === undefined || newValue === null){ |
|
|
|
this.quoteDetail.manageCost = 0; |
|
|
|
} |
|
|
|
this.computeTotalCost(); |
|
|
|
this.computeQuoteTotalCost(); |
|
|
|
}, |
|
|
|
'quoteDetail.otherCost'(newValue, oldValue){ |
|
|
|
if (newValue === undefined || newValue === null){ |
|
|
|
this.quoteDetail.otherCost = 0; |
|
|
|
} |
|
|
|
this.computeTotalCost(); |
|
|
|
this.computeQuoteTotalCost(); |
|
|
|
}, |
|
|
|
'quoteDetail.profitRate'(newValue, oldValue){ |
|
|
|
if (newValue === undefined || newValue === null){ |
|
|
|
@ -165,12 +207,24 @@ export default { |
|
|
|
} |
|
|
|
this.computeProfitAmount(); |
|
|
|
}, |
|
|
|
'quoteDetail.quoteProfitRate'(newValue, oldValue){ |
|
|
|
if (newValue === undefined || newValue === null){ |
|
|
|
this.quoteDetail.quoteProfitRate = 0; |
|
|
|
} |
|
|
|
this.computeQuoteProfitAmount(); |
|
|
|
}, |
|
|
|
'quoteDetail.taxRate'(newValue, oldValue){ |
|
|
|
if (newValue === undefined || newValue === null){ |
|
|
|
this.quoteDetail.taxRate = 0; |
|
|
|
} |
|
|
|
this.computeTaxCost(); |
|
|
|
}, |
|
|
|
'quoteDetail.quoteTaxRate'(newValue, oldValue){ |
|
|
|
if (newValue === undefined || newValue === null){ |
|
|
|
this.quoteDetail.quoteTaxRate = 0; |
|
|
|
} |
|
|
|
this.computeQuoteTaxCost(); |
|
|
|
}, |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
@ -179,19 +233,26 @@ export default { |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<el-button :loading="computeLoading" type="primary" :disabled="quoteDetail.status === '下达'" @click="handleQueryAllCost"> 计 算</el-button> |
|
|
|
|
|
|
|
<el-select v-model="showQuoteCost"> |
|
|
|
<el-option label="报价成本" :value="true"></el-option> |
|
|
|
<el-option label="标准成本" :value="false"></el-option> |
|
|
|
</el-select> |
|
|
|
|
|
|
|
<el-checkbox v-model="isShowCost">显示系统自动计算结果</el-checkbox> |
|
|
|
<!--系统自动计算结果--> |
|
|
|
<el-form :model="quoteDetail" ref="costForm" :rules="rules" label-position="top" label-width="120px"> |
|
|
|
<fieldset |
|
|
|
style="height:80px;margin-top: 2px;border: 1px solid #777;"> |
|
|
|
<fieldset v-if="isShowCost" |
|
|
|
style="margin-top: 2px;border: 1px solid #777;"> |
|
|
|
<legend>系统自动计算结果(料工费/工具)</legend> |
|
|
|
<el-row :gutter="10" > |
|
|
|
<el-col :span="4"> |
|
|
|
<el-col :span="4" v-show="!showQuoteCost"> |
|
|
|
<el-form-item label="材料标准成本:" prop="partCost" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%; " :controls="false" |
|
|
|
v-model="quoteDetail.partCost" :precision="4" disabled/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-col :span="4" v-show="showQuoteCost"> |
|
|
|
<el-form-item label="材料报价成本:" prop="bomUnYield" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%; " :controls="false" |
|
|
|
v-model="quoteDetail.bomUnYield" :precision="4" disabled/> |
|
|
|
@ -224,16 +285,16 @@ export default { |
|
|
|
</el-row> |
|
|
|
</fieldset> |
|
|
|
<fieldset |
|
|
|
style="height:80px;margin-top: 5px;border: 1px solid #777;"> |
|
|
|
style="margin-top: 5px;border: 1px solid #777;"> |
|
|
|
<legend>调整后成本(料工费/工具)</legend> |
|
|
|
<el-row :gutter="10" > |
|
|
|
<el-col :span="4"> |
|
|
|
<el-col :span="4" v-if="!showQuoteCost"> |
|
|
|
<el-form-item label="材料标准成本:" prop="adjustPartCost" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
|
v-model="quoteDetail.adjustPartCost" :disabled="quoteDetail.status === '下达'" :step="0" :precision="4" :min="0"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-col :span="4" v-if="showQuoteCost"> |
|
|
|
<el-form-item label="材料报价成本:" prop="adjustBomUnYield" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
|
v-model="quoteDetail.adjustBomUnYield" :disabled="quoteDetail.status === '下达'" :step="0" :precision="4" :min="0"/> |
|
|
|
@ -266,7 +327,7 @@ export default { |
|
|
|
</el-row> |
|
|
|
</fieldset> |
|
|
|
<fieldset |
|
|
|
style="height:80px;margin-top: 5px;border: 1px solid #777;"> |
|
|
|
style="margin-top: 5px;border: 1px solid #777;"> |
|
|
|
<legend>其他成本</legend> |
|
|
|
<el-row :gutter="10" > |
|
|
|
<el-col :span="4"> |
|
|
|
@ -293,65 +354,115 @@ export default { |
|
|
|
v-model="quoteDetail.otherCost" :disabled="quoteDetail.status === '下达'" :step="0" :precision="4" :min="0"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="总成本:" prop="totalCost" :show-message="false"> |
|
|
|
<el-col :span="4" v-if="!showQuoteCost"> |
|
|
|
<el-form-item label="标准总成本:" prop="totalCost" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
|
v-model="quoteDetail.totalCost" :step="0" :precision="4" :min="0" disabled/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" v-if="showQuoteCost"> |
|
|
|
<el-form-item label="报价总成本:" prop="quoteTotalCost" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
|
v-model="quoteDetail.quoteTotalCost" :step="0" :precision="4" :min="0" disabled/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</fieldset> |
|
|
|
<fieldset style="height:80px;margin-top: 5px;border: 1px solid #777;"> |
|
|
|
<fieldset style="margin-top: 5px;border: 1px solid #777;"> |
|
|
|
<legend>利润</legend> |
|
|
|
<el-row :gutter="10" > |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="利润率%:" prop="profitRate" :show-message="false"> |
|
|
|
<el-col :span="4" v-if="!showQuoteCost"> |
|
|
|
<el-form-item label="标准利润率%:" prop="profitRate" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
|
v-model="quoteDetail.profitRate" :disabled="quoteDetail.status === '下达'" :step="0" :min="0"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="利润额:" prop="profitAmount" :show-message="false"> |
|
|
|
<el-col :span="4" v-if="!showQuoteCost"> |
|
|
|
<el-form-item label="标准利润额:" prop="profitAmount" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
|
v-model="quoteDetail.profitAmount" :step="0" :precision="4" :min="0" disabled/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" v-if="showQuoteCost"> |
|
|
|
<el-form-item label="报价利润率%:" prop="quoteProfitRate" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
|
v-model="quoteDetail.quoteProfitRate" :disabled="quoteDetail.status === '下达'" :step="0" :min="0"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" v-if="showQuoteCost"> |
|
|
|
<el-form-item label="报价利润额:" prop="quoteProfitAmount" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
|
v-model="quoteDetail.quoteProfitAmount" :step="0" :precision="4" :min="0" disabled/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</fieldset> |
|
|
|
<fieldset style="height:80px;margin-top: 5px;border: 1px solid #777;"> |
|
|
|
<fieldset style="margin-top: 5px;border: 1px solid #777;"> |
|
|
|
<legend>最终价格</legend> |
|
|
|
<el-row :gutter="10" > |
|
|
|
<el-row :gutter="10" v-if="!showQuoteCost"> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="未税总额:" prop="totalPrice" :show-message="false"> |
|
|
|
<el-form-item label="标准未税总额:" prop="totalPrice" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
|
v-model="quoteDetail.totalPrice" :step="0" :precision="4" :min="0" disabled/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="未税单价:" prop="unitPrice" :show-message="false"> |
|
|
|
<el-form-item label="标准未税单价:" prop="unitPrice" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
|
v-model="quoteDetail.unitPrice" :step="0" :min="0" :precision="6" disabled/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="税率%:" prop="taxRate" :show-message="false"> |
|
|
|
<el-form-item label="标准税率%:" prop="taxRate" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
|
v-model="quoteDetail.taxRate" :disabled="quoteDetail.status === '下达'" :step="0" :min="0"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="含税总额:" prop="taxTotalPrice" :show-message="false"> |
|
|
|
<el-form-item label="标准含税总额:" prop="taxTotalPrice" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
|
v-model="quoteDetail.taxTotalPrice" :step="0" :precision="4" :min="0" disabled/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="含税单价:" prop="taxUnitPrice" :show-message="false"> |
|
|
|
<el-form-item label="标准含税单价:" prop="taxUnitPrice" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
|
v-model="quoteDetail.taxUnitPrice" :step="0" :precision="6" :min="0" disabled/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row :gutter="10" v-if="showQuoteCost"> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="报价未税总额:" prop="quoteTotalPrice" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
|
v-model="quoteDetail.quoteTotalPrice" :step="0" :precision="4" :min="0" disabled/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="报价未税单价:" prop="quoteUnitPrice" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
|
v-model="quoteDetail.quoteUnitPrice" :step="0" :min="0" :precision="6" disabled/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="报价税率%:" prop="quoteTaxRate" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
|
v-model="quoteDetail.quoteTaxRate" :disabled="quoteDetail.status === '下达'" :step="0" :min="0"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="报价含税总额:" prop="quoteTaxTotalPrice" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
|
v-model="quoteDetail.quoteTaxTotalPrice" :step="0" :precision="4" :min="0" disabled/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="报价含税单价:" prop="quoteTaxUnitPrice" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
|
v-model="quoteDetail.quoteTaxUnitPrice" :step="0" :precision="6" :min="0" disabled/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</fieldset> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
|