<template>
    <order-page
        ref="pageRef"
        :pageConfig="pageConfig"
        permissionKey="awaitDelivery"
    >
        <template #toolbar>
            <el-button
                type="success"
                plain
                v-permission="'recycleOrder:awaitDelivery:batchReceive'"
                @click="handleBatchReceive()"
            >
                批量确认收货
            </el-button>
        </template>
    </order-page>
</template>

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

    defineOptions({ name: 'RecycleOrderawaitDelivery' });

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

    const pageConfig = reactive({
        pageUrl: '/order/orderInfo/received/pageList',
        exportUrl: '/order/orderInfo/received/export',
        fileName: '待签收订单',
        cacheKey: 'awaitDeliveryTable'
    });

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