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

修改部分功能

yangg 3 hónapja
szülő
commit
7f909a3b23

+ 1 - 1
.env.development

@@ -6,7 +6,7 @@ ENV = 'development'
 # 本地环境接口地址 121.36.251.245
 
 
-VITE_API_URL = 'https://backend.qicai321.com'
+VITE_API_URL = 'http://192.168.66.187:8083'
 # VITE_API_URL = 'https://backend.qicai321.com'
 VITE_API_WX_URL='https://api.weixin.qq.com/'
 

+ 7 - 0
src/views/JobApplication/list/api.ts

@@ -79,3 +79,10 @@ export function updateBatchStatus(data: {
 		data
 	});
 } */
+
+export function getApplicationStatusSummary() {
+	return request({
+		url: '/api/system/job/application_status_summary/?tenant_id=1',
+		method: 'get',
+	});
+}

+ 3 - 2
src/views/JobApplication/list/components/BatchStatusDialog.vue

@@ -9,7 +9,8 @@
     <el-form :model="form" label-width="100px" ref="formRef" :rules="rules">
       <el-form-item label="新状态" prop="new_status">
         <el-select v-model="form.new_status" placeholder="请选择新状态" style="width: 100%">
-          <el-option :value="1" label="待面试" />
+          <el-option :value="0" label="待面试" />
+          <el-option :value="1" label="已通知面试" />
           <el-option :value="2" label="已面试" />
           <el-option :value="3" label="已录用" />
           <el-option :value="4" label="已拒绝" />
