Selaa lähdekoodia

refactor: 转账权限改为操作列直接切换按钮,去掉编辑表单开关

- 企业列表操作列: 开通转账(绿)/关闭转账(红) 直接调EnterpriseAPI.update切换
- 去掉EnterpriseForm里的el-switch
alphaH 14 tuntia sitten
vanhempi
sitoutus
1033ce93ca

+ 0 - 8
frontend/src/views/module_payment/enterprise/components/EnterpriseForm.vue

@@ -28,14 +28,6 @@
         </el-col>
       </el-row>
 
-      <el-row :gutter="20">
-        <el-col :span="12">
-          <el-form-item label="转账功能">
-            <el-switch v-model="formData.transfer_enabled" active-text="已开通" inactive-text="未开通" />
-          </el-form-item>
-        </el-col>
-      </el-row>
-
       <!-- 万里汇uid:仅国外服务商显示 -->
       <el-row v-if="formData.scope_label === 'OVERSEAS'" :gutter="20">
         <el-col :span="12">

+ 19 - 3
frontend/src/views/module_payment/enterprise/index.vue

@@ -59,9 +59,12 @@
                     @click="handleOpenDetail(scope.row)">
                     详情
                   </el-button>
-                  <el-button type="warning" size="small" link
-                    @click="currentOutBizNo = scope.row.enterprise_id; handleOpenDialog('update')">
-                    编辑
+                  <el-button
+                    size="small" link
+                    :type="scope.row.transfer_enabled ? 'danger' : 'success'"
+                    :loading="scope.row._toggling"
+                    @click="handleToggleTransfer(scope.row)">
+                    {{ scope.row.transfer_enabled ? '关闭转账' : '开通转账' }}
                   </el-button>
                   <el-button v-if="!isAdmin && (!scope.row.f2f_status || scope.row.f2f_status === 'CLOSED')"
                     v-hasPerm="['module_payment:facetoface:apply']" type="success" size="small" link
@@ -354,6 +357,19 @@ const employeeDialogEnterpriseId = ref<string>();
 const employeeFormRef = ref();
 const isEmployeeSubmitting = ref(false);
 
