|
|
|
@ -37,11 +37,17 @@ export default { |
|
|
|
adjustToolCost: [ |
|
|
|
{ required: true, message: "请输入工具成本", trigger: ["blur","change"] } |
|
|
|
], |
|
|
|
adjustTestCost: [ |
|
|
|
{ required: true, message: "请输入测试成本", trigger: ["blur","change"] } |
|
|
|
], |
|
|
|
adjustElseCost: [ |
|
|
|
{ required: true, message: "请输入其他成本", trigger: ["blur","change"] } |
|
|
|
], |
|
|
|
manageCost: [ |
|
|
|
{ required: true, message: "请输入管理成本", trigger: ["blur","change"] } |
|
|
|
], |
|
|
|
otherCost: [ |
|
|
|
{ required: true, message: "请输入其他成本", trigger: ["blur","change"] } |
|
|
|
{ required: true, message: "请输入包装&运输成本", trigger: ["blur","change"] } |
|
|
|
], |
|
|
|
profitRate: [ |
|
|
|
{ required: true, message: "请输入利润率", trigger: ["blur","change"] } |
|
|
|
@ -65,7 +71,7 @@ export default { |
|
|
|
tagNo:undefined, |
|
|
|
type:undefined, |
|
|
|
|
|
|
|
allCheckedLabel:['工具','测试','其他','包装','运输'], |
|
|
|
allCheckedLabel:['工具','测试','其他','包装&运输'], |
|
|
|
// selectionChecked:[], |
|
|
|
checkAll:false, |
|
|
|
|
|
|
|
@ -96,9 +102,19 @@ export default { |
|
|
|
this.quoteDetail.adjustMachineCost + |
|
|
|
this.quoteDetail.adjustFabricateCost + |
|
|
|
this.quoteDetail.adjustLabourCost + |
|
|
|
this.quoteDetail.adjustToolCost + |
|
|
|
this.quoteDetail.manageCost + |
|
|
|
this.quoteDetail.otherCost; |
|
|
|
this.quoteDetail.manageCost; |
|
|
|
if (this.selectionChecked.includes('其他')){ |
|
|
|
this.quoteDetail.totalCost += this.quoteDetail.adjustElseCost; |
|
|
|
} |
|
|
|
if (this.selectionChecked.includes('工具')){ |
|
|
|
this.quoteDetail.totalCost += this.quoteDetail.adjustToolCost; |
|
|
|
} |
|
|
|
if (this.selectionChecked.includes('测试')){ |
|
|
|
this.quoteDetail.totalCost += this.quoteDetail.adjustTestCost; |
|
|
|
} |
|
|
|
if (this.selectionChecked.includes('包装&运输')){ |
|
|
|
this.quoteDetail.totalCost += this.quoteDetail.otherCost; |
|
|
|
} |
|
|
|
this.computeCurrencyTotalCost(); |
|
|
|
this.computeProfitAmount(); |
|
|
|
}, |
|
|
|
@ -109,9 +125,19 @@ export default { |
|
|
|
this.quoteDetail.adjustMachineCost + |
|
|
|
this.quoteDetail.adjustFabricateCost + |
|
|
|
this.quoteDetail.adjustLabourCost + |
|
|
|
this.quoteDetail.adjustToolCost + |
|
|
|
this.quoteDetail.manageCost + |
|
|
|
this.quoteDetail.otherCost; |
|
|
|
this.quoteDetail.manageCost; |
|
|
|
if (this.selectionChecked.includes('其他')){ |
|
|
|
this.quoteDetail.quoteTotalCost += this.quoteDetail.adjustElseCost; |
|
|
|
} |
|
|
|
if (this.selectionChecked.includes('工具')){ |
|
|
|
this.quoteDetail.quoteTotalCost += this.quoteDetail.adjustToolCost; |
|
|
|
} |
|
|
|
if (this.selectionChecked.includes('测试')){ |
|
|
|
this.quoteDetail.quoteTotalCost += this.quoteDetail.adjustTestCost; |
|
|
|
} |
|
|
|
if (this.selectionChecked.includes('包装&运输')){ |
|
|
|
this.quoteDetail.quoteTotalCost += this.quoteDetail.otherCost; |
|
|
|
} |
|
|
|
this.computeQuoteCurrencyTotalCost(); |
|
|
|
this.computeQuoteProfitAmount(); |
|
|
|
}, |
|
|
|
@ -164,6 +190,10 @@ export default { |
|
|
|
this.quoteDetail.adjustFabricateCost = data.row.manufactureCost; |
|
|
|
this.quoteDetail.toolCost = data.row.toolCost; |
|
|
|
this.quoteDetail.adjustToolCost = data.row.toolCost; |
|
|
|
this.quoteDetail.testCost = data.row.testCost; |
|
|
|
this.quoteDetail.adjustTestCost = data.row.testCost; |
|
|
|
this.quoteDetail.elseCost = data.row.elseCost; |
|
|
|
this.quoteDetail.adjustElseCost = data.row.elseCost; |
|
|
|
this.quoteDetail.packCost = data.row.packCost; |
|
|
|
this.quoteDetail.shippingCost = data.row.shippingCost; |
|
|
|
this.quoteDetail.otherCost = data.row.otherCost; |
|
|
|
@ -239,6 +269,20 @@ export default { |
|
|
|
this.computeTotalCost(); |
|
|
|
this.computeQuoteTotalCost(); |
|
|
|
}, |
|
|
|
'quoteDetail.adjustTestCost'(newValue, oldValue){ |
|
|
|
if (newValue === undefined || newValue === null){ |
|
|
|
this.quoteDetail.adjustTestCost = 0; |
|
|
|
} |
|
|
|
this.computeTotalCost(); |
|
|
|
this.computeQuoteTotalCost(); |
|
|
|
}, |
|
|
|
'quoteDetail.adjustElseCost'(newValue, oldValue){ |
|
|
|
if (newValue === undefined || newValue === null){ |
|
|
|
this.quoteDetail.adjustElseCost = 0; |
|
|
|
} |
|
|
|
this.computeTotalCost(); |
|
|
|
this.computeQuoteTotalCost(); |
|
|
|
}, |
|
|
|
'quoteDetail.manageCost'(newValue, oldValue){ |
|
|
|
if (newValue === undefined || newValue === null){ |
|
|
|
this.quoteDetail.manageCost = 0; |
|
|
|
@ -319,12 +363,15 @@ export default { |
|
|
|
}else { |
|
|
|
this.checkAll = false; |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
}, |
|
|
|
computed:{ |
|
|
|
selectionChecked:{ |
|
|
|
set(newVal){ |
|
|
|
this.selection = newVal.join(',') |
|
|
|
this.quoteDetail.calculatedItems = this.selection; |
|
|
|
this.computeTotalCost(); |
|
|
|
this.computeQuoteTotalCost(); |
|
|
|
}, |
|
|
|
get(){ |
|
|
|
if (this.selection === '' || this.selection === undefined || this.selection === null){ |
|
|
|
@ -335,6 +382,9 @@ export default { |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted() { |
|
|
|
if (this.quoteDetail.calculatedItems){ |
|
|
|
this.selection = this.quoteDetail.calculatedItems; |
|
|
|
} |
|
|
|
this.$nextTick(()=>{ |
|
|
|
this.computeProfitAmount() |
|
|
|
this.computeQuoteProfitAmount() |
|
|
|
@ -345,27 +395,21 @@ export default { |
|
|
|
|
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<el-row :gutter="10"> |
|
|
|
<el-col :span="2"> |
|
|
|
<el-button :loading="computeLoading" style="width: 80px" type="primary" :disabled="quoteDetail.status === '下达'" @click="handleQueryAllCost"> 计 算</el-button> |
|
|
|
</el-col> |
|
|
|
<el-col :span="2"> |
|
|
|
<el-popover |
|
|
|
placement="bottom-start" |
|
|
|
width="100" |
|
|
|
trigger="hover"> |
|
|
|
<div> |
|
|
|
<el-checkbox :indeterminate="selectionChecked.length > 0 && selectionChecked.length < allCheckedLabel.length" v-model="checkAll" @change="changeAllCheck"> 全选 </el-checkbox> |
|
|
|
</div> |
|
|
|
<el-checkbox-group v-model="selectionChecked"> |
|
|
|
<div v-for="label in allCheckedLabel"> |
|
|
|
<el-checkbox :label="label" :key="label">{{label}}</el-checkbox> |
|
|
|
</div> |
|
|
|
</el-checkbox-group> |
|
|
|
<a slot="reference">计入材料成本</a> |
|
|
|
</el-popover> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-button :loading="computeLoading" style="margin-right: 10px" type="primary" :disabled="quoteDetail.status === '下达'" @click="handleQueryAllCost"> 计 算</el-button> |
|
|
|
<el-popover |
|
|
|
placement="bottom-start" |
|
|
|
width="100" |
|
|
|
trigger="hover"> |
|
|
|
<div> |
|
|
|
<el-checkbox :indeterminate="selectionChecked.length > 0 && selectionChecked.length < allCheckedLabel.length" v-model="checkAll" @change="changeAllCheck"> 全选 </el-checkbox> |
|
|
|
</div> |
|
|
|
<el-checkbox-group v-model="selectionChecked"> |
|
|
|
<div v-for="label in allCheckedLabel"> |
|
|
|
<el-checkbox :label="label" :key="label">{{label}}</el-checkbox> |
|
|
|
</div> |
|
|
|
</el-checkbox-group> |
|
|
|
<a slot="reference">计入材料成本</a> |
|
|
|
</el-popover> |
|
|
|
|
|
|
|
<!-- <el-select v-model="showQuoteCost">--> |
|
|
|
<!-- <el-option label="报价成本" :value="true"></el-option>--> |
|
|
|
@ -410,6 +454,18 @@ export default { |
|
|
|
v-model="quoteDetail.toolCost" :precision="4" disabled/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="测试成本:" prop="testCost" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
|
v-model="quoteDetail.testCost" :precision="4" disabled/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="其他成本:" prop="elseCost" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
|
v-model="quoteDetail.elseCost" :precision="4" disabled/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</fieldset> |
|
|
|
<fieldset |
|
|
|
@ -446,6 +502,18 @@ export default { |
|
|
|
v-model="quoteDetail.adjustToolCost" :disabled="quoteDetail.status === '下达'" :step="0" :precision="4" :min="0"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="测试成本:" prop="adjustTestCost" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
|
v-model="quoteDetail.adjustTestCost" :disabled="quoteDetail.status === '下达'" :step="0" :precision="4" :min="0"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="其他成本:" prop="adjustElseost" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%;" :controls="false" |
|
|
|
v-model="quoteDetail.adjustElseCost" :disabled="quoteDetail.status === '下达'" :step="0" :precision="4" :min="0"/> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
</fieldset> |
|
|
|
<fieldset style="margin-top: 5px;border: 1px solid #777;" v-if="isShowOtherCost"> |
|
|
|
@ -470,7 +538,7 @@ export default { |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="其他成本:" prop="otherCost" :show-message="false"> |
|
|
|
<el-form-item label="包装&运输:" prop="otherCost" :show-message="false"> |
|
|
|
<el-input-number style="width: 100%; " :controls="false" |
|
|
|
v-model="quoteDetail.otherCost" :disabled="quoteDetail.status === '下达'" :step="0" :precision="4" :min="0"/> |
|
|
|
</el-form-item> |
|
|
|
|