bxs-tools-ui 3.2.0 → 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 +936 -824
- 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 +313 -21
- 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 +939 -826
- 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 +313 -25
- 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 +4 -4
- package/packages/share-sheet/demo/index.vue +10 -10
- package/packages/share-sheet/handler.js +14 -14
- package/packages/share-sheet/index.less +201 -0
- package/packages/share-sheet/index.vue +39 -39
- 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 -203
- 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
package/lib/person-info/index.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
(function (global, factory) {
|
|
2
|
-
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('lodash'), require('qs'), require('
|
|
3
|
-
typeof define === 'function' && define.amd ? define(['exports', 'vue', 'lodash', 'qs', '
|
|
4
|
-
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BXT = {}, global.Vue, global._, global.QS, global.
|
|
5
|
-
})(this, (function (exports, Vue, lodash, QS,
|
|
2
|
+
typeof exports === 'object' && typeof module !== 'undefined' ? factory(exports, require('vue'), require('lodash'), require('qs'), require('vant/lib/dialog/index.css'), require('vant/lib/dialog'), require('vant/lib/toast/index.css'), require('vant/lib/toast'), require('md5'), require('crypto-js')) :
|
|
3
|
+
typeof define === 'function' && define.amd ? define(['exports', 'vue', 'lodash', 'qs', 'vant/lib/dialog/index.css', 'vant/lib/dialog', 'vant/lib/toast/index.css', 'vant/lib/toast', 'md5', 'crypto-js'], factory) :
|
|
4
|
+
(global = typeof globalThis !== 'undefined' ? globalThis : global || self, factory(global.BXT = {}, global.Vue, global._, global.QS, null, global._Dialog, null, global._Toast));
|
|
5
|
+
})(this, (function (exports, Vue, lodash, QS, index_css, _Dialog, index_css$1, _Toast) { 'use strict';
|
|
6
6
|
|
|
7
7
|
function asyncGeneratorStep(n, t, e, r, o, a, c) {
|
|
8
8
|
try {
|
|
@@ -600,11 +600,11 @@
|
|
|
600
600
|
return obj;
|
|
601
601
|
}
|
|
602
602
|
|
|
603
|
-
function _toConsumableArray
|
|
604
|
-
return _arrayWithoutHoles
|
|
603
|
+
function _toConsumableArray(arr) {
|
|
604
|
+
return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _nonIterableSpread();
|
|
605
605
|
}
|
|
606
606
|
|
|
607
|
-
function _arrayWithoutHoles
|
|
607
|
+
function _arrayWithoutHoles(arr) {
|
|
608
608
|
if (Array.isArray(arr)) {
|
|
609
609
|
for (var i = 0, arr2 = new Array(arr.length); i < arr.length; i++) arr2[i] = arr[i];
|
|
610
610
|
|
|
@@ -612,11 +612,11 @@
|
|
|
612
612
|
}
|
|
613
613
|
}
|
|
614
614
|
|
|
615
|
-
function _iterableToArray
|
|
615
|
+
function _iterableToArray(iter) {
|
|
616
616
|
if (Symbol.iterator in Object(iter) || Object.prototype.toString.call(iter) === "[object Arguments]") return Array.from(iter);
|
|
617
617
|
}
|
|
618
618
|
|
|
619
|
-
function _nonIterableSpread
|
|
619
|
+
function _nonIterableSpread() {
|
|
620
620
|
throw new TypeError("Invalid attempt to spread non-iterable instance");
|
|
621
621
|
}
|
|
622
622
|
|
|
@@ -870,7 +870,7 @@
|
|
|
870
870
|
}
|
|
871
871
|
|
|
872
872
|
Component.registerHooks = function registerHooks(keys) {
|
|
873
|
-
$internalHooks.push.apply($internalHooks, _toConsumableArray
|
|
873
|
+
$internalHooks.push.apply($internalHooks, _toConsumableArray(keys));
|
|
874
874
|
};
|
|
875
875
|
|
|
876
876
|
/** vue-property-decorator verson 8.5.1 MIT LICENSE copyright 2020 kaorun343 */
|
|
@@ -943,13 +943,7 @@
|
|
|
943
943
|
});
|
|
944
944
|
}
|
|
945
945
|
|
|
946
|
-
|
|
947
|
-
function consoleLogWhenEnable() {
|
|
948
|
-
if (enableLizhaoDebug) {
|
|
949
|
-
var _console;
|
|
950
|
-
(_console = console).log.apply(_console, arguments);
|
|
951
|
-
}
|
|
952
|
-
}
|
|
946
|
+
document && document.cookie && document.cookie.match('ENABLE_LIZHAO_DEBUG=1');
|
|
953
947
|
|
|
954
948
|
/**
|
|
955
949
|
* **将对象下的 eleOrderList 数组中的子元素下的 value,转换为 key-value 键值对**
|
|
@@ -998,102 +992,6 @@
|
|
|
998
992
|
return resData;
|
|
999
993
|
}
|
|
1000
994
|
|
|
1001
|
-
/**
|
|
1002
|
-
* **转换交费期间的值。实际是表示豁免险与所关联的险种的交费期间值的关系**
|
|
1003
|
-
* @author Lizhao <lz@winbaoxian.com>
|
|
1004
|
-
* @date 2022-04-25
|
|
1005
|
-
* @param {string} val - 必传。交费期间的值
|
|
1006
|
-
* @param {number} pMinus 0 可不传。指定要减去的值
|
|
1007
|
-
* @param {number} age 0 可不传。所附加的人员的年龄
|
|
1008
|
-
* @returns {string} 交费期间
|
|
1009
|
-
* @example
|
|
1010
|
-
* getHuomianPeriodValue('a999')
|
|
1011
|
-
* // returns a999
|
|
1012
|
-
*
|
|
1013
|
-
* getHuomianPeriodValue('b10', 1)
|
|
1014
|
-
* // returns b9
|
|
1015
|
-
*
|
|
1016
|
-
* getHuomianPeriodValue('a60', 1, 30)
|
|
1017
|
-
* // returns b29
|
|
1018
|
-
*/
|
|
1019
|
-
function getHuomianPeriodValue() {
|
|
1020
|
-
var val = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : '';
|
|
1021
|
-
var pMinus = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 0;
|
|
1022
|
-
var age = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;
|
|
1023
|
-
// a999: 终身; a1000: 趸交
|
|
1024
|
-
if (val == 'a999' || val == 'a1000') {
|
|
1025
|
-
return val;
|
|
1026
|
-
}
|
|
1027
|
-
// b开头:XXX 年。关联险种的交费期间 - 指定的值
|
|
1028
|
-
if (val.search(/^b/) !== -1) {
|
|
1029
|
-
return 'b' + (Number(val.replace(/[^0-9]/, '')) - pMinus);
|
|
1030
|
-
}
|
|
1031
|
-
// a开头:至XXX岁。关联险种的交费期间 - 人员的年龄 - 指定的值
|
|
1032
|
-
if (val.search(/^a/) !== -1) {
|
|
1033
|
-
return 'b' + (Number(val.replace(/[^0-9]/, '')) - age - pMinus);
|
|
1034
|
-
}
|
|
1035
|
-
return '';
|
|
1036
|
-
}
|
|
1037
|
-
|
|
1038
|
-
/**
|
|
1039
|
-
* **将大于10000且是10000的倍数的值,转换成单位为万的字符串**
|
|
1040
|
-
* @author Lizhao <lz@winbaoxian.com>
|
|
1041
|
-
* @date 2022-04-25
|
|
1042
|
-
* @param {number} value 必传
|
|
1043
|
-
* @returns {number|string} 满足条件时返回单位为万的字符串,否则返回原数值
|
|
1044
|
-
* @example
|
|
1045
|
-
* converUnit10000(1000)
|
|
1046
|
-
* // returns 1000
|
|
1047
|
-
*
|
|
1048
|
-
* converUnit10000(2000000)
|
|
1049
|
-
* // returns 200万
|
|
1050
|
-
*
|
|
1051
|
-
* converUnit10000(2000001)
|
|
1052
|
-
* // returns 2000001
|
|
1053
|
-
*/
|
|
1054
|
-
function converUnit10000(value) {
|
|
1055
|
-
return value >= 10000 && !(value % 10000) ? "".concat(value / 10000, "\u4E07") : value;
|
|
1056
|
-
}
|
|
1057
|
-
|
|
1058
|
-
/**
|
|
1059
|
-
* **对象的深拷贝**
|
|
1060
|
-
* @ignore
|
|
1061
|
-
* @author Lizhao <lz@winbaoxian.com>
|
|
1062
|
-
* @date 2022-04-25
|
|
1063
|
-
* @param {object} obj - 必传
|
|
1064
|
-
* @param {WeakMap} hash - 可不传
|
|
1065
|
-
* @returns {object} 拷贝对象
|
|
1066
|
-
*/
|
|
1067
|
-
function deepCopy(obj) {
|
|
1068
|
-
var hash = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : new WeakMap();
|
|
1069
|
-
if (!obj || _typeof$2(obj) !== 'object') {
|
|
1070
|
-
return obj;
|
|
1071
|
-
}
|
|
1072
|
-
if (hash.has(obj)) {
|
|
1073
|
-
return hash.get(obj);
|
|
1074
|
-
}
|
|
1075
|
-
var newObj;
|
|
1076
|
-
var Constructor = obj.constructor;
|
|
1077
|
-
switch (Constructor) {
|
|
1078
|
-
case RegExp:
|
|
1079
|
-
newObj = new Constructor(obj);
|
|
1080
|
-
break;
|
|
1081
|
-
case Date:
|
|
1082
|
-
newObj = new Constructor(obj.getTime());
|
|
1083
|
-
break;
|
|
1084
|
-
default:
|
|
1085
|
-
newObj = new Constructor();
|
|
1086
|
-
break;
|
|
1087
|
-
}
|
|
1088
|
-
hash.set(obj, newObj);
|
|
1089
|
-
for (var key in obj) {
|
|
1090
|
-
if (obj.hasOwnProperty(key)) {
|
|
1091
|
-
newObj[key] = _typeof$2(obj[key]) === 'object' ? deepCopy(obj[key], hash) : obj[key];
|
|
1092
|
-
}
|
|
1093
|
-
}
|
|
1094
|
-
return newObj;
|
|
1095
|
-
}
|
|
1096
|
-
|
|
1097
995
|
/**
|
|
1098
996
|
* **根据生日算年龄**
|
|
1099
997
|
* @author Lizhao <lz@winbaoxian.com>
|
|
@@ -1120,176 +1018,6 @@
|
|
|
1120
1018
|
}
|
|
1121
1019
|
return age;
|
|
1122
1020
|
}
|
|
1123
|
-
function getExpressionParamMap(personData, product, ins, options) {
|
|
1124
|
-
var map = {
|
|
1125
|
-
planbookId: null,
|
|
1126
|
-
// 计划书id
|
|
1127
|
-
productId: null,
|
|
1128
|
-
// 产品id
|
|
1129
|
-
insured: {},
|
|
1130
|
-
// 被保人
|
|
1131
|
-
insured2: {},
|
|
1132
|
-
// 第二被保人
|
|
1133
|
-
applicant: {},
|
|
1134
|
-
// 投保人
|
|
1135
|
-
recipient: {},
|
|
1136
|
-
// 收件人
|
|
1137
|
-
p: {},
|
|
1138
|
-
// 当前产品
|
|
1139
|
-
m: {},
|
|
1140
|
-
// 主险
|
|
1141
|
-
me: {},
|
|
1142
|
-
// 当前险种
|
|
1143
|
-
common: {},
|
|
1144
|
-
// 通用信息
|
|
1145
|
-
customVariable: null,
|
|
1146
|
-
// 自定义变量
|
|
1147
|
-
cv: null,
|
|
1148
|
-
// 简写,自定义变量
|
|
1149
|
-
t: {} // 事件目标
|
|
1150
|
-
};
|
|
1151
|
-
if (personData) {
|
|
1152
|
-
var insuredInfo = (personData.personOrderList || []).find(function (p) {
|
|
1153
|
-
return p.key === 'insuredInfo';
|
|
1154
|
-
});
|
|
1155
|
-
var insured2Info = (personData.personOrderList || []).find(function (p) {
|
|
1156
|
-
return p.key === 'insured2Info';
|
|
1157
|
-
});
|
|
1158
|
-
var applicantInfo = (personData.personOrderList || []).find(function (p) {
|
|
1159
|
-
return p.key === 'applicantInfo';
|
|
1160
|
-
});
|
|
1161
|
-
var recipientInfo = personData !== null && personData !== void 0 && personData.recipientInfo ? personData.recipientInfo : null;
|
|
1162
|
-
map.insured = insuredInfo ? convertEleOrderListToObj(insuredInfo) : {};
|
|
1163
|
-
map.insured2 = insured2Info ? convertEleOrderListToObj(insured2Info) : {};
|
|
1164
|
-
map.applicant = applicantInfo ? convertEleOrderListToObj(applicantInfo) : {};
|
|
1165
|
-
map.recipient = recipientInfo ? convertEleOrderListToObj(recipientInfo) : {};
|
|
1166
|
-
}
|
|
1167
|
-
if (ins) {
|
|
1168
|
-
map.me = ins ? convertEleOrderListToObj(ins) : {};
|
|
1169
|
-
map["i".concat(ins.key)] = ins;
|
|
1170
|
-
}
|
|
1171
|
-
if (product) {
|
|
1172
|
-
map.productId = product.key;
|
|
1173
|
-
Object.keys(product).filter(function (k) {
|
|
1174
|
-
return !['mulInsOrderList'].includes(k);
|
|
1175
|
-
}).forEach(function (k) {
|
|
1176
|
-
map.p[k] = product[k];
|
|
1177
|
-
});
|
|
1178
|
-
if (Array.isArray(product.mulInsOrderList)) {
|
|
1179
|
-
var common = product.mulInsOrderList.find(function (item) {
|
|
1180
|
-
return item.key === 'common';
|
|
1181
|
-
});
|
|
1182
|
-
var insuranceList = product.mulInsOrderList.filter(function (item) {
|
|
1183
|
-
return !['common'].includes(item.key);
|
|
1184
|
-
}).map(function (item) {
|
|
1185
|
-
return convertEleOrderListToObj(item);
|
|
1186
|
-
});
|
|
1187
|
-
map.m = insuranceList[0] ? insuranceList[0] : {};
|
|
1188
|
-
map.me = ins && ins.key ? insuranceList.find(function (e) {
|
|
1189
|
-
return e.key === ins.key;
|
|
1190
|
-
}) || {} : {};
|
|
1191
|
-
map.common = common ? convertEleOrderListToObj(common) : {};
|
|
1192
|
-
insuranceList.forEach(function (item) {
|
|
1193
|
-
map["i".concat(item.key)] = item;
|
|
1194
|
-
});
|
|
1195
|
-
}
|
|
1196
|
-
}
|
|
1197
|
-
if (options) {
|
|
1198
|
-
if (options.planbookId) {
|
|
1199
|
-
map.planbookId = options.planbookId;
|
|
1200
|
-
}
|
|
1201
|
-
if (options.eventTarget) {
|
|
1202
|
-
map.t = options.eventTarget;
|
|
1203
|
-
}
|
|
1204
|
-
}
|
|
1205
|
-
if (ins && ins.customVariableExp) {
|
|
1206
|
-
var exp = ins.customVariableExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'map.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'map.$2');
|
|
1207
|
-
map.customVariable = eval(exp);
|
|
1208
|
-
map.cv = map.customVariable;
|
|
1209
|
-
}
|
|
1210
|
-
return map;
|
|
1211
|
-
}
|
|
1212
|
-
function executeElementRule(personData, product, ins, ele) {
|
|
1213
|
-
var options = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {};
|
|
1214
|
-
var paramMap = getExpressionParamMap(personData, product, ins, options);
|
|
1215
|
-
var newEleMap = {};
|
|
1216
|
-
if (paramMap) {
|
|
1217
|
-
if (['cmCommonTitle'].includes(ele.componentName)) {
|
|
1218
|
-
if (ele.underwriteExp) {
|
|
1219
|
-
var exp = ele.underwriteExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
1220
|
-
var evalValue = eval(exp);
|
|
1221
|
-
if (Array.isArray(evalValue)) {
|
|
1222
|
-
if ([0, 1].includes(evalValue[0])) {
|
|
1223
|
-
newEleMap.value = evalValue[0] === 1;
|
|
1224
|
-
}
|
|
1225
|
-
if ([0, 1].includes(evalValue[1])) {
|
|
1226
|
-
newEleMap.isDisabled = evalValue[1] === 0;
|
|
1227
|
-
}
|
|
1228
|
-
}
|
|
1229
|
-
consoleLogWhenEnable("".concat(ele.key, ": underwriteExp"), exp, evalValue);
|
|
1230
|
-
}
|
|
1231
|
-
}
|
|
1232
|
-
if (['cmCommonSelect', 'cmCommonRadioBtn', 'cmCommonRadio', 'cmCommonCheckbox'].includes(ele.componentName)) {
|
|
1233
|
-
if (ele.defaultValueExp) {
|
|
1234
|
-
var _exp = ele.defaultValueExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
1235
|
-
var expValue = eval(_exp);
|
|
1236
|
-
if (!['', null, undefined].includes(expValue)) {
|
|
1237
|
-
newEleMap.value = expValue;
|
|
1238
|
-
}
|
|
1239
|
-
consoleLogWhenEnable("".concat(ele.key, ": defaultValueExp"), _exp, newEleMap.value);
|
|
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
|
-
var _exp3 = ele.defaultValueExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
1268
|
-
var _expValue = eval(_exp3);
|
|
1269
|
-
if (!['', null, undefined].includes(_expValue)) {
|
|
1270
|
-
newEleMap.value = _expValue;
|
|
1271
|
-
}
|
|
1272
|
-
consoleLogWhenEnable("".concat(ele.key, ": defaultValueExp"), _exp3, newEleMap.value);
|
|
1273
|
-
}
|
|
1274
|
-
if (ele.minExp) {
|
|
1275
|
-
var _exp4 = ele.minExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
1276
|
-
newEleMap.min = eval(_exp4);
|
|
1277
|
-
consoleLogWhenEnable("".concat(ele.key, ": minExp"), _exp4, newEleMap.min);
|
|
1278
|
-
}
|
|
1279
|
-
if (ele.maxExp) {
|
|
1280
|
-
var _exp5 = ele.maxExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
1281
|
-
newEleMap.max = eval(_exp5);
|
|
1282
|
-
consoleLogWhenEnable("".concat(ele.key, ": maxExp"), _exp5, newEleMap.max);
|
|
1283
|
-
}
|
|
1284
|
-
if (ele.multiExp) {
|
|
1285
|
-
var _exp6 = ele.multiExp.replace(/(%)(\d+)(\.*\w*)(%)/g, 'paramMap.i$2$3').replace(/(%)(\w*\.*\w*)(%)/g, 'paramMap.$2');
|
|
1286
|
-
newEleMap.multi = eval(_exp6);
|
|
1287
|
-
consoleLogWhenEnable("".concat(ele.key, ": multiExp"), _exp6, newEleMap.multi);
|
|
1288
|
-
}
|
|
1289
|
-
}
|
|
1290
|
-
}
|
|
1291
|
-
return newEleMap;
|
|
1292
|
-
}
|
|
1293
1021
|
|
|
1294
1022
|
/**
|
|
1295
1023
|
* **处理人员数据**
|
|
@@ -9452,12 +9180,27 @@
|
|
|
9452
9180
|
var Jax = /*@__PURE__*/getDefaultExportFromCjs(jaxExports);
|
|
9453
9181
|
|
|
9454
9182
|
var getStandardOrigin = Jax.urlUtil.getStandardOrigin;
|
|
9183
|
+
var _Jax$parseUaString = Jax.parseUaString();
|
|
9184
|
+
_Jax$parseUaString.isApp;
|
|
9185
|
+
_Jax$parseUaString.appType;
|
|
9186
|
+
_Jax$parseUaString.appVersion;
|
|
9187
|
+
_Jax$parseUaString.isAndroid;
|
|
9188
|
+
_Jax$parseUaString.isIos;
|
|
9189
|
+
_Jax$parseUaString.isBxsApp;
|
|
9190
|
+
_Jax$parseUaString.isBaoXiaoZhuApp;
|
|
9191
|
+
_Jax$parseUaString.isBrokerApp;
|
|
9192
|
+
_Jax$parseUaString.isYjjApp;
|
|
9193
|
+
_Jax$parseUaString.isToBApp;
|
|
9194
|
+
_Jax$parseUaString.isRongYiBaoApp;
|
|
9195
|
+
_Jax$parseUaString.isWeChat;
|
|
9196
|
+
_Jax$parseUaString.appScheme;
|
|
9455
9197
|
var hostname = window && window.location && window.location.hostname || '';
|
|
9456
9198
|
/** 当前页 host 为 cppoc- 前缀时,请求 loading 使用 Vant Toast,否则走 appBridge */
|
|
9457
9199
|
var IS_CPPOC_HOST = hostname.startsWith('cppoc-');
|
|
9458
9200
|
var IS_PRODUCT_ENV = hostname.search(/(winbaoxian|ai-baoxiaozhu)\.com/) !== -1;
|
|
9459
9201
|
hostname.search(/(winbaoxian|ai-baoxiaozhu)\.cn/) !== -1;
|
|
9460
9202
|
var IS_LOCALHOST_ENV = hostname.search(/localhost|192\.168|127\.0\.0\.1|dev\.winbaoxian\.cn/) !== -1;
|
|
9203
|
+
var IS_LOCALHOST_IP_ENV = hostname.search(/192\.168/) !== -1;
|
|
9461
9204
|
var IS_UAT_ENV = hostname.includes("pbf-uat.");
|
|
9462
9205
|
var IS_ENABLE_DEBUG = !IS_PRODUCT_ENV;
|
|
9463
9206
|
if (IS_ENABLE_DEBUG) {
|
|
@@ -9465,6 +9208,9 @@
|
|
|
9465
9208
|
}
|
|
9466
9209
|
hostname.includes('ai-baoxiaozhu') ? 'ai-baoxiaozhu' : 'winbaoxian';
|
|
9467
9210
|
function getFullOrigin(data) {
|
|
9211
|
+
if (IS_LOCALHOST_IP_ENV) {
|
|
9212
|
+
return "https://".concat(data, ".winbaoxian.cn");
|
|
9213
|
+
}
|
|
9468
9214
|
var _prefixDomain = IS_CPPOC_HOST ? 'cppoc-' : '';
|
|
9469
9215
|
if (typeof data === 'string') {
|
|
9470
9216
|
return getStandardOrigin("".concat(_prefixDomain).concat(data));
|
|
@@ -9479,7 +9225,7 @@
|
|
|
9479
9225
|
}
|
|
9480
9226
|
var APP_HOSTNAME = getFullOrigin('app');
|
|
9481
9227
|
getFullOrigin('pbf');
|
|
9482
|
-
getFullOrigin("bxs-planbook-api".concat(IS_UAT_ENV ? '-uat' : ''));
|
|
9228
|
+
var PLANBOOK_API_HOSTNAME = getFullOrigin("bxs-planbook-api".concat(IS_UAT_ENV ? '-uat' : ''));
|
|
9483
9229
|
getUrlParams();
|
|
9484
9230
|
function getUrlParams(url) {
|
|
9485
9231
|
var _url = location.search || '';
|
|
@@ -9487,662 +9233,264 @@
|
|
|
9487
9233
|
return _searchStr ? QS.parse(_searchStr) : {};
|
|
9488
9234
|
}
|
|
9489
9235
|
|
|
9490
|
-
function
|
|
9491
|
-
(
|
|
9492
|
-
|
|
9493
|
-
|
|
9494
|
-
|
|
9495
|
-
|
|
9496
|
-
|
|
9497
|
-
|
|
9498
|
-
}
|
|
9499
|
-
|
|
9500
|
-
function _iterableToArray(r) {
|
|
9501
|
-
if ("undefined" != typeof Symbol && null != r[Symbol.iterator] || null != r["@@iterator"]) return Array.from(r);
|
|
9502
|
-
}
|
|
9503
|
-
|
|
9504
|
-
function _unsupportedIterableToArray(r, a) {
|
|
9505
|
-
if (r) {
|
|
9506
|
-
if ("string" == typeof r) return _arrayLikeToArray(r, a);
|
|
9507
|
-
var t = {}.toString.call(r).slice(8, -1);
|
|
9508
|
-
return "Object" === t && r.constructor && (t = r.constructor.name), "Map" === t || "Set" === t ? Array.from(r) : "Arguments" === t || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t) ? _arrayLikeToArray(r, a) : void 0;
|
|
9236
|
+
function showLoading() {
|
|
9237
|
+
if (IS_CPPOC_HOST) {
|
|
9238
|
+
_Toast.loading({
|
|
9239
|
+
message: '加载中...',
|
|
9240
|
+
forbidClick: true
|
|
9241
|
+
});
|
|
9242
|
+
} else if (window.appBridge && window.appBridge.showLoading) {
|
|
9243
|
+
window.appBridge.showLoading();
|
|
9509
9244
|
}
|
|
9510
9245
|
}
|
|
9511
|
-
|
|
9512
|
-
|
|
9513
|
-
|
|
9514
|
-
|
|
9515
|
-
|
|
9516
|
-
function _toConsumableArray(r) {
|
|
9517
|
-
return _arrayWithoutHoles(r) || _iterableToArray(r) || _unsupportedIterableToArray(r) || _nonIterableSpread();
|
|
9518
|
-
}
|
|
9519
|
-
|
|
9520
|
-
/**
|
|
9521
|
-
* **处理险种数据**
|
|
9522
|
-
* - 初始化元素的校验规则
|
|
9523
|
-
* - 处理保额保费互算、保额和计划的逻辑关系
|
|
9524
|
-
* @author Lizhao <lz@winbaoxian.com>
|
|
9525
|
-
* @date 2022-04-26
|
|
9526
|
-
* @param {IProdInsurance} insData 必传。险种数据(单个)
|
|
9527
|
-
* @param {IPbProduct} productData 必传。产品数据(单个)
|
|
9528
|
-
* @returns {IProdInsurance} 险种数据(单个)
|
|
9529
|
-
*/
|
|
9530
|
-
function insuranceDataHandler(insData, productData) {
|
|
9531
|
-
if (!insData || !insData.eleOrderList) {
|
|
9532
|
-
return insData;
|
|
9533
|
-
}
|
|
9534
|
-
if (insData.reduceBaof) {
|
|
9535
|
-
insData.reduceBaofData = insData.reduceBaofData || null;
|
|
9536
|
-
insData.duplicateReduceBaofData = insData.duplicateReduceBaofData || null;
|
|
9537
|
-
}
|
|
9538
|
-
insData.eleOrderList.forEach(function (ele) {
|
|
9539
|
-
ele.isDisabled = ele.isDisabled || null;
|
|
9540
|
-
ele.isHide = ele.isHide || null;
|
|
9541
|
-
ele.isIgnoreValidate = ele.isIgnoreValidate || null;
|
|
9542
|
-
ele.rules = _toConsumableArray(initElementValidateRules(ele, productData));
|
|
9543
|
-
});
|
|
9544
|
-
var calMethod = insData.eleOrderList.find(function (e) {
|
|
9545
|
-
return e.key === 'calMethod';
|
|
9546
|
-
});
|
|
9547
|
-
var baoe = insData.eleOrderList.find(function (e) {
|
|
9548
|
-
return e.key === 'baoe';
|
|
9549
|
-
});
|
|
9550
|
-
var baof = insData.eleOrderList.find(function (e) {
|
|
9551
|
-
return e.key === 'baof';
|
|
9552
|
-
}) || insData.eleOrderList.find(function (e) {
|
|
9553
|
-
return e.key === 'payModePremium';
|
|
9554
|
-
});
|
|
9555
|
-
var plan = insData.eleOrderList.find(function (e) {
|
|
9556
|
-
return e.key === 'plan';
|
|
9557
|
-
});
|
|
9558
|
-
// 同时有保额和计划时,若保额被隐藏则显示计划 2019.09.11)
|
|
9559
|
-
if (!calMethod && baoe && plan) {
|
|
9560
|
-
insData.showPlanDesc = !!baoe.isHide;
|
|
9561
|
-
}
|
|
9562
|
-
// 切换保额保费互算问题 By Lizhao@2020.11.25
|
|
9563
|
-
if (calMethod && baoe && baof) {
|
|
9564
|
-
baoe.isHide = calMethod.value !== 'baoe2baof';
|
|
9565
|
-
baof.isHide = calMethod.value === 'baoe2baof';
|
|
9246
|
+
function hideLoading() {
|
|
9247
|
+
if (IS_CPPOC_HOST) {
|
|
9248
|
+
_Toast.clear();
|
|
9249
|
+
} else if (window.appBridge && window.appBridge.hideLoading) {
|
|
9250
|
+
window.appBridge.hideLoading();
|
|
9566
9251
|
}
|
|
9567
|
-
return insData;
|
|
9568
9252
|
}
|
|
9569
9253
|
|
|
9570
|
-
|
|
9571
|
-
|
|
9572
|
-
|
|
9573
|
-
|
|
9574
|
-
|
|
9575
|
-
|
|
9576
|
-
|
|
9577
|
-
|
|
9578
|
-
* @date 2022-04-26
|
|
9579
|
-
* @param {IInsElement} ele 必传。元素数据(单个)
|
|
9580
|
-
* @param {IPbProduct} productData 可不传。产品数据(单个)
|
|
9581
|
-
* @returns {object} 元素的校验规则
|
|
9582
|
-
*/
|
|
9583
|
-
function initElementValidateRules(ele, productData) {
|
|
9584
|
-
var mulInsOrderList = productData && productData.mulInsOrderList ? productData.mulInsOrderList : [];
|
|
9585
|
-
var insurance0 = mulInsOrderList && mulInsOrderList.length ? mulInsOrderList.find(function (ins) {
|
|
9586
|
-
return ins.key !== 'common';
|
|
9587
|
-
}) : null;
|
|
9588
|
-
var insurance0Name = insurance0 && insurance0.name ? insurance0.name : '';
|
|
9589
|
-
var isPensionInsurance = insurance0Name.match(/个养|个人养老/);
|
|
9590
|
-
var rules = [];
|
|
9591
|
-
// 必填及正则校验
|
|
9592
|
-
if (['cmCommonInput'].indexOf(String(ele.componentName)) !== -1) {
|
|
9593
|
-
rules = [{
|
|
9594
|
-
required: ele.required !== false,
|
|
9595
|
-
message: "\u8BF7\u8F93\u5165".concat(ele.labelName || '', "\u503C")
|
|
9596
|
-
}, {
|
|
9597
|
-
pattern: ele.regExp ? eval(String(ele.regExp)) : ele.key === 'num' ? /^\d*(\.\d{0,2})?$/ : /^\d*$/,
|
|
9598
|
-
message: ele.regExpMessage || (ele.regExp ? '输入不合法,请重新输入' : ele.key === 'num' ? '请输入2位小数的数值' : '请输入整数值')
|
|
9599
|
-
}];
|
|
9254
|
+
function ownKeys(e, r) { var t = Object.keys(e); if (Object.getOwnPropertySymbols) { var o = Object.getOwnPropertySymbols(e); r && (o = o.filter(function (r) { return Object.getOwnPropertyDescriptor(e, r).enumerable; })), t.push.apply(t, o); } return t; }
|
|
9255
|
+
function _objectSpread(e) { for (var r = 1; r < arguments.length; r++) { var t = null != arguments[r] ? arguments[r] : {}; r % 2 ? ownKeys(Object(t), true).forEach(function (r) { _defineProperty$1(e, r, t[r]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) { Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r)); }); } return e; }
|
|
9256
|
+
var options = {
|
|
9257
|
+
baseURL: PLANBOOK_API_HOSTNAME,
|
|
9258
|
+
withCredentials: true,
|
|
9259
|
+
timeout: 10000,
|
|
9260
|
+
headers: {
|
|
9261
|
+
'X-Requested-With': 'XMLHttpRequest'
|
|
9600
9262
|
}
|
|
9601
|
-
|
|
9602
|
-
|
|
9603
|
-
|
|
9604
|
-
|
|
9605
|
-
|
|
9606
|
-
min = ele.min;
|
|
9263
|
+
};
|
|
9264
|
+
var loadingTimer = null;
|
|
9265
|
+
var showRequestLoading = function showRequestLoading() {
|
|
9266
|
+
if (loadingTimer) {
|
|
9267
|
+
clearTimeout(loadingTimer);
|
|
9607
9268
|
}
|
|
9608
|
-
|
|
9609
|
-
|
|
9269
|
+
loadingTimer = setTimeout(function () {
|
|
9270
|
+
showLoading();
|
|
9271
|
+
}, 300);
|
|
9272
|
+
};
|
|
9273
|
+
var hideRequestLoading = function hideRequestLoading() {
|
|
9274
|
+
if (loadingTimer) {
|
|
9275
|
+
hideLoading();
|
|
9610
9276
|
}
|
|
9611
|
-
if (
|
|
9612
|
-
|
|
9613
|
-
if (min && max) {
|
|
9614
|
-
message = "\u8BF7\u8F93\u5165".concat(converUnit10000(min), "~").concat(converUnit10000(max), "\u4E4B\u95F4\u7684\u6570\u503C");
|
|
9615
|
-
} else if (!min) {
|
|
9616
|
-
message = "\u8BF7\u8F93\u5165\u4E0D\u5927\u4E8E".concat(converUnit10000(max), "\u7684\u6570\u503C");
|
|
9617
|
-
// 个人养老险,保费的最大金额限制,提示文案改成:“个人养老金,最高保费${max}元”。From hyw
|
|
9618
|
-
if (isPensionInsurance && ele.key === 'baof') {
|
|
9619
|
-
message = "\u4E2A\u4EBA\u517B\u8001\u91D1\uFF0C\u6700\u9AD8\u4FDD\u8D39".concat(converUnit10000(max), "\u5143");
|
|
9620
|
-
}
|
|
9621
|
-
} else if (!max) {
|
|
9622
|
-
message = "\u8BF7\u8F93\u5165\u4E0D\u5C0F\u4E8E".concat(converUnit10000(min), "\u7684\u6570\u503C");
|
|
9623
|
-
}
|
|
9624
|
-
rules.push({
|
|
9625
|
-
type: 'number',
|
|
9626
|
-
min: min || -Infinity,
|
|
9627
|
-
max: max || Infinity,
|
|
9628
|
-
message: message,
|
|
9629
|
-
validator: function validator(value, rule) {
|
|
9630
|
-
return (value || value === 0) && value >= rule.min && value <= rule.max;
|
|
9631
|
-
}
|
|
9632
|
-
});
|
|
9277
|
+
if (loadingTimer) {
|
|
9278
|
+
clearTimeout(loadingTimer);
|
|
9633
9279
|
}
|
|
9634
|
-
|
|
9635
|
-
|
|
9636
|
-
|
|
9637
|
-
|
|
9638
|
-
|
|
9639
|
-
|
|
9640
|
-
|
|
9641
|
-
return (value || value === 0) && !(value % rule.multiple);
|
|
9642
|
-
}
|
|
9643
|
-
});
|
|
9280
|
+
};
|
|
9281
|
+
var normalizeMethod = function normalizeMethod(method) {
|
|
9282
|
+
return (method || 'get').toUpperCase();
|
|
9283
|
+
};
|
|
9284
|
+
var serializeParams = function serializeParams(params) {
|
|
9285
|
+
if (!params) {
|
|
9286
|
+
return '';
|
|
9644
9287
|
}
|
|
9645
|
-
|
|
9646
|
-
|
|
9647
|
-
|
|
9648
|
-
|
|
9649
|
-
|
|
9650
|
-
var insurance1, insurance2, insTitle1, insTitle2, itemValue1, itemValue2;
|
|
9651
|
-
if (item1 && item2) {
|
|
9652
|
-
// 查找对应的险种
|
|
9653
|
-
insurance1 = mulInsOrderList.find(function (ins) {
|
|
9654
|
-
return ins.key + '' === item1[1];
|
|
9655
|
-
});
|
|
9656
|
-
insurance2 = mulInsOrderList.find(function (ins) {
|
|
9657
|
-
return ins.key + '' === item2[1];
|
|
9658
|
-
});
|
|
9659
|
-
}
|
|
9660
|
-
if (insurance1 && insurance1.eleOrderList) {
|
|
9661
|
-
// 险种选中时,获取险种对应元素的值
|
|
9662
|
-
insTitle1 = insurance1.eleOrderList.find(function (e) {
|
|
9663
|
-
return e.key === 'title';
|
|
9664
|
-
});
|
|
9665
|
-
if (insTitle1 && insTitle1.value) {
|
|
9666
|
-
itemValue1 = insurance1.eleOrderList.find(function (e) {
|
|
9667
|
-
return e.key === item1[2];
|
|
9668
|
-
});
|
|
9669
|
-
}
|
|
9288
|
+
var queryParts = [];
|
|
9289
|
+
Object.keys(params).forEach(function (key) {
|
|
9290
|
+
var value = params[key];
|
|
9291
|
+
if (value === undefined || value === null) {
|
|
9292
|
+
return;
|
|
9670
9293
|
}
|
|
9671
|
-
if (
|
|
9672
|
-
|
|
9673
|
-
|
|
9294
|
+
if (Array.isArray(value)) {
|
|
9295
|
+
value.forEach(function (item) {
|
|
9296
|
+
queryParts.push("".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(item)));
|
|
9674
9297
|
});
|
|
9675
|
-
|
|
9676
|
-
itemValue2 = insurance2.eleOrderList.find(function (e) {
|
|
9677
|
-
return e.key === item2[2];
|
|
9678
|
-
});
|
|
9679
|
-
}
|
|
9298
|
+
return;
|
|
9680
9299
|
}
|
|
9681
|
-
|
|
9682
|
-
|
|
9683
|
-
|
|
9684
|
-
|
|
9685
|
-
|
|
9686
|
-
|
|
9687
|
-
|
|
9688
|
-
|
|
9689
|
-
|
|
9690
|
-
|
|
9691
|
-
|
|
9692
|
-
|
|
9693
|
-
|
|
9694
|
-
|
|
9695
|
-
|
|
9696
|
-
|
|
9697
|
-
|
|
9698
|
-
|
|
9699
|
-
|
|
9700
|
-
|
|
9701
|
-
|
|
9702
|
-
|
|
9703
|
-
|
|
9704
|
-
|
|
9705
|
-
|
|
9706
|
-
|
|
9707
|
-
|
|
9708
|
-
|
|
9709
|
-
}
|
|
9710
|
-
});
|
|
9300
|
+
queryParts.push("".concat(encodeURIComponent(key), "=").concat(encodeURIComponent(value)));
|
|
9301
|
+
});
|
|
9302
|
+
return queryParts.join('&');
|
|
9303
|
+
};
|
|
9304
|
+
var isAbsoluteUrl = function isAbsoluteUrl(url) {
|
|
9305
|
+
return /^https?:\/\//.test(url);
|
|
9306
|
+
};
|
|
9307
|
+
var buildUrl = function buildUrl(baseURL, url, params) {
|
|
9308
|
+
var queryString = serializeParams(params);
|
|
9309
|
+
var requestUrl = isAbsoluteUrl(url) ? url : "".concat(baseURL).concat(url);
|
|
9310
|
+
if (!queryString) {
|
|
9311
|
+
return requestUrl;
|
|
9312
|
+
}
|
|
9313
|
+
return "".concat(requestUrl).concat(requestUrl.includes('?') ? '&' : '?').concat(queryString);
|
|
9314
|
+
};
|
|
9315
|
+
var isPlainObject = function isPlainObject(value) {
|
|
9316
|
+
return Object.prototype.toString.call(value) === '[object Object]';
|
|
9317
|
+
};
|
|
9318
|
+
var buildBody = function buildBody(data, headers) {
|
|
9319
|
+
if (data === undefined || data === null) {
|
|
9320
|
+
return undefined;
|
|
9321
|
+
}
|
|
9322
|
+
if (data instanceof FormData || data instanceof Blob || typeof data === 'string') {
|
|
9323
|
+
return data;
|
|
9324
|
+
}
|
|
9325
|
+
if (isPlainObject(data) || Array.isArray(data)) {
|
|
9326
|
+
if (!headers['Content-Type']) {
|
|
9327
|
+
headers['Content-Type'] = 'application/json';
|
|
9711
9328
|
}
|
|
9329
|
+
return JSON.stringify(data);
|
|
9712
9330
|
}
|
|
9713
|
-
return
|
|
9714
|
-
}
|
|
9715
|
-
|
|
9716
|
-
|
|
9717
|
-
|
|
9718
|
-
|
|
9719
|
-
/**
|
|
9720
|
-
* **处理产品数据(单个)**
|
|
9721
|
-
* - 提取通用信息
|
|
9722
|
-
* - 处理险种数据
|
|
9723
|
-
* - 根据被、投保人信息,处理险种状态。如:险种是否可选
|
|
9724
|
-
* - 根据校验条件解析产品状态。如:险种是否可选、重新获取元素(下拉框、单选框)的可选项
|
|
9725
|
-
* - 创建或更新组合险(多个险种组合成一个险种)
|
|
9726
|
-
* - 根据被、投保人信息,判断该产品是否可以显示
|
|
9727
|
-
* @author Lizhao <lz@winbaoxian.com>
|
|
9728
|
-
* @date 2022-04-26
|
|
9729
|
-
* @param {IPbProduct} prodData 必传。产品数据(单个)
|
|
9730
|
-
* @param {object} prodVerifyData 必传。产品校验条件(单个)
|
|
9731
|
-
* @param {IPbPersons} personData 必传。人员信息,包括被保人、投保人、投保人配偶
|
|
9732
|
-
* @param {object} [parmas] 可不传。补充参数,目前只有 planbookId
|
|
9733
|
-
* @returns {Promise<IPbProduct>} 产品数据(单个)
|
|
9734
|
-
*/
|
|
9735
|
-
function productDataHandler(_x, _x2, _x3, _x4) {
|
|
9736
|
-
return _productDataHandler.apply(this, arguments);
|
|
9737
|
-
}
|
|
9738
|
-
|
|
9739
|
-
/**
|
|
9740
|
-
* **处理多被保人**
|
|
9741
|
-
* @ignore
|
|
9742
|
-
* @author Lizhao <lz@winbaoxian.com>
|
|
9743
|
-
* @date 2024-02-28
|
|
9744
|
-
* @param {IPbPersons} personData 必传。人员信息,包括被保人、投保人、投保人配偶
|
|
9745
|
-
* @returns 人员信息
|
|
9746
|
-
*/
|
|
9747
|
-
function _productDataHandler() {
|
|
9748
|
-
_productDataHandler = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(prodData, prodVerifyData, personData, parmas) {
|
|
9749
|
-
var productVerifyData, _parmas$eventTarget, insuranceKey, elementKey, groupInsurance, groupInsuranceIdEle, subInsurances, hasProduct, hasVerifyData, hasPersonData, personOrderList, _prodData$mulInsOrder3;
|
|
9331
|
+
return data;
|
|
9332
|
+
};
|
|
9333
|
+
var parseResponse = /*#__PURE__*/function () {
|
|
9334
|
+
var _ref = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee(response) {
|
|
9335
|
+
var contentType, text;
|
|
9750
9336
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
9751
9337
|
while (1) switch (_context.prev = _context.next) {
|
|
9752
9338
|
case 0:
|
|
9753
|
-
|
|
9339
|
+
contentType = response.headers.get('content-type') || '';
|
|
9340
|
+
if (!contentType.includes('application/json')) {
|
|
9754
9341
|
_context.next = 1;
|
|
9755
9342
|
break;
|
|
9756
9343
|
}
|
|
9757
|
-
return _context.abrupt("return",
|
|
9344
|
+
return _context.abrupt("return", response.json());
|
|
9758
9345
|
case 1:
|
|
9759
|
-
|
|
9760
|
-
|
|
9761
|
-
|
|
9762
|
-
|
|
9763
|
-
if (
|
|
9346
|
+
_context.next = 2;
|
|
9347
|
+
return response.text();
|
|
9348
|
+
case 2:
|
|
9349
|
+
text = _context.sent;
|
|
9350
|
+
if (text) {
|
|
9764
9351
|
_context.next = 3;
|
|
9765
9352
|
break;
|
|
9766
9353
|
}
|
|
9767
|
-
_context.
|
|
9768
|
-
|
|
9354
|
+
return _context.abrupt("return", {});
|
|
9355
|
+
case 3:
|
|
9356
|
+
_context.prev = 3;
|
|
9357
|
+
return _context.abrupt("return", JSON.parse(text));
|
|
9358
|
+
case 4:
|
|
9359
|
+
_context.prev = 4;
|
|
9360
|
+
_context["catch"](3);
|
|
9361
|
+
return _context.abrupt("return", {
|
|
9362
|
+
data: text
|
|
9363
|
+
});
|
|
9364
|
+
case 5:
|
|
9365
|
+
case "end":
|
|
9366
|
+
return _context.stop();
|
|
9367
|
+
}
|
|
9368
|
+
}, _callee, null, [[3, 4]]);
|
|
9369
|
+
}));
|
|
9370
|
+
return function parseResponse(_x) {
|
|
9371
|
+
return _ref.apply(this, arguments);
|
|
9372
|
+
};
|
|
9373
|
+
}();
|
|
9374
|
+
var createTimeoutError = function createTimeoutError(timeout) {
|
|
9375
|
+
var error = new Error("timeout of ".concat(timeout, "ms exceeded"));
|
|
9376
|
+
error.name = 'TimeoutError';
|
|
9377
|
+
return error;
|
|
9378
|
+
};
|
|
9379
|
+
var request = /*#__PURE__*/function () {
|
|
9380
|
+
var _ref2 = _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2(config) {
|
|
9381
|
+
var url, _config$baseURL, baseURL, _config$method, method, params, data, _config$headers, headers, isIgnoreLoading, _config$timeout, timeout, _config$withCredentia, withCredentials, returnFullResponse, requestHeaders, timeoutId, fetchPromise, response, res, error, code, messageMap, message, _t2;
|
|
9382
|
+
return _regeneratorRuntime.wrap(function (_context2) {
|
|
9383
|
+
while (1) switch (_context2.prev = _context2.next) {
|
|
9384
|
+
case 0:
|
|
9385
|
+
url = config.url, _config$baseURL = config.baseURL, baseURL = _config$baseURL === void 0 ? options.baseURL : _config$baseURL, _config$method = config.method, method = _config$method === void 0 ? 'get' : _config$method, params = config.params, data = config.data, _config$headers = config.headers, headers = _config$headers === void 0 ? {} : _config$headers, isIgnoreLoading = config.isIgnoreLoading, _config$timeout = config.timeout, timeout = _config$timeout === void 0 ? options.timeout : _config$timeout, _config$withCredentia = config.withCredentials, withCredentials = _config$withCredentia === void 0 ? options.withCredentials : _config$withCredentia, returnFullResponse = config.returnFullResponse;
|
|
9386
|
+
if (!isIgnoreLoading) {
|
|
9387
|
+
showRequestLoading();
|
|
9388
|
+
}
|
|
9389
|
+
requestHeaders = _objectSpread(_objectSpread({}, options.headers), headers);
|
|
9390
|
+
timeoutId = null;
|
|
9391
|
+
_context2.prev = 1;
|
|
9392
|
+
fetchPromise = fetch(buildUrl(baseURL, url, params), {
|
|
9393
|
+
method: normalizeMethod(method),
|
|
9394
|
+
headers: requestHeaders,
|
|
9395
|
+
body: normalizeMethod(method) === 'GET' ? undefined : buildBody(data, requestHeaders),
|
|
9396
|
+
credentials: withCredentials ? 'include' : 'same-origin'
|
|
9397
|
+
});
|
|
9398
|
+
_context2.next = 2;
|
|
9399
|
+
return Promise.race([fetchPromise, new Promise(function (resolve, reject) {
|
|
9400
|
+
timeoutId = setTimeout(function () {
|
|
9401
|
+
reject(createTimeoutError(timeout));
|
|
9402
|
+
}, timeout);
|
|
9403
|
+
})]);
|
|
9769
9404
|
case 2:
|
|
9770
|
-
|
|
9771
|
-
|
|
9772
|
-
|
|
9405
|
+
response = _context2.sent;
|
|
9406
|
+
_context2.next = 3;
|
|
9407
|
+
return parseResponse(response);
|
|
9773
9408
|
case 3:
|
|
9774
|
-
|
|
9409
|
+
res = _context2.sent;
|
|
9410
|
+
if (response.ok) {
|
|
9411
|
+
_context2.next = 4;
|
|
9412
|
+
break;
|
|
9413
|
+
}
|
|
9414
|
+
error = new Error("Request failed with status code ".concat(response.status));
|
|
9415
|
+
error.response = {
|
|
9416
|
+
status: response.status,
|
|
9417
|
+
data: res
|
|
9418
|
+
};
|
|
9419
|
+
throw error;
|
|
9775
9420
|
case 4:
|
|
9776
|
-
|
|
9777
|
-
if (
|
|
9778
|
-
|
|
9779
|
-
|
|
9780
|
-
groupInsurance = (prodData.mulInsOrderList || []).find(function (ins) {
|
|
9781
|
-
return ins.key === insuranceKey;
|
|
9782
|
-
});
|
|
9783
|
-
groupInsuranceIdEle = ((groupInsurance === null || groupInsurance === void 0 ? void 0 : groupInsurance.eleOrderList) || []).find(function (e) {
|
|
9784
|
-
return e.key === 'insuranceId';
|
|
9785
|
-
});
|
|
9786
|
-
subInsurances = (prodData.mulInsOrderList || []).filter(function (ins) {
|
|
9787
|
-
return ins.groupKey === insuranceKey;
|
|
9788
|
-
});
|
|
9789
|
-
subInsurances.forEach(function (ins) {
|
|
9790
|
-
var titleEle = (ins.eleOrderList || []).find(function (e) {
|
|
9791
|
-
return e.key === 'title';
|
|
9792
|
-
});
|
|
9793
|
-
if (titleEle && groupInsuranceIdEle && !Array.isArray(groupInsuranceIdEle.value)) {
|
|
9794
|
-
titleEle.value = groupInsuranceIdEle.value === ins.key;
|
|
9795
|
-
}
|
|
9796
|
-
});
|
|
9797
|
-
}
|
|
9421
|
+
code = res.code;
|
|
9422
|
+
if (!['002012', '002013', '002015'].includes(code)) {
|
|
9423
|
+
_context2.next = 5;
|
|
9424
|
+
break;
|
|
9798
9425
|
}
|
|
9799
|
-
|
|
9800
|
-
|
|
9801
|
-
|
|
9802
|
-
|
|
9803
|
-
|
|
9804
|
-
|
|
9805
|
-
|
|
9806
|
-
|
|
9807
|
-
|
|
9808
|
-
|
|
9809
|
-
|
|
9810
|
-
insuranceDataHandler(ins, prodData);
|
|
9811
|
-
var insuranceVerifyData = productVerifyData[ins.key];
|
|
9812
|
-
if (!insuranceVerifyData) {
|
|
9813
|
-
if (ins.key !== 'common') {
|
|
9814
|
-
consoleLogWhenEnable("".concat(prodData.titleName, "-").concat(prodData.key, " -> ").concat(ins.name, "-").concat(ins.key, ": \u5F53\u524D\u9669\u79CD\u6CA1\u6709\u8D39\u7387\u8868"));
|
|
9815
|
-
}
|
|
9816
|
-
return;
|
|
9817
|
-
}
|
|
9818
|
-
// 双豁免是种特殊的投保人豁免。双豁免包含投保人豁免和投保人配偶豁免。如果没有选中配偶信息,则认为是投保人豁免,选中则认为投保人豁免和配偶豁免都选中
|
|
9819
|
-
var isTouHuomianIns = ins.huomian === 'touHuomian' || ins.huomian === 'shuangHuomian';
|
|
9820
|
-
var insuredInfo = personOrderList.find(function (p) {
|
|
9821
|
-
return p.key === 'insuredInfo';
|
|
9822
|
-
});
|
|
9823
|
-
var applicantInfo = personOrderList.find(function (p) {
|
|
9824
|
-
return p.key === 'applicantInfo';
|
|
9825
|
-
});
|
|
9826
|
-
// 如果豁免险种可以附加被保人,也可以附加投保人。选中投保人,则附加到投保人
|
|
9827
|
-
var personType = isTouHuomianIns ? 'applicantInfo' : 'insuredInfo';
|
|
9828
|
-
if (isTouHuomianIns && ins.allowSamePerson) {
|
|
9829
|
-
personType = applicantInfo && applicantInfo.title ? 'applicantInfo' : 'insuredInfo';
|
|
9830
|
-
}
|
|
9831
|
-
|
|
9832
|
-
// 取当前性别、年龄下的费率条件
|
|
9833
|
-
var targetPerson = personOrderList.find(function (p) {
|
|
9834
|
-
return p.key === personType;
|
|
9835
|
-
});
|
|
9836
|
-
var personCondition = null;
|
|
9837
|
-
if (targetPerson) {
|
|
9838
|
-
// 对应性别、年龄下的限制条件
|
|
9839
|
-
personCondition = insuranceVerifyData.find(function (v) {
|
|
9840
|
-
return targetPerson.sex === v.sex && targetPerson.age >= v.minAge && targetPerson.age <= v.maxAge;
|
|
9841
|
-
});
|
|
9842
|
-
if (personCondition) {
|
|
9843
|
-
// 当前险种的限制条件
|
|
9844
|
-
personCondition = personCondition.conditionData;
|
|
9845
|
-
//如果险种可以附加被保人,也可以附加投保人。选中投保人,则附加到投保人
|
|
9846
|
-
var isSamePerson = isTouHuomianIns && ins.allowSamePerson && personCondition.key === 'samePerson';
|
|
9847
|
-
if (isSamePerson) {
|
|
9848
|
-
personCondition = personCondition.samePerson.find(function (c) {
|
|
9849
|
-
return c.value == (applicantInfo.title ? 0 : 1);
|
|
9850
|
-
});
|
|
9851
|
-
}
|
|
9852
|
-
}
|
|
9853
|
-
}
|
|
9854
|
-
var curCondition = personCondition;
|
|
9855
|
-
var eleTitle = (_ins$eleOrderList = ins.eleOrderList) === null || _ins$eleOrderList === void 0 ? void 0 : _ins$eleOrderList.find(function (e) {
|
|
9856
|
-
return e.key === 'title';
|
|
9857
|
-
});
|
|
9858
|
-
// 遍历当前险种的限制条件
|
|
9859
|
-
var _loop2 = function _loop2() {
|
|
9860
|
-
var _ins$eleOrderList2;
|
|
9861
|
-
// 如果险种不存在费率限制条件或者投保人豁免在没有选中投保人信息的条件下,险种不可选
|
|
9862
|
-
var isNotAllowSelect = !curCondition || isTouHuomianIns && !ins.allowSamePerson && (!targetPerson.title || targetPerson.applicantAndInsuredSame);
|
|
9863
|
-
if (isNotAllowSelect) {
|
|
9864
|
-
eleTitle.isDisabled = true;
|
|
9865
|
-
eleTitle.value = false;
|
|
9866
|
-
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"));
|
|
9867
|
-
} else {
|
|
9868
|
-
// 存在费率,险种可选
|
|
9869
|
-
eleTitle.isDisabled = false;
|
|
9870
|
-
// 如果是必选险种,险种一定选中
|
|
9871
|
-
if (ins.required && (!ins.groupKey || ins.isCheckbox)) {
|
|
9872
|
-
eleTitle.value = true;
|
|
9873
|
-
eleTitle.isDisabled = true;
|
|
9874
|
-
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)"));
|
|
9875
|
-
}
|
|
9876
|
-
}
|
|
9877
|
-
if (!curCondition) {
|
|
9878
|
-
return 0; // break
|
|
9879
|
-
}
|
|
9880
|
-
// 判断是否为通用元素
|
|
9881
|
-
var eleData = (_ins$eleOrderList2 = ins.eleOrderList) === null || _ins$eleOrderList2 === void 0 ? void 0 : _ins$eleOrderList2.find(function (e) {
|
|
9882
|
-
return e.key === curCondition.key;
|
|
9883
|
-
});
|
|
9884
|
-
var commonData = insList.find(function (ins) {
|
|
9885
|
-
return ins.key === 'common';
|
|
9886
|
-
});
|
|
9887
|
-
if (!eleData && commonData && commonData.eleOrderList) {
|
|
9888
|
-
eleData = commonData.eleOrderList.find(function (e) {
|
|
9889
|
-
return e.key === curCondition.key;
|
|
9890
|
-
});
|
|
9891
|
-
}
|
|
9892
|
-
if (!eleData) {
|
|
9893
|
-
consoleLogWhenEnable("".concat(ins.name, " - ").concat(curCondition && curCondition.key, "\u5143\u7D20\u4E0D\u5B58\u5728\uFF1A"));
|
|
9894
|
-
curCondition = null;
|
|
9895
|
-
return 0; // break
|
|
9896
|
-
}
|
|
9897
|
-
var eleCondi = curCondition[curCondition.key];
|
|
9898
|
-
// 元素隐藏且非不可修改状态,取对应关联的险种的值
|
|
9899
|
-
var isBeGovernedEle = eleData.isHide && !eleData.isDisabled && ins.refInsuranceId && Number(ins.refInsuranceId) !== -2;
|
|
9900
|
-
if (isBeGovernedEle) {
|
|
9901
|
-
var refInsData = null;
|
|
9902
|
-
// -1: 关联主险。即险种中key值为非 「common」的第一个险种
|
|
9903
|
-
if (Number(ins.refInsuranceId) === -1) {
|
|
9904
|
-
refInsData = insList[0].key === 'common' ? insList[1] : insList[0];
|
|
9905
|
-
} else {
|
|
9906
|
-
refInsData = insList.find(function (ins) {
|
|
9907
|
-
return ins.key == ins.refInsuranceId;
|
|
9908
|
-
});
|
|
9909
|
-
}
|
|
9910
|
-
// 数据取值来源的元素
|
|
9911
|
-
var refEleData = refInsData && refInsData.eleOrderList && refInsData.eleOrderList.find(function (e) {
|
|
9912
|
-
return e.key === eleData.key;
|
|
9913
|
-
});
|
|
9914
|
-
if (refEleData) {
|
|
9915
|
-
// 豁免险,缴费期间需要减去某个值
|
|
9916
|
-
if (ins.huomian && eleData.key == 'pPeriod') {
|
|
9917
|
-
eleData.value = getHuomianPeriodValue(refEleData.value, ins.pMinus, ins.huomian === 'touHuomian' ? insuredInfo.age : targetPerson.age);
|
|
9918
|
-
} else {
|
|
9919
|
-
eleData.value = refEleData.value;
|
|
9920
|
-
}
|
|
9921
|
-
} else {
|
|
9922
|
-
consoleLogWhenEnable("".concat(ins.name, "-").concat(ins.key, "\uFF1A\u5173\u8054\u9669\u79CD").concat(ins.refInsuranceId, "\u4E0D\u5B58\u5728"));
|
|
9923
|
-
}
|
|
9924
|
-
} else {
|
|
9925
|
-
var backupOpts = eleData.opts && eleData.opts.length ? eleData.opts.slice(0) : [];
|
|
9926
|
-
eleData.opts = eleCondi.filter(function (c) {
|
|
9927
|
-
return c.value !== undefined && c.desc !== undefined;
|
|
9928
|
-
}).map(function (c) {
|
|
9929
|
-
var option = backupOpts.find(function (o) {
|
|
9930
|
-
return o.val == c.value;
|
|
9931
|
-
});
|
|
9932
|
-
return {
|
|
9933
|
-
val: c.value,
|
|
9934
|
-
desc: c.desc || c.value,
|
|
9935
|
-
isHide: option && option.isHide || null,
|
|
9936
|
-
isDisabled: option && option.isDisabled || null,
|
|
9937
|
-
isInvalid: null
|
|
9938
|
-
};
|
|
9939
|
-
});
|
|
9940
|
-
// 交费期间,默认取最后一个元素的值;其他元素,默认取第一个元素。By Lizh 2020.4.10, From hyw
|
|
9941
|
-
var isNoOption = eleData.opts && eleData.opts.length && eleData.opts.every(function (ele) {
|
|
9942
|
-
return ele.val != eleData.value;
|
|
9943
|
-
});
|
|
9944
|
-
if (isNoOption) {
|
|
9945
|
-
if (eleData.key === 'pPeriod') {
|
|
9946
|
-
var _eleData$opts;
|
|
9947
|
-
var filterOpts = (_eleData$opts = eleData.opts) === null || _eleData$opts === void 0 ? void 0 : _eleData$opts.filter(function (opt) {
|
|
9948
|
-
return !opt.isHide && !opt.isDisabled;
|
|
9949
|
-
});
|
|
9950
|
-
if (filterOpts && filterOpts.length) {
|
|
9951
|
-
eleData.value = filterOpts[filterOpts.length - 1].val;
|
|
9952
|
-
}
|
|
9953
|
-
} else {
|
|
9954
|
-
if (eleData.opts && eleData.opts.length) {
|
|
9955
|
-
eleData.value = eleData.opts[0].val;
|
|
9956
|
-
}
|
|
9957
|
-
}
|
|
9958
|
-
}
|
|
9959
|
-
}
|
|
9960
|
-
// 提定下一个元素的限制条件
|
|
9961
|
-
curCondition = eleCondi.find(function (eleCondi) {
|
|
9962
|
-
return eleCondi.value == eleData.value;
|
|
9963
|
-
});
|
|
9964
|
-
var eleIndex = ins.eleOrderList.findIndex(function (ele) {
|
|
9965
|
-
return ele.key === eleData.key;
|
|
9966
|
-
});
|
|
9967
|
-
var prevElement;
|
|
9968
|
-
if (eleIndex >= 1) {
|
|
9969
|
-
prevElement = ins.eleOrderList[eleIndex - 1];
|
|
9970
|
-
}
|
|
9971
|
-
if (prevElement) {
|
|
9972
|
-
// 如果下一个元素的 value 不存在限制条件。则遍历上一个元素,重新设置上一元素的值,并取对应的限制条件。
|
|
9973
|
-
if (!curCondition) {
|
|
9974
|
-
var prevEleVerify = getElementVerifyFromProductVerify(personCondition, insList, {
|
|
9975
|
-
insuranceKey: ins.key,
|
|
9976
|
-
elementKey: prevElement.key
|
|
9977
|
-
});
|
|
9978
|
-
var onePrevEleVerify = prevEleVerify === null || prevEleVerify === void 0 ? void 0 : prevEleVerify.find(function (v) {
|
|
9979
|
-
return v[eleData.key] && v[eleData.key].some(function (condi) {
|
|
9980
|
-
return condi.value === eleData.value;
|
|
9981
|
-
});
|
|
9982
|
-
});
|
|
9983
|
-
if (onePrevEleVerify) {
|
|
9984
|
-
prevElement.value = onePrevEleVerify.value;
|
|
9985
|
-
curCondition = onePrevEleVerify[eleData.key];
|
|
9986
|
-
}
|
|
9987
|
-
}
|
|
9988
|
-
if (!curCondition) {
|
|
9989
|
-
eleTitle.isDisabled = true;
|
|
9990
|
-
eleTitle.value = false;
|
|
9991
|
-
consoleLogWhenEnable("".concat(eleTitle.labelName, "-").concat(ins.key, ": \u8D39\u7387\u4E0D\u5B58\u5728\uFF01"));
|
|
9992
|
-
}
|
|
9993
|
-
|
|
9994
|
-
// 如果当前元素是隐藏的且不可修改,则过滤上一元素的选项,即,删除上一元素中不包含当前元素值的选项。
|
|
9995
|
-
var isNeedReverseFilter = eleData.isHide && !eleData.isDisabled && prevElement.opts && prevElement.opts.length;
|
|
9996
|
-
if (isNeedReverseFilter) {
|
|
9997
|
-
var _prevEleVerify = getElementVerifyFromProductVerify(personCondition, insList, {
|
|
9998
|
-
insuranceKey: ins.key,
|
|
9999
|
-
elementKey: prevElement.key
|
|
10000
|
-
});
|
|
10001
|
-
if (_prevEleVerify) {
|
|
10002
|
-
prevElement.opts = _prevEleVerify.filter(function (v) {
|
|
10003
|
-
var elementVerify = getElementVerifyFromProductVerify(personCondition, insList, _defineProperty$1({
|
|
10004
|
-
insuranceKey: ins.key,
|
|
10005
|
-
elementKey: eleData.key
|
|
10006
|
-
}, prevElement.key, v.value));
|
|
10007
|
-
return elementVerify && elementVerify.some(function (c) {
|
|
10008
|
-
return c.value == eleData.value;
|
|
10009
|
-
});
|
|
10010
|
-
}).map(function (v) {
|
|
10011
|
-
return {
|
|
10012
|
-
val: v.value,
|
|
10013
|
-
desc: v.desc || v.value,
|
|
10014
|
-
isHide: null,
|
|
10015
|
-
isDisabled: null,
|
|
10016
|
-
isInvalid: null
|
|
10017
|
-
};
|
|
10018
|
-
});
|
|
10019
|
-
}
|
|
10020
|
-
}
|
|
10021
|
-
}
|
|
10022
|
-
},
|
|
10023
|
-
_ret;
|
|
10024
|
-
do {
|
|
10025
|
-
_ret = _loop2();
|
|
10026
|
-
if (_ret === 0) break;
|
|
10027
|
-
} while (curCondition && curCondition.key && curCondition[curCondition.key]);
|
|
10028
|
-
if (Array.isArray(ins.eleOrderList)) {
|
|
10029
|
-
ins.eleOrderList.forEach(function (ele) {
|
|
10030
|
-
var newEleMap = executeElementRule(personData, prodData, ins, ele, parmas);
|
|
10031
|
-
for (var k in newEleMap) {
|
|
10032
|
-
ele[k] = newEleMap[k];
|
|
10033
|
-
}
|
|
10034
|
-
});
|
|
10035
|
-
insuranceDataHandler(ins, prodData);
|
|
10036
|
-
}
|
|
9426
|
+
messageMap = {
|
|
9427
|
+
m002012: '当前账号因操作频繁被限制,请明天再试。感谢理解',
|
|
9428
|
+
m002013: '您的操作频率较高,已达到今日生成上限。请稍后再试或明天继续使用,感谢您的理解!',
|
|
9429
|
+
m002015: '您今天做了太多计划书了,休息一下,明天再来吧'
|
|
9430
|
+
};
|
|
9431
|
+
message = messageMap["m".concat(code)];
|
|
9432
|
+
if (message) {
|
|
9433
|
+
_Dialog.alert({
|
|
9434
|
+
message: message,
|
|
9435
|
+
confirmButtonText: '知道了',
|
|
9436
|
+
confirmButtonColor: '#0A64FE'
|
|
10037
9437
|
});
|
|
10038
9438
|
}
|
|
10039
|
-
|
|
10040
|
-
|
|
10041
|
-
|
|
9439
|
+
return _context2.abrupt("return", Promise.reject({
|
|
9440
|
+
code: code,
|
|
9441
|
+
message: message
|
|
9442
|
+
}));
|
|
10042
9443
|
case 5:
|
|
9444
|
+
if (!(code === 401 || res.status === 401)) {
|
|
9445
|
+
_context2.next = 6;
|
|
9446
|
+
break;
|
|
9447
|
+
}
|
|
9448
|
+
gotoLogin();
|
|
9449
|
+
return _context2.abrupt("return", Promise.reject('status: 401'));
|
|
9450
|
+
case 6:
|
|
9451
|
+
if (!(res.success && res.data === -1)) {
|
|
9452
|
+
_context2.next = 7;
|
|
9453
|
+
break;
|
|
9454
|
+
}
|
|
9455
|
+
gotoLogin();
|
|
9456
|
+
return _context2.abrupt("return", Promise.reject('login: -1'));
|
|
9457
|
+
case 7:
|
|
9458
|
+
return _context2.abrupt("return", returnFullResponse ? res : res.data);
|
|
9459
|
+
case 8:
|
|
9460
|
+
_context2.prev = 8;
|
|
9461
|
+
_t2 = _context2["catch"](1);
|
|
9462
|
+
if (_t2.response && _t2.response.status == 401) {
|
|
9463
|
+
gotoLogin();
|
|
9464
|
+
}
|
|
9465
|
+
return _context2.abrupt("return", Promise.reject(_t2));
|
|
9466
|
+
case 9:
|
|
9467
|
+
_context2.prev = 9;
|
|
9468
|
+
if (timeoutId) {
|
|
9469
|
+
clearTimeout(timeoutId);
|
|
9470
|
+
}
|
|
9471
|
+
hideRequestLoading();
|
|
9472
|
+
return _context2.finish(9);
|
|
9473
|
+
case 10:
|
|
10043
9474
|
case "end":
|
|
10044
|
-
return
|
|
9475
|
+
return _context2.stop();
|
|
10045
9476
|
}
|
|
10046
|
-
},
|
|
9477
|
+
}, _callee2, null, [[1, 8, 9, 10]]);
|
|
10047
9478
|
}));
|
|
10048
|
-
return
|
|
10049
|
-
|
|
10050
|
-
|
|
10051
|
-
|
|
10052
|
-
|
|
10053
|
-
|
|
10054
|
-
|
|
10055
|
-
|
|
10056
|
-
|
|
10057
|
-
|
|
10058
|
-
|
|
10059
|
-
|
|
10060
|
-
|
|
10061
|
-
|
|
10062
|
-
var insuredIndex = personOrderList.findIndex(function (p) {
|
|
10063
|
-
return p.key === 'insuredInfo';
|
|
10064
|
-
});
|
|
10065
|
-
if (insuredIndex >= 0) {
|
|
10066
|
-
var person = lodash.cloneDeep(insuredInfo);
|
|
10067
|
-
person.key = 'insured2Info';
|
|
10068
|
-
person.eleOrderList.forEach(function (e) {
|
|
10069
|
-
if (e.key === 'title') {
|
|
10070
|
-
e.isDisabled = false;
|
|
10071
|
-
e.value = true;
|
|
10072
|
-
e.label = '第二被保人信息';
|
|
10073
|
-
}
|
|
10074
|
-
});
|
|
10075
|
-
personOrderList.splice(insuredIndex + 1, 0, person);
|
|
9479
|
+
return function request(_x2) {
|
|
9480
|
+
return _ref2.apply(this, arguments);
|
|
9481
|
+
};
|
|
9482
|
+
}();
|
|
9483
|
+
|
|
9484
|
+
function getPlanbookInsuranceVerifyData(params) {
|
|
9485
|
+
return request({
|
|
9486
|
+
baseURL: APP_HOSTNAME,
|
|
9487
|
+
url: '/planBook/input/insurance/verifyData',
|
|
9488
|
+
method: 'post',
|
|
9489
|
+
data: params,
|
|
9490
|
+
headers: {
|
|
9491
|
+
Accept: 'application/json, text/plain, */*',
|
|
9492
|
+
'Content-Type': 'application/json;'
|
|
10076
9493
|
}
|
|
10077
|
-
}
|
|
10078
|
-
return personData;
|
|
10079
|
-
}
|
|
10080
|
-
|
|
10081
|
-
/**
|
|
10082
|
-
* 请求返回当前产品、当前条件的费率数据
|
|
10083
|
-
* @ignore
|
|
10084
|
-
* @author Lizhao <lz@winbaoxian.com>
|
|
10085
|
-
* @date 2024-02-28
|
|
10086
|
-
* @param {IPbProduct} prodData 必传。产品数据(单个)
|
|
10087
|
-
* @param {IPbPersons} personData 必传。人员信息,包括被保人、投保人、投保人配偶
|
|
10088
|
-
* @returns 请求函数的 Promise
|
|
10089
|
-
*/
|
|
10090
|
-
function getSingleInsurancesVerifyData(prodData, personData) {
|
|
10091
|
-
var _prodData$mulInsOrder, _prodData$mulInsOrder2;
|
|
10092
|
-
var parmas = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
|
|
10093
|
-
var personOrderList = personData.personOrderList;
|
|
10094
|
-
if (!(personOrderList && personOrderList.length)) {
|
|
10095
|
-
return null;
|
|
10096
|
-
}
|
|
10097
|
-
var pbId = prodData.isTemp || prodData.policyType === 'single_insurance' ? null : parmas.planbookId;
|
|
10098
|
-
var productId = prodData.policyType === 'single_insurance' ? null : prodData.key;
|
|
10099
|
-
// 险种对比,prodData 没有 feeValidateMode 字段。因此需要特殊处理。
|
|
10100
|
-
// 险种对比,以险种为维度,其 prodData.key 就是险种id,不能当成正常产品id。因此需要特殊处理。
|
|
10101
|
-
if (prodData.feeValidateMode !== 'single') {
|
|
10102
|
-
productId = null;
|
|
10103
|
-
}
|
|
10104
|
-
var insuredList = personOrderList.filter(function (p) {
|
|
10105
|
-
return ['insuredInfo', 'insured2Info'].includes(p.key);
|
|
10106
|
-
}).filter(function (p) {
|
|
10107
|
-
var _p$eleOrderList;
|
|
10108
|
-
var title = (_p$eleOrderList = p.eleOrderList) === null || _p$eleOrderList === void 0 ? void 0 : _p$eleOrderList.find(function (e) {
|
|
10109
|
-
return e.key === 'title';
|
|
10110
|
-
});
|
|
10111
|
-
return title && title.value || p.title;
|
|
10112
|
-
}).map(function (p) {
|
|
10113
|
-
var person = convertEleOrderListToObj(p);
|
|
10114
|
-
return {
|
|
10115
|
-
key: person.key,
|
|
10116
|
-
sex: person.sex,
|
|
10117
|
-
age: person.age
|
|
10118
|
-
};
|
|
10119
|
-
});
|
|
10120
|
-
var applicant = null;
|
|
10121
|
-
var applicantItem = personData.personOrderList.find(function (p) {
|
|
10122
|
-
return p.key === 'applicantInfo';
|
|
10123
|
-
});
|
|
10124
|
-
if (applicantItem) {
|
|
10125
|
-
var person = convertEleOrderListToObj(applicantItem);
|
|
10126
|
-
applicant = {
|
|
10127
|
-
key: person.key,
|
|
10128
|
-
sex: person.sex,
|
|
10129
|
-
age: person.age
|
|
10130
|
-
};
|
|
10131
|
-
}
|
|
10132
|
-
var insuranceIdList = prodData === null || prodData === void 0 || (_prodData$mulInsOrder = prodData.mulInsOrderList) === null || _prodData$mulInsOrder === void 0 ? void 0 : _prodData$mulInsOrder.map(function (ins) {
|
|
10133
|
-
return ins.key;
|
|
10134
|
-
}).filter(function (k) {
|
|
10135
|
-
return !['common'].includes(k);
|
|
10136
|
-
});
|
|
10137
|
-
prodData === null || prodData === void 0 || (_prodData$mulInsOrder2 = prodData.mulInsOrderList) === null || _prodData$mulInsOrder2 === void 0 || _prodData$mulInsOrder2.reduce(function (list, ins) {
|
|
10138
|
-
return ins.key === 'common' || ins.isGroup ? list : list.concat(ins.key);
|
|
10139
|
-
}, []);
|
|
10140
|
-
return getAndCacheInsurancesVerifyData({
|
|
10141
|
-
pbId: pbId,
|
|
10142
|
-
productId: productId,
|
|
10143
|
-
insuredList: insuredList,
|
|
10144
|
-
applicant: applicant,
|
|
10145
|
-
insuranceIdList: insuranceIdList
|
|
10146
9494
|
});
|
|
10147
9495
|
}
|
|
10148
9496
|
|
|
@@ -10154,403 +9502,13 @@
|
|
|
10154
9502
|
* @param { any } params 必传。接口请求信息
|
|
10155
9503
|
* @returns {Promise<any>} 产品下所有险种的费率
|
|
10156
9504
|
*/
|
|
10157
|
-
|
|
10158
|
-
|
|
10159
|
-
return fetch(url, {
|
|
10160
|
-
method: 'POST',
|
|
10161
|
-
credentials: 'include',
|
|
10162
|
-
headers: {
|
|
10163
|
-
Accept: 'application/json, text/plain, */*',
|
|
10164
|
-
'Content-Type': 'application/json;'
|
|
10165
|
-
},
|
|
10166
|
-
body: JSON.stringify(params)
|
|
10167
|
-
}).then(function (response) {
|
|
10168
|
-
return response.json();
|
|
10169
|
-
}).then(function (_ref) {
|
|
10170
|
-
var success = _ref.success,
|
|
10171
|
-
data = _ref.data;
|
|
10172
|
-
if (!success || !data) {
|
|
10173
|
-
return Promise.reject();
|
|
10174
|
-
}
|
|
10175
|
-
return Promise.resolve(data);
|
|
10176
|
-
}).catch(function () {});
|
|
9505
|
+
lodash.memoize(function (params) {
|
|
9506
|
+
return getPlanbookInsuranceVerifyData(params).catch(function () {});
|
|
10177
9507
|
}, function (params) {
|
|
10178
9508
|
return QS.stringify(params);
|
|
10179
9509
|
});
|
|
10180
|
-
function getElementVerifyFromProductVerify(verify, insurances, option) {
|
|
10181
|
-
if (!verify || !verify.key || !verify[verify.key] || !insurances || !option) {
|
|
10182
|
-
return verify;
|
|
10183
|
-
}
|
|
10184
|
-
var insuranceInfo = {};
|
|
10185
|
-
insurances.forEach(function (ins) {
|
|
10186
|
-
if (['common', option.insuranceKey].includes(ins.key)) {
|
|
10187
|
-
insuranceInfo = _objectSpread(_objectSpread({}, insuranceInfo), convertEleOrderListToObj(ins));
|
|
10188
|
-
}
|
|
10189
|
-
});
|
|
10190
|
-
insuranceInfo = _objectSpread(_objectSpread({}, insuranceInfo), option);
|
|
10191
|
-
var temp = verify;
|
|
10192
|
-
var hasElementKey = verify.key === option.elementKey;
|
|
10193
|
-
while (temp && temp.key && temp.key !== option.elementKey) {
|
|
10194
|
-
temp = temp[temp.key].find(function (v) {
|
|
10195
|
-
return v.value == insuranceInfo[temp.key];
|
|
10196
|
-
});
|
|
10197
|
-
if (temp && temp.key === option.elementKey) {
|
|
10198
|
-
hasElementKey = true;
|
|
10199
|
-
}
|
|
10200
|
-
}
|
|
10201
|
-
if (!hasElementKey) {
|
|
10202
|
-
return null;
|
|
10203
|
-
}
|
|
10204
|
-
if (temp && temp[option.elementKey]) {
|
|
10205
|
-
return temp[option.elementKey];
|
|
10206
|
-
}
|
|
10207
|
-
return temp ? [temp] : null;
|
|
10208
|
-
}
|
|
10209
|
-
|
|
10210
|
-
/**
|
|
10211
|
-
* **提取产品中的通用信息**
|
|
10212
|
-
* - 将产品下所有险种中 [common: true] 的元素,提取到一个新险种下(险种[key: common]),并作为产品的第一个险种。
|
|
10213
|
-
* @ignore
|
|
10214
|
-
* @author Lizhao <lz@winbaoxian.com>
|
|
10215
|
-
* @date 2022-04-26
|
|
10216
|
-
* @param {IPbProduct} prodData 必传。产品数据(单个)
|
|
10217
|
-
* @returns {IPbProduct} 产品数据(单个)
|
|
10218
|
-
*/
|
|
10219
|
-
function setCommonInfo(prodData) {
|
|
10220
|
-
if (!prodData || !prodData.mulInsOrderList) {
|
|
10221
|
-
return prodData;
|
|
10222
|
-
}
|
|
10223
|
-
var common = {
|
|
10224
|
-
key: 'common',
|
|
10225
|
-
eleOrderList: []
|
|
10226
|
-
};
|
|
10227
|
-
prodData.mulInsOrderList.forEach(function (ins) {
|
|
10228
|
-
if (!ins.eleOrderList) {
|
|
10229
|
-
return;
|
|
10230
|
-
}
|
|
10231
|
-
ins.eleOrderList.forEach(function (ele) {
|
|
10232
|
-
if (ele.common && common.eleOrderList.every(function (e) {
|
|
10233
|
-
return e.key !== ele.key;
|
|
10234
|
-
})) {
|
|
10235
|
-
common.eleOrderList.push(ele);
|
|
10236
|
-
}
|
|
10237
|
-
});
|
|
10238
|
-
ins.eleOrderList = ins.eleOrderList.filter(function (ele) {
|
|
10239
|
-
return !ele.common;
|
|
10240
|
-
});
|
|
10241
|
-
});
|
|
10242
|
-
// 把通用信息当作一个险种,做为产品险种列表的第一个险种
|
|
10243
|
-
if (!common.eleOrderList.length) {
|
|
10244
|
-
return prodData;
|
|
10245
|
-
}
|
|
10246
|
-
prodData.mulInsOrderList = prodData.mulInsOrderList.filter(function (ins) {
|
|
10247
|
-
return ins.key !== 'common';
|
|
10248
|
-
});
|
|
10249
|
-
prodData.mulInsOrderList.unshift(common);
|
|
10250
|
-
// 通用信息,与跟随其后的险种不留间距
|
|
10251
|
-
if (prodData.mulInsOrderList[1]) {
|
|
10252
|
-
prodData.mulInsOrderList[1].isFollowing = true;
|
|
10253
|
-
}
|
|
10254
|
-
return prodData;
|
|
10255
|
-
}
|
|
10256
|
-
|
|
10257
|
-
/**
|
|
10258
|
-
* **创建或更新组合险**
|
|
10259
|
-
* - 组合险是虚拟的险种,是为了解决特殊场景:多个险种,只能同时选中一个。
|
|
10260
|
-
* - 组合险的初始状态取决于子险种,状态包括:是否可选、包含的元素、元素的选项及值。用户有交互,以交互后的状态为准。
|
|
10261
|
-
* @ignore
|
|
10262
|
-
* @author Lizhao <lz@winbaoxian.com>
|
|
10263
|
-
* @date 2022-04-26
|
|
10264
|
-
* @param {IPbProduct} prodData 必传。产品数据(单个)
|
|
10265
|
-
* @returns {IPbProduct} 产品数据(单个)
|
|
10266
|
-
*/
|
|
10267
|
-
function setGroupInsurance(prodData) {
|
|
10268
|
-
var mulInsOrderList = prodData && prodData.mulInsOrderList ? prodData.mulInsOrderList : [];
|
|
10269
|
-
// 清空险种列表中的已有的险种组合
|
|
10270
|
-
prodData.mulInsOrderList = mulInsOrderList.filter(function (ins) {
|
|
10271
|
-
return !ins.isGroup;
|
|
10272
|
-
});
|
|
10273
|
-
|
|
10274
|
-
// 多险种选一,或多险种选多。生成一个组合,如多个险种合成豁免险
|
|
10275
|
-
var groupInsuranceList = mulInsOrderList.filter(function (ins) {
|
|
10276
|
-
return !!ins.groupKey;
|
|
10277
|
-
});
|
|
10278
|
-
if (groupInsuranceList.length) {
|
|
10279
|
-
var newGroupInsMap = {};
|
|
10280
|
-
groupInsuranceList.filter(function (ins) {
|
|
10281
|
-
return ins.groupKey;
|
|
10282
|
-
}).forEach(function (ins) {
|
|
10283
|
-
newGroupInsMap[ins.groupKey] = newGroupInsMap[ins.groupKey] || {
|
|
10284
|
-
key: ins.groupKey,
|
|
10285
|
-
name: ins.groupName,
|
|
10286
|
-
huomian: ins.huomian,
|
|
10287
|
-
isGroup: true,
|
|
10288
|
-
eleOrderList: [{
|
|
10289
|
-
key: 'title',
|
|
10290
|
-
value: false,
|
|
10291
|
-
isDisabled: false,
|
|
10292
|
-
componentName: 'cmCommonTitle',
|
|
10293
|
-
labelName: ins.groupName
|
|
10294
|
-
}, {
|
|
10295
|
-
key: 'insuranceId',
|
|
10296
|
-
value: ins.isCheckbox ? [] : null,
|
|
10297
|
-
componentName: ins.isCheckbox ? 'cmCommonCheckbox' : 'cmCommonRadio',
|
|
10298
|
-
opts: []
|
|
10299
|
-
}]
|
|
10300
|
-
};
|
|
10301
|
-
|
|
10302
|
-
// 将子险种转换成险种组合的选项
|
|
10303
|
-
var titleEle = ins.eleOrderList.find(function (e) {
|
|
10304
|
-
return e.key === 'title';
|
|
10305
|
-
});
|
|
10306
|
-
var insuranceIdEle = newGroupInsMap[ins.groupKey].eleOrderList.find(function (e) {
|
|
10307
|
-
return e.key === 'insuranceId';
|
|
10308
|
-
});
|
|
10309
|
-
insuranceIdEle.opts.push({
|
|
10310
|
-
val: ins.key,
|
|
10311
|
-
code: ins.code,
|
|
10312
|
-
desc: titleEle.labelName,
|
|
10313
|
-
isDisabled: titleEle.isDisabled
|
|
10314
|
-
});
|
|
10315
|
-
});
|
|
10316
|
-
|
|
10317
|
-
// 处理组合险中的逻辑,并加入到产品险种列表中
|
|
10318
|
-
var _loop = function _loop(k) {
|
|
10319
|
-
var _oldGroupInsurance$el;
|
|
10320
|
-
var oldGroupInsurance = mulInsOrderList.find(function (ins) {
|
|
10321
|
-
return ins.key === k;
|
|
10322
|
-
});
|
|
10323
|
-
var oldGroupTitleElement = oldGroupInsurance ? (_oldGroupInsurance$el = oldGroupInsurance.eleOrderList) === null || _oldGroupInsurance$el === void 0 ? void 0 : _oldGroupInsurance$el.find(function (e) {
|
|
10324
|
-
return e.key === 'title';
|
|
10325
|
-
}) : null;
|
|
10326
|
-
var oldGroupTitleValue = oldGroupTitleElement ? oldGroupTitleElement.value : null;
|
|
10327
|
-
var nGroupTitleEle = newGroupInsMap[k].eleOrderList.find(function (e) {
|
|
10328
|
-
return e.key === 'title';
|
|
10329
|
-
});
|
|
10330
|
-
var nGroupInsuranceIdEle = newGroupInsMap[k].eleOrderList.find(function (e) {
|
|
10331
|
-
return e.key === 'insuranceId';
|
|
10332
|
-
});
|
|
10333
|
-
var groupInsList = mulInsOrderList.filter(function (ins) {
|
|
10334
|
-
return ins.groupKey == k;
|
|
10335
|
-
});
|
|
10336
|
-
if (nGroupTitleEle && nGroupInsuranceIdEle && groupInsList.length) {
|
|
10337
|
-
var notDisabledInsurances = groupInsList.filter(function (ins) {
|
|
10338
|
-
var titleEle = (ins.eleOrderList || []).find(function (e) {
|
|
10339
|
-
return e.key === 'title';
|
|
10340
|
-
});
|
|
10341
|
-
return titleEle && !titleEle.isDisabled;
|
|
10342
|
-
});
|
|
10343
|
-
var checkedInsurances = notDisabledInsurances.filter(function (ins) {
|
|
10344
|
-
var titleEle = (ins.eleOrderList || []).find(function (ele) {
|
|
10345
|
-
return ele.key === 'title';
|
|
10346
|
-
});
|
|
10347
|
-
return titleEle && titleEle.value;
|
|
10348
|
-
});
|
|
10349
|
-
var hasRequiredIns = notDisabledInsurances.some(function (ins) {
|
|
10350
|
-
return ins.required;
|
|
10351
|
-
});
|
|
10352
|
-
var checkedInsurance = checkedInsurances[0];
|
|
10353
|
-
// hasRequiredIns:如果组合险中有一款是必选的,则整个组合险为选中状态
|
|
10354
|
-
// 所有险种都不可选,则组合险不可修改且不选中。否则,组合险种可选
|
|
10355
|
-
nGroupTitleEle.value = oldGroupTitleValue === false ? oldGroupTitleValue : oldGroupTitleValue || !!checkedInsurance;
|
|
10356
|
-
if (hasRequiredIns) {
|
|
10357
|
-
nGroupTitleEle.value = hasRequiredIns;
|
|
10358
|
-
}
|
|
10359
|
-
nGroupTitleEle.isDisabled = hasRequiredIns || (nGroupInsuranceIdEle.opts || []).every(function (opt) {
|
|
10360
|
-
return !!opt.isDisabled;
|
|
10361
|
-
});
|
|
10362
|
-
nGroupInsuranceIdEle.value = checkedInsurance ? checkedInsurance.key : null;
|
|
10363
|
-
|
|
10364
|
-
//将当前选中险种的部分数据复制到组合险中
|
|
10365
|
-
if (checkedInsurance) {
|
|
10366
|
-
// 定义组件险中的元素:自身eleOrderList + 所选险种的eleOrderList(不包含标题)
|
|
10367
|
-
var keys = ['code', 'groupKey', 'groupName', 'isFollowing', 'key', 'name', 'accountData', 'reduceBaofData', 'duplicateReduceBaofData'];
|
|
10368
|
-
for (var ck in checkedInsurance) {
|
|
10369
|
-
if (!keys.includes(ck)) {
|
|
10370
|
-
if (ck === 'eleOrderList') {
|
|
10371
|
-
newGroupInsMap[k][ck] = newGroupInsMap[k][ck].concat(checkedInsurance[ck].filter(function (ele) {
|
|
10372
|
-
return ele.key !== 'title';
|
|
10373
|
-
}));
|
|
10374
|
-
} else {
|
|
10375
|
-
newGroupInsMap[k][ck] = checkedInsurance[ck];
|
|
10376
|
-
}
|
|
10377
|
-
}
|
|
10378
|
-
}
|
|
10379
|
-
}
|
|
10380
|
-
}
|
|
10381
|
-
var index = mulInsOrderList.findLastIndex(function (ins) {
|
|
10382
|
-
return ins.groupKey === k;
|
|
10383
|
-
});
|
|
10384
|
-
if (index >= 0) {
|
|
10385
|
-
prodData.mulInsOrderList.splice(index + 1, 0, newGroupInsMap[k]);
|
|
10386
|
-
}
|
|
10387
|
-
};
|
|
10388
|
-
for (var k in newGroupInsMap) {
|
|
10389
|
-
_loop(k);
|
|
10390
|
-
}
|
|
10391
|
-
}
|
|
10392
|
-
return prodData;
|
|
10393
|
-
}
|
|
10394
|
-
|
|
10395
|
-
/**
|
|
10396
|
-
* **判断是否隐藏产品**
|
|
10397
|
-
* - 根据必选险种,或者所有险种的年龄范围,取并集,计算出产品年龄范围
|
|
10398
|
-
* - 判断被保人年龄是否超出产品年龄范围,如果是,则该产品不可选,隐藏产品
|
|
10399
|
-
* @ignore
|
|
10400
|
-
* @author Lizhao <lz@winbaoxian.com>
|
|
10401
|
-
* @date 2022-04-26
|
|
10402
|
-
* @param {IPbProduct} prodData 必传。产品数据(单个)
|
|
10403
|
-
* @param {object} productVerifyData 必传。产品限制条件(单个)
|
|
10404
|
-
* @param {IPbPerson} personOrderList 必传。转换后的人员信息,包括被保人、投保人、投保人配偶
|
|
10405
|
-
* @returns {object} 产品数据(单个)
|
|
10406
|
-
*/
|
|
10407
|
-
function isHideProduct(prodData, productVerifyData, personOrderList) {
|
|
10408
|
-
var ageRangeProd = {};
|
|
10409
|
-
if (prodData && productVerifyData && Object.keys(productVerifyData).length && personOrderList) {
|
|
10410
|
-
if (prodData.mulInsOrderList) {
|
|
10411
|
-
// 产品中是否有必选险种且有费率
|
|
10412
|
-
var hasRequiredIns = prodData.mulInsOrderList.some(function (ins) {
|
|
10413
|
-
return !!ins.required && productVerifyData[ins.key];
|
|
10414
|
-
});
|
|
10415
|
-
prodData.mulInsOrderList.forEach(function (ins) {
|
|
10416
|
-
// 当前险种的限制条件
|
|
10417
|
-
var insuranceVerifyData = productVerifyData[ins.key];
|
|
10418
|
-
if (insuranceVerifyData) {
|
|
10419
|
-
// 产品年龄范围取各险种最大范围
|
|
10420
|
-
if ((!ins.huomian || ins.huomian == 'beiHuomian') && (!hasRequiredIns || hasRequiredIns && ins.required)) {
|
|
10421
|
-
insuranceVerifyData.forEach(function (verify) {
|
|
10422
|
-
ageRangeProd[verify.sex] = ageRangeProd[verify.sex] || [];
|
|
10423
|
-
ageRangeProd[verify.sex] = [Math.min(ageRangeProd[verify.sex][0] === undefined ? verify.minAge : ageRangeProd[verify.sex][0], verify.minAge), Math.max(ageRangeProd[verify.sex][1] === undefined ? verify.maxAge : ageRangeProd[verify.sex][1], verify.maxAge)];
|
|
10424
|
-
});
|
|
10425
|
-
}
|
|
10426
|
-
}
|
|
10427
|
-
});
|
|
10428
|
-
}
|
|
10429
|
-
var _ref2 = personOrderList.find(function (p) {
|
|
10430
|
-
return p.key === 'insuredInfo';
|
|
10431
|
-
}),
|
|
10432
|
-
sex = _ref2.sex,
|
|
10433
|
-
age = _ref2.age;
|
|
10434
|
-
if (ageRangeProd[sex] && age >= ageRangeProd[sex][0] && age <= ageRangeProd[sex][1]) {
|
|
10435
|
-
prodData.hide = false;
|
|
10436
|
-
} else {
|
|
10437
|
-
prodData.hadChoice = false;
|
|
10438
|
-
prodData.hide = true;
|
|
10439
|
-
prodData.totalBaof = null;
|
|
10440
|
-
}
|
|
10441
|
-
}
|
|
10442
|
-
return ageRangeProd;
|
|
10443
|
-
}
|
|
10444
|
-
|
|
10445
|
-
/**
|
|
10446
|
-
* **清空追加领取、减保领取、调整保额数据**
|
|
10447
|
-
* @author Lizhao <lz@winbaoxian.com>
|
|
10448
|
-
* @date 2022-04-26
|
|
10449
|
-
* @param {IPbProduct} productData 产品数据
|
|
10450
|
-
* @returns {IPbProduct} 产品数据
|
|
10451
|
-
*/
|
|
10452
|
-
function clearAddAndTakeAndAdjustBaoeData(productData) {
|
|
10453
|
-
if (!productData) {
|
|
10454
|
-
return productData;
|
|
10455
|
-
}
|
|
10456
|
-
if (!productData.mulInsOrderList) {
|
|
10457
|
-
return productData;
|
|
10458
|
-
}
|
|
10459
|
-
productData.adjustBaoeData = null;
|
|
10460
|
-
productData.mulInsOrderList.forEach(function (ins) {
|
|
10461
|
-
if (ins.accountData && ins.accountData.addAndTakeData) {
|
|
10462
|
-
ins.accountData.addAndTakeData.forEach(function (aat) {
|
|
10463
|
-
aat.adjustData = [];
|
|
10464
|
-
});
|
|
10465
|
-
}
|
|
10466
|
-
if (ins.reduceBaof) {
|
|
10467
|
-
if (ins.reduceBaofData) {
|
|
10468
|
-
ins.reduceBaofData.addAndTakeData.forEach(function (aat) {
|
|
10469
|
-
aat.adjustData = [];
|
|
10470
|
-
});
|
|
10471
|
-
}
|
|
10472
|
-
if (ins.duplicateReduceBaofData) {
|
|
10473
|
-
ins.duplicateReduceBaofData.addAndTakeData.forEach(function (aat) {
|
|
10474
|
-
aat.adjustData = [];
|
|
10475
|
-
});
|
|
10476
|
-
}
|
|
10477
|
-
}
|
|
10478
|
-
});
|
|
10479
|
-
return productData;
|
|
10480
|
-
}
|
|
10481
|
-
|
|
10482
|
-
function showLoading() {
|
|
10483
|
-
if (IS_CPPOC_HOST) {
|
|
10484
|
-
_Toast.loading({
|
|
10485
|
-
message: '加载中...',
|
|
10486
|
-
forbidClick: true
|
|
10487
|
-
});
|
|
10488
|
-
} else if (window.appBridge && window.appBridge.showLoading) {
|
|
10489
|
-
window.appBridge.showLoading();
|
|
10490
|
-
}
|
|
10491
|
-
}
|
|
10492
|
-
function hideLoading() {
|
|
10493
|
-
if (IS_CPPOC_HOST) {
|
|
10494
|
-
_Toast.clear();
|
|
10495
|
-
} else if (window.appBridge && window.appBridge.hideLoading) {
|
|
10496
|
-
window.appBridge.hideLoading();
|
|
10497
|
-
}
|
|
10498
|
-
}
|
|
10499
|
-
|
|
10500
|
-
// 创建axios实例
|
|
10501
|
-
var service = axios.create({
|
|
10502
|
-
baseURL: APP_HOSTNAME,
|
|
10503
|
-
withCredentials: true,
|
|
10504
|
-
timeout: 10000,
|
|
10505
|
-
// 请求超时时间
|
|
10506
|
-
headers: {
|
|
10507
|
-
'X-Requested-With': 'XMLHttpRequest'
|
|
10508
|
-
}
|
|
10509
|
-
});
|
|
10510
|
-
var loadingTimer = null;
|
|
10511
|
-
var loading = function loading(show) {
|
|
10512
|
-
if (show) {
|
|
10513
|
-
showLoading();
|
|
10514
|
-
} else {
|
|
10515
|
-
hideLoading();
|
|
10516
|
-
}
|
|
10517
|
-
};
|
|
10518
|
-
|
|
10519
|
-
// request拦截器
|
|
10520
|
-
service.interceptors.request.use(function (config) {
|
|
10521
|
-
if (loadingTimer) clearTimeout(loadingTimer);
|
|
10522
|
-
loadingTimer = setTimeout(function () {
|
|
10523
|
-
loading(true);
|
|
10524
|
-
}, 300);
|
|
10525
|
-
return config;
|
|
10526
|
-
}, function (error) {
|
|
10527
|
-
// Do something with request error
|
|
10528
|
-
console.log(error); // for debug
|
|
10529
|
-
Promise.reject(error);
|
|
10530
|
-
});
|
|
10531
|
-
|
|
10532
|
-
// respone拦截器
|
|
10533
|
-
service.interceptors.response.use(function (response) {
|
|
10534
|
-
if (loadingTimer) clearTimeout(loadingTimer);
|
|
10535
|
-
loading(false);
|
|
10536
|
-
var res = response.data;
|
|
10537
|
-
if (res.code === 401 || res.status === 401) {
|
|
10538
|
-
// gotoLogin()
|
|
10539
|
-
return Promise.reject('login');
|
|
10540
|
-
}
|
|
10541
|
-
return res;
|
|
10542
|
-
}, function (error) {
|
|
10543
|
-
if (loadingTimer) clearTimeout(loadingTimer);
|
|
10544
|
-
loading(false);
|
|
10545
|
-
if (error.response && error.response.status == 401) {
|
|
10546
|
-
// gotoLogin()
|
|
10547
|
-
return Promise.reject('login');
|
|
10548
|
-
}
|
|
10549
|
-
console.log('err' + error); // for debug
|
|
10550
|
-
return Promise.reject(error);
|
|
10551
|
-
});
|
|
10552
9510
|
|
|
10553
|
-
var _dec$2, _dec2$2, _dec3$2, _dec4$2, _dec5$2, _dec6$2, _dec7, _dec8, _dec9, _dec0, _dec1, _dec10, _class$2, _class2$2, _descriptor$2, _descriptor2$2, _descriptor3$2, _descriptor4$1, _descriptor5$1, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _descriptor0;
|
|
9511
|
+
var _dec$2, _dec2$2, _dec3$2, _dec4$2, _dec5$2, _dec6$2, _dec7$1, _dec8, _dec9, _dec0, _dec1, _dec10, _class$2, _class2$2, _descriptor$2, _descriptor2$2, _descriptor3$2, _descriptor4$1, _descriptor5$1, _descriptor6$1, _descriptor7, _descriptor8, _descriptor9, _descriptor0;
|
|
10554
9512
|
function _callSuper$2(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct$2() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
10555
9513
|
function _isNativeReflectConstruct$2() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct$2 = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
10556
9514
|
var BxtTitleItem = (_dec$2 = Component({
|
|
@@ -10565,7 +9523,7 @@
|
|
|
10565
9523
|
default: ''
|
|
10566
9524
|
}), _dec6$2 = Prop({
|
|
10567
9525
|
default: ''
|
|
10568
|
-
}), _dec7 = Prop({
|
|
9526
|
+
}), _dec7$1 = Prop({
|
|
10569
9527
|
default: ''
|
|
10570
9528
|
}), _dec8 = Prop({
|
|
10571
9529
|
default: ''
|
|
@@ -10592,7 +9550,7 @@
|
|
|
10592
9550
|
_initializerDefineProperty(_this, "isShowCrmPerson", _descriptor3$2, _this);
|
|
10593
9551
|
_initializerDefineProperty(_this, "label", _descriptor4$1, _this);
|
|
10594
9552
|
_initializerDefineProperty(_this, "code", _descriptor5$1, _this);
|
|
10595
|
-
_initializerDefineProperty(_this, "huomianTag", _descriptor6, _this);
|
|
9553
|
+
_initializerDefineProperty(_this, "huomianTag", _descriptor6$1, _this);
|
|
10596
9554
|
_initializerDefineProperty(_this, "statusTag", _descriptor7, _this);
|
|
10597
9555
|
_initializerDefineProperty(_this, "huomianTips", _descriptor8, _this);
|
|
10598
9556
|
_initializerDefineProperty(_this, "disabled", _descriptor9, _this);
|
|
@@ -10655,7 +9613,7 @@
|
|
|
10655
9613
|
enumerable: true,
|
|
10656
9614
|
writable: true,
|
|
10657
9615
|
initializer: null
|
|
10658
|
-
}), _descriptor6 = _applyDecoratedDescriptor(_class2$2.prototype, "huomianTag", [_dec7], {
|
|
9616
|
+
}), _descriptor6$1 = _applyDecoratedDescriptor(_class2$2.prototype, "huomianTag", [_dec7$1], {
|
|
10659
9617
|
configurable: true,
|
|
10660
9618
|
enumerable: true,
|
|
10661
9619
|
writable: true,
|
|
@@ -10883,6 +9841,7 @@
|
|
|
10883
9841
|
|
|
10884
9842
|
/* script */
|
|
10885
9843
|
var __vue_script__$5 = script$3;
|
|
9844
|
+
|
|
10886
9845
|
/* template */
|
|
10887
9846
|
var __vue_render__$5 = function __vue_render__() {
|
|
10888
9847
|
var _vm = this;
|
|
@@ -10961,29 +9920,6 @@
|
|
|
10961
9920
|
staticRenderFns: __vue_staticRenderFns__$5
|
|
10962
9921
|
}, __vue_inject_styles__$5, __vue_script__$5);
|
|
10963
9922
|
|
|
10964
|
-
//
|
|
10965
|
-
//
|
|
10966
|
-
//
|
|
10967
|
-
//
|
|
10968
|
-
//
|
|
10969
|
-
//
|
|
10970
|
-
//
|
|
10971
|
-
//
|
|
10972
|
-
//
|
|
10973
|
-
//
|
|
10974
|
-
//
|
|
10975
|
-
//
|
|
10976
|
-
//
|
|
10977
|
-
//
|
|
10978
|
-
//
|
|
10979
|
-
//
|
|
10980
|
-
//
|
|
10981
|
-
//
|
|
10982
|
-
//
|
|
10983
|
-
//
|
|
10984
|
-
//
|
|
10985
|
-
//
|
|
10986
|
-
|
|
10987
9923
|
function initPickerConfig() {
|
|
10988
9924
|
return {
|
|
10989
9925
|
visible: false,
|
|
@@ -11092,6 +10028,7 @@
|
|
|
11092
10028
|
|
|
11093
10029
|
/* script */
|
|
11094
10030
|
var __vue_script__$4 = script$2;
|
|
10031
|
+
|
|
11095
10032
|
/* template */
|
|
11096
10033
|
var __vue_render__$4 = function __vue_render__() {
|
|
11097
10034
|
var _vm = this;
|
|
@@ -11171,7 +10108,7 @@
|
|
|
11171
10108
|
if (arguments.length === 0) {
|
|
11172
10109
|
return null;
|
|
11173
10110
|
}
|
|
11174
|
-
var format = cFormat
|
|
10111
|
+
var format = cFormat;
|
|
11175
10112
|
var date;
|
|
11176
10113
|
if (time === null) {
|
|
11177
10114
|
return;
|
|
@@ -11306,6 +10243,7 @@
|
|
|
11306
10243
|
|
|
11307
10244
|
/* script */
|
|
11308
10245
|
var __vue_script__$3 = script$1;
|
|
10246
|
+
|
|
11309
10247
|
/* template */
|
|
11310
10248
|
var __vue_render__$3 = function __vue_render__() {
|
|
11311
10249
|
var _vm = this;
|
|
@@ -11491,6 +10429,7 @@
|
|
|
11491
10429
|
|
|
11492
10430
|
/* script */
|
|
11493
10431
|
var __vue_script__$2 = script;
|
|
10432
|
+
|
|
11494
10433
|
/* template */
|
|
11495
10434
|
var __vue_render__$2 = function __vue_render__() {
|
|
11496
10435
|
var _vm = this;
|
|
@@ -11581,7 +10520,7 @@
|
|
|
11581
10520
|
_this = _callSuper$1(this, BxtCrmPersonPop, [].concat(args));
|
|
11582
10521
|
_defineProperty$1(_this, "title", '');
|
|
11583
10522
|
_defineProperty$1(_this, "currentValue", false);
|
|
11584
|
-
_defineProperty$1(_this, "currentPersonData",
|
|
10523
|
+
_defineProperty$1(_this, "currentPersonData", lodash.cloneDeep(_this.personData));
|
|
11585
10524
|
_defineProperty$1(_this, "canImportCrm", !!(window.appBridge && window.appBridge.checkAppFeature('CRM_IMPORT')));
|
|
11586
10525
|
_initializerDefineProperty(_this, "value", _descriptor$1, _this);
|
|
11587
10526
|
_initializerDefineProperty(_this, "personData", _descriptor2$1, _this);
|
|
@@ -11680,7 +10619,7 @@
|
|
|
11680
10619
|
key: "setCrmPersonData",
|
|
11681
10620
|
value: function setCrmPersonData(info) {
|
|
11682
10621
|
var self = this;
|
|
11683
|
-
var copyPersonData =
|
|
10622
|
+
var copyPersonData = lodash.cloneDeep(self.currentPersonData);
|
|
11684
10623
|
var isImportSuccess = true;
|
|
11685
10624
|
copyPersonData.cid = info.cid;
|
|
11686
10625
|
copyPersonData.eleOrderList.map(function (ele) {
|
|
@@ -11945,7 +10884,7 @@
|
|
|
11945
10884
|
staticRenderFns: __vue_staticRenderFns__$1
|
|
11946
10885
|
}, __vue_inject_styles__$1, __vue_script__$1);
|
|
11947
10886
|
|
|
11948
|
-
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5;
|
|
10887
|
+
var _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6;
|
|
11949
10888
|
function _callSuper(t, o, e) { return o = _getPrototypeOf(o), _possibleConstructorReturn(t, _isNativeReflectConstruct() ? Reflect.construct(o, e || [], _getPrototypeOf(t).constructor) : o.apply(t, e)); }
|
|
11950
10889
|
function _isNativeReflectConstruct() { try { var t = !Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); } catch (t) {} return (_isNativeReflectConstruct = function _isNativeReflectConstruct() { return !!t; })(); }
|
|
11951
10890
|
var BxtPersonInfo = (_dec = Component({
|
|
@@ -11974,6 +10913,10 @@
|
|
|
11974
10913
|
return {};
|
|
11975
10914
|
}
|
|
11976
10915
|
}), _dec6 = Prop({
|
|
10916
|
+
default: function _default() {
|
|
10917
|
+
return {};
|
|
10918
|
+
}
|
|
10919
|
+
}), _dec7 = Prop({
|
|
11977
10920
|
default: false
|
|
11978
10921
|
}), _dec(_class = (_class2 = /*#__PURE__*/function (_Vue) {
|
|
11979
10922
|
function BxtPersonInfo() {
|
|
@@ -11984,11 +10927,12 @@
|
|
|
11984
10927
|
}
|
|
11985
10928
|
_this = _callSuper(this, BxtPersonInfo, [].concat(args));
|
|
11986
10929
|
_defineProperty$1(_this, "isShowCrmPersonPop", false);
|
|
11987
|
-
_initializerDefineProperty(_this, "
|
|
11988
|
-
_initializerDefineProperty(_this, "
|
|
11989
|
-
_initializerDefineProperty(_this, "
|
|
11990
|
-
_initializerDefineProperty(_this, "
|
|
11991
|
-
_initializerDefineProperty(_this, "
|
|
10930
|
+
_initializerDefineProperty(_this, "user", _descriptor, _this);
|
|
10931
|
+
_initializerDefineProperty(_this, "inputData", _descriptor2, _this);
|
|
10932
|
+
_initializerDefineProperty(_this, "verifyData", _descriptor3, _this);
|
|
10933
|
+
_initializerDefineProperty(_this, "personData", _descriptor4, _this);
|
|
10934
|
+
_initializerDefineProperty(_this, "params", _descriptor5, _this);
|
|
10935
|
+
_initializerDefineProperty(_this, "isShowCrmPerson", _descriptor6, _this);
|
|
11992
10936
|
return _this;
|
|
11993
10937
|
}
|
|
11994
10938
|
_inherits(BxtPersonInfo, _Vue);
|
|
@@ -12044,18 +10988,13 @@
|
|
|
12044
10988
|
var ele,
|
|
12045
10989
|
inputData,
|
|
12046
10990
|
personData,
|
|
12047
|
-
verifyData,
|
|
12048
|
-
params,
|
|
12049
10991
|
allPersonsData,
|
|
12050
|
-
productGroupList,
|
|
12051
|
-
eventTarget,
|
|
12052
|
-
promises,
|
|
12053
10992
|
_args = arguments;
|
|
12054
10993
|
return _regeneratorRuntime.wrap(function (_context) {
|
|
12055
10994
|
while (1) switch (_context.prev = _context.next) {
|
|
12056
10995
|
case 0:
|
|
12057
10996
|
ele = _args.length > 0 && _args[0] !== undefined ? _args[0] : {};
|
|
12058
|
-
inputData = this.inputData, personData = this.personData
|
|
10997
|
+
inputData = this.inputData, personData = this.personData;
|
|
12059
10998
|
if (inputData) {
|
|
12060
10999
|
_context.next = 1;
|
|
12061
11000
|
break;
|
|
@@ -12063,41 +11002,19 @@
|
|
|
12063
11002
|
return _context.abrupt("return");
|
|
12064
11003
|
case 1:
|
|
12065
11004
|
allPersonsData = inputData.personData;
|
|
12066
|
-
|
|
12067
|
-
|
|
12068
|
-
|
|
12069
|
-
|
|
12070
|
-
|
|
12071
|
-
|
|
12072
|
-
_context.next = 2;
|
|
12073
|
-
break;
|
|
12074
|
-
}
|
|
12075
|
-
personDataHandler(allPersonsData);
|
|
12076
|
-
if (personData.key === 'applicantInfo') {
|
|
12077
|
-
if (ele.key === 'applicantAndInsuredSame' && !ele.value) {
|
|
12078
|
-
personData.cid = null;
|
|
11005
|
+
if (allPersonsData) {
|
|
11006
|
+
personDataHandler(allPersonsData);
|
|
11007
|
+
if (personData.key === 'applicantInfo') {
|
|
11008
|
+
if (ele.key === 'applicantAndInsuredSame' && !ele.value) {
|
|
11009
|
+
personData.cid = null;
|
|
11010
|
+
}
|
|
12079
11011
|
}
|
|
12080
11012
|
}
|
|
12081
|
-
promises = [];
|
|
12082
|
-
productGroupList.filter(function (g) {
|
|
12083
|
-
return g.prodOrderList;
|
|
12084
|
-
}).forEach(function (g) {
|
|
12085
|
-
g.prodOrderList.map(function (p) {
|
|
12086
|
-
clearAddAndTakeAndAdjustBaoeData(p);
|
|
12087
|
-
promises.push(productDataHandler(p, lodash.get(verifyData, "[".concat(p.key, "]")), allPersonsData, {
|
|
12088
|
-
planbookId: lodash.get(params, 'planbookId'),
|
|
12089
|
-
eventTarget: eventTarget
|
|
12090
|
-
}));
|
|
12091
|
-
});
|
|
12092
|
-
});
|
|
12093
|
-
_context.next = 2;
|
|
12094
|
-
return Promise.all(promises);
|
|
12095
|
-
case 2:
|
|
12096
11013
|
if (personData.key && ele.key && !['age'].includes(ele.key)) {
|
|
12097
11014
|
window.WeiyiStatSDK && window.WeiyiStatSDK.submit("".concat(personData.key, "_").concat(ele.key));
|
|
12098
11015
|
}
|
|
12099
11016
|
this.$emit('change', personData, ele);
|
|
12100
|
-
case
|
|
11017
|
+
case 2:
|
|
12101
11018
|
case "end":
|
|
12102
11019
|
return _context.stop();
|
|
12103
11020
|
}
|
|
@@ -12139,27 +11056,32 @@
|
|
|
12139
11056
|
return false;
|
|
12140
11057
|
}
|
|
12141
11058
|
}]);
|
|
12142
|
-
}(Vue), _descriptor = _applyDecoratedDescriptor(_class2.prototype, "
|
|
11059
|
+
}(Vue), _descriptor = _applyDecoratedDescriptor(_class2.prototype, "user", [_dec2], {
|
|
12143
11060
|
configurable: true,
|
|
12144
11061
|
enumerable: true,
|
|
12145
11062
|
writable: true,
|
|
12146
11063
|
initializer: null
|
|
12147
|
-
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "
|
|
11064
|
+
}), _descriptor2 = _applyDecoratedDescriptor(_class2.prototype, "inputData", [_dec3], {
|
|
12148
11065
|
configurable: true,
|
|
12149
11066
|
enumerable: true,
|
|
12150
11067
|
writable: true,
|
|
12151
11068
|
initializer: null
|
|
12152
|
-
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "
|
|
11069
|
+
}), _descriptor3 = _applyDecoratedDescriptor(_class2.prototype, "verifyData", [_dec4], {
|
|
12153
11070
|
configurable: true,
|
|
12154
11071
|
enumerable: true,
|
|
12155
11072
|
writable: true,
|
|
12156
11073
|
initializer: null
|
|
12157
|
-
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "
|
|
11074
|
+
}), _descriptor4 = _applyDecoratedDescriptor(_class2.prototype, "personData", [_dec5], {
|
|
12158
11075
|
configurable: true,
|
|
12159
11076
|
enumerable: true,
|
|
12160
11077
|
writable: true,
|
|
12161
11078
|
initializer: null
|
|
12162
|
-
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "
|
|
11079
|
+
}), _descriptor5 = _applyDecoratedDescriptor(_class2.prototype, "params", [_dec6], {
|
|
11080
|
+
configurable: true,
|
|
11081
|
+
enumerable: true,
|
|
11082
|
+
writable: true,
|
|
11083
|
+
initializer: null
|
|
11084
|
+
}), _descriptor6 = _applyDecoratedDescriptor(_class2.prototype, "isShowCrmPerson", [_dec7], {
|
|
12163
11085
|
configurable: true,
|
|
12164
11086
|
enumerable: true,
|
|
12165
11087
|
writable: true,
|
|
@@ -12168,6 +11090,7 @@
|
|
|
12168
11090
|
|
|
12169
11091
|
/* script */
|
|
12170
11092
|
var __vue_script__ = BxtPersonInfo;
|
|
11093
|
+
|
|
12171
11094
|
/* template */
|
|
12172
11095
|
var __vue_render__ = function __vue_render__() {
|
|
12173
11096
|
var _vm = this;
|