diff --git a/src/api/production/dailyPlan.js b/src/api/production/dailyPlan.js index fcb9ccc..b1174a6 100644 --- a/src/api/production/dailyPlan.js +++ b/src/api/production/dailyPlan.js @@ -31,3 +31,5 @@ export const changeSoScheduledListSeqNo=data => createAPI(`/dailyPlan/changeSoS export const resourceCapacityLoadingData=data => createAPI(`/dailyPlan/resourceCapacityLoadingData`,'post',data) // export const checkScheduleLoad=data => createAPI(`/dailyPlan/checkScheduleLoad`,'post',data) +// 获取 +export const getProduceScheduleList = data => createAPI('/dailyPlan/getProduceScheduleData', 'POST', data) diff --git a/src/api/production/pallet.js b/src/api/production/pallet.js index f2fa29f..27f289b 100644 --- a/src/api/production/pallet.js +++ b/src/api/production/pallet.js @@ -8,7 +8,7 @@ export const savePallet=data => createAPI(`/pallet/savePallet`,'post',data) export const savePalletAdds=data => createAPI(`/pallet/savePalletAdds`,'post',data) export const printPallet=data => createAPI(`/pallet/printPallet`,'post',data) - +export const printSerialNo=data => createAPI(`/pallet/printSerialNo`,'post',data) //获取位置数据 export const getLocationData=data => createAPI(`/pallet/getLocationData`,'post',data) //保存位置数据 diff --git a/src/views/modules/production/dailyPlan.vue b/src/views/modules/production/dailyPlan.vue index b41600b..e8d568b 100644 --- a/src/views/modules/production/dailyPlan.vue +++ b/src/views/modules/production/dailyPlan.vue @@ -1,8 +1,8 @@ - + 查询条件 - + @@ -37,20 +37,21 @@ - - + + - - 排序 - + + 排序 + + 要求完工日期 @@ -61,9 +62,9 @@ - + 排产信息 - + @@ -71,12 +72,12 @@ - + 机台: - + - + 查询 - + 修改计划顺序 - - - - 多日排产 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + + + 多日排产 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -577,79 +578,84 @@ - - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + + - - - - - - - - + + + + + + + + - - - - - - - 删除 - 当日负荷 - - - + + + + + + + 删除 + 当日负荷 + + + 关闭 @@ -712,57 +718,59 @@ - - - - - - - - - - - - - - - + + + + + + + + + + + + + + + 保存 关闭 - + @@ -788,6 +796,7 @@ } from '@/api/prd.js' import Chooselist from '@/views/modules/common/Chooselist' + export default { name: 'dailyPlan', components: { @@ -795,55 +804,55 @@ }, data () { return { - sumTime:'', + sumTime: '', shiftNoList: [], - tagNo:'', - tagNo2:'', - height:200, - searchData:{ - orderNo:'', - date1:'', - date2:'', - partNo:'', - date3:'', - date4:'', - sortField:'order by needDate', - scheduleDate:new Date(), - site:this.$store.state.user.site, - workCenterNo:'', - resourceId:'', - shiftNo:'', - itemNo:'', + tagNo: '', + tagNo2: '', + height: 200, + searchData: { + orderNo: '', + date1: '', + date2: '', + partNo: '', + date3: '', + date4: '', + sortField: 'order by needDate', + scheduleDate: new Date(), + site: this.$store.state.user.site, + workCenterNo: '', + resourceId: '', + shiftNo: '', + itemNo: '', }, - schedulingModalData:{ - orderNo:'', - site:'', - needDate:'', - lotSize:'', - qtyToSchedule:'', - partNo:'', - partDesc:'', - itemNo:'', - itemDesc:'', - workCenterNo:'', - scheduleDate:'', - scheduleQty:'', - resourceId:'', - shiftNo:'', - sumQty:'', + schedulingModalData: { + orderNo: '', + site: '', + needDate: '', + lotSize: '', + qtyToSchedule: '', + partNo: '', + partDesc: '', + itemNo: '', + itemDesc: '', + workCenterNo: '', + scheduleDate: '', + scheduleQty: '', + resourceId: '', + shiftNo: '', + sumQty: '', }, - scheduledModalFlag:false, - hasScheduledModalFlag:false, - changeModalFlag:false, - allShiftNoList:[], - scheduleTableData:[], - ShopOrderTableData:[], - availableResourceList:[], - calendarDateTypeShiftData:[], - schedulingModalTableData:[], - hasScheduledData:[], - currentRoutingRow:null, - changeTableData:[], + scheduledModalFlag: false, + hasScheduledModalFlag: false, + changeModalFlag: false, + allShiftNoList: [], + scheduleTableData: [], + ShopOrderTableData: [], + availableResourceList: [], + calendarDateTypeShiftData: [], + schedulingModalTableData: [], + hasScheduledData: [], + currentRoutingRow: null, + changeTableData: [], } }, mounted () { @@ -857,133 +866,133 @@ getShiftData().then(({data}) => { let list = data.rows for (let i = 0; i < list.length; i++) { - this.allShiftNoList=[]; + this.allShiftNoList = [] let resultData = { value: list[i].shiftno, - label: list[i].shiftno+'('+list[i].shiftdesc+')' + label: list[i].shiftno + '(' + list[i].shiftdesc + ')' } this.allShiftNoList.push(resultData) } - if(list.length>0){ - this.schedulingModalData.shiftNo=data.rows[0].shiftno + if (list.length > 0) { + this.schedulingModalData.shiftNo = data.rows[0].shiftno } }) }, - getBaseData(val){ - if (this.tagNo === 24){ - if(this.tagNo2===1) { + getBaseData (val) { + if (this.tagNo === 24) { + if (this.tagNo2 === 1) { this.searchData.workCenterNo = val.WorkCenterNo - }else { + } else { this.searchData.workCenterNo = val.WorkCenterNo } } - if (this.tagNo === 88){ - if(this.tagNo2===1) { + if (this.tagNo === 88) { + if (this.tagNo2 === 1) { this.searchData.resourceId = val.ResourceID - this.getWorkCenterNo(); - }else { + this.getWorkCenterNo() + } else { this.searchData.resourceId = val.ResourceID } } }, // 获取基础数据列表 - getBaseList(val,val2){ + getBaseList (val, val2) { this.tagNo = val this.tagNo2 = val2 this.$nextTick(() => { - let strVal = ""; - if (val === 24){ - if(val2===1) { + let strVal = '' + if (val === 24) { + if (val2 === 1) { strVal = this.searchData.workCenterNo - }else { + } else { strVal = this.searchData.workCenterNo } } - if (val === 88){ - if(val2===1) { + if (val === 88) { + if (val2 === 1) { strVal = this.searchData.resourceId - }else { + } else { strVal = this.searchData.resourceId } } - this.$refs.baseList.init(val,strVal) + this.$refs.baseList.init(val, strVal) }) }, - getWeekShiftData(){ - let inData={ - site:this.searchData.site, - workCenterNo:this.searchData.workCenterNo, - resourceID:this.searchData.resourceId, - scheduleDate:this.searchData.scheduleDate, + getWeekShiftData () { + let inData = { + site: this.searchData.site, + workCenterNo: this.searchData.workCenterNo, + resourceID: this.searchData.resourceId, + scheduleDate: this.searchData.scheduleDate, } getWeekShiftData(inData).then(({data}) => { this.calendarDateTypeShiftData = data.rows }) }, - getShopOrderOutData(){ + getShopOrderOutData () { getShopOrderOutData(this.searchData).then(({data}) => { this.ShopOrderTableData = data.rows }) }, - getOrderScheduleList(){ - let inData={ - scheduleDate:this.searchData.scheduleDate, - site:this.searchData.site, - workCenterNo:this.searchData.workCenterNo, - resourceId:this.searchData.resourceId, + getOrderScheduleList () { + let inData = { + scheduleDate: this.searchData.scheduleDate, + site: this.searchData.site, + workCenterNo: this.searchData.workCenterNo, + resourceId: this.searchData.resourceId, } getOrderScheduleList(inData).then(({data}) => { this.scheduleTableData = data.rows }) }, - scheduledModal(row){ - if(row.qtyToSchedule==0){ + scheduledModal (row) { + if (row.qtyToSchedule == 0) { this.$alert('该订单已排产完毕!', '错误', { confirmButtonText: '确定' }) return false } - this.schedulingModalData={ - orderNo:row.orderNo, - site:row.site, - needDate:row.needDate, - lotSize:row.lotSize, - qtyToSchedule:row.qtyToSchedule, - partNo:row.partNo, - partDesc:row.partDesc, - itemNo:row.itemNo, - itemDesc:row.itemDesc, - workCenterNo:row.workCenterNo, - scheduleDate:'', - scheduleQty:'', - resourceId:'', - shiftNo:'', - sumQty:0, - }; - this.schedulingModalTableData=[]; - this.getAvailableResourceList(row); - this.getAllShiftNoList(); - this.scheduledModalFlag=true; + this.schedulingModalData = { + orderNo: row.orderNo, + site: row.site, + needDate: row.needDate, + lotSize: row.lotSize, + qtyToSchedule: row.qtyToSchedule, + partNo: row.partNo, + partDesc: row.partDesc, + itemNo: row.itemNo, + itemDesc: row.itemDesc, + workCenterNo: row.workCenterNo, + scheduleDate: '', + scheduleQty: '', + resourceId: '', + shiftNo: '', + sumQty: 0, + } + this.schedulingModalTableData = [] + this.getAvailableResourceList(row) + this.getAllShiftNoList() + this.scheduledModalFlag = true }, - searchAllData(){ - if(this.searchData.site==""||this.searchData.site==null){ + searchAllData () { + if (this.searchData.site == '' || this.searchData.site == null) { this.$alert('请输入工厂!', '错误', { confirmButtonText: '确定' }) return false } - if(this.searchData.resourceId==""||this.searchData.resourceId==null){ + if (this.searchData.resourceId == '' || this.searchData.resourceId == null) { this.$alert('请输入机台!', '错误', { confirmButtonText: '确定' }) return false } - this.getShopOrderOutData(); - this.getOrderScheduleList(); + this.getShopOrderOutData() + this.getOrderScheduleList() }, - addPlans(){ + addPlans () { if (this.schedulingModalData.resourceId == '') { this.$alert('请选择机台!', '错误', { @@ -997,189 +1006,191 @@ }) return false } - this.schedulingModalTableData.push({ scheduleQty:'', - resourceId:this.schedulingModalData.resourceId, - shiftNo:this.schedulingModalData.shiftNo, - scheduleDate:null, - selectList:[]}) - this.sumQty+=this.schedulingModalData.scheduleQty; + this.schedulingModalTableData.push({ + scheduleQty: '', + resourceId: this.schedulingModalData.resourceId, + shiftNo: this.schedulingModalData.shiftNo, + scheduleDate: null, + selectList: [] + }) + this.sumQty += this.schedulingModalData.scheduleQty }, - splitScheduleTable(index){ + splitScheduleTable (index) { - this.schedulingModalTableData.splice(index,1); - this.changeSum(); + this.schedulingModalTableData.splice(index, 1) + this.changeSum() }, - getWorkCenterNo(){ - let inData={ - site:this.$store.state.user.site, - resourceID:this.searchData.resourceId + getWorkCenterNo () { + let inData = { + site: this.$store.state.user.site, + resourceID: this.searchData.resourceId } getWorkCenterNoWithSiteResourceId(inData).then(({data}) => { this.searchData.workCenterNo = data.rows[0].workCenterNo - this.getWeekShiftData(); - this.getOrderScheduleList(); + this.getWeekShiftData() + this.getOrderScheduleList() }) }, - getTodayShiftNo(){ - let inData={ - scheduledate:this.searchData.scheduleDate, - site:this.searchData.site, - }; - this.getOrderScheduleList(); - getTodayShiftNoList(inData).then(({data}) => { + getTodayShiftNo () { + let inData = { + scheduledate: this.searchData.scheduleDate, + site: this.searchData.site, + } + this.getOrderScheduleList() + getTodayShiftNoList(inData).then(({data}) => { this.shiftNoList = data.rows }) }, - getTodayShiftNo2(index){ - let inData={ - scheduledate:this.schedulingModalTableData[index].scheduleDate, - site:this.searchData.site, - }; + getTodayShiftNo2 (index) { + let inData = { + scheduledate: this.schedulingModalTableData[index].scheduleDate, + site: this.searchData.site, + } getTodayShiftNoList(inData).then(({data}) => { this.schedulingModalTableData[index].selectList = data.rows //如果当天不存在默认班次就删除 - if(data.rows.length>0){ - let flag=true; - for (let i = 0; i 0) { + let flag = true + for (let i = 0; i < data.rows.length; i++) { + if (data.rows[i].shiftno == this.schedulingModalTableData[index].shiftNo) { + flag = false } } - if (flag){ - this.schedulingModalTableData[index].shiftNo=''; + if (flag) { + this.schedulingModalTableData[index].shiftNo = '' } - }else { - this.schedulingModalTableData[index].shiftNo=''; + } else { + this.schedulingModalTableData[index].shiftNo = '' } }) }, - getAvailableResourceList(row){ - let inData={ - orderNo:row.orderNo, - site:row.site, - itemNo:row.itemNo, - }; + getAvailableResourceList (row) { + let inData = { + orderNo: row.orderNo, + site: row.site, + itemNo: row.itemNo, + } getSORoutingAvailableResourceList(inData).then(({data}) => { this.availableResourceList = data.rows - if(data.rows.length>0){ - this.schedulingModalData.resourceId=data.rows[0].resourceID + if (data.rows.length > 0) { + this.schedulingModalData.resourceId = data.rows[0].resourceID } }) }, - getHasScheduledData(row){ - if(row.scheduleDate==null||row.scheduleDate==''){ + getHasScheduledData (row) { + if (row.scheduleDate == null || row.scheduleDate == '') { this.$alert('请选择排产日期!', '错误', { confirmButtonText: '确定' }) return false } - let inData={ - site:this.schedulingModalData.site, - sResourceID:row.resourceId, - sScheduledDate:row.scheduleDate, - sShiftNo:row.shiftNo, + let inData = { + site: this.schedulingModalData.site, + sResourceID: row.resourceId, + sScheduledDate: row.scheduleDate, + sShiftNo: row.shiftNo, } getHasScheduledData(inData).then(({data}) => { this.hasScheduledData = data.rows - let number=0; - if(this.hasScheduledData.length>0){ - for (let i = 0; i 0) { + for (let i = 0; i < this.hasScheduledData.length; i++) { + if (this.hasScheduledData[i].timeRequired != null && this.hasScheduledData[i].timeRequired != '') { + number += Number(this.hasScheduledData[i].timeRequired) } } } - this.sumTime=number; + this.sumTime = number }) - this.hasScheduledModalFlag=true; + this.hasScheduledModalFlag = true }, /*设置工艺的行*/ - setCurrentRoutingRow(row, column, event) { - this.currentRoutingRow = JSON.parse(JSON.stringify(row)); + setCurrentRoutingRow (row, column, event) { + this.currentRoutingRow = JSON.parse(JSON.stringify(row)) }, /*设置当前行的下标*/ - routingRowClassName({row, rowIndex}){ + routingRowClassName ({row, rowIndex}) { //判断当前行颜色参数 - if(row.qtyScheduled > 0){ - return 'customer-row-gray'; + if (row.qtyScheduled > 0) { + return 'customer-row-gray' } }, /*开始排产的操作*/ - routingRowClassName2({row, rowIndex}){ - let date=new Date(); - let planDate=new Date(row.planFinishTime.replace("-","/")) + routingRowClassName2 ({row, rowIndex}) { + let date = new Date() + let planDate = new Date(row.planFinishTime.replace('-', '/')) //判断当前行颜色参数 - if(row.closedFlag=="Y" && row.qtyReported>=row.lotSize){ - return 'customer-row-1'; - }else if(row.closedFlag=="Y" && row.qtyReported= row.lotSize) { + return 'customer-row-1' + } else if (row.closedFlag == 'Y' && row.qtyReported < row.lotSize) { + return 'customer-row-2' + } else if (planDate < date) { + return 'customer-row-3' } }, - startScheduleOperation(row, $event, column){ - if(this.searchData.site==""||this.searchData.site==null){ + startScheduleOperation (row, $event, column) { + if (this.searchData.site == '' || this.searchData.site == null) { this.$alert('请输入工厂!', '错误', { confirmButtonText: '确定' }) return false } - if(this.searchData.resourceId==""||this.searchData.resourceId==null){ + if (this.searchData.resourceId == '' || this.searchData.resourceId == null) { this.$alert('请输入机台!', '错误', { confirmButtonText: '确定' }) return false } - if(this.searchData.scheduleDate==""||this.searchData.scheduleDate==null){ + if (this.searchData.scheduleDate == '' || this.searchData.scheduleDate == null) { this.$alert('请选择排产日期!', '错误', { confirmButtonText: '确定' }) return false } - if(this.searchData.shiftNo==""||this.searchData.shiftNo==null){ + if (this.searchData.shiftNo == '' || this.searchData.shiftNo == null) { this.$alert('请选择班次!', '错误', { confirmButtonText: '确定' }) return false } - let inData={ - site:this.$store.state.user.site, - orderNo:row.orderNo, - itemNo:row.itemNo, - workCenterNo:this.searchData.workCenterNo, - resourceID:this.searchData.resourceId, - qtyToSchedule:row.qtyToSchedule, - scheduleDate:this.searchData.scheduleDate, - scheduleTime:this.searchData.scheduleDate, - userId:this.$store.state.user.name, - shiftNo:this.searchData.shiftNo, - } + let inData = { + site: this.$store.state.user.site, + orderNo: row.orderNo, + itemNo: row.itemNo, + workCenterNo: this.searchData.workCenterNo, + resourceID: this.searchData.resourceId, + qtyToSchedule: row.qtyToSchedule, + scheduleDate: this.searchData.scheduleDate, + scheduleTime: this.searchData.scheduleDate, + userId: this.$store.state.user.name, + shiftNo: this.searchData.shiftNo, + } checkScheduleLoad(inData).then(({data}) => { - if(data.code===0){ + if (data.code === 0) { scheduleOne(inData).then(({data}) => { - if(data.code===0){ - row.qtyToSchedule = 0; + if (data.code === 0) { + row.qtyToSchedule = 0 row.qtyScheduled = row.lotSize - this.getOrderScheduleList(); - }else { + this.getOrderScheduleList() + } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) } }) - }else { + } else { this.$confirm(data.msg, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(() => { scheduleOne(inData).then(({data}) => { - if(data.code===0){ - row.qtyToSchedule = 0; + if (data.code === 0) { + row.qtyToSchedule = 0 row.qtyScheduled = row.lotSize - this.getOrderScheduleList(); - }else { + this.getOrderScheduleList() + } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) @@ -1190,90 +1201,95 @@ } }) - //自己赋值给自己 //this.shopOrderList = JSON.parse(JSON.stringify(this.shopOrderList)); //this.$message.error('字段time_required找不到!'); }, - changeSum(){ - let sum=0; - if(this.schedulingModalTableData.length>0) { + changeSum () { + let sum = 0 + if (this.schedulingModalTableData.length > 0) { for (let i = 0; i < this.schedulingModalTableData.length; i++) { - if (this.schedulingModalTableData[i].scheduleQty != "" && this.schedulingModalTableData[i].scheduleQty != null) { - sum += Number(this.schedulingModalTableData[i].scheduleQty); + if (this.schedulingModalTableData[i].scheduleQty != '' && this.schedulingModalTableData[i].scheduleQty != null) { + sum += Number(this.schedulingModalTableData[i].scheduleQty) } } } - this.schedulingModalData.sumQty = sum; + this.schedulingModalData.sumQty = sum }, - savePlans(){ - if(this.schedulingModalTableData.length==0){ + async savePlans () { + if (this.schedulingModalTableData.length == 0) { this.$alert('未添加排产记录!', '错误', { confirmButtonText: '确定' }) return false } - if(this.schedulingModalData.sumQty>this.schedulingModalData.qtyToSchedule){ + if (this.schedulingModalData.sumQty > this.schedulingModalData.qtyToSchedule) { this.$alert('排产数量超出可排产数量!', '错误', { confirmButtonText: '确定' }) return false } - let inList=[]; + let inList = [] for (let i = 0; i < this.schedulingModalTableData.length; i++) { - if (this.schedulingModalTableData[i].scheduleQty == "" || this.schedulingModalTableData[i].scheduleQty == null || this.schedulingModalTableData[i].scheduleQty ==0) { + if (this.schedulingModalTableData[i].scheduleQty == '' || this.schedulingModalTableData[i].scheduleQty == null || this.schedulingModalTableData[i].scheduleQty == 0) { this.$alert('未输入排产数量!', '错误', { confirmButtonText: '确定' }) return false } - if (this.schedulingModalTableData[i].scheduleDate == "" || this.schedulingModalTableData[i].scheduleDate == null) { + if (this.schedulingModalTableData[i].scheduleDate == '' || this.schedulingModalTableData[i].scheduleDate == null) { this.$alert('未选择排产日期!', '错误', { confirmButtonText: '确定' }) return false } - if (this.schedulingModalTableData[i].shiftNo == "" || this.schedulingModalTableData[i].shiftNo == null) { + if (this.schedulingModalTableData[i].shiftNo == '' || this.schedulingModalTableData[i].shiftNo == null) { this.$alert('未选择排产班次!', '错误', { confirmButtonText: '确定' }) return false } - let thisData={ - site:this.$store.state.user.site, - orderNo:this.schedulingModalData.orderNo, - itemNo:this.schedulingModalData.itemNo, - workCenterNo:this.schedulingModalData.workCenterNo, - resourceID:this.schedulingModalTableData[i].resourceId, - qtyToSchedule:this.schedulingModalTableData[i].scheduleQty, - scheduleDate:this.schedulingModalTableData[i].scheduleDate, - userId:this.$store.state.user.name, - shiftNo:this.schedulingModalTableData[i].shiftNo, + let thisData = { + site: this.$store.state.user.site, + orderNo: this.schedulingModalData.orderNo, + itemNo: this.schedulingModalData.itemNo, + workCenterNo: this.schedulingModalData.workCenterNo, + resourceID: this.schedulingModalTableData[i].resourceId, + qtyToSchedule: this.schedulingModalTableData[i].scheduleQty, + scheduleDate: this.schedulingModalTableData[i].scheduleDate, + userId: this.$store.state.user.name, + shiftNo: this.schedulingModalTableData[i].shiftNo, } - inList.push(thisData); + inList.push(thisData) } - let flag=true; + // this.checkId=0; + // this.checkList=inList; + // this.checkScheduledList(); + let flag = true for (let i = 0; i < this.schedulingModalTableData.length; i++) { - checkScheduleLoad(inList[i]).then(({data}) => { - if(data.code===0){ + if (flag === false) { + return false + } + await checkScheduleLoad(inList[i]).then(async ({data}) => { + if (data.code === 0) { - }else { - this.$confirm(data.msg, '提示', { + } else { + await this.$confirm(data.msg, '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' - }).then(() => { + }).then( () => { + + }).catch( () => { + flag = false - }).catch(() => { - flag=false; - return false; }) } }) } - if(flag) { - scheduleDatas(inList).then(({data}) => { + if (flag) { + await scheduleDatas(inList).then(async ({data}) => { if (data.code === 0) { for (let i = 0; i < this.ShopOrderTableData.length; i++) { if (inList[0].orderNo == this.ShopOrderTableData[i].orderNo && inList[0].itemNo == this.ShopOrderTableData[i].itemNo) { @@ -1281,17 +1297,10 @@ this.ShopOrderTableData[i].qtyScheduled = Number(this.ShopOrderTableData[i].qtyScheduled) + Number(this.schedulingModalData.sumQty) } } - this.getOrderScheduleList(); - this.schedulingModalTableData = []; - this.scheduledModalFlag = false; - this.$message({ - message: '保存成功', - type: 'success', - duration: 1500, - - onClose: () => { - } - }) + this.getOrderScheduleList() + this.schedulingModalTableData = [] + this.scheduledModalFlag = false + await this.$message.success('保存成功') } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' @@ -1300,32 +1309,39 @@ }) } }, - cancelSchedule(row, $event, column){ + // checkScheduledList(){ + // if(this.checkId { - let inData={ - site:row.site, - orderNo:row.orderNo, - itemNo:row.itemNo, - seqNo:row.seqNo, - workCenterNo:row.workCenterNo, - resourceID:row.resourceId, - scheduledQty:row.lotSize, + let inData = { + site: row.site, + orderNo: row.orderNo, + itemNo: row.itemNo, + seqNo: row.seqNo, + workCenterNo: row.workCenterNo, + resourceID: row.resourceId, + scheduledQty: row.lotSize, + scheduleDate: row.scheduledDate, + shiftNo: row.shiftNo, } cancelScheduleData(inData).then(({data}) => { - if(data.code===0){ - for (let i = 0; i { - rescheduleData(inData).then(({data}) =>{ - if(data.code===0){ - for (let i = 0; i { + rescheduleData(inData).then(({data}) => { + if (data.code === 0) { + for (let i = 0; i < this.ShopOrderTableData.length; i++) { + if (inList[0].orderNo == this.ShopOrderTableData[i].orderNo && inList[0].itemNo == this.ShopOrderTableData[i].itemNo) { + this.ShopOrderTableData[i].qtyToSchedule = Number(this.ShopOrderTableData[i].qtyToSchedule) - Number(this.schedulingModalData.sumQty) + this.ShopOrderTableData[i].qtyScheduled = Number(this.ShopOrderTableData[i].qtyScheduled) + Number(this.schedulingModalData.sumQty) } } - this.getOrderScheduleList(); + this.getOrderScheduleList() this.$message({ message: '操作成功', type: 'success', @@ -1381,7 +1397,7 @@ onClose: () => { } }) - }else { + } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) @@ -1389,70 +1405,70 @@ }) }) }, - changeModal(){ - if(this.searchData.site==""||this.searchData.site==null){ + changeModal () { + if (this.searchData.site == '' || this.searchData.site == null) { this.$alert('请输入工厂!', '错误', { confirmButtonText: '确定' }) return false } - if(this.searchData.resourceId==""||this.searchData.resourceId==null){ + if (this.searchData.resourceId == '' || this.searchData.resourceId == null) { this.$alert('请输入机台!', '错误', { confirmButtonText: '确定' }) return false } - if(this.searchData.scheduleDate==""||this.searchData.scheduleDate==null){ + if (this.searchData.scheduleDate == '' || this.searchData.scheduleDate == null) { this.$alert('请选择排产日期!', '错误', { confirmButtonText: '确定' }) return false } - let inData={ - scheduleDate:this.searchData.scheduleDate, - site:this.searchData.site, - workCenterNo:this.searchData.workCenterNo, - resourceId:this.searchData.resourceId, + let inData = { + scheduleDate: this.searchData.scheduleDate, + site: this.searchData.site, + workCenterNo: this.searchData.workCenterNo, + resourceId: this.searchData.resourceId, } getOrderScheduleList(inData).then(({data}) => { this.changeTableData = data.rows - if(this.changeTableData.length==0){ + if (this.changeTableData.length == 0) { this.$alert('该机台无排产计划!', '错误', { confirmButtonText: '确定' }) return false } - this.changeModalFlag=true; + this.changeModalFlag = true }) }, - changeSeqNo(){ - if(this.changeTableData.length==0){ + changeSeqNo () { + if (this.changeTableData.length == 0) { this.$alert('该机台无排产计划!', '错误', { confirmButtonText: '确定' }) return false } - let inList=[]; - for (let i = 0; i { - changeSoScheduledListSeqNo(inList).then(({data}) =>{ - if(data.code===0){ - this.changeModalFlag=false; - this.getOrderScheduleList(); + }).then(() => { + changeSoScheduledListSeqNo(inList).then(({data}) => { + if (data.code === 0) { + this.changeModalFlag = false + this.getOrderScheduleList() this.$message({ message: '操作成功', type: 'success', @@ -1461,7 +1477,7 @@ } }) - }else { + } else { this.$alert(data.msg, '错误', { confirmButtonText: '确定' }) @@ -1471,7 +1487,7 @@ }, }, created () { - this.getTodayShiftNo(); + this.getTodayShiftNo() } } diff --git a/src/views/modules/production/search_schedule.vue b/src/views/modules/production/search_schedule.vue new file mode 100644 index 0000000..8bf0abc --- /dev/null +++ b/src/views/modules/production/search_schedule.vue @@ -0,0 +1,856 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + 显示已关闭计划 + + + + 查询 + + + 导出 + + + + + + + 打印标签 + + + + + {{ scope.row[item.columnProp] }} + + + + + + + + + + + +