From 8bf28ea0550212ecf77a7c8a135bea36f89c742f Mon Sep 17 00:00:00 2001
From: tuqin <tuqin@tuqin.cn>
Date: 星期三, 28 十月 2026 09:46:48 +0800
Subject: [PATCH] feat(hrm): 薪酬核算新增全勤奖与实出天数;考勤记录支持按时间段导出

---
 src/api/hrm/salary/calculation/index.ts           |    4 ++
 src/views/hrm/salary/calculation/data.ts          |   10 +++--
 src/views/hrm/salary/calculation/modules/form.vue |    1 
 src/views/hrm/salary/calculation/index.vue        |   28 +++++++++++++
 src/views/hrm/attendance/record/index.vue         |   23 +++++++++--
 5 files changed, 57 insertions(+), 9 deletions(-)

diff --git a/src/api/hrm/salary/calculation/index.ts b/src/api/hrm/salary/calculation/index.ts
index 8c19dd6..d37208c 100644
--- a/src/api/hrm/salary/calculation/index.ts
+++ b/src/api/hrm/salary/calculation/index.ts
@@ -22,6 +22,10 @@
     mealAllowance?: number;
     transportAllowance?: number;
     otherAllowance?: number;
+    /** 鍏ㄥ嫟濂� */
+    fullAttendanceBonus?: number;
+    /** 瀹炲嚭澶╂暟锛堝彇鑷�冨嫟姹囨�伙級 */
+    actualDays?: number;
     socialSecurityDeduction?: number;
     housingFundDeduction?: number;
     taxDeduction?: number;
diff --git a/src/views/hrm/attendance/record/index.vue b/src/views/hrm/attendance/record/index.vue
index 6aabd6c..1cb6e60 100644
--- a/src/views/hrm/attendance/record/index.vue
+++ b/src/views/hrm/attendance/record/index.vue
@@ -40,10 +40,25 @@
   importModalApi.open();
 }
 
-/** 瀵煎嚭鑰冨嫟璁板綍 */
+/** 鎶婃悳绱㈣〃鍗曠殑鏃ユ湡鑼冨洿鎷嗘垚鍚庣璁よ瘑鐨� startDate / endDate */
+function buildQueryParams(formValues?: Record<string, any>) {
+  const { date, ...rest } = formValues ?? {};
+  const [startDate, endDate] = Array.isArray(date) ? date : [];
+  return {
+    ...rest,
+    ...(startDate ? { startDate } : {}),
+    ...(endDate ? { endDate } : {}),
+  };
+}
+
+/** 瀵煎嚭鑰冨嫟璁板綍锛堟寜褰撳墠鎼滅储鏉′欢锛屽惈鏃ユ湡鏃堕棿娈碉級 */
 async function handleExport() {
-  const data = await exportAttendanceRecord(await gridApi.formApi.getValues());
-  downloadFileFromBlobPart({ fileName: '鑰冨嫟璁板綍.xls', source: data });
+  const params = buildQueryParams(await gridApi.formApi.getValues());
+  const data = await exportAttendanceRecord(params);
+  const suffix = params.startDate && params.endDate
+    ? `_${params.startDate}_${params.endDate}`
+    : '';
+  downloadFileFromBlobPart({ fileName: `鑰冨嫟璁板綍${suffix}.xls`, source: data });
 }
 
 const [Grid, gridApi] = useVbenVxeGrid({
@@ -60,7 +75,7 @@
           await getAttendanceRecordPage({
             pageNo: page.currentPage,
             pageSize: page.pageSize,
-            ...formValues,
+            ...buildQueryParams(formValues),
           }),
       },
     },
diff --git a/src/views/hrm/salary/calculation/data.ts b/src/views/hrm/salary/calculation/data.ts
index 2f8ce82..0c0667a 100644
--- a/src/views/hrm/salary/calculation/data.ts
+++ b/src/views/hrm/salary/calculation/data.ts
@@ -87,15 +87,16 @@
     { field: 'mealAllowance', title: '椁愯ˉ', width: 110, slots: { default: 'editableCell' } },
     { field: 'transportAllowance', title: '浜ら�氳ˉ璐�', width: 110, slots: { default: 'editableCell' } },
     { field: 'otherAllowance', title: '鍏朵粬琛ヨ创', width: 110, slots: { default: 'editableCell' } },
+    { field: 'fullAttendanceBonus', title: '鍏ㄥ嫟濂�', width: 110, slots: { default: 'editableCell' } },
     { field: 'socialSecurityDeduction', title: '绀句繚鎵f', width: 120, slots: { default: 'editableCell' } },
     { field: 'housingFundDeduction', title: '鍏Н閲戞墸娆�', width: 120, slots: { default: 'editableCell' } },
     { field: 'taxDeduction', title: '涓◣鎵f', width: 120, slots: { default: 'editableCell' } },
     { field: 'otherDeduction', title: '鍏朵粬鎵f', width: 110, slots: { default: 'editableCell' } },
     { field: 'leaveDeduction', title: '璇峰亣鎵f', width: 120, slots: { default: 'editableCell' } },
     { field: 'actualSalary', title: '瀹炲彂宸ヨ祫', width: 110, formatter: 'formatAmount2' },
-    { field: 'workDays', title: '鍑哄嫟澶╂暟', width: 110, slots: { default: 'editableCell' } },
+    { field: 'workDays', title: '搴斿嚭澶╂暟', width: 110, slots: { default: 'editableCell' } },
+    { field: 'actualDays', title: '瀹炲嚭澶╂暟', width: 110, slots: { default: 'editableCell' } },
     { field: 'overtimeHours', title: '鍔犵彮鏃堕暱(h)', width: 120, slots: { default: 'editableCell' } },
