| | |
| | | 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'; |
| | |
| | | importModalApi.open(); |
| | | } |
| | | |
| | | /** 待转正提醒数 */ |
| | | const regularizeCount = ref(0); |
| | | async function refreshRegularizeReminders() { |
| | | try { |
| | | const list = await getRegularizeReminders(7); |
| | | regularizeCount.value = list?.length ?? 0; |
| | | } catch { |
| | | regularizeCount.value = 0; |
| | | } |
| | | } |
| | | onMounted(refreshRegularizeReminders); |
| | | |
| | | /** 员工转正(仅劳动合同可转正) */ |
| | | async function handleRegularize(row: HrmEmployeeApi.Employee) { |
| | | await regularizeEmployee(row.id!); |
| | | message.success(`【${row.name}】已转正`); |
| | | handleRefresh(); |
| | | refreshRegularizeReminders(); |
| | | } |
| | | |
| | | const [Grid, gridApi] = useVbenVxeGrid({ |
| | | formOptions: { |
| | | schema: useGridFormSchema(), |
| | |
| | | <Page auto-content-height> |
| | | <ImportModal @success="handleRefresh" /> |
| | | <FormModal @success="handleRefresh" /> |
| | | <Alert |
| | | v-if="regularizeCount > 0" |
| | | class="mb-3" |
| | | :message="`待转正提醒:有 ${regularizeCount} 名员工试用期即将到期,请及时转正`" |
| | | show-icon |
| | | type="warning" |
| | | /> |
| | | <Grid table-title="员工列表"> |
| | | <template #toolbar-tools> |
| | | <TableAction |
| | |
| | | onClick: handleEdit.bind(null, row), |
| | | }, |
| | | { |
| | | label: '转正', |
| | | type: 'link', |
| | | auth: ['hrm:employee:update'], |
| | | ifShow: () => row.employeeStatus === 2, |
| | | popConfirm: { |
| | | title: `确认将【${row.name}】转正吗?(仅劳动合同可转正,不含调岗)`, |
| | | confirm: handleRegularize.bind(null, row), |
| | | }, |
| | | }, |
| | | { |
| | | label: $t('common.delete'), |
| | | type: 'link', |
| | | danger: true, |