From 5cd5a5baa076377f3136338db7a9336d0d570d33 Mon Sep 17 00:00:00 2001
From: tuqin <tuqin@tuqin.cn>
Date: 星期六, 24 十月 2026 19:47:33 +0800
Subject: [PATCH] feat(hrm): 前端同步新疆中亿装配的人力资源模块
---
src/views/hrm/employee/index.vue | 48 +++++++++++++++++++++++++++++++++++++++++++++---
1 files changed, 45 insertions(+), 3 deletions(-)
diff --git a/src/views/hrm/employee/index.vue b/src/views/hrm/employee/index.vue
index 9f5cb70..57f2d62 100644
--- a/src/views/hrm/employee/index.vue
+++ b/src/views/hrm/employee/index.vue
@@ -5,15 +5,15 @@
import { Page, useVbenModal } from '#/packages/effects/common-ui/src';
import { downloadFileFromBlobPart } from '#/packages/utils/src';
-import { Button, message, Progress, Tag } from 'ant-design-vue';
+import { Button, message, Progress, Tag, Alert } from 'ant-design-vue';
-import { ref } from 'vue';
+import { onMounted, ref } from 'vue';
import { DICT_TYPE } from '#/packages/constants/src';
import { getDictLabel } from '#/packages/effects/hooks/src';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
-import { deleteEmployee, exportEmployee, getEmployeePage } from '#/api/hrm/employee';
+import { deleteEmployee, exportEmployee, getEmployeePage, getRegularizeReminders, regularizeEmployee } from '#/api/hrm/employee';
import { $t } from '#/locales';
import { useGridColumns, useGridFormSchema } from './data';
@@ -116,6 +116,26 @@
importModalApi.open();
}
+/** 寰呰浆姝f彁閱掓暟 */
+const regularizeCount = ref(0);
+async function refreshRegularizeReminders() {
+ try {
+ const list = await getRegularizeReminders(7);
+ regularizeCount.value = list?.length ?? 0;
+ } catch {
+ regularizeCount.value = 0;
+ }
+}
+onMounted(refreshRegularizeReminders);
+
+/** 鍛樺伐杞锛堜粎鍔冲姩鍚堝悓鍙浆姝o級 */
+async function handleRegularize(row: HrmEmployeeApi.Employee) {
+ await regularizeEmployee(row.id!);
+ message.success(`銆�${row.name}銆戝凡杞`);
+ handleRefresh();
+ refreshRegularizeReminders();
+}
+
const [Grid, gridApi] = useVbenVxeGrid({
formOptions: {
schema: useGridFormSchema(),
@@ -150,6 +170,13 @@
<Page auto-content-height>
<ImportModal @success="handleRefresh" />
<FormModal @success="handleRefresh" />
+ <Alert
+ v-if="regularizeCount > 0"
+ class="mb-3"
+ :message="`寰呰浆姝f彁閱掞細鏈� ${regularizeCount} 鍚嶅憳宸ヨ瘯鐢ㄦ湡鍗冲皢鍒版湡锛岃鍙婃椂杞`"
+ show-icon
+ type="warning"
+ />
<Grid table-title="鍛樺伐鍒楄〃">
<template #toolbar-tools>
<TableAction
@@ -191,6 +218,11 @@
{{ getDictLabel(DICT_TYPE.HRM_EMPLOYEE_STATUS, row.employeeStatus) }}
</Tag>
</template>
+ <template #employeeCategory="{ row }">
+ <Tag :color="row.employeeCategory === 2 ? 'orange' : row.employeeCategory === 3 ? 'purple' : 'blue'">
+ {{ getDictLabel(DICT_TYPE.HRM_EMPLOYEE_CATEGORY, row.employeeCategory) }}
+ </Tag>
+ </template>
<template #actions="{ row }">
<TableAction
:actions="[
@@ -202,6 +234,16 @@
onClick: handleEdit.bind(null, row),
},
{
+ label: '杞',
+ type: 'link',
+ auth: ['hrm:employee:update'],
+ ifShow: () => row.employeeStatus === 2,
+ popConfirm: {
+ title: `纭灏嗐��${row.name}銆戣浆姝e悧锛燂紙浠呭姵鍔ㄥ悎鍚屽彲杞锛屼笉鍚皟宀楋級`,
+ confirm: handleRegularize.bind(null, row),
+ },
+ },
+ {
label: $t('common.delete'),
type: 'link',
danger: true,
--
Gitblit v1.9.3