From b0e6a3324bcc0e073c4f864cb537e1725685b0c5 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期五, 09 十月 2026 21:10:20 +0800
Subject: [PATCH] 天津-奇缘恒艺 1.录数据需求修改
---
src/views/personnelManagement/contractManagement/index.vue | 74 +++++++++++++++++++------------------
1 files changed, 38 insertions(+), 36 deletions(-)
diff --git a/src/views/personnelManagement/contractManagement/index.vue b/src/views/personnelManagement/contractManagement/index.vue
index d6abdb3..458952a 100644
--- a/src/views/personnelManagement/contractManagement/index.vue
+++ b/src/views/personnelManagement/contractManagement/index.vue
@@ -5,9 +5,6 @@
<span class="search_title">濮撳悕锛�</span>
<el-input v-model="searchForm.staffName" style="width: 240px" placeholder="璇疯緭鍏ュ鍚嶆悳绱�" @change="handleQuery"
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>
</div>
<div>
@@ -20,7 +17,14 @@
<div class="table_list">
<PIMTable rowKey="id" :column="tableColumn" :tableData="tableData" :page="page" :isSelection="true"
@selection-change="handleSelectionChange" :tableLoading="tableLoading" @pagination="pagination"
- :total="page.total"></PIMTable>
+ :total="page.total">
+ <template #age="{ row }">
+ <span>{{ calcAge(row.birthDate) }}</span>
+ </template>
+ <template #contractTime="{ row }">
+ <span>{{ formatContractTime(row) }}</span>
+ </template>
+ </PIMTable>
</div>
<form-dia ref="formDia" @close="handleQuery"></form-dia>
<renew-contract
@@ -77,20 +81,17 @@
<script setup>
import { Search } from "@element-plus/icons-vue";
+import dayjs from "dayjs";
import { onMounted, ref, defineAsyncComponent } from "vue";
import FormDia from "@/views/personnelManagement/contractManagement/components/formDia.vue";
const RenewContract = defineAsyncComponent(() => import("@/views/personnelManagement/employeeRecord/components/RenewContract.vue"));
import { ElMessageBox } from "element-plus";
import { staffOnJobListPage } from "@/api/personnelManagement/staffOnJob.js";
-import dayjs from "dayjs";
import { getToken } from "@/utils/auth.js";
import FilesDia from "./filesDia.vue";
const data = reactive({
searchForm: {
staffName: "",
- entryDate: null, // 褰曞叆鏃ユ湡
- entryDateStart: undefined,
- entryDateEnd: undefined,
},
});
const { searchForm } = toRefs(data);
@@ -131,8 +132,10 @@
prop: "sex",
},
{
- label: "鎴风睄浣忓潃",
- prop: "nativePlace",
+ label: "骞撮緞",
+ prop: "age",
+ dataType: "slot",
+ slot: "age",
},
// {
// label: "宀椾綅",
@@ -144,22 +147,16 @@
// width: 200
// },
{
- label: "绗竴瀛﹀巻",
- prop: "firstStudy",
- },
- {
- label: "涓撲笟",
- prop: "profession",
- width: 100
- },
- {
- label: "骞撮緞",
- prop: "age",
- },
- {
label: "鑱旂郴鐢佃瘽",
prop: "phone",
width: 150
+ },
+ {
+ label: "鍚堝悓鏃堕棿",
+ prop: "contractTime",
+ dataType: "slot",
+ slot: "contractTime",
+ width: 200,
},
// {
// label: "绱ф�ヨ仈绯讳汉",
@@ -180,11 +177,6 @@
// prop: "contractStartTime",
// width: 120
// },
- {
- label: "鍚堝悓缁撴潫鏃ユ湡",
- prop: "contractExpireTime",
- width: 120
- },
{
dataType: "action",
label: "鎿嶄綔",
@@ -225,15 +217,26 @@
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");
+// 鏍规嵁鍑虹敓鏃ユ湡璁$畻骞撮緞
+const calcAge = (birth) => {
+ if (!birth) return "-";
+ const birthDay = dayjs(birth);
+ const now = dayjs();
+ let age = now.year() - birthDay.year();
+ if (now.month() < birthDay.month() || (now.month() === birthDay.month() && now.date() < birthDay.date())) {
+ age--;
}
- getList();
+ return age;
};
+
+// 鍚堝悓鏃堕棿锛堝紑濮� ~ 缁撴潫锛�
+const formatContractTime = (row) => {
+ const start = row.contractStartTime;
+ const end = row.contractEndTime;
+ if (start && end) return `${start} ~ ${end}`;
+ return start || end || "-";
+};
+
// 鎵撳紑闄勪欢寮规
const openFilesFormDia = (row) => {
console.log(row)
@@ -255,7 +258,6 @@
const getList = () => {
tableLoading.value = true;
const params = { ...searchForm.value, ...page };
- params.entryDate = undefined
params.staffState = 1
staffOnJobListPage(params).then(res => {
tableLoading.value = false;
--
Gitblit v1.9.3