Browse Source

优化每人得分计算

ouyj 4 months ago
parent
commit
1895b6eb4d
1 changed files with 21 additions and 12 deletions
  1. 21 12
      ygtx-ui/src/views/gxt/orderScore/index.vue

+ 21 - 12
ygtx-ui/src/views/gxt/orderScore/index.vue

@@ -1479,9 +1479,12 @@ function calculateRepairScores() {
   }
 
   const totalScore = parseFloat(scoreMatch[1]);
-  const personCount = selfEvaluationForm.value.scorePersonList.length;
-  
-  if (personCount === 0) return;
+
+  if (selfEvaluationForm.value.scorePersonList.length === 0) return;
+
+  const personCount = selfEvaluationForm.value.scorePersonList.length +
+      (parseInt(selfEvaluationForm.value.wwryNum) || 0) +
+      (parseInt(selfEvaluationForm.value.wlryNum) || 0);
 
   // 计算基础分
   const baseScore = totalScore / personCount;
@@ -1499,9 +1502,10 @@ function calculateRepairScores() {
 
 /** 计算维保工单人员得分 */
 function calculateMaintenanceScores() {
-  const personCount = selfEvaluationForm.value.scorePersonList.length;
-  if (personCount === 0) return;
-  
+  if (selfEvaluationForm.value.scorePersonList.length === 0) return;
+  const personCount = selfEvaluationForm.value.scorePersonList.length+
+      (parseInt(selfEvaluationForm.value.wwryNum) || 0) +
+      (parseInt(selfEvaluationForm.value.wlryNum) || 0);
   // 获取分项完成系数,默认为1
   const completionFactor = selfEvaluationForm.value.itemCompletionFactor || 1;
   
@@ -1748,9 +1752,12 @@ function calculateRepairReviewScores() {
   }
 
   const totalScore = parseFloat(scoreMatch[1]);
-  const personCount = reviewForm.value.scorePersonList.length;
-  
-  if (personCount === 0) return;
+
+  if (reviewForm.value.scorePersonList.length === 0) return;
+
+  const personCount = reviewForm.value.scorePersonList.length+
+      (parseInt(reviewForm.value.wwryNum) || 0) +
+      (parseInt(reviewForm.value.wlryNum) || 0);
 
   // 计算基础分
   const baseScore = totalScore / personCount;
@@ -1775,9 +1782,11 @@ function calculateMaintenanceReviewScores() {
   } else {
     showModifyReason.value = false;
   }
-  
-  const personCount = reviewForm.value.scorePersonList.length;
-  if (personCount === 0) return;
+
+  if (reviewForm.value.scorePersonList.length === 0) return;
+  const personCount = reviewForm.value.scorePersonList.length+
+      (parseInt(reviewForm.value.wwryNum) || 0) +
+      (parseInt(reviewForm.value.wlryNum) || 0);
   
   // 获取分项完成系数,默认为1
   const completionFactor = reviewForm.value.itemCompletionFactor || 1;