Commit dbdeb7c7 authored by renjintao's avatar renjintao

aps

parent 147ad0f5
...@@ -138,4 +138,13 @@ export default { ...@@ -138,4 +138,13 @@ export default {
return Api.post(`${apsUrl}/aps/aischedule`, params) return Api.post(`${apsUrl}/aps/aischedule`, params)
}, },
//智能排产end---- //智能排产end----
//多级连排
createorderproductrelation() {
return Api.post(`${apsUrl}/apspoolappservices/createorderproductrelation`)
},
apsdatascheduledlevel(params) {
return Api.post(`${apsUrl}/apspoolappservices/aps_data_scheduled_level`, params)
},
} }
...@@ -26,7 +26,7 @@ ...@@ -26,7 +26,7 @@
</a> </a>
<Button type="primary" @click="goResults" style="background:#515A6E;border:solid 1px #515A6E">历史方案</Button> <Button type="primary" @click="goResults" style="background:#515A6E;border:solid 1px #515A6E">历史方案</Button>
<Button type="primary" @click="openApsModal">APS排产</Button> <Button type="primary" @click="openApsModal">APS排产</Button>
<Button type="primary" v-if="showMutiAps">多级连排</Button> <Button type="primary" @click="openApsMutiModal">多级连排</Button>
</template> </template>
<template slot="batch"> <template slot="batch">
<Button type="primary" class="mr10 ml10" @click="removeOk">移出排产</Button> <Button type="primary" class="mr10 ml10" @click="removeOk">移出排产</Button>
...@@ -41,9 +41,12 @@ ...@@ -41,9 +41,12 @@
<Modal v-model="addModal" title="工序参数设置" footer-hide width="1000"> <Modal v-model="addModal" title="工序参数设置" footer-hide width="1000">
<Add @on-close="cancel" @on-parameter-ok="addOk" :opTaskPk="setParams.opTaskPk" :partTaskPk="setParams.partTaskPk" :taskSeq="setParams.taskSeq" :count="setParams.count" /> <Add @on-close="cancel" @on-parameter-ok="addOk" :opTaskPk="setParams.opTaskPk" :partTaskPk="setParams.partTaskPk" :taskSeq="setParams.taskSeq" :count="setParams.count" />
</Modal> </Modal>
<Modal v-model="apsModal" title="确定APS排产" @on-ok="apsOk" @on-cancel="cancel"> <Modal v-model="apsModal" title="确定APS排产" @on-ok="apsOk(1)" @on-cancel="cancel">
<p>确定进行APS排产?</p> <p>确定进行APS排产?</p>
</Modal> </Modal>
<Modal v-model="apsMutiModal" title="确定多级连排" @on-ok="apsMutiOk" @on-cancel="cancel">
<p>确定进行多级连排?</p>
</Modal>
<!-- <Modal v-model="resultModal" title="数据检查" width="1500" @on-ok="checkOk" @on-cancel="cancel"> <!-- <Modal v-model="resultModal" title="数据检查" width="1500" @on-ok="checkOk" @on-cancel="cancel">
<CheckResult :data="result"></CheckResult> <CheckResult :data="result"></CheckResult>
</Modal> --> </Modal> -->
...@@ -110,6 +113,7 @@ export default { ...@@ -110,6 +113,7 @@ export default {
detailModal: false, detailModal: false,
deletelModal: false, deletelModal: false,
apsModal: false, apsModal: false,
apsMutiModal: false,
addModalTemp: false, addModalTemp: false,
modalDuration: false, modalDuration: false,
insertlModal1: false, insertlModal1: false,
...@@ -369,7 +373,6 @@ export default { ...@@ -369,7 +373,6 @@ export default {
listTemp: [], //自定义模板排序下拉框列表 listTemp: [], //自定义模板排序下拉框列表
tempValue: null, tempValue: null,
tempStatu: 0, //新建模型时传过来的id值 tempStatu: 0, //新建模型时传过来的id值
showMutiAps: false, //多级连排是否显示
}; };
}, },
mounted() { mounted() {
...@@ -505,6 +508,7 @@ export default { ...@@ -505,6 +508,7 @@ export default {
this.apsModal = false; this.apsModal = false;
this.apsCheckModal = false; this.apsCheckModal = false;
this.resultModal = false; this.resultModal = false;
this.apsMutiModal = false;
}, },
onDragDrop(a, b) { onDragDrop(a, b) {
//拖拽排序 //拖拽排序
...@@ -538,6 +542,17 @@ export default { ...@@ -538,6 +542,17 @@ export default {
this.$Message.error("请设置基准日期"); this.$Message.error("请设置基准日期");
} }
}, },
openApsMutiModal() {
if (this.list.length == 1) {
this.$Message.error("单个订单不能进行多级连排")
return false
}
if (this.entity.setTime != "") {
this.apsMutiModal = true;
} else {
this.$Message.error("请设置基准日期");
}
},
//查看历史方案 //查看历史方案
goResults() { goResults() {
this.$router.push({ this.$router.push({
...@@ -546,7 +561,7 @@ export default { ...@@ -546,7 +561,7 @@ export default {
}); });
}, },
//确定aps排产 //确定aps排产
apsOk() { apsOk(type) {
this.circleModal = true; this.circleModal = true;
//APS排产前订单优先级功能 //APS排产前订单优先级功能
let parmsOrderpriority = { let parmsOrderpriority = {
...@@ -571,7 +586,11 @@ export default { ...@@ -571,7 +586,11 @@ export default {
if (res1.success) { if (res1.success) {
// this.result=res1.result; // this.result=res1.result;
// this.resultModal=true; // this.resultModal=true;
this.checkOk(); if (type == 1) {
this.checkOk();
} else if (type == 2) {
this.checkMutiOk()
}
} else { } else {
// this.circleModal = false; // this.circleModal = false;
// this.$Message.error("操作失败:数据校验"); // this.$Message.error("操作失败:数据校验");
...@@ -632,6 +651,47 @@ export default { ...@@ -632,6 +651,47 @@ export default {
}.bind(this) }.bind(this)
); );
}, },
//多级连排
apsMutiOk() {
Api.createorderproductrelation().then(res => {
if (res.success && res.result) {
this.apsOk(2)
} else {
this.$Message.error("订单没有bom关系")
}
})
},
checkMutiOk() {
//排产计算
let paramsTime = {
DtTime: this.entity.setTime
};
Api.apsdatascheduledlevel(paramsTime)
.then(res2 => {
if (res2.success) {
if (res2.result.res) {
this.$Message.success("排产计算成功");
this.circleModal = false;
this.$router.push({
path: "/aps/results"
// params: { customerId: id }
});
} else {
this.circleModal = false;
this.$Message.error(res2.result.msg);
}
} else {
this.circleModal = false;
this.$Message.error("操作失败:排产计算");
}
})
.catch(
function (err) {
this.circleModal = false;
this.$Message.error("操作失败");
}.bind(this)
);
},
//打开设置参数 //打开设置参数
openAddModel(type, row) { openAddModel(type, row) {
if (type == 2) { if (type == 2) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment