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