-    { field: 'totalWorkHours', title: '鎺掔彮宸ユ椂(h)', width: 110 },
     {
       field: 'status',
       title: '鐘舵��',
@@ -129,14 +130,15 @@
     { title: '椁愯ˉ', dataIndex: 'mealAllowance', width: 100 },
     { title: '浜ら�氳ˉ璐�', dataIndex: 'transportAllowance', width: 100 },
     { title: '鍏朵粬琛ヨ创', dataIndex: 'otherAllowance', width: 100 },
+    { title: '鍏ㄥ嫟濂�', dataIndex: 'fullAttendanceBonus', width: 100 },
     { title: '绀句繚鎵f', dataIndex: 'socialSecurityDeduction', width: 110 },
     { title: '鍏Н閲戞墸娆�', dataIndex: 'housingFundDeduction', width: 110 },
     { title: '涓◣鎵f', dataIndex: 'taxDeduction', width: 110 },
     { title: '鍏朵粬鎵f', dataIndex: 'otherDeduction', width: 100 },
     { title: '璇峰亣鎵f', dataIndex: 'leaveDeduction', width: 110 },
-    { title: '鍑哄嫟澶╂暟', dataIndex: 'workDays', width: 90 },
+    { title: '搴斿嚭澶╂暟', dataIndex: 'workDays', width: 90 },
+    { title: '瀹炲嚭澶╂暟', dataIndex: 'actualDays', width: 90 },
     { title: '鍔犵彮鏃堕暱', dataIndex: 'overtimeHours', width: 100 },
-    { title: '鎺掔彮宸ユ椂(h)', dataIndex: 'totalWorkHours', width: 100 },
     { title: '瀹炲彂宸ヨ祫', dataIndex: 'actualSalary', width: 100, fixed: 'right' },
   ];
 }
diff --git a/src/views/hrm/salary/calculation/index.vue b/src/views/hrm/salary/calculation/index.vue
index 4729973..ae28b78 100644
--- a/src/views/hrm/salary/calculation/index.vue
+++ b/src/views/hrm/salary/calculation/index.vue
@@ -102,8 +102,12 @@
 
 /** 璁$畻瀹炲彂宸ヨ祫 */
 function calculateActualSalary(record: HrmSalaryCalculationApi.SalaryCalculation) {
+  // 鏀跺叆椤瑰繀椤讳笌鍚庣 calcActualSalary 淇濇寔涓�鑷达紝鍚﹀垯棰勮/淇濆瓨鐨勫疄鍙戦噾棰濅細涓庡悗绔噸绠楃粨鏋滀笉涓�鑷�
   const income = (record.baseSalary || 0) +
+    (record.postSalary || 0) +
+    (record.senioritySalary || 0) +
     (record.performanceSalary || 0) +
+    (record.fullAttendanceBonus || 0) +
     (record.overtimePay || 0) +
     (record.mealAllowance || 0) +
     (record.transportAllowance || 0) +
@@ -113,7 +117,7 @@
     (record.taxDeduction || 0) +
     (record.otherDeduction || 0) +
     (record.leaveDeduction || 0);
-  return income - deduction;
+  return Number((income - deduction).toFixed(2));
 }
 
 /** 鏇存柊琛屾暟鎹苟璁$畻瀹炲彂宸ヨ祫 */
@@ -256,12 +260,14 @@
   'mealAllowance',
   'transportAllowance',
   'otherAllowance',
+  'fullAttendanceBonus',
   'socialSecurityDeduction',
   'housingFundDeduction',
   'taxDeduction',
   'otherDeduction',
   'leaveDeduction',
   'workDays',
+  'actualDays',
   'overtimeHours',
 ];
 
@@ -497,6 +503,16 @@
               @change="(val: number) => updateFieldValue(record, 'housingFundDeduction', val)"
             />
           </template>
+          <template v-else-if="column.dataIndex === 'fullAttendanceBonus'">
+            <InputNumber
+              v-model:value="record.fullAttendanceBonus"
+              :min="0"
+              :precision="2"
+              size="small"
+              style="width: 90px"
+              @change="(val: number) => updateFieldValue(record, 'fullAttendanceBonus', val)"
+            />
+          </template>
           <template v-else-if="column.dataIndex === 'taxDeduction'">
             <InputNumber
               v-model:value="record.taxDeduction"
@@ -540,6 +556,16 @@
               style="width: 70px"
             />
           </template>
+          <template v-else-if="column.dataIndex === 'actualDays'">
+            <InputNumber
+              v-model:value="record.actualDays"
+              :min="0"
+              :max="31"
+              :precision="0"
+              size="small"
+              style="width: 70px"
+            />
+          </template>
           <template v-else-if="column.dataIndex === 'overtimeHours'">
             <InputNumber
               v-model:value="record.overtimeHours"
diff --git a/src/views/hrm/salary/calculation/modules/form.vue b/src/views/hrm/salary/calculation/modules/form.vue
index a3af255..96f4729 100644
--- a/src/views/hrm/salary/calculation/modules/form.vue
+++ b/src/views/hrm/salary/calculation/modules/form.vue
@@ -24,6 +24,7 @@
   { key: 'mealAllowance', label: '椁愯ˉ' },
   { key: 'transportAllowance', label: '浜ら�氳ˉ璐�' },
   { key: 'otherAllowance', label: '鍏朵粬琛ヨ创' },
+  { key: 'fullAttendanceBonus', label: '鍏ㄥ嫟濂�' },
 ];
 
 /** 鎵i櫎椤� */

--
Gitblit v1.9.3