Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
B
binfast-admin-view
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
binfast
binfast-admin-view
Commits
3905e5fc
Commit
3905e5fc
authored
Oct 30, 2025
by
刘斌
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 完善入职离职
parent
bf1ac72a
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
230 additions
and
14 deletions
+230
-14
employeeDept.ts
apps/web-antd/src/api/hr/employeeDept.ts
+91
-0
employeeInfo.ts
apps/web-antd/src/api/hr/employeeInfo.ts
+8
-0
dictType.ts
apps/web-antd/src/api/system/dict/dictType.ts
+10
-0
form.vue
apps/web-antd/src/views/hr/employeeInfo/form.vue
+96
-7
list.vue
apps/web-antd/src/views/hr/employeeInfo/list.vue
+5
-5
list.vue
apps/web-antd/src/views/system/dict/type/list.vue
+20
-2
No files found.
apps/web-antd/src/api/hr/employeeDept.ts
0 → 100644
View file @
3905e5fc
import
type
{
BaseModel
,
PageQuery
}
from
'#/api/baseModel'
;
import
{
commonExport
}
from
'#/api/helper'
;
import
{
requestClient
}
from
'#/api/request'
;
export
namespace
EmployeeDeptApi
{
export
interface
EmployeeDept
extends
BaseModel
{
/**
* 父级部门
*/
parentId
?:
number
;
/**
* 部门名称
*/
name
?:
string
;
/**
* 祖级关系
*/
nodePath
?:
string
;
/**
* 显示顺序
*/
orderNum
?:
number
;
/**
* 状态
*/
status
?:
number
;
}
}
/**
* 查询员工部门列表
* @param params
* @returns {*} page
*/
export
function
apiPage
(
params
:
PageQuery
)
{
return
requestClient
.
get
(
'/employee/dept/page'
,
{
params
});
}
/**
* 查询员工部门详细
* @param id
*/
export
function
apiDetail
(
id
:
number
)
{
return
requestClient
.
get
(
`/employee/dept/
${
id
}
`
);
}
/**
* 新增员工部门
* @param data
*/
export
function
apiAdd
(
data
:
EmployeeDeptApi
.
EmployeeDept
)
{
return
requestClient
.
post
(
'/employee/dept'
,
data
);
}
/**
* 修改员工部门
* @param data
*/
export
function
apiUpdate
(
data
:
EmployeeDeptApi
.
EmployeeDept
)
{
return
requestClient
.
put
(
'/employee/dept'
,
data
);
}
/**
* 删除员工部门
* @param id
*/
export
function
apiDelete
(
id
:
Array
<
number
>
|
number
)
{
return
requestClient
.
delete
(
`/employee/dept/
${
id
}
`
);
}
/**
* 导出员工部门
* @param params
*/
export
function
apiExport
(
params
:
PageQuery
)
{
return
commonExport
(
'/employee/dept/export'
,
params
);
}
/**
* 根据部门等级查询部门名称
* @param level
*/
export
function
selectDeptNamesByLevel
(
level
:
number
)
{
return
requestClient
.
get
(
`/employee/dept/deptNames/
${
level
}
`
);
}
/**
* 根据父级部门名称查询部门名称
* @param name
*/
export
function
selectDeptNamesByParent
(
name
:
string
)
{
return
requestClient
.
get
(
`/employee/dept/deptNamesByParentName/
${
name
}
`
);
}
apps/web-antd/src/api/hr/employeeInfo.ts
View file @
3905e5fc
...
...
@@ -248,6 +248,14 @@ export function apiExport(id: number) {
return
commonExport
(
`/employee/info/export/
${
id
}
`
,
{});
}
/**
* 申请员工离职
* @param id
*/
export
function
applyResign
(
id
:
number
)
{
return
requestClient
.
put
(
`/employee/info/applyResign/
${
id
}
`
);
}
/**
* 下载用户导入模板
* @returns blob
...
...
apps/web-antd/src/api/system/dict/dictType.ts
View file @
3905e5fc
...
...
@@ -81,3 +81,13 @@ export function apiExport(params?: PageQuery) {
export
function
apiOptionselect
()
{
return
requestClient
.
get
(
'/system/dict/type/optionselect'
);
}
/**
* 刷新字典缓存
* @returns void
*/
export
function
refreshDictTypeCache
()
{
return
requestClient
.
delete
(
'/system/dict/type/refreshCache'
,
{
successMessageMode
:
'message'
,
});
}
apps/web-antd/src/views/hr/employeeInfo/form.vue
View file @
3905e5fc
...
...
@@ -5,11 +5,16 @@ import type { EmployeeInfoApi } from '#/api/hr/employeeInfo';
import
{
computed
,
ref
}
from
'vue'
;
import
{
useVbenDrawer
}
from
'@vben/common-ui'
;
import
{
getVxePopupContainer
}
from
'@vben/utils'
;
import
{
Skeleton
}
from
'ant-design-vue'
;
import
{
useVbenForm
}
from
'#/adapter/form'
;
import
{
apiAdd
,
apiUpdate
}
from
'#/api/hr/employeeInfo'
;
import
{
selectDeptNamesByLevel
,
selectDeptNamesByParent
,
}
from
'#/api/hr/employeeDept'
;
import
{
apiAdd
,
apiDetail
,
apiUpdate
}
from
'#/api/hr/employeeInfo'
;
import
{
getDictOptions
}
from
'#/utils/dict'
;
import
{
defaultFormValueGetter
,
useBeforeCloseDiff
}
from
'#/utils/popup'
;
...
...
@@ -20,6 +25,7 @@ const emit = defineEmits<{
}
>
();
const
formData
=
ref
<
EmployeeInfoApi
.
Employee
>
();
const
loading
=
ref
(
false
);
const
isUpdate
=
ref
(
false
);
const
formSchema
:
VbenFormSchema
[]
=
[
{
...
...
@@ -47,13 +53,33 @@ const formSchema: VbenFormSchema[] = [
rules
:
'required'
,
},
{
component
:
'Input'
,
component
:
'ApiSelect'
,
componentProps
:
(
formModel
)
=>
({
api
:
async
()
=>
{
const
data
:
string
[]
=
await
selectDeptNamesByLevel
(
1
);
return
data
.
map
((
item
)
=>
({
label
:
item
,
value
:
item
,
}));
},
async
onSelect
(
name
:
string
)
{
/** 根据部门ID加载岗位 */
await
setupDeptLevel2Options
(
name
);
/** 变化后需要重新选择岗位 */
formModel
.
secondLevelDepartment
=
[];
},
getVxePopupContainer
,
}),
fieldName
:
'firstLevelDepartment'
,
label
:
'一级部门'
,
rules
:
'required'
,
},
{
component
:
'Input'
,
component
:
'Select'
,
componentProps
:
{
getVxePopupContainer
,
placeholder
:
'请先选择一级部门'
,
},
fieldName
:
'secondLevelDepartment'
,
label
:
'二级部门'
,
rules
:
'required'
,
...
...
@@ -120,6 +146,11 @@ const formSchema: VbenFormSchema[] = [
},
{
component
:
'DatePicker'
,
componentProps
:
{
format
:
'YYYY-MM-DD'
,
valueFormat
:
'YYYY-MM-DD'
,
getVxePopupContainer
,
},
fieldName
:
'birthDate'
,
label
:
'出生日期'
,
rules
:
'required'
,
...
...
@@ -222,6 +253,11 @@ const formSchema: VbenFormSchema[] = [
},
{
component
:
'DatePicker'
,
componentProps
:
{
format
:
'YYYY-MM-DD'
,
valueFormat
:
'YYYY-MM-DD'
,
getVxePopupContainer
,
},
fieldName
:
'graduationDate'
,
label
:
'毕业时间'
,
rules
:
'required'
,
...
...
@@ -252,18 +288,33 @@ const formSchema: VbenFormSchema[] = [
},
{
component
:
'DatePicker'
,
componentProps
:
{
format
:
'YYYY-MM-DD'
,
valueFormat
:
'YYYY-MM-DD'
,
getVxePopupContainer
,
},
fieldName
:
'workStartDate'
,
label
:
'参加工作时间'
,
rules
:
'required'
,
},
{
component
:
'DatePicker'
,
componentProps
:
{
format
:
'YYYY-MM-DD'
,
valueFormat
:
'YYYY-MM-DD'
,
getVxePopupContainer
,
},
fieldName
:
'entryDate'
,
label
:
'入职时间'
,
rules
:
'required'
,
},
{
component
:
'DatePicker'
,
componentProps
:
{
format
:
'YYYY-MM-DD'
,
valueFormat
:
'YYYY-MM-DD'
,
getVxePopupContainer
,
},
fieldName
:
'regularizationDate'
,
label
:
'转正时间'
,
rules
:
'required'
,
...
...
@@ -330,21 +381,36 @@ const formSchema: VbenFormSchema[] = [
},
{
component
:
'DatePicker'
,
componentProps
:
{
format
:
'YYYY-MM-DD'
,
valueFormat
:
'YYYY-MM-DD'
,
getVxePopupContainer
,
},
fieldName
:
'contractStartDate'
,
label
:
'劳动合同开始时间'
,
rules
:
'required'
,
},
{
component
:
'DatePicker'
,
componentProps
:
{
format
:
'YYYY-MM-DD'
,
valueFormat
:
'YYYY-MM-DD'
,
getVxePopupContainer
,
},
fieldName
:
'contractEndDate'
,
label
:
'劳动合同截止时间'
,
rules
:
'required'
,
},
{
component
:
'DatePicker'
,
componentProps
:
{
format
:
'YYYY-MM-DD'
,
valueFormat
:
'YYYY-MM-DD'
,
getVxePopupContainer
,
},
fieldName
:
'contractExpirationReminder'
,
label
:
'合同到期提醒'
,
rules
:
'required'
,
//
rules: 'required',
},
{
component
:
'Input'
,
...
...
@@ -447,17 +513,40 @@ const [Drawer, drawerApi] = useVbenDrawer({
if
(
!
isOpen
)
{
return
null
;
}
const
data
=
drawerApi
.
getData
<
EmployeeInfoApi
.
Employee
>
();
if
(
data
)
{
drawerApi
.
drawerLoading
(
true
);
loading
.
value
=
true
;
const
{
id
}
=
drawerApi
.
getData
()
as
{
id
?:
number
};
isUpdate
.
value
=
!!
id
;
console
.
log
(
'[id]'
,
id
);
if
(
id
)
{
const
data
=
await
apiDetail
(
id
);
formData
.
value
=
data
;
await
formApi
.
setValues
(
formData
.
value
);
await
formApi
.
setValues
(
formData
.
value
!
);
await
setupDeptLevel2Options
(
data
.
firstLevelDepartment
);
}
else
{
formApi
.
resetForm
();
}
await
markInitialized
();
drawerApi
.
drawerLoading
(
false
);
loading
.
value
=
false
;
},
});
async
function
setupDeptLevel2Options
(
name
:
string
)
{
const
deptNameList
:
string
[]
=
await
selectDeptNamesByParent
(
name
);
const
options
=
deptNameList
.
map
((
item
)
=>
({
label
:
item
,
value
:
item
,
}));
const
placeholder
=
options
.
length
>
0
?
'请选择'
:
'该部门下暂无岗位'
;
formApi
.
updateSchema
([
{
componentProps
:
{
options
,
placeholder
},
fieldName
:
'secondLevelDepartment'
,
},
]);
}
async
function
onSubmit
()
{
const
{
valid
}
=
await
formApi
.
validate
();
if
(
valid
)
{
...
...
apps/web-antd/src/views/hr/employeeInfo/list.vue
View file @
3905e5fc
...
...
@@ -11,7 +11,7 @@ import { getVxePopupContainer } from '@vben/utils';
import
{
Button
,
message
,
Popconfirm
,
Space
}
from
'ant-design-vue'
;
import
{
useVbenVxeGrid
}
from
'#/adapter/vxe-table'
;
import
{
api
Delete
,
apiExport
,
apiPage
}
from
'#/api/hr/employeeInfo'
;
import
{
api
Export
,
apiPage
,
applyResign
}
from
'#/api/hr/employeeInfo'
;
import
{
GhostButton
}
from
'#/components/global/button'
;
import
{
commonDownloadExcel
}
from
'#/utils/file/download'
;
...
...
@@ -107,7 +107,7 @@ function onRefresh() {
gridApi
.
query
();
}
function
onEdit
(
row
:
EmployeeInfoApi
.
Employee
)
{
formDrawerApi
.
setData
(
row
).
open
();
formDrawerApi
.
setData
(
{
id
:
row
.
id
}
).
open
();
}
function
onCreate
()
{
formDrawerApi
.
setData
({}).
open
();
...
...
@@ -118,7 +118,7 @@ function onResign(row: EmployeeInfoApi.Employee) {
duration
:
0
,
key
:
'action_process_msg'
,
});
ap
iDelete
(
row
.
id
||
0
)
ap
plyResign
(
row
.
id
||
0
)
.
then
(()
=>
{
message
.
success
({
content
:
`
${
row
.
name
}
离职申请成功`
,
...
...
@@ -191,7 +191,7 @@ function handleDownloadExcel(row: EmployeeInfoApi.Employee) {
<Popconfirm
:get-popup-container=
"getVxePopupContainer"
placement=
"left"
:title=
"`确认离职【$
{row.name}】?`"
:title=
"`确认
申请
离职【$
{row.name}】?`"
@confirm="onResign(row)"
>
<GhostButton
...
...
@@ -199,7 +199,7 @@ function handleDownloadExcel(row: EmployeeInfoApi.Employee) {
v-access:code=
"['employee:info:resign']"
@
click
.
stop=
""
>
离职
申请
离职
</GhostButton>
</Popconfirm>
</Space>
...
...
apps/web-antd/src/views/system/dict/type/list.vue
View file @
3905e5fc
...
...
@@ -16,7 +16,11 @@ import { Plus } from '@vben/icons';
import
{
Button
,
message
}
from
'ant-design-vue'
;
import
{
useVbenVxeGrid
}
from
'#/adapter/vxe-table'
;
import
{
apiDelete
,
apiPage
}
from
'#/api/system/dict/dictType'
;
import
{
apiDelete
,
apiPage
,
refreshDictTypeCache
,
}
from
'#/api/system/dict/dictType'
;
import
{
emitter
}
from
'../mitt'
;
import
{
querySchema
,
useColumns
}
from
'./data'
;
...
...
@@ -83,7 +87,10 @@ const [Grid, gridApi] = useVbenVxeGrid({
gridEvents
,
});
function
onActionClick
({
code
,
row
}:
OnActionClickParams
<
DictTypeApi
.
DictType
>
)
{
function
onActionClick
({
code
,
row
,
}:
OnActionClickParams
<
DictTypeApi
.
DictType
>
)
{
switch
(
code
)
{
case
'delete'
:
{
onDelete
(
row
);
...
...
@@ -127,12 +134,23 @@ function onDelete(row: DictTypeApi.DictType) {
hideLoading
();
});
}
async
function
handleRefreshCache
()
{
await
refreshDictTypeCache
();
await
tableApi
.
query
();
}
</
script
>
<
template
>
<div>
<DictTypeModal
@
success=
"onRefresh"
/>
<Grid
table-title=
"字典类型列表"
>
<template
#
toolbar-tools
>
<a-button
v-access:code=
"['system:dict:edit']"
@
click=
"handleRefreshCache"
>
刷新缓存
</a-button>
<Button
type=
"primary"
v-access:code=
"['system:dict:add']"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment