From 36da09165a3acb54340ca39e86491bcb97515fcf Mon Sep 17 00:00:00 2001 From: ruanqi Date: Wed, 19 Jan 2022 18:16:13 +0800 Subject: [PATCH] =?UTF-8?q?=E7=BB=B4=E6=8A=A4=E5=B7=A5=E8=89=BA=E8=B7=AF?= =?UTF-8?q?=E7=BA=BF=20=20rq?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/base/site.js | 6 + .../modules/base/maintainProductRouting.vue | 261 ++++++++++++++++-- .../searchProductProcessRoute.vue | 2 +- 3 files changed, 245 insertions(+), 24 deletions(-) diff --git a/src/api/base/site.js b/src/api/base/site.js index 2600820..bf130a8 100644 --- a/src/api/base/site.js +++ b/src/api/base/site.js @@ -127,3 +127,9 @@ export const getToolDesc = data => createAPI(`/base/getToolDesc`,'post',data) export const saveRoutingTool = data => createAPI(`/base/saveRoutingTool`,'post',data) //删除工具 export const deleteRoutingTool= data => createAPI(`/base/deleteRoutingTool`,'post',data) +//修改状态 +export const changeRoutingStatus= data => createAPI(`/base/changeRoutingStatus`,'post',data) +//修改状态 +export const checkRoutingAndOrder= data => createAPI(`/base/checkRoutingAndOrder`,'post',data) +//修改订单工艺路线 +export const changeOrderRouting= data => createAPI(`/base/changeOrderRouting`,'post',data) diff --git a/src/views/modules/base/maintainProductRouting.vue b/src/views/modules/base/maintainProductRouting.vue index c03354b..484e692 100644 --- a/src/views/modules/base/maintainProductRouting.vue +++ b/src/views/modules/base/maintainProductRouting.vue @@ -13,6 +13,8 @@ + {{'物料信息'}} + {{'更改状态'}} @@ -30,6 +32,7 @@ + {{'同步工艺路线到订单'}} @@ -310,6 +313,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 关闭 + + + + + + + + + + + + + 保存 + 关闭 + + + @@ -329,6 +382,10 @@ getToolDesc, saveRoutingTool, deleteRoutingTool, + searchPartNoData, + changeRoutingStatus, + checkRoutingAndOrder, + changeOrderRouting, }from "@/api/base/site.js" import Chooselist from '@/views/modules/common/Chooselist' export default { @@ -346,6 +403,7 @@ currentRow2:null, currentRow:null, tagNo:'', + status:'', dataListLoading: false, searchPartNo:'', height:200, @@ -363,12 +421,24 @@ defaultflag:'', repairFlag:'', }, + partData:{ + partNo:'', + partDescription:'', + site:'', + createDate:'', + umid:'', + active:'', + configurationTemplateID:'', + modelFlag:'', + }, activeName:'first', modelFlag:false, ToolmodelFlag:false, detailmodelFlag:false, detailmodelInputFlag:false, toolmodelInputFlag:false, + partFlag:false, + statusFlag:false, dataList:[], dataList2:[], dataList3:[], @@ -1659,30 +1729,37 @@ }) return false; } - 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 - } - searchUsedResource(data2).then(({data}) => { - this.resourceList2 = data.rows - }) - } else { - this.$alert(data.msg, '错误', { - confirmButtonText: '确定' - }) + 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 + } + searchUsedResource(data2).then(({data}) => { + this.resourceList2 = data.rows + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) }) }, jumpWorkCenter(){ @@ -1707,6 +1784,144 @@ localStorage.setItem('toolInfo', JSON.stringify(inData)) this.$router.replace('knifemold-tool-info') }, + getPartDetail(){ + if(this.mainData.partNo==null||this.mainData.partNo==''){ + this.$alert("请选择物料编码!", '错误', { + 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; + }) + }, + 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; + } + 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.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }, + tongBuOrder(){ + if(this.mainData.partNo==null||this.mainData.partNo==''){ + 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, + } + 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({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }) + }, }, created() { diff --git a/src/views/modules/productProcessRoute/searchProductProcessRoute.vue b/src/views/modules/productProcessRoute/searchProductProcessRoute.vue index dd050f7..003d905 100644 --- a/src/views/modules/productProcessRoute/searchProductProcessRoute.vue +++ b/src/views/modules/productProcessRoute/searchProductProcessRoute.vue @@ -128,7 +128,7 @@ - +