wupengfei
3 天以前 9ec7e7f0d7d91a3fec413ea490b70ecefbb2a211
src/views/EnterpriseManage/components/WechatConfigureView.vue
@@ -1,6 +1,6 @@
<template>
  <LoadingLayout :loading="isLoading">
    <ProForm :model="form" ref="dialogForm" label-width="150px">
    <ProForm :model="form" ref="dialogForm" label-width="210px">
      <ProFormItemV2
        label="业务申请编号:"
        prop="business_code"
@@ -30,6 +30,7 @@
          :maxlength="100"
          v-model.trim="form.contact_name"
          placeholder="请输入超级管理员姓名"
          show-word-limit
        >
        </ProFormText>
      </ProFormItemV2>
@@ -75,17 +76,39 @@
          ></ProFormImageUpload>
        </ProFormItemV2>
        <ProFormItemV2
          label="证件有效期:"
          prop="contact_period"
          :check-rules="[{ type: 'array', message: '请选择证件有效期' }]"
          label="证件有效期开始时间:"
          prop="contact_period_begin"
          :check-rules="[{ message: '请选择证件有效期开始时间' }]"
        >
          <ProFormDatePicker v-model="form.contact_period_begin" type="date"></ProFormDatePicker>
        </ProFormItemV2>
        <ProFormItemV2 label="证件有效期是否为长期:" prop="contact_period_isLong">
          <ProFormRadio
            v-model.trim="form.contact_period_isLong"
            :value-enum="BooleanOptions"
            :button-style="false"
          />
        </ProFormItemV2>
        <ProFormItemV2
          v-if="!form.contact_period_isLong"
          label="证件有效期结束时间:"
          prop="contact_period_end"
          :check-rules="[
            {
              message: '请选择证件有效期结束时间',
              validator: (rule, value, callback) => {
                if (dayjs(value).isAfter(dayjs(form.contact_period_begin))) {
                  callback();
                }
                callback(new Error('结束时间不能小于开始时间'));
              },
            },
          ]"
        >
          <ProFormDatePicker
            v-model="form.contact_period"
            type="daterange"
            range-separator="~"
            start-placeholder="起始日期"
            end-placeholder="到期日期"
            clearable
            v-model="form.contact_period_end"
            type="date"
            placeholder="请选择证件有效期结束时间"
          ></ProFormDatePicker>
        </ProFormItemV2>
        <ProFormItemV2
@@ -98,7 +121,7 @@
              v-model:file-url="form.business_authorization_letter"
              :limit="1"
              :limitFileSize="10"
              accept="png,jpg,jpeg,pdf"
              accept="jpg/jpeg,png"
            ></ProFormUpload>
            <el-button style="margin-left: 10px" type="primary" link @click="downloadTemplate"
              >模板下载</el-button
@@ -149,7 +172,7 @@
            v-model:file-url="form.license_copy"
            :limitFileCount="1"
            :on-success="handleLicenseUrlChange"
            accept="jpg/jpeg,png,pdf"
            accept="jpg/jpeg,png"
          ></ProFormUpload>
        </ProFormItemV2>
        <ProFormItemV2
@@ -182,6 +205,7 @@
            :maxlength="100"
            v-model.trim="form.legal_person"
            placeholder="请输入法人姓名"
            show-word-limit
          />
        </ProFormItemV2>
      </template>
@@ -232,6 +256,7 @@
            :maxlength="128"
            v-model.trim="form.cert_merchant_name"
            placeholder="请输入商户名称"
            show-word-limit
          />
        </ProFormItemV2>
        <ProFormItemV2
@@ -244,6 +269,7 @@
            :maxlength="128"
            v-model.trim="form.cert_company_address"
            placeholder="请输入注册地址"
            show-word-limit
          />
        </ProFormItemV2>
        <ProFormItemV2
@@ -256,20 +282,43 @@
            :maxlength="100"
            v-model.trim="form.cert_legal_person"
            placeholder="请输入法定代表人"
            show-word-limit
          />
        </ProFormItemV2>
        <ProFormItemV2
          label="证件有效期:"
          prop="cert_period"
          :check-rules="[{ type: 'array', message: '请选择证件有效期' }]"
          label="证件有效期开始时间:"
          prop="cert_period_begin"
          :check-rules="[{ message: '请选择证件有效期开始时间' }]"
        >
          <ProFormDatePicker v-model="form.cert_period_begin" type="date"></ProFormDatePicker>
        </ProFormItemV2>
        <ProFormItemV2 label="证件有效期是否为长期:" prop="cert_period_isLong">
          <ProFormRadio
            v-model.trim="form.cert_period_isLong"
            :value-enum="BooleanOptions"
            :button-style="false"
          />
        </ProFormItemV2>
        <ProFormItemV2
          v-if="!form.cert_period_isLong"
          label="证件有效期结束时间:"
          prop="cert_period_end"
          :check-rules="[
            {
              message: '请选择证件有效期结束时间',
              validator: (rule, value, callback) => {
                if (dayjs(value).isAfter(dayjs(form.cert_period_begin))) {
                  callback();
                }
                callback(new Error('结束时间不能小于开始时间'));
              },
            },
          ]"
        >
          <ProFormDatePicker
            v-model="form.cert_period"
            type="daterange"
            range-separator="~"
            start-placeholder="起始日期"
            end-placeholder="到期日期"
            clearable
            v-model="form.cert_period_end"
            type="date"
            placeholder="请选择证件有效期结束时间"
          ></ProFormDatePicker>
        </ProFormItemV2>
      </template>
@@ -312,7 +361,7 @@
            v-model:file-url="form.authorize_letter_copy"
            :limit="1"
            :limitFileSize="10"
            accept="png,jpg,jpeg,pdf"
            accept="jpg/jpeg,png"
          ></ProFormUpload>
          <el-button style="margin-left: 10px" type="primary" link @click="downloadFRTemplate"
            >模板下载</el-button
