<template>
    <order-page
        ref="pageRef"
        :pageConfig="pageConfig"
        permissionKey="awaitPickup"
    >
        <template #toolbar>
            <el-button
                type="danger"
                plain
                v-permission="'recycleOrder:awaitPickup:batchCancel'"
                @click="handleBatchCancel"
            >
                批量取消订单
            </el-button>
        </template>
    </order-page>
</template>

<script setup>
    import { ref, reactive } from 'vue';
    import { ElMessageBox } from 'element-plus/es';
    import OrderPage from '@/views/recycleOrder/components/order-page-all.vue';
    import { useRouter } from 'vue-router';

    defineOptions({ name: 'RecycleOrderawaitPickup' });

    let router = useRouter();
    /** 页面组件实例 */
    const pageRef = ref(null);

    const pageConfig = reactive({
        pageUrl: '/order/orderInfo/pickUp/pageList',
        exportUrl: '/order/orderInfo/pickUp/export',
        fileName: '待取件订单',
        cacheKey: 'awaitPickupTable'
    });

    //批量取消订单
    function handleBatchCancel() {
        pageRef.value?.operatBatch({
            title: '确认批量取消订单？',
            url: '/recycleOrder/batchAudit'
        });
    }
</script>