@@ -77,7 +78,7 @@ const handleSubmit = async () => {
     try {
       const data = {
         application_ids: form.application_ids,
-        new_status: form.new_status,
+        new_status: form.new_status as number,
         note: form.note,
         tenant_id: '1'
       };

+ 4 - 3
src/views/JobApplication/list/crud.tsx

@@ -205,7 +205,7 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 					},
 					// 添加批量操作按钮
 					// 添加批量绑定标签按钮
-					batchBindTags: {
+					/* batchBindTags: {
 						text: '批量绑定标签',
 						type: 'primary',
 						show: true,
@@ -222,7 +222,7 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 							// 打开批量绑定标签对话框
 							context.openBatchTagsDialog(selection);
 						},
-					},
+					}, */
 					// 添加批量修改状态按钮
 					batchUpdateStatus: {
 						text: '批量修改状态',
@@ -419,7 +419,8 @@ export const createCrudOptions = function ({ crudExpose, context}: CreateCrudOpt
 					},
 					dict: dict({
 						data: [
-							{ value: 1, label: '待面试' },
+							{ value: 0, label: '待面试' },
+							{ value: 1, label: '已通知面试' },
 							{ value: 2, label: '已面试' },
 							{ value: 3, label: '已录用' },
 							{ value: 4, label: '已拒绝' },

+ 62 - 21
src/views/JobApplication/list/index.vue

@@ -13,7 +13,7 @@
 					</div>
 					
 					<!-- 待安排 -->
-					<div class="tree-item" :class="{ active: activeNode === 'status-1' }" @click="handleNodeClick({ type: 'status', value: 1, id: 'status-1' })">
+					<div class="tree-item" :class="{ active: activeNode === 'status-1' }" @click="handleNodeClick({ type: 'status', value: 0, id: 'status-1' })">
 						<div class="item-content">
 							<el-icon><Clock /></el-icon>
 							<span>待面试</span>
@@ -103,6 +103,7 @@ import { handleColumnPermission } from '/@/utils/columnPermission';
 import { Grid, Clock, ArrowRight, Check, RefreshRight, Briefcase } from '@element-plus/icons-vue';
 import BatchTagsDialog from './components/index.vue';
 import BatchStatusDialog from './components/BatchStatusDialog.vue';
+import { getApplicationStatusSummary } from './api';
 
 const { crudBinding, crudRef, crudExpose, crudOptions, resetCrudOptions } = useFs({ 
 	createCrudOptions,
@@ -155,6 +156,46 @@ const fetchPositions = async () => {
 	}
 };
 
+// 获取申请状态统计数据
+const fetchStatusSummary = async () => {
+	try {
+		const res = await getApplicationStatusSummary();
+		const data = res;
+		console.log(data)
+		if (data.code === 2000 && data.data) {
+			totalCount.value = data.data.total || 0;
+			
+			// 更新状态计数
+			if (data.data.status_data && Array.isArray(data.data.status_data)) {
+				data.data.status_data.forEach((item: any) => {
+					// 注意:API返回的status可能与前端定义的不完全一致,需要映射
+					const statusMap: Record<number, number> = {
+						0: 1, // API中的0对应前端的1(待面试)
+						2: 2, // 已面试
+						3: 3, // 已录用
+						4: 4  // 已拒绝
+					};
+					
+					const frontendStatus = statusMap[item.status];
+					if (frontendStatus && frontendStatus in statusCounts) {
+						statusCounts[frontendStatus] = item.count;
+					}
+				});
+			} else {
+				// 如果没有status_data,则使用单独的字段
+				statusCounts[1] = data.data.pending || 0;
+				statusCounts[2] = data.data.interviewed || 0;
+				statusCounts[3] = data.data.hired || 0;
+				statusCounts[4] = data.data.rejected || 0;
+			}
+		} else {
+			console.error('获取申请状态统计失败:', data.message || '未知错误');
+		}
+	} catch (error) {
+		console.error('获取申请状态统计异常:', error);
+	}
+};
+
 // 切换职位列表显示
 const togglePositionList = () => {
 	showPositionList.value = !showPositionList.value;
@@ -168,9 +209,20 @@ const handleNodeClick = (data: any) => {
 	activeNode.value = data.id || 'all';
 	
 	if (data.type === 'all') {
-		// 清除所有筛选条件
-		crudExpose.getSearchRef().resetFields();
-		crudExpose.doRefresh();
+		try {
+			// 尝试重置表单,如果方法存在的话
+			const searchRef = crudExpose.getSearchRef();
+			if (searchRef && typeof searchRef.resetFields === 'function') {
+				searchRef.resetFields();
+			}
+		} catch (error) {
+			console.warn('重置表单失败:', error);
+		}
+		
+		// 无论如何都执行搜索,确保数据刷新
+		crudExpose.doSearch({
+			form: {}
+		});
 	} else if (data.type === 'status') {
 		// 按状态筛选
 		crudExpose.doSearch({
@@ -192,21 +244,6 @@ const handleNodeClick = (data: any) => {
 const updateCounts = (data: any) => {
 	if (!data || !data.records) return;
 	
-	totalCount.value = data.total || 0;
-	
-	// 重置计数
-	Object.keys(statusCounts).forEach(key => {
-		statusCounts[Number(key)] = 0;
-	});
-	
-	// 统计各状态数量
-	data.records.forEach((record: any) => {
-		const status = record.status;
-		if (status && typeof status === 'number' && status in statusCounts) {
-			statusCounts[status]++;
-		}
-	});
-	
 	// 统计各职位数量
 	// 重置职位计数
 	positions.value.forEach(position => {
@@ -226,8 +263,9 @@ const updateCounts = (data: any) => {
 
 // 处理批量状态修改成功
 const handleBatchStatusSuccess = () => {
-	// 刷新数据
+	// 刷新数据和状态统计
 	crudExpose.doRefresh();
+	fetchStatusSummary();
 };
 
 // 页面打开后获取列表数据
@@ -235,10 +273,13 @@ onMounted(async () => {
 	// 获取职位列表
 	await fetchPositions();
 	
+	// 获取申请状态统计
+	await fetchStatusSummary();
+	
 	// 设置列权限
 	const newOptions = await handleColumnPermission(GetPermission, crudOptions);
 	
-	// 添加数据加载后的回调,用于更新计数
+	// 添加数据加载后的回调,用于更新职位计数
 	if (newOptions && newOptions.crudOptions && newOptions.crudOptions.request) {
 		const originalPageRequest = newOptions.crudOptions.request.pageRequest;
 		newOptions.crudOptions.request.pageRequest = async (query: any) => {

+ 77 - 22
src/views/JobApplication/report/index.vue

@@ -926,19 +926,72 @@ const handleVideoError = (event: Event) => {
   }
 }
 
-// 添加 DUV 得分解释函数
+// 修改 DUV 得分解释函数
 const getDuvScoreInterpretation = (score: number | undefined): string => {
   if (score === undefined) return '未进行心理测评或数据缺失'
-  return score.toString()
- /*  if (score <= 30) {
-    return '心理状态良好,无明显异常。候选人在心理测评中表现出稳定的情绪状态和健康的心理特质,适合岗位要求。'
-  } else if (score <= 60) {
-    return '心理状态基本正常,存在轻微波动。候选人在某些方面可能存在轻微的心理压力,但总体上仍保持稳定,基本符合岗位要求。'
-  } else if (score <= 90) {
-    return '心理状态存在一定波动,建议关注。候选人在测评中表现出一定程度的心理压力或情绪波动,可能需要进一步评估其适应性。'
+  
+  if (score <= 20) {
+    return '心理状态健康,情绪稳定、认知正常。候选人在心理测评中表现出稳定的情绪状态和健康的心理特质,适合岗位要求。'
+  } else if (score <= 35) {
+    return '轻微焦虑或负面情绪,仍具备岗位适应力。候选人在某些方面可能存在轻微的心理压力,但总体上仍保持稳定,基本符合岗位要求。'
+  } else if (score <= 55) {
+    return '存在一定情绪波动或压力反应。候选人在测评中表现出一定程度的心理压力或情绪波动,建议进一步面谈评估。'
+  } else if (score <= 70) {
+    return '心理压力较大,可能影响工作稳定性。候选人在测评中表现出较明显的心理压力或情绪不稳定性,建议慎重录用或考虑调岗。'
+  } else {
+    return '可能存在较严重心理或精神问题。候选人在测评中表现出明显的心理或情绪问题,不建议录用。'
+  }
+}
+
+// 更新 DUV 得分显示的 CSS 类判断逻辑
+const getDuvScoreClass = (score: number | undefined): string => {
+  if (score === undefined) return 'text-gray-500'
+  
+  if (score <= 20) {
+    return 'text-green-500' // 优秀
+  } else if (score <= 35) {
+    return 'text-blue-500' // 良好
+  } else if (score <= 55) {
+    return 'text-yellow-500' // 一般
+  } else if (score <= 70) {
+    return 'text-orange-500' // 偏差
+  } else {
+    return 'text-red-500' // 严重异常
+  }
+}
+
+// 获取 DUV 得分等级
+const getDuvScoreLevel = (score: number | undefined): string => {
+  if (score === undefined) return '未知'
+  
+  if (score <= 20) {
+    return '优秀'
+  } else if (score <= 35) {
+    return '良好'
+  } else if (score <= 55) {
+    return '一般'
+  } else if (score <= 70) {
+    return '偏差'
+  } else {
+    return '严重异常'
+  }
+}
+
+// 获取录用建议
+const getDuvHireRecommendation = (score: number | undefined): string => {
+  if (score === undefined) return '无法给出建议'
+  
+  if (score <= 20) {
+    return '建议优先录取'
+  } else if (score <= 35) {
+    return '可考虑录取'
+  } else if (score <= 55) {
+    return '建议进一步面谈评估'
+  } else if (score <= 70) {
+    return '慎重录用或建议调岗'
   } else {
-    return '心理状态波动较大,建议谨慎考虑。候选人在测评中表现出较明显的心理压力或情绪不稳定性,可能不完全符合岗位要求。'
-  } */
+    return '不建议录用'
+  }
 }
 
 // 添加安全获取分数值的辅助函数
@@ -1131,20 +1184,22 @@ const handleViewProfile = () => {
                 </ul>
               </div>
             </div>
-             <!-- 修改 DUV 得分显示部分,添加更安全的处理 /{{ getSafeMaxScoreValue(apiData?.scoring_summary?.max_possible_score) }}-->
+             <!-- 修改 DUV 得分显示部分 -->
              <div class="border-b pb-4">
-                <div class="flex items-center justify-between mt-4 mb-2">
-                  <span class="text-gray-600">DUV 心理测评得分</span>
-                  <span :class="{
-                    'text-green-500': getSafeScoreValue(apiData?.scoring_summary?.total_score_obtained) <= 30,
-                    'text-yellow-500': getSafeScoreValue(apiData?.scoring_summary?.total_score_obtained) > 30 && getSafeScoreValue(apiData?.scoring_summary?.total_score_obtained) <= 60,
-                    'text-red-500': getSafeScoreValue(apiData?.scoring_summary?.total_score_obtained) > 60
-                  }">{{ getSafeScoreValue(apiData?.scoring_summary?.total_score_obtained) }}</span>
-                </div>
-               <!--  <p class="text-gray-600 text-sm">
-                  {{ getDuvScoreInterpretation(apiData?.scoring_summary?.total_score_obtained) }}
-                </p> -->
+              <div class="flex items-center justify-between mt-4 mb-2">
+                <span class="text-gray-600">DUV 心理测评得分</span>
+                <span :class="getDuvScoreClass(apiData?.scoring_summary?.total_score_obtained)">
+                  {{ getSafeScoreValue(apiData?.scoring_summary?.total_score_obtained) }}
+                  <span class="ml-2 text-sm">({{ getDuvScoreLevel(apiData?.scoring_summary?.total_score_obtained) }})</span>
+                </span>
               </div>
+              <p class="text-gray-600 text-sm">
+                {{ getDuvScoreInterpretation(apiData?.scoring_summary?.total_score_obtained) }}
+              </p>
+              <p class="text-sm mt-1" :class="getDuvScoreClass(apiData?.scoring_summary?.total_score_obtained)">
+                <strong>录用建议:</strong> {{ getDuvHireRecommendation(apiData?.scoring_summary?.total_score_obtained) }}
+              </p>
+            </div>
           </div>
 
           <!-- 2. DUV分析评估 -->