order-info.vue 1.95 KB
<template>
    <div v-if="data" class="order-info">
        <div>单号:<span>{{this.data.id}} </span>&nbsp;|&nbsp; 发往:<span>{{this.data.storeroomName || '-'}} &nbsp; {{this.data.address || '-'}} &nbsp;{{this.data.adminName || '-'}}</span></div>
        <div>品牌:<span>{{this.data.brandName || '-'}}</span>
            &nbsp;|&nbsp;  店铺:<span>{{this.data.shopName || '-'}}</span>
            &nbsp;|&nbsp;  供应商:<span>{{this.data.supplierName || '-'}}</span>
            &nbsp;|&nbsp;  进项税率:<span>{{this.data.inputTaxRate || '-'}}</span>
            &nbsp;|&nbsp;  数量:<span>{{this.data.totalNum || '-'}}</span>
            &nbsp;|&nbsp;  总吊牌金额:<span>{{this.data.totalRetailPrice || '-'}}</span>
            &nbsp;|&nbsp;  总进货金额:<span>{{this.data.totalPurchasePrice || '-'}}</span>
        </div>
    </div>
</template>

<script>
    import InvoiceService from 'services/repository/invoice-service';

    export default {
        name: 'order-info',
        props: ['id'],
        created() {
            this.invoiceService = new InvoiceService();
        },
        data() {
            return {
                data: null
            };
        },
        mounted() {
            this.getOrderInfo();
        },
        methods: {
            getOrderInfo() {
                return this.invoiceService.orderInfo(this.id).then((result) =>{
                    if (result.code === 200) {
                        this.data = result.data;
                        this.$emit('on-change', this.data);
                    }
                });
            },
            refresh() {
                this.getOrderInfo();
            }
        }
    };
</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>