Commit 5bb5604b authored by 任金涛 's avatar 任金涛

excute

parent cd9bd065
<template>
<div style="padding:0">
<div style="padding: 0;">
<DataGrid
style="margin-top:-25px;margin-bottom:-25px"
style="margin-top: -25px; margin-bottom: -25px;"
:columns="columns"
ref="grid"
:easy="false"
......@@ -12,12 +12,23 @@
:page="false"
:height="gridHeight"
></DataGrid>
<Modal v-model="editModal" title="编辑" footer-hide width="800">
<Edit :eid="curId" @on-close="cancel" />
<Edit
:eid="curId"
:opTaskPk="setParams.opTaskPk"
:partTaskPk="setParams.partTaskPk"
:taskSeq="setParams.taskSeq"
:count="setParams.count"
@on-close="cancel"
/>
</Modal>
<Modal v-model="insertlModal" title="插单" @on-ok="insertOk" @on-cancel="cancel">
<p>确定进行 {{insertTItle}} 操作?</p>
<Modal
v-model="insertlModal"
title="插单"
@on-ok="insertOk"
@on-cancel="cancel"
>
<p>确定进行 {{ insertTItle }} 操作?</p>
</Modal>
<Modal v-model="setParsModal" title="工序参数设置" footer-hide width="1000">
<Add :eid="curId" @on-close="cancel" />
......@@ -32,10 +43,10 @@ export default {
name: "list",
components: {
Edit,
Add
Add,
},
props: {
rowId: { type: Number }
rowId: { type: Number },
},
data() {
return {
......@@ -43,8 +54,8 @@ export default {
easySearch: {
keys: {
op: "task_seq",
value: null
}
value: null,
},
},
setParsModal: false,
editModal: false,
......@@ -57,7 +68,7 @@ export default {
{ key: "id", title: this.l("id"), hide: true, align: "left" },
{ title: " ", width: 130 },
{
key: "important_flag",//insert_flag?
key: "important_flag", //insert_flag?
title: this.l("important_flag"),
align: "center",
high: true,
......@@ -69,9 +80,9 @@ export default {
props: {
content:
params.row.important_flag == 1 ? "取消插单" : "进行插单",
placement: "top"
placement: "top",
},
class: "ico"
class: "ico",
},
[
h("Icon", {
......@@ -81,43 +92,43 @@ export default {
? "ios-flag"
: "ios-flag-outline",
size: 20,
color: params.row.important_flag == 1 ? "#2680EB" : "#aaa"
color: params.row.important_flag == 1 ? "#2680EB" : "#aaa",
},
on: {
click: () => this.changeFlag(params.row.id, params.index)
}
})
click: () => this.changeFlag(params.row.id, 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",
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,
},
{
......@@ -125,7 +136,7 @@ export default {
title: this.l("put_into_qty"),
align: "left",
high: true,
hide: true
hide: true,
},
{
key: "plan_start",
......@@ -133,7 +144,7 @@ export default {
align: "center",
high: true,
width: 140,
hide: true
hide: true,
},
{
key: "plan_finish",
......@@ -141,26 +152,26 @@ export default {
align: "center",
high: true,
width: 140,
hide: true
hide: true,
},
{
key:"first_equip",
title:this.l("first_equip"),
align:"left",
easy:true,
high:true,
key: "first_equip",
title: this.l("first_equip"),
align: "left",
easy: true,
high: true,
},
{
key: "setup_time",
title: this.l("setup_time"),
align: "right",
high: true
high: true,
},
{
key: "run_time",
title: this.l("run_time"),
align: "right",
high: true
high: true,
},
{
key: "outside_time",
......@@ -173,20 +184,20 @@ export default {
title: this.l("transport_time"),
align: "right",
high: true,
hide: true
hide: true,
},
{
key: "check_time",
title: this.l("check_time"),
align: "right",
high: true,
hide: true
hide: true,
},
{
key: "efficiency_value",
title: this.l("efficiency_value"),
align: "right",
high: true
high: true,
},
{
key: "machine_rule",
......@@ -194,14 +205,14 @@ 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",
......@@ -209,7 +220,7 @@ export default {
align: "left",
easy: true,
high: true,
hide: true
hide: true,
},
{
key: "first_equip",
......@@ -217,48 +228,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",
......@@ -266,7 +277,7 @@ export default {
align: "left",
easy: true,
high: true,
hide: true
hide: true,
},
{
......@@ -275,7 +286,7 @@ export default {
align: "left",
easy: true,
high: true,
hide: true
hide: true,
},
{
key: "workshopcode",
......@@ -283,21 +294,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",
......@@ -305,14 +316,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: "操作",
......@@ -326,9 +337,9 @@ export default {
icon: "md-options",
type: "icon",
oprate: "detail",
title: "工序参数设置"
title: "工序参数设置",
},
on: { click: () => this.openParms(params.row.id) }
on: { click: () => this.openParms(params.row) },
}),
h("op", {
attrs: {
......@@ -336,9 +347,9 @@ export default {
type: "icon",
title: "編輯工序",
oprate: "edit",
msg: "确认要移出排产吗?"
msg: "确认要移出排产吗?",
},
on: { click: () => this.edit(params.row.id) }
on: { click: () => this.edit(params.row.id) },
}),
h("op", {
attrs: {
......@@ -346,17 +357,25 @@ export default {
type: "icon",
title: "删除工序",
oprate: "delete",
msg: "确认要刪除工序吗?"
msg: "确认要刪除工序吗?",
},
on: { click: () => this.remove(params.row, params.index) }
})
on: { click: () => this.remove(params.row, params.index) },
}),
]);
}
}
},
},
],
data1: [],
insertTItle: "插单",
selectRoutingDetail: {} //需那种工序
selectRoutingDetail: {}, //需那种工序
//设置参数开始
setParams: {
opTaskPk: 0, //工单ID
partTaskPk: 0, //生产计划ID
taskSeq: "", //工序编号
count: 0,
}, //生产计划数量
//设置参数结束
};
},
mounted() {
......@@ -369,12 +388,12 @@ 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) * 48;
this.gridHeight = (res.result.length + 1) * 51;
this.data1 = res.result;
}
});
......@@ -406,7 +425,13 @@ export default {
//插单事件end----
//单个工序进行参设置start----
openParms(id) {
openParms(row) {
this.setParams = {
opTaskPk:row.op_task_pk,
partTaskPk: row.part_task_pk,
taskSeq: row.task_seq,
count: row.put_into_qty,
};
this.setParsModal = true;
},
//单个工序进行参数设置end----
......@@ -425,9 +450,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);
......@@ -447,9 +472,8 @@ export default {
l(key) {
let vkey = "mes_op_task_plan_simulate" + "." + key;
return this.$t(vkey) || key;
}
}
},
},
};
</script>
<style lang="less">
</style>
\ No newline at end of file
<style lang="less"></style>
......@@ -19,11 +19,11 @@
<DatePicker
type="date"
placeholder="设置基准日期"
style="width: 150px"
style="width: 150px;"
v-model="entity.setTime"
@on-change="getTime"
></DatePicker>
<a style="font-weight:bold;" @click="addModal=true">
<a style="font-weight: bold;" @click="openAddModel(1)">
<Icon type="ios-options" size="14" />&nbsp;工序参数调整
</a>
</template>
......@@ -34,13 +34,27 @@
<Button type="primary" @click="openApsModal">APS排产</Button>
</template>
<template slot="batch">
<Button type="primary" class="mr10 ml10" @click="removeOk">移出排产</Button>
<Button type="primary" class="mr10 ml10" @click="removeOk"
>移出排产</Button
>
</template>
</DataGrid>
<Modal v-model="addModal" title="工序参数设置" footer-hide width="1000">
<Add @on-close="cancel" @on-ok="addOk" :opTaskPk="opTaskPk" :partTaskPk="partTaskPk" :taskSeq="taskSeq" :count="count" />
<Add
@on-close="cancel"
@on-ok="addOk"
:opTaskPk="setParams.opTaskPk"
:partTaskPk="setParams.partTaskPk"
:taskSeq="setParams.taskSeq"
:count="setParams.count"
/>
</Modal>
<Modal v-model="apsModal" title="确定APS排产" @on-ok="apsOk" @on-cancel="cancel">
<Modal
v-model="apsModal"
title="确定APS排产"
@on-ok="apsOk"
@on-cancel="cancel"
>
<p>确定进行APS排产?</p>
</Modal>
</div>
......@@ -53,16 +67,16 @@ export default {
name: "list",
components: {
Add,
Expand
Expand,
},
data() {
return {
action: Api.index,
easySearch: {
keys: { op: "notes", value: null }
keys: { op: "notes", value: null },
},
entity: {
setTime: ""
setTime: "",
},
addModal: false,
editModal: false,
......@@ -82,11 +96,11 @@ export default {
return h("Icon", {
attrs: {
type: "md-more",
size: 18
size: 18,
},
class: "drag"
class: "drag",
});
}
},
},
{
type: "expand",
......@@ -94,16 +108,16 @@ export default {
render: (h, params) => {
return h(Expand, {
props: {
rowId: params.row.part_task_pk
}
rowId: params.row.part_task_pk,
},
});
}
},
},
{
key: "selection",
type: "selection",
width: 50,
align: "center"
align: "center",
},
{
key: "id",
......@@ -111,7 +125,7 @@ export default {
hide: true,
align: "left",
sortable: true,
width: 50
width: 50,
},
{
key: "insert_flag",
......@@ -120,13 +134,13 @@ export default {
width: 70,
high: true,
code: "aps.aps.insert_flag",
category: "icon"
category: "icon",
},
{
key: "part_task_pk",
title: this.l("part_task_pk"),
align: "left",
high: true
high: true,
},
{
key: "priority",
......@@ -135,20 +149,20 @@ export default {
high: true,
render: (h, params) => {
return h("span", {}, params.index + 1);
}
},
},
{
key: "plan_qty",
title: this.l("plan_qty"),
align: "left",
high: true,
sortable: true
sortable: true,
},
{
key: "spare_qty",
title: this.l("spare_qty"),
align: "left",
high: true
high: true,
},
{
key: "plan_start",
......@@ -157,7 +171,7 @@ export default {
high: true,
hide: true,
resizable: true,
width: 140
width: 140,
},
{
key: "plan_finish",
......@@ -167,7 +181,7 @@ export default {
hide: true,
sortable: true,
resizable: true,
width: 140
width: 140,
},
{
key: "notes",
......@@ -175,14 +189,14 @@ export default {
align: "left",
easy: true,
high: true,
hide: true
hide: true,
},
{
key: "demand_start",
title: this.l("demand_start"),
align: "center",
resizable: true,
width: 140
width: 140,
},
{
key: "demand_finish",
......@@ -190,14 +204,14 @@ export default {
align: "center",
high: true,
resizable: true,
width: 140
width: 140,
},
{
key: "badjustflag",
title: this.l("badjustflag"),
align: "left",
high: true,
hide:true,
hide: true,
},
{
title: "操作",
......@@ -211,9 +225,9 @@ export default {
attrs: {
icon: "md-options",
type: "icon",
title: "工序参数设置"
title: "工序参数设置",
},
on: { click: () => this.openParms(params.row.id) }
on: { click: () => this.openAddModel(2, params.row) },
}),
h("op", {
attrs: {
......@@ -221,9 +235,9 @@ export default {
type: "icon",
title: "移出排产池",
oprate: "delete",
msg: "确认要移出排产吗?"
msg: "确认要移出排产吗?",
},
on: { click: () => this.remove(params.row.part_task_pk) }
on: { click: () => this.remove(params.row.part_task_pk) },
}),
h("op", {
attrs: {
......@@ -231,20 +245,22 @@ export default {
type: "icon",
title: "恢复工序",
oprate: "delete",
msg: "确认要恢复工序吗?"
msg: "确认要恢复工序吗?",
},
on: { click: () => this.refresh(params.row.part_task_pk) }
})
on: { click: () => this.refresh(params.row.part_task_pk) },
}),
]);
}
}
},
},
],
arrPartPkId: [],
//设置参数开始
opTaskPk:0,//工单ID
partTaskPk:0,//生产计划ID
taskSeq:"",//工序编号
count:0,//生产计划数量
setParams: {
opTaskPk: 0, //工单ID
partTaskPk: 0, //生产计划ID
taskSeq: "", //工序编号
count: 0,
}, //生产计划数量
//设置参数结束
};
},
......@@ -257,7 +273,7 @@ export default {
methods: {
//排产池加载数据列表
loadList() {
Api.getall().then(res => {
Api.getall().then((res) => {
if (res.success) {
this.list = res.result;
}
......@@ -281,9 +297,9 @@ export default {
refresh(partPkId) {
//恢复工序
let params = {
id: partPkId
id: partPkId,
};
Api.recoveryoptasksimluate(params).then(r => {
Api.recoveryoptasksimluate(params).then((r) => {
if (r.success) {
this.$Message.success("恢复成功");
this.list = [];
......@@ -300,9 +316,9 @@ export default {
paramsArry.push(partPkId);
}
let params = {
partPks: paramsArry
partPks: paramsArry,
};
Api.shiftoutapspool(params).then(r => {
Api.shiftoutapspool(params).then((r) => {
if (r.success) {
this.$Message.success("移出排产池操作成功");
this.loadList();
......@@ -313,7 +329,7 @@ export default {
//批量选择
let selectRows = a;
this.arrPartPkId = [];
selectRows.forEach(e => {
selectRows.forEach((e) => {
this.arrPartPkId.push(e.part_task_pk);
});
},
......@@ -332,11 +348,12 @@ export default {
this.deletedlModal = false;
this.apsModal = false;
},
onDragDrop(a, b) {//拖拽排序
onDragDrop(a, b) {
//拖拽排序
//this.list.splice(b, 1, ...this.list.splice(a, 1, this.list[b]));
let tempArray=this.list[a]
this.list.splice(a,1)
this.list.splice(b,0,tempArray)
let tempArray = this.list[a];
this.list.splice(a, 1);
this.list.splice(b, 0, tempArray);
},
openParms(id) {
this.addModal = true;
......@@ -376,25 +393,25 @@ export default {
});
parmsOrderpriority.alls = arryIds;
// alert(JSON.stringify(parmsOrderpriority));
Api.orderpriority(parmsOrderpriority).then(res => {
Api.orderpriority(parmsOrderpriority).then((res) => {
if (res.success) {
if (res.result) {
//this.$Message.success("排序成功");
//apsp排产前检查
Api.apsdatachecked().then(res1 => {
Api.apsdatachecked().then((res1) => {
if (res1.success) {
if (res1.result.res) {
// this.$Message.success("数据校验成功");
//排产计算
let paramsTime = {
setTime: this.entity.setTime
setTime: this.entity.setTime,
};
Api.apsprepareandcalc(paramsTime).then(res2 => {
Api.apsprepareandcalc(paramsTime).then((res2) => {
if (res2.success) {
if (res2.result.res) {
this.$Message.success("排产计算成功");
this.$router.push({
name: "aps-results"
name: "aps-results",
// params: { customerId: id }
});
} else {
......@@ -418,8 +435,28 @@ export default {
this.$Message.error("操作失败:排序");
}
});
},
//打开设置参数
openAddModel(type, row) {
if (type == 2) {
this.setParams = {
opTaskPk: 0,
partTaskPk: row.part_task_pk,
taskSeq: "",
count: row.plan_qty,
};
} else {
this.setParams = {
opTaskPk: 0,
partTaskPk: 0,
taskSeq: "",
count: 0,
};
}
}
this.addModal = true;
},
},
};
</script>
<style lang="less">
......
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