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 @@