<template>
  <div class="jeepay-m-center" style="margin-top: 5px; margin-left: 20px;">
    <a-form
      ref="applyFormRef"
      :model="applymentDetailInfo"
      :label-col="{ span: 4 }"
      :wrapper-col="{ span: 8 }"
      :rules="applyRules"
    >
      <a-divider class="jeepay-m-divider" orientation="left" style="color: #1A66FF;">经营信息</a-divider>
      <a-form-item label="选择商户类型" name="hmMerchantType">
        <a-radio-group v-model:value="applymentDetailInfo.hmMerchantType" @change="clearWxMcc()">
          <a-radio value="GENERAL_MERCHANT">普通商户</a-radio>
          <a-radio value="PERSONAL_MERCHANT">个人小微</a-radio>
        </a-radio-group>
      </a-form-item>
      <a-form-item v-if="applymentDetailInfo.hmMerchantType=='GENERAL_MERCHANT'" label="选择企业性质" name="enterpriseNature">
        <a-radio-group v-model:value="applymentDetailInfo.enterpriseNature" @change="clearWxMcc()">
          <a-radio value="STOCK_COMPANY">股份公司</a-radio>
          <a-radio value="LIMITED_COMPANY">有限公司</a-radio>
          <a-radio value="INDIVIDUAL_BUSINESS">个体工商户</a-radio>
          <a-radio value="GOVERNMENT_INSTITUTION">事业单位</a-radio>
          <a-radio value="OTHER">其他组织</a-radio>
        </a-radio-group>
      </a-form-item>
      <a-form-item v-if="applymentDetailInfo.hmMerchantType=='PERSONAL_MERCHANT'" label="选择小微经营类型" name="microBizType">
        <a-radio-group v-model:value="applymentDetailInfo.microBizType" @change="() => emit('itemRender')">
          <a-radio value="MICRO_TYPE_STORE">门店场所</a-radio>
          <a-radio value="MICRO_TYPE_MOBILE">流动经营/便民服务</a-radio>
          <a-radio value="MICRO_TYPE_ONLINE">线上商品/服务交易</a-radio>
        </a-radio-group>
      </a-form-item>

      <a-form-item label="商户经营类目" name="mccCode">
        <JeepayHmpayMccSelect v-model:value="applymentDetailInfo.mccCode" />
      </a-form-item>

      <a-form-item label="商户类别" name="mccTypeCode">
        <JeepayHmpayMchMccSelect v-model:value="applymentDetailInfo.mccTypeCode" />
        <span class="jeepay-tip-text">用于开通支付产品（支付宝和银联）</span>
      </a-form-item>

      <a-form-item label="微信经营类目" name="wxMccCode">
        <JeepayHmpayWxSelect
          v-model:value="applymentDetailInfo.wxMccCode" 
          :hmMerchantType="applymentDetailInfo.hmMerchantType"
          :enterpriseNature="applymentDetailInfo.enterpriseNature"
        />
        <span class="jeepay-tip-text">选择商户类型和企业性质后可选择（开通微信支付时必填）</span>
      </a-form-item>
  
      <a-form-item v-if="applymentDetailInfo.hmMerchantType=='GENERAL_MERCHANT'" label="营业执照照片" name="licenseImg">
        <JeepayUpload v-model:src="applymentDetailInfo.licenseImg" bizType="applyment" ocrType="license" @ocrScan="ocrScanFunc" />
      </a-form-item>

      <a-form-item label="商户简称" name="mchShortName">
        <a-input v-model:value.trim="applymentDetailInfo.mchShortName" />
        <span class="jeepay-tip-text">用于在支付时向用户展示</span>
      </a-form-item>

      <a-form-item v-if="applymentDetailInfo.hmMerchantType=='GENERAL_MERCHANT'" label="商户执照名称" name="mchFullName">
        <a-input v-model:value.trim="applymentDetailInfo.mchFullName" />
        <span class="jeepay-tip-text">*必须同营业执照名称一致<br>
          *若个体工商户营业执照没有商家名称或者名称为"*"或者"***"，则商户名称应填"个体户XXX"（XXX为营业执照上经营者姓名）</span>
      </a-form-item>
          
      <a-form-item v-if="applymentDetailInfo.hmMerchantType=='GENERAL_MERCHANT'" label="营业执照编号" name="licenseNo">
        <a-input v-model:value.trim="applymentDetailInfo.licenseNo" />
      </a-form-item>
                
      <a-form-item v-if="applymentDetailInfo.hmMerchantType=='GENERAL_MERCHANT'" label="注册地址" name="registerAddress">
        <a-input v-model:value.trim="applymentDetailInfo.registerAddress" />
      </a-form-item>

      <a-form-item v-if="applymentDetailInfo.hmMerchantType=='GENERAL_MERCHANT'" label="营业执照起始有效期" name="licenseEffectBegin">
        <a-input v-model:value.trim="applymentDetailInfo.licenseEffectBegin" />
      </a-form-item>

      <a-form-item v-if="applymentDetailInfo.hmMerchantType=='GENERAL_MERCHANT'" class="jeepay-valid" label="营业执照有效期截止" name="licenseEffectEnd">
        <a-input v-model:value.trim="applymentDetailInfo.licenseEffectEnd" :disabled="applymentDetailInfo.licenseEffectEnd == '长期'" style="width: 150px;margin-right: 10px;" />
        <a-checkbox :checked="applymentDetailInfo.licenseEffectEnd == '长期' " @change="(e) => applymentDetailInfo.licenseEffectEnd = e.target.checked ? '长期' : '' ">长期</a-checkbox>
      </a-form-item>

      <a-form-item v-if="applymentDetailInfo.hmMerchantType=='GENERAL_MERCHANT'" label="工商网截图" name="icNetScreenShot">
        <JeepayUpload v-model:src="applymentDetailInfo.icNetScreenShot" bizType="applyment" />
      </a-form-item>

      <a-form-item v-if="applymentDetailInfo.hmMerchantType=='PERSONAL_MERCHANT'" label="租赁协议" name="leaseAgreement">
        <JeepayUpload v-model:src="applymentDetailInfo.leaseAgreement" bizType="applyment" />
      </a-form-item>
      
      <a-divider class="jeepay-m-divider" orientation="left" style="color: #1A66FF;">法人信息</a-divider>

      <a-form-item label="法人身份证人像面照片" name="idcard1Img">
        <JeepayUpload v-model:src="applymentDetailInfo.idcard1Img" bizType="applyment" ocrType="idCard" @ocrScan="ocrScanFunc" />
      </a-form-item>

      <a-form-item label="法人身份证国徽面照片" name="idcard2Img">
        <JeepayUpload v-model:src="applymentDetailInfo.idcard2Img" bizType="applyment" ocrType="idCard" @ocrScan="ocrScanFunc" />
      </a-form-item>

      <a-form-item label="法人手持身份证照" name="idcardInHandImg">
        <JeepayUpload v-model:src="applymentDetailInfo.idcardInHandImg" bizType="applyment" />
      </a-form-item>

      <a-form-item label="法人姓名" name="idcardName">
        <a-input v-model:value.trim="applymentDetailInfo.idcardName" />
      </a-form-item>
      
      <a-form-item label="证件号" name="idcardNo">
        <a-input v-model:value.trim="applymentDetailInfo.idcardNo" />
      </a-form-item>
      
      <a-form-item v-if="vdata.hideItem.indexOf('idcardEffectBegin') < 0 " label="法人身份证起始有效期" name="idcardEffectBegin">
        <a-input v-model:value.trim="applymentDetailInfo.idcardEffectBegin" />
      </a-form-item>

      <a-form-item v-if="vdata.hideItem.indexOf('idcardEffectEnd') < 0 " label="法人身份证结束有效期" name="idcardEffectEnd">
        <a-input v-model:value.trim="applymentDetailInfo.idcardEffectEnd" :disabled="applymentDetailInfo.idcardEffectEnd == '长期'" style="width: 150px;margin-right: 10px;" />
        <a-checkbox :checked="applymentDetailInfo.idcardEffectEnd == '长期' " @change="(e : any) => applymentDetailInfo.idcardEffectEnd = e.target.checked ? '长期' : '' ">长期</a-checkbox>
      </a-form-item>
      
      <a-divider class="jeepay-m-divider" orientation="left" style="color: #1A66FF;">商户信息</a-divider>

      <a-form-item label="商户地理位置选择省市县" name="areaCode">
        <JeepayAreaSelect v-model:value="applymentDetailInfo.areaCode" />
      </a-form-item>

      <a-form-item label="商户详细地址" name="address">
        <a-input v-model:value.trim="applymentDetailInfo.address" />
      </a-form-item>

      <a-divider class="jeepay-m-divider" orientation="left" style="color: #1A66FF;">联系人信息</a-divider>
      <a-button shape="round" style="margin-left: 40%; margin-bottom:10px " type="primary" @click="isLegal('contact')">
        <arrow-right-outlined />
        点此使用法人信息
      </a-button>
      <a-form-item v-if="applymentDetailInfo.hmMerchantType=='GENERAL_MERCHANT'" label="联系人类型" name="contactPersonType">
        <a-radio-group v-model:value="applymentDetailInfo.contactPersonType" @change="changePersonType(applymentDetailInfo.contactPersonType)">
          <a-radio value="LEGAL_PERSON">法人代表</a-radio>
          <a-radio value="CONTROLLER">控制人</a-radio>
          <a-radio value="AGENT">代理人</a-radio>
          <a-radio value="OTHER">其他</a-radio>
        </a-radio-group>
      </a-form-item>

      <div v-if="applymentDetailInfo.contactPersonType && applymentDetailInfo.contactPersonType != 'LEGAL_PERSON' && applymentDetailInfo.hmMerchantType=='GENERAL_MERCHANT'">
        <a-form-item label="联系人身份证人像面照片" name="contactIdcard1Img">
          <JeepayUpload v-model:src="applymentDetailInfo.contactIdcard1Img" bizType="applyment" ocrType="idCard" @ocrScan="ocrScanContactFunc" />
        </a-form-item>

        <a-form-item label="联系人身份证国徽面照片" name="contactIdcard2Img">
          <JeepayUpload v-model:src="applymentDetailInfo.contactIdcard2Img" bizType="applyment" ocrType="idCard" @ocrScan="ocrScanContactFunc" />
        </a-form-item>
      </div>

      <a-form-item label="联系人姓名" name="contactName">
        <a-input v-model:value.trim="applymentDetailInfo.contactName" />
      </a-form-item>

      <a-form-item v-if="applymentDetailInfo.hmMerchantType=='PERSONAL_MERCHANT'" label="联系人性别" name="contactPersonSex">
        <a-radio-group v-model:value="applymentDetailInfo.contactPersonSex">
          <a-radio value="MALE">男</a-radio>
          <a-radio value="FEMALE">女</a-radio>
        </a-radio-group>
      </a-form-item>

      <a-form-item label="联系人身份证号" name="contactIdcardNo">
        <a-input v-model:value.trim="applymentDetailInfo.contactIdcardNo" />
      </a-form-item>

      <a-form-item label="联系人证件地址" name="contactIdcardAddress">
        <a-input v-model:value.trim="applymentDetailInfo.contactIdcardAddress" />
      </a-form-item>

      <a-form-item v-if="vdata.hideItem.indexOf('contactIdcardEffectBegin') < 0 " label="联系人身份证起始有效期" name="contactIdcardEffectBegin">
        <a-input v-model:value.trim="applymentDetailInfo.contactIdcardEffectBegin" />
      </a-form-item>

      <a-form-item v-if="vdata.hideItem.indexOf('contactIdcardEffectEnd') < 0 " label="联系人身份证结束有效期" name="contactIdcardEffectEnd">
        <a-input v-model:value.trim="applymentDetailInfo.contactIdcardEffectEnd" :disabled="applymentDetailInfo.contactIdcardEffectEnd == '长期'" style="width: 150px;margin-right: 10px;" />
        <a-checkbox :checked="applymentDetailInfo.contactIdcardEffectEnd == '长期' " @change="(e : any) => applymentDetailInfo.contactIdcardEffectEnd = e.target.checked ? '长期' : '' ">长期</a-checkbox>
      </a-form-item>

      <a-form-item label="联系人电话" name="contactPhone">
        <a-input v-model:value.trim="applymentDetailInfo.contactPhone" />
      </a-form-item>

      <a-form-item label="联系人邮箱" name="contactEmail">
        <a-input v-model:value.trim="applymentDetailInfo.contactEmail" />
      </a-form-item>

      <a-form-item label="客服电话" name="serviceTel">
        <a-input v-model:value.trim="applymentDetailInfo.serviceTel" />
      </a-form-item>

      <a-divider class="jeepay-m-divider" orientation="left" style="color: #1A66FF;">绑卡验证材料</a-divider>
      
      <a-form-item label="银行账户类型" name="bankAccountType">
        <a-radio-group v-model:value="applymentDetailInfo.bankAccountType" @change="changeSettInfo()">
          <a-radio value="PUBLIC_ACCOUNT" :disabled="applymentDetailInfo.hmMerchantType == 'PERSONAL_MERCHANT'">对公帐户</a-radio>
          <a-radio value="PRIVATE_DEBIT_ACCOUNT" :checked="true">对私借记卡</a-radio>
          <span class="jeepay-tip-text">进件首次发起成功后，会进入绑卡的待验证环节</span>
        </a-radio-group>
      </a-form-item>
      
      <div v-if="applymentDetailInfo.bankAccountType == 'PRIVATE_DEBIT_ACCOUNT' && applymentDetailInfo.hmMerchantType == 'GENERAL_MERCHANT'">
        <a-form-item label="结算人身份证人像面照片" name="settAccountIdcard1Img">
          <JeepayUpload v-model:src="applymentDetailInfo.settAccountIdcard1Img" bizType="applyment" />
          <span class="jeepay-tip-text">非法人结算时，必传</span>
        </a-form-item>
        <a-form-item label="结算人身份证国徽面照片" name="settAccountIdcard2Img">
          <JeepayUpload v-model:src="applymentDetailInfo.settAccountIdcard2Img" bizType="applyment" />
          <span class="jeepay-tip-text">非法人结算时，必传</span>
        </a-form-item>
        <a-form-item label="非法人结算授权书照片" name="contactWxAuthImg">
          <JeepayUpload v-model:src="applymentDetailInfo.contactWxAuthImg" bizType="applyment" />
          <span class="jeepay-tip-text">非法人结算时，必传</span>
        </a-form-item>
      </div>
   

      <a-divider class="jeepay-m-divider" orientation="left" style="color: #1A66FF;">其他补充材料</a-divider>
      <a-form-item label="补充材料1" name="otherPicUrl1">
        <JeepayUpload v-model:src="applymentDetailInfo.otherPicUrl1" bizType="applyment" />
      </a-form-item>
      <a-form-item label="补充材料2" name="otherPicUrl2">
        <JeepayUpload v-model:src="applymentDetailInfo.otherPicUrl2" bizType="applyment" />
      </a-form-item>
      <a-form-item label="补充材料3" name="otherPicUrl3">
        <JeepayUpload v-model:src="applymentDetailInfo.otherPicUrl3" bizType="applyment" />
      </a-form-item>
    </a-form>
  </div>
