Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
M
mongo-ui
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
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
ui
mongo-ui
Commits
fbfc9905
Commit
fbfc9905
authored
Aug 26, 2020
by
郭志伟
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix: 万家保险种添加生日校验;顾问问卷问题修复
parent
d097ebb0
Changes
6
Show whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
105 additions
and
26 deletions
+105
-26
utils.js
src/service/utils.js
+13
-0
index.vue
src/views/Consultant/Question/index.vue
+16
-5
AIDetail.vue
src/views/Goods/Detail/AIDetail.vue
+23
-1
CIIDetail.vue
src/views/Goods/Detail/CIIDetail.vue
+24
-1
MIDetail.vue
src/views/Goods/Detail/MIDetail.vue
+25
-2
index.vue
src/views/Policy/Add/index.vue
+4
-17
No files found.
src/service/utils.js
View file @
fbfc9905
...
@@ -222,3 +222,16 @@ export function getRealAge(strBirthday) {
...
@@ -222,3 +222,16 @@ export function getRealAge(strBirthday) {
}
}
return
returnAge
;
//返回周岁年龄
return
returnAge
;
//返回周岁年龄
}
}
export
function
getBirthDate
(
idCard
)
{
let
birthday
=
""
;
if
(
idCard
)
{
if
(
idCard
.
length
==
15
)
{
birthday
=
"
19
"
+
idCard
.
substr
(
6
,
6
);
}
else
if
(
idCard
.
length
==
18
)
{
birthday
=
idCard
.
substr
(
6
,
8
);
}
birthday
=
birthday
.
replace
(
/
(
.
{4})(
.
{2})
/
,
"
$1-$2-
"
);
}
return
birthday
;
}
src/views/Consultant/Question/index.vue
View file @
fbfc9905
...
@@ -175,7 +175,7 @@ export default {
...
@@ -175,7 +175,7 @@ export default {
birthday
:
"
1990-01-01
"
,
birthday
:
"
1990-01-01
"
,
socialSecurity
:
""
,
socialSecurity
:
""
,
annualIncome
:
"
10万
"
,
annualIncome
:
"
10万
"
,
loan
:
"
无
房贷
"
,
loan
:
"
无
贷款
"
,
addressCode
:
"
北京市,北京市
"
,
addressCode
:
"
北京市,北京市
"
,
questionType
:
""
,
questionType
:
""
,
userName
:
""
,
userName
:
""
,
...
@@ -270,7 +270,7 @@ export default {
...
@@ -270,7 +270,7 @@ export default {
],
],
// 贷款
// 贷款
loanOptions
:
[
loanOptions
:
[
"
无
房贷
"
,
"
无
贷款
"
,
"
1000元
"
,
"
1000元
"
,
"
2000元
"
,
"
2000元
"
,
"
3000元
"
,
"
3000元
"
,
...
@@ -280,7 +280,7 @@ export default {
...
@@ -280,7 +280,7 @@ export default {
"
7000元
"
,
"
7000元
"
,
"
8000元
"
,
"
8000元
"
,
"
9000元
"
,
"
9000元
"
,
"
1万元
以上
"
,
"
1万元
"
,
"
1万元以上
"
"
1万元以上
"
],
],
solveOptions
:
[
solveOptions
:
[
...
@@ -300,8 +300,11 @@ export default {
...
@@ -300,8 +300,11 @@ export default {
currentStep
(
val
)
{
currentStep
(
val
)
{
this
.
$forceUpdate
();
this
.
$forceUpdate
();
if
(
val
===
3
)
{
if
(
val
===
3
)
{
if
(
this
.
formData
.
annualIncome
===
"
10万
"
)
{
this
.
setPickerDefaultVal
(
"
income
"
,
"
10万
"
,
this
.
incomeOptions
);
this
.
$refs
[
"
income
"
].
refreshColumns
();
this
.
$refs
[
"
income
"
].
refreshColumns
();
}
}
}
if
(
val
===
4
)
{
if
(
val
===
4
)
{
this
.
$refs
[
"
loan
"
].
refreshColumns
();
this
.
$refs
[
"
loan
"
].
refreshColumns
();
}
}
...
@@ -310,7 +313,6 @@ export default {
...
@@ -310,7 +313,6 @@ export default {
}
}
}
}
},
},
mounted
()
{},
methods
:
{
methods
:
{
nextQuestion
()
{
nextQuestion
()
{
const
{
currentStep
,
stepTips
,
formData
}
=
this
;
const
{
currentStep
,
stepTips
,
formData
}
=
this
;
...
@@ -344,6 +346,15 @@ export default {
...
@@ -344,6 +346,15 @@ export default {
}
}
this
.
formData
[
type
]
=
value
;
this
.
formData
[
type
]
=
value
;
},
},
setPickerDefaultVal
(
refName
,
value
,
options
)
{
setTimeout
(()
=>
{
const
$picker
=
this
.
$refs
[
refName
];
$picker
.
setColumnIndex
(
0
,
options
.
findIndex
(
item
=>
item
===
value
)
);
});
},
async
onSubmit
()
{
async
onSubmit
()
{
const
{
formData
}
=
this
;
const
{
formData
}
=
this
;
const
{
socialSecurity
,
gender
}
=
formData
;
const
{
socialSecurity
,
gender
}
=
formData
;
...
...
src/views/Goods/Detail/AIDetail.vue
View file @
fbfc9905
...
@@ -97,6 +97,7 @@ import localStorage from "@/service/localStorage";
...
@@ -97,6 +97,7 @@ import localStorage from "@/service/localStorage";
import
Detail
from
"
@/api/detail.zhongan.yiwai
"
;
import
Detail
from
"
@/api/detail.zhongan.yiwai
"
;
import
{
trail
,
list
}
from
"
@/api/product
"
;
import
{
trail
,
list
}
from
"
@/api/product
"
;
import
{
isIdNo
}
from
"
@/service/validation
"
;
import
{
isIdNo
}
from
"
@/service/validation
"
;
import
{
getRealAge
,
getBirthDate
}
from
"
@/service/utils
"
;
export
default
{
export
default
{
name
:
"
GoodsDetail-AI
"
,
name
:
"
GoodsDetail-AI
"
,
...
@@ -311,6 +312,26 @@ export default {
...
@@ -311,6 +312,26 @@ export default {
delete
this
.
subFormData
.
insuredUserInfo
;
delete
this
.
subFormData
.
insuredUserInfo
;
}
}
},
},
getRealIdNo
()
{
const
{
relation
,
userInfoSecId
:
userId
,
idNo
:
idNoMask
}
=
this
.
formData
;
const
{
selfSecId
:
holderUserId
,
selfIdNo
:
holderIdNoMask
}
=
this
.
formData
;
let
currentIdNo
=
!
relation
||
relation
===
"
1
"
?
holderIdNoMask
:
idNoMask
;
const
currentUserId
=
!
relation
||
relation
===
"
1
"
?
holderUserId
:
userId
;
const
familyList
=
this
.
$refs
[
"
insureForm
"
].
familyList
;
if
(
!
currentIdNo
)
return
""
;
currentIdNo
=
currentIdNo
.
indexOf
(
"
**
"
)
>
-
1
?
familyList
.
find
(
item
=>
item
.
userInfoSecId
===
currentUserId
).
idNo
:
currentIdNo
;
return
currentIdNo
;
},
checkAgeInRange
()
{
const
currentIdNo
=
this
.
getRealIdNo
();
if
(
!
currentIdNo
)
return
;
const
birthday
=
getBirthDate
(
currentIdNo
);
const
realAge
=
getRealAge
(
birthday
);
return
realAge
>=
18
&&
realAge
<=
65
;
},
async
getDetail
()
{
async
getDetail
()
{
this
.
goodId
=
this
.
$route
.
query
.
id
;
this
.
goodId
=
this
.
$route
.
query
.
id
;
const
res
=
await
list
();
const
res
=
await
list
();
...
@@ -330,7 +351,8 @@ export default {
...
@@ -330,7 +351,8 @@ export default {
let
idNoWho
=
!
relation
||
relation
===
"
1
"
?
selfIdNo
:
idNo
;
let
idNoWho
=
!
relation
||
relation
===
"
1
"
?
selfIdNo
:
idNo
;
let
idWho
=
!
relation
||
relation
===
"
1
"
?
selfSecId
:
userInfoSecId
;
let
idWho
=
!
relation
||
relation
===
"
1
"
?
selfSecId
:
userInfoSecId
;
idWho
=
idNoWho
.
indexOf
(
"
**
"
)
>
-
1
?
idWho
||
undefined
:
undefined
;
idWho
=
idNoWho
.
indexOf
(
"
**
"
)
>
-
1
?
idWho
||
undefined
:
undefined
;
if
(
!
idNoWho
&&
!
amountInsured
)
return
;
this
.
isCalPrice
=
this
.
checkAgeInRange
();
if
(
!
this
.
isCalPrice
||
(
!
idNoWho
&&
!
amountInsured
))
return
;
const
_param
=
{
const
_param
=
{
productNo
:
this
.
goodId
,
productNo
:
this
.
goodId
,
productUserInfo
:
{
productUserInfo
:
{
...
...
src/views/Goods/Detail/CIIDetail.vue
View file @
fbfc9905
...
@@ -90,10 +90,12 @@ import ProtocolRead from "./modules/ProtocolRead";
...
@@ -90,10 +90,12 @@ import ProtocolRead from "./modules/ProtocolRead";
import
NavTab
from
"
./modules/NavTab
"
;
import
NavTab
from
"
./modules/NavTab
"
;
import
detailLoginMixin
from
"
./modules/detailLogin.mixin
"
;
import
detailLoginMixin
from
"
./modules/detailLogin.mixin
"
;
import
fromNow
from
"
date-fns/formatDistanceToNowStrict
"
;
import
localStorage
from
"
@/service/localStorage
"
;
import
localStorage
from
"
@/service/localStorage
"
;
import
Detail
from
"
@/api/detail.huatai.zhongjixian
"
;
import
Detail
from
"
@/api/detail.huatai.zhongjixian
"
;
import
{
trail
,
list
}
from
"
@/api/product
"
;
import
{
trail
,
list
}
from
"
@/api/product
"
;
import
{
isIdNo
}
from
"
@/service/validation
"
;
import
{
isIdNo
}
from
"
@/service/validation
"
;
import
{
getRealAge
,
getBirthDate
}
from
"
@/service/utils
"
;
export
default
{
export
default
{
name
:
"
GoodsDetail-CII
"
,
name
:
"
GoodsDetail-CII
"
,
...
@@ -327,6 +329,26 @@ export default {
...
@@ -327,6 +329,26 @@ export default {
nextStep
()
{
nextStep
()
{
this
.
$router
.
push
({
path
:
"
/goods/inform
"
});
this
.
$router
.
push
({
path
:
"
/goods/inform
"
});
},
},
getRealIdNo
()
{
const
{
relation
,
userInfoSecId
:
userId
,
idNo
:
idNoMask
}
=
this
.
formData
;
const
{
selfSecId
:
holderUserId
,
selfIdNo
:
holderIdNoMask
}
=
this
.
formData
;
let
currentIdNo
=
!
relation
||
relation
===
"
1
"
?
holderIdNoMask
:
idNoMask
;
const
currentUserId
=
!
relation
||
relation
===
"
1
"
?
holderUserId
:
userId
;
const
familyList
=
this
.
$refs
[
"
insureForm
"
].
familyList
;
if
(
!
currentIdNo
)
return
""
;
currentIdNo
=
currentIdNo
.
indexOf
(
"
**
"
)
>
-
1
?
familyList
.
find
(
item
=>
item
.
userInfoSecId
===
currentUserId
).
idNo
:
currentIdNo
;
return
currentIdNo
;
},
checkAgeInRange
()
{
const
currentIdNo
=
this
.
getRealIdNo
();
if
(
!
currentIdNo
)
return
;
const
birthday
=
getBirthDate
(
currentIdNo
);
const
isOverMonth
=
birthday
&&
parseInt
(
fromNow
(
new
Date
(
birthday
),
{
unit
:
"
day
"
}))
>=
30
;
return
isOverMonth
&&
getRealAge
(
birthday
)
<=
50
;
},
async
getDetail
()
{
async
getDetail
()
{
this
.
goodId
=
this
.
$route
.
query
.
id
;
this
.
goodId
=
this
.
$route
.
query
.
id
;
const
res
=
await
list
();
const
res
=
await
list
();
...
@@ -353,7 +375,8 @@ export default {
...
@@ -353,7 +375,8 @@ export default {
userInfoSecId
userInfoSecId
}
=
this
.
formData
;
}
=
this
.
formData
;
let
idNoWho
=
!
relation
||
relation
===
"
1
"
?
selfIdNo
:
idNo
;
let
idNoWho
=
!
relation
||
relation
===
"
1
"
?
selfIdNo
:
idNo
;
if
(
!
idNoWho
||
!
payType
)
return
;
this
.
isCalPrice
=
this
.
checkAgeInRange
();
if
(
!
idNoWho
||
!
payType
||
!
this
.
isCalPrice
)
return
;
const
_param
=
{
const
_param
=
{
productNo
:
this
.
goodId
,
productNo
:
this
.
goodId
,
productUserInfo
:
{
productUserInfo
:
{
...
...
src/views/Goods/Detail/MIDetail.vue
View file @
fbfc9905
...
@@ -90,8 +90,10 @@ import NavTab from "./modules/NavTab";
...
@@ -90,8 +90,10 @@ import NavTab from "./modules/NavTab";
import
detailPayMixin
from
"
./modules/detailPay.mixin
"
;
import
detailPayMixin
from
"
./modules/detailPay.mixin
"
;
import
detailLoginMixin
from
"
./modules/detailLogin.mixin
"
;
import
detailLoginMixin
from
"
./modules/detailLogin.mixin
"
;
import
fromNow
from
"
date-fns/formatDistanceToNowStrict
"
;
import
{
trail
,
list
}
from
"
@/api/product
"
;
import
{
trail
,
list
}
from
"
@/api/product
"
;
import
localStorage
from
"
@/service/localStorage
"
;
import
localStorage
from
"
@/service/localStorage
"
;
import
{
getRealAge
,
getBirthDate
}
from
"
@/service/utils
"
;
import
Detail
from
"
@/api/detail.taikang.yiliaobaozhang
"
;
import
Detail
from
"
@/api/detail.taikang.yiliaobaozhang
"
;
import
{
isIdNo
}
from
"
@/service/validation
"
;
import
{
isIdNo
}
from
"
@/service/validation
"
;
...
@@ -219,7 +221,7 @@ export default {
...
@@ -219,7 +221,7 @@ export default {
},
},
onSubmit
()
{
onSubmit
()
{
if
(
!
this
.
isCalPrice
)
{
if
(
!
this
.
isCalPrice
)
{
this
.
$notify
({
type
:
"
warn
"
,
message
:
"
被保人年龄不在可投保范围,请仔细核对
"
});
this
.
$notify
({
type
:
"
warn
ing
"
,
message
:
"
被保人年龄不在可投保范围,请仔细核对
"
});
return
;
return
;
}
}
if
(
localStorage
.
get
(
"
mongoToken
"
))
{
if
(
localStorage
.
get
(
"
mongoToken
"
))
{
...
@@ -320,6 +322,26 @@ export default {
...
@@ -320,6 +322,26 @@ export default {
delete
this
.
subFormData
.
insuredUserInfo
;
delete
this
.
subFormData
.
insuredUserInfo
;
}
}
},
},
getRealIdNo
()
{
const
{
relation
,
userInfoSecId
:
userId
,
idNo
:
idNoMask
}
=
this
.
formData
;
const
{
selfSecId
:
holderUserId
,
selfIdNo
:
holderIdNoMask
}
=
this
.
formData
;
let
currentIdNo
=
!
relation
||
relation
===
"
1
"
?
holderIdNoMask
:
idNoMask
;
const
currentUserId
=
!
relation
||
relation
===
"
1
"
?
holderUserId
:
userId
;
const
familyList
=
this
.
$refs
[
"
insureForm
"
].
familyList
;
if
(
!
currentIdNo
)
return
""
;
currentIdNo
=
currentIdNo
.
indexOf
(
"
**
"
)
>
-
1
?
familyList
.
find
(
item
=>
item
.
userInfoSecId
===
currentUserId
).
idNo
:
currentIdNo
;
return
currentIdNo
;
},
checkAgeInRange
()
{
const
currentIdNo
=
this
.
getRealIdNo
();
if
(
!
currentIdNo
)
return
;
const
birthday
=
getBirthDate
(
currentIdNo
);
const
isOverMonth
=
birthday
&&
parseInt
(
fromNow
(
new
Date
(
birthday
),
{
unit
:
"
day
"
}))
>=
30
;
return
isOverMonth
&&
getRealAge
(
birthday
)
<=
60
;
},
async
getDetail
()
{
async
getDetail
()
{
this
.
goodId
=
this
.
$route
.
query
.
id
;
this
.
goodId
=
this
.
$route
.
query
.
id
;
const
res
=
await
list
();
const
res
=
await
list
();
...
@@ -337,7 +359,8 @@ export default {
...
@@ -337,7 +359,8 @@ export default {
let
{
price
,
subPrice
}
=
this
.
headerInfo
;
let
{
price
,
subPrice
}
=
this
.
headerInfo
;
const
{
idNo
,
socialSecurity
,
payType
,
userInfoSecId
,
relation
,
selfIdNo
}
=
this
.
formData
;
const
{
idNo
,
socialSecurity
,
payType
,
userInfoSecId
,
relation
,
selfIdNo
}
=
this
.
formData
;
let
idNoWho
=
!
relation
||
relation
===
"
1
"
?
selfIdNo
:
idNo
;
let
idNoWho
=
!
relation
||
relation
===
"
1
"
?
selfIdNo
:
idNo
;
if
(
!
idNoWho
||
!
payType
||
!
socialSecurity
)
return
;
this
.
isCalPrice
=
this
.
checkAgeInRange
();
if
(
!
idNoWho
||
!
payType
||
!
socialSecurity
||
!
this
.
isCalPrice
)
return
;
const
_param
=
{
const
_param
=
{
productNo
:
this
.
goodId
,
productNo
:
this
.
goodId
,
productUserInfo
:
{
productUserInfo
:
{
...
...
src/views/Policy/Add/index.vue
View file @
fbfc9905
...
@@ -527,7 +527,7 @@ import autoSaveForm from "@/mixins/autoSaveForm.mixin";
...
@@ -527,7 +527,7 @@ import autoSaveForm from "@/mixins/autoSaveForm.mixin";
import
liCalFee
from
"
@/views/Goods/Detail/modules/liCalFee.mixin
"
;
import
liCalFee
from
"
@/views/Goods/Detail/modules/liCalFee.mixin
"
;
import
{
addDays
,
addYears
,
format
as
dateFormat
}
from
"
date-fns
"
;
import
{
addDays
,
addYears
,
format
as
dateFormat
}
from
"
date-fns
"
;
import
debounce
from
"
lodash/debounce
"
;
import
debounce
from
"
lodash/debounce
"
;
import
{
getRealAge
}
from
"
@/service/utils
"
;
import
{
getRealAge
,
getBirthDate
}
from
"
@/service/utils
"
;
import
localStorage
from
"
@/service/localStorage
"
;
import
localStorage
from
"
@/service/localStorage
"
;
import
{
mapState
,
mapActions
}
from
"
vuex
"
;
import
{
mapState
,
mapActions
}
from
"
vuex
"
;
import
Detail
from
"
@/api/detail.huagui.shouxian
"
;
import
Detail
from
"
@/api/detail.huagui.shouxian
"
;
...
@@ -706,7 +706,7 @@ export default {
...
@@ -706,7 +706,7 @@ export default {
age
()
{
age
()
{
const
currentIdNo
=
this
.
getRealIdNo
();
const
currentIdNo
=
this
.
getRealIdNo
();
if
(
!
currentIdNo
)
return
;
if
(
!
currentIdNo
)
return
;
const
birthday
=
this
.
getBirthDate
(
currentIdNo
);
const
birthday
=
getBirthDate
(
currentIdNo
);
const
userAge
=
birthday
?
getRealAge
(
birthday
)
:
""
;
const
userAge
=
birthday
?
getRealAge
(
birthday
)
:
""
;
return
isNaN
(
userAge
)
?
18
:
userAge
;
return
isNaN
(
userAge
)
?
18
:
userAge
;
},
},
...
@@ -913,19 +913,6 @@ export default {
...
@@ -913,19 +913,6 @@ export default {
}
}
this
.
$forceUpdate
();
this
.
$forceUpdate
();
},
},
getBirthDate
(
idCard
)
{
let
birthday
=
""
;
if
(
idCard
)
{
if
(
idCard
.
length
==
15
)
{
birthday
=
"
19
"
+
idCard
.
substr
(
6
,
6
);
}
else
if
(
idCard
.
length
==
18
)
{
birthday
=
idCard
.
substr
(
6
,
8
);
}
birthday
=
birthday
.
replace
(
/
(
.
{4})(
.
{2})
/
,
"
$1-$2-
"
);
}
return
birthday
;
},
getRealIdNo
()
{
getRealIdNo
()
{
const
{
relation
,
userInfoSecId
:
userId
,
idNo
:
idNoMask
}
=
this
.
formData
.
insuredUserInfo
;
const
{
relation
,
userInfoSecId
:
userId
,
idNo
:
idNoMask
}
=
this
.
formData
.
insuredUserInfo
;
const
{
userInfoSecId
:
holderUserId
,
idNo
:
holderIdNoMask
}
=
this
.
formData
.
holderUserInfo
;
const
{
userInfoSecId
:
holderUserId
,
idNo
:
holderIdNoMask
}
=
this
.
formData
.
holderUserInfo
;
...
@@ -941,7 +928,7 @@ export default {
...
@@ -941,7 +928,7 @@ export default {
setEffectiveDate
:
debounce
(
function
()
{
setEffectiveDate
:
debounce
(
function
()
{
const
currentIdNo
=
this
.
getRealIdNo
();
const
currentIdNo
=
this
.
getRealIdNo
();
if
(
!
currentIdNo
)
return
;
if
(
!
currentIdNo
)
return
;
const
birthday
=
this
.
getBirthDate
(
currentIdNo
);
const
birthday
=
getBirthDate
(
currentIdNo
);
const
birthdayArr
=
birthday
.
split
(
"
-
"
);
const
birthdayArr
=
birthday
.
split
(
"
-
"
);
const
currentdayArr
=
dateFormat
(
new
Date
(),
"
yyyy-MM-dd
"
).
split
(
"
-
"
);
const
currentdayArr
=
dateFormat
(
new
Date
(),
"
yyyy-MM-dd
"
).
split
(
"
-
"
);
const
nextDate
=
const
nextDate
=
...
@@ -952,7 +939,7 @@ export default {
...
@@ -952,7 +939,7 @@ export default {
}),
}),
resetFormItemVal
(
key
,
val
)
{
resetFormItemVal
(
key
,
val
)
{
const
currentIdNo
=
this
.
getRealIdNo
();
const
currentIdNo
=
this
.
getRealIdNo
();
const
birthday
=
this
.
getBirthDate
(
currentIdNo
);
const
birthday
=
getBirthDate
(
currentIdNo
);
if
(
birthday
&&
this
.
formData
.
productItem
[
key
]
===
val
&&
val
)
{
if
(
birthday
&&
this
.
formData
.
productItem
[
key
]
===
val
&&
val
)
{
switch
(
key
)
{
switch
(
key
)
{
case
"
amountInsured
"
:
case
"
amountInsured
"
:
...
...
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