info.vue
2.41 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
<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="print">打印</Button>
<Button @click="back">返回入库物流列表</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';
import {info} from './store';
export default {
props: ['id'],
created() {
this.expressService = new ExpressService();
},
data() {
return info.call(this);
},
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>