自动排产1.0

yangwl
zhaoxiaolin 5 months ago
parent 230466b4dd
commit 822968c5e8

@ -71,6 +71,14 @@ export function getWorkOrderList(id) {
}) })
} }
//排产预览
export function getWorkOrderListCG(id) {
return request({
url: '/plan/order/getWorkOrderListCG/' + id,
method: 'get'
})
}
// 通过母订单id查询最新订单列表 // 通过母订单id查询最新订单列表
export function getOrderList(id) { export function getOrderList(id) {
return request({ return request({
@ -184,3 +192,21 @@ export function autoSplitOrder(data) {
data: data data: data
}); });
} }
//关闭窗口
export function autoSplitOrderCancel(data) {
return request({
url: '/plan/order/autoSplitOrderCancel',
method: 'post',
data: data
});
}
//确认排产
export function autoSplitOrderOk(data) {
return request({
url: '/plan/order/autoSplitOrderOk',
method: 'post',
data: data
});
}

@ -115,14 +115,14 @@
>导出 >导出
</el-button> </el-button>
</el-col> </el-col>
<!-
<el-col :span="1.5"> <el-col :span="1.5">
<el-button type="primary" plain icon="el-icon-edit" size="mini" <el-button type="primary" plain icon="el-icon-guide" size="mini"
@click="handleAutoSplit" @click="handleAutoSplit"
:disabled="single" :disabled="single"
v-hasPermi="['mes:pro:order:edit']">辅助排产 v-hasPermi="['mes:pro:order:edit']">辅助排产
</el-button> </el-button>
</el-col>---> </el-col>
<right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar> <right-toolbar :showSearch.sync="showSearch" @queryTable="getList"></right-toolbar>
</el-row> </el-row>
@ -584,7 +584,7 @@
<div slot="footer" class="dialog-footer"> <div slot="footer" class="dialog-footer">
<el-button style="margin-top: 12px;" @click="next" v-if="this.activeSplit < 2"></el-button> <el-button style="margin-top: 12px;" @click="next" v-if="this.activeSplit < 2"></el-button>
<el-button style="margin-top: 12px;" @click="prev" v-if="this.activeSplit > 0"></el-button> <el-button style="margin-top: 12px;" @click="prev" v-if="this.activeSplit > 0"></el-button>
<el-button type="primary"> </el-button> <el-button type="primary" @click="autoSplitCommit" v-if="this.activeSplit==2"> </el-button>
<el-button @click="cancel"> </el-button> <el-button @click="cancel"> </el-button>
</div> </div>
</el-dialog> </el-dialog>
@ -597,14 +597,14 @@ import {
getProEquipment, getProEquipment,
getProRoutes,getProSortNo, getProRoutes,getProSortNo,
getProShifts, getProShifts,
getWorkOrderList, getWorkOrderList,getWorkOrderListCG,
subSplitOrder,checkRepeatBatchCodes, subSplitOrder,checkRepeatBatchCodes,
listOrder, listOrder,
addOrder, addOrder,
updateOrder, updateOrder,
syncSAP, selectMaterielList,getAutoSplitList, syncSAP, selectMaterielList,getAutoSplitList,
deleteOrder,getCanProductLine, deleteOrder,getCanProductLine,
autoSplitOrder autoSplitOrder,autoSplitOrderCancel,autoSplitOrderOk
} from '@/api/plan/order' } from '@/api/plan/order'
import Treeselect from '@riophae/vue-treeselect' import Treeselect from '@riophae/vue-treeselect'
import '@riophae/vue-treeselect/dist/vue-treeselect.css' import '@riophae/vue-treeselect/dist/vue-treeselect.css'
@ -726,10 +726,11 @@ export default {
openAutoSplit:false, openAutoSplit:false,
orderCodes:[], orderCodes:[],
autoSplitList:[], autoSplitList:[],
autoSplitLoading: true, openAutoSplit: false,
activeSplit: 0, activeSplit: 0,
autoSplitform1:{ autoSplitform1:{
productDate:new Date() productDate:null,
sortNo:null
}, },
autoSplitform2: {lineCodes:[]}, autoSplitform2: {lineCodes:[]},
lineCodes:[] lineCodes:[]
@ -1374,6 +1375,9 @@ export default {
this.dialogVisible = false; this.dialogVisible = false;
this.splitOpen = false; this.splitOpen = false;
this.reset(); this.reset();
this.openAutoSplit = false;
this.activeSplit = 0;
autoSplitOrderCancel(Object.assign({},this.autoSplitList[0])).then(response => {});
}, },
// //
checkNull(entity) { checkNull(entity) {
@ -1492,17 +1496,23 @@ export default {
}, },
// //
handleAutoSplit(row) { handleAutoSplit(row) {
this.autoSplitLoading = true; this.openAutoSplit = true;
this.autoSplitList = this.orderCodes; this.autoSplitList = this.orderCodes;
if(this.autoSplitList[0] == 'o2'){
this.$modal.msgError("已经拆分结束!");
}
this.autoSplitform1.productDate = this.autoSplitList[0].planProDate;
// () // ()
getProRoutes(this.autoSplitList[0].prodCode).then(response => { getProRoutes(this.autoSplitList[0].prodCode).then(response => {
this.routes = response.data; this.routes = response.data;
this.autoSplitform1.routeCode = response.data[0].routeCode this.autoSplitform1.routeCode = response.data[0].routeCode;
}) })
var ymd = moment(this.autoSplitform1.productDate).format('YYYY-MM-DD') //var ymd = moment(this.autoSplitform1.productDate).format('YYYY-MM-DD')
// //
getProSortNo(ymd).then(response => { getProSortNo(this.autoSplitform1.productDate).then(response => {
this.autoSplitform1.sortNo = response this.autoSplitform1.sortNo = response
}) })
// 线 // 线
@ -1513,7 +1523,6 @@ export default {
this.openAutoSplit = true; this.openAutoSplit = true;
this.autoSplitLoading = false;
}, },
// //
selectable(row, index) { selectable(row, index) {
@ -1555,9 +1564,20 @@ export default {
if (this.activeSplit++ > 2) this.activeSplit = 0; if (this.activeSplit++ > 2) this.activeSplit = 0;
//线 //线
if(this.activeSplit == 2){ if(this.activeSplit == 2){
debugger autoSplitOrder(Object.assign({},this.autoSplitList[0],this.autoSplitform1,this.autoSplitform2)).then(response => {
autoSplitOrder(Object.assign({},this.autoSplitform1,this.autoSplitform2,this.autoSplitList[0])).then(response => { this.workerLoading = true // true
//
getWorkOrderListCG(this.autoSplitList[0].id).then(response => {
var data = response.data
this.splitData = data
this.refreshWorkerTable = false // refreshProTablefalse
this.$nextTick(() => {
// 使$nextTickDOM
this.refreshWorkerTable = true // refreshProTabletrue
this.workerLoading = false // false
})
})
}); });
} }
}, },
@ -1565,10 +1585,17 @@ export default {
if (this.activeSplit-- > 2) this.activeSplit = 2; if (this.activeSplit-- > 2) this.activeSplit = 2;
// //
if(this.activeSplit == 1){ if(this.activeSplit == 1){
autoSplitOrderCancel(Object.assign({},autoSplitform2)).then(response => { autoSplitOrderCancel(Object.assign({},this.autoSplitList[0])).then(response => {
}); });
} }
},
autoSplitCommit(){
autoSplitOrderOk(Object.assign({},this.autoSplitList[0])).then(response => {
this.$modal.msgSuccess('提交成功')
this.getList();
this.openAutoSplit = false;
this.activeSplit = 0;
});
} }
} }

Loading…
Cancel
Save