Commit 99b5997e authored by renjintao's avatar renjintao

插单

parent f72ab564
......@@ -72,16 +72,16 @@ export default {
getequiplist(params) {
return Api.get(`${apsUrl}/mes_equip_info/getequiplist`, params);
},
//获取当前登录人所在车间下的所有部门
userdepartmentsofworkshop(params) {
//获取当前登录人所在车间下的所有部门
userdepartmentsofworkshop(params) {
return Api.get(`${systemUrl}/user/userdepartmentsofworkshop`, params);
},
//工时修改
updatesetuptimeandfirstequip(params) {
//工时修改
updatesetuptimeandfirstequip(params) {
return Api.post(`${apsUrl}/mes_op_task_plan_simulate/updatesetuptimeandfirstequip`, params);
},
//工时同步到原始工艺
apsupdate(params) {
//工时同步到原始工艺
apsupdate(params) {
return Api.post(`${designUrl}/routingdetail/apsupdate `, params);
},
//排序模板相关start-----
......@@ -90,24 +90,24 @@ export default {
return Api.get(`${apsUrl}/apspoolappservices/getdropsortlist`);
},
//点击新增初始化数据
addsorttemplateplus(){
addsorttemplateplus() {
return Api.post(`${apsUrl}/apspoolappservices/addsorttemplateplus`);
},
//保存模板
savesorttemplate(params) {
return Api.post(`${apsUrl}/apspoolappservices/savesorttemplate`, params);
},
//使用排产规则
usesorttemplate (params) {
//使用排产规则
usesorttemplate(params) {
return Api.post(`${apsUrl}/apspoolappservices/usesorttemplate `, params);
},
//删除排产模板
removesorttemplate(params){
removesorttemplate(params) {
return Api.post(`${apsUrl}/apspoolappservices/removesorttemplate `, params);
},
//获取单个模板信息
getsorttemplate(params) {
return Api.get(`${apsUrl}/apspoolappservices/getsorttemplate`,params);
return Api.get(`${apsUrl}/apspoolappservices/getsorttemplate`, params);
},
//排序模板相关end-----
//修改外协工期相关start-----
......@@ -116,12 +116,17 @@ export default {
return Api.get(`${apsUrl}/apspoolappservices/getoutsidetimelist`);
},
//保存外协任务工期
saveoutsidetime(params){
return Api.post(`${apsUrl}/apspoolappservices/saveoutsidetime `,params)
saveoutsidetime(params) {
return Api.post(`${apsUrl}/apspoolappservices/saveoutsidetime `, params)
},
//保存插单任务
saveinsertorder(params){
return Api.post(`${apsUrl}/apspoolappservices/saveinsertorder `,params)
saveinsertorder(params) {
return Api.post(`${apsUrl}/apspoolappservices/saveinsertorder `, params)
},
//取消插单任务
cancelinsertorder(params) {
return Api.post(`${apsUrl}/apspoolappservices/cancelinsertorder `, params)
},
//修改外协工期相关end-----
}
......@@ -63,11 +63,10 @@ export default {
gridHeight: 50,
size: "small",
columns: [
{ key: "id", title: this.l("id"), hide: true, align: "left" },
{ title: " ", width: 130 },
{
key: "important_flag", //insert_flag?
title: this.l("important_flag"),
key: "insert_flag",
title: this.l("insert_flag"),
align: "center",
high: true,
width: 60,
......@@ -77,7 +76,7 @@ export default {
{
props: {
content:
params.row.important_flag == 1 ? "取消插单" : "进行插单",
params.row.insert_flag == 1 ? "取消插单" : "进行插单",
placement: "top"
},
class: "ico"
......@@ -86,14 +85,14 @@ export default {
h("Icon", {
attrs: {
type:
params.row.important_flag == 1
params.row.insert_flag == 1
? "ios-flag"
: "ios-flag-outline",
size: 20,
color: params.row.important_flag == 1 ? "#2680EB" : "#aaa"
color: params.row.insert_flag == 1 ? "#2680EB" : "#aaa"
},
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 {
//插单事件start----
changeFlag(id, index) {
this.rowIndex = index;
if (this.data1[this.rowIndex].important_flag == 1) {
if (this.data1[this.rowIndex].insert_flag == 1) {
this.insertTItle = "取消插单";
} else {
this.insertTItle = "插单";
......@@ -408,11 +407,35 @@ export default {
},
insertOk() {
//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 {
this.$Message.error("取消插单失败!");
}
})
.catch(err => {
this.$Message.error("数据异常!");
});
} else {
this.data1[this.rowIndex].important_flag = 1;
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.detailModal = false;
......@@ -429,7 +452,7 @@ export default {
taskSeq: row.task_seq,
count: row.put_into_qty
};
this.rowData=row
this.rowData = row;
this.setParsModal = true;
},
//单个工序进行参数设置end----
......@@ -480,7 +503,8 @@ export default {
};
</script>
<style lang="less">
.excute table tr th span,.excute table tr td {
.excute table tr th span,
.excute table tr td {
font-size: 10px;
}
</style>
......@@ -87,6 +87,9 @@
</Col>
</Row>
</Modal>
<Modal v-model="insertlModal1" :title="insertTItle1" @on-ok="insertOk1" @on-cancel="cancel">
<p>确定进行 {{ insertTItle1 }} 操作?</p>
</Modal>
</div>
</template>
<script>
......@@ -119,6 +122,9 @@ export default {
apsModal: false,
addModalTemp: false,
modalDuration: false,
insertlModal1: false,
insertTItle1: "插单",
rowIndex1: null,
list: [],
curId: 0,
columns: [
......@@ -169,8 +175,34 @@ export default {
align: "center",
width: 70,
high: true,
code: "aps.aps.insert_flag",
category: "icon"
render: (h, params) => {
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",
......@@ -615,8 +647,53 @@ export default {
//打开外协工期任务modal
openDuration() {
this.modalDuration = true;
}
},
//外协工期修改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>
......
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