Blame view

app/pages/repository/diff/components/order-info.vue 1.77 KB
李奇 authored
1 2
<template>
    <layout-body>
李奇 authored
3
        <Table border :columns="columns" :data="dataList" :show-header="false"></Table>
李奇 authored
4 5 6 7
    </layout-body>
</template>

<script>
李奇 authored
8 9 10
    import _ from 'lodash';
    import {DiffService} from 'services/repository';
李奇 authored
11 12
    export default {
        props: {
李奇 authored
13 14
            id: {
                type: Number
李奇 authored
15 16
            }
        },
李奇 authored
17 18 19 20 21 22 23 24 25 26 27 28
        data() {
            return {
                columns: [{
                    width: 200,
                    align: 'right',
                    key: 'label'
                }, {
                    key: 'value'
                }],
                dataList: []
            };
        },
李奇 authored
29
        created() {
李奇 authored
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
            this.diffService = new DiffService();
            this.diffService.detail({id: this.id})
                .then(res => {
                    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 = res.data[item.value] || '-';
                    });
李奇 authored
56
李奇 authored
57 58
                    this.dataList = fields;
                });
李奇 authored
59 60 61 62 63 64 65 66
        },
        methods: {
        }
    };
</script>

<style lang="scss">
</style>