</template>
<script setup lang="ts">

import {ref, reactive, defineEmits, defineExpose, inject, getCurrentInstance} from 'vue'
import ruleGenerator from '@/utils/ruleGenerator'


// 获取当前实例的代理对象
const { $infoBox } = getCurrentInstance()!.appContext.config.globalProperties

// 接收父组件的进件详细参数
let applymentDetailInfoInject : any = inject('applymentDetailInfo')
let applymentDetailInfo : any = applymentDetailInfoInject.value

if(!applymentDetailInfo.hmMerchantType) {
  applymentDetailInfo.hmMerchantType = 'GENERAL_MERCHANT'
}

const vdata : any = reactive({
  hideItem : []
})


// 表单实例
const applyFormRef = ref()
// 表单验证规则
const applyRules = {
                    hmMerchantType: [ ruleGenerator.requiredSelect('商户类型', 'string') ],
                    enterpriseNature: [ { required: false }, {
                                validator: (rule, value) => {
                                  if(applymentDetailInfo.hmMerchantType=='GENERAL_MERCHANT'){
                                    if(!value) {
                                      return Promise.reject('请选择企业性质')
                                    }
                                  }
                                  return Promise.resolve()
                                }
                              } ],
                    microBizType: [ { required: false }, {
                                validator: (rule, value) => {
                                  if(applymentDetailInfo.hmMerchantType!='GENERAL_MERCHANT'){
                                    if(!value) {
                                      return Promise.reject('请选择经营类型')
                                    }
                                  }
                                  return Promise.resolve()
                                }
                              } ],
                    contactName: [ ruleGenerator.requiredInput('联系人姓名') ],
                    contactIdcardNo: [ ruleGenerator.requiredInput('联系人身份证号') ],
                    contactPhone: [ ruleGenerator.requiredInput('联系人电话'), ruleGenerator.mobile ],
                    serviceTel: [ ruleGenerator.requiredInput('客服电话') ],
                    contactEmail: [ ruleGenerator.requiredInput('联系人邮箱') ],
                    address: [ ruleGenerator.requiredInput('店铺地址') ],
                    leaseAgreement: [ ruleGenerator.requiredUpload('租赁协议') ],
                    areaCode: [ ruleGenerator.requiredInput('省市县', 'array') ],
                    mccCode: [ ruleGenerator.requiredInput('经营类目') ],
                    idcardEffectBegin: [ ruleGenerator.requiredInput('身份证起始有效期'), ruleGenerator.date ],
                    idcardEffectEnd: [ ruleGenerator.requiredInput('身份证有效期截止日期'), ruleGenerator.dateOrForever ],
                    licenseNo: [ ruleGenerator.requiredInput('营业执照编号') ],
                    licenseImg: [ ruleGenerator.requiredUpload('营业执照照片') ],
                    licenseEffectBegin: [ ruleGenerator.requiredInput('营业执照起始有效期'), ruleGenerator.date ],
                    licenseEffectEnd: [ ruleGenerator.requiredInput('营业执照有效期截止'), ruleGenerator.dateOrForever ],

                    idcardInHandImg: [ { required: false}, {
                                validator: (rule, value) => {
                                  if(applymentDetailInfo.hmMerchantType!='GENERAL_MERCHANT'){
                                    if(!value) {
                                      return Promise.reject('请上传法人手持身份证人像照')
                                    }
                                  }
                                  return Promise.resolve()
                                }
                              } ],
                    mchFullName: [ ruleGenerator.requiredInput('商户名称全称') ],
                    mchShortName: [ ruleGenerator.requiredInput('商户简称') ],
                    registerAddress: [ ruleGenerator.requiredInput('注册地址') ],
                    idcardName: [ ruleGenerator.requiredInput('法人姓名') ],
                    idcardNo: [ ruleGenerator.requiredInput('法人证件号') ],
                    idcard1Img: [ ruleGenerator.requiredUpload('法人身份证人像面照片') ],
                    idcard2Img: [ ruleGenerator.requiredUpload('法人身份证国徽面照片') ],
                    contactPersonType: [ ruleGenerator.requiredSelect('联系人类型', 'string') ],
                    bankAccountType: [ ruleGenerator.requiredSelect('银行账户类型', 'string') ],
                    contactIdcardAddress: [ ruleGenerator.requiredInput('联系人证件地址') ],
                    contactIdcardEffectBegin: [ ruleGenerator.requiredInput('身份证起始有效期'), ruleGenerator.date ],
                    contactIdcardEffectEnd: [ ruleGenerator.requiredInput('身份证有效期截止日期'), ruleGenerator.dateOrForever ]
                  }
