|
|
|
@ -1,22 +1,22 @@ |
|
|
|
<template> |
|
|
|
<div> |
|
|
|
<!-- 物料新增/编辑模态框 --> |
|
|
|
<el-dialog :title="modalData.title" top="18vh" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="1000px"> |
|
|
|
<el-dialog :title="modalData.title" top="18vh" :close-on-click-modal="false" v-drag :visible.sync="modalFlag" width="1100px"> |
|
|
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;"> |
|
|
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules"> |
|
|
|
<el-form-item label="物料编码" prop="partNo"> |
|
|
|
<el-input v-model="modalData.partNo" disabled style="width: 128px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="物料描述" prop="partDesc" style="margin-left: -10px"> |
|
|
|
<el-input v-model="modalData.partDesc" clearable style="width: 346px"></el-input> |
|
|
|
<el-input v-model="modalData.partDesc" clearable style="width: 396px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="物料描述(英文)"> |
|
|
|
<el-input v-model="modalData.partDesceEn" style="width: 477px"></el-input> |
|
|
|
<el-input v-model="modalData.partDesceEn" style="width: 527px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;"> |
|
|
|
<el-form-item prop="spec" label="规格"> |
|
|
|
<el-input v-model="modalData.spec" style="width: 477px"></el-input> |
|
|
|
<el-input v-model="modalData.spec" style="width: 527px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="BU" prop="bu"> |
|
|
|
<el-select v-model="modalData.bu" placeholder="请选择" @change="getPreviousPartNo" :disabled="modalDisableFlag" style="width: 90px"> |
|
|
|
@ -41,6 +41,17 @@ |
|
|
|
<el-option label="原材料" value="Purchased (raw)"></el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="模板(新增)"> |
|
|
|
<span style="cursor: pointer" slot="label" @click="handleTemplateAdd"><a herf="#">模板(新增)</a></span> |
|
|
|
<el-select v-model="modalData.tempNo" @change="chooseTemplate" style="width: 105px"> |
|
|
|
<el-option |
|
|
|
v-for="option in templateList" |
|
|
|
:key="option.templateNo" |
|
|
|
:label="option.templateName" |
|
|
|
:value="option.templateNo"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-if="modalData.flag === '1'" style="margin-top: 23px"> |
|
|
|
<el-checkbox v-model="modalData.tblBaseFlag" true-label="Y">复制属性({{previousPartNo}})</el-checkbox> |
|
|
|
</el-form-item> |
|
|
|
@ -52,64 +63,75 @@ |
|
|
|
<el-form-item prop="umId2"> |
|
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(510)"><a herf="#">计量单位</a></span> |
|
|
|
<el-input v-model="modalData.umId2" @blur="umIdBlur(510)" style="width: 128px"></el-input> |
|
|
|
<el-input v-model="modalData.umName" disabled style="width: 330px"></el-input> |
|
|
|
<el-input v-model="modalData.umName" disabled style="width: 380px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-if="modalData.partType2 === 'Purchased (raw)'" prop="familyID"> |
|
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(214)"><a herf="#">物料分类</a></span> |
|
|
|
<el-input v-model="modalData.familyID" @blur="partFamilyBlur(214)" style="width: 128px"></el-input> |
|
|
|
<el-input v-model="modalData.familyName" disabled style="width: 330px"></el-input> |
|
|
|
<el-input v-model="modalData.familyName" disabled style="width: 380px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-else> |
|
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(214)"><a herf="#">物料分类</a></span> |
|
|
|
<el-input v-model="modalData.familyID" @blur="partFamilyBlur(214)" style="width: 128px"></el-input> |
|
|
|
<el-input v-model="modalData.familyName" disabled style="width: 330px"></el-input> |
|
|
|
<el-input v-model="modalData.familyName" disabled style="width: 380px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;"> |
|
|
|
<el-form-item v-if="modalData.partType2 === 'Purchased (raw)'"> |
|
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(211)"><a herf="#">商品组1</a></span> |
|
|
|
<el-input v-model="modalData.productGroupId1" @blur="productGroupId1Blur(211)" style="width: 128px"></el-input> |
|
|
|
<el-input v-model="modalData.productGroupName1" disabled style="width: 330px"></el-input> |
|
|
|
<el-input v-model="modalData.productGroupName1" disabled style="width: 380px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-else prop="productGroupId1"> |
|
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(211)"><a herf="#">商品组1</a></span> |
|
|
|
<el-input v-model="modalData.productGroupId1" @blur="productGroupId1Blur(211)" style="width: 128px"></el-input> |
|
|
|
<el-input v-model="modalData.productGroupName1" disabled style="width: 330px"></el-input> |
|
|
|
<el-input v-model="modalData.productGroupName1" disabled style="width: 380px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-if="modalData.partType2 === 'Purchased (raw)'"> |
|
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(212)"><a herf="#">商品组2</a></span> |
|
|
|
<el-input v-model="modalData.productGroupId2" @blur="productGroupId2Blur(212)" style="width: 128px"></el-input> |
|
|
|
<el-input v-model="modalData.productGroupName2" disabled style="width: 330px"></el-input> |
|
|
|
<el-input v-model="modalData.productGroupName2" disabled style="width: 380px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item v-else prop="productGroupId2"> |
|
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(212)"><a herf="#">商品组2</a></span> |
|
|
|
<el-input v-model="modalData.productGroupId2" @blur="productGroupId2Blur(212)" style="width: 128px"></el-input> |
|
|
|
<el-input v-model="modalData.productGroupName2" disabled style="width: 330px"></el-input> |
|
|
|
<el-input v-model="modalData.productGroupName2" disabled style="width: 380px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;"> |
|
|
|
<el-form-item> |
|
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(213)"><a herf="#">商品组3</a></span> |
|
|
|
<el-input v-model="modalData.productGroupId3" @blur="productGroupId3Blur(213)" style="width: 128px"></el-input> |
|
|
|
<el-input v-model="modalData.productGroupName3" disabled style="width: 330px"></el-input> |
|
|
|
<el-input v-model="modalData.productGroupName3" disabled style="width: 380px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="codeNo"> |
|
|
|
<span style="cursor: pointer" v-if="!modalDisableFlag" slot="label" @click="getBaseList(219)"><a herf="#">属性模板</a></span> |
|
|
|
<span v-else slot="label">属性模板</span> |
|
|
|
<el-input v-model="modalData.codeNo" :disabled="modalDisableFlag" @blur="modelBlur(219)" style="width: 128px"></el-input> |
|
|
|
<el-input v-model="modalData.codeDesc" disabled style="width: 330px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;"> |
|
|
|
<el-form-item> |
|
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(518)"><a herf="#">BOM模板</a></span> |
|
|
|
<el-input v-model="modalData.templateNo" @blur="bomTemplateBlur(518)" style="width: 128px"></el-input> |
|
|
|
<el-input v-model="modalData.templateName" disabled style="width: 330px"></el-input> |
|
|
|
<el-input v-model="modalData.codeDesc" disabled style="width: 380px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<div v-show="modalData.partType2==='Manufactured'" > |
|
|
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;"> |
|
|
|
<el-form-item prop="templateNo"> |
|
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(518)"><a herf="#">BOM模板</a></span> |
|
|
|
<el-input v-model="modalData.templateNo" @blur="bomTemplateBlur(518)" style="width: 128px"></el-input> |
|
|
|
<el-input v-model="modalData.templateName" disabled style="width: 380px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
<div v-show="modalData.partType2!=='Manufactured'"> |
|
|
|
<el-form :inline="true" label-position="top" :model="modalData" style="margin-top: -5px;"> |
|
|
|
<el-form-item> |
|
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(518)"><a herf="#">BOM模板</a></span> |
|
|
|
<el-input v-model="modalData.templateNo" @blur="bomTemplateBlur(518)" style="width: 128px"></el-input> |
|
|
|
<el-input v-model="modalData.templateName" disabled style="width: 380px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</div> |
|
|
|
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;"> |
|
|
|
<el-form-item label="备注" style="height: 135px"> |
|
|
|
<el-input type="textarea" v-model="modalData.remark" :rows="5" resize='none' show-word-limit style="width: 939px"></el-input> |
|
|
|
<el-input type="textarea" v-model="modalData.remark" :rows="5" resize='none' show-word-limit style="width: 1039px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
</el-tab-pane> |
|
|
|
@ -744,6 +766,67 @@ |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<el-dialog :title="'模板新增'" top="18vh" :close-on-click-modal="false" v-drag :visible.sync="templateAddFlag" width="850px"> |
|
|
|
<el-form :inline="true" :rules="tempRules" label-position="top" :model="tempData" style="margin-top: -5px;"> |
|
|
|
<el-form-item label="BU" prop="bu"> |
|
|
|
<el-select v-model="tempData.bu" placeholder="请选择" @change="getPreviousPartNo" style="width: 127px"> |
|
|
|
<el-option |
|
|
|
v-for = "i in userBuList" |
|
|
|
:key = "i.buNo" |
|
|
|
:label = "i.buDesc" |
|
|
|
:value = "i.buNo"> |
|
|
|
</el-option> |
|
|
|
</el-select> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="模板编码" prop="templateNo"> |
|
|
|
<el-input v-model="tempData.templateNo" clearable style="width: 240px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item label="模板名称" prop="templateName"> |
|
|
|
<el-input v-model="tempData.templateName" clearable style="width: 380px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" :rules="tempRules" label-position="top" :model="tempData" style="margin-top: -5px;"> |
|
|
|
<el-form-item prop="umId"> |
|
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(510)"><a herf="#">计量单位</a></span> |
|
|
|
<el-input v-model="tempData.umName" disabled style="width: 380px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="familyId"> |
|
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(214)"><a herf="#">物料分类</a></span> |
|
|
|
<el-input v-model="tempData.familyName" disabled style="width: 380px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" :rules="tempRules" label-position="top" :model="tempData" style="margin-top: -5px;"> |
|
|
|
<el-form-item prop="productGroupId1"> |
|
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(211)"><a herf="#">商品组1</a></span> |
|
|
|
<el-input v-model="tempData.productGroupName1" disabled style="width: 380px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="productGroupId2"> |
|
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(212)"><a herf="#">商品组2</a></span> |
|
|
|
<el-input v-model="tempData.productGroupName2" disabled style="width: 380px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" :rules="tempRules" label-position="top" :model="tempData" style="margin-top: -5px;"> |
|
|
|
<el-form-item prop="productGroupId3"> |
|
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(213)"><a herf="#">商品组3</a></span> |
|
|
|
<el-input v-model="tempData.productGroupName3" disabled style="width: 380px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
<el-form-item prop="codeNo"> |
|
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(219)"><a herf="#">属性模板</a></span> |
|
|
|
<el-input v-model="tempData.codeDesc" disabled style="width: 380px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-form :inline="true" :rules="tempRules" label-position="top" :model="tempData" style="margin-top: -5px;"> |
|
|
|
<el-form-item prop="bomTemplateNo"> |
|
|
|
<span style="cursor: pointer" slot="label" @click="getBaseList(518)"><a herf="#">BOM模板</a></span> |
|
|
|
<el-input v-model="tempData.bomTemplateName" disabled style="width: 380px"></el-input> |
|
|
|
</el-form-item> |
|
|
|
</el-form> |
|
|
|
<el-footer style="height:40px;margin-top: 20px;text-align:center"> |
|
|
|
<el-button type="primary" @click="templateAdd">保存</el-button> |
|
|
|
<el-button type="primary" @click="templateAddFlag = false">关闭</el-button> |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
|
|
|
|
<!-- chooseList模态框 --> |
|
|
|
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|
|
|
|
|
|
|
@ -799,6 +882,8 @@ import Chooselist from '@/views/modules/common/Chooselist_eam' |
|
|
|
import partUploadFile from "./part_upload_file" |
|
|
|
import {updateInquiryDetailStatusAndPart} from "../../../api/inquiry/inquiryDetail"; |
|
|
|
import {EventBus} from "../../../main"; |
|
|
|
import {getChooselist1} from "../../../api/chooselist/chooselist"; |
|
|
|
import {chooseTemplate, getTemplateList, templateAdd} from "../../../api/part/quicklyCreateBom"; |
|
|
|
export default { |
|
|
|
name: 'partCreate', |
|
|
|
components: { |
|
|
|
@ -812,6 +897,45 @@ export default { |
|
|
|
this.modalData.partNo = this.modalData.partNo.toUpperCase() |
|
|
|
} |
|
|
|
}, |
|
|
|
'modalData.bu': { |
|
|
|
deep: true, |
|
|
|
handler: function (newV, oldV) { |
|
|
|
this.getTemplateList() |
|
|
|
} |
|
|
|
}, |
|
|
|
templateAddFlag: { |
|
|
|
deep: true, |
|
|
|
handler: function (newV, oldV) { |
|
|
|
if (newV===false) { |
|
|
|
this.tempData = { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
bu: '', |
|
|
|
templateNo: '', |
|
|
|
templateName: '', |
|
|
|
umId: '', |
|
|
|
umName: '', |
|
|
|
familyId: '', |
|
|
|
familyName: '', |
|
|
|
productGroupId1: '', |
|
|
|
productGroupName1: '', |
|
|
|
productGroupId2: '', |
|
|
|
productGroupName2: '', |
|
|
|
productGroupId3: '', |
|
|
|
productGroupName3: '', |
|
|
|
codeNo: '', |
|
|
|
codeDesc: '', |
|
|
|
bomTemplateNo: '', |
|
|
|
bomTemplateName: '', |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
'tempData.bu': { |
|
|
|
deep: true, |
|
|
|
handler: function (newV, oldV) { |
|
|
|
this.tempData.buNo = newV.split('_')[1] |
|
|
|
} |
|
|
|
} |
|
|
|
}, |
|
|
|
props: { |
|
|
|
initData:{ |
|
|
|
@ -850,10 +974,11 @@ export default { |
|
|
|
flag: '', |
|
|
|
title: '', |
|
|
|
site: '', |
|
|
|
buNo: '', |
|
|
|
buNo: this.initData.buNo, |
|
|
|
bu: '', |
|
|
|
partNo: '', |
|
|
|
partDesc: '', |
|
|
|
tempNo: '', |
|
|
|
umId2: '', |
|
|
|
umName: '', |
|
|
|
spec: '', |
|
|
|
@ -881,6 +1006,28 @@ export default { |
|
|
|
partBomStatus: '', |
|
|
|
updateBy: '' |
|
|
|
}, |
|
|
|
// 定义tempData |
|
|
|
tempData: { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
bu: '', |
|
|
|
buNo: '', |
|
|
|
templateNo: '', |
|
|
|
templateName: '', |
|
|
|
umId: '', |
|
|
|
umName: '', |
|
|
|
familyId: '', |
|
|
|
familyName: '', |
|
|
|
productGroupId1: '', |
|
|
|
productGroupName1: '', |
|
|
|
productGroupId2: '', |
|
|
|
productGroupName2: '', |
|
|
|
productGroupId3: '', |
|
|
|
productGroupName3: '', |
|
|
|
codeNo: '', |
|
|
|
codeDesc: '', |
|
|
|
bomTemplateNo: '', |
|
|
|
bomTemplateName: '', |
|
|
|
}, |
|
|
|
itemData: { |
|
|
|
site: this.$store.state.user.site, |
|
|
|
partNo: '', |
|
|
|
@ -958,6 +1105,7 @@ export default { |
|
|
|
routingAlternativeList: [], |
|
|
|
copyAttributeList: [], |
|
|
|
fileList: [], |
|
|
|
templateList: [], |
|
|
|
// ======== 列表表头 ======== |
|
|
|
columnList: [ |
|
|
|
{ |
|
|
|
@ -1947,6 +2095,85 @@ export default { |
|
|
|
trigger: ['blur','change'] |
|
|
|
} |
|
|
|
], |
|
|
|
templateNo: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: ['blur','change'] |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
tempRules: { |
|
|
|
bu: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: ['blur','change'] |
|
|
|
} |
|
|
|
], |
|
|
|
templateNo: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: ['blur','change'] |
|
|
|
} |
|
|
|
], |
|
|
|
templateName: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: ['blur','change'] |
|
|
|
} |
|
|
|
], |
|
|
|
umId: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: ['blur','change'] |
|
|
|
} |
|
|
|
], |
|
|
|
familyId: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: ['blur','change'] |
|
|
|
} |
|
|
|
], |
|
|
|
productGroupId1: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: ['blur','change'] |
|
|
|
} |
|
|
|
], |
|
|
|
productGroupId2: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: ['blur','change'] |
|
|
|
} |
|
|
|
], |
|
|
|
productGroupId3: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: ['blur','change'] |
|
|
|
} |
|
|
|
], |
|
|
|
codeNo: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: ['blur','change'] |
|
|
|
} |
|
|
|
], |
|
|
|
bomTemplateNo: [ |
|
|
|
{ |
|
|
|
required: true, |
|
|
|
message: ' ', |
|
|
|
trigger: ['blur','change'] |
|
|
|
} |
|
|
|
] |
|
|
|
}, |
|
|
|
// ======== 复选数据集 ======== |
|
|
|
partSelections: [], |
|
|
|
@ -1976,7 +2203,8 @@ export default { |
|
|
|
uploadDialog: false, |
|
|
|
menuId: this.$route.meta.menuId, |
|
|
|
previousPartNo: '', |
|
|
|
saveLoading: false |
|
|
|
saveLoading: false, |
|
|
|
templateAddFlag: false, |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
@ -2359,6 +2587,7 @@ export default { |
|
|
|
commitItemValue(tempData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.getPartItem() |
|
|
|
this.$emit('update-part-item') |
|
|
|
this.attributeDialog = true |
|
|
|
this.$message({ |
|
|
|
message: '操作成功', |
|
|
|
@ -3160,72 +3389,207 @@ export default { |
|
|
|
this.$nextTick(() => { |
|
|
|
let strVal = '' |
|
|
|
let conSql = '' |
|
|
|
if (this.modalData.bu === null || this.modalData.bu === '') { |
|
|
|
this.$message.warning("请选择BU!") |
|
|
|
return |
|
|
|
if (!this.templateAddFlag){ |
|
|
|
if (this.modalData.bu === null || this.modalData.bu === '') { |
|
|
|
this.$message.warning("请选择BU!") |
|
|
|
return |
|
|
|
} else { |
|
|
|
conSql = " and site = '" + this.modalData.bu.split('_')[0] + "'" + " and bu_no = '" + this.modalData.bu.split('_')[1] + "'" |
|
|
|
} |
|
|
|
if (val === 510) { |
|
|
|
strVal = this.modalData.umId2 |
|
|
|
conSql = " and site = '" + this.modalData.bu.split('_')[0] + "'" |
|
|
|
} else if (val === 211) { |
|
|
|
strVal = this.modalData.productGroupId1 |
|
|
|
} else if (val === 212) { |
|
|
|
strVal = this.modalData.productGroupId2 |
|
|
|
} else if (val === 213) { |
|
|
|
strVal = this.modalData.productGroupId3 |
|
|
|
} else if (val === 214) { |
|
|
|
strVal = this.modalData.familyID |
|
|
|
} else if (val === 219) { |
|
|
|
strVal = this.modalData.codeNo |
|
|
|
} else if (val === 518) { |
|
|
|
strVal = this.modalData.templateNo |
|
|
|
conSql = " and site = '" + this.modalData.bu.split('_')[0] + "'" |
|
|
|
} |
|
|
|
} else { |
|
|
|
conSql = " and site = '" + this.modalData.bu.split('_')[0] + "'" + " and bu_no = '" + this.modalData.bu.split('_')[1] + "'" |
|
|
|
} |
|
|
|
if (val === 510) { |
|
|
|
strVal = this.modalData.umId2 |
|
|
|
conSql = " and site = '" + this.modalData.bu.split('_')[0] + "'" |
|
|
|
} else if (val === 211) { |
|
|
|
strVal = this.modalData.productGroupId1 |
|
|
|
} else if (val === 212) { |
|
|
|
strVal = this.modalData.productGroupId2 |
|
|
|
} else if (val === 213) { |
|
|
|
strVal = this.modalData.productGroupId3 |
|
|
|
} else if (val === 214) { |
|
|
|
strVal = this.modalData.familyID |
|
|
|
} else if (val === 219) { |
|
|
|
strVal = this.modalData.codeNo |
|
|
|
} else if (val === 518) { |
|
|
|
strVal = this.modalData.templateNo |
|
|
|
conSql = " and site = '" + this.modalData.bu.split('_')[0] + "'" |
|
|
|
if (this.tempData.bu === null || this.tempData.bu === '') { |
|
|
|
this.$message.warning("请选择BU!") |
|
|
|
return |
|
|
|
} else { |
|
|
|
conSql = " and site = '" + this.tempData.bu.split('_')[0] + "'" + " and bu_no = '" + this.tempData.bu.split('_')[1] + "'" |
|
|
|
} |
|
|
|
if (val === 510) { |
|
|
|
strVal = this.tempData.umId |
|
|
|
conSql = " and site = '" + this.tempData.bu.split('_')[0] + "'" |
|
|
|
} else if (val === 211) { |
|
|
|
strVal = this.tempData.productGroupId1 |
|
|
|
} else if (val === 212) { |
|
|
|
strVal = this.tempData.productGroupId2 |
|
|
|
} else if (val === 213) { |
|
|
|
strVal = this.tempData.productGroupId3 |
|
|
|
} else if (val === 214) { |
|
|
|
strVal = this.tempData.familyID |
|
|
|
} else if (val === 219) { |
|
|
|
strVal = this.tempData.codeNo |
|
|
|
} else if (val === 518) { |
|
|
|
strVal = this.tempData.bomTemplateNo |
|
|
|
conSql = " and site = '" + this.tempData.bu.split('_')[0] + "'" |
|
|
|
} |
|
|
|
} |
|
|
|
this.$refs.baseList.init(val, strVal, conSql) |
|
|
|
}) |
|
|
|
}, |
|
|
|
// 列表方法的回调 |
|
|
|
getBaseData (val) { |
|
|
|
if (this.tagNo === 510) { |
|
|
|
this.modalData.umId2 = val.UMID |
|
|
|
this.modalData.umName = val.UMName |
|
|
|
} else if (this.tagNo === 211) { |
|
|
|
this.modalData.productGroupId1 = val.product_group_id |
|
|
|
this.modalData.productGroupName1 = val.product_group_name |
|
|
|
} else if (this.tagNo === 212) { |
|
|
|
this.modalData.productGroupId2 = val.product_group_id |
|
|
|
this.modalData.productGroupName2 = val.product_group_name |
|
|
|
} else if (this.tagNo === 213) { |
|
|
|
this.modalData.productGroupId3 = val.product_group_id |
|
|
|
this.modalData.productGroupName3 = val.product_group_name |
|
|
|
} else if (this.tagNo === 214) { |
|
|
|
this.modalData.familyID = val.family_id |
|
|
|
this.modalData.familyName = val.family_name |
|
|
|
} else if (this.tagNo === 219) { |
|
|
|
if (this.modalData.flag === '2') { |
|
|
|
if (val.code_no != this.tempCodeNo) { |
|
|
|
this.$confirm(`更换属性模板将替换下方物料属性数据,请确认?`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
this.modalData.codeNo = val.code_no |
|
|
|
this.$set(this.modalData, 'codeDesc', val.code_desc) |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
if(!this.templateAddFlag){ |
|
|
|
if (this.tagNo === 510) { |
|
|
|
this.modalData.umId2 = val.UMID |
|
|
|
this.modalData.umName = val.UMName |
|
|
|
} else if (this.tagNo === 211) { |
|
|
|
this.modalData.productGroupId1 = val.product_group_id |
|
|
|
this.modalData.productGroupName1 = val.product_group_name |
|
|
|
} else if (this.tagNo === 212) { |
|
|
|
this.modalData.productGroupId2 = val.product_group_id |
|
|
|
this.modalData.productGroupName2 = val.product_group_name |
|
|
|
} else if (this.tagNo === 213) { |
|
|
|
this.modalData.productGroupId3 = val.product_group_id |
|
|
|
this.modalData.productGroupName3 = val.product_group_name |
|
|
|
} else if (this.tagNo === 214) { |
|
|
|
this.modalData.familyID = val.family_id |
|
|
|
this.modalData.familyName = val.family_name |
|
|
|
} else if (this.tagNo === 219) { |
|
|
|
if (this.modalData.flag === '2') { |
|
|
|
if (val.code_no != this.tempCodeNo) { |
|
|
|
this.$confirm(`更换属性模板将替换下方物料属性数据,请确认?`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() => { |
|
|
|
this.modalData.codeNo = val.code_no |
|
|
|
this.$set(this.modalData, 'codeDesc', val.code_desc) |
|
|
|
}).catch(() => { |
|
|
|
}) |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.modalData.codeNo = val.code_no |
|
|
|
this.$set(this.modalData, 'codeDesc', val.code_desc) |
|
|
|
} |
|
|
|
} else { |
|
|
|
this.modalData.codeNo = val.code_no |
|
|
|
this.$set(this.modalData, 'codeDesc', val.code_desc) |
|
|
|
} else if (this.tagNo === 518) { |
|
|
|
this.modalData.templateNo = val.template_no |
|
|
|
this.modalData.templateName = val.template_name |
|
|
|
} |
|
|
|
} else { |
|
|
|
if (this.tagNo === 510) { |
|
|
|
this.tempData.umId = val.UMID |
|
|
|
this.tempData.umName = val.UMName |
|
|
|
} else if (this.tagNo === 211) { |
|
|
|
this.tempData.productGroupId1 = val.product_group_id |
|
|
|
this.tempData.productGroupName1 = val.product_group_name |
|
|
|
} else if (this.tagNo === 212) { |
|
|
|
this.tempData.productGroupId2 = val.product_group_id |
|
|
|
this.tempData.productGroupName2 = val.product_group_name |
|
|
|
} else if (this.tagNo === 213) { |
|
|
|
this.tempData.productGroupId3 = val.product_group_id |
|
|
|
this.tempData.productGroupName3 = val.product_group_name |
|
|
|
} else if (this.tagNo === 214) { |
|
|
|
this.tempData.familyId = val.family_id |
|
|
|
this.tempData.familyName = val.family_name |
|
|
|
} else if (this.tagNo === 219) { |
|
|
|
this.tempData.codeNo = val.code_no |
|
|
|
this.$set(this.tempData, 'codeDesc', val.code_desc) |
|
|
|
} else if (this.tagNo === 518) { |
|
|
|
this.tempData.bomTemplateNo = val.template_no |
|
|
|
this.$set(this.tempData, 'bomTemplateName', val.template_name) |
|
|
|
} |
|
|
|
} else if (this.tagNo === 518) { |
|
|
|
this.modalData.templateNo = val.template_no |
|
|
|
this.modalData.templateName = val.template_name |
|
|
|
} |
|
|
|
}, |
|
|
|
|
|
|
|
templateAdd() { |
|
|
|
if (this.tempData.bu === null || this.tempData.bu === ''){ |
|
|
|
this.$message.warning("请选择BU!") |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.tempData.templateNo === null || this.tempData.templateNo === ''){ |
|
|
|
this.$message.warning("请填写模板编码!") |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.tempData.templateName === null || this.tempData.templateName === ''){ |
|
|
|
this.$message.warning("请填写模板名称!") |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.tempData.umId === null || this.tempData.umId === ''){ |
|
|
|
this.$message.warning("请选择计量单位!") |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.tempData.familyId === null || this.tempData.familyId === ''){ |
|
|
|
this.$message.warning("请选择物料分类!") |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.tempData.productGroupId1 === null || this.tempData.productGroupId1 === ''){ |
|
|
|
this.$message.warning("请选择商品组1!") |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.tempData.productGroupId2 === null || this.tempData.productGroupId2 === ''){ |
|
|
|
this.$message.warning("请选择商品组2!") |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.tempData.productGroupId3 === null || this.tempData.productGroupId3 === ''){ |
|
|
|
this.$message.warning("请选择商品组3!") |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.tempData.codeNo === null || this.tempData.codeNo === ''){ |
|
|
|
this.$message.warning("请选择属性模板!") |
|
|
|
return |
|
|
|
} |
|
|
|
if (this.tempData.bomTemplateNo === null || this.tempData.bomTemplateNo === ''){ |
|
|
|
this.$message.warning("请选择BOM模板!") |
|
|
|
return |
|
|
|
} |
|
|
|
templateAdd(this.tempData).then(({data}) => { |
|
|
|
if (data&&data.code===0){ |
|
|
|
this.getTemplateList() |
|
|
|
this.templateAddFlag = false |
|
|
|
this.$message({ |
|
|
|
message: '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 1500, |
|
|
|
onClose: () => {} |
|
|
|
}) |
|
|
|
} else { |
|
|
|
this.$alert(data.msg, '错误', { |
|
|
|
confirmButtonText: '确定' |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
getTemplateList() { |
|
|
|
this.modalData.buNo = this.modalData.bu.split('_')[1] |
|
|
|
getTemplateList(this.modalData).then(({data}) => { |
|
|
|
if (data && data.code === 0) { |
|
|
|
this.templateList = data.rows |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
chooseTemplate(){ |
|
|
|
chooseTemplate(this.modalData).then(({data}) => { |
|
|
|
if (data&&data.code===0) { |
|
|
|
Object.keys(data.data).forEach(key => { |
|
|
|
if (key !== 'tempNo') { |
|
|
|
this.modalData[key] = data.data[key]; |
|
|
|
} |
|
|
|
}); |
|
|
|
this.modalData.umId2 = data.data.umId |
|
|
|
this.modalData.familyID = data.data.familyId |
|
|
|
this.modalData.templateNo = data.data.bomTemplateNo |
|
|
|
this.modalData.templateName = data.data.bomTemplateName |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
saveQuicklyCreate(){ |
|
|
|
let inData = { |
|
|
|
id: this.initData.id, |
|
|
|
@ -3244,6 +3608,10 @@ export default { |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
}, |
|
|
|
|
|
|
|
handleTemplateAdd() { |
|
|
|
this.templateAddFlag = true |
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
|