Commit a786ee3a authored by 仇晓婷's avatar 仇晓婷

智能排产

parent d58fef4f
<template> <template>
<div style="padding: 0;" class="excute"> <div style="padding: 0" class="excute">
<DataGrid style="margin-top:2px; margin-bottom: -5px;" :columns="columns" ref="grid" :easy="false" :high="false" :set="false" :border="false" :data="data1" :height="gridHeight" :page="false" :size="size"></DataGrid> <DataGrid
style="margin-top: 2px; margin-bottom: -5px"
:columns="columns"
ref="grid"
:easy="false"
:high="false"
:set="false"
:border="false"
:data="data1"
:height="gridHeight"
:page="false"
:size="size"
></DataGrid>
<Modal v-model="editModal" title="编辑" footer-hide width="800"> <Modal v-model="editModal" title="编辑" footer-hide width="800">
<Edit :row="rowData" @on-close="cancel" @on-option-ok="addOk" /> <Edit :row="rowData" @on-close="cancel" @on-option-ok="addOk" />
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
...@@ -15,12 +27,12 @@ export default { ...@@ -15,12 +27,12 @@ export default {
name: "list", name: "list",
components: { components: {
Edit, Edit,
Add Add,
}, },
props: { props: {
rowId: { rowId: {
type: Number type: Number,
} },
}, },
data() { data() {
return { return {
...@@ -28,8 +40,8 @@ export default { ...@@ -28,8 +40,8 @@ export default {
easySearch: { easySearch: {
keys: { keys: {
op: "task_seq", op: "task_seq",
value: null value: null,
} },
}, },
setParsModal: false, setParsModal: false,
editModal: false, editModal: false,
...@@ -38,23 +50,24 @@ export default { ...@@ -38,23 +50,24 @@ export default {
curId: 0, curId: 0,
gridHeight: 150, gridHeight: 150,
size: "small", size: "small",
columns: [{ columns: [
{
title: " ", title: " ",
width: 130 width: 130,
}, },
{ {
key: "task_seq", key: "task_seq",
title: this.l("task_seq"), title: this.l("task_seq"),
align: "left", align: "left",
easy: true, easy: true,
high: true high: true,
}, },
{ {
key: "op_task_pk", key: "op_task_pk",
title: this.l("op_task_pk"), title: this.l("op_task_pk"),
align: "left", align: "left",
high: true, high: true,
hide: true hide: true,
}, },
{ {
key: "task_name", key: "task_name",
...@@ -62,28 +75,42 @@ export default { ...@@ -62,28 +75,42 @@ export default {
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
hide: true hide: true,
}, },
{ {
key: "taskseq_des", key: "taskseq_des",
title: this.l("task_name"), title: this.l("task_name"),
align: "left", align: "left",
easy: true, easy: true,
high: true high: true,
},
{
key: "routingHeaderCode",
title: this.l("routingHeaderCode"),
align: "left",
easy: true,
high: true,
},
{
key: "routingHeaderName",
title: this.l("routingHeaderName"),
align: "left",
easy: true,
high: true,
}, },
{ {
key: "part_task_pk", key: "part_task_pk",
title: this.l("part_task_pk"), title: this.l("part_task_pk"),
align: "left", align: "left",
high: true, high: true,
hide: true hide: true,
}, },
{ {
key: "put_into_qty", key: "put_into_qty",
title: this.l("put_into_qty"), title: this.l("put_into_qty"),
align: "left", align: "left",
high: true, high: true,
hide: true hide: true,
}, },
{ {
key: "plan_start", key: "plan_start",
...@@ -91,7 +118,7 @@ export default { ...@@ -91,7 +118,7 @@ export default {
align: "center", align: "center",
high: true, high: true,
width: 140, width: 140,
hide: true hide: true,
}, },
{ {
key: "plan_finish", key: "plan_finish",
...@@ -99,42 +126,42 @@ export default { ...@@ -99,42 +126,42 @@ export default {
align: "center", align: "center",
high: true, high: true,
width: 140, width: 140,
hide: true hide: true,
}, },
{ {
key: "equip_type", key: "equip_type",
title: this.l("equip_type"), title: this.l("equip_type"),
align: "left", align: "left",
easy: true, easy: true,
high: true high: true,
}, },
{ {
key: "firsT_EQUIP_CODE", key: "firsT_EQUIP_CODE",
title: this.l("first_equip"), title: this.l("first_equip"),
align: "left", align: "left",
easy: true, easy: true,
high: true high: true,
}, },
{ {
key: "setup_time", key: "setup_time",
title: this.l("setup_time"), title: this.l("setup_time"),
align: "right", align: "right",
high: true, high: true,
type: "outputTime" type: "outputTime",
}, },
{ {
key: "run_time", key: "run_time",
title: this.l("run_time"), title: this.l("run_time"),
align: "right", align: "right",
high: true, high: true,
type: "outputTime" type: "outputTime",
}, },
{ {
key: "outside_time", key: "outside_time",
title: this.l("outside_time"), title: this.l("outside_time"),
align: "right", align: "right",
high: true, high: true,
type: "outputTime" type: "outputTime",
}, },
{ {
key: "transport_time", key: "transport_time",
...@@ -142,7 +169,7 @@ export default { ...@@ -142,7 +169,7 @@ export default {
align: "right", align: "right",
high: true, high: true,
hide: true, hide: true,
type: "outputTime" type: "outputTime",
}, },
{ {
key: "check_time", key: "check_time",
...@@ -150,13 +177,13 @@ export default { ...@@ -150,13 +177,13 @@ export default {
align: "right", align: "right",
high: true, high: true,
hide: true, hide: true,
type: "outputTime" type: "outputTime",
}, },
{ {
key: "efficiency_value", key: "efficiency_value",
title: this.l("efficiency_value"), title: this.l("efficiency_value"),
align: "right", align: "right",
high: true high: true,
}, },
{ {
key: "machine_rule", key: "machine_rule",
...@@ -164,14 +191,14 @@ export default { ...@@ -164,14 +191,14 @@ export default {
align: "center", align: "center",
easy: true, easy: true,
high: true, high: true,
width: 140 width: 140,
}, },
{ {
key: "singleout", key: "singleout",
title: this.l("singleout"), title: this.l("singleout"),
align: "left", align: "left",
high: true, high: true,
hide: true hide: true,
}, },
{ {
key: "equip_type", key: "equip_type",
...@@ -179,7 +206,7 @@ export default { ...@@ -179,7 +206,7 @@ export default {
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
hide: true hide: true,
}, },
{ {
key: "first_equip", key: "first_equip",
...@@ -187,48 +214,48 @@ export default { ...@@ -187,48 +214,48 @@ export default {
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
hide: true hide: true,
}, },
{ {
key: "cal_id", key: "cal_id",
title: this.l("cal_id"), title: this.l("cal_id"),
align: "left", align: "left",
easy: true, easy: true,
high: true high: true,
}, },
{ {
key: "plan_method", key: "plan_method",
title: this.l("plan_method"), title: this.l("plan_method"),
align: "left", align: "left",
easy: true, easy: true,
high: true high: true,
}, },
{ {
key: "over_time", key: "over_time",
title: this.l("over_time"), title: this.l("over_time"),
align: "left", align: "left",
easy: true, easy: true,
high: true high: true,
}, },
{ {
key: "isdiscrete", key: "isdiscrete",
title: this.l("isdiscrete"), title: this.l("isdiscrete"),
align: "center", align: "center",
easy: true, easy: true,
high: true high: true,
}, },
{ {
key: "discrete_value", key: "discrete_value",
title: this.l("discrete_value"), title: this.l("discrete_value"),
align: "right", align: "right",
high: true high: true,
}, },
{ {
key: "multi_machine", key: "multi_machine",
title: this.l("multi_machine"), title: this.l("multi_machine"),
align: "center", align: "center",
easy: true, easy: true,
high: true high: true,
}, },
{ {
key: "notes", key: "notes",
...@@ -236,7 +263,7 @@ export default { ...@@ -236,7 +263,7 @@ export default {
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
hide: true hide: true,
}, },
{ {
...@@ -245,21 +272,21 @@ export default { ...@@ -245,21 +272,21 @@ export default {
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
hide: true hide: true,
}, },
{ {
key: "routing_detail_id", key: "routing_detail_id",
title: this.l("routing_detail_id"), title: this.l("routing_detail_id"),
align: "left", align: "left",
high: true, high: true,
hide: true hide: true,
}, },
{ {
key: "routing_header_id", key: "routing_header_id",
title: this.l("routing_header_id"), title: this.l("routing_header_id"),
align: "left", align: "left",
high: true, high: true,
hide: true hide: true,
}, },
{ {
key: "comb_param", key: "comb_param",
...@@ -267,14 +294,14 @@ export default { ...@@ -267,14 +294,14 @@ export default {
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
hide: true hide: true,
}, },
{ {
key: "rule_qty", key: "rule_qty",
title: this.l("rule_qty"), title: this.l("rule_qty"),
align: "left", align: "left",
high: true, high: true,
hide: true hide: true,
}, },
{ {
title: "操作", title: "操作",
...@@ -282,19 +309,22 @@ export default { ...@@ -282,19 +309,22 @@ export default {
width: 140, width: 140,
align: "center", align: "center",
render: (h, params) => { render: (h, params) => {
return h("div", { return h(
class: "action" "div",
}, [ {
class: "action",
},
[
h("op", { h("op", {
attrs: { attrs: {
icon: "md-create", icon: "md-create",
type: "icon", type: "icon",
title: "編輯工序", title: "編輯工序",
oprate: "edit" oprate: "edit",
}, },
on: { on: {
click: () => this.edit(params.row) click: () => this.edit(params.row),
} },
}), }),
h("op", { h("op", {
attrs: { attrs: {
...@@ -302,15 +332,16 @@ export default { ...@@ -302,15 +332,16 @@ export default {
type: "icon", type: "icon",
title: "删除工序", title: "删除工序",
oprate: "delete", oprate: "delete",
msg: "确认要刪除工序吗?" msg: "确认要刪除工序吗?",
}, },
on: { on: {
click: () => this.remove(params.row, params.index) click: () => this.remove(params.row, params.index),
} },
}) }),
]); ]
} );
} },
},
], ],
data1: [], data1: [],
insertTItle: "插单", insertTItle: "插单",
...@@ -320,28 +351,25 @@ export default { ...@@ -320,28 +351,25 @@ export default {
opTaskPk: 0, //工单ID opTaskPk: 0, //工单ID
partTaskPk: 0, //生产计划ID partTaskPk: 0, //生产计划ID
taskSeq: "", //工序编号 taskSeq: "", //工序编号
count: 0 //生产计划数量 count: 0, //生产计划数量
}, },
//设置参数结束 //设置参数结束
rowData: {} //编辑时传入行数据 rowData: {}, //编辑时传入行数据
}; };
}, },
mounted() { mounted() {
this.loadData(this.rowId); this.loadData(this.rowId);
}, },
async fetch({ async fetch({ store, params }) {
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
methods: { methods: {
//根据点击副组件传过来id进行加载数据 //根据点击副组件传过来id进行加载数据
loadData(expendId) { loadData(expendId) {
let params = { let params = {
id: expendId id: expendId,
}; };
Api.getbyorderid(params).then(res => { Api.getbyorderid(params).then((res) => {
if (res.success) { if (res.success) {
this.gridHeight = 50; this.gridHeight = 50;
this.gridHeight = (res.result.length + 1) * 47; this.gridHeight = (res.result.length + 1) * 47;
...@@ -364,9 +392,9 @@ export default { ...@@ -364,9 +392,9 @@ export default {
this.selectRoutingDetail = row; this.selectRoutingDetail = row;
let params = { let params = {
partPk: this.selectRoutingDetail.part_task_pk, partPk: this.selectRoutingDetail.part_task_pk,
detailIdstr: this.selectRoutingDetail.routing_detail_id detailIdstr: this.selectRoutingDetail.routing_detail_id,
}; };
Api.removeoptasksimluate(params).then(r => { Api.removeoptasksimluate(params).then((r) => {
if (r.success) { if (r.success) {
this.$Message.success("删除成功"); this.$Message.success("删除成功");
this.data1.splice(this.rowIndex, 1); this.data1.splice(this.rowIndex, 1);
...@@ -390,8 +418,8 @@ export default { ...@@ -390,8 +418,8 @@ export default {
l(key) { l(key) {
let vkey = "mes_op_task_plan_simulate" + "." + key; let vkey = "mes_op_task_plan_simulate" + "." + key;
return this.$t(vkey) || key; return this.$t(vkey) || key;
} },
} },
}; };
</script> </script>
......
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