// emit： 向父组件进行通讯。 
const emit = defineEmits(['itemRender'])

// 验证所有的规则 & 提交进件资料
function saveDataPreCallback(isTempData){
    // 转换商户类型
    convertMerchentType()

    // 草稿状态直接提交 
    if(isTempData){
      return Promise.resolve()
    }

    
    // 校验是否选择了商户类别和微信经营类目
    if(!applymentDetailInfo.mccTypeCode && !applymentDetailInfo.wxMccCode ) {
      $infoBox.message.error('[商户类别]和[微信经营类目]不能同时为空')
      return Promise.reject()
    }
    // 验证所有表单
    return applyFormRef.value.validate().then(() => {
      return Promise.resolve()
    }).catch((params) => {
      $infoBox.message.error('数据填写不完整， 请检查后提交')
      return Promise.reject()
    })

}

// 图片识别的回调函数
function ocrScanFunc(orcObject){
  if(orcObject){
    Object.assign(applymentDetailInfo, orcObject)
    // 执照注册地址回填  
    if(orcObject.licenseAddress) {
      applymentDetailInfo.registerAddress = orcObject.licenseAddress
    }
    if(orcObject.idcardSex) {
      applymentDetailInfo.idcardSex = orcObject.idcardSex
    }
    if(orcObject.idcardAddress) {
      applymentDetailInfo.idcardAddress = orcObject.idcardAddress
    }
  }
}


