Parcourir la source

王子文 专项培养

wangggziwen il y a 3 ans
Parent
commit
0ef3e738c3
1 fichiers modifiés avec 61 ajouts et 39 suppressions
  1. 61 39
      ui/src/views/training/spec/seasonalfeedback/index.vue

+ 61 - 39
ui/src/views/training/spec/seasonalfeedback/index.vue

@@ -525,8 +525,8 @@ export default {
         mentorStaffId: ""
       },
       // 导师反馈内容
-      mentorFeedback: null, // 季度反馈内容
-      detailFeedback: null, // 计划详情反馈内容
+      mentorFeedback: "", // 季度反馈内容
+      detailFeedback: "", // 计划详情反馈内容
       // 反馈对话框参数
       feedbackDialog: {
         id: 0,
@@ -719,7 +719,7 @@ export default {
         this.radio14 = null;
       }
       // 清空导师反馈内容
-      this.mentorFeedback = null;
+      this.mentorFeedback = "";
       // 查询参数
       let feedback = {};
       feedback.mentorId = tab.name;
@@ -914,6 +914,15 @@ export default {
           if(data[i].answer == "1") {
             total += 100;
           }
+          else if(data[i].answer == "2") {
+            total += 75;
+          }
+          else if(data[i].answer == "3") {
+            total += 50;
+          }
+          else if(data[i].answer == "4") {
+            total += 25;
+          }
         }
         let avg = total / 14; // 平均分
         // 更新当前导师评分
@@ -943,10 +952,22 @@ export default {
             invitedMentors += 1;
           }
         }
-        // 受邀导师平均分 = 总分 / 人数
-        invitedMentorFeedbackScoreAvg = invitedMentorFeedbackScoreSum / invitedMentors;
+        // 计算受邀导师平均分
+        if (invitedMentorFeedbackScoreSum == 0) { // 受邀导师未评分
+          invitedMentorFeedbackScoreAvg = 0;
+        } else {
+          // 受邀导师平均分 = 总分 / 人数
+          invitedMentorFeedbackScoreAvg = invitedMentorFeedbackScoreSum / invitedMentors;
+        }
+        // 计算季度平均分
+        if (invitedMentorFeedbackScoreSum == 0) { // 受邀导师未评分
+          overallScore = mentorFeedbackScore;
+        } else if (mentorFeedbackScore == 0) {  // 本导师未评分
+          overallScore = invitedMentorFeedbackScoreAvg;
+        } else {
         // 季度平均分 = 本导师评分 * 60% + 受邀导师平均分 * 40%
-        overallScore = mentorFeedbackScore * 0.6 + invitedMentorFeedbackScoreAvg * 0.4;
+          overallScore = mentorFeedbackScore * 0.6 + invitedMentorFeedbackScoreAvg * 0.4;
+        }
         // 更新季度平均分
         updateFeedback({ id: feedbackId, overallScore: overallScore });
         // 更新继任者评分表数据
@@ -957,17 +978,17 @@ export default {
         }).then(response => {
           let data = response.data;
           let score = {};
-          if (this.queryParams.feedbackSeason == 1) {
-            score.quaterOne = overallScore;
+          if (this.queryParams.feedbackSeason == "1") {
+            score.quarterOne = overallScore;
           }
-          if (this.queryParams.feedbackSeason == 2) {
-            score.quaterTwo = overallScore;
+          if (this.queryParams.feedbackSeason == "2") {
+            score.quarterTwo = overallScore;
           }
-          if (this.queryParams.feedbackSeason == 3) {
-            score.quaterThree = overallScore;
+          if (this.queryParams.feedbackSeason == "3") {
+            score.quarterThree = overallScore;
           }
-          if (this.queryParams.feedbackSeason == 4) {
-            score.quaterFour = overallScore;
+          if (this.queryParams.feedbackSeason == "4") {
+            score.quarterFour = overallScore;
           }
           if (data != null) {
             score.id = data.id;
@@ -1001,8 +1022,8 @@ export default {
             }
           } else {
             addAnswer(answerObj).then(response => {
-            // 计算导师评分
-            this.calcFeedbackScore();
+              // 计算导师评分
+              this.calcFeedbackScore();
             });
           }
       });
@@ -1286,7 +1307,7 @@ export default {
       this.radio13 = null;
       this.radio14 = null;
       // 清空导师反馈内容
-      this.mentorFeedback = null;
+      this.mentorFeedback = "";
       // 清空会议日期
       this.meetingDate = null;
       getFeedbackByParams({
@@ -1313,29 +1334,30 @@ export default {
             this.mentorTabs.push({ name: data[i].mentorId, title: data[i].mentorName});
           }
         });
+        // 刷新问卷
+        listAnswer( { feedbackId: this.feedbackId } ).then(response => {
+          let data = response.rows;
+          for (let i = 0; i < data.length; i++) {
+            if (data[i].questionId == "4") { this.radio1 = data[i].answer; }
+            if (data[i].questionId == "5") { this.radio2 = data[i].answer; }
+            if (data[i].questionId == "6") { this.radio3 = data[i].answer; }
+            if (data[i].questionId == "7") { this.radio4 = data[i].answer; }
+            if (data[i].questionId == "8") { this.radio5 = data[i].answer; }
+            if (data[i].questionId == "9") { this.radio6 = data[i].answer; }
+            if (data[i].questionId == "10") { this.radio7 = data[i].answer; }
+            if (data[i].questionId == "11") { this.radio8 = data[i].answer; }
+            if (data[i].questionId == "12") { this.radio9 = data[i].answer; }
+            if (data[i].questionId == "13") { this.radio10 = data[i].answer; }
+            if (data[i].questionId == "14") { this.radio11 = data[i].answer; }
+            if (data[i].questionId == "15") { this.radio12 = data[i].answer; }
+            if (data[i].questionId == "16") { this.radio13 = data[i].answer; }
+            if (data[i].questionId == "17") { this.radio14 = data[i].answer; }
+            
+          }
+          window.scrollTo(0, 0);
+        });
       });
-      // 刷新问卷
-      listAnswer( { feedbackId: this.feedbackId } ).then(response => {
-        let data = response.rows;
-        for (let i = 0; i < data.length; i++) {
-          if (data[i].questionId == "4") { this.radio1 = data[i].answer; }
-          if (data[i].questionId == "5") { this.radio2 = data[i].answer; }
-          if (data[i].questionId == "6") { this.radio3 = data[i].answer; }
-          if (data[i].questionId == "7") { this.radio4 = data[i].answer; }
-          if (data[i].questionId == "8") { this.radio5 = data[i].answer; }
-          if (data[i].questionId == "9") { this.radio6 = data[i].answer; }
-          if (data[i].questionId == "10") { this.radio7 = data[i].answer; }
-          if (data[i].questionId == "11") { this.radio8 = data[i].answer; }
-          if (data[i].questionId == "12") { this.radio9 = data[i].answer; }
-          if (data[i].questionId == "13") { this.radio10 = data[i].answer; }
-          if (data[i].questionId == "14") { this.radio11 = data[i].answer; }
-          if (data[i].questionId == "15") { this.radio12 = data[i].answer; }
-          if (data[i].questionId == "16") { this.radio13 = data[i].answer; }
-          if (data[i].questionId == "17") { this.radio14 = data[i].answer; }
-          
-        }
-        window.scrollTo(0, 0);
-      });
+      
     },
     /** 重置按钮操作 */
     resetQuery() {