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 | 143 +++++++++++++++++++++++++++++++++++++++++++---- 1 files changed, 130 insertions(+), 13 deletions(-) diff --git a/src/views/EnterpriseManage/components/ConfigureDialog.vue b/src/views/EnterpriseManage/components/ConfigureDialog.vue index 16d84e1..c7bf12b 100644 --- a/src/views/EnterpriseManage/components/ConfigureDialog.vue +++ b/src/views/EnterpriseManage/components/ConfigureDialog.vue @@ -1,6 +1,6 @@ <template> <ProDialog title="閰嶇疆" v-model="visible" @close="onDialogClose" destroy-on-close draggable> - <ProForm :model="form" ref="dialogForm" label-width="100px"> + <ProForm :model="form" ref="dialogForm" label-width="120px"> <ProFormItemV2 label="" prop="enterpriseConfigureType" label-width="0"> <ProFormRadio v-model="form.enterpriseConfigureType" @@ -35,25 +35,79 @@ </ProFormItemV2> <ProFormItemV2 label="閾惰璐︽埛:" prop="verifyStatus"> {{ VerifyStatusText[form.verifyStatus] }} - <el-button style="margin-left: 40px" type="primary" link @click="handleCheckBankAccount" + <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="handleOpenEnterpriseWallet" + >鑾峰彇绛剧害閾炬帴</el-button + > + </div> + </ProFormItemV2> + <ProFormItemV2 + label="鍟嗘埛ID:" + prop="alipayMerchantId" + :checkRules="[{ message: '璇疯緭鍏ュ晢鎴稩D' }]" + > + <ProFormText v-model.trim="form.alipayMerchantId" placeholder="璇疯緭鍏ュ晢鎴稩D" /> + </ProFormItemV2> + <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="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 - label="鍚嶇О:" + v-for="(item, index) in enabledElectronSignSettings" + :label="item.accessName" + :key="item.access" prop="electronSignAccesses" - :checkRules="[{ message: '璇烽�夋嫨鐢靛瓙绛鹃�氶亾' }]" + required > - <ProFormSelect - v-model="form.electronSignAccesses" - :valueEnum="EnumElectronSignAccessText" - placeholder="璇烽�夋嫨鐢靛瓙绛鹃�氶亾" - multiple - > - </ProFormSelect> + <ProFormSwitch + v-model="form.electronSignAccesses[index]" + :active-value="Number(item.access)" + :inactive-value="null" + ></ProFormSwitch> </ProFormItemV2> </template> <template v-if="form.enterpriseConfigureType === EnterpriseConfigureType.ShortMessage"> @@ -84,6 +138,7 @@ </span> </template> </ProDialog> + <AlipayWalletOpen v-bind="dialogQrcodeProps"></AlipayWalletOpen> </template> <script setup lang="ts"> @@ -96,6 +151,10 @@ ProFormRadio, ProFormInputNumber, ProFormSelect, + ProFormSwitch, + useFormDialog, + UploadUserFile, + ProFormImageUpload, } from '@bole-core/components'; import { BoleRegExp } from '@bole-core/core'; import { @@ -104,8 +163,12 @@ ChargeTypeEnum, EnumElectronSignAccessText, EnumSmsAccessText, - EnumRealAccess, + EnumElectronSignAccess, + EnumEnterpriseWalletSignStatusText, + EnumEnterpriseWalletExpandindirectOrderStatusText, } from '@/constants'; +import * as enterpriseWalletServices from '@/services/api/enterpriseWallet'; +import AlipayWalletOpen from './AlipayWalletOpen.vue'; defineOptions({ name: 'ConfigureDialog', @@ -120,6 +183,14 @@ electronSignAccesses: EnumElectronSignAccess[]; smsAccess: EnumSmsAccess; smsCost: number; + alipayAccount: string; + alipayMerchantId: string; + id: string; + + signStatus: EnumEnterpriseWalletSignStatus; + expandindirectOrderStatus: EnumEnterpriseWalletExpandindirectOrderStatus; + + url: UploadUserFile[]; }; const form = defineModel<Form>('form'); @@ -132,7 +203,20 @@ const dialogForm = ref<FormInstance>(); -function handleCheckBankAccount() {} +const { enabledElectronSignSettings } = useEnabledElectronSignSettings(); + +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; @@ -149,6 +233,39 @@ } }); } + +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, + account: form.value.alipayAccount, + merchantId: form.value.alipayMerchantId, + }; + let res = await enterpriseWalletServices.openEnterpriseWallet(params); + if (res) { + handleAdd({ + alipayUrl: res.signUrl, + }); + } + } catch (error) {} +} </script> <style lang="scss" scoped> @use '@/style/common.scss' as *; -- Gitblit v1.9.1