Forráskód Böngészése

fix: 详情/编辑/签约链接 enterprise_id 来源修正 - 优先使用行级数据

alphah 1 hete
szülő
commit
3b1a2afa82

BIN
frontend/dist.zip


+ 9 - 7
frontend/src/views/module_payment/employee/index.vue

@@ -51,11 +51,11 @@
                   label="操作" align="center" min-width="160">
                   <template #default="scope">
                     <el-button v-hasPerm="['module_payment:employee:detail']" type="info" size="small" link :icon="View"
-                      @click="handleOpenDialog('detail', scope.row.employee_id)">
+                      @click="handleOpenDialog('detail', scope.row.employee_id, scope.row.enterprise_id)">
                       详情
                     </el-button>
                     <el-button v-hasPerm="['module_payment:employee:update']" type="primary" size="small" link
-                      @click="handleOpenDialog('update', scope.row.employee_id)">
+                      @click="handleOpenDialog('update', scope.row.employee_id, scope.row.enterprise_id)">
                       编辑
                     </el-button>
                     <el-button v-hasPerm="['module_payment:employee:invite']" type="success" size="small" link
@@ -129,21 +129,21 @@
     <EnhancedDialog v-model="dialogVisible.visible" :title="dialogVisible.title" @close="handleCloseDialog">
       <template v-if="dialogVisible.type === 'detail'">
         <template v-if="dialogVisible.entity === 'employee'">
-          <EmployeeDetail :employee-id="currentEmployeeId" :enterprise-id="currentEnterpriseId" />
+          <EmployeeDetail :employee-id="currentEmployeeId" :enterprise-id="currentRowEnterpriseId || currentEnterpriseId" />
         </template>
         <template v-else-if="dialogVisible.entity === 'department'">
-          <DepartmentDetail :department-id="currentDepartmentId" :enterprise-id="currentEnterpriseId" />
+          <DepartmentDetail :department-id="currentDepartmentId" :enterprise-id="currentRowEnterpriseId || currentEnterpriseId" />
         </template>
       </template>
 
       <template v-else>
         <template v-if="dialogVisible.entity === 'employee'">
           <EmployeeForm ref="formRef" :type="dialogVisible.type" :employee-id="currentEmployeeId"
-            :enterprise-id="currentEnterpriseId" @success="handleFormSuccess" />
+            :enterprise-id="currentRowEnterpriseId || currentEnterpriseId" @success="handleFormSuccess" />
         </template>
         <template v-else-if="dialogVisible.entity === 'department'">
           <DepartmentForm ref="deptFormRef" :type="dialogVisible.type" :department-id="currentDepartmentId"
-            :enterprise-id="currentEnterpriseId || enterpriseIdFromUrl.value" @success="handleDeptFormSuccess" />
+            :enterprise-id="currentRowEnterpriseId || currentEnterpriseId" @success="handleDeptFormSuccess" />
         </template>
       </template>
 
@@ -313,6 +313,7 @@ const useEnterprise = useEnterpriseStore();
 
 const currentEmployeeId = ref<string>("");
 const currentDepartmentId = ref<string>("");
+const currentRowEnterpriseId = ref<string>("");
 const currentEnterpriseId = computed(() => enterpriseIdFromUrl.value || useEnterprise.getCurrentEnterprise?.enterprise_id || "");
 
 // 部门搜索配置
@@ -463,10 +464,11 @@ const deptContentConfig = reactive<IContentConfig<DepartmentPageQuery>>({
   },
 });
 
-function handleOpenDialog(type: "create" | "update" | "detail", employeeId: string) {
+function handleOpenDialog(type: "create" | "update" | "detail", employeeId: string, enterpriseId?: string) {
   dialogVisible.type = type;
   dialogVisible.entity = "employee";
   currentEmployeeId.value = employeeId;
+  currentRowEnterpriseId.value = enterpriseId || "";
   if (type === "create") {
     dialogVisible.title = "添加员工";
   } else if (type === "update") {