diff --git a/src/api/part/quicklyCreateBom.js b/src/api/part/quicklyCreateBom.js index be551d0..aadd9e5 100644 --- a/src/api/part/quicklyCreateBom.js +++ b/src/api/part/quicklyCreateBom.js @@ -5,10 +5,12 @@ export const nodeSave = data => createAPI(`/part/quicklyBom/nodeSave`,'post',dat export const nodeDelete = data => createAPI(`/part/quicklyBom/nodeDelete`,'post',data) export const nodeEdit = data => createAPI(`/part/quicklyBom/nodeEdit`,'post',data) export const getBomInformationByPartNo = data => createAPI(`/part/quicklyBom/getBomInformationByPartNo`,'post',data) +export const getBomInformationListByPartNo = data => createAPI(`/part/quicklyBom/getBomInformationListByPartNo`,'post',data) export const savePartInfo = data => createAPI(`/part/quicklyBom/savePartInfo`,'post',data) export const updatePartNoOfNode = data => createAPI(`/part/quicklyBom/updatePartNoOfNode`,'post',data) export const saveBomHeader = data => createAPI(`/part/quicklyBom/saveBomHeader`,'post',data) export const getRoutingInformationByPartNo = data => createAPI(`/part/quicklyBom/getRoutingInformationByPartNo`,'post',data) +export const getRoutingInformationListByPartNo = data => createAPI(`/part/quicklyBom/getRoutingInformationListByPartNo`,'post',data) export const saveRoutingHeader = data => createAPI(`/part/quicklyBom/saveRoutingHeader`,'post',data) export const batchBuildInfo = data => createAPI(`/part/quicklyBom/batchBuildInfo`,'post',data) export const resetNodePartInfo = data => createAPI(`/part/quicklyBom/resetNodePartInfo`,'post',data) @@ -17,3 +19,5 @@ export const saveMainPartInfo = data => createAPI(`/part/quicklyBom/saveMainPart export const templateAdd = data => createAPI(`/part/quicklyBom/templateAdd`,'post',data) export const getTemplateList = data => createAPI(`/part/quicklyBom/getTemplateList`,'post',data) export const chooseTemplate = data => createAPI(`/part/quicklyBom/chooseTemplate`,'post',data) +export const getBomAndRoutingRevision = data => createAPI(`/part/quicklyBom/getBomAndRoutingRevision`,'post',data) +export const setRevision = data => createAPI(`/part/quicklyBom/setRevision`,'post',data) diff --git a/src/views/modules/part/bom_create.vue b/src/views/modules/part/bom_create.vue index b1cf1e2..e97621d 100644 --- a/src/views/modules/part/bom_create.vue +++ b/src/views/modules/part/bom_create.vue @@ -61,54 +61,58 @@ - - 保存 + + + Build + Retire + + + - - - - - - 编辑 - Build - Retire - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -1786,8 +1790,12 @@ export default { // 子明细新增模态框 saveComponentModal () { - if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) { - this.$message.warning('请先选择替代!') + // if (this.detailData.alternativeNo === '' || this.detailData.alternativeNo == null) { + // this.$message.warning('请先选择替代!') + // return + // } + if (this.modalData.flag==='1'&&headerSaveFlag) { + this.$message.warning('请先保存!') return } this.componentData = { diff --git a/src/views/modules/part/part_create.vue b/src/views/modules/part/part_create.vue index 10d2d7d..88beb61 100644 --- a/src/views/modules/part/part_create.vue +++ b/src/views/modules/part/part_create.vue @@ -2176,7 +2176,7 @@ export default { this.modalData = { flag: '1', title: '物料新增', - site: '', + site: this.$store.state.user.site, buNo: '', bu: this.userBuList[0].buNo, partNo: '', @@ -3507,6 +3507,7 @@ export default { }); this.modalData.umId2 = data.data.umId this.modalData.familyID = data.data.familyId + if (this.modalData.partType2&&this.modalData.partType2==='Manufactured') this.modalData.templateNo = data.data.bomTemplateNo this.modalData.templateName = data.data.bomTemplateName } diff --git a/src/views/modules/part/quicklyCreateBom.vue b/src/views/modules/part/quicklyCreateBom.vue index 425019b..20b3123 100644 --- a/src/views/modules/part/quicklyCreateBom.vue +++ b/src/views/modules/part/quicklyCreateBom.vue @@ -16,9 +16,9 @@ 维护 - - 完成 - + + + 物料属性批量维护 @@ -225,10 +225,12 @@ :before-close="handleBatchUpdateDialogClose" close-on-click-modal="false">
-
- 复制属性 - {{attributeFlag?'编辑' : '保存'}} - +
+
+ 复制属性 + {{ attributeFlag ? '编辑' : '保存' }} +
+ @@ -288,6 +291,9 @@ @@ -346,6 +352,26 @@ + + + + + + + + + + + + - + 新增 @@ -452,8 +478,9 @@
- + + + + 更改版本 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
关闭 @@ -837,9 +977,19 @@ import { getItemLists, batchSavePartInfo, addPartsItem, batchUpdateCodeNo, deletePartsItem, commitItemsValue } from "../../../api/part/partInformation"; import {getChooselist1} from "../../../api/chooselist/chooselist"; -import {chooseTemplate, getTemplateList, savePartInfo, updatePartNoOfNode} from "../../../api/part/quicklyCreateBom"; +import { + chooseEngChgLevel, + chooseTemplate, getBomAndRoutingRevision, + getBomInformationListByPartNo, + getRoutingInformationListByPartNo, + getTemplateList, + savePartInfo, setRevision, + updatePartNoOfNode +} from "../../../api/part/quicklyCreateBom"; import {getSiteAndBuByUserName} from "../../../api/qc/qc"; import Data from "lodash"; +import {queryBomDetail} from "../../../api/part/bomManagement"; +import {queryRoutingDetail} from "../../../api/part/routingManagement"; export default { components: { PartCreate, @@ -859,6 +1009,24 @@ export default { handler: function (newV, oldV) { if (this.inventoryPartTable==='part_item1'&&this.attributeFlag1){ this.getPartItem1() + } else if (this.inventoryPartTable==='revision_info'){ + this.getRevisionInfo() + } + } + }, + 'bomCurrentRow': { + deep: true, + handler: function (newV, oldV) { + if (newV) { + this.routingCurrentRow = null + } + } + }, + 'routingCurrentRow': { + deep: true, + handler: function (newV, oldV) { + if (newV) { + this.bomCurrentRow = null } } }, @@ -900,20 +1068,28 @@ export default { this.childrenNodeList = []; } } + }, + 'routingComponentPartList': { + deep: true, + handler: function (newV, oldV) { + newV.forEach(item => { + item.formula = this.getFormula(item.operationName) + }) + } } }, data () { return { activeTable: 'bom_info', + activeTab1: 'default', + activeTab2: 'default', inventoryPartTable: 'part_item', - // selectableFields: [], partItemList: [], partItemList1: [], copyAttributeList: [], treeData: [], treeData1: [], childrenNodeList: [], - umList: [], userBuList: [], partFamilyList: [], partProductGroupList1: [], @@ -933,6 +1109,7 @@ export default { exportHeader: ["节点"], exportFooter: [], height: 200, + rightWidth: '', pageIndex: 1, pageSize: 20, totalPage: 0, @@ -949,6 +1126,10 @@ export default { itemSelections2: [], itemList1: [], itemList2: [], + bomComponentPartList: [], + routingComponentPartList: [], + bomComponentList: [], + routingComponentList: [], previousCodeNo: '', searchData: { site: '', @@ -1021,6 +1202,8 @@ export default { dataList: [{}], currentNode: {}, partCurrentRow: {}, + bomCurrentRow: {}, + routingCurrentRow: {}, partCurrentRowIndex: -1, columnList: [ { @@ -1203,7 +1386,7 @@ export default { columnImage: false, status: true, fixed: '', - columnWidth: 100 + columnWidth: 130 }, { columnProp: 'umName', @@ -1282,6 +1465,28 @@ export default { fixed: '', columnWidth: 100 }, + { + columnProp: 'engChgLevel', + headerAlign: "center", + align: "center", + columnLabel: 'BOM版本号', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + columnWidth: 100 + }, + { + columnProp: 'routingRevision', + headerAlign: "center", + align: "center", + columnLabel: 'Routing版本号', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + columnWidth: 100 + }, { columnProp: 'remark', headerAlign: "center", @@ -1451,6 +1656,28 @@ export default { fixed: '', columnWidth: 100 }, + { + columnProp: 'engChgLevel', + headerAlign: "center", + align: "center", + columnLabel: 'BOM版本号', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + columnWidth: 100 + }, + { + columnProp: 'routingRevision', + headerAlign: "center", + align: "center", + columnLabel: 'Routing版本号', + columnHidden: false, + columnImage: false, + status: true, + fixed: '', + columnWidth: 100 + }, { columnProp: 'remark', headerAlign: "center", @@ -1615,6 +1842,574 @@ export default { columnWidth: 300, // columnWidth: 340, }, + ], + bomComponentListColumnList: [ + { + userId: this.$store.state.user.name, + functionId: 601002, + serialNumber: '601002Table2LineSequence', + tableId: '601002Table2', + tableName: 'BOM子物料表', + columnProp: 'lineSequence', + headerAlign: 'center', + align: 'center', + columnLabel: '序号', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 50 + }, + { + userId: this.$store.state.user.name, + functionId: 601002, + serialNumber: '601002Table2ComponentPart', + tableId: '601002Table2', + tableName: 'BOM子物料表', + columnProp: 'componentPart', + 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: 601002, + serialNumber: '601002Table2ComponentPartDesc', + tableId: '601002Table2', + tableName: 'BOM子物料表', + columnProp: 'componentPartDesc', + headerAlign: 'center', + align: 'left', + columnLabel: '物料名称', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 300 + }, + { + userId: this.$store.state.user.name, + functionId: 601002, + serialNumber: '601002Table2ComponentPartDesc', + tableId: '601002Table2', + tableName: 'BOM子物料表', + columnProp: 'formula', + headerAlign: 'center', + align: 'left', + columnLabel: '计算公式', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 300 + }, + { + userId: this.$store.state.user.name, + functionId: 601002, + serialNumber: '601002Table2PrintUnit', + tableId: '601002Table2', + tableName: 'BOM子物料表', + columnProp: 'printUnitName', + headerAlign: 'center', + align: 'center', + columnLabel: '物料单位', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 601002, + serialNumber: '601002Table2PrintUnit', + tableId: '601002Table2', + tableName: 'BOM子物料表', + columnProp: 'qtyPerAssembly', + headerAlign: 'center', + align: 'center', + columnLabel: '单位用量', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 100 + }, + // { + // userId: this.$store.state.user.name, + // functionId: 601002, + // serialNumber: '601002Table2PrintUnit', + // tableId: '601002Table2', + // tableName: 'BOM子物料表', + // columnProp: 'componentScrap', + // 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: 601002, + serialNumber: '601002Table2PrintUnit', + tableId: '601002Table2', + tableName: 'BOM子物料表', + columnProp: 'shrinkageFactor', + 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: 601002, + serialNumber: '601002Table2OperationNo', + tableId: '601002Table2', + tableName: 'BOM子物料表', + 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: 601002, + serialNumber: '601002Table2OperationName', + tableId: '601002Table2', + tableName: 'BOM子物料表', + columnProp: 'operationName', + 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: 601002, + serialNumber: '601002Table2NoteText', + tableId: '601002Table2', + tableName: 'BOM子物料表', + columnProp: 'noteText', + headerAlign: 'center', + align: 'center', + columnLabel: '备注', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 150 + }, + ], + bomComponentListColumns: [ + { + userId: this.$store.state.user.name, + columnProp: 'engChgLevel', + headerAlign: 'center', + align: 'center', + columnLabel: 'BOM版本号', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 80 + }, + { + userId: this.$store.state.user.name, + columnProp: 'noteText', + headerAlign: 'center', + align: 'left', + columnLabel: '备注', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 200 + }, + ], + routingComponentListColumns: [ + { + userId: this.$store.state.user.name, + columnProp: 'routingRevision', + headerAlign: 'center', + align: 'center', + columnLabel: 'Routing版本号', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + columnProp: 'noteText', + headerAlign: 'center', + align: 'left', + columnLabel: '备注', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 200 + }, + ], + routingComponentListColumnList: [ + { + userId: this.$store.state.user.name, + functionId: 601003, + 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: 601003, + serialNumber: '104003Table2OperationName', + tableId: '104003Table2', + tableName: 'Routing工序表', + columnProp: 'operationName', + 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: 601003, + serialNumber: '104003Table2MachCycleTime', + tableId: '104003Table2', + tableName: 'Routing工序表', + columnProp: 'machCycleTime', + headerAlign: 'center', + align: 'right', + columnLabel: '机器处理时间', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 601003, + serialNumber: '104003Table2OperationName', + tableId: '104003Table2', + tableName: 'Routing工序表', + columnProp: 'formula', + headerAlign: 'center', + align: 'left', + columnLabel: '计算公式', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 260 + }, + { + userId: this.$store.state.user.name, + functionId: 601003, + serialNumber: '104003Table2OperationName', + tableId: '104003Table2', + tableName: 'Routing工序表', + columnProp: 'crewSize', + headerAlign: 'center', + align: 'center', + columnLabel: '人数', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 601003, + serialNumber: '104003Table2OperationName', + tableId: '104003Table2', + tableName: 'Routing工序表', + columnProp: 'refSpeed', + headerAlign: 'center', + align: 'center', + columnLabel: '速度', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 601003, + serialNumber: '104003Table2OperationName', + tableId: '104003Table2', + tableName: 'Routing工序表', + columnProp: 'refTime', + headerAlign: 'center', + align: 'center', + columnLabel: '时间', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 601003, + serialNumber: '104003Table2OperationName', + tableId: '104003Table2', + tableName: 'Routing工序表', + columnProp: 'refEfficiency', + headerAlign: 'center', + align: 'center', + columnLabel: '效率', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 601003, + 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: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 601003, + serialNumber: '104003Table2MachRunFactor', + tableId: '104003Table2', + tableName: 'Routing工序表', + columnProp: 'machRunFactor', + headerAlign: 'center', + align: 'right', + columnLabel: '机器单位产出', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 601003, + 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: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 601003, + serialNumber: '104003Table2LaborClassNo', + tableId: '104003Table2', + tableName: 'Routing工序表', + columnProp: 'laborClassDesc', + 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: 601003, + serialNumber: '104003Table2LaborCycleTime', + tableId: '104003Table2', + tableName: 'Routing工序表', + columnProp: 'laborCycleTime', + headerAlign: 'center', + align: 'right', + columnLabel: '人工处理时间', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 601003, + 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: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 601003, + serialNumber: '104003Table2EfficiencyFactor', + tableId: '104003Table2', + tableName: 'Routing工序表', + columnProp: 'efficiencyFactor', + 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: 601003, + serialNumber: '104003Table2WorkCenterNo', + tableId: '104003Table2', + tableName: 'Routing工序表', + columnProp: 'workCenterNo', + headerAlign: 'center', + align: 'center', + columnLabel: '加工中心编码', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 601003, + serialNumber: '104003Table2NoteText', + tableId: '104003Table2', + tableName: 'Routing工序表', + columnProp: 'noteText', + headerAlign: 'center', + align: 'center', + columnLabel: '备注', + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: '', + columnWidth: 120 + }, ], // 控制 nodeModalFlag: false, @@ -1629,12 +2424,15 @@ export default { batchUpdateFlag: false, attributeFlag: true, attributeFlag1: true, + attributeFlag2: true, fastAddFlag: false, fastAddFlag1: false, loading: false, addItemLoading: false, deleteItemLoading: false, - buNoQueryLoading: false + buNoQueryLoading: false, + alternativeLoading: false, + bomFlag: true } }, created () { @@ -1917,7 +2715,8 @@ export default { partDesc: '', nodeFlag: true, page: 1, - limit: 10 + limit: 10, + mainPart: this.searchData.partNo } this.currentNode = data this.queryPartList() @@ -2320,6 +3119,67 @@ export default { } }) }, + + getRevisionInfo(){ + if (this.partCurrentRow.partNo!==null&&this.partCurrentRow.partNo.length>0){ + let tempData = { + site: this.partCurrentRow.site, + buNo: this.partCurrentRow.buNo, + mainPart: this.searchData.partNo, + partNo: this.partCurrentRow.partNo, + partDesc: this.partCurrentRow.partDesc, + printUnit: this.partCurrentRow.umId2, + printUnitName: this.partCurrentRow.umName, + bomType: 'Manufacturing', + routingType: 'Manufacturing', + nodeId: this.partCurrentRow.nodeId, + offFlag: '2' + } + this.$nextTick(() => { + getBomInformationListByPartNo(tempData).then(({data}) => { + if (data && data.code === 0) { + this.bomComponentList = [] + this.bomComponentPartList = [] + if (data.rows.length > 0) { + data.rows = data.rows.filter(item => item.partNo!==null&&item.partNo.length>0) + if (data.rows.length > 0) { + for (let i = 0; i < data.rows.length; i++) { + this.$set(data.rows[i], 'index', i) + this.$set(this.bomComponentList, i, data.rows[i]) + this.queryBomDetail(data.rows[i]) + } + } + } + } else { + this.$alert(data.msg, '提示', { + confirmButtonText: '确定' + }) + } + }) + getRoutingInformationListByPartNo(tempData).then(({data}) => { + if (data && data.code === 0) { + this.routingComponentList = [] + this.routingComponentPartList = [] + if (data.rows.length > 0) { + data.rows = data.rows.filter(item => item.partNo!==null&&item.partNo.length>0) + if (data.rows.length > 0) { + for (let i = 0; i < data.rows.length; i++) { + this.$set(data.rows[i], 'index', i) + this.$set(this.routingComponentList, i, data.rows[i]) + this.queryRoutingDetail(data.rows[i]) + } + } + } + } else { + this.$alert(data.msg, '提示', { + confirmButtonText: '确定' + }) + } + }) + }) + } + }, + handleBatchUpdatePart(){ if(this.treeData.length===0){ this.$message.warning('请先维护主物料的BOM模板!') @@ -2347,7 +3207,7 @@ export default { username: this.$store.state.user.name, } getSiteAndBuByUserName(tempData1).then(({data}) => { - if (data.code === 0) { + if (data&&data.code === 0) { this.userBuList = data.rows.sort((a, b) => { return a.buNo.split('_')[1].localeCompare(b.buNo.split('_')[1]); }); @@ -2355,7 +3215,7 @@ export default { }) this.getTemplateList() this.getPartItem2() - this.$forceUpdate() + this.getBomAndRoutingRevision() this.batchUpdateFlag = true }else { this.$alert(data.msg, '错误', { @@ -2448,6 +3308,8 @@ export default { this.getPartItem2() } else if (this.inventoryPartTable === 'part_item1') { this.getPartItem1() + } else if (this.inventoryPartTable === 'revision_info') { + this.getRevisionInfo() } }, @@ -2498,6 +3360,11 @@ export default { items[j].recordType = 'IP' } list.push({ + site: this.partList1[i].site, + buNo: this.partList1[i].buNo, + partNo: this.partList1[i].partNo, + codeNo: this.partList1[i].codeNo, + recordType: 'IP', itemList: items }) } @@ -2517,8 +3384,11 @@ export default { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) + this.attributeFlag1 = true + this.loading = false } }).catch((error) => { + this.attributeFlag1 = true this.$set(this, 'loading', false) this.$message.error(error) }) @@ -2698,7 +3568,17 @@ export default { }, rowStyle({row}){ - if(row.nodeName===this.partCurrentRow.nodeName) + if(this.partCurrentRow&&row.nodeName===this.partCurrentRow.nodeName) + return { 'background-color': '#E8F7F6', cursor: 'pointer' }; + }, + + bomRowStyle({row}){ + if(this.bomCurrentRow&&row.engChgLevel===this.bomCurrentRow.engChgLevel) + return { 'background-color': '#E8F7F6', cursor: 'pointer' }; + }, + + routingRowStyle({row}){ + if(this.routingCurrentRow&&row.routingRevision===this.routingCurrentRow.routingRevision) return { 'background-color': '#E8F7F6', cursor: 'pointer' }; }, @@ -2815,6 +3695,7 @@ export default { } } } + this.partList1.forEach(item => this.$set(item, 'mainPart', this.searchData.partNo)) // 修改物料的属性 batchSavePartInfo(this.partList1.filter(item => item.partNo&&item.partNo!=='')).then(({data}) => { if (data && data.code === 0){ @@ -2898,6 +3779,7 @@ export default { batchUpdateCodeNo(partList).then(({data}) => { if (data&&data.code === 0){ this.handleBatchUpdatePart() + this.handleEditInfo() this.$message({ message: '操作成功', type: 'success', @@ -2976,6 +3858,314 @@ export default { } }, + queryBomDetail(row) { + let tempData = { + flag: '2', + site: row.site, + buNo: row.buNo, + partNo: row.partNo, + partDesc: row.partDesc, + engChgLevel: row.engChgLevel, + bomType: row.bomType, + noteText: row.noteText, + effPhaseInDate: row.effPhaseInDate, + effPhaseOutDate: row.effPhaseOutDate, + engRevision: row.engRevision, + typeFlag: row.typeFlag, + netWeight: row.netWeight, + updateBy: this.$store.state.user.name, + printUnit: row.printUnit, + printUnitName: row.printUnitName, + alternativeNo: row.alternativeNo, + yieldRate: row.yieldRate, + shrinkageFactor: new Decimal(100).sub(new Decimal(row.yieldRate)).toNumber(), + processUnit: row.processUnit, + processUnitName: row.processUnitName + } + queryBomDetail(tempData).then(({data}) => { + if (data && data.code === 0) { + this.bomComponentPartList = data.rows.componentList + this.bomComponentList[row.index] = { ...this.bomComponentList[row.index], ...data.rows.detailData} + this.bomCurrentRow = JSON.parse(JSON.stringify(this.bomComponentList[0])) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + + queryRoutingDetail (row) { + let tempData = { + flag: '2', + site: row.site, + buNo: row.buNo, + partNo: row.partNo, + partDesc: row.partDesc, + routingRevision: row.routingRevision, + routingType: row.routingType, + noteText: row.noteText, + phaseInDate: row.phaseInDate, + phaseOutDate: row.phaseOutDate, + engRevision: row.engRevision, + typeFlag: row.typeFlag, + netWeight: row.netWeight, + updateBy: this.$store.state.user.name, + printUnit: row.printUnit, + printUnitName: row.printUnitName, + alternativeNo: row.alternativeNo, + } + // 查routing明细 + queryRoutingDetail(tempData).then(({data}) => { + if (data && data.code === 0) { + this.routingComponentPartList = data.rows.componentList + this.routingComponentList[row.index] = { ...this.routingComponentList[row.index], ...data.rows.detailData} + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + + bomRowClick() { + let tempData = { + flag: '2', + site: this.bomCurrentRow.site, + buNo: this.bomCurrentRow.buNo, + partNo: this.bomCurrentRow.partNo, + partDesc: this.bomCurrentRow.partDesc, + engChgLevel: this.bomCurrentRow.engChgLevel, + bomType: this.bomCurrentRow.bomType, + noteText: this.bomCurrentRow.noteText, + effPhaseInDate: this.bomCurrentRow.effPhaseInDate, + effPhaseOutDate: this.bomCurrentRow.effPhaseOutDate, + engRevision: this.bomCurrentRow.engRevision, + typeFlag: this.bomCurrentRow.typeFlag, + netWeight: this.bomCurrentRow.netWeight, + updateBy: this.$store.state.user.name, + printUnit: this.bomCurrentRow.printUnit, + printUnitName: this.bomCurrentRow.printUnitName, + alternativeNo: this.bomCurrentRow.alternativeNo, + yieldRate: this.bomCurrentRow.yieldRate, + shrinkageFactor: new Decimal(100).sub(new Decimal(this.bomCurrentRow.yieldRate)).toNumber(), + processUnit: this.bomCurrentRow.processUnit, + processUnitName: this.bomCurrentRow.processUnitName + } + queryBomDetail(tempData).then(({data}) => { + if (data && data.code === 0) { + this.bomComponentPartList = data.rows.componentList + this.bomFlag = true + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + + bomInfoRowClick(row) { + this.bomCurrentRow = JSON.parse(JSON.stringify(row)) + this.bomRowClick() + }, + + bomInfoTabClick() { + if (this.bomComponentList.length>0){ + if (!this.bomCurrentRow) { + this.bomCurrentRow = this.bomComponentList[0] + } + this.bomRowClick() + } + }, + + bomInfoRowDblClick(row){ + let tempData = { + site: this.$store.state.user.site, + partNo: row.partNo, + mainPart: this.searchData.partNo, + engChgLevel: row.engChgLevel, + routingRevision: this.partCurrentRow.routingRevision + } + setRevision(tempData).then(({data}) => { + if (data && data.code === 0) { + this.handleBatchUpdatePart() + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } + }) + }, + routingInfoRowDblClick(row){ + let tempData = { + site: this.$store.state.user.site, + partNo: row.partNo, + mainPart: this.searchData.partNo, + engChgLevel: this.partCurrentRow.engChgLevel, + routingRevision: row.routingRevision + } + setRevision(tempData).then(({data}) => { + if (data && data.code === 0) { + this.handleBatchUpdatePart() + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } + }) + }, + + routingInfoRowClick(row) { + this.routingCurrentRow = JSON.parse(JSON.stringify(row)) + this.routingRowClick() + }, + + routingInfoTabClick() { + if (this.routingComponentList.length>0) { + if (!this.routingCurrentRow) { + this.routingCurrentRow = this.routingComponentList[0] + } + this.routingRowClick() + } + }, + + routingRowClick() { + let tempData = { + flag: '2', + site: this.routingCurrentRow.site, + buNo: this.routingCurrentRow.buNo, + partNo: this.routingCurrentRow.partNo, + partDesc: this.routingCurrentRow.partDesc, + routingRevision: this.routingCurrentRow.routingRevision, + routingType: this.routingCurrentRow.routingType, + noteText: this.routingCurrentRow.noteText, + phaseInDate: this.routingCurrentRow.phaseInDate, + phaseOutDate: this.routingCurrentRow.phaseOutDate, + engRevision: this.routingCurrentRow.engRevision, + typeFlag: this.routingCurrentRow.typeFlag, + netWeight: this.routingCurrentRow.netWeight, + updateBy: this.$store.state.user.name, + printUnit: this.routingCurrentRow.printUnit, + printUnitName: this.routingCurrentRow.printUnitName, + alternativeNo: this.routingCurrentRow.alternativeNo, + } + // 查routing明细 + queryRoutingDetail(tempData).then(({data}) => { + if (data && data.code === 0) { + this.routingComponentPartList = data.rows.componentList + this.bomFlag = false + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + + getFormula(value) { + switch (value) { + case '一复': case '熟化': case 'RFID前道检品': + return '人数/(速度x时间x效率)' + case '印刷': case 'RFID-蚀刻': case 'RFID-分切': + return '人数/(速度x时间x效率)/Printing lanes' + case '绑定': case 'RFID编码': case 'RFID编码打印': + return '人数/(UPH(每小时产量)*效率)*1KCT' + case 'RFID多条检测': + return '人数/(速度x时间xCDx效率)*1KCT' + case 'RFID复合模切检测': + return '人数/(速度x时间x效率x(CDx复合列数))*1KCT' + case 'RFID后道检品': + return '人数/UPH(每小时产量)*100%*1KCT' + case 'RFID自动贴标': + return '人数/(速度x时间x效率x(CDx贴标列数))*1KCT' + case 'Voyantic在线检测': + return '人数/(速度x时间x效率x(CDx检测列数))*1KCT' + case 'RFID包装': + return '人数/(日产量/8小时/17人均摊)*1KCT' + default: + return '' + } + }, + + getBomAndRoutingRevision(){ + let list = [] + for (let i = 0; i < this.partList1.length; i++) { + list.push({ + site: this.partList1[i].site, + buNo: this.partList1[i].buNo, + partNo: this.partList1[i].partNo, + partDesc: this.partList1[i].partDesc, + printUnit: this.partList1[i].umId2, + printUnitName: this.partList1[i].umName, + bomType: 'Manufacturing', + routingType: 'Manufacturing', + nodeId: this.partList1[i].nodeId, + offFlag: '2' + }) + } + getBomAndRoutingRevision(list).then(({data}) => { + if (data && data.code === 0) { + for (let i = 0; i { + if (data && data.code === 0) { + this.handleBatchUpdatePart() + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } + }) + } else if(this.routingCurrentRow) { + let tempData = { + site: this.$store.state.user.site, + partNo: this.routingCurrentRow.partNo, + mainPart: this.searchData.partNo, + engChgLevel: this.partCurrentRow.engChgLevel, + routingRevision: this.routingCurrentRow.routingRevision + } + setRevision(tempData).then(({data}) => { + if (data && data.code === 0) { + this.handleBatchUpdatePart() + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => {} + }) + } + }) + } else { + this.$message({ + message: '请先选择BOM或Routing的版本', + type: 'warning', + duration: 1500, + onClose: () => {} + }) + } + } + } } @@ -3040,6 +4230,11 @@ export default { line-height: 38px; font-size: 13px; } +.down-tree{ + //height: 470px; + display: block; + overflow-y: scroll; +} diff --git a/src/views/modules/part/routing_create.vue b/src/views/modules/part/routing_create.vue index 0baf8f5..6cb238f 100644 --- a/src/views/modules/part/routing_create.vue +++ b/src/views/modules/part/routing_create.vue @@ -46,52 +46,54 @@
- - 保存 + + + Build + Retire + 基于标准工序快速创建 + + +
- - - - - - 编辑 - Build - Retire - 基于标准工序快速创建 - - - - - - - - - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/views/modules/quote/detail/primary/quoteDetailBom.vue b/src/views/modules/quote/detail/primary/quoteDetailBom.vue index d45cfdb..bc0cca0 100644 --- a/src/views/modules/quote/detail/primary/quoteDetailBom.vue +++ b/src/views/modules/quote/detail/primary/quoteDetailBom.vue @@ -311,6 +311,7 @@ export default { handleQueryQuoteDetailBomTree() { let params = { id: this.quoteDetail.id, + queryType: 'bom' } this.queryTreeLoading = true; queryQuoteDetailBomTree(params).then(({data}) => { diff --git a/src/views/modules/quote/detail/primary/quoteDetailRouting.vue b/src/views/modules/quote/detail/primary/quoteDetailRouting.vue index 79812e0..d77d967 100644 --- a/src/views/modules/quote/detail/primary/quoteDetailRouting.vue +++ b/src/views/modules/quote/detail/primary/quoteDetailRouting.vue @@ -567,6 +567,7 @@ export default { handleQueryQuoteDetailBomTree(){ let params = { id: this.quoteDetail.id, + queryType: 'routing' } this.queryTreeLoading = true; queryQuoteDetailBomTree(params).then(({data})=>{ diff --git a/src/views/modules/quote/detail/quoteDetail.vue b/src/views/modules/quote/detail/quoteDetail.vue index 120c6b3..8be6801 100644 --- a/src/views/modules/quote/detail/quoteDetail.vue +++ b/src/views/modules/quote/detail/quoteDetail.vue @@ -798,7 +798,7 @@ export default { - +