Commit 677c6af7 authored by renjintao's avatar renjintao

ai api.js

parent 912fb1d2
...@@ -52,7 +52,6 @@ ...@@ -52,7 +52,6 @@
</Col> </Col>
</Row> </Row>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
...@@ -69,21 +68,21 @@ export default { ...@@ -69,21 +68,21 @@ export default {
Expand, Expand,
Temp, Temp,
Duration, Duration,
CheckResult CheckResult,
}, },
data() { data() {
return { return {
action: Api.index, action: Api.index,
easySearch: { easySearch: {
keys: { op: "notes", value: null } keys: { op: "notes", value: null },
}, },
result: { result: {
res: true, res: true,
datas: '{}' datas: "{}",
}, },
resultModal: false, resultModal: false,
entity: { entity: {
setTime: "" setTime: "",
}, },
editModal: false, editModal: false,
detailModal: false, detailModal: false,
...@@ -106,11 +105,11 @@ export default { ...@@ -106,11 +105,11 @@ export default {
return h("Icon", { return h("Icon", {
attrs: { attrs: {
type: "md-more", type: "md-more",
size: 18 size: 18,
}, },
class: "drag" class: "drag",
}); });
} },
}, },
{ {
type: "expand", type: "expand",
...@@ -118,16 +117,16 @@ export default { ...@@ -118,16 +117,16 @@ export default {
render: (h, params) => { render: (h, params) => {
return h(Expand, { return h(Expand, {
props: { props: {
rowId: params.row.part_task_pk rowId: params.row.part_task_pk,
} },
}); });
} },
}, },
{ {
key: "selection", key: "selection",
type: "selection", type: "selection",
width: 50, width: 50,
align: "center" align: "center",
}, },
{ {
key: "id", key: "id",
...@@ -135,38 +134,38 @@ export default { ...@@ -135,38 +134,38 @@ export default {
hide: true, hide: true,
align: "left", align: "left",
sortable: true, sortable: true,
width: 50 width: 50,
}, },
{ {
key: "mesCode", key: "mesCode",
title: this.l("mes_code"), title: this.l("mes_code"),
align: "left", align: "left",
high: true, high: true,
width: 240 width: 240,
}, },
{ {
key: "product_name", key: "product_name",
title: this.l("product_name"), title: this.l("product_name"),
align: "left", align: "left",
high: true high: true,
}, },
{ {
key: "drawingnum", key: "drawingnum",
title: this.l("drawingnum"), title: this.l("drawingnum"),
align: "left", align: "left",
high: true high: true,
}, },
{ {
key: "project_no", key: "project_no",
title: this.l("project_no"), title: this.l("project_no"),
align: "left", align: "left",
high: true high: true,
}, },
{ {
key: "batchnum", key: "batchnum",
title: this.l("batchnum"), title: this.l("batchnum"),
align: "left", align: "left",
high: true high: true,
}, },
{ {
key: "urgency_level", key: "urgency_level",
...@@ -174,7 +173,7 @@ export default { ...@@ -174,7 +173,7 @@ export default {
align: "left", align: "left",
high: true, high: true,
code: "plan.order.urgencyLevel", code: "plan.order.urgencyLevel",
width: 100 width: 100,
}, },
{ {
key: "priority", key: "priority",
...@@ -184,14 +183,14 @@ export default { ...@@ -184,14 +183,14 @@ export default {
hide: true, hide: true,
render: (h, params) => { render: (h, params) => {
return h("span", {}, params.index + 1); return h("span", {}, params.index + 1);
} },
}, },
{ {
key: "plan_qty", key: "plan_qty",
title: this.l("plan_qty"), title: this.l("plan_qty"),
align: "right", align: "right",
width: 100, width: 100,
high: true high: true,
}, },
{ {
key: "spare_qty", key: "spare_qty",
...@@ -199,7 +198,7 @@ export default { ...@@ -199,7 +198,7 @@ export default {
align: "right", align: "right",
width: 100, width: 100,
high: true, high: true,
hide: true hide: true,
}, },
{ {
key: "plan_start", key: "plan_start",
...@@ -208,7 +207,7 @@ export default { ...@@ -208,7 +207,7 @@ export default {
high: true, high: true,
hide: true, hide: true,
resizable: true, resizable: true,
width: 150 width: 150,
}, },
{ {
key: "plan_finish", key: "plan_finish",
...@@ -218,7 +217,7 @@ export default { ...@@ -218,7 +217,7 @@ export default {
hide: true, hide: true,
sortable: true, sortable: true,
resizable: true, resizable: true,
width: 150 width: 150,
}, },
{ {
key: "notes", key: "notes",
...@@ -226,7 +225,7 @@ export default { ...@@ -226,7 +225,7 @@ export default {
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
hide: true hide: true,
}, },
{ {
key: "demand_start", key: "demand_start",
...@@ -234,7 +233,7 @@ export default { ...@@ -234,7 +233,7 @@ export default {
align: "center", align: "center",
resizable: true, resizable: true,
width: 150, width: 150,
type: "date" type: "date",
}, },
{ {
key: "demand_finish", key: "demand_finish",
...@@ -243,14 +242,14 @@ export default { ...@@ -243,14 +242,14 @@ export default {
high: true, high: true,
resizable: true, resizable: true,
width: 150, width: 150,
type: "date" type: "date",
}, },
{ {
key: "badjustflag", key: "badjustflag",
title: this.l("badjustflag"), title: this.l("badjustflag"),
align: "left", align: "left",
high: true, high: true,
hide: true hide: true,
}, },
{ {
title: "操作", title: "操作",
...@@ -266,9 +265,9 @@ export default { ...@@ -266,9 +265,9 @@ export default {
type: "icon", type: "icon",
title: "恢复工序", title: "恢复工序",
oprate: "edit", oprate: "edit",
msg: "确认要恢复工序吗?" msg: "确认要恢复工序吗?",
}, },
on: { click: () => this.refresh(params.row.part_task_pk) } on: { click: () => this.refresh(params.row.part_task_pk) },
}), }),
h("op", { h("op", {
attrs: { attrs: {
...@@ -276,13 +275,13 @@ export default { ...@@ -276,13 +275,13 @@ export default {
type: "icon", type: "icon",
title: "移出排产池", title: "移出排产池",
oprate: "delete", oprate: "delete",
msg: "确认要移出排产吗?" msg: "确认要移出排产吗?",
}, },
on: { click: () => this.remove(params.row.part_task_pk) } on: { click: () => this.remove(params.row.part_task_pk) },
}) }),
]); ]);
} },
} },
], ],
arrPartPkId: [], arrPartPkId: [],
//设置参数开始 //设置参数开始
...@@ -290,11 +289,11 @@ export default { ...@@ -290,11 +289,11 @@ export default {
opTaskPk: 0, //工单ID opTaskPk: 0, //工单ID
partTaskPk: 0, //生产计划ID partTaskPk: 0, //生产计划ID
taskSeq: "", //工序编号 taskSeq: "", //工序编号
count: 0 //生产计划数量 count: 0, //生产计划数量
}, },
//设置参数结束 //设置参数结束
circleModal: false, //进度条 circleModal: false, //进度条
tempStatu: 0 //新建模型时传过来的id值 tempStatu: 0, //新建模型时传过来的id值
}; };
}, },
mounted() { mounted() {
...@@ -306,14 +305,13 @@ export default { ...@@ -306,14 +305,13 @@ export default {
methods: { methods: {
//排产池加载数据列表 //排产池加载数据列表
loadList() { loadList() {
Api.getall().then(res => { Api.getall().then((res) => {
if (res.success) { if (res.success) {
this.list = res.result; this.list = res.result;
} }
}); });
}, },
detail(id) { detail(id) {
this.detailModal = true; this.detailModal = true;
this.curId = id; this.curId = id;
...@@ -325,9 +323,9 @@ export default { ...@@ -325,9 +323,9 @@ export default {
refresh(partPkId) { refresh(partPkId) {
//恢复工序 //恢复工序
let params = { let params = {
id: partPkId id: partPkId,
}; };
Api.recoveryoptasksimluate(params).then(r => { Api.recoveryoptasksimluate(params).then((r) => {
if (r.success) { if (r.success) {
this.$Message.success("恢复成功"); this.$Message.success("恢复成功");
this.list = []; this.list = [];
...@@ -345,10 +343,10 @@ export default { ...@@ -345,10 +343,10 @@ export default {
paramsArry.push(partPkId); paramsArry.push(partPkId);
} }
let params = { let params = {
partPks: paramsArry partPks: paramsArry,
}; };
Api.beforeshiftoutapspool(params) Api.beforeshiftoutapspool(params)
.then(res => { .then((res) => {
if (res.success) { if (res.success) {
if (res.result) { if (res.result) {
this.checkapspool(params); this.checkapspool(params);
...@@ -361,7 +359,7 @@ export default { ...@@ -361,7 +359,7 @@ export default {
this.$Message.error("校验失败"); this.$Message.error("校验失败");
} }
}) })
.catch(err => { .catch((err) => {
this.$Message.error("连接错误1"); this.$Message.error("连接错误1");
}); });
}, },
...@@ -370,7 +368,7 @@ export default { ...@@ -370,7 +368,7 @@ export default {
}, },
checkapspool(params) { checkapspool(params) {
Api.shiftoutapspool(params) Api.shiftoutapspool(params)
.then(r => { .then((r) => {
if (r.success) { if (r.success) {
this.$Message.success("移出排产池操作成功"); this.$Message.success("移出排产池操作成功");
this.loadList(); this.loadList();
...@@ -383,7 +381,7 @@ export default { ...@@ -383,7 +381,7 @@ export default {
this.$Message.error("移出排产池操作失败"); this.$Message.error("移出排产池操作失败");
} }
}) })
.catch(err => { .catch((err) => {
this.$Message.error("连接失败2"); this.$Message.error("连接失败2");
}); });
}, },
...@@ -391,7 +389,7 @@ export default { ...@@ -391,7 +389,7 @@ export default {
//批量选择 //批量选择
let selectRows = a; let selectRows = a;
this.arrPartPkId = []; this.arrPartPkId = [];
selectRows.forEach(e => { selectRows.forEach((e) => {
this.arrPartPkId.push(e.part_task_pk); this.arrPartPkId.push(e.part_task_pk);
}); });
}, },
...@@ -457,13 +455,13 @@ export default { ...@@ -457,13 +455,13 @@ export default {
parmsOrderpriority.alls = arryIds; parmsOrderpriority.alls = arryIds;
// alert(JSON.stringify(parmsOrderpriority)); // alert(JSON.stringify(parmsOrderpriority));
Api.orderpriority(parmsOrderpriority) Api.orderpriority(parmsOrderpriority)
.then(res => { .then((res) => {
if (res.success) { if (res.success) {
if (res.result) { if (res.result) {
//this.$Message.success("排序成功"); //this.$Message.success("排序成功");
//智能排产前检查 //智能排产前检查
Api.apsdatachecked() Api.apsdatachecked()
.then(res1 => { .then((res1) => {
if (res1.success) { if (res1.success) {
// this.result=res1.result; // this.result=res1.result;
// this.resultModal=true; // this.resultModal=true;
...@@ -471,12 +469,12 @@ export default { ...@@ -471,12 +469,12 @@ export default {
} else { } else {
// this.circleModal = false; // this.circleModal = false;
// this.$Message.error("操作失败:数据校验"); // this.$Message.error("操作失败:数据校验");
this.result=res1.result; this.result = res1.result;
this.resultModal=true; this.resultModal = true;
} }
}) })
.catch( .catch(
function(err) { function (err) {
this.circleModal = false; this.circleModal = false;
this.$Message.error("操作失败"); this.$Message.error("操作失败");
}.bind(this) }.bind(this)
...@@ -491,7 +489,7 @@ export default { ...@@ -491,7 +489,7 @@ export default {
} }
}) })
.catch( .catch(
function(err) { function (err) {
this.circleModal = false; this.circleModal = false;
this.$Message.error("操作失败"); this.$Message.error("操作失败");
}.bind(this) }.bind(this)
...@@ -500,22 +498,30 @@ export default { ...@@ -500,22 +498,30 @@ export default {
checkOk() { checkOk() {
//排产计算 //排产计算
let paramsTime = { let paramsTime = {
setTime: this.entity.setTime setTime: this.entity.setTime,
}; };
Api.apsprepareandcalc(paramsTime) Api.apsprepareandcalc(paramsTime)
.then(res2 => { .then((res2) => {
if (res2.success) { if (res2.success) {
if (res2.result.res) { if (res2.result.res) {
this.$Message.success("排产计算成功"); // this.$Message.success("排产计算成功");
//智能排产操作start //智能排产操作start
Api.aischedule(paramsTime).then((res3) => {
//只能排产操作end if (res3.success) {
if (res3.result.res) {
this.$Message.success("排产成功");
this.circleModal = false; this.circleModal = false;
this.$router.push({ this.$router.push({
path: "/ai/results" path: "/ai/results",
// params: { customerId: id } // params: { customerId: id }
}); });
} else {
this.circleModal = false;
this.$Message.error(res3.result.msg);
}
}
});
//智能排产操作end
} else { } else {
this.circleModal = false; this.circleModal = false;
this.$Message.error(res2.result.msg); this.$Message.error(res2.result.msg);
...@@ -526,16 +532,13 @@ export default { ...@@ -526,16 +532,13 @@ export default {
} }
}) })
.catch( .catch(
function(err) { function (err) {
this.circleModal = false; this.circleModal = false;
this.$Message.error("操作失败"); this.$Message.error("操作失败");
}.bind(this) }.bind(this)
); );
}, },
},
}
}; };
</script> </script>
<style lang="less"> <style lang="less">
......
...@@ -121,16 +121,21 @@ export default { ...@@ -121,16 +121,21 @@ export default {
}, },
//保存外协任务工期 //保存外协任务工期
saveoutsidetime(params) { saveoutsidetime(params) {
return Api.post(`${apsUrl}/apspoolappservices/saveoutsidetime `, params) return Api.post(`${apsUrl}/apspoolappservices/saveoutsidetime`, params)
}, },
//保存插单任务 //保存插单任务
saveinsertorder(params) { saveinsertorder(params) {
return Api.post(`${apsUrl}/apspoolappservices/saveinsertorder `, params) return Api.post(`${apsUrl}/apspoolappservices/saveinsertorder`, params)
}, },
//取消插单任务 //取消插单任务
cancelinsertorder(params) { cancelinsertorder(params) {
return Api.post(`${apsUrl}/apspoolappservices/cancelinsertorder `, params) return Api.post(`${apsUrl}/apspoolappservices/cancelinsertorder`, params)
}, },
//修改外协工期相关end----- //修改外协工期相关end-----
//智能排产start----
aischedule(params) {
return Api.post(`${apsUrl}/aps/aischedule`, params)
},
//智能排产end----
} }
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