diff --git a/src/api/production/dailyPlan.js b/src/api/production/dailyPlan.js
index 9f86a82..075aa68 100644
--- a/src/api/production/dailyPlan.js
+++ b/src/api/production/dailyPlan.js
@@ -23,3 +23,7 @@ export const scheduleOne=data => createAPI(`/dailyPlan/scheduleOne`,'post',data
export const scheduleDatas=data => createAPI(`/dailyPlan/scheduleDatas`,'post',data)
//获得当日负荷
export const cancelScheduleData=data => createAPI(`/dailyPlan/cancelScheduleData`,'post',data)
+//重新排产
+export const rescheduleData=data => createAPI(`/dailyPlan/rescheduleData`,'post',data)
+//改变排产顺序
+export const changeSoScheduledListSeqNo=data => createAPI(`/dailyPlan/changeSoScheduledListSeqNo`,'post',data)
diff --git a/src/assets/scss/global.scss b/src/assets/scss/global.scss
index 847575d..dcd0c42 100644
--- a/src/assets/scss/global.scss
+++ b/src/assets/scss/global.scss
@@ -368,3 +368,16 @@ a:hover{
.mainTable .hover-row > td{
background-color: transparent !important;
}
+
+/* 颜色控制 */
+.mainTable .el-table .customer-row-1 {
+ background: #FF00FF;
+}
+
+.mainTable .el-table .customer-row-2 {
+ background: #FFD700;
+}
+
+.mainTable .el-table .customer-row-3 {
+ background: #0000CD;
+}
diff --git a/src/views/modules/production/dailyPlan.vue b/src/views/modules/production/dailyPlan.vue
index 9ff6ee8..7bf40eb 100644
--- a/src/views/modules/production/dailyPlan.vue
+++ b/src/views/modules/production/dailyPlan.vue
@@ -140,6 +140,8 @@
查询
+
+ 修改计划顺序
-
-
-
+ align="right"
+ min-width="70"
+ label="排序序号">
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ label="排产日期">
+
@@ -639,6 +649,10 @@
+
+ 关闭
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ 保存
+ 关闭
+
+
@@ -692,6 +758,8 @@
scheduleOne,
scheduleDatas,
cancelScheduleData,
+ rescheduleData,
+ changeSoScheduledListSeqNo,
} from '@/api/production/dailyPlan.js'
import {
@@ -744,6 +812,7 @@
},
scheduledModalFlag:false,
hasScheduledModalFlag:false,
+ changeModalFlag:false,
allShiftNoList:[],
scheduleTableData:[],
ShopOrderTableData:[],
@@ -752,6 +821,7 @@
schedulingModalTableData:[],
hasScheduledData:[],
currentRoutingRow:null,
+ changeTableData:[],
}
},
mounted () {
@@ -846,6 +916,12 @@
})
},
scheduledModal(row){
+ if(row.qtyToSchedule==0){
+ this.$alert('该订单已排产完毕!', '错误', {
+ confirmButtonText: '确定'
+ })
+ return false
+ }
this.schedulingModalData={
orderNo:row.orderNo,
site:row.site,
@@ -869,6 +945,18 @@
this.scheduledModalFlag=true;
},
searchAllData(){
+ if(this.searchData.site==""||this.searchData.site==null){
+ this.$alert('请输入工厂!', '错误', {
+ confirmButtonText: '确定'
+ })
+ return false
+ }
+ if(this.searchData.resourceId==""||this.searchData.resourceId==null){
+ this.$alert('请输入机台!', '错误', {
+ confirmButtonText: '确定'
+ })
+ return false
+ }
this.getShopOrderOutData();
this.getOrderScheduleList();
},
@@ -980,13 +1068,24 @@
},
/*设置当前行的下标*/
routingRowClassName({row, rowIndex}){
- row.index = rowIndex;
//判断当前行颜色参数
if(row.qtyScheduled > 0){
return 'customer-row-gray';
}
},
/*开始排产的操作*/
+ 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 {
if(data.code===0){
row.qtyToSchedule = 0;
row.qtyScheduled = row.lotSize
+ this.getOrderScheduleList();
}else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
@@ -1101,6 +1202,17 @@
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: () => {
+ }
+ })
}else {
this.$alert(data.msg, '错误', {
confirmButtonText: '确定'
@@ -1140,8 +1252,143 @@
}
})
})
- }
+ },
+ rescheduled(){
+ if(this.searchData.site==""||this.searchData.site==null){
+ this.$alert('请输入工厂!', '错误', {
+ confirmButtonText: '确定'
+ })
+ return false
+ }
+ if(this.searchData.resourceId==""||this.searchData.resourceId==null){
+ this.$alert('请输入机台!', '错误', {
+ confirmButtonText: '确定'
+ })
+ return false
+ }
+ if(this.searchData.scheduleDate==""||this.searchData.scheduleDate==null){
+ this.$alert('请选择排产日期!', '错误', {
+ confirmButtonText: '确定'
+ })
+ return false
+ }
+ let inData={
+ site:this.$store.state.user.site,
+ workCenterNo:this.searchData.workCenterNo,
+ resourceID:this.searchData.resourceId,
+ scheduleDate:this.searchData.scheduleDate,
+ scheduleTime:this.searchData.scheduleDate,
+ }
+ this.$confirm(`是否重新排产该机台当日日计划?`, '提示', {
+ confirmButtonText: '确定',
+ cancelButtonText: '取消',
+ type: 'warning'
+ }).then(() =>{
+ rescheduleData(inData).then(({data}) =>{
+ if(data.code===0){
+ for (let i = 0; i {
+ }
+ })
+ }else {
+ this.$alert(data.msg, '错误', {
+ confirmButtonText: '确定'
+ })
+ }
+ })
+ })
+ },
+ changeModal(){
+ if(this.searchData.site==""||this.searchData.site==null){
+ this.$alert('请输入工厂!', '错误', {
+ confirmButtonText: '确定'
+ })
+ return false
+ }
+ if(this.searchData.resourceId==""||this.searchData.resourceId==null){
+ this.$alert('请输入机台!', '错误', {
+ confirmButtonText: '确定'
+ })
+ return false
+ }
+ 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,
+ }
+ getOrderScheduleList(inData).then(({data}) => {
+ this.changeTableData = data.rows
+ if(this.changeTableData.length==0){
+ this.$alert('该机台无排产计划!', '错误', {
+ confirmButtonText: '确定'
+ })
+ return false
+ }
+ this.changeModalFlag=true;
+ })
+
+ },
+ 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();
+ this.$message({
+ message: '操作成功',
+ type: 'success',
+ duration: 1500,
+ onClose: () => {
+
+ }
+ })
+ }else {
+ this.$alert(data.msg, '错误', {
+ confirmButtonText: '确定'
+ })
+ }
+ })
+ })
+ },
},
created () {
this.getTodayShiftNo();