|
|
|
@ -144,18 +144,34 @@ export default { |
|
|
|
this.$message.error(error); |
|
|
|
this.computeLoading = false |
|
|
|
}) |
|
|
|
}, |
|
|
|
handleValidate(){ |
|
|
|
this.$refs.costForm.validate((valid,obj)=>{ |
|
|
|
if (!valid){ |
|
|
|
let i = 1; |
|
|
|
for (let item in obj){ |
|
|
|
this.$message.error(obj[item][0].message); |
|
|
|
if (i === 1){ |
|
|
|
return |
|
|
|
} |
|
|
|
i++; |
|
|
|
} |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
}, |
|
|
|
watch:{ |
|
|
|
'quoteDetail.adjustPartCost'(newValue, oldValue){ |
|
|
|
if (newValue === undefined || newValue === null){ |
|
|
|
this.quoteDetail.adjustPartCost = 0; |
|
|
|
this.$set(this.quoteDetail, 'adjustPartCost', 0); |
|
|
|
} |
|
|
|
this.computeTotalCost(); |
|
|
|
}, |
|
|
|
'quoteDetail.adjustBomUnYield'(newValue, oldValue){ |
|
|
|
console.log(oldValue) |
|
|
|
console.log(newValue) |
|
|
|
if (newValue === undefined || newValue === null){ |
|
|
|
this.quoteDetail.adjustPartCost = 0; |
|
|
|
this.quoteDetail.adjustBomUnYield = 0; |
|
|
|
} |
|
|
|
this.computeQuoteTotalCost(); |
|
|
|
}, |
|
|
|
@ -242,14 +258,13 @@ export default { |
|
|
|
<el-checkbox v-model="isShowCost">显示系统自动计算结果</el-checkbox> |
|
|
|
<!--系统自动计算结果--> |
|
|
|
<el-form :model="quoteDetail" ref="costForm" :rules="rules" label-position="top" label-width="120px"> |
|
|
|
<fieldset v-if="isShowCost" |
|
|
|
<fieldset v-show="isShowCost" |
|
|
|
style="margin-top: 2px;border: 1px solid #777;"> |
|
|
|
<legend>系统自动计算结果(料工费/工具)</legend> |
|
|
|
<el-row :gutter="10" > |
|
|
|
<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-input-number style="width: 100%; " :controls="false" v-model="quoteDetail.partCost" :precision="4" disabled/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" v-show="showQuoteCost"> |
|
|
|
@ -288,13 +303,13 @@ export default { |
|
|
|
style="margin-top: 5px;border: 1px solid #777;"> |
|
|
|
<legend>调整后成本(料工费/工具)</legend> |
|
|
|
<el-row :gutter="10" > |
|
|
|
<el-col :span="4" v-if="!showQuoteCost"> |
|
|
|
<el-col :span="4" v-show="!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" v-if="showQuoteCost"> |
|
|
|
<el-col :span="4" v-show="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"/> |
|
|
|
@ -354,13 +369,13 @@ export default { |
|
|
|
v-model="quoteDetail.otherCost" :disabled="quoteDetail.status === '下达'" :step="0" :precision="4" :min="0"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" v-if="!showQuoteCost"> |
|
|
|
<el-col :span="4" v-show="!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-col :span="4" v-show="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/> |
|
|
|
@ -371,25 +386,25 @@ export default { |
|
|
|
<fieldset style="margin-top: 5px;border: 1px solid #777;"> |
|
|
|
<legend>利润</legend> |
|
|
|
<el-row :gutter="10" > |
|
|
|
<el-col :span="4" v-if="!showQuoteCost"> |
|
|
|
<el-col :span="4" v-show="!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" v-if="!showQuoteCost"> |
|
|
|
<el-col :span="4" v-show="!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-col :span="4" v-show="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-col :span="4" v-show="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/> |
|
|
|
@ -399,7 +414,7 @@ export default { |
|
|
|
</fieldset> |
|
|
|
<fieldset style="margin-top: 5px;border: 1px solid #777;"> |
|
|
|
<legend>最终价格</legend> |
|
|
|
<el-row :gutter="10" v-if="!showQuoteCost"> |
|
|
|
<el-row :gutter="10" v-show="!showQuoteCost"> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="标准未税总额:" prop="totalPrice" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
|
@ -431,7 +446,7 @@ export default { |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row :gutter="10" v-if="showQuoteCost"> |
|
|
|
<el-row :gutter="10" v-show="showQuoteCost"> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="报价未税总额:" prop="quoteTotalPrice" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
|
|