Преглед изворни кода

fix: 统一owner_type从ENTERPRISE_PAY_UID改为EMPLOYEE(匹配employee_id类型)

alphah пре 2 недеља
родитељ
комит
efb7c4adce

+ 4 - 3
backend/app/plugin/module_payment/expense/institution/controller.py

@@ -127,16 +127,17 @@ async def create_institution_controller(
         mapped_adapter = ADAPTER_TYPE_MAP.get(adapter_type, adapter_type)
         scope_data = {
             "adapter_type": mapped_adapter,
-            "owner_type": data.get("scope_owner_type", "ENTERPRISE_PAY_UID"),
+            "owner_type": data.get("scope_owner_type", "EMPLOYEE"),
             "add_owner_id_list": data.get("scope_owner_id_list"),
         }
         # 全体员工时把 scope 写入创建请求(避免默认无scope导致支付宝后台不可操作)
         if adapter_type == "all":
             data["institution_scope_info"] = {
                 "adapter_type": "ALL",
-                "owner_type": "ENTERPRISE_PAY_UID",
+                "owner_type": "EMPLOYEE",
             }
 
+
     # 解析发放规则数据
     issuerule_data = None
     if data.get("grant_mode") == "period":
@@ -328,7 +329,7 @@ async def modify_institution_controller(
         scope_info = {
             "enterprise_id": enterprise_id,
             "adapter_type": new_adapter,
-            "owner_type": "ENTERPRISE_PAY_UID",
+            "owner_type": "EMPLOYEE",
         }
         if add_ids:
             scope_info["add_owner_id_list"] = add_ids

BIN
frontend/dist.zip


+ 3 - 3
frontend/src/views/module_payment/institution/components/InstitutionForm.vue

@@ -487,10 +487,10 @@ async function submitForm() {
 
     // 适用范围参数
     if (formData.applicable_scope === "department") {
-      submitData.scope_owner_type = "ENTERPRISE_PAY_UID";
+      submitData.scope_owner_type = "EMPLOYEE";
       submitData.scope_owner_id_list = formData.department_id ? [formData.department_id] : undefined;
     } else if (formData.applicable_scope === "employee") {
-      submitData.scope_owner_type = "ENTERPRISE_PAY_UID";
+      submitData.scope_owner_type = "EMPLOYEE";
       submitData.scope_owner_id_list = formData.employee_ids;
     }
 
@@ -526,7 +526,7 @@ async function submitForm() {
         consult_mode: formData.consult_mode || undefined,
         // 适用员工范围
         applicable_scope: formData.applicable_scope,
-        scope_owner_type: "ENTERPRISE_PAY_UID",
+        scope_owner_type: "EMPLOYEE",
         scope_owner_id_list: formData.applicable_scope === "employee"
           ? (formData.employee_ids || [])
           : formData.applicable_scope === "department" && formData.department_id

+ 1 - 1
frontend/src/views/module_payment/quota/components/IssueBatchForm.vue

@@ -225,7 +225,7 @@ function confirmEmployeeSelect() {
     if (!quota || quota <= 0) continue;
     targets.push({
       issue_quota: String(quota),
-      owner_type: "ENTERPRISE_PAY_UID",
+      owner_type: "EMPLOYEE",
       owner_id: employee.employee_id,
       user_name: employee.employee_name || employee.name,
     });