wupengfei
4 天以前 bb9dac08d11f4e90c355e08ba6ffdfd0f9303d31
feat: 微信
3个文件已修改
472 ■■■■■ 已修改文件
src/services/api/enterpriseWallet.ts 92 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/services/api/typings.d.ts 227 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/EnterpriseManage/components/WechatConfigureView.vue 153 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/services/api/enterpriseWallet.ts
@@ -313,6 +313,98 @@
  );
}
/** 查询企业微信钱包地区 GET /api/user/enterpriseWallet/getEnterpriseWeChatPayWalletAreas */
export async function getEnterpriseWeChatPayWalletAreas(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.APIgetEnterpriseWeChatPayWalletAreasParams,
  options?: API.RequestConfig
) {
  return request<API.WeChatPayArea[]>(
    '/api/user/enterpriseWallet/getEnterpriseWeChatPayWalletAreas',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}
/** 查询企业微信支付钱包支行分页列表 POST /api/user/enterpriseWallet/getEnterpriseWeChatPayWalletBankBranches */
export async function getEnterpriseWeChatPayWalletBankBranches(
  body: API.GetEnterpriseWeChatPayWalletBankBranchesQuery,
  options?: API.RequestConfig
) {
  return request<API.GetEnterpriseWeChatPayWalletBankBranchesQueryResult>(
    '/api/user/enterpriseWallet/getEnterpriseWeChatPayWalletBankBranches',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json-patch+json',
      },
      data: body,
      ...(options || {}),
    }
  );
}
/** 查询企业微信支付钱包银行城市列表 GET /api/user/enterpriseWallet/getEnterpriseWeChatPayWalletBankCities */
export async function getEnterpriseWeChatPayWalletBankCities(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.APIgetEnterpriseWeChatPayWalletBankCitiesParams,
  options?: API.RequestConfig
) {
  return request<API.GetEnterpriseWeChatPayWalletBankCitiesQueryItem[]>(
    '/api/user/enterpriseWallet/getEnterpriseWeChatPayWalletBankCities',
    {
      method: 'GET',
      params: {
        ...params,
      },
      ...(options || {}),
    }
  );
}
/** 查询企业微信支付钱包银行省份列表 GET /api/user/enterpriseWallet/getEnterpriseWeChatPayWalletBankProvinces */
export async function getEnterpriseWeChatPayWalletBankProvinces(
  // 叠加生成的Param类型 (非body参数swagger默认没有生成对象)
  params: API.APIgetEnterpriseWeChatPayWalletBankProvincesParams,
  options?: API.RequestConfig
) {
  return request<API.GetEnterpriseWeChatPayWalletBankProvincesQueryItem[]>(
    '/api/user/enterpriseWallet/getEnterpriseWeChatPayWalletBankProvinces',
    {
      method: 'GET',
      params: {
        ...params,
        request: undefined,
        ...params['request'],
      },
      ...(options || {}),
    }
  );
}
/** 查询企业微信支付钱包银行分页列表 POST /api/user/enterpriseWallet/getEnterpriseWeChatPayWalletBanks */
export async function getEnterpriseWeChatPayWalletBanks(
  body: API.GetEnterpriseWeChatPayWalletBanksQuery,
  options?: API.RequestConfig
) {
  return request<API.GetEnterpriseWeChatPayWalletBanksQueryResult>(
    '/api/user/enterpriseWallet/getEnterpriseWeChatPayWalletBanks',
    {
      method: 'POST',
      headers: {
        'Content-Type': 'application/json-patch+json',
      },
      data: body,
      ...(options || {}),
    }
  );
}
/** 开通企业钱包 POST /api/user/enterpriseWallet/openEnterpriseWallet */
export async function openEnterpriseWallet(
  body: API.OpenEnterpriseWalletCommand,
src/services/api/typings.d.ts
@@ -134,6 +134,21 @@
    id?: string;
  }
  interface APIgetEnterpriseWeChatPayWalletAreasParams {
    /** 最大深度 */
    maxDeep?: number;
  }
  interface APIgetEnterpriseWeChatPayWalletBankCitiesParams {
    /** 省份编码,唯一标识一个省份,用于查询该省份下的城市列表 */
    provinceCode: number;
  }
  interface APIgetEnterpriseWeChatPayWalletBankProvincesParams {
    /** 查询企业微信支付钱包银行省份列表 */
    request?: GetEnterpriseWeChatPayWalletBankProvincesQuery;
  }
  interface APIgetEnterpriseWeChatPayWalletParams {
    /** 企业Id */
    enterpriseId?: string;
@@ -1675,6 +1690,42 @@
    timestamp?: number;
  }
  interface FriendlyResultGetEnterpriseWeChatPayWalletBankBranchesQueryResult {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    data?: GetEnterpriseWeChatPayWalletBankBranchesQueryResult;
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultGetEnterpriseWeChatPayWalletBanksQueryResult {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    data?: GetEnterpriseWeChatPayWalletBanksQueryResult;
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultGetEnterpriseWeChatPayWalletQueryResult {
    /** 跟踪Id */
    traceId?: string;
@@ -2526,6 +2577,44 @@
    timestamp?: number;
  }
  interface FriendlyResultListGetEnterpriseWeChatPayWalletBankCitiesQueryItem {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    /** 数据 */
    data?: GetEnterpriseWeChatPayWalletBankCitiesQueryItem[];
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultListGetEnterpriseWeChatPayWalletBankProvincesQueryItem {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    /** 数据 */
    data?: GetEnterpriseWeChatPayWalletBankProvincesQueryItem[];
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultListGetMenusQueryResultItem {
    /** 跟踪Id */
    traceId?: string;
@@ -2725,6 +2814,25 @@
    errorCode?: string;
    /** 数据 */
    data?: SelectOptionStringGetDictionaryDataSelectQueryResultOption[];
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
    msg?: any;
    /** 附加数据 */
    extras?: any;
    /** 时间戳 */
    timestamp?: number;
  }
  interface FriendlyResultListWeChatPayArea {
    /** 跟踪Id */
    traceId?: string;
    /** 状态码 */
    code?: number;
    /** 错误码 */
    errorCode?: string;
    /** 数据 */
    data?: WeChatPayArea[];
    /** 执行成功 */
    success?: boolean;
    /** 错误信息 */
@@ -3968,9 +4076,73 @@
    transactionStatus?: EnumWalletTransactionStatus;
  }
  interface GetEnterpriseWeChatPayWalletBankBranchesQuery {
    /** 银行别名编码
银行别名的编码,查询支行接口仅支持需要填写支行的银行别名编码 */
    bank_alias_code: string;
    /** 城市编码,唯一标识一座城市,用于结合银行别名编码查询支行列表 */
    city_code: number;
    pageModel?: PagedListQueryPageModel;
  }
  interface GetEnterpriseWeChatPayWalletBankBranchesQueryResult {
    pageModel?: PagedListQueryResultPageModel;
    /** 数据 */
    data?: GetEnterpriseWeChatPayWalletBankBranchesQueryResultItem[];
  }
  interface GetEnterpriseWeChatPayWalletBankBranchesQueryResultItem {
    /** 开户银行支行名称,用于开户银行为其他银行的情况下,在入驻、修改结算银行卡、企业付款等场景下填写结算银行卡信息 */
    bank_branch_name: string;
    /** 开户银行支行的联行号,用于开户银行为其他银行的情况下,在入驻、修改结算银行卡、企业付款等场景下填写结算银行卡信息 */
    bank_branch_id: string;
  }
  interface GetEnterpriseWeChatPayWalletBankCitiesQueryItem {
    /** 城市名称,必填 */
    city_name: string;
    /** 城市编码,唯一标识一座城市,用于结合银行别名编码查询支行列表,必填 */
    city_code: number;
  }
  type GetEnterpriseWeChatPayWalletBankProvincesQuery = Record<string, any>;
  interface GetEnterpriseWeChatPayWalletBankProvincesQueryItem {
    /** 省份名称,必填 */
    province_name: string;
    /** 省份编码,唯一标识一个省份,用于查询该省份下的城市列表,必填 */
    province_code: number;
  }
  interface GetEnterpriseWeChatPayWalletBanksQuery {
    bank_account_type: EnumWeChatPayApplymentBankAccountType;
    pageModel?: PagedListQueryPageModel;
  }
  interface GetEnterpriseWeChatPayWalletBanksQueryResult {
    pageModel?: PagedListQueryResultPageModel;
    /** 数据 */
    data?: GetEnterpriseWeChatPayWalletBanksQueryResultItem[];
  }
  interface GetEnterpriseWeChatPayWalletBanksQueryResultItem {
    /** 银行别名,用于在前端展示全量银行名称供用户选择,如工商银行、深圳前海微众银行等共计4000多家银行的别名名称 */
    bankAlias?: string;
    /** 银行别名编码,用于在查询支行列表接口检索获取支行列表(仅开户银行为其他银行时需要查询支行) */
    bankAliasCode?: string;
    /** 开户银行名称,用于在入驻、修改结算银行卡、企业付款等场景中填写所用银行卡对应的开户银行,其中非直连银行统一为其他银行 */
    accountBank?: string;
    /** 开户银行编码,用于在入驻、修改结算银行卡、企业付款等场景中填写所用银行卡对应的开户银行,其中非直连银行统一为 1099 */
    accountBankCode?: number;
    /** 是否需要填写支行,该开户银行是否需要传入对应的支行,需要请使用银行别名编码和城市编码查询选择具体的支行并传入(默认值为true)
如需查询城市编码,需要通过查询城市列表接口获取相应的城市编码信息 */
    needBankBranch?: boolean;
  }
  interface GetEnterpriseWeChatPayWalletQueryResult {
    /** 钱包Id */
    id?: string;
    bank_account_info: GetEnterpriseWeChatPayWalletQueryResultBankAccountInfo;
    /** 超级管理员签约链接
1、超级管理员用微信扫码,关注“微信支付商家助手”公众号后,公众号将自动发送签约消息;超管需点击消息,根据指引完成核对联系信息、账户验证、签约等操作;
2、超管完成核对联系信息,后续申请单进度可通过公众号自动通知超级管理员 */
@@ -3991,8 +4163,42 @@
    subject_info: WeChatPayApplymentBodyParametersSubjectInfo;
    business_info: WeChatPayApplymentBodyParametersBusinessInfo;
    settlement_info: WeChatPayApplymentBodyParametersSettlementInfo;
    bank_account_info: WeChatPayApplymentBodyParametersBankAccountInfo;
    addition_info?: WeChatPayApplymentBodyParametersAdditionInfo;
  }
  interface GetEnterpriseWeChatPayWalletQueryResultBankAccountInfo {
    /** 银行别名编码
银行别名的编码,查询支行接口仅支持需要填写支行的银行别名编码 */
    bank_alias_code?: string;
    /** 城市编码,唯一标识一座城市,用于结合银行别名编码查询支行列表 */
    city_code?: number;
    bank_account_type: EnumWeChatPayApplymentBankAccountType;
    /** 开户名称
1、选择“经营者个人银行卡”时,开户名称必须与“经营者证件姓名”一致;
2、选择“对公银行账户”时,开户名称必须与营业执照上的“商户名称”一致;
3、该字段需要使用微信支付公钥加密(推荐),请参考获取微信支付公钥ID说明以及微信支付公钥加密敏感信息指引,也可以使用微信支付平台证书公钥加密,参考获取平台证书序列号、平台证书加密敏感信息指引。 */
    account_name: string;
    /** 开户银行
对私银行调用:查询支持个人业务的银行列表API
对公银行调用:查询支持对公业务的银行列表API */
    account_bank: string;
    /** 开户银行省市编码
该字段即将下线处理,无需传入
至少精确到市,详细参见省市区编号对照表
注:仅当省市区编号对照表中无对应的省市区编号时,可向上取该银行对应市级编号或省级编号。 */
    bank_address_code?: string;
    /** 开户银行银行号
1、根据开户银行查询接口中的“是否需要填写支行”判断是否需要填写。如为其他银行,开户银行全称(含支行)和开户银行联行号二选一;
2、详细需调用查询支行列表API查看查询结果。 */
    bank_branch_id?: string;
    /** 开户银行全称(含支行)
1、根据开户银行查询接口中的“是否需要填写支行”判断是否需要填写。如为其他银行,开户银行全称(含支行)和开户银行联行号二选一;
2、详细需调用查询支行列表API查看查询结果。 */
    bank_name?: string;
    /** 银行账号
1、数字,长度遵循系统支持的卡号长度要求表;
2、该字段需要使用微信支付公钥加密(推荐),请参考获取微信支付公钥ID说明以及微信支付公钥加密敏感信息指引,也可以使用微信支付平台证书公钥加密,参考获取平台证书序列号、平台证书加密敏感信息指引。 */
    account_number: string;
  }
  interface GetExceptionLogsQuery {
@@ -5882,11 +6088,11 @@
2、服务商自定义的唯一编号;
3、每个编号对应一个申请单,每个申请单审核通过后会生成一个微信支付商户号。 */
    business_code: string;
    bank_account_info: WeChatPayApplymentBodyParametersBankAccountInfo;
    contact_info: WeChatPayApplymentBodyParametersContactInfo;
    subject_info: WeChatPayApplymentBodyParametersSubjectInfo;
    business_info: WeChatPayApplymentBodyParametersBusinessInfo;
    settlement_info: WeChatPayApplymentBodyParametersSettlementInfo;
    bank_account_info: WeChatPayApplymentBodyParametersBankAccountInfo;
    addition_info?: WeChatPayApplymentBodyParametersAdditionInfo;
  }
@@ -7505,6 +7711,23 @@
    ubo_period_end: string;
  }
  interface WeChatPayArea {
    /** Id */
    id?: string;
    /** 省市编码 */
    areaCode?: string;
    /** 名称 */
    areaName?: string;
    /** 地区名称 */
    fullName?: string;
    /** 层级 */
    leyer?: number;
    /** 父级省市编码 */
    parentCode?: string;
    /** 子集 */
    children?: WeChatPayArea[];
  }
  interface WeChatPayGetApplymentResponseAuditDetail {
    /** 提交申请单的资料项字段名 */
    field: string;
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"
@@ -571,10 +571,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="线下场所地址:"
@@ -895,8 +900,12 @@
        prop="bank_address_code"
        :checkRules="[{ message: '请输入开户银行省市编码' }]"
      >
        <ProFormText v-model.trim="form.bank_address_code" placeholder="请输入开户银行省市编码" />
        <el-button type="primary" link @click="downloadAddressCodeTemplate">省市编码模板</el-button>
        <div style="display: flex; width: 100%">
          <ProFormText v-model.trim="form.bank_address_code" placeholder="请输入开户银行省市编码" />
          <el-button type="primary" link @click="downloadAddressCodeTemplate"
            >省市编码模板</el-button
          >
        </div>
      </ProFormItemV2>
      <ProFormItemV2
        label="开户银行银行号:"
@@ -906,11 +915,11 @@
        <ProFormText v-model.trim="form.bank_branch_id" placeholder="请输入开户银行银行号" />
      </ProFormItemV2>
      <ProFormItemV2
        label="开户银行全称(含支行):"
        label="开户银行全称(含支行):"
        prop="bank_name"
        :checkRules="[{ message: '请输入开户银行全称(含支行)' }]"
        :checkRules="[{ message: '请输入开户银行全称(含支行)' }]"
      >
        <ProFormText v-model.trim="form.bank_name" placeholder="请输入开户银行全称(含支行)" />
        <ProFormText v-model.trim="form.bank_name" placeholder="请输入开户银行全称(含支行)" />
      </ProFormItemV2>
      <ProFormItemV2
        label="银行账号:"
@@ -1297,13 +1306,129 @@
  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,
        contact_id_doc_type: form.contact_id_doc_type,
        contact_id_number: form.contact_id_number,
        contact_id_doc_copy: form.contact_id_doc_copy?.[0]?.path,
        contact_id_doc_copy_back: form.contact_id_doc_copy_back?.[0]?.path,
        contact_period_begin: format(form.contact_period[0], 'YYYY-MM-DD 00:00:00'),
        contact_period_end: format(form.contact_period[1], 'YYYY-MM-DD 23:59:59'),
        business_authorization_letter: form.business_authorization_letter?.[0]?.path,
        mobile_phone: form.mobile_phone,
        contact_email: form.contact_email,
      },
      subject_info: {
        subject_type: form.subject_type,
        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,
        },
        certificate_info: {
          cert_copy: form.cert_copy?.[0]?.path,
          cert_type: form.cert_type,
          cert_number: form.cert_number,
          merchant_name: form.cert_merchant_name,
          company_address: form.cert_company_address,
          legal_person: form.cert_legal_person,
          period_begin: format(form.cert_period[0], 'YYYY-MM-DD 00:00:00'),
          period_end: format(form.cert_period[1], 'YYYY-MM-DD 23:59:59'),
        },
        identity_info: {
          id_holder_type: form.id_holder_type,
          id_doc_type: form.id_doc_type,
          authorize_letter_copy: form.authorize_letter_copy?.[0]?.path,
          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.id_card_period[0], 'YYYY-MM-DD 00:00:00'),
            card_period_end: format(form.id_card_period[1], 'YYYY-MM-DD 23:59:59'),
          },
        },
        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_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[0], 'YYYY-MM-DD 00:00:00'),
                ubo_period_end: format(x.ubo_period[1], 'YYYY-MM-DD 23:59:59'),
              }))
            : [],
      },
      business_info: {
        merchant_shortname: form.merchant_shortname,
        service_phone: form.service_phone,
        sales_info: {
          sales_scenes_type: form.sales_scenes_type,
          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) : [],
          },
          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) : [],
          },
          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) : [],
          },
          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) : [],
          },
          web_info: {
            domain: form.domain,
            web_authorisation: form.web_authorisation?.[0]?.path,
          },
          wework_info: {
            sub_corp_id: form.sub_corp_id,
            wework_pics: form.wework_pics?.length > 0 ? form.wework_pics?.map((x) => x.path) : [],
          },
        },
      },
      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,
      },
    };
    let res = await enterpriseWalletServices.openEnterpriseWeChatPayWallet(params);
    return res;
  } catch (error) {}
}
@@ -1336,7 +1461,7 @@
}
defineExpose({
  onConfirm: enterpriseWalletExpandindirectCreate,
  onConfirm: openEnterpriseWeChatPayWallet,
});
</script>