From 86632cc9fb021b6d65b2ae70561bb7acb5160617 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Wed, 4 Sep 2024 17:56:55 +0800 Subject: [PATCH] =?UTF-8?q?2024-09-04=20RFQ=E5=8A=9F=E8=83=BD=E4=BF=AE?= =?UTF-8?q?=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/modules/part/bomManagement.vue | 140 +++++-- src/views/modules/part/routingManagement.vue | 394 +++++++++++++++++-- 2 files changed, 472 insertions(+), 62 deletions(-) diff --git a/src/views/modules/part/bomManagement.vue b/src/views/modules/part/bomManagement.vue index cef3b3a..cf44a42 100644 --- a/src/views/modules/part/bomManagement.vue +++ b/src/views/modules/part/bomManagement.vue @@ -19,7 +19,12 @@ - + + + + + + @@ -526,7 +531,7 @@ - + @@ -608,7 +613,7 @@ - 保存 + 保存 关闭 @@ -669,15 +674,18 @@ Source Revision - + - - + + + + + - + @@ -695,16 +703,20 @@
Destination Revision - - + + 物料编码 + - - + + + + + - + @@ -856,6 +868,7 @@ export default { saveHeaderLoading: false, saveDetailLoading: false, saveAllLoading: false, + copyLoading: false, // 初始页签 detailTable: 'bom_detail', subDetailTable: 'bom_sub_detail', @@ -945,6 +958,7 @@ export default { limit: 10 }, copyPartData: { + type: '', site: '', buNo: '', partNo: '', @@ -981,6 +995,7 @@ export default { }, copyBomData: { site: '', + buNo: '', partNo: '', partDesc: '', engChgLevel: '', @@ -993,6 +1008,7 @@ export default { copyAlternativeData: { site: '', partNo: '', + partDesc: '', engChgLevel: '', bomType: '', alternativeNo: '', @@ -1879,6 +1895,7 @@ export default { columnImage: false, status: true, fixed: '', + columnWidth: 100 }, { columnProp: 'alternativeDescription', @@ -1889,6 +1906,7 @@ export default { columnImage: false, status: true, fixed: '', + columnWidth: 200 }, { columnProp: 'status', @@ -1899,6 +1917,7 @@ export default { columnImage: false, status: true, fixed: '', + columnWidth: 100 }, ], // ======== 必填规则 ======== @@ -2298,6 +2317,7 @@ export default { updateBy: this.$store.state.user.name, printUnit: row.printUnit, printUnitName: row.printUnitName, + alternativeNo: row.alternativeNo } this.subDetailTable = 'bom_sub_detail' // 查bom明细 @@ -2732,6 +2752,8 @@ export default { partNoBlur () { this.partData.limit = this.pageSize2 this.partData.page = this.pageIndex2 + this.partData.site = this.modalData.bu.split('_')[0] + this.partData.buNo = this.modalData.bu.split('_')[1] this.partData.partNo = this.modalData.partNo queryPartList(this.partData).then(({data}) => { if (data && data.code === 0) { @@ -2781,9 +2803,14 @@ export default { // 双击选择copy物料 getCopyRowData (row) { - this.copyBomData.partNo = row.partNo - this.copyBomData.partDesc = row.partDesc - this.copyBomTypeChange() + if (this.copyPartData.type === '1') { + this.copyBomData.partNo = row.partNo + this.copyBomData.partDesc = row.partDesc + this.copyBomTypeChange() + } else { + this.copyAlternativeData.partNo = row.partNo + this.copyAlternativeData.partDesc = row.partDesc + } this.copyPartModelFlag = false }, @@ -2816,10 +2843,10 @@ export default { * copy物料列表 */ queryCopyPartModal () { - this.copyPartData.limit = this.pageSize3 - this.copyPartData.page = this.pageIndex3 - this.copyPartData.site = this.copyBomData.site - this.copyPartData.buNo = this.copyBomData.buNo + this.copyPartData.limit = this.pageSize4 + this.copyPartData.page = this.pageIndex4 + this.copyPartData.site = this.modalData.site + this.copyPartData.buNo = this.modalData.buNo // 查询所有物料 queryPartList(this.copyPartData).then(({data}) => { if (data && data.code === 0) { @@ -2901,20 +2928,38 @@ export default { // copy物料编码失焦事件 copyPartBlur () { - if (this.copyBomData.partNo != null && this.copyBomData.partNo !== '') { - this.copyPartData.limit = this.pageSize4 - this.copyPartData.page = this.pageIndex4 - this.copyPartData.partNo = this.copyBomData.partNo - queryPartList(this.copyPartData).then(({data}) => { - if (data && data.code === 0) { - if (data.page.list.length === 1) { - this.copyBomData.partDesc = data.page.list[0].partDesc - } else { - this.$message.warning('该物料不存在!') - this.copyBomData.partDesc = '' + if (this.copyPartData.type === '1') { + if (this.copyBomData.partNo != null && this.copyBomData.partNo !== '') { + this.copyPartData.limit = this.pageSize4 + this.copyPartData.page = this.pageIndex4 + this.copyPartData.partNo = this.copyBomData.partNo + queryPartList(this.copyPartData).then(({data}) => { + if (data && data.code === 0) { + if (data.page.list.length === 1) { + this.copyBomData.partDesc = data.page.list[0].partDesc + } else { + this.$message.warning('该物料不存在!') + this.copyBomData.partDesc = '' + } } - } - }) + }) + } + } else { + if (this.copyAlternativeData.partNo != null && this.copyAlternativeData.partNo !== '') { + this.copyPartData.limit = this.pageSize4 + this.copyPartData.page = this.pageIndex4 + this.copyPartData.partNo = this.copyAlternativeData.partNo + queryPartList(this.copyPartData).then(({data}) => { + if (data && data.code === 0) { + if (data.page.list.length === 1) { + this.copyAlternativeData.partDesc = data.page.list[0].partDesc + } else { + this.$message.warning('该物料不存在!') + this.copyAlternativeData.partDesc = '' + } + } + }) + } } }, @@ -3186,6 +3231,15 @@ export default { previousVersion: {}, createBy: this.$store.state.user.name, } + this.copyPartData = { + type: '1', + site: this.modalData.site, + buNo: this.modalData.buNo, + partNo: '', + partDesc: '', + page: 1, + limit: 10 + } this.copyBomModelFlag = true }, /** @@ -3204,12 +3258,17 @@ export default { this.$message.warning('请选择制造类型!') return } + if (this.copyBomData.effPhaseOutDate != null && this.copyBomData.effPhaseOutDate !== '' && this.copyBomData.effPhaseOutDate < this.copyBomData.effPhaseInDate) { + this.$message.warning('失效日期必须大于生效日期!') + return + } this.copyBomData.previousVersion = this.modalData + this.copyLoading = true // 新增主表信息 copyBom(this.copyBomData).then(({data}) => { if (data && data.code === 0) { - this.modalData.effPhaseOutDate = data.rows.effPhaseOutDate this.copyBomModelFlag = false + this.updateModal(data.rows) this.$message({ message: '操作成功', type: 'success', @@ -3221,6 +3280,9 @@ export default { confirmButtonText: '确定' }) } + this.copyLoading = false + }).catch(()=>{ + this.copyLoading = false }) }, /** @@ -3231,6 +3293,7 @@ export default { site: this.detailData.site, buNo: this.detailData.buNo, partNo: this.detailData.partNo, + partDesc: this.modalData.partDesc, engChgLevel: this.detailData.engChgLevel, bomType: this.detailData.bomType, alternativeNo: this.detailData.alternativeNo, @@ -3242,6 +3305,15 @@ export default { previousVersion: {}, createBy: this.$store.state.user.name } + this.copyPartData = { + type: '2', + site: this.detailData.site, + buNo: this.detailData.buNo, + partNo: '', + partDesc: '', + page: 1, + limit: 10 + } this.copyAlternativeModelFlag = true }, @@ -3272,7 +3344,7 @@ export default { this.copyAlternativeData.previousVersion = this.detailData copyAlternative(this.copyAlternativeData).then(({data}) => { if (data && data.code === 0) { - this.detailDataList = data.rows.detailDataList + this.updateModal(data.rows) this.copyAlternativeModelFlag = false this.$message({ message: '操作成功', diff --git a/src/views/modules/part/routingManagement.vue b/src/views/modules/part/routingManagement.vue index 83a9ee4..c923493 100644 --- a/src/views/modules/part/routingManagement.vue +++ b/src/views/modules/part/routingManagement.vue @@ -319,6 +319,16 @@ + + + 关闭 @@ -417,15 +427,18 @@ Source Revision - + - - + + + + + - + @@ -464,19 +477,23 @@
Destination Revision - - + + 物料编码 + - - + + + + + - + - + @@ -493,7 +510,7 @@
- 保存 + 保存 关闭 @@ -504,15 +521,18 @@ Source Revision - + - - + + + + + - + @@ -530,16 +550,20 @@
Destination Revision - - + + 物料编码 + - - + + + + + - + @@ -559,11 +583,61 @@
- 保存 + 保存 关闭 + + + + + + + + + + + 查询 + + + + + + + + + + + + 关闭 + + + @@ -660,6 +734,12 @@ export default { pageIndex: 1, pageSize: 50, totalPage: 0, + pageIndex2: 1, + pageSize2: 20, + totalPage2: 0, + pageIndex4: 1, + pageSize4: 20, + totalPage4: 0, selectedDataNum: 0, // 条件查询 searchData: { @@ -676,6 +756,7 @@ export default { saveHeaderLoading: false, saveDetailLoading: false, saveAllLoading: false, + copyLoading: false, // 初始页签 detailTable: 'routing_detail', subDetailTable: 'routing_sub_detail', @@ -763,6 +844,8 @@ export default { buNo: '', partNo: '', partDesc: '', + page: 1, + limit: 10 }, operationData: { site: this.$store.state.user.site, @@ -800,7 +883,9 @@ export default { }, copyRoutingData: { site: '', + buNo: '', partNo: '', + partDesc: '', routingRevision: '', routingType: '', phaseInDate: '', @@ -811,6 +896,7 @@ export default { copyAlternativeData: { site: '', partNo: '', + partDesc: '', routingRevision: '', routingType: '', alternativeNo: '', @@ -829,6 +915,15 @@ export default { previousVersion: {}, createBy: '' }, + copyPartData: { + type: '', + site: '', + buNo: '', + partNo: '', + partDesc: '', + page: 1, + limit: 10 + }, // ======== 数据列表 ======== dataList: [], partList: [], @@ -839,6 +934,7 @@ export default { checkedDetail: [], checkedTool: [], alternativeList: [], + copyPartList: [], // ======== 列表表头 ======== columnList: [ { @@ -1384,6 +1480,68 @@ export default { fixed: '', }, ], + componentPartColumnList: [ + { + columnProp: 'partNo', + headerAlign: "center", + align: "center", + columnLabel: '物料编码', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + }, + { + columnProp: 'partDesc', + headerAlign: "center", + align: "left", + columnLabel: '物料名称', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + }, + { + columnProp: 'familyName', + headerAlign: "center", + align: "center", + columnLabel: '物料分类', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + }, + { + columnProp: 'printUnit', + headerAlign: "center", + align: "center", + columnLabel: '计量单位', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + }, + { + columnProp: 'spec', + headerAlign: "center", + align: "center", + columnLabel: '规格型号', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + }, + { + columnProp: 'partType', + headerAlign: "center", + align: "center", + columnLabel: '零件类型', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + } + ], // ======== 必填规则 ======== rules: { partNo: [ @@ -1556,6 +1714,7 @@ export default { copyAlternativeModelFlag: false, headerSaveFlag: false, menuId: this.$route.meta.menuId, + copyPartModelFlag: false, } }, @@ -1628,6 +1787,149 @@ export default { this.getDataList() }, + /** + * 每页数 + * @param val + */ + sizeChangeHandle2 (val) { + this.pageSize2 = val + this.pageIndex2 = 1 + this.queryPartList() + }, + + /** + * 当前页 + * @param val + */ + currentChangeHandle2 (val) { + this.pageIndex2 = val + this.queryPartList() + }, + + /** + * 每页数 + * @param val + */ + sizeChangeHandle4 (val) { + this.pageSize4 = val + this.pageIndex4 = 1 + this.queryCopyPartModal() + }, + + /** + * 当前页 + * @param val + */ + currentChangeHandle4 (val) { + this.pageIndex4 = val + this.queryCopyPartModal() + }, + + /** + * copy物料列表 + */ + queryCopyPartModal () { + this.copyPartData.limit = this.pageSize4 + this.copyPartData.page = this.pageIndex4 + this.copyPartData.site = this.modalData.site + this.copyPartData.buNo = this.modalData.buNo + // 查询所有物料 + queryPartList(this.copyPartData).then(({data}) => { + if (data && data.code === 0) { + this.copyPartList = data.page.list + this.pageIndex4 = data.page.currPage + this.pageSize4 = data.page.pageSize + this.totalPage4 = data.page.totalCount + this.copyPartModelFlag = true + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + + /** + * copy物料查询列表 + */ + queryCopyPartList () { + this.copyPartData.limit = this.pageSize4 + this.copyPartData.page = this.pageIndex4 + // 查询所有物料 + queryPartList(this.copyPartData).then(({data}) => { + if (data && data.code === 0) { + this.copyPartList = data.page.list + this.pageIndex4 = data.page.currPage + this.pageSize4 = data.page.pageSize + this.totalPage4 = data.page.totalCount + } else { + this.copyPartList = [] + } + }) + }, + + // copy物料编码失焦事件 + copyPartBlur () { + if (this.copyPartData.type === '1') { + if (this.copyRoutingData.partNo != null && this.copyRoutingData.partNo !== '') { + this.copyPartData.limit = this.pageSize4 + this.copyPartData.page = this.pageIndex4 + this.copyPartData.partNo = this.copyRoutingData.partNo + queryPartList(this.copyPartData).then(({data}) => { + if (data && data.code === 0) { + if (data.page.list.length === 1) { + this.copyRoutingData.partDesc = data.page.list[0].partDesc + } else { + this.$message.warning('该物料不存在!') + this.copyRoutingData.partDesc = '' + } + } + }) + } + } else { + if (this.copyAlternativeData.partNo != null && this.copyAlternativeData.partNo !== '') { + this.copyPartData.limit = this.pageSize4 + this.copyPartData.page = this.pageIndex4 + this.copyPartData.partNo = this.copyAlternativeData.partNo + queryPartList(this.copyPartData).then(({data}) => { + if (data && data.code === 0) { + if (data.page.list.length === 1) { + this.copyAlternativeData.partDesc = data.page.list[0].partDesc + } else { + this.$message.warning('该物料不存在!') + this.copyAlternativeData.partDesc = '' + } + } + }) + } + } + }, + + // 双击选择copy物料 + getCopyRowData (row) { + if (this.copyPartData.type === '1') { + this.copyRoutingData.partNo = row.partNo + this.copyRoutingData.partDesc = row.partDesc + this.copyRoutingTypeChange() + } else { + this.copyAlternativeData.partNo = row.partNo + this.copyAlternativeData.partDesc = row.partDesc + } + this.copyPartModelFlag = false + }, + + // copy BOM类型改变 + copyRoutingTypeChange () { + // 获取物料的routing版本号 + getRottingRevision(this.copyRoutingData).then(({data}) => { + if (data && data.code === 0) { + this.copyRoutingData.routingRevision = data.routingRevision + } else { + this.copyRoutingData.routingRevision = '' + } + }) + }, + // ======== 列表数据操作方法 ======== /** * 获取数据列表 @@ -1728,6 +2030,7 @@ export default { updateBy: this.$store.state.user.name, printUnit: row.printUnit, printUnitName: row.printUnitName, + alternativeNo: row.alternativeNo, } // 查routing明细 queryRoutingDetail(this.modalData).then(({data}) => { @@ -2102,11 +2405,16 @@ export default { * 查询物料 */ queryPartList () { + this.partData.limit = this.pageSize2 + this.partData.page = this.pageIndex2 this.partData.site = this.modalData.bu.split('_')[0] this.partData.buNo = this.modalData.bu.split('_')[1] queryPartListRouting(this.partData).then(({data}) => { if (data && data.code === 0) { - this.partList = data.rows + this.partList = data.page.list + this.pageIndex2 = data.page.currPage + this.pageSize2 = data.page.pageSize + this.totalPage2 = data.page.totalCount this.partModelFlag = true } else { this.$alert(data.msg, '错误', { @@ -2118,13 +2426,15 @@ export default { // 物料编码失焦事件 partNoBlur () { + this.partData.limit = this.pageSize2 + this.partData.page = this.pageIndex2 this.partData.partNo = this.modalData.partNo queryPartList(this.partData).then(({data}) => { if (data && data.code === 0) { - if (data.rows.length === 1) { - this.modalData.partDesc = data.rows[0].partDesc - this.modalData.printUnit = data.rows[0].printUnit - this.modalData.printUnitName = data.rows[0].printUnitName + if (data.page.list.length === 1) { + this.modalData.partDesc = data.page.list[0].partDesc + this.modalData.printUnit = data.page.list[0].printUnit + this.modalData.printUnitName = data.page.list[0].printUnitName // 获取物料的routing版本号 getRottingRevision(this.modalData).then(({data}) => { if (data && data.code === 0) { @@ -2443,6 +2753,7 @@ export default { site: this.modalData.site, buNo: this.modalData.buNo, partNo: this.modalData.partNo, + partDesc: this.modalData.partDesc, routingRevision: this.modalData.routingRevision + 1, routingType: this.modalData.routingType, phaseInDate: this.dayjs(new Date()).format('YYYY-MM-DD'), @@ -2450,6 +2761,15 @@ export default { previousVersion: {}, createBy: this.$store.state.user.name, } + this.copyPartData = { + type: '1', + site: this.modalData.site, + buNo: this.modalData.buNo, + partNo: '', + partDesc: '', + page: 1, + limit: 10 + } this.copyRoutingModelFlag = true }, @@ -2470,11 +2790,12 @@ export default { return } this.copyRoutingData.previousVersion = this.modalData + this.copyLoading = true // 新增主表信息 copyRouting(this.copyRoutingData).then(({data}) => { if (data && data.code === 0) { - this.modalData.phaseOutDate = data.rows.phaseOutDate this.copyRoutingModelFlag = false + this.updateModal(data.rows) this.$message({ message: '操作成功', type: 'success', @@ -2486,6 +2807,9 @@ export default { confirmButtonText: '确定' }) } + this.copyLoading = false + }).catch(()=>{ + this.copyLoading = false }) }, @@ -2497,6 +2821,7 @@ export default { site: this.detailData.site, buNo: this.detailData.buNo, partNo: this.detailData.partNo, + partDesc: this.modalData.partDesc, routingRevision: this.detailData.routingRevision, routingType: this.detailData.routingType, alternativeNo: this.detailData.alternativeNo, @@ -2515,6 +2840,15 @@ export default { previousVersion: {}, createBy: this.$store.state.user.name } + this.copyPartData = { + type: '2', + site: this.detailData.site, + buNo: this.detailData.buNo, + partNo: '', + partDesc: '', + page: 1, + limit: 10 + } this.copyAlternativeModelFlag = true }, @@ -2543,10 +2877,11 @@ export default { return } this.copyAlternativeData.previousVersion = this.detailData + this.copyLoading = true copyAlternative(this.copyAlternativeData).then(({data}) => { if (data && data.code === 0) { - this.detailDataList = data.rows.detailDataList this.copyAlternativeModelFlag = false + this.updateModal(data.rows) this.$message({ message: '操作成功', type: 'success', @@ -2558,6 +2893,9 @@ export default { confirmButtonText: '确定' }) } + this.copyLoading = false + }).catch(()=>{ + this.copyLoading = false }) },