任务设置问题修改

v1.2.0
‘wangjiuyun 2025-01-08 16:37:48 +08:00
parent 7532d5cf47
commit 8d02e76518
9 changed files with 361 additions and 123 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 1000 B

View File

@ -317,4 +317,3 @@ body {
position: absolute; position: absolute;
right: 20px; right: 20px;
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 1000 B

View File

@ -179,8 +179,7 @@ export default {
} }
}, },
selectRow({ arr, row }) { selectRow({ arr, row }) {
console.log(row,22);
if ( if (
this.currentSelectedUser.filter((ele) => ele.userId == row.userId) this.currentSelectedUser.filter((ele) => ele.userId == row.userId)
.length .length
@ -200,6 +199,8 @@ export default {
} else { } else {
this.currentSelectedUserName.push(row.nickName); this.currentSelectedUserName.push(row.nickName);
} }
console.log(this.currentSelectedUserName,22);
}, },
fetchUserList: async function () { fetchUserList: async function () {
const response = await systemApi.getUserList({ const response = await systemApi.getUserList({
@ -262,7 +263,7 @@ export default {
this.selectedUsers = []; this.selectedUsers = [];
this.$refs.customTableRef?.setCurrentRow(); this.$refs.customTableRef?.setCurrentRow();
} }
} else { } else {
if (!newVal.length) { if (!newVal.length) {
this.selectedUsers = []; this.selectedUsers = [];
this.$refs.customTableRef?.clearSelection(); this.$refs.customTableRef?.clearSelection();

View File

@ -1,11 +1,35 @@
<template> <template>
<div class="conetentBox"> <div class="conetentBox">
<div class="flex-row jcsb aic userBox"> <div class="titleBox flex-row aic jcsb">
<div>张三 2024年员工年度考核</div> <div class="flex-row aic">
<div v-if="!isNormal">{{ saveData.manageScore }}</div> <div class="block"></div>
{{ examineTask.taskName }}
</div>
<div class="flex-row jcfs f1" style="gap: 20px" v-if="isEdit">
<el-button type="default" style="width: 90px" @click="saveScoreCheck(0)"
>保存</el-button
>
<el-button type="primary" style="width: 90px" @click="saveScoreCheck(1)"
>提交</el-button
>
</div>
</div>
<div class="flex-row jcsb aic userBox headerBox">
<div class="flex-row aic">
<i
class="el-icon-user-solid"
style="color: #4096ff; font-size: 24px; margin-right: 5px"
></i
>{{ examineUser.userName }}
</div>
<div class="totalBox aic" v-if="!isNormal">
<div>考核评分</div>
<div class="scoreTotal">{{ saveData.manageScore }}</div>
</div>
</div> </div>
<div class="tableBox"> <div class="tableBox">
<div <div
class="tableRow"
v-for="(table, index) in tableData" v-for="(table, index) in tableData"
:key="index" :key="index"
style="margin-bottom: 20px" style="margin-bottom: 20px"
@ -18,38 +42,87 @@
:label="header.label" :label="header.label"
:prop="header.prop" :prop="header.prop"
:width="header.width" :width="header.width"
:minWidth="header.minWidth"
> >
</el-table-column> </el-table-column>
<el-table-column label="评分" prop="score" width="300"> <el-table-column
label="评分"
prop="score"
minWidth="320"
class-name="sorceTableCell"
>
<template slot-scope="scope"> <template slot-scope="scope">
<div style="width: 80%; position: relative"> <div style="width: 88%; position: relative">
<div> <div>
<div
class="flex-row jcsb"
style="
margin-left: 10px;
width: 90%;
color: #999;
font-weight: 500;
font-size: 14px;
"
>
<div>0</div>
<div v-show="scope.row.score != 10">10</div>
</div>
<div
class="scoreText aic"
v-show="scope.row.score != 0"
:style="{
left: scope.row.score * 9 - 5 + '%',
}"
>
<img
src="@/assets/task/score.png"
:style="{
height: '28px',
width: '34px',
zIndex: 0,
position: 'absolute',
top: '0',
}"
alt=""
/>
<div
:style="{
zIndex: 10,
paddingLeft: scope.row.score != 10 ? '13px' : '9px',
}"
>
{{ scope.row.score }}
</div>
</div>
<div
v-for="item in scope.row.score == 0
? 0
: scope.row.score - 1"
:key="item"
class="stepBox"
:style="{
left: item * 9 + 1.5 + '%',
}"
></div>
<el-slider <el-slider
v-model="scope.row.score" v-model="scope.row.score"
:min="0" :min="0"
:max="10" :max="10"
@change="updateScore(scope.row)" @change="updateScore(scope.row)"
:disabled="!isEdit" :disabled="!isEdit"
style="width: 90%"
show-stops
show-tooltip
></el-slider> ></el-slider>
</div> </div>
<div class="statusText" v-show="scope.row.score == 0"> <div class="statusText" v-show="scope.row.score == 0">
未打分 暂未打分
</div>
<div class="flex-row jcsb" style="margin-left: 10px">
<div>0</div>
<div class="scoreText">{{ scope.row.score }}</div>
<div>10</div>
</div> </div>
</div> </div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column <el-table-column label="自评总结" prop="score" v-if="isNormal">
label="自评总结"
prop="score"
width="300"
v-if="isNormal"
>
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<el-button <el-button
@ -57,25 +130,22 @@
@click="handleEdit(scope.row)" @click="handleEdit(scope.row)"
type="text" type="text"
size="mini" size="mini"
icon="el-icon-edit"
:class="{ hasEdit: !scope.row.remark }" :class="{ hasEdit: !scope.row.remark }"
>{{ scope.row.remark ? "已填写" : "未填写" }}</el-button style="font-weight: 600"
> >{{ scope.row.remark ? "查看" : "暂未评价" }}
<i
style="color: #4096ff; font-size: 14px"
class="el-icon-edit el-icon--right"
></i
></el-button>
<el-button <el-button
v-if="!isEdit && scope.row.remark" v-if="!isEdit"
@click="handleEdit(scope.row)" @click="handleEdit(scope.row)"
type="text" type="text"
size="mini" size="mini"
icon="el-icon-view"
:class="{ hasEdit: !scope.row.remark }" :class="{ hasEdit: !scope.row.remark }"
>查看</el-button style="font-weight: 600"
> >{{ scope.row.remark ? "查看" : "暂未评价" }}</el-button
<el-button
v-if="!isEdit && !scope.row.remark"
type="text"
size="mini"
:class="{ hasEdit: !scope.row.remark }"
>未填写</el-button
> >
</div> </div>
</template> </template>
@ -91,21 +161,16 @@
:autosize="{ minRows: 4 }" :autosize="{ minRows: 4 }"
placeholder="0/300" placeholder="0/300"
v-model="saveData.judgeContent" v-model="saveData.judgeContent"
:disabled="!isEdit" :readonly="!isEdit"
maxlength="300"
show-word-limit
> >
</el-input> </el-input>
</div> </div>
</div> </div>
</div> </div>
</div> </div>
<p class="flex-row jcc" style="gap: 40px" v-if="isEdit">
<el-button type="default" style="width: 150px" @click="saveScoreCheck(0)"
>保存</el-button
>
<el-button type="primary" style="width: 150px" @click="saveScoreCheck(1)"
>提交</el-button
>
</p>
<el-dialog title="自评总结" :visible.sync="dialogVisible" width="30%"> <el-dialog title="自评总结" :visible.sync="dialogVisible" width="30%">
<div> <div>
<el-input <el-input
@ -113,14 +178,16 @@
:autosize="{ minRows: 4 }" :autosize="{ minRows: 4 }"
placeholder="0/200" placeholder="0/200"
v-model="remark" v-model="remark"
:disabled="!isEdit" :readonly="!isEdit"
maxlength="200"
show-word-limit
> >
</el-input> </el-input>
</div> </div>
<span slot="footer" class="dialog-footer" v-if="isEdit"> <span slot="footer" class="dialog-footer" >
<el-button @click="cancelEdit"> </el-button> <el-button @click="cancelEdit">{{isEdit?' ':''}}</el-button>
<el-button type="primary" @click="saveEdit"> </el-button> <el-button type="primary" @click="saveEdit" v-if="isEdit"> </el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
@ -128,10 +195,10 @@
<script> <script>
import { taskApi } from "@/utils/api"; import { taskApi } from "@/utils/api";
export default { export default {
data() { data() {
return { return {
userId: "",
taskId: "", taskId: "",
isNormal: false, isNormal: false,
dialogVisible: false, dialogVisible: false,
@ -140,8 +207,12 @@ export default {
remark: "", remark: "",
isEdit: "", isEdit: "",
headers: [ headers: [
{ label: "考核项", prop: "reviewItem", width: 200 }, { label: "考核项", prop: "reviewItem", minWidth: 100 },
{ label: "评分标准", prop: "remarks", width: 700 }, {
label: "评分标准",
prop: "remarks",
minWidth: 320,
},
], ],
// //
tableData: [ tableData: [
@ -151,7 +222,6 @@ export default {
examineTaskId: "", examineTaskId: "",
examineId: "", examineId: "",
reviewType: "", reviewType: "",
userId: "",
reviewType: "", reviewType: "",
// //
saveData: { saveData: {
@ -163,6 +233,8 @@ export default {
judgeContent: "", judgeContent: "",
examineDetailList: [], examineDetailList: [],
}, },
examineUser: {},
examineTask: {},
}; };
}, },
methods: { methods: {
@ -180,12 +252,10 @@ export default {
let param = { let param = {
examineTaskId: this.examineTaskId, examineTaskId: this.examineTaskId,
reviewType: this.reviewType, reviewType: this.reviewType,
userId: this.userId,
}; };
if (this.isNormal) {
param.userId = this.userId; param.examineId = this.examineId;
} else {
param.examineId = this.examineId;
}
taskApi.getTaskScoreDetail(param).then((res) => { taskApi.getTaskScoreDetail(param).then((res) => {
let objData = {}; let objData = {};
res.data.examineConfigDetailVoList.forEach((ele) => { res.data.examineConfigDetailVoList.forEach((ele) => {
@ -194,11 +264,17 @@ export default {
}); });
this.tableData = Object.values(objData); this.tableData = Object.values(objData);
if (!this.examineId) { if (!this.examineId) {
this.examineId = res.data.examineUser.examineId;
} else { } else {
this.saveData.judgeContent = res.data.examineUser.judgeContent || ""; this.saveData.judgeContent = res.data.examineUser.judgeContent || "";
this.saveData.manageScore = res.data.examineUser.manageScore || ""; this.saveData.manageScore = res.data.examineUser.manageScore || "";
} }
this.examineId = res.data.examineUser.id;
this.examineTask = res.data.examineTask;
this.examineUser = res.data.examineUser;
if(res.data.examineUser.examineStatusSelf==1)
this.isEdit =false
}); });
}, },
handleEdit(row) { handleEdit(row) {
@ -244,10 +320,7 @@ export default {
return; return;
} }
// //
if ( if (this.saveData.examineDetailList.filter((ele) => !ele.score).length) {
this.saveData.examineDetailList.filter((ele) => !ele.score).length &&
!this.isNormal
) {
this.$alert("存在未评分绩效项,请完善后再试", "提交失败", { this.$alert("存在未评分绩效项,请完善后再试", "提交失败", {
confirmButtonText: "确定", confirmButtonText: "确定",
type: "warning", type: "warning",
@ -261,7 +334,7 @@ export default {
confirmButtonText: "确定", confirmButtonText: "确定",
type: "warning", type: "warning",
}); });
} else if (this.saveData.judgeContent.length > 300) { } else if (this.saveData.judgeContent.length > 300 && !this.isNormal) {
this.$message({ this.$message({
message: "总体评价限制300个字符", message: "总体评价限制300个字符",
type: "warning", type: "warning",
@ -319,7 +392,7 @@ export default {
<style scoped> <style scoped>
.conetentBox { .conetentBox {
padding: 30px; padding: 40px 30px 30px;
background-color: #fff; background-color: #fff;
height: 90vh; /* 设置整体高度 */ height: 90vh; /* 设置整体高度 */
overflow: auto; overflow: auto;
@ -327,30 +400,44 @@ export default {
.el-table { .el-table {
margin-top: 20px; margin-top: 20px;
} }
.userBox { .userBox {
margin: 0 0 20px; margin: 0 0 20px;
font-size: 16px; font-size: 16px;
font-weight: bold; font-weight: bold;
} }
::v-deep .el-slider__runway { ::v-deep .el-slider__runway {
height: 20px; height: 14px;
border-radius: 20px; border-radius: 10px;
margin: 10px !important; margin: 10px !important;
/* width: 95%; */ /* width: 95%; */
} }
::v-deep .el-slider__runway.disabled .el-slider__bar { ::v-deep .el-slider__runway.disabled .el-slider__bar {
height: 14px;
border-radius: 10px;
background-color: #ff5722; background-color: #ff5722;
} }
::v-deep .el-slider__stop {
height: 14px;
border-radius: 0;
z-index: 1000;
}
::v-deep .el-slider__bar { ::v-deep .el-slider__bar {
height: 20px; height: 14px;
border-radius: 20px; border-radius: 10px;
background-color: #ff5722; background: linear-gradient(to right, #ffb144, #ff7d00);
} }
::v-deep .el-slider__button { ::v-deep .el-slider__button {
display: none; display: none;
} }
.scoreText { .scoreText {
color: #1686d8; color: #fff;
position: absolute;
top: 2px;
font-weight: 500;
display: flex;
flex-direction: row;
} }
::v-deep .el-table th { ::v-deep .el-table th {
text-align: left; text-align: left;
@ -364,19 +451,74 @@ export default {
font-weight: bold; font-weight: bold;
} }
.statusText { .statusText {
color: #ff5722; color: #ff7d00;
position: absolute; position: absolute;
right: -58px; right: -50px;
top: 10px; top: 26px;
font-size: 14px;
font-weight: 600;
} }
.hasEdit { .hasEdit {
color: #ff5722; color: #999999;
} }
::v-deep .el-dialog { ::v-deep .el-dialog {
margin-top: 15% !important; margin-top: 15% !important;
} }
.tableBox { .tableBox {
height: 85%; height: 75%;
overflow: auto; overflow: auto;
padding: 20px;
background-color: #fff;
}
.tableBox ::v-deep .el-table {
border-left: 1px solid #eeeeee;
border-right: 1px solid #eeeeee;
}
.tableRow {
padding: 20px;
box-shadow: 0 0 20px #0000000f;
}
.titleBox {
font-size: 20px;
font-weight: bold;
margin-bottom: 40px;
}
.headerBox {
padding: 20px;
background-color: #f9f9f9;
border-radius: 2px;
font-size: 14px;
}
.block {
width: 4px;
height: 24px;
background-color: #4096ff;
margin-right: 10px;
}
.stepBox {
position: absolute;
top: 33px;
height: 14px;
width: 3px;
background-color: #fff;
z-index: 100;
}
.totalBox {
width: 150px;
display: flex;
flex-direction: row;
font-size: 14px;
color: #333333;
}
.scoreTotal {
font-size: 28px;
font-weight: 700;
color: #ff7d00;
}
::v-deep .sorceTableCell .cell {
margin-bottom: 20px;
}
::v-deep .el-table__body .el-table__cell {
padding: 20px 0;
} }
</style> </style>

View File

@ -25,7 +25,7 @@
</div> </div>
<div <div
class="action-buttons aic" class="action-buttons aic"
@click="viewDetails(item.id, 0)" @click="viewDetails(item.id, 1)"
> >
考核评分 考核评分
<img <img
@ -50,7 +50,7 @@
/> />
<div class="flex-row aic nameBox"> <div class="flex-row aic nameBox">
<div>{{ item.taskName }}</div> <div>{{ item.taskName }}</div>
<el-tag type="info" size="mini">进行中</el-tag> <el-tag type="info" size="mini">已过期</el-tag>
</div> </div>
<div class="timeBox"> <div class="timeBox">
截止时间{{ item.endTime.split(" ")[0] }} 截止时间{{ item.endTime.split(" ")[0] }}
@ -96,11 +96,11 @@ export default {
this.taskList = res.data; this.taskList = res.data;
}); });
}, },
viewDetails(id, isOutData) { viewDetails(id, isEdit) {
// //
this.$router.push({ this.$router.push({
path: "/workAppraisal/managerUser", path: "/workAppraisal/managerUser",
query: { taskId: id, isOutData }, query: { taskId: id, isEdit },
}); });
}, },
}, },

View File

@ -55,14 +55,14 @@
<template slot="operation" slot-scope="{ row }"> <template slot="operation" slot-scope="{ row }">
<div class="operation-buttons"> <div class="operation-buttons">
<el-button <el-button
v-if="isOutData == 0 && row.examineStatus == '0'" v-if="isEdit == 1 && row.examineStatus == '0'"
@click="handleEdit(row, 1)" @click="handleEdit(row, 1)"
type="text" type="text"
size="mini" size="mini"
>去评分</el-button >去评分</el-button
> >
<el-button <el-button
v-if="row.examineStatus == '1' || isOutData == 1" v-if="row.examineStatus == '1' || isEdit == 0"
type="text" type="text"
size="mini" size="mini"
@click="handleEdit(row, 0)" @click="handleEdit(row, 0)"
@ -101,7 +101,7 @@ export default {
examineStatus: "", examineStatus: "",
}, },
taskId: "", taskId: "",
isOutData: "", isEdit: "",
columns: [ columns: [
{ prop: "userName", label: "考核人员" }, { prop: "userName", label: "考核人员" },
{ prop: "manageScore", label: "考核评分", sortable: "custom" }, { prop: "manageScore", label: "考核评分", sortable: "custom" },
@ -202,7 +202,7 @@ export default {
}, },
created() { created() {
this.taskId = this.$route.query.taskId; this.taskId = this.$route.query.taskId;
this.isOutData = this.$route.query.isOutData; this.isEdit = this.$route.query.isEdit;
}, },
mounted() { mounted() {
this.taskUserList(); this.taskUserList();

View File

@ -21,7 +21,7 @@
</div> </div>
<div class="status-actions aic"> <div class="status-actions aic">
<div class="peopleNumber"> <div class="peopleNumber">
考核人数{{ item.peopleNumber }} <!-- 考核人数{{ item.peopleNumber }} -->
</div> </div>
<div <div
class="action-buttons aic" class="action-buttons aic"
@ -50,7 +50,7 @@
/> />
<div class="flex-row aic nameBox"> <div class="flex-row aic nameBox">
<div>{{ item.taskName }}</div> <div>{{ item.taskName }}</div>
<el-tag type="info" size="mini">进行中</el-tag> <el-tag type="info" size="mini">已过期</el-tag>
</div> </div>
<div class="timeBox"> <div class="timeBox">
截止时间{{ item.endTime.split(" ")[0] }} 截止时间{{ item.endTime.split(" ")[0] }}
@ -64,7 +64,7 @@
class="action-buttons aic" class="action-buttons aic"
@click="viewDetails(item.id, 0)" @click="viewDetails(item.id, 0)"
> >
考核评分 查看详情
<img <img
src="@/assets/task/right.png" src="@/assets/task/right.png"
alt="" alt=""

View File

@ -184,8 +184,12 @@
v-for="(ele, index) in item.list" v-for="(ele, index) in item.list"
:key="index" :key="index"
class="flex-row jcsb leftSub" class="flex-row jcsb leftSub"
:class="{
selectClass: selectLeftRow == ele.title + ele.type,
}"
@click="selectLeft(ele)"
> >
<div>{{ ele.reviewItem }}</div> <div>{{ ele.title }}</div>
<div class="statusText">{{ ele.weight }}%</div> <div class="statusText">{{ ele.weight }}%</div>
</div> </div>
</div> </div>
@ -211,8 +215,11 @@
<div> <div>
<div <div
v-for="(item, index) in ( v-for="(item, index) in (
scoreList.find((ele) => ele.title == letfValue) || {} (
).list" (scoreList.find((ele) => ele.title == letfValue) || {})
.list || []
).find((ele) => ele.title + ele.type == selectLeftRow) || {}
).rightArr || []"
:key="index" :key="index"
style="margin-bottom: 10px" style="margin-bottom: 10px"
class="flex-row jcsb aic" class="flex-row jcsb aic"
@ -222,7 +229,7 @@
<el-slider <el-slider
v-model="item.weight" v-model="item.weight"
:max="20" :max="20"
@change="totalWeight" @change="changeTotal"
></el-slider> ></el-slider>
<div class="flex-row jcsb scoreBox" style="margin-left: 15px"> <div class="flex-row jcsb scoreBox" style="margin-left: 15px">
<div>0%</div> <div>0%</div>
@ -259,6 +266,7 @@ export default {
taskStatus: "", taskStatus: "",
year: "", year: "",
}, },
selectLeftRow: "",
columns: [ columns: [
{ prop: "taskName", label: "任务名称" }, { prop: "taskName", label: "任务名称" },
{ prop: "peopleNumber", label: "考核人数" }, { prop: "peopleNumber", label: "考核人数" },
@ -267,7 +275,7 @@ export default {
label: "任务状态", label: "任务状态",
type: "status", type: "status",
callback: (value) => { callback: (value) => {
if (value == 1) var color = "#333"; if (value == 2) var color = "#999";
else var color = "#EA741D"; else var color = "#EA741D";
return `<span style="color: ${color}">${ return `<span style="color: ${color}">${
@ -312,8 +320,8 @@ export default {
pageSize: 10, // pageSize: 10, //
statusList: [ statusList: [
{ label: "全部", value: "" }, { label: "全部", value: "" },
{ label: "待评分", value: "0" }, { label: "进行中", value: "0" },
{ label: "已完成", value: "1" }, { label: "已过期", value: "2" },
], ],
dialogVisible1: false, dialogVisible1: false,
isEdit: false, isEdit: false,
@ -329,7 +337,7 @@ export default {
rules: { rules: {
taskName: [ taskName: [
{ required: true, message: "请输入活动名称", trigger: "blur" }, { required: true, message: "请输入活动名称", trigger: "blur" },
{ min: 1, max: 20, message: "长度在 3 到 5 个字符", trigger: "blur" }, { min: 1, max: 20, message: "长度限制20个字符", trigger: "blur" },
], ],
peopleNumberDetail: [ peopleNumberDetail: [
{ required: true, message: "请选择考核人员", trigger: "change" }, { required: true, message: "请选择考核人员", trigger: "change" },
@ -346,21 +354,12 @@ export default {
}; };
}, },
watch: { watch: {
scoreList: {
handler(newVal, oldVal) {
this.scoreList.forEach((ele) => {
ele.weight = ele.list.reduce(
(total, ele) => total + (ele.weight || 0),
0
);
});
},
deep: true,
},
dialogVisible1(newVal) { dialogVisible1(newVal) {
if (newVal) { if (newVal) {
this.$nextTick(() => { this.$nextTick(() => {
this.$refs.selectUserRef?.$refs.customTableRef?.handleCurrentChange(1); this.$refs.selectUserRef?.$refs.customTableRef?.handleCurrentChange(
1
);
}); });
} }
}, },
@ -411,7 +410,7 @@ export default {
this.currentSelectedUser.push(ele); this.currentSelectedUser.push(ele);
}); });
(this.selectRow.peopleNumberDetail || "").split(",").forEach((ele) => { (this.selectRow.peopleNumberDetail || "").split(",").forEach((ele) => {
this.currentSelectedUserName.push(ele); if (ele) this.currentSelectedUserName.push(ele);
}); });
}); });
}, },
@ -422,6 +421,9 @@ export default {
this.taskData.userIdList = data.map((ele) => ele.userId); this.taskData.userIdList = data.map((ele) => ele.userId);
this.taskData.peopleNumber = data.length; this.taskData.peopleNumber = data.length;
this.selectRow.userIdList = data.map((ele) => ele.userId); this.selectRow.userIdList = data.map((ele) => ele.userId);
this.selectRow.peopleNumberDetail = data
.map((ele) => ele.nickName)
.join(",");
}, },
handleUserClose() { handleUserClose() {
this.userSelectDialogVisible = false; this.userSelectDialogVisible = false;
@ -437,11 +439,7 @@ export default {
endTime: "", endTime: "",
peopleNumber: 0, peopleNumber: 0,
}; };
this.$nextTick(() => { this.selectRow = {};
this.$refs.selectUserRef?.$refs.customTableRef?.clearSelection();
this.$refs.selectUserRef?.$refs.customTableRef.handleCurrentChange(1);
this.currentSelectedUser = [];
});
}, },
editTask(row) { editTask(row) {
this.isEdit = true; this.isEdit = true;
@ -459,14 +457,75 @@ export default {
taskApi.getTaskSet(row.id).then((res) => { taskApi.getTaskSet(row.id).then((res) => {
let objData = {}; let objData = {};
res.data.forEach((ele) => { res.data.forEach((ele) => {
if (!objData[ele.reviewCategory]) objData[ele.reviewCategory] = []; if (!objData[ele.reviewType]) objData[ele.reviewType] = [];
objData[ele.reviewCategory].push(ele); objData[ele.reviewType].push(ele);
}); });
this.scoreList = Object.values(objData).map((ele) => ({ let arrList = {};
title: ele[0].reviewCategory, Object.keys(objData).forEach((ele) => {
list: ele, let arr = [];
weight: ele.reduce((total, ele) => (ele.weight || 0) + total, 0), objData[ele].forEach((item) => {
})); if (!arr[item.reviewCategory]) arr[item.reviewCategory] = [];
arr[item.reviewCategory].push(item);
});
arrList[ele] = arr;
});
this.scoreList = [
{
title: "组长评估绩效指标",
list: Object.keys(arrList["0"]).map((ele) => ({
title: ele,
weight: arrList["0"][ele].reduce(
(total, item) => (item.weight || 0) + total,
0
),
rightArr: arrList["0"][ele],
type: 0,
})),
weight: Object.values(arrList["0"]).reduce(
(total, item) =>
(item.reduce((total, item) => (item.weight || 0) + total, 0) ||
0) + total,
0
),
},
{
title: "个人自评绩效指标",
list: Object.keys(arrList["1"]).map((ele) => ({
title: ele,
weight: arrList["1"][ele].reduce(
(total, item) => (item.weight || 0) + total,
0
),
rightArr: arrList["1"][ele],
type: 1,
})),
weight: Object.values(arrList["1"]).reduce(
(total, item) =>
(item.reduce((total, item) => (item.weight || 0) + total, 0) ||
0) + total,
0
),
},
{
title: "系统核算绩效指标",
list: Object.keys(arrList["2"]).map((ele) => ({
title: ele,
weight: arrList["2"][ele].reduce(
(total, item) => (item.weight || 0) + total,
0
),
rightArr: arrList["2"][ele],
type: 2,
})),
weight: Object.values(arrList["2"]).reduce(
(total, item) =>
(item.reduce((total, item) => (item.weight || 0) + total, 0) ||
0) + total,
0
),
},
];
this.dialogVisible2 = true; this.dialogVisible2 = true;
}); });
@ -481,14 +540,16 @@ export default {
message: "累计权重值必须为100%,请调整后再试", message: "累计权重值必须为100%,请调整后再试",
}); });
} else { } else {
let arr = []; let examineConfigList = [];
this.scoreList this.scoreList
.map((ele) => ele.list) .map((ele) => ele.list)
.flat() .flat()
.map((ele) => ele.rightArr)
.flat()
.forEach((ele) => { .forEach((ele) => {
arr.push({ id: ele.id, weight: ele.weight }); examineConfigList.push({ id: ele.id, weight: ele.weight });
}); });
taskApi.setTaskSet(arr).then((res) => { taskApi.setTaskSet({examineConfigList,taskId:this.id}).then((res) => {
this.$message({ this.$message({
type: "success", type: "success",
message: "操作成功", message: "操作成功",
@ -516,6 +577,9 @@ export default {
}); });
}); });
}, },
selectLeft(row) {
this.selectLeftRow = row.title + row.type;
},
saveTask() { saveTask() {
this.$refs.taskFormRef.validate((valid) => { this.$refs.taskFormRef.validate((valid) => {
if (valid) { if (valid) {
@ -544,6 +608,23 @@ export default {
} }
}); });
}, },
changeTotal(data) {
this.$nextTick(() => {
this.scoreList.forEach((ele) => {
ele.list.forEach((item) => {
item.weight = item.rightArr.reduce(
(total, ele) => total + (ele.weight || 0),
0
);
});
ele.weight = ele.list.reduce(
(total, ele) => total + (ele.weight || 0),
0
);
});
});
console.log(this.scoreList, 11);
},
}, },
mounted() { mounted() {
this.getTaskList(); this.getTaskList();
@ -703,8 +784,9 @@ export default {
text-align: right; text-align: right;
} }
.leftSub { .leftSub {
padding-right: 20px; padding: 10px 20px 10px 10px;
margin-bottom: 5px; margin-bottom: 5px;
cursor: pointer;
} }
.setTitle { .setTitle {
font-weight: bold; font-weight: bold;
@ -722,4 +804,18 @@ export default {
::v-deep .el-collapse { ::v-deep .el-collapse {
border: none !important; border: none !important;
} }
.search-buttons ::v-deep .el-button {
width: 90px !important;
height: 36px;
}
::v-deep .operation-buttons .el-button {
padding: 4px 8px;
margin: 0 2px;
font-weight: 600;
font-size: 14px;
}
.selectClass {
background-color: #4096ff;
color: #fff;
}
</style> </style>