<template>
    <div>
        <el-card class="box-card" shadow="hover" style="margin-bottom: 10px">
            <div style="margin: 12px 0">汇付会员</div>
            <div style="margin: 12px 0" v-if="ruleForm.nickname == ''">
                没有查询到汇付会员配置，请点击按钮创建汇付会员
                <!-- 刷新按钮 -->
                <el-button
                    size="medium"
                    type="primary"
                    @click="openCreateAdapayMember = true"
                >
                    创建汇付会员
                </el-button>
            </div>
            <el-descriptions v-else :column="2">
                <el-descriptions-item label="会员昵称">{{
                    ruleForm.nickname
                }}</el-descriptions-item>
                <el-descriptions-item label="会员邮箱">{{
                    ruleForm.email
                }}</el-descriptions-item>
                <el-descriptions-item label="会员性别">{{
                    ruleForm.gender === "FEMALE" ? "女" : "男"
                }}</el-descriptions-item>
                <el-descriptions-item label="会员地址">{{
                    ruleForm.location
                }}</el-descriptions-item>
            </el-descriptions>
        </el-card>

        <el-card class="box-card" shadow="hover">
            <div style="margin: 12px 0">汇付结算账户</div>
            <div style="margin: 12px 0" v-if="ruleForm.nickname !== ''">
                没有查询到汇付结算账户配置，请点击按钮创建汇付结算账户
                <!-- 刷新按钮 -->
                <el-button
                    size="medium"
                    type="primary"
                    @click="openCreateAdapaySettleAccount = true"
                >
                    创建汇付结算账户
                </el-button>
            </div>
            <el-form
                :model="ruleForm"
                :rules="rules"
                ref="ruleForm"
                label-width="250px"
                class="demo-ruleForm"
                v-else
            >
                <el-form-item label="银行账户类型" prop="bank_acct_type">
                    <el-radio-group v-model="ruleForm.bank_acct_type">
                        <el-radio label="1">对公</el-radio>
                        <el-radio label="2">对私</el-radio>
                    </el-radio-group>
                </el-form-item>

                <el-form-item label="银行卡号" prop="card_id">
                    <el-input v-model="ruleForm.card_id"></el-input>
                </el-form-item>
                <el-form-item label="银行卡对应的户名" prop="card_name">
                    <el-input v-model="ruleForm.card_name"></el-input>
                </el-form-item>
                <el-form-item
                    label="证件号"
                    prop="cert_id"
                    :rules="
                        ruleForm.bank_acct_type === '2'
                            ? rules.cert_id
                            : [{ required: false }]
                    "
                >
                    <el-input v-model="ruleForm.cert_id"></el-input>
                </el-form-item>

                <el-form-item
                    label="证件类型"
                    prop="cert_type"
                    :rules="
                        ruleForm.bank_acct_type === '2'
                            ? rules.cert_type
                            : [{ required: false }]
                    "
                >
                    <el-input v-model="ruleForm.cert_type"></el-input>
                </el-form-item>
                <el-form-item label="手机号" prop="tel_no">
                    <el-input v-model="ruleForm.tel_no"></el-input>
                </el-form-item>
                <el-form-item
                    label="银行编码"
                    prop="bank_code"
                    :rules="
                        ruleForm.bank_acct_type === '1'
                            ? rules.bank_code
                            : [{ required: false }]
                    "
                >
                    <el-input v-model="ruleForm.bank_code"></el-input>
                </el-form-item>
                <el-form-item label="开户银行名称" prop="bank_name">
                    <el-input v-model="ruleForm.bank_name"></el-input>
                </el-form-item>
                <el-form-item
                    label="银行账户开户银行所在省份编码"
                    prop="prov_code"
                    :rules="
                        ruleForm.bank_acct_type === '1'
                            ? rules.prov_code
                            : [{ required: false }]
                    "
                >
                    <el-cascader
                        v-model="value"
                        :options="options"
                        @change="handleChange"
                    ></el-cascader>
                    <!-- <el-input v-model="ruleForm.prov_code"></el-input> -->
                </el-form-item>
                <!-- <el-form-item
                    label="银行账户开户银行所在地区编码"
                    prop="area_code"
                    :rules="
                        ruleForm.bank_acct_type === '1'
                            ? rules.area_code
                            : [{ required: false }]
                    "
                >
                    <el-input v-model="ruleForm.area_code"></el-input>
                </el-form-item> -->
                <el-form-item>
                    <el-button type="primary" @click="submitForm('ruleForm')"
                        >提交</el-button
                    >
                </el-form-item>
            </el-form>
        </el-card>

        <el-dialog
            title="创建汇付会员"
            :visible.sync="openCreateAdapayMember"
            width="150"
            append-to-body
        >
            <el-form
                :model="ruleForm"
                :rules="rules"
                ref="ruleForm"
                label-width="250px"
                class="demo-ruleForm"
            >
                <el-form-item label="会员昵称" prop="nickname">
                    <el-input v-model="ruleForm.nickname"></el-input>
                </el-form-item>
                <el-form-item label="会员邮箱" prop="email">
                    <el-input v-model="ruleForm.email"></el-input>
                </el-form-item>
                <el-form-item label="会员性别" prop="gender">
                    <el-radio-group v-model="ruleForm.gender">
                        <el-radio label="MALE">男</el-radio>
                        <el-radio label="FEMALE">女</el-radio>
                    </el-radio-group>
                </el-form-item>
                <el-form-item label="会员地址" prop="location">
                    <!-- type="textarea" -->
                    <el-input v-model="ruleForm.location"></el-input>
                </el-form-item>

                <el-form-item>
                    <el-button type="primary" @click="submitForm('ruleForm')"
                        >提交</el-button
                    >
                </el-form-item>
            </el-form>
        </el-dialog>

        <el-dialog
            title="创建汇付结算账户"
            :visible.sync="openCreateAdapaySettleAccount"
            width="150"
            append-to-body
        >
            <el-form
                :model="ruleForm"
                :rules="rules"
                ref="ruleForm"
                label-width="250px"
                class="demo-ruleForm"
            >
                <el-form-item label="银行账户类型" prop="bank_acct_type">
                    <el-radio-group v-model="ruleForm.bank_acct_type">
                        <el-radio label="1">对公</el-radio>
                        <el-radio label="2">对私</el-radio>
                    </el-radio-group>
                </el-form-item>

                <el-form-item label="银行卡号" prop="card_id">
                    <el-input v-model="ruleForm.card_id"></el-input>
                </el-form-item>
                <el-form-item label="银行卡对应的户名" prop="card_name">
                    <el-input v-model="ruleForm.card_name"></el-input>
                </el-form-item>
                <el-form-item
                    label="证件号"
                    prop="cert_id"
                    :rules="
                        ruleForm.bank_acct_type === '2'
                            ? rules.cert_id
                            : [{ required: false }]
                    "
                >
                    <el-input v-model="ruleForm.cert_id"></el-input>
                </el-form-item>

                <el-form-item
                    label="证件类型"
                    prop="cert_type"
                    :rules="
                        ruleForm.bank_acct_type === '2'
                            ? rules.cert_type
                            : [{ required: false }]
                    "
                >
                    <el-input v-model="ruleForm.cert_type"></el-input>
                </el-form-item>
                <el-form-item label="手机号" prop="tel_no">
                    <el-input v-model="ruleForm.tel_no"></el-input>
                </el-form-item>
                <el-form-item
                    label="银行编码"
                    prop="bank_code"
                    :rules="
                        ruleForm.bank_acct_type === '1'
                            ? rules.bank_code
                            : [{ required: false }]
                    "
                >
                    <el-input v-model="ruleForm.bank_code"></el-input>
                </el-form-item>
                <el-form-item label="开户银行名称" prop="bank_name">
                    <el-input v-model="ruleForm.bank_name"></el-input>
                </el-form-item>
                <el-form-item
                    label="银行账户开户银行所在城市编码"
                    prop="prov_code"
                    :rules="
                        ruleForm.bank_acct_type === '1'
                            ? rules.prov_code
                            : [{ required: false }]
                    "
                >
                    <el-input v-model="ruleForm.prov_code"></el-input>
                </el-form-item>
                <el-form-item
                    label="银行账户开户银行所在地区编码"
                    prop="area_code"
                    :rules="
                        ruleForm.bank_acct_type === '1'
                            ? rules.area_code
                            : [{ required: false }]
                    "
                >
                    <el-input v-model="ruleForm.area_code"></el-input>
                </el-form-item>
                <el-form-item>
                    <el-button type="primary" @click="submitForm('ruleForm')"
                        >提交</el-button
                    >
                </el-form-item>
            </el-form>
        </el-dialog>
    </div>
