Browse Source

排产页面的排产 取消 分批排产

master
Rui_Li 4 years ago
parent
commit
d3a96c8f3a
  1. 7
      src/api/schedule/order_schedule.js
  2. 78
      src/views/modules/schedule/com_split_schedule.vue
  3. 181
      src/views/modules/schedule/order_schedule.vue

7
src/api/schedule/order_schedule.js

@ -12,4 +12,11 @@ export const getOrderScheduleList = data => createAPI('schedule/getOrderSchedule
//获取当前加工中心对应的机台数据 //获取当前加工中心对应的机台数据
export const getCurrentWorkCenterNoByResourceId = data => createAPI('scheduling/getCurrentWorkCenterNoByResourceId', 'POST', data) export const getCurrentWorkCenterNoByResourceId = data => createAPI('scheduling/getCurrentWorkCenterNoByResourceId', 'POST', data)
//排产生产工单的操作
export const scheduleWorkOrder = data => createAPI('scheduling/scheduleWorkOrder', 'POST', data)
//取消排产生产工单的操作
export const cancelSoSchedule = data => createAPI('scheduling/cancelSoSchedule', 'POST', data)

78
src/views/modules/schedule/com_split_schedule.vue

@ -0,0 +1,78 @@
<template>
<div class="customer-css">
<el-dialog :title="titleCon" v-drag v-bind="$attrs" v-on="$listeners"
width="360px" style="height: 300px;" class="customer-dialog">
<el-form :inline="true" label-position="top" style="height: 100px;"
label-width="80px">
<!-- 菜单信息 -->
<el-row>
<el-col :span="24" >
<el-form-item :label="'排产数量:'">
<el-input-number ref="scheduleQty" v-model="pageData.scheduleQty"></el-input-number>
</el-form-item>
</el-col>
</el-row>
</el-form>
<span slot="footer" class="dialog-footer" style="margin-top: -20px;">
<el-button type="primary" @click="addExceptionReason"> </el-button>
<el-button type="primary" @click="closeDialog">关闭</el-button>
</span>
</el-dialog>
</div>
</template>
<script>
export default {
name: "com_split_schedule",
data() {
return {
titleCon: '分批排产',
pageData: {
site: this.$store.state.user.site,
userName: this.$store.state.user.name,
scheduleQty: 0
},
}
},
methods: {
/*初始化页面参数*/
init(scheduleRow) {
//
this.pageData.scheduleQty = scheduleRow.qtyToSchedule;
//
this.$nextTick(() => {
this.$refs.scheduleQty.focus();
});
//
},
/*关闭modal*/
closeDialog(){
this.$emit('update:visible', false);
},
/*添加异常原因的数据*/
addSplitSchedule(){
//
let scheduleQty = this.pageData.scheduleQty;
if(scheduleQty <= 0){
this.$message.error('排产数量必须大于0!');
return false;
}
//
this.closeDialog();
//
this.$emit('initAddSplitSchedule', this.pageData.scheduleQty);
},
},
created() {
//
}
}
</script>
<style scoped lang="scss">
</style>

181
src/views/modules/schedule/order_schedule.vue

@ -17,7 +17,7 @@
<legend>排序</legend><br> <legend>排序</legend><br>
<el-form :inline="true" style="margin-top: -10px; margin-bottom: 15px;" label-position="top" label-width="100px" > <el-form :inline="true" style="margin-top: -10px; margin-bottom: 15px;" label-position="top" label-width="100px" >
<el-form-item :label="''" style="margin-bottom: 5px;"> <el-form-item :label="''" style="margin-bottom: 5px;">
<el-radio-group v-model="searchData.sortField">
<el-radio-group v-model="pageData.sortField">
<el-radio label="needDate">要求完工日期</el-radio> <el-radio label="needDate">要求完工日期</el-radio>
<el-radio label="orderNo">订单号</el-radio> <el-radio label="orderNo">订单号</el-radio>
<el-radio label="partNo">产品编码</el-radio> <el-radio label="partNo">产品编码</el-radio>
@ -30,33 +30,33 @@
<el-form-item :label="'录入日期:'"> <el-form-item :label="'录入日期:'">
<el-date-picker class="el-time-width" <el-date-picker class="el-time-width"
style="" style=""
v-model="searchData.enterTime1"
v-model="pageData.enterTime1"
value-format="yyyy-MM-dd"> value-format="yyyy-MM-dd">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item :label="''" style="margin-top: -10px;"> <el-form-item :label="''" style="margin-top: -10px;">
<el-date-picker class="el-time-width" <el-date-picker class="el-time-width"
style="margin-top: 30px;" style="margin-top: 30px;"
v-model="searchData.enterTime2"
v-model="pageData.enterTime2"
value-format="yyyy-MM-dd" placeholder=""> value-format="yyyy-MM-dd" placeholder="">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item :label="'要求完工日期:'"> <el-form-item :label="'要求完工日期:'">
<el-date-picker class="el-time-width" <el-date-picker class="el-time-width"
style="" style=""
v-model="searchData.needTime1"
v-model="pageData.needTime1"
value-format="yyyy-MM-dd" placeholder=""> value-format="yyyy-MM-dd" placeholder="">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item :label="''" style="margin-top: -10px;"> <el-form-item :label="''" style="margin-top: -10px;">
<el-date-picker class="el-time-width" <el-date-picker class="el-time-width"
style="margin-top: 30px;" style="margin-top: 30px;"
v-model="searchData.needTime2"
v-model="pageData.needTime2"
value-format="yyyy-MM-dd" placeholder=""> value-format="yyyy-MM-dd" placeholder="">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item :label="'产成品编码:'"> <el-form-item :label="'产成品编码:'">
<el-input v-model="searchData.partNo" style="width: 120px"></el-input>
<el-input v-model="pageData.partNo" style="width: 120px"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
@ -68,16 +68,17 @@
<el-form-item :label="'排产日期:'"> <el-form-item :label="'排产日期:'">
<el-date-picker class="el-time-width" <el-date-picker class="el-time-width"
style="" style=""
v-model="searchData.scheduleDate"
v-model="pageData.scheduleDate"
value-format="yyyy-MM-dd"> value-format="yyyy-MM-dd">
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
<el-form-item :label="''" style="margin-top: -10px;"> <el-form-item :label="''" style="margin-top: -10px;">
<el-checkbox v-model="pageData.specifiedTime" true-label="Y" false-label="N" style="margin-top: 28px;" ></el-checkbox>
<el-time-picker <el-time-picker
format="HH:mm" format="HH:mm"
arrow-control arrow-control
style="margin-top: 30px; width: 65px" style="margin-top: 30px; width: 65px"
v-model="searchData.timePeriod"
v-model="pageData.scheduleTime"
value-format="HH:mm"> value-format="HH:mm">
</el-time-picker> </el-time-picker>
</el-form-item> </el-form-item>
@ -87,15 +88,15 @@
</el-form> </el-form>
<el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 10px;"> <el-form :inline="true" label-position="top" label-width="100px" style="margin-top: 10px;">
<el-form-item :label="'工厂编号:'"> <el-form-item :label="'工厂编号:'">
<el-input v-model="searchData.site" style="width: 85px"></el-input>
<el-input v-model="pageData.site" style="width: 85px"></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<span slot="label" style="" @click="getBaseList(88)"><a herf="#">机台编号:</a></span> <span slot="label" style="" @click="getBaseList(88)"><a herf="#">机台编号:</a></span>
<el-input v-model="searchData.resourceId" style="width: 120px"></el-input>
<el-input v-model="pageData.resourceId" style="width: 120px"></el-input>
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
<span slot="label" style="" @click="getBaseList(24)"><a herf="#">加工中心编码:</a></span> <span slot="label" style="" @click="getBaseList(24)"><a herf="#">加工中心编码:</a></span>
<el-input v-model="searchData.workCenterNo" style="width: 120px"></el-input>
<el-input v-model="pageData.workCenterNo" style="width: 120px"></el-input>
</el-form-item> </el-form-item>
</el-form> </el-form>
<!-- 记录示意图 --> <!-- 记录示意图 -->
@ -118,7 +119,7 @@
<legend>等待订单</legend> <legend>等待订单</legend>
<el-form :inline="true" label-position="left" label-width="100px" class="customer-border"> <el-form :inline="true" label-position="left" label-width="100px" class="customer-border">
<el-form-item :label="'等待时间(分钟):'" > <el-form-item :label="'等待时间(分钟):'" >
<el-input type="number" v-model="searchData.waitTimes"
<el-input type="number" v-model="pageData.waitTimes"
style="margin-top: 3px; width: 48px;"> style="margin-top: 3px; width: 48px;">
</el-input> </el-input>
</el-form-item> </el-form-item>
@ -194,13 +195,16 @@
<el-form :inline="true" label-position="top" label-width="100px"> <el-form :inline="true" label-position="top" label-width="100px">
<el-form-item :label="'明细记录'"> <el-form-item :label="'明细记录'">
</el-form-item> </el-form-item>
<i class="el-icon-unfold"></i>
</el-form> </el-form>
<el-table <el-table
height="135" height="135"
:data="orderScheduleList" :data="orderScheduleList"
border border
highlight-current-row highlight-current-row
ref="scheduleTable"
@row-click="setCurrentSchedulingRow" @row-click="setCurrentSchedulingRow"
@row-dblclick="warnCancelScheduleConfirm"
v-loading="dataListLoading" v-loading="dataListLoading"
style="margin-top: -20px; width: 100%;"> style="margin-top: -20px; width: 100%;">
<el-table-column <el-table-column
@ -221,17 +225,27 @@
</el-table-column> </el-table-column>
</el-table> </el-table>
</el-main> </el-main>
<!--列表的组件-->
<Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist> <Chooselist ref="baseList" @getBaseData="getBaseData"></Chooselist>
<!-- 生产过程的停机组件 -->
<comSplitSchedule ref="comSplitSchedule" :close-on-click-modal="false"
:visible.sync="showDownFlag"
@initAddSplitSchedule="initAddSplitSchedule">
</comSplitSchedule>
</div> </div>
</template> </template>
<script> <script>
import Chooselist from '@/views/modules/common/Chooselist';/*列表组件*/ import Chooselist from '@/views/modules/common/Chooselist';/*列表组件*/
import comSplitSchedule from '@/views/modules/schedule/com_split_schedule';/*分批排产的modal*/
import { import {
getResourceRestList, getResourceRestList,
getShopOrderList, getShopOrderList,
getOrderScheduleList, getOrderScheduleList,
getCurrentWorkCenterNoByResourceId, getCurrentWorkCenterNoByResourceId,
scheduleWorkOrder,
cancelSoSchedule,
} from '@/api/schedule/order_schedule.js' } from '@/api/schedule/order_schedule.js'
export default { export default {
@ -239,13 +253,18 @@ export default {
return { return {
height: 200, height: 200,
tagNo: '', tagNo: '',
scheduleIndex: -1,
modelFlag: false, modelFlag: false,
modelInputFlag: true, modelInputFlag: true,
currentRoutingRow: {}, currentRoutingRow: {},
currentSchedlingRow: {}, currentSchedlingRow: {},
selectList: [], selectList: [],
searchData: {
pageData: {
site: this.$store.state.user.site, site: this.$store.state.user.site,
username: this.$store.state.user.name,
orderNo: '',
itemNo: '',
seqNo: 0,
resourceId: '', resourceId: '',
workCenterNo: '', workCenterNo: '',
enterTime1: '', enterTime1: '',
@ -253,17 +272,16 @@ export default {
needTime1: '', needTime1: '',
needTime2: new Date(), needTime2: new Date(),
scheduleDate: this.dayjs(new Date()).format('YYYY-MM-DD'), scheduleDate: this.dayjs(new Date()).format('YYYY-MM-DD'),
scheduleTime: this.dayjs(new Date()).format('HH:mm:ss'),
specifiedTime: 'N',
scheduledQty: 0,
sortField: '', sortField: '',
status: 1,
user: this.$store.state.user.name
status: 1
}, },
resourceShiftList: [], resourceShiftList: [],
shopOrderList: [], shopOrderList: [],
orderScheduleList: [], orderScheduleList: [],
dataListLoading: false, dataListLoading: false,
buttons: {
search: '查询',
},
columnTimeArray: [ columnTimeArray: [
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
@ -1100,10 +1118,10 @@ export default {
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
functionId: 5301, functionId: 5301,
serialNumber: '5301ScheduleLotSize',
serialNumber: '5301ScheduleQtyRequired',
tableId: "5301Schedule", tableId: "5301Schedule",
tableName: "排产明细表", tableName: "排产明细表",
columnProp: "lotSize",
columnProp: "qtyRequired",
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
columnLabel: "待生产数量", columnLabel: "待生产数量",
@ -1118,10 +1136,10 @@ export default {
{ {
userId: this.$store.state.user.name, userId: this.$store.state.user.name,
functionId: 5301, functionId: 5301,
serialNumber: '5301ScheduleLotSize',
serialNumber: '5301ScheduleQtyRequired',
tableId: "5301Schedule", tableId: "5301Schedule",
tableName: "排产明细表", tableName: "排产明细表",
columnProp: "lotSize",
columnProp: "qtyRequired",
headerAlign: "center", headerAlign: "center",
align: "center", align: "center",
columnLabel: "派工单需求数量", columnLabel: "派工单需求数量",
@ -1698,6 +1716,7 @@ export default {
/*组件*/ /*组件*/
components: { components: {
Chooselist,/*列表的组件*/ Chooselist,/*列表的组件*/
comSplitSchedule,/* 分批排产的组件 */
}, },
mounted() { mounted() {
@ -1709,22 +1728,29 @@ export default {
getResourceShiftData() { getResourceShiftData() {
let queryData = { let queryData = {
site: this.$store.state.user.site, site: this.$store.state.user.site,
workCenterNo: this.searchData.workCenterNo,
resourceId: this.searchData.resourceId,
scheduleDate: this.searchData.scheduleDate
workCenterNo: this.pageData.workCenterNo,
resourceId: this.pageData.resourceId,
scheduleDate: this.pageData.scheduleDate
} }
getResourceRestList(queryData).then(({data}) => { getResourceRestList(queryData).then(({data}) => {
this.resourceShiftList = data.rows this.resourceShiftList = data.rows
}) })
}, },
getShopOrderList() { getShopOrderList() {
getShopOrderList(this.searchData).then(({data}) => {
getShopOrderList(this.pageData).then(({data}) => {
this.shopOrderList = data.rows this.shopOrderList = data.rows
}) })
}, },
getOrderScheduleList() { getOrderScheduleList() {
getOrderScheduleList(this.searchData).then(({data}) => {
this.orderScheduleList = data.rows
getOrderScheduleList(this.pageData).then(({data}) => {
this.orderScheduleList = data.rows;
//
if(this.scheduleIndex >= 0){
//
this.$refs.scheduleTable.setCurrentRow(this.$refs.scheduleTable.data[index]);
}
}) })
}, },
@ -1735,22 +1761,14 @@ export default {
this.getOrderScheduleList(); this.getOrderScheduleList();
}, },
/*开始排产的操作*/
startScheduleOperation(row, $event, column){
row.qtyScheduled = 1;
//
//this.shopOrderList = JSON.parse(JSON.stringify(this.shopOrderList));
//this.$message.error('time_required!');
},
/*列表方法的回调*/
/*列表方法的回调*/
getBaseData(val){ getBaseData(val){
if (this.tagNo === 88){ if (this.tagNo === 88){
this.searchData.resourceId = val.ResourceID;
this.pageData.resourceId = val.ResourceID;
// //
this.getCurrentWorkCenterNoByResourceId(); this.getCurrentWorkCenterNoByResourceId();
}else if(this.tagNo == 24){ }else if(this.tagNo == 24){
this.searchData.workCenterNo = val.WorkCenterNo;
this.pageData.workCenterNo = val.WorkCenterNo;
} }
}, },
@ -1760,9 +1778,9 @@ export default {
this.$nextTick(() => { this.$nextTick(() => {
let strVal = ""; let strVal = "";
if (val === 88){ if (val === 88){
strVal = this.searchData.resourceId;
strVal = this.pageData.resourceId;
}else if(val === 24){ }else if(val === 24){
strVal = this.searchData.workCenterNo;
strVal = this.pageData.workCenterNo;
} }
this.$refs.baseList.init(val,strVal) this.$refs.baseList.init(val,strVal)
}) })
@ -1770,14 +1788,14 @@ export default {
/*获取当前的机台对应的加工中心*/ /*获取当前的机台对应的加工中心*/
getCurrentWorkCenterNoByResourceId(){ getCurrentWorkCenterNoByResourceId(){
getCurrentWorkCenterNoByResourceId(this.searchData).then(({data}) => {
getCurrentWorkCenterNoByResourceId(this.pageData).then(({data}) => {
// //
if (data.code == 500) { if (data.code == 500) {
this.$message.error(data.msg); this.$message.error(data.msg);
} else{ } else{
this.searchData.workCenterNo = data.workCenterNo;
this.pageData.workCenterNo = data.workCenterNo;
} }
this.searchData.workCenterNo = data.workCenterNo;
this.pageData.workCenterNo = data.workCenterNo;
}); });
}, },
@ -1794,11 +1812,86 @@ export default {
setCurrentRoutingRow(row, column, event) { setCurrentRoutingRow(row, column, event) {
this.currentRoutingRow = JSON.parse(JSON.stringify(row)); this.currentRoutingRow = JSON.parse(JSON.stringify(row));
}, },
/*开始排产的操作*/
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;
}
//
row.qtyScheduled = row.qtyToSchedule;
this.pageData.scheduledQty = row.qtyScheduled;
//
this.pageData.orderNo = row.orderNo;
this.pageData.itemNo = row.itemNo;
//
this.scheduleWorkOrderOperation();
},
/*排产生产工单*/
scheduleWorkOrderOperation(){
scheduleWorkOrder(this.pageData).then(({data}) => {
if(data.code == 500){
this.$message.error(data.msg);
}else{
this.$message.info(data.msg);
//
this.getOrderScheduleList();
}
});
},
/*设置派工单的行*/ /*设置派工单的行*/
setCurrentSchedulingRow(row, column, event) { setCurrentSchedulingRow(row, column, event) {
this.currentSchedlingRow = JSON.parse(JSON.stringify(row)); this.currentSchedlingRow = JSON.parse(JSON.stringify(row));
}, },
/*提示取消派工单*/
warnCancelScheduleConfirm(row, $event, column){
//
this.$confirm('确实要取消该派工单吗?', '提示', {
confirmButtonText: '确认',
celButtonText: '取消',
type: 'warning'
}).then(() =>{
//
this.cancelScheduleBun(row);
});
},
/*取消派工单的操作*/
cancelScheduleBun(scheduleRow){
//
this.pageData.orderNo = scheduleRow.orderNo;
this.pageData.itemNo = scheduleRow.itemNo;
this.pageData.seqNo = scheduleRow.seqNo;
this.pageData.scheduledQty = scheduleRow.qtyRequired;
this.pageData.workCenterNo = scheduleRow.workCenterNo;
this.pageData.resourceId = scheduleRow.resourceId;
//
cancelSoSchedule(this.pageData).then(({data}) => {
if(data.code == 500){
this.$message.error(data.msg);
}else{
this.$message.info(data.msg);
//
this.getOrderScheduleList();
}
});
},
/*分批排产*/
initAddSplitSchedule(scheduledQty){
//
},
}, },
created() { created() {
// //

Loading…
Cancel
Save