// 图片识别的回调函数 - 联系人       
function ocrScanContactFunc(orcObject){
  if(orcObject){
    if (orcObject.idcardName) {
      applymentDetailInfo.contactName = orcObject.idcardName
    }
    if (orcObject.idcardNo) {
      applymentDetailInfo.contactIdcardNo = orcObject.idcardNo
    }
    if(orcObject.licenseAddress) {
      applymentDetailInfo.registerAddress = orcObject.licenseAddress
    }
    if(orcObject.idcardSex) {
      if (orcObject.idcardSex == '男') {
          applymentDetailInfo.contactPersonSex = 'MALE'
        } else if (orcObject.idcardSex == '女') {
          applymentDetailInfo.contactPersonSex = 'FEMALE'
        }else {
          applymentDetailInfo.contactPersonSex = ''
        }
    }
    if(orcObject.idcardAddress) {
      applymentDetailInfo.contactIdcardAddress = orcObject.idcardAddress
    }
    if(orcObject.idcardEffectBegin){
      applymentDetailInfo.contactIdcardEffectBegin = orcObject.idcardEffectBegin
    }
    if(orcObject.idcardEffectEnd){
      applymentDetailInfo.contactIdcardEffectEnd = orcObject.idcardEffectEnd
    }
  }
}

function changePersonType(value) {
  if(value == 'LEGAL_PERSON') {
    isLegal('contact')
  }
}

