|
|
|
@ -183,7 +183,7 @@ |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="报价数量" prop="quotationDetailQuantity"> |
|
|
|
<div class="right"> |
|
|
|
<el-input v-model="insertQuotationDetail.quotationDetailQuantity" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> |
|
|
|
<el-input v-model="insertQuotationDetail.quotationDetailQuantity" type="number" @input="value=>inputNumberWithReg(value,0)" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
@ -282,6 +282,7 @@ |
|
|
|
<el-table-column label="损耗率%" header-align="center" align="right" show-overflow-tooltip prop="attritionRate"/> |
|
|
|
<el-table-column label="调机用量" header-align="center" align="right" show-overflow-tooltip prop="transferAmount"/> |
|
|
|
<el-table-column label="单位成本" header-align="center" align="right" show-overflow-tooltip prop="unitCost"/> |
|
|
|
<el-table-column label="单位报价成本" header-align="center" align="right" show-overflow-tooltip prop="quotationUnitCost"/> |
|
|
|
<el-table-column label="备注" header-align="center" align="left" show-overflow-tooltip prop="remark"/> |
|
|
|
</el-table> |
|
|
|
</el-form> |
|
|
|
@ -353,6 +354,7 @@ |
|
|
|
<el-table-column label="工具数量" header-align="center" align="right" prop="toolQuantity" show-overflow-tooltip/> |
|
|
|
<el-table-column label="单位成本" header-align="center" align="right" prop="unitCost" show-overflow-tooltip/> |
|
|
|
<el-table-column label="预计使用寿命" header-align="center" align="right" prop="expectedServiceLife" show-overflow-tooltip/> |
|
|
|
<el-table-column label="单位报价成本" header-align="center" align="right" prop="quotationUnitCost" show-overflow-tooltip/> |
|
|
|
<el-table-column label="备注" header-align="center" align="left" prop="remark" show-overflow-tooltip/> |
|
|
|
</el-table> |
|
|
|
</el-form> |
|
|
|
@ -543,7 +545,7 @@ |
|
|
|
label-width="120px"> |
|
|
|
<el-row> |
|
|
|
<el-col :span="4"> |
|
|
|
<el-form-item label="未税总价:" prop="systemComputeAmount"> |
|
|
|
<el-form-item label="未税总额:" prop="systemComputeAmount"> |
|
|
|
<div class="right"> |
|
|
|
<el-input v-model="quotationDetailData.systemComputeAmount" type="number" disabled/> |
|
|
|
</div> |
|
|
|
@ -564,7 +566,7 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="4" :offset="1"> |
|
|
|
<el-form-item label="含税总价:" prop="systemComputePrice"> |
|
|
|
<el-form-item label="含税总额:" prop="systemComputePrice"> |
|
|
|
<div class="right"> |
|
|
|
<el-input v-model="quotationDetailData.systemComputePrice" type="number" disabled/> |
|
|
|
</div> |
|
|
|
@ -589,7 +591,7 @@ |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!--quotationTool新增--> |
|
|
|
<el-dialog title="报价工具" @close="closeQuotationToolDialog" :visible.sync="saveQuotationToolFlag" width="40%" |
|
|
|
<el-dialog title="报价工具" @close="closeQuotationToolDialog" @open="openQuotationToolDialog" :visible.sync="saveQuotationToolFlag" width="40%" |
|
|
|
top="15vh" :close-on-click-modal="false"> |
|
|
|
<el-form :rules="quotationToolRules" ref="quotationToolForm" :model="quotationTool" label-position="top" |
|
|
|
style="height: 260px"> |
|
|
|
@ -610,23 +612,30 @@ |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="工具数量" prop="toolQuantity"> |
|
|
|
<div class="right"> |
|
|
|
<el-input v-model="quotationTool.toolQuantity" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/> |
|
|
|
<el-input @input="computeToolQuotationUnitCost(quotationTool)" v-model="quotationTool.toolQuantity" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12" :offset="2"> |
|
|
|
<el-form-item label="单位成本" prop="unitCost"> |
|
|
|
<el-form-item label="预计使用寿命" prop="expectedServiceLife"> |
|
|
|
<div class="right"> |
|
|
|
<el-input v-model="quotationTool.unitCost" :disabled="quotationTool.toolNo !== '*'" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/> |
|
|
|
<el-input @input="computeToolQuotationUnitCost(quotationTool)" v-model="quotationTool.expectedServiceLife" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
</el-row> |
|
|
|
<el-row> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="预计使用寿命" prop="expectedServiceLife"> |
|
|
|
<el-form-item label="单位成本" prop="unitCost"> |
|
|
|
<div class="right"> |
|
|
|
<el-input @input="computeToolQuotationUnitCost(quotationTool)" v-model="quotationTool.unitCost" :disabled="quotationTool.toolNo !== '*'" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12" :offset="2"> |
|
|
|
<el-form-item label="单位报价成本" prop="unitCost"> |
|
|
|
<div class="right"> |
|
|
|
<el-input v-model="quotationTool.expectedServiceLife" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/> |
|
|
|
<el-input v-model="quotationTool.quotationUnitCost" disabled onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
@ -697,7 +706,7 @@ |
|
|
|
<el-row> |
|
|
|
<el-col :span="8" > |
|
|
|
<el-form-item label="加工中心编码" prop="machiningCenterNo"> |
|
|
|
<el-select v-model="quotationRouting.machiningCenterNo" filterable clearable style="width: 100%" @change="(val) => changeWorkCenterSelect(val, quotationRouting)" placeholder="请选择"> |
|
|
|
<el-select v-model="quotationRouting.machiningCenterNo" filterable style="width: 100%" @change="changeWorkCenterSelect" placeholder="请选择"> |
|
|
|
<el-option |
|
|
|
key="*" |
|
|
|
label="*" |
|
|
|
@ -727,23 +736,44 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12" :offset="2"> |
|
|
|
<el-form-item label="调机时间" prop="machiningSetupTime"> |
|
|
|
<el-form-item label="加工中心机器成本" prop="machineryCenterCost"> |
|
|
|
<div class="right"> |
|
|
|
<el-input v-model="quotationRouting.machiningSetupTime" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> |
|
|
|
<el-input :disabled="quotationRouting.machiningCenterNo !== '*'" v-model="quotationRouting.machineryCenterCost" @input="changeRoutingCost" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8" > |
|
|
|
<el-form-item label="单位产出量" prop="unitOutputQuantity"> |
|
|
|
<el-form-item label="加工中心人工成本" prop="laborCenterCost"> |
|
|
|
<div class="right"> |
|
|
|
<el-input :disabled="quotationRouting.machiningCenterNo !== '*'" v-model="quotationRouting.laborCenterCost" @input="changeRoutingCost" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12" :offset="2"> |
|
|
|
<el-form-item label="加工制造费用" prop="manufacturingCenterCost"> |
|
|
|
<div class="right"> |
|
|
|
<el-input :disabled="quotationRouting.machiningCenterNo !== '*'" v-model="quotationRouting.manufacturingCenterCost" @input="changeRoutingCost" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="调机时间" prop="machiningSetupTime"> |
|
|
|
<div class="right"> |
|
|
|
<el-input v-model="quotationRouting.unitOutputQuantity" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> |
|
|
|
<el-input v-model="quotationRouting.machiningSetupTime" @input="changeRoutingCost" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12" :offset="2"> |
|
|
|
<el-form-item label="单位产出量" prop="unitOutputQuantity"> |
|
|
|
<div class="right"> |
|
|
|
<el-input v-model="quotationRouting.unitOutputQuantity" @input="changeRoutingCost" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="产出单位" prop="outputUnit"> |
|
|
|
<el-select v-model="quotationRouting.outputUnit" |
|
|
|
style="width: 100%" clearable placeholder="请选择"> |
|
|
|
style="width: 100%" placeholder="请选择" @change="changeRoutingCost"> |
|
|
|
<el-option |
|
|
|
v-for="item in outputUnitList" |
|
|
|
:key="item.label" |
|
|
|
@ -753,45 +783,45 @@ |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8" > |
|
|
|
<el-col :span="12" :offset="2" > |
|
|
|
<el-form-item label="效率%" prop="routingEfficiency"> |
|
|
|
<div class="right"> |
|
|
|
<el-input v-model="quotationRouting.routingEfficiency" min="0" max="100" @input="value=>inputRule(value,2)" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12" :offset="2"> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="操作工人数" prop="operatorsNumber"> |
|
|
|
<div class="right"> |
|
|
|
<el-input v-model="quotationRouting.operatorsNumber" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/> |
|
|
|
<el-input v-model="quotationRouting.operatorsNumber" @input="changeRoutingCost" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8" > |
|
|
|
<el-col :span="12" :offset="2" > |
|
|
|
<el-form-item label="单位机器成本" prop="unitMachineryCost"> |
|
|
|
<div class="right"> |
|
|
|
<el-input @input="changeRoutingCost" :disabled="quotationRouting.machiningCenterNo !== '*'" v-model="quotationRouting.unitMachineryCost" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/> |
|
|
|
<el-input disabled v-model="quotationRouting.unitMachineryCost" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12" :offset="2"> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="单位人工成本" prop="unitLaborCost"> |
|
|
|
<div class="right"> |
|
|
|
<el-input @input="changeRoutingCost" :disabled="quotationRouting.machiningCenterNo !== '*'" v-model="quotationRouting.unitLaborCost" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/> |
|
|
|
<el-input disabled v-model="quotationRouting.unitLaborCost" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8" > |
|
|
|
<el-col :span="12" :offset="2" > |
|
|
|
<el-form-item label="单位制造费用" prop="unitManufacturingCost"> |
|
|
|
<div class="right"> |
|
|
|
<el-input @input="changeRoutingCost" :disabled="quotationRouting.machiningCenterNo !== '*'" v-model="quotationRouting.unitManufacturingCost" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/> |
|
|
|
<el-input disabled v-model="quotationRouting.unitManufacturingCost" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))" type="number"/> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12" :offset="2"> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="单位报价成本" prop="unitQuotedCost"> |
|
|
|
<div class="right"> |
|
|
|
<el-input disabled v-model="quotationRouting.unitQuotedCost" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> |
|
|
|
<el-input disabled type="number" v-model="quotationRouting.unitQuotedCost" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
@ -814,6 +844,7 @@ |
|
|
|
title="报价材料" |
|
|
|
:visible.sync="quotationPartDialogFlag" |
|
|
|
@close="closeQuotationPartDialog" |
|
|
|
@open="openQuotationPartDialog" |
|
|
|
:close-on-click-modal="false" |
|
|
|
width="40%"> |
|
|
|
<el-form :model="quotationPart" :rules="quotationPartRules" ref="quotationPartForm" label-position="top"> |
|
|
|
@ -848,7 +879,7 @@ |
|
|
|
<el-col :span="12" :offset="2"> |
|
|
|
<el-form-item label="单位用量" prop="unitDosage"> |
|
|
|
<div class="right"> |
|
|
|
<el-input v-model="quotationPart.unitDosage" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> |
|
|
|
<el-input @input="computePartQuotationUnitCost(quotationPart)" v-model="quotationPart.unitDosage" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
@ -862,14 +893,21 @@ |
|
|
|
<el-col :span="12" :offset="2"> |
|
|
|
<el-form-item label="调机用量" prop="transferAmount"> |
|
|
|
<div class="right"> |
|
|
|
<el-input v-model="quotationPart.transferAmount" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> |
|
|
|
<el-input @input="computePartQuotationUnitCost(quotationPart)" v-model="quotationPart.transferAmount" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="8"> |
|
|
|
<el-form-item label="单位成本" prop="unitCost"> |
|
|
|
<div class="right"> |
|
|
|
<el-input :disabled="quotationPart.quotationPartNo !== '*'" v-model="quotationPart.unitCost" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> |
|
|
|
<el-input @input="computePartQuotationUnitCost(quotationPart)" :disabled="quotationPart.quotationPartNo !== '*'" v-model="quotationPart.unitCost" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
<el-col :span="12" :offset="2"> |
|
|
|
<el-form-item label="单位报价成本"> |
|
|
|
<div class="right"> |
|
|
|
<el-input disabled v-model="quotationPart.quotationUnitCost" type="number" onKeypress="return (/[\d\.]/.test(String.fromCharCode(event.keyCode)))"/> |
|
|
|
</div> |
|
|
|
</el-form-item> |
|
|
|
</el-col> |
|
|
|
@ -1032,6 +1070,7 @@ |
|
|
|
<el-table-column label="损耗率%" show-overflow-tooltip prop="attritionRate"/> |
|
|
|
<el-table-column label="调机用量" show-overflow-tooltip prop="transferAmount"/> |
|
|
|
<el-table-column label="单位成本" show-overflow-tooltip prop="unitCost"/> |
|
|
|
<el-table-column label="单位报价成本" show-overflow-tooltip prop="quotationUnitCost"/> |
|
|
|
</el-table> |
|
|
|
|
|
|
|
<el-table v-if="options===2" key="otherQuotationRoutingTable" :data="otherQuotationRoutingList" ref="otherQuotationRoutingTable" :style="{marginTop:'10px'}" |
|
|
|
@ -1073,6 +1112,7 @@ |
|
|
|
<el-table-column label="工具描述" prop="toolDescription" show-overflow-tooltip/> |
|
|
|
<el-table-column label="工具数量" prop="toolQuantity" show-overflow-tooltip/> |
|
|
|
<el-table-column label="工具成本" prop="unitCost" show-overflow-tooltip/> |
|
|
|
<el-table-column label="单位报价成本" prop="quotationUnitCost" show-overflow-tooltip/> |
|
|
|
<el-table-column label="预计使用寿命" prop="expectedServiceLife" show-overflow-tooltip/> |
|
|
|
</el-table> |
|
|
|
<span slot="footer" class="dialog-footer" style="margin-top: 5px"> |
|
|
|
@ -1431,7 +1471,7 @@ export default { |
|
|
|
}, |
|
|
|
selectionQuotationRoutingList:[],//选中的工艺记录集合 |
|
|
|
umInformationList:[],// 单位集合 |
|
|
|
outputUnitList:[{label:"单位/小时"},{label: "小时/单位"},{label: "小时"}],// 产出单位集合 |
|
|
|
outputUnitList:[{label: "小时"},{label:"单位/小时"},{label: "小时/单位"},],// 产出单位集合 |
|
|
|
workCenterList:[],// 加工中心集合 |
|
|
|
partList:[],//材料信息集合 |
|
|
|
quotationPartFormTable:{ |
|
|
|
@ -1547,9 +1587,10 @@ export default { |
|
|
|
quotationPartDesc:undefined,//报价材料名称 |
|
|
|
umId:undefined,//计量单位 |
|
|
|
unitDosage:1,//单位用量 |
|
|
|
attritionRate:1,//损耗率 |
|
|
|
attritionRate:0,//损耗率 |
|
|
|
transferAmount:1,//调机用量 |
|
|
|
unitCost:1,//单位成本 |
|
|
|
quotationUnitCost:0,//单位报价成本 |
|
|
|
remark:undefined,//备注 |
|
|
|
}, |
|
|
|
//报价明细新增对象 |
|
|
|
@ -1610,15 +1651,18 @@ export default { |
|
|
|
machiningCenterNo:undefined,//加工中心编码 |
|
|
|
machiningCenterDesc:undefined,//加工中心名称 |
|
|
|
machiningCenterType:undefined,//加工中心类别 |
|
|
|
machiningSetupTime:1,//调机时间 |
|
|
|
unitOutputQuantity:0,//单位产出量 |
|
|
|
outputUnit:'单位/小时',//单位编码 |
|
|
|
machiningSetupTime:0,//调机时间 |
|
|
|
unitOutputQuantity:1,//单位产出量 |
|
|
|
outputUnit:'小时',//单位编码 |
|
|
|
routingEfficiency:100,//效率 |
|
|
|
operatorsNumber:1,//操作工人数 |
|
|
|
unitMachineryCost:0,//单位机器成本 |
|
|
|
unitLaborCost:0,//单位人工成本 |
|
|
|
unitManufacturingCost:0,//单位制造费用 |
|
|
|
unitQuotedCost:0,//单位报价成本 |
|
|
|
laborCenterCost:0, |
|
|
|
machineryCenterCost:0,//机器成本 |
|
|
|
manufacturingCenterCost:0, |
|
|
|
remark:undefined,//备注 |
|
|
|
}, |
|
|
|
//报价工具对象 |
|
|
|
@ -1629,6 +1673,7 @@ export default { |
|
|
|
toolDescription: "", |
|
|
|
toolQuantity: 1, |
|
|
|
unitCost: 1, |
|
|
|
quotationUnitCost:0, |
|
|
|
expectedServiceLife: 1, |
|
|
|
remark: "", |
|
|
|
}, |
|
|
|
@ -1923,6 +1968,10 @@ export default { |
|
|
|
{required: true, message: ' ', trigger: 'change'}, |
|
|
|
{required: true, message: ' ', trigger: 'blur'}, |
|
|
|
], |
|
|
|
quotationRoutingDesc: [ |
|
|
|
{required: true, message: ' ', trigger: 'change'}, |
|
|
|
{required: true, message: ' ', trigger: 'blur'}, |
|
|
|
], |
|
|
|
itemNo: [ |
|
|
|
{required: true, message: ' ', trigger: 'change'}, |
|
|
|
{required: true, message: ' ', trigger: 'blur'}, |
|
|
|
@ -1960,20 +2009,32 @@ export default { |
|
|
|
{required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'blur'}, |
|
|
|
], |
|
|
|
unitMachineryCost: [ |
|
|
|
{required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'change'}, |
|
|
|
{required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'blur'}, |
|
|
|
{required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'change'}, |
|
|
|
{required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'blur'}, |
|
|
|
], |
|
|
|
unitLaborCost: [ |
|
|
|
{required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'change'}, |
|
|
|
{required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'blur'}, |
|
|
|
{required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'change'}, |
|
|
|
{required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'blur'}, |
|
|
|
], |
|
|
|
unitManufacturingCost: [ |
|
|
|
{required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'change'}, |
|
|
|
{required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'blur'}, |
|
|
|
{required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'change'}, |
|
|
|
{required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'blur'}, |
|
|
|
], |
|
|
|
unitQuotedCost: [ |
|
|
|
{required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'change'}, |
|
|
|
{required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'blur'}, |
|
|
|
{required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'change'}, |
|
|
|
{required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'blur'}, |
|
|
|
], |
|
|
|
machineryCenterCost: [ |
|
|
|
{required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'change'}, |
|
|
|
{required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'blur'}, |
|
|
|
], |
|
|
|
laborCenterCost: [ |
|
|
|
{required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'change'}, |
|
|
|
{required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'blur'}, |
|
|
|
], |
|
|
|
manufacturingCenterCost: [ |
|
|
|
{required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'change'}, |
|
|
|
{required: true, pattern: /^[0-9]+(.[0-9]{1,4})?$/, message: ' ', trigger: 'blur'}, |
|
|
|
], |
|
|
|
}, |
|
|
|
//报价材料 |
|
|
|
@ -2730,6 +2791,7 @@ export default { |
|
|
|
this.batchInsertQuotationPartData(otherSelectionPart); |
|
|
|
break; |
|
|
|
case 2: |
|
|
|
|
|
|
|
otherSelectionRouting = this.selectionOtherDetailList.map(item=>{ |
|
|
|
item.quotationDetailId = this.quotationDetailData.quotationDetailId; |
|
|
|
item.quotationRoutingId = undefined; |
|
|
|
@ -2896,18 +2958,6 @@ export default { |
|
|
|
this.initQuotationRoutingLoading = false; |
|
|
|
if (data.code === 200) { |
|
|
|
this.quotationRoutingFormTable.quotationRoutingList = data.data; |
|
|
|
// 计算价格 |
|
|
|
let list = this.quotationRoutingFormTable.quotationRoutingList; |
|
|
|
this.quotationDetailData.computeLabourCost = 0; |
|
|
|
this.quotationDetailData.computeFabricateCost = 0; |
|
|
|
this.quotationDetailData.computeMachineCost = 0; |
|
|
|
for (let i = 0; i < list.length; i++) { |
|
|
|
let item = list[i]; |
|
|
|
// 获取总价格 |
|
|
|
this.quotationDetailData.computeLabourCost = new Decimal(this.quotationDetailData.computeLabourCost).add(new Decimal(item.unitLaborCost)).toNumber(); |
|
|
|
this.quotationDetailData.computeFabricateCost = new Decimal(this.quotationDetailData.computeFabricateCost).add(new Decimal(item.unitManufacturingCost)).toNumber(); |
|
|
|
this.quotationDetailData.computeMachineCost = new Decimal(this.quotationDetailData.computeMachineCost).add(new Decimal(item.unitMachineryCost)).toNumber(); |
|
|
|
} |
|
|
|
} |
|
|
|
}).catch((error)=>{ |
|
|
|
this.initQuotationRoutingLoading = false; |
|
|
|
@ -2923,7 +2973,6 @@ export default { |
|
|
|
this.initQuotationPartLoading = false; |
|
|
|
if (data.code === 200){ |
|
|
|
this.quotationPartFormTable.quotationPartList = data.data; |
|
|
|
this.computeQuotationPartCost();// 计算材料 |
|
|
|
} |
|
|
|
}).catch((error)=>{ |
|
|
|
this.initQuotationPartLoading = false; |
|
|
|
@ -2939,7 +2988,6 @@ export default { |
|
|
|
this.initQuotationToolLoading = false; |
|
|
|
if (data.code === 200) { |
|
|
|
this.quotationToolFormTable.quotationToolList = data.data; |
|
|
|
this.computeQuotationToolCost();// 计算工具价格 |
|
|
|
} |
|
|
|
}).catch((error)=>{ |
|
|
|
this.initQuotationToolLoading = false; |
|
|
|
@ -3024,6 +3072,14 @@ export default { |
|
|
|
}, |
|
|
|
|
|
|
|
// ===============================================打开dialog事件================================================== |
|
|
|
// 打开材料弹框 |
|
|
|
openQuotationPartDialog(){ |
|
|
|
this.computePartQuotationUnitCost(this.quotationPart); |
|
|
|
}, |
|
|
|
// 打开工具弹框 |
|
|
|
openQuotationToolDialog(){ |
|
|
|
this.computeToolQuotationUnitCost(this.quotationTool); |
|
|
|
}, |
|
|
|
// 点击可选择打开 可选择弹框 |
|
|
|
chooseModalBtn(row){ |
|
|
|
this.chooseModalData.itemNo=row.itemNo; |
|
|
|
@ -3094,7 +3150,8 @@ export default { |
|
|
|
}, |
|
|
|
// 打开报价工序新增 |
|
|
|
openQuotationRoutingDialog(){ |
|
|
|
// this.queryOperationList(); |
|
|
|
// this.queryOperationList() |
|
|
|
this.changeWorkCenterSelect(this.quotationRouting.machiningCenterNo) |
|
|
|
}, |
|
|
|
// 打开 材料信息弹框 |
|
|
|
openPartDialog(){ |
|
|
|
@ -3206,14 +3263,17 @@ export default { |
|
|
|
machiningCenterNo:undefined,//加工中心编码 |
|
|
|
machiningCenterDesc:undefined,//加工中心名称 |
|
|
|
machiningCenterType:undefined,//加工中心类别 |
|
|
|
machiningSetupTime:1,//调机时间 |
|
|
|
unitOutputQuantity:0,//单位产出量 |
|
|
|
outputUnit:'单位/小时',//单位编码 |
|
|
|
machiningSetupTime:0,//调机时间 |
|
|
|
unitOutputQuantity:1,//单位产出量 |
|
|
|
outputUnit:'小时',//单位编码 |
|
|
|
routingEfficiency:100,//效率 |
|
|
|
operatorsNumber:1,//操作工人数 |
|
|
|
unitMachineryCost:0,//单位机器成本 |
|
|
|
unitLaborCost:0,//单位人工成本 |
|
|
|
unitManufacturingCost:0,//单位制造费用 |
|
|
|
laborCenterCost:0, |
|
|
|
machineryCenterCost:0,//机器成本 |
|
|
|
manufacturingCenterCost:0, |
|
|
|
unitQuotedCost:0,//单位报价成本 |
|
|
|
remark:undefined,//备注 |
|
|
|
}; |
|
|
|
@ -3228,6 +3288,7 @@ export default { |
|
|
|
toolDescription: "", |
|
|
|
toolQuantity: 1, |
|
|
|
unitCost: 1, |
|
|
|
quotationUnitCost: 0, |
|
|
|
expectedServiceLife: 1, |
|
|
|
remark: "", |
|
|
|
}; |
|
|
|
@ -3257,9 +3318,10 @@ export default { |
|
|
|
quotationPartDesc:undefined,//报价材料名称 |
|
|
|
umId:undefined,//计量单位 |
|
|
|
unitDosage:1,//单位用量 |
|
|
|
attritionRate:1,//损耗率 |
|
|
|
attritionRate:0,//损耗率 |
|
|
|
transferAmount:1,//调机用量 |
|
|
|
unitCost:1,//单位成本 |
|
|
|
quotationUnitCost: 0,//报价单位成本 |
|
|
|
remark:undefined,//备注 |
|
|
|
}; |
|
|
|
this.selectionPartList = []; |
|
|
|
@ -3385,6 +3447,7 @@ export default { |
|
|
|
this.quotationPart.quotationPartDesc = row.partDesc; |
|
|
|
this.quotationPart.umId = row.umId; |
|
|
|
this.quotationPart.unitCost = row.standardCost; |
|
|
|
this.computePartQuotationUnitCost(this.quotationPart); |
|
|
|
this.partDialogFlag = false; |
|
|
|
}, |
|
|
|
// 项目材料双击事件 |
|
|
|
@ -3400,34 +3463,47 @@ export default { |
|
|
|
this.quotationTool.toolNo = row.toolNo; |
|
|
|
this.quotationTool.toolDescription = row.toolDescription; |
|
|
|
this.quotationTool.unitCost = row.unitCost ? row.unitCost : 0; |
|
|
|
this.computeToolQuotationUnitCost(this.quotationTool) |
|
|
|
this.toolHeaderDialogFlag= false; |
|
|
|
}, |
|
|
|
getComponentRowData (row) { |
|
|
|
this.quotationRouting.quotationRoutingNo = row.operationId |
|
|
|
this.quotationRouting.quotationRoutingDesc = row.operationName |
|
|
|
this.quotationRouting.machiningCenterNo = row.workCenterNo |
|
|
|
this.changeWorkCenterSelect(row.workCenterNo, this.quotationRouting) |
|
|
|
this.changeWorkCenterSelect(row.workCenterNo) |
|
|
|
this.componentPartModelFlag = false |
|
|
|
}, |
|
|
|
// =============================================输入框输入事件======================================================= |
|
|
|
// 计算材料总成本 |
|
|
|
computeQuotationPartCost(){ |
|
|
|
let amount = this.quotationPartFormTable.quotationPartList.reduce((total,currentValue)=>{ |
|
|
|
// 用量 调机用量+单位用量+损耗率 |
|
|
|
let count = new Decimal(currentValue.unitDosage).add(new Decimal(currentValue.transferAmount)); |
|
|
|
count = count.add(count.mul(new Decimal(currentValue.attritionRate)).div(100)); |
|
|
|
return total + count.mul(new Decimal(currentValue.unitCost)).toNumber(); |
|
|
|
return total + new Decimal(currentValue.quotationUnitCost).toNumber(); |
|
|
|
},0); |
|
|
|
this.quotationDetailData.computePartCost = new Decimal(amount).mul(new Decimal(this.quotationDetailData.quotationDetailQuantity)).toNumber(); |
|
|
|
}, |
|
|
|
// 计算 报价工具总成本 |
|
|
|
computeQuotationToolCost(){ |
|
|
|
this.quotationDetailData.computeToolCost = this.quotationToolFormTable.quotationToolList.reduce((total, currentValue) => { |
|
|
|
return total + new Decimal(currentValue.toolQuantity).mul(new Decimal(currentValue.unitCost)).toNumber(); |
|
|
|
return total + new Decimal(currentValue.quotationUnitCost).toNumber(); |
|
|
|
}, 0); |
|
|
|
}, |
|
|
|
computeQuotationRoutingCost(){ |
|
|
|
this.quotationDetailData.computeLabourCost = 0; |
|
|
|
this.quotationDetailData.computeFabricateCost = 0; |
|
|
|
this.quotationDetailData.computeMachineCost = 0; |
|
|
|
for (let i = 0; i < this.quotationRoutingFormTable.quotationRoutingList.length; i++) { |
|
|
|
let item = this.quotationRoutingFormTable.quotationRoutingList[i]; |
|
|
|
// 获取总价格 |
|
|
|
this.quotationDetailData.computeLabourCost = new Decimal(this.quotationDetailData.computeLabourCost).add(new Decimal(item.unitLaborCost)).toNumber(); |
|
|
|
this.quotationDetailData.computeFabricateCost = new Decimal(this.quotationDetailData.computeFabricateCost).add(new Decimal(item.unitManufacturingCost)).toNumber(); |
|
|
|
this.quotationDetailData.computeMachineCost = new Decimal(this.quotationDetailData.computeMachineCost).add(new Decimal(item.unitMachineryCost)).toNumber(); |
|
|
|
} |
|
|
|
}, |
|
|
|
// 计算按钮 |
|
|
|
adjustCost(){ |
|
|
|
this.computeQuotationPartCost();// 计算材料总成本 |
|
|
|
this.computeQuotationToolCost();//计算工具成本 |
|
|
|
this.computeQuotationRoutingCost();//计算工艺成本 |
|
|
|
this.quotationDetailData.adjustPartCost = new Decimal(this.quotationDetailData.computePartCost).toSignificantDigits().toNumber(); |
|
|
|
this.quotationDetailData.adjustToolCost = new Decimal(this.quotationDetailData.computeToolCost).toSignificantDigits().toNumber(); |
|
|
|
this.quotationDetailData.adjustLabourCost = new Decimal(this.quotationDetailData.computeLabourCost).toSignificantDigits().toNumber(); |
|
|
|
@ -3471,29 +3547,54 @@ export default { |
|
|
|
this.quotationDetailData.detailTotalCost = this.quotationDetailData.detailTotalCost.add(new Decimal(this.quotationDetailData.detailOtherCost)); |
|
|
|
this.quotationDetailData.detailTotalCost = this.quotationDetailData.detailTotalCost.add(new Decimal(this.quotationDetailData.detailManageCost)).toSignificantDigits().toNumber(); |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 计算材料报价单位成本 |
|
|
|
* @param row 计算对象 |
|
|
|
*/ |
|
|
|
computePartQuotationUnitCost(row){ |
|
|
|
if (!row.transferAmount || !row.unitDosage || !row.unitCost){ |
|
|
|
row.quotationUnitCost = 0; |
|
|
|
return |
|
|
|
} |
|
|
|
if (!row.attritionRate){ |
|
|
|
row.attritionRate = 0; |
|
|
|
} |
|
|
|
// 需求数量 = 调机用量 / 主记录上的报价数量 + 1 * 单位用量 * (1 – 损耗率 / 100) |
|
|
|
let transferAmountNumber = new Decimal(row.transferAmount).div(new Decimal(this.quotationDetailData.quotationDetailQuantity)); |
|
|
|
let needNumber =transferAmountNumber.add(new Decimal(1).mul(new Decimal(row.unitDosage).mul(new Decimal(1).sub(new Decimal(row.attritionRate).div(new Decimal(100)))))); |
|
|
|
// 报价单位成本 = 单位成本 * 需求数量 |
|
|
|
row.quotationUnitCost = new Decimal(new Decimal(row.unitCost).mul(needNumber).toFixed(4,Decimal.ROUND_HALF_UP)).toSignificantDigits().toNumber(); |
|
|
|
}, |
|
|
|
computeToolQuotationUnitCost(row){ |
|
|
|
//单位报价成本 = 单位成本 * 工具数量 / 预计使用寿命 |
|
|
|
if (!row.expectedServiceLife || row.expectedServiceLife <= 0){ |
|
|
|
this.quotationTool.expectedServiceLife = 1; |
|
|
|
} |
|
|
|
if (!row.toolQuantity || row.toolQuantity <= 0){ |
|
|
|
this.quotationTool.toolQuantity = 1; |
|
|
|
} |
|
|
|
if (!row.unitCost || row.unitCost <= 0){ |
|
|
|
this.quotationTool.unitCost = 1; |
|
|
|
} |
|
|
|
if (!row.expectedServiceLife || !row.toolQuantity || !row.unitCost){ |
|
|
|
row.quotationUnitCost = 0; |
|
|
|
return |
|
|
|
} |
|
|
|
row.quotationUnitCost = new Decimal(new Decimal(row.unitCost).mul(new Decimal(row.toolQuantity)).div(new Decimal(row.expectedServiceLife)).toFixed(4,Decimal.ROUND_HALF_UP)).toSignificantDigits().toNumber(); |
|
|
|
}, |
|
|
|
// ====================================================输入框 事件============================================= |
|
|
|
changeWorkCenterSelect(val,obj){ |
|
|
|
let value = this.workCenterList.find((item)=>item.workCenterNo == val); |
|
|
|
changeWorkCenterSelect(val){ |
|
|
|
let value = this.workCenterList.find((item)=>item.workCenterNo === val); |
|
|
|
if (value){ |
|
|
|
obj.machiningCenterDesc = value.workCenterDesc; |
|
|
|
obj.machiningCenterType = value.workCenterType; |
|
|
|
obj.unitLaborCost = value.laborCost; // 人工成本 |
|
|
|
obj.unitMachineryCost = value.unitCost; // 机器成本 |
|
|
|
obj.unitManufacturingCost = value.overheadCost;// 制造费用 |
|
|
|
this.quotationRouting.machiningCenterNo = value.workCenterNo; |
|
|
|
this.quotationRouting.machiningCenterDesc = value.workCenterDesc; |
|
|
|
this.quotationRouting.machiningCenterType = value.workCenterType; |
|
|
|
this.quotationRouting.laborCenterCost = value.laborCost; // 人工成本 |
|
|
|
this.quotationRouting.machineryCenterCost = value.unitCost; // 机器成本 |
|
|
|
this.quotationRouting.manufacturingCenterCost = value.overheadCost;// 制造费用 |
|
|
|
// 计算费用 |
|
|
|
// 获得效率 |
|
|
|
let efficiency = new Decimal(obj.routingEfficiency).div(new Decimal(100)).toNumber(); |
|
|
|
if (obj.outputUnit === '小时'){ |
|
|
|
// obj.unitManufacturingCost = obj. |
|
|
|
}else if (obj.outputUnit === '小时/单位'){ |
|
|
|
|
|
|
|
}else if (obj.outputUnit === '单位/小时'){ |
|
|
|
|
|
|
|
}else { |
|
|
|
this.$message.warning("产出单位有误") |
|
|
|
} |
|
|
|
this.changeRoutingCost();// 工艺 计算单位成本 |
|
|
|
} |
|
|
|
}, |
|
|
|
machiningCenterNoSelect(e,row){ |
|
|
|
let value = e.target.value; // 输入框值 |
|
|
|
@ -3501,18 +3602,114 @@ export default { |
|
|
|
row.machiningCenterNo = value |
|
|
|
} |
|
|
|
}, |
|
|
|
// 计算工艺单位机器成本 |
|
|
|
computeUnitMachine(){ |
|
|
|
let unitMachineryCost = this.quotationRouting.machineryCenterCost; |
|
|
|
if (!unitMachineryCost){ |
|
|
|
this.quotationRouting.unitMachineryCost = 0; |
|
|
|
return |
|
|
|
} |
|
|
|
let total = new Decimal(0); |
|
|
|
// 单位机器成本 * 机器调机时间 |
|
|
|
if (!this.quotationRouting.machiningSetupTime || this.quotationRouting.machiningSetupTime < 0){ |
|
|
|
this.quotationRouting.machiningSetupTime = 0; |
|
|
|
} |
|
|
|
total = total.add(new Decimal(unitMachineryCost).mul(this.quotationRouting.machiningSetupTime)) |
|
|
|
// 单位机器成本 * 机器需求生产时间 - 机器需求生产时间 = 机器单位生产时间 * (效率 / 100) |
|
|
|
let efficiency = new Decimal(this.quotationRouting.routingEfficiency).div(new Decimal(100));//效率 |
|
|
|
// 计算单位生产时间 |
|
|
|
if (!this.quotationRouting.unitOutputQuantity || this.quotationRouting.unitOutputQuantity <= 0){ |
|
|
|
this.quotationRouting.unitOutputQuantity = 0; |
|
|
|
total = total.add(new Decimal(0)); |
|
|
|
}else { |
|
|
|
if (this.quotationRouting.outputUnit === '小时'){ |
|
|
|
total = total.add(new Decimal(unitMachineryCost).mul(new Decimal(this.quotationRouting.unitOutputQuantity).mul(efficiency))) |
|
|
|
}else if (this.quotationRouting.outputUnit === '小时/单位'){ |
|
|
|
total = total.add(new Decimal(unitMachineryCost).mul(new Decimal(1).mul(new Decimal(this.quotationRouting.unitOutputQuantity)).mul(efficiency))) |
|
|
|
}else if (this.quotationRouting.outputUnit === '单位/小时'){ |
|
|
|
total = total.add(new Decimal(unitMachineryCost).mul(new Decimal(1).div(new Decimal(this.quotationRouting.unitOutputQuantity)).mul(efficiency))) |
|
|
|
}else { |
|
|
|
total = total.add(new Decimal(0)); |
|
|
|
} |
|
|
|
} |
|
|
|
this.quotationRouting.unitMachineryCost = new Decimal(total.toFixed(4,Decimal.ROUND_HALF_UP)).toSignificantDigits().toNumber(); |
|
|
|
}, |
|
|
|
// 计算工艺单位制造费用 |
|
|
|
computeManufacturingCenterCost(){ |
|
|
|
let manufacturingCenterCost = this.quotationRouting.manufacturingCenterCost; |
|
|
|
if (!manufacturingCenterCost){ |
|
|
|
this.quotationRouting.manufacturingCenterCost = 0; |
|
|
|
return |
|
|
|
} |
|
|
|
let total = new Decimal(0); |
|
|
|
// 单位机器成本 * 机器调机时间 |
|
|
|
if (!this.quotationRouting.machiningSetupTime || this.quotationRouting.machiningSetupTime < 0){ |
|
|
|
this.quotationRouting.machiningSetupTime = 0; |
|
|
|
} |
|
|
|
total = total.add(new Decimal(manufacturingCenterCost).mul(this.quotationRouting.machiningSetupTime)) |
|
|
|
// 单位机器成本 * 机器需求生产时间 - 机器需求生产时间 = 机器单位生产时间 * (效率 / 100) |
|
|
|
let efficiency = new Decimal(this.quotationRouting.routingEfficiency).div(new Decimal(100));//效率 |
|
|
|
// 计算单位生产时间 |
|
|
|
if (!this.quotationRouting.unitOutputQuantity || this.quotationRouting.unitOutputQuantity <= 0){ |
|
|
|
this.quotationRouting.unitOutputQuantity = 0; |
|
|
|
total = total.add(new Decimal(0)); |
|
|
|
}else { |
|
|
|
if (this.quotationRouting.outputUnit === '小时'){ |
|
|
|
total = total.add(new Decimal(manufacturingCenterCost).mul(new Decimal(this.quotationRouting.unitOutputQuantity).mul(efficiency))) |
|
|
|
}else if (this.quotationRouting.outputUnit === '小时/单位'){ |
|
|
|
total = total.add(new Decimal(manufacturingCenterCost).mul(new Decimal(1).mul(new Decimal(this.quotationRouting.unitOutputQuantity)).mul(efficiency))) |
|
|
|
}else if (this.quotationRouting.outputUnit === '单位/小时'){ |
|
|
|
total = total.add(new Decimal(manufacturingCenterCost).mul(new Decimal(1).div(new Decimal(this.quotationRouting.unitOutputQuantity)).mul(efficiency))) |
|
|
|
}else { |
|
|
|
total = total.add(new Decimal(0)); |
|
|
|
} |
|
|
|
} |
|
|
|
this.quotationRouting.unitManufacturingCost = new Decimal(total.toFixed(4,Decimal.ROUND_HALF_UP)).toSignificantDigits().toNumber(); |
|
|
|
}, |
|
|
|
computeLaborCenterCost(){ |
|
|
|
let laborCenterCost = this.quotationRouting.laborCenterCost; |
|
|
|
if (!laborCenterCost){ |
|
|
|
this.quotationRouting.laborCenterCost = 0; |
|
|
|
return |
|
|
|
} |
|
|
|
if (!this.quotationRouting.machiningSetupTime || this.quotationRouting.machiningSetupTime < 0){ |
|
|
|
this.quotationRouting.machiningSetupTime = 0; |
|
|
|
} |
|
|
|
// 单位调机时间 调机时间/主记录报价数量 |
|
|
|
let total = new Decimal(this.quotationRouting.machiningSetupTime).div(new Decimal(this.quotationDetailData.quotationDetailQuantity)); |
|
|
|
//效率 |
|
|
|
let efficiency = new Decimal(this.quotationRouting.routingEfficiency).div(new Decimal(100)); |
|
|
|
// 人工单位生产时间 |
|
|
|
let LaborUnitTime = new Decimal(0); |
|
|
|
if (this.quotationRouting.outputUnit === '小时'){ |
|
|
|
LaborUnitTime = LaborUnitTime.add(new Decimal(this.quotationRouting.unitOutputQuantity)) |
|
|
|
}else if (this.quotationRouting.outputUnit === '小时/单位'){ |
|
|
|
LaborUnitTime = LaborUnitTime.add(new Decimal(1).mul(new Decimal(this.quotationRouting.unitOutputQuantity))) |
|
|
|
}else if (this.quotationRouting.outputUnit === '单位/小时'){ |
|
|
|
LaborUnitTime = LaborUnitTime.add(new Decimal(1).div(new Decimal(this.quotationRouting.unitOutputQuantity))) |
|
|
|
}else { |
|
|
|
LaborUnitTime = LaborUnitTime.add(new Decimal(0)); |
|
|
|
} |
|
|
|
// 人工需求生产时间 |
|
|
|
total = total.add(LaborUnitTime.mul(new Decimal(this.quotationRouting.operatorsNumber)).mul(efficiency)).mul(new Decimal(laborCenterCost)); |
|
|
|
this.quotationRouting.unitLaborCost = new Decimal(total.toFixed(4,Decimal.ROUND_HALF_UP)).toSignificantDigits().toNumber(); |
|
|
|
}, |
|
|
|
// 计算工艺单位成本 |
|
|
|
changeRoutingCost(){ |
|
|
|
this.quotationRouting.unitQuotedCost = new Decimal(0); |
|
|
|
if (this.quotationRouting.unitMachineryCost){ |
|
|
|
if (this.quotationRouting.machineryCenterCost && this.quotationRouting.machineryCenterCost > 0){ |
|
|
|
this.computeUnitMachine();// 单位机械成本 |
|
|
|
this.quotationRouting.unitQuotedCost = this.quotationRouting.unitQuotedCost.add(new Decimal(this.quotationRouting.unitMachineryCost)); |
|
|
|
} |
|
|
|
if (this.quotationRouting.unitLaborCost){ |
|
|
|
if (this.quotationRouting.laborCenterCost && this.quotationRouting.laborCenterCost > 0){ |
|
|
|
this.computeLaborCenterCost(); |
|
|
|
this.quotationRouting.unitQuotedCost = this.quotationRouting.unitQuotedCost.add(new Decimal(this.quotationRouting.unitLaborCost)); |
|
|
|
} |
|
|
|
if (this.quotationRouting.unitManufacturingCost){ |
|
|
|
if (this.quotationRouting.manufacturingCenterCost && this.quotationRouting.manufacturingCenterCost > 0){ |
|
|
|
this.computeManufacturingCenterCost();//制造费用 |
|
|
|
this.quotationRouting.unitQuotedCost = this.quotationRouting.unitQuotedCost.add(new Decimal(this.quotationRouting.unitManufacturingCost)); |
|
|
|
} |
|
|
|
this.quotationRouting.unitQuotedCost = new Decimal(this.quotationRouting.unitQuotedCost).toSignificantDigits().toNumber(); |
|
|
|
}, |
|
|
|
// ==================================================校验工具类==================================================== |
|
|
|
// 校验处理 |
|
|
|
@ -3557,7 +3754,7 @@ export default { |
|
|
|
// 输入规则 |
|
|
|
inputRule(value,type){ |
|
|
|
if (value === undefined || value === null || value === ''){ |
|
|
|
this.setInputValue(value,type); |
|
|
|
this.setInputValue(0,type); |
|
|
|
return |
|
|
|
} |
|
|
|
if (!isNaN(value)){ |
|
|
|
@ -3577,9 +3774,25 @@ export default { |
|
|
|
switch (type){ |
|
|
|
case 1: |
|
|
|
this.quotationPart.attritionRate = value; |
|
|
|
this.computePartQuotationUnitCost(this.quotationPart) |
|
|
|
break |
|
|
|
case 2: |
|
|
|
this.quotationRouting.routingEfficiency = value; |
|
|
|
this.changeRoutingCost(); |
|
|
|
break |
|
|
|
} |
|
|
|
}, |
|
|
|
inputNumberWithReg(value,type){ |
|
|
|
if (value === undefined || value === null || value === ''){ |
|
|
|
value = 1; |
|
|
|
return |
|
|
|
} |
|
|
|
if (value <= 0){ |
|
|
|
value = 1; |
|
|
|
} |
|
|
|
switch (type){ |
|
|
|
case 0: |
|
|
|
this.insertQuotationDetail.quotationDetailQuantity = value; |
|
|
|
break |
|
|
|
} |
|
|
|
}, |
|
|
|
|