order-info.vue
2.37 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>
<Table border :columns="columns" :data="dataList" :show-header="false"></Table>
<handle-area :other-info="otherInfo" :work-id="workOrderId"></handle-area>
</layout-body>
</template>
<script>
import _ from 'lodash';
import HandleArea from './handle-area';
import {DiffService} from 'services/repository';
export default {
props: {
id: {
type: Number
}
},
data() {
return {
columns: [{
width: 200,
align: 'right',
key: 'label'
}, {
key: 'value',
className: 'value-column'
}],
dataList: [],
workOrderId: 0,
otherInfo: {}
};
},
created() {
this.diffService = new DiffService();
this.$Loading.start();
this.workOrderId = +this.id;
this.diffService.detail({id: this.workOrderId})
.then(res => {
const data = res.data;
let fields = [{
label: '主题:',
value: 'subject'
}, {
label: '分类:',
value: 'typeName'
}, {
label: '到货单号:',
value: 'orderNumber'
}, {
label: '紧急程度:',
value: 'emergencyDegreeName'
}, {
label: '品牌:',
value: 'brandName'
}, {
label: '描述:',
value: 'content'
}];
_.each(fields, item => {
item.value = data[item.value] || '-';
});
this.dataList = fields;
this.otherInfo = data.workOrderOrtherInfoBo || {};
this.$Loading.finish();
});
},
methods: {
},
components: {
HandleArea
}
};
</script>
<style lang="scss">
.value-column {
img {
max-width: 400px;
}
}
</style>