|
@@ -797,22 +797,26 @@ export default {
|
|
|
// ====================获取当前导师的学员列表====================
|
|
|
listSuccessorsByMentorId(this.queryObject).then(response => {
|
|
|
let data = response.data;
|
|
|
+ console.log(data);
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
|
this.successorOptions.push( { key: data[i].staffId, value: data[i].staffName } );
|
|
|
}
|
|
|
+ console.log(this.successorOptions);
|
|
|
// ====================获取当前导师作为受邀导师的学员列表====================
|
|
|
return listInvitedSuccessor(null);
|
|
|
})
|
|
|
.then(response => {
|
|
|
let data = response.data;
|
|
|
+ console.log(data);
|
|
|
for (let i = 0; i < data.length; i++) {
|
|
|
this.successorOptions.push( { key: data[i].successorId, value: data[i].successorName } );
|
|
|
}
|
|
|
+ console.log(this.successorOptions);
|
|
|
// 学员数组去重
|
|
|
let map = new Map();
|
|
|
this.successorOptions.forEach((item, index) => {
|
|
|
- if (!map.has(item["successorId"])) {
|
|
|
- map.set(item["successorId"], item);
|
|
|
+ if (!map.has(item["key"])) {
|
|
|
+ map.set(item["key"], item);
|
|
|
}
|
|
|
});
|
|
|
this.successorOptions = [...map.values()];
|
|
@@ -997,7 +1001,8 @@ export default {
|
|
|
successorId: this.queryParams.successorId,
|
|
|
feedbackYear: this.queryParams.feedbackYear,
|
|
|
feedbackSeason: this.queryParams.feedbackSeason
|
|
|
- }).then(response => {
|
|
|
+ })
|
|
|
+ .then(response => {
|
|
|
let data = response.data;
|
|
|
let score = {};
|
|
|
// 截取至小数点后两位
|
|
@@ -1014,15 +1019,47 @@ export default {
|
|
|
if (this.queryParams.feedbackSeason == "4") {
|
|
|
score.quarterFour = overallScore;
|
|
|
}
|
|
|
- if (data != null) {
|
|
|
+ if (data != null) { // 更新季度评分
|
|
|
score.id = data.id;
|
|
|
updateScore(score);
|
|
|
- } else {
|
|
|
+ } else { // 新增评分
|
|
|
score.staffId = this.queryParams.successorId;
|
|
|
score.feedbackYear = this.queryParams.feedbackYear;
|
|
|
score.feedbackSeason = this.queryParams.feedbackSeason;
|
|
|
addScore(score);
|
|
|
}
|
|
|
+ return getScore({
|
|
|
+ successorId: this.queryParams.successorId,
|
|
|
+ feedbackYear: this.queryParams.feedbackYear,
|
|
|
+ feedbackSeason: this.queryParams.feedbackSeason
|
|
|
+ });
|
|
|
+ })
|
|
|
+ .then(response => { // 计算年度评分
|
|
|
+ let data = response.data;
|
|
|
+ let count = 0;
|
|
|
+ let sum = 0;
|
|
|
+ if (data.quarterOne != null) {
|
|
|
+ count++;
|
|
|
+ sum += data.quarterOne;
|
|
|
+ }
|
|
|
+ if (data.quarterTwo != null) {
|
|
|
+ count++;
|
|
|
+ sum += data.quarterTwo;
|
|
|
+ }
|
|
|
+ if (data.quarterThree != null) {
|
|
|
+ count++;
|
|
|
+ sum += data.quarterThree;
|
|
|
+ }
|
|
|
+ if (data.quarterFour != null) {
|
|
|
+ count++;
|
|
|
+ sum += data.quarterFour;
|
|
|
+ }
|
|
|
+ let year = sum / count;
|
|
|
+ year = year.toString().substring(0,year.toString().indexOf(".")+3);
|
|
|
+ let score = {};
|
|
|
+ score.id = data.id;
|
|
|
+ score.year = year;
|
|
|
+ updateScore(score);
|
|
|
});
|
|
|
});
|
|
|
},
|