diff --git a/src/views/modules/production/dailyPlan.vue b/src/views/modules/production/dailyPlan.vue index 51b6763..8b0bde3 100644 --- a/src/views/modules/production/dailyPlan.vue +++ b/src/views/modules/production/dailyPlan.vue @@ -82,7 +82,6 @@ 查询 - 班次信息 @@ -91,7 +90,21 @@ :height="height" :data="tableData" border - style="width: 100%"> + style="width: 100%" + @selection-change="selectionChangeHandle"> + + + + + + + + + + - - - 新增班次 - - - - - - - - - - - - - - - - 退出 - - - - - - - - - - - - - - - - - - - - - - 保存 - 取消 - - @@ -392,22 +322,17 @@ getWorkPlanData, delPlan, getShiftData, - saveNewShift, - deleteShift } from "@/api/prd.js" export default { name: 'productionDispatch', data () { return { - shiftFlag:false, + selectList:[], //维护日计划界面 schedulingModalFlag:false, - newShiftFlag1:true, - newShiftFlag:false, scheduleTableData:[], - shiftData:[], scheduledModelData:{ orderNo:'', planStartDate:'', @@ -415,14 +340,7 @@ schedulingSize:'', unSchedulingSize:'', }, - newShiftData:{ - shiftno:'', - shiftdesc:'', - startexacttime:'', - endexacttime:'', - id:'', - site:this.$store.state.user.site, - }, + dataListSelections:[], scheduledingData:{ orderNo:'', orderDate:'', @@ -447,7 +365,7 @@ endDate1: '', startDate2: '', endDate2: '', - status: '', + status: "('已下达','已发料','已入库','已开工')", partNo:'' , startDate3: '', endDate3: '', @@ -469,6 +387,12 @@ }, //维护日计划界面 schedulingModal () { + if(this.scheduledModelData.unSchedulingSize==0){ + this.$alert("该日计划已排产完毕无需新增!", '错误', { + confirmButtonText: '确定', + }); + return false; + } this.scheduledingDataFlag1 = false; this.scheduledingDataFlag3 = true; this.scheduledingData.userName = this.$store.state.user.name; @@ -481,10 +405,27 @@ this.scheduledingData.shiftId = ""; this.schedulingModalFlag = true; }, + // 多选数据 + selectionChangeHandle (val) { + this.dataListSelections = val; + }, + //多选框选中触发判断 + checkSelections(row){ + if(row.status=="已计划"||row.status=="已取消"||row.status=="已关闭"){ + return false; + } + if(row.schedulingSize>=row.orderQty){ + return false; + } + return true; + }, //排产信息界面 openScheduleModel (row) { + if(row.status=="已计划"||row.status=="已取消"||row.status=="已关闭"){ - this.$message.error("该日计划状态为"+row.status+"无法排产"); + this.$alert("该订单状态为"+row.status+"无法排产", '错误', { + confirmButtonText: '确定', + }); return false; } let list={orderNo:row.orderNo} @@ -503,12 +444,7 @@ this.scheduleTableData = data.rows }) }, - shiftModel () { - this.shiftFlag = true; - getShiftData().then(({data}) => { - this.shiftData = data.rows; - }) - }, + // 查询 getData () { @@ -520,26 +456,30 @@ planSave () { if (this.scheduledingData.orderDate == "" || null == this.scheduledingData.orderDate) { - this.$message.error("请选择计划日期!"); + this.$alert("请选择计划日期!", '错误', { + confirmButtonText: '确定', + }); return false; } if (this.scheduledingData.orderQty == "" || null == this.scheduledingData.orderQty) { - this.$message.error("请输入排产数量!"); + this.$alert("请输入排产数量!", '错误', { + confirmButtonText: '确定', + }); return false; } if (this.scheduledingData.orderQty <= 0 ) { - this.$message.error("排产数量必须大于0!"); + this.$alert("排产数量必须大于0!", '错误', { + confirmButtonText: '确定', + }); return false; } if (this.scheduledingData.shiftId == "") { - this.$message.error("请输入排产班次!"); + this.$alert("请输入排产班次!", '错误', { + confirmButtonText: '确定', + }); return false; } - this.$confirm(`是否保存?`, '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { + // this.scheduledingData.orderDate = this.format(this.scheduledingData.orderDate,'yyyy-MM-dd') @@ -562,34 +502,38 @@ } }) } else { - this.$message.error(data.msg) + this.$alert(data.msg, '错误', { + confirmButtonText: '确定', + }); } }) - }).catch(() => { - }) }, planSaveOn () { if (this.scheduledingData.orderDate == "" || null == this.scheduledingData.orderDate) { - this.$message.error("请选择计划日期!"); + this.$alert("请选择计划日期!", '错误', { + confirmButtonText: '确定', + }); return false; } if (this.scheduledingData.orderQty == "" || null == this.scheduledingData.orderQty) { - this.$message.error("请输入排产数量!"); + this.$alert("请输入排产数量!", '错误', { + confirmButtonText: '确定', + }); return false; } if (this.scheduledingData.shiftId == "") { - this.$message.error("请输入排产班次!"); + this.$alert("请输入排产班次!", '错误', { + confirmButtonText: '确定', + }); return false; } if (this.scheduledingData.orderQty <= 0 ) { - this.$message.error("排产数量必须大于0!"); + this.$alert("排产数量必须大于0!", '错误', { + confirmButtonText: '确定', + }); return false; } - this.$confirm(`是否保存?`, '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { + savePlan(this.scheduledingData).then(({data}) => { if (data && data.code === 0) { getShiftData().then(({data}) => { @@ -604,11 +548,11 @@ } }) } else { - this.$message.error(data.msg) + this.$alert(data.msg, '错误', { + confirmButtonText: '确定', + }); } }) - }).catch(() => { - }) }, //修改日计划 editSchedule (row) { @@ -653,79 +597,17 @@ } }) } else { - this.$message.error(data.msg) + this.$alert(data.msg, '错误', { + confirmButtonText: '确定', + }); } }) }).catch(() => { }) }, - newShift () { - this.newShiftFlag1 = false; - this.newShiftData.shiftno = ''; - this.newShiftData.shiftdesc = ''; - this.newShiftData.startexacttime = ''; - this.newShiftData.endexacttime = ''; - this.newShiftData.id = 0; - this.newShiftFlag = true; - }, - newShiftSave(){ - if (this.newShiftData.shiftno == "" || null == this.newShiftData.shiftno) { - this.$message.error("请输入班次编码!"); - return false; - } - if (this.newShiftData.shiftdesc == "" || null == this.newShiftData.shiftdesc) { - this.$message.error("请输入班次名称!"); - return false; - } - if (this.newShiftData.startexacttime == "") { - this.$message.error("请输入上班时间!"); - return false; - } - if (this.newShiftData.endexacttime == "") { - this.$message.error("请输入下班时间!"); - return false; - } - this.$confirm(`是否保存此条记录?`, '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - let time1=this.newShiftData.startexacttime; - let time2=this.newShiftData.endexacttime; - this.newShiftData.startexacttime='2020-01-01 '+this.newShiftData.startexacttime+':00'; - this.newShiftData.endexacttime='2020-01-01 '+this.newShiftData.endexacttime+':00'; - saveNewShift(this.newShiftData).then(({data}) => { - this.newShiftData.startexacttime=time1; - this.newShiftData.endexacttime=time2; - if (data && data.code === 0) { - this.newShiftFlag=false; - getShiftData().then(({data}) => { - this.shiftData = data.rows; - }) - this.$message({ - message: '操作成功', - type: 'success', - duration: 1500, - onClose: () => { - } - }) - } else { - this.$message.error(data.msg) - } - }) - }).catch(() => { - }) - }, - editShift(row){ - this.newShiftData.shiftno = row.shiftno; - this.newShiftData.shiftdesc = row.shiftdesc; - this.newShiftData.startexacttime = row.startexacttime; - this.newShiftData.endexacttime = row.endexacttime; - this.newShiftData.id = row.id; - this.newShiftFlag1 = true; - this.newShiftFlag = true; - }, + + getTime(date) { if(date==''){ return "" @@ -734,36 +616,7 @@ return new Date(new Date(json_date) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '') } }, - deleteShift(row){ - - this.$confirm(`是否删除此条班次信息?`, '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - let inData={ - id:row.id - } - deleteShift(inData).then(({data}) => { - if (data && data.code === 0) { - getShiftData().then(({data}) => { - this.shiftData = data.rows; - }) - this.$message({ - message: '操作成功', - type: 'success', - duration: 1500, - onClose: () => { - } - }) - } else { - this.$message.error(data.msg) - } - }) - }).catch(() => { - }) - }, getSelectData(){ this.selectList=[]; getShiftData().then(({data}) => { @@ -784,7 +637,5 @@ } diff --git a/src/views/modules/production/dailyPlanCirculation.vue b/src/views/modules/production/dailyPlanCirculation.vue index f6bc0cb..e9772f4 100644 --- a/src/views/modules/production/dailyPlanCirculation.vue +++ b/src/views/modules/production/dailyPlanCirculation.vue @@ -252,7 +252,9 @@ } }) } else { - this.$message.error(data.msg) + this.$alert(data.msg, '错误', { + confirmButtonText: '确定', + }); } }) }).catch(() => { @@ -260,14 +262,18 @@ }, circulationModal(row){ if(row.closeFlag=="已流转"){ - this.$message.error("订单已流转无法再次流转!"); + this.$alert("订单已流转无法再次流转!", '错误', { + confirmButtonText: '确定', + }); return false; } if(row.qtyfinished>=row.orderQty){ - this.$message.error("订单已全部入库无需流转!"); + this.$alert("订单已全部入库无需流转!", '错误', { + confirmButtonText: '确定', + }); return false; } - this.getSelectData() + this.getSelectData(); this.circulationFlag=true; this.circulationData.orderNo=row.orderNo; this.circulationData.unFinishQty=row.orderQty-row.qtyfinished; @@ -275,36 +281,35 @@ this.circulationData.shiftId=''; this.circulationData.orderRef1=row.orderRef1; }, - circulationSave(){ + circulationSave() { if (this.circulationData.shiftId == "" || null == this.circulationData.shiftId) { - this.$message.error("请选择班次!"); + this.$alert("请选择班次!", '错误', { + confirmButtonText: '确定', + }); return false; } if (this.circulationData.orderDate == "") { - this.$message.error("请输入流转日期!"); + this.$alert("请输入流转日期!", '错误', { + confirmButtonText: '确定', + }); return false; } - this.$confirm(`是否流转此日计划?`, '提示', { - confirmButtonText: '确定', - cancelButtonText: '取消', - type: 'warning' - }).then(() => { - circulationSave(this.circulationData).then(({data}) => { - if (data && data.code === 0) { - this.search(); - this.circulationFlag=false; - this.$message({ - message: '流转成功', - type: 'success', - duration: 1500, - onClose: () => { - } - }) - } else { - this.$message.error(data.msg) - } - }) - }).catch(() => { + circulationSave(this.circulationData).then(({data}) => { + if (data && data.code === 0) { + this.search(); + this.circulationFlag = false; + this.$message({ + message: '流转成功', + type: 'success', + duration: 1500, + onClose: () => { + } + }) + } else { + this.$alert(data.msg, '错误', { + confirmButtonText: '确定', + }); + } }) }, getSelectData(){ diff --git a/src/views/modules/sys/shiftData.vue b/src/views/modules/sys/shiftData.vue new file mode 100644 index 0000000..6809660 --- /dev/null +++ b/src/views/modules/sys/shiftData.vue @@ -0,0 +1,238 @@ + + + +