From 83fbd90cae5ed5e3cc8eeb8e50a07947363ce06f Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Fri, 7 Feb 2025 14:45:44 +0800 Subject: [PATCH] 2025-02-07 --- src/views/modules/part/bomSearch3.vue | 18 +- src/views/modules/part/partInformation.vue | 193 ++++++++++++++------- src/views/modules/part/part_create.vue | 64 +++++-- 3 files changed, 184 insertions(+), 91 deletions(-) diff --git a/src/views/modules/part/bomSearch3.vue b/src/views/modules/part/bomSearch3.vue index 884ea51..1f96cf7 100644 --- a/src/views/modules/part/bomSearch3.vue +++ b/src/views/modules/part/bomSearch3.vue @@ -93,11 +93,13 @@ + ref="tree"> @@ -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) } }) }, diff --git a/src/views/modules/part/partInformation.vue b/src/views/modules/part/partInformation.vue index 7324b66..71b504a 100644 --- a/src/views/modules/part/partInformation.vue +++ b/src/views/modules/part/partInformation.vue @@ -177,21 +177,34 @@ - + + 物料分类 + + + + 物料分类 - - - + 商品组1 - + + 商品组1 + + + + + 商品组2 + + + + 商品组2 @@ -203,7 +216,7 @@ - + 属性模板 @@ -904,47 +917,71 @@ - -
+ +
Part No To Copy - + - - + + + + + + + + + + - - + + + + + + +
-
+
Select Part Information to Copy - + + + 主信息 + + + + + 物料属性 + + + - General + 代理商 + + + + + 供应商 + + + + + 默认库位 - - - - - - - - - - - - - - - - -
- 保存 + 保存 关闭 @@ -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 }) }, diff --git a/src/views/modules/part/part_create.vue b/src/views/modules/part/part_create.vue index f1a7ebb..857a076 100644 --- a/src/views/modules/part/part_create.vue +++ b/src/views/modules/part/part_create.vue @@ -54,21 +54,34 @@ - + + 物料分类 + + + + 物料分类 - - - + 商品组1 - + + 商品组1 + + + + + 商品组2 + + + + 商品组2 @@ -80,9 +93,9 @@ - + 属性模板 - 属性模板 + 属性模板 @@ -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 }