Commit 99b5997e authored by renjintao's avatar renjintao

插单

parent f72ab564
...@@ -90,7 +90,7 @@ export default { ...@@ -90,7 +90,7 @@ export default {
return Api.get(`${apsUrl}/apspoolappservices/getdropsortlist`); return Api.get(`${apsUrl}/apspoolappservices/getdropsortlist`);
}, },
//点击新增初始化数据 //点击新增初始化数据
addsorttemplateplus(){ addsorttemplateplus() {
return Api.post(`${apsUrl}/apspoolappservices/addsorttemplateplus`); return Api.post(`${apsUrl}/apspoolappservices/addsorttemplateplus`);
}, },
//保存模板 //保存模板
...@@ -98,16 +98,16 @@ export default { ...@@ -98,16 +98,16 @@ export default {
return Api.post(`${apsUrl}/apspoolappservices/savesorttemplate`, params); return Api.post(`${apsUrl}/apspoolappservices/savesorttemplate`, params);
}, },
//使用排产规则 //使用排产规则
usesorttemplate (params) { usesorttemplate(params) {
return Api.post(`${apsUrl}/apspoolappservices/usesorttemplate `, params); return Api.post(`${apsUrl}/apspoolappservices/usesorttemplate `, params);
}, },
//删除排产模板 //删除排产模板
removesorttemplate(params){ removesorttemplate(params) {
return Api.post(`${apsUrl}/apspoolappservices/removesorttemplate `, params); return Api.post(`${apsUrl}/apspoolappservices/removesorttemplate `, params);
}, },
//获取单个模板信息 //获取单个模板信息
getsorttemplate(params) { getsorttemplate(params) {
return Api.get(`${apsUrl}/apspoolappservices/getsorttemplate`,params); return Api.get(`${apsUrl}/apspoolappservices/getsorttemplate`, params);
}, },
//排序模板相关end----- //排序模板相关end-----
//修改外协工期相关start----- //修改外协工期相关start-----
...@@ -116,12 +116,17 @@ export default { ...@@ -116,12 +116,17 @@ export default {
return Api.get(`${apsUrl}/apspoolappservices/getoutsidetimelist`); return Api.get(`${apsUrl}/apspoolappservices/getoutsidetimelist`);
}, },
//保存外协任务工期 //保存外协任务工期
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) {
return Api.post(`${apsUrl}/apspoolappservices/cancelinsertorder `, params)
},
//修改外协工期相关end----- //修改外协工期相关end-----
} }
...@@ -63,11 +63,10 @@ export default { ...@@ -63,11 +63,10 @@ export default {
gridHeight: 50, gridHeight: 50,
size: "small", size: "small",
columns: [ columns: [
{ key: "id", title: this.l("id"), hide: true, align: "left" },
{ title: " ", width: 130 }, { title: " ", width: 130 },
{ {
key: "important_flag", //insert_flag? key: "insert_flag",
title: this.l("important_flag"), title: this.l("insert_flag"),
align: "center", align: "center",
high: true, high: true,
width: 60, width: 60,
...@@ -77,7 +76,7 @@ export default { ...@@ -77,7 +76,7 @@ export default {
{ {
props: { props: {
content: content:
params.row.important_flag == 1 ? "取消插单" : "进行插单", params.row.insert_flag == 1 ? "取消插单" : "进行插单",
placement: "top" placement: "top"
}, },
class: "ico" class: "ico"
...@@ -86,14 +85,14 @@ export default { ...@@ -86,14 +85,14 @@ export default {
h("Icon", { h("Icon", {
attrs: { attrs: {
type: type:
params.row.important_flag == 1 params.row.insert_flag == 1
? "ios-flag" ? "ios-flag"
: "ios-flag-outline", : "ios-flag-outline",
size: 20, size: 20,
color: params.row.important_flag == 1 ? "#2680EB" : "#aaa" color: params.row.insert_flag == 1 ? "#2680EB" : "#aaa"
}, },
on: { on: {
click: () => this.changeFlag(params.row.id, params.index) click: () => this.changeFlag(params.row.op_task_pk, params.index)
} }
}) })
] ]
...@@ -399,7 +398,7 @@ export default { ...@@ -399,7 +398,7 @@ export default {
//插单事件start---- //插单事件start----
changeFlag(id, index) { changeFlag(id, index) {
this.rowIndex = index; this.rowIndex = index;
if (this.data1[this.rowIndex].important_flag == 1) { if (this.data1[this.rowIndex].insert_flag == 1) {
this.insertTItle = "取消插单"; this.insertTItle = "取消插单";
} else { } else {
this.insertTItle = "插单"; this.insertTItle = "插单";
...@@ -408,11 +407,35 @@ export default { ...@@ -408,11 +407,35 @@ export default {
}, },
insertOk() { insertOk() {
//this.loadData(this.row) //this.loadData(this.row)
if (this.data1[this.rowIndex].important_flag == 1) { if (this.data1[this.rowIndex].insert_flag == 1) {
//根据插单数据状态进行插单或取消插单操作 //根据插单数据状态进行插单或取消插单操作
this.data1[this.rowIndex].important_flag = 0; let params1 = { partTaskPks: [], opTaskPks: [this.data1[this.rowIndex].op_task_pk] };
Api.cancelinsertorder(params1)
.then(res => {
if (res.success) {
this.$Message.success("取消插单成功!");
this.data1[this.rowIndex].insert_flag = 0;
} else { } else {
this.data1[this.rowIndex].important_flag = 1; this.$Message.error("取消插单失败!");
}
})
.catch(err => {
this.$Message.error("数据异常!");
});
} else {
let params = { partTaskPks: [], opTaskPks: [this.data1[this.rowIndex].op_task_pk] };
Api.saveinsertorder(params)
.then(res => {
if (res.success) {
this.$Message.success("插单成功!");
this.data1[this.rowIndex].insert_flag = 1;
} else {
this.$Message.error("插单失败!");
}
})
.catch(err => {
this.$Message.error("数据异常!");
});
} }
this.setParsModal = false; this.setParsModal = false;
this.detailModal = false; this.detailModal = false;
...@@ -429,7 +452,7 @@ export default { ...@@ -429,7 +452,7 @@ export default {
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;
}, },
//单个工序进行参数设置end---- //单个工序进行参数设置end----
...@@ -480,7 +503,8 @@ export default { ...@@ -480,7 +503,8 @@ export default {
}; };
</script> </script>
<style lang="less"> <style lang="less">
.excute table tr th span,.excute table tr td { .excute table tr th span,
.excute table tr td {
font-size: 10px; font-size: 10px;
} }
</style> </style>
...@@ -87,6 +87,9 @@ ...@@ -87,6 +87,9 @@
</Col> </Col>
</Row> </Row>
</Modal> </Modal>
<Modal v-model="insertlModal1" :title="insertTItle1" @on-ok="insertOk1" @on-cancel="cancel">
<p>确定进行 {{ insertTItle1 }} 操作?</p>
</Modal>
</div> </div>
</template> </template>
<script> <script>
...@@ -119,6 +122,9 @@ export default { ...@@ -119,6 +122,9 @@ export default {
apsModal: false, apsModal: false,
addModalTemp: false, addModalTemp: false,
modalDuration: false, modalDuration: false,
insertlModal1: false,
insertTItle1: "插单",
rowIndex1: null,
list: [], list: [],
curId: 0, curId: 0,
columns: [ columns: [
...@@ -169,8 +175,34 @@ export default { ...@@ -169,8 +175,34 @@ export default {
align: "center", align: "center",
width: 70, width: 70,
high: true, high: true,
code: "aps.aps.insert_flag", render: (h, params) => {
category: "icon" return h(
"Tooltip",
{
props: {
content:
params.row.insert_flag == 1 ? "取消插单" : "进行插单",
placement: "top"
},
class: "ico"
},
[
h("Icon", {
attrs: {
type:
params.row.insert_flag == 1
? "ios-flag"
: "ios-flag-outline",
size: 20,
color: params.row.insert_flag == 1 ? "#2680EB" : "#aaa"
},
on: {
click: () => this.changeFlag1(params.row.part_task_pk, params.index)
}
})
]
);
}
}, },
{ {
key: "mesCode", key: "mesCode",
...@@ -615,8 +647,53 @@ export default { ...@@ -615,8 +647,53 @@ export default {
//打开外协工期任务modal //打开外协工期任务modal
openDuration() { openDuration() {
this.modalDuration = true; this.modalDuration = true;
} },
//外协工期修改end //外协工期修改end
//插单start
//插单事件start----
changeFlag1(id, index) {
this.rowIndex1 = index;
if (this.list[this.rowIndex1].insert_flag == 1) {
this.insertTItle1 = "取消插单";
} else {
this.insertTItle1 = "插单";
}
this.insertlModal1 = true;
},
insertOk1() {
if (this.list[this.rowIndex1].insert_flag == 1) {
//根据插单数据状态进行插单或取消插单操作
let params1 = { partTaskPks: [this.list[this.rowIndex1].part_task_pk], opTaskPks: [] };
Api.cancelinsertorder(params1)
.then(res => {
if (res.success) {
this.$Message.success("取消插单成功!");
this.list[this.rowIndex1].insert_flag = 0;
} else {
this.$Message.error("取消插单失败!");
}
})
.catch(err => {
this.$Message.error("数据异常!");
});
} else {
let params = { partTaskPks: [this.list[this.rowIndex1].part_task_pk], opTaskPks: [] };
Api.saveinsertorder(params)
.then(res => {
if (res.success) {
this.$Message.success("插单成功!");
this.list[this.rowIndex1].insert_flag = 1;
} else {
this.$Message.error("插单失败!");
}
})
.catch(err => {
this.$Message.error("数据异常!");
});
}
this.insertlModal1 = false;
},
//插单end
} }
}; };
</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