From 15b1d4f07e5a0cc5b77fca5adf1c043bee3c4585 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期二, 09 九月 2025 13:54:56 +0800
Subject: [PATCH] fix: bug

---
 src/views/EnterpriseManage/components/ConfigureDialog.vue |   98 ++++++++++++++++++++++++++++++++++++++++++++++++-
 1 files changed, 96 insertions(+), 2 deletions(-)

diff --git a/src/views/EnterpriseManage/components/ConfigureDialog.vue b/src/views/EnterpriseManage/components/ConfigureDialog.vue
index e1d475e..4129230 100644
--- a/src/views/EnterpriseManage/components/ConfigureDialog.vue
+++ b/src/views/EnterpriseManage/components/ConfigureDialog.vue
@@ -35,11 +35,51 @@
         </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="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
@@ -84,6 +124,7 @@
       </span>
     </template>
   </ProDialog>
+  <AlipayWalletOpen v-bind="dialogQrcodeProps"></AlipayWalletOpen>
 </template>
 
 <script setup lang="ts">
@@ -97,6 +138,7 @@
   ProFormInputNumber,
   ProFormSelect,
   ProFormSwitch,
+  useFormDialog,
 } from '@bole-core/components';
 import { BoleRegExp } from '@bole-core/core';
 import {
@@ -106,7 +148,11 @@
   EnumElectronSignAccessText,
   EnumSmsAccessText,
   EnumElectronSignAccess,
+  EnumEnterpriseWalletSignStatusText,
+  EnumEnterpriseWalletExpandindirectOrderStatusText,
 } from '@/constants';
+import * as enterpriseWalletServices from '@/services/api/enterpriseWallet';
+import AlipayWalletOpen from './AlipayWalletOpen.vue';
 
 defineOptions({
   name: 'ConfigureDialog',
@@ -121,6 +167,12 @@
   electronSignAccesses: EnumElectronSignAccess[];
   smsAccess: EnumSmsAccess;
   smsCost: number;
+  alipayAccount: string;
+  alipayMerchantId: string;
+  id: string;
+
+  signStatus: EnumEnterpriseWalletSignStatus;
+  expandindirectOrderStatus: EnumEnterpriseWalletExpandindirectOrderStatus;
 };
 
 const form = defineModel<Form>('form');
@@ -135,7 +187,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;
@@ -152,6 +215,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