Просмотр исходного кода

fix: 手工发放员工选择仅展示已签约 + 发送owner_open_id(企业码身份)

alphah 2 недель назад
Родитель
Сommit
4018070367

+ 1 - 0
backend/app/plugin/module_payment/employee/schema.py

@@ -92,6 +92,7 @@ class EmployeeListOutSchema(BaseModel):
     status: str = Field(description="状态")
     employee_mobile: Optional[str] = Field(default=None, description="员工手机号")
     user_id: Optional[int] = Field(default=None, description="关联的系统用户ID")
+    identity_open_id: Optional[str] = Field(default=None, description="员工openId(企业码身份)")
     created_time: Optional[datetime] = Field(default=None, description="创建时间")
 
 

BIN
frontend/dist.zip


+ 1 - 0
frontend/src/api/module_payment/employee.ts

@@ -78,6 +78,7 @@ export interface EmployeeTable {
   employee_no?: string;
   status: string;
   employee_mobile?: string;
+  identity_open_id?: string;
   user_id?: number;
   created_time: string;
 }

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

@@ -207,7 +207,9 @@ async function loadEmployees() {
     }
     if (!eid) return;
     const res = await EmployeeAPI.listEmployee({ enterprise_id: eid, page_no: 1, page_size: 500 });
-    employeeList.value = res?.data?.data?.items || [];
+    // 仅展示已签约的员工
+    const allItems = res?.data?.data?.items || [];
+    employeeList.value = allItems.filter((emp: any) => emp.status === "ACTIVATED");
   } catch (e) {
     console.error("加载员工列表失败", e);
   }
@@ -225,8 +227,9 @@ function confirmEmployeeSelect() {
     if (!quota || quota <= 0) continue;
     targets.push({
       issue_quota: String(quota),
-      owner_type: "EMPLOYEE",
+      owner_type: "ENTERPRISE_PAY_UID",
       owner_id: employee.employee_id,
+      owner_open_id: employee.identity_open_id || undefined,
       user_name: employee.employee_name || employee.name,
     });
   }