除指标配置,调试基本完成

v1.2.0
‘wangjiuyun 2025-01-06 12:35:35 +08:00
parent 43492eb5d2
commit 434a20f0a6
7 changed files with 251 additions and 116 deletions

View File

@ -120,7 +120,6 @@ export default {
}, },
], ],
userData: [], userData: [],
customTableRef: null,
isInternalChange: false, isInternalChange: false,
}; };
}, },
@ -231,8 +230,11 @@ export default {
this.selectedUsers = []; this.selectedUsers = [];
this.$refs.customTableRef?.clearSelection(); this.$refs.customTableRef?.clearSelection();
} else { } else {
newVal.forEach((ele) => { this.$refs.customTableRef?.clearSelection();
this.$refs.customTableRef?.toggleRowSelection(ele, true); newVal.forEach((item) => {
let row = this.userData.find((ele) => ele.userId == item);
if (row)
this.$refs.customTableRef?.toggleRowSelection(row, true);
}); });
} }
} }
@ -252,6 +254,11 @@ export default {
this.selectedUsers = [row]; this.selectedUsers = [row];
this.$refs.customTableRef?.setCurrentRow(row); this.$refs.customTableRef?.setCurrentRow(row);
} }
} else {
this.currentSelectedUser.forEach((item) => {
let row = newVal.find((ele) => ele.userId == item);
if (row) this.$refs.customTableRef?.toggleRowSelection(row, true);
});
} }
}); });
}, },

View File

