<!--
 * @Author: Fly
 * @Date: 2025-12-10 16:44:11
 * @LastEditTime: 2025-12-20 14:14:28
 * @Description: 
-->
<template>
    <Drawer title="查看" :visible.sync="DrawerVisible" :showFooter="true" :skeleton="skeletonLoading"
        :wrapperClosable="true" :size="$drawerWidth(800)">
        <el-form ref="form" label-width="120px">
            <!-- <div class="form-headline">支付信息</div> -->
            <el-row class="form-content">
                <el-col :span="24">
                    <el-form-item label="代理级别：">{{ FormData.agentLevel | AgentLevelOptionFilter | TableItemEmpty
                        }}</el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="真实姓名：">{{ FormData.realName | TableItemEmpty }}</el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="联系方式：">{{ FormData.phone | TableItemEmpty }}</el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="身份证号：">{{ FormData.idCard | TableItemEmpty }}</el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="性别：">
                        <dict-tag :options="dict.type.sys_user_sex" :value="FormData.gender" />
                    </el-form-item>
                </el-col>
                <el-col :span="12">
                    <el-form-item label="所属区域：">{{ FormData.provinceName | TableItemEmpty }}</el-form-item>
                </el-col>
                <el-col :span="24" v-if="FormData.agentLevel === AgentLevelEnum.LEVEL_2">
                    <el-form-item label="上级代理：">{{ FormData.parentAgentName | TableItemEmpty }} ({{
                        FormData.parentAgentPhone | TableItemEmpty }})</el-form-item>
                </el-col>

            </el-row>


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

<script>
import { agentInfo } from "@/api/agentManage/agentList";
import { AgentLevelEnum } from "@/utils/statusEnum";
export default {
    name: '',
    dicts: ['sys_user_sex'],
    data() {
        return {
            AgentLevelEnum,
            DrawerVisible: false,
            skeletonLoading: false,
            FormData: {}
        };
    },
    created() {
        // setTimeout(() => {
        //     this.openHandle({ agentId: 22 })
        // }, 100);
    },

    methods: {
        async openHandle(row) {
            this.DrawerVisible = true;
            const { agentId } = row || {};
            this.skeletonLoading = true;
            let V_ = null;
            try {
                if (agentId) {
                    const { data } = await agentInfo(agentId);
                    V_ = data;
                }
            } catch { }

            this.FormData = V_ || row || {};
            this.skeletonLoading = false;
        },

    },
};
</script>