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

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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