// 将法人信息填入到指定地方
function isLegal(type){
  if (type) {
    if (type == 'contact') {
      // 将法人信息填入到商户联系人中
      applymentDetailInfo.contactName = applymentDetailInfo.idcardName
      applymentDetailInfo.contactIdcardNo = applymentDetailInfo.idcardNo
      applymentDetailInfo.contactIdcardEffectBegin = applymentDetailInfo.idcardEffectBegin
      applymentDetailInfo.contactIdcardEffectEnd = applymentDetailInfo.idcardEffectEnd
      if (applymentDetailInfo.idcardSex) {
        if (applymentDetailInfo.idcardSex == '男') {
          applymentDetailInfo.contactPersonSex = 'MALE'
        } else if (applymentDetailInfo.idcardSex == '女') {
          applymentDetailInfo.contactPersonSex = 'FEMALE'
        }else {
          applymentDetailInfo.contactPersonSex = ''
        }
      }
      applymentDetailInfo.contactIdcardAddress = applymentDetailInfo.idcardAddress
    }
  }
}

// 转换商户类型
function convertMerchentType() {
  applymentDetailInfo.merchantType = 5
  if(!applymentDetailInfo.hmMerchantType){
    return
  }

  if (applymentDetailInfo.hmMerchantType == 'PERSONAL_MERCHANT') {
    // 个人小微 
    applymentDetailInfo.merchantType = 1
    applymentDetailInfo.mchFullName = '商户_' + (applymentDetailInfo.idcardName ? applymentDetailInfo.idcardName : '')
  } else {
    if (!applymentDetailInfo.enterpriseNature) {
      return
    }
    // 股份和有限公司
    if (applymentDetailInfo.enterpriseNature == 'STOCK_COMPANY' || applymentDetailInfo.enterpriseNature == 'LIMITED_COMPANY') {
      applymentDetailInfo.merchantType = 3
    // 个体工商户
    } else if (applymentDetailInfo.enterpriseNature == 'INDIVIDUAL_BUSINESS') {
      applymentDetailInfo.merchantType = 2
    // 事业单位
    } else if (applymentDetailInfo.enterpriseNature == 'GOVERNMENT_INSTITUTION') {
      applymentDetailInfo.merchantType = 4
    // 其他组织
    } else {
      applymentDetailInfo.merchantType = 5
    }
  }
}

// 当商户类型或是企业性质发送改变时清除微信经营类目
function clearWxMcc(){
  applymentDetailInfo.wxMccCode = ''
}

function changeSettInfo(){
  if (applymentDetailInfo.bankAccountType == 'PRIVATE_DEBIT_ACCOUNT') {
    applymentDetailInfo.settAccountName = applymentDetailInfo.idcardName
    applymentDetailInfo.bankAccountIdCardNo = applymentDetailInfo.idcardNo
  } else {
    applymentDetailInfo.settAccountName = applymentDetailInfo.mchFullName
    applymentDetailInfo.bankAccountIdCardNo = ''
  }
}
defineExpose({ saveDataPreCallback })

</script>

