From e705ef7b15c04307d6f37b388564dedfaeef4a55 Mon Sep 17 00:00:00 2001
From: 张诺 <zhang_12370@163.com>
Date: 星期二, 21 四月 2026 15:27:09 +0800
Subject: [PATCH] 阳光彩印web 生产报工的机台展示
---
src/views/personnelManagement/employeeRecord/index.vue | 111 ++++++++++++++++++++++++++++++++-----------------------
1 files changed, 65 insertions(+), 46 deletions(-)
diff --git a/src/views/personnelManagement/employeeRecord/index.vue b/src/views/personnelManagement/employeeRecord/index.vue
index 19addfa..c88336a 100644
--- a/src/views/personnelManagement/employeeRecord/index.vue
+++ b/src/views/personnelManagement/employeeRecord/index.vue
@@ -21,7 +21,7 @@
<div>
<el-button type="primary" @click="openFormNewOrEditFormDia('add')">鏂板鍏ヨ亴</el-button>
<el-button @click="handleOut">瀵煎嚭</el-button>
- <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button>
+ <!-- <el-button type="danger" plain @click="handleDelete">鍒犻櫎</el-button> -->
</div>
</div>
<div class="table_list">
@@ -35,6 +35,7 @@
:tableLoading="tableLoading"
@pagination="pagination"
:total="page.total"
+ :rowClassName="rowClassName"
></PIMTable>
</div>
<show-form-dia ref="formDia" @close="handleQuery"></show-form-dia>
@@ -102,67 +103,50 @@
prop: "staffName",
},
{
+ label: "鍒悕",
+ prop: "alias",
+ },
+ {
+ label: "鎵嬫満",
+ prop: "phone",
+ width: 150,
+ },
+ {
label: "鎬у埆",
prop: "sex",
},
{
- label: "鎴风睄浣忓潃",
- prop: "nativePlace",
- },
- {
- label: "閮ㄩ棬",
- prop: "deptName",
- },
- {
- label: "宀椾綅",
- prop: "postJob",
- },
- {
- label: "鐜颁綇鍧�",
- prop: "adress",
- width:200
- },
- {
- label: "绗竴瀛﹀巻",
- prop: "firstStudy",
- },
- {
- label: "涓撲笟",
- prop: "profession",
- width:100
+ label: "鍑虹敓鏃ユ湡",
+ prop: "birthDate",
+ width: 120,
},
{
label: "骞撮緞",
prop: "age",
},
{
- label: "鑱旂郴鐢佃瘽",
- prop: "phone",
- width:150
+ label: "绫嶈疮",
+ prop: "nativePlace",
},
{
- label: "绱ф�ヨ仈绯讳汉",
- prop: "emergencyContact",
- width: 120
+ label: "姘戞棌",
+ prop: "nation",
+ width: 100,
},
{
- label: "绱ф�ヨ仈绯讳汉鐢佃瘽",
- prop: "emergencyContactPhone",
- width:150
+ label: "濠氬Щ鐘跺喌",
+ prop: "maritalStatus",
+ width: 100,
},
- // {
- // label: "鍚堝悓骞撮檺",
- // prop: "contractTerm",
- // },
- // {
- // label: "鍚堝悓寮�濮嬫棩鏈�",
- // prop: "contractStartTime",
- // width: 120
- // },
{
- label: "鍚堝悓缁撴潫鏃ユ湡",
+ label: "鍛樺伐閫氳鍦板潃",
+ prop: "contactAddress",
+ minWidth: 180,
+ },
+ {
+ label:"鍚堝悓鍒版湡鏃堕棿",
prop: "contractExpireTime",
- width: 120
+ minWidth: 120,
},
{
dataType: "action",
@@ -218,6 +202,33 @@
}
getList();
};
+
+const rowClassName = ({ row }) => {
+ const dateStr = row.contractExpireTime;
+
+ if (!dateStr) return '';
+
+ const now = new Date();
+ const target = new Date(dateStr.replace(/-/g, '/')); // 鍏煎 Safari
+
+ // 褰掗浂鏃堕棿锛堝叧閿紒锛�
+ now.setHours(0, 0, 0, 0);
+ target.setHours(0, 0, 0, 0);
+
+ const days = Math.ceil((target - now) / (1000 * 60 * 60 * 24));
+
+ console.log('鍓╀綑澶╂暟:', days);
+
+ // 瓒呰繃45澶╋細姝e父
+ if (days > 45) return '';
+
+ // 0~45澶╋細棰勮锛堜綘鍙互鎹㈤鑹诧級
+ if (days >= 0) return 'bg-warning';
+
+ // 宸茶繃鏈�
+ return 'bg-danger';
+};
+
// 鏌ヨ鍒楄〃
/** 鎼滅储鎸夐挳鎿嶄綔 */
const handleQuery = () => {
@@ -302,4 +313,12 @@
});
</script>
-<style scoped></style>
+<style scoped>
+:deep(.el-table .bg-warning > td.el-table__cell) {
+ background-color: #fdf2e3;
+}
+
+:deep(.el-table .bg-danger > td.el-table__cell) {
+ background-color: #ffe5e5;
+}
+</style>
--
Gitblit v1.9.3