@@ -331,23 +380,21 @@
          prop="id_card_copy"
          :check-rules="[{ type: 'upload', message: '请上传身份证人像面' }]"
        >
          <ProFormUpload
          <ProFormImageUpload
            v-model:file-url="form.id_card_copy"
            :limitFileCount="1"
            :limit-file-count="1"
            :on-success="handleFrontImgUrlChange"
            accept="jpg/jpeg,png,pdf"
          ></ProFormUpload>
          ></ProFormImageUpload>
        </ProFormItemV2>
        <ProFormItemV2
          label="身份证国徽面:"
          prop="id_card_national"
          :check-rules="[{ type: 'upload', message: '请上传身份证国徽面' }]"
        >
          <ProFormUpload
          <ProFormImageUpload
            v-model:file-url="form.id_card_national"
            :limitFileCount="1"
            accept="jpg/jpeg,png,pdf"
          ></ProFormUpload>
            :limit-file-count="1"
          ></ProFormImageUpload>
        </ProFormItemV2>
        <ProFormItemV2
          label="身份证姓名:"
@@ -359,6 +406,7 @@
            :maxlength="100"
            v-model.trim="form.id_card_name"
            placeholder="请输入身份证姓名"
            show-word-limit
          />
        </ProFormItemV2>
        <ProFormItemV2
@@ -369,17 +417,51 @@
          <ProFormText v-model.trim="form.id_card_number" placeholder="请输入身份证号码" />
        </ProFormItemV2>
        <ProFormItemV2
          label="身份证有效期:"
          prop="id_card_period"
          :checkRules="[{ message: '请选择身份证有效期', type: 'array' }]"
          v-if="form.subject_type === EnumWeChatPayApplymentSubjectType.SUBJECT_TYPE_ENTERPRISE"
          label="身份证居住地址:"
          prop="id_card_address"
          :checkRules="[{ message: '请输入身份证居住地址' }]"
        >
          <ProFormText v-model.trim="form.id_card_address" placeholder="请输入身份证居住地址" />
        </ProFormItemV2>
        <ProFormItemV2
          label="身份证有效期开始时间:"
          prop="card_period_begin"
          :checkRules="[{ message: '请选择身份证有效期开始时间' }]"
        >
          <ProFormDatePicker
            v-model="form.id_card_period"
            type="daterange"
            range-separator="~"
            start-placeholder="起始日期"
            end-placeholder="到期日期"
            clearable
            v-model="form.card_period_begin"
            type="date"
            placeholder="请选择身份证有效期开始时间"
          ></ProFormDatePicker>
        </ProFormItemV2>
        <ProFormItemV2 label="身份证有效期是否为长期:" prop="card_period_isLong">
          <ProFormRadio
            v-model.trim="form.card_period_isLong"
            :value-enum="BooleanOptions"
            :button-style="false"
          />
        </ProFormItemV2>
        <ProFormItemV2
          v-if="!form.card_period_isLong"
          label="身份证有效期结束时间:"
          prop="card_period_end"
          :checkRules="[
            {
              message: '请选择身份证有效期结束时间',
              validator: (rule, value, callback) => {
                if (dayjs(value).isAfter(dayjs(form.card_period_begin))) {
                  callback();
                }
                callback(new Error('结束时间不能小于开始时间'));
              },
            },
          ]"
        >
          <ProFormDatePicker
            v-model="form.card_period_end"
            type="date"
            placeholder="请选择身份证有效期结束时间"
          ></ProFormDatePicker>
        </ProFormItemV2>
      </template>
@@ -398,7 +480,7 @@
          <ProFormUpload
            v-model:file-url="form.id_doc_copy"
            :limitFileCount="1"
            accept="jpg/jpeg,png,pdf"
            accept="jpg/jpeg,png"
          ></ProFormUpload>
        </ProFormItemV2>
@@ -412,6 +494,7 @@
            :maxlength="100"
            v-model.trim="form.id_doc_name"
            placeholder="请输入证件姓名"
            show-word-limit
          />
        </ProFormItemV2>
        <ProFormItemV2
@@ -422,17 +505,39 @@
          <ProFormText v-model.trim="form.id_doc_number" placeholder="请输入证件号码" />
        </ProFormItemV2>
        <ProFormItemV2
          label="证件有效期:"
          prop="id_doc_period"
          :checkRules="[{ message: '请选择证件有效期', type: 'array' }]"
          label="证件有效期开始时间:"
          prop="doc_period_begin"
          :checkRules="[{ message: '请选择证件有效期开始时间' }]"
        >
          <ProFormDatePicker v-model="form.doc_period_begin" type="date"></ProFormDatePicker>
        </ProFormItemV2>
        <ProFormItemV2 label="证件有效期是否为长期:" prop="doc_period_isLong">
          <ProFormRadio
            v-model.trim="form.doc_period_isLong"
            :value-enum="BooleanOptions"
            :button-style="false"
          />
        </ProFormItemV2>
        <ProFormItemV2
          v-if="!form.doc_period_isLong"
          label="证件有效期结束时间:"
          prop="doc_period_end"
          :checkRules="[
            {
              message: '请选择证件有效期结束时间',
              validator: (rule, value, callback) => {
                if (dayjs(value).isAfter(dayjs(form.doc_period_begin))) {
                  callback();
                }
                callback(new Error('结束时间不能小于开始时间'));
              },
            },
          ]"
        >
          <ProFormDatePicker
            v-model="form.id_doc_period"
            type="daterange"
            range-separator="~"
            start-placeholder="起始日期"
            end-placeholder="到期日期"
            clearable
            v-model="form.doc_period_end"
            type="date"
            placeholder="请选择证件有效期结束时间"
          ></ProFormDatePicker>
        </ProFormItemV2>
      </template>
@@ -449,7 +554,7 @@
        </div>
        <div v-for="(item, index) in form.ubo_info_list" :key="index">
          <ProFormItemV2
            :label="`第${index + 1}个证件类型:`"
            :label="`受益人证件类型:`"
            :prop="`ubo_info_list.${index}.ubo_id_doc_type`"
            :checkRules="[{ message: '请选择证件类型' }]"
          >
@@ -461,7 +566,7 @@
            </ProFormSelect>
          </ProFormItemV2>
          <ProFormItemV2
            :label="`第${index + 1}个证件正面照片:`"
            :label="`受益人证件正面照片:`"
            :prop="`ubo_info_list.${index}.ubo_id_doc_copy`"
            :check-rules="[{ type: 'upload', message: '请上传证件正面照片' }]"
          >
