From 3ec0ca03b150b22d29d844d5fe6d1a2abd457835 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期二, 16 九月 2025 14:53:22 +0800
Subject: [PATCH] fix: bug
---
src/views/EnterpriseManage/components/ConfigureDialog.vue | 247 ++++++++++++++++++++++++++++++++++++-------------
1 files changed, 182 insertions(+), 65 deletions(-)
diff --git a/src/views/EnterpriseManage/components/ConfigureDialog.vue b/src/views/EnterpriseManage/components/ConfigureDialog.vue
index 234dbbf..4a8e7f9 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,80 +35,122 @@
</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.Electronic">
- <div class="configure-dialog-form-title">閫氶亾閰嶇疆</div>
+ <template v-if="form.enterpriseConfigureType === EnterpriseConfigureType.AliPay">
<ProFormItemV2
- label="鍚嶇О:"
- prop="realAccess"
- :checkRules="[{ message: '璇烽�夋嫨鐢靛瓙绛鹃�氶亾' }]"
+ 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: '璇疯緭鍏ュ晢鎴稩D' }]"
+ >
+ <ProFormText v-model.trim="form.alipayMerchantId" placeholder="璇疯緭鍏ュ晢鎴稩D" disabled />
+ </ProFormItemV2>
+ <ProFormItemV2 label="涓氬姟鍦烘櫙:" prop="scene" :checkRules="[{ message: '璇烽�夋嫨涓氬姟鍦烘櫙' }]">
<ProFormSelect
- v-model="form.realAccess"
- :valueEnum="EnumRealAccessText"
- placeholder="璇烽�夋嫨鐢靛瓙绛鹃�氶亾"
+ v-model="form.scene"
+ :valueEnum="EnumEnterpriseWalletExpandindirectOrderSceneText"
+ placeholder="璇烽�夋嫨涓氬姟鍦烘櫙"
>
</ProFormSelect>
</ProFormItemV2>
- <div class="configure-dialog-form-title">璐圭敤閰嶇疆</div>
<ProFormItemV2
- label="璁¤垂鏂瑰紡:"
- prop="chargeType"
- :checkRules="[{ message: '璇烽�夋嫨璁¤垂鏂瑰紡' }]"
+ label="鍦烘櫙鎻忚堪:"
+ prop="sceneDirections"
+ :checkRules="[{ message: '璇疯緭鍏ュ満鏅弿杩�' }]"
>
- <ProFormRadio
- :button-style="false"
- v-model="form.chargeType"
- :value-enum="ChargeTypeEnumText"
+ <ProFormText
+ v-model.trim="form.sceneDirections"
+ placeholder="璋�/閫氳繃浠�涔堝獟浠嬶紙APP/web/灏忕▼搴�)/涓昏涓鸿皝鎻愪緵浠�涔堟湇鍔�/鐢ㄤ簬鍦ㄤ粈涔堝満鏅粰浠�涔堜汉缇よ浆璐�"
/>
</ProFormItemV2>
- <template v-if="form.chargeType === ChargeTypeEnum.Group">
- <ProFormItemV2 label="瀹炲悕璐圭敤:" prop="realVerifyCost">
- <ProFormInputNumber
- :controls="false"
- v-model="form.realVerifyCost"
- placeholder="璇疯緭鍏�"
- unit="鍏�/鏉�"
- />
- </ProFormItemV2>
- <ProFormItemV2 label="绛剧害璐圭敤:" prop="signCost">
- <ProFormInputNumber
- :controls="false"
- v-model="form.signCost"
- placeholder="璇疯緭鍏�"
- unit="鍏�/浠�"
- />
- </ProFormItemV2>
- </template>
- <template v-if="form.chargeType === ChargeTypeEnum.Merge">
- <ProFormItemV2 label="缁熶竴鐢靛瓙绛�:" prop="mergeSignCost">
- <ProFormInputNumber
- :controls="false"
- v-model="form.mergeSignCost"
- placeholder="璇疯緭鍏�"
- unit="鍏�/浠�"
- />
- </ProFormItemV2>
- </template>
+ <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="messageChannel"
- :checkRules="[{ message: '璇烽�夋嫨鐭俊閫氶亾' }]"
- >
+ <div class="configure-dialog-form-title">閫氶亾閰嶇疆</div>
+ <ProFormItemV2 label="鍚嶇О:" prop="smsAccess" :checkRules="[{ message: '璇烽�夋嫨鐭俊閫氶亾' }]">
<ProFormSelect
- v-model="form.messageChannel"
+ v-model="form.smsAccess"
:valueEnum="EnumSmsAccessText"
placeholder="璇烽�夋嫨鐭俊閫氶亾"
>
</ProFormSelect>
- </ProFormItemV2> -->
+ </ProFormItemV2>
<div class="configure-dialog-form-title">璐圭敤閰嶇疆</div>
<ProFormItemV2 label="鐭俊璐圭敤:" prop="smsCost">
<ProFormInputNumber
@@ -127,6 +169,7 @@
</span>
</template>
</ProDialog>
+ <AlipayWalletOpen v-bind="dialogQrcodeProps"></AlipayWalletOpen>
</template>
<script setup lang="ts">
@@ -139,19 +182,26 @@
ProFormRadio,
ProFormInputNumber,
ProFormSelect,
+ ProFormSwitch,
+ useFormDialog,
+ UploadUserFile,
+ ProFormImageUpload,
+ ProFormUpload,
} from '@bole-core/components';
import { BoleRegExp } from '@bole-core/core';
import {
EnterpriseConfigureType,
EnterpriseConfigureTypeText,
ChargeTypeEnum,
- ChargeTypeEnumText,
- EnumRealAccessText,
- VerifyStatusText,
- VerifyStatus,
+ EnumElectronSignAccessText,
EnumSmsAccessText,
- EnumRealAccess,
+ EnumElectronSignAccess,
+ EnumEnterpriseWalletSignStatusText,
+ EnumEnterpriseWalletExpandindirectOrderStatusText,
+ EnumEnterpriseWalletExpandindirectOrderSceneText,
} from '@/constants';
+import * as enterpriseWalletServices from '@/services/api/enterpriseWallet';
+import AlipayWalletOpen from './AlipayWalletOpen.vue';
defineOptions({
name: 'ConfigureDialog',
@@ -163,13 +213,23 @@
// openBranchBank: string;
// bankAccount: string;
// verifyStatus: VerifyStatus;
- chargeType: ChargeTypeEnum;
- realAccess: EnumRealAccess;
- realVerifyCost: number;
- signCost: number;
- mergeSignCost: number;
+ 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');
@@ -182,7 +242,33 @@
const dialogForm = ref<FormInstance>();
-function handleCheckBankAccount() {}
+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) {}
+}
function onDialogClose() {
if (!dialogForm.value) return;
@@ -199,6 +285,37 @@
}
});
}
+
+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) {}
+}
</script>
<style lang="scss" scoped>
@use '@/style/common.scss' as *;
--
Gitblit v1.9.1