From 2260308c9ab6abca8b32ba1afc1dbada04ec0c1b Mon Sep 17 00:00:00 2001 From: wupengfei <834520024@qq.com> Date: 星期四, 11 九月 2025 13:09:47 +0800 Subject: [PATCH] feat: 页面 --- src/views/EnterpriseManage/components/ConfigureDialog.vue | 74 ++++++++++++++++++++++++++++++++----- 1 files changed, 64 insertions(+), 10 deletions(-) diff --git a/src/views/EnterpriseManage/components/ConfigureDialog.vue b/src/views/EnterpriseManage/components/ConfigureDialog.vue index 46b8b87..c7bf12b 100644 --- a/src/views/EnterpriseManage/components/ConfigureDialog.vue +++ b/src/views/EnterpriseManage/components/ConfigureDialog.vue @@ -49,7 +49,11 @@ <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 + style="margin-left: 10px" + type="primary" + link + @click="handleOpenEnterpriseWallet" >鑾峰彇绛剧害閾炬帴</el-button > </div> @@ -61,14 +65,30 @@ > <ProFormText v-model.trim="form.alipayMerchantId" placeholder="璇疯緭鍏ュ晢鎴稩D" /> </ProFormItemV2> - <ProFormItemV2 label="绛剧害鐘舵��:" prop="alipayAccount" required> - <span>宸茬绾�</span> + <ProFormItemV2 + label="鍥剧墖:" + prop="url" + :check-rules="[{ type: 'upload', message: '璇蜂笂浼犲浘鐗�' }]" + > + <ProFormImageUpload v-model:file-url="form.url" :limitFileCount="1"></ProFormImageUpload> + </ProFormItemV2> + <ProFormItemV2 + label="鍥剧墖:" + prop="url" + :check-rules="[{ type: 'upload', message: '璇蜂笂浼犲浘鐗�' }]" + > + <ProFormImageUpload v-model:file-url="form.url" :limitFileCount="1"></ProFormImageUpload> + </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="alipayAccount" required> - <span>宸茶繘浠�</span> + <ProFormItemV2 label="杩涗欢鐘舵��:" prop="expandindirectOrderStatus" required> + <span>{{ + EnumEnterpriseWalletExpandindirectOrderStatusText[form.expandindirectOrderStatus] + }}</span> <el-button style="margin-left: 10px" type="primary" link @click="handleCheckBankAccount" >鏍¢獙</el-button > @@ -118,7 +138,7 @@ </span> </template> </ProDialog> - <QrcodeDialog v-bind="dialogQrcodeProps"></QrcodeDialog> + <AlipayWalletOpen v-bind="dialogQrcodeProps"></AlipayWalletOpen> </template> <script setup lang="ts"> @@ -133,6 +153,8 @@ ProFormSelect, ProFormSwitch, useFormDialog, + UploadUserFile, + ProFormImageUpload, } from '@bole-core/components'; import { BoleRegExp } from '@bole-core/core'; import { @@ -142,9 +164,11 @@ EnumElectronSignAccessText, EnumSmsAccessText, EnumElectronSignAccess, + EnumEnterpriseWalletSignStatusText, + EnumEnterpriseWalletExpandindirectOrderStatusText, } from '@/constants'; import * as enterpriseWalletServices from '@/services/api/enterpriseWallet'; -import QrcodeDialog from './QrcodeDialog.vue'; +import AlipayWalletOpen from './AlipayWalletOpen.vue'; defineOptions({ name: 'ConfigureDialog', @@ -161,6 +185,12 @@ smsCost: number; alipayAccount: string; alipayMerchantId: string; + id: string; + + signStatus: EnumEnterpriseWalletSignStatus; + expandindirectOrderStatus: EnumEnterpriseWalletExpandindirectOrderStatus; + + url: UploadUserFile[]; }; const form = defineModel<Form>('form'); @@ -175,7 +205,18 @@ const { enabledElectronSignSettings } = useEnabledElectronSignSettings(); -function handleCheckBankAccount() {} +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) {} +} function onDialogClose() { if (!dialogForm.value) return; @@ -195,19 +236,32 @@ const { dialogProps: dialogQrcodeProps, handleAdd } = useFormDialog({ defaultFormParams: { - qrcodeUrl: '', + 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, + account: form.value.alipayAccount, + merchantId: form.value.alipayMerchantId, }; let res = await enterpriseWalletServices.openEnterpriseWallet(params); if (res) { handleAdd({ - qrcodeUrl: res.signUrl, + alipayUrl: res.signUrl, }); } } catch (error) {} -- Gitblit v1.9.1