express-detail.vue
4.29 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
<template>
<layout-body>
<div class="detail-header">
<Button type="primary" @click="backExpList">返回发货物流表</Button>
<Button type="primary" @click="print">打印</Button>
<span class="no">物流单号:{{expressNo}}</span>
<span class="time">发货时间:{{expressTime}}</span>
</div>
<layout-list>
<Table border :columns="table.cols" :data="table.list"></Table>
</layout-list>
</layout-body>
</template>
<script>
import moment from 'moment';
import TradeService from 'services/trade/trade-service';
export default {
data() {
return {
table: {
cols: [
{
title: 'sku',
key: 'sku',
align: 'center'
}, {
title: '条码',
key: 'skuFactoryCode',
align: 'center'
}, {
title: '商品图片',
align: 'center',
render: (h, params) => {
const row = params.row;
const directives = [
{ name: 'prod-img', value: row.sku, modifiers: { sku: true } }
];
return (
<div>
<img {...{ directives }}></img>
</div>
);
}
}, {
title: '商品名称',
key: 'productName',
align: 'center'
}, {
title: '规格',
align: 'center',
render(h, params) {
const row = params.row;
return (
<span>{row.colorName || ''}/{row.size}</span>
);
}
}, {
title: '调拨单号/已发数',
align: 'center',
render(h, params) {
const row = params.row;
return (
<div>
{row.boList.map(item => {
return <p>{item.proRequisitionFormId}/{item.num}</p>;
})}
</div>
);
}
}
],
list: []
},
expressNo: 0,
expressTime: ''
};
},
created() {
this.tradeService = new TradeService();
this.expressNo = this.$route.query.expressNo;
this.expressDetail();
},
methods: {
print() {
const href = `/trade/printDetail.html?expressNo=${this.expressNo}`;
window.open(href, '_blank');
},
backExpList() {
this.$router.push({
name: 'trade.allot.express'
});
},
expressDetail() {
this.tradeService.allotExpressDetail(this.expressNo)
.then(res => {
this.resolveData(res.data);
});
},
resolveData(data) {
const fmt = 'YYYY-MM-DD HH:mm:ss';
this.table.list = data;
this.expressTime = '-';
if (data.length) {
this.expressTime = moment.unix(data[0].createTime).format(fmt);
}
}
},
components: {
}
};
</script>
<style lang="scss" scoped>
.detail-header {
margin-bottom: 20px;
.no,
.time {
margin-left: 10px;
}
}
</style>