info.vue
4.59 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
<template>
<layout-body>
<div class="order-info">
<div>物流单号:<span>{{id}}</span> 发货时间:<span>{{sendTime || '-'}}</span></div>
<div>发往:<span>{{storeroomName || '-'}} {{address || '-'}} {{adminName || '-'}} </span></div>
</div>
<layout-action>
<Button type="primary" @click="back">返回入库物流列表</Button>
<Button type="primary" @click="print">打印</Button>
</layout-action>
<layout-list>
<Table border :columns="tableCols" :data="tableData"></Table>
</layout-list>
</layout-body>
</template>
<script>
import ExpressService from 'services/repository/express-service';
import moment from 'moment';
import _ from 'lodash';
export default {
props: ['id'],
created() {
this.expressService = new ExpressService();
},
data() {
return {
tableCols: [
{
title: 'sku',
key: 'sku',
align: 'center'
},
{
title: '条码',
key: 'skuFactoryCode',
align: 'center'
},
{
title: '商品图片',
align: 'center',
render: (h, params) => {
let directives = [
{name: 'prod-img', value: params.row.skn, modifiers: {skn: true}}
];
return (
<div>
<img {...{directives}}></img>
</div>
);
}
},
{
title: '商品名称',
key: 'productName',
align: 'center'
},
{
title: '规格',
align: 'center',
render: (h, params) => {
return (
<div>{params.row.colorName}/{params.row.size}</div>
);
}
},
{
title: '订单号/已发数',
align: 'center',
render: (h, params) => {
return (
<div>{params.row.boList.map((i) => {
return (
<div>{i.proRequisitionFormId}/{i.num}</div>
);
})}</div>
);
}
}
],
tableData: [],
id: null,
time: null,
storeroomName: null,
address: null,
adminName: null
};
},
mounted() {
this.id = this.$route.params.id;
this.time = this.$route.query.time;
this.getExpress(this.id);
},
computed: {
sendTime() {
return moment.unix(this.time).format('YYYY-MM-DD HH:mm:ss');
}
},
methods: {
getExpress(id) {
return this.expressService.show({expressNumber: id}).then((result) => {
if (result.code === 200) {
this.tableData = result.data;
this.storeroomName = _.first(this.tableData || {}).storeroomName;
this.address = _.first(this.tableData || {}).address;
this.adminName = _.first(this.tableData || {}).adminName;
}
});
},
back() {
this.$router.push({
name: 'repository.express.list'
});
},
print() {
const href = `/trade/printDetail.html?expressNo=${this.id}`;
window.open(href, '_blank');
}
}
};
</script>
<style lang="scss" scoped>
.order-info {
div {
display: block;
margin-bottom: 10px;
}
span {
padding: 5px;
color: #f00;
background-color: #f9f3f5;
border-radius: 2px;
margin-right: 5px;
}
}
</style>