| | |
| | | } |
| | | |
| | | export const EnterpriseConfigureTypeText = { |
| | | // [EnterpriseConfigureType.Bank]: '银行信息配置', |
| | | [EnterpriseConfigureType.AliPay]: '支付信息配置', |
| | | [EnterpriseConfigureType.Bank]: '银行信息配置', |
| | | [EnterpriseConfigureType.AliPay]: '支付宝配置', |
| | | [EnterpriseConfigureType.Electronic]: '电子签配置', |
| | | [EnterpriseConfigureType.ShortMessage]: '短信通道配置', |
| | | }; |
| | |
| | | /** 协议失效时间 */ |
| | | invalidTime?: string; |
| | | signStatus?: EnumEnterpriseWalletSignStatus; |
| | | /** 所属银行 */ |
| | | bank?: string; |
| | | /** 所属支行 */ |
| | | bankBranch?: string; |
| | | /** 支付宝姓名 */ |
| | | name?: string; |
| | | /** 支付宝登录账号 */ |
| | |
| | | LoadingLayout, |
| | | AppContainer, |
| | | QueryFilterItem, |
| | | useTable, |
| | | useFormDialog, |
| | | FieldRadio, |
| | | UploadUserFile, |
| | | useTableV2, |
| | | } from '@bole-core/components'; |
| | | import { useAccess, useGlobalEventContext } from '@/hooks'; |
| | |
| | | import ConfigureDialog from './components/ConfigureDialog.vue'; |
| | | import { Message } from '@bole-core/core'; |
| | | import * as enterpriseServices from '@/services/api/enterprise'; |
| | | import * as enterpriseWalletServices from '@/services/api/enterpriseWallet'; |
| | | import { convertWalletApiToFiles, convertWalletFilesToApi } from '@/utils'; |
| | | |
| | | defineOptions({ |
| | | name: 'EnterpriseManageList', |
| | |
| | | }); |
| | | |
| | | const router = useRouter(); |
| | | |
| | | const { invalidateQueries } = useEnabledElectronSignSettings(); |
| | | |
| | | const { |
| | | getDataSource: getList, |
| | |
| | | } |
| | | ); |
| | | |
| | | async function getEnterpriseElectronSignSetting(id: string) { |
| | | return await enterpriseServices.getEnterpriseElectronSignSetting({ id: id }); |
| | | function openDialog(row?: API.GetEnterprisesQueryResultItem) { |
| | | handleEdit({ |
| | | id: row.id, |
| | | enterpriseConfigureType: EnterpriseConfigureType.Bank, |
| | | }); |
| | | } |
| | | |
| | | async function getEnterpriseSmsSetting(id: string) { |
| | | return await enterpriseServices.getEnterpriseSmsSetting({ id: id }); |
| | | } |
| | | |
| | | const EnumElectronSignAccessList = computed(() => |
| | | Object.values(EnumElectronSignAccess) |
| | | .filter(Number) |
| | | .map((x) => Number(x)) |
| | | ); |
| | | |
| | | async function openDialog(row?: API.GetEnterprisesQueryResultItem) { |
| | | try { |
| | | if (row) { |
| | | let electronSignSetting = await getEnterpriseElectronSignSetting(row.id); |
| | | let smsSetting = await getEnterpriseSmsSetting(row.id); |
| | | let alipayWallet = await enterpriseWalletServices.getEnterpriseWallet({ |
| | | enterpriseId: row.id, |
| | | access: EnumEnterpriseWalletAccess.Alipay, |
| | | }); |
| | | handleEdit({ |
| | | id: row.id, |
| | | enterpriseConfigureType: EnterpriseConfigureType.AliPay, |
| | | electronSignAccesses: EnumElectronSignAccessList.value.map((value) => |
| | | electronSignSetting.electronSignAccesses.includes(value) ? value : null |
| | | ), |
| | | smsAccess: smsSetting.smsAccess, |
| | | smsCost: smsSetting.smsCost, |
| | | alipayAccount: alipayWallet.identity, |
| | | alipayMerchantId: alipayWallet.code, |
| | | signStatus: alipayWallet.signStatus, |
| | | expandindirectOrderStatus: alipayWallet.expandindirectOrderStatus, |
| | | |
| | | name: alipayWallet.name, |
| | | scene: alipayWallet.scene || EnumEnterpriseWalletExpandindirectOrderScene.YONGJIN_BAOCHOU, |
| | | sceneDirections: alipayWallet.sceneDirections, |
| | | sceneFiles: convertWalletApiToFiles( |
| | | alipayWallet.files, |
| | | EnumEnterpriseWalletExpandindirectOrderFileType.Scene |
| | | ), |
| | | sceneQualificationFiles: convertWalletApiToFiles( |
| | | alipayWallet.files, |
| | | EnumEnterpriseWalletExpandindirectOrderFileType.SceneQualification |
| | | ), |
| | | }); |
| | | } else { |
| | | handleAdd({ |
| | | enterpriseConfigureType: EnterpriseConfigureType.AliPay, |
| | | }); |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | |
| | | const { dialogProps, handleAdd, handleEdit, editForm, dialogState } = useFormDialog({ |
| | | const { dialogProps, handleEdit, dialogState } = useFormDialog({ |
| | | onConfirm: handleAddOrEdit, |
| | | defaultFormParams: { |
| | | id: '', |
| | | enterpriseConfigureType: EnterpriseConfigureType.AliPay, |
| | | electronSignAccesses: [] as EnumElectronSignAccess[], |
| | | smsAccess: '' as any as EnumSmsAccess, |
| | | smsCost: 0, |
| | | alipayAccount: '', |
| | | alipayMerchantId: '', |
| | | signStatus: '' as any as EnumEnterpriseWalletSignStatus, |
| | | expandindirectOrderStatus: '' as any as EnumEnterpriseWalletExpandindirectOrderStatus, |
| | | |
| | | name: '', |
| | | scene: '' as any as EnumEnterpriseWalletExpandindirectOrderScene, |
| | | sceneDirections: '', |
| | | /**转账场景截图 */ |
| | | sceneFiles: [] as UploadUserFile[], |
| | | /**商户行业资质图片或协议文本 */ |
| | | sceneQualificationFiles: [] as UploadUserFile[], |
| | | enterpriseConfigureType: EnterpriseConfigureType.Bank, |
| | | }, |
| | | }); |
| | | |
| | | async function handleAddOrEdit() { |
| | | try { |
| | | let res; |
| | | // if (type === EnterpriseConfigureType.Bank) { |
| | | // res = await createOrEditFlexEnterpriseBankSetting(); |
| | | // } |
| | | if (editForm.enterpriseConfigureType === EnterpriseConfigureType.Electronic) { |
| | | res = await createOrEditFlexEnterpriseSignSetting(); |
| | | } |
| | | if (editForm.enterpriseConfigureType === EnterpriseConfigureType.ShortMessage) { |
| | | res = await createOrEditFlexEnterpriseMessageSetting(); |
| | | } |
| | | if (editForm.enterpriseConfigureType === EnterpriseConfigureType.AliPay) { |
| | | res = await enterpriseWalletExpandindirectCreate(); |
| | | } |
| | | if (res) { |
| | | Message.successMessage('操作成功'); |
| | | getList(paginationState.pageIndex); |
| | | dialogState.dialogVisible = false; |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | |
| | | async function enterpriseWalletExpandindirectCreate() { |
| | | try { |
| | | let params: API.EnterpriseWalletExpandindirectCreateCommand = { |
| | | enterpriseId: editForm.id, |
| | | identity: editForm.alipayAccount, |
| | | name: editForm.name, |
| | | scene: editForm.scene, |
| | | sceneDirections: editForm.sceneDirections, |
| | | sitesInfo: null, |
| | | files: [ |
| | | ...convertWalletFilesToApi( |
| | | editForm.sceneFiles, |
| | | EnumEnterpriseWalletExpandindirectOrderFileType.Scene |
| | | ), |
| | | ...convertWalletFilesToApi( |
| | | editForm.sceneQualificationFiles, |
| | | EnumEnterpriseWalletExpandindirectOrderFileType.SceneQualification |
| | | ), |
| | | ], |
| | | }; |
| | | return await enterpriseWalletServices.enterpriseWalletExpandindirectCreate(params); |
| | | } catch (error) {} |
| | | } |
| | | |
| | | // async function createOrEditFlexEnterpriseBankSetting() { |
| | | // try { |
| | | // let params: API.CreateOrEditFlexEnterpriseBankInput = { |
| | | // id: editForm.id, |
| | | // openBank: editForm.openBank, |
| | | // openBranchBank: editForm.openBranchBank, |
| | | // bankAccount: editForm.bankAccount, |
| | | // verifyStatus: editForm.verifyStatus, |
| | | // flexEnterpirseId: editForm.flexEnterpirseId, |
| | | // }; |
| | | // return await flexEnterpriseServices.createOrEditFlexEnterpriseBankSetting(params); |
| | | // } catch (error) {} |
| | | // } |
| | | |
| | | async function createOrEditFlexEnterpriseSignSetting() { |
| | | try { |
| | | let params: API.SetEnterpriseElectronSignSettingCommand = { |
| | | id: editForm.id, |
| | | electronSignAccesses: editForm.electronSignAccesses.filter(Boolean), |
| | | }; |
| | | let res = await enterpriseServices.setEnterpriseElectronSignSetting(params); |
| | | invalidateQueries(); |
| | | return res; |
| | | } catch (error) {} |
| | | } |
| | | async function createOrEditFlexEnterpriseMessageSetting() { |
| | | try { |
| | | let params: API.SetEnterpriseSmsSettingCommand = { |
| | | id: editForm.id, |
| | | smsAccess: editForm.smsAccess, |
| | | smsCost: editForm.smsCost, |
| | | }; |
| | | return await enterpriseServices.setEnterpriseSmsSetting(params); |
| | | Message.successMessage('操作成功'); |
| | | getList(paginationState.pageIndex); |
| | | dialogState.dialogVisible = false; |
| | | } catch (error) {} |
| | | } |
| | | |
New file |
| | |
| | | <template> |
| | | <LoadingLayout :loading="isLoading"> |
| | | <ProForm :model="form" ref="dialogForm" label-width="120px"> |
| | | <ProFormItemV2 |
| | | label="支付宝账号:" |
| | | prop="alipayAccount" |
| | | :checkRules="[{ message: '请输入支付宝账号' }]" |
| | | > |
| | | <div style="display: flex; width: 100%"> |
| | | <ProFormText v-model.trim="form.alipayAccount" placeholder="请输入支付宝账号"> |
| | | </ProFormText> |
| | | <el-button style="margin-left: 10px" type="primary" link @click="openEnterpriseWallet" |
| | | >获取签约链接</el-button |
| | | > |
| | | </div> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 |
| | | label="支付宝姓名:" |
| | | prop="name" |
| | | :checkRules="[{ message: '请输入支付宝姓名' }]" |
| | | > |
| | | <ProFormText v-model.trim="form.name" placeholder="请输入支付宝姓名" /> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 |
| | | label="商户ID:" |
| | | prop="alipayMerchantId" |
| | | :checkRules="[{ message: '请输入商户ID' }]" |
| | | > |
| | | <ProFormText v-model.trim="form.alipayMerchantId" placeholder="请输入商户ID" disabled /> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 label="业务场景:" prop="scene" :checkRules="[{ message: '请选择业务场景' }]"> |
| | | <ProFormSelect |
| | | v-model="form.scene" |
| | | :valueEnum="EnumEnterpriseWalletExpandindirectOrderSceneText" |
| | | placeholder="请选择业务场景" |
| | | > |
| | | </ProFormSelect> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 |
| | | label="场景描述:" |
| | | prop="sceneDirections" |
| | | :checkRules="[{ message: '请输入场景描述' }]" |
| | | > |
| | | <ProFormText |
| | | v-model.trim="form.sceneDirections" |
| | | placeholder="谁/通过什么媒介(APP/web/小程序)/主要为谁提供什么服务/用于在什么场景给什么人群转账" |
| | | /> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 |
| | | label="转账场景截图:" |
| | | prop="sceneFiles" |
| | | :check-rules="[{ type: 'upload', message: '请上传转账场景截图' }]" |
| | | > |
| | | <ProFormUpload |
| | | v-model:file-url="form.sceneFiles" |
| | | :limit="5" |
| | | :limitFileSize="10" |
| | | accept="png,jpg,jpeg,pdf" |
| | | ></ProFormUpload> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 |
| | | label="资质文件:" |
| | | prop="sceneQualificationFiles" |
| | | :check-rules="[{ type: 'upload', message: '请上传资质文件' }]" |
| | | > |
| | | <ProFormUpload |
| | | v-model:file-url="form.sceneQualificationFiles" |
| | | :limit="5" |
| | | :limitFileSize="10" |
| | | accept="png,jpg,jpeg,pdf" |
| | | ></ProFormUpload> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 label="签约状态:" prop="signStatus" required> |
| | | <span>{{ EnumEnterpriseWalletSignStatusText[form.signStatus] }}</span> |
| | | <el-button |
| | | style="margin-left: 10px" |
| | | type="primary" |
| | | link |
| | | @click="refetch({ type: 'inactive' })" |
| | | >校验</el-button |
| | | > |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 label="进件状态:" prop="expandindirectOrderStatus" required> |
| | | <span>{{ |
| | | EnumEnterpriseWalletExpandindirectOrderStatusText[form.expandindirectOrderStatus] |
| | | }}</span> |
| | | <el-button |
| | | style="margin-left: 10px" |
| | | type="primary" |
| | | link |
| | | @click="refetch({ type: 'inactive' })" |
| | | >校验</el-button |
| | | > |
| | | </ProFormItemV2> |
| | | </ProForm> |
| | | <AlipayWalletOpen v-bind="dialogQrcodeProps"></AlipayWalletOpen> |
| | | </LoadingLayout> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { FormInstance } from 'element-plus'; |
| | | import { |
| | | ProForm, |
| | | ProFormItemV2, |
| | | ProFormText, |
| | | LoadingLayout, |
| | | UploadUserFile, |
| | | ProFormSelect, |
| | | ProFormUpload, |
| | | useFormDialog, |
| | | } from '@bole-core/components'; |
| | | import * as enterpriseWalletServices from '@/services/api/enterpriseWallet'; |
| | | import { useQuery } from '@tanstack/vue-query'; |
| | | import { |
| | | EnumEnterpriseWalletExpandindirectOrderSceneText, |
| | | EnumEnterpriseWalletSignStatusText, |
| | | EnumEnterpriseWalletExpandindirectOrderStatusText, |
| | | } from '@/constants'; |
| | | import { convertWalletApiToFiles, convertWalletFilesToApi } from '@/utils'; |
| | | import AlipayWalletOpen from './AlipayWalletOpen.vue'; |
| | | |
| | | defineOptions({ |
| | | name: 'AliPayConfigureView', |
| | | }); |
| | | |
| | | type Props = { |
| | | id: string; |
| | | }; |
| | | |
| | | const props = withDefaults(defineProps<Props>(), {}); |
| | | |
| | | const dialogForm = ref<FormInstance>(); |
| | | |
| | | const form = reactive({ |
| | | alipayAccount: '', |
| | | alipayMerchantId: '', |
| | | signStatus: '' as any as EnumEnterpriseWalletSignStatus, |
| | | expandindirectOrderStatus: '' as any as EnumEnterpriseWalletExpandindirectOrderStatus, |
| | | name: '', |
| | | scene: '' as any as EnumEnterpriseWalletExpandindirectOrderScene, |
| | | sceneDirections: '', |
| | | /**转账场景截图 */ |
| | | sceneFiles: [] as UploadUserFile[], |
| | | /**商户行业资质图片或协议文本 */ |
| | | sceneQualificationFiles: [] as UploadUserFile[], |
| | | }); |
| | | |
| | | const { isLoading, refetch } = useQuery({ |
| | | queryKey: [ |
| | | 'enterpriseWalletServices/getEnterpriseWallet', |
| | | props.id, |
| | | EnumEnterpriseWalletAccess.Alipay, |
| | | ], |
| | | queryFn: async (ctx) => { |
| | | return await enterpriseWalletServices.getEnterpriseWallet({ |
| | | enterpriseId: props.id, |
| | | access: EnumEnterpriseWalletAccess.Alipay, |
| | | }); |
| | | }, |
| | | onSuccess(data) { |
| | | form.alipayAccount = data.identity; |
| | | form.alipayMerchantId = data.code; |
| | | form.expandindirectOrderStatus = data.expandindirectOrderStatus; |
| | | form.signStatus = data.signStatus; |
| | | form.name = data.name; |
| | | form.scene = data.scene || EnumEnterpriseWalletExpandindirectOrderScene.YONGJIN_BAOCHOU; |
| | | form.name = data.sceneDirections; |
| | | form.sceneFiles = convertWalletApiToFiles( |
| | | data.files, |
| | | EnumEnterpriseWalletExpandindirectOrderFileType.Scene |
| | | ); |
| | | form.sceneQualificationFiles = convertWalletApiToFiles( |
| | | data.files, |
| | | EnumEnterpriseWalletExpandindirectOrderFileType.SceneQualification |
| | | ); |
| | | }, |
| | | }); |
| | | |
| | | const { dialogProps: dialogQrcodeProps, handleAdd } = useFormDialog({ |
| | | defaultFormParams: { |
| | | alipayUrl: '', |
| | | }, |
| | | }); |
| | | |
| | | async function openEnterpriseWallet() { |
| | | try { |
| | | let params: API.OpenEnterpriseWalletCommand = { |
| | | access: EnumEnterpriseWalletAccess.Alipay, |
| | | enterpriseId: props.id, |
| | | }; |
| | | let res = await enterpriseWalletServices.openEnterpriseWallet(params); |
| | | if (res) { |
| | | handleAdd({ |
| | | alipayUrl: res.signUrl, |
| | | }); |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | |
| | | async function enterpriseWalletExpandindirectCreate() { |
| | | try { |
| | | if (!dialogForm.value) return; |
| | | const valid = await dialogForm.value.validate(); |
| | | if (!valid) return; |
| | | let params: API.EnterpriseWalletExpandindirectCreateCommand = { |
| | | enterpriseId: props.id, |
| | | identity: form.alipayAccount, |
| | | name: form.name, |
| | | scene: form.scene, |
| | | sceneDirections: form.sceneDirections, |
| | | sitesInfo: null, |
| | | files: [ |
| | | ...convertWalletFilesToApi( |
| | | form.sceneFiles, |
| | | EnumEnterpriseWalletExpandindirectOrderFileType.Scene |
| | | ), |
| | | ...convertWalletFilesToApi( |
| | | form.sceneQualificationFiles, |
| | | EnumEnterpriseWalletExpandindirectOrderFileType.SceneQualification |
| | | ), |
| | | ], |
| | | }; |
| | | let res = await enterpriseWalletServices.enterpriseWalletExpandindirectCreate(params); |
| | | return res; |
| | | } catch (error) {} |
| | | } |
| | | |
| | | defineExpose({ |
| | | onConfirm: enterpriseWalletExpandindirectCreate, |
| | | }); |
| | | </script> |
New file |
| | |
| | | <template> |
| | | <LoadingLayout :loading="isLoading"> |
| | | <ProForm :model="form" ref="dialogForm" label-width="120px"> |
| | | <ProFormItemV2 label="开户总行:" prop="bank"> |
| | | <ProFormText v-model.trim="form.bank" placeholder="请输入开户总行" :maxlength="40" /> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 label="开户支行:" prop="bankBranch"> |
| | | <ProFormText v-model.trim="form.bankBranch" placeholder="请输入开户支行" :maxlength="40" /> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 |
| | | label="银行账户:" |
| | | prop="bankAccount" |
| | | :check-rules="[ |
| | | { message: '请输入银行账户' }, |
| | | { message: '银行账户仅支持数字', pattern: BoleRegExp.RegNumber }, |
| | | ]" |
| | | > |
| | | <ProFormText v-model.trim="form.bankAccount" placeholder="请输入银行账户" /> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 label="银行账户:" prop="signStatus"> |
| | | {{ EnumEnterpriseWalletSignStatusText[form.signStatus] }} |
| | | <el-button |
| | | style="margin-left: 10px" |
| | | type="primary" |
| | | link |
| | | @click="refetch({ type: 'inactive' })" |
| | | >校验</el-button |
| | | > |
| | | </ProFormItemV2> |
| | | </ProForm> |
| | | </LoadingLayout> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { FormInstance } from 'element-plus'; |
| | | import { ProForm, ProFormItemV2, ProFormText, LoadingLayout } from '@bole-core/components'; |
| | | import * as enterpriseWalletServices from '@/services/api/enterpriseWallet'; |
| | | import { EnumEnterpriseWalletSignStatusText } from '@/constants'; |
| | | import { BoleRegExp } from '@bole-core/core'; |
| | | import { useQuery } from '@tanstack/vue-query'; |
| | | |
| | | defineOptions({ |
| | | name: 'BankConfigureView', |
| | | }); |
| | | |
| | | type Props = { |
| | | id: string; |
| | | }; |
| | | |
| | | const props = withDefaults(defineProps<Props>(), {}); |
| | | |
| | | const dialogForm = ref<FormInstance>(); |
| | | |
| | | const form = reactive({ |
| | | bank: '', |
| | | bankBranch: '', |
| | | bankAccount: '', |
| | | signStatus: '' as any as EnumEnterpriseWalletSignStatus, |
| | | }); |
| | | |
| | | const { isLoading, refetch } = useQuery({ |
| | | queryKey: [ |
| | | 'enterpriseWalletServices/getEnterpriseWallet', |
| | | props.id, |
| | | EnumEnterpriseWalletAccess.PingAnPay, |
| | | ], |
| | | queryFn: async () => { |
| | | return await enterpriseWalletServices.getEnterpriseWallet({ |
| | | enterpriseId: props.id, |
| | | access: EnumEnterpriseWalletAccess.PingAnPay, |
| | | }); |
| | | }, |
| | | onSuccess(data) { |
| | | form.bank = data.bank; |
| | | form.bankBranch = data.bankBranch; |
| | | form.bankAccount = data.identity; |
| | | form.signStatus = data.signStatus; |
| | | }, |
| | | }); |
| | | |
| | | async function openEnterpriseWallet() { |
| | | try { |
| | | if (!dialogForm.value) return; |
| | | const valid = await dialogForm.value.validate(); |
| | | if (!valid) return; |
| | | let params: API.OpenEnterpriseWalletCommand = { |
| | | access: EnumEnterpriseWalletAccess.PingAnPay, |
| | | enterpriseId: props.id, |
| | | bank: form.bank, |
| | | bankBranch: form.bankBranch, |
| | | identity: form.bankAccount, |
| | | }; |
| | | let res = await enterpriseWalletServices.openEnterpriseWallet(params); |
| | | return res; |
| | | } catch (error) {} |
| | | } |
| | | |
| | | defineExpose({ |
| | | onConfirm: openEnterpriseWallet, |
| | | }); |
| | | </script> |
| | |
| | | <template> |
| | | <ProDialog title="配置" v-model="visible" @close="onDialogClose" destroy-on-close draggable> |
| | | <ProForm :model="form" ref="dialogForm" label-width="120px"> |
| | | <ProFormItemV2 label="" prop="enterpriseConfigureType" label-width="0"> |
| | | <ProFormRadio |
| | | v-model="form.enterpriseConfigureType" |
| | | :value-enum="EnterpriseConfigureTypeText" |
| | | buttonStyle |
| | | /> |
| | | </ProFormItemV2> |
| | | <!-- <template v-if="form.enterpriseConfigureType === EnterpriseConfigureType.Bank"> |
| | | <ProFormItemV2 label="开户总行:" prop="openBank"> |
| | | <ProFormText |
| | | v-model.trim="form.openBank" |
| | | placeholder="请输入开户总行" |
| | | :maxlength="40" |
| | | /> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 label="开户支行:" prop="openBranchBank"> |
| | | <ProFormText |
| | | v-model.trim="form.openBranchBank" |
| | | placeholder="请输入开户支行" |
| | | :maxlength="40" |
| | | /> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 |
| | | label="银行账户:" |
| | | prop="bankAccount" |
| | | :check-rules="[ |
| | | { message: '请输入银行账户' }, |
| | | { message: '银行账户仅支持数字', pattern: BoleRegExp.RegNumber }, |
| | | ]" |
| | | > |
| | | <ProFormText v-model.trim="form.bankAccount" placeholder="请输入银行账户" /> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 label="银行账户:" prop="verifyStatus"> |
| | | {{ VerifyStatusText[form.verifyStatus] }} |
| | | <el-button style="margin-left: 10px" type="primary" link @click="handleCheckBankAccount" |
| | | >校验</el-button |
| | | > |
| | | </ProFormItemV2> |
| | | </template> --> |
| | | <template v-if="form.enterpriseConfigureType === EnterpriseConfigureType.AliPay"> |
| | | <ProFormItemV2 |
| | | label="支付宝账号:" |
| | | prop="alipayAccount" |
| | | :checkRules="[{ message: '请输入支付宝账号' }]" |
| | | > |
| | | <div style="display: flex; width: 100%"> |
| | | <ProFormText v-model.trim="form.alipayAccount" placeholder="请输入支付宝账号"> |
| | | </ProFormText> |
| | | <el-button style="margin-left: 10px" type="primary" link @click="openEnterpriseWallet" |
| | | >获取签约链接</el-button |
| | | > |
| | | </div> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 |
| | | label="支付宝姓名:" |
| | | prop="name" |
| | | :checkRules="[{ message: '请输入支付宝姓名' }]" |
| | | > |
| | | <ProFormText v-model.trim="form.name" placeholder="请输入支付宝姓名" /> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 |
| | | label="商户ID:" |
| | | prop="alipayMerchantId" |
| | | :checkRules="[{ message: '请输入商户ID' }]" |
| | | > |
| | | <ProFormText v-model.trim="form.alipayMerchantId" placeholder="请输入商户ID" disabled /> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 label="业务场景:" prop="scene" :checkRules="[{ message: '请选择业务场景' }]"> |
| | | <ProFormSelect |
| | | v-model="form.scene" |
| | | :valueEnum="EnumEnterpriseWalletExpandindirectOrderSceneText" |
| | | placeholder="请选择业务场景" |
| | | > |
| | | </ProFormSelect> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 |
| | | label="场景描述:" |
| | | prop="sceneDirections" |
| | | :checkRules="[{ message: '请输入场景描述' }]" |
| | | > |
| | | <ProFormText |
| | | v-model.trim="form.sceneDirections" |
| | | placeholder="谁/通过什么媒介(APP/web/小程序)/主要为谁提供什么服务/用于在什么场景给什么人群转账" |
| | | /> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 |
| | | label="转账场景截图:" |
| | | prop="sceneFiles" |
| | | :check-rules="[{ type: 'upload', message: '请上传转账场景截图' }]" |
| | | > |
| | | <ProFormUpload |
| | | v-model:file-url="form.sceneFiles" |
| | | :limit="5" |
| | | :limitFileSize="10" |
| | | accept="png,jpg,jpeg,pdf" |
| | | ></ProFormUpload> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 |
| | | label="资质文件:" |
| | | prop="sceneQualificationFiles" |
| | | :check-rules="[{ type: 'upload', message: '请上传资质文件' }]" |
| | | > |
| | | <ProFormUpload |
| | | v-model:file-url="form.sceneQualificationFiles" |
| | | :limit="5" |
| | | :limitFileSize="10" |
| | | accept="png,jpg,jpeg,pdf" |
| | | ></ProFormUpload> |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 label="签约状态:" prop="signStatus" required> |
| | | <span>{{ EnumEnterpriseWalletSignStatusText[form.signStatus] }}</span> |
| | | <el-button style="margin-left: 10px" type="primary" link @click="handleCheckBankAccount" |
| | | >校验</el-button |
| | | > |
| | | </ProFormItemV2> |
| | | <ProFormItemV2 label="进件状态:" prop="expandindirectOrderStatus" required> |
| | | <span>{{ |
| | | EnumEnterpriseWalletExpandindirectOrderStatusText[form.expandindirectOrderStatus] |
| | | }}</span> |
| | | <el-button style="margin-left: 10px" type="primary" link @click="handleCheckBankAccount" |
| | | >校验</el-button |
| | | > |
| | | </ProFormItemV2> |
| | | </template> |
| | | <template v-if="form.enterpriseConfigureType === EnterpriseConfigureType.Electronic"> |
| | | <div class="configure-dialog-form-title">通道配置</div> |
| | | <ProFormItemV2 |
| | | v-for="(item, index) in enabledElectronSignSettings" |
| | | :label="item.accessName" |
| | | :key="item.access" |
| | | prop="electronSignAccesses" |
| | | required |
| | | > |
| | | <ProFormSwitch |
| | | v-model="form.electronSignAccesses[index]" |
| | | :active-value="Number(item.access)" |
| | | :inactive-value="null" |
| | | ></ProFormSwitch> |
| | | </ProFormItemV2> |
| | | </template> |
| | | <template v-if="form.enterpriseConfigureType === EnterpriseConfigureType.ShortMessage"> |
| | | <div class="configure-dialog-form-title">通道配置</div> |
| | | <ProFormItemV2 label="名称:" prop="smsAccess" :checkRules="[{ message: '请选择短信通道' }]"> |
| | | <ProFormSelect |
| | | v-model="form.smsAccess" |
| | | :valueEnum="EnumSmsAccessText" |
| | | placeholder="请选择短信通道" |
| | | > |
| | | </ProFormSelect> |
| | | </ProFormItemV2> |
| | | <div class="configure-dialog-form-title">费用配置</div> |
| | | <ProFormItemV2 label="短信费用:" prop="smsCost"> |
| | | <ProFormInputNumber |
| | | :controls="false" |
| | | v-model="form.smsCost" |
| | | placeholder="请输入" |
| | | unit="元/条" |
| | | /> |
| | | </ProFormItemV2> |
| | | </template> |
| | | </ProForm> |
| | | <FieldRadio |
| | | v-model="form.enterpriseConfigureType" |
| | | :value-enum="EnterpriseConfigureTypeText" |
| | | buttonStyle |
| | | style="margin-bottom: 22px" |
| | | /> |
| | | <el-tabs v-model="form.enterpriseConfigureType" class="configure-dialog-tabs"> |
| | | <el-tab-pane lazy :name="EnterpriseConfigureType.Bank"> |
| | | <BankConfigureView :id="form.id" ref="bankConfigureViewRef" /> |
| | | </el-tab-pane> |
| | | <el-tab-pane lazy :name="EnterpriseConfigureType.AliPay"> |
| | | <AliPayConfigureView :id="form.id" ref="aliPayConfigureViewRef" /> |
| | | </el-tab-pane> |
| | | <el-tab-pane lazy :name="EnterpriseConfigureType.Electronic"> |
| | | <ElectronicConfigureView :id="form.id" ref="electronicConfigureViewRef" /> |
| | | </el-tab-pane> |
| | | <el-tab-pane lazy :name="EnterpriseConfigureType.ShortMessage"> |
| | | <ShortMessageConfigureView :id="form.id" ref="shortMessageConfigureViewRef" /> |
| | | </el-tab-pane> |
| | | </el-tabs> |
| | | <template #footer> |
| | | <span class="dialog-footer"> |
| | | <el-button @click="emit('onCancel')">取 消</el-button> |
| | |
| | | </span> |
| | | </template> |
| | | </ProDialog> |
| | | <AlipayWalletOpen v-bind="dialogQrcodeProps"></AlipayWalletOpen> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { FormInstance } from 'element-plus'; |
| | | import { |
| | | ProDialog, |
| | | ProForm, |
| | | ProFormItemV2, |
| | | ProFormText, |
| | | ProFormRadio, |
| | | ProFormInputNumber, |
| | | ProFormSelect, |
| | | ProFormSwitch, |
| | | useFormDialog, |
| | | UploadUserFile, |
| | | ProFormImageUpload, |
| | | ProFormUpload, |
| | | } from '@bole-core/components'; |
| | | import { BoleRegExp } from '@bole-core/core'; |
| | | import { |
| | | EnterpriseConfigureType, |
| | | EnterpriseConfigureTypeText, |
| | | ChargeTypeEnum, |
| | | EnumElectronSignAccessText, |
| | | EnumSmsAccessText, |
| | | EnumElectronSignAccess, |
| | | EnumEnterpriseWalletSignStatusText, |
| | | EnumEnterpriseWalletExpandindirectOrderStatusText, |
| | | EnumEnterpriseWalletExpandindirectOrderSceneText, |
| | | } from '@/constants'; |
| | | import * as enterpriseWalletServices from '@/services/api/enterpriseWallet'; |
| | | import AlipayWalletOpen from './AlipayWalletOpen.vue'; |
| | | import { ProDialog, FieldRadio } from '@bole-core/components'; |
| | | import { EnterpriseConfigureType, EnterpriseConfigureTypeText } from '@/constants'; |
| | | import BankConfigureView from './BankConfigureView.vue'; |
| | | import AliPayConfigureView from './AliPayConfigureView.vue'; |
| | | import ElectronicConfigureView from './ElectronicConfigureView.vue'; |
| | | import ShortMessageConfigureView from './ShortMessageConfigureView.vue'; |
| | | |
| | | defineOptions({ |
| | | name: 'ConfigureDialog', |
| | |
| | | |
| | | type Form = { |
| | | enterpriseConfigureType: EnterpriseConfigureType; |
| | | // openBank: string; |
| | | // openBranchBank: string; |
| | | // bankAccount: string; |
| | | // verifyStatus: VerifyStatus; |
| | | electronSignAccesses: EnumElectronSignAccess[]; |
| | | smsAccess: EnumSmsAccess; |
| | | smsCost: number; |
| | | alipayAccount: string; |
| | | alipayMerchantId: string; |
| | | id: string; |
| | | |
| | | signStatus: EnumEnterpriseWalletSignStatus; |
| | | expandindirectOrderStatus: EnumEnterpriseWalletExpandindirectOrderStatus; |
| | | |
| | | name: string; |
| | | scene: EnumEnterpriseWalletExpandindirectOrderScene; |
| | | sceneDirections: string; |
| | | /**转账场景截图 */ |
| | | sceneFiles: UploadUserFile[]; |
| | | /**商户行业资质图片或协议文本 */ |
| | | sceneQualificationFiles: UploadUserFile[]; |
| | | }; |
| | | |
| | | const form = defineModel<Form>('form'); |
| | |
| | | (e: 'onCancel'): void; |
| | | }>(); |
| | | |
| | | const dialogForm = ref<FormInstance>(); |
| | | |
| | | const { enabledElectronSignSettings } = useEnabledElectronSignSettings({ |
| | | all: true, |
| | | }); |
| | | |
| | | async function handleCheckBankAccount() { |
| | | try { |
| | | let alipayWallet = await enterpriseWalletServices.getEnterpriseWallet({ |
| | | enterpriseId: form.value.id, |
| | | access: EnumEnterpriseWalletAccess.Alipay, |
| | | }); |
| | | if (alipayWallet) { |
| | | form.value.signStatus = alipayWallet.signStatus; |
| | | form.value.expandindirectOrderStatus = alipayWallet.expandindirectOrderStatus; |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | |
| | | async function getEnterpriseWalletExpandindirectOrder() { |
| | | try { |
| | | let res = await enterpriseWalletServices.getEnterpriseWalletExpandindirectOrder({ |
| | | enterpriseId: form.value.id, |
| | | }); |
| | | if (res) { |
| | | form.value.expandindirectOrderStatus = res.orderStatus; |
| | | } |
| | | } catch (error) {} |
| | | } |
| | | const bankConfigureViewRef = |
| | | useTemplateRef<InstanceType<typeof BankConfigureView>>('bankConfigureViewRef'); |
| | | const aliPayConfigureViewRef = |
| | | useTemplateRef<InstanceType<typeof AliPayConfigureView>>('aliPayConfigureViewRef'); |
| | | const electronicConfigureViewRef = useTemplateRef<InstanceType<typeof ElectronicConfigureView>>( |
| | | 'electronicConfigureViewRef' |
| | | ); |
| | | const shortMessageConfigureViewRef = useTemplateRef<InstanceType<typeof ShortMessageConfigureView>>( |
| | | 'shortMessageConfigureViewRef' |
| | | ); |
| | | |
| | | function onDialogClose() { |
| | | if (!dialogForm.value) return; |
| | | dialogForm.value.resetFields(); |
| | | // if (!dialogForm.value) return; |
| | | // dialogForm.value.resetFields(); |
| | | } |
| | | |
| | | function handleConfirm() { |
| | | if (!dialogForm.value) return; |
| | | dialogForm.value.validate((valid) => { |
| | | if (valid) { |
| | | emit('onConfirm'); |
| | | } else { |
| | | return; |
| | | } |
| | | }); |
| | | } |
| | | |
| | | const { dialogProps: dialogQrcodeProps, handleAdd } = useFormDialog({ |
| | | defaultFormParams: { |
| | | alipayUrl: '', |
| | | }, |
| | | }); |
| | | |
| | | // async function handleOpenEnterpriseWallet() { |
| | | // try { |
| | | // if (!dialogForm.value) return; |
| | | // const valid = await dialogForm.value.validateField(['alipayAccount', 'alipayMerchantId']); |
| | | // if (valid) { |
| | | // openEnterpriseWallet(); |
| | | // } |
| | | // } catch (error) {} |
| | | // } |
| | | |
| | | async function openEnterpriseWallet() { |
| | | try { |
| | | let params: API.OpenEnterpriseWalletCommand = { |
| | | access: EnumEnterpriseWalletAccess.Alipay, |
| | | enterpriseId: form.value.id, |
| | | }; |
| | | let res = await enterpriseWalletServices.openEnterpriseWallet(params); |
| | | if (res) { |
| | | handleAdd({ |
| | | alipayUrl: res.signUrl, |
| | | }); |
| | | } |
| | | } catch (error) {} |
| | | async function handleConfirm() { |
| | | let res: any; |
| | | if (form.value.enterpriseConfigureType === EnterpriseConfigureType.Bank) { |
| | | res = await bankConfigureViewRef.value?.onConfirm(); |
| | | } else if (form.value.enterpriseConfigureType === EnterpriseConfigureType.AliPay) { |
| | | res = await aliPayConfigureViewRef.value?.onConfirm?.(); |
| | | } else if (form.value.enterpriseConfigureType === EnterpriseConfigureType.Electronic) { |
| | | res = await electronicConfigureViewRef.value?.onConfirm?.(); |
| | | } else if (form.value.enterpriseConfigureType === EnterpriseConfigureType.ShortMessage) { |
| | | res = await shortMessageConfigureViewRef.value?.onConfirm?.(); |
| | | } |
| | | if (res) { |
| | | emit('onConfirm'); |
| | | } |
| | | } |
| | | </script> |
| | | <style lang="scss" scoped> |
| | | @use '@/style/common.scss' as *; |
| | | |
| | | .configure-dialog-form-title { |
| | | margin-bottom: 10px; |
| | | font-size: 15px; |
| | | font-weight: bold; |
| | | line-height: 36px; |
| | | .configure-dialog-tabs { |
| | | :deep() { |
| | | .el-tabs__header { |
| | | display: none; |
| | | } |
| | | } |
| | | } |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <LoadingLayout :loading="isLoading"> |
| | | <ProForm :model="form" ref="dialogForm" label-width="120px"> |
| | | <div class="configure-dialog-form-title">通道配置</div> |
| | | <ProFormItemV2 |
| | | v-for="(item, index) in enabledElectronSignSettings" |
| | | :label="item.accessName" |
| | | :key="item.access" |
| | | prop="electronSignAccesses" |
| | | required |
| | | > |
| | | <ProFormSwitch |
| | | v-model="form.electronSignAccesses[index]" |
| | | :active-value="Number(item.access)" |
| | | :inactive-value="null" |
| | | ></ProFormSwitch> |
| | | </ProFormItemV2> |
| | | </ProForm> |
| | | </LoadingLayout> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { FormInstance } from 'element-plus'; |
| | | import { ProForm, ProFormItemV2, ProFormSwitch, LoadingLayout } from '@bole-core/components'; |
| | | import * as enterpriseServices from '@/services/api/enterprise'; |
| | | import { useQuery } from '@tanstack/vue-query'; |
| | | import { useEnabledElectronSignSettings } from '@/hooks'; |
| | | |
| | | defineOptions({ |
| | | name: 'ElectronicConfigureView', |
| | | }); |
| | | |
| | | type Props = { |
| | | id: string; |
| | | }; |
| | | |
| | | const props = withDefaults(defineProps<Props>(), {}); |
| | | |
| | | const dialogForm = ref<FormInstance>(); |
| | | |
| | | const { enabledElectronSignSettings, invalidateQueries } = useEnabledElectronSignSettings({ |
| | | all: true, |
| | | }); |
| | | |
| | | const form = reactive({ |
| | | electronSignAccesses: [] as EnumElectronSignAccess[], |
| | | }); |
| | | |
| | | const EnumElectronSignAccessList = computed(() => |
| | | Object.values(EnumElectronSignAccess) |
| | | .filter(Number) |
| | | .map((x) => Number(x)) |
| | | ); |
| | | |
| | | const { isLoading } = useQuery({ |
| | | queryKey: ['enterpriseServices/getEnterpriseElectronSignSetting', props.id], |
| | | queryFn: async () => { |
| | | return await enterpriseServices.getEnterpriseElectronSignSetting({ |
| | | id: props.id, |
| | | }); |
| | | }, |
| | | onSuccess(data) { |
| | | form.electronSignAccesses = EnumElectronSignAccessList.value.map((value) => |
| | | data.electronSignAccesses.includes(value) ? value : null |
| | | ); |
| | | }, |
| | | }); |
| | | |
| | | async function createOrEditFlexEnterpriseSignSetting() { |
| | | try { |
| | | if (!dialogForm.value) return; |
| | | const valid = await dialogForm.value.validate(); |
| | | if (!valid) return; |
| | | let params: API.SetEnterpriseElectronSignSettingCommand = { |
| | | id: props.id, |
| | | electronSignAccesses: form.electronSignAccesses.filter(Boolean), |
| | | }; |
| | | let res = await enterpriseServices.setEnterpriseElectronSignSetting(params); |
| | | invalidateQueries(); |
| | | return res; |
| | | } catch (error) {} |
| | | } |
| | | |
| | | defineExpose({ |
| | | onConfirm: createOrEditFlexEnterpriseSignSetting, |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @use '@/style/common.scss' as *; |
| | | |
| | | .configure-dialog-form-title { |
| | | margin-bottom: 10px; |
| | | font-size: 15px; |
| | | font-weight: bold; |
| | | line-height: 36px; |
| | | } |
| | | </style> |
New file |
| | |
| | | <template> |
| | | <LoadingLayout :loading="isLoading"> |
| | | <ProForm :model="form" ref="dialogForm" label-width="120px"> |
| | | <div class="configure-dialog-form-title">通道配置</div> |
| | | <ProFormItemV2 label="名称:" prop="smsAccess" :checkRules="[{ message: '请选择短信通道' }]"> |
| | | <ProFormSelect |
| | | v-model="form.smsAccess" |
| | | :valueEnum="EnumSmsAccessText" |
| | | placeholder="请选择短信通道" |
| | | > |
| | | </ProFormSelect> |
| | | </ProFormItemV2> |
| | | <div class="configure-dialog-form-title">费用配置</div> |
| | | <ProFormItemV2 label="短信费用:" prop="smsCost"> |
| | | <ProFormInputNumber |
| | | :controls="false" |
| | | v-model="form.smsCost" |
| | | placeholder="请输入" |
| | | unit="元/条" |
| | | /> |
| | | </ProFormItemV2> |
| | | </ProForm> |
| | | </LoadingLayout> |
| | | </template> |
| | | |
| | | <script setup lang="ts"> |
| | | import { FormInstance } from 'element-plus'; |
| | | import { |
| | | ProForm, |
| | | ProFormItemV2, |
| | | ProFormSelect, |
| | | LoadingLayout, |
| | | ProFormInputNumber, |
| | | } from '@bole-core/components'; |
| | | import * as enterpriseServices from '@/services/api/enterprise'; |
| | | import { useQuery } from '@tanstack/vue-query'; |
| | | import { EnumSmsAccessText } from '@/constants'; |
| | | |
| | | defineOptions({ |
| | | name: 'ShortMessageConfigureView', |
| | | }); |
| | | |
| | | type Props = { |
| | | id: string; |
| | | }; |
| | | |
| | | const props = withDefaults(defineProps<Props>(), {}); |
| | | |
| | | const dialogForm = ref<FormInstance>(); |
| | | |
| | | const form = reactive({ |
| | | smsAccess: '' as any as EnumSmsAccess, |
| | | smsCost: 0, |
| | | }); |
| | | |
| | | const { isLoading } = useQuery({ |
| | | queryKey: ['enterpriseServices/getEnterpriseSmsSetting', props.id], |
| | | queryFn: async () => { |
| | | return await enterpriseServices.getEnterpriseSmsSetting({ |
| | | id: props.id, |
| | | }); |
| | | }, |
| | | onSuccess(data) { |
| | | form.smsAccess = data.smsAccess; |
| | | form.smsCost = data.smsCost; |
| | | }, |
| | | }); |
| | | |
| | | async function createOrEditFlexEnterpriseMessageSetting() { |
| | | try { |
| | | if (!dialogForm.value) return; |
| | | const valid = await dialogForm.value.validate(); |
| | | if (!valid) return; |
| | | let params: API.SetEnterpriseSmsSettingCommand = { |
| | | id: props.id, |
| | | smsAccess: form.smsAccess, |
| | | smsCost: form.smsCost, |
| | | }; |
| | | let res = await enterpriseServices.setEnterpriseSmsSetting(params); |
| | | return res; |
| | | } catch (error) {} |
| | | } |
| | | |
| | | defineExpose({ |
| | | onConfirm: createOrEditFlexEnterpriseMessageSetting, |
| | | }); |
| | | </script> |
| | | |
| | | <style lang="scss" scoped> |
| | | @use '@/style/common.scss' as *; |
| | | |
| | | .configure-dialog-form-title { |
| | | margin-bottom: 10px; |
| | | font-size: 15px; |
| | | font-weight: bold; |
| | | line-height: 36px; |
| | | } |
| | | </style> |