diff --git a/src/views/modules/base/maintainProductRouting.vue b/src/views/modules/base/maintainProductRouting.vue index 69b633c..7da5dcf 100644 --- a/src/views/modules/base/maintainProductRouting.vue +++ b/src/views/modules/base/maintainProductRouting.vue @@ -1,45 +1,48 @@ - + 关闭 - + - + 加工中心编码: @@ -214,7 +228,7 @@ - + 保存 关闭 @@ -222,7 +236,8 @@ - + - + - + 工具编号: - + - + - + - + - + - + 保存 关闭 @@ -264,32 +280,32 @@ - 可选机台: + 可选机台: - - - - + height="300px" + :data="resourceList1" + border + @row-click="clickData3" + highlight-current-row + v-loading="dataListLoading" + style="width: 100%"> + + + +
@@ -300,39 +316,39 @@
- 已选机台: + 已选机台: - - - - + height="300px" + :data="resourceList2" + border + @row-click="clickData4" + highlight-current-row + v-loading="dataListLoading" + style="width: 100%"> + + + +
- - - + + +
- + @@ -363,11 +379,11 @@ - + 关闭 - + @@ -376,31 +392,33 @@ - + 保存 关闭 - +
源产品工艺路线 - + - + - + - + @@ -410,17 +428,19 @@
新产品工艺路线 - + 工艺路线编码: - + - + - + - +
- + 自动停用早期所有版本
@@ -447,65 +467,67 @@
- + 复制工具信息
- + 复制可用机台
- + 保存 关闭 - + 工艺路线编码: - + - + - + - - - - - - - - - - - + + + + + + + + + + + - - - - - - + + + + + + - + @@ -517,12 +539,12 @@ - + 保存 关闭 - + @@ -549,1853 +571,1869 @@ setDefault, saveRoutingHeaderData, deleteRoutingHeaderData - }from "@/api/base/site.js" + } from "@/api/base/site.js" import Chooselist from '@/views/modules/common/Chooselist' - export default { - name: "maintainProductRouting", - components: { - Chooselist - }, - data () { - return { - routingHeaderInputFlag:false, - routingHeaderModelFlag:false, - routingHeaderData:{ - partNo:'', - site:'', - status:'', - revNo:'', - phaseInDate:'', - phaseOutDate:'', - routingType:'', - remark:'', - defaultflag:'', - repairFlag:'', - add:'', + + export default { + name: "maintainProductRouting", + components: { + Chooselist + }, + data() { + return { + routingHeaderInputFlag: false, + routingHeaderModelFlag: false, + routingHeaderData: { + partNo: '', + site: '', + status: '', + revNo: '', + phaseInDate: '', + phaseOutDate: '', + routingType: '', + remark: '', + defaultflag: '', + repairFlag: '', + add: '', + }, + selectList: [], + resourceList1: [], + resourceList2: [], + currentRow4: null, + currentRow3: null, + currentRow2: null, + currentRow: null, + tagNo: '', + status: '', + dataListLoading: false, + searchPartNo: '', + height: 200, + mainData: { + partNo: '', + spec: '', + status: '', + site: '', + routingType: '', + revNo: '', + phaseInDate: '', + phaseOutDate: '', + umid: '', + remark: '', + defaultflag: '', + repairFlag: '', + }, + partData: { + partNo: '', + partDescription: '', + site: '', + createDate: '', + umid: '', + active: '', + configurationTemplateID: '', + modelFlag: '', + }, + copyRoutingData: { + partNo: '', + partDescription: '', + revNo: '', + phaseInDate: '', + repairFlag: '', + partNo1: '', + partDescription1: '', + revNo1: '', + phaseInDate1: '', + repairFlag1: false, + oldFlag: false, + toolFlag: false, + resourceFlag: false, + }, + activeName: 'first', + modelFlag: false, + ToolmodelFlag: false, + detailmodelFlag: false, + detailmodelInputFlag: false, + toolmodelInputFlag: false, + copyRoutingModelFlag: false, + partFlag: false, + statusFlag: false, + dataList: [], + dataList2: [], + dataList3: [], + toolData: { + site: '', + partNo: '', + revNo: '', + itemNo: '', + operationDesc: '', + toolID: '', + toolDescription: '', + spec: '', + toolQty: '', + remark: '', + user: '', + add: '', + }, + columnList: [ + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040TablePartNo', + tableId: "6040Table", + tableName: "维护工艺路线数据表", + columnProp: "partNo", + headerAlign: "center", + align: "left", + columnLabel: "物料编码", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040TableSpec', + tableId: "6040Table", + tableName: "维护工艺路线数据表", + columnProp: "spec", + headerAlign: "center", + align: "left", + columnLabel: "名称/规格", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 120 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040TableRoutingType', + tableId: "6040Table", + tableName: "维护工艺路线数据表", + columnProp: "routingType", + headerAlign: "center", + align: "left", + columnLabel: "工艺路线类型", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 80 }, - selectList:[], - resourceList1:[], - resourceList2:[], - currentRow4:null, - currentRow3:null, - currentRow2:null, - currentRow:null, - tagNo:'', - status:'', - dataListLoading: false, - searchPartNo:'', - height:200, - mainData:{ - partNo:'', - spec:'', - status:'', - site:'', - routingType:'', - revNo:'', - phaseInDate:'', - phaseOutDate:'', - umid:'', - remark:'', - defaultflag:'', - repairFlag:'', + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040TableRevNo', + tableId: "6040Table", + tableName: "维护工艺路线数据表", + columnProp: "revNo", + headerAlign: "center", + align: "left", + columnLabel: "版本号", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 60 }, - partData:{ - partNo:'', - partDescription:'', - site:'', - createDate:'', - umid:'', - active:'', - configurationTemplateID:'', - modelFlag:'', + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040TablePhaseInDate', + tableId: "6040Table", + tableName: "维护工艺路线数据表", + columnProp: "phaseInDate", + headerAlign: "center", + align: "left", + columnLabel: "启用日期", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 80 }, - copyRoutingData:{ - partNo:'', - partDescription:'', - revNo:'', - phaseInDate:'', - repairFlag:'', - partNo1:'', - partDescription1:'', - revNo1:'', - phaseInDate1:'', - repairFlag1:false, - oldFlag:false, - toolFlag:false, - resourceFlag:false, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040TablePhaseOutDate', + tableId: "6040Table", + tableName: "维护工艺路线数据表", + columnProp: "phaseOutDate", + headerAlign: "center", + align: "left", + columnLabel: "停用日期", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 80 }, - activeName:'first', - modelFlag:false, - ToolmodelFlag:false, - detailmodelFlag:false, - detailmodelInputFlag:false, - toolmodelInputFlag:false, - copyRoutingModelFlag:false, - partFlag:false, - statusFlag:false, - dataList:[], - dataList2:[], - dataList3:[], - toolData:{ - site:'', - partNo:'', - revNo:'', - itemNo:'', - operationDesc:'', - toolID:'', - toolDescription:'', - spec:'', - toolQty:'', - remark:'', - user:'', - add:'', + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040TableStatus', + tableId: "6040Table", + tableName: "维护工艺路线数据表", + columnProp: "status", + headerAlign: "center", + align: "left", + columnLabel: "状态", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 40 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040TableSite', + tableId: "6040Table", + tableName: "维护工艺路线数据表", + columnProp: "site", + headerAlign: "center", + align: "left", + columnLabel: "工厂编码", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 60 + }, + ], + columnList2: [ + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table2ItemNo', + tableId: "6040Table2", + tableName: "维护工艺路线工序表", + columnProp: "itemNo", + headerAlign: "center", + align: "right", + columnLabel: "工序号", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 60 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table2OperationDesc', + tableId: "6040Table2", + tableName: "维护工艺路线工序表", + columnProp: "operationDesc", + headerAlign: "center", + align: "left", + columnLabel: "工序名称", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 300 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table2WorkCenterNo', + tableId: "6040Table2", + tableName: "维护工艺路线工序表", + columnProp: "workCenterNo", + headerAlign: "center", + align: "left", + columnLabel: "加工中心编码", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table2WorkCenterDesc', + tableId: "6040Table2", + tableName: "维护工艺路线工序表", + columnProp: "workCenterDesc", + headerAlign: "center", + align: "left", + columnLabel: "加工中心名称", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table2MachSetupTime', + tableId: "6040Table2", + tableName: "维护工艺路线工序表", + columnProp: "machSetupTime", + headerAlign: "center", + align: "right", + columnLabel: "准备时间(小时)", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table2MachRunFactor', + tableId: "6040Table2", + tableName: "维护工艺路线工序表", + columnProp: "machRunFactor", + headerAlign: "center", + align: "right", + columnLabel: "单位产出量", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table2FactorUnit', + tableId: "6040Table2", + tableName: "维护工艺路线工序表", + columnProp: "factorUnit", + headerAlign: "center", + align: "left", + columnLabel: "产出单位", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table2Efficiency', + tableId: "6040Table2", + tableName: "维护工艺路线工序表", + columnProp: "efficiency", + headerAlign: "center", + align: "right", + columnLabel: "效率(%)", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 80 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table2Remark', + tableId: "6040Table2", + tableName: "维护工艺路线工序表", + columnProp: "remark", + headerAlign: "center", + align: "left", + columnLabel: "备注", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 160 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table2JJGZUnitPrice', + tableId: "6040Table2", + tableName: "维护工艺路线工序表", + columnProp: "jjgzUnitPrice", + headerAlign: "center", + align: "right", + columnLabel: "每件计价", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table2JJGZUnitFactor', + tableId: "6040Table2", + tableName: "维护工艺路线工序表", + columnProp: "jjgzUnitFactor", + headerAlign: "center", + align: "left", + columnLabel: "计价单位", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table2Crewsize', + tableId: "6040Table2", + tableName: "维护工艺路线工序表", + columnProp: "crewsize", + headerAlign: "center", + align: "left", + columnLabel: "操作工人数", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table2WorkCenterType', + tableId: "6040Table2", + tableName: "维护工艺路线工序表", + columnProp: "workCenterType", + headerAlign: "center", + align: "left", + columnLabel: "加工中心类型", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table2WXPartNo', + tableId: "6040Table2", + tableName: "维护工艺路线工序表", + columnProp: "wxPartNo", + headerAlign: "center", + align: "left", + columnLabel: "费用结算料号", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 120 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table2WXSpec', + tableId: "6040Table2", + tableName: "维护工艺路线工序表", + columnProp: "wxSpec", + headerAlign: "center", + align: "left", + columnLabel: "费用结算物料名称/规格", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 250 }, - columnList:[ - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040TablePartNo', - tableId: "6040Table", - tableName: "维护工艺路线数据表", - columnProp: "partNo", - headerAlign: "center", - align: "left", - columnLabel: "物料编码", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 100 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040TableSpec', - tableId: "6040Table", - tableName: "维护工艺路线数据表", - columnProp: "spec", - headerAlign: "center", - align: "left", - columnLabel: "名称/规格", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 120 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040TableRoutingType', - tableId: "6040Table", - tableName: "维护工艺路线数据表", - columnProp: "routingType", - headerAlign: "center", - align: "left", - columnLabel: "工艺路线类型", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 80 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040TableRevNo', - tableId: "6040Table", - tableName: "维护工艺路线数据表", - columnProp: "revNo", - headerAlign: "center", - align: "left", - columnLabel: "版本号", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 60 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040TablePhaseInDate', - tableId: "6040Table", - tableName: "维护工艺路线数据表", - columnProp: "phaseInDate", - headerAlign: "center", - align: "left", - columnLabel: "启用日期", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 80 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040TablePhaseOutDate', - tableId: "6040Table", - tableName: "维护工艺路线数据表", - columnProp: "phaseOutDate", - headerAlign: "center", - align: "left", - columnLabel: "停用日期", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 80 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040TableStatus', - tableId: "6040Table", - tableName: "维护工艺路线数据表", - columnProp: "status", - headerAlign: "center", - align: "left", - columnLabel: "状态", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 40 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040TableSite', - tableId: "6040Table", - tableName: "维护工艺路线数据表", - columnProp: "site", - headerAlign: "center", - align: "left", - columnLabel: "工厂编码", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 60 - }, - ], - columnList2:[ - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table2ItemNo', - tableId: "6040Table2", - tableName: "维护工艺路线工序表", - columnProp: "itemNo", - headerAlign: "center", - align: "right", - columnLabel: "工序号", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 60 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table2OperationDesc', - tableId: "6040Table2", - tableName: "维护工艺路线工序表", - columnProp: "operationDesc", - headerAlign: "center", - align: "left", - columnLabel: "工序名称", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 300 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table2WorkCenterNo', - tableId: "6040Table2", - tableName: "维护工艺路线工序表", - columnProp: "workCenterNo", - headerAlign: "center", - align: "left", - columnLabel: "加工中心编码", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 100 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table2WorkCenterDesc', - tableId: "6040Table2", - tableName: "维护工艺路线工序表", - columnProp: "workCenterDesc", - headerAlign: "center", - align: "left", - columnLabel: "加工中心名称", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 100 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table2MachSetupTime', - tableId: "6040Table2", - tableName: "维护工艺路线工序表", - columnProp: "machSetupTime", - headerAlign: "center", - align: "right", - columnLabel: "准备时间(小时)", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 100 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table2MachRunFactor', - tableId: "6040Table2", - tableName: "维护工艺路线工序表", - columnProp: "machRunFactor", - headerAlign: "center", - align: "right", - columnLabel: "单位产出量", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 100 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table2FactorUnit', - tableId: "6040Table2", - tableName: "维护工艺路线工序表", - columnProp: "factorUnit", - headerAlign: "center", - align: "left", - columnLabel: "产出单位", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 100 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table2Efficiency', - tableId: "6040Table2", - tableName: "维护工艺路线工序表", - columnProp: "efficiency", - headerAlign: "center", - align: "right", - columnLabel: "效率(%)", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 80 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table2Remark', - tableId: "6040Table2", - tableName: "维护工艺路线工序表", - columnProp: "remark", - headerAlign: "center", - align: "left", - columnLabel: "备注", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 160 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table2JJGZUnitPrice', - tableId: "6040Table2", - tableName: "维护工艺路线工序表", - columnProp: "jjgzUnitPrice", - headerAlign: "center", - align: "right", - columnLabel: "每件计价", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 100 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table2JJGZUnitFactor', - tableId: "6040Table2", - tableName: "维护工艺路线工序表", - columnProp: "jjgzUnitFactor", - headerAlign: "center", - align: "left", - columnLabel: "计价单位", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 100 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table2Crewsize', - tableId: "6040Table2", - tableName: "维护工艺路线工序表", - columnProp: "crewsize", - headerAlign: "center", - align: "left", - columnLabel: "操作工人数", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 100 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table2WorkCenterType', - tableId: "6040Table2", - tableName: "维护工艺路线工序表", - columnProp: "workCenterType", - headerAlign: "center", - align: "left", - columnLabel: "加工中心类型", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 100 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table2WXPartNo', - tableId: "6040Table2", - tableName: "维护工艺路线工序表", - columnProp: "wxPartNo", - headerAlign: "center", - align: "left", - columnLabel: "费用结算料号", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 120 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table2WXSpec', - tableId: "6040Table2", - tableName: "维护工艺路线工序表", - columnProp: "wxSpec", - headerAlign: "center", - align: "left", - columnLabel: "费用结算物料名称/规格", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 250 - }, - ], - columnList3:[ - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table3RevNo', - tableId: "6040Table3", - tableName: "维护工艺路线工具表", - columnProp: "revNo", - headerAlign: "center", - align: "left", - columnLabel: "版本号", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 80 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table3ItemNo', - tableId: "6040Table3", - tableName: "维护工艺路线工具表", - columnProp: "itemNo", - headerAlign: "center", - align: "right", - columnLabel: "工序号", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 80 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table3ToolID', - tableId: "6040Table3", - tableName: "维护工艺路线工具表", - columnProp: "toolID", - headerAlign: "center", - align: "left", - columnLabel: "工具编号", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 150 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table3ToolDescription', - tableId: "6040Table3", - tableName: "维护工艺路线工具表", - columnProp: "toolDescription", - headerAlign: "center", - align: "left", - columnLabel: "工具名称", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 200 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table3Spec', - tableId: "6040Table3", - tableName: "维护工艺路线工具表", - columnProp: "spec", - headerAlign: "center", - align: "left", - columnLabel: "规格型号", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 150 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table3ToolQty', - tableId: "6040Table3", - tableName: "维护工艺路线工具表", - columnProp: "toolQty", - headerAlign: "center", - align: "right", - columnLabel: "工具数量", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 80 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table3Active', - tableId: "6040Table3", - tableName: "维护工艺路线工具表", - columnProp: "active", - headerAlign: "center", - align: "left", - columnLabel: "在用", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 60 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table3FamilyID', - tableId: "6040Table3", - tableName: "维护工艺路线工具表", - columnProp: "familyID", - headerAlign: "center", - align: "left", - columnLabel: "工具分类", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 100 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table3FamilyName', - tableId: "6040Table3", - tableName: "维护工艺路线工具表", - columnProp: "familyName", - headerAlign: "center", - align: "left", - columnLabel: "工具分类名称", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 150 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table3Remark', - tableId: "6040Table3", - tableName: "维护工艺路线工具表", - columnProp: "remark", - headerAlign: "center", - align: "left", - columnLabel: "备注", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 200 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table3CreateDate', - tableId: "6040Table3", - tableName: "维护工艺路线工具表", - columnProp: "createDate", - headerAlign: "center", - align: "left", - columnLabel: "录入日期", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 160 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table3CreatedBy', - tableId: "6040Table3", - tableName: "维护工艺路线工具表", - columnProp: "createdBy", - headerAlign: "center", - align: "left", - columnLabel: "录入人", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 100 - }, - ], - columnList4:[ - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table4ResourceID', - tableId: "6040Table4", - tableName: "维护工艺路线可用机台表", - columnProp: "resourceID", - headerAlign: "center", - align: "left", - columnLabel: "机台编码", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 70 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table4ResourceDesc', - tableId: "6040Table4", - tableName: "维护工艺路线可用机台表", - columnProp: "resourceDesc", - headerAlign: "center", - align: "left", - columnLabel: "机台名称", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 160 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table4Active', - tableId: "6040Table4", - tableName: "维护工艺路线可用机台表", - columnProp: "active", - headerAlign: "center", - align: "left", - columnLabel: "在用", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 50 - }, - ], - columnList5:[ - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table5ResourceID', - tableId: "6040Table5", - tableName: "维护工艺路线已选机台表", - columnProp: "resourceID", - headerAlign: "center", - align: "left", - columnLabel: "机台编码", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 70 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table5ResourceDesc', - tableId: "6040Table5", - tableName: "维护工艺路线已选机台表", - columnProp: "resourceDesc", - headerAlign: "center", - align: "left", - columnLabel: "机台名称", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 160 - }, - { - userId: this.$store.state.user.name, - functionId: 6040, - serialNumber: '6040Table5Active', - tableId: "6040Table5", - tableName: "维护工艺路线已选机台表", - columnProp: "active", - headerAlign: "center", - align: "left", - columnLabel: "在用", - columnHidden: false, - columnImage: false, - columnSortable: false, - sortLv: 0, - status: true, - fixed: false, - columnWidth: 50 - }, - ], - routingModelFlag:false, - detailData:{ - itemNo:'', - operationDesc:'', - workCenterNo:'', - machSetupTime:'', - machRunFactor:'', - factorUnit:'', - jjgzUnitPrice:'', - jjgzUnitFactor:'', - efficiency:'', - crewsize:'', - remark:'', - site:'', - partNo:'', - revNo:'', - add:'', - user:'', + ], + columnList3: [ + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table3RevNo', + tableId: "6040Table3", + tableName: "维护工艺路线工具表", + columnProp: "revNo", + headerAlign: "center", + align: "left", + columnLabel: "版本号", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 80 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table3ItemNo', + tableId: "6040Table3", + tableName: "维护工艺路线工具表", + columnProp: "itemNo", + headerAlign: "center", + align: "right", + columnLabel: "工序号", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 80 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table3ToolID', + tableId: "6040Table3", + tableName: "维护工艺路线工具表", + columnProp: "toolID", + headerAlign: "center", + align: "left", + columnLabel: "工具编号", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 150 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table3ToolDescription', + tableId: "6040Table3", + tableName: "维护工艺路线工具表", + columnProp: "toolDescription", + headerAlign: "center", + align: "left", + columnLabel: "工具名称", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 200 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table3Spec', + tableId: "6040Table3", + tableName: "维护工艺路线工具表", + columnProp: "spec", + headerAlign: "center", + align: "left", + columnLabel: "规格型号", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 150 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table3ToolQty', + tableId: "6040Table3", + tableName: "维护工艺路线工具表", + columnProp: "toolQty", + headerAlign: "center", + align: "right", + columnLabel: "工具数量", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 80 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table3Active', + tableId: "6040Table3", + tableName: "维护工艺路线工具表", + columnProp: "active", + headerAlign: "center", + align: "left", + columnLabel: "在用", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 60 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table3FamilyID', + tableId: "6040Table3", + tableName: "维护工艺路线工具表", + columnProp: "familyID", + headerAlign: "center", + align: "left", + columnLabel: "工具分类", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 100 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table3FamilyName', + tableId: "6040Table3", + tableName: "维护工艺路线工具表", + columnProp: "familyName", + headerAlign: "center", + align: "left", + columnLabel: "工具分类名称", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 150 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table3Remark', + tableId: "6040Table3", + tableName: "维护工艺路线工具表", + columnProp: "remark", + headerAlign: "center", + align: "left", + columnLabel: "备注", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 200 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table3CreateDate', + tableId: "6040Table3", + tableName: "维护工艺路线工具表", + columnProp: "createDate", + headerAlign: "center", + align: "left", + columnLabel: "录入日期", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 160 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table3CreatedBy', + tableId: "6040Table3", + tableName: "维护工艺路线工具表", + columnProp: "createdBy", + headerAlign: "center", + align: "left", + columnLabel: "录入人", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 100 + }, + ], + columnList4: [ + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table4ResourceID', + tableId: "6040Table4", + tableName: "维护工艺路线可用机台表", + columnProp: "resourceID", + headerAlign: "center", + align: "left", + columnLabel: "机台编码", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 70 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table4ResourceDesc', + tableId: "6040Table4", + tableName: "维护工艺路线可用机台表", + columnProp: "resourceDesc", + headerAlign: "center", + align: "left", + columnLabel: "机台名称", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 160 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table4Active', + tableId: "6040Table4", + tableName: "维护工艺路线可用机台表", + columnProp: "active", + headerAlign: "center", + align: "left", + columnLabel: "在用", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 50 + }, + ], + columnList5: [ + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table5ResourceID', + tableId: "6040Table5", + tableName: "维护工艺路线已选机台表", + columnProp: "resourceID", + headerAlign: "center", + align: "left", + columnLabel: "机台编码", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 70 + }, + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table5ResourceDesc', + tableId: "6040Table5", + tableName: "维护工艺路线已选机台表", + columnProp: "resourceDesc", + headerAlign: "center", + align: "left", + columnLabel: "机台名称", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 160 }, - tagNo2:'', + { + userId: this.$store.state.user.name, + functionId: 6040, + serialNumber: '6040Table5Active', + tableId: "6040Table5", + tableName: "维护工艺路线已选机台表", + columnProp: "active", + headerAlign: "center", + align: "left", + columnLabel: "在用", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 50 + }, + ], + routingModelFlag: false, + detailData: { + itemNo: '', + operationDesc: '', + workCenterNo: '', + machSetupTime: '', + machRunFactor: '', + factorUnit: '', + jjgzUnitPrice: '', + jjgzUnitFactor: '', + efficiency: '', + crewsize: '', + remark: '', + site: '', + partNo: '', + revNo: '', + add: '', + user: '', + }, + tagNo2: '', + } + }, + watch: { + toolData: { + deep: true, + handler: function (newV, oldV) { + this.toolData.toolID = this.toolData.toolID.toUpperCase() } }, - watch: { - toolData: { - deep: true, - handler: function (newV, oldV) { - this.toolData.toolID = this.toolData.toolID.toUpperCase() - } - }, - detailData: { - deep: true, - handler: function (newV, oldV) { - this.detailData.workCenterNo = this.detailData.workCenterNo.toUpperCase() - } + detailData: { + deep: true, + handler: function (newV, oldV) { + this.detailData.workCenterNo = this.detailData.workCenterNo.toUpperCase() } + } + }, + mounted() { + this.$nextTick(() => { + this.height = window.innerHeight - 310; + }) + }, + methods: { + editRoutingHeaderModel(row) { + this.routingHeaderData = { + partNo: row.partNo, + site: row.site, + status: row.status, + revNo: row.revNo, + phaseInDate: row.phaseInDate, + phaseOutDate: row.phaseOutDate, + routingType: row.routingType, + remark: row.remark, + defaultflag: row.defaultflag, + repairFlag: row.repairFlag, + add: 1, + }; + this.routingHeaderInputFlag = true; + this.routingHeaderModelFlag = true; }, - mounted() { - this.$nextTick(() => { - this.height = window.innerHeight - 310; - }) + addRoutingHeaderModel() { + this.routingHeaderData = { + partNo: '', + site: this.$store.state.user.site, + status: '试验', + revNo: '', + phaseInDate: new Date(), + phaseOutDate: null, + routingType: '制造', + remark: '', + defaultflag: 'Y', + repairFlag: 'N', + add: 0, + }; + this.routingHeaderInputFlag = false; + this.routingHeaderModelFlag = true; }, - methods: { - editRoutingHeaderModel(row){ - this.routingHeaderData={ - partNo:row.partNo, - site:row.site, - status:row.status, - revNo:row.revNo, - phaseInDate:row.phaseInDate, - phaseOutDate:row.phaseOutDate, - routingType:row.routingType, - remark:row.remark, - defaultflag:row.defaultflag, - repairFlag:row.repairFlag, - add:1, - }; - this.routingHeaderInputFlag=true; - this.routingHeaderModelFlag=true; - }, - addRoutingHeaderModel(){ - this.routingHeaderData={ - partNo:'', - site:this.$store.state.user.site, - status:'试验', - revNo:'', - phaseInDate:new Date(), - phaseOutDate:null, - routingType:'制造', - remark:'', - defaultflag:'Y', - repairFlag:'N', - add:0, - }; - this.routingHeaderInputFlag=false; - this.routingHeaderModelFlag=true; - }, - saveRoutingHeaderData(){ - if(this.routingHeaderData.partNo==''||this.routingHeaderData.partNo==null){ - this.$alert("请输入工艺路线号!",'错误',{ - confirmButtonText:'确定' - }) - return false; - } - if(this.routingHeaderData.revNo==''||this.routingHeaderData.revNo==null){ - this.$alert("请输入版本号!",'错误',{ - confirmButtonText:'确定' + saveRoutingHeaderData() { + if (this.routingHeaderData.partNo == '' || this.routingHeaderData.partNo == null) { + this.$alert("请输入工艺路线号!", '错误', { + confirmButtonText: '确定' + }) + return false; + } + if (this.routingHeaderData.revNo == '' || this.routingHeaderData.revNo == null) { + this.$alert("请输入版本号!", '错误', { + confirmButtonText: '确定' + }) + return false; + } + if (this.routingHeaderData.phaseInDate == '' || this.routingHeaderData.phaseInDate == null) { + this.$alert("请选择启用日期!", '错误', { + confirmButtonText: '确定' + }) + return false; + } + saveRoutingHeaderData(this.routingHeaderData).then(({data}) => { + if (data && data.code == 200) { + this.routingHeaderModelFlag = false + this.searchRoutingWithPartNo(); + this.$message.success('操作成功') + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' }) - return false; } - if(this.routingHeaderData.phaseInDate==''||this.routingHeaderData.phaseInDate==null){ - this.$alert("请选择启用日期!",'错误',{ - confirmButtonText:'确定' - }) - return false; + }) + }, + deleteRoutingHeaderData(row) { + this.$confirm(`是否删除此工艺路线的所有数据?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + let inData = { + site: row.site, + partNo: row.partNo, + revNo: row.revNo, } - saveRoutingHeaderData(this.routingHeaderData).then(({data}) => { + deleteRoutingHeaderData(inData).then(({data}) => { if (data && data.code == 200) { - this.routingHeaderModelFlag = false this.searchRoutingWithPartNo(); - this.$message.success('操作成功') } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }) - }, - deleteRoutingHeaderData(row){ - this.$confirm(`是否删除此工艺路线的所有数据?`, '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - let inData = { - site: row.site, - partNo: row.partNo, - revNo: row.revNo, - } - deleteRoutingHeaderData(inData).then(({data}) => { - if (data && data.code == 200) { - this.searchRoutingWithPartNo(); - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) - } - }) - }) - }, - getBaseData(val){ - if (this.tagNo === 24){ - this.detailData.workCenterNo = val.WorkCenterNo + }) + }, + getBaseData(val) { + if (this.tagNo === 24) { + this.detailData.workCenterNo = val.WorkCenterNo + } + if (this.tagNo === 70) { + this.toolData.toolID = val.ToolID + this.getToolDesc(); + } + if (this.tagNo === 5) { + if (this.tagNo2 === 1) { + this.copyRoutingData.partNo1 = val.PartNo + this.getPartDescription(); + } else { + this.routingHeaderData.partNo = val.PartNo } - if (this.tagNo === 70){ - this.toolData.toolID = val.ToolID - this.getToolDesc(); + } + }, + // 获取基础数据列表 + getBaseList(val, val2) { + this.tagNo = val + this.tagNo2 = val2 + this.$nextTick(() => { + let strVal = ""; + if (val === 24) { + strVal = this.detailData.workCenterNo } - if (this.tagNo === 5){ - if(this.tagNo2===1) { - this.copyRoutingData.partNo1 = val.PartNo - this.getPartDescription(); - }else { - this.routingHeaderData.partNo= val.PartNo + if (val === 70) { + strVal = this.toolData.toolID + if (this.toolmodelInputFlag) { + return false } } - }, - // 获取基础数据列表 - getBaseList(val,val2){ - this.tagNo = val - this.tagNo2 = val2 - this.$nextTick(() => { - let strVal = ""; - if (val === 24){ - strVal = this.detailData.workCenterNo - } - if (val === 70){ - strVal = this.toolData.toolID - if(this.toolmodelInputFlag){ - return false - } - } - if (val === 5){ - if(val2===1) { - strVal = this.copyRoutingData.partNo1 - }else { - strVal = this.routingHeaderData.partNo - } + if (val === 5) { + if (val2 === 1) { + strVal = this.copyRoutingData.partNo1 + } else { + strVal = this.routingHeaderData.partNo } - this.$refs.baseList.init(val,strVal) - }) - }, - addRoutingDetail(){ - if(this.mainData.partNo==null||this.mainData.partNo==''){ - this.$alert("请选择物料号!", '错误', { - confirmButtonText: '确定' - }) - return false; } - let itemNo; - if(this.dataList2===[]||this.dataList2.length==0){ - itemNo=10; - }else { - itemNo=this.dataList2[0].itemNo; - for (let i = 0; i < this.dataList2.length; i++) { - if(itemNo { + this.currentRow = null; + if (data && data.code == 200) { + this.detailmodelFlag = false + let data1 = { + site: this.mainData.site, + partNo: this.mainData.partNo, + revNo: this.mainData.revNo, + } + searchRoutingDetailData(data1).then(({data}) => { + + if (data.total == 0) { + this.dataList2 = [] + } else { + this.dataList2 = data.rows; + } }) - return false; - } - if(this.detailData.jjgzUnitPrice===''||this.detailData.jjgzUnitPrice==null){ - this.$alert("请输入计价单价!",'错误',{ - confirmButtonText:'确定' - }) - return false; - } - if(this.detailData.crewsize===''||this.detailData.crewsize==null){ - this.$alert("请输入操作员人数!",'错误',{ - confirmButtonText:'确定' - }) - return false; - } - if(this.detailData.efficiency===''||this.detailData.efficiency==null){ - this.$alert("请输入效率!",'错误',{ - confirmButtonText:'确定' - }) - return false; - } - if(this.detailData.efficiency<=0){ - this.$alert("效率必须大于0!",'错误',{ - confirmButtonText:'确定' + + this.$message.success('操作成功') + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' }) - return false; } - saveRoutingDetailData(this.detailData).then(({data}) => { - this.currentRow=null; + }) + }, + deleteRoutingDetail() { + if (this.currentRow == null) { + this.$alert("请选择工艺路线工序!", '错误', { + confirmButtonText: '确定' + }) + return false; + } + this.$confirm(`是否删除此工艺路线工序?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + + }).then(() => { + deleteRoutingDetail(this.currentRow).then(({data}) => { + this.currentRow = null; if (data && data.code == 200) { - this.detailmodelFlag = false - let data1={ + let data1 = { site: this.mainData.site, - partNo:this.mainData.partNo, - revNo:this.mainData.revNo, + partNo: this.mainData.partNo, + revNo: this.mainData.revNo, } searchRoutingDetailData(data1).then(({data}) => { - - if(data.total==0){ - this.dataList2=[] - }else { - this.dataList2=data.rows; + this.dataList2 = data.rows; + }) + this.$message({ + message: '删除成功', + type: 'success', + duration: 1500, + onClose: () => { } }) - - this.$message.success('操作成功') + this.$message.success('删除成功') } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }) - }, - deleteRoutingDetail(){ - if(this.currentRow==null){ - this.$alert("请选择工艺路线工序!", '错误', { - confirmButtonText: '确定' + }) + }, + tableHanddle(row) { + let data = { + partNo: row.partNo, + site: row.site, + revNo: row.revNo, + } + searchRoutingWithPartNo(data).then(({data}) => { + if (data.rows.length > 0) { + if (data.rows[0].repairFlag == 'Y') { + data.rows[0].repairFlag = true; + } else { + data.rows[0].repairFlag = false; + } + if (data.rows[0].defaultflag == 'Y') { + data.rows[0].defaultflag = true; + } else { + data.rows[0].defaultflag = false; + } + this.mainData = data.rows[0] + let data1 = { + site: data.rows[0].site, + partNo: data.rows[0].partNo, + revNo: data.rows[0].revNo, + } + searchRoutingDetailData(data1).then(({data}) => { + this.dataList2 = data.rows; }) - return false; - } - this.$confirm(`是否删除此工艺路线工序?`, '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - - }).then(() => { - deleteRoutingDetail(this.currentRow).then(({data}) => { - this.currentRow=null; - if (data && data.code == 200) { - let data1={ - site: this.mainData.site, - partNo:this.mainData.partNo, - revNo:this.mainData.revNo, - } - searchRoutingDetailData(data1).then(({data}) => { - this.dataList2=data.rows; - }) - this.$message({ - message: '删除成功', - type: 'success', - duration: 1500, - onClose: () => { - } - }) - this.$message.success('删除成功') - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) - } + searchRoutingToolData(data1).then(({data}) => { + this.dataList3 = data.rows; }) - }) - }, - tableHanddle(row) { - let data={ - partNo:row.partNo, - site:row.site, - revNo:row.revNo, } - searchRoutingWithPartNo(data).then(({data}) => { - if(data.rows.length>0){ - if(data.rows[0].repairFlag=='Y'){ - data.rows[0].repairFlag=true; - }else { - data.rows[0].repairFlag=false; - } - if(data.rows[0].defaultflag=='Y'){ - data.rows[0].defaultflag=true; - }else { - data.rows[0].defaultflag=false; - } - this.mainData = data.rows[0] - let data1={ - site: data.rows[0].site, - partNo:data.rows[0].partNo, - revNo:data.rows[0].revNo, - } - searchRoutingDetailData(data1).then(({data}) => { - this.dataList2=data.rows; - }) - searchRoutingToolData(data1).then(({data}) => { - this.dataList3=data.rows; - }) - } - }) - this.modelFlag = false; + }) + this.modelFlag = false; - }, - getResourceModel(){ - if(this.currentRow==null){ - this.$alert("请选择工艺路线工序!", '错误', { - confirmButtonText: '确定' - }) - return false; - } - let data1={ - site:this.mainData.site, - workCenterNo:this.currentRow.workCenterNo, - } - searchAllResource(data1).then(({data}) => { - this.resourceList1 = data.rows + }, + getResourceModel() { + if (this.currentRow == null) { + this.$alert("请选择工艺路线工序!", '错误', { + confirmButtonText: '确定' }) - let data2={ - site:this.mainData.site, - partNo:this.mainData.partNo, - revNo:this.currentRow.revNo, - itemNo:this.currentRow.itemNo - } - searchUsedResource(data2).then(({data}) => { - this.resourceList2 = data.rows + return false; + } + let data1 = { + site: this.mainData.site, + workCenterNo: this.currentRow.workCenterNo, + } + searchAllResource(data1).then(({data}) => { + this.resourceList1 = data.rows + }) + let data2 = { + site: this.mainData.site, + partNo: this.mainData.partNo, + revNo: this.currentRow.revNo, + itemNo: this.currentRow.itemNo + } + searchUsedResource(data2).then(({data}) => { + this.resourceList2 = data.rows + }) + this.routingModelFlag = true; + }, + getSearchModal() { + this.searchPartNo = ''; + this.searchRoutingWithPartNo(); + this.modelFlag = true; + }, + editRoutingDetail() { + if (this.currentRow == null) { + this.$alert("请选择工艺路线工序!", '错误', { + confirmButtonText: '确定' }) - this.routingModelFlag=true; - }, - getSearchModal() { - this.searchPartNo = ''; - this.searchRoutingWithPartNo(); - this.modelFlag = true; - }, - editRoutingDetail(){ - if(this.currentRow==null){ - this.$alert("请选择工艺路线工序!", '错误', { - confirmButtonText: '确定' - }) - return false; - } - this. detailData={ - itemNo:this.currentRow.itemNo, - operationDesc:this.currentRow.operationDesc, - workCenterNo:this.currentRow.workCenterNo, - machSetupTime:this.currentRow.machSetupTime, - machRunFactor:this.currentRow.machRunFactor, - factorUnit:this.currentRow.factorUnit, - jjgzUnitPrice:this.currentRow.jjgzUnitPrice, - jjgzUnitFactor:this.currentRow.jjgzUnitFactor, - efficiency:this.currentRow.efficiency, - crewsize:this.currentRow.crewsize, - remark:this.currentRow.remark, - add:1, - partNo:this.mainData.partNo, - revNo:this.mainData.revNo, - site:this.mainData.site, - user:this.$store.state.user.name, + return false; + } + this.detailData = { + itemNo: this.currentRow.itemNo, + operationDesc: this.currentRow.operationDesc, + workCenterNo: this.currentRow.workCenterNo, + machSetupTime: this.currentRow.machSetupTime, + machRunFactor: this.currentRow.machRunFactor, + factorUnit: this.currentRow.factorUnit, + jjgzUnitPrice: this.currentRow.jjgzUnitPrice, + jjgzUnitFactor: this.currentRow.jjgzUnitFactor, + efficiency: this.currentRow.efficiency, + crewsize: this.currentRow.crewsize, + remark: this.currentRow.remark, + add: 1, + partNo: this.mainData.partNo, + revNo: this.mainData.revNo, + site: this.mainData.site, + user: this.$store.state.user.name, + } + this.detailmodelInputFlag = true; + this.detailmodelFlag = true; + }, + searchRoutingWithPartNo() { + let data = { + partNo: this.searchPartNo + } + searchRoutingWithPartNo(data).then(({data}) => { + this.dataList = data.rows + }) + }, + clickData(row) { + this.currentRow = JSON.parse(JSON.stringify(row)); + }, + clickData2(row) { + this.currentRow2 = JSON.parse(JSON.stringify(row)); + }, + clickData3(row) { + this.currentRow3 = JSON.parse(JSON.stringify(row)); + }, + clickData4(row) { + this.currentRow4 = JSON.parse(JSON.stringify(row)); + }, + addResource() { + if (this.currentRow3 == null) { + this.$alert("请选择可选机台!", '错误', { + confirmButtonText: '确定' + }) + return false; + } + let inData = { + site: this.mainData.site, + partNo: this.mainData.partNo, + revNo: this.mainData.revNo, + itemNo: this.currentRow.itemNo, + resourceID: this.currentRow3.resourceID + } + addRoutingResource(inData).then(({data}) => { + + if (data && data.code == 200) { + let data2 = { + site: this.mainData.site, + partNo: this.mainData.partNo, + revNo: this.currentRow.revNo, + itemNo: this.currentRow.itemNo + } + searchUsedResource(data2).then(({data}) => { + this.resourceList2 = data.rows + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) } - this.detailmodelInputFlag=true; - this.detailmodelFlag=true; - }, - searchRoutingWithPartNo() { - let data={ - partNo:this.searchPartNo + }) + }, + addRoutingTool() { + if (this.mainData.partNo == null || this.mainData.partNo == '') { + this.$alert("请选择物料号!", '错误', { + confirmButtonText: '确定' + }) + return false; + } + this.toolData = { + site: this.mainData.site, + partNo: this.mainData.partNo, + revNo: this.mainData.revNo, + itemNo: '', + operationDesc: '', + toolID: '', + toolDescription: '', + spec: '', + toolQty: '', + remark: '', + user: this.$store.state.user.name, + add: 0, + }; + this.selectList = []; + let data = { + site: this.mainData.site, + partNo: this.mainData.partNo, + revNo: this.mainData.revNo, + } + getItemSelect(data).then(({data}) => { + let list = data.rows; + for (let i = 0; i < list.length; i++) { + let resultData = { + value: list[i].itemNo, + label: list[i].itemNo + } + this.selectList.push(resultData); } - searchRoutingWithPartNo(data).then(({data}) => { - this.dataList = data.rows + }) + this.toolmodelInputFlag = false; + this.ToolmodelFlag = true; + }, + editRoutingTool() { + if (this.currentRow2 == null) { + this.$alert("请选择工具!", '错误', { + confirmButtonText: '确定' }) - }, - clickData(row){ - this.currentRow = JSON.parse(JSON.stringify(row)); - }, - clickData2(row){ - this.currentRow2 = JSON.parse(JSON.stringify(row)); - }, - clickData3(row){ - this.currentRow3 = JSON.parse(JSON.stringify(row)); - }, - clickData4(row){ - this.currentRow4 = JSON.parse(JSON.stringify(row)); - }, - addResource(){ - if(this.currentRow3==null){ - this.$alert("请选择可选机台!", '错误', { + return false; + } + this.toolData = { + site: this.mainData.site, + partNo: this.mainData.partNo, + revNo: this.mainData.revNo, + itemNo: this.currentRow2.itemNo, + operationDesc: this.currentRow2.operationDesc, + toolID: this.currentRow2.toolID, + toolDescription: this.currentRow2.toolDescription, + spec: this.currentRow2.spec, + toolQty: this.currentRow2.toolQty, + remark: this.currentRow2.remark, + user: this.$store.state.user.name, + add: 1, + }; + this.getOperationDesc(); + this.toolmodelInputFlag = true; + this.ToolmodelFlag = true; + }, + saveRoutingTool() { + if (this.toolData.itemNo == '' || this.toolData.itemNo == null) { + this.$alert("请选择工序号!", '错误', { + confirmButtonText: '确定' + }) + return false; + } + if (this.toolData.toolID == '' || this.toolData.toolID == null) { + this.$alert("请输入工具编号!", '错误', { + confirmButtonText: '确定' + }) + return false; + } + if (this.toolData.toolQty == '' || this.toolData.toolQty == null) { + this.$alert("请输入工具数量!", '错误', { + confirmButtonText: '确定' + }) + return false; + } + saveRoutingTool(this.toolData).then(({data}) => { + this.currentRow2 = null; + if (data && data.code == 200) { + this.ToolmodelFlag = false + let data1 = { + site: this.mainData.site, + partNo: this.mainData.partNo, + revNo: this.mainData.revNo, + } + searchRoutingToolData(data1).then(({data}) => { + this.dataList3 = data.rows; + }) + this.$message.success('操作成功') + } else { + this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) - return false; } - let inData={ + }) + }, + deleteRoutingTool() { + if (this.currentRow2 == null) { + this.$alert("请选择工具!", '错误', { + confirmButtonText: '确定' + }) + return false; + } + this.$confirm(`是否删除此工具信息?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + let delDate = { site: this.mainData.site, - partNo:this.mainData.partNo, - revNo:this.mainData.revNo, - itemNo:this.currentRow.itemNo, - resourceID:this.currentRow3.resourceID + partNo: this.mainData.partNo, + revNo: this.mainData.revNo, + itemNo: this.currentRow2.itemNo, + toolID: this.currentRow2.toolID, } - addRoutingResource(inData).then(({data}) => { - + deleteRoutingTool(delDate).then(({data}) => { + this.currentRow2 = null; if (data && data.code == 200) { - let data2={ - site:this.mainData.site, - partNo:this.mainData.partNo, - revNo:this.currentRow.revNo, - itemNo:this.currentRow.itemNo + this.ToolmodelFlag = false + let data1 = { + site: this.mainData.site, + partNo: this.mainData.partNo, + revNo: this.mainData.revNo, } - searchUsedResource(data2).then(({data}) => { - this.resourceList2 = data.rows + searchRoutingToolData(data1).then(({data}) => { + this.dataList3 = data.rows; }) + this.$message.success('删除成功') } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }) - }, - addRoutingTool(){ - if(this.mainData.partNo==null||this.mainData.partNo==''){ - this.$alert("请选择物料号!", '错误', { - confirmButtonText: '确定' - }) - return false; + }) + }, + getOperationDesc() { + let data = { + site: this.mainData.site, + partNo: this.mainData.partNo, + revNo: this.mainData.revNo, + itemNo: this.toolData.itemNo + } + getItemSelect(data).then(({data}) => { + if (data.rows.length > 0) { + this.toolData.operationDesc = data.rows[0].operationDesc } - this.toolData={ - site:this.mainData.site, - partNo:this.mainData.partNo, - revNo:this.mainData.revNo, - itemNo:'', - operationDesc:'', - toolID:'', - toolDescription:'', - spec:'', - toolQty:'', - remark:'', - user:this.$store.state.user.name, - add:0, - }; - this.selectList=[]; - let data={ - site:this.mainData.site, - partNo:this.mainData.partNo, - revNo:this.mainData.revNo, + }) + }, + getToolDesc() { + let data = { + site: this.mainData.site, + toolID: this.toolData.toolID + } + getToolDesc(data).then(({data}) => { + if (data.rows.length > 0) { + this.toolData.toolDescription = data.rows[0].toolDescription + this.toolData.spec = data.rows[0].spec } - getItemSelect(data).then(({data}) => { - let list=data.rows; - for (let i = 0; i { + let inData = { + site: this.mainData.site, + partNo: this.mainData.partNo, + revNo: this.mainData.revNo, + itemNo: this.currentRow.itemNo, + resourceID: this.currentRow4.resourceID } - saveRoutingTool(this.toolData).then(({data}) => { - this.currentRow2=null; + deleteRoutingResource(inData).then(({data}) => { if (data && data.code == 200) { - this.ToolmodelFlag = false - let data1={ + this.currentRow4 = null; + let data2 = { site: this.mainData.site, - partNo:this.mainData.partNo, - revNo:this.mainData.revNo, + partNo: this.mainData.partNo, + revNo: this.currentRow.revNo, + itemNo: this.currentRow.itemNo } - searchRoutingToolData(data1).then(({data}) => { - this.dataList3=data.rows; + searchUsedResource(data2).then(({data}) => { + this.resourceList2 = data.rows }) - this.$message.success('操作成功') } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }) - }, - deleteRoutingTool(){ - if(this.currentRow2==null){ - this.$alert("请选择工具!", '错误', { - confirmButtonText: '确定' - }) - return false; - } - this.$confirm(`是否删除此工具信息?`, '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - let delDate={ - site:this.mainData.site, - partNo:this.mainData.partNo, - revNo:this.mainData.revNo, - itemNo:this.currentRow2.itemNo, - toolID:this.currentRow2.toolID, - } - deleteRoutingTool(delDate).then(({data}) => { - this.currentRow2=null; - if (data && data.code == 200) { - this.ToolmodelFlag = false - let data1={ - site: this.mainData.site, - partNo:this.mainData.partNo, - revNo:this.mainData.revNo, - } - searchRoutingToolData(data1).then(({data}) => { - this.dataList3=data.rows; - }) - this.$message.success('删除成功') - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) - } - }) + }) + }, + jumpWorkCenter() { + if (this.currentRow == null) { + this.$alert("请选择工艺路线工序!", '错误', { + confirmButtonText: '确定' }) - }, - getOperationDesc(){ - let data={ - site:this.mainData.site, - partNo:this.mainData.partNo, - revNo:this.mainData.revNo, - itemNo:this.toolData.itemNo - } - getItemSelect(data).then(({data}) => { - if(data.rows.length>0){ - this.toolData.operationDesc=data.rows[0].operationDesc - } + return false; + } + let inData = { + user: this.$store.state.user.name, + site: this.currentRow.site, + workCenterNo: this.currentRow.workCenterNo + }; + localStorage.setItem('workCenterNo', JSON.stringify(inData)) + this.$router.replace('base-workCenter') + }, + jumpToolInfo() { + if (this.currentRow2 == null) { + this.$alert("请选择工具!", '错误', { + confirmButtonText: '确定' }) - }, - getToolDesc(){ - let data={ - site:this.mainData.site, - toolID:this.toolData.toolID - } - getToolDesc(data).then(({data}) => { - if(data.rows.length>0){ - this.toolData.toolDescription=data.rows[0].toolDescription - this.toolData.spec=data.rows[0].spec - } + return false; + } + let inData = { + site: this.$store.state.user.site, + toolId: this.currentRow2.toolID, + toolDescription: this.currentRow2.toolDescription + }; + localStorage.setItem('toolInfo', JSON.stringify(inData)) + this.$router.replace('knifemold-tool-info') + }, + getPartDetail() { + if (this.mainData.partNo == null || this.mainData.partNo == '') { + this.$alert("请选择物料编码!", '错误', { + confirmButtonText: '确定' }) - }, - deleteResource(){ - if(this.currentRow4==null){ - this.$alert("请选择已选机台!", '错误', { + return false; + } + let inData = { + user: this.$store.state.user.name, + site: this.mainData.site, + partNo: this.mainData.partNo + } + searchPartNoData(inData).then(({data}) => { + if (data.rows.length == 0) { + this.$alert("该物料编码不存在", '错误', { confirmButtonText: '确定' }) return false; } - this.$confirm(`是否删除此机台?`, '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - - }).then(() => { - let inData = { - site: this.mainData.site, - partNo: this.mainData.partNo, - revNo: this.mainData.revNo, - itemNo: this.currentRow.itemNo, - resourceID: this.currentRow4.resourceID - } - deleteRoutingResource(inData).then(({data}) => { - if (data && data.code == 200) { - this.currentRow4 = null; - let data2 = { - site: this.mainData.site, - partNo: this.mainData.partNo, - revNo: this.currentRow.revNo, - itemNo: this.currentRow.itemNo + this.partData = data.rows[0]; + this.partFlag = true; + }) + }, + changeStatus() { + if (this.mainData.partNo == null || this.mainData.partNo == '') { + this.$alert("请选择物料编码!", '错误', { + confirmButtonText: '确定' + }) + return false; + } + this.status = this.mainData.status; + this.statusFlag = true; + }, + saveStatus() { + if (this.status == this.mainData.status) { + this.$alert("该物料状态为" + this.status + ",不需要修改!", '错误', { + confirmButtonText: '确定' + }) + return false; + } + let inData = { + partNo: this.mainData.partNo, + site: this.mainData.site, + revNo: this.mainData.revNo, + status: this.status + } + changeRoutingStatus(inData).then(({data}) => { + if (data && data.code == 200) { + this.statusFlag = false + searchRoutingWithPartNo(inData).then(({data}) => { + if (data.rows.length > 0) { + if (data.rows[0].repairFlag == 'Y') { + data.rows[0].repairFlag = true; + } else { + data.rows[0].repairFlag = false; + } + if (data.rows[0].defaultflag == 'Y') { + data.rows[0].defaultflag = true; + } else { + data.rows[0].defaultflag = false; } - searchUsedResource(data2).then(({data}) => { - this.resourceList2 = data.rows + this.mainData = data.rows[0] + let data1 = { + site: data.rows[0].site, + partNo: data.rows[0].partNo, + revNo: data.rows[0].revNo, + } + searchRoutingDetailData(data1).then(({data}) => { + this.dataList2 = data.rows; }) - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' + searchRoutingToolData(data1).then(({data}) => { + this.dataList3 = data.rows; }) } + }) - }) - }, - jumpWorkCenter(){ - if(this.currentRow==null){ - this.$alert("请选择工艺路线工序!", '错误', { - confirmButtonText: '确定' - }) - return false; - } - let inData={user:this.$store.state.user.name,site:this.currentRow.site,workCenterNo:this.currentRow.workCenterNo}; - localStorage.setItem('workCenterNo', JSON.stringify(inData)) - this.$router.replace('base-workCenter') - }, - jumpToolInfo(){ - if(this.currentRow2==null){ - this.$alert("请选择工具!", '错误', { - confirmButtonText: '确定' - }) - return false; - } - let inData={site:this.$store.state.user.site,toolId:this.currentRow2.toolID,toolDescription:this.currentRow2.toolDescription}; - localStorage.setItem('toolInfo', JSON.stringify(inData)) - this.$router.replace('knifemold-tool-info') - }, - getPartDetail(){ - if(this.mainData.partNo==null||this.mainData.partNo==''){ - this.$alert("请选择物料编码!", '错误', { + this.$message.success('操作成功') + } else { + this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) - return false; - } - let inData={ - user:this.$store.state.user.name, - site:this.mainData.site, - partNo:this.mainData.partNo } - searchPartNoData(inData).then(({data}) => { - if (data.rows.length==0){ - this.$alert("该物料编码不存在", '错误', { - confirmButtonText: '确定' - }) - return false; - } - this.partData = data.rows[0]; - this.partFlag=true; + }) + }, + tongBuOrder() { + if (this.mainData.partNo == null || this.mainData.partNo == '') { + this.$alert("请选择物料编码!", '错误', { + confirmButtonText: '确定' }) - }, - changeStatus(){ - if(this.mainData.partNo==null||this.mainData.partNo==''){ - this.$alert("请选择物料编码!", '错误', { - confirmButtonText: '确定' - }) - return false; - } - this.status=this.mainData.status; - this.statusFlag=true; - }, - saveStatus(){ - if(this.status==this.mainData.status){ - this.$alert("该物料状态为"+this.status+",不需要修改!", '错误', { - confirmButtonText: '确定' - }) - return false; - } - let inData={ - partNo:this.mainData.partNo, - site:this.mainData.site, - revNo:this.mainData.revNo, - status:this.status + return false; + } + if (this.mainData.partNo == '999998' || this.mainData.partNo == '999999') { + this.$alert("特殊订单无法同步!", '错误', { + confirmButtonText: '确定' + }) + return false; + } + this.$confirm(`确定要把该工艺路线同步到该产品的未开工生产订单上吗?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + let inData = { + partNo: this.mainData.partNo, + site: this.mainData.site, + revNo: this.mainData.revNo, + user: this.$store.state.user.name, } - changeRoutingStatus(inData).then(({data}) => { + checkRoutingAndOrder(inData).then(({data}) => { if (data && data.code == 200) { - this.statusFlag = false - searchRoutingWithPartNo(inData).then(({data}) => { - if(data.rows.length>0){ - if(data.rows[0].repairFlag=='Y'){ - data.rows[0].repairFlag=true; - }else { - data.rows[0].repairFlag=false; - } - if(data.rows[0].defaultflag=='Y'){ - data.rows[0].defaultflag=true; - }else { - data.rows[0].defaultflag=false; - } - this.mainData = data.rows[0] - let data1={ - site: data.rows[0].site, - partNo:data.rows[0].partNo, - revNo:data.rows[0].revNo, + this.$confirm('有' + data.obj + '个生产订单将会被同步,是否继续?', '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + }).then(() => { + changeOrderRouting(inData).then(({data}) => { + if (data && data.code == 200) { + this.$message.success('操作成功') + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) } - searchRoutingDetailData(data1).then(({data}) => { - this.dataList2=data.rows; - }) - searchRoutingToolData(data1).then(({data}) => { - this.dataList3=data.rows; - }) - } - + }) }) - this.$message.success('操作成功') } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }) + }) + }, + copyRouting() { + if (this.mainData.partNo == null || this.mainData.partNo == '') { + this.$alert("请选择物料编码!", '错误', { + confirmButtonText: '确定' + }) + return false; + } + this.copyRoutingData = { + partNo: this.mainData.partNo, + partDescription: this.mainData.spec, + revNo: this.mainData.revNo, + phaseInDate: this.mainData.phaseInDate, + repairFlag: this.mainData.repairFlag, + partNo1: '', + partDescription1: '', + revNo1: '', + phaseInDate1: new Date(), + repairFlag1: false, + oldFlag: false, + toolFlag: false, + resourceFlag: false, }, - tongBuOrder(){ - if(this.mainData.partNo==null||this.mainData.partNo==''){ - this.$alert("请选择物料编码!", '错误', { - confirmButtonText: '确定' - }) - return false; - } - if(this.mainData.partNo=='999998'||this.mainData.partNo=='999999'){ - this.$alert("特殊订单无法同步!", '错误', { - confirmButtonText: '确定' - }) - return false; - } - this.$confirm(`确定要把该工艺路线同步到该产品的未开工生产订单上吗?`, '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - let inData={ - partNo:this.mainData.partNo, - site:this.mainData.site, - revNo:this.mainData.revNo, - user:this.$store.state.user.name, + this.copyRoutingModelFlag = true; + }, + saveCopyRouting() { + if (this.copyRoutingData.partNo1 == '' || this.copyRoutingData.partNo1 == null) { + this.$alert("请输入新物料号!", '错误', { + confirmButtonText: '确定' + }) + return false; + } + if (this.copyRoutingData.revNo1 == '' || this.copyRoutingData.revNo1 == null) { + this.$alert("请输入新版本号!", '错误', { + confirmButtonText: '确定' + }) + return false; + } + if (this.copyRoutingData.phaseInDate1 == '' || this.copyRoutingData.phaseInDate1 == null) { + this.$alert("请选择新启用日期!", '错误', { + confirmButtonText: '确定' + }) + return false; + } + let repairFlag1 = 'N'; + if (this.copyRoutingData.repairFlag1 === true) { + repairFlag1 = 'Y'; + } + let inData = { + site: this.mainData.site, + partNo: this.copyRoutingData.partNo, + revNo: this.copyRoutingData.revNo, + partNo1: this.copyRoutingData.partNo1, + revNo1: this.copyRoutingData.revNo1, + phaseInDate1: this.copyRoutingData.phaseInDate1, + repairFlag1: repairFlag1, + oldFlag: this.copyRoutingData.oldFlag, + toolFlag: this.copyRoutingData.toolFlag, + resourceFlag: this.copyRoutingData.resourceFlag, + user: this.$store.state.user.name + } + saveCopyRouting(inData).then(({data}) => { + if (data && data.code == 200) { + this.copyRoutingModelFlag = false + let data = { + partNo: this.mainData.partNo, + site: this.mainData.site, + revNo: this.mainData.revNo, } - checkRoutingAndOrder(inData).then(({data}) => { - if (data && data.code == 200) { - this.$confirm('有'+data.obj+'个生产订单将会被同步,是否继续?', '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - changeOrderRouting(inData).then(({data}) =>{ - if (data && data.code == 200) { - this.$message.success('操作成功') - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) - } - }) + searchRoutingWithPartNo(data).then(({data}) => { + if (data.rows.length > 0) { + if (data.rows[0].repairFlag == 'Y') { + data.rows[0].repairFlag = true; + } else { + data.rows[0].repairFlag = false; + } + if (data.rows[0].defaultflag == 'Y') { + data.rows[0].defaultflag = true; + } else { + data.rows[0].defaultflag = false; + } + this.mainData = data.rows[0] + let data1 = { + site: data.rows[0].site, + partNo: data.rows[0].partNo, + revNo: data.rows[0].revNo, + } + searchRoutingDetailData(data1).then(({data}) => { + this.dataList2 = data.rows; }) - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' + searchRoutingToolData(data1).then(({data}) => { + this.dataList3 = data.rows; }) } + }) - }) - }, - copyRouting(){ - if(this.mainData.partNo==null||this.mainData.partNo==''){ - this.$alert("请选择物料编码!", '错误', { + this.$message.success('操作成功') + + let row = { + partNo: this.copyRoutingData.partNo1, + site: this.mainData.site, + revNo: this.copyRoutingData.revNo1, + } + this.tableHanddle(row) + } else { + this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) - return false; - } - this.copyRoutingData={ - partNo:this.mainData.partNo, - partDescription:this.mainData.spec, - revNo:this.mainData.revNo, - phaseInDate:this.mainData.phaseInDate, - repairFlag:this.mainData.repairFlag, - partNo1:'', - partDescription1:'', - revNo1:'', - phaseInDate1:new Date(), - repairFlag1:false, - oldFlag:false, - toolFlag:false, - resourceFlag:false, - }, - this.copyRoutingModelFlag=true; - }, - saveCopyRouting(){ - if(this.copyRoutingData.partNo1==''||this.copyRoutingData.partNo1==null){ - this.$alert("请输入新物料号!",'错误',{ - confirmButtonText:'确定' - }) - return false; } - if(this.copyRoutingData.revNo1==''||this.copyRoutingData.revNo1==null){ - this.$alert("请输入新版本号!",'错误',{ - confirmButtonText:'确定' - }) - return false; - } - if(this.copyRoutingData.phaseInDate1==''||this.copyRoutingData.phaseInDate1==null){ - this.$alert("请选择新启用日期!",'错误',{ - confirmButtonText:'确定' - }) + }) + }, + getPartDescription() { + let inData = { + user: this.$store.state.user.name, + site: this.mainData.site, + partNo: this.copyRoutingData.partNo1 + } + searchPartNoData(inData).then(({data}) => { + if (data.rows.length == 0) { return false; } - let repairFlag1='N'; - if(this.copyRoutingData.repairFlag1===true){ - repairFlag1='Y'; - } - let inData={ - site:this.mainData.site, - partNo:this.copyRoutingData.partNo, - revNo:this.copyRoutingData.revNo, - partNo1:this.copyRoutingData.partNo1, - revNo1:this.copyRoutingData.revNo1, - phaseInDate1:this.copyRoutingData.phaseInDate1, - repairFlag1:repairFlag1, - oldFlag:this.copyRoutingData.oldFlag, - toolFlag:this.copyRoutingData.toolFlag, - resourceFlag:this.copyRoutingData.resourceFlag, - user:this.$store.state.user.name + this.copyRoutingData.partDescription1 = data.rows[0].partDescription; + }) + + }, + setDefault() { + if (this.mainData.partNo == null || this.mainData.partNo == '') { + this.$alert("请选择物料编码!", '错误', { + confirmButtonText: '确定' + }) + return false; + } + this.$confirm(`是否将此工艺路线版本设为默认?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + + }).then(() => { + let data1 = { + site: this.mainData.site, + partNo: this.mainData.partNo, + revNo: this.mainData.revNo, } - saveCopyRouting(inData).then(({data}) => { + setDefault(data1).then(({data}) => { if (data && data.code == 200) { - this.copyRoutingModelFlag = false - let data={ - partNo:this.mainData.partNo, - site:this.mainData.site, - revNo:this.mainData.revNo, - } - searchRoutingWithPartNo(data).then(({data}) => { - if(data.rows.length>0){ - if(data.rows[0].repairFlag=='Y'){ - data.rows[0].repairFlag=true; - }else { - data.rows[0].repairFlag=false; - } - if(data.rows[0].defaultflag=='Y'){ - data.rows[0].defaultflag=true; - }else { - data.rows[0].defaultflag=false; - } - this.mainData = data.rows[0] - let data1={ - site: data.rows[0].site, - partNo:data.rows[0].partNo, - revNo:data.rows[0].revNo, - } - searchRoutingDetailData(data1).then(({data}) => { - this.dataList2=data.rows; - }) - searchRoutingToolData(data1).then(({data}) => { - this.dataList3=data.rows; - }) - } + this.mainData.defaultflag = true; + this.$message.success('操作成功') - }) - this.$message.success('操作成功') } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }) - }, - getPartDescription(){ - let inData={ - user:this.$store.state.user.name, - site:this.mainData.site, - partNo:this.copyRoutingData.partNo1 - } - searchPartNoData(inData).then(({data}) => { - if (data.rows.length==0){ - return false; - } - this.copyRoutingData.partDescription1 = data.rows[0].partDescription; - }) - - }, - setDefault(){ - if(this.mainData.partNo==null||this.mainData.partNo==''){ - this.$alert("请选择物料编码!", '错误', { - confirmButtonText: '确定' - }) - return false; - } - this.$confirm(`是否将此工艺路线版本设为默认?`, '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - - }).then(() => { - let data1 = { - site: this.mainData.site, - partNo: this.mainData.partNo, - revNo: this.mainData.revNo, - } - setDefault(data1).then(({data}) => { - if (data && data.code == 200) { - this.mainData.defaultflag=true; - this.$message.success('操作成功') - - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) - } - }) - }) - }, + }) }, - created() { + }, + created() { - } } + }