express-detail.vue
3.46 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
<template>
<LayoutBody>
<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>
<LayoutList>
<Table border :columns="table.cols" :data="table.list"></Table>
</LayoutList>
</LayoutBody>
</template>
<script>
import _ from 'lodash';
import moment from 'moment';
import service from 'trade-service';
export default {
data() {
return {
table: {
cols: [
{
title: 'sku',
key: 'sku',
align: 'center'
}, {
title: '条码',
key: 'skuFactoryCode',
align: 'center'
}, {
title: '商品图片',
align: 'center',
render() {
return `<div>
<img v-prod-img.sku="row.sku">
</div>`;
}
}, {
title: '商品名称',
key: 'productName',
align: 'center'
}, {
title: '规格',
align: 'center',
render(row) {
return `${row.colorName || ''}/${row.size}`;
}
}, {
title: '调拨单号/已发数',
align: 'center',
render(row) {
let $html = '';
_.each(row.boList, i => {
$html += `<p>${i.proRequisitionFormId}/${i.num}</p>`;
});
return $html;
}
}
],
list: []
},
expressNo: 0,
expressTime: ''
};
},
created() {
this.expressNo = this.$route.query.expressNo;
this.expressDetail();
},
methods: {
print(){
window.print();
},
backExpList() {
this.$router.push({
name: 'trade.allot.express'
});
},
expressDetail() {
service.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 = moment.unix(data[0].createTime).format(fmt);
}
},
components: {
}
};
</script>
<style lang="scss" scoped>
.detail-header {
margin-bottom: 20px;
.no,
.time {
margin-left: 10px;
}
}
</style>