@@ -471,7 +576,21 @@
            ></ProFormImageUpload>
          </ProFormItemV2>
          <ProFormItemV2
            :label="`第${index + 1}个证件姓名:`"
            v-if="
              item.ubo_id_doc_type !==
              EnumWeChatPayApplymentIdDocType.IDENTIFICATION_TYPE_OVERSEA_PASSPORT
            "
            :label="`受益人证件反面照片:`"
            :prop="`ubo_info_list.${index}.ubo_id_doc_copy_back`"
            :check-rules="[{ type: 'upload', message: '请上传证件反面照片' }]"
          >
            <ProFormImageUpload
              v-model:file-url="item.ubo_id_doc_copy_back"
              :limit-file-count="1"
            ></ProFormImageUpload>
          </ProFormItemV2>
          <ProFormItemV2
            :label="`受益人证件姓名:`"
            :prop="`ubo_info_list.${index}.ubo_id_doc_name`"
            :checkRules="[{ message: '请输入证件姓名' }]"
          >
@@ -480,34 +599,64 @@
              :maxlength="100"
              v-model.trim="item.ubo_id_doc_name"
              placeholder="请输入证件姓名"
              show-word-limit
            />
          </ProFormItemV2>
          <ProFormItemV2
            :label="`第${index + 1}个证件号码:`"
            :label="`受益人证件号码:`"
            :prop="`ubo_info_list.${index}.ubo_id_doc_number`"
            :checkRules="[{ message: '请输入证件号码' }]"
          >
            <ProFormText v-model.trim="item.ubo_id_doc_number" placeholder="请输入证件号码" />
          </ProFormItemV2>
          <ProFormItemV2
            :label="`第${index + 1}个证件居住地址:`"
            :label="`受益人证件居住地址:`"
            :prop="`ubo_info_list.${index}.ubo_id_doc_address`"
            :checkRules="[{ message: '请输入证件居住地址' }]"
          >
            <ProFormText v-model.trim="item.ubo_id_doc_address" placeholder="请输入证件居住地址" />
          </ProFormItemV2>
          <ProFormItemV2
            :label="`第${index + 1}个证件有效期:`"
            :prop="`ubo_info_list.${index}.ubo_period`"
            :checkRules="[{ message: '请选择证件有效期', type: 'array' }]"
            :label="`证件有效期开始时间:`"
            :prop="`ubo_info_list.${index}.ubo_period_begin`"
            :checkRules="[{ message: '请选择证件有效期开始时间' }]"
          >
            <ProFormDatePicker
              v-model="item.ubo_period"
              type="daterange"
              range-separator="~"
              start-placeholder="起始日期"
              end-placeholder="到期日期"
              clearable
              v-model="item.ubo_period_begin"
              type="date"
              placeholder="请选择证件有效期开始时间"
            ></ProFormDatePicker>
          </ProFormItemV2>
          <ProFormItemV2
            label="证件有效期是否为长期:"
            :prop="`ubo_info_list.${index}.ubo_period_isLong`"
          >
            <ProFormRadio
              v-model.trim="item.ubo_period_isLong"
              :value-enum="BooleanOptions"
              :button-style="false"
            />
          </ProFormItemV2>
          <ProFormItemV2
            v-if="!item.ubo_period_isLong"
            :label="`证件有效期结束时间:`"
            :prop="`ubo_info_list.${index}.ubo_period_end`"
            :checkRules="[
              {
                message: '请选择证件有效期结束时间',
                validator: (rule, value, callback) => {
                  if (dayjs(value).isAfter(dayjs(item.ubo_period_begin))) {
                    callback();
                  }
                  callback(new Error('结束时间不能小于开始时间'));
                },
              },
            ]"
          >
            <ProFormDatePicker
              v-model="item.ubo_period_end"
              type="date"
              placeholder="请选择证件有效期结束时间"
            ></ProFormDatePicker>
          </ProFormItemV2>
          <el-button type="primary" link @click="deleteUboInfo(index)">删除</el-button>
@@ -564,6 +713,7 @@
            :maxlength="50"
            v-model.trim="form.biz_store_name"
            placeholder="请输入线下场所名称"
            show-word-limit
          />
        </ProFormItemV2>
        <ProFormItemV2
@@ -571,10 +721,15 @@
          prop="biz_address_code"
          :checkRules="[{ message: '请输入线下场所省市编码', type: 'number' }]"
        >
          <ProFormText v-model.trim="form.biz_address_code" placeholder="请输入线下场所省市编码" />
          <el-button type="primary" link @click="downloadAddressCodeTemplate"
            >省市编码模板</el-button
          >
          <div style="display: flex; width: 100%">
            <ProFormText
              v-model.trim="form.biz_address_code"
              placeholder="请输入线下场所省市编码"
            />
            <el-button type="primary" link @click="downloadAddressCodeTemplate"
              >省市编码模板</el-button
            >
          </div>
        </ProFormItemV2>
        <ProFormItemV2
          label="线下场所地址:"
@@ -586,6 +741,7 @@
            :minlength="4"
            v-model.trim="form.biz_store_address"
            placeholder="请输入线下场所地址"
            show-word-limit
          />
        </ProFormItemV2>
        <ProFormItemV2
@@ -722,6 +878,36 @@
          ></ProFormUpload>
        </ProFormItemV2>
      </template>
      <template
        v-if="
          form.sales_scenes_type.includes(EnumWeChatPayApplymentSalesScenesType.SALES_SCENES_WEB)
        "
      >
        <ProFormItemV2
          label="互联网网站域名:"
          prop="domain"
          :checkRules="[{ message: '请输入互联网网站域名' }]"
        >
          <ProFormText v-model.trim="form.domain" placeholder="请输入互联网网站域名" />
        </ProFormItemV2>
        <ProFormItemV2 label="网站授权函:" prop="web_authorisation">
          <div style="display: flex">
            <ProFormUpload
              v-model:file-url="form.web_authorisation"
              :limit="1"
              :limitFileSize="10"
              accept="jpg/jpeg,png,pdf"
            ></ProFormUpload>
            <el-button
              style="margin-left: 10px"
              type="primary"
              link
              @click="downloadWebAuthorisationTemplate"
              >模板下载</el-button
            >
          </div>
        </ProFormItemV2>
      </template>
      <template
        v-if="
