Commit 862306c7 authored by 仇晓婷's avatar 仇晓婷

产品和工单默认图片

parent 5b32ebb1
<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
:columns="columns"
ref="grid"
:batch="false"
:type="typeInfo"
:span="6"
:lazy="true"
:conditions="easySearch"
:action="action"
:gutter="40"
>
<template slot="easySearch"> <template slot="easySearch">
<Form ref="formInline" :model="easySearch" inline> <Form ref="formInline" :model="easySearch" inline>
<FormItem prop="keys"> <FormItem prop="keys">
<Input placeholder="请输入订单编号/产品名称/图号" v-model="easySearch.keys.value" v-width="260" clearable /> <Input
placeholder="请输入订单编号/产品名称/图号"
v-model="easySearch.keys.value"
v-width="260"
clearable
/>
</FormItem> </FormItem>
<FormItem> <FormItem>
<Button type="primary" @click="search">查询</Button> <Button type="primary" @click="search">查询</Button>
...@@ -18,7 +33,10 @@ ...@@ -18,7 +33,10 @@
<Button :icon="iconInfo" shape="circle" :title="titleInfo" @click="changeShwo"></Button> <Button :icon="iconInfo" shape="circle" :title="titleInfo" @click="changeShwo"></Button>
</template> </template>
<template slot="card" slot-scope="{row}"> <template slot="card" slot-scope="{row}">
<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)"> <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)"
>
<Row class="title-i"> <Row class="title-i">
<Col :span="10" class="order-code"> <Col :span="10" class="order-code">
<Ellipsis :text="row.productName" :lines="1" tooltip transfer /> <Ellipsis :text="row.productName" :lines="1" tooltip transfer />
...@@ -30,7 +48,13 @@ ...@@ -30,7 +48,13 @@
<div class="statuBg" :style="tdStyle(row.status)"></div> <div class="statuBg" :style="tdStyle(row.status)"></div>
<div class="boxTitle"> <div class="boxTitle">
<div class="text"> <div class="text">
<state code="taskList.status" ref="state" :value="row.status" type="text" :color="false"></state> <state
code="taskList.status"
ref="state"
:value="row.status"
type="text"
:color="false"
></state>
</div> </div>
</div> </div>
</Col> </Col>
...@@ -38,7 +62,18 @@ ...@@ -38,7 +62,18 @@
<div class="panel-text"> <div class="panel-text">
<Row> <Row>
<Col span="8"> <Col span="8">
<img :src="getUrl(row.productUrl)" width="120" height="120" :title="row.productUrl" style="border:#cacbd0 dashed 1px" onerror="this.src='/imgicon/noPic_product.png';" /> <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)"
width="120"
height="120"
:title="row.productUrl"
style="border:#cacbd0 dashed 1px"
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>
...@@ -57,17 +92,33 @@ ...@@ -57,17 +92,33 @@
<Row class="rowBottom"> <Row class="rowBottom">
<Col span="14">{{l("drawnNumber")}}{{row.drawnNumber}}</Col> <Col span="14">{{l("drawnNumber")}}{{row.drawnNumber}}</Col>
<Col span="10" class="tr"> <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" /> <Icon
<span style="color:#FFA000" v-if="getStatus(row.status)&&getTimes(row.endTime)<86400&&getTimes(row.endTime)>0">预警</span>&nbsp;&nbsp; type="md-alert"
<Icon type="md-timer" size="18" color="#FE7777" v-if="getStatus(row.status)&&compareTime(row.endTime)" /> size="18"
<span style="color:#FE7777" v-if="getStatus(row.status)&&compareTime(row.endTime)">超期</span> 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> </Col>
</Row> </Row>
</div> </div>
</div> </div>
</template> </template>
</DataGrid> </DataGrid>
</div> </div>
</template> </template>
<script> <script>
...@@ -76,7 +127,7 @@ import Search from "./search"; ...@@ -76,7 +127,7 @@ import Search from "./search";
export default { export default {
name: "starOrder", name: "starOrder",
components: { components: {
Search Search,
}, },
data() { data() {
return { return {
...@@ -84,15 +135,16 @@ export default { ...@@ -84,15 +135,16 @@ export default {
easySearch: { easySearch: {
keys: { keys: {
op: "mesCode,productName,drawnNumber", op: "mesCode,productName,drawnNumber",
value: null value: null,
} },
}, },
downUrl: fileUrlDown, downUrl: fileUrlDown,
columns: [{ columns: [
{
title: this.l("mesCode"), title: this.l("mesCode"),
key: "mesCode", key: "mesCode",
width: 240, width: 240,
align: "left" align: "left",
}, },
{ {
key: "status", key: "status",
...@@ -100,40 +152,40 @@ export default { ...@@ -100,40 +152,40 @@ export default {
align: "center", align: "center",
high: true, high: true,
code: "taskList.status", code: "taskList.status",
width: 120 width: 120,
}, },
{ {
key: "productName", key: "productName",
title: this.l("productName"), title: this.l("productName"),
align: "left", align: "left",
high: true high: true,
}, },
{ {
key: "drawnNumber", key: "drawnNumber",
title: this.l("drawnNumber"), title: this.l("drawnNumber"),
align: "left", align: "left",
high: true high: true,
}, },
{ {
key: "quantity", key: "quantity",
title: this.l("quantity"), title: this.l("quantity"),
align: "right", align: "right",
width: 120, width: 120,
high: true high: true,
}, },
{ {
key: "beginTime", key: "beginTime",
title: this.l("beginTime"), title: this.l("beginTime"),
align: "center", align: "center",
width: 180, width: 180,
high: true high: true,
}, },
{ {
key: "endTime", key: "endTime",
title: this.l("endTime"), title: this.l("endTime"),
align: "center", align: "center",
width: 180, width: 180,
high: true high: true,
}, },
{ {
title: "操作", title: "操作",
...@@ -141,13 +193,17 @@ export default { ...@@ -141,13 +193,17 @@ export default {
width: 140, width: 140,
align: "center", align: "center",
render: (h, params) => { render: (h, params) => {
return h("div", { return h(
class: "action" "div",
}, [ {
class: "action",
},
[
h( h(
"op", { "op",
{
attrs: { attrs: {
oprate: "edit" oprate: "edit",
}, },
on: { on: {
click: () => click: () =>
...@@ -162,29 +218,27 @@ export default { ...@@ -162,29 +218,27 @@ export default {
params.row.mesCode, params.row.mesCode,
params.row.productName, params.row.productName,
params.row.drawnNumber params.row.drawnNumber
) ),
} },
}, },
"查看" "查看"
) ),
]); ]
} );
} },
},
], ],
typeInfo: "card", typeInfo: "card",
iconInfo: "md-apps", iconInfo: "md-apps",
titleInfo: "卡片模式", titleInfo: "卡片模式",
nowTime: new Date().getTime() //页面当前打开时间 nowTime: new Date().getTime(), //页面当前打开时间
}; };
}, },
created() { created() {
let oldStr = localStorage.getItem("admin"); let oldStr = localStorage.getItem("admin");
let userlist = this.$store.getters.getUser(2); let userlist = this.$store.getters.getUser(2);
}, },
async fetch({ async fetch({ store, params }) {
store,
params
}) {
await store.dispatch("loadDictionary"); // 加载数据字典 await store.dispatch("loadDictionary"); // 加载数据字典
}, },
mounted() { mounted() {
...@@ -219,15 +273,15 @@ export default { ...@@ -219,15 +273,15 @@ export default {
dispatchStatus: status, dispatchStatus: status,
mesCode: mesCode, mesCode: mesCode,
productName: productName, productName: productName,
drawnNumber: drawnNumber drawnNumber: drawnNumber,
} },
}); });
}, },
tdStyle(val) { tdStyle(val) {
//动态根据状态值加载状态值对应的颜色 //动态根据状态值加载状态值对应的颜色
let temDic = this.$store.getters.dictionaryByKey("taskList.status"); let temDic = this.$store.getters.dictionaryByKey("taskList.status");
let temColor = "#666"; let temColor = "#666";
temDic.forEach(data => { temDic.forEach((data) => {
if (Number(data.code) == val) { if (Number(data.code) == val) {
temColor = data.color; temColor = data.color;
} }
...@@ -293,8 +347,8 @@ export default { ...@@ -293,8 +347,8 @@ export default {
l(key) { l(key) {
let vkey = "order_list" + "." + key; let vkey = "order_list" + "." + key;
return this.$t(vkey) || key; return this.$t(vkey) || key;
} },
} },
}; };
</script> </script>
...@@ -336,7 +390,16 @@ export default { ...@@ -336,7 +390,16 @@ export default {
.panel-text { .panel-text {
padding: 5px 8px; padding: 5px 8px;
.img-i {
width: 120px;
height: 120px;
overflow: hidden;
border: #cacbd0 dashed 1px;
img {
// width: 90px;
// height: 90px;
}
}
.row { .row {
color: #666666; color: #666666;
padding-left: 10px; padding-left: 10px;
......
...@@ -40,7 +40,9 @@ ...@@ -40,7 +40,9 @@
<Row class="row-down" :gutter="10"> <Row class="row-down" :gutter="10">
<Col span="7"> <Col span="7">
<div class="img-i"> <div class="img-i">
<img :src="downUrl +row.productUrl" onerror="this.src='/imgicon/noPic_product.png';"/> <img :src="downUrl +row.productUrl" v-if="row.productUrl" />
<!-- onerror="this.src='/imgicon/chan_Pin.png'" -->
<img src="@/assets/imgicon/chan_Pin.png" v-else width="100%" height="100%" />
</div> </div>
</Col> </Col>
<Col span="17" class="c"> <Col span="17" class="c">
...@@ -84,20 +86,20 @@ import Search from "./search"; ...@@ -84,20 +86,20 @@ import Search from "./search";
export default { export default {
name: "list", name: "list",
components: { components: {
Search Search,
}, },
head: { head: {
title: "", title: "",
author: "henq", author: "henq",
description: "product_info 5/20/2020 3:13:51 PM" description: "product_info 5/20/2020 3:13:51 PM",
}, },
props: { props: {
parent: { parent: {
id: Number, id: Number,
parentName: String, parentName: String,
ids: String, ids: String,
bomId: Number bomId: Number,
} },
}, },
data() { data() {
return { return {
...@@ -106,7 +108,7 @@ export default { ...@@ -106,7 +108,7 @@ export default {
easySearch: { easySearch: {
keys: { op: "mmcode,name", value: null }, keys: { op: "mmcode,name", value: null },
levelId: { op: "In", value: this.id }, levelId: { op: "In", value: this.id },
upId: { op: "In", value: 0 } upId: { op: "In", value: 0 },
}, },
modal: false, modal: false,
title: "新增", title: "新增",
...@@ -119,19 +121,19 @@ export default { ...@@ -119,19 +121,19 @@ export default {
title: this.$t("id"), title: this.$t("id"),
hide: true, hide: true,
align: "left", align: "left",
high: true high: true,
}, },
{ {
title: this.l("name"), title: this.l("name"),
key: "name", key: "name",
align: "left" align: "left",
}, },
{ {
key: "mmcode", key: "mmcode",
title: this.l("mmcode"), title: this.l("mmcode"),
align: "center", align: "center",
high: true high: true,
}, },
{ {
key: "productUrl", key: "productUrl",
...@@ -144,39 +146,39 @@ export default { ...@@ -144,39 +146,39 @@ export default {
"a", "a",
{ {
attrs: { attrs: {
oprate: "detail" oprate: "detail",
// href: this.fileUrlPath, // href: this.fileUrlPath,
// target: "_blank" // target: "_blank"
}, },
on: { on: {
click: () => { click: () => {
this.downFile(params.row.productUrl); this.downFile(params.row.productUrl);
} },
} },
}, },
"查看图片" "查看图片"
) ),
]); ]);
} },
}, },
{ {
key: "levelTitle", key: "levelTitle",
title: this.l("levelTitle"), title: this.l("levelTitle"),
align: "left", align: "left",
high: true high: true,
}, },
{ {
key: "drawingNo", key: "drawingNo",
title: this.l("drawingNo"), title: this.l("drawingNo"),
align: "right", align: "right",
high: true high: true,
}, },
{ {
key: "madeCompanyTitle", key: "madeCompanyTitle",
title: this.l("madeCompanyTitle"), title: this.l("madeCompanyTitle"),
align: "center", align: "center",
width: 260, width: 260,
high: true high: true,
}, },
{ {
title: "操作", title: "操作",
...@@ -190,8 +192,8 @@ export default { ...@@ -190,8 +192,8 @@ export default {
{ {
attrs: { oprate: "edit" }, attrs: { oprate: "edit" },
on: { on: {
click: () => this.bom(params.row) click: () => this.bom(params.row),
} },
}, },
"BOM" "BOM"
), ),
...@@ -200,8 +202,8 @@ export default { ...@@ -200,8 +202,8 @@ export default {
{ {
attrs: { oprate: "edit" }, attrs: { oprate: "edit" },
on: { on: {
click: () => this.edit(params.row) click: () => this.edit(params.row),
} },
}, },
"编辑" "编辑"
), ),
...@@ -209,7 +211,7 @@ export default { ...@@ -209,7 +211,7 @@ export default {
"op", "op",
{ {
attrs: { oprate: "delete" }, attrs: { oprate: "delete" },
on: { click: () => this.remove(params.row) } on: { click: () => this.remove(params.row) },
}, },
"删除" "删除"
), ),
...@@ -218,18 +220,18 @@ export default { ...@@ -218,18 +220,18 @@ export default {
{ {
attrs: { oprate: "view" }, attrs: { oprate: "view" },
on: { on: {
click: () => this.view(params.row) click: () => this.view(params.row),
} },
}, },
"详情" "详情"
) ),
]); ]);
} },
} },
], ],
typeInfo: "card", typeInfo: "card",
iconInfo: "md-apps", iconInfo: "md-apps",
titleInfo: "卡片模式" titleInfo: "卡片模式",
}; };
}, },
mounted() { mounted() {
...@@ -314,8 +316,7 @@ export default { ...@@ -314,8 +316,7 @@ export default {
this.fullscreen = true; this.fullscreen = true;
}, },
remove(row) { remove(row) {
Api.delete(row.bomId).then((r) => {
Api.delete(row.bomId).then(r => {
if (r.success) { if (r.success) {
this.$refs.grid.load(); this.$refs.grid.load();
this.$Message.success("删除成功"); this.$Message.success("删除成功");
...@@ -329,19 +330,19 @@ export default { ...@@ -329,19 +330,19 @@ export default {
l(key) { l(key) {
let vkey = "product_info" + "." + key; let vkey = "product_info" + "." + key;
return this.$t(vkey) || key; return this.$t(vkey) || key;
} },
}, },
watch: { watch: {
"parent.id"(v) { "parent.id"(v) {
if (v) { if (v) {
let data = { let data = {
levelId: { op: "In", value: this.parent.ids }, levelId: { op: "In", value: this.parent.ids },
upId: { op: "In", value: 0 } upId: { op: "In", value: 0 },
}; };
this.$refs.grid.reload(data); this.$refs.grid.reload(data);
} }
} },
} },
}; };
</script> </script>
<style lang="less"> <style lang="less">
...@@ -369,7 +370,7 @@ export default { ...@@ -369,7 +370,7 @@ export default {
height: 90px; height: 90px;
margin-right: 15px; margin-right: 15px;
// overflow: hidden; // overflow: hidden;
img{ img {
width: 90px; width: 90px;
height: 90px; height: 90px;
} }
......
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