allot-deliver.vue 1.28 KB
<template>
    <modal-deliver
        ref="modalDeliver"
        :expresses="expresses"
        :store-info="storeInfo"
        @deliver="deliver">
    </modal-deliver>
</template>

<script>
    import TrageService from 'services/trade/trade-service';

    export default {
        name: 'allot-deliver',
        created() {
            this.tradeService = new TrageService();
        },
        data() {
            return {
                expresses: [],
                storeInfo: {}
            };
        },
        methods: {
            show() {
                this.tradeService.allotExpressCompList().then(res => {
                    this.expresses = res.data;
                });
                this.tradeService.allotWarehouseInfo().then(res => {
                    this.storeInfo = {
                        storeName: res.data.storehouseName,
                        address: res.data.address,
                        adminName: res.data.adminName,
                        phone: res.data.phone
                    };
                });
                this.$refs.modalDeliver.show();
            },
            hide() {
                this.$refs.modalDeliver.hide();
            },
            deliver(data) {
                this.$emit('deliver', data);
            }
        }
    };
</script>