Commit d10308ba authored by renjintao's avatar renjintao

request&&aps

parent d8df0f8b
......@@ -34,9 +34,7 @@
<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">
......@@ -49,14 +47,20 @@
: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>
<Modal v-model="circleModal" title footer-hide :mask-closable="false">
<div slot="close"></div>
<Row>
<Col class="demo-spin-col" span="24">
<Spin fix>
<Icon type="ios-loading" size="18" class="demo-spin-icon-load"></Icon>
<div>APS排产进行中......</div>
</Spin>
</Col>
</Row>
</Modal>
</div>
</template>
<script>
......@@ -67,16 +71,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,
......@@ -96,11 +100,11 @@ export default {
return h("Icon", {
attrs: {
type: "md-more",
size: 18,
size: 18
},
class: "drag",
class: "drag"
});
},
}
},
{
type: "expand",
......@@ -108,16 +112,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",
......@@ -125,7 +129,7 @@ export default {
hide: true,
align: "left",
sortable: true,
width: 50,
width: 50
},
{
key: "insert_flag",
......@@ -134,13 +138,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",
......@@ -149,20 +153,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",
......@@ -171,7 +175,7 @@ export default {
high: true,
hide: true,
resizable: true,
width: 140,
width: 140
},
{
key: "plan_finish",
......@@ -181,7 +185,7 @@ export default {
hide: true,
sortable: true,
resizable: true,
width: 140,
width: 140
},
{
key: "notes",
......@@ -189,14 +193,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",
......@@ -204,14 +208,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: "操作",
......@@ -225,9 +229,9 @@ export default {
attrs: {
icon: "md-options",
type: "icon",
title: "工序参数设置",
title: "工序参数设置"
},
on: { click: () => this.openAddModel(2, params.row) },
on: { click: () => this.openAddModel(2, params.row) }
}),
h("op", {
attrs: {
......@@ -235,9 +239,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: {
......@@ -245,13 +249,13 @@ 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: [],
//设置参数开始
......@@ -259,9 +263,10 @@ export default {
opTaskPk: 0, //工单ID
partTaskPk: 0, //生产计划ID
taskSeq: "", //工序编号
count: 0,
}, //生产计划数量
count: 0 //生产计划数量
},
//设置参数结束
circleModal: false //进度条
};
},
mounted() {
......@@ -273,7 +278,7 @@ export default {
methods: {
//排产池加载数据列表
loadList() {
Api.getall().then((res) => {
Api.getall().then(res => {
if (res.success) {
this.list = res.result;
}
......@@ -298,9 +303,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 = [];
......@@ -317,9 +322,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();
......@@ -330,7 +335,7 @@ export default {
//批量选择
let selectRows = a;
this.arrPartPkId = [];
selectRows.forEach((e) => {
selectRows.forEach(e => {
this.arrPartPkId.push(e.part_task_pk);
});
},
......@@ -383,6 +388,7 @@ export default {
},
//确定aps排产
apsOk() {
this.circleModal = true;
//APS排产前订单优先级功能
let parmsOrderpriority = { alls: [] };
let arryIds = [];
......@@ -394,25 +400,26 @@ 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.circleModal = false;
this.$router.push({
name: "aps-results",
name: "aps-results"
// params: { customerId: id }
});
} else {
......@@ -444,23 +451,51 @@ export default {
opTaskPk: 0,
partTaskPk: row.part_task_pk,
taskSeq: "",
count: row.plan_qty,
count: row.plan_qty
};
} else {
this.setParams = {
opTaskPk: 0,
partTaskPk: 0,
taskSeq: "",
count: 0,
count: 0
};
}
this.addModal = true;
},
},
}
}
};
</script>
<style lang="less">
.drag {
cursor: move;
}
.demo-spin-icon-load {
animation: ani-demo-spin 1s linear infinite;
}
@keyframes ani-demo-spin {
from {
transform: rotate(0deg);
}
50% {
transform: rotate(180deg);
}
to {
transform: rotate(360deg);
}
}
.demo-spin-col {
height: 100px;
position: relative;
border: 0px solid #eee;
}
.vertical-center-modal {
display: flex;
align-items: center;
justify-content: center;
.ivu-modal {
top: 0;
}
}
</style>
......@@ -53,7 +53,7 @@ function errorLog (err) {
// 创建一个 axios 实例
const service = axios.create({
baseURL: Setting.apiBaseURL,
timeout: 20000, // 请求超时时间
timeout: 60000, // 请求超时时间
transformRequest:[(data)=>{
function dateFormat(date, fmt) {
if (null == date || undefined == date) return '';
......
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