Browse Source

王子文 专项培养 季度汇报
1) 页面加载时生成导师标签页
2) 导师标签页切换时刷新问卷和导师反馈内容

wangggziwen 3 years ago
parent
commit
995c25ec27
1 changed files with 54 additions and 8 deletions
  1. 54 8
      ui/src/views/training/spec/seasonalfeedback/index.vue

+ 54 - 8
ui/src/views/training/spec/seasonalfeedback/index.vue

@@ -423,6 +423,8 @@ export default {
       tableData: [],
       // 反馈id
       feedbackId: null,
+      // 父级反馈id
+      parentId: null,
       // 会议日期快捷选项
       pickerOptions: {
         shortcuts: [{
@@ -652,14 +654,57 @@ export default {
   methods: {
     /** 标签页切换事件 */
     handleTabClick(tab) {
-      console.log(tab.name);
-
-
-      // 导师id=tab.name
-      // 根据导师id学员id年季度获取feedbackId
-
-      // 刷新问卷和导师反馈内容
-
+      // 清空问卷
+      this.radio1 = null;
+      this.radio2 = null;
+      this.radio3 = null;
+      this.radio4 = null;
+      this.radio5 = null;
+      this.radio6 = null;
+      this.radio7 = null;
+      this.radio8 = null;
+      this.radio9 = null;
+      this.radio10 = null;
+      this.radio11 = null;
+      this.radio12 = null;
+      this.radio13 = null;
+      this.radio14 = null;
+      // 清空导师反馈内容
+      this.mentorFeedback = null;
+      // 根据标签页导师id获取反馈id
+      getFeedbackByParams({
+        mentorId: tab.name,
+        successorId: this.queryParams.successorId,
+        feedbackYear: this.queryParams.feedbackYear,
+        feedbackSeason: this.queryParams.feedbackSeason,
+        parentId: this.parentId
+      }).then(response => {
+        let data = response.data;
+        // 设置反馈id为当前tab导师反馈id
+        this.feedbackId = data.id;
+        // 刷新导师反馈内容
+        this.mentorFeedback = data.mentorFeedback;
+        // 刷新问卷
+        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; }
+          }
+        });
+      });
     },
     /** 初始化页面数据 */
     initPageData() {
@@ -697,6 +742,7 @@ export default {
         }).then(response => {
           let data = response.data;
           this.feedbackId = data.id;
+          this.parentId = data.id;
           this.meetingDate = data.meetingDate;
           this.mentorFeedback = data.mentorFeedback;
           // 初始化汇报附件