diff --git a/src/api/base/site.js b/src/api/base/site.js index c91e09e..2d1419e 100644 --- a/src/api/base/site.js +++ b/src/api/base/site.js @@ -143,3 +143,16 @@ export const saveRoutingHeaderData = data => createAPI(`/base/saveRoutingHeaderD export const deleteRoutingHeaderData = data => createAPI(`/base/deleteRoutingHeaderData`,'post',data) //查询SORouting表 export const getSORoutingData = data => createAPI(`/base/getSORoutingData`,'post',data) +//保存SORouting表 +export const saveSORoutingData= data => createAPI(`/base/saveSORoutingData`,'post',data) + +//SORouting表 +export const deleteSORoutingData= data => createAPI(`/base/deleteSORoutingData`,'post',data) + +//获取SORouting机台数据 +export const searchSORoutingResource= data => createAPI(`/base/searchSORoutingResource`,'post',data) +//添加机台 +export const addSORoutingResource= data => createAPI(`/base/addSORoutingResource`,'post',data) + +//删除可用机台 +export const deleteSORoutingResource= data => createAPI(`/base/deleteSORoutingResource`,'post',data) diff --git a/src/views/modules/base/maintainProductRouting.vue b/src/views/modules/base/maintainProductRouting.vue index 2ac6bd8..615c710 100644 --- a/src/views/modules/base/maintainProductRouting.vue +++ b/src/views/modules/base/maintainProductRouting.vue @@ -1595,8 +1595,7 @@ machRunFactor:0, factorUnit:null, jjgzUnitPrice:0, - jjgzUnitFactor:'', - efficiency:0, + efficiency:100, crewsize:0, remark:'', add:0, @@ -1652,6 +1651,12 @@ }) return false; } + if(this.detailData.efficiency<=0){ + this.$alert("效率必须大于0!",'错误',{ + confirmButtonText:'确定' + }) + return false; + } saveRoutingDetailData(this.detailData).then(({data}) => { this.currentRow=null; if (data && data.code == 200) { diff --git a/src/views/modules/common/updateProductRouting.vue b/src/views/modules/common/updateProductRouting.vue index 2ffe62c..4e879e2 100644 --- a/src/views/modules/common/updateProductRouting.vue +++ b/src/views/modules/common/updateProductRouting.vue @@ -19,6 +19,7 @@ 新增 编辑 删除 + {{'可用机台'}} @@ -84,6 +86,7 @@ @@ -106,6 +109,74 @@ + + + + 可选机台: + + + + + + + +
+ 添加机台>> +
+
+ 删除机台<< +
+
+ + 已选机台: + + + + + + +
+
@@ -113,6 +184,12 @@ import Chooselist from '@/views/modules/common/Chooselist' import { getSORoutingData, + saveSORoutingData, + deleteSORoutingData, + searchAllResource, + searchSORoutingResource, + addSORoutingResource, + deleteSORoutingResource }from "@/api/base/site.js" export default { name: "updateProductRouting", @@ -132,8 +209,12 @@ addModelFlag:false, height:350, dataList:[], + resourceList1:[], + resourceList2:[], dataListLoading:false, currentRow:null, + currentRow2:null, + currentRow3:null, columnList:[ { userId: this.$store.state.user.name, @@ -512,11 +593,123 @@ remark:'', site:'', partNo:'', - revNo:'', add:'', user:'', }, detailmodelInputFlag:false, + routingModelFlag:false, + columnList2:[ + { + userId: this.$store.state.user.name, + functionId: 6099, + serialNumber: '6099Table2ResourceID', + tableId: "6099Table2", + 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: 6099, + serialNumber: '6099Table2ResourceDesc', + tableId: "6099Table2", + 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: 6099, + serialNumber: '6099Table2Active', + tableId: "6099Table2", + tableName: "维护工艺路线可用机台表", + columnProp: "active", + headerAlign: "center", + align: "left", + columnLabel: "在用", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 50 + }, + ], + columnList3:[ + { + userId: this.$store.state.user.name, + functionId: 6099, + serialNumber: '6099Table3ResourceID', + tableId: "6099Table3", + 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: 6099, + serialNumber: '6099Table3ResourceDesc', + tableId: "6099Table3", + 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: 6099, + serialNumber: '6099Table3Active', + tableId: "6099Table3", + tableName: "维护工艺路线已选机台表", + columnProp: "active", + headerAlign: "center", + align: "left", + columnLabel: "在用", + columnHidden: false, + columnImage: false, + columnSortable: false, + sortLv: 0, + status: true, + fixed: false, + columnWidth: 50 + }, + ], } }, mounted() { @@ -570,17 +763,16 @@ itemNo:'', operationDesc:'', workCenterNo:'', - machSetupTime:'', - machRunFactor:'', + machSetupTime:0, + machRunFactor:1, factorUnit:'单位/小时', - planStartTime:'', - planFinishTime:'', + planStartTime:new Date(), + planFinishTime:new Date(), efficiency:'', - crewsize:'', + crewsize:100, remark:'', - site:'', - partNo:'', - revNo:'', + site:this.searchData.site, + partNo:this.searchData.partNo, add:0, user:this.$store.state.user.name, }; @@ -619,12 +811,235 @@ remark:this.currentRow.remark, site:this.currentRow.site, partNo:this.currentRow.partNo, - revNo:this.currentRow.revNo, add:1, user:this.$store.state.user.name, } this.addModelFlag=true; }, + saveSORoutingData(){ + if(this.detailData.itemNo==''||this.detailData.itemNo==null){ + this.$alert("请输入工序号!",'错误',{ + confirmButtonText:'确定' + }) + return false; + } + if(this.detailData.operationDesc==''||this.detailData.operationDesc==null){ + this.$alert("请输入工序名称!",'错误',{ + confirmButtonText:'确定' + }) + return false; + } + if(this.detailData.machSetupTime===''||this.detailData.machSetupTime==null){ + this.$alert("请输入准备时间!",'错误',{ + confirmButtonText:'确定' + }) + return false; + } + if(this.detailData.workCenterNo==''||this.detailData.workCenterNo==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.machRunFactor===''||this.detailData.machRunFactor==null){ + this.$alert("请输入单位产出量!",'错误',{ + confirmButtonText:'确定' + }) + return false; + } + if(this.detailData.machRunFactor<=0){ + this.$alert("单位产出量必须大于0!",'错误',{ + confirmButtonText:'确定' + }) + return false; + } + + if(this.detailData.efficiency<=0){ + this.$alert("效率必须大于0!",'错误',{ + confirmButtonText:'确定' + }) + return false; + } + let inData={ + itemNo:this.detailData.itemNo, + operationDesc:this.detailData.operationDesc, + workCenterNo:this.detailData.workCenterNo, + machSetupTime:this.detailData.machSetupTime, + machRunFactor:this.detailData.machRunFactor, + factorUnit:this.detailData.factorUnit, + planStartTime:this.detailData.planStartTime, + planFinishTime:this.detailData.planFinishTime, + efficiency:this.detailData.efficiency, + crewsize:this.detailData.crewsize, + remark:this.detailData.remark, + site:this.detailData.site, + partNo:this.detailData.partNo, + orderNo:this.searchData.orderNo, + add:this.detailData.add, + user:this.$store.state.user.name, + } + saveSORoutingData(inData).then(({data}) => { + this.currentRow=null; + if (data && data.code == 200) { + this.addModelFlag = false + this.getData(); + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + deleteSORoutingData(){ + if(this.currentRow==null){ + this.$alert("请选择工序!", '错误', { + confirmButtonText: '确定' + }) + return false; + } + this.$confirm(`是否删除此工艺路线工序?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + + }).then(() => { + deleteSORoutingData(this.currentRow).then(({data}) => { + this.currentRow=null; + if (data && data.code == 200) { + this.getData(); + this.$message({ + message: '删除成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }) + }, + clickData3(row){ + this.currentRow3 = JSON.parse(JSON.stringify(row)); + }, + clickData2(row){ + this.currentRow2 = JSON.parse(JSON.stringify(row)); + }, + getResourceModel(){ + if(this.currentRow==null){ + this.$alert("请选择工艺路线工序!", '错误', { + confirmButtonText: '确定' + }) + return false; + } + let data1={ + site:this.searchData.site, + workCenterNo:this.currentRow.workCenterNo, + } + searchAllResource(data1).then(({data}) => { + this.resourceList1 = data.rows + }) + let data2={ + site:this.searchData.site, + orderNo:this.searchData.orderNo, + itemNo:this.currentRow.itemNo + } + searchSORoutingResource(data2).then(({data}) => { + this.resourceList2 = data.rows + }) + this.routingModelFlag=true; + }, + addResource(){ + if(this.currentRow2==null){ + this.$alert("请选择可选机台!", '错误', { + confirmButtonText: '确定' + }) + return false; + } + let inData={ + site: this.currentRow.site, + orderNo:this.currentRow.orderNo, + itemNo:this.currentRow.itemNo, + resourceID:this.currentRow2.resourceID + } + addSORoutingResource(inData).then(({data}) => { + + if (data && data.code == 200) { + let data2={ + site:this.searchData.site, + orderNo:this.searchData.orderNo, + itemNo:this.currentRow.itemNo + } + searchSORoutingResource(data2).then(({data}) => { + this.resourceList2 = data.rows + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + deleteResource(){ + if(this.currentRow3==null){ + this.$alert("请选择已选机台!", '错误', { + confirmButtonText: '确定' + }) + return false; + } + this.$confirm(`是否删除此机台?`, '提示', { + confirmButtonText: '确定', + cancelButtonText: '取消', + type: 'warning' + + }).then(() => { + let inData = { + site: this.currentRow.site, + orderNo:this.currentRow.orderNo, + itemNo:this.currentRow.itemNo, + resourceID: this.currentRow3.resourceID + } + deleteSORoutingResource(inData).then(({data}) => { + if (data && data.code == 200) { + this.currentRow3 = null; + let data2={ + site:this.searchData.site, + orderNo:this.searchData.orderNo, + itemNo:this.currentRow.itemNo + } + searchSORoutingResource(data2).then(({data}) => { + this.resourceList2 = data.rows + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }) + }, }, created() { diff --git a/src/views/modules/schedule/order_schedule.vue b/src/views/modules/schedule/order_schedule.vue index 6b45546..e3dfc34 100644 --- a/src/views/modules/schedule/order_schedule.vue +++ b/src/views/modules/schedule/order_schedule.vue @@ -182,11 +182,11 @@
重新排产 - - - - - +
+ 更改工艺路线 + 更改工艺路线版本
查看物料库存