Commit fb442d69 authored by renjintao's avatar renjintao

Merge branch 'product' of git.mes123.com:zhouyx/mes-ui into product-rjt

parents 1b700f11 89e37758
<template> <template>
<div class="aps-r"> <div class="aps-r">
<DataGrid :columns="columns" ref="grid" :batch="false" :type="typeInfo" :span="6" :lazy="true" :conditions="easySearch" :action="action" :gutter="40"> <DataGrid
<template slot="easySearch"> :columns="columns"
<Form ref="formInline" :model="easySearch" inline> ref="grid"
<FormItem prop="keys"> :batch="false"
<Input placeholder="请输入订单编号/产品名称/图号" v-model="easySearch.keys.value" v-width="260" clearable /> :type="typeInfo"
</FormItem> :span="6"
<!-- :lazy="true"
:conditions="easySearch"
:action="action"
:gutter="40"
>
<template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys">
<Input
placeholder="请输入订单编号/产品名称/图号"
v-model="easySearch.keys.value"
v-width="260"
clearable
/>
</FormItem>
<!--
<FormItem> <FormItem>
<Dictionary code="taskList.status" placeholder="请选择工单状态" :multiple="true" v-model="easySearch.DispatchStatus.value"></Dictionary> <Dictionary code="taskList.status" placeholder="请选择工单状态" :multiple="true" v-model="easySearch.DispatchStatus.value"></Dictionary>
</FormItem> </FormItem>
--> -->
<FormItem> <FormItem>
<Button type="primary" @click="search">查询</Button> <Button type="primary" @click="search">查询</Button>
</FormItem> </FormItem>
</Form> </Form>
</template> </template>
<template slot="searchForm"> <template slot="searchForm">
<Search /> <Search />
</template> </template>
<template slot="buttons"> <template slot="buttons">
<Button :icon="iconInfo" shape="circle" :title="titleInfo" @click="changeShwo"></Button> <Button
</template> :icon="iconInfo"
<template slot="card" slot-scope="{row}"> shape="circle"
<div class="body" @click="toExecute(row.id,row.orderId,row.executeId,row.routingHeaderId,row.routingDetailId,row.quantity,row.status,row.mesCode,row.productName,row.drawnNumber)"> :title="titleInfo"
<Row class="title-i"> @click="changeShwo"
<Col :span="10" class="order-code"> ></Button>
<Ellipsis :text="row.productName" :lines="1" tooltip transfer /> </template>
</Col> <template slot="card" slot-scope="{ row }">
<Col :span="10" class="order-code"> <div
<Ellipsis :text="row.mesCode" :lines="1" tooltip transfer /> class="body"
</Col> @click="
<Col :span="4"> toExecute(
<div class="statuBg" :style="tdStyle(row.status)"></div> row.id,
<div class="boxTitle"> row.orderId,
<div class="text"> row.executeId,
<state code="taskList.status" ref="state" :value="row.status" type="text" :color="false"></state> row.routingHeaderId,
</div> row.routingDetailId,
</div> row.quantity,
</Col> row.status,
</Row> row.mesCode,
<div class="panel-text"> row.productName,
<Row> row.drawnNumber
<Col span="8"> )
<div class="img-i"> "
<img :src="downUrl +row.productUrl" v-if="row.productUrl" /> >
<img src="@/assets/imgicon/chan_Pin.png" v-else width="100%" height="100%" /> <Row class="title-i">
</div> <Col :span="10" class="order-code">
<!-- <img <Ellipsis :text="row.productName" :lines="1" tooltip transfer />
</Col>
<Col :span="10" class="order-code">
<Ellipsis :text="row.mesCode" :lines="1" tooltip transfer />
</Col>
<Col :span="4">
<div class="statuBg" :style="tdStyle(row.status)"></div>
<div class="boxTitle">
<div class="text">
<state
code="taskList.status"
ref="state"
:value="row.status"
type="text"
:color="false"
></state>
</div>
</div>
</Col>
</Row>
<div class="panel-text">
<Row>
<Col span="8">
<div class="img-i">
<img :src="downUrl + row.productUrl" v-if="row.productUrl" />
<img
src="@/assets/imgicon/chan_Pin.png"
v-else
width="100%"
height="100%"
/>
</div>
<!-- <img
:src="getUrl(row.productUrl)" :src="getUrl(row.productUrl)"
width="120" width="120"
height="120" height="120"
...@@ -55,377 +102,417 @@ ...@@ -55,377 +102,417 @@
style="border:#cacbd0 dashed 1px" style="border:#cacbd0 dashed 1px"
onerror="this.src='/imgicon/noPic_product.png';" onerror="this.src='/imgicon/noPic_product.png';"
/>--> />-->
</Col> </Col>
<Col span="16" class="row"> <Col span="16" class="row">
<p>{{l("beginTime")}}{{row.beginTime}}</p> <p>{{ l("beginTime") }}{{ row.beginTime }}</p>
<p> <p>
<span v-if="getStatus(row.status)">{{l("planEndTime")}}</span> <span v-if="getStatus(row.status)"
<span v-else>{{l("endTime")}}</span> >{{ l("planEndTime") }}</span
{{row.endTime}} >
</p> <span v-else>{{ l("endTime") }}</span>
<p v-if="getStatus(row.status)&&getTimes(row.endTime)>0"> {{ row.endTime }}
剩余时间: </p>
<OutputTime :value="getTimes(row.endTime)" style="display:inline"></OutputTime> <p v-if="getStatus(row.status) && getTimes(row.endTime) > 0">
</p> 剩余时间:
<p>{{l("quantity")}}{{row.quantity}}</p> <OutputTime
</Col> :value="getTimes(row.endTime)"
</Row> style="display: inline"
<Row class="rowBottom"> ></OutputTime>
<Col span="14">{{l("drawnNumber")}}{{row.drawnNumber}}</Col> </p>
<Col span="10" class="tr">
<Icon type="md-alert" size="18" color="#FFA000" v-if="getStatus(row.status)&&getTimes(row.endTime)<86400&&getTimes(row.endTime)>0" /> <Row>
<span style="color:#FFA000" v-if="getStatus(row.status)&&getTimes(row.endTime)<86400&&getTimes(row.endTime)>0">预警</span>&nbsp;&nbsp; <Col span="12">
<Icon type="md-timer" size="18" color="#FE7777" v-if="getStatus(row.status)&&compareTime(row.endTime)" /> <p>{{ l("quantity") }}{{ row.quantity }}</p></Col
<span style="color:#FE7777" v-if="getStatus(row.status)&&compareTime(row.endTime)">超期</span> >
</Col> <Col span="12"
</Row> ><p>工序号:{{ row.taskSeq }}</p></Col
</div> >
</div> </Row>
</template> <p>工序名称:{{ row.taskName }}</p>
</Col>
</Row>
<Row class="rowBottom">
<Col span="14">{{ l("drawnNumber") }}{{ row.drawnNumber }}</Col>
<Col span="10" class="tr">
<Icon
type="md-alert"
size="18"
color="#FFA000"
v-if="
getStatus(row.status) &&
getTimes(row.endTime) < 86400 &&
getTimes(row.endTime) > 0
"
/>
<span
style="color: #ffa000"
v-if="
getStatus(row.status) &&
getTimes(row.endTime) < 86400 &&
getTimes(row.endTime) > 0
"
>预警</span
>&nbsp;&nbsp;
<Icon
type="md-timer"
size="18"
color="#FE7777"
v-if="getStatus(row.status) && compareTime(row.endTime)"
/>
<span
style="color: #fe7777"
v-if="getStatus(row.status) && compareTime(row.endTime)"
>超期</span
>
</Col>
</Row>
</div>
</div>
</template>
</DataGrid> </DataGrid>
</div> </div>
</template> </template>
<script> <script>
import Api from "./api"; import Api from "./api";
import Search from "./search"; import Search from "./search";
export default { export default {
name: "starOrder", name: "starOrder",
components: { components: {
Search, Search,
}, },
data() { data() {
return { return {
action: Api.index, action: Api.index,
easySearch: { easySearch: {
keys: { keys: {
op: "mesCode,productName,drawnNumber", op: "mesCode,productName,drawnNumber",
value: null, value: null,
},
DispatchStatus: {
op: "In",
value: [12, 14, 5, 7, -1]
}
},
downUrl: fileUrlDown,
columns: [{
title: this.l("Id"),
key: "id",
width: 80,
align: "left",
},
{
title: this.l("mesCode"),
key: "mesCode",
width: 240,
align: "left",
},
{
key: "status",
title: this.l("status"),
align: "center",
high: true,
code: "taskList.status",
width: 120,
},
{
key: "productName",
title: this.l("productName"),
align: "left",
high: true,
},
{
key: "drawnNumber",
title: this.l("drawnNumber"),
align: "left",
high: true,
},
{
key: "quantity",
title: this.l("quantity"),
align: "right",
width: 120,
high: true,
},
{
key: "beginTime",
title: this.l("beginTime"),
align: "center",
width: 180,
high: true,
},
{
key: "endTime",
title: this.l("endTime"),
align: "center",
width: 180,
high: true,
},
{
title: "操作",
key: "action",
width: 140,
align: "center",
render: (h, params) => {
return h(
"div", {
class: "action",
},
[
h(
"op", {
attrs: {
oprate: "edit",
},
on: {
click: () =>
this.toExecute(
params.row.id,
params.row.orderId,
params.row.executeId,
params.row.routingHeaderId,
params.row.routingDetailId,
params.row.quantity,
params.row.status,
params.row.mesCode,
params.row.productName,
params.row.drawnNumber
),
},
},
"查看"
),
]
);
},
},
],
typeInfo: "card",
iconInfo: "md-apps",
titleInfo: "卡片模式",
nowTime: new Date().getTime(), //页面当前打开时间
};
},
created() {
let oldStr = localStorage.getItem("admin");
let userlist = this.$store.getters.getUser(2);
},
async fetch({
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
mounted() {
this.search();
},
methods: {
search() {
this.$refs.grid.reload(this.easySearch);
}, },
toExecute( DispatchStatus: {
id, op: "In",
orderId, value: [12, 14, 5, 7, -1],
executeId,
headid,
routingDetailId,
quantity,
status,
mesCode,
productName,
drawnNumber
) {
//跳转到对应操作页面 获取id:this.$route.query.id
this.$router.push({
path: "/produce/execute",
query: {
id: id, //工单ID
orderId: orderId, //订单id
executeId: executeId, //订单执行表id
headid: headid, //工艺规程id
routid: routingDetailId, //工序ID
quantity: quantity, //派工数量
dispatchStatus: status,
mesCode: mesCode,
productName: productName,
drawnNumber: drawnNumber,
},
});
}, },
tdStyle(val) { },
//动态根据状态值加载状态值对应的颜色 downUrl: fileUrlDown,
let temDic = this.$store.getters.dictionaryByKey("taskList.status"); columns: [
let temColor = "#666"; {
temDic.forEach((data) => { title: this.l("Id"),
if (Number(data.code) == val) { key: "id",
temColor = data.color; width: 80,
} align: "left",
});
var style = {};
style["border-top"] = " solid 38px " + temColor;
return style;
}, },
changeShwo() { {
//显示模式切换 title: this.l("mesCode"),
if (this.typeInfo == "card") { key: "mesCode",
this.typeInfo = "table"; width: 240,
this.iconInfo = "md-list"; align: "left",
this.titleInfo = "列表模式";
} else {
this.typeInfo = "card";
this.iconInfo = "md-apps";
this.titleInfo = "卡片模式";
}
}, },
compareTime(dateStart) { {
//比较当前时间和计划完成时间 key: "status",
let planEndTime = new Date(dateStart).getTime(); title: this.l("status"),
let res = true; align: "center",
if (this.nowTime - planEndTime > 0) { high: true,
res = true; code: "taskList.status",
} else { width: 120,
res = false;
}
return res;
}, },
getTimes(dateStart) { {
//返回计划完成时间和当前时间的差值 key: "productName",
let planEndTime = new Date(dateStart).getTime(); title: this.l("productName"),
let res = 0; align: "left",
if (this.nowTime - planEndTime > 0) { high: true,
res = 0;
} else {
res = (this.nowTime - planEndTime) / 1000;
}
return res;
}, },
getStatus(status) { {
//根据状态返回未开工、执行中、暂停状态的bool值 key: "drawnNumber",
let res = true; title: this.l("drawnNumber"),
if (status == 12 || status == 14 || status == 5) { align: "left",
res = true; high: true,
} else {
res = false;
}
return res;
}, },
getUrl(url) { {
//返回img需要显示的src值 key: "quantity",
let tempUrl = ""; title: this.l("quantity"),
if (url && url.length > 0) { align: "right",
tempUrl = this.downUrl + url; width: 120,
} else { high: true,
tempUrl = iconImg + "noPic_product.png";
}
return tempUrl;
}, },
l(key) { {
let vkey = "order_list" + "." + key; key: "beginTime",
return this.$t(vkey) || key; title: this.l("beginTime"),
align: "center",
width: 180,
high: true,
}, },
{
key: "endTime",
title: this.l("endTime"),
align: "center",
width: 180,
high: true,
},
{
title: "操作",
key: "action",
width: 140,
align: "center",
render: (h, params) => {
return h(
"div",
{
class: "action",
},
[
h(
"op",
{
attrs: {
oprate: "edit",
},
on: {
click: () =>
this.toExecute(
params.row.id,
params.row.orderId,
params.row.executeId,
params.row.routingHeaderId,
params.row.routingDetailId,
params.row.quantity,
params.row.status,
params.row.mesCode,
params.row.productName,
params.row.drawnNumber
),
},
},
"查看"
),
]
);
},
},
],
typeInfo: "card",
iconInfo: "md-apps",
titleInfo: "卡片模式",
nowTime: new Date().getTime(), //页面当前打开时间
};
},
created() {
let oldStr = localStorage.getItem("admin");
let userlist = this.$store.getters.getUser(2);
},
async fetch({ store, params }) {
await store.dispatch("loadDictionary"); // 加载数据字典
},
mounted() {
this.search();
},
methods: {
search() {
this.$refs.grid.reload(this.easySearch);
},
toExecute(
id,
orderId,
executeId,
headid,
routingDetailId,
quantity,
status,
mesCode,
productName,
drawnNumber
) {
//跳转到对应操作页面 获取id:this.$route.query.id
this.$router.push({
path: "/produce/execute",
query: {
id: id, //工单ID
orderId: orderId, //订单id
executeId: executeId, //订单执行表id
headid: headid, //工艺规程id
routid: routingDetailId, //工序ID
quantity: quantity, //派工数量
dispatchStatus: status,
mesCode: mesCode,
productName: productName,
drawnNumber: drawnNumber,
},
});
},
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;
},
getStatus(status) {
//根据状态返回未开工、执行中、暂停状态的bool值
let res = true;
if (status == 12 || status == 14 || status == 5) {
res = true;
} else {
res = false;
}
return res;
},
getUrl(url) {
//返回img需要显示的src值
let tempUrl = "";
if (url && url.length > 0) {
tempUrl = this.downUrl + url;
} else {
tempUrl = iconImg + "noPic_product.png";
}
return tempUrl;
},
l(key) {
let vkey = "order_list" + "." + key;
return this.$t(vkey) || key;
},
},
}; };
</script> </script>
<style lang="less"> <style lang="less">
.aps-r { .aps-r {
// width: 100%; // width: 100%;
// height: 100%; // height: 100%;
// overflow: auto; // overflow: auto;
// padding: 15px 0 15px 15px; // padding: 15px 0 15px 15px;
height: calc(100vh - 110px); height: calc(100vh - 110px);
.body { .body {
background: white; background: white;
border-radius: 4px 0 4px 4px; border-radius: 4px 0 4px 4px;
border: #cacbd0 solid 1px; border: #cacbd0 solid 1px;
margin-bottom: 30px; margin-bottom: 30px;
.title-i { .title-i {
padding: 0 0 0 8px; padding: 0 0 0 8px;
height: 38px; height: 38px;
line-height: 38px; line-height: 38px;
color: #2680eb; color: #2680eb;
font-size: 14px; font-size: 14px;
font-weight: bold; font-weight: bold;
border-bottom: #cacbd0 dotted 1px; border-bottom: #cacbd0 dotted 1px;
.btn-click { .btn-click {
text-align: right; text-align: right;
a { a {
color: #fff; color: #fff;
} }
a:hover { a:hover {
color: #249e91; color: #249e91;
}
}
} }
}
}
.panel-text { .panel-text {
padding: 5px 8px; padding: 5px 8px;
.img-i { .img-i {
width: 120px; width: 120px;
height: 120px; height: 120px;
overflow: hidden; overflow: hidden;
border: #cacbd0 dashed 1px; border: #cacbd0 dashed 1px;
//img { //img {
// width: 90px; // width: 90px;
// height: 90px; // height: 90px;
//} //}
} }
.row { .row {
color: #666666; color: #666666;
padding-left: 10px; padding-left: 10px;
p { p {
line-height: 30px; line-height: 30px;
}
}
} }
}
} }
}
.body:hover { .body:hover {
cursor: pointer; cursor: pointer;
box-shadow: 0 0 10px #888888; box-shadow: 0 0 10px #888888;
} }
} }
.statuBg { .statuBg {
height: 0px; height: 0px;
width: 0; width: 0;
border-left: solid 50px transparent; border-left: solid 50px transparent;
float: right; float: right;
margin-right: -1px; margin-right: -1px;
} }
.boxTitle { .boxTitle {
color: white; color: white;
float: right; float: right;
margin-top: -42px; margin-top: -42px;
/* Rotate div */ /* Rotate div */
transform: rotate(37deg); transform: rotate(37deg);
-ms-transform: rotate(37deg); -ms-transform: rotate(37deg);
/* Internet Explorer */ /* Internet Explorer */
-moz-transform: rotate(37deg); -moz-transform: rotate(37deg);
/* Firefox */ /* Firefox */
-webkit-transform: rotate(37deg); -webkit-transform: rotate(37deg);
/* Safari 和 Chrome */ /* Safari 和 Chrome */
-o-transform: rotate(37deg); -o-transform: rotate(37deg);
/* Opera */ /* Opera */
.text { .text {
font-size: 8px; font-size: 8px;
font-weight: normal; font-weight: normal;
} }
} }
.rowBottom .ivu-col-span-10 { .rowBottom .ivu-col-span-10 {
height: 24px; height: 24px;
padding-right: 10px; 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