+async function handleToggleTransfer(row: any) {
+  row._toggling = true;
+  try {
+    await EnterpriseAPI.update(row.enterprise_id, { transfer_enabled: !row.transfer_enabled });
+    row.transfer_enabled = !row.transfer_enabled;
+    ElMessage.success(row.transfer_enabled ? "已开通转账功能" : "已关闭转账功能");
+  } catch {
+    ElMessage.error("操作失败");
+  } finally {
+    row._toggling = false;
+  }
+}
+
 function handleOpenDialog(type: "apply" | "update" | "detail") {
   dialogVisible.type = type;
   if (type === "apply") {

+ 28 - 0
logs/payment-platform.log

@@ -1 +1,29 @@
 2026-07-16 10:16:57.648 [background-preinit] INFO  o.h.validator.internal.util.Version - HV000001: Hibernate Validator 8.0.1.Final
+2026-07-16 10:16:57.733 [main] INFO  c.p.platform.PaymentApplication - Starting PaymentApplication using Java 21.0.11 with PID 50928 (D:\project2\payment-platform\java\target\classes started by 1 in D:\project2\payment-platform)
+2026-07-16 10:16:57.734 [main] INFO  c.p.platform.PaymentApplication - The following 1 profile is active: "dev"
+2026-07-16 10:16:58.941 [main] INFO  o.s.d.r.c.RepositoryConfigurationDelegate - Multiple Spring Data modules found, entering strict repository configuration mode
+2026-07-16 10:16:58.943 [main] INFO  o.s.d.r.c.RepositoryConfigurationDelegate - Bootstrapping Spring Data Redis repositories in DEFAULT mode.
+2026-07-16 10:16:59.015 [main] INFO  o.s.d.r.c.RepositoryConfigurationDelegate - Finished Spring Data repository scanning in 56 ms. Found 0 Redis repository interfaces.
+2026-07-16 10:16:59.931 [main] INFO  o.s.b.w.e.tomcat.TomcatWebServer - Tomcat initialized with port 8001 (http)
+2026-07-16 10:16:59.944 [main] INFO  o.a.coyote.http11.Http11NioProtocol - Initializing ProtocolHandler ["http-nio-8001"]
+2026-07-16 10:16:59.946 [main] INFO  o.a.catalina.core.StandardService - Starting service [Tomcat]
+2026-07-16 10:16:59.947 [main] INFO  o.a.catalina.core.StandardEngine - Starting Servlet engine: [Apache Tomcat/10.1.20]
+2026-07-16 10:17:00.018 [main] INFO  o.a.c.c.C.[.[localhost].[/api/v1] - Initializing Spring embedded WebApplicationContext
+2026-07-16 10:17:00.018 [main] INFO  o.s.b.w.s.c.ServletWebServerApplicationContext - Root WebApplicationContext: initialization completed in 2075 ms
+2026-07-16 10:17:00.055 [main] INFO  c.a.d.s.b.a.DruidDataSourceAutoConfigure - Init DruidDataSource
+2026-07-16 10:17:01.696 [main] INFO  c.alibaba.druid.pool.DruidDataSource - {dataSource-1} inited
+2026-07-16 10:17:02.771 [main] WARN  c.p.p.c.alipay.AlipayClientFactory - 支付宝默认配置不完整,将仅使用服务商/租户专属客户端
+2026-07-16 10:17:02.993 [main] INFO  c.p.platform.core.oss.OssService - OSS client initialized: bucket=hunanxiaojunzioss, endpoint=oss-cn-beijing.aliyuncs.com
+2026-07-16 10:17:03.393 [main] INFO  c.p.p.m.p.e.s.EnterpriseNameSyncScheduler - [企业名称同步] 调度器启动
+2026-07-16 10:17:03.815 [main] INFO  c.p.p.m.p.n.s.NotificationService - 已注册 7 个通知处理器: [AccountHandler, BillHandler, EmployeeHandler, EnterpriseHandler, InstitutionHandler, OrderHandler, VoucherHandler]
+2026-07-16 10:17:05.062 [main] INFO  o.s.s.web.DefaultSecurityFilterChain - Will secure any request with [org.springframework.security.web.session.DisableEncodeUrlFilter@6939f18a, org.springframework.security.web.context.request.async.WebAsyncManagerIntegrationFilter@8bd9d08, org.springframework.security.web.context.SecurityContextHolderFilter@701da311, org.springframework.security.web.header.HeaderWriterFilter@732bb49d, org.springframework.web.filter.CorsFilter@189f3ccd, org.springframework.security.web.authentication.logout.LogoutFilter@44c54463, com.payment.platform.core.security.JwtAuthFilter@857f1a7, com.payment.platform.core.security.TenantApiKeyAuthFilter@176054b7, org.springframework.security.web.savedrequest.RequestCacheAwareFilter@5de14222, org.springframework.security.web.servletapi.SecurityContextHolderAwareRequestFilter@6fb51e17, org.springframework.security.web.authentication.AnonymousAuthenticationFilter@2eb0932c, org.springframework.security.web.session.SessionManagementFilter@19a4cdea, org.springframework.security.web.access.ExceptionTranslationFilter@45e68fac, org.springframework.security.web.access.intercept.AuthorizationFilter@41041c31]
+2026-07-16 10:17:05.783 [main] INFO  o.a.coyote.http11.Http11NioProtocol - Starting ProtocolHandler ["http-nio-8001"]
+2026-07-16 10:17:05.803 [main] INFO  o.s.b.w.e.tomcat.TomcatWebServer - Tomcat started on port 8001 (http) with context path '/api/v1'
+2026-07-16 10:17:05.970 [main] INFO  c.p.platform.PaymentApplication - Started PaymentApplication in 8.96 seconds (process running for 10.204)
+2026-07-16 10:17:07.846 [main] INFO  c.p.p.core.config.AppStartupRunner - 系统配置缓存初始化完成
+2026-07-16 10:17:08.987 [main] INFO  c.p.p.core.config.AppStartupRunner - 数据字典缓存初始化完成 (10 个字典类型)
+2026-07-16 10:17:12.241 [tomcat-handler-0] INFO  o.a.c.c.C.[.[localhost].[/api/v1] - Initializing Spring DispatcherServlet 'dispatcherServlet'
+2026-07-16 10:17:12.242 [tomcat-handler-0] INFO  o.s.web.servlet.DispatcherServlet - Initializing Servlet 'dispatcherServlet'
+2026-07-16 10:17:12.244 [tomcat-handler-0] INFO  o.s.web.servlet.DispatcherServlet - Completed initialization in 2 ms
+2026-07-16 10:17:22.528 [tomcat-handler-7] INFO  c.p.p.m.s.auth.service.AuthService - 用户ID: 1, 用户名: admin 正在生成JWT令牌
+2026-07-16 10:17:22.618 [tomcat-handler-7] INFO  c.p.p.m.s.a.c.AuthController - 用户admin登录成功