From 405199ad6829b8482f3ba82fa108765d6f18255f Mon Sep 17 00:00:00 2001 From: fengyuan_yang <1976974459@qq.com> Date: Thu, 30 Nov 2023 17:58:57 +0800 Subject: [PATCH] 2023-11-30 --- src/api/part/routingManagement.js | 7 + src/views/modules/part/bomManagement.vue | 194 ++++- src/views/modules/part/routingManagement.vue | 727 ++++++++++++------- 3 files changed, 658 insertions(+), 270 deletions(-) diff --git a/src/api/part/routingManagement.js b/src/api/part/routingManagement.js index e1aa96a..add3d68 100644 --- a/src/api/part/routingManagement.js +++ b/src/api/part/routingManagement.js @@ -98,5 +98,12 @@ export const updateRoutingComponent = data => createAPI(`/plm/routingManagement/ */ export const deleteRoutingComponent = data => createAPI(`/plm/routingManagement/deleteRoutingComponent`,'post',data) +/** + * 查询工序列表 + * @param data + * @returns {*} + */ +export const queryOperationList = data => createAPI(`/plm/routingManagement/queryOperationList`,'post',data) + diff --git a/src/views/modules/part/bomManagement.vue b/src/views/modules/part/bomManagement.vue index 379afa6..ed6be04 100644 --- a/src/views/modules/part/bomManagement.vue +++ b/src/views/modules/part/bomManagement.vue @@ -9,7 +9,7 @@ - 查询 + 查询 新增 删除 - + 物料编码 @@ -107,8 +106,8 @@ - - 保存 + + @@ -140,8 +139,8 @@ - - + + 保存 @@ -197,7 +196,6 @@ height="256px" border ref="componentTable" - v-loading="dataListLoading" @row-click="componentClickRow" :row-class-name="rowClassName" @selection-change="componentSelectionChange" @@ -232,7 +230,7 @@ - 保存 + 保存 关闭 @@ -256,7 +254,7 @@ - 保存 + 保存 关闭 @@ -280,7 +278,6 @@ :data="partList" @row-dblclick="getRowData" border - v-loading="dataListLoading" style="width: 100%;"> - 保存 + 保存 关闭 @@ -472,8 +468,12 @@ export default { page: 1, limit: 10 }, - // 其它 - dataListLoading: false, + // loading + queryLoading: false, + saveHeaderLoading: false, + saveDetailLoading: false, + saveComponentLoading: false, + saveAllLoading: false, // 初始页签 detailTable: 'bom_detail', subDetailTable: 'bom_sub_detail', @@ -609,6 +609,114 @@ export default { fixed: '', columnWidth: 120 }, + { + userId: this.$store.state.user.name, + functionId: 104002, + serialNumber: '104002Table1BomType', + tableId: '104002Table1', + tableName: 'BOM信息表', + columnProp: 'bomType', + 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: 104002, + serialNumber: '104002Table1EngChgLevel', + tableId: '104002Table1', + tableName: 'BOM信息表', + columnProp: 'engChgLevel', + headerAlign: 'center', + align: 'center', + columnLabel: 'BOM版本号', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 120 + }, + { + userId: this.$store.state.user.name, + functionId: 104002, + serialNumber: '104002Table1engRevision', + tableId: '104002Table1', + tableName: 'BOM信息表', + columnProp: 'engRevision', + 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: 104002, + serialNumber: '104002Table1NetWeight', + tableId: '104002Table1', + tableName: 'BOM信息表', + columnProp: 'netWeight', + headerAlign: 'center', + align: 'right', + columnLabel: '净重', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 80 + }, + { + userId: this.$store.state.user.name, + functionId: 104002, + serialNumber: '104002Table1EffPhaseInDate', + tableId: '104002Table1', + tableName: 'BOM信息表', + columnProp: 'effPhaseInDate', + 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: 104002, + serialNumber: '104002Table1EffPhaseOutDate', + tableId: '104002Table1', + tableName: 'BOM信息表', + columnProp: 'effPhaseOutDate', + 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: 104002, @@ -625,7 +733,7 @@ export default { sortLv: 0, status: true, fixed: '', - columnWidth: 160 + columnWidth: 130 }, { userId: this.$store.state.user.name, @@ -661,7 +769,7 @@ export default { sortLv: 0, status: true, fixed: '', - columnWidth: 160 + columnWidth: 130 }, { userId: this.$store.state.user.name, @@ -1133,6 +1241,7 @@ export default { getDataList () { this.searchData.limit = this.pageSize this.searchData.page = this.pageIndex + this.queryLoading = true bomManagementSearch(this.searchData).then(({data}) => { if (data.code === 0) { this.dataList = data.page.list @@ -1141,7 +1250,7 @@ export default { this.totalPage = data.page.totalCount this.$refs.selectDiv.setLengthAll( this.dataList.length) } - this.dataListLoading = false + this.queryLoading = false }) }, /** @@ -1348,6 +1457,7 @@ export default { informationList: this.subDetailList } if (this.modalData.flag === '1') { + this.saveAllLoading = true bomManagementSave(tempData).then(({data}) => { if (data && data.code === 0) { this.getDataList() @@ -1363,8 +1473,10 @@ export default { confirmButtonText: '确定' }) } + this.saveAllLoading = false }) } else { + this.saveAllLoading = true bomManagementEdit(tempData).then(({data}) => { if (data && data.code === 0) { this.getDataList() @@ -1380,6 +1492,7 @@ export default { confirmButtonText: '确定' }) } + this.saveAllLoading = false }) } }, @@ -1420,6 +1533,43 @@ export default { this.modalFlag = false } }, + /** + * 新增编辑模态框关闭 + */ + closeModalX (done) { + let tempArr = [] + tempArr.push(this.modalData) + if (this.modalData.flag === '1') { + this.$confirm(`是否不保存且删除该条BOM记录?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + let tempData = { + informationList: tempArr + } + bomManagementDelete(tempData).then(({data}) => { + if (data && data.code === 0) { + this.getDataList() + done() + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }).catch(() => { + }) + } else { + done() + } + }, /** * bom删除 */ @@ -1612,6 +1762,7 @@ export default { return } if (this.componentData.flag === '1') { + this.saveComponentLoading = true saveBomComponent(this.componentData).then(({data}) => { if (data && data.code === 0) { this.subDetailList = data.rows @@ -1627,8 +1778,10 @@ export default { confirmButtonText: '确定' }) } + this.saveComponentLoading = false }) } else if (this.componentData.flag === '2') { + this.saveComponentLoading = true updateBomComponent(this.componentData).then(({data}) => { if (data && data.code === 0) { this.subDetailList = data.rows @@ -1644,6 +1797,7 @@ export default { confirmButtonText: '确定' }) } + this.saveComponentLoading = false }) } }, @@ -1681,6 +1835,7 @@ export default { this.$message.warning('请先选择类型!') return } + this.saveHeaderLoading = true // 新增主表信息 saveBomHeader(this.modalData).then(({data}) => { if (data && data.code === 0) { @@ -1714,6 +1869,7 @@ export default { confirmButtonText: '确定' }) } + this.saveHeaderLoading = false }) }, /** @@ -1788,6 +1944,7 @@ export default { this.$message.warning('请填写最小订单数!') return } + this.saveDetailLoading = true bomDetailSave(this.saveDetailData).then(({data}) => { if (data && data.code === 0) { this.detailDataList = data.rows @@ -1805,6 +1962,7 @@ export default { confirmButtonText: '确定' }) } + this.saveDetailLoading = false }) }, /** diff --git a/src/views/modules/part/routingManagement.vue b/src/views/modules/part/routingManagement.vue index 23e1205..6526a16 100644 --- a/src/views/modules/part/routingManagement.vue +++ b/src/views/modules/part/routingManagement.vue @@ -9,7 +9,7 @@ - 查询 + 查询 新增 删除 - + 物料编码 @@ -101,9 +100,6 @@ - - 保存 - @@ -131,6 +127,9 @@ + + 保存 + @@ -182,7 +181,6 @@ height="256px" border ref="componentTable" - v-loading="dataListLoading" @row-click="componentClickRow" :row-class-name="rowClassName" @selection-change="componentSelectionChange" @@ -217,8 +215,8 @@ - 保存 - 关闭 + 保存 + 关闭 @@ -231,9 +229,6 @@ - - - @@ -241,7 +236,7 @@ - 保存 + 保存 关闭 @@ -265,7 +260,6 @@ :data="partList" @row-dblclick="getRowData" border - v-loading="dataListLoading" style="width: 100%;"> - - - - - + + + + + - - + + - 查询 + 查询 - + - - 子物料编码 - 子物料编码 - + + 工序号 + 工序号 + - - + + - - + + - - - - - - - - - + + 加工中心 + + + + + + + + + + + + + + + + + + + - - 工序 - + + - - 发料库位 - + + - - - + + + - - + + - - + + + + + + + + + + + + 人员等级 + + + + 调机时的人员等级 + @@ -382,7 +400,7 @@ - 保存 + 保存 关闭 @@ -408,6 +426,7 @@ import { saveRoutingComponent, // 新增routing子明细 updateRoutingComponent, // 修改routing子明细 deleteRoutingComponent, // 删除routing子明细 + queryOperationList, // 查询工序列表 } from '@/api/part/routingManagement.js' import ChooseList from '@/views/modules/common/Chooselist' @@ -455,8 +474,12 @@ export default { page: 1, limit: 10 }, - // 其它 - dataListLoading: false, + // loading + queryLoading: false, + saveHeaderLoading: false, + saveDetailLoading: false, + saveComponentLoading: false, + saveAllLoading: false, // 初始页签 detailTable: 'routing_detail', subDetailTable: 'routing_sub_detail', @@ -503,22 +526,29 @@ export default { flag: '', site: this.$store.state.user.site, partNo: '', - engChgLevel: '', + routingRevision: '', routingType: '', alternativeNo: '', - componentPart: '', - componentPartDesc: '', - printUnit: '', - printUnitName: '', - qtyPerAssembly: '', - componentScrap: '', - issueType: '', - shrinkageFactor: '', - lineItemNo: '', + operationId: '', operationNo: '', operationName: '', - issueToLoc: '', - issueToLocName: '', + efficiencyFactor: '', + machRunFactor: '', + machSetupTime: '', + runTimeCode: '', + laborRunFactor: '', + laborSetupTime: '', + crewSize: '', + setupCrewSize: '', + outsideOpItem: '', + machineNo: '', + workCenterNo: '', + workCenterDesc: '', + laborClassNo: '', + laborClassDesc: '', + setupLaborClassNo: '', + setupLaborClassDesc: '', + overlap: '', noteText: '', createDate: '', createBy: '', @@ -530,20 +560,27 @@ export default { partNo: '', partDesc: '', }, - componentPartData: { + operationData: { site: this.$store.state.user.site, - partNo: '', - partDesc: '', + operationId: '', + operationName: '', }, saveDetailData: { site: this.$store.state.user.site, partNo: '', - engChgLevel: '', + routingRevision: '', routingType: '', alternativeNo: '', alternativeDescription: '', + routTemplateId: '', + planDate: '', + fixedLeadTimeDay: '', + fixedLeadTimeHour: '', + variableLeadTimeDay: '', + variableLeadTimeHour: '', + forStdLotByDay: '', + forLotByDay: '', minLotQty: '', - defaultFlag: '', detailNoteText: '', createDate: '', createBy: '', @@ -553,7 +590,7 @@ export default { // ======== 数据列表 ======== dataList: [], partList: [], - componentPartList: [], + operationList: [], componentPartSelections: [], subDetailList: [], detailDataList: [], @@ -596,6 +633,42 @@ export default { fixed: '', columnWidth: 120 }, + { + userId: this.$store.state.user.name, + functionId: 104003, + serialNumber: '104003Table1RoutingType', + tableId: '104003Table1', + tableName: 'Routing信息表', + columnProp: 'routingType', + 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: '104003Table1RoutingRevision', + tableId: '104003Table1', + tableName: 'Routing信息表', + columnProp: 'routingRevision', + headerAlign: 'center', + align: 'center', + columnLabel: 'Routing版本号', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 120 + }, { userId: this.$store.state.user.name, functionId: 104003, @@ -695,12 +768,12 @@ export default { fixed: '', }, ], - componentPartColumnList: [ + componentOperationColumnList: [ { - columnProp: 'partNo', + columnProp: 'operationId', headerAlign: "center", align: "center", - columnLabel: '物料编码', + columnLabel: '工序号', columnHidden: false, columnImage: false, columnSortable: false, @@ -709,10 +782,10 @@ export default { fixed: '', }, { - columnProp: 'partDesc', + columnProp: 'operationName', headerAlign: "center", align: "center", - columnLabel: '物料名称', + columnLabel: '工序名称', columnHidden: false, columnImage: false, columnSortable: false, @@ -725,31 +798,49 @@ export default { { userId: this.$store.state.user.name, functionId: 104003, - serialNumber: '104003Table2ComponentPart', + serialNumber: '104003Table2OperationId', tableId: '104003Table2', - tableName: 'BOM子物料表', - columnProp: 'componentPart', + tableName: 'Routing工序表', + columnProp: 'operationId', headerAlign: 'center', align: 'center', - columnLabel: '物料编码', + columnLabel: '工序号', columnHidden: false, columnImage: false, columnSortable: false, sortLv: 0, status: true, fixed: '', - columnWidth: 120 + columnWidth: 80 + }, + { + userId: this.$store.state.user.name, + functionId: 104003, + serialNumber: '104003Table2OperationNo', + tableId: '104003Table2', + tableName: 'Routing工序表', + columnProp: 'operationNo', + 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: '104003Table2ComponentPartDesc', + serialNumber: '104003Table2OperationName', tableId: '104003Table2', - tableName: 'BOM子物料表', - columnProp: 'componentPartDesc', + tableName: 'Routing工序表', + columnProp: 'operationName', headerAlign: 'center', align: 'left', - columnLabel: '物料名称', + columnLabel: '工序名称', columnHidden: false, columnImage: false, columnSortable: false, @@ -761,13 +852,13 @@ export default { { userId: this.$store.state.user.name, functionId: 104003, - serialNumber: '104003Table2QtyPerAssembly', + serialNumber: '104003Table2EfficiencyFactor', tableId: '104003Table2', - tableName: 'BOM子物料表', - columnProp: 'qtyPerAssembly', + tableName: 'Routing工序表', + columnProp: 'efficiencyFactor', headerAlign: 'center', align: 'right', - columnLabel: '单位用量', + columnLabel: '机器效率', columnHidden: false, columnImage: false, columnSortable: false, @@ -779,13 +870,13 @@ export default { { userId: this.$store.state.user.name, functionId: 104003, - serialNumber: '104003Table2ComponentScrap', + serialNumber: '104003Table2MachRunFactor', tableId: '104003Table2', - tableName: 'BOM子物料表', - columnProp: 'componentScrap', + tableName: 'Routing工序表', + columnProp: 'machRunFactor', headerAlign: 'center', align: 'right', - columnLabel: '调机量', + columnLabel: '机器运行速度', columnHidden: false, columnImage: false, columnSortable: false, @@ -797,13 +888,13 @@ export default { { userId: this.$store.state.user.name, functionId: 104003, - serialNumber: '104003Table2ShrinkageFactor', + serialNumber: '104003Table2MachSetupTime', tableId: '104003Table2', - tableName: 'BOM子物料表', - columnProp: 'shrinkageFactor', + tableName: 'Routing工序表', + columnProp: 'machSetupTime', headerAlign: 'center', align: 'right', - columnLabel: '损耗率', + columnLabel: '调机时长', columnHidden: false, columnImage: false, columnSortable: false, @@ -815,13 +906,13 @@ export default { { userId: this.$store.state.user.name, functionId: 104003, - serialNumber: '104003Table2PrintUnitName', + serialNumber: '104003Table2RunTimeCode', tableId: '104003Table2', - tableName: 'BOM子物料表', - columnProp: 'printUnitName', + tableName: 'Routing工序表', + columnProp: 'runTimeCode', headerAlign: 'center', align: 'center', - columnLabel: '单位', + columnLabel: '时长单位', columnHidden: false, columnImage: false, columnSortable: false, @@ -833,13 +924,103 @@ export default { { userId: this.$store.state.user.name, functionId: 104003, - serialNumber: '104003Table2IssueType', + serialNumber: '104003Table2LaborRunFactor', + tableId: '104003Table2', + tableName: 'Routing工序表', + columnProp: 'laborRunFactor', + headerAlign: 'center', + align: 'right', + columnLabel: '人工效率', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 80 + }, + { + userId: this.$store.state.user.name, + functionId: 104003, + serialNumber: '104003Table2LaborSetupTime', + tableId: '104003Table2', + tableName: 'Routing工序表', + columnProp: 'laborSetupTime', + headerAlign: 'center', + align: 'right', + columnLabel: '人工生产速度', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 80 + }, + { + userId: this.$store.state.user.name, + functionId: 104003, + serialNumber: '104003Table2CrewSize', + tableId: '104003Table2', + tableName: 'Routing工序表', + columnProp: 'crewSize', + headerAlign: 'center', + align: 'right', + columnLabel: '生产过程人数', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 80 + }, + { + userId: this.$store.state.user.name, + functionId: 104003, + serialNumber: '104003Table2SetupCrewSize', + tableId: '104003Table2', + tableName: 'Routing工序表', + columnProp: 'setupCrewSize', + headerAlign: 'center', + align: 'right', + columnLabel: '调机过程人数', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 80 + }, + { + userId: this.$store.state.user.name, + functionId: 104003, + serialNumber: '104003Table2OutsideOpItem', + tableId: '104003Table2', + tableName: 'Routing工序表', + columnProp: 'outsideOpItem', + 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: '104003Table2MachineNo', tableId: '104003Table2', - tableName: 'BOM子物料表', - columnProp: 'issueTypeName', + tableName: 'Routing工序表', + columnProp: 'machineNo', headerAlign: 'center', align: 'center', - columnLabel: '生产属性', + columnLabel: '机台', columnHidden: false, columnImage: false, columnSortable: false, @@ -851,13 +1032,31 @@ export default { { userId: this.$store.state.user.name, functionId: 104003, - serialNumber: '104003Table2OperationDesc', + serialNumber: '104003Table2WorkCenterDesc', tableId: '104003Table2', - tableName: 'BOM子物料表', - columnProp: 'operationNo', + tableName: 'Routing工序表', + columnProp: 'workCenterDesc', headerAlign: 'center', - align: 'left', - columnLabel: '工序', + 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: '104003Table2LaborClassNo', + tableId: '104003Table2', + tableName: 'Routing工序表', + columnProp: 'laborClassDesc', + headerAlign: 'center', + align: 'center', + columnLabel: '人员等级', columnHidden: false, columnImage: false, columnSortable: false, @@ -869,13 +1068,13 @@ export default { { userId: this.$store.state.user.name, functionId: 104003, - serialNumber: '104003Table2IssueToLoc', + serialNumber: '104003Table2SetupLaborClassDesc', tableId: '104003Table2', - tableName: 'BOM子物料表', - columnProp: 'issueToLocName', + tableName: 'Routing工序表', + columnProp: 'setupLaborClassDesc', headerAlign: 'center', align: 'center', - columnLabel: '发料库位', + columnLabel: '调机时人员等级', columnHidden: false, columnImage: false, columnSortable: false, @@ -889,7 +1088,7 @@ export default { functionId: 104003, serialNumber: '104003Table2NoteText', tableId: '104003Table2', - tableName: 'BOM子物料表', + tableName: 'Routing工序表', columnProp: 'componentNoteText', headerAlign: 'center', align: 'left', @@ -926,21 +1125,21 @@ export default { trigger: 'change' } ], - effPhaseInDate: [ + phaseInDate: [ { required: true, message: ' ', trigger: 'change' } ], - effPhaseOutDate: [ + phaseOutDate: [ { required: true, message: ' ', trigger: 'change' } ], - engChgLevel: [ + routingRevision: [ { required: true, message: ' ', @@ -954,13 +1153,6 @@ export default { trigger: 'change' } ], - typeFlag: [ - { - required: true, - message: ' ', - trigger: 'change' - } - ] }, detailRules: { alternativeNo: [ @@ -976,52 +1168,24 @@ export default { message: ' ', trigger: 'change' } - ], - minLotQty: [ - { - required: true, - message: ' ', - trigger: 'change' - } - ], + ] }, componentRules: { - componentPart: [ - { - required: true, - message: ' ', - trigger: 'change' - } - ], - componentPartDesc: [ - { - required: true, - message: ' ', - trigger: 'change' - } - ], - qtyPerAssembly: [ + operationId: [ { required: true, message: ' ', trigger: 'change' } ], - componentScrap: [ + operationName: [ { required: true, message: ' ', trigger: 'change' } ], - shrinkageFactor: [ - { - required: true, - message: ' ', - trigger: 'change' - } - ], - issueType: [ + operationNo: [ { required: true, message: ' ', @@ -1120,6 +1284,7 @@ export default { getDataList () { this.searchData.limit = this.pageSize this.searchData.page = this.pageIndex + this.queryLoading = true routingManagementSearch(this.searchData).then(({data}) => { if (data.code === 0) { this.dataList = data.page.list @@ -1128,7 +1293,7 @@ export default { this.totalPage = data.page.totalCount this.$refs.selectDiv.setLengthAll( this.dataList.length) } - this.dataListLoading = false + this.queryLoading = false }) }, /** @@ -1190,11 +1355,11 @@ export default { site: row.site, partNo: row.partNo, partDesc: row.partDesc, - engChgLevel: row.engChgLevel, + routingRevision: row.routingRevision, routingType: row.routingType, noteText: row.noteText, - effPhaseInDate: row.effPhaseInDate, - effPhaseOutDate: row.effPhaseOutDate, + phaseInDate: row.phaseInDate, + phaseOutDate: row.phaseOutDate, engRevision: row.engRevision, typeFlag: row.typeFlag, netWeight: row.netWeight, @@ -1216,7 +1381,7 @@ export default { }) }, /** - * 新增子明细 + * 新增子明细模态框 */ saveComponentModal () { if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) { @@ -1227,22 +1392,29 @@ export default { flag: '1', site: this.$store.state.user.site, partNo: this.modalData.partNo, - engChgLevel: this.modalData.engChgLevel, + routingRevision: this.modalData.routingRevision, routingType: this.modalData.routingType, alternativeNo: this.detailData.alternativeNo, - componentPart: '', - componentPartDesc: '', - printUnit: '', - printUnitName: '', - qtyPerAssembly: '', - componentScrap: '', - issueType: '', - shrinkageFactor: '', - lineItemNo: '', + operationId: '', operationNo: '', operationName: '', - issueToLoc: '', - issueToLocName: '', + efficiencyFactor: '', + machRunFactor: '', + machSetupTime: '', + runTimeCode: '', + laborRunFactor: '', + laborSetupTime: '', + crewSize: '', + setupCrewSize: '', + outsideOpItem: '', + machineNo: '', + workCenterNo: '', + workCenterDesc: '', + laborClassNo: '', + laborClassDesc: '', + setupLaborClassNo: '', + setupLaborClassDesc: '', + overlap: '', noteText: '', createBy: this.$store.state.user.name, } @@ -1257,22 +1429,29 @@ export default { flag: '2', site: row.site, partNo: row.partNo, - engChgLevel: row.engChgLevel, + routingRevision: row.routingRevision, routingType: row.routingType, alternativeNo: row.alternativeNo, - componentPart: row.componentPart, - componentPartDesc: row.componentPartDesc, - printUnit: row.printUnit, - printUnitName: row.printUnitName, - qtyPerAssembly: row.qtyPerAssembly, - componentScrap: row.componentScrap, - issueType: row.issueType, - shrinkageFactor: row.shrinkageFactor, - lineItemNo: row.lineItemNo, + operationId: row.operationId, operationNo: row.operationNo, operationName: row.operationName, - issueToLoc: row.issueToLoc, - issueToLocName: row.issueToLocName, + efficiencyFactor: row.efficiencyFactor, + machRunFactor: row.machRunFactor, + machSetupTime: row.machSetupTime, + runTimeCode: row.runTimeCode, + laborRunFactor: row.laborRunFactor, + laborSetupTime: row.laborSetupTime, + crewSize: row.crewSize, + setupCrewSize: row.setupCrewSize, + outsideOpItem: row.outsideOpItem, + machineNo: row.machineNo, + workCenterNo: row.workCenterNo, + workCenterDesc: row.workCenterDesc, + laborClassNo: row.laborClassNo, + laborClassDesc: row.laborClassDesc, + setupLaborClassNo: row.setupLaborClassNo, + setupLaborClassDesc: row.setupLaborClassDesc, + overlap: row.overlap, noteText: row.noteText, updateBy: this.$store.state.user.name, } @@ -1298,15 +1477,15 @@ export default { this.$message.warning('请选择制造类型!') return } - if (this.modalData.effPhaseInDate === '' || this.modalData.effPhaseInDate == null) { + if (this.modalData.phaseInDate === '' || this.modalData.phaseInDate == null) { this.$message.warning('请选择开始时间!') return } - if (this.modalData.effPhaseOutDate === '' || this.modalData.effPhaseOutDate == null) { + if (this.modalData.phaseOutDate === '' || this.modalData.phaseOutDate == null) { this.$message.warning('请选择结束时间!') return } - if (this.modalData.engChgLevel === '' || this.modalData.engChgLevel == null) { + if (this.modalData.routingRevision === '' || this.modalData.routingRevision == null) { this.$message.warning('请填写BOM版本号!') return } @@ -1318,24 +1497,20 @@ export default { site: this.$store.state.user.site, partNo: this.modalData.partNo, partDesc: this.modalData.partDesc, - engChgLevel: this.modalData.engChgLevel, + routingRevision: this.modalData.routingRevision, routingType: this.modalData.routingType, noteText: this.modalData.noteText, - effPhaseInDate: this.modalData.effPhaseInDate, - effPhaseOutDate: this.modalData.effPhaseOutDate, - engRevision: this.modalData.engRevision, - typeFlag: this.modalData.typeFlag, - netWeight: this.modalData.netWeight, + phaseInDate: this.modalData.phaseInDate, + phaseOutDate: this.modalData.phaseOutDate, alternativeNo: this.detailData.alternativeNo, alternativeDescription: this.detailData.alternativeDescription, - minLotQty: this.detailData.minLotQty, - defaultFlag: this.detailData.defaultFlag, detailNoteText: this.detailData.detailNoteText, createBy: this.$store.state.user.name, updateBy: this.$store.state.user.name, informationList: this.subDetailList } if (this.modalData.flag === '1') { + this.saveAllLoading = true routingManagementSave(tempData).then(({data}) => { if (data && data.code === 0) { this.getDataList() @@ -1351,8 +1526,10 @@ export default { confirmButtonText: '确定' }) } + this.saveAllLoading = false }) } else { + this.saveAllLoading = true routingManagementEdit(tempData).then(({data}) => { if (data && data.code === 0) { this.getDataList() @@ -1368,6 +1545,7 @@ export default { confirmButtonText: '确定' }) } + this.saveAllLoading = false }) } }, @@ -1408,6 +1586,43 @@ export default { this.modalFlag = false } }, + /** + * 新增编辑模态框关闭 + */ + closeModalX (done) { + let tempArr = [] + tempArr.push(this.modalData) + if (this.modalData.flag === '1') { + this.$confirm(`是否不保存且删除该条BOM记录?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + let tempData = { + informationList: tempArr + } + routingManagementDelete(tempData).then(({data}) => { + if (data && data.code === 0) { + this.getDataList() + done() + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }).catch(() => { + }) + } else { + done() + } + }, /** * routing删除 */ @@ -1468,18 +1683,18 @@ export default { this.partModelFlag = false }, getComponentRowData (row) { - this.componentData.componentPart = row.partNo - this.componentData.componentPartDesc = row.partDesc + this.componentData.operationId = row.operationId + this.componentData.operationName = row.operationName this.componentPartModelFlag = false }, /** - * 物料列表 + * 工序列表 */ - queryComponentPartList () { - // 查询所有物料 - queryPartList(this.componentPartData).then(({data}) => { + queryOperationList () { + // 查询所有工序 + queryOperationList(this.operationData).then(({data}) => { if (data && data.code === 0) { - this.componentPartList = data.rows + this.operationList = data.rows this.componentPartModelFlag = true } else { this.$alert(data.msg, '错误', { @@ -1568,38 +1783,23 @@ export default { return } if (this.componentData.routingType === '' || this.componentData.routingType == null) { - this.$message.warning('请选择主记录制造类型!') + this.$message.warning('请选择主记录工艺类型!') return } - if (this.componentData.engChgLevel === '' || this.componentData.engChgLevel == null) { - this.$message.warning('请填写主记录BOM版本号!') + if (this.componentData.routingRevision === '' || this.componentData.routingRevision == null) { + this.$message.warning('请填写主记录Routing版本号!') return } - if (this.componentData.componentPart === '' || this.componentData.componentPart == null) { - this.$message.warning('请选择子物料编码!') + if (this.componentData.operationId === '' || this.componentData.operationId == null) { + this.$message.warning('请选择工序号!') return } - if (this.componentData.componentPartDesc === '' || this.componentData.componentPartDesc == null) { - this.$message.warning('请选择子物料名称!') - return - } - if (this.componentData.qtyPerAssembly === '' || this.componentData.qtyPerAssembly == null) { - this.$message.warning('请填写单位用量!') - return - } - if (this.componentData.componentScrap === '' || this.componentData.componentScrap == null) { - this.$message.warning('请填写调机量!') - return - } - if (this.componentData.shrinkageFactor === '' || this.componentData.shrinkageFactor == null) { - this.$message.warning('请填写损耗率!') - return - } - if (this.componentData.issueType === '' || this.componentData.issueType == null) { - this.$message.warning('请选择生产属性!') + if (this.componentData.operationNo === '' || this.componentData.operationNo == null) { + this.$message.warning('请填写工序编码!') return } if (this.componentData.flag === '1') { + this.saveComponentLoading = true saveRoutingComponent(this.componentData).then(({data}) => { if (data && data.code === 0) { this.subDetailList = data.rows @@ -1615,8 +1815,10 @@ export default { confirmButtonText: '确定' }) } + this.saveComponentLoading = false }) } else if (this.componentData.flag === '2') { + this.saveComponentLoading = true updateRoutingComponent(this.componentData).then(({data}) => { if (data && data.code === 0) { this.subDetailList = data.rows @@ -1632,6 +1834,7 @@ export default { confirmButtonText: '确定' }) } + this.saveComponentLoading = false }) } }, @@ -1657,7 +1860,7 @@ export default { this.$message.warning('请先选择Routing物料!') return } - if (this.modalData.engChgLevel === '' || this.modalData.engChgLevel == null) { + if (this.modalData.routingRevision === '' || this.modalData.routingRevision == null) { this.$message.warning('请先填写Routing版本号!') return } @@ -1665,10 +1868,7 @@ export default { this.$message.warning('请先选择制造类型!') return } - if (this.modalData.typeFlag === '' || this.modalData.typeFlag == null) { - this.$message.warning('请先选择类型!') - return - } + this.saveHeaderLoading = true // 新增主表信息 saveRoutingHeader(this.modalData).then(({data}) => { if (data && data.code === 0) { @@ -1678,11 +1878,11 @@ export default { site: data.rows.modalData.site, partNo: data.rows.modalData.partNo, partDesc: data.rows.modalData.partDesc, - engChgLevel: data.rows.modalData.engChgLevel, + routingRevision: data.rows.modalData.routingRevision, routingType: data.rows.modalData.routingType, noteText: data.rows.modalData.noteText, - effPhaseInDate: data.rows.modalData.effPhaseInDate, - effPhaseOutDate: data.rows.modalData.effPhaseOutDate, + phaseInDate: data.rows.modalData.phaseInDate, + phaseOutDate: data.rows.modalData.phaseOutDate, engRevision: data.rows.modalData.engRevision, typeFlag: data.rows.modalData.typeFlag, netWeight: data.rows.modalData.netWeight, @@ -1702,6 +1902,7 @@ export default { confirmButtonText: '确定' }) } + this.saveHeaderLoading = false }) }, /** @@ -1712,23 +1913,30 @@ export default { this.$message.warning('请先选择Routing物料!') return } - if (this.modalData.engChgLevel === '' || this.modalData.engChgLevel == null) { + if (this.modalData.routingRevision === '' || this.modalData.routingRevision == null) { this.$message.warning('请先填写Routing版本号!') return } if (this.modalData.routingType === '' || this.modalData.routingType == null) { - this.$message.warning('请先选择制造类型!') + this.$message.warning('请先选择工艺类型!') return } this.saveDetailData = { site: this.$store.state.user.site, partNo: this.modalData.partNo, - engChgLevel: this.modalData.engChgLevel, + routingRevision: this.modalData.routingRevision, routingType: this.modalData.routingType, alternativeNo: '', alternativeDescription: '', + routTemplateId: '', + planDate: '', + fixedLeadTimeDay: '', + fixedLeadTimeHour: '', + variableLeadTimeDay: '', + variableLeadTimeHour: '', + forStdLotByDay: '', + forLotByDay: '', minLotQty: '', - defaultFlag: '', detailNoteText: '', createDate: '', createBy: this.$store.state.user.name, @@ -1739,7 +1947,7 @@ export default { if (data.rows.length > 0) { this.saveDetailModalFlag = true } else { - this.$message.warning('请先保存BOM主记录!') + this.$message.warning('请先保存Routing主记录!') } } else { this.$alert(data.msg, '提示', { @@ -1756,12 +1964,12 @@ export default { this.$message.warning('请先选择Routing物料!') return } - if (this.saveDetailData.engChgLevel === '' || this.saveDetailData.engChgLevel == null) { + if (this.saveDetailData.routingRevision === '' || this.saveDetailData.routingRevision == null) { this.$message.warning('请先填写Routing版本号!') return } if (this.saveDetailData.routingType === '' || this.saveDetailData.routingType == null) { - this.$message.warning('请先选择制造类型!') + this.$message.warning('请先选择工艺类型!') return } if (this.saveDetailData.alternativeNo === '' || this.saveDetailData.alternativeNo == null) { @@ -1772,10 +1980,7 @@ export default { this.$message.warning('请填写替代名称!') return } - if (this.saveDetailData.minLotQty === '' || this.saveDetailData.minLotQty == null) { - this.$message.warning('请填写最小订单数!') - return - } + this.saveDetailLoading = true routingDetailSave(this.saveDetailData).then(({data}) => { if (data && data.code === 0) { this.detailDataList = data.rows @@ -1793,6 +1998,7 @@ export default { confirmButtonText: '确定' }) } + this.saveDetailLoading = false }) }, /** @@ -1856,11 +2062,19 @@ export default { */ getBaseList (val, type) { this.tagNo = val + this.tagNo1 = type this.$nextTick(() => { let strVal = '' if (val === 117) { strVal = this.componentData.issueToLoc } + if (val === 118) { + if(type === 1) { + strVal = this.componentData.laborClassNo + } else if (type === 2) { + strVal = this.componentData.setupLaborClassNo + } + } this.$refs.baseList.init(val, strVal) }) }, @@ -1873,6 +2087,15 @@ export default { this.componentData.issueToLoc = val.location_id this.componentData.issueToLocName = val.location_name } + if (this.tagNo === 118) { + if (this.tagNo1 === 1) { + this.componentData.laborClassNo = val.level_id + this.componentData.laborClassDesc = val.level_desc + } else if (this.tagNo1 === 2) { + this.componentData.setupLaborClassNo = val.level_id + this.componentData.setupLaborClassDesc = val.level_desc + } + } }, // ======== 导出相关方法 ========