bxs-tools-ui 3.1.3 → 3.2.0-1
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 +2 -4
- package/es/adjust-baoe/index.js +3 -5
- package/es/index.js +378 -190
- package/es/insure-calculate/index.js +2 -4
- package/es/person-info/index.js +285 -150
- package/es/product-info/index.js +353 -173
- package/es/share-sheet/index.js +2 -4
- package/es/utils/index.js +285 -154
- package/lib/add-and-take/index.js +2 -4
- package/lib/adjust-baoe/index.js +3 -5
- package/lib/index.js +378 -190
- package/lib/insure-calculate/index.js +2 -4
- package/lib/person-info/index.js +285 -150
- package/lib/product-info/index.js +353 -173
- package/lib/share-sheet/index.js +2 -4
- package/lib/utils/index.js +288 -153
- package/package.json +1 -1
- package/packages/add-and-take/demo/index.vue +2 -2
- package/packages/bxs-utils/planbook/common.ts +150 -0
- package/packages/bxs-utils/planbook/index.ts +1 -4
- package/packages/bxs-utils/planbook/person.ts +2 -4
- package/packages/bxs-utils/planbook/product.ts +84 -140
- package/packages/index.ts +1 -1
- package/packages/person-info/index.vue +6 -1
- package/packages/planbook-input/components/product-table.vue +8 -9
- package/packages/planbook-input/helper.js +140 -12
- package/packages/planbook-input/index.vue +44 -10
- package/packages/product-info/index.vue +51 -8
|
@@ -37349,6 +37349,8 @@ if (typeof window !== 'undefined' && window.Vue) {
|
|
|
37349
37349
|
install$1(window.Vue);
|
|
37350
37350
|
}
|
|
37351
37351
|
|
|
37352
|
+
document && document.cookie && document.cookie.match('ENABLE_LIZHAO_DEBUG=1');
|
|
37353
|
+
|
|
37352
37354
|
/**
|
|
37353
37355
|
* **多被保人,获取并缓存多个险种信息的费率信息**
|
|
37354
37356
|
* @author Lizhao <lz@winbaoxian.com>
|
|
@@ -37380,10 +37382,6 @@ memoize(function (params) {
|
|
|
37380
37382
|
return QS.stringify(params);
|
|
37381
37383
|
});
|
|
37382
37384
|
|
|
37383
|
-
if (document && document.cookie && document.cookie.match('LIZHAO_DEBUG_CONSOLE_FLAG=1')) {
|
|
37384
|
-
window.DEBUG_TEMP_CONSOLE_FLAG = true;
|
|
37385
|
-
}
|
|
37386
|
-
|
|
37387
37385
|
function showLoading() {
|
|
37388
37386
|
if (IS_CPPOC_HOST) {
|
|
37389
37387
|
_Toast.loading({
|
package/es/person-info/index.js
CHANGED
|
@@ -944,6 +944,14 @@ function Watch(path, options) {
|
|
|
944
944
|
});
|
|
945
945
|
}
|
|
946
946
|
|
|
947
|
+
var enableLizhaoDebug = document && document.cookie && document.cookie.match('ENABLE_LIZHAO_DEBUG=1');
|
|
948
|
+
function consoleLogWhenEnable() {
|
|
949
|
+
if (enableLizhaoDebug) {
|
|
950
|
+
var _console;
|
|
951
|
+
(_console = console).log.apply(_console, arguments);
|
|
952
|
+
}
|
|
953
|
+
}
|
|
954
|
+
|
|
947
955
|
/**
|
|
948
956
|
* **将对象下的 eleOrderList 数组中的子元素下的 value,转换为 key-value 键值对**
|
|
949
957
|
* @author Lizhao <lz@winbaoxian.com>
|
|
@@ -1113,6 +1121,174 @@ function getAgeFromBirth(birth, cDate) {
|
|
|
1113
1121
|
}
|
|
1114
1122
|
return age;
|
|
1115
1123
|
}
|
|
1124
|
+
function getExpressionParamMap(personData, product, ins, options) {
|
|
1125
|
+
var map = {
|
|
1126
|
+
planbookId: null,
|
|
1127
|
+
// 计划书id
|
|
1128
|
+
productId: null,
|
|
1129
|
+
// 产品id
|
|
1130
|
+
insured: {},
|
|
1131
|
+
// 被保人
|
|
1132
|
+
insured2: {},
|
|
1133
|
+
// 第二被保人
|
|
1134
|
+
applicant: {},
|
|
1135
|
+
// 投保人
|
|
1136
|
+
recipient: {},
|
|
1137
|
+
// 收件人
|
|
1138
|
+
p: {},
|
|
1139
|
+
// 当前产品
|
|
1140
|
+
m: {},
|
|
1141
|
+
// 主险
|
|
1142
|
+
me: {},
|
|
1143
|
+
// 当前险种
|
|
1144
|
+
common: {},
|
|
1145
|
+
// 通用信息
|
|
1146
|
+
customVariable: null,
|
|
1147
|
+
// 自定义变量
|
|
1148
|
+
cv: null,
|
|
1149
|
+
// 简写,自定义变量
|
|
1150
|
+
t: {} // 事件目标
|
|
1151
|
+
};
|
|
1152
|
+
if (personData) {
|
|
1153
|
+
var insuredInfo = (personData.personOrderList || []).find(function (p) {
|
|
1154
|
+
return p.key === 'insuredInfo';
|
|
1155
|
+
});
|
|
1156
|
+
var insured2Info = (personData.personOrderList || []).find(function (p) {
|
|
1157
|
+
return p.key === 'insured2Info';
|
|
1158
|
+
});
|
|
1159
|
+
var applicantInfo = (personData.personOrderList || []).find(function (p) {
|
|
1160
|
+
return p.key === 'applicantInfo';
|
|
1161
|
+
});
|
|
1162
|
+
var recipientInfo = personData !== null && personData !== void 0 && personData.recipientInfo ? personData.recipientInfo : null;
|
|
1163
|
+
map.insured = insuredInfo ? convertEleOrderListToObj(insuredInfo) : {};
|
|
1164
|
+
map.insured2 = insured2Info ? convertEleOrderListToObj(insured2Info) : {};
|
|
1165
|
+
map.applicant = applicantInfo ? convertEleOrderListToObj(applicantInfo) : {};
|
|
1166
|
+
map.recipient = recipientInfo ? convertEleOrderListToObj(recipientInfo) : {};
|
|
1167
|
+
}
|
|
1168
|
+
if (ins) {
|
|
1169
|
+
map.me = ins ? convertEleOrderListToObj(ins) : {};
|
|
1170
|
+
map["i".concat(ins.key)] = ins;
|
|
1171
|
+
}
|
|
1172
|
+
if (product) {
|
|
1173
|
+
map.productId = product.key;
|
|
1174
|
+
Object.keys(product).filter(function (k) {
|
|
1175
|
+
return !['mulInsOrderList'].includes(k);
|
|
1176
|
+
}).forEach(function (k) {
|
|
1177
|
+
map.p[k] = product[k];
|
|
1178
|
+
});
|
|
1179
|
+
if (Array.isArray(product.mulInsOrderList)) {
|
|
1180
|
+
var common = product.mulInsOrderList.find(function (item) {
|
|
1181
|
+
return item.key === 'common';
|
|
1182
|
+
});
|
|
1183
|
+
var insuranceList = product.mulInsOrderList.filter(function (item) {
|
|
1184
|
+
return !['common'].includes(item.key);
|
|
1185
|
+
}).map(function (item) {
|
|
1186
|
+
return convertEleOrderListToObj(item);
|
|
1187
|
+
});
|
|
1188
|
+
map.m = insuranceList[0] ? insuranceList[0] : {};
|
|
1189
|
+
map.me = ins && ins.key ? insuranceList.find(function (e) {
|
|
1190
|
+
return e.key === ins.key;
|
|
1191
|
+
}) || {} : {};
|
|
1192
|
+
map.common = common ? convertEleOrderListToObj(common) : {};
|
|
1193
|
+
insuranceList.forEach(function (item) {
|
|
1194
|
+
map["i".concat(item.key)] = item;
|
|
1195
|
+
});
|
|
1196
|
+
}
|
|
1197
|
+
}
|
|
1198
|
+
if (options) {
|
|
1199
|
+
if (options.planbookId) {
|
|
1200
|
+
map.planbookId = options.planbookId;
|
|
1201
|
+
}
|
|
1202
|
+
if (options.eventTarget) {
|
|
1203
|
+
map.t = options.eventTarget;
|
|
1204
|
+
}
|
|
1205
|
+
}
|
|
1206
|
+
if (ins && ins.customVariableExp) {
|
|
1207
|
+
var exp = ins.customVariableExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'map.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'map.$2');
|
|
1208
|
+
map.customVariable = eval(exp);
|
|
1209
|
+
map.cv = map.customVariable;
|
|
1210
|
+
}
|
|
1211
|
+
return map;
|
|
1212
|
+
}
|
|
1213
|
+
function executeElementRule(personData, product, ins, ele) {
|
|
1214
|
+
var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
1215
|
+
var paramMap = getExpressionParamMap(personData, product, ins, options);
|
|
1216
|
+
var newEleMap = {};
|
|
1217
|
+
if (paramMap) {
|
|
1218
|
+
if (['cmCommonTitle'].includes(ele.componentName)) {
|
|
1219
|
+
if (ele.underwriteExp) {
|
|
1220
|
+
var exp = ele.underwriteExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
1221
|
+
var evalValue = eval(exp);
|
|
1222
|
+
if (Array.isArray(evalValue)) {
|
|
1223
|
+
if ([0, 1].includes(evalValue[0])) {
|
|
1224
|
+
newEleMap.value = evalValue[0] === 1;
|
|
1225
|
+
}
|
|
1226
|
+
if ([0, 1].includes(evalValue[1])) {
|
|
1227
|
+
newEleMap.isDisabled = evalValue[1] === 0;
|
|
1228
|
+
}
|
|
1229
|
+
}
|
|
1230
|
+
consoleLogWhenEnable("".concat(ele.key, ": underwriteExp"), exp, evalValue);
|
|
1231
|
+
}
|
|
1232
|
+
}
|
|
1233
|
+
if (['cmCommonSelect', 'cmCommonRadioBtn', 'cmCommonRadio', 'cmCommonCheckbox'].includes(ele.componentName)) {
|
|
1234
|
+
if (ele.defaultValueExp) {
|
|
1235
|
+
if (ele.value !== 0 && !ele.value && paramMap.t.elementKey !== ele.key) {
|
|
1236
|
+
var _exp = ele.defaultValueExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
1237
|
+
newEleMap.value = eval(_exp);
|
|
1238
|
+
consoleLogWhenEnable("".concat(ele.key, ": defaultValueExp"), _exp, newEleMap.value);
|
|
1239
|
+
}
|
|
1240
|
+
}
|
|
1241
|
+
if (ele.underwriteExp) {
|
|
1242
|
+
var _exp2 = ele.underwriteExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
1243
|
+
var _evalValue = eval(_exp2);
|
|
1244
|
+
if (Array.isArray(_evalValue) && Array.isArray(ele.opts)) {
|
|
1245
|
+
if (_evalValue.length === 2) {
|
|
1246
|
+
newEleMap.opts = (ele.opts || []).filter(function (o) {
|
|
1247
|
+
return o.val >= _evalValue[0] && o.val <= _evalValue[1];
|
|
1248
|
+
});
|
|
1249
|
+
} else {
|
|
1250
|
+
newEleMap.opts = (ele.opts || []).filter(function (o) {
|
|
1251
|
+
return _evalValue.includes(o.val);
|
|
1252
|
+
});
|
|
1253
|
+
}
|
|
1254
|
+
}
|
|
1255
|
+
if (Array.isArray(newEleMap.opts)) {
|
|
1256
|
+
if (newEleMap.opts.length && !newEleMap.opts.some(function (o) {
|
|
1257
|
+
return o.val === ele.value;
|
|
1258
|
+
})) {
|
|
1259
|
+
newEleMap.value = newEleMap.opts[0].val;
|
|
1260
|
+
}
|
|
1261
|
+
}
|
|
1262
|
+
consoleLogWhenEnable("".concat(ele.key, ": underwriteExp"), _exp2, _evalValue);
|
|
1263
|
+
}
|
|
1264
|
+
}
|
|
1265
|
+
if (['cmCommonInput'].includes(ele.componentName)) {
|
|
1266
|
+
if (ele.defaultValueExp) {
|
|
1267
|
+
if (ele.value !== 0 && !ele.value && paramMap.t.elementKey !== ele.key) {
|
|
1268
|
+
var _exp3 = ele.defaultValueExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
1269
|
+
newEleMap.value = eval(_exp3);
|
|
1270
|
+
consoleLogWhenEnable("".concat(ele.key, ": defaultValueExp"), _exp3, newEleMap.value);
|
|
1271
|
+
}
|
|
1272
|
+
}
|
|
1273
|
+
if (ele.minExp) {
|
|
1274
|
+
var _exp4 = ele.minExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
1275
|
+
newEleMap.min = eval(_exp4);
|
|
1276
|
+
consoleLogWhenEnable("".concat(ele.key, ": minExp"), _exp4, newEleMap.min);
|
|
1277
|
+
}
|
|
1278
|
+
if (ele.maxExp) {
|
|
1279
|
+
var _exp5 = ele.maxExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
1280
|
+
newEleMap.max = eval(_exp5);
|
|
1281
|
+
consoleLogWhenEnable("".concat(ele.key, ": maxExp"), _exp5, newEleMap.max);
|
|
1282
|
+
}
|
|
1283
|
+
if (ele.multiExp) {
|
|
1284
|
+
var _exp6 = ele.multiExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
1285
|
+
newEleMap.multi = eval(_exp6);
|
|
1286
|
+
consoleLogWhenEnable("".concat(ele.key, ": multiExp"), _exp6, newEleMap.multi);
|
|
1287
|
+
}
|
|
1288
|
+
}
|
|
1289
|
+
}
|
|
1290
|
+
return newEleMap;
|
|
1291
|
+
}
|
|
1116
1292
|
|
|
1117
1293
|
/**
|
|
1118
1294
|
* **处理人员数据**
|
|
@@ -9568,7 +9744,7 @@ function productDataHandler(_x, _x2, _x3, _x4) {
|
|
|
9568
9744
|
*/
|
|
9569
9745
|
function _productDataHandler() {
|
|
9570
9746
|
_productDataHandler = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(prodData, prodVerifyData, personData, parmas) {
|
|
9571
|
-
var productVerifyData, hasProduct, hasVerifyData, hasPersonData, personOrderList, _prodData$mulInsOrder3;
|
|
9747
|
+
var productVerifyData, _parmas$eventTarget, insuranceKey, elementKey, groupInsurance, groupInsuranceIdEle, subInsurances, hasProduct, hasVerifyData, hasPersonData, personOrderList, _prodData$mulInsOrder3;
|
|
9572
9748
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
9573
9749
|
while (1) switch (_context.prev = _context.next) {
|
|
9574
9750
|
case 0:
|
|
@@ -9595,6 +9771,29 @@ function _productDataHandler() {
|
|
|
9595
9771
|
case 3:
|
|
9596
9772
|
productVerifyData = prodVerifyData;
|
|
9597
9773
|
case 4:
|
|
9774
|
+
// 组合险种特殊处理:当用户点击组合险种的子险种选项时,将其他子险种的标题设置为未选中状态
|
|
9775
|
+
if (parmas && parmas.eventTarget) {
|
|
9776
|
+
_parmas$eventTarget = parmas.eventTarget, insuranceKey = _parmas$eventTarget.insuranceKey, elementKey = _parmas$eventTarget.elementKey;
|
|
9777
|
+
if (insuranceKey && elementKey === 'insuranceId') {
|
|
9778
|
+
groupInsurance = (prodData.mulInsOrderList || []).find(function (ins) {
|
|
9779
|
+
return ins.key === insuranceKey;
|
|
9780
|
+
});
|
|
9781
|
+
groupInsuranceIdEle = ((groupInsurance === null || groupInsurance === void 0 ? void 0 : groupInsurance.eleOrderList) || []).find(function (e) {
|
|
9782
|
+
return e.key === 'insuranceId';
|
|
9783
|
+
});
|
|
9784
|
+
subInsurances = (prodData.mulInsOrderList || []).filter(function (ins) {
|
|
9785
|
+
return ins.groupKey === insuranceKey;
|
|
9786
|
+
});
|
|
9787
|
+
subInsurances.forEach(function (ins) {
|
|
9788
|
+
var titleEle = (ins.eleOrderList || []).find(function (e) {
|
|
9789
|
+
return e.key === 'title';
|
|
9790
|
+
});
|
|
9791
|
+
if (titleEle && groupInsuranceIdEle && !Array.isArray(titleEle.value)) {
|
|
9792
|
+
titleEle.value = groupInsuranceIdEle.value === ins.key;
|
|
9793
|
+
}
|
|
9794
|
+
});
|
|
9795
|
+
}
|
|
9796
|
+
}
|
|
9598
9797
|
hasProduct = prodData.mulInsOrderList;
|
|
9599
9798
|
hasVerifyData = productVerifyData && Object.keys(productVerifyData).length;
|
|
9600
9799
|
hasPersonData = personData && personData.personOrderList;
|
|
@@ -9609,8 +9808,8 @@ function _productDataHandler() {
|
|
|
9609
9808
|
insuranceDataHandler(ins, prodData);
|
|
9610
9809
|
var insuranceVerifyData = productVerifyData[ins.key];
|
|
9611
9810
|
if (!insuranceVerifyData) {
|
|
9612
|
-
if (
|
|
9613
|
-
|
|
9811
|
+
if (ins.key !== 'common') {
|
|
9812
|
+
consoleLogWhenEnable("".concat(prodData.titleName, "-").concat(prodData.key, " -> ").concat(ins.name, "-").concat(ins.key, ": \u5F53\u524D\u9669\u79CD\u6CA1\u6709\u8D39\u7387\u8868"));
|
|
9614
9813
|
}
|
|
9615
9814
|
return;
|
|
9616
9815
|
}
|
|
@@ -9662,9 +9861,7 @@ function _productDataHandler() {
|
|
|
9662
9861
|
if (isNotAllowSelect) {
|
|
9663
9862
|
eleTitle.isDisabled = true;
|
|
9664
9863
|
eleTitle.value = false;
|
|
9665
|
-
|
|
9666
|
-
console.log(curCondition ? "".concat(eleTitle.labelName, "-").concat(ins.key, ": \u8D39\u7387\u5B58\u5728\uFF01\u4F46\u6295\u4FDD\u4EBA\u672A\u9009\u4E2D\u6216\u6295\u88AB\u4FDD\u4EBA\u4E3A\u540C\u4E00\u4EBA\uFF0C\u8BE5\u8C41\u514D\u9669\uFF08\u4E0D\u80FD\u9644\u52A0\u5230\u88AB\u4FDD\u4EBA\uFF09\u4E0D\u53EF\u9009") : "".concat(eleTitle.labelName, "-").concat(ins.key, ": \u8D39\u7387\u4E0D\u5B58\u5728\uFF01"));
|
|
9667
|
-
}
|
|
9864
|
+
consoleLogWhenEnable(curCondition ? "".concat(eleTitle.labelName, "-").concat(ins.key, ": \u8D39\u7387\u5B58\u5728\uFF01\u4F46\u6295\u4FDD\u4EBA\u672A\u9009\u4E2D\u6216\u6295\u88AB\u4FDD\u4EBA\u4E3A\u540C\u4E00\u4EBA\uFF0C\u8BE5\u8C41\u514D\u9669\uFF08\u4E0D\u80FD\u9644\u52A0\u5230\u88AB\u4FDD\u4EBA\uFF09\u4E0D\u53EF\u9009") : "".concat(eleTitle.labelName, "-").concat(ins.key, ": \u8D39\u7387\u4E0D\u5B58\u5728\uFF01"));
|
|
9668
9865
|
} else {
|
|
9669
9866
|
// 存在费率,险种可选
|
|
9670
9867
|
eleTitle.isDisabled = false;
|
|
@@ -9672,9 +9869,7 @@ function _productDataHandler() {
|
|
|
9672
9869
|
if (ins.required && (!ins.groupKey || ins.isCheckbox)) {
|
|
9673
9870
|
eleTitle.value = true;
|
|
9674
9871
|
eleTitle.isDisabled = true;
|
|
9675
|
-
|
|
9676
|
-
console.log("".concat(eleTitle.labelName, "-").concat(ins.key, ": \u8D39\u7387\u5B58\u5728\uFF0C\u9669\u79CD\u4E3A\u5FC5\u9009\u9669\u4E14(\u4E3A\u975E\u7EC4\u5408\u9669\u6216\u4E3A\u591A\u9009\u4E00\u9669\u79CD)"));
|
|
9677
|
-
}
|
|
9872
|
+
consoleLogWhenEnable("".concat(eleTitle.labelName, "-").concat(ins.key, ": \u8D39\u7387\u5B58\u5728\uFF0C\u9669\u79CD\u4E3A\u5FC5\u9009\u9669\u4E14(\u4E3A\u975E\u7EC4\u5408\u9669\u6216\u4E3A\u591A\u9009\u4E00\u9669\u79CD)"));
|
|
9678
9873
|
}
|
|
9679
9874
|
}
|
|
9680
9875
|
if (!curCondition) {
|
|
@@ -9693,9 +9888,7 @@ function _productDataHandler() {
|
|
|
9693
9888
|
});
|
|
9694
9889
|
}
|
|
9695
9890
|
if (!eleData) {
|
|
9696
|
-
|
|
9697
|
-
console.log("".concat(ins.name, " - ").concat(curCondition && curCondition.key, "\u5143\u7D20\u4E0D\u5B58\u5728\uFF1A"));
|
|
9698
|
-
}
|
|
9891
|
+
consoleLogWhenEnable("".concat(ins.name, " - ").concat(curCondition && curCondition.key, "\u5143\u7D20\u4E0D\u5B58\u5728\uFF1A"));
|
|
9699
9892
|
curCondition = null;
|
|
9700
9893
|
return 0; // break
|
|
9701
9894
|
}
|
|
@@ -9724,9 +9917,7 @@ function _productDataHandler() {
|
|
|
9724
9917
|
eleData.value = refEleData.value;
|
|
9725
9918
|
}
|
|
9726
9919
|
} else {
|
|
9727
|
-
|
|
9728
|
-
console.log("".concat(ins.name, "-").concat(ins.key, "\uFF1A\u5173\u8054\u9669\u79CD").concat(ins.refInsuranceId, "\u4E0D\u5B58\u5728"));
|
|
9729
|
-
}
|
|
9920
|
+
consoleLogWhenEnable("".concat(ins.name, "-").concat(ins.key, "\uFF1A\u5173\u8054\u9669\u79CD").concat(ins.refInsuranceId, "\u4E0D\u5B58\u5728"));
|
|
9730
9921
|
}
|
|
9731
9922
|
} else {
|
|
9732
9923
|
var backupOpts = eleData.opts && eleData.opts.length ? eleData.opts.slice(0) : [];
|
|
@@ -9795,9 +9986,7 @@ function _productDataHandler() {
|
|
|
9795
9986
|
if (!curCondition) {
|
|
9796
9987
|
eleTitle.isDisabled = true;
|
|
9797
9988
|
eleTitle.value = false;
|
|
9798
|
-
|
|
9799
|
-
console.log("".concat(eleTitle.labelName, "-").concat(ins.key, ": \u8D39\u7387\u4E0D\u5B58\u5728\uFF01"));
|
|
9800
|
-
}
|
|
9989
|
+
consoleLogWhenEnable("".concat(eleTitle.labelName, "-").concat(ins.key, ": \u8D39\u7387\u4E0D\u5B58\u5728\uFF01"));
|
|
9801
9990
|
}
|
|
9802
9991
|
|
|
9803
9992
|
// 如果当前元素是隐藏的且不可修改,则过滤上一元素的选项,即,删除上一元素中不包含当前元素值的选项。
|
|
@@ -9834,6 +10023,15 @@ function _productDataHandler() {
|
|
|
9834
10023
|
_ret = _loop2();
|
|
9835
10024
|
if (_ret === 0) break;
|
|
9836
10025
|
} while (curCondition && curCondition.key && curCondition[curCondition.key]);
|
|
10026
|
+
if (Array.isArray(ins.eleOrderList)) {
|
|
10027
|
+
ins.eleOrderList.forEach(function (ele) {
|
|
10028
|
+
var newEleMap = executeElementRule(personData, prodData, ins, ele, parmas);
|
|
10029
|
+
for (var k in newEleMap) {
|
|
10030
|
+
ele[k] = newEleMap[k];
|
|
10031
|
+
}
|
|
10032
|
+
});
|
|
10033
|
+
insuranceDataHandler(ins, prodData);
|
|
10034
|
+
}
|
|
9837
10035
|
});
|
|
9838
10036
|
}
|
|
9839
10037
|
setGroupInsurance(prodData);
|
|
@@ -10063,40 +10261,21 @@ function setCommonInfo(prodData) {
|
|
|
10063
10261
|
* @returns {IPbProduct} 产品数据(单个)
|
|
10064
10262
|
*/
|
|
10065
10263
|
function setGroupInsurance(prodData) {
|
|
10066
|
-
|
|
10067
|
-
|
|
10068
|
-
|
|
10069
|
-
var groupInsuranceList = prodData && prodData.mulInsOrderList && prodData.mulInsOrderList.filter(function (ins) {
|
|
10070
|
-
return !!ins.groupKey;
|
|
10071
|
-
});
|
|
10072
|
-
if (!groupInsuranceList || !groupInsuranceList.length) {
|
|
10073
|
-
return prodData;
|
|
10074
|
-
}
|
|
10075
|
-
var oldGroupInsList = prodData.mulInsOrderList.filter(function (ins) {
|
|
10076
|
-
return ins.isGroup;
|
|
10077
|
-
});
|
|
10078
|
-
var newGroupInsMap = {};
|
|
10079
|
-
//清空险种列表中的已有的险种组合
|
|
10080
|
-
prodData.mulInsOrderList = prodData.mulInsOrderList.filter(function (ins) {
|
|
10264
|
+
var mulInsOrderList = prodData && prodData.mulInsOrderList ? prodData.mulInsOrderList : [];
|
|
10265
|
+
// 清空险种列表中的已有的险种组合
|
|
10266
|
+
prodData.mulInsOrderList = mulInsOrderList.filter(function (ins) {
|
|
10081
10267
|
return !ins.isGroup;
|
|
10082
10268
|
});
|
|
10083
|
-
|
|
10084
|
-
|
|
10085
|
-
|
|
10086
|
-
|
|
10087
|
-
|
|
10088
|
-
|
|
10089
|
-
var
|
|
10090
|
-
|
|
10091
|
-
|
|
10092
|
-
|
|
10093
|
-
return e.key === 'title';
|
|
10094
|
-
});
|
|
10095
|
-
oldInsuranceIdEle = oldGroupIns.eleOrderList.find(function (e) {
|
|
10096
|
-
return e.key === 'insuranceId';
|
|
10097
|
-
});
|
|
10098
|
-
}
|
|
10099
|
-
if (ins.groupKey) {
|
|
10269
|
+
|
|
10270
|
+
// 多险种选一,或多险种选多。生成一个组合,如多个险种合成豁免险
|
|
10271
|
+
var groupInsuranceList = mulInsOrderList.filter(function (ins) {
|
|
10272
|
+
return !!ins.groupKey;
|
|
10273
|
+
});
|
|
10274
|
+
if (groupInsuranceList.length) {
|
|
10275
|
+
var newGroupInsMap = {};
|
|
10276
|
+
groupInsuranceList.filter(function (ins) {
|
|
10277
|
+
return ins.groupKey;
|
|
10278
|
+
}).forEach(function (ins) {
|
|
10100
10279
|
newGroupInsMap[ins.groupKey] = newGroupInsMap[ins.groupKey] || {
|
|
10101
10280
|
key: ins.groupKey,
|
|
10102
10281
|
name: ins.groupName,
|
|
@@ -10104,19 +10283,19 @@ function setGroupInsurance(prodData) {
|
|
|
10104
10283
|
isGroup: true,
|
|
10105
10284
|
eleOrderList: [{
|
|
10106
10285
|
key: 'title',
|
|
10107
|
-
value:
|
|
10286
|
+
value: false,
|
|
10108
10287
|
isDisabled: false,
|
|
10109
10288
|
componentName: 'cmCommonTitle',
|
|
10110
10289
|
labelName: ins.groupName
|
|
10111
10290
|
}, {
|
|
10112
10291
|
key: 'insuranceId',
|
|
10113
|
-
value:
|
|
10292
|
+
value: ins.isCheckbox ? [] : null,
|
|
10114
10293
|
componentName: ins.isCheckbox ? 'cmCommonCheckbox' : 'cmCommonRadio',
|
|
10115
10294
|
opts: []
|
|
10116
10295
|
}]
|
|
10117
10296
|
};
|
|
10118
10297
|
|
|
10119
|
-
//
|
|
10298
|
+
// 将子险种转换成险种组合的选项
|
|
10120
10299
|
var titleEle = ins.eleOrderList.find(function (e) {
|
|
10121
10300
|
return e.key === 'title';
|
|
10122
10301
|
});
|
|
@@ -10129,119 +10308,73 @@ function setGroupInsurance(prodData) {
|
|
|
10129
10308
|
desc: titleEle.labelName,
|
|
10130
10309
|
isDisabled: titleEle.isDisabled
|
|
10131
10310
|
});
|
|
10132
|
-
}
|
|
10133
|
-
});
|
|
10134
|
-
|
|
10135
|
-
// 处理组合险中的逻辑,并加入到产品险种列表中
|
|
10136
|
-
var _loop = function _loop(k) {
|
|
10137
|
-
var nGroupTitle = newGroupInsMap[k].eleOrderList.find(function (e) {
|
|
10138
|
-
return e.key === 'title';
|
|
10139
|
-
});
|
|
10140
|
-
var nGroupInsuranceId = newGroupInsMap[k].eleOrderList.find(function (e) {
|
|
10141
|
-
return e.key === 'insuranceId';
|
|
10142
10311
|
});
|
|
10143
|
-
|
|
10144
|
-
|
|
10145
|
-
|
|
10146
|
-
|
|
10147
|
-
|
|
10148
|
-
|
|
10149
|
-
|
|
10150
|
-
|
|
10151
|
-
|
|
10152
|
-
|
|
10153
|
-
}
|
|
10154
|
-
}
|
|
10155
|
-
var groupInsList = prodData.mulInsOrderList.filter(function (ins) {
|
|
10312
|
+
|
|
10313
|
+
// 处理组合险中的逻辑,并加入到产品险种列表中
|
|
10314
|
+
var _loop = function _loop(k) {
|
|
10315
|
+
var nGroupTitleEle = newGroupInsMap[k].eleOrderList.find(function (e) {
|
|
10316
|
+
return e.key === 'title';
|
|
10317
|
+
});
|
|
10318
|
+
var nGroupInsuranceIdEle = newGroupInsMap[k].eleOrderList.find(function (e) {
|
|
10319
|
+
return e.key === 'insuranceId';
|
|
10320
|
+
});
|
|
10321
|
+
var groupInsList = mulInsOrderList.filter(function (ins) {
|
|
10156
10322
|
return ins.groupKey == k;
|
|
10157
10323
|
});
|
|
10158
|
-
if (
|
|
10159
|
-
// 如果组合险中有一款是必选的,则整个组合险为选中状态
|
|
10160
|
-
if (groupInsList.some(function (ins) {
|
|
10161
|
-
var subTitle = ins.eleOrderList.find(function (e) {
|
|
10162
|
-
return e.key === 'title';
|
|
10163
|
-
});
|
|
10164
|
-
return ins.required && subTitle && !subTitle.isDisabled;
|
|
10165
|
-
})) {
|
|
10166
|
-
nGroupTitle.value = true;
|
|
10167
|
-
nGroupTitle.isDisabled = true;
|
|
10168
|
-
}
|
|
10169
|
-
|
|
10170
|
-
// 初始化时,设置组合险默认值
|
|
10324
|
+
if (nGroupTitleEle && nGroupInsuranceIdEle && groupInsList.length) {
|
|
10171
10325
|
var notDisabledInsurances = groupInsList.filter(function (ins) {
|
|
10172
|
-
var
|
|
10326
|
+
var titleEle = (ins.eleOrderList || []).find(function (e) {
|
|
10173
10327
|
return e.key === 'title';
|
|
10174
10328
|
});
|
|
10175
|
-
return
|
|
10329
|
+
return titleEle && !titleEle.isDisabled;
|
|
10176
10330
|
});
|
|
10177
|
-
var checkedInsurances = notDisabledInsurances.
|
|
10178
|
-
var
|
|
10179
|
-
return
|
|
10331
|
+
var checkedInsurances = notDisabledInsurances.filter(function (ins) {
|
|
10332
|
+
var titleEle = (ins.eleOrderList || []).find(function (ele) {
|
|
10333
|
+
return ele.key === 'title';
|
|
10180
10334
|
});
|
|
10181
|
-
return
|
|
10335
|
+
return titleEle && titleEle.value;
|
|
10182
10336
|
});
|
|
10183
|
-
|
|
10184
|
-
|
|
10185
|
-
|
|
10186
|
-
|
|
10187
|
-
|
|
10188
|
-
|
|
10189
|
-
|
|
10190
|
-
|
|
10191
|
-
|
|
10192
|
-
|
|
10193
|
-
|
|
10194
|
-
}
|
|
10195
|
-
if (nGroupInsuranceId) {
|
|
10196
|
-
if (nGroupInsuranceId.value) {
|
|
10197
|
-
if (nGroupInsuranceId.value.constructor === Array) {
|
|
10198
|
-
if (nGroupInsuranceId.opts) {
|
|
10199
|
-
nGroupInsuranceId.opts = nGroupInsuranceId.opts.filter(function (opt) {
|
|
10200
|
-
return nGroupInsuranceId.value.indexOf(opt.val) !== -1 && !opt.isDisabled;
|
|
10201
|
-
});
|
|
10202
|
-
}
|
|
10203
|
-
} else {
|
|
10204
|
-
var opt = nGroupInsuranceId.opts.find(function (o) {
|
|
10205
|
-
return o.val === nGroupInsuranceId.value;
|
|
10206
|
-
});
|
|
10207
|
-
if (opt && opt.isDisabled) {
|
|
10208
|
-
nGroupInsuranceId.value = '';
|
|
10209
|
-
}
|
|
10210
|
-
}
|
|
10211
|
-
}
|
|
10212
|
-
if (nGroupInsuranceId.value) {
|
|
10213
|
-
var checkedIns = prodData.mulInsOrderList.find(function (ins) {
|
|
10214
|
-
return ins.key === nGroupInsuranceId.value;
|
|
10337
|
+
var hasRequiredIns = notDisabledInsurances.some(function (ins) {
|
|
10338
|
+
return ins.required;
|
|
10339
|
+
});
|
|
10340
|
+
var checkedInsurance = checkedInsurances[0];
|
|
10341
|
+
// hasRequiredIns:如果组合险中有一款是必选的,则整个组合险为选中状态
|
|
10342
|
+
// 所有险种都不可选,则组合险不可修改且不选中。否则,组合险种可选
|
|
10343
|
+
nGroupTitleEle.value = hasRequiredIns || (nGroupInsuranceIdEle.opts || []).some(function (opt) {
|
|
10344
|
+
return !opt.isDisabled;
|
|
10345
|
+
});
|
|
10346
|
+
nGroupTitleEle.isDisabled = hasRequiredIns || (nGroupInsuranceIdEle.opts || []).every(function (opt) {
|
|
10347
|
+
return !!opt.isDisabled;
|
|
10215
10348
|
});
|
|
10216
|
-
|
|
10217
|
-
|
|
10218
|
-
|
|
10219
|
-
|
|
10220
|
-
|
|
10349
|
+
nGroupInsuranceIdEle.value = checkedInsurance ? checkedInsurance.key : null;
|
|
10350
|
+
|
|
10351
|
+
//将当前选中险种的部分数据复制到组合险中
|
|
10352
|
+
if (checkedInsurance) {
|
|
10353
|
+
// 定义组件险中的元素:自身eleOrderList + 所选险种的eleOrderList(不包含标题)
|
|
10354
|
+
var keys = ['code', 'groupKey', 'groupName', 'isFollowing', 'key', 'name', 'accountData', 'reduceBaofData', 'duplicateReduceBaofData'];
|
|
10355
|
+
for (var ck in checkedInsurance) {
|
|
10356
|
+
if (!keys.includes(ck)) {
|
|
10221
10357
|
if (ck === 'eleOrderList') {
|
|
10222
|
-
newGroupInsMap[k][ck] = newGroupInsMap[k][ck].concat(
|
|
10358
|
+
newGroupInsMap[k][ck] = newGroupInsMap[k][ck].concat(checkedInsurance[ck].filter(function (ele) {
|
|
10223
10359
|
return ele.key !== 'title';
|
|
10224
10360
|
}));
|
|
10225
10361
|
} else {
|
|
10226
|
-
newGroupInsMap[k][ck] =
|
|
10362
|
+
newGroupInsMap[k][ck] = checkedInsurance[ck];
|
|
10227
10363
|
}
|
|
10228
10364
|
}
|
|
10229
10365
|
}
|
|
10230
10366
|
}
|
|
10231
10367
|
}
|
|
10232
|
-
|
|
10233
|
-
|
|
10234
|
-
|
|
10235
|
-
if (
|
|
10236
|
-
index
|
|
10368
|
+
var index = mulInsOrderList.findLastIndex(function (ins) {
|
|
10369
|
+
return ins.groupKey === k;
|
|
10370
|
+
});
|
|
10371
|
+
if (index >= 0) {
|
|
10372
|
+
prodData.mulInsOrderList.splice(index + 1, 0, newGroupInsMap[k]);
|
|
10237
10373
|
}
|
|
10238
|
-
}
|
|
10239
|
-
|
|
10240
|
-
|
|
10374
|
+
};
|
|
10375
|
+
for (var k in newGroupInsMap) {
|
|
10376
|
+
_loop(k);
|
|
10241
10377
|
}
|
|
10242
|
-
};
|
|
10243
|
-
for (var k in newGroupInsMap) {
|
|
10244
|
-
_loop(k);
|
|
10245
10378
|
}
|
|
10246
10379
|
return prodData;
|
|
10247
10380
|
}
|
|
@@ -10333,10 +10466,6 @@ function clearAddAndTakeAndAdjustBaoeData(productData) {
|
|
|
10333
10466
|
return productData;
|
|
10334
10467
|
}
|
|
10335
10468
|
|
|
10336
|
-
if (document && document.cookie && document.cookie.match('LIZHAO_DEBUG_CONSOLE_FLAG=1')) {
|
|
10337
|
-
window.DEBUG_TEMP_CONSOLE_FLAG = true;
|
|
10338
|
-
}
|
|
10339
|
-
|
|
10340
10469
|
function showLoading() {
|
|
10341
10470
|
if (IS_CPPOC_HOST) {
|
|
10342
10471
|
_Toast.loading({
|
|
@@ -11906,6 +12035,7 @@ var BxtPersonInfo = (_dec = Component({
|
|
|
11906
12035
|
params,
|
|
11907
12036
|
allPersonsData,
|
|
11908
12037
|
productGroupList,
|
|
12038
|
+
eventTarget,
|
|
11909
12039
|
promises,
|
|
11910
12040
|
_args = arguments;
|
|
11911
12041
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
@@ -11921,6 +12051,10 @@ var BxtPersonInfo = (_dec = Component({
|
|
|
11921
12051
|
case 1:
|
|
11922
12052
|
allPersonsData = inputData.personData;
|
|
11923
12053
|
productGroupList = inputData.productGroupList || [];
|
|
12054
|
+
eventTarget = {
|
|
12055
|
+
personKey: personData.key,
|
|
12056
|
+
elementKey: ele.key
|
|
12057
|
+
};
|
|
11924
12058
|
if (!allPersonsData) {
|
|
11925
12059
|
_context.next = 2;
|
|
11926
12060
|
break;
|
|
@@ -11938,7 +12072,8 @@ var BxtPersonInfo = (_dec = Component({
|
|
|
11938
12072
|
g.prodOrderList.map(function (p) {
|
|
11939
12073
|
clearAddAndTakeAndAdjustBaoeData(p);
|
|
11940
12074
|
promises.push(productDataHandler(p, get(verifyData, "[".concat(p.key, "]")), allPersonsData, {
|
|
11941
|
-
planbookId: get(params, 'planbookId')
|
|
12075
|
+
planbookId: get(params, 'planbookId'),
|
|
12076
|
+
eventTarget: eventTarget
|
|
11942
12077
|
}));
|
|
11943
12078
|
});
|
|
11944
12079
|
});
|