|
@@ -92,7 +92,12 @@
|
|
|
</el-form>
|
|
|
<!-- 标签页 -->
|
|
|
<el-tabs type="border-card" @tab-click="handleTabClick" v-model="activeName">
|
|
|
- <el-tab-pane label="居海波" name="20255">
|
|
|
+ <el-tab-pane
|
|
|
+ :key="item.name"
|
|
|
+ v-for="(item) in mentorTabs"
|
|
|
+ :label="item.title"
|
|
|
+ :name="item.name"
|
|
|
+ >
|
|
|
<!-- 培养计划总表 -->
|
|
|
<el-table
|
|
|
v-loading="loading"
|
|
@@ -641,39 +646,103 @@ export default {
|
|
|
this.getDicts("st_study_state").then(response => {
|
|
|
this.studyStateOptions = response.data;
|
|
|
});
|
|
|
- // 初始化页面
|
|
|
- this.initPage();
|
|
|
+ // 初始化页面数据
|
|
|
+ this.initPageData();
|
|
|
},
|
|
|
methods: {
|
|
|
- /** 获取导师标签页 */
|
|
|
- getMentorTabs() {
|
|
|
- // // 获取本导师反馈id
|
|
|
- // getFeedbackByParams({
|
|
|
- // successorId: this.queryParams.successorId,
|
|
|
- // feedbackYear: this.queryParams.feedbackYear,
|
|
|
- // feedbackSeason: this.queryParams.feedbackSeason
|
|
|
- // })
|
|
|
- // .then(response => {
|
|
|
- // let data = response.data;
|
|
|
- // this.mentorTabs.push({ key: data.mentorStaffId, value: data.mentorStaffName });
|
|
|
- // // 获取parent_id为本导师反馈id的反馈记录
|
|
|
- // return listFeedback( { parentId: data.id } );
|
|
|
- // })
|
|
|
- // .then(response => {
|
|
|
- // let data = response.rows;
|
|
|
- // for (let i = 0; i < data.length; i++) {
|
|
|
- // this.mentorTabs.push({ key: data[i].mentorStaffId, value: data[i].mentorStaffName });
|
|
|
- // }
|
|
|
- // console.log(this.mentorTabs);
|
|
|
- // });
|
|
|
+ /** 标签页切换事件 */
|
|
|
+ handleTabClick(tab) {
|
|
|
+ console.log(tab.name);
|
|
|
+
|
|
|
+
|
|
|
+ // 导师id=tab.name
|
|
|
+ // 根据导师id学员id年季度获取feedbackId
|
|
|
+
|
|
|
+ // 刷新问卷和导师反馈内容
|
|
|
+
|
|
|
+ },
|
|
|
+ /** 初始化页面数据 */
|
|
|
+ initPageData() {
|
|
|
+ // 获取当前日期
|
|
|
+ let date = new Date();
|
|
|
+ // 搜索条件默认为当年、当季度
|
|
|
+ this.queryParams.feedbackYear = date.getFullYear().toString();
|
|
|
+ this.queryParams.feedbackSeason = ( ( date.getMonth() + 2 ) / 3 ).toString();
|
|
|
+ // ====================获取导师下拉列表====================
|
|
|
+ listMentors().then(response => {
|
|
|
+ let mentorList = response.data;
|
|
|
+ for (let i = 0; i < mentorList.length; i++) {
|
|
|
+ let mentor = {};
|
|
|
+ mentor.key = mentorList[i].mentorStaffId;
|
|
|
+ mentor.value = mentorList[i].mentorStaffName;
|
|
|
+ this.mentorOptions.push(mentor);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // ====================获取当前导师的学员列表====================
|
|
|
+ listSuccessorsByMentorId(this.queryObject).then(response => {
|
|
|
+ let data = response.data;
|
|
|
+ for (let i = 0; i < data.length; i++) {
|
|
|
+ if (i == 0) {
|
|
|
+ // 默认选中列表中第一个学员
|
|
|
+ this.queryParams.successorId = data[i].staffId;
|
|
|
+ this.getList();
|
|
|
+ }
|
|
|
+ this.successorOptions.push( { key: data[i].staffId, value: data[i].staffName } );
|
|
|
+ }
|
|
|
+ // 获取当前学员当年当季度反馈id
|
|
|
+ getFeedbackByParams({
|
|
|
+ successorId: this.queryParams.successorId,
|
|
|
+ feedbackYear: this.queryParams.feedbackYear,
|
|
|
+ feedbackSeason: this.queryParams.feedbackSeason
|
|
|
+ }).then(response => {
|
|
|
+ let data = response.data;
|
|
|
+ this.feedbackId = data.id;
|
|
|
+ this.meetingDate = data.meetingDate;
|
|
|
+ this.mentorFeedback = data.mentorFeedback;
|
|
|
+ // 初始化汇报附件
|
|
|
+ this.initFileList(data.id);
|
|
|
+ // ====================初始化导师标签页====================
|
|
|
+ this.activeName = data.mentorId;
|
|
|
+ this.mentorTabs.push({ name: data.mentorId, title: data.mentorName});
|
|
|
+ listFeedback( { parentId: data.id } ).then(response => {
|
|
|
+ let data = response.rows;
|
|
|
+ for (let i = 0; i < data.length; i++) {
|
|
|
+ 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; }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+ });
|
|
|
+ // ====================获取当前导师作为受邀导师的学员列表====================
|
|
|
+ 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 } );
|
|
|
+ }
|
|
|
+ });
|
|
|
},
|
|
|
/** 问卷判空 */
|
|
|
isEmpty() {
|
|
|
- let radioArray =
|
|
|
- [
|
|
|
- this.radio1, this.radio2, this.radio3, this.radio4, this.radio5, this.radio6, this.radio7,
|
|
|
- this.radio8, this.radio9, this.radio10, this.radio11, this.radio12, this.radio13, this.radio14
|
|
|
- ];
|
|
|
+ let radioArray = [ this.radio1, this.radio2, this.radio3, this.radio4, this.radio5, this.radio6, this.radio7, this.radio8, this.radio9, this.radio10, this.radio11, this.radio12, this.radio13, this.radio14 ];
|
|
|
let isEmpty = false;
|
|
|
for (let i = 0; i < radioArray.length; i++) {
|
|
|
if (radioArray[i] == "") {
|
|
@@ -774,19 +843,14 @@ export default {
|
|
|
handleSave() {
|
|
|
// 问卷判空
|
|
|
if (this.isEmpty()) {
|
|
|
- this.$message.error('问卷不能为空')
|
|
|
+ this.$message.error('问卷答案不能为空')
|
|
|
return;
|
|
|
}
|
|
|
- let radioArray =
|
|
|
- [
|
|
|
- this.radio1, this.radio2, this.radio3, this.radio4, this.radio5, this.radio6, this.radio7,
|
|
|
- this.radio8, this.radio9, this.radio10, this.radio11, this.radio12, this.radio13, this.radio14
|
|
|
- ];
|
|
|
+ let radioArray = [ this.radio1, this.radio2, this.radio3, this.radio4, this.radio5, this.radio6, this.radio7, this.radio8, this.radio9, this.radio10, this.radio11, this.radio12, this.radio13, this.radio14 ];
|
|
|
let questionArray = [1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14];
|
|
|
+ // 保存问卷内容
|
|
|
for (let i = 0; i < radioArray.length; i++) {
|
|
|
- // 保存问卷内容
|
|
|
this.saveAnswer(questionArray[i]+3, radioArray[i]);
|
|
|
-
|
|
|
}
|
|
|
// 保存导师反馈内容
|
|
|
this.saveMentorFeedback();
|
|
@@ -883,9 +947,9 @@ export default {
|
|
|
this.doc.queryParams.pId = id
|
|
|
this.doc.pId = id
|
|
|
this.getFileList()
|
|
|
- this.$nextTick(() => {
|
|
|
- this.$refs.doc.clearFiles()
|
|
|
- })
|
|
|
+ // this.$nextTick(() => {
|
|
|
+ // this.$refs.doc.clearFiles()
|
|
|
+ // })
|
|
|
},
|
|
|
getFileList() {
|
|
|
allFileList(this.doc.queryParams).then(response => {
|
|
@@ -931,22 +995,6 @@ export default {
|
|
|
this.msgSuccess(this.$t('删除成功'));
|
|
|
})
|
|
|
},
|
|
|
- /** 初始化页面 */
|
|
|
- initPage() {
|
|
|
- // 获取当前日期
|
|
|
- let date = new Date();
|
|
|
- // 搜索条件默认为当年、当季度
|
|
|
- this.queryParams.feedbackYear = date.getFullYear().toString();
|
|
|
- this.queryParams.feedbackSeason = ( ( date.getMonth() + 2 ) / 3 ).toString();
|
|
|
- // 获取导师标签列表
|
|
|
- this.getMentorTabs();
|
|
|
- // 获取学员下拉列表
|
|
|
- this.getSuccessorOptions();
|
|
|
- // 获取导师下拉列表
|
|
|
- this.getMentorOptions();
|
|
|
- // 设置首选标签页name为当前登录用户id
|
|
|
- this.activeName = "20255";
|
|
|
- },
|
|
|
/** 邀请导师 */
|
|
|
handleInvite() {
|
|
|
let updateParams = {};
|
|
@@ -976,84 +1024,6 @@ export default {
|
|
|
|
|
|
this.msgSuccess("邀请成功,邮件已发送");
|
|
|
},
|
|
|
- /** 标签页切换事件 */
|
|
|
- handleTabClick(tab) {
|
|
|
- console.log(tab.name);
|
|
|
- },
|
|
|
- /** 查询导师下拉列表 */
|
|
|
- getMentorOptions() {
|
|
|
- listMentors().then(response => {
|
|
|
- let mentorList = response.data;
|
|
|
- for (let i = 0; i < mentorList.length; i++) {
|
|
|
- let mentor = {};
|
|
|
- mentor.key = mentorList[i].mentorStaffId;
|
|
|
- mentor.value = mentorList[i].mentorStaffName;
|
|
|
- this.mentorOptions.push(mentor);
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
- /** 查询学员下拉列表 */
|
|
|
- getSuccessorOptions() {
|
|
|
- // 获取作为导师的学员列表
|
|
|
- listSuccessorsByMentorId(this.queryObject).then(response => {
|
|
|
- let successorList = response.data;
|
|
|
- for (let i = 0; i < successorList.length; i++) {
|
|
|
- if (i == 0) {
|
|
|
- // 默认选中列表中第一个学员
|
|
|
- this.queryParams.successorId = successorList[i].staffId;
|
|
|
- // 获取计划列表
|
|
|
- this.getList();
|
|
|
- }
|
|
|
- let successor = {};
|
|
|
- successor.key = successorList[i].staffId;
|
|
|
- successor.value = successorList[i].staffName;
|
|
|
- this.successorOptions.push(successor);
|
|
|
- }
|
|
|
- let getParams = {};
|
|
|
- getParams.successorId = this.queryParams.successorId;
|
|
|
- getParams.feedbackYear = this.queryParams.feedbackYear;
|
|
|
- getParams.feedbackSeason = this.queryParams.feedbackSeason;
|
|
|
- // 获取当前学员当年当季度反馈id
|
|
|
- getFeedbackByParams(getParams).then(response => {
|
|
|
- let data = response.data;
|
|
|
- this.feedbackId = data.id;
|
|
|
- this.meetingDate = data.meetingDate;
|
|
|
- this.mentorFeedback = data.mentorFeedback;
|
|
|
- // 初始化汇报附件
|
|
|
- this.initFileList(data.id);
|
|
|
- // 获取14个问题的答案
|
|
|
- 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; }
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- // 获取作为受邀导师的学员列表
|
|
|
- return listInvitedSuccessor(null);
|
|
|
- }).then(response => {
|
|
|
- let successorList = response.data;
|
|
|
- for (let i = 0; i < successorList.length; i++) {
|
|
|
- let successor = {};
|
|
|
- successor.key = successorList[i].successorId;
|
|
|
- successor.value = successorList[i].successorName;
|
|
|
- this.successorOptions.push(successor);
|
|
|
- }
|
|
|
- });
|
|
|
- },
|
|
|
/** 查询专项培训反馈列表 */
|
|
|
getList() {
|
|
|
this.loading = true;
|