</template>

<script>
import {
    selectAdapayMember,
    createAdapayMember,
} from "@/api/adapayMember/adapayMember";
export default {
    props: ["merchantId"],
    data() {
        return {
            // 汇付会员
            adapayMember: null,
            openCreateAdapayMember: false,
            // 汇付结算账户
            adapaySettleAccount: null,
            openCreateAdapaySettleAccount: false,
            ruleForm: {
                nickname: "",
                email: "",
                gender: "",
                location: "",
                card_id: "",
                card_name: "",
                cert_id: "",
                cert_type: "",
                tel_no: "",
                bank_code: "",
                bank_name: "",
                bank_acct_type: "",
                prov_code: "",
                area_code: "",
                merchantId: this.merchantId,
            },
            rules: {
                email: [
                    {
                        required: true,
                        message: "请填写会员邮箱",
                        trigger: "blur",
                    },
                    {
                        type: "email",
                        message: "请输入正确的邮箱地址",
                        trigger: "blur",
                    },
                ],
                gender: [
                    {
                        required: true,
                        message: "请选择会员性别",
                        trigger: "blur",
                    },
                ],
                location: [
                    {
                        required: true,
                        message: "请填写会员地址",
                        trigger: "blur",
                    },
                ],
                nickname: [
                    {
                        required: true,
                        message: "请填写会员昵称",
                        trigger: "blur",
                    },
                ],
                card_id: [
                    {
                        required: true,
                        message: "请填写银行卡号",
                        trigger: "blur",
                    },
                    {
                        pattern: /^[1-9]\d{9,29}$/,
                        message: "银行卡号格式有误",
                        trigger: "blur",
                    },
                ],
                card_name: [
                    {
                        required: true,
                        message: "请填写银行卡号对应的户名",
                        trigger: "blur",
                    },
                ],
                tel_no: [
                    {
                        required: true,
                        message: "请填写手机号",
                        trigger: "blur",
                    },
                    {
                        pattern: /^(?:(?:\+|00)86)?1\d{10}$/,
                        message: "手机号格式有误",
                        trigger: "blur",
                    },
                ],
                bank_acct_type: [
                    {
                        required: true,
                        message: "请选择银行账户类型",
                        trigger: "blur",
                    },
                ],
                area_code: [
                    {
                        required: true,
                        message: "银行账户开户银行所在地区编码",
                        trigger: "blur",
                    },
                ],
                prov_code: [
                    {
                        required: true,
                        message: "请填写银行账户开户银行所在省份编码",
                        trigger: "blur",
                    },
                ],
                cert_id: [
                    {
                        required: true,
                        message: "请填写证件号",
                        trigger: "blur",
                    },
                ],
                cert_type: [
                    {
                        required: true,
                        message: "请填写证件类型",
                        trigger: "blur",
                    },
                ],
                bank_code: [
                    {
                        required: true,
                        message: "请填写银行编码",
                        trigger: "blur",
                    },
                ],
            },
            value: [],
            options: [
                {
                    value: "0011",
                    label: "北京市",
                    children: [
                        {
                            value: "1100",
                            label: "北京市",
                        },
                    ],
                },
                {
                    value: "0012",
                    label: "天津市",
                    children: [
                        {
                            value: "1200",
                            label: "天津市",
                        },
                    ],
                },
                {
                    value: "0013",
                    label: "河北省",
                    children: [
                        {
                            value: "1301",
                            label: "石家庄",
                        },
                        {
                            value: "1302",
                            label: "保定",
                        },
                        {
                            value: "1303",
                            label: "沧州",
                        },
                        {
                            value: "1304",
                            label: "承德",
                        },
                        {
                            value: "1305",
                            label: "邯郸",
                        },
                        {
                            value: "1306",
                            label: "衡水",
                        },
                        {
                            value: "1307",
                            label: "廊坊",
                        },
                        {
                            value: "1308",
                            label: "秦皇岛",
                        },
                        {
                            value: "1309",
                            label: "唐山",
                        },
                        {
                            value: "1310",
                            label: "邢台",
                        },
                        {
                            value: "1311",
                            label: "张家口",
                        },
                    ],
                },
                {
                    value: "0014",
                    label: "山西省",
                    children: [
                        {
                            value: "1401",
                            label: "太原",
                        },
                        {
                            value: "1402",
                            label: "长治",
                        },
                        {
                            value: "1403",
                            label: "大同",
                        },
                        {
                            value: "1404",
                            label: "晋城",
                        },
                        {
                            value: "1405",
                            label: "离石",
                        },
                        {
                            value: "1406",
                            label: "临汾",
                        },
                        {
                            value: "1407",
                            label: "朔州",
                        },
                        {
                            value: "1408",
                            label: "忻州",
                        },
                        {
                            value: "1409",
                            label: "阳泉",
                        },
                        {
                            value: "1410",
                            label: "榆次",
                        },
                        {
                            value: "1411",
                            label: "运城",
                        },
                        {
                            value: "1412",
                            label: "晋中",
                        },
                        {
                            value: "1413",
                            label: "吕梁",
                        },
                    ],
                },
                {
                    value: "0015",
                    label: "内蒙古自治区",
                    children: [
                        {
                            value: "1501",
                            label: "呼和浩特",
                        },
                        {
                            value: "1502",
                            label: "包头",
                        },
                        {
                            value: "1503",
                            label: "阿拉善",
                        },
                        {
                            value: "1504",
                            label: "巴彦淖尔",
                        },
                        {
                            value: "1505",
                            label: "赤峰",
                        },
                        {
                            value: "1506",
                            label: "呼伦贝尔",
                        },
                        {
                            value: "1507",
                            label: "乌海",
                        },
                        {
                            value: "1508",
                            label: "乌兰察布",
                        },
                        {
                            value: "1509",
                            label: "锡林郭勒",
                        },
                        {
                            value: "1510",
                            label: "兴安",
                        },
                        {
                            value: "1511",
                            label: "鄂尔多斯",
                        },
                        {
                            value: "1512",
                            label: "通辽",
                        },
                        {
                            value: "1513",
                            label: "满洲里",
                        },
                    ],
                },
                {
                    value: "0021",
                    label: "辽宁省",
                    children: [
                        {
                            value: "2101",
                            label: "沈阳",
                        },
                        {
                            value: "2102",
                            label: "大连",
                        },
                        {
                            value: "2103",
                            label: "鞍山",
                        },
                        {
                            value: "2104",
                            label: "本溪",
                        },
                        {
                            value: "2105",
                            label: "朝阳",
                        },
                        {
                            value: "2106",
                            label: "丹东",
                        },
                        {
                            value: "2107",
                            label: "抚顺",
                        },
                        {
                            value: "2108",
                            label: "阜新",
                        },
                        {
                            value: "2109",
                            label: "葫芦岛",
                        },
                        {
                            value: "2110",
                            label: "锦州",
                        },
                        {
                            value: "2111",
                            label: "辽阳",
                        },
                        {
                            value: "2112",
                            label: "盘锦",
                        },
                        {
                            value: "2113",
                            label: "铁岭",
                        },
                        {
                            value: "2114",
                            label: "营口",
                        },
                    ],
                },
                {
                    value: "0022",
                    label: "吉林省",
                    children: [
                        {
                            value: "2201",
                            label: "长春",
                        },
                        {
                            value: "2202",
                            label: "白城",
                        },
                        {
                            value: "2203",
                            label: "白山",
                        },
                        {
                            value: "2204",
                            label: "吉林",
                        },
                        {
                            value: "2205",
                            label: "辽源",
                        },
                        {
                            value: "2206",
                            label: "四平",
                        },
                        {
                            value: "2207",
                            label: "松原",
                        },
                        {
                            value: "2208",
                            label: "通化",
                        },
                        {
                            value: "2209",
                            label: "延边",
                        },
                    ],
                },
                {
                    value: "0023",
                    label: "黑龙江省",
                    children: [
                        {
                            value: "2301",
                            label: "哈尔滨",
                        },
                        {
                            value: "2302",
                            label: "大庆",
                        },
                        {
                            value: "2303",
                            label: "大兴安岭",
                        },
                        {
                            value: "2304",
                            label: "鹤岗",
                        },
                        {
                            value: "2305",
                            label: "黑河",
                        },
                        {
                            value: "2306",
                            label: "鸡西",
                        },
                        {
                            value: "2307",
                            label: "佳木斯",
                        },
                        {
                            value: "2308",
                            label: "牡丹江",
                        },
                        {
                            value: "2309",
                            label: "七台河",
                        },
                        {
                            value: "2310",
                            label: "齐齐哈尔",
                        },
                        {
                            value: "2311",
                            label: "双鸭山",
                        },
                        {
                            value: "2312",
                            label: "绥化",
                        },
                        {
                            value: "2313",
                            label: "伊春",
                        },
                    ],
                },
                {
                    value: "0031",
                    label: "上海市",
                    children: [
                        {
                            value: "3100",
                            label: "上海市",
                        },
                    ],
                },

                {
                    value: "0032",
                    label: "江苏省",
                    children: [
                        {
                            value: "3201",
                            label: "南京",
                        },
                        {
                            value: "3202",
                            label: "常州",
                        },
                        {
                            value: "3203",
                            label: "淮安",
                        },
                        {
                            value: "3204",
                            label: "连云港",
                        },
                        {
                            value: "3205",
                            label: "南通",
                        },
                        {
                            value: "3206",
                            label: "苏州",
                        },
                        {
                            value: "3207",
                            label: "宿迁",
                        },
                        {
                            value: "3208",
                            label: "泰州",
                        },
                        {
                            value: "3209",
                            label: "无锡",
                        },
                        {
                            value: "3210",
                            label: "徐州",
                        },
                        {
                            value: "3211",
                            label: "盐城",
                        },
                        {
                            value: "3212",
                            label: "扬州",
                        },
                        {
                            value: "3213",
                            label: "镇江",
                        },
                        {
                            value: "3214",
                            label: "胥浦",
                        },
                        {
                            value: "3215",
                            label: "昆山",
                        },
                    ],
                },

                {
                    value: "0033",
                    label: "浙江省",
                    children: [
                        {
                            value: "3301",
                            label: "杭州",
                        },
                        {
                            value: "3302",
                            label: "宁波",
                        },
                        {
                            value: "3303",
                            label: "湖州",
                        },
                        {
                            value: "3304",
                            label: "嘉兴",
                        },
                        {
                            value: "3305",
                            label: "金华",
                        },
                        {
                            value: "3306",
                            label: "绍兴",
                        },
                        {
                            value: "3307",
                            label: "台州",
                        },
                        {
                            value: "3308",
                            label: "温州",
                        },
                        {
                            value: "3309",
                            label: "舟山",
                        },
                        {
                            value: "3310",
                            label: "衢州",
                        },
                        {
                            value: "3311",
                            label: "丽水",
                        },
                    ],
                },

                {
                    value: "0034",
                    label: "安徽省",
                    children: [
                        {
                            value: "3401",
                            label: "合肥",
                        },
                        {
                            value: "3402",
                            label: "安庆",
                        },
                        {
                            value: "3403",
                            label: "蚌埠",
                        },
                        {
                            value: "3404",
                            label: "巢湖",
                        },
                        {
                            value: "3405",
                            label: "池州",
                        },
                        {
                            value: "3406",
                            label: "滁州",
                        },
                        {
                            value: "3407",
                            label: "阜阳",
                        },
                        {
                            value: "3408",
                            label: "淮北",
                        },
                        {
                            value: "3409",
                            label: "淮南",
                        },
                        {
                            value: "3410",
                            label: "黄山",
                        },
                        {
                            value: "3411",
                            label: "六安",
                        },
                        {
                            value: "3412",
                            label: "马鞍山",
                        },
                        {
                            value: "3414",
                            label: "铜陵",
                        },
                        {
                            value: "3415",
                            label: "芜湖",
                        },
                        {
                            value: "3416",
                            label: "宣城",
                        },
                        {
                            value: "3417",
                            label: "亳州",
                        },
                        {
                            value: "3418",
                            label: "宿州",
                        },
                    ],
                },
                {
                    value: "0035",
                    label: "福建省",
                    children: [
                        {
                            value: "3501",
                            label: "福州",
                        },
                        {
                            value: "3502",
                            label: "厦门",
                        },
                        {
                            value: "3503",
                            label: "龙岩",
                        },
                        {
                            value: "3504",
                            label: "南平",
                        },
                        {
                            value: "3505",
                            label: "宁德",
                        },
                        {
                            value: "3506",
                            label: "莆田",
                        },
                        {
                            value: "3507",
                            label: "泉州",
                        },
                        {
                            value: "3508",
                            label: "三明",
                        },
                        {
                            value: "3509",
                            label: "漳州",
                        },
                    ],
                },
                {
                    value: "0036",
                    label: "江西省",
                    children: [
                        {
                            value: "3601",
                            label: "南昌",
                        },
                        {
                            value: "3602",
                            label: "抚州",
                        },
                        {
                            value: "3603",
                            label: "赣州",
                        },
                        {
                            value: "3604",
                            label: "吉安",
                        },
                        {
                            value: "3605",
                            label: "景德镇",
                        },
                        {
                            value: "3606",
                            label: "九江",
                        },
                        {
                            value: "3607",
                            label: "萍乡",
                        },
                        {
                            value: "3608",
                            label: "上饶",
                        },
                        {
                            value: "3609",
                            label: "新余",
                        },
                        {
                            value: "3610",
                            label: "宜春",
                        },
                        {
                            value: "3611",
                            label: "鹰潭",
                        },
                    ],
                },

                {
                    value: "0037",
                    label: "山东省",
                    children: [
                        {
                            value: "3701",
                            label: "济南",
                        },
                        {
                            value: "3702",
                            label: "青岛",
                        },
                        {
                            value: "3703",
                            label: "滨州",
                        },
                        {
                            value: "3704",
                            label: "德州",
                        },
                        {
                            value: "3705",
                            label: "东营",
                        },
                        {
                            value: "3706",
                            label: "菏泽",
                        },
                        {
                            value: "3707",
                            label: "济宁",
                        },
                        {
                            value: "3708",
                            label: "莱芜",
                        },
                        {
                            value: "3709",
                            label: "聊城",
                        },
                        {
                            value: "3710",
                            label: "临沂",
                        },
                        {
                            value: "3711",
                            label: "日照",
                        },
                        {
                            value: "3712",
                            label: "泰安",
                        },
                        {
                            value: "3713",
                            label: "威海",
                        },
                        {
                            value: "3714",
                            label: "潍坊",
                        },
                        {
                            value: "3715",
                            label: "烟台",
                        },
                        {
                            value: "3716",
                            label: "枣庄",
                        },
                        {
                            value: "3717",
                            label: "淄博",
                        },
                    ],
                },
                {
                    value: "0041",
                    label: "河南省",
                    children: [
                        {
                            value: "4101",
                            label: "郑州",
                        },
                        {
                            value: "4102",
                            label: "安阳",
                        },
                        {
                            value: "4103",
                            label: "焦作",
                        },
                        {
                            value: "4104",
                            label: "鹤壁",
                        },
                        {
                            value: "4105",
                            label: "开封",
                        },
                        {
                            value: "4106",
                            label: "洛阳",
                        },
                        {
                            value: "4107",
                            label: "南阳",
                        },
                        {
                            value: "4108",
                            label: "平顶山",
                        },
                        {
                            value: "4109",
                            label: "三门峡",
                        },
                        {
                            value: "4110",
                            label: "商丘",
                        },
                        {
                            value: "4111",
                            label: "新乡",
                        },
                        {
                            value: "4112",
                            label: "信阳",
                        },
                        {
                            value: "4113",
                            label: "许昌",
                        },
                        {
                            value: "4114",
                            label: "周口",
                        },
                        {
                            value: "4115",
                            label: "驻马店",
                        },
                        {
                            value: "4116",
                            label: "漯河",
                        },
                        {
                            value: "4117",
                            label: "濮阳",
                        },
                        {
                            value: "4118",
                            label: "济源",
                        },
                    ],
                },
                {
                    value: "0042",
                    label: "湖北省",
                    children: [
                        {
                            value: "4201",
                            label: "武汉",
                        },
                        {
                            value: "4202",
                            label: "鄂州",
                        },
                        {
                            value: "4203",
                            label: "恩施",
                        },
                        {
                            value: "4204",
                            label: "黄冈",
                        },
                        {
                            value: "4205",
                            label: "黄石",
                        },
                        {
                            value: "4206",
                            label: "荆门",
                        },
                        {
                            value: "4207",
                            label: "荆州",
                        },
                        {
                            value: "4208",
                            label: "十堰",
                        },
                        {
                            value: "4209",
                            label: "随州",
                        },
                        {
                            value: "4210",
                            label: "咸宁",
                        },
                        {
                            value: "4211",
                            label: "襄樊",
                        },
                        {
                            value: "4212",
                            label: "孝感",
                        },
                        {
                            value: "4213",
                            label: "神农架",
                        },
                        {
                            value: "4214",
                            label: "天门",
                        },
                        {
                            value: "4215",
                            label: "宜昌",
                        },
                        {
                            value: "4216",
                            label: "三峡",
                        },
                        {
                            value: "4217",
                            label: "潜江",
                        },
                        {
                            value: "4218",
                            label: "仙桃",
                        },
                    ],
                },
                {
                    value: "0043",
                    label: "湖南省",
                    children: [
                        {
                            value: "4301",
                            label: "长沙",
                        },
                        {
                            value: "4302",
                            label: "常德",
                        },
                        {
                            value: "4303",
                            label: "郴州",
                        },
                        {
                            value: "4304",
                            label: "衡阳",
                        },
                        {
                            value: "4305",
                            label: "怀化",
                        },
                        {
                            value: "4306",
                            label: "娄底",
                        },
                        {
                            value: "4307",
                            label: "邵阳",
                        },
                        {
                            value: "4308",
                            label: "湘潭",
                        },
                        {
                            value: "4309",
                            label: "湘西",
                        },
                        {
                            value: "4310",
                            label: "益阳",
                        },
                        {
                            value: "4311",
                            label: "永州",
                        },
                        {
                            value: "4312",
                            label: "岳阳",
                        },
                        {
                            value: "4313",
                            label: "张家界",
                        },
                        {
                            value: "4314",
                            label: "株洲",
                        },
                        {
                            value: "4331",
                            label: "吉首",
                        },
                    ],
                },

                {
                    value: "0044",
                    label: "广东省",
                    children: [
                        {
                            value: "4401",
                            label: "广州",
                        },
                        {
                            value: "4402",
                            label: "深圳",
                        },
                        {
                            value: "4403",
                            label: "潮州",
                        },
                        {
                            value: "4404",
                            label: "东莞",
                        },
                        {
                            value: "4405",
                            label: "佛山",
                        },
                        {
                            value: "4406",
                            label: "惠州",
                        },
                        {
                            value: "4407",
                            label: "江门",
                        },
                        {
                            value: "4408",
                            label: "揭阳",
                        },
                        {
                            value: "4409",
                            label: "茂名",
                        },
                        {
                            value: "4410",
                            label: "梅州",
                        },
                        {
                            value: "4411",
                            label: "清远",
                        },
                        {
                            value: "4412",
                            label: "汕头",
                        },
                        {
                            value: "4413",
                            label: "汕尾",
                        },
                        {
                            value: "4414",
                            label: "韶关",
                        },
                        {
                            value: "4415",
                            label: "阳江",
                        },
                        {
                            value: "4416",
                            label: "云浮",
                        },
                        {
                            value: "4417",
                            label: "湛江",
                        },
                        {
                            value: "4418",
                            label: "肇庆",
                        },
                        {
                            value: "4419",
                            label: "中山",
                        },
                        {
                            value: "4420",
                            label: "河源",
                        },
                        {
                            value: "4421",
                            label: "珠海",
                        },
                    ],
                },

                {
                    value: "0045",
                    label: "广西壮族自治区",
                    children: [
                        {
                            value: "4501",
                            label: "南宁",
                        },
                        {
                            value: "4502",
                            label: "百色",
                        },
                        {
                            value: "4503",
                            label: "北海",
                        },
                        {
                            value: "4504",
                            label: "桂林",
                        },
                        {
                            value: "4505",
                            label: "河池",
                        },
                        {
                            value: "4506",
                            label: "柳州",
                        },
                        {
                            value: "4507",
                            label: "梧州",
                        },
                        {
                            value: "4508",
                            label: "玉林",
                        },
                        {
                            value: "4509",
                            label: "崇左",
                        },
                        {
                            value: "4510",
                            label: "防城港",
                        },
                        {
                            value: "4511",
                            label: "贵港",
                        },
                        {
                            value: "4512",
                            label: "贺州",
                        },
                        {
                            value: "4513",
                            label: "来宾",
                        },
                        {
                            value: "4514",
                            label: "钦州",
                        },
                    ],
                },

                {
                    value: "0046",
                    label: "海南省",
                    children: [
                        {
                            value: "4601",
                            label: "海口",
                        },
                        {
                            value: "4602",
                            label: "三亚",
                        },
                        {
                            value: "4603",
                            label: "白沙",
                        },
                        {
                            value: "4604",
                            label: "保亭",
                        },
                        {
                            value: "4605",
                            label: "昌江",
                        },
                        {
                            value: "4606",
                            label: "澄迈",
                        },
                        {
                            value: "4607",
                            label: "儋州",
                        },
                        {
                            value: "4608",
                            label: "定安",
                        },
                        {
                            value: "4609",
                            label: "东方",
                        },
                        {
                            value: "4610",
                            label: "乐东",
                        },
                        {
                            value: "4611",
                            label: "临高",
                        },
                        {
                            value: "4612",
                            label: "陵水",
                        },
                        {
                            value: "4613",
                            label: "琼海",
                        },
                        {
                            value: "4614",
                            label: "琼中",
                        },
                        {
                            value: "4615",
                            label: "屯昌",
                        },
                        {
                            value: "4616",
                            label: "万宁",
                        },
                        {
                            value: "4617",
                            label: "文昌",
                        },
                        {
                            value: "4618",
                            label: "五指山",
                        },
                        {
                            value: "4619",
                            label: "洋浦",
                        },
                    ],
                },

                {
                    value: "0050",
                    label: "重庆市",
                    children: [
                        {
                            value: "5000",
                            label: "重庆市",
                        },
                    ],
                },

                {
                    value: "0051",
                    label: "四川省",
                    children: [
                        {
                            value: "5101",
                            label: "成都",
                        },
                        {
                            value: "5102",
                            label: "巴中",
                        },
                        {
                            value: "5103",
                            label: "达州",
                        },
                        {
                            value: "5104",
                            label: "德阳",
                        },
                        {
                            value: "5105",
                            label: "广安",
                        },
                        {
                            value: "5106",
                            label: "广元",
                        },
                        {
                            value: "5107",
                            label: "乐山",
                        },
                        {
                            value: "5108",
                            label: "凉山",
                        },
                        {
                            value: "5109",
                            label: "眉山",
                        },
                        {
                            value: "5110",
                            label: "绵阳",
                        },
                        {
                            value: "5111",
                            label: "南充",
                        },
                        {
                            value: "5112",
                            label: "内江",
                        },
                        {
                            value: "5113",
                            label: "攀枝花",
                        },
                        {
                            value: "5114",
                            label: "遂宁",
                        },
                        {
                            value: "5115",
                            label: "雅安",
                        },
                        {
                            value: "5116",
                            label: "宜宾",
                        },
                        {
                            value: "5117",
                            label: "自贡",
                        },
                        {
                            value: "5118",
                            label: "泸州",
                        },
                        {
                            value: "5119",
                            label: "阿坝",
                        },
                        {
                            value: "5120",
                            label: "甘孜",
                        },
                        {
                            value: "5121",
                            label: "资阳",
                        },
                    ],
                },

                {
                    value: "0052",
                    label: "贵州省",
                    children: [
                        {
                            value: "5201",
                            label: "贵阳",
                        },
                        {
                            value: "5202",
                            label: "安顺",
                        },
                        {
                            value: "5203",
                            label: "毕节",
                        },
                        {
                            value: "5204",
                            label: "六盘水",
                        },
                        {
                            value: "5205",
                            label: "铜仁",
                        },
                        {
                            value: "5206",
                            label: "遵义",
                        },
                        {
                            value: "5207",
                            label: "黔东南",
                        },
                        {
                            value: "5208",
                            label: "黔南",
                        },
                        {
                            value: "5209",
                            label: "黔西南",
                        },
                    ],
                },

                {
                    value: "0053",
                    label: "云南省",
                    children: [
                        {
                            value: "5301",
                            label: "昆明",
                        },
                        {
                            value: "5302",
                            label: "西双版纳",
                        },
                        {
                            value: "5303",
                            label: "保山",
                        },
                        {
                            value: "5304",
                            label: "楚雄",
                        },
                        {
                            value: "5305",
                            label: "大理",
                        },
                        {
                            value: "5306",
                            label: "德宏",
                        },
                        {
                            value: "5307",
                            label: "红河",
                        },
                        {
                            value: "5308",
                            label: "丽江",
                        },
                        {
                            value: "5309",
                            label: "临沧",
                        },
                        {
                            value: "5310",
                            label: "怒江",
                        },
                        {
                            value: "5311",
                            label: "曲靖",
                        },
                        {
                            value: "5312",
                            label: "思茅",
                        },
                        {
                            value: "5313",
                            label: "文山",
                        },
                        {
                            value: "5314",
                            label: "玉溪",
                        },
                        {
                            value: "5315",
                            label: "昭通",
                        },
                        {
                            value: "5316",
                            label: "中甸",
                        },
                        {
                            value: "5317",
                            label: "迪庆州",
                        },
                    ],
                },

                {
                    value: "0054",
                    label: "西藏自治区",
                    children: [
                        {
                            value: "5401",
                            label: "拉萨",
                        },
                        {
                            value: "5402",
                            label: "阿里",
                        },
                        {
                            value: "5403",
                            label: "昌都",
                        },
                        {
                            value: "5404",
                            label: "林芝",
                        },
                        {
                            value: "5405",
                            label: "那曲",
                        },
                        {
                            value: "5406",
                            label: "日喀则",
                        },
                        {
                            value: "5407",
                            label: "山南",
                        },
                        {
                            value: "5424",
                            label: "樟木口岸",
                        },
                    ],
                },

                {
                    value: "0061",
                    label: "陕西省",
                    children: [
                        {
                            value: "6101",
                            label: "西安",
                        },
                        {
                            value: "6102",
                            label: "安康",
                        },
                        {
                            value: "6103",
                            label: "宝鸡",
                        },
                        {
                            value: "6104",
                            label: "汉中",
                        },
                        {
                            value: "6105",
                            label: "商洛",
                        },
                        {
                            value: "6106",
                            label: "铜川",
                        },
                        {
                            value: "6107",
                            label: "渭南",
                        },
                        {
                            value: "6108",
                            label: "咸阳",
                        },
                        {
                            value: "6109",
                            label: "延安",
                        },
                        {
                            value: "6110",
                            label: "榆林",
                        },
                    ],
                },

                {
                    value: "0062",
                    label: "甘肃省",
                    children: [
                        {
                            value: "6201",
                            label: "兰州",
                        },
                        {
                            value: "6202",
                            label: "白银",
                        },
                        {
                            value: "6203",
                            label: "定西",
                        },
                        {
                            value: "6204",
                            label: "东风",
                        },
                        {
                            value: "6205",
                            label: "合作",
                        },
                        {
                            value: "6206",
                            label: "嘉峪关",
                        },
                        {
                            value: "6207",
                            label: "金昌",
                        },
                        {
                            value: "6208",
                            label: "酒泉",
                        },
                        {
                            value: "6209",
                            label: "矿区",
                        },
                        {
                            value: "6210",
                            label: "临夏",
                        },
                        {
                            value: "6211",
                            label: "陇南",
                        },
                        {
                            value: "6212",
                            label: "平凉",
                        },
                        {
                            value: "6213",
                            label: "庆阳",
                        },
                        {
                            value: "6214",
                            label: "天水",
                        },
                        {
                            value: "6215",
                            label: "武威",
                        },
                        {
                            value: "6216",
                            label: "张掖",
                        },
                        {
                            value: "6217",
                            label: "甘南州",
                        },
                    ],
                },

                {
                    value: "0063",
                    label: "青海省",
                    children: [
                        {
                            value: "6301",
                            label: "西宁",
                        },
                        {
                            value: "6302",
                            label: "海东",
                        },
                        {
                            value: "6322",
                            label: "海北",
                        },
                        {
                            value: "6323",
                            label: "黄南",
                        },
                        {
                            value: "6325",
                            label: "海南",
                        },
                        {
                            value: "6326",
                            label: "果洛",
                        },
                        {
                            value: "6327",
                            label: "玉树",
                        },
                        {
                            value: "6328",
                            label: "海西",
                        },
                    ],
                },

                {
                    value: "0064",
                    label: "宁夏回族自治区",
                    children: [
                        {
                            value: "6401",
                            label: "银川",
                        },
                        {
                            value: "6402",
                            label: "中卫",
                        },
                        {
                            value: "6403",
                            label: "固原",
                        },
                        {
                            value: "6404",
                            label: "石嘴山",
                        },
                        {
                            value: "6405",
                            label: "吴忠",
                        },
                    ],
                },

                {
                    value: "0065",
                    label: "新疆维吾尔自治区",
                    children: [
                        {
                            value: "6501",
                            label: "乌鲁木齐",
                        },
                        {
                            value: "6502",
                            label: "阿克苏",
                        },
                        {
                            value: "6503",
                            label: "阿勒泰",
                        },
                        {
                            value: "6504",
                            label: "巴州",
                        },
                        {
                            value: "6505",
                            label: "博州",
                        },
                        {
                            value: "6506",
                            label: "昌吉",
                        },
                        {
                            value: "6507",
                            label: "哈密",
                        },
                        {
                            value: "6508",
                            label: "和田",
                        },
                        {
                            value: "6509",
                            label: "喀什",
                        },
                        {
                            value: "6510",
                            label: "克拉玛依",
                        },
                        {
                            value: "6511",
                            label: "马兰",
                        },
                        {
                            value: "6512",
                            label: "石河子",
                        },
                        {
                            value: "6513",
                            label: "塔城",
                        },
                        {
                            value: "6514",
                            label: "吐鲁番",
                        },
                        {
                            value: "6515",
                            label: "伊犁",
                        },
                        {
                            value: "6516",
                            label: "克州",
                        },
                        {
                            value: "6517",
                            label: "阿拉尔",
                        },
                        {
                            value: "6518",
                            label: "五家渠",
                        },
                    ],
                },
                {
                    value: "2003",
                    label: "台湾省",
                    children: [
                        {
                            value: "9903",
                            label: "台湾省",
                        },
                    ],
                },

                {
                    value: "2001",
                    label: "香港特别行政区",
                    children: [
                        {
                            value: "9901",
                            label: "香港特别行政区",
                        },
                    ],
                },
                {
                    value: "2002",
                    label: "澳门特别行政区",
                    children: [
                        {
                            value: "9902",
                            label: "澳门特别行政区",
                        },
                    ],
                },
            ],
        };
    },
    methods: {
        handleChange(value) {
            console.log(value);
        },
        // 创建汇付会员
        submitForm(formName) {
            this.$refs[formName].validate((valid) => {
                if (valid) {
                    console.log("valid", this.ruleForm);
                    createAdapayMember(this.ruleForm).then((response) => {
                        console.log("新增", response);
                        this.openCreateAdapayMember = false;
                        this.selectAdapayMember();
                    });
                } else {
                    console.log("提交表格失败");
                    return false;
                }
            });
        },
        resetForm(formName) {
            this.$refs[formName].resetFields();
        },
        // 查询汇付会员
        selectAdapayMember() {
            console.log("this.merchantId", this.merchantId);
            let param = {
                merchantId: this.merchantId,
            };
            selectAdapayMember(param).then((response) => {
                // console.log("查询 response", response);
                if (response.data != null) {
                    this.ruleForm = response.data;
                    this.adapayMember = response.data;
                }
            });
        },
        // 查询汇付结算账户
        selectSettleAccount() {},
    },
    created() {
        this.selectAdapayMember();
        this.selectSettleAccount();
    },
};
</script>
