<!--
 * @Author: Fly
 * @Date: 2025-12-17 14:17:40
 * @LastEditTime: 2025-12-17 14:59:28
 * @Description: 
-->
<template>
    <Drawer :title="DrawerTitle" :visible.sync="DrawerVisible" :showFooter="true" :skeleton="skeletonLoading"
        :wrapperClosable="true" :size="$drawerWidth(800)">
        <el-table v-loading="loading" ref="multipleTableRef" :border="TableBorder" :size="ELTableSize" :data="dataList">
            <el-table-column type="index" width="55" label="序号" align="center">
                <template slot-scope="{$index}">
                    {{ $getTableIndex(queryParams, $index + 1) }}
                </template>
            </el-table-column>
            <template v-for="item in TableColumn">
                <el-table-column :label="item.label" :align="item.align || 'center'" :width="item.width">
                    <template slot-scope="{row}">
                        {{ (item.formatter ? item.formatter(row) : row[item.prop]) | TableItemEmpty }}
                    </template>
                </el-table-column>
            </template>
            <el-table-column label="操作" align="center" width="120">
                <template slot-scope="{row}">
                    <el-button type="text" :size="ELTableSize" @click="$emit('callback', row); DrawerVisible = false;">选择</el-button>
                </template>
            </el-table-column>
        </el-table>
        <pagination v-show="total > 0" :total="total" :page.sync="queryParams.pageNum"
            :limit.sync="queryParams.pageSize" @pagination="getList" />


        <template v-slot:footer>
            <el-button :size="ELsize" @click.stop="DrawerVisible = false">取消</el-button>
        </template>
    </Drawer>
</template>

<script>
import { getChainBusinessPageApi } from "@/api/shop.js"
import { getBusinessDayBillPageApi, getBusinessDayBillStatisticsApi } from "@/api/financeManage";
import getListApi from "@/mixins/getListApi";
export default {
    name: '',
    mixins: [getListApi],
    data() {
        return {
            DrawerTitle: '选择迁移店铺',
            DrawerVisible: false,
            skeletonLoading: false,

            listURL: getChainBusinessPageApi,
            tableRowKey: 'queueId',
            isSelecPage: true,
            queryParams: {
                pageNum: 1,
                pageSize: 10,
                // currentBusinessId: undefined,
            },
            initializationShow: false,
            TableColumn: [
                {
                    label: '店铺信息',
                    prop: 'businessName',
                    // width: 180
                },
                {
                    label: '店铺所在区域',
                    prop: 'address'
                }
            ],

        };
    },
    created() {
        // setTimeout(() => {
        //     this.openHandle({ businessId: 21, businessName: "总部国际专卖店" })
        // }, 2000);
    },

    methods: {
        async openHandle(row) {
            console.log('openHandle === ', row);
            this.DrawerVisible = true;
            const { businessId, businessName } = row;
            // this.queryParams.currentBusinessId = businessId;
            this.handleQuery();
        },
    },
};
</script>