@@ -783,37 +969,6 @@
      <template
        v-if="
          form.sales_scenes_type.includes(EnumWeChatPayApplymentSalesScenesType.SALES_SCENES_WEB)
        "
      >
        <ProFormItemV2
          label="互联网网站域名:"
          prop="domain"
          :checkRules="[{ message: '请输入互联网网站域名' }]"
        >
          <ProFormText v-model.trim="form.domain" placeholder="请输入互联网网站域名" />
        </ProFormItemV2>
        <ProFormItemV2 label="网站授权函:" prop="web_authorisation">
          <div style="display: flex">
            <ProFormUpload
              v-model:file-url="form.web_authorisation"
              :limit="1"
              :limitFileSize="10"
              accept="png,jpg,jpeg,pdf"
            ></ProFormUpload>
            <el-button
              style="margin-left: 10px"
              type="primary"
              link
              @click="downloadWebAuthorisationTemplate"
              >模板下载</el-button
            >
          </div>
        </ProFormItemV2>
      </template>
      <template
        v-if="
          form.sales_scenes_type.includes(EnumWeChatPayApplymentSalesScenesType.SALES_SCENES_WEWORK)
        "
      >
@@ -859,6 +1014,7 @@
          :maxlength="50"
          v-model.trim="form.qualification_type"
          placeholder="请输入所属行业(详细参见费率结算规则对照表)"
          show-word-limit
        />
      </ProFormItemV2>
      <ProFormItemV2 label="特殊资质图片:" prop="qualifications">
@@ -871,7 +1027,7 @@
      >
        <ProFormSelect
          v-model="form.bank_account_type"
          :valueEnum="EnumWeChatPayApplymentBankAccountTypeText"
          :valueEnum="bank_account_typeList"
          placeholder="请选择结算银行账户类型"
        >
        </ProFormSelect>
@@ -885,33 +1041,43 @@
      </ProFormItemV2>
      <ProFormItemV2
        label="开户银行:"
        prop="account_bank"
        prop="bank_alias"
        :checkRules="[{ message: '请输入开户银行' }]"
      >
        <ProFormText v-model.trim="form.account_bank" placeholder="请输入开户银行" />
        <WeChatPayWalletBanksSelect
          v-model:bank_alias="form.bank_alias"
          v-model:account_bank="form.account_bank"
          v-model:account_bank_code="form.account_bank_code"
          v-model:bank_alias_code="form.bank_alias_code"
          v-model:need_bank_branch="form.need_bank_branch"
          :bank_account_type="form.bank_account_type"
          placeholder="请输入开户银行"
          clearable
          filterable
        />
      </ProFormItemV2>
      <ProFormItemV2
        label="开户银行省市编码:"
        prop="bank_address_code"
        :checkRules="[{ message: '请输入开户银行省市编码' }]"
      >
        <ProFormText v-model.trim="form.bank_address_code" placeholder="请输入开户银行省市编码" />
        <el-button type="primary" link @click="downloadAddressCodeTemplate">省市编码模板</el-button>
      </ProFormItemV2>
      <ProFormItemV2
        label="开户银行银行号:"
        prop="bank_branch_id"
        :checkRules="[{ message: '请输入开户银行银行号' }]"
      >
        <ProFormText v-model.trim="form.bank_branch_id" placeholder="请输入开户银行银行号" />
      </ProFormItemV2>
      <ProFormItemV2
        label="开户银行全称(含支行):"
        prop="bank_name"
        :checkRules="[{ message: '请输入开户银行全称(含支行)' }]"
      >
        <ProFormText v-model.trim="form.bank_name" placeholder="请输入开户银行全称(含支行)" />
      </ProFormItemV2>
      <template v-if="form.need_bank_branch">
        <ProFormItemV2
          label="开户支行省市编码:"
          prop="bank_branch_area"
          :checkRules="[{ message: '请输入开户银行银行号' }]"
        >
          <WeChatPayWalletBankBranchAreaCascader v-model:areaList="form.bank_branch_area" />
        </ProFormItemV2>
        <ProFormItemV2
          label="开户银行全称(含支行):"
          prop="bank_branch_id"
          :checkRules="[{ message: '请输入开户银行全称(含支行)' }]"
        >
          <WeChatPayWalletBankBranchsSelect
            v-model:bank_branch_id="form.bank_branch_id"
            placeholder="请输入"
            :bank_alias_code="form.bank_alias_code"
            :need_bank_branch="form.need_bank_branch"
            :city_code="form.bank_branch_area?.[1]"
          />
        </ProFormItemV2>
      </template>
      <ProFormItemV2
        label="银行账号:"
        prop="account_number"
