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

aps排产

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