|
|
|
@ -29,7 +29,7 @@ |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
|
|
|
|
<!-- 材料列表 --> |
|
|
|
<!-- bom列表 --> |
|
|
|
<el-table |
|
|
|
:height="height" |
|
|
|
:data="dataList" |
|
|
|
@ -188,104 +188,47 @@ |
|
|
|
<el-tab-pane label="Components" name="bom_sub_detail"> |
|
|
|
<el-form label-position="top" style="margin-top: 5px"> |
|
|
|
<el-form-item> |
|
|
|
<el-button type="primary" @click="queryComponentPartList()" style="margin-left: 7px">新增</el-button> |
|
|
|
<el-button type="primary" @click="saveComponentModal()" style="margin-left: 7px">新增</el-button> |
|
|
|
<el-button type="primary" @click="deleteComponentPart()">删除</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<!-- <div class="rq">--> |
|
|
|
<el-table |
|
|
|
:data="subDetailList" |
|
|
|
height="256px" |
|
|
|
border |
|
|
|
ref="componentTable" |
|
|
|
v-loading="dataListLoading" |
|
|
|
@row-click="componentClickRow" |
|
|
|
:row-class-name="rowClassName" |
|
|
|
@selection-change="componentSelectionChange" |
|
|
|
style="width:100%"> |
|
|
|
<el-table-column type="selection" align="center" width="50"></el-table-column> |
|
|
|
<el-table-column |
|
|
|
v-for="(item,index) in columnSubDetailList" :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-column--> |
|
|
|
<!-- prop=""--> |
|
|
|
<!-- header-align="center"--> |
|
|
|
<!-- align="right"--> |
|
|
|
<!-- min-width="80"--> |
|
|
|
<!-- label="单位用量">--> |
|
|
|
<!-- <template slot-scope="scope">--> |
|
|
|
<!-- <el-input :ref="`qtyPerAssembly${scope.$index}`" v-model="scope.row.qtyPerAssembly" @keyup.enter.native="focusNextInput(scope.$index, 'qtyPerAssembly')" type="number"></el-input>--> |
|
|
|
<!-- </template>--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
<!-- <el-table-column--> |
|
|
|
<!-- prop=""--> |
|
|
|
<!-- header-align="center"--> |
|
|
|
<!-- align="right"--> |
|
|
|
<!-- min-width="80"--> |
|
|
|
<!-- label="调机量">--> |
|
|
|
<!-- <template slot-scope="scope">--> |
|
|
|
<!-- <el-input :ref="`componentScrap${scope.$index}`" v-model="scope.row.componentScrap" @keyup.enter.native="focusNextInput(scope.$index, 'componentScrap')" type="number"></el-input>--> |
|
|
|
<!-- </template>--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
<!-- <el-table-column--> |
|
|
|
<!-- prop=""--> |
|
|
|
<!-- header-align="center"--> |
|
|
|
<!-- align="right"--> |
|
|
|
<!-- min-width="80"--> |
|
|
|
<!-- label="损耗率">--> |
|
|
|
<!-- <template slot-scope="scope">--> |
|
|
|
<!-- <el-input :ref="`shrinkageFactor${scope.$index}`" v-model="scope.row.shrinkageFactor" @keyup.enter.native="focusNextInput(scope.$index, 'shrinkageFactor')" type="number"></el-input>--> |
|
|
|
<!-- </template>--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
<!-- <el-table-column--> |
|
|
|
<!-- prop="printUnitName"--> |
|
|
|
<!-- header-align="center"--> |
|
|
|
<!-- align="center"--> |
|
|
|
<!-- min-width="60"--> |
|
|
|
<!-- label="单位">--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
<!-- <el-table-column--> |
|
|
|
<!-- prop=""--> |
|
|
|
<!-- header-align="center"--> |
|
|
|
<!-- align="right"--> |
|
|
|
<!-- min-width="80"--> |
|
|
|
<!-- label="生产属性">--> |
|
|
|
<!-- <template slot-scope="scope">--> |
|
|
|
<!-- <el-select v-model="scope.row.issueType">--> |
|
|
|
<!-- <el-option label="领退料倒冲" value="A"></el-option>--> |
|
|
|
<!-- <el-option label="工单倒冲" value="B"></el-option>--> |
|
|
|
<!-- <el-option label="生产订单倒冲" value="C"></el-option>--> |
|
|
|
<!-- <el-option label="投料倒冲" value="D"></el-option>--> |
|
|
|
<!-- <el-option label="批次倒冲" value="E"></el-option>--> |
|
|
|
<!-- <el-option label="销售订单倒冲" value="F"></el-option>--> |
|
|
|
<!-- <el-option label="项目倒冲" value="G"></el-option>--> |
|
|
|
<!-- </el-select>--> |
|
|
|
<!-- </template>--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
</el-table> |
|
|
|
<!-- </div>--> |
|
|
|
<el-table |
|
|
|
:data="subDetailList" |
|
|
|
height="256px" |
|
|
|
border |
|
|
|
ref="componentTable" |
|
|
|
v-loading="dataListLoading" |
|
|
|
@row-click="componentClickRow" |
|
|
|
:row-class-name="rowClassName" |
|
|
|
@selection-change="componentSelectionChange" |
|
|
|
style="width:100%"> |
|
|
|
<el-table-column type="selection" align="center" width="50"></el-table-column> |
|
|
|
<el-table-column |
|
|
|
v-for="(item,index) in columnSubDetailList" :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="updateComponentModal(scope.row)">编辑</a> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-tab-pane> |
|
|
|
</el-tabs> |
|
|
|
<el-footer style="height:30px;margin-top:20px;text-align:center"> |
|
|
|
@ -294,6 +237,7 @@ |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 明细新增模态框 --> |
|
|
|
<el-dialog title="新增替代" :close-on-click-modal="false" v-drag :visible.sync="saveDetailModalFlag" width="650px"> |
|
|
|
<el-form :inline="true" label-position="top" :model="saveDetailData" :rules="detailRules" style="margin-left: 5px"> |
|
|
|
<el-form-item :label="'替代编码'" prop="alternativeNo" :rules="detailRules.alternativeNo"> |
|
|
|
@ -362,55 +306,99 @@ |
|
|
|
|
|
|
|
<!-- 子明细物料模态框 --> |
|
|
|
<el-dialog title="物料清单" :close-on-click-modal="false" v-drag :visible.sync="componentPartModelFlag" width="520px"> |
|
|
|
<div class="rq"> |
|
|
|
<el-form :inline="true" label-position="top" :model="componentPartData"> |
|
|
|
<el-form-item :label="'物料编码'"> |
|
|
|
<el-input v-model="componentPartData.partNo" clearable style="width: 120px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'物料名称'"> |
|
|
|
<el-input v-model="componentPartData.partDesc" clearable style="width: 120px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="' '"> |
|
|
|
<el-button type="primary" @click="queryComponentPartList()">查询</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-table |
|
|
|
:height="300" |
|
|
|
:data="componentPartList" |
|
|
|
ref="componentPartTable" |
|
|
|
@row-click="componentPartClickRow" |
|
|
|
@selection-change="selectionComponentPart" |
|
|
|
:row-key="getRowKeys" |
|
|
|
border |
|
|
|
v-loading="dataListLoading" |
|
|
|
style="width: 100%;"> |
|
|
|
<el-table-column |
|
|
|
type="selection" |
|
|
|
header-align="center" |
|
|
|
align="center" |
|
|
|
:reserve-selection="true" |
|
|
|
width="50"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
v-for="(item,index) in componentPartColumnList" :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> |
|
|
|
</div> |
|
|
|
<el-footer style="height:40px;margin-top: 20px;text-align:center"> |
|
|
|
<el-button type="primary" @click="confirmComponentPart()">确认</el-button> |
|
|
|
<el-button type="primary" @click="componentPartModelFlag=false">关闭</el-button> |
|
|
|
<el-form :inline="true" label-position="top" :model="componentPartData"> |
|
|
|
<el-form-item :label="'物料编码'"> |
|
|
|
<el-input v-model="componentPartData.partNo" clearable style="width: 120px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'物料名称'"> |
|
|
|
<el-input v-model="componentPartData.partDesc" clearable style="width: 120px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="' '"> |
|
|
|
<el-button type="primary" @click="queryComponentPartList()">查询</el-button> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-table |
|
|
|
:height="300" |
|
|
|
:data="componentPartList" |
|
|
|
@row-dblclick="getComponentRowData" |
|
|
|
border |
|
|
|
v-loading="dataListLoading" |
|
|
|
style="width: 100%;"> |
|
|
|
<el-table-column |
|
|
|
v-for="(item,index) in componentPartColumnList" :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> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- 子明细新增模态框 --> |
|
|
|
<el-dialog title="新增子物料" :close-on-click-modal="false" v-drag :visible.sync="componentSaveModal" width="500px"> |
|
|
|
<el-form :inline="true" label-position="top" :model="componentData" :rules="componentRules" style="margin-left: 5px"> |
|
|
|
<el-form-item prop="componentPart" :rules="componentRules.componentPart"> |
|
|
|
<span v-if="!componentDisableFlag" slot="label" @click="queryComponentPartList()"><a herf="#">子物料编码</a></span> |
|
|
|
<span v-if="componentDisableFlag" slot="label">子物料编码</span> |
|
|
|
<el-input v-model="componentData.componentPart" :disabled="componentDisableFlag" style="width: 221px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'子物料名称'" prop="componentPartDesc" :rules="componentRules.componentPartDesc"> |
|
|
|
<el-input v-model="componentData.componentPartDesc" disabled style="width: 221px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="componentData" :rules="componentRules" style="margin-left: 5px"> |
|
|
|
<el-form-item :label="'单位'"> |
|
|
|
<el-input v-model="componentData.printUnitName" disabled style="width: 221px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'生产属性'" prop="issueType" :rules="componentRules.issueType"> |
|
|
|
<el-select v-model="componentData.issueType" clearable style="width: 221px"> |
|
|
|
<el-option label="领退料倒冲" value="A"></el-option> |
|
|
|
<el-option label="工单倒冲" value="B"></el-option> |
|
|
|
<el-option label="生产订单倒冲" value="C"></el-option> |
|
|
|
<el-option label="投料倒冲" value="D"></el-option> |
|
|
|
<el-option label="批次倒冲" value="E"></el-option> |
|
|
|
<el-option label="销售订单倒冲" value="F"></el-option> |
|
|
|
<el-option label="项目倒冲" value="G"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="componentData" style="margin-left: 5px"> |
|
|
|
<el-form-item> |
|
|
|
<span slot="label" @click="getBaseList(103)"><a herf="#">工序</a></span> |
|
|
|
<el-input v-model="componentData.operationName" style="width: 221px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item> |
|
|
|
<span slot="label" @click="getBaseList(117)"><a herf="#">发料库位</a></span> |
|
|
|
<el-input v-model="componentData.issueToLocName" style="width: 221px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="componentData" :rules="componentRules" style="margin-left: 5px"> |
|
|
|
<el-form-item :label="'单位用量'" prop="qtyPerAssembly" :rules="componentRules.qtyPerAssembly"> |
|
|
|
<el-input v-model="componentData.qtyPerAssembly" type="number" style="width: 142px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'调机量'" prop="componentScrap" :rules="componentRules.componentScrap"> |
|
|
|
<el-input v-model="componentData.componentScrap" type="number" style="width: 142px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item :label="'损耗率'" prop="shrinkageFactor" :rules="componentRules.shrinkageFactor"> |
|
|
|
<el-input v-model="componentData.shrinkageFactor" type="number" style="width: 142px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="componentData" style="margin-left: 5px"> |
|
|
|
<el-form-item label="备注"> |
|
|
|
<el-input type="textarea" v-model="componentData.noteText" :rows="3" resize='none' maxlength="300" show-word-limit style="width: 455px;height: 20px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-footer style="height:35px;margin-top:65px;text-align:center"> |
|
|
|
<el-button type="primary" @click="componentDataSave()">保存</el-button> |
|
|
|
<el-button type="primary" @click="componentSaveModal = false">关闭</el-button> |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
@ -431,12 +419,14 @@ import { |
|
|
|
bomDetailSave, // bom明细新增 |
|
|
|
bomDetailDelete, // bom明细删除 |
|
|
|
queryPartList, // 查询物料清单 |
|
|
|
queryBomComponent, // 查bom子明细 |
|
|
|
queryBomComponent, // 查询bom子明细 |
|
|
|
saveBomComponent, // 新增bom子明细 |
|
|
|
updateBomComponent, // 修改bom子明细 |
|
|
|
deleteBomComponent, // 删除bom子明细 |
|
|
|
} from '@/api/part/bomManagement.js' |
|
|
|
import ChooseList from '@/views/modules/common/Chooselist' |
|
|
|
import dayjs from "dayjs"; |
|
|
|
import fa from "element-ui/src/locale/lang/fa"; |
|
|
|
|
|
|
|
export default { |
|
|
|
// 组件 |
|
|
|
@ -522,7 +512,8 @@ export default { |
|
|
|
updateDate: '', |
|
|
|
updateBy: '' |
|
|
|
}, |
|
|
|
subDetailData: { |
|
|
|
componentData: { |
|
|
|
flag: '', |
|
|
|
site: this.$store.state.user.site, |
|
|
|
partNo: '', |
|
|
|
engChgLevel: '', |
|
|
|
@ -531,13 +522,16 @@ export default { |
|
|
|
componentPart: '', |
|
|
|
componentPartDesc: '', |
|
|
|
printUnit: '', |
|
|
|
printUnitName: '', |
|
|
|
qtyPerAssembly: '', |
|
|
|
componentScrap: '', |
|
|
|
issueType: '', |
|
|
|
shrinkageFactor: '', |
|
|
|
lineItemNo: '', |
|
|
|
operationNo: '', |
|
|
|
operationName: '', |
|
|
|
issueToLoc: '', |
|
|
|
issueToLocName: '', |
|
|
|
noteText: '', |
|
|
|
createDate: '', |
|
|
|
createBy: '', |
|
|
|
@ -839,7 +833,7 @@ export default { |
|
|
|
tableName: 'BOM子物料表', |
|
|
|
columnProp: 'printUnitName', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'left', |
|
|
|
align: 'center', |
|
|
|
columnLabel: '单位', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
@ -855,9 +849,9 @@ export default { |
|
|
|
serialNumber: '104002Table2IssueType', |
|
|
|
tableId: '104002Table2', |
|
|
|
tableName: 'BOM子物料表', |
|
|
|
columnProp: 'issueType', |
|
|
|
columnProp: 'issueTypeName', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'left', |
|
|
|
align: 'center', |
|
|
|
columnLabel: '生产属性', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
@ -891,9 +885,9 @@ export default { |
|
|
|
serialNumber: '104002Table2IssueToLoc', |
|
|
|
tableId: '104002Table2', |
|
|
|
tableName: 'BOM子物料表', |
|
|
|
columnProp: 'issueToLoc', |
|
|
|
columnProp: 'issueToLocName', |
|
|
|
headerAlign: 'center', |
|
|
|
align: 'left', |
|
|
|
align: 'center', |
|
|
|
columnLabel: '发料库位', |
|
|
|
columnHidden: false, |
|
|
|
columnImage: false, |
|
|
|
@ -1004,6 +998,50 @@ export default { |
|
|
|
} |
|
|
|
], |
|
|
|
}, |
|
|
|
componentRules: { |
|
|
|
componentPart: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: 'change' |
|
|
|
} |
|
|
|
], |
|
|
|
componentPartDesc: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: 'change' |
|
|
|
} |
|
|
|
], |
|
|
|
qtyPerAssembly: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: 'change' |
|
|
|
} |
|
|
|
], |
|
|
|
componentScrap: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: 'change' |
|
|
|
} |
|
|
|
], |
|
|
|
shrinkageFactor: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: 'change' |
|
|
|
} |
|
|
|
], |
|
|
|
issueType: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: 'change' |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
// ======== 复选数据集 ======== |
|
|
|
bomSelections: [], |
|
|
|
// ======== 模态框开关控制 ======== |
|
|
|
@ -1011,7 +1049,9 @@ export default { |
|
|
|
modalDisableFlag: false, |
|
|
|
partModelFlag: false, |
|
|
|
componentPartModelFlag: false, |
|
|
|
saveDetailModalFlag :false |
|
|
|
saveDetailModalFlag :false, |
|
|
|
componentSaveModal: false, |
|
|
|
componentDisableFlag: false |
|
|
|
} |
|
|
|
}, |
|
|
|
mounted () { |
|
|
|
@ -1187,6 +1227,71 @@ export default { |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 新增子明细 |
|
|
|
*/ |
|
|
|
saveComponentModal () { |
|
|
|
if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) { |
|
|
|
this.$message.warning('请先选择替代!') |
|
|
|
return |
|
|
|
} |
|
|
|
this.componentData = { |
|
|
|
flag: '1', |
|
|
|
site: this.$store.state.user.site, |
|
|
|
partNo: this.modalData.partNo, |
|
|
|
engChgLevel: this.modalData.engChgLevel, |
|
|
|
bomType: this.modalData.bomType, |
|
|
|
alternativeNo: this.detailData.alternativeNo, |
|
|
|
componentPart: '', |
|
|
|
componentPartDesc: '', |
|
|
|
printUnit: '', |
|
|
|
printUnitName: '', |
|
|
|
qtyPerAssembly: '', |
|
|
|
componentScrap: '', |
|
|
|
issueType: '', |
|
|
|
shrinkageFactor: '', |
|
|
|
lineItemNo: '', |
|
|
|
operationNo: '', |
|
|
|
operationName: '', |
|
|
|
issueToLoc: '', |
|
|
|
issueToLocName: '', |
|
|
|
noteText: '', |
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
} |
|
|
|
this.componentDisableFlag = false |
|
|
|
this.componentSaveModal = true |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 编辑模态框 |
|
|
|
*/ |
|
|
|
updateComponentModal (row) { |
|
|
|
this.componentData = { |
|
|
|
flag: '2', |
|
|
|
site: row.site, |
|
|
|
partNo: row.partNo, |
|
|
|
engChgLevel: row.engChgLevel, |
|
|
|
bomType: row.bomType, |
|
|
|
alternativeNo: row.alternativeNo, |
|
|
|
componentPart: row.componentPart, |
|
|
|
componentPartDesc: row.componentPartDesc, |
|
|
|
printUnit: row.printUnit, |
|
|
|
printUnitName: row.printUnitName, |
|
|
|
qtyPerAssembly: row.qtyPerAssembly, |
|
|
|
componentScrap: row.componentScrap, |
|
|
|
issueType: row.issueType, |
|
|
|
shrinkageFactor: row.shrinkageFactor, |
|
|
|
lineItemNo: row.lineItemNo, |
|
|
|
operationNo: row.operationNo, |
|
|
|
operationName: row.operationName, |
|
|
|
issueToLoc: row.issueToLoc, |
|
|
|
issueToLocName: row.issueToLocName, |
|
|
|
noteText: row.noteText, |
|
|
|
updateBy: this.$store.state.user.name, |
|
|
|
} |
|
|
|
this.componentDisableFlag = true |
|
|
|
this.componentSaveModal = true |
|
|
|
}, |
|
|
|
|
|
|
|
|
|
|
|
// ======== 新增/编辑/删除方法 ======== |
|
|
|
/** |
|
|
|
@ -1351,7 +1456,7 @@ export default { |
|
|
|
}) |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 查询未建 bom 的物料 |
|
|
|
* 查询物料 |
|
|
|
*/ |
|
|
|
queryPartList () { |
|
|
|
queryPartList(this.partData).then(({data}) => { |
|
|
|
@ -1374,14 +1479,15 @@ export default { |
|
|
|
this.modalData.partDesc = row.partDesc |
|
|
|
this.partModelFlag = false |
|
|
|
}, |
|
|
|
getComponentRowData (row) { |
|
|
|
this.componentData.componentPart = row.partNo |
|
|
|
this.componentData.componentPartDesc = row.partDesc |
|
|
|
this.componentPartModelFlag = false |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 新增子明细 |
|
|
|
* 物料列表 |
|
|
|
*/ |
|
|
|
queryComponentPartList () { |
|
|
|
if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) { |
|
|
|
this.$message.warning('请先选择替代!') |
|
|
|
return |
|
|
|
} |
|
|
|
// 查询所有物料 |
|
|
|
queryPartList(this.componentPartData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
@ -1421,23 +1527,6 @@ export default { |
|
|
|
confirmButtonText: "确定", |
|
|
|
cancelButtonText: "取消", |
|
|
|
type: "warning" |
|
|
|
// callback: (action) => { |
|
|
|
// if (action === "confirm") { |
|
|
|
// let val = this.checkedDetail |
|
|
|
// val.forEach((val, index) => { |
|
|
|
// this.subDetailList.forEach((v, i) => { |
|
|
|
// if (val.xh === v.xh) { |
|
|
|
// this.subDetailList.splice(i, 1) |
|
|
|
// } |
|
|
|
// }) |
|
|
|
// }) |
|
|
|
// this.$message({message: "删除成功!", type: "success",}) |
|
|
|
// return |
|
|
|
// } else { |
|
|
|
// this.$message({message: "已取消删除操作", type: "warning",}) |
|
|
|
// return |
|
|
|
// } |
|
|
|
// }, |
|
|
|
}).then(() => { |
|
|
|
let tempData = { |
|
|
|
informationList: this.checkedDetail |
|
|
|
@ -1465,60 +1554,98 @@ export default { |
|
|
|
* 子物料 |
|
|
|
* @param row |
|
|
|
*/ |
|
|
|
componentPartClickRow (row) { |
|
|
|
this.$refs.componentPartTable.toggleRowSelection(row) |
|
|
|
}, |
|
|
|
// componentPartClickRow (row) { |
|
|
|
// this.$refs.componentPartTable.toggleRowSelection(row) |
|
|
|
// }, |
|
|
|
componentClickRow (row) { |
|
|
|
this.$refs.componentTable.toggleRowSelection(row) |
|
|
|
}, |
|
|
|
// /** |
|
|
|
// * 多选子物料 |
|
|
|
// * @param val |
|
|
|
// */ |
|
|
|
// selectionComponentPart (val) { |
|
|
|
// this.componentPartSelections = val |
|
|
|
// }, |
|
|
|
// getRowKeys(row) { |
|
|
|
// // 唯一值,一般都为id |
|
|
|
// return row.partNo |
|
|
|
// }, |
|
|
|
/** |
|
|
|
* 多选子物料 |
|
|
|
* @param val |
|
|
|
*/ |
|
|
|
selectionComponentPart (val) { |
|
|
|
this.componentPartSelections = val |
|
|
|
}, |
|
|
|
getRowKeys(row) { |
|
|
|
// 唯一值,一般都为id |
|
|
|
return row.partNo |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 提交选中的子物料 |
|
|
|
* 新增子明细方法 |
|
|
|
*/ |
|
|
|
confirmComponentPart () { |
|
|
|
// for (let i = 0; i < this.componentPartSelections.length; i++) { |
|
|
|
// let obj = {} |
|
|
|
// obj.site = this.$store.state.user.site |
|
|
|
// obj.partNo = this.modalData.partNo |
|
|
|
// obj.engChgLevel = this.modalData.engChgLevel |
|
|
|
// obj.bomType = this.modalData.bomType |
|
|
|
// obj.alternativeNo = this.detailData.alternativeNo |
|
|
|
// obj.componentPart = this.componentPartSelections[i].partNo |
|
|
|
// obj.componentPartDesc = this.componentPartSelections[i].partDesc |
|
|
|
// obj.qtyPerAssembly = '' |
|
|
|
// obj.printUnit = this.componentPartSelections[i].umId |
|
|
|
// obj.printUnitName = this.componentPartSelections[i].umName |
|
|
|
// this.subDetailList.push(obj) |
|
|
|
// } |
|
|
|
let tempData = { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
partNo: this.modalData.partNo, |
|
|
|
engChgLevel: this.modalData.engChgLevel, |
|
|
|
bomType: this.modalData.bomType, |
|
|
|
alternativeNo: this.detailData.alternativeNo, |
|
|
|
createBy: this.$store.state.user.name, |
|
|
|
informationList: this.componentPartSelections |
|
|
|
componentDataSave () { |
|
|
|
if (this.componentData.partNo === '' || this.componentData.partNo == null) { |
|
|
|
this.$message.warning('请选择主记录物料编码!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.componentData.bomType === '' || this.componentData.bomType == null) { |
|
|
|
this.$message.warning('请选择主记录制造类型!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.componentData.engChgLevel === '' || this.componentData.engChgLevel == null) { |
|
|
|
this.$message.warning('请填写主记录BOM版本号!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.componentData.componentPart === '' || this.componentData.componentPart == null) { |
|
|
|
this.$message.warning('请选择子物料编码!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.componentData.componentPartDesc === '' || this.componentData.componentPartDesc == null) { |
|
|
|
this.$message.warning('请选择子物料名称!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.componentData.qtyPerAssembly === '' || this.componentData.qtyPerAssembly == null) { |
|
|
|
this.$message.warning('请填写单位用量!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.componentData.componentScrap === '' || this.componentData.componentScrap == null) { |
|
|
|
this.$message.warning('请填写调机量!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.componentData.shrinkageFactor === '' || this.componentData.shrinkageFactor == null) { |
|
|
|
this.$message.warning('请填写损耗率!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.componentData.issueType === '' || this.componentData.issueType == null) { |
|
|
|
this.$message.warning('请选择生产属性!') |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.componentData.flag === '1') { |
|
|
|
saveBomComponent(this.componentData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.subDetailList = data.rows |
|
|
|
this.componentSaveModal = false |
|
|
|
this.$message({ |
|
|
|
message: '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 1500, |
|
|
|
onClose: () => {} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} else if (this.componentData.flag === '2') { |
|
|
|
updateBomComponent(this.componentData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.subDetailList = data.rows |
|
|
|
this.componentSaveModal = false |
|
|
|
this.$message({ |
|
|
|
message: '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 1500, |
|
|
|
onClose: () => {} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
} |
|
|
|
saveBomComponent(tempData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.subDetailList = data.rows |
|
|
|
this.componentPartModelFlag = false |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
/** |
|
|
|
* 回车事件 |
|
|
|
@ -1743,8 +1870,8 @@ export default { |
|
|
|
this.tagNo = val |
|
|
|
this.$nextTick(() => { |
|
|
|
let strVal = '' |
|
|
|
if (val === 116) { |
|
|
|
strVal = this.modalData.partNo |
|
|
|
if (val === 117) { |
|
|
|
strVal = this.componentData.issueToLoc |
|
|
|
} |
|
|
|
this.$refs.baseList.init(val, strVal) |
|
|
|
}) |
|
|
|
@ -1754,9 +1881,9 @@ export default { |
|
|
|
* @param val |
|
|
|
*/ |
|
|
|
getBaseData (val) { |
|
|
|
if (this.tagNo === 116) { |
|
|
|
this.modalData.partNo = val.part_no |
|
|
|
this.modalData.partDesc = val.part_desc |
|
|
|
if (this.tagNo === 117) { |
|
|
|
this.componentData.issueToLoc = val.location_id |
|
|
|
this.componentData.issueToLocName = val.location_name |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
|