diff --git a/src/api/base/site.js b/src/api/base/site.js index 974d0ab..bf130a8 100644 --- a/src/api/base/site.js +++ b/src/api/base/site.js @@ -119,3 +119,17 @@ export const searchUsedResource= data => createAPI(`/base/searchUsedResource`,'p export const addRoutingResource= data => createAPI(`/base/addRoutingResource`,'post',data) //删除机台 export const deleteRoutingResource= data => createAPI(`/base/deleteRoutingResource`,'post',data) +//工序下拉框 +export const getItemSelect= data => createAPI(`/base/getItemSelect`,'post',data) +//工具信息 +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 5bae528..0f54731 100644 --- a/src/views/modules/base/maintainProductRouting.vue +++ b/src/views/modules/base/maintainProductRouting.vue @@ -13,6 +13,8 @@ + {{'物料信息'}} + {{'更改状态'}} @@ -30,6 +32,7 @@ + {{'同步工艺路线到订单'}} @@ -79,6 +82,7 @@ {{'新增'}} {{'修改'}} {{'删除'}} + {{'工具信息'}} 关闭 - + - + + + + - + - - + + 工具编号: + - + - + - + - + - 保存 + 保存 关闭 @@ -300,6 +313,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + 关闭 + + + + + + + + + + + + + 保存 + 关闭 + + + @@ -315,6 +378,14 @@ searchAllResource, addRoutingResource, deleteRoutingResource, + getItemSelect, + getToolDesc, + saveRoutingTool, + deleteRoutingTool, + searchPartNoData, + changeRoutingStatus, + checkRoutingAndOrder, + changeOrderRouting, }from "@/api/base/site.js" import Chooselist from '@/views/modules/common/Chooselist' export default { @@ -324,6 +395,7 @@ }, data () { return { + selectList:[], resourceList1:[], resourceList2:[], currentRow4:null, @@ -331,6 +403,7 @@ currentRow2:null, currentRow:null, tagNo:'', + status:'', dataListLoading: false, searchPartNo:'', height:200, @@ -348,11 +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:[], @@ -361,12 +447,14 @@ partNo:'', revNo:'', itemNo:'', - site:'', - site:'', - site:'', - site:'', - site:'', - site:'', + operationDesc:'', + toolID:'', + toolDescription:'', + spec:'', + toolQty:'', + remark:'', + user:'', + add:'', }, columnList:[ { @@ -1149,8 +1237,9 @@ if (this.tagNo === 24){ this.detailData.workCenterNo = val.WorkCenterNo } - if (this.tagNo === 91){ - this.modelData3.calendarID = val.CalendarID + if (this.tagNo === 70){ + this.toolData.toolID = val.ToolID + this.getToolDesc(); } }, // 获取基础数据列表 @@ -1161,8 +1250,8 @@ if (val === 24){ strVal = this.detailData.workCenterNo } - if (val === 91){ - strVal = this.modelData3.calendarID + if (val === 70){ + strVal = this.toolData.toolID } this.$refs.baseList.init(val,strVal) }) @@ -1197,7 +1286,7 @@ this.detailmodelFlag=true; }, - saveRoutingDetailData(){ + saveRoutingDetailData(){ if(this.detailData.itemNo==''||this.detailData.itemNo==null){ this.$alert("请输入工序号!",'错误',{ confirmButtonText:'确定' @@ -1453,33 +1542,107 @@ }) }, 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 { + 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.currentRow4=null; - let data2={ - site:this.mainData.site, + this.ToolmodelFlag = false + let data1={ + site: this.mainData.site, partNo:this.mainData.partNo, - revNo:this.currentRow.revNo, - itemNo:this.currentRow.itemNo + revNo:this.mainData.revNo, } - searchUsedResource(data2).then(({data}) => { - this.resourceList2 = data.rows + searchRoutingToolData(data1).then(({data}) => { + this.dataList3=data.rows; + }) + this.$message({ + message: '操作成功', + type: 'success', + duration: 1500, + onClose: () => { + } }) } else { this.$alert(data.msg, '错误', { @@ -1488,6 +1651,117 @@ } }) }, + 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({ + message: '删除成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + 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 + } + }) + }, + 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 + } + }) + }, + deleteResource(){ + if(this.currentRow4==null){ + 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 + } + searchUsedResource(data2).then(({data}) => { + this.resourceList2 = data.rows + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定' + }) + } + }) + }) + }, jumpWorkCenter(){ if(this.currentRow==null){ this.$alert("请选择工艺路线工序!", '错误', { @@ -1499,6 +1773,156 @@ 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("请选择物料编码!", '错误', { + 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, + user:this.$store.state.user.name, + } + 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 @@ - +