From 173855b299e89930b5ea2ff9a9295fde9d0f55b5 Mon Sep 17 00:00:00 2001
From: gaoluyang <2820782392@qq.com>
Date: 星期六, 07 十一月 2026 08:51:43 +0800
Subject: [PATCH] feat: 同步质检、生产、销售、财务与人事前端功能
---
src/views/hrm/employee/modules/social-security-list.vue | 129 ++++++------------------------------------
1 files changed, 19 insertions(+), 110 deletions(-)
diff --git a/src/views/hrm/employee/modules/social-security-list.vue b/src/views/hrm/employee/modules/social-security-list.vue
index f3eb352..f000295 100644
--- a/src/views/hrm/employee/modules/social-security-list.vue
+++ b/src/views/hrm/employee/modules/social-security-list.vue
@@ -1,94 +1,36 @@
<script lang="ts" setup>
-import type { FormType } from './form.vue';
import type { HrmEmployeeSocialSecurityApi } from '#/api/hrm/salary/employee-social-security';
-import { ref, computed, watch } from 'vue';
+import { ref, watch } from 'vue';
-import { useVbenModal } from '#/packages/effects/common-ui/src';
+import { Alert, Table, Tag } from 'ant-design-vue';
-import { message, Table, Tag, Button } from 'ant-design-vue';
-
-import { ACTION_ICON, TableAction } from '#/adapter/vxe-table';
-import {
- createEmployeeSocialSecurity,
- deleteEmployeeSocialSecurity,
- getEmployeeSocialSecurityListByUser,
- updateEmployeeSocialSecurity,
-} from '#/api/hrm/salary/employee-social-security';
-import { getSocialSecuritySchemeList } from '#/api/hrm/salary/social-security-scheme';
-import { $t } from '#/locales';
-
-import SocialSecurityForm from './social-security-form.vue';
+import { getEmployeeSocialSecurityListByDept } from '#/api/hrm/salary/employee-social-security';
const props = defineProps<{
- employeeId?: number;
- userId?: number;
- formType?: FormType;
+ deptId?: number;
}>();
-const emit = defineEmits(['refresh']);
-
const list = ref<HrmEmployeeSocialSecurityApi.EmployeeSocialSecurity[]>([]);
-const schemeList = ref<any[]>([]);
const loading = ref(false);
-const [FormModal, formModalApi] = useVbenModal({
- connectedComponent: SocialSecurityForm,
- destroyOnClose: true,
-});
-
-/** 鍒锋柊鍒楄〃 */
+/** 鍔犺浇鍛樺伐鎵�鍦ㄩ儴闂ㄧ殑绀句繚鍏Н閲戞。妗堬紙鎸夐儴闂ㄥ叡鐢紝姝ゅ鍙锛� */
async function handleRefresh() {
- if (!props.userId) return;
+ if (!props.deptId) {
+ list.value = [];
+ return;
+ }
loading.value = true;
try {
- list.value = await getEmployeeSocialSecurityListByUser(props.userId);
+ list.value = await getEmployeeSocialSecurityListByDept(props.deptId);
} finally {
loading.value = false;
}
- emit('refresh');
}
-/** 鏂板妗f */
-function handleCreate() {
- formModalApi.setData({
- formType: 'create',
- userId: props.userId,
- schemeList: schemeList.value,
- }).open();
-}
-
-/** 缂栬緫妗f */
-function handleEdit(row: HrmEmployeeSocialSecurityApi.EmployeeSocialSecurity) {
- formModalApi.setData({
- formType: 'update',
- id: row.id,
- userId: props.userId,
- schemeList: schemeList.value,
- }).open();
-}
-
-/** 鍒犻櫎妗f */
-async function handleDelete(row: HrmEmployeeSocialSecurityApi.EmployeeSocialSecurity) {
- await deleteEmployeeSocialSecurity(row.id!);
- message.success($t('ui.actionMessage.deleteSuccess', ['绀句繚鍏Н閲戞。妗�']));
- handleRefresh();
-}
-
-/** 鑾峰彇鏂规鍒楄〃 */
-async function getSchemeList() {
- schemeList.value = await getSocialSecuritySchemeList({ status: 0 });
-}
-
-/** 鐩戝惉 userId 鍙樺寲 */
watch(
- () => props.userId,
- (val) => {
- if (val) {
- handleRefresh();
- getSchemeList();
- }
- },
+ () => props.deptId,
+ () => handleRefresh(),
{ immediate: true },
);
@@ -103,29 +45,18 @@
width: 80,
key: 'status',
},
- {
- title: '鎿嶄綔',
- key: 'action',
- width: 150,
- fixed: 'right',
- },
];
-
-const isDetail = computed(() => props.formType === 'detail');
</script>
<template>
<div class="social-security-list">
- <FormModal @success="handleRefresh" />
+ <Alert
+ message="绀句繚鍏Н閲戞。妗堟寜閮ㄩ棬缁存姢锛岄儴闂ㄤ笅鎵�鏈夊憳宸ュ叡鐢ㄦ渶鏂扮敓鏁堢殑涓�浠斤紱濡傞渶璋冩暣锛岃鍒般�岃柂閰鐞� - 閮ㄩ棬绀句繚鍏Н閲戞。妗堛�嶄慨鏀广��"
+ type="info"
+ show-icon
+ style="margin-bottom: 12px"
+ />
- <!-- 宸ュ叿鏍� -->
- <div v-if="!isDetail" class="mb-3">
- <Button type="primary" @click="handleCreate">
- 鏂板绀句繚鍏Н閲戞。妗�
- </Button>
- </div>
-
- <!-- 琛ㄦ牸 -->
<Table
:columns="columns"
:data-source="list"
@@ -140,28 +71,6 @@
{{ record.status === 0 ? '鍚敤' : '绂佺敤' }}
</Tag>
</template>
- <template v-else-if="column.key === 'action' && !isDetail">
- <TableAction
- :actions="[
- {
- label: $t('common.edit'),
- type: 'link',
- icon: ACTION_ICON.EDIT,
- onClick: handleEdit.bind(null, record),
- },
- {
- label: $t('common.delete'),
- type: 'link',
- danger: true,
- icon: ACTION_ICON.DELETE,
- popConfirm: {
- title: $t('ui.actionMessage.deleteConfirm', ['绀句繚鍏Н閲戞。妗�']),
- confirm: handleDelete.bind(null, record),
- },
- },
- ]"
- />
- </template>
</template>
</Table>
</div>
@@ -171,4 +80,4 @@
.social-security-list {
padding: 0;
}
-</style>
\ No newline at end of file
+</style>
--
Gitblit v1.9.3