From 6be148088dddf3cb658ba28f0031f7d31ad91590 Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Tue, 10 Jun 2025 16:39:52 +0800 Subject: [PATCH] =?UTF-8?q?2025-06-10=20=E9=80=89=E6=8B=A9=E7=89=A9?= =?UTF-8?q?=E6=96=99=E6=97=B6=E8=83=BD=E5=A4=9F=E7=9C=8B=E5=88=B0/?= =?UTF-8?q?=E8=B7=B3=E8=BD=AC=E8=BF=99=E4=B8=AA=E7=89=A9=E6=96=99=E7=9A=84?= =?UTF-8?q?BOM=E4=BF=A1=E6=81=AF=EF=BC=88=E4=BA=A7=E5=93=81BOM=E3=80=81?= =?UTF-8?q?=E9=85=8D=E6=96=B9BOM=EF=BC=89=20=E6=93=8D=E4=BD=9C=E4=B8=AD?= =?UTF-8?q?=E5=A2=9E=E5=8A=A0BOM=E7=9A=84=E6=9F=A5=E7=9C=8B=EF=BC=88?= =?UTF-8?q?=E4=BB=85=E6=9F=A5=E7=9C=8B=EF=BC=8C=E4=B8=8D=E5=8F=AF=E7=BC=96?= =?UTF-8?q?=E8=BE=91=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/part/recipeManagement.js | 5 + src/views/modules/part/bomManagement.vue | 189 ++++++++++++++++-- src/views/modules/part/recipeManagement.vue | 169 +++++++++++++++- .../com_technical-add-or-update.vue | 6 +- 4 files changed, 344 insertions(+), 25 deletions(-) diff --git a/src/api/part/recipeManagement.js b/src/api/part/recipeManagement.js index eb4967b..b73efbf 100644 --- a/src/api/part/recipeManagement.js +++ b/src/api/part/recipeManagement.js @@ -203,4 +203,9 @@ export const queryPartListRecipe = data => createAPI(`/plm/recipeManagement/quer */ export const queryPartListAll = data => createAPI(`/plm/recipeManagement/queryPartListAll`,'post',data) +/** + * 查子物料Recipe + */ +export const queryComponentPartRecipeList = data => createAPI(`/plm/recipeManagement/queryComponentPartRecipeList`,'post',data) + diff --git a/src/views/modules/part/bomManagement.vue b/src/views/modules/part/bomManagement.vue index 602770d..b2cebd6 100644 --- a/src/views/modules/part/bomManagement.vue +++ b/src/views/modules/part/bomManagement.vue @@ -465,7 +465,7 @@ - + @@ -489,7 +489,11 @@ + + + + + + + + + + + 关闭 @@ -933,6 +964,7 @@ import { queryMultiLevelStructureTable, // 刷新多级别结构 queryPartListBom, // 查出可创建BOM的物料 queryPartListAll, // 查询包含Purchase(Raw)的物料 + queryComponentPartBomList, // 查子物料BOM } from '@/api/part/bomManagement.js' import ChooseList from '@/views/modules/common/Chooselist' @@ -1035,6 +1067,7 @@ export default { // 初始页签 detailTable: 'bom_detail', subDetailTable: 'bom_sub_detail', + componentTable: 'component_part_bom', // ======== 数据对象 ======== modalData: { flag: '', @@ -1203,6 +1236,7 @@ export default { itemCostDistribution: '', updateBy: '', }, + componentPartCurrentRow: {}, // ======== 数据列表 ======== dataList: [], partList: [], @@ -1217,6 +1251,7 @@ export default { checkedByProduct: [], operationList: [], multiLevelStructureList: [], + componentPartBomList: [], // ======== 列表表头 ======== columnList: [ { @@ -2521,6 +2556,96 @@ export default { columnWidth: 100 }, ], + columnComponentPartList: [ + { + columnProp: 'engChgLevel', + headerAlign: "center", + align: "center", + columnLabel: 'BOM版本号', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + columnWidth: 60 + }, + { + columnProp: 'bomType', + headerAlign: "center", + align: "center", + columnLabel: '制造类型', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + columnWidth: 100 + }, + { + columnProp: 'alternativeNo', + headerAlign: "center", + align: "center", + columnLabel: '替代编码', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + columnWidth: 80 + }, + { + columnProp: 'alternativeDescription', + headerAlign: "center", + align: "left", + columnLabel: '替代名称', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + columnWidth: 100 + }, + { + columnProp: 'componentPart', + headerAlign: "center", + align: "left", + columnLabel: '子物料编码', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + columnWidth: 100 + }, + { + columnProp: 'componentPartDesc', + headerAlign: "center", + align: "left", + columnLabel: '子物料名称', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + columnWidth: 200 + }, + { + columnProp: 'qtyPerAssembly', + headerAlign: "center", + align: "right", + columnLabel: '单位用量', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + columnWidth: 140 + }, + { + columnProp: 'printUnit', + headerAlign: "center", + align: "left", + columnLabel: '计量单位', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + columnWidth: 80 + }, + ], // ======== 必填规则 ======== rules: { partNo: [ @@ -3078,10 +3203,6 @@ export default { this.$message.warning('请先选择替代!') return } - // if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') { - // this.$message.warning('不可编辑的替代状态!') - // return - // } this.componentData = { flag: '1', site: this.$store.state.user.site, @@ -3128,10 +3249,6 @@ export default { this.$message.warning('请先选择替代!') return } - // if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') { - // this.$message.warning('不可编辑的替代状态!') - // return - // } this.componentData = { flag: '1', site: this.$store.state.user.site, @@ -3174,10 +3291,6 @@ export default { // 子明细编辑模态框 updateComponentModal (row) { - // if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') { - // this.$message.warning('不可编辑的替代状态!') - // return - // } this.componentData = { flag: '2', site: row.site, @@ -3210,10 +3323,6 @@ export default { // 副产品编辑模态框 updateByProductModal (row) { - // if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') { - // this.$message.warning('不可编辑的替代状态!') - // return - // } this.componentData = { flag: '2', site: row.site, @@ -3246,10 +3355,6 @@ export default { // 副产品成本分配编辑模态框 updateManufStructCostDistribModal (row) { - // if (this.detailData.status != null && this.detailData.status !== '' && this.detailData.status !== 'Tentative') { - // this.$message.warning('不可编辑的替代状态!') - // return - // } this.manufStructCostDistribData = { site: row.site, partNo: row.partNo, @@ -3514,6 +3619,48 @@ export default { }) }, + // 刷新页签的table数据 + tabClick () { + if (this.componentTable === 'component_part_bom') { + this.queryComponentPartBomList() + } + }, + + // 子物料Bom列表 + queryComponentPartBomList () { + let tempData = { + site: this.$store.state.user.site, + partNo: this.componentPartCurrentRow.partNo, + } + queryComponentPartBomList(tempData).then(({data}) => { + if (data && data.code === 0) { + this.componentPartBomList = data.rows + } else { + this.componentPartBomList = [] + } + }) + }, + + rowStyle ({row}) { + if (this.componentPartCurrentRow.partNo === row.partNo) { + return { 'background-color': '#E8F7F6', cursor: 'pointer' } + } + }, + + // 单机选中物料信息 + componentPartClickRow (row, column) { + this.componentPartCurrentRow = JSON.parse(JSON.stringify(row)) + }, + + // 当前值发生变化的时候修改 + changeCurrentRow (row, oldRow) { + // 判断是否是获取焦点的事件 + if (row) { + this.componentPartCurrentRow = JSON.parse(JSON.stringify(row)) + this.tabClick() + } + }, + // copy物料列表 queryCopyPartModal () { this.copyPartData.limit = this.pageSize4 diff --git a/src/views/modules/part/recipeManagement.vue b/src/views/modules/part/recipeManagement.vue index 23317a2..436b387 100644 --- a/src/views/modules/part/recipeManagement.vue +++ b/src/views/modules/part/recipeManagement.vue @@ -360,7 +360,7 @@ - + @@ -384,7 +384,11 @@ + + + + + + + + + + + 关闭 @@ -839,6 +870,7 @@ import { queryMultiLevelStructureTable, // 刷新多级别结构 queryPartListRecipe, // 查出可创建Recipe的物料 queryPartListAll, // 查询包含Purchase(Raw)的物料 + queryComponentPartRecipeList, // 查子物料配方 } from '@/api/part/recipeManagement.js' import ChooseList from '@/views/modules/common/Chooselist' @@ -941,6 +973,7 @@ export default { // 初始页签 detailTable: 'recipe_detail', subDetailTable: 'recipe_sub_detail', + componentTable: 'component_part_bom', // ======== 数据对象 ======== modalData: { flag: '', @@ -1133,6 +1166,7 @@ export default { itemCostDistribution: '', updateBy: '', }, + componentPartCurrentRow: {}, // ======== 数据列表 ======== dataList: [], partList: [], @@ -1147,6 +1181,7 @@ export default { checkedByProduct: [], operationList: [], multiLevelStructureList: [], + componentPartBomList: [], // ======== 列表表头 ======== columnList: [ { @@ -2505,6 +2540,96 @@ export default { columnWidth: 100 }, ], + columnComponentPartList: [ + { + columnProp: 'engChgLevel', + headerAlign: "center", + align: "center", + columnLabel: 'BOM版本号', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + columnWidth: 60 + }, + { + columnProp: 'bomType', + headerAlign: "center", + align: "center", + columnLabel: '制造类型', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + columnWidth: 100 + }, + { + columnProp: 'alternativeNo', + headerAlign: "center", + align: "center", + columnLabel: '替代编码', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + columnWidth: 80 + }, + { + columnProp: 'alternativeDescription', + headerAlign: "center", + align: "left", + columnLabel: '替代名称', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + columnWidth: 100 + }, + { + columnProp: 'componentPart', + headerAlign: "center", + align: "left", + columnLabel: '子物料编码', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + columnWidth: 100 + }, + { + columnProp: 'componentPartDesc', + headerAlign: "center", + align: "left", + columnLabel: '子物料名称', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + columnWidth: 200 + }, + { + columnProp: 'qtyPerAssembly', + headerAlign: "center", + align: "right", + columnLabel: '单位用量', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + columnWidth: 140 + }, + { + columnProp: 'printUnit', + headerAlign: "center", + align: "left", + columnLabel: '计量单位', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + columnWidth: 80 + }, + ], // ======== 必填规则 ======== rules: { partNo: [ @@ -3516,6 +3641,48 @@ export default { }) }, + // 刷新页签的table数据 + tabClick () { + if (this.componentTable === 'component_part_bom') { + this.queryComponentPartBomList() + } + }, + + // 子物料Bom列表 + queryComponentPartBomList () { + let tempData = { + site: this.$store.state.user.site, + partNo: this.componentPartCurrentRow.partNo, + } + queryComponentPartRecipeList(tempData).then(({data}) => { + if (data && data.code === 0) { + this.componentPartBomList = data.rows + } else { + this.componentPartBomList = [] + } + }) + }, + + rowStyle ({row}) { + if (this.componentPartCurrentRow.partNo === row.partNo) { + return { 'background-color': '#E8F7F6', cursor: 'pointer' } + } + }, + + // 单机选中物料信息 + componentPartClickRow (row, column) { + this.componentPartCurrentRow = JSON.parse(JSON.stringify(row)) + }, + + // 当前值发生变化的时候修改 + changeCurrentRow (row, oldRow) { + // 判断是否是获取焦点的事件 + if (row) { + this.componentPartCurrentRow = JSON.parse(JSON.stringify(row)) + this.tabClick() + } + }, + // copy物料列表 queryCopyPartModal () { this.copyPartData.limit = this.pageSize4 diff --git a/src/views/modules/sampleManagement/com_technical-add-or-update.vue b/src/views/modules/sampleManagement/com_technical-add-or-update.vue index df40ae2..7aa5a49 100644 --- a/src/views/modules/sampleManagement/com_technical-add-or-update.vue +++ b/src/views/modules/sampleManagement/com_technical-add-or-update.vue @@ -112,7 +112,7 @@