From 258156413b3d6f5a16342d3d28620af72e859e97 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期四, 30 十月 2025 16:16:54 +0800
Subject: [PATCH] 查询条件中有关时间的不要赋值默认日期
---
src/views/personnelManagement/employeeRecord/index.vue | 33 ++++++++++++++++++++++++++++-----
1 files changed, 28 insertions(+), 5 deletions(-)
diff --git a/src/views/personnelManagement/employeeRecord/index.vue b/src/views/personnelManagement/employeeRecord/index.vue
index af2dca8..d0801fd 100644
--- a/src/views/personnelManagement/employeeRecord/index.vue
+++ b/src/views/personnelManagement/employeeRecord/index.vue
@@ -11,6 +11,9 @@
clearable
:prefix-icon="Search"
/>
+ <span style="margin-left: 10px" class="search_title">鍚堝悓缁撴潫鏃ユ湡锛�</span>
+ <el-date-picker v-model="searchForm.entryDate" value-format="YYYY-MM-DD" format="YYYY-MM-DD" type="daterange"
+ placeholder="璇烽�夋嫨" clearable @change="changeDaterange" />
<el-button type="primary" @click="handleQuery" style="margin-left: 10px"
>鎼滅储</el-button
>
@@ -31,7 +34,7 @@
@selection-change="handleSelectionChange"
:tableLoading="tableLoading"
@pagination="pagination"
- :total="total"
+ :total="page.total"
></PIMTable>
</div>
<form-dia ref="formDia" @close="handleQuery"></form-dia>
@@ -44,10 +47,14 @@
import FormDia from "@/views/personnelManagement/employeeRecord/components/formDia.vue";
import {ElMessageBox} from "element-plus";
import {staffOnJobListPage} from "@/api/personnelManagement/employeeRecord.js";
+import dayjs from "dayjs";
const data = reactive({
searchForm: {
staffName: "",
+ entryDate: undefined, // 褰曞叆鏃ユ湡
+ entryDateStart: undefined,
+ entryDateEnd: undefined,
},
});
const { searchForm } = toRefs(data);
@@ -98,6 +105,7 @@
{
label: "瀹跺涵浣忓潃",
prop: "adress",
+ width:200
},
{
label: "绗竴瀛﹀巻",
@@ -106,10 +114,12 @@
{
label: "涓撲笟",
prop: "profession",
+ width:100
},
{
label: "韬唤璇佸彿",
prop: "identityCard",
+ width:200
},
{
label: "骞撮緞",
@@ -118,6 +128,7 @@
{
label: "鑱旂郴鐢佃瘽",
prop: "phone",
+ width:150
},
{
label: "绱ф�ヨ仈绯讳汉",
@@ -125,8 +136,9 @@
width: 120
},
{
- label: "鑱旂郴鐢佃瘽",
+ label: "绱ф�ヨ仈绯讳汉鐢佃瘽",
prop: "emergencyContactPhone",
+ width:150
},
{
label: "鍚堝悓骞撮檺",
@@ -164,11 +176,20 @@
const page = reactive({
current: 1,
size: 100,
+ total: 0
});
-const total = ref(0);
const formDia = ref()
const { proxy } = getCurrentInstance()
+const changeDaterange = (value) => {
+ searchForm.value.entryDateStart = undefined;
+ searchForm.value.entryDateEnd = undefined;
+ if (value) {
+ searchForm.value.entryDateStart = dayjs(value[0]).format("YYYY-MM-DD");
+ searchForm.value.entryDateEnd = dayjs(value[1]).format("YYYY-MM-DD");
+ }
+ getList();
+};
// 鏌ヨ鍒楄〃
/** 鎼滅储鎸夐挳鎿嶄綔 */
const handleQuery = () => {
@@ -182,10 +203,12 @@
};
const getList = () => {
tableLoading.value = true;
- staffOnJobListPage({...page, ...searchForm.value, staffState: 1}).then(res => {
+ const params = { ...searchForm.value, ...page };
+ params.entryDate = undefined
+ staffOnJobListPage({...params, staffState: 1}).then(res => {
tableLoading.value = false;
tableData.value = res.data.records
- total.value = res.data.total;
+ page.total = res.data.total;
}).catch(err => {
tableLoading.value = false;
})
--
Gitblit v1.9.3