@ -59,6 +59,7 @@
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
tableHeight="495px" tableHeight="495px"
ref="customTableRef"
> >
<template slot="operation" slot-scope="{ row }"> <template slot="operation" slot-scope="{ row }">
<div class="operation-buttons"> <div class="operation-buttons">
@ -193,6 +194,7 @@ export default {
this.searchForm[key] = ""; this.searchForm[key] = "";
}); });
this.currentSelectedUser = []; this.currentSelectedUser = [];
this.$refs.customTableRef.handleCurrentChange(1);
this.fetchProjectList(); this.fetchProjectList();
}, },
addProject() { addProject() {

View File

@ -4,10 +4,8 @@
<div style="margin-bottom: 20px">人员绩效表</div> <div style="margin-bottom: 20px">人员绩效表</div>
<el-tree <el-tree
:data="deptOptions" :data="deptOptions"
:props="defaultProps"
:expand-on-click-node="false" :expand-on-click-node="false"
:filter-node-method="filterNode" ref="treeRef"
ref="tree"
node-key="id" node-key="id"
default-expand-all default-expand-all
highlight-current highlight-current
@ -22,7 +20,23 @@
class="demo-form-inline" class="demo-form-inline"
size="small" size="small"
> >
<el-form-item label="统计任务" class="form-item"> </el-form-item> <el-form-item label="统计任务" class="form-item">
<el-select
v-model="taskId"
placeholder="选择任务"
@change="getTaskUserList"
>
<el-option
v-for="item in taskList"
:key="item.id"
:label="item.taskName"
:value="item.id"
/>
</el-select>
</el-form-item>
<el-form-item class="search-buttons">
<el-button @click="onReset"></el-button>
</el-form-item>
</el-form> </el-form>
</div> </div>
<div class="f1 df"> <div class="f1 df">
@ -35,6 +49,7 @@
@size-change="handleSizeChange" @size-change="handleSizeChange"
@current-change="handleCurrentChange" @current-change="handleCurrentChange"
tableHeight="495px" tableHeight="495px"
@sortChange="sortChange"
> >
<template slot="operation" slot-scope="{ row }"> <template slot="operation" slot-scope="{ row }">
<div class="operation-buttons"> <div class="operation-buttons">
@ -56,7 +71,7 @@
<script> <script>
import CustomTable from "@/components/CustomTable.vue"; import CustomTable from "@/components/CustomTable.vue";
import SelectUser from "@/components/SelectUser.vue"; import SelectUser from "@/components/SelectUser.vue";
import { projectApi, systemApi } from "@/utils/api"; import { taskApi } from "@/utils/api";
import { deptTreeSelect } from "@/api/system/user"; import { deptTreeSelect } from "@/api/system/user";
export default { export default {
@ -67,21 +82,26 @@ export default {
data() { data() {
return { return {
deptOptions: undefined, deptOptions: undefined,
taskId: "",
searchForm: { searchForm: {
projectName: "", userIdList: [],
userName: "",
isAsc: "",
}, },
columns: [ columns: [
{ prop: "projectName", label: "考核人员" }, { prop: "userName", label: "考核人员" },
{ prop: "projectCode", label: "考核评分", sortable: true }, { prop: "manageScore", label: "考核评分", sortable: "custom" },
{ {
prop: "projectState", prop: "examineStatus",
label: "状态", label: "状态",
type: "status", type: "status",
callback: (value) => { callback: (value) => {
if (value == 1) var color = "#333"; if (value == 0) var color = "#333";
else var color = "#1686d68"; else var color = "#1686d68";
return `<span style="color: ${color}">${value}</span>`; return `<span style="color: ${color}">${
value == 0 ? "待评分" : "已完成"
}</span>`;
}, },
}, },
{ {
@ -96,33 +116,39 @@ export default {
currentSelectedUser: [], currentSelectedUser: [],
pageNum: 1, // pageNum: 1, //
pageSize: 10, // pageSize: 10, //
statusList: [ taskList: [],
{ label: "全部", value: "" },
{ label: "待评分", value: "0" },
{ label: "已完成", value: "1" },
],
}; };
}, },
methods: { methods: {
onSearch() { onSearch() {
this.fetchProjectList(); this.getTaskUserList();
}, },
onReset() { onReset() {
Object.keys(this.searchForm).forEach((key) => { Object.keys(this.searchForm).forEach((key) => {
this.searchForm[key] = ""; this.searchForm[key] = "";
}); });
this.fetchProjectList(); this.$refs.treeRef.setCurrentKey(null);
// this.searchForm.taskId = this.taskList[0]?.id;
this.getTaskUserList();
},
handleNodeClick(data) {
this.searchForm.deptId = data.id;
this.getTaskUserList();
}, },
handleEdit(row, edit) { handleEdit(row, edit) {
this.$router.push({ this.$router.push({
path: "/projectBank/userScoreDetail", path: "/projectBank/userScoreDetail",
query: { id: row.id, edit }, query: { taskId: row.taskId, examineId:row.id },
}); });
}, },
fetchProjectList() { getTaskUserList() {
projectApi if (!this.taskId) return;
.listProject({ taskApi
.getTaskUserList({
...this.searchForm, ...this.searchForm,
taskId: this.taskId,
pageNum: this.pageNum, pageNum: this.pageNum,
pageSize: this.pageSize, pageSize: this.pageSize,
}) })
@ -131,25 +157,41 @@ export default {
this.total = res.total; this.total = res.total;
}); });
}, },
getTaskList() {
taskApi
.getTaskList({
pageNum: 1,
pageSize: 100000,
})
.then((res) => {
this.taskList = res.rows;
this.taskId = res.rows[0]?.id;
this.getTaskUserList();
});
},
handleSizeChange(size) { handleSizeChange(size) {
this.pageSize = size; this.pageSize = size;
this.pageNum = 1; // this.pageNum = 1; //
this.fetchProjectList(); this.getTaskUserList();
}, },
handleCurrentChange(page) { handleCurrentChange(page) {
this.pageNum = page; this.pageNum = page;
this.fetchProjectList(); this.getTaskUserList();
}, },
getDeptTree() { getDeptTree() {
deptTreeSelect().then((response) => { deptTreeSelect().then((response) => {
this.deptOptions = response.data; this.deptOptions = response.data;
}); });
}, },
sortChange({ order }) {
this.searchForm.isAsc =
order == "descending" ? "desc" : order == "ascending" ? "asc" : "";
this.getTaskUserList();
},
}, },
mounted() { mounted() {
this.getDeptTree(); this.getDeptTree();
this.getTaskList();
this.fetchProjectList();
}, },
}; };
</script> </script>

View File

@ -2,44 +2,49 @@
<div class="conetentBox"> <div class="conetentBox">
<div class="flex-row jcsb aic userBox"> <div class="flex-row jcsb aic userBox">
<div> <div>
<el-form <el-form :inline="true" class="demo-form-inline" size="small">
:inline="true"
:model="searchForm"
class="demo-form-inline"
size="small"
>
<el-form-item label="考核人员" class="form-item"> <el-form-item label="考核人员" class="form-item">
<el-input <el-select
v-model="searchForm.userName" v-model="examineId"
placeholder="考核人员" placeholder="请选择"
readonly @change="userChange"
@click.native="openUserSelectDialog" >
><el-button slot="append" icon="el-icon-s-custom"></el-button <el-option
></el-input> v-for="item in userList"
:key="item.id"
:label="item.userName"
:value="item.id"
>
</el-option>
</el-select>
</el-form-item> </el-form-item>
<el-form-item label="考核任务" class="form-item"> <el-form-item label="考核任务" class="form-item">
<el-select v-model="searchForm.taskId" placeholder="请选择"> <el-select
v-model="examineTaskId"
placeholder="请选择"
@change="getUserList"
>
<el-option <el-option
v-for="item in taskList" v-for="item in taskList"
:key="item.value" :key="item.id"
:label="item.label" :label="item.taskName"
:value="item.value" :value="item.id"
> >
</el-option> </el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
</el-form> </el-form>
</div> </div>
<div>考核评分</div> <div>考核评分{{ score }}</div>
</div> </div>
<el-tabs v-model="activeName" type="card" @tab-click="handleClick"> <el-tabs v-model="activeName" type="card">
<el-tab-pane label="组长评估" name="first"> <el-tab-pane label="组长评估" name="first">
<div <div
v-for="(table, index) in tableData" v-for="(table, index) in tableData1"
:key="index" :key="index"
style="margin-bottom: 20px" style="margin-bottom: 20px"
> >
<div class="userBox">表格 {{ index + 1 }}</div> <div class="userBox">{{ table[0].reviewCategory }}</div>
<el-table :data="table" style="width: 100%"> <el-table :data="table" style="width: 100%">
<el-table-column <el-table-column
v-for="(header, hIndex) in headers" v-for="(header, hIndex) in headers"
@ -57,10 +62,12 @@
v-model="scope.row.score" v-model="scope.row.score"
:min="0" :min="0"
:max="10" :max="10"
@change="updateScore(scope.row)" disabled
></el-slider> ></el-slider>
</div> </div>
<div class="statusText">未打分</div> <div class="statusText" v-show="scope.row.score == 0">
未打分
</div>
<div class="flex-row jcsb" style="margin-left: 10px"> <div class="flex-row jcsb" style="margin-left: 10px">
<div>0</div> <div>0</div>
@ -80,7 +87,7 @@
type="textarea" type="textarea"
:autosize="{ minRows: 4 }" :autosize="{ minRows: 4 }"
placeholder="0/300" placeholder="0/300"
v-model="managerText" v-model="judgeContent"
readonly readonly
> >
</el-input> </el-input>
@ -89,11 +96,11 @@
></el-tab-pane> ></el-tab-pane>
<el-tab-pane label="个人自评" name="second"> <el-tab-pane label="个人自评" name="second">
<div <div
v-for="(table, index) in tableData" v-for="(table, index) in tableData2"
:key="index" :key="index"
style="margin-bottom: 20px" style="margin-bottom: 20px"
> >
<div class="userBox">表格 {{ index + 1 }}</div> <div class="userBox">表格 {{ table[0].reviewCategory }}</div>
<el-table :data="table" style="width: 100%"> <el-table :data="table" style="width: 100%">
<el-table-column <el-table-column
v-for="(header, hIndex) in headers" v-for="(header, hIndex) in headers"
@ -111,10 +118,12 @@
v-model="scope.row.score" v-model="scope.row.score"
:min="0" :min="0"
:max="10" :max="10"
@change="updateScore(scope.row)" disabled
></el-slider> ></el-slider>
</div> </div>
<div class="statusText">未打分</div> <div class="statusText" v-show="scope.row.score == 0">
未打分
</div>
<div class="flex-row jcsb" style="margin-left: 10px"> <div class="flex-row jcsb" style="margin-left: 10px">
<div>0</div> <div>0</div>
@ -128,11 +137,20 @@
<template slot-scope="scope"> <template slot-scope="scope">
<div> <div>
<el-button <el-button
v-if="scope.row.remark"
@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 }"
>{{ scope.row.remark ? "查看" : "未填写" }}</el-button >查看</el-button
>
<el-button
v-if="!scope.row.remark"
type="text"
size="mini"
:class="{ hasEdit: !scope.row.remark }"
>未填写</el-button
> >
</div> </div>
</template> </template>
@ -158,80 +176,96 @@
<el-button @click="dialogVisible = false">关闭</el-button> <el-button @click="dialogVisible = false">关闭</el-button>
</span> </span>
</el-dialog> </el-dialog>
<SelectUser
:dialogVisible="userSelectDialogVisible"
:currentSelectedUser="currentSelectedUser"
:showSelection="true"
:highligt="false"
@confirm="handleUserConfirm"
@close="handleUserClose"
/>
</div> </div>
</template> </template>
<script> <script>
import SelectUser from "@/components/SelectUser.vue"; import { taskApi } from "@/utils/api";
export default { export default {
components: {
SelectUser,
},
data() { data() {
return { return {
taskId: "", examineTaskId: "",
isNormal: false, examineId: "",
userList: [],
dialogVisible: false, dialogVisible: false,
saveStatus: "",
remark: "", remark: "",
headers: [ headers: [
{ label: "考核项", prop: "name", width: 300 }, { label: "考核项", prop: "reviewItem", width: 300 },
{ label: "评分标准", prop: "description" }, { label: "评分标准", prop: "remarks" },
], ],
// //
tableData: [ tableData1: [],
[ tableData2: [],
{ name: "项目1", description: "描述1", score: 0, remark: "ss" }, taskList: [],
{ name: "项目2", description: "描述2", score: 0, remark: "" }, judgeContent: "",
], score: "",
[
{ name: "项目3", description: "描述3", score: 0, remark: "" },
{ name: "项目4", description: "描述4", score: 0, remark: "ss" },
],
//
],
taskList: [{ label: "任务1", value: 1 }],
managerText: "",
searchForm: {
userName: "",
userId: "",
taskId: "",
},
activeName: "first", activeName: "first",
userSelectDialogVisible: false,
currentSelectedUser: [],
}; };
}, },
methods: { methods: {
updateScore(row) {
//
console.log(`项目: ${row.name}, 评分: ${row.score}`);
},
handleEdit(row) { handleEdit(row) {
this.dialogVisible = true; this.dialogVisible = true;
this.remark = row.remark; this.remark = row.remark;
}, },
openUserSelectDialog() {
this.userSelectDialogVisible = true; getTaskList() {
taskApi
.getTaskList({
pageNum: 1,
pageSize: 100000,
})
.then((res) => {
this.taskList = res.rows;
this.$nextTick(() => {
this.examineTaskId = Number(this.$route.query.taskId);
this.getUserList();
});
});
}, },
handleUserConfirm(data) { getUserList() {
this.searchForm.userName = data.map((ele) => ele.nickName); if (!this.examineTaskId) return;
this.searchForm.userId = data.map((ele) => ele.userId); taskApi
.getTaskUserList({
taskId: this.examineTaskId,
pageNum: 1,
pageSize: 100000,
})
.then((res) => {
this.userList = res.rows;
this.$nextTick(() => {
this.examineId = Number(this.$route.query.examineId);
this.getSocreDetail(0);
this.getSocreDetail(1);
});
});
}, },
handleUserClose() { userChange() {
this.userSelectDialogVisible = false; this.getSocreDetail(0);
this.getSocreDetail(1);
},
//
getSocreDetail(type) {
let param = {
examineTaskId: this.examineTaskId,
reviewType: type,
examineId: this.examineId,
};
taskApi.getTaskScoreDetail(param).then((res) => {
let objData = {};
res.data.examineConfigDetailVoList.forEach((ele) => {
if (!objData[ele.reviewCategory]) objData[ele.reviewCategory] = [];
objData[ele.reviewCategory].push(ele);
});
if (type == 0) this.tableData1 = Object.values(objData);
else this.tableData2 = Object.values(objData);
this.judgeContent = res.data.examineUser.judgeContent;
this.score = res.data.examineUser.score;
});
}, },
}, },
created() {}, created() {
this.getTaskList();
},
}; };
</script> </script>
@ -261,6 +295,14 @@ export default {
border-radius: 20px; border-radius: 20px;
background-color: #ff5722; background-color: #ff5722;
} }
::v-deep .el-slider__runway.disabled .el-slider__bar {
background-color: #ff5722;
}
::v-deep .el-slider__bar {
height: 20px;
border-radius: 20px;
background-color: #ff5722;
}
::v-deep .el-slider__button { ::v-deep .el-slider__button {
display: none; display: none;
} }
@ -286,4 +328,9 @@ export default {
::v-deep .el-dialog { ::v-deep .el-dialog {
margin-top: 15% !important; margin-top: 15% !important;
} }
::v-deep .el-tab-pane {
height: 600px;
overflow: auto;
}
</style> </style>

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="appraisal-manager"> <div class="appraisal-manager">
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName">
<el-tab-pane label="进行中" name="进行中"> <el-tab-pane label="进行中" name="进行中">
<div class="assessment-container flex-row"> <div class="assessment-container flex-row">
<div v-for="item in taskList['0']" :key="item.id" class="taskBox"> <div v-for="item in taskList['0']" :key="item.id" class="taskBox">

View File

@ -1,6 +1,6 @@
<template> <template>
<div class="appraisal-manager"> <div class="appraisal-manager">
<el-tabs v-model="activeName" @tab-click="handleClick"> <el-tabs v-model="activeName">
<el-tab-pane label="进行中" name="进行中"> <el-tab-pane label="进行中" name="进行中">
<div class="assessment-container flex-row"> <div class="assessment-container flex-row">
<div v-for="item in taskList['0']" :key="item.id" class="taskBox"> <div v-for="item in taskList['0']" :key="item.id" class="taskBox">

View File

@ -81,6 +81,7 @@
:currentSelectedUser="currentSelectedUser" :currentSelectedUser="currentSelectedUser"
:showSelection="true" :showSelection="true"
:highligt="false" :highligt="false"
ref="selectUserRef"
@confirm="handleUserConfirm" @confirm="handleUserConfirm"
@close="handleUserClose" @close="handleUserClose"
/> />
@ -125,6 +126,9 @@
style="width: 90%" style="width: 90%"
placeholder="选择日期" placeholder="选择日期"
value-format="yyyy-MM-dd 23:59:59" value-format="yyyy-MM-dd 23:59:59"
:picker-options="{
disabledDate: disabledDate,
}"
> >
</el-date-picker> </el-date-picker>
</el-form-item> </el-form-item>
@ -142,7 +146,7 @@
<el-collapse <el-collapse
v-model="letfValue" v-model="letfValue"
:accordion="true" :accordion="true"
style="height: 300px;overflow: auto;" style="height: 300px; overflow: auto"
> >
<el-collapse-item <el-collapse-item
v-for="(item, index) in scoreList" v-for="(item, index) in scoreList"
@ -212,7 +216,7 @@
</div> </div>
<span slot="footer" class="dialog-footer"> <span slot="footer" class="dialog-footer">
<el-button @click="dialogVisible2 = false">取消</el-button> <el-button @click="dialogVisible2 = false">取消</el-button>
<el-button type="primary" @click="save"></el-button> <el-button type="primary" @click="saveSet"></el-button>
</span> </span>
</el-dialog> </el-dialog>
</div> </div>
@ -310,6 +314,7 @@ export default {
dialogVisible2: false, dialogVisible2: false,
letfValue: "", letfValue: "",
scoreList: [], scoreList: [],
selectRow: {},
}; };
}, },
watch: { watch: {
@ -324,6 +329,13 @@ export default {
}, },
deep: true, deep: true,
}, },
dialogVisible1(newVal) {
console.log(newVal, 111);
if (newVal) {
this.$refs.selectUserRef?.$refs.customTableRef.handleCurrentChange(1);
}
},
}, },
methods: { methods: {
onSearch() { onSearch() {
@ -335,6 +347,11 @@ export default {
}); });
this.getTaskList(); this.getTaskList();
}, },
disabledDate(date) {
const startDate = new Date().getTime(); //
return new Date(date).getTime() + 60 * 60 * 24 * 1000 < startDate; //
},
getTaskList() { getTaskList() {
taskApi taskApi
.getTaskList({ .getTaskList({
@ -358,6 +375,13 @@ export default {
}, },
openUserSelectDialog() { openUserSelectDialog() {
this.userSelectDialogVisible = true; this.userSelectDialogVisible = true;
this.$nextTick(() => {
this.$refs.selectUserRef?.$refs.customTableRef?.clearSelection();
this.currentSelectedUser = [];
(this.selectRow.userIdList || []).forEach((ele) => {
this.currentSelectedUser.push(ele);
});
});
}, },
handleUserConfirm(data) { handleUserConfirm(data) {
this.taskData.peopleNumberDetail = data this.taskData.peopleNumberDetail = data
@ -365,6 +389,7 @@ export default {
.join(","); .join(",");
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);
}, },
handleUserClose() { handleUserClose() {
this.userSelectDialogVisible = false; this.userSelectDialogVisible = false;
@ -372,6 +397,19 @@ export default {
addTask() { addTask() {
this.isEdit = false; this.isEdit = false;
this.dialogVisible1 = true; this.dialogVisible1 = true;
this.taskData = {
id: "",
taskName: "",
peopleNumberDetail: "",
userIdList: [],
endTime: "",
peopleNumber: 0,
};
this.$nextTick(() => {
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;
@ -381,10 +419,8 @@ export default {
this.taskData.peopleNumber = row.peopleNumber; this.taskData.peopleNumber = row.peopleNumber;
this.taskData.peopleNumberDetail = row.peopleNumberDetail; this.taskData.peopleNumberDetail = row.peopleNumberDetail;
this.taskData.userIdList = row.userIdList; this.taskData.userIdList = row.userIdList;
this.currentSelectedUser = []; this.taskData.endTime = row.endTime;
(row.userIdList || []).forEach((ele) => { this.selectRow = row;
this.currentSelectedUser.push(ele);
});
}, },
setTask(row) { setTask(row) {
taskApi.getTaskSet(row.id).then((res) => { taskApi.getTaskSet(row.id).then((res) => {
@ -402,6 +438,7 @@ export default {
this.dialogVisible2 = true; this.dialogVisible2 = true;
}); });
}, },
saveSet() {},
delTask(row) { delTask(row) {
this.$confirm( this.$confirm(
"删除任务及绩效数据,该操作不可逆,请谨慎操作", "删除任务及绩效数据,该操作不可逆,请谨慎操作",