From baddb052ccd4a91ef1881ba663e6a4e55b05f4fb Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期三, 14 十月 2026 15:51:55 +0800
Subject: [PATCH] feat(hrm): 社保公积金方案表单加「适用部门」与默认缴费基数,修比例输入精度

---
 src/views/hrm/leave/index.vue |   72 +++++++++++++++++++++++++++++++++--
 1 files changed, 67 insertions(+), 5 deletions(-)

diff --git a/src/views/hrm/leave/index.vue b/src/views/hrm/leave/index.vue
index 029edf5..d088fc2 100644
--- a/src/views/hrm/leave/index.vue
+++ b/src/views/hrm/leave/index.vue
@@ -2,14 +2,20 @@
 import type { VxeTableGridOptions } from '#/adapter/vxe-table';
 import type { HrmLeaveApi } from '#/api/hrm/leave';
 
+import { ref } from 'vue';
+
 import { Page, useVbenModal } from '#/packages/effects/common-ui/src';
 
-import { message } from 'ant-design-vue';
+import { message, Modal, Select, Tag } from 'ant-design-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 {
   cancelLeave,
   deleteLeave,
+  getLeaveApproveProcessDefinitionList,
   getLeavePage,
   submitLeave,
 } from '#/api/hrm/leave';
@@ -58,11 +64,34 @@
   }
 }
 
-/** 鎻愪氦璇峰亣鐢宠 */
+const submitModalVisible = ref(false);
+const currentRow = ref<HrmLeaveApi.Leave>();
+const processList = ref<HrmLeaveApi.ApproveProcess[]>([]);
+const selectedProcessKey = ref<string>();
+const submitLoading = ref(false);
+
+/** 鎻愪氦璇峰亣鐢宠锛堝厛閫夋嫨瀹℃壒娴佺▼锛� */
 async function handleSubmit(row: HrmLeaveApi.Leave) {
-  await submitLeave(row.id!);
-  message.success('鎻愪氦鎴愬姛');
-  handleRefresh();
+  processList.value = await getLeaveApproveProcessDefinitionList();
+  currentRow.value = row;
+  selectedProcessKey.value = undefined;
+  submitModalVisible.value = true;
+}
+
+async function confirmSubmit() {
+  if (!selectedProcessKey.value) {
+    message.warning('璇烽�夋嫨璇峰亣瀹℃壒娴佺▼');
+    return;
+  }
+  submitLoading.value = true;
+  try {
+    await submitLeave(currentRow.value!.id!, selectedProcessKey.value);
+    message.success('鎻愪氦鎴愬姛');
+    submitModalVisible.value = false;
+    handleRefresh();
+  } finally {
+    submitLoading.value = false;
+  }
 }
 
 /** 鎾ら攢璇峰亣鐢宠 */
@@ -70,6 +99,20 @@
   await cancelLeave(row.id!);
   message.success('鎾ら攢鎴愬姛');
   handleRefresh();
+}
+
+/** 璇峰亣绫诲瀷棰滆壊 */
+function getLeaveTypeColor(type: number): string {
+  switch (type) {
+    case 1: return 'green';      // 骞村亣
+    case 2: return 'orange';     // 浜嬪亣
+    case 3: return 'red';        // 鐥呭亣
+    case 4: return 'purple';     // 濠氬亣
+    case 5: return 'cyan';       // 浜у亣
+    case 6: return 'magenta';    // 涓у亣
+    case 7: return 'geekblue';   // 璋冧紤
+    default: return 'default';
+  }
 }
 
 const [Grid, gridApi] = useVbenVxeGrid({
@@ -119,6 +162,11 @@
           ]"
         />
       </template>
+      <template #leaveType="{ row }">
+        <Tag :color="getLeaveTypeColor(row.leaveType)">
+          {{ getDictLabel(DICT_TYPE.HRM_LEAVE_TYPE, row.leaveType) }}
+        </Tag>
+      </template>
       <template #actions="{ row }">
         <TableAction
           :actions="[
@@ -165,5 +213,19 @@
         />
       </template>
     </Grid>
+    <Modal
+      v-model:open="submitModalVisible"
+      title="鎻愪氦鑷冲崗鍚屽姙鍏�"
+      width="420px"
+      :confirm-loading="submitLoading"
+      @ok="confirmSubmit"
+    >
+      <Select
+        v-model:value="selectedProcessKey"
+        class="w-full"
+        placeholder="璇烽�夋嫨璇峰亣瀹℃壒娴佺▼"
+        :options="processList.map((item) => ({ label: item.name, value: item.key }))"
+      />
+    </Modal>
   </Page>
 </template>
\ No newline at end of file

--
Gitblit v1.9.3