Browse Source

2025-02-07

java8
fengyuan_yang 11 months ago
parent
commit
83fbd90cae
  1. 18
      src/views/modules/part/bomSearch3.vue
  2. 193
      src/views/modules/part/partInformation.vue
  3. 64
      src/views/modules/part/part_create.vue

18
src/views/modules/part/bomSearch3.vue

@ -93,11 +93,13 @@
<el-col :style="{width: leftWidth + 'px',height: secondHeight + 'px'}" class="down-tree">
<el-tree
:data="treeData"
node-key="id"
:props="defaultProps"
:default-expand-all="true"
:expand-on-click-node="false"
node-key="id"
highlight-current
@node-click="handleNodeClick"
:props="defaultProps">
ref="tree">
</el-tree>
</el-col>
<el-col :style="{width: rightWidth + 'px',height: secondHeight + 'px'}" style="margin-left: 10px">
@ -207,7 +209,7 @@ export default {
// ======== ========
headerCurrentRow: {},
defaultProps: {
children: "informationList",
children: "list",
label: "id",
},
// ======== ========
@ -756,7 +758,7 @@ export default {
* @param e
* @param node
*/
handleNodeClick (e, node) {
handleNodeClick (e) {
//
getComponentPartList(e).then(({data}) => {
if (data && data.code === 0) {
@ -809,8 +811,14 @@ export default {
getAlternativeTree(this.headerCurrentRow).then(({data}) => {
if (data && data.code === 0) {
this.treeData = data.rows
if (this.treeData.length > 0) {
this.$nextTick(() => {
this.$refs.tree.setCurrentKey(this.treeData[0].id);
this.handleNodeClick(this.treeData[0])
})
}
} else {
this.treeData = []
this.$message.warning(data.msg)
}
})
},

193
src/views/modules/part/partInformation.vue

@ -177,21 +177,34 @@
<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-form-item>
<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-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-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;">
</el-form>
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;">
<el-form-item>
<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-form-item>
<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-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-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>
@ -203,7 +216,7 @@
<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-form-item>
<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="modalData.codeNo" @blur="modelBlur(219)" style="width: 128px"></el-input>
<el-input v-model="modalData.codeDesc" disabled style="width: 330px"></el-input>
@ -904,47 +917,71 @@
</el-dialog>
<!-- copyPart -->
<el-dialog title="Copy Part" :close-on-click-modal="false" v-drag :visible.sync="copyPartModelFlag" width="500px">
<fieldset style="width: 474px">
<el-dialog title="Copy Part" :close-on-click-modal="false" v-drag :visible.sync="copyPartModelFlag" width="510px">
<fieldset style="width: 486px">
<legend>Part No To Copy</legend>
<el-form :inline="true" style="margin-left: 7px">
<el-form :inline="true" label-position="top" style="margin-left: 7px">
<el-form-item label="From Part">
<el-input v-model="modalData.partNo" readonly style="width: 140px"></el-input>
<el-input v-model="modalData.partDesc" readonly style="width: 287px"></el-input>
<el-input v-model="modalData.partNo" disabled style="width: 120px"></el-input>
<el-input v-model="modalData.partDesc" disabled style="width: 205px"></el-input>
</el-form-item>
<el-form-item label="From Site And BU">
<el-select v-model="modalData.bu" disabled style="width: 100px">
<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>
<el-form :inline="true" label-position="top" style="margin-left: 7px">
<el-form-item label="To Part">
<el-input v-model="copyPartData.partNo" style="width: 140px"></el-input>
<el-input v-model="copyPartData.partDesc" style="width: 287px"></el-input>
<el-input v-model="copyPartData.partDesc" style="width: 330px"></el-input>
</el-form-item>
<el-form-item label="To Site And BU">
<el-select v-model="copyPartData.bu" placeholder="请选择" style="width: 100px">
<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>
</fieldset>
<fieldset style="width: 474px">
<fieldset style="width: 486px">
<legend>Select Part Information to Copy</legend>
<el-form :inline="true" style="margin-left: 7px">
<el-form :inline="true">
<el-form-item label=" ">
<el-checkbox v-model="copyPartData.copyGeneral" true-label="Y">General</el-checkbox>
<el-checkbox v-model="copyPartData.copyGeneral" true-label="Y">主信息</el-checkbox>
</el-form-item>
</el-form>
<el-form :inline="true">
<el-form-item label=" ">
<el-checkbox v-model="copyPartData.copyCharacteristic" true-label="Y">物料属性</el-checkbox>
</el-form-item>
</el-form>
<el-form :inline="true">
<el-form-item label=" ">
<el-checkbox v-model="copyPartData.copyAgent" true-label="Y">代理商</el-checkbox>
</el-form-item>
</el-form>
<el-form :inline="true">
<el-form-item label=" ">
<el-checkbox v-model="copyPartData.copyManufacturing" true-label="Y">供应商</el-checkbox>
</el-form-item>
</el-form>
<el-form :inline="true">
<el-form-item label=" ">
<el-checkbox v-model="copyPartData.copyDefaultLocation" true-label="Y">默认库位</el-checkbox>
</el-form-item>
<!-- <el-form-item label=" ">-->
<!-- <el-checkbox v-model="copyPartData.copyCosts" true-label="Y">Costs</el-checkbox>-->
<!-- </el-form-item>-->
<!-- <el-form-item label=" ">-->
<!-- <el-checkbox v-model="copyPartData.copyPlanningData" true-label="Y">Planning Data</el-checkbox>-->
<!-- </el-form-item>-->
</el-form>
<!-- <el-form :inline="true" style="margin-left: 7px">-->
<!-- <el-form-item label=" ">-->
<!-- <el-checkbox v-model="copyPartData.copyManufacturing" true-label="Y">Manufacturing</el-checkbox>-->
<!-- </el-form-item>-->
<!-- <el-form-item label=" ">-->
<!-- <el-checkbox v-model="copyPartData.copyDefaultLocation" true-label="Y">Default Location</el-checkbox>-->
<!-- </el-form-item>-->
<!-- <el-form-item label=" ">-->
<!-- <el-checkbox v-model="copyPartData.copyRevision" true-label="Y">Revision</el-checkbox>-->
<!-- </el-form-item>-->
<!-- </el-form>-->
</fieldset>
<el-footer style="height:40px;margin-top: 10px;text-align:center">
<el-button type="primary" @click="copyPart">保存</el-button>
<el-button type="primary" :loading="copyLoading" @click="copyPart">保存</el-button>
<el-button type="primary" @click="copyPartModelFlag = false">关闭</el-button>
</el-footer>
</el-dialog>
@ -1080,6 +1117,7 @@
},
//
loading: false,
copyLoading: false,
//
activeTable: 'part_item',
inventoryPartTable: 'General',
@ -1142,14 +1180,16 @@
},
copyPartData: {
site: '',
buNo: '',
partNo: '',
partDesc: '',
partType2: '',
active: '',
copyGeneral: 'Y',
copyCosts: '',
copyPlanningData: '',
copyAgent: '',
copyCharacteristic: '',
copyManufacturing: '',
copyDefaultLocation: '',
copyRevision: '',
previousVersion: {},
createBy: ''
},
@ -2131,13 +2171,6 @@
trigger: ['blur','change']
}
],
partNo: [
{
required: true,
message: ' ',
trigger: ['blur','change']
}
],
partDesc: [
{
required: true,
@ -2159,13 +2192,6 @@
trigger: ['blur','change']
}
],
manufacturerName: [
{
required: true,
message: ' ',
trigger: ['blur','change']
}
],
active: [
{
required: true,
@ -2173,28 +2199,28 @@
trigger: ['blur','change']
}
],
agentName: [
partType2: [
{
required: true,
message: ' ',
trigger: ['blur','change']
}
],
partType2: [
familyID: [
{
required: true,
message: ' ',
trigger: ['blur','change']
}
],
productGroupId4: [
productGroupId1: [
{
required: true,
message: ' ',
trigger: ['blur','change']
}
],
lotTrackingCode: [
productGroupId2: [
{
required: true,
message: ' ',
@ -3168,11 +3194,31 @@
this.$message.warning('请选择BU!')
return
}
if (this.modalData.active === '' || this.modalData.active == null) {
this.$message.warning('请选择是否在用!')
return
}
if (this.modalData.partType2 === '' || this.modalData.partType2 == null) {
this.$message.warning('请选择零件类型!')
return
}
if (this.modalData.umId2 === '' || this.modalData.umId2 == null) {
this.$message.warning('请选择计量单位!')
return
}
if (this.modalData.tblBaseFlag === 'Y' && this.modalData.codeNo === '') {
if (this.modalData.partType2 === 'Purchased (raw)' && (this.modalData.familyID === '' || this.modalData.familyID == null)) {
this.$message.warning('请选择物料分类!')
return
}
if (this.modalData.partType2 !== 'Purchased (raw)' && (this.modalData.productGroupId1 === '' || this.modalData.productGroupId1 == null)) {
this.$message.warning('请选择商品组1!')
return
}
if (this.modalData.partType2 !== 'Purchased (raw)' && (this.modalData.productGroupId2 === '' || this.modalData.productGroupId2 == null)) {
this.$message.warning('请选择商品组2!')
return
}
if (this.modalData.codeNo === '' || this.modalData.codeNo == null) {
this.$message.warning('请选择属性模板!')
return
}
@ -3252,16 +3298,17 @@
//
toCopyPartModal () {
this.copyPartData = {
site: this.modalData.site,
buNo: this.modalData.buNo,
partNo: this.modalData.partNo,
bu: this.modalData.site + '_' + this.modalData.buNo,
site: '',
buNo: '',
partNo: '',
partDesc: this.modalData.partDesc,
active: 'Y',
copyGeneral: 'Y',
copyCosts: '',
copyPlanningData: '',
copyAgent: '',
copyManufacturing: '',
copyDefaultLocation: '',
copyRevision: '',
copyCharacteristic: '',
previousVersion: this.modalData,
createBy: this.$store.state.user.name
}
@ -3270,22 +3317,31 @@
//
copyPart () {
if (this.copyPartData.partNo === '' || this.copyPartData.partNo == null) {
this.$message.warning('请输入物料编码!')
return
}
if (this.copyPartData.partDesc === '' || this.copyPartData.partDesc == null) {
this.$message.warning('请输入物料名称!')
return
}
if (this.copyPartData.copyGeneral === '' || this.copyPartData.copyGeneral == null) {
this.$message.warning('General信息必选!')
this.$message.warning('信息必选!')
return
}
this.copyLoading = true
copyPart(this.copyPartData).then(({data}) => {
if (data && data.code === 0) {
this.searchData = {
site: '',
userName: this.$store.state.user.name,
buNo: '',
partNo: data.partNo,
startDate: '',
endDate: '',
partDesc: '',
page: 1,
limit: 10
}
this.getDataList()
this.copyPartModelFlag = false
this.modalFlag = false
this.$message({
message: '操作成功',
type: 'success',
@ -3297,6 +3353,9 @@
confirmButtonText: '确定'
})
}
this.copyLoading = false
}).catch(()=>{
this.copyLoading = false
})
},

64
src/views/modules/part/part_create.vue

@ -54,21 +54,34 @@
<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-form-item>
<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-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-form-item>
</el-form>
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;">
</el-form>
<el-form :inline="true" label-position="top" :model="modalData" :rules="rules" style="margin-top: -5px;">
<el-form-item>
<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-form-item>
<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-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-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>
@ -80,9 +93,9 @@
<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-form-item>
<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="modalDisableFlag" slot="label">属性模板</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>
@ -1865,13 +1878,6 @@ export default {
trigger: ['blur','change']
}
],
manufacturerName: [
{
required: true,
message: ' ',
trigger: ['blur','change']
}
],
active: [
{
required: true,
@ -1879,28 +1885,28 @@ export default {
trigger: ['blur','change']
}
],
agentName: [
partType2: [
{
required: true,
message: ' ',
trigger: ['blur','change']
}
],
partType2: [
familyID: [
{
required: true,
message: ' ',
trigger: ['blur','change']
}
],
productGroupId4: [
productGroupId1: [
{
required: true,
message: ' ',
trigger: ['blur','change']
}
],
lotTrackingCode: [
productGroupId2: [
{
required: true,
message: ' ',
@ -2026,11 +2032,31 @@ export default {
this.$message.warning('请选择BU!')
return
}
if (this.modalData.active === '' || this.modalData.active == null) {
this.$message.warning('请选择是否在用!')
return
}
if (this.modalData.partType2 === '' || this.modalData.partType2 == null) {
this.$message.warning('请选择零件类型!')
return
}
if (this.modalData.umId2 === '' || this.modalData.umId2 == null) {
this.$message.warning('请选择计量单位!')
return
}
if (this.modalData.tblBaseFlag === 'Y' && this.modalData.codeNo === '') {
if (this.modalData.partType2 === 'Purchased (raw)' && (this.modalData.familyID === '' || this.modalData.familyID == null)) {
this.$message.warning('请选择物料分类!')
return
}
if (this.modalData.partType2 !== 'Purchased (raw)' && (this.modalData.productGroupId1 === '' || this.modalData.productGroupId1 == null)) {
this.$message.warning('请选择商品组1!')
return
}
if (this.modalData.partType2 !== 'Purchased (raw)' && (this.modalData.productGroupId2 === '' || this.modalData.productGroupId2 == null)) {
this.$message.warning('请选择商品组2!')
return
}
if (this.modalData.codeNo === '' || this.modalData.codeNo == null) {
this.$message.warning('请选择属性模板!')
return
}

Loading…
Cancel
Save