Commit 909c5f5d authored by 仇晓婷's avatar 仇晓婷

流水排产

parent f6b29aad
...@@ -135,7 +135,7 @@ ...@@ -135,7 +135,7 @@
import Set from "./set"; import Set from "./set";
import Api from "./api"; import Api from "./api";
export default { export default {
name: "list", name: "set",
components: { components: {
Set Set
}, },
...@@ -182,11 +182,11 @@ export default { ...@@ -182,11 +182,11 @@ export default {
u.aps = 0; u.aps = 0;
}); });
this.list = r.result; this.list = r.result;
if (r.result[0]) { // if (r.result[0]) {
// this.tagTata(r.result[0].id); // this.tagTata(r.result[0].id);
} else { // } else {
this.result = []; // this.result = [];
} // }
} else { } else {
this.$Message.info("排产池数据请求失败"); this.$Message.info("排产池数据请求失败");
} }
...@@ -298,58 +298,62 @@ export default { ...@@ -298,58 +298,62 @@ export default {
}, },
//下发 //下发
lowerHair() { lowerHair() {
var items = []; if (this.orderId) {
var obj = {}; var items = [];
if (this.mode == 1) { var obj = {};
for (let i = 0; i < this.result.length; i++) { if (this.mode == 1) {
obj = { for (let i = 0; i < this.result.length; i++) {
detailId: this.result[i].detailId, obj = {
userIds: this.result[i].userIds, detailId: this.result[i].detailId,
quantity: this.result[i].quantity, userIds: this.result[i].userIds,
beginTime: this.result[i].beginTime, quantity: this.result[i].quantity,
endTime: this.result[i].endTime, beginTime: this.result[i].beginTime,
remark: this.result[i].remark endTime: this.result[i].endTime,
remark: this.result[i].remark
};
items.push(obj);
}
let data = {
orderId: this.orderId,
routingHeaderId: this.routingHeaderId,
items: items
}; };
items.push(obj); Api.flonestepschedule(data).then(r => {
} if (r.success) {
let data = { this.$Message.success("下发成功");
orderId: this.orderId, this.orderlist(this.status);
routingHeaderId: this.routingHeaderId, } else {
items: items this.$Message.info("下发失败");
}; }
Api.flonestepschedule(data).then(r => { });
if (r.success) { } else if (this.mode == 2) {
this.$Message.success("下发成功"); for (let i = 0; i < this.result.length; i++) {
this.orderlist(this.status); obj = {
} else { detailId: this.result[i].detailId,
this.$Message.info("下发失败"); shopId: this.result[i].shopId,
quantity: this.result[i].quantity,
beginTime: this.result[i].beginTime,
endTime: this.result[i].endTime,
remark: this.result[i].remark
};
items.push(obj);
} }
}); let data = {
} else if (this.mode == 2) { orderId: this.orderId,
for (let i = 0; i < this.result.length; i++) { routingHeaderId: this.routingHeaderId,
obj = { items: items
detailId: this.result[i].detailId,
shopId: this.result[i].shopId,
quantity: this.result[i].quantity,
beginTime: this.result[i].beginTime,
endTime: this.result[i].endTime,
remark: this.result[i].remark
}; };
items.push(obj); Api.fltwostepschedule(data).then(r => {
if (r.success) {
this.$Message.success("下发成功");
this.orderlist(this.status);
} else {
this.$Message.info("下发失败");
}
});
} }
let data = { } else {
orderId: this.orderId, this.$Message.info("请先选择排产订单");
routingHeaderId: this.routingHeaderId,
items: items
};
Api.fltwostepschedule(data).then(r => {
if (r.success) {
this.$Message.success("下发成功");
this.orderlist(this.status);
} else {
this.$Message.info("下发失败");
}
});
} }
}, },
closeOk() { closeOk() {
...@@ -370,7 +374,6 @@ export default { ...@@ -370,7 +374,6 @@ export default {
let oks = this.result.filter(u => { let oks = this.result.filter(u => {
return u.aps == mode; return u.aps == mode;
}); });
return oks.length == this.result.length; return oks.length == this.result.length;
} }
} }
......
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