Browse Source

2023-11-21 plm报价

master
zelian_wu 2 years ago
parent
commit
c8eea73236
  1. 8
      src/api/part/partInformation.js
  2. 7
      src/api/quotation/quotationHeader.js
  3. 673
      src/components/quotation/sellForQuotation/quotationDetail.vue

8
src/api/part/partInformation.js

@ -46,3 +46,11 @@ export const getFileContentList = data => createAPI(`/plm/partInformation/getFil
export const deletePartFile = data => createAPI(`/plm/partInformation/deletePartFile`,'post',data)
/**
* 查询材料信息
* @param data
* @returns {*}
*/
export const searchPartList = (data) => createAPI(`/plm/partInformation/searchPartList`,'get',data);

7
src/api/quotation/quotationHeader.js

@ -81,3 +81,10 @@ export const updateQuotationRouting = (data) => createAPI('/plm/quotationRouting
* @returns {*}
*/
export const deleteQuotationRouting = (data) => createAPI('/plm/quotationRouting/deleteQuotationRouting','post',data);
/**
* 查询 quotationPart
* @param data
* @returns {*}
*/
export const searchQuotationPart = (data) => createAPI('/plm/quotationPart/searchQuotationPart','get',data);

673
src/components/quotation/sellForQuotation/quotationDetail.vue

@ -243,91 +243,218 @@
<el-tab-pane name="index" label="材料">
<el-button type="primary" @click="quotationPartDialogFlag = true"> </el-button>
<el-button type="primary">从其他报价单复制</el-button>
<el-table style="margin-top: 5px" :data="quotationPartList" height="400">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column label="操作" width="120" align="center">
<template slot-scope="scope">
<el-link style="cursor: pointer">编辑</el-link>
<el-link style="cursor: pointer">删除</el-link>
</template>
</el-table-column>
<el-table-column type="index" width="50" align="center" label="序号"/>
<el-table-column label="材料编码" align="center"/>
<el-table-column label="材料名称" align="center"/>
<el-table-column label="计量单位" align="center"/>
<el-table-column label="单位用量" align="center"/>
<el-table-column label="损耗率" align="center"/>
<el-table-column label="调机用量" align="center"/>
<el-table-column label="单位成本" align="center"/>
<el-table-column label="备注" align="center"/>
</el-table>
<el-button type="primary" @click="deleteSelectionQuotationPart"> </el-button>
<el-form :model="quotationPartFormTable" :rules="quotationPartRules" ref="quotationPartTableForm">
<el-table style="margin-top: 5px" v-loading="partTableFlag"
element-loading-text="拼命加载中"
element-loading-spinner="el-icon-loading"
:data="quotationPartFormTable.quotationPartList" height="400"
@selection-change="handleSelectionChangeQuotationPartTable">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column label="操作" width="120" align="center">
<template slot-scope="{row,$index}">
<el-link style="cursor: pointer" @click="deleteQuotationPart($index)">删除</el-link>
</template>
</el-table-column>
<el-table-column type="index" width="50" align="center" label="序号"/>
<el-table-column label="材料编码" align="center" show-overflow-tooltip prop="quotationPartNo"/>
<el-table-column label="材料名称" align="center" show-overflow-tooltip prop="quotationPartDesc">
<template slot-scope="{row,$index}">
<el-form-item :prop="'quotationPartList.'+$index+'.quotationPartDesc'" :rules="quotationPartRules.quotationPartDesc">
<el-input :ref="'quotationPartDesc_'+$index" @keyup.native.enter="enterKeyUpFun('quotationPartDesc_'+($index+1))" v-model="row.quotationPartDesc" clearable/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="计量单位" align="center" show-overflow-tooltip prop="umId">
<template slot-scope="{row,$index}">
<el-form-item :prop="'quotationPartList.'+$index+'.umId'" :rules="quotationPartRules.umId">
<el-select v-model="row.umId" :disabled="quotationPart.quotationPartNo === '*'" style="width: 100%" placeholder="请选择">
<el-option
v-for="item in umInformationList"
:key="item.umId"
:label="item.umName"
:value="item.umId" style="width: 160px">
<span style="float: left">{{item.umName }}</span>
<span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 60px">
{{ item.umId}}
</span>
</el-option>
</el-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="单位用量" align="center" show-overflow-tooltip prop="unitDosage">
<template slot-scope="{row,$index}">
<el-form-item :prop="'quotationPartList.'+$index+'.unitDosage'" :rules="quotationPartRules.unitDosage">
<el-input :ref="'unitDosage_'+$index" @keyup.native.enter="enterKeyUpFun('unitDosage_'+($index+1))" v-model="row.unitDosage" clearable/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="损耗率%" align="center" show-overflow-tooltip prop="attritionRate">
<template slot-scope="{row,$index}">
<el-form-item :prop="'quotationPartList.'+$index+'.attritionRate'" :rules="quotationPartRules.attritionRate">
<el-input :ref="'attritionRate_'+$index" @keyup.native.enter="enterKeyUpFun('attritionRate_'+($index+1))" v-model="row.attritionRate" clearable/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="调机用量" align="center" show-overflow-tooltip prop="transferAmount">
<template slot-scope="{row,$index}">
<el-form-item :prop="'quotationPartList.'+$index+'.transferAmount'" :rules="quotationPartRules.transferAmount">
<el-input :ref="'transferAmount_'+$index" @keyup.native.enter="enterKeyUpFun('transferAmount_'+($index+1))" v-model="row.transferAmount" clearable/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="单位成本" align="center" show-overflow-tooltip prop="unitCost">
<template slot-scope="{row,$index}">
<el-form-item :prop="'quotationPartList.'+$index+'.unitCost'" :rules="quotationPartRules.unitCost">
<el-input :ref="'partUnitCost_'+$index" @keyup.native.enter="enterKeyUpFun('partUnitCost_'+($index+1))" v-model="row.unitCost" clearable/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="备注" align="center" show-overflow-tooltip prop="remark">
<template slot-scope="{row,$index}">
<el-form-item :prop="'quotationPartList.'+$index+'.remark'" :rules="quotationPartRules.remark">
<el-input :ref="'partRemark_'+$index" @keyup.native.enter="enterKeyUpFun('partRemark_'+($index+1))" v-model="row.remark" clearable/>
</el-form-item>
</template>
</el-table-column>
</el-table>
</el-form>
</el-tab-pane>
<el-tab-pane label="工艺">
<el-button type="primary" @click="quotationRoutingDialogFlag = true"> </el-button>
<el-button type="primary">从其他报价单复制</el-button>
<el-button type="primary" @click="deleteSelectionQuotationBtn"> </el-button>
<el-table style="margin-top: 5px" :data="quotationRoutingList" height="400" @selection-change="handleSelectionChangeQuotationRoutingTable">
<el-table-column
type="selection"
width="55"
fixed
align="center">
</el-table-column>
<el-table-column label="操作" width="80" align="center" fixed>
<template slot-scope="{row,$index}">
<el-link style="cursor: pointer" @click="deleteQuotationRoutingBtn($index)">删除</el-link>
</template>
</el-table-column>
<el-table-column width="50" align="center" label="序号" type="index" show-overflow-tooltip/>
<el-table-column align="center" label="工序编码" prop="quotationRoutingNo" show-overflow-tooltip/>
<el-table-column align="center" label="工序名称" prop="quotationRoutingDesc" show-overflow-tooltip/>
<el-table-column align="center" label="加工中心编码" width="120" prop="machiningCenterNo" show-overflow-tooltip>
<template slot-scope="{row,$index}">
<el-select v-model="row.machiningCenterNo" style="width: 100%" @change="(val) => changeWorkCenterSelect(val, row)" placeholder="请选择">
<el-option
v-for="item in workCenterList"
:key="item.workCenterNo"
:label="item.workCenterNo"
:value="item.workCenterNo">
<span style="float: left">{{ item.workCenterNo }}</span>
<span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 100px">
{{ item.workCenterDesc }}
</span>
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="加工中心名称" align="center" width="120" prop="machiningCenterDesc" show-overflow-tooltip/>
<el-table-column label="加工中心类别" align="center" width="120" prop="machiningCenterType" show-overflow-tooltip/>
<el-table-column label="调机时间" align="center" width="60" prop="machiningSetupTime" show-overflow-tooltip/>
<el-table-column label="单位产出量" align="center" width="120" prop="unitOutputQuantity" show-overflow-tooltip/>
<el-table-column label="产出单位" align="center" width="120" prop="umName" show-overflow-tooltip>
<template slot-scope="{row,$index}">
<el-select v-model="row.umId" placeholder="请选择">
<el-option
v-for="item in umInformationList"
:key="item.umId"
:label="item.umName"
:value="item.umId">
<span style="float: left">{{ item.umName }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.umId }}</span>
</el-option>
</el-select>
</template>
</el-table-column>
<el-table-column label="效率" align="center" width="60" prop="routingEfficiency" show-overflow-tooltip/>
<el-table-column label="操作工人数" align="center" width="120" prop="operatorsNumber" show-overflow-tooltip/>
<el-table-column label="单位机械成本" align="center" width="120" prop="unitMachineryCost" show-overflow-tooltip/>
<el-table-column label="单位人工成本" align="center" width="120" prop="unitLaborCost" show-overflow-tooltip/>
<el-table-column label="单位制造费用" align="center" width="120" prop="unitManufacturingCost" show-overflow-tooltip/>
<el-table-column label="单位报价成本" align="center" width="120" prop="unitQuotedCost" show-overflow-tooltip/>
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip/>
</el-table>
<el-button type="primary" @click="deleteSelectionQuotationRoutingBtn"> </el-button>
<el-form ref="quotationRoutingTableForm" :model="quotationRoutingFormTable" :rules="quotationRoutingRules">
<el-table style="margin-top: 5px" :data="quotationRoutingFormTable.quotationRoutingList" height="400" @selection-change="handleSelectionChangeQuotationRoutingTable">
<el-table-column
type="selection"
width="55"
align="center">
</el-table-column>
<el-table-column label="操作" width="80" align="center">
<template slot-scope="{row,$index}">
<el-link style="cursor: pointer" @click="deleteQuotationRoutingBtn($index)">删除</el-link>
</template>
</el-table-column>
<el-table-column width="50" align="center" label="序号" type="index" show-overflow-tooltip/>
<el-table-column align="center" label="工序编码" prop="quotationRoutingNo" show-overflow-tooltip/>
<el-table-column align="center" width="120" label="工序名称" prop="quotationRoutingDesc" show-overflow-tooltip>
<template slot-scope="{row,$index}">
<el-form-item :prop="'quotationRoutingList.'+$index+'.quotationRoutingDesc'" :rules="quotationRoutingRules.quotationRoutingDesc">
<el-input :disabled="row.quotationRoutingNo.trim() !=='*'" :ref="'quotationRoutingDesc_'+$index" @keyup.native.enter="enterKeyUpFun('quotationRoutingDesc_'+($index+1))" v-model="row.quotationRoutingDesc" clearable/>
</el-form-item>
</template>
</el-table-column>
<el-table-column align="center" label="加工中心编码" width="120" prop="machiningCenterNo" show-overflow-tooltip>
<template slot-scope="{row,$index}">
<el-form-item :prop="'quotationRoutingList.'+$index+'.machiningCenterNo'" :rules="quotationRoutingRules.machiningCenterNo">
<el-select v-model="row.machiningCenterNo" filterable style="width: 100%" @change="(val) => changeWorkCenterSelect(val, row)" placeholder="请选择">
<el-option
v-for="item in workCenterList"
:key="item.workCenterNo"
:label="item.workCenterNo"
:value="item.workCenterNo">
<span style="float: left;width: 80px">{{ item.workCenterNo }}</span>
<span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 100px">
{{ item.workCenterDesc }}
</span>
</el-option>
</el-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="加工中心名称" align="center" width="120" prop="machiningCenterDesc" show-overflow-tooltip/>
<el-table-column label="加工中心类别" align="center" width="120" prop="machiningCenterType" show-overflow-tooltip/>
<el-table-column label="调机时间" align="center" width="120" prop="machiningSetupTime" show-overflow-tooltip>
<template slot-scope="{row,$index}">
<el-form-item :prop="'quotationRoutingList.'+$index+'.machiningSetupTime'" :rules="quotationRoutingRules.machiningSetupTime">
<el-input :ref="'machiningSetupTime_'+$index" @keyup.native.enter="enterKeyUpFun('machiningSetupTime_'+($index+1))" v-model="row.machiningSetupTime" clearable/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="单位产出量" align="center" width="120" prop="unitOutputQuantity" show-overflow-tooltip>
<template slot-scope="{row,$index}">
<el-form-item :prop="'quotationRoutingList.'+$index+'.unitOutputQuantity'" :rules="quotationRoutingRules.unitOutputQuantity">
<el-input @keyup.native.enter="enterKeyUpFun('unitOutputQuantity_'+($index+1))" v-model="row.unitOutputQuantity" :ref="'unitOutputQuantity_'+$index" clearable/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="产出单位" align="center" width="120" prop="outputUnit" show-overflow-tooltip>
<template slot-scope="{row,$index}">
<el-form-item :prop="'quotationRoutingList.'+$index+'.outputUnit'" :rules="quotationRoutingRules.outputUnit">
<el-select v-model="row.outputUnit" clearable
filterable allow-create
@blur="(e)=>outputUnitSelect(e,row)"
default-first-option placeholder="请选择">
<el-option
v-for="item in outputUnitList"
:key="item.label"
:label="item.label"
:value="item.label">
<span style="float: left">{{ item.label }}</span>
<span style="float: right; color: #8492a6; font-size: 13px">{{ item.value }}</span>
</el-option>
</el-select>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="效率" align="center" width="120" prop="routingEfficiency" show-overflow-tooltip>
<template slot-scope="{row,$index}">
<el-form-item :prop="'quotationRoutingList.'+$index+'.routingEfficiency'" :rules="quotationRoutingRules.routingEfficiency">
<el-input :ref="'routingEfficiency_'+$index" @keyup.native.enter="enterKeyUpFun('routingEfficiency_'+($index+1))" v-model="row.routingEfficiency" clearable/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="操作工人数" align="center" width="120" prop="operatorsNumber" show-overflow-tooltip>
<template slot-scope="{row,$index}">
<el-form-item :prop="'quotationRoutingList.'+$index+'.operatorsNumber'" :rules="quotationRoutingRules.operatorsNumber">
<el-input :ref="'operatorsNumber_'+$index" @keyup.native.enter="enterKeyUpFun('operatorsNumber_'+($index+1))" v-model="row.operatorsNumber" clearable/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="单位机械成本" align="center" width="120" prop="unitMachineryCost" show-overflow-tooltip>
<template slot-scope="{row,$index}">
<el-form-item :prop="'quotationRoutingList.'+$index+'.unitMachineryCost'" :rules="quotationRoutingRules.unitMachineryCost">
<el-input :ref="'unitMachineryCost_'+$index" @keyup.native.enter="enterKeyUpFun('unitMachineryCost_'+($index+1))" v-model="row.unitMachineryCost" clearable/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="单位人工成本" align="center" width="120" prop="unitLaborCost" show-overflow-tooltip>
<template slot-scope="{row,$index}">
<el-form-item :prop="'quotationRoutingList.'+$index+'.unitLaborCost'" :rules="quotationRoutingRules.unitLaborCost">
<el-input :ref="'unitLaborCost_'+$index" @keyup.native.enter="enterKeyUpFun('unitLaborCost_'+($index+1))" v-model="row.unitLaborCost" clearable/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="单位制造费用" align="center" width="120" prop="unitManufacturingCost" show-overflow-tooltip>
<template slot-scope="{row,$index}">
<el-form-item :prop="'quotationRoutingList.'+$index+'.unitManufacturingCost'" :rules="quotationRoutingRules.unitManufacturingCost">
<el-input :ref="'unitManufacturingCost_'+$index" @keyup.native.enter="enterKeyUpFun('unitManufacturingCost_'+($index+1))" v-model="row.unitManufacturingCost" clearable/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="单位报价成本" align="center" width="120" prop="unitQuotedCost" show-overflow-tooltip>
<template slot-scope="{row,$index}">
<el-form-item :prop="'quotationRoutingList.'+$index+'.unitQuotedCost'" :rules="quotationRoutingRules.unitQuotedCost">
<el-input :ref="'unitQuotedCost_'+$index" @keyup.native.enter="enterKeyUpFun('unitQuotedCost_'+($index+1))" v-model="row.unitQuotedCost" clearable/>
</el-form-item>
</template>
</el-table-column>
<el-table-column label="备注" align="center" width="140" prop="remark" show-overflow-tooltip>
<template slot-scope="{row,$index}">
<el-input :ref="'partRemark_'+$index" @keyup.native.enter="enterKeyUpFun('partRemark_'+($index+1))" v-model="row.remark" clearable/>
</template>
</el-table-column>
</el-table>
</el-form>
</el-tab-pane>
<!--======================工具========================-->
<el-tab-pane label="工具">
<el-button type="primary" @click="saveQuotationToolFlag = true"> </el-button>
<el-button type="primary">从其他报价单复制</el-button>
@ -635,13 +762,13 @@
<el-row>
<el-col :span="6" >
<el-form-item label="加工中心编码" prop="machiningCenterNo">
<el-select v-model="quotationRouting.machiningCenterNo" clearable style="width: 100%" @change="(val) => changeWorkCenterSelect(val, quotationRouting)" placeholder="请选择">
<el-select v-model="quotationRouting.machiningCenterNo" filterable clearable style="width: 100%" @change="(val) => changeWorkCenterSelect(val, quotationRouting)" placeholder="请选择">
<el-option
v-for="item in workCenterList"
:key="item.workCenterNo"
:label="item.workCenterNo"
:value="item.workCenterNo">
<span style="float: left">{{ item.workCenterNo }}</span>
<span style="float: left;width: 80px">{{ item.workCenterNo }}</span>
<span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 100px">
{{ item.workCenterDesc }}
</span>
@ -670,47 +797,47 @@
</el-form-item>
</el-col>
<el-col :span="6" :offset="2">
<el-form-item label="单位" prop="umId">
<el-select v-model="quotationRouting.umId" style="width: 100%" clearable placeholder="请选择">
<el-form-item label="产出单位" prop="outputUnit">
<el-select v-model="quotationRouting.outputUnit" filterable allow-create
@blur="(e)=>outputUnitSelect(e,quotationRouting)"
default-first-option style="width: 100%" clearable placeholder="请选择">
<el-option
v-for="item in umInformationList"
:key="item.umId"
:label="item.umName"
:value="item.umId">
<span style="float: left">{{ item.umName }}</span>
<span style="float: right; color: #8492a6; font-size: 11px">{{ item.umId }}</span>
v-for="item in outputUnitList"
:key="item.label"
:label="item.label"
:value="item.label">
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="6" >
<el-form-item label="效率" prop="routingEfficiency">
<el-input v-model="quotationRouting.routingEfficiency" style="width: 100%" :controls="false" :min="1"></el-input>
<el-input v-model="quotationRouting.routingEfficiency"></el-input>
</el-form-item>
</el-col>
<el-col :span="6" :offset="2">
<el-form-item label="操作工人数" prop="operatorsNumber">
<el-input v-model="quotationRouting.operatorsNumber" style="width: 100%" :controls="false" :min="1"></el-input>
<el-input v-model="quotationRouting.operatorsNumber"></el-input>
</el-form-item>
</el-col>
<el-col :span="6" :offset="2">
<el-form-item label="单位机械成本" prop="unitMachineryCost">
<el-input v-model="quotationRouting.unitMachineryCost" style="width: 100%" :controls="false" :min="1"></el-input>
<el-input v-model="quotationRouting.unitMachineryCost"></el-input>
</el-form-item>
</el-col>
<el-col :span="6" >
<el-form-item label="单位人工成本" prop="unitLaborCost">
<el-input v-model="quotationRouting.unitLaborCost" style="width: 100%" :controls="false" :min="1"></el-input>
<el-input v-model="quotationRouting.unitLaborCost"></el-input>
</el-form-item>
</el-col>
<el-col :span="6" :offset="2">
<el-form-item label="单位制造费用" prop="unitManufacturingCost">
<el-input v-model="quotationRouting.unitManufacturingCost" style="width: 100%" :controls="false" :min="1"></el-input>
<el-input v-model="quotationRouting.unitManufacturingCost"></el-input>
</el-form-item>
</el-col>
<el-col :span="6" :offset="2">
<el-form-item label="单位报价成本" prop="unitQuotedCost">
<el-input v-model="quotationRouting.unitQuotedCost" style="width: 100%" :controls="false" :min="1"></el-input>
<el-input v-model="quotationRouting.unitQuotedCost"></el-input>
</el-form-item>
</el-col>
</el-row>
@ -728,27 +855,126 @@
<el-dialog
title="报价材料"
:visible.sync="quotationPartDialogFlag"
@close="closeQuotationPartDialog"
width="30%">
<el-form :model="quotationPart" ref="quotationPartForm" label-position="top">
<el-form :model="quotationPart" :rules="quotationPartRules" ref="quotationPartForm" label-position="top">
<el-row>
<el-col :span="10">
<el-form-item label="材料编号" prop="quotationPartNo">
<el-input v-model="quotationPart.quotationPartNo" clearable/>
<span slot="label" @click="partDialogFlag = true" style="cursor: pointer"><a>工具编码</a></span>
<el-input v-model="quotationPart.quotationPartNo" :disabled="quotationPart.quotationPartDesc" clearable/>
</el-form-item>
</el-col>
<el-col :span="10" :offset="2">
<el-form-item label="材料名称" prop="quotationPartDesc">
<el-input v-model="quotationPart.quotationPartDesc" clearable/>
<el-input v-model="quotationPart.quotationPartDesc" :disabled="quotationPart.quotationPartNo != '*'" clearable/>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="计量单位" prop="umId">
<el-select v-model="quotationPart.umId" :disabled="quotationPart.quotationPartNo != '*'" style="width: 100%" clearable placeholder="请选择">
<el-option
v-for="item in umInformationList"
:key="item.umId"
:label="item.umName"
:value="item.umId">
<span style="float: left">{{item.umName }}</span>
<span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 100px">
{{ item.umId}}
</span>
</el-option>
</el-select>
</el-form-item>
</el-col>
<el-col :span="10" :offset="2">
<el-form-item label="单位用量" prop="unitDosage">
<el-input v-model="quotationPart.unitDosage" clearable/>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="损耗率" prop="attritionRate">
<el-input v-model="quotationPart.attritionRate" clearable>
<template slot="append">%</template>
</el-input>
</el-form-item>
</el-col>
<el-col :span="10" :offset="2">
<el-form-item label="调机用量" prop="transferAmount">
<el-input v-model="quotationPart.transferAmount" clearable/>
</el-form-item>
</el-col>
<el-col :span="10">
<el-form-item label="单位成本" prop="unitCost">
<el-input v-model="quotationPart.unitCost" clearable/>
</el-form-item>
</el-col>
<el-col :span="22">
<el-form-item label="备注" prop="remark" style="height: 80px">
<el-input type="textarea" v-model="quotationPart.remark"/>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer">
<el-button @click="quotationPartDialogFlag = false"> </el-button>
<el-button type="primary" @click="quotationPartDialogFlag = false"> </el-button>
<el-button type="primary" @click="saveQuotationPartBtn"> </el-button>
</span>
</el-dialog>
<!--材料弹框-->
<el-dialog title="材料列表" @open="openPartDialog"
:visible.sync="partDialogFlag">
<!--搜索条件-->
<el-form :model="partData" ref="partDataForm" label-position="top">
<el-row>
<el-col :span="4">
<el-form-item label="工具编号" prop="toolNo">
<el-input v-model="partData.partNo" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" :offset="1">
<el-form-item label="工具描述" prop="toolDescription">
<el-input v-model="partData.partDesc" clearable/>
</el-form-item>
</el-col>
<el-col :span="4" :offset="1">
<el-form-item label=" ">
<el-button type="primary" @click="initPartList"> </el-button>
</el-form-item>
</el-col>
</el-row>
</el-form>
<!--筛选的数据-->
<el-table :data="computedPartTable" ref="toolHeaderTable" :style="{marginTop:'10px'}"
height="300px" stripe border width="30%" @selection-change="handleSelectionChangePartTable">
<el-table-column
type="selection"
width="55" align="center">
</el-table-column>
<el-table-column label="材料编号" prop="partNo"/>
<el-table-column label="材料描述" prop="partDesc"/>
<el-table-column label="计量单位" width="200" prop="umId">
<template slot-scope="{row,$index}">
<el-select v-model="row.umId" disabled style="width: 100%" clearable placeholder="请选择">
<el-option
v-for="item in umInformationList"
:key="item.umId"
:label="item.umName"
:value="item.umId">
<span style="float: left">{{item.umName }}</span>
<span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 100px">
{{ item.umId}}
</span>
</el-option>
</el-select>
</template>
</el-table-column>
</el-table>
<span slot="footer" class="dialog-footer" style="margin-top: 5px">
<el-button @click="partDialogFlag= false"> </el-button>
<el-button type="primary" @click="savePartBtn"> </el-button>
</span>
</el-dialog>
</div>
</template>
<script>
@ -763,6 +989,7 @@ import {
insertQuotationRouting,
updateQuotationRouting,
deleteQuotationRouting,
searchQuotationPart,
} from '@/api/quotation/quotationHeader.js';
import {
searchUmInformationList, //
@ -773,6 +1000,9 @@ import {
import {
searchWorkCenter, //
} from '@/api/part/workCenter.js';
import {
searchPartList, //
} from '@/api/part/partInformation.js';
export default {
props: ['quotationHeader'],
name: "quotationDetail",
@ -786,11 +1016,19 @@ export default {
selectionQuotationToolList:[],//
toolHeaderList:[],//
selectionToolHeaderList:[],//
quotationRoutingList: [],//
quotationRoutingFormTable:{
quotationRoutingList:[],//
},
selectionQuotationRoutingList:[],//
umInformationList:[],//
outputUnitList:[{label:"单位/小时"},{label: "小时/单位"},{label: "小时"}],//
workCenterList:[],//
quotationPartList: [],//
partList:[],//
quotationPartFormTable:{
quotationPartList: [],//
},
selectionQuotationPartList:[],//
selectionPartList:[],//
// =========================================================================================
no: 1,//
size: 20,//
@ -802,12 +1040,14 @@ export default {
toolHeaderDialogFlag:false,//
quotationRoutingDialogFlag: false,//
quotationPartDialogFlag:false,//
partDialogFlag:false,//
// =======================================================================================
//
insertQuotationDetailData: {
flag: false,
},
// ============================================= ================================================
partTableFlag:true,
// ==============================================================================================
activeName: "index",//
// =========================================================================================
@ -819,7 +1059,11 @@ export default {
site:this.$store.state.user.site,//
quotationPartNo:undefined,//
quotationPartDesc:undefined,//
quotationPartQuantity:undefined,//
umId:undefined,//
unitDosage:undefined,//
attritionRate:undefined,//
transferAmount:undefined,//
unitCost:undefined,//
remark:undefined,//
},
//
@ -882,7 +1126,7 @@ export default {
machiningCenterType:undefined,//
machiningSetupTime:undefined,//
unitOutputQuantity:undefined,//
umId:undefined,//
outputUnit:undefined,//
routingEfficiency:undefined,//
operatorsNumber:undefined,//
unitMachineryCost:undefined,//
@ -907,6 +1151,11 @@ export default {
toolNo:undefined,//
toolDescription:undefined,//
},
//
partData:{
partNo:undefined,//
partDesc:undefined,
},
// ======================================================================================
//
quotationDetailRules: {
@ -1014,8 +1263,9 @@ export default {
{required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'change'},
{required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'blur'},
],
umId: [
outputUnit: [
{required: true, message: ' ', trigger: 'change'},
{required: true, message: ' ', trigger: 'blur'},
],
routingEfficiency: [
{required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'change'},
@ -1042,6 +1292,37 @@ export default {
{required: true, pattern: /^([1-9]\d*|[0]{1,1})$/, message: ' ', trigger: 'blur'},
],
},
//
quotationPartRules:{
quotationPartNo:[
{required: true, message: ' ', trigger: 'change'},
{required: true, message: ' ', trigger: 'blur'},
],
quotationPartDesc:[
{required: true, message: ' ', trigger: 'change'},
{required: true, message: ' ', trigger: 'blur'},
],
umId:[
{required: true, message: ' ', trigger: 'change'},
{required: true, message: ' ', trigger: 'blur'},
],
unitDosage:[
{required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'change'},
{required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'blur'},
],
attritionRate:[
{required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'change'},
{required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'blur'},
],
transferAmount: [
{required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'change'},
{required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'blur'},
],
unitCost:[
{required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'change'},
{required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'blur'},
],
},
// ==========================================================================
//
quotationDetailColumns: [
@ -1077,7 +1358,7 @@ export default {
{label: "machiningCenterType", value: "加工中心类别"},
{label: "machiningSetupTime", value: "调机时间"},
{label: "unitOutputQuantity", value: "单位产出量"},
{label: "umId", value: "单位编码"},
{label: "outputUnit", value: "产出单位"},
{label: "routingEfficiency", value: "效率"},
{label: "operatorsNumber", value: "操作工人数"},
{label: "unitMachineryCost", value: "单位机械成本"},
@ -1085,6 +1366,16 @@ export default {
{label: "unitManufacturingCost", value: "单位制造费用"},
{label: "unitQuotedCost", value: "单位报价成本"},
],
//
quotationPartColumns:[
{label:"quotationPartNo",value:"材料编号"},
{label: "quotationPartDesc", value: "材料名称"},
{label: "umId",value: "计量单位"},
{label: "unitDosage", value: "单位用量"},
{label: "attritionRate", value: "损耗率"},
{label: "transferAmount", value: "调机用量"},
{label: "unitCost", value: "单位成本"},
],
}
},
computed: {
@ -1110,7 +1401,30 @@ export default {
return tableData;
}
return this.toolHeaderList;
}
},
//
computedPartTable:function (){
let searchPartNo = this.partData.partNo;
let searchPartDescription = this.partData.partDesc;
if (searchPartNo || searchPartDescription){
let tableData = JSON.parse(JSON.stringify(this.partList));
if (searchPartNo && searchPartDescription){
tableData = tableData.filter(item=>{
return item.partNo.includes(searchPartNo) && item.partDesc.includes(searchPartDescription);
})
}else if (searchPartNo){
tableData = tableData.filter(item=>{
return item.partNo.includes(searchPartNo) ;
})
}else {
tableData = tableData.filter(item=>{
return item.partDesc.includes(searchPartDescription);
})
}
return tableData;
}
return this.partList;
},
},
watch: {
//
@ -1184,6 +1498,7 @@ export default {
},
//
deleteSelectionQuotationTool(){
console.log(this.selectionQuotationToolList.length)
this.selectionQuotationToolList.reverse().forEach(item => {
this.quotationToolFormTable.quotationToolList.splice(item.index,1);
});
@ -1192,20 +1507,33 @@ export default {
},
//
deleteQuotationRoutingBtn(index){
this.quotationRoutingList.splice(index,1);
this.quotationRoutingFormTable.quotationRoutingList.splice(index,1);
//
this.$message.success("删除成功!");
},
//
deleteSelectionQuotationBtn(){
deleteSelectionQuotationRoutingBtn(){
this.selectionQuotationRoutingList.reverse().forEach(item => {
this.quotationRoutingList.splice(item.index,1);
this.quotationRoutingFormTable.quotationRoutingList.splice(item.index,1);
});
//
this.$message.success("删除成功!");
},
//
deleteQuotationPart(index){
this.quotationPartFormTable.quotationPartList.splice(index,1)
this.$message.success("删除成功!")
},
//
deleteSelectionQuotationPart(){
this.selectionQuotationPartList.reverse().forEach(item => {
this.quotationPartFormTable.quotationPartList.splice(item.index,1);
});
//
this.$message.success("删除成功!");
},
// ====================================================================================================
//
saveQuotationDetail() {
@ -1218,6 +1546,20 @@ export default {
this.rulesValidateLabel(objects, this.quotationDetailColumns);
}
});
//
this.$refs.quotationPartTableForm.validate((validate, objects) => {
if (!validate) {
flag = false;
this.rulesValidateTableLabel(objects, this.quotationPartColumns);
}
});
//
this.$refs.quotationRoutingTableForm.validate((validate, objects) => {
if (!validate) {
flag = false;
this.rulesValidateTableLabel(objects, this.quotationRoutingColumns);
}
});
//
this.$refs.quotationToolTableForm.validate((validate, objects) => {
if (!validate) {
@ -1244,8 +1586,8 @@ export default {
//
let params = this.quotationDetailData;
params.quotationToolList = this.quotationToolFormTable.quotationToolList;
params.quotationPartList = this.quotationPartList;
params.quotationRoutingList = this.quotationRoutingList;
params.quotationPartList = this.quotationPartFormTable.quotationPartList;
params.quotationRoutingList = this.quotationRoutingFormTable.quotationRoutingList;
updateQuotationDetail(this.quotationDetailData).then(({data}) => {
if (data.code == 200) {
this.quotationDetailFlag = false;
@ -1277,19 +1619,54 @@ export default {
this.quotationTool.toolDescription = toolDescriptionStr.substring(0, toolDescriptionStr.length - 1);
this.toolHeaderDialogFlag = false;
},
//
savePartBtn(){
let quotationPartNo = "";
let quotationPartDesc = "";
this.selectionPartList = this.selectionPartList.map(item=>{
item.quotationDetailId = this.quotationDetailData.quotationDetailId;
item.site = this.$store.state.user.site;
quotationPartNo += item.partNo + ";";
quotationPartDesc += item.partDesc + ";";
return item;
});
this.quotationPart.quotationPartNo = quotationPartNo.substring(0, quotationPartNo.length - 1);
this.quotationPart.quotationPartDesc = quotationPartDesc.substring(0, quotationPartDesc.length - 1);
this.partDialogFlag = false;
},
//
saveQuotationRoutingBtn(){
this.$refs.quotationRoutingForm.validate((validate,objects)=>{
if (!validate){
this.rulesValidateLabel(objects,this.quotationRoutingColumns);
}else {
//
this.quotationRouting.quotationDetailId = this.quotationDetailData.quotationDetailId;
this.quotationRoutingList.push(JSON.parse(JSON.stringify(this.quotationRouting)));
//TODO
console.log(this.selectionPartList)
if (this.selectionPartList.length > 0){
}else {
//
this.quotationRouting.quotationDetailId = this.quotationDetailData.quotationDetailId;
this.quotationRoutingFormTable.quotationRoutingList.push(JSON.parse(JSON.stringify(this.quotationRouting)));
}
this.$message.success("新增成功!");
this.quotationRoutingDialogFlag = false;
}
})
},
//
saveQuotationPartBtn(){
this.$refs['quotationPartForm'].validate((validate,objects)=>{
if (!validate){
this.rulesValidateLabel(objects,this.quotationPartColumns);
}else {
//
this.quotationPart.quotationDetailId = this.quotationDetailData.quotationDetailId;
this.quotationPartFormTable.quotationPartList.push(JSON.parse(JSON.stringify(this.quotationPart)));
this.quotationPartDialogFlag = false;
}
})
},
// =================================================================================================
//
editQuotationDetail(row) {
@ -1360,8 +1737,8 @@ export default {
let total = 0;
searchQuotationRoutingByDetailId(params).then(({data})=>{
if (data.code == 200) {
this.quotationRoutingList = data.data;
let unitMachineryCostTotal = this.quotationRoutingList.reduce((total, currentValue) => {
this.quotationRoutingFormTable.quotationRoutingList = data.data;
let unitMachineryCostTotal = this.quotationRoutingFormTable.quotationRoutingList.reduce((total, currentValue) => {
return total + currentValue.unitMachineryCost;
}, 0);
this.quotationDetailData.computeMachineCost = unitMachineryCostTotal;
@ -1377,6 +1754,15 @@ export default {
},
//
initQuotationPart() {
let params = {
quotationDetailId: this.quotationDetailData.quotationDetailId,
};
this.partTableFlag = false;
searchQuotationPart(params).then(({data})=>{
if (data.code == 200){
this.quotationPartFormTable.quotationPartList = data.data;
}
})
let total = 0;
this.quotationDetailData.computePartCost = total;
this.quotationDetailData.adjustPartCost = total;
@ -1406,6 +1792,17 @@ export default {
}
})
},
//
initPartList(){
let params = {
site:this.$store.state.user.site
};
searchPartList(params).then(({data})=>{
if (data.code == 200) {
this.partList = data.data;
}
})
},
// =================================================================================================
// size
detailSizeChange(val) {
@ -1460,12 +1857,22 @@ export default {
this.$refs.quotationToolForm.resetFields();
}
},
//
openPartDialog(){
if (this.selectionPartList.length > 0) {
this.$refs.quotationPartForm.resetFields();
}
},
// =======================================================dialog=============================================
//
closeInsertDialog() {
this.activeName = "index";
//
this.quotationToolFormTable.quotationToolList = [];
//
this.quotationRoutingFormTable.quotationRoutingList = [];
//
this.quotationPartFormTable.quotationPartList = [];
this.quotationDetailData = {};
this.quotationDetailData.computeToolCost = undefined;
//
@ -1497,6 +1904,10 @@ export default {
//
closeToolHeaderDialog(){
},
//
closeQuotationPartDialog(){
this.$refs['quotationPartForm'].resetFields();
},
// ===============================================================================================
//
@ -1511,6 +1922,14 @@ export default {
handleSelectionChangeQuotationRoutingTable(selection){
this.selectionQuotationRoutingList = selection;
},
//
handleSelectionChangeQuotationPartTable(selection){
this.selectionQuotationPartList = selection;
},
//
handleSelectionChangePartTable(selection){
this.selectionPartList = selection;
},
// ====================================================================================================
//
inputProfitRate() {
@ -1580,7 +1999,7 @@ export default {
this.inputProfitRate();
this.inputOuterCost();
},
// ====================================================change=============================================
// ==================================================== =============================================
changeWorkCenterSelect(val,obj){
let value = this.workCenterList.find((item)=>{
return item.workCenterNo == val;
@ -1588,6 +2007,12 @@ export default {
obj.machiningCenterDesc = value?value.workCenterDesc:"";
obj.machiningCenterType = value?value.workCenterType:"";
},
outputUnitSelect(e,row){
let value = e.target.value; //
if(value) { //
row.outputUnit = value
}
},
// ======================================================================================================
//
rulesValidateLabel(objects, labels) {
@ -1606,7 +2031,7 @@ export default {
for (let filed in objects) {
let tableName = filed.split(".")[0];
filed = filed.split(".")[2];
tableName = tableName == "quotationToolList" ? "工具" : "工艺";
tableName = tableName === "quotationToolList" ? "工具" : tableName === "quotationRoutingList" ? "工艺" : "材料";
for (let i = 0; i < labels.length; i++) {
let quotationToolColumn = labels[i];
if (quotationToolColumn.label === filed) {
@ -1617,9 +2042,11 @@ export default {
}
},
// ====================================================================================================
//
//
enterKeyUpFun(refName){
this.$refs[refName].focus();
if (this.$refs[refName]){
this.$refs[refName].focus();
}
},
},
created() {
@ -1630,6 +2057,8 @@ export default {
//
this.initToolHeader();
this.initWorkCenterData();
this.initPartList();
},
}
</script>

Loading…
Cancel
Save