Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
Y
yd-csf-front
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
1
Merge Requests
1
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
yuzhenWang
yd-csf-front
Commits
56adb469
Commit
56adb469
authored
Oct 21, 2025
by
yuzhenWang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
流程修改6
parent
c763f338
Hide whitespace changes
Inline
Side-by-side
Showing
15 changed files
with
425 additions
and
129 deletions
+425
-129
src/formJson/applicant.js
+4
-4
src/formJson/beneficiary.js
+3
-3
src/formJson/customer.js
+19
-19
src/formJson/insured.js
+4
-4
src/formJson/secondHolder.js
+0
-1
src/utils/validate.js
+67
-6
src/views/components/country.vue
+26
-11
src/views/components/phone.vue
+1
-0
src/views/sign/FnaList/components/customer.vue
+2
-12
src/views/sign/appointment/appointmentEdit.vue
+1
-0
src/views/sign/appointment/components/appointmentInfo.vue
+35
-1
src/views/sign/appointment/components/beneficiaryInfo.vue
+61
-24
src/views/sign/appointment/components/insuredInfo.vue
+94
-22
src/views/sign/appointment/components/policyHolderInfo.vue
+99
-22
src/views/sign/appointment/components/secondHolderInfo.vue
+9
-0
No files found.
src/formJson/applicant.js
View file @
56adb469
...
...
@@ -67,7 +67,7 @@ const applicant = [
lg
:
8
//栅格布局份数
},
{
label
:
'
姓名
'
,
label
:
'
名字
'
,
key
:
'name'
,
customerKey
:
'name'
,
domType
:
'Input'
,
...
...
@@ -102,7 +102,7 @@ const applicant = [
key
:
'documentType'
,
customerKey
:
'idType'
,
domType
:
'Select'
,
required
:
fals
e
,
required
:
tru
e
,
disabled
:
false
,
placeholder
:
'请选择'
,
dictType
:
'csf_id_type'
,
...
...
@@ -118,7 +118,7 @@ const applicant = [
customerKey
:
'idCard'
,
domType
:
'Input'
,
inputType
:
'number'
,
required
:
fals
e
,
required
:
tru
e
,
maxLength
:
20
,
disabled
:
false
,
placeholder
:
'请输入'
,
...
...
@@ -150,7 +150,7 @@ const applicant = [
inputType
:
'number'
,
required
:
false
,
maxLength
:
20
,
disabled
:
fals
e
,
disabled
:
tru
e
,
placeholder
:
'请输入'
,
show
:
true
,
labelPosition
:
'top'
,
//标签的位置
...
...
src/formJson/beneficiary.js
View file @
56adb469
...
...
@@ -57,7 +57,7 @@ const beneficiary = [
customerKey
:
'name'
,
domType
:
'Input'
,
inputType
:
'text'
,
required
:
tru
e
,
required
:
fals
e
,
maxLength
:
20
,
disabled
:
false
,
placeholder
:
'请输入'
,
...
...
@@ -121,7 +121,7 @@ const beneficiary = [
customerKey
:
'idCard'
,
domType
:
'Input'
,
inputType
:
'number'
,
required
:
fals
e
,
required
:
tru
e
,
maxLength
:
20
,
disabled
:
false
,
placeholder
:
'请输入'
,
...
...
@@ -377,7 +377,7 @@ const beneficiary = [
showMoudle
:
true
,
//模块是否展示
data
:
[
{
label
:
'受益比例'
,
label
:
'受益比例
(%)
'
,
key
:
'benefitRatio'
,
customerKey
:
'idCard'
,
domType
:
'Input'
,
...
...
src/formJson/customer.js
View file @
56adb469
...
...
@@ -35,7 +35,7 @@ const customer = [
// lg: 8 //栅格布局份数
// },
{
label
:
'
姓名
'
,
label
:
'
名字
'
,
key
:
'name'
,
type
:
'Input'
,
inputType
:
'text'
,
...
...
@@ -251,7 +251,7 @@ const customer = [
type
:
'Input'
,
inputType
:
'text'
,
maxLength
:
300
,
required
:
fals
e
,
required
:
tru
e
,
disabled
:
false
,
placeholder
:
'请输入'
,
show
:
true
,
...
...
@@ -400,29 +400,29 @@ const customer = [
labelWidth
:
'120px'
,
//标签宽度
sm
:
8
,
//栅格布局份数
lg
:
8
//栅格布局份数
},
{
label
:
'邮寄地址'
,
key
:
'mailingAddress'
,
type
:
'arrowRight'
,
required
:
false
,
disabled
:
false
,
placeholder
:
'请填写'
,
show
:
true
,
drawerType
:
'address'
,
mailingAddress
:
{},
labelPosition
:
'top'
,
//标签的位置
labelWidth
:
'120px'
,
//标签宽度
sm
:
8
,
//栅格布局份数
lg
:
8
//栅格布局份数
}
// {
// label: '邮寄地址',
// key: 'mailingAddress',
// type: 'arrowRight',
// required: false,
// disabled: false,
// placeholder: '请填写',
// show: true,
// drawerType: 'address',
// mailingAddress: {},
// labelPosition: 'top', //标签的位置
// labelWidth: '120px', //标签宽度
// sm: 8, //栅格布局份数
// lg: 8 //栅格布局份数
// }
]
},
{
fatherTitle
:
'证件信息'
,
type
:
'object'
,
key
:
'pid'
,
description
:
'证件信息至少填写一项'
,
//
description: '证件信息至少填写一项',
data
:
[
{
label
:
'证件类型'
,
...
...
@@ -443,7 +443,7 @@ const customer = [
key
:
'idCard'
,
type
:
'Input'
,
inputType
:
'text'
,
required
:
fals
e
,
required
:
tru
e
,
maxLength
:
20
,
disabled
:
false
,
placeholder
:
'请输入'
,
...
...
src/formJson/insured.js
View file @
56adb469
...
...
@@ -87,7 +87,7 @@ const insured = [
customerKey
:
'name'
,
domType
:
'Input'
,
inputType
:
'text'
,
required
:
tru
e
,
required
:
fals
e
,
maxLength
:
20
,
disabled
:
false
,
placeholder
:
'请输入'
,
...
...
@@ -117,7 +117,7 @@ const insured = [
key
:
'documentType'
,
customerKey
:
'idType'
,
domType
:
'Select'
,
required
:
fals
e
,
required
:
tru
e
,
disabled
:
false
,
placeholder
:
'请选择'
,
dictType
:
'csf_id_type'
,
...
...
@@ -133,7 +133,7 @@ const insured = [
customerKey
:
'idCard'
,
domType
:
'Input'
,
inputType
:
'number'
,
required
:
fals
e
,
required
:
tru
e
,
maxLength
:
20
,
disabled
:
false
,
placeholder
:
'请输入'
,
...
...
@@ -165,7 +165,7 @@ const insured = [
inputType
:
'number'
,
required
:
false
,
maxLength
:
20
,
disabled
:
fals
e
,
disabled
:
tru
e
,
placeholder
:
'请输入'
,
show
:
true
,
labelPosition
:
'top'
,
//标签的位置
...
...
src/formJson/secondHolder.js
View file @
56adb469
const
secondHolder
=
[
// 基础信息
{
...
...
src/utils/validate.js
View file @
56adb469
...
...
@@ -5,25 +5,28 @@
* @returns {Boolean}
*/
export
function
isPathMatch
(
pattern
,
path
)
{
const
regexPattern
=
pattern
.
replace
(
/
\/
/g
,
'
\\
/'
).
replace
(
/
\*\*
/g
,
'.*'
).
replace
(
/
\*
/g
,
'[^
\\
/]*'
)
const
regexPattern
=
pattern
.
replace
(
/
\/
/g
,
'
\\
/'
)
.
replace
(
/
\*\*
/g
,
'.*'
)
.
replace
(
/
\*
/g
,
'[^
\\
/]*'
)
const
regex
=
new
RegExp
(
`^
${
regexPattern
}
$`
)
return
regex
.
test
(
path
)
}
/**
* 判断value字符串是否为空
* 判断value字符串是否为空
* @param {string} value
* @returns {Boolean}
*/
export
function
isEmpty
(
value
)
{
if
(
value
==
null
||
value
==
""
||
value
==
undefined
||
value
==
"undefined"
)
{
if
(
value
==
null
||
value
==
''
||
value
==
undefined
||
value
==
'undefined'
)
{
return
true
}
return
false
}
/**
* 判断url是否是http或https
* 判断url是否是http或https
* @param {string} url
* @returns {Boolean}
*/
...
...
@@ -54,7 +57,8 @@ export function validUsername(str) {
* @returns {Boolean}
*/
export
function
validURL
(
url
)
{
const
reg
=
/^
(
https
?
|ftp
)
:
\/\/([
a-zA-Z0-9.-
]
+
(
:
[
a-zA-Z0-9.&%$-
]
+
)
*@
)
*
((
25
[
0-5
]
|2
[
0-4
][
0-9
]
|1
[
0-9
]{2}
|
[
1-9
][
0-9
]?)(\.(
25
[
0-5
]
|2
[
0-4
][
0-9
]
|1
[
0-9
]{2}
|
[
1-9
]?[
0-9
])){3}
|
([
a-zA-Z0-9-
]
+
\.)
*
[
a-zA-Z0-9-
]
+
\.(
com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|
[
a-zA-Z
]{2}))(
:
[
0-9
]
+
)
*
(\/(
$|
[
a-zA-Z0-9.,?'
\\
+&%$#=~_-
]
+
))
*$/
const
reg
=
/^
(
https
?
|ftp
)
:
\/\/([
a-zA-Z0-9.-
]
+
(
:
[
a-zA-Z0-9.&%$-
]
+
)
*@
)
*
((
25
[
0-5
]
|2
[
0-4
][
0-9
]
|1
[
0-9
]{2}
|
[
1-9
][
0-9
]?)(\.(
25
[
0-5
]
|2
[
0-4
][
0-9
]
|1
[
0-9
]{2}
|
[
1-9
]?[
0-9
])){3}
|
([
a-zA-Z0-9-
]
+
\.)
*
[
a-zA-Z0-9-
]
+
\.(
com|edu|gov|int|mil|net|org|biz|arpa|info|name|pro|aero|coop|museum|
[
a-zA-Z
]{2}))(
:
[
0-9
]
+
)
*
(\/(
$|
[
a-zA-Z0-9.,?'
\\
+&%$#=~_-
]
+
))
*$/
return
reg
.
test
(
url
)
}
...
...
@@ -90,7 +94,8 @@ export function validAlphabets(str) {
* @returns {Boolean}
*/
export
function
validEmail
(
email
)
{
const
reg
=
/^
(([^
<>()
\[\]\\
.,;:
\s
@"
]
+
(\.[^
<>()
\[\]\\
.,;:
\s
@"
]
+
)
*
)
|
(
".+"
))
@
((\[[
0-9
]{1,3}\.[
0-9
]{1,3}\.[
0-9
]{1,3}\.[
0-9
]{1,3}\])
|
(([
a-zA-Z
\-
0-9
]
+
\.)
+
[
a-zA-Z
]{2,}))
$/
const
reg
=
/^
(([^
<>()
\[\]\\
.,;:
\s
@"
]
+
(\.[^
<>()
\[\]\\
.,;:
\s
@"
]
+
)
*
)
|
(
".+"
))
@
((\[[
0-9
]{1,3}\.[
0-9
]{1,3}\.[
0-9
]{1,3}\.[
0-9
]{1,3}\])
|
(([
a-zA-Z
\-
0-9
]
+
\.)
+
[
a-zA-Z
]{2,}))
$/
return
reg
.
test
(
email
)
}
...
...
@@ -112,3 +117,59 @@ export function isArray(arg) {
}
return
Array
.
isArray
(
arg
)
}
/**
* 英文姓名校验规则
*/
export
const
validateEnglish
=
(
rule
,
value
,
callback
)
=>
{
// if (!value) {
// // 如果值为空且字段不是必填的,直接通过校验
// return callback()
// }
// 1. 基本字符检查
if
(
!
/^
[
A-Za-z
\s\-
'.
]
+$/
.
test
(
value
))
{
return
callback
(
new
Error
(
"包含非法字符,只允许英文字母、空格、-、'和."
))
}
// 2. 首字母大写检查
// if (!/^[A-Z]/.test(value)) {
// return callback(new Error('名字应以大写字母开头'))
// }
// 3. 长度检查
if
(
value
.
length
<
2
)
{
return
callback
(
new
Error
(
'名字至少需要2个字符'
))
}
// 4. 连续特殊字符检查
if
(
/
[\s\-
'.
]{2,}
/
.
test
(
value
))
{
return
callback
(
new
Error
(
'不能连续使用特殊字符'
))
}
// 5. 开头或结尾不能是特殊字符
if
(
/^
[\s\-
'.
]
|
[\s\-
'.
]
$/
.
test
(
value
.
trim
()))
{
return
callback
(
new
Error
(
'名字不能以特殊字符开头或结尾'
))
}
callback
()
}
/**
* 手机号校验规则
*/
export
const
validatePhone
=
(
rule
,
value
,
callback
)
=>
{
if
(
!
value
)
{
return
callback
()
}
const
phoneRegex
=
/^1
[
3-9
]\d{9}
$/
if
(
!
phoneRegex
.
test
(
value
))
{
return
callback
(
new
Error
(
'请输入正确的手机号码'
))
}
callback
()
}
export
default
{
validateEnglish
,
validatePhone
}
src/views/components/country.vue
View file @
56adb469
...
...
@@ -22,7 +22,7 @@
class=
"searchInput"
v-model=
"searchValue"
placeholder=
"请输入国家/地区名称"
@
change
=
"searchCountry"
@
input
=
"searchCountry"
/>
<el-icon
class=
"searchIcon"
><Search
/></el-icon>
</div>
...
...
@@ -64,11 +64,20 @@
<div
v-if=
"searchValue"
>
<div
class=
"hotCountryList"
>
<el-row
:gutter=
"20"
>
<
template
v-for=
"item in searchList"
:key=
"item.name"
>
<el-col
:sm=
"24"
:lg=
"24"
@
click=
"handleCountryClick(item)"
>
<div
class=
"hotCountryItem"
>
<span>
{{
item
.
name
}}
</span>
<span>
{{
item
.
areaCode
}}
</span>
<
template
v-if=
"searchList.length > 0"
>
<template
v-for=
"item in searchList"
:key=
"item.name"
>
<el-col
:sm=
"24"
:lg=
"24"
@
click=
"handleCountryClick(item)"
>
<div
class=
"hotCountryItem"
>
<span>
{{
item
.
name
}}
</span>
<span>
{{
item
.
areaCode
}}
</span>
</div>
</el-col>
</
template
>
</template>
<
template
v-else
>
<el-col
:span=
"24"
>
<div
class=
"countryEmpty"
>
<span>
暂无数据
</span>
</div>
</el-col>
</
template
>
...
...
@@ -131,11 +140,17 @@ const searchCountry = () => {
isSearchLoading
.
value
=
true
if
(
searchValue
.
value
.
trim
())
{
getSearchCountry
(
searchValue
.
value
.
trim
()).
then
(
res
=>
{
// searchList.value = []
if
(
res
.
code
===
200
)
{
res
.
data
.
countryList
.
forEach
(
d
=>
{
d
.
areaCode
=
`+
${
d
.
areaCode
}
`
})
searchList
.
value
=
res
.
data
.
countryList
if
(
res
.
data
.
countryList
&&
res
.
data
.
countryList
.
length
>
0
)
{
res
.
data
.
countryList
.
forEach
(
d
=>
{
d
.
areaCode
=
`+
${
d
.
areaCode
}
`
})
searchList
.
value
=
res
.
data
.
countryList
}
else
{
searchList
.
value
=
[]
}
isSearchLoading
.
value
=
false
}
})
...
...
@@ -310,7 +325,7 @@ watch(countryDrawer, val => {
margin-top
:
10px
;
color
:
#909399
;
}
.
empty-state
{
.
countryEmpty
{
text-align
:
center
;
padding
:
40px
0
;
color
:
#909399
;
...
...
src/views/components/phone.vue
View file @
56adb469
...
...
@@ -234,6 +234,7 @@ watch(
border
:
1px
solid
#e5e6e8
;
border-radius
:
3px
;
padding
:
10px
;
cursor
:
pointer
;
}
}
}
...
...
src/views/sign/FnaList/components/customer.vue
View file @
56adb469
...
...
@@ -185,6 +185,7 @@
</div>
</template>
<
script
setup
name=
"customer"
>
import
{
validateEnglish
}
from
'@/utils/validate'
import
{
calculateExactAge
}
from
'@/utils/date'
import
dayjs
from
'dayjs'
import
{
ArrowRight
}
from
'@element-plus/icons-vue'
...
...
@@ -219,7 +220,7 @@ const tableLoading = ref(false)
const
tableData
=
ref
([])
const
total
=
ref
(
0
)
const
customerRef
=
ref
(
null
)
//
/
计算默认显示的日期(18年前的今天)
//计算默认显示的日期(18年前的今天)
const
defaultDisplayDate
=
ref
(
dayjs
().
subtract
(
18
,
'year'
).
toDate
())
// 地址组件菜单数据
...
...
@@ -371,17 +372,6 @@ const fetchDictData = dictType => {
return
[]
}
}
// 添加英文校验函数
const
validateEnglish
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
&&
!
/^
[
A-Za-z
]
*$/
.
test
(
value
))
{
// 清空非英文字符
form
.
value
.
firstNamePinyin
=
''
callback
(
new
Error
(
'只能输入英文字母'
))
}
else
{
callback
()
}
}
// 处理表单配置,添加字典数据
const
processFormData
=
async
()
=>
{
// 深拷贝原始数据
...
...
src/views/sign/appointment/appointmentEdit.vue
View file @
56adb469
...
...
@@ -612,6 +612,7 @@ const handleSubmit = type => {
submitAppointmentObj
.
value
.
apiBeneficiaryInfoDtoList
=
beneficiaryInfoRef
.
value
[
0
].
handleFormValues
()
}
// return
// 代表新增预约
if
(
formStatus
.
value
==
'appointmentAdd'
&&
!
idsObj
.
value
.
appointmentBizId
)
{
submitAppointmentObj
.
value
.
apiAppointmentInfoDto
.
customerBizId
=
...
...
src/views/sign/appointment/components/appointmentInfo.vue
View file @
56adb469
...
...
@@ -339,6 +339,22 @@ const handleButtonClick = child => {
}
const
handleDateChange
=
child
=>
{
if
(
child
.
key
===
'confirmAppointmentTime'
&&
form
.
value
[
child
.
key
])
{
if
(
form
.
value
[
'arrivalTime'
])
{
const
appointmentTimestamp
=
dayjs
(
form
.
value
[
'confirmAppointmentTime'
]).
valueOf
()
const
arrivalTimestamp
=
dayjs
(
form
.
value
[
'arrivalTime'
]).
valueOf
()
if
(
appointmentTimestamp
<
arrivalTimestamp
)
{
proxy
.
$modal
.
msgError
(
'预约时间早于到港时间,请重新选择预约时间'
)
form
.
value
[
'confirmAppointmentTime'
]
=
''
return
}
else
if
(
appointmentTimestamp
>
arrivalTimestamp
)
{
// proxy.$modal.msgError('预约时间早于到港时间,请重新选择预约时间')
// form.value['confirmAppointmentTime'] = ''
}
else
{
proxy
.
$modal
.
msgError
(
'预约时间应晚于到港时间,请重新选择预约时间'
)
form
.
value
[
'confirmAppointmentTime'
]
=
''
return
}
}
resetShow
({
type
:
'child'
,
key
:
'newPolicyButton'
,
status
:
true
})
}
else
if
(
child
.
key
===
'confirmAppointmentTime'
&&
!
form
.
value
[
child
.
key
])
{
resetShow
({
type
:
'child'
,
key
:
'newPolicyButton'
,
status
:
false
})
...
...
@@ -356,8 +372,26 @@ const handleDateChange = child => {
form
.
value
[
'arrivalTime'
]
=
''
}
}
}
else
if
(
child
.
key
===
'confirmAppointmentTime'
)
{
if
(
form
.
value
[
'arrivalTime'
])
{
console
.
log
(
'22222'
)
const
appointmentTimestamp
=
dayjs
(
form
.
value
[
'confirmAppointmentTime'
]).
valueOf
()
const
arrivalTimestamp
=
dayjs
(
form
.
value
[
'arrivalTime'
]).
valueOf
()
console
.
log
(
'appointmentTimestamp'
,
appointmentTimestamp
)
console
.
log
(
'arrivalTimestamp'
,
arrivalTimestamp
)
// if (appointmentTimestamp
<
arrivalTimestamp
)
{
// // proxy.$modal.msgError('预约时间早于到港时间,请重新选择预约时间')
// // form.value['confirmAppointmentTime'] = ''
// } else if (appointmentTimestamp > arrivalTimestamp) {
// proxy.$modal.msgError('预约时间早于到港时间,请重新选择预约时间')
// form.value['confirmAppointmentTime'] = ''
// } else {
// proxy.$modal.msgError('预约时间应晚于到港时间,请重新选择预约时间')
// form.value['confirmAppointmentTime'] = ''
// }
}
}
}
// 获取字典数据
const
fetchDictData
=
dictType
=>
{
...
...
src/views/sign/appointment/components/beneficiaryInfo.vue
View file @
56adb469
...
...
@@ -41,13 +41,7 @@
<template
v-for=
"child in level2.data"
:key=
"child.key"
>
<el-col
:sm=
"child.sm"
:lg=
"child.lg"
class=
"formItem"
v-if=
"child.show"
>
<div>
<el-form-item
:label-width=
"child.labelWidth"
:label=
"child.label"
:prop=
"`apiBeneficiaryInfoDtoList.$
{l1}.${child.key}`"
:key="child.key"
:label-position="child.labelPosition"
:rules="
<!-- :rules="
child.required
? [
{
...
...
@@ -57,8 +51,16 @@
}
]
: []
"
" -->
<el-form-item
:label-width=
"child.labelWidth"
:label=
"child.label"
:prop=
"`apiBeneficiaryInfoDtoList.$
{l1}.${child.key}`"
:key="child.key"
:label-position="child.labelPosition"
:rules="getRules(child)"
>
<!-- @input="handleInputChange(father, child, l1)" -->
<el-input
v-if=
"child.domType === 'Input'"
:type=
"child.inputType"
...
...
@@ -200,6 +202,7 @@
</div>
</template>
<
script
setup
name=
"beneficiaryInfo"
>
import
{
validateEnglish
}
from
'@/utils/validate'
import
{
ArrowRight
}
from
'@element-plus/icons-vue'
import
beneficiaryDomData
from
'@/formJson/beneficiary'
import
Country
from
'@/views/components/country'
...
...
@@ -327,6 +330,39 @@ const {
tempBeneficiaryForm
,
tempBeneficiaryDomData
}
=
toRefs
(
data
)
// 获取表单项的校验规则
const
getRules
=
child
=>
{
const
rules
=
[]
// 必填校验
if
(
child
.
required
)
{
rules
.
push
({
required
:
true
,
message
:
`
${
child
.
label
}
不能为空`
,
trigger
:
'blur'
})
}
// 为英文姓名添加自定义校验
if
(
child
.
key
===
'nameEn'
)
{
rules
.
push
({
validator
:
validateEnglish
,
trigger
:
'change'
})
}
return
rules
}
// const handleInputChange = (father, child, index) => {
// switch (child.key) {
// case 'nameEn':
// validateEnglish(form.value['apiBeneficiaryInfoDtoList'][index][child.key], child.key)
// break
// default:
// break
// }
// }
// 新增受益人
const
addBeneficiary
=
()
=>
{
let
oneMoudle
=
JSON
.
parse
(
JSON
.
stringify
(
processedBeneficiaryData
.
value
[
0
]))
...
...
@@ -415,16 +451,16 @@ const fetchDictData = dictType => {
return
[]
}
}
// 添加英文校验函数
const
validateEnglish
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
&&
!
/^
[
A-Za-z
]
*$/
.
test
(
value
))
{
// 清空非英文字符
form
.
value
.
firstNamePinyin
=
''
callback
(
new
Error
(
'只能输入英文字母'
))
}
else
{
callback
()
}
}
//
//
添加英文校验函数
//
const validateEnglish = (rule, value, callback) => {
//
if (value && !/^[A-Za-z]*$/.test(value)) {
//
// 清空非英文字符
//
form.value.firstNamePinyin = ''
//
callback(new Error('只能输入英文字母'))
//
} else {
//
callback()
//
}
//
}
// 处理表单配置,添加字典数据
/**
...
...
@@ -457,12 +493,6 @@ const processFormData = async obj => {
// 获取字典数据
field
.
options
=
fetchDictData
(
field
.
dictType
)
}
// if (props.idsObj.appointmentBizId) {
// field.disabled = true
// } else {
// field.disabled = false
// }
}
}
}
...
...
@@ -805,6 +835,13 @@ const setFormValue = () => {
}
else
{
section
.
showMoudle
=
true
}
}
else
if
(
(
info
.
customerType
==
'COMPANY'
||
info
.
customerType
==
'INDIVIDUAL'
)
&&
info
.
insurantRel
&&
info
.
insurantRel
==
'MYSELF'
&&
section
.
key
!==
'customer'
)
{
section
.
showMoudle
=
false
}
}
}
...
...
src/views/sign/appointment/components/insuredInfo.vue
View file @
56adb469
...
...
@@ -34,13 +34,7 @@
<template
v-for=
"child in father.data"
:key=
"child.key"
>
<el-col
:sm=
"child.sm"
:lg=
"child.lg"
class=
"formItem"
v-if=
"child.show"
>
<div>
<el-form-item
:label-width=
"child.labelWidth"
:label=
"child.label"
:prop=
"child.key"
:key=
"child.key"
:label-position=
"child.labelPosition"
:rules=
"
<!-- :rules="
child.required
? [
{
...
...
@@ -50,8 +44,16 @@
}
]
: []
"
" -->
<el-form-item
:label-width=
"child.labelWidth"
:label=
"child.label"
:prop=
"child.key"
:key=
"child.key"
:label-position=
"child.labelPosition"
:rules=
"getRules(child)"
>
<!-- @input="handleInputChange(father, child)" -->
<el-input
v-if=
"child.domType === 'Input'"
:type=
"child.inputType"
...
...
@@ -79,9 +81,10 @@
style=
"width: 100%"
v-if=
"child.domType === 'DatePicker'"
type=
"date"
:disabled-date=
"disabledDate"
:placeholder=
"child.placeholder"
:disabled=
"child.disabled"
:disabled-date=
"time => disabledDate(time, child)"
@
change=
"handleDateChange(child)"
/>
<el-input
v-if=
"child.domType === 'arrowRight'"
...
...
@@ -195,6 +198,9 @@
</div>
</template>
<
script
setup
name=
"insuredInfo"
>
import
{
validateEnglish
}
from
'@/utils/validate'
import
{
calculateExactAge
}
from
'@/utils/date'
import
dayjs
from
'dayjs'
import
{
ArrowRight
}
from
'@element-plus/icons-vue'
import
policyDomData
from
'@/formJson/insured'
import
Country
from
'@/views/components/country'
...
...
@@ -316,8 +322,58 @@ const data = reactive({
})
const
{
form
,
rules
,
processedinsuredData
,
queryParams
,
oldAppointmentData
,
tempPolicyForm
}
=
toRefs
(
data
)
const
disabledDate
=
time
=>
{
// 获取表单项的校验规则
const
getRules
=
child
=>
{
const
rules
=
[]
// 必填校验
if
(
child
.
required
)
{
rules
.
push
({
required
:
true
,
message
:
`
${
child
.
label
}
不能为空`
,
trigger
:
'blur'
})
}
// 为英文姓名添加自定义校验
if
(
child
.
key
===
'nameEn'
)
{
rules
.
push
({
validator
:
validateEnglish
,
trigger
:
'change'
})
}
return
rules
}
const
handleInputChange
=
(
father
,
child
)
=>
{
switch
(
child
.
key
)
{
case
'nameEn'
:
validateEnglish
(
form
.
value
[
child
.
key
],
child
.
key
)
break
default
:
break
}
}
const
handleDateChange
=
child
=>
{
let
age
=
null
if
(
child
.
key
==
'birthday'
)
{
age
=
calculateExactAge
(
proxy
.
formatToDate
(
form
.
value
.
birthday
))
if
(
age
>=
0
)
{
form
.
value
.
age
=
age
}
}
}
const
disabledDate
=
(
time
,
child
)
=>
{
return
time
.
getTime
()
>
Date
.
now
()
// if (child.key == 'birthday') {
// // 计算18年前的今天
// const eighteenYearsAgo = dayjs().subtract(18, 'year')
// // 禁用今天之后的日期和18年前的今天之后的日期
// return time.getTime() > Date.now() || time.getTime() > eighteenYearsAgo.valueOf()
// } else {
// return time.getTime() > Date.now()
// }
}
const
exportInfo
=
()
=>
{
if
(
props
.
customerBizId
&&
editStatus
.
value
)
{
...
...
@@ -373,16 +429,16 @@ const fetchDictData = dictType => {
return
[]
}
}
// 添加英文校验函数
const
validateEnglish
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
&&
!
/^
[
A-Za-z
]
*$/
.
test
(
value
))
{
// 清空非英文字符
form
.
value
.
firstNamePinyin
=
''
callback
(
new
Error
(
'只能输入英文字母'
))
}
else
{
callback
()
}
}
//
//
添加英文校验函数
//
const validateEnglish = (rule, value, callback) => {
//
if (value && !/^[A-Za-z]*$/.test(value)) {
//
// 清空非英文字符
//
form.value.firstNamePinyin = ''
//
callback(new Error('只能输入英文字母'))
//
} else {
//
callback()
//
}
//
}
const
mergeObjects
=
(
obj1
,
obj2
)
=>
{
const
result
=
Object
.
assign
({},
obj1
)
...
...
@@ -563,7 +619,11 @@ const processFormData = async obj => {
if
(
props
.
idsObj
.
appointmentBizId
)
{
field
.
disabled
=
true
}
else
{
field
.
disabled
=
false
if
(
field
.
key
==
'age'
)
{
field
.
disabled
=
true
}
else
{
field
.
disabled
=
false
}
}
}
}
...
...
@@ -604,6 +664,14 @@ const processFormData = async obj => {
}
else
{
editStatus
.
value
=
false
}
if
(
form
.
value
[
'birthday'
])
{
let
age
=
calculateExactAge
(
proxy
.
formatToDate
(
form
.
value
.
birthday
))
if
(
age
>=
0
)
{
form
.
value
.
age
=
age
}
}
else
{
form
.
value
.
age
=
null
}
processedinsuredData
.
value
=
oldAppointmentData
.
value
=
processedData
}
...
...
@@ -792,7 +860,11 @@ const handleEditStatus = status => {
if
(
editStatus
.
value
)
{
field
.
disabled
=
true
}
else
{
field
.
disabled
=
false
if
(
field
.
key
==
'age'
)
{
field
.
disabled
=
true
}
else
{
field
.
disabled
=
false
}
}
}
}
...
...
src/views/sign/appointment/components/policyHolderInfo.vue
View file @
56adb469
...
...
@@ -34,13 +34,7 @@
<template
v-for=
"child in father.data"
:key=
"child.key"
>
<el-col
:sm=
"child.sm"
:lg=
"child.lg"
class=
"formItem"
v-if=
"child.show"
>
<div>
<el-form-item
:label-width=
"child.labelWidth"
:label=
"child.label"
:prop=
"child.key"
:key=
"child.key"
:label-position=
"child.labelPosition"
:rules=
"
<!-- :rules="
child.required
? [
{
...
...
@@ -50,8 +44,16 @@
}
]
: []
"
" -->
<el-form-item
:label-width=
"child.labelWidth"
:label=
"child.label"
:prop=
"child.key"
:key=
"child.key"
:label-position=
"child.labelPosition"
:rules=
"getRules(child)"
>
<!-- @input="handleInputChange(father, child)" -->
<el-input
v-if=
"child.domType === 'Input'"
:type=
"child.inputType"
...
...
@@ -74,14 +76,16 @@
:value=
"item.value"
/>
</el-select>
<!-- :default-value="defaultDisplayDate" -->
<el-date-picker
v-model=
"form[child.key]"
style=
"width: 100%"
v-if=
"child.domType === 'DatePicker'"
type=
"date"
:disabled-date=
"disabledDate"
:placeholder=
"child.placeholder"
:disabled=
"child.disabled"
:disabled-date=
"time => disabledDate(time, child)"
@
change=
"handleDateChange(child)"
/>
<el-input
v-if=
"child.domType === 'arrowRight'"
...
...
@@ -195,6 +199,9 @@
</div>
</template>
<
script
setup
name=
"policyholderInfo"
>
import
{
validateEnglish
}
from
'@/utils/validate'
import
{
calculateExactAge
}
from
'@/utils/date'
import
dayjs
from
'dayjs'
import
{
ArrowRight
}
from
'@element-plus/icons-vue'
import
policyDomData
from
'@/formJson/applicant'
import
Country
from
'@/views/components/country'
...
...
@@ -216,6 +223,9 @@ const props = defineProps({
appointmentStatus
:
{
type
:
Number
},
//父组件传递过来的预约的状态
customerInfo
:
{
type
:
Object
,
default
:
()
=>
({})
}
//客户详情回显表单用
})
//计算默认显示的日期(18年前的今天)
const
defaultDisplayDate
=
ref
(
dayjs
().
subtract
(
18
,
'year'
).
toDate
())
const
emit
=
defineEmits
([
'handleSuccessEdit'
])
const
{
proxy
}
=
getCurrentInstance
()
// const { csf_id_type, sys_gender } = proxy.useDict('csf_id_type', 'sys_gender')
...
...
@@ -316,8 +326,59 @@ const data = reactive({
})
const
{
form
,
rules
,
processedPolicyData
,
queryParams
,
oldAppointmentData
,
tempPolicyForm
}
=
toRefs
(
data
)
const
disabledDate
=
time
=>
{
// 获取表单项的校验规则
const
getRules
=
child
=>
{
const
rules
=
[]
// 必填校验
if
(
child
.
required
)
{
rules
.
push
({
required
:
true
,
message
:
`
${
child
.
label
}
不能为空`
,
trigger
:
'blur'
})
}
// 为英文姓名添加自定义校验
if
(
child
.
key
===
'nameEn'
)
{
rules
.
push
({
validator
:
validateEnglish
,
trigger
:
'change'
})
}
return
rules
}
const
handleInputChange
=
(
father
,
child
)
=>
{
switch
(
child
.
key
)
{
case
'nameEn'
:
validateEnglish
(
form
.
value
[
child
.
key
],
child
.
key
)
break
default
:
break
}
}
const
handleDateChange
=
child
=>
{
let
age
=
null
if
(
child
.
key
==
'birthday'
)
{
age
=
calculateExactAge
(
proxy
.
formatToDate
(
form
.
value
.
birthday
))
if
(
age
>=
0
)
{
form
.
value
.
age
=
age
}
}
}
const
disabledDate
=
(
time
,
child
)
=>
{
return
time
.
getTime
()
>
Date
.
now
()
// if (child.key == 'birthday') {
// // 计算18年前的今天
// const eighteenYearsAgo = dayjs().subtract(18, 'year')
// // 禁用今天之后的日期和18年前的今天之后的日期
// return time.getTime() > Date.now() || time.getTime() > eighteenYearsAgo.valueOf()
// } else {
// return time.getTime() > Date.now()
// }
}
const
exportInfo
=
()
=>
{
if
(
props
.
customerBizId
&&
editStatus
.
value
)
{
...
...
@@ -374,16 +435,16 @@ const fetchDictData = dictType => {
return
[]
}
}
// 添加英文校验函数
const
validateEnglish
=
(
rule
,
value
,
callback
)
=>
{
if
(
value
&&
!
/^
[
A-Za-z
]
*$/
.
test
(
value
))
{
// 清空非英文字符
form
.
value
.
firstNamePinyin
=
''
callback
(
new
Error
(
'只能输入英文字母'
))
}
else
{
callback
()
}
}
//
//
添加英文校验函数
//
const validateEnglish = (rule, value, callback) => {
//
if (value && !/^[A-Za-z]*$/.test(value)) {
//
// 清空非英文字符
//
form.value.firstNamePinyin = ''
//
callback(new Error('只能输入英文字母'))
//
} else {
//
callback()
//
}
//
}
const
mergeObjects
=
(
obj1
,
obj2
)
=>
{
const
result
=
Object
.
assign
({},
obj1
)
...
...
@@ -562,7 +623,11 @@ const processFormData = async obj => {
if
(
props
.
idsObj
.
appointmentBizId
)
{
field
.
disabled
=
true
}
else
{
field
.
disabled
=
false
if
(
field
.
key
==
'age'
)
{
field
.
disabled
=
true
}
else
{
field
.
disabled
=
false
}
}
}
}
...
...
@@ -605,6 +670,14 @@ const processFormData = async obj => {
}
else
{
editStatus
.
value
=
false
}
if
(
form
.
value
[
'birthday'
])
{
let
age
=
calculateExactAge
(
proxy
.
formatToDate
(
form
.
value
.
birthday
))
if
(
age
>=
0
)
{
form
.
value
.
age
=
age
}
}
else
{
form
.
value
.
age
=
null
}
processedPolicyData
.
value
=
oldAppointmentData
.
value
=
processedData
}
...
...
@@ -789,7 +862,11 @@ const handleEditStatus = status => {
if
(
editStatus
.
value
)
{
field
.
disabled
=
true
}
else
{
field
.
disabled
=
false
if
(
field
.
key
==
'age'
)
{
field
.
disabled
=
true
}
else
{
field
.
disabled
=
false
}
}
}
}
...
...
src/views/sign/appointment/components/secondHolderInfo.vue
View file @
56adb469
...
...
@@ -651,6 +651,15 @@ const handleFormValues = () => {
submitObj
[
key1
]
=
proxy
.
formatToDateTime
(
submitObj
[
key1
])
}
}
// if (Object.keys(submitObj).length > 0) {
// if (submitForm['documentType'] && !submitForm['idNumber']) {
// proxy.$message.error('请输入证件号码')
// return
// } else if(submitForm['idNumber'] && !submitForm['documentType']){
// proxy.$message.error('请输入证件类型')
// return
// }
// }
return
submitObj
}
// 表单提交
...
...
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