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

aps排产

parent 4c9c39af
...@@ -1137,6 +1137,8 @@ export default { ...@@ -1137,6 +1137,8 @@ export default {
multipleEquip: "是否多台安排设备", // 否 是 multipleEquip: "是否多台安排设备", // 否 是
multipleEquipIds: "设备id", //用英文逗号分隔 multipleEquipIds: "设备id", //用英文逗号分隔
discrete: '离散值', discrete: '离散值',
routingHeaderCode:'工艺编号',
routingHeaderName:'工艺名称',
}, },
routing_header: { routing_header: {
id: '', id: '',
......
<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="1000"> <Modal v-model="editModal" title="编辑" footer-hide width="1000">
<Edit :row="rowData" @on-close="cancel" @on-option-ok="addOk" /> <Edit :row="rowData" @on-close="cancel" @on-option-ok="addOk" />
</Modal> </Modal>
<Modal v-model="insertlModal" :title="insertTItle" @on-ok="insertOk" @on-cancel="cancel"> <Modal
v-model="insertlModal"
:title="insertTItle"
@on-ok="insertOk"
@on-cancel="cancel"
>
<p>确定进行 {{ insertTItle }} 操作?</p> <p>确定进行 {{ insertTItle }} 操作?</p>
</Modal> </Modal>
<Modal v-model="setParsModal" title="工序参数设置" footer-hide width="1000"> <Modal v-model="setParsModal" title="工序参数设置" footer-hide width="1000">
<Add @on-parameter-ok="addOk" @on-close="cancel" :opTaskPk="setParams.opTaskPk" :partTaskPk="setParams.partTaskPk" :taskSeq="setParams.taskSeq" :count="setParams.count" :row="rowData" /> <Add
@on-parameter-ok="addOk"
@on-close="cancel"
:opTaskPk="setParams.opTaskPk"
:partTaskPk="setParams.partTaskPk"
:taskSeq="setParams.taskSeq"
:count="setParams.count"
:row="rowData"
/>
</Modal> </Modal>
</div> </div>
</template> </template>
<script> <script>
...@@ -21,12 +46,12 @@ export default { ...@@ -21,12 +46,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 {
...@@ -34,8 +59,8 @@ export default { ...@@ -34,8 +59,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,
...@@ -45,9 +70,10 @@ export default { ...@@ -45,9 +70,10 @@ export default {
curId: 0, curId: 0,
gridHeight: 150, gridHeight: 150,
size: "small", size: "small",
columns: [{ columns: [
{
title: " ", title: " ",
width: 130 width: 130,
}, },
{ {
key: "insert_flag", key: "insert_flag",
...@@ -57,43 +83,47 @@ export default { ...@@ -57,43 +83,47 @@ export default {
width: 60, width: 60,
render: (h, params) => { render: (h, params) => {
return h( return h(
"Tooltip", { "Tooltip",
{
props: { props: {
content: params.row.insert_flag == 1 ? "取消插单" : "进行插单", content:
placement: "top" params.row.insert_flag == 1 ? "取消插单" : "进行插单",
placement: "top",
}, },
class: "ico" class: "ico",
}, },
[ [
h("Icon", { h("Icon", {
attrs: { attrs: {
type: params.row.insert_flag == 1 ? type:
"ios-flag" : "ios-flag-outline", params.row.insert_flag == 1
? "ios-flag"
: "ios-flag-outline",
size: 20, size: 20,
color: params.row.insert_flag == 1 ? "#2680EB" : "#aaa" color: params.row.insert_flag == 1 ? "#2680EB" : "#aaa",
}, },
on: { on: {
click: () => click: () =>
this.changeFlag(params.row.op_task_pk, params.index) this.changeFlag(params.row.op_task_pk, params.index),
} },
}) }),
] ]
); );
} },
}, },
{ {
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",
...@@ -101,28 +131,42 @@ export default { ...@@ -101,28 +131,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: "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: "routingHeaderCode",
title: this.l("routingHeaderCode"),
align: "left",
easy: true,
high: true,
},
{
key: "routingHeaderName",
title: this.l("routingHeaderName"),
align: "left",
easy: true,
high: 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",
...@@ -130,7 +174,7 @@ export default { ...@@ -130,7 +174,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",
...@@ -138,7 +182,7 @@ export default { ...@@ -138,7 +182,7 @@ export default {
align: "center", align: "center",
high: true, high: true,
width: 140, width: 140,
hide: true hide: true,
}, },
{ {
key: "firsT_EQUIP_CODE", key: "firsT_EQUIP_CODE",
...@@ -153,21 +197,21 @@ export default { ...@@ -153,21 +197,21 @@ export default {
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",
...@@ -175,7 +219,7 @@ export default { ...@@ -175,7 +219,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",
...@@ -183,13 +227,13 @@ export default { ...@@ -183,13 +227,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",
...@@ -197,21 +241,21 @@ export default { ...@@ -197,21 +241,21 @@ 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",
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", key: "first_equip",
...@@ -219,48 +263,48 @@ export default { ...@@ -219,48 +263,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",
...@@ -268,7 +312,7 @@ export default { ...@@ -268,7 +312,7 @@ export default {
align: "left", align: "left",
easy: true, easy: true,
high: true, high: true,
hide: true hide: true,
}, },
{ {
...@@ -277,21 +321,21 @@ export default { ...@@ -277,21 +321,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",
...@@ -299,14 +343,14 @@ export default { ...@@ -299,14 +343,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: "操作",
...@@ -314,30 +358,33 @@ export default { ...@@ -314,30 +358,33 @@ 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-options", icon: "md-options",
type: "icon", type: "icon",
oprate: "detail", oprate: "detail",
title: "工序参数设置" title: "工序参数设置",
}, },
on: { on: {
click: () => this.openParms(params.row) click: () => this.openParms(params.row),
} },
}), }),
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: {
...@@ -345,15 +392,16 @@ export default { ...@@ -345,15 +392,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: "插单",
...@@ -363,7 +411,7 @@ export default { ...@@ -363,7 +411,7 @@ export default {
opTaskPk: 0, //工单ID opTaskPk: 0, //工单ID
partTaskPk: 0, //生产计划ID partTaskPk: 0, //生产计划ID
taskSeq: "", //工序编号 taskSeq: "", //工序编号
count: 0 //生产计划数量 count: 0, //生产计划数量
}, },
//设置参数结束 //设置参数结束
rowData: {}, //编辑时传入行数据 rowData: {}, //编辑时传入行数据
...@@ -374,10 +422,7 @@ export default { ...@@ -374,10 +422,7 @@ export default {
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"); // 加载数据字典
}, },
created() { created() {
...@@ -388,9 +433,9 @@ export default { ...@@ -388,9 +433,9 @@ export default {
//根据点击副组件传过来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;
...@@ -415,10 +460,10 @@ export default { ...@@ -415,10 +460,10 @@ export default {
//根据插单数据状态进行插单或取消插单操作 //根据插单数据状态进行插单或取消插单操作
let params1 = { let params1 = {
partTaskPks: [], partTaskPks: [],
opTaskPks: [this.data1[this.rowIndex].op_task_pk] opTaskPks: [this.data1[this.rowIndex].op_task_pk],
}; };
Api.cancelinsertorder(params1) Api.cancelinsertorder(params1)
.then(res => { .then((res) => {
if (res.success) { if (res.success) {
this.$Message.success("取消插单成功!"); this.$Message.success("取消插单成功!");
this.data1[this.rowIndex].insert_flag = 0; this.data1[this.rowIndex].insert_flag = 0;
...@@ -426,16 +471,16 @@ export default { ...@@ -426,16 +471,16 @@ export default {
this.$Message.error("取消插单失败!"); this.$Message.error("取消插单失败!");
} }
}) })
.catch(err => { .catch((err) => {
this.$Message.error("数据异常!"); this.$Message.error("数据异常!");
}); });
} else { } else {
let params = { let params = {
partTaskPks: [], partTaskPks: [],
opTaskPks: [this.data1[this.rowIndex].op_task_pk] opTaskPks: [this.data1[this.rowIndex].op_task_pk],
}; };
Api.saveinsertorder(params) Api.saveinsertorder(params)
.then(res => { .then((res) => {
if (res.success) { if (res.success) {
this.$Message.success("插单成功!"); this.$Message.success("插单成功!");
this.data1[this.rowIndex].insert_flag = 1; this.data1[this.rowIndex].insert_flag = 1;
...@@ -443,7 +488,7 @@ export default { ...@@ -443,7 +488,7 @@ export default {
this.$Message.error("插单失败!"); this.$Message.error("插单失败!");
} }
}) })
.catch(err => { .catch((err) => {
this.$Message.error("数据异常!"); this.$Message.error("数据异常!");
}); });
} }
...@@ -460,7 +505,7 @@ export default { ...@@ -460,7 +505,7 @@ export default {
opTaskPk: row.op_task_pk, opTaskPk: row.op_task_pk,
partTaskPk: row.part_task_pk, partTaskPk: row.part_task_pk,
taskSeq: row.task_seq, taskSeq: row.task_seq,
count: row.put_into_qty count: row.put_into_qty,
}; };
this.rowData = row; this.rowData = row;
this.setParsModal = true; this.setParsModal = true;
...@@ -481,9 +526,9 @@ export default { ...@@ -481,9 +526,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);
...@@ -507,39 +552,39 @@ export default { ...@@ -507,39 +552,39 @@ export default {
}, },
//根据firsT_EQUIP_CODE返回对应的首选资源 //根据firsT_EQUIP_CODE返回对应的首选资源
getResourceName(code) { getResourceName(code) {
let name = "" let name = "";
let resources = this.$u.clone(this.resources); let resources = this.$u.clone(this.resources);
if (code && code != '') { if (code && code != "") {
resources.forEach(e => { resources.forEach((e) => {
if (e.code == code) { if (e.code == code) {
let type = e.type let type = e.type;
this.types.forEach(el => { this.types.forEach((el) => {
if (type && type != '' && el.code == e.type) { if (type && type != "" && el.code == e.type) {
name = el.name + "/" + e.title name = el.name + "/" + e.title;
} }
}) });
} }
}) });
} }
return name; return name;
}, },
//获取首选资源所有的数据 //获取首选资源所有的数据
getResource() { getResource() {
let url = `${systemUrl}/planresource/list`; let url = `${systemUrl}/planresource/list`;
let name = "" let name = "";
this.$api this.$api
.post(url, { .post(url, {
pageSize: 2000 pageSize: 2000,
}) })
.then(r => { .then((r) => {
this.resources = r.result; this.resources = r.result;
}); });
}, },
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