Browse Source

Merge remote-tracking branch 'origin/master'

master
ruanqi 2 years ago
parent
commit
57d943ec6b
  1. 32
      src/api/part/bomManagement.js
  2. 24
      src/api/part/partInformation.js
  3. 7
      src/api/quotation/quotationHeader.js
  4. 673
      src/components/quotation/sellForQuotation/quotationDetail.vue
  5. 544
      src/views/modules/part/bomManagement.vue
  6. 822
      src/views/modules/part/partInformation.vue
  7. 27
      src/views/modules/part/part_upload_file.vue

32
src/api/part/bomManagement.js

@ -0,0 +1,32 @@
import { createAPI } from "@/utils/httpRequest.js";
/**
* bom列表查询
* @param data
* @returns {*}
*/
export const bomManagementSearch = data => createAPI(`/plm/bomManagement/bomManagementSearch`,'post',data)
/**
* bom新增
* @param data
* @returns {*}
*/
export const bomManagementSave = data => createAPI(`/plm/bomManagement/bomManagementSave`,'post',data)
/**
* bom编辑
* @param data
* @returns {*}
*/
export const bomManagementEdit = data => createAPI(`/plm/bomManagement/bomManagementEdit`,'post',data)
/**
* bom删除
* @param data
* @returns {*}
*/
export const bomManagementDelete = data => createAPI(`/plm/bomManagement/bomManagementDelete`,'post',data)

24
src/api/part/partInformation.js

