diff --git a/src/api/part/bomManagement.js b/src/api/part/bomManagement.js index e7f5ca6..8810cb2 100644 --- a/src/api/part/bomManagement.js +++ b/src/api/part/bomManagement.js @@ -133,5 +133,20 @@ export const getBomEngChgLevel = data => createAPI(`/plm/bomManagement/getBomEng */ export const getComponentLineSequence = data => createAPI(`/plm/bomManagement/getComponentLineSequence`,'post',data) +/** + * 复制bom + * @param data + * @returns {*} + */ +export const copyBom = data => createAPI(`/plm/bomManagement/copyBom`,'post',data) + +/** + * 复制alternative + * @param data + * @returns {*} + */ +export const copyAlternative = data => createAPI(`/plm/bomManagement/copyAlternative`,'post',data) + + diff --git a/src/api/part/partInformation.js b/src/api/part/partInformation.js index 6caf83a..046575d 100644 --- a/src/api/part/partInformation.js +++ b/src/api/part/partInformation.js @@ -198,3 +198,22 @@ export const queryPartItem = data => createAPI(`/plm/partInformation/queryPartIt */ export const queryMasterField = data => createAPI(`/plm/partInformation/queryMasterField`,'post',data) +/** + * 临时物料转为正式物料 + */ +export const toBecomeOfficialPart = data => createAPI(`/plm/partInformation/toBecomeOfficialPart`,'post',data) + +/** + * 查询物料的bom版本列表 + */ +export const queryPartRevisionList = data => createAPI(`/plm/partInformation/queryPartRevisionList`,'post',data) + +/** + * 编辑bom版本 + */ +export const updateRevision = data => createAPI(`/plm/partInformation/updateRevision`,'post',data) + +/** + * 复制物料 + */ +export const copyPart = data => createAPI(`/plm/partInformation/copyPart`,'post',data) diff --git a/src/api/part/routingManagement.js b/src/api/part/routingManagement.js index e298783..3c5dda4 100644 --- a/src/api/part/routingManagement.js +++ b/src/api/part/routingManagement.js @@ -168,3 +168,17 @@ export const deleteRoutingTool = data => createAPI(`/plm/routingManagement/delet * @Date 2024/10/21 10:14:35 **/ export const routingAllInfoSearch = data => createAPI(`/plm/routingManagement/routingAllInfoSearch`,'post',data) + +/** + * 复制Routing + * @param data + * @returns {*} + */ +export const copyRouting = data => createAPI(`/plm/routingManagement/copyRouting`,'post',data) + +/** + * 复制alternative + * @param data + * @returns {*} + */ +export const copyAlternative = data => createAPI(`/plm/routingManagement/copyAlternative`,'post',data) diff --git a/src/views/modules/part/bomManagement.vue b/src/views/modules/part/bomManagement.vue index f7fe0cb..598a57a 100644 --- a/src/views/modules/part/bomManagement.vue +++ b/src/views/modules/part/bomManagement.vue @@ -112,8 +112,9 @@ - + - + - - 保存 + + 保存 + Copy @@ -155,8 +158,9 @@ 新增 删除 编辑 - Buildable - Obsolete + Copy + Buildable + Obsolete @@ -450,6 +454,161 @@ + + +
+ Source Revision + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ Destination Revision + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + 保存 + 关闭 + +
+ + + +
+ Source Revision + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ Destination Revision + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + 保存 + 关闭 + +
+ @@ -476,6 +635,8 @@ import { queryOperationList, // 根据物料编码查询工序 getBomEngChgLevel, // 获取物料的bom版本号 getComponentLineSequence, // 获取子料的序号 + copyBom, // 复制bom + copyAlternative, // 复制alternative } from '@/api/part/bomManagement.js' import ChooseList from '@/views/modules/common/Chooselist' import dayjs from "dayjs"; @@ -630,6 +791,30 @@ export default { partNo: '', operationName: '', }, + copyBomData: { + site: '', + partNo: '', + engChgLevel: '', + bomType: '', + effPhaseInDate: '', + effPhaseOutDate: '', + previousVersion: {}, + createBy: '' + }, + copyAlternativeData: { + site: '', + partNo: '', + engChgLevel: '', + bomType: '', + alternativeNo: '', + alternativeDescription: '', + minLotQty: '', + defaultFlag: '', + detailNoteText: '', + status: '', + previousVersion: {}, + createBy: '' + }, // ======== 数据列表 ======== dataList: [], partList: [], @@ -758,7 +943,7 @@ export default { columnProp: 'effPhaseInDate', headerAlign: 'center', align: 'center', - columnLabel: '开始时间', + columnLabel: '生效日期', columnHidden: false, columnImage: false, columnSortable: false, @@ -776,7 +961,7 @@ export default { columnProp: 'effPhaseOutDate', headerAlign: 'center', align: 'center', - columnLabel: '结束时间', + columnLabel: '失效日期', columnHidden: false, columnImage: false, columnSortable: false, @@ -1172,6 +1357,44 @@ export default { fixed: '', } ], + columnBomDetailList: [ + { + columnProp: 'alternativeNo', + headerAlign: "center", + align: "center", + columnLabel: '替代编码', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + }, + { + columnProp: 'alternativeDescription', + headerAlign: "center", + align: "center", + columnLabel: '替代名称', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + }, + { + columnProp: 'status', + headerAlign: "center", + align: "center", + columnLabel: '状态', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + }, + ], // ======== 必填规则 ======== rules: { partNo: [ @@ -1296,6 +1519,8 @@ export default { componentSaveModal: false, componentDisableFlag: false, operationModelFlag: false, + copyBomModelFlag: false, + copyAlternativeModelFlag: false } }, @@ -1681,11 +1906,11 @@ export default { return } if (this.modalData.effPhaseInDate === '' || this.modalData.effPhaseInDate == null) { - this.$message.warning('请选择开始时间!') + this.$message.warning('请选择生效日期!') return } // if (this.modalData.effPhaseOutDate === '' || this.modalData.effPhaseOutDate == null) { - // this.$message.warning('请选择结束时间!') + // this.$message.warning('请选择失效日期!') // return // } if (this.modalData.engChgLevel === '' || this.modalData.engChgLevel == null) { @@ -2195,6 +2420,119 @@ export default { this.saveHeaderLoading = false }) }, + /** + * 复制bom的模态框 + */ + copyBomRevision () { + this.copyBomData = { + site: this.modalData.site, + partNo: this.modalData.partNo, + engChgLevel: this.modalData.engChgLevel + 1, + bomType: this.modalData.bomType, + effPhaseInDate: this.dayjs(new Date()).format('YYYY-MM-DD'), + effPhaseOutDate: '', + previousVersion: {}, + createBy: this.$store.state.user.name + } + this.copyBomModelFlag = true + }, + /** + * 复制bom的方法 + */ + copyBom () { + if (this.copyBomData.partNo === '' || this.copyBomData.partNo == null) { + this.$message.warning('请选择Bom物料!') + return + } + if (this.copyBomData.engChgLevel === '' || this.copyBomData.engChgLevel == null) { + this.$message.warning('请填写Bom版本号!') + return + } + if (this.copyBomData.bomType === '' || this.copyBomData.bomType == null) { + this.$message.warning('请选择制造类型!') + return + } + this.copyBomData.previousVersion = this.modalData + // 新增主表信息 + copyBom(this.copyBomData).then(({data}) => { + if (data && data.code === 0) { + this.copyBomModelFlag = false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + /** + * 复制alternative的模态框 + */ + copyBomAlternative () { + this.copyAlternativeData = { + site: this.detailData.site, + partNo: this.detailData.partNo, + engChgLevel: this.detailData.engChgLevel, + bomType: this.detailData.bomType, + alternativeNo: this.detailData.alternativeNo, + alternativeDescription: this.detailData.alternativeDescription, + minLotQty: this.detailData.minLotQty, + defaultFlag: this.detailData.defaultFlag, + detailNoteText: this.detailData.detailNoteText, + status: 'Tentative', + previousVersion: {}, + createBy: this.$store.state.user.name + } + this.copyAlternativeModelFlag = true + }, + + /** + * 复制alternative的方法 + */ + copyAlternative () { + if (this.copyAlternativeData.partNo === '' || this.copyAlternativeData.partNo == null) { + this.$message.warning('请选择Bom物料!') + return + } + if (this.copyAlternativeData.engChgLevel === '' || this.copyAlternativeData.engChgLevel == null) { + this.$message.warning('请填写Bom版本号!') + return + } + if (this.copyAlternativeData.bomType === '' || this.copyAlternativeData.bomType == null) { + this.$message.warning('请选择制造类型!') + return + } + if (this.copyAlternativeData.alternativeNo === '' || this.copyAlternativeData.alternativeNo == null) { + this.$message.warning('请填写替代编码!') + return + } + if (this.copyAlternativeData.alternativeDescription === '' || this.copyAlternativeData.alternativeDescription == null) { + this.$message.warning('请填写替代名称!') + return + } + this.copyAlternativeData.previousVersion = this.detailData + copyAlternative(this.copyAlternativeData).then(({data}) => { + if (data && data.code === 0) { + this.copyAlternativeModelFlag = false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + /** * 新增替代方法 */ diff --git a/src/views/modules/part/partCatalogInformation.vue b/src/views/modules/part/partCatalogInformation.vue index e6f77e1..36ae87c 100644 --- a/src/views/modules/part/partCatalogInformation.vue +++ b/src/views/modules/part/partCatalogInformation.vue @@ -11,7 +11,7 @@ 查询 新增 - 删除 + - - - - + + Copy + + + 转正式物料 + + @@ -273,9 +276,9 @@ - 海关统计序号 / Customs Star No - - + 海关统计序号 / Customs Stat No + + @@ -454,7 +457,40 @@ - + + + + + + + + + +
@@ -1107,6 +1143,72 @@ + + + + + + + + + + + + + + + + + + + 保存 + 关闭 + + + + + +
+ Part No To Copy + + + + + + + + + + +
+
+ Select Part Information to Copy + + + General + + + Costs + + + Planning Data + + + + + Manufacturing + + + Default Location + + +
+ + 保存 + 关闭 + +
+ @@ -1150,6 +1252,10 @@ deletePartItem, // 删除物料属性 queryPartItem, queryMasterField, // 根据物料编码查 masterPart 属性 + toBecomeOfficialPart, // 临时物料转为正式物料 + queryPartRevisionList, // 查询物料的bom版本列表 + updateRevision, //编辑bom版本 + copyPart // 复制物料 } from '@/api/part/partInformation.js' import { getFileContentList, // 获取物料单附件列表 @@ -1176,6 +1282,23 @@ deep: true, handler: function (newV, oldV) { this.modalData.partNo = this.modalData.partNo.toUpperCase() + this.modalData.productGroupId4 = this.modalData.productGroupId4.toUpperCase() + this.modalData.hazardCode = this.modalData.hazardCode.toUpperCase() + this.modalData.productGroupId3 = this.modalData.productGroupId3.toUpperCase() + this.modalData.umId = this.modalData.umId.toUpperCase() + this.modalData.groupId = this.modalData.groupId.toUpperCase() + this.modalData.productGroupId1 = this.modalData.productGroupId1.toUpperCase() + this.modalData.familyId = this.modalData.familyId.toUpperCase() + this.modalData.productGroupId2 = this.modalData.productGroupId2.toUpperCase() + this.modalData.assetClass = this.modalData.assetClass.toUpperCase() + this.modalData.partStatus = this.modalData.partStatus.toUpperCase() + this.modalData.abcClass = this.modalData.abcClass.toUpperCase() + this.modalData.codeNo = this.modalData.codeNo.toUpperCase() + this.modalData.countryOfOrigin = this.modalData.countryOfOrigin.toUpperCase() + this.modalData.regionOfOrigin = this.modalData.regionOfOrigin.toUpperCase() + this.modalData.customsStatNo = this.modalData.customsStatNo.toUpperCase() + this.modalData.partCostGroupId = this.modalData.partCostGroupId.toUpperCase() + this.modalData.planningMethod = this.modalData.planningMethod.toUpperCase() } } }, @@ -1212,6 +1335,7 @@ dataListLoading: false, // 初始页签 activeTable: 'part_item', + inventoryPartTable: '', // ======== 数据对象 ======== modalData: { flag: '', @@ -1273,8 +1397,8 @@ regionOfOrigin: '', regionOfOriginDesc: '', durabilityWeek: '', - customsStarNo: '', - customsStarDesc: '', + customsStatNo: '', + customsStatDesc: '', durabilityDay: '', intrastatConvFactor: '', umDesc: '', @@ -1313,6 +1437,16 @@ density: '', variableLeadTimeHour: '' }, + revisionData: { + site: '', + partNo: '', + engChgLevel: '', + bomType: '', + noteText: '', + effPhaseInDate: '', + effPhaseOutDate: '', + engRevision: '' + }, itemData: { site: this.$store.state.user.site, partNo: '', @@ -1338,6 +1472,18 @@ locationId: '', locationName: '', }, + copyPartData: { + site: '', + partNo: '', + partDesc: '', + copyGeneral: 'Y', + copyCosts: '', + copyPlanningData: '', + copyManufacturing: '', + copyDefaultLocation: '', + previousVersion: {}, + createBy: '' + }, // ======== 数据列表 ======== dataList: [], partItemList: [], @@ -1369,6 +1515,7 @@ itemSelections2: [], itemList1:[], itemList2:[], + revisionList: [], // ======== 列表表头 ======== columnList: [ { @@ -2428,6 +2575,110 @@ fixed: '', }, ], + columnRevisionList: [ + { + userId: this.$store.state.user.name, + functionId: 104001, + serialNumber: '104001Table8EngChgLevel', + tableId: "104001Table8", + tableName: "物料版本表", + columnProp: 'engChgLevel', + headerAlign: "center", + align: "center", + columnLabel: '版本号', + columnHidden: false, + columnImage: false, + columnSortable: true, + sortLv: 0, + status: true, + fixed: '', + }, + { + userId: this.$store.state.user.name, + functionId: 104001, + serialNumber: '104001Table8BomType', + tableId: "104001Table8", + tableName: "物料版本表", + columnProp: 'bomType', + headerAlign: "center", + align: "center", + columnLabel: '制造类型', + columnHidden: false, + columnImage: false, + columnSortable: true, + sortLv: 0, + status: true, + fixed: '', + }, + { + userId: this.$store.state.user.name, + functionId: 104001, + serialNumber: '104001Table8EffPhaseInDate', + tableId: "104001Table8", + tableName: "物料版本表", + columnProp: 'effPhaseInDate', + headerAlign: "center", + align: "center", + columnLabel: '生效日期', + columnHidden: false, + columnImage: false, + columnSortable: true, + sortLv: 0, + status: true, + fixed: '', + }, + { + userId: this.$store.state.user.name, + functionId: 104001, + serialNumber: '104001Table8EffPhaseOutDate', + tableId: "104001Table8", + tableName: "物料版本表", + columnProp: 'effPhaseOutDate', + headerAlign: "center", + align: "center", + columnLabel: '失效日期', + columnHidden: false, + columnImage: false, + columnSortable: true, + sortLv: 0, + status: true, + fixed: '', + }, + { + userId: this.$store.state.user.name, + functionId: 104001, + serialNumber: '104001Table8NoteText', + tableId: "104001Table8", + tableName: "物料版本表", + columnProp: 'noteText', + headerAlign: "center", + align: "center", + columnLabel: '版本文本', + columnHidden: false, + columnImage: false, + columnSortable: true, + sortLv: 0, + status: true, + fixed: '', + }, + { + userId: this.$store.state.user.name, + functionId: 104001, + serialNumber: '104001Table8EngRevision', + tableId: "104001Table8", + tableName: "物料版本表", + columnProp: 'engRevision', + headerAlign: "center", + align: "center", + columnLabel: '工程版本', + columnHidden: false, + columnImage: false, + columnSortable: true, + sortLv: 0, + status: true, + fixed: '', + }, + ], // ======== 必填规则 ======== rules: { partNo: [ @@ -2517,7 +2768,9 @@ manufacturerModelFlag: false, updateItemModelFlag: false, fastAddFlag: false, - locationModelFlag: false + locationModelFlag: false, + updateRevisionModelFlag: false, + copyPartModelFlag: false } }, @@ -2534,6 +2787,78 @@ }, methods: { + // 页签选择替换 + inventoryPartClick (tab, event) { + this.refreshInventoryPartTable() + }, + + // 刷新页签的table数据 + refreshInventoryPartTable () { + if (this.inventoryPartTable === 'Revisions') { + this.queryPartRevisionList() + } + }, + + // 查询物料的bom版本列表 + queryPartRevisionList () { + let tempData = { + site: this.modalData.site, + partNo: this.modalData.partNo, + // partType: this.modalData.partType + } + queryPartRevisionList(tempData).then(({data}) => { + if (data && data.code === 0) { + this.revisionList = data.rows + } else { + this.revisionList = [] + } + }) + }, + + // 编辑bom版本模态框 + updateRevisionModal (row) { + this.revisionData = row + this.updateRevisionModelFlag = true + }, + + // 编辑bom版本 + updateRevision () { + updateRevision(this.revisionData).then(({data}) => { + if (data && data.code === 0) { + this.queryPartRevisionList() + this.updateRevisionModelFlag = false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + + // 临时物料转为正式物料 + toBecomeOfficialPart () { + toBecomeOfficialPart(this.modalData).then(({data}) => { + if (data && data.code === 0) { + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + // 物料编码失去焦点事件 queryMasterField () { // 根据物料编码查 masterPart 属性 @@ -2991,8 +3316,8 @@ regionOfOrigin: '', regionOfOriginDesc: '', durabilityWeek: '', - customsStarNo: '', - customsStarDesc: '', + customsStatNo: '', + customsStatDesc: '', durabilityDay: '', intrastatConvFactor: '', umDesc: '', @@ -3096,8 +3421,8 @@ regionOfOrigin: row.regionOfOrigin, regionOfOriginDesc: row.regionOfOriginDesc, durabilityWeek: '', - customsStarNo: row.customsStarNo, - customsStarDesc: row.customsStarDesc, + customsStatNo: row.customsStatNo, + customsStatDesc: row.customsStatDesc, durabilityDay: row.durabilityDay, intrastatConvFactor: row.intrastatConvFactor, umDesc: row.umDesc, @@ -3134,7 +3459,8 @@ overReportTolerance: row.overReportTolerance, fixedLeadTimeHour: row.fixedLeadTimeHour, density: row.density, - variableLeadTimeHour: row.variableLeadTimeHour + variableLeadTimeHour: row.variableLeadTimeHour, + createDate: row.createDate } this.modalDisableFlag = true this.modalFlag = true @@ -3705,6 +4031,56 @@ }) }, + // 复制物料的模态框 + toCopyPartModal () { + this.copyPartData = { + site: this.modalData.site, + partNo: this.modalData.partNo, + partDesc: this.modalData.partDesc, + copyGeneral: 'Y', + copyCosts: '', + copyPlanningData: '', + copyManufacturing: '', + copyDefaultLocation: '', + previousVersion: this.modalData, + createBy: this.$store.state.user.name + } + this.copyPartModelFlag = true + }, + + // 复制物料的方法 + 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信息必选!') + return + } + copyPart(this.copyPartData).then(({data}) => { + if (data && data.code === 0) { + this.getDataList() + this.copyPartModelFlag = false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + + // ======== 列表操作方法 ======== /** * 单机选中物料信息 @@ -3880,7 +4256,7 @@ } else if (val === 128) { strVal = this.modalData.regionOfOrigin } else if (val === 129) { - strVal = this.modalData.customsStarNo + strVal = this.modalData.customsStatNo } else if (val === 131) { strVal = this.modalData.partCostGroupId } else if (val === 132) { @@ -3954,8 +4330,8 @@ this.modalData.regionOfOrigin = val.region_of_origin this.modalData.regionOfOriginDesc = val.region_of_origin_desc } else if (this.tagNo === 129) { - this.modalData.customsStarNo = val.customs_star_no - this.modalData.customsStarDesc = val.customs_star_desc + this.modalData.customsStatNo = val.customs_stat_no + this.modalData.customsStatDesc = val.customs_stat_desc } else if (this.tagNo === 131) { this.modalData.partCostGroupId = val.part_cost_group_id this.modalData.partCostGroupDesc = val.part_cost_group_desc @@ -4019,5 +4395,6 @@ -moz-appearance: textfield; padding-right: 5px !important; } + diff --git a/src/views/modules/part/routingManagement.vue b/src/views/modules/part/routingManagement.vue index 37ef3fe..506d1d8 100644 --- a/src/views/modules/part/routingManagement.vue +++ b/src/views/modules/part/routingManagement.vue @@ -108,7 +108,7 @@ - + - + - - 保存 + + 保存 + Copy @@ -148,6 +149,7 @@ 新增 删除 编辑 + Copy Buildable Obsolete @@ -262,6 +264,7 @@ width="100" label="操作"> @@ -517,6 +520,283 @@ + + +
+ Source Revision + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ Destination Revision + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + 保存 + 关闭 + +
+ + + +
+ Source Revision + + + + + + + + + + + + + + + + + + + + + + + + +
+
+ Destination Revision + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+ + 保存 + 关闭 + +
+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 新增 + 删除 + + + + + + + + + + + + + + + 关闭 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 保存 + 关闭 + + + @@ -547,8 +827,18 @@ import { queryOperationListByAlternative, // 根据替代查询工序列表 queryAlternativeListByPartNo, // 根据物料查询替代 routingToolEdit, // 编辑 routingTool - deleteRoutingTool // 删除 routingTool + deleteRoutingTool, // 删除 routingTool + copyRouting, // 复制routing + copyAlternative, // 复制alternative } from '@/api/part/routingManagement.js' +import { + routingSearchAlternative, // routing 替代列表查询 + getRoutingWorkGuideline, // 获取 workGuideline + getGuidelineSeq, // 获取 guidelineSeq + workGuidelineSave, // 新增 workGuideline + workGuidelineEdit, // 编辑 workGuideline + deleteWorkGuideline, // 删除 workGuideline +} from '@/api/part/routingOperationWorkGuidelines.js' import ChooseList from '@/views/modules/common/Chooselist' export default { @@ -735,6 +1025,69 @@ export default { createBy: '', updateBy: '' }, + copyRoutingData: { + site: '', + partNo: '', + routingRevision: '', + routingType: '', + phaseInDate: '', + phaseOutDate: '', + previousVersion: {}, + createBy: '' + }, + copyAlternativeData: { + site: '', + partNo: '', + routingRevision: '', + routingType: '', + alternativeNo: '', + alternativeDescription: '', + routTemplateId: '', + planDate: '', + fixedLeadTimeDay: '', + fixedLeadTimeHour: '', + variableLeadTimeDay: '', + variableLeadTimeHour: '', + forStdLotByDay: '', + forLotByDay: '', + minLotQty: '', + detailNoteText: '', + status: '', + previousVersion: {}, + createBy: '' + }, + workGuidelineData: { + site: this.$store.state.user.site, + partNo: '', + partDesc: '', + routingRevision: '', + routingType: '', + alternativeNo: '', + alternativeDescription: '', + operationNo: '', + operationName: '' + }, + saveWorkGuidelineData: { + flag: '', + id: '', + site: this.$store.state.user.site, + partNo: '', + partDesc: '', + routingRevision: '', + routingType: '', + alternativeNo: '', + alternativeDescription: '', + operationNo: '', + operationName: '', + guidelineSeq: '', + guidelineDesc: '', + guidelineText: '', + guidelineType: '', + signOffRequired: '', + inspectionSignOffRequired: '', + createBy: '', + updateBy: '' + }, // ======== 数据列表 ======== dataList: [], partList: [], @@ -746,6 +1099,7 @@ export default { checkedTool: [], routingToolList: [], alternativeList: [], + workGuidelineList: [], // ======== 列表表头 ======== columnList: [ { @@ -1371,39 +1725,259 @@ export default { { userId: this.$store.state.user.name, functionId: 104003, - serialNumber: '104003Table3ToolQty', - tableId: '104003Table3', - tableName: 'Routing工具表', - columnProp: 'toolQty', + serialNumber: '104003Table3ToolQty', + tableId: '104003Table3', + tableName: 'Routing工具表', + columnProp: 'toolQty', + headerAlign: 'center', + align: 'center', + columnLabel: '工具数量', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 60 + }, + { + userId: this.$store.state.user.name, + functionId: 104003, + serialNumber: '104003Table3Remark', + tableId: '104003Table3', + tableName: 'Routing工具表', + columnProp: 'remark', + headerAlign: 'center', + align: 'center', + columnLabel: '备注', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 150 + }, + ], + columnRoutingDetailList: [ + { + columnProp: 'alternativeNo', + headerAlign: "center", + align: "center", + columnLabel: '替代编码', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + }, + { + columnProp: 'alternativeDescription', + headerAlign: "center", + align: "center", + columnLabel: '替代名称', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + }, + { + columnProp: 'status', + headerAlign: "center", + align: "center", + columnLabel: '状态', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + }, + ], + workGuidelineColumnList: [ + { + userId: this.$store.state.user.name, + functionId: 104003, + serialNumber: '104003Table4GuidelineSeq', + tableId: '104003Table4', + tableName: 'workGuideline表', + columnProp: 'guidelineSeq', + headerAlign: 'center', + align: 'right', + columnLabel: '序号', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 60 + }, + { + userId: this.$store.state.user.name, + functionId: 104003, + serialNumber: '104003Table4GuidelineDesc', + tableId: '104003Table4', + tableName: 'workGuideline表', + columnProp: 'guidelineDesc', + headerAlign: 'center', + align: 'left', + columnLabel: '工艺指导名称', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 120 + }, + { + userId: this.$store.state.user.name, + functionId: 104003, + serialNumber: '104003Table4GuidelineText', + tableId: '104003Table4', + tableName: 'workGuideline表', + columnProp: 'guidelineText', + headerAlign: 'center', + align: 'left', + columnLabel: '工艺指导描述', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 200 + }, + { + userId: this.$store.state.user.name, + functionId: 104003, + serialNumber: '104003Table4GuidelineType', + tableId: '104003Table4', + tableName: 'workGuideline表', + columnProp: 'guidelineType', + headerAlign: 'center', + align: 'center', + columnLabel: '工艺指导类型', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 120 + }, + { + userId: this.$store.state.user.name, + functionId: 104003, + serialNumber: '104003Table4SignOffRequired', + tableId: '104003Table4', + tableName: 'workGuideline表', + columnProp: 'signOffRequired', + headerAlign: 'center', + align: 'center', + columnLabel: '签字', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 150 + }, + { + userId: this.$store.state.user.name, + functionId: 104003, + serialNumber: '104003Table4InspectionSignOffRequired', + tableId: '104003Table4', + tableName: 'workGuideline表', + columnProp: 'inspectionSignOffRequired', + headerAlign: 'center', + align: 'center', + columnLabel: '检验签字', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 150 + }, + { + userId: this.$store.state.user.name, + functionId: 104003, + serialNumber: '104003Table4CreateDate', + tableId: '104003Table4', + tableName: 'BOM信息表', + columnProp: 'createDate', + headerAlign: 'center', + align: 'center', + columnLabel: '创建时间', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 130 + }, + { + userId: this.$store.state.user.name, + functionId: 104003, + serialNumber: '104003Table4CreateBy', + tableId: '104003Table4', + tableName: 'BOM信息表', + columnProp: 'createBy', + headerAlign: 'center', + align: 'center', + columnLabel: '创建人', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 80 + }, + { + userId: this.$store.state.user.name, + functionId: 104003, + serialNumber: '104003Table4UpdateDate', + tableId: '104003Table4', + tableName: 'BOM信息表', + columnProp: 'updateDate', headerAlign: 'center', align: 'center', - columnLabel: '工具数量', + columnLabel: '更新时间', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 60 + columnWidth: 130 }, { userId: this.$store.state.user.name, functionId: 104003, - serialNumber: '104003Table3Remark', - tableId: '104003Table3', - tableName: 'Routing工具表', - columnProp: 'remark', + serialNumber: '104003Table4UpdateBy', + tableId: '104003Table4', + tableName: 'BOM信息表', + columnProp: 'updateBy', headerAlign: 'center', align: 'center', - columnLabel: '备注', + columnLabel: '更新人', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 150 - }, + columnWidth: 80 + } ], // ======== 必填规则 ======== rules: { @@ -1489,8 +2063,46 @@ export default { } ] }, + guidelineRules: { + guidelineSeq: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ], + guidelineDesc: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ], + guidelineType: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ], + signOffRequired: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ], + inspectionSignOffRequired: [ + { + required: true, + message: ' ', + trigger: 'change' + } + ] + }, // ======== 复选数据集 ======== routingSelections: [], + workGuidelineSelections: [], // ======== 模态框开关控制 ======== modalFlag: false, modalDisableFlag: false, @@ -1501,7 +2113,12 @@ export default { componentSaveModal: false, componentDisableFlag: false, saveRoutingToolModal: false, - saveRoutingToolDisableModal: false + saveRoutingToolDisableModal: false, + copyRoutingModelFlag: false, + copyAlternativeModelFlag: false, + queryWorkGuidelineModal: false, + saveWorkGuidelineModal: false, + workGuidelineDisableModal: false } }, @@ -1970,13 +2587,9 @@ export default { return } if (this.modalData.phaseInDate === '' || this.modalData.phaseInDate == null) { - this.$message.warning('请选择开始时间!') + this.$message.warning('请选择生效时间!') return } - // if (this.modalData.phaseOutDate === '' || this.modalData.phaseOutDate == null) { - // this.$message.warning('请选择结束时间!') - // return - // } if (this.modalData.routingRevision === '' || this.modalData.routingRevision == null) { this.$message.warning('请填写Routing版本号!') return @@ -2393,6 +3006,325 @@ export default { this.saveHeaderLoading = false }) }, + + /** + * 复制Routing的模态框 + */ + copyRoutingRevision () { + this.copyRoutingData = { + site: this.modalData.site, + partNo: this.modalData.partNo, + routingRevision: this.modalData.routingRevision + 1, + routingType: this.modalData.routingType, + phaseInDate: this.dayjs(new Date()).format('YYYY-MM-DD'), + phaseOutDate: '', + previousVersion: {}, + createBy: this.$store.state.user.name + } + this.copyRoutingModelFlag = true + }, + /** + * 复制Routing的方法 + */ + copyRouting () { + if (this.copyRoutingData.partNo === '' || this.copyRoutingData.partNo == null) { + this.$message.warning('请选择Routing物料!') + return + } + if (this.copyRoutingData.routingRevision === '' || this.copyRoutingData.routingRevision == null) { + this.$message.warning('请填写Routing版本号!') + return + } + if (this.copyRoutingData.routingType === '' || this.copyRoutingData.routingType == null) { + this.$message.warning('请选择工艺类型!') + return + } + this.copyRoutingData.previousVersion = this.modalData + // 新增主表信息 + copyRouting(this.copyRoutingData).then(({data}) => { + if (data && data.code === 0) { + this.copyRoutingModelFlag = false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + /** + * 复制alternative的模态框 + */ + copyRoutingAlternative () { + this.copyAlternativeData = { + site: this.detailData.site, + partNo: this.detailData.partNo, + routingRevision: this.detailData.routingRevision, + routingType: this.detailData.routingType, + alternativeNo: this.detailData.alternativeNo, + alternativeDescription: this.detailData.alternativeDescription, + routTemplateId: '', + planDate: '', + fixedLeadTimeDay: '', + fixedLeadTimeHour: '', + variableLeadTimeDay: '', + variableLeadTimeHour: '', + forStdLotByDay: '', + forLotByDay: '', + minLotQty: '', + detailNoteText: '', + status: 'Tentative', + previousVersion: {}, + createBy: this.$store.state.user.name + } + this.copyAlternativeModelFlag = true + }, + + /** + * 工艺指导模态框 + */ + workGuidelineModal (row) { + this.workGuidelineData = { + site: this.modalData.site, + partNo: this.modalData.partNo, + partDesc: this.modalData.partDesc, + routingRevision: this.modalData.routingRevision, + routingType: this.modalData.routingType, + alternativeNo: this.detailData.alternativeNo, + alternativeDescription: this.detailData.alternativeDescription, + operationNo: row.operationNo, + operationName: row.operationName + } + this.getRoutingWorkGuideline() + this.queryWorkGuidelineModal = true + }, + /** + * 获取 workGuideline + */ + getRoutingWorkGuideline () { + getRoutingWorkGuideline(this.workGuidelineData).then(({data}) => { + if (data && data.code === 0) { + this.workGuidelineList = data.rows + } else { + this.workGuidelineList = [] + } + }) + }, + /** + * 复选列表信息 + * @param val + */ + selectionWorkGuideline (val) { + this.workGuidelineSelections = val + }, + /** + * workGuideline 新增模态框 + */ + saveWorkGuideline () { + this.saveWorkGuidelineData = { + flag: '1', + id: '', + site: this.workGuidelineData.site, + partNo: this.workGuidelineData.partNo, + partDesc: this.workGuidelineData.partDesc, + routingRevision: this.workGuidelineData.routingRevision, + routingType: this.workGuidelineData.routingType, + alternativeNo: this.workGuidelineData.alternativeNo, + alternativeDescription: this.workGuidelineData.alternativeDescription, + operationNo: this.workGuidelineData.operationNo, + operationName: this.workGuidelineData.operationName, + guidelineSeq: '', + guidelineDesc: '', + guidelineText: '', + guidelineType: 'Instruction', + signOffRequired: 'Not Required', + inspectionSignOffRequired: 'Not Required', + createBy: this.$store.state.user.name, + updateBy: '' + } + // 查询seq + getGuidelineSeq(this.workGuidelineData).then(({data}) => { + if (data && data.code === 0) { + this.saveWorkGuidelineData.guidelineSeq = data.guidelineSeq + } + }) + // 开启模态框 + this.saveWorkGuidelineModal = true + this.workGuidelineDisableModal = false + }, + /** + * workGuideline 编辑模态框 + */ + updateWorkGuidelineModal (row) { + this.saveWorkGuidelineData = { + flag: '2', + id: row.id, + site: row.site, + partNo: row.partNo, + partDesc: row.partDesc, + routingRevision: row.routingRevision, + routingType: row.routingType, + alternativeNo: row.alternativeNo, + alternativeDescription: row.alternativeDescription, + operationNo: row.operationNo, + operationName: row.operationName, + guidelineSeq: row.guidelineSeq, + guidelineDesc: row.guidelineDesc, + guidelineText: row.guidelineText, + guidelineType: row.guidelineType, + signOffRequired: row.signOffRequired, + inspectionSignOffRequired: row.inspectionSignOffRequired, + createBy: '', + updateBy: this.$store.state.user.name + } + // 开启模态框 + this.saveWorkGuidelineModal = true + this.workGuidelineDisableModal = true + }, + /** + * workGuideline 新增方法 + */ + workGuidelineCommit () { + if (this.saveWorkGuidelineData.guidelineSeq === '' || this.saveWorkGuidelineData.guidelineSeq == null) { + this.$message.warning('请输入序号!') + return + } + if (this.saveWorkGuidelineData.guidelineDesc === '' || this.saveWorkGuidelineData.guidelineDesc == null) { + this.$message.warning('请输入工艺指导名称!') + return + } + if (this.saveWorkGuidelineData.guidelineType === '' || this.saveWorkGuidelineData.guidelineType == null) { + this.$message.warning('请选择工艺指导类型!') + return + } + if (this.saveWorkGuidelineData.signOffRequired === '' || this.saveWorkGuidelineData.signOffRequired == null) { + this.$message.warning('请选择签字!') + return + } + if (this.saveWorkGuidelineData.inspectionSignOffRequired === '' || this.saveWorkGuidelineData.inspectionSignOffRequired == null) { + this.$message.warning('请选择检验签字!') + return + } + if (this.saveWorkGuidelineData.flag === '1') { + workGuidelineSave(this.saveWorkGuidelineData).then(({data}) => { + if (data && data.code === 0) { + this.getRoutingWorkGuideline() + this.saveWorkGuidelineModal = false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + } else { + workGuidelineEdit(this.saveWorkGuidelineData).then(({data}) => { + if (data && data.code === 0) { + this.getRoutingWorkGuideline() + this.saveWorkGuidelineModal = false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + } + }, + /** + * 删除 workGuideline + */ + deleteModal () { + if(this.workGuidelineSelections.length === 0){ + this.$message.warning('请勾选要删除的工艺指导!') + return + } + this.$confirm(`是否删除这 `+ this.workGuidelineSelections.length +` 条工艺指导?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + let tempData = { + informationList: this.workGuidelineSelections + } + deleteWorkGuideline(tempData).then(({data}) => { + if (data && data.code === 0) { + this.getRoutingWorkGuideline() + this.workGuidelineSelections = [] + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }).catch(() => { + }) + }, + + + /** + * 复制alternative的方法 + */ + copyAlternative () { + if (this.copyAlternativeData.partNo === '' || this.copyAlternativeData.partNo == null) { + this.$message.warning('请选择Routing物料!') + return + } + if (this.copyAlternativeData.routingRevision === '' || this.copyAlternativeData.routingRevision == null) { + this.$message.warning('请填写Routing版本号!') + return + } + if (this.copyAlternativeData.routingType === '' || this.copyAlternativeData.routingType == null) { + this.$message.warning('请选择工艺类型!') + return + } + if (this.copyAlternativeData.alternativeNo === '' || this.copyAlternativeData.alternativeNo == null) { + this.$message.warning('请填写替代编码!') + return + } + if (this.copyAlternativeData.alternativeDescription === '' || this.copyAlternativeData.alternativeDescription == null) { + this.$message.warning('请填写替代名称!') + return + } + this.copyAlternativeData.previousVersion = this.detailData + copyAlternative(this.copyAlternativeData).then(({data}) => { + if (data && data.code === 0) { + this.copyAlternativeModelFlag = false + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + /** * 新增替代方法 */ @@ -2804,6 +3736,9 @@ export default {