任务设置问题修改

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;
right: 20px;
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 1000 B

View File

@ -179,7 +179,6 @@ export default {
}
},
selectRow({ arr, row }) {
console.log(row,22);
if (
this.currentSelectedUser.filter((ele) => ele.userId == row.userId)
@ -200,6 +199,8 @@ export default {
} else {
this.currentSelectedUserName.push(row.nickName);
}
console.log(this.currentSelectedUserName,22);
},
fetchUserList: async function () {
const response = await systemApi.getUserList({

View File

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

View File

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

View File

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

View File

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

View File

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