|
@@ -1,7 +1,7 @@
|
|
|
<template>
|
|
|
<div class="app-container">
|
|
|
<!-- 搜索栏 -->
|
|
|
- <el-form :inline="true">
|
|
|
+ <el-form :inline="true" v-if="isMentor">
|
|
|
<el-form-item label="会议日期">
|
|
|
<el-date-picker
|
|
|
size="small"
|
|
@@ -43,7 +43,7 @@
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<el-form :model="queryParams" ref="queryForm" :inline="true" v-show="showSearch">
|
|
|
- <el-form-item label="学员" prop="successorId">
|
|
|
+ <el-form-item label="学员" prop="successorId" v-if="isMentor">
|
|
|
<el-select
|
|
|
size="small"
|
|
|
v-model="queryParams.successorId"
|
|
@@ -127,6 +127,7 @@
|
|
|
<div>
|
|
|
<h3>汇报展示PPT</h3>
|
|
|
<el-upload
|
|
|
+ v-if="!isMentor"
|
|
|
ref="doc"
|
|
|
:headers="doc.headers"
|
|
|
class="upload-demo"
|
|
@@ -163,6 +164,7 @@
|
|
|
@click="handleDownload(scope.row)"
|
|
|
>{{ $t('下载') }}</el-button>
|
|
|
<el-button
|
|
|
+ v-if="!isMentor"
|
|
|
size="mini"
|
|
|
type="text"
|
|
|
icon="el-icon-delete"
|
|
@@ -173,7 +175,7 @@
|
|
|
</el-table>
|
|
|
</div>
|
|
|
<!-- 问卷 -->
|
|
|
- <div>
|
|
|
+ <div v-if="isMentor">
|
|
|
<div style="display:inline-block;width:40%;">
|
|
|
<h3 style="margin-bottom:0px;">学员表现</h3>
|
|
|
<div class="question">
|
|
@@ -338,9 +340,14 @@
|
|
|
<!-- 导师反馈 -->
|
|
|
<div>
|
|
|
<h3>导师反馈</h3>
|
|
|
- <editor :min-height="300" v-model="mentorFeedback" v-if="showSaveButton"/>
|
|
|
+ <div v-if="showSaveButton && ( staffId == activeName )">
|
|
|
+ <editor
|
|
|
+ :min-height="300"
|
|
|
+ v-model="mentorFeedback"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
<span
|
|
|
- v-if="!showSaveButton"
|
|
|
+ v-if="!showSaveButton || ( staffId != activeName )"
|
|
|
v-html="mentorFeedback"
|
|
|
style="overflow:scroll; display:block; border:1px solid #CCCCCC; height: 300px; padding:15px;font-family: Helvetica, Arial, sans-serif; font-size: 13px;"
|
|
|
>
|
|
@@ -352,7 +359,7 @@
|
|
|
size="medium"
|
|
|
type="success"
|
|
|
@click="handleSave"
|
|
|
- v-if="showSaveButton"
|
|
|
+ v-if="showSaveButton && ( staffId == activeName )"
|
|
|
>
|
|
|
保存
|
|
|
</el-button>
|
|
@@ -417,13 +424,21 @@ import { getToken } from "@/utils/auth";
|
|
|
import Treeselect from "@riophae/vue-treeselect";
|
|
|
import "@riophae/vue-treeselect/dist/vue-treeselect.css";
|
|
|
import Editor from '@/components/Editor';
|
|
|
-import { listMentors2 } from "@/api/plant/staffmgr";
|
|
|
+import { listMentors2, getStaffId, isMentor } from "@/api/plant/staffmgr";
|
|
|
|
|
|
export default {
|
|
|
name: "SeasonalFeedback",
|
|
|
components: { Treeselect, Editor },
|
|
|
data() {
|
|
|
return {
|
|
|
+ // 父级反馈导师id
|
|
|
+ mentorId: null,
|
|
|
+ // 是否为第一次搜索
|
|
|
+ isFirstSearch: true,
|
|
|
+ // 当前用户id
|
|
|
+ staffId: null,
|
|
|
+ // 是否为导师
|
|
|
+ isMentor: null,
|
|
|
// 显示保存按钮
|
|
|
showSaveButton: false,
|
|
|
// 导师标签
|
|
@@ -683,112 +698,44 @@ export default {
|
|
|
},
|
|
|
/** 标签页切换事件 */
|
|
|
handleTabClick(tab) {
|
|
|
- // 清空问卷
|
|
|
- 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.activeName = tab.name;
|
|
|
+ if (this.isMentor) {
|
|
|
+ // 清空问卷
|
|
|
+ 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;
|
|
|
+ // 查询参数
|
|
|
+ let feedback = {};
|
|
|
+ feedback.mentorId = tab.name;
|
|
|
+ feedback.successorId = this.queryParams.successorId;
|
|
|
+ feedback.feedbackYear = this.queryParams.feedbackYear;
|
|
|
+ feedback.feedbackSeason = this.queryParams.feedbackSeason;
|
|
|
+ if (this.isMentor && this.staffId != tab.name) {
|
|
|
+ feedback.parentId = this.parentId;
|
|
|
+ }
|
|
|
// 根据标签页导师id获取反馈id
|
|
|
- getFeedbackByParams({
|
|
|
- mentorId: tab.name,
|
|
|
- successorId: this.queryParams.successorId,
|
|
|
- feedbackYear: this.queryParams.feedbackYear,
|
|
|
- feedbackSeason: this.queryParams.feedbackSeason,
|
|
|
- parentId: this.parentId
|
|
|
- }).then(response => {
|
|
|
+ getFeedbackByParams(feedback).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; }
|
|
|
- }
|
|
|
- window.scrollTo(0, 0);
|
|
|
- });
|
|
|
- });
|
|
|
- },
|
|
|
- /** 初始化页面数据 */
|
|
|
- initPageData() {
|
|
|
- // 获取当前日期
|
|
|
- let date = new Date();
|
|
|
- // 搜索条件默认为当年、当季度
|
|
|
- this.queryParams.feedbackYear = date.getFullYear().toString();
|
|
|
- this.queryParams.feedbackYearTemp = date.getFullYear().toString();
|
|
|
- this.queryParams.feedbackSeason = ( ( date.getMonth() + 2 ) / 3 ).toString();
|
|
|
- // ====================获取导师下拉列表====================
|
|
|
- listMentors2().then(response => {
|
|
|
- let mentorList = response.data;
|
|
|
- for (let i = 0; i < mentorList.length; i++) {
|
|
|
- let mentor = {};
|
|
|
- mentor.key = mentorList[i].staffid;
|
|
|
- mentor.value = mentorList[i].name;
|
|
|
- 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.parentId = data.id;
|
|
|
- this.meetingDate = data.meetingDate;
|
|
|
- this.resetLastDay();
|
|
|
- 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});
|
|
|
- }
|
|
|
- });
|
|
|
- // ====================获取问卷答案====================
|
|
|
+ if (this.isMentor) {
|
|
|
+ // 刷新问卷
|
|
|
listAnswer( { feedbackId: this.feedbackId } ).then(response => {
|
|
|
let data = response.rows;
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
@@ -807,15 +754,130 @@ export default {
|
|
|
if (data[i].questionId == "16") { this.radio13 = data[i].answer; }
|
|
|
if (data[i].questionId == "17") { this.radio14 = data[i].answer; }
|
|
|
}
|
|
|
- window.scrollTo(0, 0);
|
|
|
+ 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 } );
|
|
|
+ },
|
|
|
+ /** 初始化页面数据 */
|
|
|
+ initPageData() {
|
|
|
+ // 获取当前日期
|
|
|
+ let date = new Date();
|
|
|
+ // 搜索条件默认为当年、当季度
|
|
|
+ this.queryParams.feedbackYear = date.getFullYear().toString();
|
|
|
+ this.queryParams.feedbackYearTemp = date.getFullYear().toString();
|
|
|
+ this.queryParams.feedbackSeason = ( ( date.getMonth() + 2 ) / 3 ).toString();
|
|
|
+ // 获取当前用户id
|
|
|
+ getStaffId().then(response => {
|
|
|
+ this.staffId = response.data;
|
|
|
+ // 判断当前用户是否为导师
|
|
|
+ return isMentor();
|
|
|
+ })
|
|
|
+ .then(response => {
|
|
|
+ this.isMentor = response.data;
|
|
|
+ if (this.isMentor) { // 当前用户是导师
|
|
|
+ // ====================获取导师下拉列表====================
|
|
|
+ listMentors2().then(response => {
|
|
|
+ let mentorList = response.data;
|
|
|
+ for (let i = 0; i < mentorList.length; i++) {
|
|
|
+ let mentor = {};
|
|
|
+ mentor.key = mentorList[i].staffid;
|
|
|
+ mentor.value = mentorList[i].name;
|
|
|
+ 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.mentorId = data.id;
|
|
|
+ this.parentId = data.id;
|
|
|
+ this.meetingDate = data.meetingDate;
|
|
|
+ this.resetLastDay();
|
|
|
+ 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; }
|
|
|
+ }
|
|
|
+ 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;
|
|
|
+ this.getList();
|
|
|
+ // 获取当前学员当年当季度反馈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.parentId = data.id;
|
|
|
+ this.meetingDate = data.meetingDate;
|
|
|
+ this.resetLastDay();
|
|
|
+ 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});
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
}
|
|
|
});
|
|
|
},
|
|
@@ -1078,7 +1140,10 @@ export default {
|
|
|
handleInvite() {
|
|
|
let updateParams = {};
|
|
|
updateParams.id = this.feedbackId;
|
|
|
- updateParams.meetingDate = this.meetingDate;
|
|
|
+ let date = new Date(this.meetingDate);
|
|
|
+ date.setTime( date.getTime() + 3600 * 1000 * 24 );
|
|
|
+ updateParams.meetingDate = date;
|
|
|
+ updateParams.id = this.parentId;
|
|
|
// 修改会议日期
|
|
|
updateFeedback(updateParams);
|
|
|
for (let i = 0; i < this.mentorOptionsArray.length; i++) {
|
|
@@ -1140,7 +1205,12 @@ export default {
|
|
|
},
|
|
|
/** 搜索按钮操作 */
|
|
|
handleQuery() {
|
|
|
- this.queryParams.feedbackYear = this.queryParams.feedbackYearTemp.getFullYear();
|
|
|
+ if (this.isFirstSearch) {
|
|
|
+ this.queryParams.feedbackYear = this.queryParams.feedbackYearTemp;
|
|
|
+ this.isFirstSearch = false;
|
|
|
+ } else {
|
|
|
+ this.queryParams.feedbackYear = this.queryParams.feedbackYearTemp.getFullYear();
|
|
|
+ }
|
|
|
this.queryParams.pageNum = 1;
|
|
|
this.getList();
|
|
|
// 清空问卷
|