@@ -924,7 +1090,7 @@
</template>
<script setup lang="ts">
import { FormInstance, ModelValueType } from 'element-plus';
import { FormInstance } from 'element-plus';
import {
  ProForm,
  ProFormItemV2,
@@ -933,11 +1099,9 @@
  UploadUserFile,
  ProFormSelect,
  ProFormUpload,
  useFormDialog,
  ProFormRadio,
  ProFormDatePicker,
  ProFormImageUpload,
  ProFormInputNumber,
} from '@bole-core/components';
import * as enterpriseWalletServices from '@/services/api/enterpriseWallet';
import { useQuery } from '@tanstack/vue-query';
@@ -958,9 +1122,15 @@
  EnumWeChatPayApplymentSalesScenesType,
  EnumWeChatPayApplymentSalesScenesTypeText,
  EnumWeChatPayApplymentBankAccountTypeText,
  EnumWeChatPayApplymentBankAccountTypeTextForGTH,
  BooleanOptions,
} from '@/constants';
import { convertApi2FormUrl, convertApi2FormUrlOnlyOne, downloadFileByUrl, format } from '@/utils';
import { convertApi2FormUrlOnlyOne, downloadFileByUrl, format, convertApi2FormUrls } from '@/utils';
import { Message } from '@bole-core/core';
import WeChatPayWalletBanksSelect from './WeChatPayWalletBanksSelect.vue';
import WeChatPayWalletBankBranchsSelect from './WeChatPayWalletBankBranchsSelect.vue';
import WeChatPayWalletBankBranchAreaCascader from './WeChatPayWalletBankBranchAreaCascader.vue';
import dayjs from 'dayjs';
defineOptions({
  name: 'WechatConfigureView',
@@ -973,10 +1143,13 @@
type UboInfo = {
  ubo_id_doc_type: EnumWeChatPayApplymentIdDocType;
  ubo_id_doc_copy: UploadUserFile[];
  ubo_id_doc_copy_back: UploadUserFile[];
  ubo_id_doc_name: string;
  ubo_id_doc_number: string;
  ubo_id_doc_address: string;
  ubo_period: ModelValueType;
  ubo_period_begin: string;
  ubo_period_end: string;
  ubo_period_isLong: boolean;
};
const props = withDefaults(defineProps<Props>(), {});
@@ -991,7 +1164,9 @@
  contact_id_number: '',
  contact_id_doc_copy: [] as UploadUserFile[],
  contact_id_doc_copy_back: [] as UploadUserFile[],
  contact_period: [] as ModelValueType,
  contact_period_begin: '',
  contact_period_end: '',
  contact_period_isLong: false,
  business_authorization_letter: [] as UploadUserFile[],
  mobile_phone: '',
  contact_email: '',
@@ -1006,7 +1181,9 @@
  cert_merchant_name: '',
  cert_company_address: '',
  cert_legal_person: '',
  cert_period: [] as ModelValueType,
  cert_period_begin: '',
  cert_period_end: '',
  cert_period_isLong: false,
  id_holder_type: '' as any as EnumWeChatPayApplymentIdHolderType,
  id_doc_type: '' as any as EnumWeChatPayApplymentIdDocType,
  authorize_letter_copy: [] as UploadUserFile[],
@@ -1015,11 +1192,15 @@
  id_card_name: '',
  id_card_number: '',
  id_card_address: '',
  id_card_period: [] as ModelValueType,
  card_period_begin: '',
  card_period_end: '',
  card_period_isLong: false,
  id_doc_copy: [] as UploadUserFile[],
  id_doc_name: '',
  id_doc_number: '',
  id_doc_period: [] as ModelValueType,
  doc_period_begin: '',
  doc_period_end: '',
  doc_period_isLong: false,
  ubo_info_list: [] as UboInfo[],
  merchant_shortname: '',
  service_phone: '',
@@ -1052,6 +1233,11 @@
  bank_branch_id: '',
  bank_name: '',
  account_number: '',
  bank_alias_code: '',
  bank_alias: '',
  account_bank_code: '' as any as number,
  need_bank_branch: false,
  bank_branch_area: [] as number[],
});
const EnumWeChatPayApplymentCertTypeTextList = computed(() => {
@@ -1084,6 +1270,13 @@
  return EnumWeChatPayApplymentIdDocTypeText;
});
const bank_account_typeList = computed(() => {
  if (form.subject_type === EnumWeChatPayApplymentSubjectType.SUBJECT_TYPE_INDIVIDUAL) {
    return EnumWeChatPayApplymentBankAccountTypeTextForGTH;
  }
  return EnumWeChatPayApplymentBankAccountTypeText;
});
const { isLoading, refetch } = useQuery({
  queryKey: [
    'enterpriseWalletServices/getEnterpriseWallet',
@@ -1099,7 +1292,7 @@
    form.business_code = data.business_code ?? '';
    form.contact_type = data.contact_info?.contact_type;
    form.contact_name = data.contact_info?.contact_name ?? '';
    form.contact_id_doc_type = data.contact_info?.contact_id_doc_type;
    form.contact_id_doc_type = data.contact_info?.contact_id_doc_type ?? ('' as any);
    form.contact_id_number = data.contact_info?.contact_id_number ?? '';
    form.contact_id_doc_copy = convertApi2FormUrlOnlyOne(
      data.contact_info?.contact_id_doc_copy ?? ''
@@ -1107,10 +1300,11 @@
    form.contact_id_doc_copy_back = convertApi2FormUrlOnlyOne(
      data.contact_info?.contact_id_doc_copy_back ?? ''
    );
    form.contact_period = [
      format(data.contact_info?.contact_period_begin, 'YYYY-MM-DD'),
      format(data.contact_info?.contact_period_end, 'YYYY-MM-DD'),
    ];
    form.contact_period_begin = format(data.contact_info?.contact_period_begin, 'YYYY-MM-DD');
    form.contact_period_isLong = !dayjs(data.contact_info?.contact_period_end).isValid();
    form.contact_period_end = dayjs(data.contact_info?.contact_period_end).isValid()
      ? format(data.contact_info?.contact_period_end, 'YYYY-MM-DD')
      : data.contact_info?.contact_period_end;
    form.business_authorization_letter = convertApi2FormUrlOnlyOne(
      data.contact_info?.business_authorization_letter ?? ''
    );
@@ -1131,10 +1325,14 @@
    form.cert_merchant_name = data.subject_info?.certificate_info?.merchant_name ?? '';
    form.cert_company_address = data.subject_info?.certificate_info?.company_address ?? '';
    form.cert_legal_person = data.subject_info?.certificate_info?.legal_person ?? '';
    form.cert_period = [
      format(data.subject_info?.certificate_info?.period_begin, 'YYYY-MM-DD'),
      format(data.subject_info?.certificate_info?.period_end, 'YYYY-MM-DD'),
    ];
    form.cert_period_begin = format(
      data.subject_info?.certificate_info?.period_begin,
      'YYYY-MM-DD'
    );
    form.cert_period_isLong = !dayjs(data.subject_info?.certificate_info?.period_end).isValid();
    form.cert_period_end = dayjs(data.subject_info?.certificate_info?.period_end).isValid()
      ? format(data.subject_info?.certificate_info?.period_end, 'YYYY-MM-DD')
      : data.subject_info?.certificate_info?.period_end;
    form.id_holder_type = data.subject_info?.identity_info?.id_holder_type;
    form.id_doc_type = data.subject_info?.identity_info?.id_doc_type;
    form.authorize_letter_copy = convertApi2FormUrlOnlyOne(
@@ -1147,32 +1345,63 @@
      data.subject_info?.identity_info?.id_card_info?.id_card_national ?? ''
    );
    form.id_card_name = data.subject_info?.identity_info?.id_card_info?.id_card_name ?? '';
    form.id_card_number = data.subject_info?.identity_info?.id_card_info?.id_card_number ?? '';
    form.id_card_address = data.subject_info?.identity_info?.id_card_info?.id_card_address ?? '';
    form.card_period_begin = format(
      data.subject_info?.identity_info?.id_card_info?.card_period_begin,
      'YYYY-MM-DD'
    );
    form.card_period_isLong = !dayjs(
      data.subject_info?.identity_info?.id_card_info?.card_period_end
    ).isValid();
    form.card_period_end = dayjs(
      data.subject_info?.identity_info?.id_card_info?.card_period_end
    ).isValid()
      ? format(data.subject_info?.identity_info?.id_card_info?.card_period_end, 'YYYY-MM-DD')
      : data.subject_info?.identity_info?.id_card_info?.card_period_end;
    form.id_doc_copy = convertApi2FormUrlOnlyOne(
      data.subject_info?.identity_info?.id_doc_info?.id_doc_copy ?? ''
    );
    form.id_doc_name = data.subject_info?.identity_info?.id_doc_info?.id_doc_name ?? '';
    form.id_doc_number = data.subject_info?.identity_info?.id_doc_info?.id_doc_number ?? '';
    form.id_doc_period = [
      format(data.subject_info?.identity_info?.id_doc_info?.doc_period_begin, 'YYYY-MM-DD'),
      format(data.subject_info?.identity_info?.id_doc_info?.doc_period_end, 'YYYY-MM-DD'),
    ];
    form.doc_period_begin = format(
      data.subject_info?.identity_info?.id_doc_info?.doc_period_begin,
      'YYYY-MM-DD'
    );
    form.doc_period_isLong = !dayjs(
      data.subject_info?.identity_info?.id_doc_info?.doc_period_end
    ).isValid();
    form.doc_period_end = dayjs(
      data.subject_info?.identity_info?.id_doc_info?.doc_period_end
    ).isValid()
      ? format(data.subject_info?.identity_info?.id_doc_info?.doc_period_end, 'YYYY-MM-DD')
      : data.subject_info?.identity_info?.id_doc_info?.doc_period_end;
    form.ubo_info_list =
      data.subject_info?.ubo_info_list?.length > 0
        ? data.subject_info?.ubo_info_list.map((x) => ({
            ubo_id_doc_type: x.ubo_id_doc_type,
            ubo_id_doc_copy: convertApi2FormUrlOnlyOne(x.ubo_id_doc_copy ?? ''),
            ubo_id_doc_copy_back: convertApi2FormUrlOnlyOne(x.ubo_id_doc_copy_back ?? ''),
            ubo_id_doc_name: x.ubo_id_doc_name,
            ubo_id_doc_number: x.ubo_id_doc_number,
            ubo_id_doc_address: x.ubo_id_doc_address,
            ubo_period: [
              format(x.ubo_period_begin, 'YYYY-MM-DD'),
              format(x.ubo_period_end, 'YYYY-MM-DD'),
            ],
            ubo_period_begin: format(x.ubo_period_begin, 'YYYY-MM-DD'),
            ubo_period_isLong: !dayjs(x.ubo_period_end).isValid(),
            ubo_period_end: dayjs(x.ubo_period_end).isValid()
              ? format(x.ubo_period_end, 'YYYY-MM-DD')
              : x.ubo_period_end,
          }))
        : [
            {
              ubo_id_doc_type: '' as any as EnumWeChatPayApplymentIdDocType,
              ubo_id_doc_copy: [],
              ubo_id_doc_copy_back: [],
              ubo_id_doc_name: '',
              ubo_id_doc_number: '',
              ubo_id_doc_address: '',
              ubo_period: [],
              ubo_period_begin: '',
              ubo_period_end: '',
              ubo_period_isLong: false,
            },
          ];
    form.merchant_shortname = data.business_info?.merchant_shortname ?? '';
@@ -1182,55 +1411,36 @@
    form.biz_address_code = data.business_info?.sales_info?.biz_store_info?.biz_address_code;
    form.biz_store_address =
      data.business_info?.sales_info?.biz_store_info?.biz_store_address ?? '';
    form.store_entrance_pic =
      data.business_info?.sales_info?.biz_store_info?.store_entrance_pic.length > 0
        ? data.business_info?.sales_info?.biz_store_info?.store_entrance_pic.map((x) =>
            convertApi2FormUrl(x)
          )
        : [];
    form.indoor_pic =
      data.business_info?.sales_info?.biz_store_info?.indoor_pic.length > 0
        ? data.business_info?.sales_info?.biz_store_info?.indoor_pic.map((x) =>
            convertApi2FormUrl(x)
          )
        : [];
    form.store_entrance_pic = convertApi2FormUrls(
      data.business_info?.sales_info?.biz_store_info?.store_entrance_pic
    );
    form.indoor_pic = convertApi2FormUrls(
      data.business_info?.sales_info?.biz_store_info?.indoor_pic
    );
    form.mp_appid = data.business_info?.sales_info?.mp_info?.mp_appid ?? '';
    form.mp_sub_appid = data.business_info?.sales_info?.mp_info?.mp_sub_appid ?? '';
    form.mp_pics =
      data.business_info?.sales_info?.mp_info?.mp_pics.length > 0
        ? data.business_info?.sales_info?.mp_info?.mp_pics.map((x) => convertApi2FormUrl(x))
        : [];
    form.mp_pics = convertApi2FormUrls(data.business_info?.sales_info?.mp_info?.mp_pics);
    form.mini_program_appid =
      data.business_info?.sales_info?.mini_program_info?.mini_program_appid ?? '';
    form.mini_program_sub_appid =
      data.business_info?.sales_info?.mini_program_info?.mini_program_sub_appid ?? '';
    form.mini_program_pics =
      data.business_info?.sales_info?.mini_program_info?.mini_program_pics.length > 0
        ? data.business_info?.sales_info?.mini_program_info?.mini_program_pics.map((x) =>
            convertApi2FormUrl(x)
          )
        : [];
    form.mini_program_pics = convertApi2FormUrls(
      data.business_info?.sales_info?.mini_program_info?.mini_program_pics
    );
    form.app_appid = data.business_info?.sales_info?.app_info?.app_appid ?? '';
    form.app_sub_appid = data.business_info?.sales_info?.app_info?.app_sub_appid ?? '';
    form.app_pics =
      data.business_info?.sales_info?.app_info?.app_pics.length > 0
        ? data.business_info?.sales_info?.app_info?.app_pics.map((x) => convertApi2FormUrl(x))
        : [];
    form.app_pics = convertApi2FormUrls(data.business_info?.sales_info?.app_info?.app_pics);
    form.domain = data.business_info?.sales_info?.web_info?.domain ?? '';
    form.web_authorisation = convertApi2FormUrlOnlyOne(
      data.business_info?.sales_info?.web_info?.web_authorisation ?? ''
    );
    form.sub_corp_id = data.business_info?.sales_info?.wework_info?.sub_corp_id ?? '';
    form.wework_pics =
      data.business_info?.sales_info?.wework_info?.wework_pics.length > 0
        ? data.business_info?.sales_info?.wework_info?.wework_pics.map((x) => convertApi2FormUrl(x))
        : [];
    form.wework_pics = convertApi2FormUrls(
      data.business_info?.sales_info?.wework_info?.wework_pics
    );
    form.settlement_id = data.settlement_info?.settlement_id ?? '';
    form.qualification_type = data.settlement_info?.qualification_type ?? '';
    form.qualifications =
      data.settlement_info?.qualifications?.length > 0
        ? data.settlement_info?.qualifications.map((x) => convertApi2FormUrl(x))
        : [];
    form.qualifications = convertApi2FormUrls(data.settlement_info?.qualifications);
    form.bank_account_type = data.bank_account_info?.bank_account_type;
    form.account_name = data.bank_account_info?.account_name ?? '';
    form.account_bank = data.bank_account_info?.account_bank ?? '';
@@ -1238,6 +1448,14 @@
    form.bank_branch_id = data.bank_account_info?.bank_branch_id ?? '';
    form.bank_name = data.bank_account_info?.bank_name ?? '';
    form.account_number = data.bank_account_info?.account_number ?? '';
    form.bank_alias_code = data.bank_account_info?.bank_alias_code ?? '';
    form.bank_alias = data.bank_account_info?.bank_alias ?? '';
    form.account_bank_code = data.bank_account_info?.account_bank_code;
    form.need_bank_branch = data.bank_account_info?.need_bank_branch ?? false;
    form.bank_branch_area = [
      data.bank_account_info?.province_code,
      data.bank_account_info?.city_code,
    ].filter(Boolean);
  },
});
@@ -1249,10 +1467,13 @@
  form.ubo_info_list.push({
    ubo_id_doc_type: '' as any as EnumWeChatPayApplymentIdDocType,
    ubo_id_doc_copy: [],
    ubo_id_doc_copy_back: [],
    ubo_id_doc_name: '',
    ubo_id_doc_number: '',
    ubo_id_doc_address: '',
    ubo_period: [],
    ubo_period_begin: '',
    ubo_period_end: '',
    ubo_period_isLong: false,
  });
}
@@ -1297,15 +1518,206 @@
  window.open('https://kf.qq.com/faq/220228IJb2UV220228uEjU3Q.html', '_blank');
}
async function enterpriseWalletExpandindirectCreate() {
async function openEnterpriseWeChatPayWallet() {
  try {
    if (!dialogForm.value) return;
    const valid = await dialogForm.value.validate();
    if (!valid) return;
    let params: API.EnterpriseWalletExpandindirectCreateCommand = {};
    let res = await enterpriseWalletServices.enterpriseWalletExpandindirectCreate(params);
    let params: API.OpenEnterpriseWeChatPayWalletCommand = {
      enterpriseId: props.id,
      business_code: form.business_code,
      contact_info: {
        contact_type: form.contact_type,
        contact_name: form.contact_name,
        mobile_phone: form.mobile_phone,
        contact_email: form.contact_email,
      },
      subject_info: {
        subject_type: form.subject_type,
        identity_info: {
          id_holder_type: form.id_holder_type,
        },
      },
      business_info: {
        merchant_shortname: form.merchant_shortname,
        service_phone: form.service_phone,
        sales_info: {
          sales_scenes_type: form.sales_scenes_type,
        },
      },
      settlement_info: {
        settlement_id: form.settlement_id,
        qualification_type: form.qualification_type,
        qualifications:
          form.qualifications?.length > 0 ? form.qualifications?.map((x) => x.path) : [],
      },
      bank_account_info: {
        bank_account_type: form.bank_account_type,
        account_name: form.account_name,
        account_bank: form.account_bank,
        bank_address_code: form.bank_address_code,
        bank_branch_id: form.bank_branch_id,
        bank_name: form.bank_name,
        account_number: form.account_number,
        bank_alias_code: form.bank_alias_code,
        province_code: form.bank_branch_area?.[0],
        city_code: form.bank_branch_area?.[1],
        bank_alias: form.bank_alias,
        account_bank_code: form.account_bank_code,
        need_bank_branch: form.need_bank_branch,
      },
    };
    if (form.contact_type === EnumWeChatPayApplymentContactType.SUPER) {
      params.contact_info.contact_id_doc_type = form.contact_id_doc_type;
      params.contact_info.contact_id_number = form.contact_id_number;
      params.contact_info.contact_id_doc_copy = form.contact_id_doc_copy?.[0]?.path;
      params.contact_info.contact_id_doc_copy_back = form.contact_id_doc_copy_back?.[0]?.path;
      params.contact_info.contact_period_begin = format(form.contact_period_begin, 'YYYY-MM-DD');
      params.contact_info.contact_period_end = form.contact_period_isLong
        ? '长期'
        : format(form.contact_period_end, 'YYYY-MM-DD');
      params.contact_info.business_authorization_letter =
        form.business_authorization_letter?.[0]?.path;
    }
    if (
      form.subject_type === EnumWeChatPayApplymentSubjectType.SUBJECT_TYPE_INDIVIDUAL ||
      form.subject_type === EnumWeChatPayApplymentSubjectType.SUBJECT_TYPE_ENTERPRISE
    ) {
      params.subject_info.business_license_info = {
        license_copy: form.license_copy?.[0]?.path,
        merchant_name: form.merchant_name,
        license_number: form.license_number,
        legal_person: form.legal_person,
      };
    }
    if (
      form.subject_type === EnumWeChatPayApplymentSubjectType.SUBJECT_TYPE_GOVERNMENT ||
      form.subject_type === EnumWeChatPayApplymentSubjectType.SUBJECT_TYPE_INSTITUTIONS ||
      form.subject_type === EnumWeChatPayApplymentSubjectType.SUBJECT_TYPE_OTHERS
    ) {
      params.subject_info.certificate_info.cert_copy = form.cert_copy?.[0]?.path;
      params.subject_info.certificate_info.cert_type = form.cert_type;
      params.subject_info.certificate_info.cert_number = form.cert_number;
      params.subject_info.certificate_info.merchant_name = form.cert_merchant_name;
      params.subject_info.certificate_info.company_address = form.cert_company_address;
      params.subject_info.certificate_info.legal_person = form.cert_legal_person;
      params.subject_info.certificate_info.period_begin = format(
        form.cert_period_begin,
        'YYYY-MM-DD'
      );
      params.subject_info.certificate_info.period_end = form.cert_period_isLong
        ? '长期'
        : format(form.cert_period_end, 'YYYY-MM-DD');
    }
    if (form.id_holder_type === EnumWeChatPayApplymentIdHolderType.LEGAL) {
      params.subject_info.identity_info.id_doc_type = form.id_doc_type;
    }
    if (form.id_holder_type === EnumWeChatPayApplymentIdHolderType.SUPER) {
      params.subject_info.identity_info.authorize_letter_copy =
        form.authorize_letter_copy?.[0]?.path;
    }
    if (
      form.id_holder_type === EnumWeChatPayApplymentIdHolderType.LEGAL &&
      form.id_doc_type === EnumWeChatPayApplymentIdDocType.IDENTIFICATION_TYPE_IDCARD
    ) {
      params.subject_info.identity_info.id_card_info = {
        id_card_copy: form.id_card_copy?.[0]?.path,
        id_card_national: form.id_card_national?.[0]?.path,
        id_card_name: form.id_card_name,
        id_card_number: form.id_card_number,
        card_period_begin: format(form.card_period_begin, 'YYYY-MM-DD'),
        card_period_end: form.card_period_isLong
          ? '长期'
          : format(form.card_period_end, 'YYYY-MM-DD'),
        id_card_address:
          form.subject_type === EnumWeChatPayApplymentSubjectType.SUBJECT_TYPE_ENTERPRISE
            ? form.id_card_address
            : '',
      };
    }
    if (
      form.id_holder_type === EnumWeChatPayApplymentIdHolderType.LEGAL &&
      form.id_doc_type !== EnumWeChatPayApplymentIdDocType.IDENTIFICATION_TYPE_IDCARD
    ) {
      params.subject_info.identity_info.id_doc_info = {
        id_doc_copy: form.id_doc_copy?.[0]?.path,
        id_doc_name: form.id_doc_name,
        id_doc_number: form.id_doc_number,
        doc_period_begin: format(form.doc_period_begin, 'YYYY-MM-DD'),
        doc_period_end: form.doc_period_isLong ? '长期' : format(form.doc_period_end, 'YYYY-MM-DD'),
      };
    }
    if (form.subject_type === EnumWeChatPayApplymentSubjectType.SUBJECT_TYPE_ENTERPRISE) {
      params.subject_info.ubo_info_list =
        form.ubo_info_list?.length > 0
          ? form.ubo_info_list.map((x) => ({
              ubo_id_doc_type: x.ubo_id_doc_type,
              ubo_id_doc_copy: x.ubo_id_doc_copy?.[0]?.path,
              ubo_id_doc_copy_back: x.ubo_id_doc_copy_back?.[0]?.path,
              ubo_id_doc_name: x.ubo_id_doc_name,
              ubo_id_doc_number: x.ubo_id_doc_number,
              ubo_id_doc_address: x.ubo_id_doc_address,
              ubo_period_begin: format(x.ubo_period_begin, 'YYYY-MM-DD'),
              ubo_period_end: x.ubo_period_isLong ? '长期' : format(x.ubo_period_end, 'YYYY-MM-DD'),
            }))
          : [];
    }
    if (form.sales_scenes_type.includes(EnumWeChatPayApplymentSalesScenesType.SALES_SCENES_STORE)) {
      params.business_info.sales_info.biz_store_info = {
        biz_store_name: form.biz_store_name,
        biz_address_code: form.biz_address_code,
        biz_store_address: form.biz_store_address,
        store_entrance_pic:
          form.store_entrance_pic?.length > 0 ? form.store_entrance_pic?.map((x) => x.path) : [],
        indoor_pic: form.indoor_pic?.length > 0 ? form.indoor_pic?.map((x) => x.path) : [],
      };
    }
    if (form.sales_scenes_type.includes(EnumWeChatPayApplymentSalesScenesType.SALES_SCENES_MP)) {
      params.business_info.sales_info.mp_info = {
        mp_appid: form.mp_appid,
        mp_sub_appid: form.mp_sub_appid,
        mp_pics: form.mp_pics?.length > 0 ? form.mp_pics?.map((x) => x.path) : [],
      };
    }
    if (
      form.sales_scenes_type.includes(
        EnumWeChatPayApplymentSalesScenesType.SALES_SCENES_MINI_PROGRAM
      )
    ) {
      params.business_info.sales_info.mini_program_info = {
        mini_program_appid: form.mini_program_appid,
        mini_program_sub_appid: form.mini_program_sub_appid,
        mini_program_pics:
          form.mini_program_pics?.length > 0 ? form.mini_program_pics?.map((x) => x.path) : [],
      };
    }
    if (form.sales_scenes_type.includes(EnumWeChatPayApplymentSalesScenesType.SALES_SCENES_APP)) {
      params.business_info.sales_info.app_info = {
        app_appid: form.app_appid,
        app_sub_appid: form.app_sub_appid,
        app_pics: form.app_pics?.length > 0 ? form.app_pics?.map((x) => x.path) : [],
      };
    }
    if (form.sales_scenes_type.includes(EnumWeChatPayApplymentSalesScenesType.SALES_SCENES_WEB)) {
      params.business_info.sales_info.web_info = {
        domain: form.domain,
        web_authorisation: form.web_authorisation?.[0]?.path,
      };
    }
    if (
      form.sales_scenes_type.includes(EnumWeChatPayApplymentSalesScenesType.SALES_SCENES_WEWORK)
    ) {
      params.business_info.sales_info.wework_info = {
        sub_corp_id: form.sub_corp_id,
        wework_pics: form.wework_pics?.length > 0 ? form.wework_pics?.map((x) => x.path) : [],
      };
    }
    let res = await enterpriseWalletServices.openEnterpriseWeChatPayWallet(params);
    return res;
  } catch (error) {}
  } catch (error) {
    console.log('error: ', error);
  }
}
function downloadFRTemplate() {
@@ -1336,7 +1748,7 @@
}
defineExpose({
  onConfirm: enterpriseWalletExpandindirectCreate,
  onConfirm: openEnterpriseWeChatPayWallet,
});
</script>