RelocationPage.vue 2.16 KB
<template>
    <a-card class="tabs-card" :tab-list="tabList" :active-tab-key="activeKey" @tabChange="key => onTabChange(key )" :bordered="false">
        <maintain-vehicle-page v-if="activeKey === 'maintainVenue'"></maintain-vehicle-page>
        <confirm-vehicle-page v-else-if="activeKey === 'confirmVenue'"></confirm-vehicle-page>
        <warehousing-page v-else-if="activeKey === 'warehousing'"></warehousing-page>
        <outbound-page v-else-if="activeKey === 'outbound'"></outbound-page>
        <template #tabBarExtraContent>
        </template>
    </a-card>
</template>
<script lang="ts">
import {Component, Vue} from 'vue-facing-decorator';
import WarehousingPage from "@/views/venue/relocation/warehousing/WarehousingPage.vue";
import OutboundPage from "@/views/venue/relocation/outbound/OutboundPage.vue";
import MaintainVehiclePage from "@/views/venue/relocation/maintain/MaintainVehiclePage.vue";
import ConfirmVehiclePage from "@/views/venue/relocation/confirm/ConfirmVehiclePage.vue";
import {Security} from "@/store";

@Component({
    components: {ConfirmVehiclePage, MaintainVehiclePage, OutboundPage, WarehousingPage}
})
export default class RelocationPage extends Vue {
    tabList = [];
    activeKey = '';

    @Security.Getter hasPrivilege;

    created(): void {
        if (this.hasPrivilege('relocation_1')) this.tabList.push({key: 'maintainVenue', tab: '待确认场地'});
        if (this.hasPrivilege('relocation_2')) this.tabList.push({key: 'confirmVenue', tab: '已确认场地'});
        if (this.hasPrivilege('relocation_3')) this.tabList.push({key: 'warehousing', tab: '入库记录'});
        if (this.hasPrivilege('relocation_4')) this.tabList.push({key: 'outbound', tab: '出库记录'});
        if (this.tabList.length > 0) this.activeKey = this.tabList[0].key;

        if (this.$route.query.venueId) {
            this.activeKey = 'confirmVenue';
            // this.pagination.queryForm.venueId = this.$route.query.venueId;
            // this.vehicleStateIndex = "0";
            // this.changeTab(this.vehicleStateIndex);
        }
    }

    onTabChange(value: string) {
        this.activeKey = value;
    }
}
</script>


<style scoped lang="less">

</style>