Commit 8b46ebfa authored by renjintao's avatar renjintao

orderList

parent 7229afef
import Api from '@/plugins/request'
export default {
index: `${PlanUrl}/orderexecutenew/paged_img`,
paged(params) {
return Api.post(`${PlanUrl}/orderexecutenew/paged_img`, params);
},
}
...@@ -7,60 +7,92 @@ ...@@ -7,60 +7,92 @@
ref="grid" ref="grid"
:data="list" :data="list"
:batch="false" :batch="false"
type="card" :type="typeInfo"
:high="false" :high="false"
:span="6" :span="6"
:lazy="true" :lazy="true"
:conditions="easySearch"
:action="action"
:set="false"
> >
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input placeholder="请输入订单编号/产品名称" v-model="easySearch.keys.value" v-width="260" />
</FormItem>
<FormItem>
<Button type="primary" @click="search">查询</Button>
</FormItem>
</Form>
</template>
<template slot="buttons">
<Button :icon="iconInfo" shape="circle" :title="titleInfo" @click="changeShwo"></Button>
</template>
<template slot="card" slot-scope="{row}"> <template slot="card" slot-scope="{row}">
<div class="body" @click="toExecute"> <div class="body" @click="toExecute">
<Row class="title-i"> <Row class="title-i">
<Col :span="10" class="order-code">{{row.productName}}</Col> <Col :span="10" class="order-code">{{row.productName}}</Col>
<Col :span="10" class="order-code">{{row.processcode}}</Col> <Col :span="10" class="order-code">{{row.mesCode}}</Col>
<Col :span="4"> <Col :span="4">
<div class="sanjiao"></div> <div class="sanjiao" :style="tdStyle(row.status)"></div>
<div class="box"><div class="text" style="font-size:6px;font-weight:normal">新建</div></div> <div class="box">
<div class="text" style="font-size:4px;font-weight:normal">
<state
code="taskList.status"
ref="state"
:value="row.status"
type="text"
:color="false"
></state>
</div>
</div>
</Col> </Col>
</Row> </Row>
<div class="panel-text"> <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> <Row>
<Col span="24" class="fa"> <Col span="8">
计划开始时间: <img
{{row.demandStartDate}} :src="getUrl(row.productUrl)"
width="120"
height="120"
style="border:#cacbd0 dashed 1px"
/>
</Col> </Col>
</Row> <Col span="16" class="row">
<Row> <p>开始时间:{{row.beginTime}}</p>
<Col span="24" class="fa"> <p>
计划结束时间: <span v-if="(row.status==12||row.status==14||row.status==5)">计划</span>结束时间:{{row.endTime}}
{{row.demandFinishDate}} </p>
<p v-if="(row.status==12||row.status==14||row.status==5)&&getTimes(row.endTime)>0">
剩余时间:
<OutputTime :value="getTimes(row.endTime)" style="display:inline"></OutputTime>
</p>
<p>生产数量:{{row.quantity}}</p>
</Col> </Col>
</Row> </Row>
<Row> <Row class="rowBottom">
<Col span="24" class="fa"> <Col span="14">图号:{{row.drawnNumber}}</Col>
实际开始时间: <Col span="10" class="tr">
{{row.actualStartDate}} <Icon
type="md-alert"
size="18"
color="#FFA000"
v-if="(row.status==12||row.status==14||row.status==5)&&getTimes(row.endTime)<86400&&getTimes(row.endTime)>0"
/>
<span
style="color:#FFA000"
v-if="(row.status==12||row.status==14||row.status==5)&&getTimes(row.endTime)<86400&&getTimes(row.endTime)>0"
>预警</span>&nbsp;&nbsp;
<Icon
type="md-timer"
size="18"
color="#FE7777"
v-if="(row.status==12||row.status==14||row.status==5)&&compareTime(row.endTime)"
/>
<span
style="color:#FE7777"
v-if="(row.status==12||row.status==14||row.status==5)&&compareTime(row.endTime)"
>超期</span>
</Col> </Col>
</Row> </Row>
</div> </div>
...@@ -70,10 +102,19 @@ ...@@ -70,10 +102,19 @@
</div> </div>
</template> </template>
<script> <script>
import Api from "./api";
export default { export default {
name: "starOrder", name: "starOrder",
data() { data() {
return { return {
action: Api.index,
easySearch: {
keys: {
op: "mesCode,productName",
value: null
}
},
downUrl: fileUrlDown,
columns: [ columns: [
{ {
title: this.l("mesCode"), title: this.l("mesCode"),
...@@ -81,42 +122,70 @@ export default { ...@@ -81,42 +122,70 @@ export default {
width: 240, width: 240,
align: "left" align: "left"
}, },
{
key: "status",
title: "工单状态",
align: "center",
high: true,
code: "taskList.status",
width: 120
},
{ {
key: "productName", key: "productName",
title: this.l("productName"), title: "产品名称",
align: "left", align: "left",
easy: true, high: true
width: 160,
high: true,
tooltip: true
}, },
{ {
key: "status", key: "drawnNumber",
title: this.l("status"), title: "图号",
align: "left",
high: true
},
{
key: "quantity",
title: "生产数量",
align: "right",
width: 120,
high: true
},
{
key: "beginTime",
title: "开始时间",
align: "center", align: "center",
high: true, width: 180,
code: "plan.order.status" high: true
}, },
{ {
key: "mainRoutingSetStatus", key: "endTime",
title: this.l("mainRoutingSetStatus"), title: "结束时间",
align: "center", align: "center",
high: true, width: 180,
code: "aps.plan.mainRoutingStatus" high: true
}, },
{ {
key: "taskType", title: "操作",
title: this.l("taskType"), key: "action",
align: "left", width: 140,
easy: true, align: "center",
high: true, render: (h, params) => {
hide: true, return h("div", { class: "action" }, [
code: "plan.order.taskType" h(
"op",
{
attrs: { oprate: "edit" },
on: { click: () => this.toExecute(params.row.id) }
},
"处理"
)
]);
}
} }
], ],
list: [ list: [
{ {
actualBeginTime: "2020-05-12 14:58:17", actualBeginTime: "2020-05-12 14:58:17",
img: "/2020/5/12/b8cbee7b-6faa-4cfa-a05a-aa7a7f13b8d7.png",
id: 1, id: 1,
orderIDs: "5", orderIDs: "5",
platesnum: 0, platesnum: 0,
...@@ -132,49 +201,289 @@ export default { ...@@ -132,49 +201,289 @@ export default {
order_id: 5, order_id: 5,
picnumber: 0, picnumber: 0,
productName: "气源分配器壳体", productName: "气源分配器壳体",
drawNum: "JPEG4620",
taskTypeName: "正式计划",
status: 1
},
{
actualBeginTime: "2020-05-12 14:58:17",
img: "/2020/5/12/b8cbee7b-6faa-4cfa-a05a-aa7a7f13b8d7.png",
id: 1,
orderIDs: "5",
platesnum: 0,
processcode: "ZGY_20200315_2",
processname: "增材制造主工艺规程",
quantity: 1, quantity: 1,
taskTypeName: "正式计划" 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: "气源分配器壳体",
drawNum: "JPEG4620",
taskTypeName: "正式计划",
status: 2
}, },
{ {
mesCode: "DDBH2010052001", actualBeginTime: "2020-05-12 14:58:17",
productName: "机床产品1", img: "/2020/5/12/b8cbee7b-6faa-4cfa-a05a-aa7a7f13b8d7.png",
status: 1, id: 1,
mainRoutingSetStatus: 1, orderIDs: "5",
taskType: 1 platesnum: 0,
processcode: "ZGY_20200315_2",
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: "气源分配器壳体",
drawNum: "JPEG4620",
taskTypeName: "正式计划",
status: 3
}, },
{ {
mesCode: "DDBH2010052002", actualBeginTime: "2020-05-12 14:58:17",
productName: "机床产品2", img: "/2020/5/12/b8cbee7b-6faa-4cfa-a05a-aa7a7f13b8d7.png",
status: 2, id: 1,
mainRoutingSetStatus: 1, orderIDs: "5",
taskType: 1 platesnum: 0,
processcode: "ZGY_20200315_2",
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: "气源分配器壳体",
drawNum: "JPEG4620",
taskTypeName: "正式计划",
status: 4
}, },
{ {
mesCode: "DDBH2010052003", actualBeginTime: "2020-05-12 14:58:17",
productName: "机床产品3", img: "/2020/5/12/b8cbee7b-6faa-4cfa-a05a-aa7a7f13b8d7.png",
status: 5, id: 1,
mainRoutingSetStatus: 1, orderIDs: "5",
taskType: 1 platesnum: 0,
processcode: "ZGY_20200315_2",
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: "气源分配器壳体",
drawNum: "JPEG4620",
taskTypeName: "正式计划",
status: 5
}, },
{ {
mesCode: "DDBH2010052004", actualBeginTime: "2020-05-12 14:58:17",
productName: "机床产品4", img: "/2020/5/12/b8cbee7b-6faa-4cfa-a05a-aa7a7f13b8d7.png",
status: 1, id: 1,
mainRoutingSetStatus: 0, orderIDs: "5",
taskType: 1 platesnum: 0,
processcode: "ZGY_20200315_2",
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: "气源分配器壳体",
drawNum: "JPEG4620",
taskTypeName: "正式计划",
status: 6
},
{
actualBeginTime: "2020-05-12 14:58:17",
img: "/2020/5/12/b8cbee7b-6faa-4cfa-a05a-aa7a7f13b8d7.png",
id: 1,
orderIDs: "5",
platesnum: 0,
processcode: "ZGY_20200315_2",
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: "气源分配器壳体",
drawNum: "JPEG4620",
taskTypeName: "正式计划",
status: 8
},
{
actualBeginTime: "2020-05-12 14:58:17",
img: "/2020/5/12/b8cbee7b-6faa-4cfa-a05a-aa7a7f13b8d7.png",
id: 1,
orderIDs: "5",
platesnum: 0,
processcode: "ZGY_20200315_2",
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: "气源分配器壳体",
drawNum: "JPEG4620",
taskTypeName: "正式计划",
status: 11
},
{
actualBeginTime: "2020-05-12 14:58:17",
img: "/2020/5/12/b8cbee7b-6faa-4cfa-a05a-aa7a7f13b8d7.png",
id: 1,
orderIDs: "5",
platesnum: 0,
processcode: "ZGY_20200315_2",
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: "气源分配器壳体",
drawNum: "JPEG4620",
taskTypeName: "正式计划",
status: 12
},
{
actualBeginTime: "2020-05-12 14:58:17",
img: "/2020/5/12/b8cbee7b-6faa-4cfa-a05a-aa7a7f13b8d7.png",
id: 1,
orderIDs: "5",
platesnum: 0,
processcode: "ZGY_20200315_2",
processname: "增材制造主工艺规程",
quantity: 13,
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: "气源分配器壳体",
drawNum: "JPEG4620",
taskTypeName: "正式计划",
status: 14
} }
] ],
typeInfo: "card",
iconInfo: "md-apps",
titleInfo: "卡片模式",
nowTime: new Date().getTime()
}; };
}, },
created() {}, created() {},
async fetch({ store, params }) { async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
mounted() {}, mounted() {
this.search();
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
methods: { methods: {
search() {
this.$refs.grid.reload(this.easySearch);
},
toExecute() { toExecute() {
this.$router.push("/produce/execute"); this.$router.push("/produce/execute");
}, },
tdStyle(val) {
//动态根据状态值加载状态值对应的颜色
let temDic = this.$store.getters.dictionaryByKey("taskList.status");
let temColor = "#666";
temDic.forEach(data => {
if (Number(data.code) == val) {
temColor = data.color;
}
});
var style = {};
style["border-top"] = " solid 38px " + temColor;
return style;
},
changeShwo() {
if (this.typeInfo == "card") {
this.typeInfo = "table";
this.iconInfo = "md-list";
this.titleInfo = "卡片模式";
} else {
this.typeInfo = "card";
this.iconInfo = "md-apps";
this.titleInfo = "列表模式";
}
},
compareTime(dateStart) {
//比较当前时间和计划完成时间
let planEndTime = new Date(dateStart).getTime();
let res = true;
if (this.nowTime - planEndTime > 0) {
res = true;
} else {
res = false;
}
return res;
},
getTimes(dateStart) {
//返回计划完成时间和当前时间的差值
let planEndTime = new Date(dateStart).getTime();
let res = 0;
if (this.nowTime - planEndTime > 0) {
res = 0;
} else {
res = (this.nowTime - planEndTime) / 1000;
}
return res;
},
getUrl(url) {
let tempUrl = "";
if (url && url.length > 0) {
tempUrl = this.downUrl + JSON.parse(url)[0].filePath;
}
else
{
tempUrl=iconImg+"noPic_product.png"
}
return tempUrl
},
l(key) { l(key) {
let vkey = "mes_order" + "." + key; let vkey = "mes_order" + "." + key;
return this.$t(vkey) || key; return this.$t(vkey) || key;
...@@ -192,8 +501,9 @@ export default { ...@@ -192,8 +501,9 @@ export default {
background: white; background: white;
border-radius: 4px; border-radius: 4px;
border: #cacbd0 solid 1px; border: #cacbd0 solid 1px;
margin-right: 8px; margin-left: 40px;
margin-bottom: 8px; margin-right: 40px;
margin-bottom: 39px;
.title-i { .title-i {
padding: 0 8px; padding: 0 8px;
height: 38px; height: 38px;
...@@ -215,51 +525,43 @@ export default { ...@@ -215,51 +525,43 @@ export default {
.panel-text { .panel-text {
padding: 5px 8px; padding: 5px 8px;
.row { .row {
height: 30px; color: #666666;
padding-left: 10px;
p {
line-height: 30px; line-height: 30px;
.fa {
color: #515a6e;
} }
} }
} }
} }
} }
.sanjiao { .sanjiao {
width: 0; margin: 38px;
height: 0; height: 0px;
border-width: 27px 27px 27px; width: 0px;
border-style: solid; border-left: solid 60px transparent;
border-color: transparent transparent green;
transform: rotate(45deg);
-ms-transform: rotate(45deg); /* Internet Explorer */
-moz-transform: rotate(45deg); /* Firefox */
-webkit-transform: rotate(45deg); /* Safari 和 Chrome */
-o-transform: rotate(45deg); /* Opera */
position: absolute; position: absolute;
right: -35px; right: -46px;
top: -27px; top: -38px;
} }
.box{ .box {
width:38px; color: white;
height:38px; width: 70px;
color: #fff; height: 70px;
overflow: hidden;
/* Rotate div */ /* Rotate div */
transform:rotate(45deg); transform: rotate(35deg);
-ms-transform:rotate(45deg); /* Internet Explorer */ -ms-transform: rotate(45deg); /* Internet Explorer */
-moz-transform:rotate(45deg); /* Firefox */ -moz-transform: rotate(45deg); /* Firefox */
-webkit-transform:rotate(45deg); /* Safari 和 Chrome */ -webkit-transform: rotate(35deg); /* Safari 和 Chrome */
-o-transform:rotate(45deg); /* Opera */ -o-transform: rotate(45deg); /* Opera */
position: absolute;
right: -19px;
top: 0px;
.text { .text {
position: absolute; position: absolute;
bottom: 0; left: 20px;
top: -10px;
}
} }
.rowBottom .ivu-col-span-10 {
height: 24px;
padding-right: 10px;
} }
</style> </style>
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