From aae0b49229d8798a2cc31a8449092e2db62e2407 Mon Sep 17 00:00:00 2001
From: zouyu <2723363702@qq.com>
Date: 星期四, 26 三月 2026 11:26:41 +0800
Subject: [PATCH] 绩效管理:人员考勤功能模块
---
src/views/performance/class/index.vue | 85 +++++++++++++++++-------------------------
1 files changed, 35 insertions(+), 50 deletions(-)
diff --git a/src/views/performance/class/index.vue b/src/views/performance/class/index.vue
index ca34134..f6c52f0 100644
--- a/src/views/performance/class/index.vue
+++ b/src/views/performance/class/index.vue
@@ -265,10 +265,26 @@
<span style="color: red; margin-right: 4px">*</span>浜哄憳鍚嶇О锛�
</div>
<div class="search_input" style="width: calc(100% - 90px)">
- <el-select v-model="schedulingQuery.userId" placeholder="璇烽�夋嫨" style="width: 100%" multiple clearable
- collapse-tags>
- <el-option v-for="item in personList" :key="item.id" :label="item.name" :value="item.id">
- </el-option>
+ <el-select v-model="schedulingQuery.userId" popper-class="select-with-all" placeholder="璇烽�夋嫨" style="width: 100%" multiple collapse-tags clearable>
+<!-- <el-option v-for="item in personList" :key="item.id" :label="item.name" :value="item.id">-->
+<!-- </el-option>-->
+ <template slot="prefix">
+ <el-button
+ type="text"
+ size="mini"
+ @click="handleSelectAll"
+ style="margin: 4px 0;"
+ >
+ {{ isAllSelected ? '鍙栨秷鍏ㄩ��' : '鍏ㄩ��' }}
+ </el-button>
+ <el-divider style="margin: 5px 0;" />
+ </template>
+ <el-option
+ v-for="item in personList"
+ :key="item.id"
+ :label="item.name"
+ :value="item.id"
+ />
</el-select>
</div>
</div>
@@ -378,7 +394,7 @@
loading: false,
schedulingQuery: {
week: "",
- userId: null,
+ userId: [],
shift: "",
},
list: [],
@@ -399,6 +415,11 @@
menuY: 0,
selectedTarget: null,
};
+ },
+ computed:{
+ isAllSelected() {
+ return this.schedulingQuery.userId.length === this.personList.length && this.personList.length > 0;
+ },
},
watch: {
@@ -423,6 +444,14 @@
document.removeEventListener('click', this.handleClickOutside)
},
methods: {
+ handleSelectAll() {
+ if (this.isAllSelected) {
+ this.schedulingQuery.userId = [];
+ } else {
+ // 鍙�変腑鍙敤閫夐」鐨剉alue
+ this.schedulingQuery.userId = this.personList.map(item => item.id);
+ }
+ },
handleContextMenu(target,e) {
// 闃绘娴忚鍣ㄩ粯璁ゅ彸閿彍鍗�
e.preventDefault()
@@ -526,40 +555,6 @@
this.initYear();
}
},
- transFromNumber(num) {
- let changeNum = [
- "闆�",
- "涓�",
- "浜�",
- "涓�",
- "鍥�",
- "浜�",
- "鍏�",
- "涓�",
- "鍏�",
- "涔�",
- ]; //changeNum[0] = "闆�"
- let unit = ["", "鍗�", "鐧�", "鍗�", "涓�"];
- num = parseInt(num);
- let getWan = (temp) => {
- let strArr = temp.toString().split("").reverse();
- let newNum = "";
- for (var i = 0; i < strArr.length; i++) {
- newNum =
- (i == 0 && strArr[i] == 0
- ? ""
- : i > 0 && strArr[i] == 0 && strArr[i - 1] == 0
- ? ""
- : changeNum[strArr[i]] + (strArr[i] == 0 ? unit[0] : unit[i])) +
- newNum;
- }
- return newNum;
- };
- let overWan = Math.floor(num / 10000);
- let noWan = num % 10000;
- if (noWan.toString().length < 4) noWan = "0" + noWan;
- return overWan ? getWan(overWan) + "涓�" + getWan(noWan) : getWan(num);
- },
init() {
this.pageLoading = true;
let year = this.query.year.getFullYear();
@@ -574,16 +569,6 @@
}).then((res) => {
this.pageLoading = false;
this.list = res.data.page
- // this.list = res.data.page.map((item) => {
- // for (let key in item.monthlyAttendance) {
- // let type = this.getDayByDic(key);
- // if (type != undefined || type != null) {
- // item[`day${type}`] = item.monthlyAttendance[key];
- // }
- // }
- // return item;
- // });
- console.log(this.list)
let headerList = res.data.headerList;
this.weeks = [];
headerList.forEach((item) => {
@@ -649,7 +634,7 @@
this.schedulingVisible = false;
this.schedulingQuery = {
week: "",
- userId: null,
+ userId: [],
shift: "",
};
this.refresh();
--
Gitblit v1.9.3