|
|
|
@ -140,6 +140,8 @@ |
|
|
|
</div> |
|
|
|
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 3px;margin-left: 2px" > |
|
|
|
<el-button type="primary" @click="searchAllData()">查询</el-button> |
|
|
|
<!-- <el-button type="primary" @click="rescheduled()">重新排产</el-button>--> |
|
|
|
<el-button type="primary" @click="changeModal()">修改计划顺序</el-button> |
|
|
|
</el-form> |
|
|
|
<div class="mainTable"> |
|
|
|
<el-table |
|
|
|
@ -308,27 +310,34 @@ |
|
|
|
label="效率"> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
<el-table |
|
|
|
:height="170" |
|
|
|
:data="scheduleTableData" |
|
|
|
@row-dblclick="cancelSchedule" |
|
|
|
:row-class-name="routingRowClassName2" |
|
|
|
border |
|
|
|
style="width: 100%"> |
|
|
|
<el-table-column |
|
|
|
prop="planStartTime" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
min-width="100" |
|
|
|
label="计划开工时间"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="planFinishTime" |
|
|
|
prop="scheduledSeqNo" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
min-width="100" |
|
|
|
label="计划完工时间"> |
|
|
|
align="right" |
|
|
|
min-width="70" |
|
|
|
label="排序序号"> |
|
|
|
</el-table-column> |
|
|
|
<!-- <el-table-column--> |
|
|
|
<!-- prop="planStartTime"--> |
|
|
|
<!-- header-align="center"--> |
|
|
|
<!-- align="left"--> |
|
|
|
<!-- min-width="100"--> |
|
|
|
<!-- label="计划开工时间">--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
<!-- <el-table-column--> |
|
|
|
<!-- prop="planFinishTime"--> |
|
|
|
<!-- header-align="center"--> |
|
|
|
<!-- align="left"--> |
|
|
|
<!-- min-width="100"--> |
|
|
|
<!-- label="计划完工时间">--> |
|
|
|
<!-- </el-table-column>--> |
|
|
|
<el-table-column |
|
|
|
prop="timeRequired" |
|
|
|
header-align="center" |
|
|
|
@ -372,11 +381,11 @@ |
|
|
|
label="产品编码"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="planFinishTime" |
|
|
|
prop="scheduledDate" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
min-width="100" |
|
|
|
label="计划完工时间"> |
|
|
|
label="排产日期"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="partDesc" |
|
|
|
@ -498,6 +507,7 @@ |
|
|
|
label="效率"> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
<el-dialog title="多日排产" :close-on-click-modal="false" v-drag :visible.sync="scheduledModalFlag" width="700px"> |
|
|
|
<el-form :inline="true" label-position="top" style="margin-left: 7px;margin-top: -5px;"> |
|
|
|
<el-form-item label="订单号:"> |
|
|
|
@ -639,6 +649,10 @@ |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
<el-footer style="height:40px;margin-top: 20px;text-align:center"> |
|
|
|
<el-button type="primary" @click="scheduledModalFlag = false">关闭</el-button> |
|
|
|
<!-- <el-button type="primary" :disabled="bannersBut" @click="saveBanners()">确定</el-button>--> |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
<el-dialog title="查看负荷" :close-on-click-modal="false" v-drag :visible.sync="hasScheduledModalFlag" width="400px"> |
|
|
|
<el-table |
|
|
|
@ -676,6 +690,58 @@ |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</el-dialog> |
|
|
|
<el-dialog title="修改顺序" :close-on-click-modal="false" v-drag :visible.sync="changeModalFlag" width="700px"> |
|
|
|
<div class="bigTable1"> |
|
|
|
<el-table |
|
|
|
height="200" |
|
|
|
:data="changeTableData" |
|
|
|
border |
|
|
|
style="width: 100%"> |
|
|
|
<el-table-column |
|
|
|
prop="scheduledSeqNo" |
|
|
|
header-align="center" |
|
|
|
align="right" |
|
|
|
min-width="80" |
|
|
|
label="排产序号"> |
|
|
|
<template slot-scope="scope"> |
|
|
|
<el-input v-model="scope.row.scheduledSeqNo" type="number" onkeyup="value=value.replace(/^(0+)|[^\d]+/g,'')" style="width:98%;text-align: right"></el-input> |
|
|
|
</template> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="orderNo" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
min-width="80" |
|
|
|
label="订单号"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="itemNo" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
min-width="80" |
|
|
|
label="工序号"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="scheduledDate" |
|
|
|
header-align="center" |
|
|
|
align="left" |
|
|
|
min-width="100" |
|
|
|
label="排产日期"> |
|
|
|
</el-table-column> |
|
|
|
<el-table-column |
|
|
|
prop="lotSize" |
|
|
|
header-align="center" |
|
|
|
align="right" |
|
|
|
min-width="80" |
|
|
|
label="排产数量"> |
|
|
|
</el-table-column> |
|
|
|
</el-table> |
|
|
|
</div> |
|
|
|
<el-footer style="height:40px;margin-top: 20px;text-align:center"> |
|
|
|
<el-button type="primary" @click="changeSeqNo">保存</el-button> |
|
|
|
<el-button type="primary" @click="changeModalFlag = false">关闭</el-button> |
|
|
|
</el-footer> |
|
|
|
</el-dialog> |
|
|
|
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> |
|
|
|
</div> |
|
|
|
</template> |
|
|
|
@ -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<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){ |
|
|
|
this.$alert('请输入工厂!', '错误', { |
|
|
|
@ -1020,12 +1119,14 @@ |
|
|
|
resourceID:this.searchData.resourceId, |
|
|
|
qtyToSchedule:row.qtyToSchedule, |
|
|
|
scheduleDate:this.searchData.scheduleDate, |
|
|
|
scheduleTime:this.searchData.scheduleDate, |
|
|
|
userId:this.$store.state.user.name, |
|
|
|
} |
|
|
|
scheduleOne(inData).then(({data}) => { |
|
|
|
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 <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.$message({ |
|
|
|
message: '操作成功', |
|
|
|
type: 'success', |
|
|
|
duration: 1500, |
|
|
|
|
|
|
|
onClose: () => { |
|
|
|
} |
|
|
|
}) |
|
|
|
}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 <this.changeTableData.length ; i++) { |
|
|
|
let data1={ |
|
|
|
site:this.changeTableData[i].site, |
|
|
|
workCenterNo:this.changeTableData[i].workCenterNo, |
|
|
|
resourceID:this.changeTableData[i].resourceId, |
|
|
|
linkedSeqNo:this.changeTableData[i].linkedSeqNo, |
|
|
|
scheduledSeqNo:this.changeTableData[i].scheduledSeqNo, |
|
|
|
} |
|
|
|
inList.push(data1); |
|
|
|
} |
|
|
|
this.$confirm(`是否修改计划顺序?`, '提示', { |
|
|
|
confirmButtonText: '确定', |
|
|
|
cancelButtonText: '取消', |
|
|
|
type: 'warning' |
|
|
|
}).then(() =>{ |
|
|
|
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(); |
|
|
|
|