Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Contribute to GitLab
Sign in
Toggle navigation
R
recruit-sys
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
李文光
recruit-sys
Commits
4d0c90f4
Commit
4d0c90f4
authored
Sep 01, 2026
by
李文光
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat: 新建岗位必填项未填时阻止提交并跳转对应Tab
parent
ef75212d
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
24 additions
and
0 deletions
+24
-0
JobEdit.vue
vue-app/src/components/jobs/JobEdit.vue
+24
-0
No files found.
vue-app/src/components/jobs/JobEdit.vue
View file @
4d0c90f4
...
@@ -59,6 +59,17 @@ const form = reactive({
...
@@ -59,6 +59,17 @@ const form = reactive({
reportTo
:
''
,
reportTo
:
''
,
})
})
// 新建岗位必填项:与表单里 required 标记保持一致,缺失时阻止提交并跳到对应 Tab
const
REQUIRED_CREATE_FIELDS
=
[
{
key
:
'title'
,
label
:
'岗位名称'
,
tab
:
'base'
},
{
key
:
'department'
,
label
:
'所属部门'
,
tab
:
'base'
},
{
key
:
'workLocation'
,
label
:
'工作地点'
,
tab
:
'base'
},
{
key
:
'headcount'
,
label
:
'招聘人数'
,
tab
:
'base'
,
check
:
(
value
)
=>
Number
(
value
)
>=
1
},
{
key
:
'jd'
,
label
:
'岗位说明 / JD'
,
tab
:
'jd'
},
{
key
:
'responsibilities'
,
label
:
'核心职责'
,
tab
:
'jd'
},
{
key
:
'requirements'
,
label
:
'任职要求'
,
tab
:
'jd'
},
]
const
syncForm
=
()
=>
{
const
syncForm
=
()
=>
{
const
job
=
existing
.
value
const
job
=
existing
.
value
form
.
jobId
=
job
?.
id
||
''
form
.
jobId
=
job
?.
id
||
''
...
@@ -143,6 +154,19 @@ const submit = async (saveMode = 'update') => {
...
@@ -143,6 +154,19 @@ const submit = async (saveMode = 'update') => {
return
return
}
}
// 新建岗位:必填项未填不得提交
if
(
isNew
.
value
)
{
for
(
const
field
of
REQUIRED_CREATE_FIELDS
)
{
const
value
=
form
[
field
.
key
]
const
empty
=
field
.
check
?
!
field
.
check
(
value
)
:
!
String
(
value
??
''
).
trim
()
if
(
empty
)
{
showToast
(
`请填写
${
field
.
label
}
`
,
'warning'
)
if
(
activeTab
.
value
!==
field
.
tab
)
activeTab
.
value
=
field
.
tab
return
}
}
}
// JD 质量检查:缺失关键信息时二次确认,不硬阻断
// JD 质量检查:缺失关键信息时二次确认,不硬阻断
const
quality
=
jdQualityCheck
({
const
quality
=
jdQualityCheck
({
title
:
form
.
title
,
title
:
form
.
title
,
...
...
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