From be028017a461af4c9745c69c4df084d4c3e6b296 Mon Sep 17 00:00:00 2001
From: zhengyiming <540361168@qq.com>
Date: 星期三, 22 十月 2025 18:08:49 +0800
Subject: [PATCH] fix: bug
---
src/views/EnterpriseManage/EnterpriseManageList.vue | 132 +++++++++++---------------------------------
1 files changed, 33 insertions(+), 99 deletions(-)
diff --git a/src/views/EnterpriseManage/EnterpriseManageList.vue b/src/views/EnterpriseManage/EnterpriseManageList.vue
index 6fbeabb..12a573b 100644
--- a/src/views/EnterpriseManage/EnterpriseManageList.vue
+++ b/src/views/EnterpriseManage/EnterpriseManageList.vue
@@ -1,5 +1,5 @@
<template>
- <LoadingLayout :loading="state.loading">
+ <LoadingLayout :loading="isInitialLoading">
<AppContainer>
<ProTableQueryFilterBar @on-reset="reset">
<template #query>
@@ -9,7 +9,6 @@
:value-enum="IsConfiguredText"
buttonStyle
showAllBtn
- @change="getList()"
/>
</QueryFilterItem>
<QueryFilterItem>
@@ -18,7 +17,6 @@
style="width: 300px"
placeholder="浼佷笟鍚嶇О/娉曚汉/鑱旂郴浜�"
@on-click-search="getList"
- @keyup.enter="getList()"
>
</SearchInput>
</QueryFilterItem>
@@ -37,6 +35,7 @@
</ProTableV2>
</AppContainer>
<ConfigureDialog v-bind="dialogProps" />
+ <WechatWalletOpen v-bind="dialogWechatProps"></WechatWalletOpen>
</LoadingLayout>
</template>
@@ -49,15 +48,16 @@
LoadingLayout,
AppContainer,
QueryFilterItem,
- useTable,
useFormDialog,
FieldRadio,
+ useTableV2,
} from '@bole-core/components';
import { useAccess, useGlobalEventContext } from '@/hooks';
import { EnterpriseConfigureType, IsConfiguredText } from '@/constants';
import ConfigureDialog from './components/ConfigureDialog.vue';
import { Message } from '@bole-core/core';
import * as enterpriseServices from '@/services/api/enterprise';
+import WechatWalletOpen from './components/WechatWalletOpen.vue';
defineOptions({
name: 'EnterpriseManageList',
@@ -85,25 +85,15 @@
const router = useRouter();
-const BaseState = {
- loading: true,
-};
-
-const state = reactive({ ...BaseState });
-
-onMounted(async () => {
- await getList();
- state.loading = false;
-});
-
const {
getDataSource: getList,
proTableProps,
paginationState,
extraParamState,
reset,
-} = useTable(
- async ({ pageIndex, pageSize }, extraParamState) => {
+ isInitialLoading,
+} = useTableV2(
+ async ({ pageIndex, pageSize, isInitialLoading }, extraParamState) => {
try {
let params: API.GetEnterprisesQuery = {
pageModel: {
@@ -116,7 +106,7 @@
};
let res = await enterpriseServices.getEnterprises(params, {
- showLoading: !state.loading,
+ showLoading: !isInitialLoading,
});
return res;
} catch (error) {
@@ -137,97 +127,41 @@
}
);
-async function getEnterpriseElectronSignSetting(id: string) {
- try {
- return await enterpriseServices.getEnterpriseElectronSignSetting({ id: id });
- } catch (error) {}
+function openDialog(row?: API.GetEnterprisesQueryResultItem) {
+ handleEdit({
+ id: row.id,
+ enterpriseConfigureType: EnterpriseConfigureType.Bank,
+ });
}
-async function getEnterpriseSmsSetting(id: string) {
- try {
- return await enterpriseServices.getEnterpriseSmsSetting({ id: id });
- } catch (error) {}
-}
-
-async function openDialog(row?: API.GetEnterprisesQueryResultItem) {
- if (row) {
- let electronSignSetting = await getEnterpriseElectronSignSetting(row.id);
- let smsSetting = await getEnterpriseSmsSetting(row.id);
- handleEdit({
- id: row.id,
- enterpriseConfigureType: EnterpriseConfigureType.Electronic,
- electronSignAccesses: electronSignSetting.electronSignAccesses,
- smsAccess: smsSetting.smsAccess,
- smsCost: smsSetting.smsCost,
- });
- } else {
- handleAdd({
- enterpriseConfigureType: EnterpriseConfigureType.Electronic,
- });
- }
-}
-
-const { dialogProps, handleAdd, handleEdit, editForm, dialogState } = useFormDialog({
+const { dialogProps, handleEdit, dialogState, editForm } = useFormDialog({
onConfirm: handleAddOrEdit,
defaultFormParams: {
id: '',
- enterpriseConfigureType: EnterpriseConfigureType.Electronic,
- electronSignAccesses: [] as any as EnumElectronSignAccess[],
- smsAccess: '' as any as EnumSmsAccess,
- smsCost: 0,
+ enterpriseConfigureType: EnterpriseConfigureType.Bank,
},
});
-async function handleAddOrEdit() {
- try {
- let res;
- // if (type === EnterpriseConfigureType.Bank) {
- // res = await createOrEditFlexEnterpriseBankSetting();
- // }
- if (editForm.enterpriseConfigureType === EnterpriseConfigureType.Electronic) {
- res = await createOrEditFlexEnterpriseSignSetting();
- }
- if (editForm.enterpriseConfigureType === EnterpriseConfigureType.ShortMessage) {
- res = await createOrEditFlexEnterpriseMessageSetting();
- }
- if (res) {
- Message.successMessage('鎿嶄綔鎴愬姛');
- getList(paginationState.pageIndex);
- dialogState.dialogVisible = false;
- }
- } catch (error) {}
-}
+const { dialogProps: dialogWechatProps, handleAdd } = useFormDialog({
+ defaultFormParams: {
+ url: '',
+ },
+});
-// async function createOrEditFlexEnterpriseBankSetting() {
-// try {
-// let params: API.CreateOrEditFlexEnterpriseBankInput = {
-// id: editForm.id,
-// openBank: editForm.openBank,
-// openBranchBank: editForm.openBranchBank,
-// bankAccount: editForm.bankAccount,
-// verifyStatus: editForm.verifyStatus,
-// flexEnterpirseId: editForm.flexEnterpirseId,
-// };
-// return await flexEnterpriseServices.createOrEditFlexEnterpriseBankSetting(params);
-// } catch (error) {}
-// }
-async function createOrEditFlexEnterpriseSignSetting() {
+async function handleAddOrEdit(data?: any) {
try {
- let params: API.SetEnterpriseElectronSignSettingCommand = {
- id: editForm.id,
- electronSignAccesses: editForm.electronSignAccesses,
- };
- return await enterpriseServices.setEnterpriseElectronSignSetting(params);
- } catch (error) {}
-}
-async function createOrEditFlexEnterpriseMessageSetting() {
- try {
- let params: API.SetEnterpriseSmsSettingCommand = {
- id: editForm.id,
- smsAccess: editForm.smsAccess,
- smsCost: editForm.smsCost,
- };
- return await enterpriseServices.setEnterpriseSmsSetting(params);
+ if (editForm.enterpriseConfigureType === EnterpriseConfigureType.Wechat) {
+ handleAdd({
+ url: data?.sign_url,
+ });
+ }
+ Message.successMessage(
+ editForm.enterpriseConfigureType === EnterpriseConfigureType.Wechat
+ ? '鎻愪氦鎴愬姛锛岃瓒呯骇绠$悊鍛樻壂鐮佽繘琛岀绾︽搷浣�'
+ : '鎿嶄綔鎴愬姛'
+ );
+ getList(paginationState.pageIndex);
+ dialogState.dialogVisible = false;
} catch (error) {}
}
--
Gitblit v1.9.1