bxs-tools-ui 1.0.21 → 1.0.25
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/lib/business-card/index.js +2 -2
- package/lib/bxs-utils/index.js +4 -3
- package/lib/canvas-poster/index.js +2 -2
- package/lib/index.css +2 -2
- package/lib/index.js +101 -115
- package/lib/insure-calculate/index.css +1 -1
- package/lib/insure-calculate/index.js +31 -61
- package/lib/person-info/index.css +1 -1
- package/lib/person-info/index.js +45 -21
- package/lib/product-info/index.css +1 -1
- package/lib/product-info/index.js +19 -24
- package/package.json +5 -15
- package/packages/business-card/demo/index.vue +2 -8
- package/packages/business-card/index.vue +6 -28
- package/packages/bxs-utils/planbook/common.js +2 -4
- package/packages/bxs-utils/planbook/insurance.js +16 -62
- package/packages/bxs-utils/planbook/person.js +22 -74
- package/packages/bxs-utils/planbook/product.js +65 -233
- package/packages/bxs-utils/trade/insureCalculate.js +11 -43
- package/packages/canvas-poster/demo/index.vue +2 -7
- package/packages/canvas-poster/index.vue +5 -37
- package/packages/components/form-item/select-item.vue +5 -17
- package/packages/components/form-item/title-item.vue +3 -8
- package/packages/insure-calculate/demo/index.vue +1 -4
- package/packages/insure-calculate/index.vue +52 -183
- package/packages/person-info/index.vue +35 -21
- package/packages/planbook-input/components/footer.vue +1 -2
- package/packages/planbook-input/components/product-table.vue +7 -17
- package/packages/planbook-input/helper.js +19 -75
- package/packages/planbook-input/index.vue +8 -28
- package/packages/product-info/demo/index.vue +2 -12
- package/packages/product-info/index.vue +8 -31
- package/src/js/md5Token.js +6 -8
- package/src/js/request.js +11 -9
- package/src/js/utils.js +3 -7
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bxs-tools-ui",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.25",
|
|
4
4
|
"description": "微易前端业务组件",
|
|
5
5
|
"main": "lib/index.js",
|
|
6
6
|
"files": [
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
"build": "npm run init && npm run build:docs && npm run build:prod && npm run build:component",
|
|
19
19
|
"test": "echo \"Error: no test specified\" && exit 1",
|
|
20
20
|
"eslint:fix": "eslint --fix '{src,packages,docs}/**/*.{js,vue,ts}'",
|
|
21
|
-
"precommit": "lint-staged"
|
|
21
|
+
"precommit": "lint-staged",
|
|
22
|
+
"prettier": "prettier --write '{src,packages}/**/*.{js,vue}'"
|
|
22
23
|
},
|
|
23
24
|
"lint-staged": {
|
|
24
25
|
"{src,packages}/**/*.{js,vue}": [
|
|
@@ -31,17 +32,6 @@
|
|
|
31
32
|
"git add"
|
|
32
33
|
]
|
|
33
34
|
},
|
|
34
|
-
"prettier": {
|
|
35
|
-
"printWidth": 80,
|
|
36
|
-
"semi": true,
|
|
37
|
-
"singleQuote": true,
|
|
38
|
-
"trailingComma": "none",
|
|
39
|
-
"bracketSpacing": true,
|
|
40
|
-
"jsxBracketSameLine": false,
|
|
41
|
-
"arrowParens": "avoid",
|
|
42
|
-
"requirePragma": false,
|
|
43
|
-
"proseWrap": "preserve"
|
|
44
|
-
},
|
|
45
35
|
"author": "lizh",
|
|
46
36
|
"license": "ISC",
|
|
47
37
|
"devDependencies": {
|
|
@@ -66,10 +56,10 @@
|
|
|
66
56
|
"crypto-js": "^4.0.0",
|
|
67
57
|
"css-loader": "^3.1.0",
|
|
68
58
|
"eslint": "^6.5.1",
|
|
69
|
-
"eslint-config-prettier": "^6.
|
|
59
|
+
"eslint-config-prettier": "^6.15.0",
|
|
70
60
|
"eslint-friendly-formatter": "^4.0.1",
|
|
71
61
|
"eslint-loader": "^4.0.2",
|
|
72
|
-
"eslint-plugin-prettier": "^3.1
|
|
62
|
+
"eslint-plugin-prettier": "^3.4.1",
|
|
73
63
|
"eslint-plugin-vue": "^7.1.0",
|
|
74
64
|
"fast-vue-md-loader": "^1.0.3",
|
|
75
65
|
"friendly-errors-webpack-plugin": "^1.7.0",
|
|
@@ -8,12 +8,7 @@
|
|
|
8
8
|
-->
|
|
9
9
|
<template>
|
|
10
10
|
<div>
|
|
11
|
-
<BusinessCard
|
|
12
|
-
:card-data="cardData"
|
|
13
|
-
:button-data="buttonData"
|
|
14
|
-
@click="avatarHandler"
|
|
15
|
-
@clickBtn="buttonHandler"
|
|
16
|
-
/>
|
|
11
|
+
<BusinessCard :card-data="cardData" :button-data="buttonData" @click="avatarHandler" @clickBtn="buttonHandler" />
|
|
17
12
|
</div>
|
|
18
13
|
</template>
|
|
19
14
|
<script lang="ts">
|
|
@@ -32,8 +27,7 @@ export default class BusinessCardDemo extends Vue {
|
|
|
32
27
|
'//media.winbaoxian.com/autoUpload/activity/2b3511574077482e0893c816eb56c8019b142d42f3639-CUzkUL_fw658_478c0884c573f5a.jpeg',
|
|
33
28
|
name: 'lizhao11',
|
|
34
29
|
rank: '三联钻代理人',
|
|
35
|
-
rankIcon:
|
|
36
|
-
'//media.winbaoxian.com/autoUpload/activity/diamond_362dcf9f4453ded.png',
|
|
30
|
+
rankIcon: '//media.winbaoxian.com/autoUpload/activity/diamond_362dcf9f4453ded.png',
|
|
37
31
|
mobile: '13023690000'
|
|
38
32
|
};
|
|
39
33
|
buttonData = {
|
|
@@ -2,48 +2,26 @@
|
|
|
2
2
|
<div class="bxt-business-card">
|
|
3
3
|
<ul class="bxt-business-card-ul">
|
|
4
4
|
<li @click="avatarHandler" class="bxt-business-card-li">
|
|
5
|
-
<img
|
|
6
|
-
:src="cardData.avatar"
|
|
7
|
-
class="bxt-business-card-avatar"
|
|
8
|
-
alt="头像"
|
|
9
|
-
/>
|
|
5
|
+
<img :src="cardData.avatar" class="bxt-business-card-avatar" alt="头像" />
|
|
10
6
|
</li>
|
|
11
7
|
<li @click="avatarHandler" class="bxt-business-card-li">
|
|
12
8
|
<div class="bxt-business-card-container">
|
|
13
9
|
<span class="bxt-business-card-name">
|
|
14
10
|
{{ cardData.name }}
|
|
15
|
-
<img
|
|
16
|
-
v-if="cardData.rankIcon"
|
|
17
|
-
:src="cardData.rankIcon"
|
|
18
|
-
class="bxt-business-card-diamond"
|
|
19
|
-
/>
|
|
11
|
+
<img v-if="cardData.rankIcon" :src="cardData.rankIcon" class="bxt-business-card-diamond" />
|
|
20
12
|
</span>
|
|
21
|
-
<span
|
|
22
|
-
v-if="cardData.rank"
|
|
23
|
-
:style="rankStyle"
|
|
24
|
-
class="bxt-business-card-rank"
|
|
25
|
-
>
|
|
13
|
+
<span v-if="cardData.rank" :style="rankStyle" class="bxt-business-card-rank">
|
|
26
14
|
{{ cardData.rank }}
|
|
27
15
|
</span>
|
|
28
16
|
</div>
|
|
29
17
|
</li>
|
|
30
18
|
<li class="bxt-business-card-li">
|
|
31
|
-
<a
|
|
32
|
-
v-if="cardData.mobile"
|
|
33
|
-
:href="`tel:${cardData.mobile}`"
|
|
34
|
-
class="bxt-business-card-mobile"
|
|
35
|
-
>
|
|
19
|
+
<a v-if="cardData.mobile" :href="`tel:${cardData.mobile}`" class="bxt-business-card-mobile">
|
|
36
20
|
{{ cardData.mobile }}
|
|
37
21
|
</a>
|
|
38
22
|
</li>
|
|
39
|
-
<li
|
|
40
|
-
|
|
41
|
-
@click="buttonHandler"
|
|
42
|
-
class="bxt-business-card-li"
|
|
43
|
-
>
|
|
44
|
-
<span :style="buttonStyle" class="bxt-business-card-button">{{
|
|
45
|
-
buttonData.tx
|
|
46
|
-
}}</span>
|
|
23
|
+
<li v-if="buttonData && buttonData.tx" @click="buttonHandler" class="bxt-business-card-li">
|
|
24
|
+
<span :style="buttonStyle" class="bxt-business-card-button">{{ buttonData.tx }}</span>
|
|
47
25
|
</li>
|
|
48
26
|
</ul>
|
|
49
27
|
</div>
|
|
@@ -146,8 +146,7 @@ export function deepCopy(obj, hash = new WeakMap()) {
|
|
|
146
146
|
hash.set(obj, newObj);
|
|
147
147
|
for (let key in obj) {
|
|
148
148
|
if (obj.hasOwnProperty(key)) {
|
|
149
|
-
newObj[key] =
|
|
150
|
-
typeof obj[key] === 'object' ? deepCopy(obj[key], hash) : obj[key];
|
|
149
|
+
newObj[key] = typeof obj[key] === 'object' ? deepCopy(obj[key], hash) : obj[key];
|
|
151
150
|
}
|
|
152
151
|
}
|
|
153
152
|
|
|
@@ -169,8 +168,7 @@ export function getAgeFromBirth(birth, cDate) {
|
|
|
169
168
|
var age = nowDate.getFullYear() - bDate.getFullYear();
|
|
170
169
|
if (
|
|
171
170
|
nowDate.getMonth() - bDate.getMonth() < 0 ||
|
|
172
|
-
(nowDate.getMonth() - bDate.getMonth() === 0 &&
|
|
173
|
-
nowDate.getDate() - bDate.getDate() < 0)
|
|
171
|
+
(nowDate.getMonth() - bDate.getMonth() === 0 && nowDate.getDate() - bDate.getDate() < 0)
|
|
174
172
|
) {
|
|
175
173
|
age--;
|
|
176
174
|
}
|
|
@@ -36,20 +36,10 @@ export function initInsuranceData(insData) {
|
|
|
36
36
|
}
|
|
37
37
|
if (e.optConf && e.optConf.length) {
|
|
38
38
|
let options = [];
|
|
39
|
-
for (
|
|
40
|
-
let i = e.optConf[0];
|
|
41
|
-
i < e.optConf[1];
|
|
42
|
-
i += (e.optConf[2] && e.optConf[2] && e.optConf[2].step) || 1
|
|
43
|
-
) {
|
|
39
|
+
for (let i = e.optConf[0]; i < e.optConf[1]; i += (e.optConf[2] && e.optConf[2] && e.optConf[2].step) || 1) {
|
|
44
40
|
options.push({
|
|
45
|
-
val:
|
|
46
|
-
|
|
47
|
-
? `${i}${e.optConf[2].valfix}`
|
|
48
|
-
: i,
|
|
49
|
-
desc:
|
|
50
|
-
e.optConf[2] && e.optConf[2].desc
|
|
51
|
-
? e.optConf[2].desc.replace(/{{&&}}/, i)
|
|
52
|
-
: i
|
|
41
|
+
val: e.optConf[2] && e.optConf[2].valfix ? `${i}${e.optConf[2].valfix}` : i,
|
|
42
|
+
desc: e.optConf[2] && e.optConf[2].desc ? e.optConf[2].desc.replace(/{{&&}}/, i) : i
|
|
53
43
|
});
|
|
54
44
|
}
|
|
55
45
|
e.opts = options;
|
|
@@ -130,9 +120,7 @@ export function initElementValidateRules(ele, productData) {
|
|
|
130
120
|
},
|
|
131
121
|
{
|
|
132
122
|
pattern: ele.regExp ? eval(ele.regExp) : /^\d*$/,
|
|
133
|
-
message:
|
|
134
|
-
ele.regExpMessage ||
|
|
135
|
-
(ele.regExp ? '输入不合法,请重新输入' : '请输入整数值')
|
|
123
|
+
message: ele.regExpMessage || (ele.regExp ? '输入不合法,请重新输入' : '请输入整数值')
|
|
136
124
|
}
|
|
137
125
|
];
|
|
138
126
|
}
|
|
@@ -149,9 +137,7 @@ export function initElementValidateRules(ele, productData) {
|
|
|
149
137
|
if (min || max) {
|
|
150
138
|
let message = '';
|
|
151
139
|
if (min && max) {
|
|
152
|
-
message = `请输入${converUnit10000(min)}~${converUnit10000(
|
|
153
|
-
max
|
|
154
|
-
)}之间的数值`;
|
|
140
|
+
message = `请输入${converUnit10000(min)}~${converUnit10000(max)}之间的数值`;
|
|
155
141
|
} else if (!min) {
|
|
156
142
|
message = `请输入不大于${converUnit10000(max)}的数值`;
|
|
157
143
|
} else if (!max) {
|
|
@@ -192,12 +178,8 @@ export function initElementValidateRules(ele, productData) {
|
|
|
192
178
|
let insurance1, insurance2, insTitle1, insTitle2, itemValue1, itemValue2;
|
|
193
179
|
if (item1 && item2) {
|
|
194
180
|
// 查找对应的险种
|
|
195
|
-
insurance1 = productData.mulInsOrderList.find(
|
|
196
|
-
|
|
197
|
-
);
|
|
198
|
-
insurance2 = productData.mulInsOrderList.find(
|
|
199
|
-
ins => ins.key + '' === item2[1]
|
|
200
|
-
);
|
|
181
|
+
insurance1 = productData.mulInsOrderList.find(ins => ins.key + '' === item1[1]);
|
|
182
|
+
insurance2 = productData.mulInsOrderList.find(ins => ins.key + '' === item2[1]);
|
|
201
183
|
}
|
|
202
184
|
if (insurance1 && insurance1.eleOrderList) {
|
|
203
185
|
// 险种选中时,获取险种对应元素的值
|
|
@@ -212,13 +194,7 @@ export function initElementValidateRules(ele, productData) {
|
|
|
212
194
|
itemValue2 = insurance2.eleOrderList.find(e => e.key === item1[2]);
|
|
213
195
|
}
|
|
214
196
|
}
|
|
215
|
-
if (
|
|
216
|
-
itemValue1 &&
|
|
217
|
-
itemValue1.value &&
|
|
218
|
-
itemValue2 &&
|
|
219
|
-
itemValue2.value &&
|
|
220
|
-
ele.compareItem[1]
|
|
221
|
-
) {
|
|
197
|
+
if (itemValue1 && itemValue1.value && itemValue2 && itemValue2.value && ele.compareItem[1]) {
|
|
222
198
|
rules.push({
|
|
223
199
|
value1: itemValue1.value,
|
|
224
200
|
value2: itemValue2.value,
|
|
@@ -264,15 +240,10 @@ export function initElementValidateRules(ele, productData) {
|
|
|
264
240
|
* - eleData: 必传。元素数据(单个)
|
|
265
241
|
* @return {*} 校验结果
|
|
266
242
|
*/
|
|
267
|
-
export function restrictElementsInInsurance({
|
|
268
|
-
personOrderList,
|
|
269
|
-
insData,
|
|
270
|
-
eleData
|
|
271
|
-
}) {
|
|
243
|
+
export function restrictElementsInInsurance({ personOrderList, insData, eleData }) {
|
|
272
244
|
let errorMsg;
|
|
273
245
|
if (insData && eleData && eleData.restrictions) {
|
|
274
|
-
let insuredInfo =
|
|
275
|
-
personOrderList && personOrderList.find(p => p.key === 'insuredInfo');
|
|
246
|
+
let insuredInfo = personOrderList && personOrderList.find(p => p.key === 'insuredInfo');
|
|
276
247
|
let insuranceInfo = convertEleOrderListToObj(insData);
|
|
277
248
|
let verifyData = {
|
|
278
249
|
sex: insuredInfo.sex,
|
|
@@ -292,18 +263,15 @@ export function restrictElementsInInsurance({
|
|
|
292
263
|
// 当前字段是目标元素
|
|
293
264
|
ele === eleData.key ||
|
|
294
265
|
// 当前约束值是字符或者数字,且数据中有该值
|
|
295
|
-
((restrict[ele].constructor === String ||
|
|
296
|
-
restrict[ele].constructor === Number) &&
|
|
266
|
+
((restrict[ele].constructor === String || restrict[ele].constructor === Number) &&
|
|
297
267
|
verifyData[ele] == restrict[ele]) ||
|
|
298
268
|
// 当前约束值是数组,且数据中有一项值包含在数组中
|
|
299
|
-
(restrict[ele].constructor === Array &&
|
|
300
|
-
restrict[ele].find(r => r == verifyData[ele]))
|
|
269
|
+
(restrict[ele].constructor === Array && restrict[ele].find(r => r == verifyData[ele]))
|
|
301
270
|
);
|
|
302
271
|
});
|
|
303
272
|
});
|
|
304
273
|
|
|
305
|
-
let valRange =
|
|
306
|
-
eleRestricts && eleRestricts[0] && eleRestricts[0][eleData.key];
|
|
274
|
+
let valRange = eleRestricts && eleRestricts[0] && eleRestricts[0][eleData.key];
|
|
307
275
|
if (valRange && valRange.length) {
|
|
308
276
|
if (eleData.opts) {
|
|
309
277
|
eleData.opts.filter(o => {
|
|
@@ -311,29 +279,15 @@ export function restrictElementsInInsurance({
|
|
|
311
279
|
o.isInvalid = true;
|
|
312
280
|
}
|
|
313
281
|
});
|
|
314
|
-
if (
|
|
315
|
-
!eleData.opts.find(
|
|
316
|
-
opt =>
|
|
317
|
-
!opt.isHide &&
|
|
318
|
-
!opt.isDisabled &&
|
|
319
|
-
!opt.isInvalid &&
|
|
320
|
-
opt.val == eleData.value
|
|
321
|
-
)
|
|
322
|
-
) {
|
|
282
|
+
if (!eleData.opts.find(opt => !opt.isHide && !opt.isDisabled && !opt.isInvalid && opt.val == eleData.value)) {
|
|
323
283
|
let opt = eleData.opts.find(o => o.val == eleData.value);
|
|
324
|
-
errorMsg = `当前条件下, 没有${eleData.labelName}${
|
|
325
|
-
opt ? opt.desc : ''
|
|
326
|
-
}选项, 已自动切换`;
|
|
284
|
+
errorMsg = `当前条件下, 没有${eleData.labelName}${opt ? opt.desc : ''}选项, 已自动切换`;
|
|
327
285
|
}
|
|
328
286
|
} else if (valRange[0] || valRange[1]) {
|
|
329
287
|
let rangeMsg = `当前条件下, ${insData.name}的${eleData.labelName}值`;
|
|
330
288
|
let minMsg = `不得小于${converUnit10000(valRange[0])}`;
|
|
331
289
|
let maxMsg = `不得大于${converUnit10000(valRange[1])}`;
|
|
332
|
-
if (
|
|
333
|
-
valRange[0] &&
|
|
334
|
-
valRange[1] &&
|
|
335
|
-
(eleData.value < valRange[0] || eleData.value > valRange[1])
|
|
336
|
-
) {
|
|
290
|
+
if (valRange[0] && valRange[1] && (eleData.value < valRange[0] || eleData.value > valRange[1])) {
|
|
337
291
|
errorMsg = `${rangeMsg}${minMsg}且${maxMsg}`;
|
|
338
292
|
} else if (valRange[0] && eleData.value < valRange[0]) {
|
|
339
293
|
errorMsg = `${rangeMsg}${minMsg}`;
|
|
@@ -30,11 +30,7 @@ export function initPersonData(inputData, verifyData) {
|
|
|
30
30
|
if (person.eleOrderList) {
|
|
31
31
|
// 投保人添加元素:投被保人是同一人
|
|
32
32
|
if (person.key === 'applicantInfo') {
|
|
33
|
-
if (
|
|
34
|
-
person.eleOrderList.every(
|
|
35
|
-
e => e.key !== 'applicantAndInsuredSame'
|
|
36
|
-
)
|
|
37
|
-
) {
|
|
33
|
+
if (person.eleOrderList.every(e => e.key !== 'applicantAndInsuredSame')) {
|
|
38
34
|
person.eleOrderList.splice(1, 0, {
|
|
39
35
|
key: 'applicantAndInsuredSame',
|
|
40
36
|
value: 0,
|
|
@@ -66,19 +62,14 @@ export function initPersonData(inputData, verifyData) {
|
|
|
66
62
|
let ageRange = getInsuredAgeRange(inputData, verifyData);
|
|
67
63
|
if (ageRange) {
|
|
68
64
|
personOrderList.forEach(person => {
|
|
69
|
-
if (
|
|
70
|
-
person.key === 'insuredInfo' &&
|
|
71
|
-
ageRange[`${person.key}1`] &&
|
|
72
|
-
ageRange[`${person.key}1`].length
|
|
73
|
-
) {
|
|
65
|
+
if (person.key === 'insuredInfo' && ageRange[`${person.key}1`] && ageRange[`${person.key}1`].length) {
|
|
74
66
|
person.eleOrderList.forEach(ele => {
|
|
75
67
|
if (ele.key === 'age') {
|
|
76
68
|
ele.opts = ageRange[`${person.key}1`];
|
|
77
69
|
// 男女年龄取值范围不同
|
|
78
70
|
if (
|
|
79
71
|
ageRange[`${person.key}2`].length &&
|
|
80
|
-
(ele.opts[0] !== ageRange[`${person.key}2`][0] ||
|
|
81
|
-
ele.opts[1] !== ageRange[`${person.key}2`][1])
|
|
72
|
+
(ele.opts[0] !== ageRange[`${person.key}2`][0] || ele.opts[1] !== ageRange[`${person.key}2`][1])
|
|
82
73
|
) {
|
|
83
74
|
ele.optsF = ageRange[`${person.key}2`];
|
|
84
75
|
}
|
|
@@ -126,6 +117,7 @@ export function initPersonData(inputData, verifyData) {
|
|
|
126
117
|
e.componentName = 'cmCommonSelect';
|
|
127
118
|
e.placeholder = '请选择年龄';
|
|
128
119
|
e.options = [];
|
|
120
|
+
e.iconColor = '#508cee';
|
|
129
121
|
break;
|
|
130
122
|
}
|
|
131
123
|
}
|
|
@@ -155,20 +147,13 @@ export function personDataHandler(allPersonsData, { personKey, eleKey } = {}) {
|
|
|
155
147
|
if (allPersonsData && allPersonsData.personOrderList) {
|
|
156
148
|
// 生日和年龄联动
|
|
157
149
|
if (personKey && eleKey) {
|
|
158
|
-
let personData = allPersonsData.personOrderList.find(
|
|
159
|
-
|
|
160
|
-
);
|
|
161
|
-
let eleData =
|
|
162
|
-
personData &&
|
|
163
|
-
personData.eleOrderList &&
|
|
164
|
-
personData.eleOrderList.find(e => e.key === eleKey);
|
|
150
|
+
let personData = allPersonsData.personOrderList.find(p => p.key === personKey);
|
|
151
|
+
let eleData = personData && personData.eleOrderList && personData.eleOrderList.find(e => e.key === eleKey);
|
|
165
152
|
if (eleData) {
|
|
166
153
|
switch (eleData.key) {
|
|
167
154
|
case 'age': {
|
|
168
155
|
// 改变年龄,清空生日
|
|
169
|
-
let birthday = personData.eleOrderList.find(
|
|
170
|
-
e => e.key === 'birthday'
|
|
171
|
-
);
|
|
156
|
+
let birthday = personData.eleOrderList.find(e => e.key === 'birthday');
|
|
172
157
|
if (birthday) {
|
|
173
158
|
birthday.value = null;
|
|
174
159
|
birthday.defaultValue = null;
|
|
@@ -196,19 +181,10 @@ export function personDataHandler(allPersonsData, { personKey, eleKey } = {}) {
|
|
|
196
181
|
if (person.key === 'insuredInfo' && applicantData) {
|
|
197
182
|
// 关于被保人、投保人是否是同一人的处理
|
|
198
183
|
// 被保人所选年龄不在投保人年龄范围内,强制选中投保人。即被保人年龄不能做投保人
|
|
199
|
-
let applicantAge = applicantData.eleOrderList.find(
|
|
200
|
-
|
|
201
|
-
);
|
|
202
|
-
|
|
203
|
-
e => e.key === 'title'
|
|
204
|
-
);
|
|
205
|
-
let applicantSame = applicantData.eleOrderList.find(
|
|
206
|
-
e => e.key === 'applicantAndInsuredSame'
|
|
207
|
-
);
|
|
208
|
-
if (
|
|
209
|
-
insuredInfo.age >= applicantAge.opts[0] &&
|
|
210
|
-
insuredInfo.age <= applicantAge.opts[1]
|
|
211
|
-
) {
|
|
184
|
+
let applicantAge = applicantData.eleOrderList.find(e => e.key === 'age');
|
|
185
|
+
let applicantTitle = applicantData.eleOrderList.find(e => e.key === 'title');
|
|
186
|
+
let applicantSame = applicantData.eleOrderList.find(e => e.key === 'applicantAndInsuredSame');
|
|
187
|
+
if (insuredInfo.age >= applicantAge.opts[0] && insuredInfo.age <= applicantAge.opts[1]) {
|
|
212
188
|
if (applicantTitle) {
|
|
213
189
|
applicantTitle.isDisabled = false;
|
|
214
190
|
}
|
|
@@ -229,17 +205,13 @@ export function personDataHandler(allPersonsData, { personKey, eleKey } = {}) {
|
|
|
229
205
|
}
|
|
230
206
|
if (person.key === 'applicantInfo') {
|
|
231
207
|
// 投被保人为是否为同一人的相关逻辑
|
|
232
|
-
let applicantSame = person.eleOrderList.find(
|
|
233
|
-
e => e.key === 'applicantAndInsuredSame'
|
|
234
|
-
);
|
|
208
|
+
let applicantSame = person.eleOrderList.find(e => e.key === 'applicantAndInsuredSame');
|
|
235
209
|
if (applicantSame) {
|
|
236
210
|
person.eleOrderList.forEach(ele => {
|
|
237
211
|
if (['title', 'applicantAndInsuredSame'].indexOf(ele.key) === -1) {
|
|
238
212
|
ele.isHide = !!applicantSame.value;
|
|
239
213
|
if (applicantSame.value) {
|
|
240
|
-
let insuredEle = insuredData.eleOrderList.find(
|
|
241
|
-
e => e.key === ele.key
|
|
242
|
-
);
|
|
214
|
+
let insuredEle = insuredData.eleOrderList.find(e => e.key === ele.key);
|
|
243
215
|
if (insuredEle) {
|
|
244
216
|
ele.value = insuredEle.value;
|
|
245
217
|
}
|
|
@@ -301,9 +273,7 @@ export function getInsuredAgeRange(inputData, verifyData) {
|
|
|
301
273
|
// 险种是否有费率
|
|
302
274
|
if (verifyData[prod.key][ins.key]) {
|
|
303
275
|
// 产品中是否有必选险种
|
|
304
|
-
let hasRequiredIns = prod.mulInsOrderList.some(
|
|
305
|
-
ins => !!ins.required
|
|
306
|
-
);
|
|
276
|
+
let hasRequiredIns = prod.mulInsOrderList.some(ins => !!ins.required);
|
|
307
277
|
//无必选产品,根据所有产品的最小值,最大值确定;有必选产品, 根据必选产品的最小值,最大值确定
|
|
308
278
|
//无必选险种,根据所有险种的最小值,最大值确定;如果有必选险种:根据必选险种的最小值,最大值确定
|
|
309
279
|
if (
|
|
@@ -314,25 +284,13 @@ export function getInsuredAgeRange(inputData, verifyData) {
|
|
|
314
284
|
verifyData[prod.key][ins.key].forEach(condi => {
|
|
315
285
|
let currentAgeRange = ageRange[`insuredInfo${condi.sex}`];
|
|
316
286
|
ageRange[`insuredInfo${condi.sex}`] = [
|
|
317
|
-
Math.min(
|
|
318
|
-
|
|
319
|
-
? Infinity
|
|
320
|
-
: currentAgeRange[0],
|
|
321
|
-
condi.minAge
|
|
322
|
-
),
|
|
323
|
-
Math.max(
|
|
324
|
-
currentAgeRange[1] === undefined
|
|
325
|
-
? -Infinity
|
|
326
|
-
: currentAgeRange[1],
|
|
327
|
-
condi.maxAge
|
|
328
|
-
)
|
|
287
|
+
Math.min(currentAgeRange[0] === undefined ? Infinity : currentAgeRange[0], condi.minAge),
|
|
288
|
+
Math.max(currentAgeRange[1] === undefined ? -Infinity : currentAgeRange[1], condi.maxAge)
|
|
329
289
|
];
|
|
330
290
|
});
|
|
331
291
|
}
|
|
332
292
|
} else {
|
|
333
|
-
console.log(
|
|
334
|
-
`${prod.titleName}-${prod.key} -> ${ins.name}-${ins.key}: 当前险种没有费率表`
|
|
335
|
-
);
|
|
293
|
+
console.log(`${prod.titleName}-${prod.key} -> ${ins.name}-${ins.key}: 当前险种没有费率表`);
|
|
336
294
|
}
|
|
337
295
|
});
|
|
338
296
|
}
|
|
@@ -358,10 +316,7 @@ export function setPersonAgeOptions(personData) {
|
|
|
358
316
|
personData.eleOrderList.forEach(ele => {
|
|
359
317
|
if (ele.key === 'age') {
|
|
360
318
|
let options = [];
|
|
361
|
-
let opts =
|
|
362
|
-
personForm.sex == 2 && ele.optsF && ele.optsF.length
|
|
363
|
-
? ele.optsF
|
|
364
|
-
: ele.opts;
|
|
319
|
+
let opts = personForm.sex == 2 && ele.optsF && ele.optsF.length ? ele.optsF : ele.opts;
|
|
365
320
|
for (let k = opts[0]; k <= opts[1]; k++) {
|
|
366
321
|
options.push({
|
|
367
322
|
val: k,
|
|
@@ -371,7 +326,7 @@ export function setPersonAgeOptions(personData) {
|
|
|
371
326
|
|
|
372
327
|
let birthday = personData.eleOrderList.find(e => e.key === 'birthday');
|
|
373
328
|
if (options.length && options.every(o => o.val !== ele.value)) {
|
|
374
|
-
ele.value = options[0];
|
|
329
|
+
ele.value = options[0].val;
|
|
375
330
|
if (birthday) {
|
|
376
331
|
birthday.value = null;
|
|
377
332
|
}
|
|
@@ -389,11 +344,7 @@ export function setPersonAgeOptions(personData) {
|
|
|
389
344
|
new Date().getMonth(),
|
|
390
345
|
new Date().getDate() + 1
|
|
391
346
|
);
|
|
392
|
-
birthday.maxDate = new Date(
|
|
393
|
-
new Date().getFullYear() - opts[0],
|
|
394
|
-
new Date().getMonth(),
|
|
395
|
-
new Date().getDate()
|
|
396
|
-
);
|
|
347
|
+
birthday.maxDate = new Date(new Date().getFullYear() - opts[0], new Date().getMonth(), new Date().getDate());
|
|
397
348
|
}
|
|
398
349
|
}
|
|
399
350
|
});
|
|
@@ -417,9 +368,7 @@ export function convertPersonData(allPersonsData, type) {
|
|
|
417
368
|
if (allPersonsData) {
|
|
418
369
|
//转换收件人信息
|
|
419
370
|
if (allPersonsData.recipientInfo) {
|
|
420
|
-
cPersonData.recipientInfo = convertEleOrderListToObj(
|
|
421
|
-
allPersonsData.recipientInfo
|
|
422
|
-
);
|
|
371
|
+
cPersonData.recipientInfo = convertEleOrderListToObj(allPersonsData.recipientInfo);
|
|
423
372
|
}
|
|
424
373
|
//转换被、投、投保人配偶的信息
|
|
425
374
|
if (allPersonsData.personOrderList) {
|
|
@@ -444,8 +393,7 @@ export function convertPersonData(allPersonsData, type) {
|
|
|
444
393
|
return {
|
|
445
394
|
recipientInfo: cPersonData.recipientInfo,
|
|
446
395
|
personOrderList:
|
|
447
|
-
allPersonsData.personOrderList &&
|
|
448
|
-
allPersonsData.personOrderList.map(p => p.key).map(p => cPersonData[p])
|
|
396
|
+
allPersonsData.personOrderList && allPersonsData.personOrderList.map(p => p.key).map(p => cPersonData[p])
|
|
449
397
|
};
|
|
450
398
|
}
|
|
451
399
|
}
|