From 2cb77a3487b8c5da6fe02f3c1018dcf70f73d29a Mon Sep 17 00:00:00 2001
From: tuqin <tuqin@tuqin.cn>
Date: 星期一, 19 十月 2026 10:25:22 +0800
Subject: [PATCH] feat(hrm): 社保公积金方案新增大病医疗/长期护理(输入支持两位小数)
---
src/views/hrm/employee/contract/index.vue | 8 +-
src/views/hrm/salary/social-security-scheme/index.vue | 12 ++++
src/views/hrm/salary/social-security-scheme/modules/form.vue | 4 +
src/views/hrm/salary/social-security-scheme/data.ts | 94 +++++++++++++++++++++++++++++++
src/api/hrm/salary/social-security-scheme/index.ts | 8 ++
5 files changed, 122 insertions(+), 4 deletions(-)
diff --git a/src/api/hrm/salary/social-security-scheme/index.ts b/src/api/hrm/salary/social-security-scheme/index.ts
index 4b1c69a..fcd385c 100644
--- a/src/api/hrm/salary/social-security-scheme/index.ts
+++ b/src/api/hrm/salary/social-security-scheme/index.ts
@@ -16,6 +16,14 @@
unemploymentPersonalRatio?: number;
workInjuryRatio?: number;
maternityRatio?: number;
+ /** 澶х梾鍖荤枟浼佷笟缂寸撼姣斾緥 */
+ seriousIllnessCompanyRatio?: number;
+ /** 澶х梾鍖荤枟涓汉缂寸撼姣斾緥 */
+ seriousIllnessPersonalRatio?: number;
+ /** 闀挎湡鎶ょ悊浼佷笟缂寸撼姣斾緥 */
+ longTermCareCompanyRatio?: number;
+ /** 闀挎湡鎶ょ悊涓汉缂寸撼姣斾緥 */
+ longTermCarePersonalRatio?: number;
housingFundCompanyRatio?: number;
housingFundPersonalRatio?: number;
status?: number;
diff --git a/src/views/hrm/employee/contract/index.vue b/src/views/hrm/employee/contract/index.vue
index 9df95ec..53c329f 100644
--- a/src/views/hrm/employee/contract/index.vue
+++ b/src/views/hrm/employee/contract/index.vue
@@ -5,7 +5,7 @@
import { Page, useVbenModal } from '#/packages/effects/common-ui/src';
import { downloadFileFromBlobPart } from '#/packages/utils/src';
-import { DownOutlined } from '@ant-design/icons-vue';
+import { IconifyIcon } from '@vben/icons';
import { Button, Dropdown, Menu, message, Modal, Tag } from 'ant-design-vue';
import { ACTION_ICON, TableAction, useVbenVxeGrid } from '#/adapter/vxe-table';
@@ -202,7 +202,7 @@
<template #toolbar-tools>
<Dropdown>
<Button class="mr-2" type="primary">
- 涓嬭浇鍚堝悓妯℃澘 <DownOutlined />
+ 涓嬭浇鍚堝悓妯℃澘 <IconifyIcon class="size-3" icon="lucide:chevron-down" />
</Button>
<template #overlay>
<Menu @click="({ key }) => handleDownloadTemplate(Number(key))">
@@ -234,7 +234,7 @@
</template>
<template #actions="{ row }">
<Dropdown>
- <a class="text-primary" @click.prevent>鐢熸垚鍚堝悓 <DownOutlined /></a>
+ <a class="text-primary" @click.prevent>鐢熸垚鍚堝悓 <IconifyIcon class="size-3" icon="lucide:chevron-down" /></a>
<template #overlay>
<Menu @click="({ key }) => handleGenerate(row, Number(key))">
<Menu.Item key="1">鍔冲姩鍚堝悓锛堢畝鐗堬級</Menu.Item>
@@ -245,7 +245,7 @@
</Dropdown>
<a class="ml-3 text-primary" @click="handleAttachments(row)">闄勪欢</a>
<Dropdown>
- <a class="ml-3 text-primary" @click.prevent>鏇村 <DownOutlined /></a>
+ <a class="ml-3 text-primary" @click.prevent>鏇村 <IconifyIcon class="size-3" icon="lucide:chevron-down" /></a>
<template #overlay>
<Menu @click="(e) => handleMore(e, row)">
<Menu.Item key="edit">淇敼</Menu.Item>
diff --git a/src/views/hrm/salary/social-security-scheme/data.ts b/src/views/hrm/salary/social-security-scheme/data.ts
index 2e363b8..9a14da2 100644
--- a/src/views/hrm/salary/social-security-scheme/data.ts
+++ b/src/views/hrm/salary/social-security-scheme/data.ts
@@ -16,6 +16,18 @@
};
}
+/** 鏍煎紡鍖栨瘮渚嬭緭鍏ワ紙鏄剧ず涓や綅灏忔暟锛屽 0.50%锛� */
+function createRatioFormatter2() {
+ return {
+ formatter: (value: number) =>
+ value !== undefined && value !== null ? `${(value * 100).toFixed(2)}%` : '',
+ parser: (value: string) => {
+ const num = parseFloat(value.replace('%', ''));
+ return isNaN(num) ? 0 : num / 100;
+ },
+ };
+}
+
/** 鏂板/淇敼绀句繚鍏Н閲戞柟妗堢殑琛ㄥ崟 */
export function useFormSchema(): VbenFormSchema[] {
return [
@@ -200,6 +212,76 @@
...createRatioFormatter(0.001),
},
},
+ // 澶х梾鍖荤枟
+ {
+ fieldName: 'divider_serious_illness',
+ label: '澶х梾鍖荤枟',
+ component: 'Divider',
+ formItemClass: 'col-span-2',
+ },
+ {
+ fieldName: 'seriousIllnessCompanyRatio',
+ label: '浼佷笟姣斾緥',
+ component: 'InputNumber',
+ componentProps: {
+ placeholder: '浼佷笟缂寸撼姣斾緥',
+ min: 0,
+ max: 1,
+ step: 0.0001,
+ precision: 4,
+ style: { width: '100%' },
+ ...createRatioFormatter2(),
+ },
+ },
+ {
+ fieldName: 'seriousIllnessPersonalRatio',
+ label: '涓汉姣斾緥',
+ component: 'InputNumber',
+ componentProps: {
+ placeholder: '涓汉缂寸撼姣斾緥',
+ min: 0,
+ max: 1,
+ step: 0.0001,
+ precision: 4,
+ style: { width: '100%' },
+ ...createRatioFormatter2(),
+ },
+ },
+ // 闀挎湡鎶ょ悊
+ {
+ fieldName: 'divider_long_term_care',
+ label: '闀挎湡鎶ょ悊',
+ component: 'Divider',
+ formItemClass: 'col-span-2',
+ },
+ {
+ fieldName: 'longTermCareCompanyRatio',
+ label: '浼佷笟姣斾緥',
+ component: 'InputNumber',
+ componentProps: {
+ placeholder: '浼佷笟缂寸撼姣斾緥',
+ min: 0,
+ max: 1,
+ step: 0.0001,
+ precision: 4,
+ style: { width: '100%' },
+ ...createRatioFormatter2(),
+ },
+ },
+ {
+ fieldName: 'longTermCarePersonalRatio',
+ label: '涓汉姣斾緥',
+ component: 'InputNumber',
+ componentProps: {
+ placeholder: '涓汉缂寸撼姣斾緥',
+ min: 0,
+ max: 1,
+ step: 0.0001,
+ precision: 4,
+ style: { width: '100%' },
+ ...createRatioFormatter2(),
+ },
+ },
// 鍏Н閲�
{
fieldName: 'divider_housing',
@@ -307,6 +389,18 @@
slots: { default: 'housingFundPersonalRatio' },
},
{
+ field: 'seriousIllnessPersonalRatio',
+ title: '澶х梾鍖荤枟(涓汉)',
+ width: 120,
+ slots: { default: 'seriousIllnessPersonalRatio' },
+ },
+ {
+ field: 'longTermCarePersonalRatio',
+ title: '闀挎湡鎶ょ悊(涓汉)',
+ width: 120,
+ slots: { default: 'longTermCarePersonalRatio' },
+ },
+ {
field: 'status',
title: '鐘舵��',
width: 80,
diff --git a/src/views/hrm/salary/social-security-scheme/index.vue b/src/views/hrm/salary/social-security-scheme/index.vue
index 65c71b5..c5dd5c7 100644
--- a/src/views/hrm/salary/social-security-scheme/index.vue
+++ b/src/views/hrm/salary/social-security-scheme/index.vue
@@ -49,6 +49,12 @@
return `${(ratio * 100).toFixed(1)}%`;
}
+/** 鏍煎紡鍖栨瘮渚嬫樉绀猴紙淇濈暀涓や綅灏忔暟锛� */
+function formatRatio2(ratio: number | undefined) {
+ if (ratio === undefined || ratio === null) return '-';
+ return `${(ratio * 100).toFixed(2)}%`;
+}
+
const [Grid, gridApi] = useVbenVxeGrid({
formOptions: {
schema: useGridFormSchema(),
@@ -107,6 +113,12 @@
<template #housingFundPersonalRatio="{ row }">
{{ formatRatio(row.housingFundPersonalRatio) }}
</template>
+ <template #seriousIllnessPersonalRatio="{ row }">
+ {{ formatRatio2(row.seriousIllnessPersonalRatio) }}
+ </template>
+ <template #longTermCarePersonalRatio="{ row }">
+ {{ formatRatio2(row.longTermCarePersonalRatio) }}
+ </template>
<template #status="{ row }">
<Tag :color="row.status === 0 ? 'success' : 'default'">
{{ row.status === 0 ? '鍚敤' : '绂佺敤' }}
diff --git a/src/views/hrm/salary/social-security-scheme/modules/form.vue b/src/views/hrm/salary/social-security-scheme/modules/form.vue
index 9611251..b6937f2 100644
--- a/src/views/hrm/salary/social-security-scheme/modules/form.vue
+++ b/src/views/hrm/salary/social-security-scheme/modules/form.vue
@@ -81,6 +81,10 @@
maternityRatio: 0.005,
housingFundCompanyRatio: 0.12,
housingFundPersonalRatio: 0.12,
+ seriousIllnessCompanyRatio: 0,
+ seriousIllnessPersonalRatio: 0,
+ longTermCareCompanyRatio: 0,
+ longTermCarePersonalRatio: 0,
status: 0,
});
return;
--
Gitblit v1.9.3