feat 乐刷进件表单联调

This commit is contained in:
daxpay
2025-07-09 20:48:51 +08:00
parent 3020f7bae3
commit 2d60bbe5ec
12 changed files with 471 additions and 545 deletions

View File

@@ -8,8 +8,8 @@ VITE_PUBLIC_PATH=/
# VITE_PROXY=[["/server","http://daxpay-api.test.yibeiguangnian.cn/"]]
# VITE_PROXY=[["/server","http://192.168.11.229:19999/"]]
# VITE_PROXY=[["/server","https://pay1.bootx.cn/"]]
VITE_PROXY=[["/server","https://dev.server.daxpay.cn/"]]
# VITE_PROXY=[["/server","http://127.0.0.1:19999/"]]
# VITE_PROXY=[["/server","https://dev.server.daxpay.cn/"]]
VITE_PROXY=[["/server","http://127.0.0.1:19999/"]]
# API 接口地址

View File

@@ -3,7 +3,7 @@
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/logo.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
<title><%= title %></title>
</head>
<body>

View File

@@ -26,7 +26,6 @@
"dependencies": {
"@types/lodash-es": "^4.17.12",
"@unocss/reset": "^0.58.9",
"@vant/area-data": "^2.0.0",
"@vueuse/core": "^10.11.1",
"axios": "^1.7.9",
"date-fns": "^3.6.0",

8
pnpm-lock.yaml generated
View File

@@ -14,9 +14,6 @@ importers:
'@unocss/reset':
specifier: ^0.58.9
version: 0.58.9
'@vant/area-data':
specifier: ^2.0.0
version: 2.0.0
'@vueuse/core':
specifier: ^10.11.1
version: 10.11.1(vue@3.5.13(typescript@5.7.2))
@@ -1197,9 +1194,6 @@ packages:
peerDependencies:
vite: ^2.9.0 || ^3.0.0-0 || ^4.0.0 || ^5.0.0-0
'@vant/area-data@2.0.0':
resolution: {integrity: sha512-zgP4AA8z09S9QTNgVCCHo9cHjcybrv22RJDYPjuCkecn4SB98T5EoPQh2TwqbQXmUhbaOGgiZGy3OUaUxnY7qg==}
'@vant/popperjs@1.3.0':
resolution: {integrity: sha512-hB+czUG+aHtjhaEmCJDuXOep0YTZjdlRR+4MSmIFnkCQIxJaXLQdSsR90XWvAI2yvKUI7TCGqR8pQg2RtvkMHw==}
@@ -5503,8 +5497,6 @@ snapshots:
transitivePeerDependencies:
- rollup
'@vant/area-data@2.0.0': {}
'@vant/popperjs@1.3.0': {}
'@vant/use@1.6.0(vue@3.5.13(typescript@5.7.2))':

View File

@@ -0,0 +1,16 @@
<template>
<van-uploader v-model="fileList" :max-count="1" :preview-image="true" :after-read="afterRead" :before-read="beforeRead()" />
</template>
<script setup>
// 上传前回调
function beforeRead() {
console.log('上传前')
}
// 上传后回调
function afterRead(file) {
console.log(file)
}
</script>

View File

@@ -1,71 +0,0 @@
export type ErrorMessageMode = 'none' | 'modal' | 'message' | undefined
export type SuccessMessageMode = ErrorMessageMode
export interface RequestOptions {
// Splicing request parameters to url
joinParamsToUrl?: boolean
// Format request parameter time
formatDate?: boolean
// Whether to process the request result
isTransformResponse?: boolean
// Whether to return native response headers
// For example: use this attribute when you need to get the response headers
isReturnNativeResponse?: boolean
// 是否加入网址
joinPrefix?: boolean
// 接口地址,如果将其留空,请使用默认 apiUrl
apiUrl?: string
// 请求拼接路径
urlPrefix?: string
// 错误消息提示类型
errorMessageMode?: ErrorMessageMode
// Success message prompt type
successMessageMode?: SuccessMessageMode
// Whether to add a timestamp
joinTime?: boolean
ignoreCancelToken?: boolean
// Whether to send token in header
withToken?: boolean
// 请求重试机制
retryRequest?: RetryRequest
}
export interface RetryRequest {
isOpenRetry: boolean
count: number
waitTime: number
}
/**
* 通用响应类
*/
export interface Result<T = any> {
code: number
type: 'success' | 'error' | 'warning'
msg: string
traceId: string | null | undefined
data: T
}
/**
* 分页响应类
*/
export interface PageResult<T = any> {
current: number
records: Array<T>
size: number
total: number
}
// multipart/form-data: upload file
export interface UploadFileParams {
// Other parameters
data?: Recordable
// File parameter interface field name
name?: string
// file name
file: File | Blob
// file name
filename?: string
[key: string]: any
}

View File

@@ -1,61 +1,168 @@
import type { PageResult } from './axios'
/**
* 分页参数
* 商户进件申请单
*/
export interface PageParam {
// 每页数量
size: number
// 当前页数
current: number
}
/**
* 分页表格列表对象
*/
export interface TablePageModel<T = any> {
// 分页参数
pages: PageParam
// 查询参数
queryParam: any
// 结果
pagination: PageResult<T>
}
/**
* 基础实体对象
*/
export interface BaseEntity {
id?: number | string | null
createTime?: string | null
}
/**
* 商户应用基础实体对象
*/
export interface MchEntity extends BaseEntity {
// 服务商号
export interface IsvMchApply extends MchEntity {
// 进件通道
channel?: string
// 进件类型
applyType?: string
// 服务商
isvNo?: string
// 服务商名称
isvName?: string
// 代理商号
agentNo?: string
// 代理商名称
agentName?: string
// 进件的商户类型
applyMchType?: string
// 商户号
mchNo?: string
// 商户名称
mchName?: string
// 应用号
appId?: string
// 应用名称
appName?: string
// 单据名称
name?: string
// 表单数据
formData?: string
// 外部状态
outStatus?: string
// 状态
status?: string
// 错误提示
errorMsg?: string
}
/**
* 键值对对象
* 进件商户申请信息
* @author xxm
* @since 2025/6/9
*/
export interface KeyValue {
key: string
value: string
export interface OnbMerchantApply {
/** 商户类型 */
merchantType?: string
/** 商户全称 */
merchantName?: string
/** 商户简称 */
merchantShortName?: string
}
/**
* 进件申请法人信息
* @author xxm
* @since 2025/6/9
*/
export interface OnbLegalApply {
/** 法人姓名 */
legalName?: string
/** 身份证号 */
certNo?: string
/** 身份证有效期类型 */
certPeriodLong?: boolean
/** 身份证开始时间 */
certStartDate?: string
/** 身份证结束时间 */
certEndDate?: string
/** 身份证正面照片 */
certFrontPic?: string
/** 身份证正面照片路径 */
certFrontPicUrl?: string
/** 身份证反面照片 */
certBackPic?: string
/** 身份证反面照片路径 */
certBackPicUrl?: string
}
/**
* 进件营业执照信息
* @author xxm
* @since 2025/6/9
*/
export interface OnbLicenseApply {
/** 营业执照号 */
licenseNo?: string
/** 营业执照名称 */
licenseName?: string
/** 执照地址-省市区编码 */
licenseRegionCode?: string[]
/** 营业执照详细地址 */
licenseAddress?: string
/** 营业执照有效期类型 */
licensePeriodLong?: boolean
/** 营业执照开始日期 */
licenseStartDate?: string
/** 营业执照结束日期 */
licenseEndDate?: string
/** 营业执照照片 */
licensePic?: string
/** 营业执照照片路径 */
licensePicUrl?: string
}
/**
* 经营场所信息
* @author xxm
* @since 2025/6/9
*/
export interface OnbShopApply {
/** 经营场所名称 */
shopName?: string
/** 省市区编码 */
shopRegionCode?: string[]
/** 经营场所详细地址 */
shopAddress?: string
/** 门头照 */
shopDoorPic?: string
/** 门头照路径 */
shopDoorPicUrl?: string
/** 室内照 */
shopInsidePic?: string
/** 室内照路径 */
shopInsidePicUrl?: string
/** 收银台照片 */
shopCashierPic?: string
/** 收银台照片路径 */
shopCashierPicUrl?: string
}
/**
* 进件结算卡信息
* @author xxm
* @since 2025/6/9
*/
export interface OnbBankAccountApply {
/** 账户类型 */
bankAccountType?: string
/** 银行卡账户名 */
bankAccountName?: string
/** 银行卡号 */
bankCardNo?: string
/** 银行卡开户行联行号 */
bankBranchNo?: string
/** 银行预留手机号 */
bankPhone?: string
/** 银行卡正面照片 */
bankCardPic?: string
/** 银行卡正面照片路径 */
bankCardPicUrl?: string
}
/**
* 持卡人信息
* @author xxm
* @since 2025/6/9
*/
export interface OnbCardHolderApply {
/** 持卡人姓名 */
holderName?: string
/** 身份证号 */
certNo?: string
/** 身份证有效期类型 */
certPeriodLong?: boolean
/** 身份证开始时间 */
certStartDate?: string
/** 身份证结束时间 */
certEndDate?: string
/** 身份证正面照片 */
certFrontPic?: string
/** 身份证正面照片路径 */
certFrontPicUrl?: string
/** 身份证反面照片 */
certBackPic?: string
/** 身份证反面照片路径 */
certBackPicUrl?: string
/** 非法人结算授权函图片 */
letterOfAuthPic?: string
/** 非法人结算授权函图片路径 */
letterOfAuthPicUrl?: string
}

View File

@@ -1,270 +1,35 @@
import { unref } from 'vue'
import type { MchEntity } from './base'
import { http } from '@/utils/http/axios'
import type { PageResult, Result } from '#/axios'
import type { Result } from '#/axios'
/**
* 获取单条
* 地区树
*/
export function findById(id) {
return http.request<Result<IsvMchApply>>({
url: '/isv/mch/apply/findById',
export function findAllProvinceAndCityAndArea() {
return http.request<Result<Region[]>>({
url: '/china/region/findAllProvinceAndCityAndArea',
method: 'get',
params: { id: unref(id) },
})
}
/**
* 分页
*/
export function page(params) {
return http.request<Result<PageResult<IsvMchApply>>>({
url: '/isv/mch/apply/page',
method: 'get',
params,
})
}
/**
* 保存
*/
export function save(obj: IsvMchApply) {
return http.request<Result<string>>({
url: '/isv/mch/apply/create',
method: 'post',
data: obj,
})
}
/**
* 更新
*/
export function update(obj: IsvMchApply) {
return http.request({
url: '/isv/mch/apply/update',
method: 'post',
data: obj,
})
}
/**
* 提交
*/
export function submit(id) {
export function submit(id, headers) {
return http.request({
url: '/isv/mch/apply/submit',
method: 'post',
params: { id },
headers,
})
}
/**
* 根据通道查询进件申请类型下拉列表
* 区域
*/
export function dropdownByChannel(channel) {
return http.request({
url: '/isv/mch/apply/type/dropdownByChannel',
method: 'get',
params: { channel },
})
}
/**
* 删除
*/
export function del(id) {
return http.request({
url: '/isv/mch/apply/delete',
method: 'post',
params: { id },
})
}
/**
* 同步
*/
export function syncInfo(id) {
return http.request({
url: '/isv/mch/apply/sync',
method: 'post',
params: { id },
})
}
/**
* 生成进件商户
*/
export function genMchInfo(param) {
return http.request({
url: '/isv/mch/apply/genMchInfo',
method: 'post',
data: param,
})
}
/**
* 商户进件申请单
*/
export interface IsvMchApply extends MchEntity {
// 进件通道
channel?: string
// 进件类型
applyType?: string
// 服务商
isvNo?: string
// 进件的商户类型
applyMchType?: string
// 商户号
mchNo?: string
// 单据名称
name?: string
// 表单数据
formData?: string
// 外部状态
outStatus?: string
// 状态
status?: string
// 错误提示
errorMsg?: string
}
/**
* 进件商户申请信息
* @author xxm
* @since 2025/6/9
*/
export interface OnbMerchantApply {
/** 商户类型 @see OnbMerchantTypeEnum */
merchantType?: string
/** 商户全称 */
merchantName?: string
/** 商户简称 */
merchantShortName?: string
}
/**
* 进件申请法人信息
* @author xxm
* @since 2025/6/9
*/
export interface OnbLegalApply {
/** 法人姓名 */
legalName?: string
/** 身份证号 */
certNo?: string
/** 身份证有效期类型 */
certPeriodLong?: boolean
/** 身份证开始时间 */
certStartDate?: string
/** 身份证结束时间 */
certEndDate?: string
/** 身份证正面照片 */
certFrontPic?: string
/** 身份证正面照片路径 */
certFrontPicUrl?: string
/** 身份证反面照片 */
certBackPic?: string
/** 身份证反面照片路径 */
certBackPicUrl?: string
}
/**
* 进件营业执照信息
* @author xxm
* @since 2025/6/9
*/
export interface OnbLicenseApply {
/** 营业执照号 */
licenseNo?: string
/** 营业执照名称 */
licenseName?: string
/** 执照地址-省市区编码 */
licenseRegionCode?: string[]
/** 营业执照详细地址 */
licenseAddress?: string
/** 营业执照有效期类型 */
licensePeriodLong?: boolean
/** 营业执照开始日期 */
licenseStartDate?: string
/** 营业执照结束日期 */
licenseEndDate?: string
/** 营业执照照片 */
licensePic?: string
/** 营业执照照片路径 */
licensePicUrl?: string
}
/**
* 经营场所信息
* @author xxm
* @since 2025/6/9
*/
export interface OnbShopApply {
/** 经营场所名称 */
shopName?: string
/** 省市区编码 */
shopRegionCode?: string[]
/** 经营场所详细地址 */
shopAddress?: string
/** 门头照 */
shopDoorPic?: string
/** 门头照路径 */
shopDoorPicUrl?: string
/** 室内照 */
shopInsidePic?: string
/** 室内照路径 */
shopInsidePicUrl?: string
/** 收银台照片 */
shopCashierPic?: string
/** 收银台照片路径 */
shopCashierPicUrl?: string
}
/**
* 进件结算卡信息
* @author xxm
* @since 2025/6/9
*/
export interface OnbBankAccountApply {
/** 账户类型 */
bankAccountType?: string
/** 银行卡账户名 */
bankAccountName?: string
/** 银行卡号 */
bankCardNo?: string
/** 银行卡开户行联行号 */
bankBranchNo?: string
/** 银行预留手机号 */
bankPhone?: string
/** 银行卡正面照片 */
bankCardPic?: string
/** 银行卡正面照片路径 */
bankCardPicUrl?: string
}
/**
* 持卡人信息
* @author xxm
* @since 2025/6/9
*/
export interface OnbCardHolderApply {
/** 持卡人姓名 */
holderName?: string
/** 身份证号 */
certNo?: string
/** 身份证有效期类型 */
certPeriodLong?: boolean
/** 身份证开始时间 */
certStartDate?: string
/** 身份证结束时间 */
certEndDate?: string
/** 身份证正面照片 */
certFrontPic?: string
/** 身份证正面照片路径 */
certFrontPicUrl?: string
/** 身份证反面照片 */
certBackPic?: string
/** 身份证反面照片路径 */
certBackPicUrl?: string
/** 非法人结算授权函图片 */
letterOfAuthPic?: string
/** 非法人结算授权函图片路径 */
letterOfAuthPicUrl?: string
export interface Region {
code: string
name: string
/** 省市区街道 */
level: 1 | 2 | 3 | 4
isLeaf?: boolean
children: Region[]
}

View File

@@ -1,20 +0,0 @@
<template>
<van-uploader v-model="fileList" :max-count="1" :preview-image="true" :after-read="afterRead" :before-read="beforeRead()" />
</template>
<script setup>
// 上传文件列表
const fileList = ref([
{ url: 'https://fastly.jsdelivr.net/npm/@vant/assets/sand.jpeg' },
])
// 上传前回调
function beforeRead() {
console.log('上传前')
}
// 上传后回调
function afterRead(file) {
console.log(file)
}
</script>

View File

@@ -1,15 +1,20 @@
<!-- eslint-disable vue/valid-attribute-name -->
<!-- eslint-disable format/prettier -->
<template>
<div class="leshuaOnBoarded">
<!-- 步骤页 -->
<van-overlay v-show="loading" :show="true">
<div class="loading-wrapper" @click.stop>
<van-loading size="24px">
获取中...
</van-loading>
</div>
</van-overlay>
<div class="stepsBox">
<span class="current">{{ currentObj.currentIndex }} </span>/{{ currentObj.date.length }}
<span class="stepName"> {{ currentObj.currentTitle }}</span>
<!-- 经营信息 结算账户 -->
</div>
<div class="formBox">
<van-form ref="formRef" @failed="onFailed">
<van-form ref="formRef">
<!-- 第一模块 -->
<template v-if="currentObj.currentIndex === 1">
<div class="commonTitle">
@@ -248,13 +253,13 @@
<template #input>
<!-- formData.mchApply.other.mccCodes -->
<van-field
v-model="categoryStr"
v-model="mccStr"
is-link
readonly
name="mccCodes"
placeholder="请选择经营类目"
:rules="rulesTwo.mccCodes"
@click="cascaderObj.openCategotyBtn"
@click="cascaderObj.openMccBtn"
/>
</template>
</van-field>
@@ -367,8 +372,8 @@
提交
</van-button>
</div>
<div class="btnBox">
<van-button type="primary" plain block @click="saveClick">
<div class="btnBox" style="margin-bottom: 20px">
<van-button type="primary" plain block @click="saveTemp">
暂存
</van-button>
</div>
@@ -391,7 +396,7 @@
<van-cascader
v-if="cascaderObj.status === 'area'"
v-model="cascaderObj.areaValue"
title="请选择"
title="请选择经营场所所在区县"
:field-names="cascaderObj.fieldNames"
:options="cascaderObj.areaOptions"
@close="cascaderObj.closeDialog"
@@ -399,11 +404,11 @@
/>
<!-- 类目 -->
<van-cascader
v-if="cascaderObj.status === 'category'"
v-model="cascaderObj.cateoryValue"
title="请选择"
v-if="cascaderObj.status === 'mcc'"
v-model="cascaderObj.mccValue"
title="请选择经营类目"
:field-names="cascaderObj.fieldNames"
:options="cascaderObj.cateoryOptions"
:options="cascaderObj.mccOptions"
@close="cascaderObj.closeDialog"
@finish="cascaderObj.onFinish"
/>
@@ -411,15 +416,28 @@
</div>
</template>
<script setup>
// import type { MerchantApply } from '../common/onBoarded.api.ts'
import { useCascaderAreaData } from '@vant/area-data'
<script setup lang="ts">
import { showNotify } from 'vant'
import upLoadView from '../components/upLoadView.vue'
import { findAllProvinceAndCityAndArea, mccTree } from './leshua.api'
import { useRoute } from 'vue-router'
import { ref } from 'vue'
import type { MerchantApply } from './leshua.api'
import { findById, mccTree, save } from './leshua.api'
import {
findAllProvinceAndCityAndArea,
submit,
} from '@/views/daxpay/h5/onboarded/common/onBoarded.api.ts'
import upLoadView from '@/components/upLoadView.vue'
const route = useRoute()
const { id: applyId, token, client } = route.query
const headers = {
'AccessToken': token,
'x-client-code': client,
}
// 控制当前页面数据对象
const currentObj = reactive({
currentIndex: 3, // 当前页面的值
currentIndex: 1, // 当前页面的值
// 数据
date: [
{
@@ -436,16 +454,16 @@ const currentObj = reactive({
},
],
currentTitle: computed(() => {
const title = currentObj.date.find(item => item.index === currentObj.currentIndex).title
return title
return currentObj.date.find(item => item.index === currentObj.currentIndex).title
}),
})
// 表单ref对象
const formRef = ref(null)
const formRef = ref<any>()
const loading = ref<boolean>(false)
// 表单数据对象
// MerchantApply
const formData = ref({
const formData = ref<MerchantApply>({
mchApply: {
merchant: {},
legal: {},
@@ -456,7 +474,10 @@ const formData = ref({
other: {},
},
})
// 格式化树装数据
/**
* 格式化树装数据
*/
function formatDate(data) {
if (!Array.isArray(data)) {
return []
@@ -471,8 +492,10 @@ function formatDate(data) {
})
}
const categoryStr = ref('') // 类目接收字段名
const areaStr = ref('') // 地区接收字段名
// 类目接收字段名
const mccStr = ref('')
// 地区接收字段名
const areaStr = ref('')
// 级联选择框对象
const cascaderObj = reactive({
showDialog: false, // 弹窗
@@ -483,12 +506,12 @@ const cascaderObj = reactive({
children: 'children',
}, // 自定义名
areaOptions: [], // 区域数据
cateoryOptions: [], // 类目数据
mccOptions: [], // 类目数据
areaValue: '', // 区域选择器的值
cateoryValue: '', // 类目选择器的值
openCategotyBtn: () => {
mccValue: '', // 类目选择器的值
openMccBtn: () => {
// 打开类目弹窗
cascaderObj.status = 'category'
cascaderObj.status = 'mcc'
cascaderObj.showDialog = true
},
openAreaBtn: () => {
@@ -503,9 +526,11 @@ const cascaderObj = reactive({
},
onFinish: (finish) => {
// 选择完成事件
if (cascaderObj.status === 'category') {
formData.value.mchApply.other.mccCodes = finish.selectedOptions.map(item => item.code) // 赋值需要传参的数据
categoryStr.value = finish.selectedOptions.map(item => item.name).join('/') // 用于表单显示
if (cascaderObj.status === 'mcc') {
// 赋值需要传参的数据
formData.value.mchApply.other.mccCodes = finish.selectedOptions.map(item => item.code)
// 用于表单显示
mccStr.value = finish.selectedOptions.map(item => item.name).join('/')
}
if (cascaderObj.status === 'area') {
formData.value.mchApply.shop.shopRegionCode = finish.selectedOptions.map(item => item.code) // 赋值需要传参的数据
@@ -514,9 +539,9 @@ const cascaderObj = reactive({
cascaderObj.showDialog = false
},
// 获取类目数据
getCateoryData: () => {
getMccData: () => {
mccTree().then(({ data }) => {
cascaderObj.cateoryOptions = formatDate(data)
cascaderObj.mccOptions = formatDate(data)
})
},
// 获取地区树据
@@ -573,10 +598,10 @@ const rulesOne = reactive({
// 身份证号码
certNo: [
{ required: true, message: '请输入身份证号码' },
{
pattern: /^[1-9]\d{16}[0-9X]$/i,
message: '身份证号码格式错误',
},
// {
// pattern: /^[1-9]\d{16}[0-9X]$/i,
// message: '身份证号码格式错误',
// },
],
// 开始时间
certStartDate: [{ required: true, message: '请选择证件开始时间' }],
@@ -585,10 +610,10 @@ const rulesOne = reactive({
// 手机号码
contactPhone: [
{ required: true, message: '请输入手机号' },
{
pattern: /^1[3-9]\d{9}$/,
message: '手机号格式错误',
},
// {
// pattern: /^1[3-9]\d{9}$/,
// message: '手机号格式错误',
// },
],
/* 营业执照信息 */
@@ -656,7 +681,36 @@ const rulesThree = reactive({
],
})
// 筛选出验证规则
/**
* 初始化
*/
onMounted(async () => {
await initData()
getInfo()
})
/**
* 初始化数据
*/
function initData() {
cascaderObj.getMccData() // 获取类目
cascaderObj.getAreaDate() // 获取区域名
}
/**
* 获取数据
*/
function getInfo() {
findById(applyId, headers).then(({ data }) => {
formData.value = data
cascaderObj.mccValue = data.mchApply?.other?.mccCodes?.[2]
cascaderObj.areaValue = data.mchApply?.shop?.shopRegionCode?.[2]
})
}
/**
* 筛选出验证规则
*/
function getFieldsByStep(index) {
switch (index) {
case 1:
@@ -669,11 +723,17 @@ function getFieldsByStep(index) {
return []
}
}
// 点击上一步
/**
* 点击上一步
*/
function prevClick() {
currentObj.currentIndex--
}
// 点击下一步进行校验
/**
* 点击下一步进行校验
*/
function nextClick() {
const fieldsToValidate = getFieldsByStep(currentObj.currentIndex)
formRef.value
@@ -682,41 +742,71 @@ function nextClick() {
// 执行下一步操作
currentObj.currentIndex++
})
.catch((error) => {
console.log(error)
.catch(() => {
showNotify({ type: 'danger', message: '还有必填项未填!请仔细检查' })
})
}
// 提交
function getLabelText(selectedValue, options) {
const labels = []
let currentLevel = options
for (let i = 0; i < selectedValue.length; i++) {
const val = selectedValue[i]
const node = currentLevel.find(item => item.id === val)
if (!node) {
break
}
labels.push(node.name)
currentLevel = node.children || []
}
return labels.join(' / ')
}
/**
* 提交
*/
function submitClick() {
const fieldsToValidate = getFieldsByStep(currentObj.date.length) // 只验证最后一页
formRef.value
.validate(fieldsToValidate)
.then(() => {
// 执行下一步操作
submit(formData.value.applyId, headers).then(({ code, data }) => {
if (code !== 0) {
showNotify({ type: 'danger', message: data })
}
loading.value = false
})
})
.catch((error) => {
console.log(error)
.catch(() => {
showNotify({ type: 'danger', message: '还有必填项未填!请仔细检查' })
})
}
// 暂存
function saveClick() {
console.log('11')
}
onMounted(() => {
formData.value.mchApply.merchant.merchantType = 'micro' // 默认选择小微商户
cascaderObj.getCateoryData() // 获取类目
cascaderObj.getAreaDate() // 获取区域名
})
/**
* 暂存
*/
function saveTemp() {
loading.value = true
save(formData.value, headers).then(({ code, data }) => {
if (code !== 0) {
showNotify({ type: 'danger', message: data })
}
else {
showNotify({ type: 'success', message: '暂存成功' })
}
loading.value = false
})
}
</script>
<style lang="less" scoped>
.leshuaOnBoarded {
width: 100%;
height: 100%;
padding-bottom: env(safe-area-inset-bottom);
.stepsBox {
width: 100%;
@@ -773,71 +863,66 @@ onMounted(() => {
}
}
}
</style>
<style lang="less">
.leshuaOnBoarded {
.van-form {
.van-cell-group {
&.van-cell-group--inset {
margin: 0 !important;
:deep(.van-form) {
.van-cell-group {
&.van-cell-group--inset {
margin: 0 !important;
}
.van-cell {
.van-cell__title {
&.van-field__label--top {
margin-bottom: 0.625rem !important;
}
}
.van-cell {
.van-cell__title {
&.van-field__label--top {
margin-bottom: 0.625rem !important;
}
}
.van-cell__value {
// 单选
.van-radio-group {
.van-radio {
.van-radio__icon {
height: 1rem;
.van-cell__value {
// 单选
.van-radio-group {
.van-radio {
.van-radio__icon {
height: 1rem;
width: 1rem;
font-size: 1.125rem;
.van-icon {
width: 1rem;
font-size: 1.125rem;
.van-icon {
width: 1rem;
height: 1rem;
line-height: 1;
}
}
.van-badge__wrapper {
&.van-icon {
width: 1rem;
height: 1rem;
}
height: 1rem;
line-height: 1;
}
}
}
.van-field__body {
input {
border: 0.0625rem solid #f5f5f5;
height: 3.125rem;
padding-left: 0.625rem;
padding-right: 2.5rem;
}
.van-field__clear {
position: absolute;
right: 0.625rem;
}
.van-switch {
.van-switch__node {
display: flex;
justify-content: center;
.vSwitch {
font-size: 0.75rem;
}
.van-badge__wrapper {
&.van-icon {
width: 1rem;
height: 1rem;
}
}
}
}
&.van-cell--clickable {
padding: 0rem 0rem !important;
display: flex;
align-items: center;
.van-field__body {
input {
border: 0.0625rem solid #f5f5f5;
height: 3.125rem;
padding-left: 0.625rem;
padding-right: 2.5rem;
}
.van-field__clear {
position: absolute;
right: 0.625rem;
}
.van-switch {
.van-switch__node {
display: flex;
justify-content: center;
.vSwitch {
font-size: 0.75rem;
}
}
}
}
}
&.van-cell--clickable {
padding: 0rem 0rem !important;
display: flex;
align-items: center;
}
}
}
}

View File

@@ -1,3 +1,5 @@
import { http } from '@/utils/http/axios'
import type { Result } from '#/axios'
import type {
OnbBankAccountApply,
OnbCardHolderApply,
@@ -5,29 +7,41 @@ import type {
OnbLicenseApply,
OnbMerchantApply,
OnbShopApply,
} from '../common/onBoarded.api'
import { http } from '@/utils/http/axios'
import type { Result } from '#/axios'
} from '@/views/daxpay/h5/onboarded/common/base'
/**
* 查询
*/
export function getInfo(id) {
export function findById(id, headers) {
return http.request<Result<MerchantApply>>({
method: 'get',
url: '/leshua/mch/apply/findById',
params: { id },
headers,
})
}
/**
* 保存
*/
export function save(param: MerchantApply) {
export function save(param: MerchantApply, headers) {
return http.request<Result<void>>({
method: 'post',
url: '/leshua/mch/apply/save',
data: param,
headers,
})
}
/**
* 提交申请
*/
export function submit(id, headers){
return http.request<Result<void>>({
method: 'post',
url: '/leshua/mch/apply/save',
data: param,
headers,
})
}
@@ -41,15 +55,6 @@ export function mccTree() {
})
}
/**
* 地区树
*/
export function findAllProvinceAndCityAndArea() {
return http.request<Result<Region[]>>({
url: '/china/region/findAllProvinceAndCityAndArea',
method: 'get',
})
}
/**
* 乐刷商户申请参数
*/
@@ -111,15 +116,3 @@ export interface MccConst {
/** 子类目 */
children?: MccConst[]
}
/**
* 区域
*/
export interface Region {
code: string
name: string
/** 省市区街道 */
level: 1 | 2 | 3 | 4
isLeaf?: boolean
children: Region[]
}

60
types/axios.d.ts vendored
View File

@@ -18,3 +18,63 @@ export interface PageResult<T = any> {
size: number
total: number
}
/**
* 分页参数
*/
export interface PageParam {
// 每页数量
size: number
// 当前页数
current: number
}
/**
* 分页表格列表对象
*/
export interface TablePageModel<T = any> {
// 分页参数
pages: PageParam
// 查询参数
queryParam: any
// 结果
pagination: PageResult<T>
}
/**
* 基础实体对象
*/
export interface BaseEntity {
id?: number | string | null
createTime?: string | null
}
/**
* 商户应用基础实体对象
*/
export interface MchEntity extends BaseEntity {
// 服务商号
isvNo?: string
// 服务商名称
isvName?: string
// 代理商号
agentNo?: string
// 代理商名称
agentName?: string
// 商户号
mchNo?: string
// 商户名称
mchName?: string
// 应用号
appId?: string
// 应用名称
appName?: string
}
/**
* 键值对对象
*/
export interface KeyValue {
key: string
value: string
}