瀏覽代碼

王子文 专项培养

wangggziwen 3 年之前
父節點
當前提交
5cd06dd063
共有 1 個文件被更改,包括 33 次插入12 次删除
  1. 33 12
      ui/src/views/training/spec/seasonalfeedback/index.vue

+ 33 - 12
ui/src/views/training/spec/seasonalfeedback/index.vue

@@ -778,8 +778,7 @@ export default {
         this.staffId = response.data;
         // 判断当前用户是否为导师
         return isMentor();
-      })
-      .then(response => {
+      }).then(response => {
         this.isMentor = response.data;
         if (this.isMentor) {  // 当前用户是导师
           // ====================获取导师下拉列表====================
@@ -805,12 +804,29 @@ export default {
               }
               this.successorOptions.push( { key: data[i].staffId, value: data[i].staffName } );
             }
+            // ====================获取当前导师作为受邀导师的学员列表====================
+            return listInvitedSuccessor(null);
+          })
+          .then(response => {
+            let data = response.data;
+            for (let i = 0; i < data.length; i++) {
+              this.successorOptions.push( { key: data[i].successorId, value: data[i].successorName } );
+            }
+            console.log(this.successorOptions);
+            if (this.successorOptions.length != 0) {
+              // 默认选中列表中第一个学员
+              this.queryParams.successorId = this.successorOptions[0].key;
+              console.log(this.queryParams.successorId);
+              this.getList();
+            }
             // 获取当前学员当年当季度反馈id
-            getFeedbackByParams({
+            return getFeedbackByParams({
               successorId: this.queryParams.successorId,
               feedbackYear: this.queryParams.feedbackYear,
               feedbackSeason: this.queryParams.feedbackSeason
-            }).then(response => {
+            });
+          })
+          .then(response => {
               let data = response.data;
               this.feedbackId = data.id;
               this.mentorId = data.mentorId;
@@ -850,14 +866,6 @@ export default {
                 }
               window.scrollTo(0, 0);
               });
-            });
-          });
-          // ====================获取当前导师作为受邀导师的学员列表====================
-          listInvitedSuccessor(null).then(response => {
-            let data = response.data;
-            for (let i = 0; i < data.length; i++) {
-              this.successorOptions.push( { key: data[i].successorId, value: data[i].successorName } );
-            }
           });
         } else {  // 当前用户是学员
           this.queryParams.successorId = this.staffId;
@@ -900,6 +908,14 @@ export default {
       }
       return isEmpty;
     },
+    /** 邀请表格判空 */
+    isInvitationFormEmpty() {
+      if (this.meetingDate == "" || this.mentorOptionsArray.length == 0) {
+        return true;
+      } else {
+        return false;
+      }
+    },
     /** 计算导师评分 */
     calcFeedbackScore() {
       let mentorFeedbackScore = 0; // 本导师评分
@@ -1197,6 +1213,10 @@ export default {
     },
     /** 邀请导师 */
     handleInvite() {
+      if (this.isInvitationFormEmpty()) {
+        this.$message.error('会议日期和受邀导师导师不能为空')
+        return;
+      }
       let updateParams = {};
       updateParams.id = this.feedbackId;
       let date = new Date(this.meetingDate);
@@ -1249,6 +1269,7 @@ export default {
     },
     /** 查询专项培训反馈列表 */
     getList() {
+      console.log(this.queryParams);
       this.loading = true;
       listPlanSeasonal(this.queryParams).then(response => {
         this.dataList = response.rows;