接口调试基本完成,选人多选问题

v1.2.0
‘wangjiuyun 2025-01-06 17:52:52 +08:00
parent 434a20f0a6
commit 7532d5cf47
12 changed files with 201 additions and 61 deletions

View File

@ -1,5 +1,4 @@
@use 'sass:math';
@use "sass:math";
* {
box-sizing: border-box;
@ -9,7 +8,7 @@
-webkit-user-select: text;
-ms-user-select: text;
user-select: text;
font-family: AliPuHui;
font-family: PingFang SC;
}
$lightThemColor: #3686ff;
html {
@ -105,11 +104,6 @@ body {
align-items: flex-start;
}
//
.ml10 {
margin-left: 0.1rem;
@ -179,7 +173,6 @@ body {
white-space: nowrap;
}
/* 竖向弹性盒子 */
.flex-col {
@include flex-row-vc;
@ -256,7 +249,6 @@ body {
}
}
// dialogbody,
.el-popup-parent--hidden {
width: 100% !important;
@ -286,7 +278,6 @@ body {
border-radius: 0.1rem;
}
:deep(.el-form-item__content) {
align-items: flex-start !important;
}
@ -306,7 +297,6 @@ body {
padding-right: 15px;
}
:deep(.el-button--primary:not(.is-text)) {
background-color: #5584ff !important ;
color: #fff !important;
@ -322,3 +312,9 @@ body {
:deep(.el-dialog--center .el-dialog__body) {
padding: 32px !important;
}
.search-buttons {
position: absolute;
right: 20px;
}

View File

@ -289,3 +289,5 @@
position: relative;
float: right;
}

View File

@ -12,6 +12,7 @@
@sort-change="sortChange"
:row-key="rowKey"
:height="tableHeight"
@select="selected"
>
<el-table-column
reserve-selection
@ -188,12 +189,16 @@ export default {
sortChange(data) {
this.$emit("sortChange", data);
},
selected(arr, row) {
this.$emit("selected", { arr, row });
},
},
updated() {
if (this.$refs.elTableRef && this.$refs.elTableRef.doLayout) {
this.$refs.elTableRef.doLayout();
}
},
mounted() {},
beforeDestroy() {},
};
@ -218,12 +223,17 @@ export default {
--el-table-text-align: center;
width: 100%;
flex: none;
font-weight: 600;
font-size: 14px;
}
::v-deep .el-table th {
text-align: center;
}
::v-deep .operation-column .el-button-text {
font-weight: 600 !important;
font-size: 14px !important;
}
::v-deep .el-table .cell {
text-align: center;
}
@ -249,4 +259,7 @@ export default {
::v-deep .el-table {
max-height: 99%;
}
::v-deep .el-table .el-table__body .el-table__cell {
padding: 15px 0 !important;
}
</style>

View File

@ -27,6 +27,7 @@
@selection-change="handleSelectionChange"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
@selected="selectRow"
rowKey="userId"
:rowClick="
(row) => {
@ -82,6 +83,10 @@ export default {
type: Array,
default: () => [],
},
currentSelectedUserName: {
type: Array,
default: () => [],
},
showSelection: {
type: Boolean,
default: false,
@ -142,7 +147,16 @@ export default {
this.$emit("close");
},
handleConfirm() {
this.$emit("confirm", this.selectedUsers);
if (!this.showSelection) this.$emit("confirm", this.selectedUsers);
else
this.$emit(
"confirm",
this.currentSelectedUser.map((ele, index) => ({
userId: ele,
nickName: this.currentSelectedUserName[index],
}))
);
this.handleClose();
},
handleSelectionChange(val) {
@ -164,6 +178,29 @@ export default {
this.selectedUsers = val;
}
},
selectRow({ arr, row }) {
console.log(row,22);
if (
this.currentSelectedUser.filter((ele) => ele.userId == row.userId)
.length
) {
this.currentSelectedUser = this.currentSelectedUser.filter(
(ele) => ele != row.userId
);
} else {
this.currentSelectedUser.push(row.userId);
}
if (
this.currentSelectedUserName.filter((ele) => ele == row.nickName).length
) {
this.currentSelectedUserName = this.currentSelectedUserName.filter(
(ele) => ele != row.nickName
);
} else {
this.currentSelectedUserName.push(row.nickName);
}
},
fetchUserList: async function () {
const response = await systemApi.getUserList({
pageNum: this.currentPage,
@ -230,7 +267,7 @@ export default {
this.selectedUsers = [];
this.$refs.customTableRef?.clearSelection();
} else {
this.$refs.customTableRef?.clearSelection();
// this.$refs.customTableRef?.clearSelection();
newVal.forEach((item) => {
let row = this.userData.find((ele) => ele.userId == item);
if (row)

View File

@ -181,6 +181,13 @@ export const taskApi = {
url: `/task/target/${id}`,
method: 'get',
}),
setTaskSet: (data) => request({
url: `/task/config/update`,
method: 'put',
data: data,
}),

View File

@ -46,6 +46,7 @@
size="mini"
@click="addProject"
v-hasPermi="['project:list:add']"
style="height: 36px;"
>+ 新建项目</el-button
>
</div>
@ -58,7 +59,7 @@
:show-index="true"
@size-change="handleSizeChange"
@current-change="handleCurrentChange"
tableHeight="495px"
tableHeight="510px"
ref="customTableRef"
>
<template slot="operation" slot-scope="{ row }">
@ -67,14 +68,12 @@
@click="handleEdit(row)"
type="text"
size="mini"
icon="el-icon-edit"
v-hasPermi="['project:list:eidt']"
>编辑</el-button
>
<el-button
type="text"
size="mini"
icon="el-icon-delete"
@click="handleDelete(row)"
v-hasPermi="['project:list:delete']"
>删除</el-button
@ -314,6 +313,8 @@ export default {
::v-deep .operation-buttons .el-button {
padding: 4px 8px;
margin: 0 2px;
font-weight: 600;
font-size: 14px;
}
::v-deep .operation-column {
@ -356,4 +357,8 @@ export default {
left: 50%;
transform: translate(-50%, -50%);
}
.search-buttons ::v-deep .el-button {
width: 90px !important;
height: 36px;
}
</style>

View File

@ -53,11 +53,7 @@
>
<template slot="operation" slot-scope="{ row }">
<div class="operation-buttons">
<el-button
type="text"
size="mini"
icon="el-icon-view"
@click="handleEdit(row, 0)"
<el-button type="text" size="mini" @click="handleEdit(row, 0)"
>查看详情</el-button
>
</div>
@ -139,7 +135,7 @@ export default {
handleEdit(row, edit) {
this.$router.push({
path: "/projectBank/userScoreDetail",
query: { taskId: row.taskId, examineId:row.id },
query: { taskId: row.taskId, examineId: row.id },
});
},
getTaskUserList() {
@ -251,10 +247,11 @@ export default {
.search-buttons {
white-space: nowrap;
}
::v-deep .operation-buttons .el-button {
padding: 4px 8px;
margin: 0 2px;
font-weight: 600;
font-size: 14px;
}
::v-deep .operation-column {
@ -304,4 +301,8 @@ export default {
::v-deep .el-table .cell {
text-align: center;
}
.search-buttons ::v-deep .el-button {
width: 90px !important;
height: 36px;
}
</style>

View File

@ -140,8 +140,8 @@ export default {
remark: "",
isEdit: "",
headers: [
{ label: "考核项", prop: "reviewItem", width: 300 },
{ label: "评分标准", prop: "remarks" },
{ label: "考核项", prop: "reviewItem", width: 200 },
{ label: "评分标准", prop: "remarks", width: 700 },
],
//
tableData: [
@ -196,8 +196,8 @@ export default {
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.saveData.judgeContent = res.data.examineUser.judgeContent || "";
this.saveData.manageScore = res.data.examineUser.manageScore || "";
}
});
},
@ -353,11 +353,15 @@ export default {
color: #1686d8;
}
::v-deep .el-table th {
text-align: center;
text-align: left;
font-size: 14px;
font-weight: bold;
}
::v-deep .el-table .cell {
text-align: center;
text-align: left;
font-size: 14px;
font-weight: bold;
}
.statusText {
color: #ff5722;

View File

@ -13,6 +13,7 @@
placeholder="考核人员"
readonly
@click.native="openUserSelectDialog"
style="width: 300px;"
><el-button slot="append" icon="el-icon-s-custom"></el-button
></el-input>
</el-form-item>
@ -21,6 +22,8 @@
v-model="searchForm.examineStatus"
placeholder="状态"
clearable
style="width: 300px;"
>
<el-option
v-for="item in statusList"
@ -56,14 +59,12 @@
@click="handleEdit(row, 1)"
type="text"
size="mini"
icon="el-icon-edit"
>去评分</el-button
>
<el-button
v-if="row.examineStatus == '1' || isOutData == 1"
type="text"
size="mini"
icon="el-icon-view"
@click="handleEdit(row, 0)"
>查看详情</el-button
>
@ -109,8 +110,8 @@ export default {
label: "状态",
type: "status",
callback: (value) => {
if (value == 0) var color = "#333";
else var color = "#1686d68";
if (value == 0) var color = "#EA741D";
else var color = "#999";
return `<span style="color: ${color}">${
value == 0 ? "待评分" : "已完成"
@ -256,10 +257,6 @@ export default {
white-space: nowrap;
}
::v-deep .operation-buttons .el-button {
padding: 4px 8px;
margin: 0 2px;
}
::v-deep .operation-column {
background-color: #ffffff;
@ -308,4 +305,14 @@ export default {
::v-deep .el-table .cell {
text-align: center;
}
::v-deep .operation-buttons .el-button {
padding: 4px 8px;
margin: 0 2px;
font-weight: 600;
font-size: 14px;
}
.search-buttons ::v-deep .el-button {
width: 90px !important;
height: 36px;
}
</style>

View File

@ -25,7 +25,7 @@
</div>
<div
class="action-buttons aic"
@click="viewDetails(item.id, 0)"
@click="viewDetails(item.id, 1)"
>
考核评分
<img
@ -104,7 +104,7 @@ export default {
id: id,
edit,
isNormal: true,
examineTaskId: 1,
examineTaskId: id,
reviewType: 1,
},
});

View File

@ -27,6 +27,16 @@
/>
</el-select>
</el-form-item>
<el-form-item label="任务年份" class="form-item">
<el-date-picker
v-model="searchForm.year"
type="year"
style="width: 90%"
placeholder="选择年份"
value-format="yyyy"
>
</el-date-picker>
</el-form-item>
<el-form-item class="search-buttons">
<el-button type="primary" @click="onSearch"></el-button>
<el-button @click="onReset"></el-button>
@ -34,7 +44,11 @@
</el-form>
</div>
<div class="table-actions mb10">
<el-button type="primary" size="mini" @click="addTask"
<el-button
type="primary"
size="mini"
@click="addTask"
style="height: 36px"
>+ 新增任务</el-button
>
</div>
@ -51,25 +65,17 @@
>
<template slot="operation" slot-scope="{ row }">
<div class="operation-buttons">
<el-button
@click="editTask(row)"
type="text"
size="mini"
icon="el-icon-edit"
<el-button @click="editTask(row)" type="text" size="mini"
>编辑</el-button
>
<el-button
v-if="row.taskStatus == 0"
type="text"
size="mini"
icon="el-icon-setting"
@click="setTask(row)"
>指标配置</el-button
>
<el-button
type="text"
size="mini"
icon="el-icon-delete"
@click="delTask(row)"
<el-button type="text" size="mini" @click="delTask(row)"
>删除</el-button
>
</div>
@ -79,6 +85,7 @@
<SelectUser
:dialogVisible="userSelectDialogVisible"
:currentSelectedUser="currentSelectedUser"
:currentSelectedUserName="currentSelectedUserName"
:showSelection="true"
:highligt="false"
ref="selectUserRef"
@ -132,6 +139,19 @@
>
</el-date-picker>
</el-form-item>
<el-form-item label="年份" class="form-item" prop="year">
<el-date-picker
v-model="taskData.year"
type="year"
style="width: 90%"
placeholder="选择年份"
value-format="yyyy"
:picker-options="{
disabledDate: disabledDate,
}"
>
</el-date-picker>
</el-form-item>
</el-form>
</div>
<span slot="footer" class="dialog-footer">
@ -237,6 +257,7 @@ export default {
searchForm: {
taskName: "",
taskStatus: "",
year: "",
},
columns: [
{ prop: "taskName", label: "任务名称" },
@ -247,13 +268,17 @@ export default {
type: "status",
callback: (value) => {
if (value == 1) var color = "#333";
else var color = "#1686d68";
else var color = "#EA741D";
return `<span style="color: ${color}">${
value ? "已过期" : "进行中"
}</span>`;
},
},
{
prop: "year",
label: "年份",
},
{
prop: "createTime",
label: "创建时间",
@ -282,6 +307,7 @@ export default {
total: 0,
userSelectDialogVisible: false,
currentSelectedUser: [],
currentSelectedUserName: [],
pageNum: 1, //
pageSize: 10, //
statusList: [
@ -298,6 +324,7 @@ export default {
userIdList: [],
endTime: "",
peopleNumber: 0,
year: "",
},
rules: {
taskName: [
@ -305,11 +332,12 @@ export default {
{ min: 1, max: 20, message: "长度在 3 到 5 个字符", trigger: "blur" },
],
peopleNumberDetail: [
{ required: true, message: "请选择考核人员", trigger: "blur" },
{ required: true, message: "请选择考核人员", trigger: "change" },
],
endTime: [
{ required: true, message: "请选择截止时间", trigger: "blur" },
],
year: [{ required: true, message: "请选择年份", trigger: "blur" }],
},
dialogVisible2: false,
letfValue: "",
@ -330,10 +358,10 @@ export default {
deep: true,
},
dialogVisible1(newVal) {
console.log(newVal, 111);
if (newVal) {
this.$refs.selectUserRef?.$refs.customTableRef.handleCurrentChange(1);
this.$nextTick(() => {
this.$refs.selectUserRef?.$refs.customTableRef?.handleCurrentChange(1);
});
}
},
},
@ -378,9 +406,13 @@ export default {
this.$nextTick(() => {
this.$refs.selectUserRef?.$refs.customTableRef?.clearSelection();
this.currentSelectedUser = [];
this.currentSelectedUserName = [];
(this.selectRow.userIdList || []).forEach((ele) => {
this.currentSelectedUser.push(ele);
});
(this.selectRow.peopleNumberDetail || "").split(",").forEach((ele) => {
this.currentSelectedUserName.push(ele);
});
});
},
handleUserConfirm(data) {
@ -420,6 +452,7 @@ export default {
this.taskData.peopleNumberDetail = row.peopleNumberDetail;
this.taskData.userIdList = row.userIdList;
this.taskData.endTime = row.endTime;
this.taskData.year = String(row.year);
this.selectRow = row;
},
setTask(row) {
@ -438,7 +471,32 @@ export default {
this.dialogVisible2 = true;
});
},
saveSet() {},
saveSet() {
if (
this.scoreList.reduce((total, ele) => total + (ele.weight || 0), 0) !==
100
) {
this.$message({
type: "warning",
message: "累计权重值必须为100%,请调整后再试",
});
} else {
let arr = [];
this.scoreList
.map((ele) => ele.list)
.flat()
.forEach((ele) => {
arr.push({ id: ele.id, weight: ele.weight });
});
taskApi.setTaskSet(arr).then((res) => {
this.$message({
type: "success",
message: "操作成功",
});
this.dialogVisible2 = false;
});
}
},
delTask(row) {
this.$confirm(
"删除任务及绩效数据,该操作不可逆,请谨慎操作",

View File

@ -152,6 +152,7 @@
<el-button
type="text"
v-if="projectInfo.userId == $store.state.user.id"
@click="logForm.workTime = logForm.max"
>{{ `当天剩余可分配工时:${logForm.max}人天` }}</el-button
>
</el-form-item>
@ -241,13 +242,22 @@ export default {
this.initDateColor(first);
},
initDateColor(first) {
let boxs = document.getElementsByClassName("date-cell");
for (var i = 0; i < boxs.length; i++) {
boxs[i].style = "";
}
this.logData.map((item) => {
var ele = document.getElementById(item.date.split(" ")[0]);
if (ele) {
if (item.state == -1) {
ele.style = "background:#ecf5ff";
} else {
ele.style = `background:linear-gradient(to right, #409eff ${(item.workTime||1)*100}% , #ecf5ff ${(item.workTime||1)*100}%);color:${item.workTime>0.65?'#fff':'#333'};`;
} else if (item.state == 0) {
ele.style = `background:linear-gradient(to right, #409eff ${
(item.workTime || 1) * 100
}% , #ecf5ff ${(item.workTime || 1) * 100}%);color:${
item.workTime > 0.65 ? "#fff" : "#333"
};`;
}
}
});