@ -33,16 +33,32 @@ export const partInformationDelete = data => createAPI(`/plm/partInformation/par
export const getPartItem = data => createAPI(`/plm/partInformation/getPartItem`,'post',data) export const getPartItem = data => createAPI(`/plm/partInformation/getPartItem`,'post',data)
/** /**
* 获取材料单附件列表
* 编辑材料属性
* @param data * @param data
* @returns {*} * @returns {*}
*/ */
export const getFileContentList = data => createAPI(`/plm/partInformation/getFileContentList`,'post',data)
export const savePartItemValue = data => createAPI(`/plm/partInformation/savePartItemValue`,'post',data)
/**
* 获取代理商列表
* @param data
* @returns {*}
*/
export const getAgentList = data => createAPI(`/plm/partInformation/getAgentList`,'post',data)
/**
* 获取材料代理商
* @param data
* @returns {*}
*/
export const getPartAgent = data => createAPI(`/plm/partInformation/getPartAgent`,'post',data)
/** /**
* 获取材料单附件列表
* 查询材料信息
* @param data * @param data
* @returns {*} * @returns {*}
*/ */
export const deletePartFile = data => createAPI(`/plm/partInformation/deletePartFile`,'post',data)
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 {*} * @returns {*}
*/ */
export const deleteQuotationRouting = (data) => createAPI('/plm/quotationRouting/deleteQuotationRouting','post',data); 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-tab-pane name="index" label="材料">
<el-button type="primary" @click="quotationPartDialogFlag = true"> </el-button> <el-button type="primary" @click="quotationPartDialogFlag = true"> </el-button>
<el-button type="primary">从其他报价单复制</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>
<el-tab-pane label="工艺"> <el-tab-pane label="工艺">
<el-button type="primary" @click="quotationRoutingDialogFlag = true"> </el-button> <el-button type="primary" @click="quotationRoutingDialogFlag = true"> </el-button>
<el-button type="primary">从其他报价单复制</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>
<!--======================工具========================-->
<el-tab-pane label="工具"> <el-tab-pane label="工具">
<el-button type="primary" @click="saveQuotationToolFlag = true"> </el-button> <el-button type="primary" @click="saveQuotationToolFlag = true"> </el-button>
<el-button type="primary">从其他报价单复制</el-button> <el-button type="primary">从其他报价单复制</el-button>
@ -635,13 +762,13 @@
<el-row> <el-row>
<el-col :span="6" > <el-col :span="6" >
<el-form-item label="加工中心编码" prop="machiningCenterNo"> <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 <el-option
v-for="item in workCenterList" v-for="item in workCenterList"
:key="item.workCenterNo" :key="item.workCenterNo"
:label="item.workCenterNo" :label="item.workCenterNo"
:value="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"> <span style="float: right; color: #8492a6;white-space:nowrap;overflow:hidden;text-overflow:ellipsis; font-size: 11px;width: 100px">
{{ item.workCenterDesc }} {{ item.workCenterDesc }}
</span> </span>
@ -670,47 +797,47 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6" :offset="2"> <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 <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-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="6" > <el-col :span="6" >
<el-form-item label="效率" prop="routingEfficiency"> <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-form-item>
</el-col> </el-col>
<el-col :span="6" :offset="2"> <el-col :span="6" :offset="2">
<el-form-item label="操作工人数" prop="operatorsNumber"> <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-form-item>
</el-col> </el-col>
<el-col :span="6" :offset="2"> <el-col :span="6" :offset="2">
<el-form-item label="单位机械成本" prop="unitMachineryCost"> <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-form-item>
</el-col> </el-col>
<el-col :span="6" > <el-col :span="6" >
<el-form-item label="单位人工成本" prop="unitLaborCost"> <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-form-item>
</el-col> </el-col>
<el-col :span="6" :offset="2"> <el-col :span="6" :offset="2">
<el-form-item label="单位制造费用" prop="unitManufacturingCost"> <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-form-item>
</el-col> </el-col>
<el-col :span="6" :offset="2"> <el-col :span="6" :offset="2">
<el-form-item label="单位报价成本" prop="unitQuotedCost"> <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-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -728,27 +855,126 @@
<el-dialog <el-dialog
title="报价材料" title="报价材料"
:visible.sync="quotationPartDialogFlag" :visible.sync="quotationPartDialogFlag"
@close="closeQuotationPartDialog"
width="30%"> 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-row>
<el-col :span="10"> <el-col :span="10">
<el-form-item label="材料编号" prop="quotationPartNo"> <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-form-item>
</el-col> </el-col>
<el-col :span="10" :offset="2"> <el-col :span="10" :offset="2">
<el-form-item label="材料名称" prop="quotationPartDesc"> <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-form-item>
</el-col> </el-col>
</el-row> </el-row>
</el-form> </el-form>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="quotationPartDialogFlag = false"> </el-button> <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> </span>
</el-dialog> </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> </div>
</template> </template>
<script> <script>
@ -763,6 +989,7 @@ import {
insertQuotationRouting, insertQuotationRouting,
updateQuotationRouting, updateQuotationRouting,
deleteQuotationRouting, deleteQuotationRouting,
searchQuotationPart,
} from '@/api/quotation/quotationHeader.js'; } from '@/api/quotation/quotationHeader.js';
import { import {
searchUmInformationList, // searchUmInformationList, //
@ -773,6 +1000,9 @@ import {
import { import {
searchWorkCenter, // searchWorkCenter, //
} from '@/api/part/workCenter.js'; } from '@/api/part/workCenter.js';
import {
searchPartList, //
} from '@/api/part/partInformation.js';
export default { export default {
props: ['quotationHeader'], props: ['quotationHeader'],
name: "quotationDetail", name: "quotationDetail",
@ -786,11 +1016,19 @@ export default {
selectionQuotationToolList:[],// selectionQuotationToolList:[],//
toolHeaderList:[],// toolHeaderList:[],//
selectionToolHeaderList:[],// selectionToolHeaderList:[],//
quotationRoutingList: [],//
quotationRoutingFormTable:{
quotationRoutingList:[],//
},
selectionQuotationRoutingList:[],// selectionQuotationRoutingList:[],//
umInformationList:[],// umInformationList:[],//
outputUnitList:[{label:"单位/小时"},{label: "小时/单位"},{label: "小时"}],//
workCenterList:[],// workCenterList:[],//
quotationPartList: [],//
partList:[],//
quotationPartFormTable:{
quotationPartList: [],//
},
selectionQuotationPartList:[],//
selectionPartList:[],//
// ========================================================================================= // =========================================================================================
no: 1,// no: 1,//
size: 20,// size: 20,//
@ -802,12 +1040,14 @@ export default {
toolHeaderDialogFlag:false,// toolHeaderDialogFlag:false,//
quotationRoutingDialogFlag: false,// quotationRoutingDialogFlag: false,//
quotationPartDialogFlag:false,// quotationPartDialogFlag:false,//
partDialogFlag:false,//
// ======================================================================================= // =======================================================================================
// //
insertQuotationDetailData: { insertQuotationDetailData: {
flag: false, flag: false,
}, },
// ============================================= ================================================
partTableFlag:true,
// ============================================================================================== // ==============================================================================================
activeName: "index",// activeName: "index",//
// ========================================================================================= // =========================================================================================
@ -819,7 +1059,11 @@ export default {
site:this.$store.state.user.site,// site:this.$store.state.user.site,//
quotationPartNo:undefined,// quotationPartNo:undefined,//
quotationPartDesc:undefined,// quotationPartDesc:undefined,//
quotationPartQuantity:undefined,//
umId:undefined,//
unitDosage:undefined,//
attritionRate:undefined,//
transferAmount:undefined,//
unitCost:undefined,//
remark:undefined,// remark:undefined,//
}, },
// //
@ -882,7 +1126,7 @@ export default {
machiningCenterType:undefined,// machiningCenterType:undefined,//
machiningSetupTime:undefined,// machiningSetupTime:undefined,//
unitOutputQuantity:undefined,// unitOutputQuantity:undefined,//
umId:undefined,//
outputUnit:undefined,//
routingEfficiency:undefined,// routingEfficiency:undefined,//
operatorsNumber:undefined,// operatorsNumber:undefined,//
unitMachineryCost:undefined,// unitMachineryCost:undefined,//
@ -907,6 +1151,11 @@ export default {
toolNo:undefined,// toolNo:undefined,//
toolDescription:undefined,// toolDescription:undefined,//
}, },
//
partData:{
partNo:undefined,//
partDesc:undefined,
},
// ====================================================================================== // ======================================================================================
// //
quotationDetailRules: { 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: 'change'},
{required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'blur'}, {required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'blur'},
], ],
umId: [
outputUnit: [
{required: true, message: ' ', trigger: 'change'}, {required: true, message: ' ', trigger: 'change'},
{required: true, message: ' ', trigger: 'blur'},
], ],
routingEfficiency: [ routingEfficiency: [
{required: true, pattern: /^[0-9]+(.[0-9]{1,2})?$/, message: ' ', trigger: 'change'}, {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'}, {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: [ quotationDetailColumns: [
@ -1077,7 +1358,7 @@ export default {
{label: "machiningCenterType", value: "加工中心类别"}, {label: "machiningCenterType", value: "加工中心类别"},
{label: "machiningSetupTime", value: "调机时间"}, {label: "machiningSetupTime", value: "调机时间"},
{label: "unitOutputQuantity", value: "单位产出量"}, {label: "unitOutputQuantity", value: "单位产出量"},
{label: "umId", value: "单位编码"},
{label: "outputUnit", value: "产出单位"},
{label: "routingEfficiency", value: "效率"}, {label: "routingEfficiency", value: "效率"},
{label: "operatorsNumber", value: "操作工人数"}, {label: "operatorsNumber", value: "操作工人数"},
{label: "unitMachineryCost", value: "单位机械成本"}, {label: "unitMachineryCost", value: "单位机械成本"},
@ -1085,6 +1366,16 @@ export default {
{label: "unitManufacturingCost", value: "单位制造费用"}, {label: "unitManufacturingCost", value: "单位制造费用"},
{label: "unitQuotedCost", 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: { computed: {
@ -1110,7 +1401,30 @@ export default {
return tableData; return tableData;
} }
return this.toolHeaderList; 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: { watch: {
// //
@ -1184,6 +1498,7 @@ export default {
}, },
// //
deleteSelectionQuotationTool(){ deleteSelectionQuotationTool(){
console.log(this.selectionQuotationToolList.length)
this.selectionQuotationToolList.reverse().forEach(item => { this.selectionQuotationToolList.reverse().forEach(item => {
this.quotationToolFormTable.quotationToolList.splice(item.index,1); this.quotationToolFormTable.quotationToolList.splice(item.index,1);
}); });
@ -1192,20 +1507,33 @@ export default {
}, },
// //
deleteQuotationRoutingBtn(index){ deleteQuotationRoutingBtn(index){
this.quotationRoutingList.splice(index,1);
this.quotationRoutingFormTable.quotationRoutingList.splice(index,1);
// //
this.$message.success("删除成功!"); this.$message.success("删除成功!");
}, },
// //
deleteSelectionQuotationBtn(){
deleteSelectionQuotationRoutingBtn(){
this.selectionQuotationRoutingList.reverse().forEach(item => { this.selectionQuotationRoutingList.reverse().forEach(item => {
this.quotationRoutingList.splice(item.index,1);
this.quotationRoutingFormTable.quotationRoutingList.splice(item.index,1);
}); });
// //
this.$message.success("删除成功!"); 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() { saveQuotationDetail() {
@ -1218,6 +1546,20 @@ export default {
this.rulesValidateLabel(objects, this.quotationDetailColumns); 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) => { this.$refs.quotationToolTableForm.validate((validate, objects) => {
if (!validate) { if (!validate) {
@ -1244,8 +1586,8 @@ export default {
// //
let params = this.quotationDetailData; let params = this.quotationDetailData;
params.quotationToolList = this.quotationToolFormTable.quotationToolList; 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}) => { updateQuotationDetail(this.quotationDetailData).then(({data}) => {
if (data.code == 200) { if (data.code == 200) {
this.quotationDetailFlag = false; this.quotationDetailFlag = false;
@ -1277,19 +1619,54 @@ export default {
this.quotationTool.toolDescription = toolDescriptionStr.substring(0, toolDescriptionStr.length - 1); this.quotationTool.toolDescription = toolDescriptionStr.substring(0, toolDescriptionStr.length - 1);
this.toolHeaderDialogFlag = false; 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(){ saveQuotationRoutingBtn(){
this.$refs.quotationRoutingForm.validate((validate,objects)=>{ this.$refs.quotationRoutingForm.validate((validate,objects)=>{
if (!validate){ if (!validate){
this.rulesValidateLabel(objects,this.quotationRoutingColumns); this.rulesValidateLabel(objects,this.quotationRoutingColumns);
}else { }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; 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) { editQuotationDetail(row) {
@ -1360,8 +1737,8 @@ export default {
let total = 0; let total = 0;
searchQuotationRoutingByDetailId(params).then(({data})=>{ searchQuotationRoutingByDetailId(params).then(({data})=>{
if (data.code == 200) { 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; return total + currentValue.unitMachineryCost;
}, 0); }, 0);
this.quotationDetailData.computeMachineCost = unitMachineryCostTotal; this.quotationDetailData.computeMachineCost = unitMachineryCostTotal;
@ -1377,6 +1754,15 @@ export default {
}, },
// //
initQuotationPart() { 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; let total = 0;
this.quotationDetailData.computePartCost = total; this.quotationDetailData.computePartCost = total;
this.quotationDetailData.adjustPartCost = 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 // size
detailSizeChange(val) { detailSizeChange(val) {
@ -1460,12 +1857,22 @@ export default {
this.$refs.quotationToolForm.resetFields(); this.$refs.quotationToolForm.resetFields();
} }
}, },
//
openPartDialog(){
if (this.selectionPartList.length > 0) {
this.$refs.quotationPartForm.resetFields();
}
},
// =======================================================dialog============================================= // =======================================================dialog=============================================
// //
closeInsertDialog() { closeInsertDialog() {
this.activeName = "index"; this.activeName = "index";
// //
this.quotationToolFormTable.quotationToolList = []; this.quotationToolFormTable.quotationToolList = [];
//
this.quotationRoutingFormTable.quotationRoutingList = [];
//
this.quotationPartFormTable.quotationPartList = [];
this.quotationDetailData = {}; this.quotationDetailData = {};
this.quotationDetailData.computeToolCost = undefined; this.quotationDetailData.computeToolCost = undefined;
// //
@ -1497,6 +1904,10 @@ export default {
// //
closeToolHeaderDialog(){ closeToolHeaderDialog(){
},
//
closeQuotationPartDialog(){
this.$refs['quotationPartForm'].resetFields();
}, },
// =============================================================================================== // ===============================================================================================
// //
@ -1511,6 +1922,14 @@ export default {
handleSelectionChangeQuotationRoutingTable(selection){ handleSelectionChangeQuotationRoutingTable(selection){
this.selectionQuotationRoutingList = selection; this.selectionQuotationRoutingList = selection;
}, },
//
handleSelectionChangeQuotationPartTable(selection){
this.selectionQuotationPartList = selection;
},
//
handleSelectionChangePartTable(selection){
this.selectionPartList = selection;
},
// ==================================================================================================== // ====================================================================================================
// //
inputProfitRate() { inputProfitRate() {
@ -1580,7 +1999,7 @@ export default {
this.inputProfitRate(); this.inputProfitRate();
this.inputOuterCost(); this.inputOuterCost();
}, },
// ====================================================change=============================================
// ==================================================== =============================================
changeWorkCenterSelect(val,obj){ changeWorkCenterSelect(val,obj){
let value = this.workCenterList.find((item)=>{ let value = this.workCenterList.find((item)=>{
return item.workCenterNo == val; return item.workCenterNo == val;
@ -1588,6 +2007,12 @@ export default {
obj.machiningCenterDesc = value?value.workCenterDesc:""; obj.machiningCenterDesc = value?value.workCenterDesc:"";
obj.machiningCenterType = value?value.workCenterType:""; obj.machiningCenterType = value?value.workCenterType:"";
}, },
outputUnitSelect(e,row){
let value = e.target.value; //
if(value) { //
row.outputUnit = value
}
},
// ====================================================================================================== // ======================================================================================================
// //
rulesValidateLabel(objects, labels) { rulesValidateLabel(objects, labels) {
@ -1606,7 +2031,7 @@ export default {
for (let filed in objects) { for (let filed in objects) {
let tableName = filed.split(".")[0]; let tableName = filed.split(".")[0];
filed = filed.split(".")[2]; filed = filed.split(".")[2];
tableName = tableName == "quotationToolList" ? "工具" : "工艺";
tableName = tableName === "quotationToolList" ? "工具" : tableName === "quotationRoutingList" ? "工艺" : "材料";
for (let i = 0; i < labels.length; i++) { for (let i = 0; i < labels.length; i++) {
let quotationToolColumn = labels[i]; let quotationToolColumn = labels[i];
if (quotationToolColumn.label === filed) { if (quotationToolColumn.label === filed) {
@ -1617,9 +2042,11 @@ export default {
} }
}, },
// ==================================================================================================== // ====================================================================================================
//
//
enterKeyUpFun(refName){ enterKeyUpFun(refName){
this.$refs[refName].focus();
if (this.$refs[refName]){
this.$refs[refName].focus();
}
}, },
}, },
created() { created() {
@ -1630,6 +2057,8 @@ export default {
// //
this.initToolHeader(); this.initToolHeader();
this.initWorkCenterData(); this.initWorkCenterData();
this.initPartList();
}, },
} }
</script> </script>

544
src/views/modules/part/bomManagement.vue

@ -0,0 +1,544 @@
<template>
<div class="mod-config">
<!-- 查询条件 -->
<el-form :inline="true" label-position="top" :model="searchData" @keyup.enter.native="getDataList()">
<el-form-item :label="'物料编码'">
<el-input v-model="searchData.partNo" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="'物料名称'">
<el-input v-model="searchData.partDesc" clearable style="width: 120px"></el-input>
</el-form-item>
<el-form-item :label="' '">
<el-button @click="getDataList()">查询</el-button>
<el-button type="primary" @click="addModal()">新增</el-button>
<el-button type="primary" @click="delModal()">删除</el-button>
<download-excel
:fields="fields()"
:data="exportData"
type="xls"
:name="exportName"
:header="exportHeader"
:footer="exportFooter"
:fetch="createExportData"
:before-generate="startDownload"
:before-finish="finishDownload"
worksheet="导出信息"
class="el-button el-button--primary el-button--medium">
{{ "导出" }}
</download-excel>
</el-form-item>
</el-form>
<!-- 材料列表 -->
<el-table
:height="height"
:data="dataList"
border
@selection-change="selectionBom"
v-loading="dataListLoading"
style="width: 100%;">
<el-table-column
type="selection"
header-align="center"
align="center"
:selectable="selectFlag"
width="50">
</el-table-column>
<el-table-column
v-for="(item,index) in columnList" :key="index"
:sortable="item.columnSortable"
:prop="item.columnProp"
:header-align="item.headerAlign"
:show-overflow-tooltip="item.showOverflowTooltip"
:align="item.align"
:fixed="item.fixed === ''?false:item.fixed"
:min-width="item.columnWidth"
:label="item.columnLabel">
<template slot-scope="scope">
<span v-if="!item.columnHidden">{{ scope.row[item.columnProp] }}</span>
<span v-if="item.columnImage"><img :src="scope.row[item.columnProp]" style="width: 100px; height: 80px"/></span>
</template>
</el-table-column>
<el-table-column
fixed="right"
header-align="center"
align="center"
width="100"
label="操作">
<template slot-scope="scope">
<a type="text" size="small" @click="updateModal(scope.row)">编辑</a>
</template>
</el-table-column>
</el-table>
<!-- 复选统计 -->
<selectDiv ref="selectDiv"></selectDiv>
<!-- 分页插件 -->
<el-pagination style="margin-top: 0px"
@size-change="sizeChangeHandle"
@current-change="currentChangeHandle"
:current-page="pageIndex"
:page-sizes="[20, 50, 100, 200, 500]"
:page-size="pageSize"
:total="totalPage"
layout="total, sizes, prev, pager, next, jumper">
</el-pagination>
<!-- bom新增/编辑模态框 -->
<el-dialog :title="modalData.title" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="495px">
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-left: 7px;margin-top: -5px;">
<el-form-item prop="partNo" :rules="rules.partNo">
<span slot="label" @click="getBaseList(116)"><a herf="#">物料编码</a></span>
<el-input v-model="modalData.partNo" style="width: 221px"></el-input>
</el-form-item>
<el-form-item label="物料名称" prop="partDesc" :rules="rules.partDesc">
<el-input v-model="modalData.partDesc" disabled style="width: 221px"></el-input>
</el-form-item>
</el-form>
<el-footer style="height:30px;margin-top: 20px;text-align:center">
<el-button type="primary" @click="saveData()">保存</el-button>
<el-button type="primary" @click="modalFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
<!-- chooseList模态框 -->
<ChooseList ref="baseList" @getBaseData="getBaseData"></ChooseList>
</div>
</template>
<script>
import {
bomManagementSearch, // bom
bomManagementSave, // bom
bomManagementEdit, // bom
bomManagementDelete, // bom
} from '@/api/part/bomManagement.js'
import ChooseList from '@/views/modules/common/Chooselist'
export default {
//
components: {
ChooseList
},
//
watch: {
searchData: {
deep: true,
handler: function (newV, oldV) {
this.searchData.partNo = this.searchData.partNo.toUpperCase()
}
}
},
//
data () {
return {
//
exportData: [],
exportName: 'bom物料列表' + this.dayjs().format('YYYYMMDDHHmmss'),
exportHeader: ['bom物料列表'],
exportFooter: [],
resultList: [],
// ======== ========
height: 200,
// ======== ========
pageIndex: 1,
pageSize: 50,
totalPage: 0,
selectedDataNum: 0,
//
searchData: {
site: this.$store.state.user.site,
partNo: '',
partDesc: '',
page: 1,
limit: 10
},
//
dataListLoading: false,
// ======== ========
modalData: {
flag: '',
title: '',
site: this.$store.state.user.site,
partNo: '',
partDesc: '',
createDate: '',
createBy: '',
updateDate: '',
updateBy: ''
},
// ======== ========
dataList: [],
// ======== ========
columnList: [
{
userId: this.$store.state.user.name,
functionId: 104002,
serialNumber: '104002Table1PartNo',
tableId: '104002Table1',
tableName: 'BOM信息表',
columnProp: 'partNo',
headerAlign: 'center',
align: 'center',
columnLabel: '物料编码',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 104002,
serialNumber: '104002Table1PartDesc',
tableId: '104002Table1',
tableName: 'BOM信息表',
columnProp: 'partDesc',
headerAlign: 'center',
align: 'center',
columnLabel: '物料名称',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 120
},
{
userId: this.$store.state.user.name,
functionId: 104002,
serialNumber: '104002Table1CreateDate',
tableId: '104002Table1',
tableName: 'BOM信息表',
columnProp: 'createDate',
headerAlign: 'center',
align: 'center',
columnLabel: '创建时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 160
},
{
userId: this.$store.state.user.name,
functionId: 104002,
serialNumber: '104002Table1CreateBy',
tableId: '104002Table1',
tableName: 'BOM信息表',
columnProp: 'createBy',
headerAlign: 'center',
align: 'center',
columnLabel: '创建人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
},
{
userId: this.$store.state.user.name,
functionId: 104002,
serialNumber: '104002Table1UpdateDate',
tableId: '104002Table1',
tableName: 'BOM信息表',
columnProp: 'updateDate',
headerAlign: 'center',
align: 'center',
columnLabel: '更新时间',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 160
},
{
userId: this.$store.state.user.name,
functionId: 104002,
serialNumber: '104002Table1UpdateBy',
tableId: '104002Table1',
tableName: 'BOM信息表',
columnProp: 'updateBy',
headerAlign: 'center',
align: 'center',
columnLabel: '更新人',
columnHidden: false,
columnImage: false,
columnSortable: false,
sortLv: 0,
status: true,
fixed: '',
columnWidth: 80
}
],
// ======== ========
rules: {
partNo: [
{
required: true,
message: ' ',
trigger: 'change'
}
],
partDesc: [
{
required: true,
message: ' ',
trigger: 'change'
}
]
},
// ======== ========
bomSelections: [],
// ======== ========
modalFlag: false,
modalDisableFlag: false,
}
},
mounted () {
this.$nextTick(() => {
this.height = window.innerHeight - 180
})
},
created () {
this.getDataList()
},
// js
methods: {
// ======== ========
/**
* 每页数
* @param val
*/
sizeChangeHandle (val) {
this.pageSize = val
this.pageIndex = 1
this.getDataList()
},
/**
* 当前页
* @param val
*/
currentChangeHandle (val) {
this.pageIndex = val
this.getDataList()
},
// ======== ========
/**
* 未知
* @returns {boolean}
*/
selectFlag () {
return true
},
/**
* 获取数据列表
*/
getDataList () {
this.searchData.limit = this.pageSize
this.searchData.page = this.pageIndex
bomManagementSearch(this.searchData).then(({data}) => {
if (data.code === 0) {
this.dataList = data.page.list
this.pageIndex = data.page.currPage
this.pageSize = data.page.pageSize
this.totalPage = data.page.totalCount
this.$refs.selectDiv.setLengthAll( this.dataList.length)
}
this.dataListLoading = false
})
},
/**
* 复选列表信息
* @param val
*/
selectionBom (val) {
this.bomSelections = val
this.$refs.selectDiv.setLengthselected(this.bomSelections.length)
},
// ======== / ========
/**
* bom新增模态框
*/
addModal () {
this.modalData = {
flag: '1',
title: 'bom新增',
site: this.$store.state.user.site,
partNo: '',
partDesc: '',
createBy: this.$store.state.user.name
}
this.modalDisableFlag = false
this.modalFlag = true
},
// ======== // ========
/**
* bom新增/编辑
*/
saveData () {
if (this.modalData.partNo === '' || this.modalData.partNo == null) {
this.$message.warning('请选择物料编码!')
return
}
if (this.modalData.partDesc === '' || this.modalData.partDesc == null) {
this.$message.warning('请选择物料名称!')
return
}
if (this.modalData.flag === '1') {
bomManagementSave(this.modalData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.modalFlag = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
} else {
bomManagementEdit(this.modalData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.modalFlag = false
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}
},
/**
* bom删除
*/
delModal () {
if(this.bomSelections.length === 0){
this.$message.warning('请勾选要删除的BOM!')
return
}
this.$confirm(`是否删除这 `+ this.bomSelections.length +` 条BOM?`, '提示', {
confirmButtonText: '确定',
cancelButtonText: '取消',
type: 'warning'
}).then(() => {
let tempData = {
informationList: this.bomSelections
}
bomManagementDelete(tempData).then(({data}) => {
if (data && data.code === 0) {
this.getDataList()
this.bomSelections = []
this.$message({
message: '操作成功',
type: 'success',
duration: 1500,
onClose: () => {}
})
} else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
})
}
})
}).catch(() => {
})
},
// ======== chooseList ========
/**
* 获取基础数据列表S
* @param val
* @param type
*/
getBaseList (val, type) {
this.tagNo = val
this.$nextTick(() => {
let strVal = ''
if (val === 116) {
strVal = this.modalData.partNo
}
this.$refs.baseList.init(val, strVal)
})
},
/**
* 列表方法的回调
* @param val
*/
getBaseData (val) {
if (this.tagNo === 116) {
this.modalData.partNo = val.part_no
this.modalData.partDesc = val.part_desc
}
},
// ======== ========
/**
* 导出excel
*/
async createExportData () {
this.searchData.limit = -1
this.searchData.page = 1
await bomManagementSearch(this.searchData).then(({data}) => {
this.resultList = data.page.list
})
return this.resultList
},
startDownload () {
},
finishDownload () {
},
fields () {
let json = '{'
this.columnList.forEach((item, index) => {
if (index == this.columnList.length - 1) {
json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"'
} else {
json += '"' + item.columnLabel + '"' + ':' + '"' + item.columnProp + '"' + ','
}
})
json += '}'
let s = eval('(' + json + ')')
return s
}
}
}
</script>

822
src/views/modules/part/partInformation.vue
File diff suppressed because it is too large
View File

27
src/views/modules/part/part_upload_file.vue

@ -4,16 +4,8 @@
<el-form :inline="true" label-position="top" label-width="80px"> <el-form :inline="true" label-position="top" label-width="80px">
<el-row> <el-row>
<el-col :span="12"> <el-col :span="12">
<el-form-item class="customer-item" label="申请单号:" >
<el-input v-model="pageData.quotationNo" readonly style="width: 120px"></el-input>
<!-- <el-select v-model="pageData.quotationNo" placeholder="请选择" style="width: 120px;">-->
<!-- <el-option-->
<!-- v-for = "item in options"-->
<!-- :key = "item.key"-->
<!-- :label = "item.value"-->
<!-- :value = "item.value">-->
<!-- </el-option>-->
<!-- </el-select>-->
<el-form-item class="customer-item" label="材料编码:" >
<el-input v-model="pageData.partNo" readonly style="width: 120px"></el-input>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@ -54,19 +46,15 @@ import {
export default { export default {
data() { data() {
return { return {
folder: '',
visible: false, visible: false,
fileList: [], fileList: [],
pageData: { pageData: {
titleCon: '', titleCon: '',
site: this.$store.state.user.site, site: this.$store.state.user.site,
createBy: this.$store.state.user.name, createBy: this.$store.state.user.name,
quotationNo: '',
partNo: '',
fileRemark: '', fileRemark: '',
folder: '',
// options: []
}, },
// options: [],
dataListLoading: false, dataListLoading: false,
} }
}, },
@ -75,8 +63,6 @@ export default {
init(currentRow) { init(currentRow) {
// //
this.pageData = JSON.parse(JSON.stringify(currentRow)) this.pageData = JSON.parse(JSON.stringify(currentRow))
// this.options = this.pageData.options
this.folder = this.pageData.folder
// //
this.visible = true this.visible = true
}, },
@ -105,16 +91,11 @@ export default {
this.$message.error("请先上传文件!") this.$message.error("请先上传文件!")
return false return false
} }
// if(this.pageData.quotationNo === '' || this.pageData.quotationNo == null){
// this.$message.error("!")
// return false
// }
const formData = new FormData() const formData = new FormData()
// //
formData.append("file", this.fileList[0].raw) formData.append("file", this.fileList[0].raw)
formData.append("folder", this.folder)
formData.append("orderRef1", this.pageData.site) formData.append("orderRef1", this.pageData.site)
formData.append("orderRef2", this.pageData.quotationNo)
formData.append("orderRef2", this.pageData.partNo)
formData.append("fileRemark", remark) formData.append("fileRemark", remark)
uploadFile(formData).then(({data}) => { uploadFile(formData).then(({data}) => {
if (data.code === 0) { if (data.code === 0) {

Loading…
Cancel
Save