From a8a80c66601a8ba8768de833df04e96d973bef71 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期五, 05 九月 2025 16:01:50 +0800
Subject: [PATCH] fix: env

---
 src/views/EnterpriseManage/components/ConfigureDialog.vue |  139 ++++++++++++++++++++++++++-------------------
 1 files changed, 80 insertions(+), 59 deletions(-)

diff --git a/src/views/EnterpriseManage/components/ConfigureDialog.vue b/src/views/EnterpriseManage/components/ConfigureDialog.vue
index 5a8a232..e094b3c 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,65 +35,60 @@
         </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="openEnterpriseWallet"
+              >鑾峰彇绛剧害閾炬帴</el-button
+            >
+          </div>
+        </ProFormItemV2>
+        <ProFormItemV2
+          label="鍟嗘埛ID:"
+          prop="alipayMerchantId"
+          :checkRules="[{ message: '璇疯緭鍏ュ晢鎴稩D' }]"
+        >
+          <ProFormText v-model.trim="form.alipayMerchantId" placeholder="璇疯緭鍏ュ晢鎴稩D" />
+        </ProFormItemV2>
+        <ProFormItemV2 label="绛剧害鐘舵��:" prop="alipayAccount" required>
+          <span>宸茬绾�</span>
+          <el-button style="margin-left: 10px" type="primary" link @click="handleCheckBankAccount"
+            >鏍¢獙</el-button
+          >
+        </ProFormItemV2>
+        <ProFormItemV2 label="杩涗欢鐘舵��:" prop="alipayAccount" required>
+          <span>宸茶繘浠�</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="鍚嶇О:"
-          prop="realAccess"
-          :checkRules="[{ message: '璇烽�夋嫨鐢靛瓙绛鹃�氶亾' }]"
+          v-for="(item, index) in enabledElectronSignSettings"
+          :label="item.accessName"
+          :key="item.access"
+          prop="electronSignAccesses"
+          required
         >
-          <ProFormSelect
-            v-model="form.realAccess"
-            :valueEnum="EnumRealAccessText"
-            placeholder="璇烽�夋嫨鐢靛瓙绛鹃�氶亾"
-          >
-          </ProFormSelect>
+          <ProFormSwitch
+            v-model="form.electronSignAccesses[index]"
+            :active-value="Number(item.access)"
+            :inactive-value="null"
+          ></ProFormSwitch>
         </ProFormItemV2>
-        <div class="configure-dialog-form-title">璐圭敤閰嶇疆</div>
-        <ProFormItemV2
-          label="璁¤垂鏂瑰紡:"
-          prop="chargeType"
-          :checkRules="[{ message: '璇烽�夋嫨璁¤垂鏂瑰紡' }]"
-        >
-          <ProFormRadio
-            :button-style="false"
-            v-model="form.chargeType"
-            :value-enum="ChargeTypeEnumText"
-          />
-        </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>
       </template>
       <template v-if="form.enterpriseConfigureType === EnterpriseConfigureType.ShortMessage">
         <div class="configure-dialog-form-title">閫氶亾閰嶇疆</div>
@@ -123,6 +118,7 @@
       </span>
     </template>
   </ProDialog>
+  <AlipayWalletOpen v-bind="dialogQrcodeProps"></AlipayWalletOpen>
 </template>
 
 <script setup lang="ts">
@@ -135,17 +131,20 @@
   ProFormRadio,
   ProFormInputNumber,
   ProFormSelect,
+  ProFormSwitch,
+  useFormDialog,
 } from '@bole-core/components';
 import { BoleRegExp } from '@bole-core/core';
 import {
   EnterpriseConfigureType,
   EnterpriseConfigureTypeText,
   ChargeTypeEnum,
-  ChargeTypeEnumText,
-  EnumRealAccessText,
+  EnumElectronSignAccessText,
   EnumSmsAccessText,
-  EnumRealAccess,
+  EnumElectronSignAccess,
 } from '@/constants';
+import * as enterpriseWalletServices from '@/services/api/enterpriseWallet';
+import AlipayWalletOpen from './AlipayWalletOpen.vue';
 
 defineOptions({
   name: 'ConfigureDialog',
@@ -157,13 +156,12 @@
   // 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;
 };
 
 const form = defineModel<Form>('form');
@@ -175,6 +173,8 @@
 }>();
 
 const dialogForm = ref<FormInstance>();
+
+const { enabledElectronSignSettings } = useEnabledElectronSignSettings();
 
 function handleCheckBankAccount() {}
 
@@ -193,6 +193,27 @@
     }
   });
 }
+
+const { dialogProps: dialogQrcodeProps, handleAdd } = useFormDialog({
+  defaultFormParams: {
+    alipayUrl: '',
+  },
+});
+
+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