Browse Source

FQC排产

master
rui_li 4 years ago
parent
commit
72b7e0dcc9
  1. 10
      src/api/schedule/order_schedule_fqc.js
  2. 248
      src/views/modules/schedule/order_schedule_fqc.vue

10
src/api/schedule/order_schedule_fqc.js

@ -9,18 +9,12 @@ export const getOperatorListWithFqc = data => createAPI('scheduling/getOperatorL
// 获取FQC的排产记录
export const getOrderScheduleListWithFqc = data => createAPI('scheduling/getOrderScheduleListWithFqc', 'POST', data)
//获取当前加工中心对应的机台数据
export const getCurrentWorkCenterNoByResourceId = data => createAPI('scheduling/getCurrentWorkCenterNoByResourceId', 'POST', data)
//排产生产工单的操作
export const scheduleWorkOrder = data => createAPI('scheduling/scheduleWorkOrder', 'POST', data)
//FQC操作员排产
export const scheduleFqcOperators = data => createAPI('scheduling/scheduleFqcOperators', 'POST', data)
//取消排产生产工单的操作
export const cancelSoSchedule = data => createAPI('scheduling/cancelSoSchedule', 'POST', data)
//取消排产生产工单的操作
export const addWaitSchedule = data => createAPI('scheduling/addWaitSchedule', 'POST', data)
//重新排产生产工单的操作
export const reScheduleWorkOrders = data => createAPI('scheduling/reScheduleWorkOrders', 'POST', data)

248
src/views/modules/schedule/order_schedule_fqc.vue

@ -115,7 +115,7 @@
<legend>可用操作员</legend>
<el-row>
<el-col :span="8">
<el-button class="customer-bun-mid" type="primary" @click=""
<el-button class="customer-bun-mid" type="primary" @click="scheduleOperatorsBun"
style="margin-left: 10px; margin-bottom: 5px;">
排产
</el-button>
@ -141,6 +141,7 @@
border
:cell-style="customerCellStyle" :cell-class-name="customerCellClassName"
@row-click="setCurrentOperatorRow"
@current-change="changeCurrentOperatorRow"
highlight-current-row
ref="operatorTable"
v-loading="dataListLoading"
@ -172,18 +173,24 @@
<fieldset class="customer-right-field">
<legend>已排产记录</legend>
<el-row>
<el-col :span="8">
<el-button class="customer-bun-mid" type="primary" @click=""
<el-col :span="4">
<el-button class="customer-bun-mid" type="primary" @click="moveUpScheduleBun"
style="margin-left: 10px; margin-bottom: 5px;">
上移
</el-button>
</el-col>
<el-col :span="8">
<el-button class="customer-bun-mid" type="primary" @click=""
<el-col :span="4">
<el-button class="customer-bun-mid" type="primary" @click="moveDownScheduleBun"
style="margin-left: 10px; margin-bottom: 5px;">
下移
</el-button>
</el-col>
<el-col :span="4">
<el-button class="customer-bun-mid" type="primary" @click="warnReScheduleConfirm"
style="margin-left: 10px; margin-bottom: 5px;">
重新排产
</el-button>
</el-col>
</el-row>
<el-container>
<el-main class="customer-right-main">
@ -192,8 +199,11 @@
:data="orderScheduleList"
border
ref="scheduleTable"
highlight-current-row
:row-class-name="scheduleRowClassName"
@row-click="setCurrentScheduleRow"
@current-change="changeScheduleRow"
@row-dblclick="warnCancelScheduleConfirm"
v-loading="dataListLoading"
style="margin-left: -15px; margin-top: -5px;">
<el-table-column
@ -316,8 +326,12 @@ import {
getShopOrderListWithFqc,
getOperatorListWithFqc,
getOrderScheduleListWithFqc,
scheduleFqcOperators,
cancelSoSchedule,
reScheduleWorkOrders,
moveUpSchedule,
moveDownSchedule
} from '@/api/schedule/order_schedule_fqc.js'
import dayjs from "dayjs";
export default {
data() {
@ -332,7 +346,7 @@ export default {
modelInputFlag: true,
currentRoutingRow: {},
currentOperatorRow: {},
currentSchedlingRow: {},
currentScheduleRow: {},
pageData: {
site: this.$store.state.user.site,
username: this.$store.state.user.name,
@ -341,12 +355,15 @@ export default {
itemDesc: '',
workCenterNo: '',
workCenterDesc: '',
resourceId: '',
qtyRequired: '',
qtyScheduled: '',
qtyToSchedule: '',
scheduleDate: this.dayjs(new Date()).format('YYYY-MM-DD'),
scheduleTime: '08:30',
specifiedTime: 'Y',
scheduleSeqNo: -1,
planStartTime: ''
},
searchData: {
site: this.$store.state.user.site,
@ -1368,11 +1385,13 @@ export default {
this.operatorList = data.rows;
//
if(this.operatorIndex >= 0){
//
this.$refs.operatorTable.setCurrentRow(this.operatorList[this.operatorIndex]);
//
setTimeout(() =>{
this.$refs.operatorTable.setCurrentRow(this.operatorList[this.operatorIndex]);
//
this.searchData.resourceId = this.operatorList[this.operatorIndex].operatorId;
this.pageData.resourceId = this.operatorList[this.operatorIndex].operatorId;
//
this.getOrderScheduleList();
},500);
@ -1395,17 +1414,6 @@ export default {
})
},
/*区分不同的菜单 调用不同的方法 调用不同的方法*/
handleCommand(menuName) {
//
if ('分批排产' === menuName) {
this.openSplitScheduleModal();
} else if ('重新排产' === menuName) {
//
this.warnReScheduleConfirm();
}
},
/*设置工艺的行*/
setCurrentRoutingRow(row, column, event) {
this.currentRoutingRow = row;
@ -1437,10 +1445,21 @@ export default {
this.currentOperatorRow = JSON.parse(JSON.stringify(row));
//
this.searchData.resourceId = row.operatorId;
this.pageData.resourceId = row.operatorId;
//table
this.getOrderScheduleList();
},
/*当前值发生变化的时候修改*/
changeCurrentOperatorRow(row, oldRow){
//
if(row){
this.currentOperatorRow = JSON.parse(JSON.stringify(row));
//
//this.operatorIndex = row.index;
}
},
/*设置当前派工单行的下标*/
scheduleRowClassName({row, rowIndex}){
row.index = rowIndex;
@ -1472,68 +1491,35 @@ export default {
//
if(row){
this.currentScheduleRow = JSON.parse(JSON.stringify(row));
//
this.scheduleIndex = row.index;
}
},
/*开始排产的操作*/
startScheduleOperation(row, $event, column) {
//
if (this.pageData.workCenterNo == null || '' == this.pageData.workCenterNo) {
this.$message.error('加工中心不能为空!')
return false;
}
if (this.pageData.resourceId == null || '' == this.pageData.resourceId) {
this.$message.error('机台不能为空!')
return false;
}
//
let scheduledQty = row.qtyToSchedule;
row.qtyScheduled = scheduledQty;
row.qtyToSchedule = parseFloat(row.qtyToSchedule) - parseFloat(row.qtyScheduled);
this.pageData.scheduledQty = scheduledQty;
//
this.pageData.orderNo = row.orderNo;
this.pageData.itemNo = row.itemNo;
//
this.scheduleWorkOrderOperation(scheduledQty);
},
/*分批排产*/
initAddSplitSchedule(scheduledQty) {
//
this.pageData.orderNo = this.currentRoutingRow.orderNo;
this.pageData.itemNo = this.currentRoutingRow.itemNo;
//
if (this.pageData.workCenterNo == null || '' == this.pageData.workCenterNo) {
this.$message.error('加工中心不能为空!')
return false;
scheduleOperatorsBun() {
//
let scheduleOperators = [];
//
for(let i = 0; i < this.operatorList.length; i++){
let tempOperator = this.operatorList[i];
if(parseFloat(tempOperator.qtyToSchedule) > 0){
scheduleOperators.push(tempOperator);
}
}
if (this.pageData.resourceId == null || '' == this.pageData.resourceId) {
this.$message.error('机台不能为空!')
//
if(scheduleOperators.length == 0){
this.$message.error('暂无可排产的操作员!');
return false;
}
this.currentRoutingRow.qtyScheduled = parseFloat(this.currentRoutingRow.qtyScheduled) + parseFloat(scheduledQty);
this.currentRoutingRow.qtyToSchedule = parseFloat(this.currentRoutingRow.qtyToSchedule) - parseFloat(scheduledQty);
//
this.scheduleWorkOrderOperation(scheduledQty);
},
/*排产生产工单*/
scheduleWorkOrderOperation(scheduledQty) {
//
this.pageData.scheduledQty = scheduledQty;
scheduleWorkOrder(this.pageData).then(({data}) => {
//
let postData = {'pageData': JSON.stringify(this.pageData), 'operatorList': JSON.stringify(scheduleOperators)}
//
scheduleFqcOperators(postData).then(({data}) => {
if (data.code == 500) {
this.currentRoutingRow.qtyScheduled = parseFloat(this.currentRoutingRow.qtyScheduled) - parseFloat(scheduledQty);
this.currentRoutingRow.qtyToSchedule = parseFloat(this.currentRoutingRow.qtyToSchedule) + parseFloat(scheduledQty);
this.$message.error(data.msg);
this.pageData.scheduledQty = 0;
} else {
this.$message.success(data.msg);
//
this.getOrderScheduleList();
//FQC
this.getOperatorList();
}
});
},
@ -1560,6 +1546,8 @@ export default {
this.pageData.scheduledQty = scheduleRow.qtyRequired;
this.pageData.workCenterNo = scheduleRow.workCenterNo;
this.pageData.resourceId = scheduleRow.resourceId;
this.pageData.scheduleSeqNo = scheduleRow.scheduleSeqNo;
this.pageData.planStartTime = scheduleRow.planStartTime;
//
cancelSoSchedule(this.pageData).then(({data}) => {
if (data.code == 500) {
@ -1572,31 +1560,24 @@ export default {
});
},
/*分批排产*/
addWaitScheduleBun() {
//
let waitTimes = this.pageData.waitTimes;
if (waitTimes <= 0) {
this.$message.error('等待时间必须大于零!')
return false;
}
//
//
if (this.pageData.workCenterNo == null || '' == this.pageData.workCenterNo) {
this.$message.error('加工中心不能为空!')
return false;
}
if (this.pageData.resourceId == null || '' == this.pageData.resourceId) {
this.$message.error('机台不能为空!')
return false;
}
//
this.addWaitScheduleOperation();
/*提示是否重新排产*/
warnReScheduleConfirm() {
//
this.$confirm('确实要对排产清单中的未完成派工单进行排产吗?', '提示', {
confirmButtonText: '确认',
celButtonText: '取消',
type: 'warning'
}).then(() => {
//
this.reScheduleFqcOperator();
});
},
/*插入等待的派工单信息*/
addWaitScheduleOperation() {
addWaitSchedule(this.pageData).then(({data}) => {
/*重新排产的方法*/
reScheduleFqcOperator() {
//
this.pageData.resourceId = this.currentOperatorRow.operatorId;
reScheduleWorkOrders(this.pageData).then(({data}) => {
if (data.code == 500) {
this.$message.error(data.msg);
} else {
@ -1607,37 +1588,66 @@ export default {
});
},
/*提示取消派工单*/
warnReScheduleConfirm() {
//
//
if (this.pageData.workCenterNo == null || '' == this.pageData.workCenterNo) {
this.$message.error('加工中心不能为空!')
/*上移派工单*/
moveUpScheduleBun(){
//
let scheduleRow = this.currentScheduleRow;
if(null == scheduleRow || scheduleRow == ''){
this.$message.error('请先选择处理的行!');
return false;
}
if (this.pageData.resourceId == null || '' == this.pageData.resourceId) {
this.$message.error('机台不能为空!')
//
if(scheduleRow.index == 0){
this.$message.error('已经是首行,无法继续上行!');
return false;
}
//
this.$confirm('确实要对排产清单中的未完成派工单进行排产吗?', '提示', {
confirmButtonText: '确认',
celButtonText: '取消',
type: 'warning'
}).then(() => {
//
this.initReScheduleWorkOrders();
//
let requestData = {'site': this.pageData.site,
'workCenterNo': this.pageData.workCenterNo,
'resourceId': this.pageData.resourceId,
'scheduleSeqNo': scheduleRow.scheduledSeqNo};
//
moveUpSchedule(requestData).then(({data}) => {
if(data.code == 500){
this.$message.error(data.msg);
}else{
this.$message.success(data.msg);
//
this.scheduleIndex = this.scheduleIndex - 1;
//
this.getOrderScheduleList();
}
});
},
/*重新排产的方法*/
initReScheduleWorkOrders() {
reScheduleWorkOrders(this.pageData).then(({data}) => {
if (data.code == 500) {
/*上移派工单*/
moveDownScheduleBun(){
//
let scheduleRow = this.currentScheduleRow;
if(null == scheduleRow || scheduleRow == ''){
this.$message.error('请先选择处理的行!');
return false;
}
let countNums = this.orderScheduleList.length;
//
if(scheduleRow.index == countNums - 1){
this.$message.error('已经是末行,无法继续下行!');
return false;
}
//
let requestData = {'site': this.pageData.site,
'workCenterNo': this.pageData.workCenterNo,
'resourceId': this.pageData.resourceId,
'scheduleSeqNo': scheduleRow.scheduledSeqNo};
//
moveDownSchedule(requestData).then(({data}) => {
if(data.code == 500){
this.$message.error(data.msg);
} else {
}else{
this.$message.success(data.msg);
//
//
this.scheduleIndex = this.scheduleIndex + 1;
//
this.getOrderScheduleList();
}
});
@ -1764,8 +1774,8 @@ div.customer-el-card-blue {
.customer-css .customer-left-main {
width: calc(50vw - 360px) !important;
padding: 0px;
margin-left: -10px;
margin-right: -25px;
margin-left: -5px;
margin-right: -20px;
margin-bottom: -5px;
}
@ -1773,8 +1783,8 @@ div.customer-el-card-blue {
.customer-css .customer-right-main {
width: calc(50vw - 240px) !important;
padding: 0px;
margin-left: -10px;
margin-right: -25px;
margin-left: -5px;
margin-right: -20px;
margin-bottom: -5px;
}

Loading…
Cancel
Save