bxs-tools-ui 3.2.1 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -20
- package/es/add-and-take/index.css +1 -1
- package/es/add-and-take/index.js +283 -64
- package/es/adjust-baoe/index.css +1 -1
- package/es/adjust-baoe/index.js +444 -195
- package/es/business-card/index.css +1 -1
- package/es/business-card/index.js +1 -0
- package/es/canvas-poster/index.css +1 -1
- package/es/canvas-poster/index.js +1 -0
- package/es/index.css +1 -1
- package/es/index.js +950 -839
- package/es/insure-calculate/index.css +1 -1
- package/es/insure-calculate/index.js +438 -265
- package/es/person-info/index.css +1 -1
- package/es/person-info/index.js +296 -1370
- package/es/product-info/index.css +1 -1
- package/es/product-info/index.js +644 -548
- package/es/share-sheet/index.css +1 -1
- package/es/share-sheet/index.js +321 -30
- package/es/utils/index.js +530 -429
- package/lib/add-and-take/index.css +1 -1
- package/lib/add-and-take/index.js +283 -64
- package/lib/adjust-baoe/index.css +1 -1
- package/lib/adjust-baoe/index.js +441 -194
- package/lib/business-card/index.css +1 -1
- package/lib/business-card/index.js +1 -0
- package/lib/canvas-poster/index.css +1 -1
- package/lib/canvas-poster/index.js +1 -0
- package/lib/index.css +1 -1
- package/lib/index.js +953 -841
- package/lib/insure-calculate/index.css +1 -1
- package/lib/insure-calculate/index.js +438 -268
- package/lib/person-info/index.css +1 -1
- package/lib/person-info/index.js +295 -1372
- package/lib/product-info/index.css +1 -1
- package/lib/product-info/index.js +645 -550
- package/lib/share-sheet/index.css +1 -1
- package/lib/share-sheet/index.js +321 -34
- package/lib/utils/index.js +531 -433
- package/package.json +9 -7
- package/packages/add-and-take/components/interest-form.less +144 -0
- package/packages/add-and-take/components/interest-form.vue +179 -179
- package/packages/add-and-take/components/interest-items.less +87 -0
- package/packages/add-and-take/components/interest-items.vue +67 -80
- package/packages/add-and-take/components/interest-table.less +111 -0
- package/packages/add-and-take/components/interest-table.vue +31 -31
- package/packages/add-and-take/constant.ts +2 -2
- package/packages/add-and-take/demo/index.vue +89 -86
- package/packages/add-and-take/handler.ts +52 -57
- package/packages/add-and-take/index.less +69 -0
- package/packages/add-and-take/index.vue +156 -156
- package/packages/add-and-take/readme.md +87 -98
- package/packages/adjust-baoe/demo/index.vue +37 -47
- package/packages/adjust-baoe/index.less +125 -0
- package/packages/adjust-baoe/index.vue +134 -147
- package/packages/adjust-baoe/readme.md +35 -45
- package/packages/business-card/demo/index.vue +7 -7
- package/packages/business-card/index.less +100 -0
- package/packages/business-card/index.vue +18 -21
- package/packages/business-card/readme.md +46 -53
- package/packages/bxs-utils/demo/index.vue +2 -2
- package/packages/bxs-utils/index.ts +5 -5
- package/packages/bxs-utils/planbook/common.ts +56 -92
- package/packages/bxs-utils/planbook/index.ts +4 -4
- package/packages/bxs-utils/planbook/insurance.ts +137 -127
- package/packages/bxs-utils/planbook/person.ts +143 -147
- package/packages/bxs-utils/planbook/product.ts +473 -509
- package/packages/bxs-utils/readme.md +94 -84
- package/packages/bxs-utils/trade/index.js +1 -1
- package/packages/bxs-utils/trade/insureCalculate.js +91 -204
- package/packages/canvas-poster/demo/index.vue +9 -13
- package/packages/canvas-poster/index.less +5 -0
- package/packages/canvas-poster/index.vue +68 -79
- package/packages/canvas-poster/readme.md +106 -109
- package/packages/index.ts +1 -1
- package/packages/insure-calculate/demo/index.vue +20 -20
- package/packages/insure-calculate/index.less +366 -0
- package/packages/insure-calculate/index.vue +305 -329
- package/packages/insure-calculate/readme.md +99 -106
- package/packages/person-info/crm-popup.vue +81 -80
- package/packages/person-info/demo/index.vue +25 -37
- package/packages/person-info/index-inline.less +11 -0
- package/packages/person-info/index.vue +53 -83
- package/packages/person-info/readme.md +109 -115
- package/packages/planbook-input/components/footer.less +54 -0
- package/packages/planbook-input/components/footer.vue +8 -64
- package/packages/planbook-input/components/handler.js +33 -44
- package/packages/planbook-input/components/product-table.less +235 -0
- package/packages/planbook-input/components/product-table.vue +114 -108
- package/packages/planbook-input/demo/index.vue +3 -3
- package/packages/planbook-input/helper.js +852 -465
- package/packages/planbook-input/index.less +30 -0
- package/packages/planbook-input/index.vue +86 -103
- package/packages/planbook-input/readme.md +72 -90
- package/packages/product-info/demo/constant.js +1 -1
- package/packages/product-info/demo/index.vue +31 -43
- package/packages/product-info/index.less +271 -0
- package/packages/product-info/index.vue +198 -210
- package/packages/product-info/readme.md +72 -75
- package/packages/share-sheet/constant.js +6 -11
- package/packages/share-sheet/demo/index.vue +24 -24
- package/packages/share-sheet/handler.js +14 -14
- package/packages/share-sheet/index.less +201 -0
- package/packages/share-sheet/index.vue +43 -43
- package/packages/share-sheet/readme.md +121 -127
- package/src/api/add-and-take.js +45 -0
- package/src/api/adjust-baoe.js +16 -0
- package/src/api/index.js +6 -0
- package/src/api/planbook.js +93 -0
- package/src/api/request.js +211 -0
- package/src/api/trade.js +56 -0
- package/src/api/user.js +18 -0
- package/src/components/common/common-age-birthday.less +66 -0
- package/src/components/common/common-age-birthday.vue +27 -95
- package/src/components/common/common-popup.less +81 -0
- package/src/components/common/common-popup.vue +12 -96
- package/src/components/common/common-radio.less +75 -0
- package/src/components/common/common-radio.vue +13 -91
- package/src/components/common/common-select.less +13 -0
- package/src/components/common/common-select.vue +21 -38
- package/src/components/common/common-title.less +115 -0
- package/src/components/common/common-title.vue +24 -24
- package/src/js/loading.js +6 -6
- package/src/js/md5Token.js +38 -44
- package/src/js/utils.js +45 -53
- package/src/js/variables.js +47 -25
- package/src/style/base.less +18 -0
- package/src/style/color.less +40 -0
- package/src/style/variables.less +21 -42
- package/packages/add-and-take/api.ts +0 -70
- package/packages/add-and-take/components/interest-form.css +0 -146
- package/packages/add-and-take/components/interest-items.css +0 -87
- package/packages/add-and-take/components/interest-table.css +0 -113
- package/packages/add-and-take/index.css +0 -70
- package/packages/adjust-baoe/index.css +0 -123
- package/packages/business-card/index.css +0 -101
- package/packages/canvas-poster/index.css +0 -5
- package/packages/insure-calculate/index.css +0 -368
- package/packages/planbook-input/api.js +0 -29
- package/packages/planbook-input/components/product-table.css +0 -236
- package/packages/planbook-input/index.css +0 -31
- package/packages/product-info/index.css +0 -264
- package/packages/share-sheet/index.css +0 -190
- package/src/components/common/common-title.css +0 -116
- package/src/js/request.js +0 -64
- package/src/style/apply.css +0 -25
- package/src/style/base.css +0 -36
- package/src/style/color.css +0 -74
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { consoleLogWhenEnable, convertEleOrderListToObj } from './common'
|
|
1
|
+
import { consoleLogWhenEnable, convertEleOrderListToObj } from './common'
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* **初始化人员数据**
|
|
@@ -12,14 +12,14 @@ import { consoleLogWhenEnable, convertEleOrderListToObj } from './common';
|
|
|
12
12
|
* @param {object} verifyData 必传。计划书校验条件
|
|
13
13
|
* @returns {void}
|
|
14
14
|
*/
|
|
15
|
-
export function initPersonData(inputData
|
|
16
|
-
let personData = inputData.personData
|
|
15
|
+
export function initPersonData(inputData: IPbInput, verifyData: any): void {
|
|
16
|
+
let personData = inputData.personData
|
|
17
17
|
if (!personData || !personData.personOrderList) {
|
|
18
|
-
return
|
|
18
|
+
return
|
|
19
19
|
}
|
|
20
|
-
let personOrderList = personData.personOrderList
|
|
20
|
+
let personOrderList = personData.personOrderList
|
|
21
21
|
if (!personOrderList || !personOrderList.length) {
|
|
22
|
-
return
|
|
22
|
+
return
|
|
23
23
|
}
|
|
24
24
|
const insuranceList: IProdInsurance[] = (inputData.productGroupList || [])
|
|
25
25
|
.map(g => g.prodOrderList || [])
|
|
@@ -27,11 +27,24 @@ export function initPersonData(inputData : IPbInput, verifyData : any) : void {
|
|
|
27
27
|
.map(p => p.mulInsOrderList || [])
|
|
28
28
|
.flat()
|
|
29
29
|
.filter((ins): ins is IProdInsurance => !!ins)
|
|
30
|
-
const hasHuomian = insuranceList.some(e => e.huomian === 'touHuomian')
|
|
30
|
+
const hasHuomian = insuranceList.some(e => e.huomian === 'touHuomian')
|
|
31
|
+
|
|
32
|
+
|
|
33
|
+
|
|
31
34
|
personOrderList.forEach(person => {
|
|
32
35
|
if (!person || !person.eleOrderList) {
|
|
33
|
-
return
|
|
36
|
+
return
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
// 投保人年龄默认范围调整到「16-99岁」。From hyw
|
|
40
|
+
if (person.key === 'applicantInfo') {
|
|
41
|
+
person.eleOrderList.forEach(ele => {
|
|
42
|
+
if (ele.key === 'age') {
|
|
43
|
+
ele.opts = [16, 99]
|
|
44
|
+
}
|
|
45
|
+
})
|
|
34
46
|
}
|
|
47
|
+
|
|
35
48
|
person.createArchive = person.createArchive || false
|
|
36
49
|
person.cid = person.cid || null
|
|
37
50
|
if (!person.eleOrderList.find(e => e.key === 'name')) {
|
|
@@ -42,7 +55,7 @@ export function initPersonData(inputData : IPbInput, verifyData : any) : void {
|
|
|
42
55
|
placeholder: '请输入姓名',
|
|
43
56
|
componentName: 'cmCommonInput',
|
|
44
57
|
maxlength: 16,
|
|
45
|
-
isHide:
|
|
58
|
+
isHide: true
|
|
46
59
|
})
|
|
47
60
|
}
|
|
48
61
|
// 投保人添加元素:投被保人是同一人
|
|
@@ -57,11 +70,11 @@ export function initPersonData(inputData : IPbInput, verifyData : any) : void {
|
|
|
57
70
|
{ val: 0, desc: '非同一人' },
|
|
58
71
|
{ val: 1, desc: '是同一人' }
|
|
59
72
|
]
|
|
60
|
-
})
|
|
73
|
+
})
|
|
61
74
|
}
|
|
62
75
|
}
|
|
63
76
|
// 添加元素:生日
|
|
64
|
-
let index = person.eleOrderList.findIndex(e => e.key === 'age')
|
|
77
|
+
let index = person.eleOrderList.findIndex(e => e.key === 'age')
|
|
65
78
|
if (person.eleOrderList.every(e => e.key !== 'birthday')) {
|
|
66
79
|
person.eleOrderList.splice(index + 1, 0, {
|
|
67
80
|
key: 'birthday',
|
|
@@ -72,60 +85,62 @@ export function initPersonData(inputData : IPbInput, verifyData : any) : void {
|
|
|
72
85
|
minDate: null,
|
|
73
86
|
maxDate: null,
|
|
74
87
|
defaulValue: null
|
|
75
|
-
})
|
|
88
|
+
})
|
|
76
89
|
}
|
|
77
90
|
|
|
78
91
|
// 设置计划书年龄范围,即被保人年龄范围
|
|
79
|
-
let ageRange = getInsuredAgeRange(inputData, verifyData)
|
|
92
|
+
let ageRange = getInsuredAgeRange(inputData, verifyData)
|
|
80
93
|
if (ageRange) {
|
|
81
|
-
personOrderList.forEach((person
|
|
94
|
+
personOrderList.forEach((person: IPbPerson) => {
|
|
82
95
|
if (person.key === 'insuredInfo' && ageRange[`${person.key}1`] && ageRange[`${person.key}1`].length) {
|
|
83
|
-
person.eleOrderList &&
|
|
84
|
-
|
|
85
|
-
ele.
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
96
|
+
person.eleOrderList &&
|
|
97
|
+
person.eleOrderList.forEach(ele => {
|
|
98
|
+
if (ele.key === 'age') {
|
|
99
|
+
ele.opts = ageRange[`${person.key}1`]
|
|
100
|
+
// 男女年龄取值范围不同
|
|
101
|
+
if (
|
|
102
|
+
ageRange[`${person.key}2`].length &&
|
|
103
|
+
ele.opts &&
|
|
104
|
+
(ele.opts[0] !== ageRange[`${person.key}2`][0] || ele.opts[1] !== ageRange[`${person.key}2`][1])
|
|
105
|
+
) {
|
|
106
|
+
ele.optsF = ageRange[`${person.key}2`]
|
|
107
|
+
}
|
|
92
108
|
}
|
|
93
|
-
}
|
|
94
|
-
});
|
|
109
|
+
})
|
|
95
110
|
}
|
|
96
|
-
})
|
|
111
|
+
})
|
|
97
112
|
}
|
|
98
113
|
|
|
99
114
|
// 转化一些必要数据
|
|
100
115
|
person.eleOrderList.forEach(e => {
|
|
101
116
|
switch (e.key) {
|
|
102
117
|
case 'title': {
|
|
103
|
-
e.isDisabled = e.isDisabled || null
|
|
104
|
-
e.componentName = 'cmCommonTitle'
|
|
118
|
+
e.isDisabled = e.isDisabled || null
|
|
119
|
+
e.componentName = 'cmCommonTitle'
|
|
105
120
|
switch (person.key) {
|
|
106
121
|
case 'insuredInfo':
|
|
107
|
-
e.isDisabled = true
|
|
108
|
-
e.label = '被保人信息'
|
|
109
|
-
break
|
|
122
|
+
e.isDisabled = true
|
|
123
|
+
e.label = '被保人信息'
|
|
124
|
+
break
|
|
110
125
|
case 'applicantInfo':
|
|
111
|
-
e.label = hasHuomian ? '投保人信息(豁免相关)' : '投保人信息'
|
|
112
|
-
break
|
|
126
|
+
e.label = hasHuomian ? '投保人信息(豁免相关)' : '投保人信息'
|
|
127
|
+
break
|
|
113
128
|
case 'spouseInfo':
|
|
114
|
-
e.label = '投保人配偶信息'
|
|
115
|
-
break
|
|
129
|
+
e.label = '投保人配偶信息'
|
|
130
|
+
break
|
|
116
131
|
default:
|
|
117
|
-
e.label = e.label || person.label || '人员信息'
|
|
118
|
-
break
|
|
132
|
+
e.label = e.label || person.label || '人员信息'
|
|
133
|
+
break
|
|
119
134
|
}
|
|
120
|
-
break
|
|
135
|
+
break
|
|
121
136
|
}
|
|
122
137
|
case 'sex': {
|
|
123
|
-
e.label = '性别'
|
|
124
|
-
e.componentName = 'cmCommonRadio'
|
|
138
|
+
e.label = '性别'
|
|
139
|
+
e.componentName = 'cmCommonRadio'
|
|
125
140
|
e.options = [
|
|
126
141
|
{ val: 1, desc: '男' },
|
|
127
142
|
{ val: 2, desc: '女' }
|
|
128
|
-
]
|
|
143
|
+
]
|
|
129
144
|
if (e.opts && e.opts.length) {
|
|
130
145
|
e.options = e.opts.map(o => ({
|
|
131
146
|
val: o.val,
|
|
@@ -135,20 +150,20 @@ export function initPersonData(inputData : IPbInput, verifyData : any) : void {
|
|
|
135
150
|
if (!e.options.find(o => o.val === e.value)) {
|
|
136
151
|
e.value = e.options[0].val
|
|
137
152
|
}
|
|
138
|
-
e.isDisabled = person.key === 'spouseInfo'
|
|
139
|
-
break
|
|
153
|
+
e.isDisabled = person.key === 'spouseInfo'
|
|
154
|
+
break
|
|
140
155
|
}
|
|
141
156
|
case 'age': {
|
|
142
|
-
e.label = '
|
|
143
|
-
e.componentName = 'cmAgeBirthday'
|
|
144
|
-
e.placeholder = '请选择年龄'
|
|
145
|
-
e.options = []
|
|
146
|
-
break
|
|
157
|
+
e.label = '投保时年龄'
|
|
158
|
+
e.componentName = 'cmAgeBirthday'
|
|
159
|
+
e.placeholder = '请选择年龄'
|
|
160
|
+
e.options = []
|
|
161
|
+
break
|
|
147
162
|
}
|
|
148
163
|
}
|
|
149
|
-
})
|
|
150
|
-
setPersonAgeOptions(person)
|
|
151
|
-
})
|
|
164
|
+
})
|
|
165
|
+
setPersonAgeOptions(person)
|
|
166
|
+
})
|
|
152
167
|
}
|
|
153
168
|
|
|
154
169
|
/**
|
|
@@ -161,59 +176,59 @@ export function initPersonData(inputData : IPbInput, verifyData : any) : void {
|
|
|
161
176
|
* @param {IPbPersons} allPersonsData 必传。所有人员的数据
|
|
162
177
|
* @returns {IPbPersons} 所有人员的数据
|
|
163
178
|
*/
|
|
164
|
-
export function personDataHandler(allPersonsData
|
|
179
|
+
export function personDataHandler(allPersonsData: IPbPersons): IPbPersons {
|
|
165
180
|
if (!allPersonsData || !allPersonsData.personOrderList) {
|
|
166
|
-
return allPersonsData
|
|
181
|
+
return allPersonsData
|
|
167
182
|
}
|
|
168
183
|
|
|
169
|
-
allPersonsData.personOrderList.forEach((person
|
|
170
|
-
setPersonAgeOptions(person)
|
|
171
|
-
const insuredData = arr.find(p => p.key === 'insuredInfo') as IPbPerson
|
|
172
|
-
const applicantData = arr.find(p => p.key === 'applicantInfo') as IPbPerson
|
|
173
|
-
const insuredInfo = convertPersonData(allPersonsData, 'insuredInfo') as IPbPerson
|
|
174
|
-
const applicantInfo = convertPersonData(allPersonsData, 'applicantInfo') as IPbPerson
|
|
184
|
+
allPersonsData.personOrderList.forEach((person: IPbPerson, i, arr) => {
|
|
185
|
+
setPersonAgeOptions(person)
|
|
186
|
+
const insuredData = arr.find(p => p.key === 'insuredInfo') as IPbPerson
|
|
187
|
+
const applicantData = arr.find(p => p.key === 'applicantInfo') as IPbPerson
|
|
188
|
+
const insuredInfo = convertPersonData(allPersonsData, 'insuredInfo') as IPbPerson
|
|
189
|
+
const applicantInfo = convertPersonData(allPersonsData, 'applicantInfo') as IPbPerson
|
|
175
190
|
if (person.key === 'insuredInfo' && applicantData && applicantData.eleOrderList) {
|
|
176
191
|
// 关于被保人、投保人是否是同一人的处理
|
|
177
192
|
// 被保人所选年龄不在投保人年龄范围内,强制选中投保人。即被保人年龄不能做投保人
|
|
178
|
-
const applicantAge = <IPersonElement>applicantData.eleOrderList.find(e => e.key === 'age')
|
|
179
|
-
const applicantTitle = <IPersonElement>applicantData.eleOrderList.find(e => e.key === 'title')
|
|
180
|
-
const applicantSame = <IPersonElement>applicantData.eleOrderList.find(e => e.key === 'applicantAndInsuredSame')
|
|
193
|
+
const applicantAge = <IPersonElement>applicantData.eleOrderList.find(e => e.key === 'age')
|
|
194
|
+
const applicantTitle = <IPersonElement>applicantData.eleOrderList.find(e => e.key === 'title')
|
|
195
|
+
const applicantSame = <IPersonElement>applicantData.eleOrderList.find(e => e.key === 'applicantAndInsuredSame')
|
|
181
196
|
if (applicantAge.opts && insuredInfo.age >= applicantAge.opts[0] && insuredInfo.age <= applicantAge.opts[1]) {
|
|
182
197
|
if (applicantTitle) {
|
|
183
|
-
applicantTitle.isDisabled = false
|
|
198
|
+
applicantTitle.isDisabled = false
|
|
184
199
|
}
|
|
185
200
|
if (applicantSame) {
|
|
186
|
-
applicantSame.isDisabled = null
|
|
187
|
-
applicantSame.isHide = null
|
|
201
|
+
applicantSame.isDisabled = null
|
|
202
|
+
applicantSame.isHide = null
|
|
188
203
|
}
|
|
189
204
|
} else {
|
|
190
205
|
if (applicantTitle) {
|
|
191
|
-
applicantTitle.value = true
|
|
192
|
-
applicantTitle.isDisabled = true
|
|
206
|
+
applicantTitle.value = true
|
|
207
|
+
applicantTitle.isDisabled = true
|
|
193
208
|
}
|
|
194
209
|
if (applicantSame) {
|
|
195
|
-
applicantSame.value = 0
|
|
196
|
-
applicantSame.isDisabled = true
|
|
197
|
-
applicantSame.isHide = true
|
|
210
|
+
applicantSame.value = 0
|
|
211
|
+
applicantSame.isDisabled = true
|
|
212
|
+
applicantSame.isHide = true
|
|
198
213
|
}
|
|
199
214
|
}
|
|
200
215
|
}
|
|
201
216
|
if (person.key === 'applicantInfo' && person.eleOrderList) {
|
|
202
217
|
// 投被保人为是否为同一人的相关逻辑
|
|
203
|
-
const applicantSame = person.eleOrderList.find(e => e.key === 'applicantAndInsuredSame')
|
|
218
|
+
const applicantSame = person.eleOrderList.find(e => e.key === 'applicantAndInsuredSame')
|
|
204
219
|
if (applicantSame) {
|
|
205
220
|
person.eleOrderList.forEach(ele => {
|
|
206
221
|
if (['title', 'applicantAndInsuredSame'].includes(ele.key)) {
|
|
207
|
-
return
|
|
222
|
+
return
|
|
208
223
|
}
|
|
209
224
|
person.cid = applicantSame.value ? insuredData.cid : person.cid
|
|
210
225
|
if (applicantSame.value && insuredData.eleOrderList) {
|
|
211
|
-
const insuredEle = insuredData.eleOrderList.find(e => e.key === ele.key)
|
|
226
|
+
const insuredEle = insuredData.eleOrderList.find(e => e.key === ele.key)
|
|
212
227
|
if (insuredEle) {
|
|
213
|
-
ele.value = insuredEle.value
|
|
228
|
+
ele.value = insuredEle.value
|
|
214
229
|
}
|
|
215
230
|
}
|
|
216
|
-
})
|
|
231
|
+
})
|
|
217
232
|
}
|
|
218
233
|
}
|
|
219
234
|
// 选中投保人才能选投保人配偶
|
|
@@ -221,17 +236,17 @@ export function personDataHandler(allPersonsData : IPbPersons) : IPbPersons {
|
|
|
221
236
|
if (person.key === 'spouseInfo' && person.eleOrderList) {
|
|
222
237
|
person.eleOrderList.forEach(ele => {
|
|
223
238
|
if (ele.key === 'title') {
|
|
224
|
-
ele.isDisabled = !applicantInfo.title
|
|
225
|
-
ele.value = applicantInfo.title ? ele.value : false
|
|
239
|
+
ele.isDisabled = !applicantInfo.title
|
|
240
|
+
ele.value = applicantInfo.title ? ele.value : false
|
|
226
241
|
}
|
|
227
242
|
if (ele.key === 'sex') {
|
|
228
|
-
ele.value = applicantInfo.sex === 1 ? 2 : 1
|
|
243
|
+
ele.value = applicantInfo.sex === 1 ? 2 : 1
|
|
229
244
|
}
|
|
230
|
-
})
|
|
245
|
+
})
|
|
231
246
|
}
|
|
232
|
-
setPersonAgeOptions(person)
|
|
233
|
-
})
|
|
234
|
-
return allPersonsData
|
|
247
|
+
setPersonAgeOptions(person)
|
|
248
|
+
})
|
|
249
|
+
return allPersonsData
|
|
235
250
|
}
|
|
236
251
|
|
|
237
252
|
/**
|
|
@@ -243,58 +258,48 @@ export function personDataHandler(allPersonsData : IPbPersons) : IPbPersons {
|
|
|
243
258
|
* @param {object} verifyData 必传。计划书校验条件
|
|
244
259
|
* @returns {object} 年龄范围
|
|
245
260
|
*/
|
|
246
|
-
export function getInsuredAgeRange(inputData
|
|
261
|
+
export function getInsuredAgeRange(inputData: IPbInput, verifyData: any): any {
|
|
247
262
|
let ageRange = {
|
|
248
263
|
insuredInfo1: [], //被保人年龄范围(男)
|
|
249
264
|
insuredInfo2: [] //被保人年龄范围(女)
|
|
250
|
-
};
|
|
251
|
-
if (
|
|
252
|
-
!inputData ||
|
|
253
|
-
!inputData.productGroupList ||
|
|
254
|
-
!inputData.personData ||
|
|
255
|
-
!inputData.personData.personOrderList ||
|
|
256
|
-
!verifyData
|
|
257
|
-
) {
|
|
258
|
-
return ageRange;
|
|
259
265
|
}
|
|
260
|
-
inputData.productGroupList.
|
|
266
|
+
if (!inputData || !inputData.productGroupList || !inputData.personData || !inputData.personData.personOrderList || !verifyData) {
|
|
267
|
+
return ageRange
|
|
268
|
+
}
|
|
269
|
+
inputData.productGroupList.forEach((group: IPbProductGroup) => {
|
|
261
270
|
if (!group.prodOrderList) {
|
|
262
|
-
return
|
|
271
|
+
return
|
|
263
272
|
}
|
|
264
273
|
//计划书是否有有效必选产品(默认个数内、必选、非组合险)
|
|
265
|
-
let hasRequiredProd = group.prodOrderList.some((prod, i) => i < group.defNum && !!prod.required && !prod.isTemp)
|
|
266
|
-
group.prodOrderList.forEach((prod
|
|
274
|
+
let hasRequiredProd = group.prodOrderList.some((prod, i) => i < group.defNum && !!prod.required && !prod.isTemp)
|
|
275
|
+
group.prodOrderList.forEach((prod: IPbProduct) => {
|
|
267
276
|
// 组合险不统计年龄范围
|
|
268
277
|
if (!verifyData[prod.key] || prod.isTemp || !prod.mulInsOrderList) {
|
|
269
|
-
return
|
|
278
|
+
return
|
|
270
279
|
}
|
|
271
|
-
prod.mulInsOrderList.forEach((ins
|
|
280
|
+
prod.mulInsOrderList.forEach((ins: IProdInsurance) => {
|
|
272
281
|
// 险种是否有费率
|
|
273
282
|
if (!verifyData[prod.key][ins.key]) {
|
|
274
|
-
consoleLogWhenEnable(`${prod.titleName}-${prod.key} -> ${ins.name}-${ins.key}: 当前险种没有费率表`)
|
|
275
|
-
return
|
|
283
|
+
consoleLogWhenEnable(`${prod.titleName}-${prod.key} -> ${ins.name}-${ins.key}: 当前险种没有费率表`)
|
|
284
|
+
return
|
|
276
285
|
}
|
|
277
286
|
// 产品中是否有必选险种
|
|
278
|
-
let hasRequiredIns = (<IProdInsurance
|
|
287
|
+
let hasRequiredIns = (<IProdInsurance[]>prod.mulInsOrderList).some(ins => !!ins.required)
|
|
279
288
|
//无必选产品,根据所有产品的最小值,最大值确定;有必选产品, 根据必选产品的最小值,最大值确定
|
|
280
289
|
//无必选险种,根据所有险种的最小值,最大值确定;如果有必选险种:根据必选险种的最小值,最大值确定
|
|
281
|
-
if (
|
|
282
|
-
(!ins.huomian || ins.huomian === 'beiHuomian') &&
|
|
283
|
-
(!hasRequiredProd || prod.required) &&
|
|
284
|
-
(!hasRequiredIns || ins.required)
|
|
285
|
-
) {
|
|
290
|
+
if ((!ins.huomian || ins.huomian === 'beiHuomian') && (!hasRequiredProd || prod.required) && (!hasRequiredIns || ins.required)) {
|
|
286
291
|
verifyData[prod.key][ins.key].forEach(condi => {
|
|
287
|
-
let currentAgeRange = ageRange[`insuredInfo${condi.sex}`]
|
|
292
|
+
let currentAgeRange = ageRange[`insuredInfo${condi.sex}`]
|
|
288
293
|
ageRange[`insuredInfo${condi.sex}`] = [
|
|
289
294
|
Math.min(currentAgeRange[0] === undefined ? Infinity : currentAgeRange[0], condi.minAge),
|
|
290
295
|
Math.max(currentAgeRange[1] === undefined ? -Infinity : currentAgeRange[1], condi.maxAge)
|
|
291
|
-
]
|
|
292
|
-
})
|
|
296
|
+
]
|
|
297
|
+
})
|
|
293
298
|
}
|
|
294
|
-
})
|
|
295
|
-
})
|
|
296
|
-
})
|
|
297
|
-
return ageRange
|
|
299
|
+
})
|
|
300
|
+
})
|
|
301
|
+
})
|
|
302
|
+
return ageRange
|
|
298
303
|
}
|
|
299
304
|
|
|
300
305
|
/**
|
|
@@ -307,47 +312,39 @@ export function getInsuredAgeRange(inputData : IPbInput, verifyData : any) : any
|
|
|
307
312
|
* @param {object} personData 必传。人员数据(单个)
|
|
308
313
|
* @returns {object} 人员数据(单个)
|
|
309
314
|
*/
|
|
310
|
-
export function setPersonAgeOptions(personData
|
|
315
|
+
export function setPersonAgeOptions(personData: IPbPerson): IPbPerson {
|
|
311
316
|
if (!personData || !personData.eleOrderList) {
|
|
312
317
|
return personData
|
|
313
318
|
}
|
|
314
|
-
const personForm = convertEleOrderListToObj(personData)
|
|
319
|
+
const personForm = convertEleOrderListToObj(personData)
|
|
315
320
|
personData.eleOrderList.forEach(ele => {
|
|
316
321
|
if (ele.key === 'age') {
|
|
317
|
-
let options
|
|
318
|
-
let opts = <number
|
|
322
|
+
let options: any = []
|
|
323
|
+
let opts = <number[]>(personForm.sex == 2 && ele.optsF && ele.optsF.length ? ele.optsF : ele.opts)
|
|
319
324
|
for (let k = opts[0]; k <= opts[1]; k++) {
|
|
320
325
|
options.push({
|
|
321
326
|
val: k,
|
|
322
327
|
desc: `${k}岁`
|
|
323
|
-
})
|
|
328
|
+
})
|
|
324
329
|
}
|
|
325
330
|
|
|
326
|
-
let birthday = (<IPersonElement
|
|
331
|
+
let birthday = (<IPersonElement[]>personData.eleOrderList).find(e => e.key === 'birthday')
|
|
327
332
|
if (options.length && options.every(o => o.val !== ele.value)) {
|
|
328
|
-
ele.value = options[0].val
|
|
333
|
+
ele.value = options[0].val
|
|
329
334
|
if (birthday) {
|
|
330
|
-
birthday.value = null
|
|
335
|
+
birthday.value = null
|
|
331
336
|
}
|
|
332
337
|
}
|
|
333
|
-
ele.options = options
|
|
338
|
+
ele.options = options
|
|
334
339
|
|
|
335
340
|
if (birthday) {
|
|
336
|
-
birthday.defaulValue = new Date(
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
new Date().getDate()
|
|
340
|
-
);
|
|
341
|
-
birthday.minDate = new Date(
|
|
342
|
-
new Date().getFullYear() - opts[1] - 1,
|
|
343
|
-
new Date().getMonth(),
|
|
344
|
-
new Date().getDate() + 1
|
|
345
|
-
);
|
|
346
|
-
birthday.maxDate = new Date(new Date().getFullYear() - opts[0], new Date().getMonth(), new Date().getDate());
|
|
341
|
+
birthday.defaulValue = new Date(new Date().getFullYear() - Number(ele.value), new Date().getMonth(), new Date().getDate())
|
|
342
|
+
birthday.minDate = new Date(new Date().getFullYear() - opts[1] - 1, new Date().getMonth(), new Date().getDate() + 1)
|
|
343
|
+
birthday.maxDate = new Date(new Date().getFullYear() - opts[0], new Date().getMonth(), new Date().getDate())
|
|
347
344
|
}
|
|
348
345
|
}
|
|
349
|
-
})
|
|
350
|
-
return personData
|
|
346
|
+
})
|
|
347
|
+
return personData
|
|
351
348
|
}
|
|
352
349
|
|
|
353
350
|
/**
|
|
@@ -361,37 +358,36 @@ export function setPersonAgeOptions(personData : IPbPerson) : IPbPerson {
|
|
|
361
358
|
* 数组,以数组形式,返回多个人员数据。
|
|
362
359
|
* @returns {any} 人员数据(单个或多个)
|
|
363
360
|
*/
|
|
364
|
-
export function convertPersonData(allPersonsData
|
|
365
|
-
let cPersonData
|
|
361
|
+
export function convertPersonData(allPersonsData: IPbPersons, type: null | string | string[] = null): any {
|
|
362
|
+
let cPersonData: any = {}
|
|
366
363
|
if (allPersonsData) {
|
|
367
364
|
//转换收件人信息
|
|
368
365
|
if (allPersonsData.recipientInfo) {
|
|
369
|
-
cPersonData.recipientInfo = convertEleOrderListToObj(allPersonsData.recipientInfo)
|
|
366
|
+
cPersonData.recipientInfo = convertEleOrderListToObj(allPersonsData.recipientInfo)
|
|
370
367
|
}
|
|
371
368
|
//转换被、投、投保人配偶的信息
|
|
372
369
|
if (allPersonsData.personOrderList) {
|
|
373
370
|
allPersonsData.personOrderList.forEach(person => {
|
|
374
|
-
cPersonData[person.key] = convertEleOrderListToObj(person)
|
|
375
|
-
})
|
|
371
|
+
cPersonData[person.key] = convertEleOrderListToObj(person)
|
|
372
|
+
})
|
|
376
373
|
}
|
|
377
374
|
}
|
|
378
375
|
if (!type) {
|
|
379
376
|
return {
|
|
380
377
|
recipientInfo: cPersonData.recipientInfo,
|
|
381
|
-
personOrderList:
|
|
382
|
-
|
|
383
|
-
};
|
|
378
|
+
personOrderList: allPersonsData.personOrderList && allPersonsData.personOrderList.map(p => p.key).map(p => cPersonData[p])
|
|
379
|
+
}
|
|
384
380
|
}
|
|
385
381
|
if (typeof type === 'string') {
|
|
386
|
-
return cPersonData[type]
|
|
382
|
+
return cPersonData[type]
|
|
387
383
|
}
|
|
388
384
|
if (type.constructor === Array) {
|
|
389
|
-
let temp
|
|
385
|
+
let temp: any = []
|
|
390
386
|
for (let k in cPersonData) {
|
|
391
387
|
if (type.indexOf(k) !== -1) {
|
|
392
|
-
temp.push(cPersonData[k])
|
|
388
|
+
temp.push(cPersonData[k])
|
|
393
389
|
}
|
|
394
390
|
}
|
|
395
|
-
return temp
|
|
391
|
+
return temp
|
|
396
392
|
}
|
|
397
393
|
}
|