Commit a8c95979 authored by renjintao's avatar renjintao

aps

parent b84f24e4
...@@ -40,6 +40,10 @@ export default { ...@@ -40,6 +40,10 @@ export default {
return Api.post(`${apsUrl}/apspoolappservices/recoveryoptasksimluate`, params); return Api.post(`${apsUrl}/apspoolappservices/recoveryoptasksimluate`, params);
}, },
//移出排产池前判断
beforeshiftoutapspool(params) {
return Api.post(`${apsUrl}/apspoolappservices/beforeshiftoutapspool`, params);
},
//移出排产池 //移出排产池
shiftoutapspool(params) { shiftoutapspool(params) {
return Api.post(`${apsUrl}/apspoolappservices/shiftoutapspool`, params); return Api.post(`${apsUrl}/apspoolappservices/shiftoutapspool`, params);
......
...@@ -60,7 +60,7 @@ ...@@ -60,7 +60,7 @@
<Modal v-model="addModalTemp" title="自定义排序模板" footer-hide width="1000" class="tempModal"> <Modal v-model="addModalTemp" title="自定义排序模板" footer-hide width="1000" class="tempModal">
<Temp :data="listTemp" ref="tempRef"></Temp> <Temp :data="listTemp" ref="tempRef"></Temp>
</Modal> </Modal>
<Modal v-model="modalDuration" title="外协任务" footer-hide width="1000" > <Modal v-model="modalDuration" title="外协任务" footer-hide width="1000">
<Duration ref="durationRef"></Duration> <Duration ref="durationRef"></Duration>
</Modal> </Modal>
<Modal v-model="addModal" title="工序参数设置" footer-hide width="1000"> <Modal v-model="addModal" title="工序参数设置" footer-hide width="1000">
...@@ -76,6 +76,9 @@ ...@@ -76,6 +76,9 @@
<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> <p>确定进行APS排产?</p>
</Modal> </Modal>
<Modal v-model="apsCheckModal" title="确定APS排产" @on-ok="apsCheckOk" @on-cancel="cancel">
<p>已有排产方案,是否移出排产池?</p>
</Modal>
<Modal v-model="circleModal" title footer-hide :mask-closable="false"> <Modal v-model="circleModal" title footer-hide :mask-closable="false">
<div slot="close"></div> <div slot="close"></div>
<Row> <Row>
...@@ -123,6 +126,8 @@ export default { ...@@ -123,6 +126,8 @@ export default {
addModalTemp: false, addModalTemp: false,
modalDuration: false, modalDuration: false,
insertlModal1: false, insertlModal1: false,
apsCheckModal: false,
tempParams: null,
insertTItle1: "插单", insertTItle1: "插单",
rowIndex1: null, rowIndex1: null,
list: [], list: [],
...@@ -197,7 +202,8 @@ export default { ...@@ -197,7 +202,8 @@ export default {
color: params.row.insert_flag == 1 ? "#2680EB" : "#aaa" color: params.row.insert_flag == 1 ? "#2680EB" : "#aaa"
}, },
on: { on: {
click: () => this.changeFlag1(params.row.part_task_pk, params.index) click: () =>
this.changeFlag1(params.row.part_task_pk, params.index)
} }
}) })
] ]
...@@ -431,6 +437,7 @@ export default { ...@@ -431,6 +437,7 @@ export default {
}, },
remove(partPkId) { remove(partPkId) {
//移出排产池 //移出排产池
this.tempParams = null;
let paramsArry = []; let paramsArry = [];
if (partPkId.constructor == Array) { if (partPkId.constructor == Array) {
paramsArry = partPkId; paramsArry = partPkId;
...@@ -440,17 +447,45 @@ export default { ...@@ -440,17 +447,45 @@ export default {
let params = { let params = {
partPks: paramsArry partPks: paramsArry
}; };
Api.shiftoutapspool(params).then(r => { Api.beforeshiftoutapspool(params)
if (r.success) { .then(res => {
this.$Message.success("移出排产池操作成功"); if (res.success) {
this.loadList(); if (res.result) {
//移出排产后将aps对应的store数量去掉 this.checkapspool(params);
this.$store.commit( } else {
"setCountAps", this.tempParams = null;
this.$store.state.countAps - paramsArry.length this.tempParams = params;
); this.apsCheckModal = true;
} }
}); } else {
this.$Message.error("校验失败");
}
})
.catch(err => {
this.$Message.error("连接错误1");
});
},
apsCheckOk() {
this.checkapspool(this.tempParams);
},
checkapspool(params) {
Api.shiftoutapspool(params)
.then(r => {
if (r.success) {
this.$Message.success("移出排产池操作成功");
this.loadList();
//移出排产后将aps对应的store数量去掉
this.$store.commit(
"setCountAps",
this.$store.state.countAps - params.partPks.length
);
} else {
this.$Message.error("移出排产池操作失败");
}
})
.catch(err => {
this.$Message.error("连接失败2");
});
}, },
onSelect(a, b) { onSelect(a, b) {
//批量选择 //批量选择
...@@ -474,6 +509,7 @@ export default { ...@@ -474,6 +509,7 @@ export default {
this.editModal = false; this.editModal = false;
this.deletedlModal = false; this.deletedlModal = false;
this.apsModal = false; this.apsModal = false;
this.apsCheckModal = false;
}, },
onDragDrop(a, b) { onDragDrop(a, b) {
//拖拽排序 //拖拽排序
...@@ -650,7 +686,7 @@ export default { ...@@ -650,7 +686,7 @@ export default {
}, },
//外协工期修改end //外协工期修改end
//插单start //插单start
//插单事件start---- //插单事件start----
changeFlag1(id, index) { changeFlag1(id, index) {
this.rowIndex1 = index; this.rowIndex1 = index;
if (this.list[this.rowIndex1].insert_flag == 1) { if (this.list[this.rowIndex1].insert_flag == 1) {
...@@ -663,7 +699,10 @@ export default { ...@@ -663,7 +699,10 @@ export default {
insertOk1() { insertOk1() {
if (this.list[this.rowIndex1].insert_flag == 1) { if (this.list[this.rowIndex1].insert_flag == 1) {
//根据插单数据状态进行插单或取消插单操作 //根据插单数据状态进行插单或取消插单操作
let params1 = { partTaskPks: [this.list[this.rowIndex1].part_task_pk], opTaskPks: [] }; let params1 = {
partTaskPks: [this.list[this.rowIndex1].part_task_pk],
opTaskPks: []
};
Api.cancelinsertorder(params1) Api.cancelinsertorder(params1)
.then(res => { .then(res => {
if (res.success) { if (res.success) {
...@@ -677,7 +716,10 @@ export default { ...@@ -677,7 +716,10 @@ export default {
this.$Message.error("数据异常!"); this.$Message.error("数据异常!");
}); });
} else { } else {
let params = { partTaskPks: [this.list[this.rowIndex1].part_task_pk], opTaskPks: [] }; let params = {
partTaskPks: [this.list[this.rowIndex1].part_task_pk],
opTaskPks: []
};
Api.saveinsertorder(params) Api.saveinsertorder(params)
.then(res => { .then(res => {
if (res.success) { if (res.success) {
...@@ -692,7 +734,7 @@ export default { ...@@ -692,7 +734,7 @@ export default {
}); });
} }
this.insertlModal1 = false; this.insertlModal1 = false;
}, }
//插单end //插单end
} }
}; };
......
<template> <template>
<div class=""> <div class="aps-r">
<div class=""> <!-- <Button @click="toExecute">工单执行</Button> -->
<Button @click="toExecute">工单执行</Button> <DataGrid
</div> :columns="columns"
</div> ref="grid"
:data="list"
:batch="false"
type="card"
:high="false"
:span="4"
:lazy="true"
>
<template slot="card" slot-scope="{row}">
<div class="body" @click="toExecute">
<Row class="title-i">
<Col :span="18" class="order-code">工艺编号:{{row.processcode}}</Col>
<Col :span="6" class="btn-click">
<State code="plan.order.status" :value="row.routing_type" />
</Col>
</Row>
<div class="panel-text">
<Row class="row">
<Col span="18" class="fa">工艺名称:{{row.processname}}</Col>
<Col span="6" class="fa">数量:{{row.quantity}}</Col>
</Row>
<Row>
<Col span="24" class="fa">
订单编号:
{{row.mesCode}}
</Col>
</Row>
<Row>
<Col span="24" class="fa">
产品名称:
{{row.productName}}
</Col>
</Row>
<Row>
<Col span="24" class="fa">
产品类型:
{{row.taskTypeName}}
</Col>
</Row>
<Row>
<Col span="24" class="fa">
计划开始时间:
{{row.demandStartDate}}
</Col>
</Row>
<Row>
<Col span="24" class="fa">
计划结束时间:
{{row.demandFinishDate}}
</Col>
</Row>
<Row>
<Col span="24" class="fa">
实际开始时间:
{{row.actualStartDate}}
</Col>
</Row>
</div>
</div>
</template>
</DataGrid>
</div>
</template> </template>
<script> <script>
export default { export default {
name:'starOrder', name: "starOrder",
data(){ data() {
return{ return {
starmodal: false, columns: [
{
title: this.l("mesCode"),
key: "mesCode",
width: 240,
align: "left"
},
{
key: "productName",
title: this.l("productName"),
align: "left",
easy: true,
width: 160,
high: true,
tooltip: true
},
{
key: "status",
title: this.l("status"),
align: "center",
high: true,
code: "plan.order.status"
},
{
key: "mainRoutingSetStatus",
title: this.l("mainRoutingSetStatus"),
align: "center",
high: true,
code: "aps.plan.mainRoutingStatus"
},
{
key: "taskType",
title: this.l("taskType"),
align: "left",
easy: true,
high: true,
hide: true,
code: "plan.order.taskType"
} }
}, ],
created() { }, list: [
async fetch({ store, params }) { {
await store.dispatch("loadDictionary"); // 加载数据字典 actualBeginTime: "2020-05-12 14:58:17",
}, id: 1,
mounted() { }, orderIDs: "5",
methods: { platesnum: 0,
toExecute(){ processcode: "ZGY_20200315_2",
this.$router.push("/produce/execute"); processname: "增材制造主工艺规程",
quantity: 1,
routing_header_id: 181,
routing_type: 1,
actualStartDate: "2020-05-12 14:58:17",
demandFinishDate: "2020-05-10 23:59:59",
demandStartDate: "2020-05-09 00:00:01",
mesCode: "DDBH_20200509_2",
order_id: 5,
picnumber: 0,
productName: "气源分配器壳体",
quantity: 1,
taskTypeName: "正式计划"
},
{
mesCode: "DDBH2010052001",
productName: "机床产品1",
status: 1,
mainRoutingSetStatus: 1,
taskType: 1
},
{
mesCode: "DDBH2010052002",
productName: "机床产品2",
status: 2,
mainRoutingSetStatus: 1,
taskType: 1
}, },
{
mesCode: "DDBH2010052003",
productName: "机床产品3",
status: 5,
mainRoutingSetStatus: 1,
taskType: 1
},
{
mesCode: "DDBH2010052004",
productName: "机床产品4",
status: 1,
mainRoutingSetStatus: 0,
taskType: 1
}
]
};
},
created() {},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
mounted() {},
methods: {
toExecute() {
this.$router.push("/produce/execute");
}, },
} l(key) {
let vkey = "mes_order" + "." + key;
return this.$t(vkey) || key;
}
}
};
</script> </script>
<style lang="less">
.aps-r {
width: 100%;
height: 100%;
overflow: auto;
padding: 15px 0 15px 15px;
.body {
border: 1px solid #e4e6ed;
border-radius: 4px;
margin-right: 8px;
margin-bottom: 8px;
.title-i {
padding: 0 8px;
height: 35px;
line-height: 35px;
color: #fff;
background: #a7b8cc;
font-size: 15px;
.btn-click {
text-align: right;
a {
color: #fff;
}
a:hover {
color: #249e91;
}
}
}
.panel-text {
background: rgba(167, 184, 204, 0.2);
padding: 5px 8px;
.row {
height: 30px;
line-height: 30px;
.fa {
color: #515a6e;
}
}
}
}
}
</style>
...@@ -5,7 +5,7 @@ const systemApi = { ...@@ -5,7 +5,7 @@ const systemApi = {
aps:'47.92.102.113' aps:'47.92.102.113'
} }
//环境切换(只修改此处): //环境切换(只修改此处):
let address=systemApi.product; let address=systemApi.dev;
//let address=systemApi.product; //let address=systemApi.product;
//let address=systemApi.local; //let address=systemApi.local;
......
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