bxs-tools-ui 3.2.0-0 → 3.2.0-2
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/es/add-and-take/index.js +13 -3
- package/es/adjust-baoe/index.js +3 -2
- package/es/index.js +171 -161
- package/es/insure-calculate/index.js +1 -0
- package/es/person-info/index.js +122 -146
- package/es/product-info/index.js +136 -152
- package/es/share-sheet/index.js +16 -4
- package/es/utils/index.js +144 -154
- package/lib/add-and-take/index.js +13 -3
- package/lib/adjust-baoe/index.js +3 -2
- package/lib/index.js +171 -161
- package/lib/insure-calculate/index.js +1 -0
- package/lib/person-info/index.js +122 -146
- package/lib/product-info/index.js +136 -152
- package/lib/share-sheet/index.js +16 -4
- package/lib/utils/index.js +144 -154
- package/package.json +1 -4
- package/packages/add-and-take/readme.md +162 -256
- package/packages/adjust-baoe/readme.md +118 -83
- package/packages/business-card/readme.md +91 -28
- package/packages/bxs-utils/planbook/common.ts +48 -20
- package/packages/bxs-utils/planbook/person.ts +1 -1
- package/packages/bxs-utils/planbook/product.ts +70 -124
- package/packages/bxs-utils/readme.md +407 -425
- package/packages/canvas-poster/readme.md +123 -83
- package/packages/index.ts +1 -1
- package/packages/insure-calculate/readme.md +185 -129
- package/packages/person-info/index.vue +6 -1
- package/packages/person-info/readme.md +149 -134
- package/packages/planbook-input/helper.js +9 -4
- package/packages/planbook-input/index.vue +5 -1
- package/packages/planbook-input/readme.md +143 -84
- package/packages/product-info/index.vue +12 -3
- package/packages/product-info/readme.md +130 -69
package/lib/index.js
CHANGED
|
@@ -8736,7 +8736,7 @@
|
|
|
8736
8736
|
* **将交费期间或者保险期间的值,转换成数值**
|
|
8737
8737
|
* @author Lizhao <lz@winbaoxian.com>
|
|
8738
8738
|
* @date 2022-04-25
|
|
8739
|
-
* @param {string} value 必传。需要转换的值
|
|
8739
|
+
* @param {string|number} value 必传。需要转换的值
|
|
8740
8740
|
* @param {number} age 0 可不传。被保人年龄
|
|
8741
8741
|
* @returns {number} 数值
|
|
8742
8742
|
* @example
|
|
@@ -8768,7 +8768,7 @@
|
|
|
8768
8768
|
* @author Lizhao <lz@winbaoxian.com>
|
|
8769
8769
|
* @date 2022-04-25
|
|
8770
8770
|
* @param {number} value 必传
|
|
8771
|
-
* @returns {string}
|
|
8771
|
+
* @returns {number|string} 满足条件时返回单位为万的字符串,否则返回原数值
|
|
8772
8772
|
* @example
|
|
8773
8773
|
* converUnit10000(1000)
|
|
8774
8774
|
* // returns 1000
|
|
@@ -8826,7 +8826,7 @@
|
|
|
8826
8826
|
* **根据生日算年龄**
|
|
8827
8827
|
* @author Lizhao <lz@winbaoxian.com>
|
|
8828
8828
|
* @date 2022-04-25
|
|
8829
|
-
* @param {Date|timestamp|dateStr} birth
|
|
8829
|
+
* @param {Date|timestamp|dateStr} birth 必传。时间字符串或时间戳
|
|
8830
8830
|
* @param {Date|timestamp|dateStr} cDate 可不传。指定时间,不传默认为当前时间
|
|
8831
8831
|
* @returns {number} 年龄
|
|
8832
8832
|
* @example
|
|
@@ -8850,11 +8850,20 @@
|
|
|
8850
8850
|
}
|
|
8851
8851
|
|
|
8852
8852
|
/**
|
|
8853
|
-
*
|
|
8853
|
+
* **将数值转换为千分位格式的字符串**
|
|
8854
8854
|
* @author Lizhao <lz@winbaoxian.com>
|
|
8855
8855
|
* @date 2024-09-10
|
|
8856
|
-
* @param {
|
|
8857
|
-
* @returns
|
|
8856
|
+
* @param {number|string} n 必传。需要转换的数值
|
|
8857
|
+
* @returns {string} 千分位字符串;空值返回空字符串;非数值返回原值
|
|
8858
|
+
* @example
|
|
8859
|
+
* formatNumberToThousand(1234567)
|
|
8860
|
+
* // returns '1,234,567'
|
|
8861
|
+
*
|
|
8862
|
+
* formatNumberToThousand(0)
|
|
8863
|
+
* // returns '0'
|
|
8864
|
+
*
|
|
8865
|
+
* formatNumberToThousand(null)
|
|
8866
|
+
* // returns ''
|
|
8858
8867
|
*/
|
|
8859
8868
|
function formatNumberToThousand(n) {
|
|
8860
8869
|
if (n !== 0 && !n) {
|
|
@@ -8868,10 +8877,21 @@
|
|
|
8868
8877
|
}
|
|
8869
8878
|
|
|
8870
8879
|
/**
|
|
8871
|
-
*
|
|
8872
|
-
*
|
|
8873
|
-
*
|
|
8874
|
-
*
|
|
8880
|
+
* **截取字符串到指定字数**
|
|
8881
|
+
* - 中文字符(及非 `[0-9a-z.()]` 的字符)计为 1 个字符
|
|
8882
|
+
* - 数字、小写字母及 `.()` 计为 0.5 个字符
|
|
8883
|
+
* - 超出长度时,截取前 n-2 个字符并追加 `...`
|
|
8884
|
+
* @author Lizhao <lz@winbaoxian.com>
|
|
8885
|
+
* @date 2024-09-10
|
|
8886
|
+
* @param {string} str 必传。需要截取的字符串
|
|
8887
|
+
* @param {number} n 必传。最大字符数(需大于 2)
|
|
8888
|
+
* @returns {string} 截取后的字符串
|
|
8889
|
+
* @example
|
|
8890
|
+
* textOverflowEllipsis('你好world', 4)
|
|
8891
|
+
* // returns 你好...
|
|
8892
|
+
*
|
|
8893
|
+
* textOverflowEllipsis('hello world', 4)
|
|
8894
|
+
* // returns hello world
|
|
8875
8895
|
*/
|
|
8876
8896
|
function textOverflowEllipsis(str, n) {
|
|
8877
8897
|
var text = String(str);
|
|
@@ -8909,7 +8929,9 @@
|
|
|
8909
8929
|
// 通用信息
|
|
8910
8930
|
customVariable: null,
|
|
8911
8931
|
// 自定义变量
|
|
8912
|
-
cv: null
|
|
8932
|
+
cv: null,
|
|
8933
|
+
// 简写,自定义变量
|
|
8934
|
+
t: {} // 事件目标
|
|
8913
8935
|
};
|
|
8914
8936
|
if (personData) {
|
|
8915
8937
|
var insuredInfo = (personData.personOrderList || []).find(function (p) {
|
|
@@ -8957,8 +8979,13 @@
|
|
|
8957
8979
|
});
|
|
8958
8980
|
}
|
|
8959
8981
|
}
|
|
8960
|
-
if (options
|
|
8961
|
-
|
|
8982
|
+
if (options) {
|
|
8983
|
+
if (options.planbookId) {
|
|
8984
|
+
map.planbookId = options.planbookId;
|
|
8985
|
+
}
|
|
8986
|
+
if (options.eventTarget) {
|
|
8987
|
+
map.t = options.eventTarget;
|
|
8988
|
+
}
|
|
8962
8989
|
}
|
|
8963
8990
|
if (ins && ins.customVariableExp) {
|
|
8964
8991
|
var exp = ins.customVariableExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'map.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'map.$2');
|
|
@@ -8989,11 +9016,12 @@
|
|
|
8989
9016
|
}
|
|
8990
9017
|
if (['cmCommonSelect', 'cmCommonRadioBtn', 'cmCommonRadio', 'cmCommonCheckbox'].includes(ele.componentName)) {
|
|
8991
9018
|
if (ele.defaultValueExp) {
|
|
8992
|
-
|
|
8993
|
-
|
|
8994
|
-
|
|
8995
|
-
|
|
9019
|
+
var _exp = ele.defaultValueExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
9020
|
+
var expValue = eval(_exp);
|
|
9021
|
+
if (!['', null, undefined].includes(expValue)) {
|
|
9022
|
+
newEleMap.value = expValue;
|
|
8996
9023
|
}
|
|
9024
|
+
consoleLogWhenEnable("".concat(ele.key, ": defaultValueExp"), _exp, newEleMap.value);
|
|
8997
9025
|
}
|
|
8998
9026
|
if (ele.underwriteExp) {
|
|
8999
9027
|
var _exp2 = ele.underwriteExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
@@ -9021,11 +9049,12 @@
|
|
|
9021
9049
|
}
|
|
9022
9050
|
if (['cmCommonInput'].includes(ele.componentName)) {
|
|
9023
9051
|
if (ele.defaultValueExp) {
|
|
9024
|
-
|
|
9025
|
-
|
|
9026
|
-
|
|
9027
|
-
|
|
9052
|
+
var _exp3 = ele.defaultValueExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
9053
|
+
var _expValue = eval(_exp3);
|
|
9054
|
+
if (!['', null, undefined].includes(_expValue)) {
|
|
9055
|
+
newEleMap.value = _expValue;
|
|
9028
9056
|
}
|
|
9057
|
+
consoleLogWhenEnable("".concat(ele.key, ": defaultValueExp"), _exp3, newEleMap.value);
|
|
9029
9058
|
}
|
|
9030
9059
|
if (ele.minExp) {
|
|
9031
9060
|
var _exp4 = ele.minExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
@@ -9422,7 +9451,7 @@
|
|
|
9422
9451
|
* @author Lizhao <lz@winbaoxian.com>
|
|
9423
9452
|
* @date 2022-04-26
|
|
9424
9453
|
* @param {IPbPersons} allPersonsData 必传。所有人员数据
|
|
9425
|
-
* @param {null|string} type 可不传。
|
|
9454
|
+
* @param {null|string|string[]} type 可不传。
|
|
9426
9455
|
* 不传,人员数据按原结构返回;
|
|
9427
9456
|
* 字符串,返回指定的人员数据;
|
|
9428
9457
|
* 数组,以数组形式,返回多个人员数据。
|
|
@@ -9943,10 +9972,10 @@
|
|
|
9943
9972
|
* @author Lizhao <lz@winbaoxian.com>
|
|
9944
9973
|
* @date 2022-04-26
|
|
9945
9974
|
* @param {IPbProduct} prodData 必传。产品数据(单个)
|
|
9946
|
-
* @param {object}
|
|
9975
|
+
* @param {object} prodVerifyData 必传。产品校验条件(单个)
|
|
9947
9976
|
* @param {IPbPersons} personData 必传。人员信息,包括被保人、投保人、投保人配偶
|
|
9948
|
-
* @param {object} parmas
|
|
9949
|
-
* @returns {IPbProduct} 产品数据(单个)
|
|
9977
|
+
* @param {object} [parmas] 可不传。补充参数,目前只有 planbookId
|
|
9978
|
+
* @returns {Promise<IPbProduct>} 产品数据(单个)
|
|
9950
9979
|
*/
|
|
9951
9980
|
function productDataHandler(_x, _x2, _x3, _x4) {
|
|
9952
9981
|
return _productDataHandler.apply(this, arguments);
|
|
@@ -9954,6 +9983,7 @@
|
|
|
9954
9983
|
|
|
9955
9984
|
/**
|
|
9956
9985
|
* **处理多被保人**
|
|
9986
|
+
* @ignore
|
|
9957
9987
|
* @author Lizhao <lz@winbaoxian.com>
|
|
9958
9988
|
* @date 2024-02-28
|
|
9959
9989
|
* @param {IPbPersons} personData 必传。人员信息,包括被保人、投保人、投保人配偶
|
|
@@ -9961,7 +9991,7 @@
|
|
|
9961
9991
|
*/
|
|
9962
9992
|
function _productDataHandler() {
|
|
9963
9993
|
_productDataHandler = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(prodData, prodVerifyData, personData, parmas) {
|
|
9964
|
-
var productVerifyData, hasProduct, hasVerifyData, hasPersonData, personOrderList, _prodData$mulInsOrder3;
|
|
9994
|
+
var productVerifyData, _parmas$eventTarget, insuranceKey, elementKey, groupInsurance, groupInsuranceIdEle, subInsurances, hasProduct, hasVerifyData, hasPersonData, personOrderList, _prodData$mulInsOrder3;
|
|
9965
9995
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
9966
9996
|
while (1) switch (_context.prev = _context.next) {
|
|
9967
9997
|
case 0:
|
|
@@ -9988,6 +10018,29 @@
|
|
|
9988
10018
|
case 3:
|
|
9989
10019
|
productVerifyData = prodVerifyData;
|
|
9990
10020
|
case 4:
|
|
10021
|
+
// 组合险种特殊处理:当用户点击组合险种的子险种选项时,将其他子险种的标题设置为未选中状态
|
|
10022
|
+
if (parmas && parmas.eventTarget) {
|
|
10023
|
+
_parmas$eventTarget = parmas.eventTarget, insuranceKey = _parmas$eventTarget.insuranceKey, elementKey = _parmas$eventTarget.elementKey;
|
|
10024
|
+
if (insuranceKey && elementKey === 'insuranceId') {
|
|
10025
|
+
groupInsurance = (prodData.mulInsOrderList || []).find(function (ins) {
|
|
10026
|
+
return ins.key === insuranceKey;
|
|
10027
|
+
});
|
|
10028
|
+
groupInsuranceIdEle = ((groupInsurance === null || groupInsurance === void 0 ? void 0 : groupInsurance.eleOrderList) || []).find(function (e) {
|
|
10029
|
+
return e.key === 'insuranceId';
|
|
10030
|
+
});
|
|
10031
|
+
subInsurances = (prodData.mulInsOrderList || []).filter(function (ins) {
|
|
10032
|
+
return ins.groupKey === insuranceKey;
|
|
10033
|
+
});
|
|
10034
|
+
subInsurances.forEach(function (ins) {
|
|
10035
|
+
var titleEle = (ins.eleOrderList || []).find(function (e) {
|
|
10036
|
+
return e.key === 'title';
|
|
10037
|
+
});
|
|
10038
|
+
if (titleEle && groupInsuranceIdEle && !Array.isArray(titleEle.value)) {
|
|
10039
|
+
titleEle.value = groupInsuranceIdEle.value === ins.key;
|
|
10040
|
+
}
|
|
10041
|
+
});
|
|
10042
|
+
}
|
|
10043
|
+
}
|
|
9991
10044
|
hasProduct = prodData.mulInsOrderList;
|
|
9992
10045
|
hasVerifyData = productVerifyData && Object.keys(productVerifyData).length;
|
|
9993
10046
|
hasPersonData = personData && personData.personOrderList;
|
|
@@ -10272,6 +10325,7 @@
|
|
|
10272
10325
|
|
|
10273
10326
|
/**
|
|
10274
10327
|
* 请求返回当前产品、当前条件的费率数据
|
|
10328
|
+
* @ignore
|
|
10275
10329
|
* @author Lizhao <lz@winbaoxian.com>
|
|
10276
10330
|
* @date 2024-02-28
|
|
10277
10331
|
* @param {IPbProduct} prodData 必传。产品数据(单个)
|
|
@@ -10339,6 +10393,7 @@
|
|
|
10339
10393
|
|
|
10340
10394
|
/**
|
|
10341
10395
|
* **多被保人,获取并缓存多个险种信息的费率信息**
|
|
10396
|
+
* @ignore
|
|
10342
10397
|
* @author Lizhao <lz@winbaoxian.com>
|
|
10343
10398
|
* @date 2023-12-28
|
|
10344
10399
|
* @param { any } params 必传。接口请求信息
|
|
@@ -10455,40 +10510,21 @@
|
|
|
10455
10510
|
* @returns {IPbProduct} 产品数据(单个)
|
|
10456
10511
|
*/
|
|
10457
10512
|
function setGroupInsurance(prodData) {
|
|
10458
|
-
|
|
10459
|
-
|
|
10460
|
-
|
|
10461
|
-
var groupInsuranceList = prodData && prodData.mulInsOrderList && prodData.mulInsOrderList.filter(function (ins) {
|
|
10462
|
-
return !!ins.groupKey;
|
|
10463
|
-
});
|
|
10464
|
-
if (!groupInsuranceList || !groupInsuranceList.length) {
|
|
10465
|
-
return prodData;
|
|
10466
|
-
}
|
|
10467
|
-
var oldGroupInsList = prodData.mulInsOrderList.filter(function (ins) {
|
|
10468
|
-
return ins.isGroup;
|
|
10469
|
-
});
|
|
10470
|
-
var newGroupInsMap = {};
|
|
10471
|
-
//清空险种列表中的已有的险种组合
|
|
10472
|
-
prodData.mulInsOrderList = prodData.mulInsOrderList.filter(function (ins) {
|
|
10513
|
+
var mulInsOrderList = prodData && prodData.mulInsOrderList ? prodData.mulInsOrderList : [];
|
|
10514
|
+
// 清空险种列表中的已有的险种组合
|
|
10515
|
+
prodData.mulInsOrderList = mulInsOrderList.filter(function (ins) {
|
|
10473
10516
|
return !ins.isGroup;
|
|
10474
10517
|
});
|
|
10475
|
-
|
|
10476
|
-
|
|
10477
|
-
|
|
10478
|
-
|
|
10479
|
-
|
|
10480
|
-
|
|
10481
|
-
var
|
|
10482
|
-
|
|
10483
|
-
|
|
10484
|
-
|
|
10485
|
-
return e.key === 'title';
|
|
10486
|
-
});
|
|
10487
|
-
oldInsuranceIdEle = oldGroupIns.eleOrderList.find(function (e) {
|
|
10488
|
-
return e.key === 'insuranceId';
|
|
10489
|
-
});
|
|
10490
|
-
}
|
|
10491
|
-
if (ins.groupKey) {
|
|
10518
|
+
|
|
10519
|
+
// 多险种选一,或多险种选多。生成一个组合,如多个险种合成豁免险
|
|
10520
|
+
var groupInsuranceList = mulInsOrderList.filter(function (ins) {
|
|
10521
|
+
return !!ins.groupKey;
|
|
10522
|
+
});
|
|
10523
|
+
if (groupInsuranceList.length) {
|
|
10524
|
+
var newGroupInsMap = {};
|
|
10525
|
+
groupInsuranceList.filter(function (ins) {
|
|
10526
|
+
return ins.groupKey;
|
|
10527
|
+
}).forEach(function (ins) {
|
|
10492
10528
|
newGroupInsMap[ins.groupKey] = newGroupInsMap[ins.groupKey] || {
|
|
10493
10529
|
key: ins.groupKey,
|
|
10494
10530
|
name: ins.groupName,
|
|
@@ -10496,19 +10532,19 @@
|
|
|
10496
10532
|
isGroup: true,
|
|
10497
10533
|
eleOrderList: [{
|
|
10498
10534
|
key: 'title',
|
|
10499
|
-
value:
|
|
10535
|
+
value: false,
|
|
10500
10536
|
isDisabled: false,
|
|
10501
10537
|
componentName: 'cmCommonTitle',
|
|
10502
10538
|
labelName: ins.groupName
|
|
10503
10539
|
}, {
|
|
10504
10540
|
key: 'insuranceId',
|
|
10505
|
-
value:
|
|
10541
|
+
value: ins.isCheckbox ? [] : null,
|
|
10506
10542
|
componentName: ins.isCheckbox ? 'cmCommonCheckbox' : 'cmCommonRadio',
|
|
10507
10543
|
opts: []
|
|
10508
10544
|
}]
|
|
10509
10545
|
};
|
|
10510
10546
|
|
|
10511
|
-
//
|
|
10547
|
+
// 将子险种转换成险种组合的选项
|
|
10512
10548
|
var titleEle = ins.eleOrderList.find(function (e) {
|
|
10513
10549
|
return e.key === 'title';
|
|
10514
10550
|
});
|
|
@@ -10521,119 +10557,73 @@
|
|
|
10521
10557
|
desc: titleEle.labelName,
|
|
10522
10558
|
isDisabled: titleEle.isDisabled
|
|
10523
10559
|
});
|
|
10524
|
-
}
|
|
10525
|
-
});
|
|
10526
|
-
|
|
10527
|
-
// 处理组合险中的逻辑,并加入到产品险种列表中
|
|
10528
|
-
var _loop = function _loop(k) {
|
|
10529
|
-
var nGroupTitle = newGroupInsMap[k].eleOrderList.find(function (e) {
|
|
10530
|
-
return e.key === 'title';
|
|
10531
10560
|
});
|
|
10532
|
-
|
|
10533
|
-
|
|
10534
|
-
|
|
10535
|
-
|
|
10536
|
-
|
|
10537
|
-
|
|
10538
|
-
|
|
10539
|
-
|
|
10540
|
-
|
|
10541
|
-
|
|
10542
|
-
nGroupTitle.isDisabled = true;
|
|
10543
|
-
} else {
|
|
10544
|
-
nGroupTitle.isDisabled = false;
|
|
10545
|
-
}
|
|
10546
|
-
}
|
|
10547
|
-
var groupInsList = prodData.mulInsOrderList.filter(function (ins) {
|
|
10561
|
+
|
|
10562
|
+
// 处理组合险中的逻辑,并加入到产品险种列表中
|
|
10563
|
+
var _loop = function _loop(k) {
|
|
10564
|
+
var nGroupTitleEle = newGroupInsMap[k].eleOrderList.find(function (e) {
|
|
10565
|
+
return e.key === 'title';
|
|
10566
|
+
});
|
|
10567
|
+
var nGroupInsuranceIdEle = newGroupInsMap[k].eleOrderList.find(function (e) {
|
|
10568
|
+
return e.key === 'insuranceId';
|
|
10569
|
+
});
|
|
10570
|
+
var groupInsList = mulInsOrderList.filter(function (ins) {
|
|
10548
10571
|
return ins.groupKey == k;
|
|
10549
10572
|
});
|
|
10550
|
-
if (
|
|
10551
|
-
// 如果组合险中有一款是必选的,则整个组合险为选中状态
|
|
10552
|
-
if (groupInsList.some(function (ins) {
|
|
10553
|
-
var subTitle = ins.eleOrderList.find(function (e) {
|
|
10554
|
-
return e.key === 'title';
|
|
10555
|
-
});
|
|
10556
|
-
return ins.required && subTitle && !subTitle.isDisabled;
|
|
10557
|
-
})) {
|
|
10558
|
-
nGroupTitle.value = true;
|
|
10559
|
-
nGroupTitle.isDisabled = true;
|
|
10560
|
-
}
|
|
10561
|
-
|
|
10562
|
-
// 初始化时,设置组合险默认值
|
|
10573
|
+
if (nGroupTitleEle && nGroupInsuranceIdEle && groupInsList.length) {
|
|
10563
10574
|
var notDisabledInsurances = groupInsList.filter(function (ins) {
|
|
10564
|
-
var
|
|
10575
|
+
var titleEle = (ins.eleOrderList || []).find(function (e) {
|
|
10565
10576
|
return e.key === 'title';
|
|
10566
10577
|
});
|
|
10567
|
-
return
|
|
10578
|
+
return titleEle && !titleEle.isDisabled;
|
|
10568
10579
|
});
|
|
10569
|
-
var checkedInsurances = notDisabledInsurances.
|
|
10570
|
-
var
|
|
10571
|
-
return
|
|
10580
|
+
var checkedInsurances = notDisabledInsurances.filter(function (ins) {
|
|
10581
|
+
var titleEle = (ins.eleOrderList || []).find(function (ele) {
|
|
10582
|
+
return ele.key === 'title';
|
|
10572
10583
|
});
|
|
10573
|
-
return
|
|
10584
|
+
return titleEle && titleEle.value;
|
|
10574
10585
|
});
|
|
10575
|
-
|
|
10576
|
-
|
|
10577
|
-
nGroupInsuranceId.value = checkedInsurances.key;
|
|
10578
|
-
nGroupTitle.value = true;
|
|
10579
|
-
} else if (nGroupTitle.value) {
|
|
10580
|
-
if (notDisabledInsurances[0]) {
|
|
10581
|
-
nGroupInsuranceId.value = notDisabledInsurances[0].key;
|
|
10582
|
-
}
|
|
10583
|
-
}
|
|
10584
|
-
}
|
|
10585
|
-
}
|
|
10586
|
-
}
|
|
10587
|
-
if (nGroupInsuranceId) {
|
|
10588
|
-
if (nGroupInsuranceId.value) {
|
|
10589
|
-
if (nGroupInsuranceId.value.constructor === Array) {
|
|
10590
|
-
if (nGroupInsuranceId.opts) {
|
|
10591
|
-
nGroupInsuranceId.opts = nGroupInsuranceId.opts.filter(function (opt) {
|
|
10592
|
-
return nGroupInsuranceId.value.indexOf(opt.val) !== -1 && !opt.isDisabled;
|
|
10593
|
-
});
|
|
10594
|
-
}
|
|
10595
|
-
} else {
|
|
10596
|
-
var opt = nGroupInsuranceId.opts.find(function (o) {
|
|
10597
|
-
return o.val === nGroupInsuranceId.value;
|
|
10598
|
-
});
|
|
10599
|
-
if (opt && opt.isDisabled) {
|
|
10600
|
-
nGroupInsuranceId.value = '';
|
|
10601
|
-
}
|
|
10602
|
-
}
|
|
10603
|
-
}
|
|
10604
|
-
if (nGroupInsuranceId.value) {
|
|
10605
|
-
var checkedIns = prodData.mulInsOrderList.find(function (ins) {
|
|
10606
|
-
return ins.key === nGroupInsuranceId.value;
|
|
10586
|
+
var hasRequiredIns = notDisabledInsurances.some(function (ins) {
|
|
10587
|
+
return ins.required;
|
|
10607
10588
|
});
|
|
10608
|
-
|
|
10609
|
-
|
|
10610
|
-
|
|
10611
|
-
|
|
10612
|
-
|
|
10589
|
+
var checkedInsurance = checkedInsurances[0];
|
|
10590
|
+
// hasRequiredIns:如果组合险中有一款是必选的,则整个组合险为选中状态
|
|
10591
|
+
// 所有险种都不可选,则组合险不可修改且不选中。否则,组合险种可选
|
|
10592
|
+
nGroupTitleEle.value = hasRequiredIns || (nGroupInsuranceIdEle.opts || []).some(function (opt) {
|
|
10593
|
+
return !opt.isDisabled;
|
|
10594
|
+
});
|
|
10595
|
+
nGroupTitleEle.isDisabled = hasRequiredIns || (nGroupInsuranceIdEle.opts || []).every(function (opt) {
|
|
10596
|
+
return !!opt.isDisabled;
|
|
10597
|
+
});
|
|
10598
|
+
nGroupInsuranceIdEle.value = checkedInsurance ? checkedInsurance.key : null;
|
|
10599
|
+
|
|
10600
|
+
//将当前选中险种的部分数据复制到组合险中
|
|
10601
|
+
if (checkedInsurance) {
|
|
10602
|
+
// 定义组件险中的元素:自身eleOrderList + 所选险种的eleOrderList(不包含标题)
|
|
10603
|
+
var keys = ['code', 'groupKey', 'groupName', 'isFollowing', 'key', 'name', 'accountData', 'reduceBaofData', 'duplicateReduceBaofData'];
|
|
10604
|
+
for (var ck in checkedInsurance) {
|
|
10605
|
+
if (!keys.includes(ck)) {
|
|
10613
10606
|
if (ck === 'eleOrderList') {
|
|
10614
|
-
newGroupInsMap[k][ck] = newGroupInsMap[k][ck].concat(
|
|
10607
|
+
newGroupInsMap[k][ck] = newGroupInsMap[k][ck].concat(checkedInsurance[ck].filter(function (ele) {
|
|
10615
10608
|
return ele.key !== 'title';
|
|
10616
10609
|
}));
|
|
10617
10610
|
} else {
|
|
10618
|
-
newGroupInsMap[k][ck] =
|
|
10611
|
+
newGroupInsMap[k][ck] = checkedInsurance[ck];
|
|
10619
10612
|
}
|
|
10620
10613
|
}
|
|
10621
10614
|
}
|
|
10622
10615
|
}
|
|
10623
10616
|
}
|
|
10624
|
-
|
|
10625
|
-
|
|
10626
|
-
|
|
10627
|
-
if (
|
|
10628
|
-
index
|
|
10617
|
+
var index = mulInsOrderList.findLastIndex(function (ins) {
|
|
10618
|
+
return ins.groupKey === k;
|
|
10619
|
+
});
|
|
10620
|
+
if (index >= 0) {
|
|
10621
|
+
prodData.mulInsOrderList.splice(index + 1, 0, newGroupInsMap[k]);
|
|
10629
10622
|
}
|
|
10630
|
-
}
|
|
10631
|
-
|
|
10632
|
-
|
|
10623
|
+
};
|
|
10624
|
+
for (var k in newGroupInsMap) {
|
|
10625
|
+
_loop(k);
|
|
10633
10626
|
}
|
|
10634
|
-
};
|
|
10635
|
-
for (var k in newGroupInsMap) {
|
|
10636
|
-
_loop(k);
|
|
10637
10627
|
}
|
|
10638
10628
|
return prodData;
|
|
10639
10629
|
}
|
|
@@ -10908,7 +10898,7 @@
|
|
|
10908
10898
|
if (insuranceData.title && !insuranceData.groupKey) {
|
|
10909
10899
|
if (insuranceData.isGroup) {
|
|
10910
10900
|
//组合险,则遍历其所选中的险种,并转换数据
|
|
10911
|
-
var insuranceId = insuranceData.insuranceId
|
|
10901
|
+
var insuranceId = Array.isArray(insuranceData.insuranceId) ? insuranceData.insuranceId : [insuranceData.insuranceId];
|
|
10912
10902
|
insuranceId.forEach(function (insId) {
|
|
10913
10903
|
var checkedIns = prodData.mulInsOrderList.find(function (p) {
|
|
10914
10904
|
return p.key === insId;
|
|
@@ -46300,6 +46290,7 @@
|
|
|
46300
46290
|
params,
|
|
46301
46291
|
allPersonsData,
|
|
46302
46292
|
productGroupList,
|
|
46293
|
+
eventTarget,
|
|
46303
46294
|
promises,
|
|
46304
46295
|
_args = arguments;
|
|
46305
46296
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
@@ -46315,6 +46306,10 @@
|
|
|
46315
46306
|
case 1:
|
|
46316
46307
|
allPersonsData = inputData.personData;
|
|
46317
46308
|
productGroupList = inputData.productGroupList || [];
|
|
46309
|
+
eventTarget = {
|
|
46310
|
+
personKey: personData.key,
|
|
46311
|
+
elementKey: ele.key
|
|
46312
|
+
};
|
|
46318
46313
|
if (!allPersonsData) {
|
|
46319
46314
|
_context.next = 2;
|
|
46320
46315
|
break;
|
|
@@ -46332,7 +46327,8 @@
|
|
|
46332
46327
|
g.prodOrderList.map(function (p) {
|
|
46333
46328
|
clearAddAndTakeAndAdjustBaoeData(p);
|
|
46334
46329
|
promises.push(productDataHandler(p, lodash.get(verifyData, "[".concat(p.key, "]")), allPersonsData, {
|
|
46335
|
-
planbookId: lodash.get(params, 'planbookId')
|
|
46330
|
+
planbookId: lodash.get(params, 'planbookId'),
|
|
46331
|
+
eventTarget: eventTarget
|
|
46336
46332
|
}));
|
|
46337
46333
|
});
|
|
46338
46334
|
});
|
|
@@ -46738,7 +46734,7 @@
|
|
|
46738
46734
|
productForm.mulInsOrderList = productForm.mulInsOrderList.map(function (ins) {
|
|
46739
46735
|
var tempIns = {};
|
|
46740
46736
|
for (var _k2 in ins) {
|
|
46741
|
-
if (!['isFollowing', 'pPeriodDesc', 'baoeDesc', 'baofDesc', 'iDurationDesc', 'accountData', 'reduceBaofData', 'duplicateReduceBaofData', 'isCheckbox', 'groupKey', 'groupName'].includes(_k2)) {
|
|
46737
|
+
if (!['isFollowing', 'pPeriodDesc', 'baoeDesc', 'baofDesc', 'iDurationDesc', 'accountData', 'reduceBaofData', 'duplicateReduceBaofData', 'isCheckbox', 'groupKey', 'groupName', 'customVariableExp', 'calcResultExp', 'revalidateFlag'].includes(_k2)) {
|
|
46742
46738
|
tempIns[_k2] = ins[_k2];
|
|
46743
46739
|
}
|
|
46744
46740
|
}
|
|
@@ -47000,7 +46996,7 @@
|
|
|
47000
46996
|
value: function () {
|
|
47001
46997
|
var _changeProduct = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3(productData, options) {
|
|
47002
46998
|
var _this5 = this;
|
|
47003
|
-
var $listeners, inputData, verifyData, personData, groupKey, productKey, params, type, insData, eleData, planbookId, publicPbUuid, productVerifyData, errorMsg, hasRevalidateFlag;
|
|
46999
|
+
var $listeners, inputData, verifyData, personData, groupKey, productKey, params, type, insData, eleData, planbookId, publicPbUuid, productVerifyData, eventTarget, errorMsg, hasRevalidateFlag;
|
|
47004
47000
|
return _regeneratorRuntime.wrap(function (_context3) {
|
|
47005
47001
|
while (1) switch (_context3.prev = _context3.next) {
|
|
47006
47002
|
case 0:
|
|
@@ -47009,12 +47005,18 @@
|
|
|
47009
47005
|
planbookId = lodash.get(params, 'planbookId');
|
|
47010
47006
|
publicPbUuid = lodash.get(params, 'publicPbUuid');
|
|
47011
47007
|
productVerifyData = lodash.get(verifyData, "[".concat(productKey, "]"));
|
|
47008
|
+
eventTarget = {
|
|
47009
|
+
insuranceKey: lodash.get(insData, 'key') || null,
|
|
47010
|
+
insuranceCode: lodash.get(insData, 'code') || null,
|
|
47011
|
+
elementKey: lodash.get(eleData, 'key') || null
|
|
47012
|
+
};
|
|
47012
47013
|
if (type === 'change') {
|
|
47013
47014
|
clearAddAndTakeAndAdjustBaoeData(productData);
|
|
47014
47015
|
}
|
|
47015
47016
|
_context3.next = 1;
|
|
47016
47017
|
return productDataHandler(productData, productVerifyData, personData, {
|
|
47017
|
-
planbookId: planbookId
|
|
47018
|
+
planbookId: planbookId,
|
|
47019
|
+
eventTarget: eventTarget
|
|
47018
47020
|
});
|
|
47019
47021
|
case 1:
|
|
47020
47022
|
if (type === 'change') {
|
|
@@ -47046,7 +47048,8 @@
|
|
|
47046
47048
|
publicPbUuid: publicPbUuid,
|
|
47047
47049
|
groupKey: groupKey,
|
|
47048
47050
|
productKey: productKey,
|
|
47049
|
-
isIgnoreError: true
|
|
47051
|
+
isIgnoreError: true,
|
|
47052
|
+
eventTarget: eventTarget
|
|
47050
47053
|
}, resolve, reject);
|
|
47051
47054
|
}).catch(function (err) {
|
|
47052
47055
|
errorMsg = lodash.get(err, '[0].message') || lodash.get(err, 'message');
|
|
@@ -47054,7 +47057,8 @@
|
|
|
47054
47057
|
case 2:
|
|
47055
47058
|
_context3.next = 3;
|
|
47056
47059
|
return productDataHandler(productData, productVerifyData, personData, {
|
|
47057
|
-
planbookId: planbookId
|
|
47060
|
+
planbookId: planbookId,
|
|
47061
|
+
eventTarget: eventTarget
|
|
47058
47062
|
});
|
|
47059
47063
|
case 3:
|
|
47060
47064
|
return _context3.abrupt("return", errorMsg);
|
|
@@ -47623,6 +47627,12 @@
|
|
|
47623
47627
|
insData: ins,
|
|
47624
47628
|
eleData: ele
|
|
47625
47629
|
});
|
|
47630
|
+
},
|
|
47631
|
+
"clear": function clear($event) {
|
|
47632
|
+
return _vm.onChange({
|
|
47633
|
+
insData: ins,
|
|
47634
|
+
eleData: ele
|
|
47635
|
+
});
|
|
47626
47636
|
}
|
|
47627
47637
|
},
|
|
47628
47638
|
scopedSlots: _vm._u([!ele.isDisabled ? {
|
|
@@ -48307,7 +48317,7 @@
|
|
|
48307
48317
|
install(window.Vue);
|
|
48308
48318
|
}
|
|
48309
48319
|
var index = {
|
|
48310
|
-
version: '3.2.0-
|
|
48320
|
+
version: '3.2.0-2',
|
|
48311
48321
|
install: install
|
|
48312
48322
|
};
|
|
48313
48323
|
|
|
@@ -37352,6 +37352,7 @@
|
|
|
37352
37352
|
|
|
37353
37353
|
/**
|
|
37354
37354
|
* **多被保人,获取并缓存多个险种信息的费率信息**
|
|
37355
|
+
* @ignore
|
|
37355
37356
|
* @author Lizhao <lz@winbaoxian.com>
|
|
37356
37357
|
* @date 2023-12-28
|
|
37357
37358
|
* @param { any } params 必传。接口请求信息
|