bxs-tools-ui 2.0.7 → 3.0.0-1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (89) hide show
  1. package/README.md +9 -8
  2. package/es/add-and-take/index.css +1 -0
  3. package/es/add-and-take/index.js +2877 -0
  4. package/es/adjust-baoe/index.css +1 -0
  5. package/es/adjust-baoe/index.js +1717 -0
  6. package/es/business-card/index.css +1 -0
  7. package/es/business-card/index.js +616 -0
  8. package/es/canvas-poster/index.css +1 -0
  9. package/es/canvas-poster/index.js +698 -0
  10. package/es/index.css +1 -0
  11. package/es/index.js +39458 -0
  12. package/es/insure-calculate/index.css +1 -0
  13. package/es/insure-calculate/index.js +31180 -0
  14. package/es/person-info/index.css +1 -0
  15. package/es/person-info/index.js +4240 -0
  16. package/es/product-info/index.css +1 -0
  17. package/es/product-info/index.js +4570 -0
  18. package/es/utils/index.js +3160 -0
  19. package/lib/add-and-take/index.css +1 -702
  20. package/lib/add-and-take/index.js +2641 -25431
  21. package/lib/adjust-baoe/index.css +1 -281
  22. package/lib/adjust-baoe/index.js +1534 -27044
  23. package/lib/business-card/index.css +1 -179
  24. package/lib/business-card/index.js +515 -1361
  25. package/lib/canvas-poster/index.css +1 -84
  26. package/lib/canvas-poster/index.js +594 -1414
  27. package/lib/index.css +1 -2538
  28. package/lib/index.js +36329 -40571
  29. package/lib/insure-calculate/index.css +1 -510
  30. package/lib/insure-calculate/index.js +28980 -25191
  31. package/lib/person-info/index.css +1 -562
  32. package/lib/person-info/index.js +3881 -27346
  33. package/lib/product-info/index.css +1 -510
  34. package/lib/product-info/index.js +4235 -34572
  35. package/lib/utils/index.js +3199 -0
  36. package/package.json +47 -18
  37. package/packages/add-and-take/components/interest-form.css +4 -3
  38. package/packages/add-and-take/components/interest-form.vue +11 -36
  39. package/packages/add-and-take/components/interest-items.css +1 -1
  40. package/packages/add-and-take/components/interest-table.css +46 -93
  41. package/packages/add-and-take/components/interest-table.vue +37 -196
  42. package/packages/add-and-take/demo/index.vue +86 -96
  43. package/packages/add-and-take/handler.ts +9 -8
  44. package/packages/add-and-take/index.css +3 -2
  45. package/packages/add-and-take/index.vue +7 -28
  46. package/packages/add-and-take/readme.md +17 -33
  47. package/packages/adjust-baoe/demo/index.vue +63 -66
  48. package/packages/adjust-baoe/index.css +21 -29
  49. package/packages/adjust-baoe/index.vue +41 -54
  50. package/packages/adjust-baoe/readme.md +52 -87
  51. package/packages/business-card/demo/index.vue +2 -11
  52. package/packages/business-card/index.css +1 -0
  53. package/packages/business-card/readme.md +36 -16
  54. package/packages/bxs-utils/index.ts +7 -0
  55. package/packages/bxs-utils/planbook/insurance.ts +5 -5
  56. package/packages/bxs-utils/planbook/product.ts +2 -1
  57. package/packages/canvas-poster/readme.md +86 -66
  58. package/packages/index.ts +52 -0
  59. package/packages/insure-calculate/demo/index.vue +22 -8
  60. package/packages/insure-calculate/index.css +8 -6
  61. package/packages/insure-calculate/index.vue +189 -146
  62. package/packages/insure-calculate/readme.md +1 -1
  63. package/packages/person-info/{crm-person.vue → crm-popup.vue} +117 -108
  64. package/packages/person-info/demo/index.vue +2 -1
  65. package/packages/person-info/index.vue +117 -130
  66. package/packages/person-info/readme.md +5 -8
  67. package/packages/planbook-input/components/product-table.css +2 -0
  68. package/packages/planbook-input/components/product-table.vue +38 -16
  69. package/packages/planbook-input/index.css +4 -1
  70. package/packages/planbook-input/index.vue +12 -9
  71. package/packages/product-info/demo/index.vue +4 -2
  72. package/packages/product-info/index.css +131 -116
  73. package/packages/product-info/index.vue +130 -145
  74. package/packages/product-info/readme.md +1 -2
  75. package/src/components/common/common-age-birthday.vue +205 -0
  76. package/{packages/components/common-popup/index.vue → src/components/common/common-popup.vue} +40 -25
  77. package/src/components/common/common-radio.vue +175 -0
  78. package/src/components/common/common-select.vue +132 -0
  79. package/{packages/components/form-item/title-item.css → src/components/common/common-title.css} +13 -5
  80. package/{packages/components/form-item/title-item.vue → src/components/common/common-title.vue} +6 -21
  81. package/src/js/request.js +3 -3
  82. package/src/style/apply.css +25 -0
  83. package/src/style/base.css +0 -28
  84. package/packages/components/common-radio.vue +0 -142
  85. package/packages/components/form-item/age-birthday-item.vue +0 -183
  86. package/packages/components/form-item/select-item.vue +0 -110
  87. package/packages/person-info/crm-person.css +0 -57
  88. package/packages/person-info/index.css +0 -51
  89. package/src/index.ts +0 -48
@@ -0,0 +1,2877 @@
1
+ import 'vant/lib/dialog/index.css';
2
+ import _Dialog from 'vant/lib/dialog';
3
+ import 'vant/lib/toast/index.css';
4
+ import _Toast from 'vant/lib/toast';
5
+ import 'vant/lib/index.css';
6
+ import _Vant from 'vant/lib';
7
+ import Vue from 'vue';
8
+ import { memoize, cloneDeep, get } from 'lodash';
9
+ import QS from 'qs';
10
+ import 'vant/lib/icon/index.css';
11
+ import _Icon from 'vant/lib/icon';
12
+
13
+ function _typeof$1(o) {
14
+ "@babel/helpers - typeof";
15
+
16
+ return _typeof$1 = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
17
+ return typeof o;
18
+ } : function (o) {
19
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
20
+ }, _typeof$1(o);
21
+ }
22
+
23
+ function toPrimitive(t, r) {
24
+ if ("object" != _typeof$1(t) || !t) return t;
25
+ var e = t[Symbol.toPrimitive];
26
+ if (void 0 !== e) {
27
+ var i = e.call(t, r);
28
+ if ("object" != _typeof$1(i)) return i;
29
+ throw new TypeError("@@toPrimitive must return a primitive value.");
30
+ }
31
+ return ("string" === r ? String : Number)(t);
32
+ }
33
+
34
+ function toPropertyKey(t) {
35
+ var i = toPrimitive(t, "string");
36
+ return "symbol" == _typeof$1(i) ? i : i + "";
37
+ }
38
+
39
+ function _defineProperty(e, r, t) {
40
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
41
+ value: t,
42
+ enumerable: true,
43
+ configurable: true,
44
+ writable: true
45
+ }) : e[r] = t, e;
46
+ }
47
+
48
+ function asyncGeneratorStep(n, t, e, r, o, a, c) {
49
+ try {
50
+ var i = n[a](c),
51
+ u = i.value;
52
+ } catch (n) {
53
+ return void e(n);
54
+ }
55
+ i.done ? t(u) : Promise.resolve(u).then(r, o);
56
+ }
57
+ function _asyncToGenerator(n) {
58
+ return function () {
59
+ var t = this,
60
+ e = arguments;
61
+ return new Promise(function (r, o) {
62
+ var a = n.apply(t, e);
63
+ function _next(n) {
64
+ asyncGeneratorStep(a, r, o, _next, _throw, "next", n);
65
+ }
66
+ function _throw(n) {
67
+ asyncGeneratorStep(a, r, o, _next, _throw, "throw", n);
68
+ }
69
+ _next(void 0);
70
+ });
71
+ };
72
+ }
73
+
74
+ function getDefaultExportFromCjs (x) {
75
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, 'default') ? x['default'] : x;
76
+ }
77
+
78
+ var regeneratorRuntime$1 = {exports: {}};
79
+
80
+ var OverloadYield = {exports: {}};
81
+
82
+ var hasRequiredOverloadYield;
83
+
84
+ function requireOverloadYield () {
85
+ if (hasRequiredOverloadYield) return OverloadYield.exports;
86
+ hasRequiredOverloadYield = 1;
87
+ (function (module) {
88
+ function _OverloadYield(e, d) {
89
+ this.v = e, this.k = d;
90
+ }
91
+ module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports;
92
+ } (OverloadYield));
93
+ return OverloadYield.exports;
94
+ }
95
+
96
+ var regenerator$1 = {exports: {}};
97
+
98
+ var regeneratorDefine = {exports: {}};
99
+
100
+ var hasRequiredRegeneratorDefine;
101
+
102
+ function requireRegeneratorDefine () {
103
+ if (hasRequiredRegeneratorDefine) return regeneratorDefine.exports;
104
+ hasRequiredRegeneratorDefine = 1;
105
+ (function (module) {
106
+ function _regeneratorDefine(e, r, n, t) {
107
+ var i = Object.defineProperty;
108
+ try {
109
+ i({}, "", {});
110
+ } catch (e) {
111
+ i = 0;
112
+ }
113
+ module.exports = _regeneratorDefine = function regeneratorDefine(e, r, n, t) {
114
+ function o(r, n) {
115
+ _regeneratorDefine(e, r, function (e) {
116
+ return this._invoke(r, n, e);
117
+ });
118
+ }
119
+ r ? i ? i(e, r, {
120
+ value: n,
121
+ enumerable: !t,
122
+ configurable: !t,
123
+ writable: !t
124
+ }) : e[r] = n : (o("next", 0), o("throw", 1), o("return", 2));
125
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports, _regeneratorDefine(e, r, n, t);
126
+ }
127
+ module.exports = _regeneratorDefine, module.exports.__esModule = true, module.exports["default"] = module.exports;
128
+ } (regeneratorDefine));
129
+ return regeneratorDefine.exports;
130
+ }
131
+
132
+ var hasRequiredRegenerator$1;
133
+
134
+ function requireRegenerator$1 () {
135
+ if (hasRequiredRegenerator$1) return regenerator$1.exports;
136
+ hasRequiredRegenerator$1 = 1;
137
+ (function (module) {
138
+ var regeneratorDefine = requireRegeneratorDefine();
139
+ function _regenerator() {
140
+ /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/babel/babel/blob/main/packages/babel-helpers/LICENSE */
141
+ var e,
142
+ t,
143
+ r = "function" == typeof Symbol ? Symbol : {},
144
+ n = r.iterator || "@@iterator",
145
+ o = r.toStringTag || "@@toStringTag";
146
+ function i(r, n, o, i) {
147
+ var c = n && n.prototype instanceof Generator ? n : Generator,
148
+ u = Object.create(c.prototype);
149
+ return regeneratorDefine(u, "_invoke", function (r, n, o) {
150
+ var i,
151
+ c,
152
+ u,
153
+ f = 0,
154
+ p = o || [],
155
+ y = false,
156
+ G = {
157
+ p: 0,
158
+ n: 0,
159
+ v: e,
160
+ a: d,
161
+ f: d.bind(e, 4),
162
+ d: function d(t, r) {
163
+ return i = t, c = 0, u = e, G.n = r, a;
164
+ }
165
+ };
166
+ function d(r, n) {
167
+ for (c = r, u = n, t = 0; !y && f && !o && t < p.length; t++) {
168
+ var o,
169
+ i = p[t],
170
+ d = G.p,
171
+ l = i[2];
172
+ r > 3 ? (o = l === n) && (u = i[(c = i[4]) ? 5 : (c = 3, 3)], i[4] = i[5] = e) : i[0] <= d && ((o = r < 2 && d < i[1]) ? (c = 0, G.v = n, G.n = i[1]) : d < l && (o = r < 3 || i[0] > n || n > l) && (i[4] = r, i[5] = n, G.n = l, c = 0));
173
+ }
174
+ if (o || r > 1) return a;
175
+ throw y = true, n;
176
+ }
177
+ return function (o, p, l) {
178
+ if (f > 1) throw TypeError("Generator is already running");
179
+ for (y && 1 === p && d(p, l), c = p, u = l; (t = c < 2 ? e : u) || !y;) {
180
+ i || (c ? c < 3 ? (c > 1 && (G.n = -1), d(c, u)) : G.n = u : G.v = u);
181
+ try {
182
+ if (f = 2, i) {
183
+ if (c || (o = "next"), t = i[o]) {
184
+ if (!(t = t.call(i, u))) throw TypeError("iterator result is not an object");
185
+ if (!t.done) return t;
186
+ u = t.value, c < 2 && (c = 0);
187
+ } else 1 === c && (t = i["return"]) && t.call(i), c < 2 && (u = TypeError("The iterator does not provide a '" + o + "' method"), c = 1);
188
+ i = e;
189
+ } else if ((t = (y = G.n < 0) ? u : r.call(n, G)) !== a) break;
190
+ } catch (t) {
191
+ i = e, c = 1, u = t;
192
+ } finally {
193
+ f = 1;
194
+ }
195
+ }
196
+ return {
197
+ value: t,
198
+ done: y
199
+ };
200
+ };
201
+ }(r, o, i), true), u;
202
+ }
203
+ var a = {};
204
+ function Generator() {}
205
+ function GeneratorFunction() {}
206
+ function GeneratorFunctionPrototype() {}
207
+ t = Object.getPrototypeOf;
208
+ var c = [][n] ? t(t([][n]())) : (regeneratorDefine(t = {}, n, function () {
209
+ return this;
210
+ }), t),
211
+ u = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(c);
212
+ function f(e) {
213
+ return Object.setPrototypeOf ? Object.setPrototypeOf(e, GeneratorFunctionPrototype) : (e.__proto__ = GeneratorFunctionPrototype, regeneratorDefine(e, o, "GeneratorFunction")), e.prototype = Object.create(u), e;
214
+ }
215
+ return GeneratorFunction.prototype = GeneratorFunctionPrototype, regeneratorDefine(u, "constructor", GeneratorFunctionPrototype), regeneratorDefine(GeneratorFunctionPrototype, "constructor", GeneratorFunction), GeneratorFunction.displayName = "GeneratorFunction", regeneratorDefine(GeneratorFunctionPrototype, o, "GeneratorFunction"), regeneratorDefine(u), regeneratorDefine(u, o, "Generator"), regeneratorDefine(u, n, function () {
216
+ return this;
217
+ }), regeneratorDefine(u, "toString", function () {
218
+ return "[object Generator]";
219
+ }), (module.exports = _regenerator = function _regenerator() {
220
+ return {
221
+ w: i,
222
+ m: f
223
+ };
224
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
225
+ }
226
+ module.exports = _regenerator, module.exports.__esModule = true, module.exports["default"] = module.exports;
227
+ } (regenerator$1));
228
+ return regenerator$1.exports;
229
+ }
230
+
231
+ var regeneratorAsync = {exports: {}};
232
+
233
+ var regeneratorAsyncGen = {exports: {}};
234
+
235
+ var regeneratorAsyncIterator = {exports: {}};
236
+
237
+ var hasRequiredRegeneratorAsyncIterator;
238
+
239
+ function requireRegeneratorAsyncIterator () {
240
+ if (hasRequiredRegeneratorAsyncIterator) return regeneratorAsyncIterator.exports;
241
+ hasRequiredRegeneratorAsyncIterator = 1;
242
+ (function (module) {
243
+ var OverloadYield = requireOverloadYield();
244
+ var regeneratorDefine = requireRegeneratorDefine();
245
+ function AsyncIterator(t, e) {
246
+ function n(r, o, i, f) {
247
+ try {
248
+ var c = t[r](o),
249
+ u = c.value;
250
+ return u instanceof OverloadYield ? e.resolve(u.v).then(function (t) {
251
+ n("next", t, i, f);
252
+ }, function (t) {
253
+ n("throw", t, i, f);
254
+ }) : e.resolve(u).then(function (t) {
255
+ c.value = t, i(c);
256
+ }, function (t) {
257
+ return n("throw", t, i, f);
258
+ });
259
+ } catch (t) {
260
+ f(t);
261
+ }
262
+ }
263
+ var r;
264
+ this.next || (regeneratorDefine(AsyncIterator.prototype), regeneratorDefine(AsyncIterator.prototype, "function" == typeof Symbol && Symbol.asyncIterator || "@asyncIterator", function () {
265
+ return this;
266
+ })), regeneratorDefine(this, "_invoke", function (t, o, i) {
267
+ function f() {
268
+ return new e(function (e, r) {
269
+ n(t, i, e, r);
270
+ });
271
+ }
272
+ return r = r ? r.then(f, f) : f();
273
+ }, true);
274
+ }
275
+ module.exports = AsyncIterator, module.exports.__esModule = true, module.exports["default"] = module.exports;
276
+ } (regeneratorAsyncIterator));
277
+ return regeneratorAsyncIterator.exports;
278
+ }
279
+
280
+ var hasRequiredRegeneratorAsyncGen;
281
+
282
+ function requireRegeneratorAsyncGen () {
283
+ if (hasRequiredRegeneratorAsyncGen) return regeneratorAsyncGen.exports;
284
+ hasRequiredRegeneratorAsyncGen = 1;
285
+ (function (module) {
286
+ var regenerator = requireRegenerator$1();
287
+ var regeneratorAsyncIterator = requireRegeneratorAsyncIterator();
288
+ function _regeneratorAsyncGen(r, e, t, o, n) {
289
+ return new regeneratorAsyncIterator(regenerator().w(r, e, t, o), n || Promise);
290
+ }
291
+ module.exports = _regeneratorAsyncGen, module.exports.__esModule = true, module.exports["default"] = module.exports;
292
+ } (regeneratorAsyncGen));
293
+ return regeneratorAsyncGen.exports;
294
+ }
295
+
296
+ var hasRequiredRegeneratorAsync;
297
+
298
+ function requireRegeneratorAsync () {
299
+ if (hasRequiredRegeneratorAsync) return regeneratorAsync.exports;
300
+ hasRequiredRegeneratorAsync = 1;
301
+ (function (module) {
302
+ var regeneratorAsyncGen = requireRegeneratorAsyncGen();
303
+ function _regeneratorAsync(n, e, r, t, o) {
304
+ var a = regeneratorAsyncGen(n, e, r, t, o);
305
+ return a.next().then(function (n) {
306
+ return n.done ? n.value : a.next();
307
+ });
308
+ }
309
+ module.exports = _regeneratorAsync, module.exports.__esModule = true, module.exports["default"] = module.exports;
310
+ } (regeneratorAsync));
311
+ return regeneratorAsync.exports;
312
+ }
313
+
314
+ var regeneratorKeys = {exports: {}};
315
+
316
+ var hasRequiredRegeneratorKeys;
317
+
318
+ function requireRegeneratorKeys () {
319
+ if (hasRequiredRegeneratorKeys) return regeneratorKeys.exports;
320
+ hasRequiredRegeneratorKeys = 1;
321
+ (function (module) {
322
+ function _regeneratorKeys(e) {
323
+ var n = Object(e),
324
+ r = [];
325
+ for (var t in n) r.unshift(t);
326
+ return function e() {
327
+ for (; r.length;) if ((t = r.pop()) in n) return e.value = t, e.done = false, e;
328
+ return e.done = true, e;
329
+ };
330
+ }
331
+ module.exports = _regeneratorKeys, module.exports.__esModule = true, module.exports["default"] = module.exports;
332
+ } (regeneratorKeys));
333
+ return regeneratorKeys.exports;
334
+ }
335
+
336
+ var regeneratorValues = {exports: {}};
337
+
338
+ var _typeof = {exports: {}};
339
+
340
+ var hasRequired_typeof;
341
+
342
+ function require_typeof () {
343
+ if (hasRequired_typeof) return _typeof.exports;
344
+ hasRequired_typeof = 1;
345
+ (function (module) {
346
+ function _typeof(o) {
347
+ "@babel/helpers - typeof";
348
+
349
+ return module.exports = _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {
350
+ return typeof o;
351
+ } : function (o) {
352
+ return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
353
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof(o);
354
+ }
355
+ module.exports = _typeof, module.exports.__esModule = true, module.exports["default"] = module.exports;
356
+ } (_typeof));
357
+ return _typeof.exports;
358
+ }
359
+
360
+ var hasRequiredRegeneratorValues;
361
+
362
+ function requireRegeneratorValues () {
363
+ if (hasRequiredRegeneratorValues) return regeneratorValues.exports;
364
+ hasRequiredRegeneratorValues = 1;
365
+ (function (module) {
366
+ var _typeof = require_typeof()["default"];
367
+ function _regeneratorValues(e) {
368
+ if (null != e) {
369
+ var t = e["function" == typeof Symbol && Symbol.iterator || "@@iterator"],
370
+ r = 0;
371
+ if (t) return t.call(e);
372
+ if ("function" == typeof e.next) return e;
373
+ if (!isNaN(e.length)) return {
374
+ next: function next() {
375
+ return e && r >= e.length && (e = void 0), {
376
+ value: e && e[r++],
377
+ done: !e
378
+ };
379
+ }
380
+ };
381
+ }
382
+ throw new TypeError(_typeof(e) + " is not iterable");
383
+ }
384
+ module.exports = _regeneratorValues, module.exports.__esModule = true, module.exports["default"] = module.exports;
385
+ } (regeneratorValues));
386
+ return regeneratorValues.exports;
387
+ }
388
+
389
+ var hasRequiredRegeneratorRuntime;
390
+
391
+ function requireRegeneratorRuntime () {
392
+ if (hasRequiredRegeneratorRuntime) return regeneratorRuntime$1.exports;
393
+ hasRequiredRegeneratorRuntime = 1;
394
+ (function (module) {
395
+ var OverloadYield = requireOverloadYield();
396
+ var regenerator = requireRegenerator$1();
397
+ var regeneratorAsync = requireRegeneratorAsync();
398
+ var regeneratorAsyncGen = requireRegeneratorAsyncGen();
399
+ var regeneratorAsyncIterator = requireRegeneratorAsyncIterator();
400
+ var regeneratorKeys = requireRegeneratorKeys();
401
+ var regeneratorValues = requireRegeneratorValues();
402
+ function _regeneratorRuntime() {
403
+
404
+ var r = regenerator(),
405
+ e = r.m(_regeneratorRuntime),
406
+ t = (Object.getPrototypeOf ? Object.getPrototypeOf(e) : e.__proto__).constructor;
407
+ function n(r) {
408
+ var e = "function" == typeof r && r.constructor;
409
+ return !!e && (e === t || "GeneratorFunction" === (e.displayName || e.name));
410
+ }
411
+ var o = {
412
+ "throw": 1,
413
+ "return": 2,
414
+ "break": 3,
415
+ "continue": 3
416
+ };
417
+ function a(r) {
418
+ var e, t;
419
+ return function (n) {
420
+ e || (e = {
421
+ stop: function stop() {
422
+ return t(n.a, 2);
423
+ },
424
+ "catch": function _catch() {
425
+ return n.v;
426
+ },
427
+ abrupt: function abrupt(r, e) {
428
+ return t(n.a, o[r], e);
429
+ },
430
+ delegateYield: function delegateYield(r, o, a) {
431
+ return e.resultName = o, t(n.d, regeneratorValues(r), a);
432
+ },
433
+ finish: function finish(r) {
434
+ return t(n.f, r);
435
+ }
436
+ }, t = function t(r, _t, o) {
437
+ n.p = e.prev, n.n = e.next;
438
+ try {
439
+ return r(_t, o);
440
+ } finally {
441
+ e.next = n.n;
442
+ }
443
+ }), e.resultName && (e[e.resultName] = n.v, e.resultName = void 0), e.sent = n.v, e.next = n.n;
444
+ try {
445
+ return r.call(this, e);
446
+ } finally {
447
+ n.p = e.prev, n.n = e.next;
448
+ }
449
+ };
450
+ }
451
+ return (module.exports = _regeneratorRuntime = function _regeneratorRuntime() {
452
+ return {
453
+ wrap: function wrap(e, t, n, o) {
454
+ return r.w(a(e), t, n, o && o.reverse());
455
+ },
456
+ isGeneratorFunction: n,
457
+ mark: r.m,
458
+ awrap: function awrap(r, e) {
459
+ return new OverloadYield(r, e);
460
+ },
461
+ AsyncIterator: regeneratorAsyncIterator,
462
+ async: function async(r, e, t, o, u) {
463
+ return (n(e) ? regeneratorAsyncGen : regeneratorAsync)(a(r), e, t, o, u);
464
+ },
465
+ keys: regeneratorKeys,
466
+ values: regeneratorValues
467
+ };
468
+ }, module.exports.__esModule = true, module.exports["default"] = module.exports)();
469
+ }
470
+ module.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports["default"] = module.exports;
471
+ } (regeneratorRuntime$1));
472
+ return regeneratorRuntime$1.exports;
473
+ }
474
+
475
+ var regenerator;
476
+ var hasRequiredRegenerator;
477
+
478
+ function requireRegenerator () {
479
+ if (hasRequiredRegenerator) return regenerator;
480
+ hasRequiredRegenerator = 1;
481
+ // TODO(Babel 8): Remove this file.
482
+
483
+ var runtime = requireRegeneratorRuntime()();
484
+ regenerator = runtime;
485
+
486
+ // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=
487
+ try {
488
+ regeneratorRuntime = runtime;
489
+ } catch (accidentalStrictMode) {
490
+ if (typeof globalThis === "object") {
491
+ globalThis.regeneratorRuntime = runtime;
492
+ } else {
493
+ Function("r", "regeneratorRuntime = r")(runtime);
494
+ }
495
+ }
496
+ return regenerator;
497
+ }
498
+
499
+ var regeneratorExports = requireRegenerator();
500
+ const _regeneratorRuntime = /*@__PURE__*/getDefaultExportFromCjs(regeneratorExports);
501
+
502
+ var hostname = window && window.location && window.location.hostname || '';
503
+ var IS_PRODUCT_ENV = hostname.search(/(winbaoxian|ai-baoxiaozhu)\.com/) !== -1;
504
+ hostname.search(/(winbaoxian|ai-baoxiaozhu)\.cn/) !== -1;
505
+ hostname.search(/localhost|192\.168|127\.0\.0\.1|dev\.winbaoxian\.cn/) !== -1;
506
+ var IS_UAT_ENV = hostname.includes("pbf-uat.");
507
+ var IS_ENABLE_DEBUG = !IS_PRODUCT_ENV;
508
+ if (IS_ENABLE_DEBUG) {
509
+ console.error("\u975E\u7EBF\u4E0A\u73AF\u5883\uFF0C\u9ED8\u8BA4\u5F00\u542F\u8C03\u8BD5\u6A21\u5F0F");
510
+ }
511
+ var topDomain = IS_PRODUCT_ENV ? 'com' : 'cn';
512
+ var secondDomain = hostname.includes('ai-baoxiaozhu') ? 'ai-baoxiaozhu' : 'winbaoxian';
513
+ var MAIN_DOMAIN = "".concat(secondDomain, ".").concat(topDomain);
514
+ var APP_HOSTNAME = "https://app.".concat(MAIN_DOMAIN);
515
+ var PLANBOOK_API_HOSTNAME = "https://bxs-planbook-api".concat(IS_UAT_ENV ? '-uat' : '', ".").concat(MAIN_DOMAIN);
516
+ getUrlParams();
517
+ function getUrlParams(url) {
518
+ var _url = location.search || '';
519
+ var _searchStr = _url.split('?')[1];
520
+ return _searchStr ? QS.parse(_searchStr) : {};
521
+ }
522
+
523
+ var apiBaseUrl = "".concat(PLANBOOK_API_HOSTNAME, "/planBook");
524
+ function initInsuranceInterest(reqParams) {
525
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
526
+ var scene = options.scene;
527
+ var apis = {
528
+ init: "".concat(apiBaseUrl, "/interest/init"),
529
+ init4: "".concat(apiBaseUrl, "/public/interest/product/init"),
530
+ init5: "".concat(apiBaseUrl, "/insurance/compare/draw/init")
531
+ };
532
+ var api = apis["init".concat([4, 5].includes(scene) ? scene : '')];
533
+ appBridge.showLoading();
534
+ return fetch(api, {
535
+ method: 'POST',
536
+ credentials: 'include',
537
+ headers: {
538
+ Accept: 'application/json, text/plain, */*',
539
+ 'Content-Type': 'application/json;'
540
+ },
541
+ body: JSON.stringify(reqParams)
542
+ }).then(function (response) {
543
+ return response.json();
544
+ }).then(function (_ref) {
545
+ var success = _ref.success,
546
+ data = _ref.data,
547
+ info = _ref.info;
548
+ if (!success || !data) {
549
+ return Promise.reject(info);
550
+ }
551
+ return Promise.resolve(data);
552
+ }).finally(function () {
553
+ appBridge.hideLoading();
554
+ });
555
+ }
556
+ function getInsuranceInterestDetail(reqParams) {
557
+ var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
558
+ var scene = options.scene,
559
+ isReduceBaof = options.isReduceBaof;
560
+ var apis = {
561
+ addAndTake: "".concat(apiBaseUrl, "/interest/addAndTake/detail"),
562
+ addAndTake4: "".concat(apiBaseUrl, "/public/interest/addAndTake/detail"),
563
+ addAndTake5: "".concat(apiBaseUrl, "/interest/addAndTake/detail"),
564
+ draw: "".concat(apiBaseUrl, "/interest/draw/detail"),
565
+ draw4: "".concat(apiBaseUrl, "/public/interest/draw/detail"),
566
+ draw5: "".concat(apiBaseUrl, "/insurance/compare/draw/detail")
567
+ };
568
+ var _type = isReduceBaof ? 'draw' : 'addAndTake';
569
+ var api = apis["".concat(_type).concat([4, 5].includes(scene) ? scene : '')];
570
+ appBridge.showLoading();
571
+ return fetch(api, {
572
+ method: 'POST',
573
+ credentials: 'include',
574
+ headers: {
575
+ Accept: 'application/json, text/plain, */*',
576
+ 'Content-Type': 'application/json;'
577
+ },
578
+ body: JSON.stringify(reqParams)
579
+ }).then(function (response) {
580
+ return response.json();
581
+ }).then(function (res) {
582
+ var success = res.success,
583
+ data = res.data;
584
+ if (!success || !data) {
585
+ return Promise.reject(res);
586
+ }
587
+ return Promise.resolve(data);
588
+ }).finally(function () {
589
+ appBridge.hideLoading();
590
+ });
591
+ }
592
+
593
+ var PURPOSE_OPTIONS = [{
594
+ val: '教育金',
595
+ desc: '教育金'
596
+ }, {
597
+ val: '婚嫁金',
598
+ desc: '婚嫁金'
599
+ }, {
600
+ val: '创业金',
601
+ desc: '创业金'
602
+ }, {
603
+ val: '养老金',
604
+ desc: '养老金'
605
+ }, {
606
+ val: '祝寿金',
607
+ desc: '祝寿金'
608
+ }, {
609
+ val: '应急金',
610
+ desc: '应急金'
611
+ }, {
612
+ val: '旅游金',
613
+ desc: '旅游金'
614
+ }, {
615
+ val: '投资金',
616
+ desc: '投资金'
617
+ }, {
618
+ val: '',
619
+ desc: '自定义'
620
+ }];
621
+
622
+ /**
623
+ * 将数值转换为千分位
624
+ * @author Lizhao <lz@winbaoxian.com>
625
+ * @date 2024-09-10
626
+ * @param {*} n 数值
627
+ * @returns 千分位字符串
628
+ */
629
+ function formatNumberToThousand(n) {
630
+ if (n !== 0 && !n) {
631
+ return '';
632
+ }
633
+ var number = Number(n);
634
+ if (isNaN(number)) {
635
+ return n;
636
+ }
637
+ return number.toLocaleString('zh-CN');
638
+ }
639
+
640
+ /**
641
+ * **多被保人,获取并缓存多个险种信息的费率信息**
642
+ * @author Lizhao <lz@winbaoxian.com>
643
+ * @date 2023-12-28
644
+ * @param { any } params 必传。接口请求信息
645
+ * @returns {Promise<any>} 产品下所有险种的费率
646
+ */
647
+ memoize(function (params) {
648
+ var url = "".concat(APP_HOSTNAME, "/planBook/input/insurance/verifyData");
649
+ return fetch(url, {
650
+ method: 'POST',
651
+ credentials: 'include',
652
+ headers: {
653
+ Accept: 'application/json, text/plain, */*',
654
+ 'Content-Type': 'application/json;'
655
+ },
656
+ body: JSON.stringify(params)
657
+ }).then(function (response) {
658
+ return response.json();
659
+ }).then(function (_ref) {
660
+ var success = _ref.success,
661
+ data = _ref.data;
662
+ if (!success || !data) {
663
+ return Promise.reject();
664
+ }
665
+ return Promise.resolve(data);
666
+ }).catch(function () {});
667
+ }, function (params) {
668
+ return QS.stringify(params);
669
+ });
670
+
671
+ if (document && document.cookie && document.cookie.match('LIZHAO_DEBUG_CONSOLE_FLAG=1')) {
672
+ window.DEBUG_TEMP_CONSOLE_FLAG = true;
673
+ }
674
+
675
+ //
676
+ //
677
+ //
678
+ //
679
+ //
680
+ //
681
+ //
682
+ //
683
+ //
684
+ //
685
+ //
686
+ //
687
+ //
688
+ //
689
+ //
690
+ //
691
+ //
692
+ //
693
+ //
694
+ //
695
+ //
696
+ //
697
+ //
698
+ //
699
+ //
700
+ //
701
+ //
702
+ //
703
+ //
704
+ //
705
+ //
706
+ //
707
+ //
708
+ //
709
+
710
+ const script$4 = {
711
+ name: 'CommonRadio',
712
+ props: {
713
+ value: {
714
+ type: [String, Number],
715
+ default: null
716
+ },
717
+ border: Boolean,
718
+ options: {
719
+ type: Array,
720
+ default: function _default() {
721
+ return [];
722
+ }
723
+ },
724
+ dataStatId: {
725
+ type: String,
726
+ default: ''
727
+ }
728
+ },
729
+ computed: {
730
+ cValue: {
731
+ get: function get() {
732
+ return this.value;
733
+ },
734
+ set: function set(v) {
735
+ this.$emit('input', v);
736
+ }
737
+ },
738
+ convertOptions: function convertOptions() {
739
+ var $attrs = this.$attrs,
740
+ options = this.options,
741
+ value = this.value;
742
+ return (options || []).map(function (o) {
743
+ return {
744
+ value: [o.value, o.val].find(function (v) {
745
+ return v !== undefined;
746
+ }),
747
+ name: o.name || o.desc
748
+ };
749
+ }).filter(function (o) {
750
+ return o.value === value || !$attrs.disabled;
751
+ });
752
+ },
753
+ listeners: function listeners() {
754
+ // van-field 的 v-model,会将绑定的值自动转换为 string 类型
755
+ // 所以不取 van-field 的 input 事件
756
+ var listeners = {};
757
+ if (this.$listeners) {
758
+ for (var k in this.$listeners) {
759
+ if (k !== 'input') {
760
+ listeners[k] = this.$listeners[k];
761
+ }
762
+ }
763
+ }
764
+ return listeners;
765
+ }
766
+ },
767
+ methods: {
768
+ onClickItem: function onClickItem(option) {
769
+ var $attrs = this.$attrs;
770
+ if ($attrs.disabled || option.isDisabled) {
771
+ return;
772
+ }
773
+ this.$emit('input', option.value);
774
+ }
775
+ }
776
+ };
777
+
778
+ function normalizeComponent(template, style, script, scopeId, isFunctionalTemplate, moduleIdentifier /* server only */, shadowMode, createInjector, createInjectorSSR, createInjectorShadow) {
779
+ // Vue.extend constructor export interop.
780
+ const options = typeof script === 'function' ? script.options : script;
781
+ // render functions
782
+ if (template && template.render) {
783
+ options.render = template.render;
784
+ options.staticRenderFns = template.staticRenderFns;
785
+ options._compiled = true;
786
+ }
787
+ return script;
788
+ }
789
+
790
+ /* script */
791
+ var __vue_script__$4 = script$4;
792
+ /* template */
793
+ var __vue_render__$4 = function __vue_render__() {
794
+ var _vm = this;
795
+ var _h = _vm.$createElement;
796
+ var _c = _vm._self._c || _h;
797
+ return _c('van-field', _vm._g(_vm._b({
798
+ class: ['bxt_common_field_radio', _vm.border ? '' : 'bxt_border'],
799
+ attrs: {
800
+ "value": _vm.value,
801
+ "autocomplete": "off"
802
+ },
803
+ scopedSlots: _vm._u([{
804
+ key: "input",
805
+ fn: function fn() {
806
+ return [_c('div', {
807
+ staticClass: "bxt_common_form_radio",
808
+ class: {
809
+ disabled: _vm.$attrs.disabled
810
+ }
811
+ }, [_vm.border ? _vm._l(_vm.convertOptions, function (option) {
812
+ return _c('span', {
813
+ key: option.value,
814
+ staticClass: "bxt_common_form_radio_item",
815
+ class: {
816
+ disabled: option.isDisabled,
817
+ active: option.value === _vm.value
818
+ },
819
+ attrs: {
820
+ "data-stat-id": _vm.dataStatId
821
+ },
822
+ on: {
823
+ "click": function click($event) {
824
+ return _vm.onClickItem(option);
825
+ }
826
+ }
827
+ }, [_vm._v("\n " + _vm._s(option.name) + "\n ")]);
828
+ }) : _c('van-radio-group', {
829
+ attrs: {
830
+ "direction": "horizontal",
831
+ "input-align": "right",
832
+ "disabled": _vm.$attrs.disabled
833
+ },
834
+ model: {
835
+ value: _vm.cValue,
836
+ callback: function callback($$v) {
837
+ _vm.cValue = $$v;
838
+ },
839
+ expression: "cValue"
840
+ }
841
+ }, _vm._l(_vm.convertOptions, function (option) {
842
+ return _c('van-radio', {
843
+ key: option.value,
844
+ attrs: {
845
+ "name": option.value,
846
+ "disabled": option.isDisabled
847
+ }
848
+ }, [_vm._v("\n " + _vm._s(option.name) + "\n ")]);
849
+ }), 1)], 2)];
850
+ },
851
+ proxy: true
852
+ }])
853
+ }, 'van-field', _vm.$attrs, false), _vm.listeners));
854
+ };
855
+ var __vue_staticRenderFns__$4 = [];
856
+
857
+ /* style */
858
+ var __vue_inject_styles__$4 = undefined;
859
+ /* style inject */
860
+
861
+ /* style inject SSR */
862
+
863
+ /* style inject shadow dom */
864
+
865
+ var __vue_component__$4 = /*#__PURE__*/normalizeComponent({
866
+ render: __vue_render__$4,
867
+ staticRenderFns: __vue_staticRenderFns__$4
868
+ }, __vue_inject_styles__$4, __vue_script__$4);
869
+
870
+ function initPickerConfig() {
871
+ return {
872
+ key: '',
873
+ visible: false,
874
+ title: '',
875
+ columns: [],
876
+ element: null
877
+ };
878
+ }
879
+ const script$3 = {
880
+ filters: {
881
+ filterOption: function filterOption(value, list) {
882
+ var option = list.find(function (o) {
883
+ return o.val === value;
884
+ });
885
+ return option ? option.desc : '';
886
+ }
887
+ },
888
+ components: _defineProperty(_defineProperty({}, _Icon.name, _Icon), "CommonRadio", __vue_component__$4),
889
+ props: {
890
+ type: String,
891
+ formData: Object,
892
+ insuredAge: Number,
893
+ minTakeYear: Number,
894
+ rate: Number,
895
+ addAndTakeRecordData: {
896
+ type: Object,
897
+ default: function _default() {
898
+ return {};
899
+ }
900
+ },
901
+ interestInitData: {
902
+ type: Object,
903
+ default: function _default() {
904
+ return {};
905
+ }
906
+ },
907
+ addAndTakeDetailData: {
908
+ type: Array,
909
+ default: function _default() {
910
+ return [];
911
+ }
912
+ },
913
+ knowledgeData: Array
914
+ },
915
+ data: function data() {
916
+ return {
917
+ formValues: cloneDeep(this.formData),
918
+ pickerConfig: initPickerConfig(),
919
+ PURPOSE_OPTIONS: PURPOSE_OPTIONS
920
+ };
921
+ },
922
+ computed: {
923
+ beginYearOptions: function beginYearOptions() {
924
+ return this.getBeginYearOptions();
925
+ },
926
+ minReservedAmount: function minReservedAmount() {
927
+ var knowledgeData = this.knowledgeData;
928
+ var drawLeft = (knowledgeData || []).find(function (e) {
929
+ return e.key === 'draw_left';
930
+ });
931
+ var drawLeftValue = Number(get(drawLeft, 'value'));
932
+ return drawLeftValue || 0;
933
+ },
934
+ maxAvailableAmount: function maxAvailableAmount() {
935
+ var type = this.type,
936
+ formValues = this.formValues,
937
+ knowledgeData = this.knowledgeData;
938
+ var maxAmount = null;
939
+ if (formValues.type === 'take') {
940
+ if (type === 'reduceBaof') {
941
+ maxAmount = this.getMaxReduceAmount();
942
+ }
943
+ if (['addAndTake', 'take'].includes(type)) {
944
+ maxAmount = this.getMaxTakeAmount();
945
+ }
946
+ }
947
+ if (maxAmount) {
948
+ // 最大可领取金额:小于最低领取金额时,展示为 0;有倍数限制时,清理求余数值
949
+ var drawMin = (knowledgeData || []).find(function (e) {
950
+ return e.key === 'draw_min';
951
+ });
952
+ var rateLimit = (knowledgeData || []).find(function (e) {
953
+ return e.key === 'rate_limit';
954
+ });
955
+ if (drawMin && drawMin.value) {
956
+ if (maxAmount < Number(drawMin.value)) {
957
+ maxAmount = 0;
958
+ }
959
+ }
960
+ if (rateLimit && rateLimit.value) {
961
+ maxAmount = Number((Math.floor(maxAmount / rateLimit.value) * rateLimit.value).toFixed(0));
962
+ }
963
+ }
964
+ return maxAmount;
965
+ },
966
+ maxAvailableAmountTips: function maxAvailableAmountTips() {
967
+ var maxAvailableAmount = this.maxAvailableAmount;
968
+ return maxAvailableAmount === null ? '' : "\u6700\u5927\u9886\u53D6\u91D1\u989D\uFF1A".concat(formatNumberToThousand(maxAvailableAmount), "\u5143");
969
+ },
970
+ adjustData: function adjustData() {
971
+ var insuredAge = this.insuredAge;
972
+ var header = {
973
+ index: '序号',
974
+ typeName: '类型',
975
+ age: '年龄(岁)',
976
+ baof: '金额(元)',
977
+ purpose: '用途',
978
+ operate: '操作'
979
+ };
980
+ var addAndTakeData = get(this, 'addAndTakeRecordData.addAndTakeData') || [];
981
+ var body = [];
982
+ addAndTakeData.filter(function (item) {
983
+ return (item.adjustData || []).length;
984
+ }).forEach(function (item) {
985
+ item.adjustData.forEach(function (ele) {
986
+ var ageStr = ele[0] === ele[1] ? ele[0] + insuredAge : "".concat(ele[0] + insuredAge, "-").concat(ele[1] + insuredAge);
987
+ var record = {
988
+ type: item.key,
989
+ typeName: {
990
+ take: '领取',
991
+ add: '追加'
992
+ }[item.key] || '',
993
+ index: body.length + 1,
994
+ age: ageStr,
995
+ baof: formatNumberToThousand(ele[2]),
996
+ purpose: ele[3],
997
+ operate: 'delete',
998
+ beginYear: ele[0],
999
+ endYear: ele[1]
1000
+ };
1001
+ body.push(record);
1002
+ });
1003
+ });
1004
+ return body.length ? [header].concat(body) : [];
1005
+ },
1006
+ hasAdjustData: function hasAdjustData() {
1007
+ return !!this.adjustData.length;
1008
+ },
1009
+ limitRules: function limitRules() {
1010
+ var knowledgeData = this.knowledgeData;
1011
+ var rules = [];
1012
+ knowledgeData.filter(function (e) {
1013
+ return ['start_time', 'draw_max', 'draw_left'].includes(e.key) && e.remark;
1014
+ }).forEach(function (e, i) {
1015
+ rules.push("".concat(i + 1, ".").concat(e.name, "\uFF1A").concat(e.remark || ''));
1016
+ });
1017
+ return rules;
1018
+ }
1019
+ },
1020
+ created: function created() {
1021
+ this.formValues = this.initFormValues(this.formData);
1022
+ },
1023
+ methods: {
1024
+ initFormValues: function initFormValues(formData) {
1025
+ var beginYearOptions = this.beginYearOptions;
1026
+ var type = formData.type,
1027
+ beginYear = formData.beginYear;
1028
+ var option0 = beginYearOptions.find(function (o) {
1029
+ return o.val === beginYear;
1030
+ }) || beginYearOptions[0];
1031
+ if (!beginYearOptions.some(function (o) {
1032
+ return o.val === beginYear;
1033
+ }) && beginYearOptions.some(function (o) {
1034
+ return o.val > beginYear;
1035
+ })) {
1036
+ option0 = beginYearOptions.find(function (o) {
1037
+ return o.val > beginYear;
1038
+ });
1039
+ }
1040
+ var _beginYear = get(option0, 'val');
1041
+ return {
1042
+ type: type,
1043
+ beginYear: _beginYear,
1044
+ endYear: _beginYear,
1045
+ baof: null,
1046
+ purpose: '',
1047
+ customPurpose: ''
1048
+ };
1049
+ },
1050
+ // 获取减保领取的最大可领金额
1051
+ getMaxReduceAmount: function getMaxReduceAmount() {
1052
+ var addAndTakeRecordData = this.addAndTakeRecordData,
1053
+ addAndTakeDetailData = this.addAndTakeDetailData,
1054
+ formValues = this.formValues,
1055
+ minReservedAmount = this.minReservedAmount;
1056
+ var beginYear = formValues.beginYear,
1057
+ endYear = formValues.endYear;
1058
+ var takeAdjustData = (get(addAndTakeRecordData, 'addAndTakeData') || []).find(function (e) {
1059
+ return e.key === 'take';
1060
+ });
1061
+ var adjustData = get(takeAdjustData, 'adjustData') || [];
1062
+ var cashValueDetail = (addAndTakeDetailData || [])[0];
1063
+ var cashValueValues = get(cashValueDetail, 'values') || [];
1064
+ var drawMaxDetail = (addAndTakeDetailData || []).find(function (d) {
1065
+ return d.key === 'draw_max';
1066
+ });
1067
+ var drawMaxValues = get(drawMaxDetail, 'values') || [];
1068
+ var maxAvailableAmount = null;
1069
+ if (cashValueValues.length) {
1070
+ var values = [];
1071
+ for (var y = beginYear; y <= endYear; y++) {
1072
+ var index = y - 1;
1073
+ if (index >= 0 && index <= cashValueValues.length - 1) {
1074
+ values.push(cashValueValues[index]);
1075
+ }
1076
+ }
1077
+ var maxHadReduceYear = Math.max.apply(null, adjustData.map(function (ad) {
1078
+ return ad[1];
1079
+ })) || 0;
1080
+ var maxReduceYear = Math.max(maxHadReduceYear, endYear);
1081
+ var maxReduceCaseValue = cashValueValues[maxReduceYear - 1];
1082
+ // 最低保留份数 = minReservedAmount / maxReduceCaseValue
1083
+ var minRetainedNum = maxReduceCaseValue ? minReservedAmount / maxReduceCaseValue : 0;
1084
+
1085
+ // 剩余可领取份数:1-最低保留份数,再遍历已领取数据,剩余份数-当年已领取金额/当年现价
1086
+ var remainderNum = 1 - (minRetainedNum || 0);
1087
+ var remainderNumArr = [];
1088
+ adjustData.forEach(function (adjust) {
1089
+ for (var y1 = adjust[0]; y1 <= adjust[1]; y1++) {
1090
+ var index1 = y1 - 1;
1091
+ if (index1 >= 0 && index1 <= cashValueValues.length - 1) {
1092
+ var currentCashValue = cashValueValues[index1];
1093
+ if (currentCashValue) {
1094
+ remainderNum = remainderNum - adjust[2] / currentCashValue;
1095
+ remainderNumArr.push(remainderNum);
1096
+ }
1097
+ }
1098
+ }
1099
+ });
1100
+
1101
+ // 即将领取系数:遍历已领取数据,1-当年已领取金额/当年现价
1102
+ var willTakeCoefficient = 0;
1103
+ var willTakeCoefficientArr = [];
1104
+ var _loop = function _loop(_y) {
1105
+ var currentCashValue = cashValueValues[_y - 1];
1106
+ var drawMaxValue = drawMaxValues[_y - 1];
1107
+ // 当前年度已领取的金额
1108
+ var currentYearHadReduceAmount = 0;
1109
+ if (_y >= beginYear && _y <= endYear) {
1110
+ if (currentCashValue) {
1111
+ willTakeCoefficient = willTakeCoefficient + 1 / currentCashValue;
1112
+ willTakeCoefficientArr.push(willTakeCoefficient);
1113
+ }
1114
+ adjustData.forEach(function (adjust) {
1115
+ if (adjust[0] <= _y && _y <= adjust[1]) {
1116
+ currentYearHadReduceAmount = adjust[2];
1117
+ }
1118
+ });
1119
+ }
1120
+
1121
+ // 最大可领取金额1:剩余可领取份数 / 即将领取系数
1122
+ var maxAvailableAmount1 = remainderNum / willTakeCoefficient;
1123
+ // 最大可领取金额2:当前领取期间内的最大可领取值 - 当前年度已领取的金额
1124
+ var maxAvailableAmount2 = drawMaxValue ? drawMaxValue - currentYearHadReduceAmount : Infinity;
1125
+ maxAvailableAmount = Math.min.apply(null, [maxAvailableAmount === null ? Infinity : maxAvailableAmount, maxAvailableAmount1, maxAvailableAmount2]);
1126
+ };
1127
+ for (var _y = beginYear; _y <= maxReduceYear; _y++) {
1128
+ _loop(_y);
1129
+ }
1130
+ }
1131
+ return maxAvailableAmount === null ? null : Math.max(0, Math.floor(Number(maxAvailableAmount.toFixed(6))));
1132
+ },
1133
+ // 获取账户领取的最大可领金额
1134
+ getMaxTakeAmount: function getMaxTakeAmount() {
1135
+ var addAndTakeRecordData = this.addAndTakeRecordData,
1136
+ addAndTakeDetailData = this.addAndTakeDetailData,
1137
+ formValues = this.formValues,
1138
+ minReservedAmount = this.minReservedAmount,
1139
+ rate = this.rate;
1140
+ var beginYear = formValues.beginYear,
1141
+ endYear = formValues.endYear;
1142
+ var takeAdjustData = (get(addAndTakeRecordData, 'addAndTakeData') || []).find(function (e) {
1143
+ return e.key === 'take';
1144
+ });
1145
+ var adjustData = get(takeAdjustData, 'adjustData') || [];
1146
+ var accountValueDetail = (addAndTakeDetailData || []).filter(function (e) {
1147
+ return e.key === 'account_value';
1148
+ })[1];
1149
+ var accountValueValues = get(accountValueDetail, 'values') || [];
1150
+ var takeMaxDetail = (addAndTakeDetailData || []).find(function (d) {
1151
+ return d.key === 'take_make';
1152
+ });
1153
+ var takeMaxValues = get(takeMaxDetail, 'values') || [];
1154
+ var maxAvailableAmount = null;
1155
+ if (accountValueValues.length) {
1156
+ var values = [];
1157
+ for (var year = beginYear; year <= endYear; year++) {
1158
+ var index = year - 1;
1159
+ if (index >= 0 && index <= accountValueValues.length - 1) {
1160
+ values.push(accountValueValues[index]);
1161
+ }
1162
+ }
1163
+ var maxHadTakeYear = Math.max.apply(null, adjustData.map(function (ad) {
1164
+ return ad[1];
1165
+ })) || 0;
1166
+ var maxTakeYear = Math.max(maxHadTakeYear, endYear);
1167
+ if (values.length) {
1168
+ var maxAvailableAmount1 = Infinity;
1169
+ var n = 0;
1170
+ var m = 0;
1171
+ var paramBArr = [];
1172
+ accountValueValues.forEach(function (v, vi) {
1173
+ if (vi >= beginYear - 1 && vi <= maxTakeYear - 1) {
1174
+ var paramA = (v - minReservedAmount) * rate;
1175
+ if (vi <= endYear - 1) {
1176
+ n++;
1177
+ var paramB = Math.pow(1 + rate, n) - 1;
1178
+ maxAvailableAmount1 = Math.min(maxAvailableAmount1, paramA / paramB);
1179
+ paramBArr.push([vi, paramB, maxAvailableAmount1]);
1180
+ } else {
1181
+ m++;
1182
+ var _paramB = Math.pow(1 + rate, n) - 1;
1183
+ var paramC = Math.pow(1 + rate, m);
1184
+ maxAvailableAmount1 = Math.min(maxAvailableAmount1, paramA / (_paramB * paramC));
1185
+ paramBArr.push([vi, _paramB, maxAvailableAmount1, paramA / (_paramB * paramC)]);
1186
+ }
1187
+ }
1188
+ });
1189
+ var maxAvailableAmount2 = Infinity;
1190
+ if (takeMaxValues.length && takeMaxValues[beginYear - 1]) {
1191
+ var beginYearAdjustbaof = 0;
1192
+ adjustData.forEach(function (adjust) {
1193
+ if (adjust[0] <= beginYear && beginYear <= adjust[1]) {
1194
+ beginYearAdjustbaof = adjust[2];
1195
+ }
1196
+ });
1197
+ maxAvailableAmount2 = takeMaxValues[beginYear - 1] - beginYearAdjustbaof;
1198
+ }
1199
+ maxAvailableAmount = Math.min.apply(null, [maxAvailableAmount === null ? Infinity : maxAvailableAmount, maxAvailableAmount1, maxAvailableAmount2]);
1200
+ }
1201
+ }
1202
+ return maxAvailableAmount === null ? null : Math.max(0, Math.floor(Number(maxAvailableAmount.toFixed(6))));
1203
+ },
1204
+ getElementRules: function getElementRules(key) {
1205
+ var knowledgeData = this.knowledgeData,
1206
+ maxAvailableAmount = this.maxAvailableAmount;
1207
+ var rules = [];
1208
+ if (key === 'baof') {
1209
+ rules.push({
1210
+ type: 'number',
1211
+ required: true,
1212
+ message: '请输入金额'
1213
+ });
1214
+ var drawMin = knowledgeData.find(function (e) {
1215
+ return e.key === 'draw_min';
1216
+ });
1217
+ var drawMinValue = Number(get(drawMin, 'value')) || 1;
1218
+ if (maxAvailableAmount) {
1219
+ rules.push({
1220
+ type: 'number',
1221
+ message: "\u8BF7\u8F93\u5165\u4E0D\u5C0F\u4E8E".concat(drawMinValue, "\u7684\u91D1\u989D"),
1222
+ validator: function validator(value) {
1223
+ return Number(value) >= drawMinValue;
1224
+ }
1225
+ });
1226
+ }
1227
+ var rateLimit = knowledgeData.find(function (e) {
1228
+ return e.key === 'rate_limit';
1229
+ });
1230
+ var rateLimitValue = Number(get(rateLimit, 'value'));
1231
+ if (maxAvailableAmount && rateLimitValue) {
1232
+ rules.push({
1233
+ type: 'number',
1234
+ message: "\u8BF7\u8F93\u5165".concat(rateLimitValue, "\u7684\u500D\u6570"),
1235
+ validator: function validator(value) {
1236
+ return !(Number(value) % rateLimitValue);
1237
+ }
1238
+ });
1239
+ }
1240
+ if (maxAvailableAmount !== null) {
1241
+ rules.push({
1242
+ type: 'number',
1243
+ message: "\u6700\u5927\u9886\u53D6\u91D1\u989D\uFF1A".concat(formatNumberToThousand(maxAvailableAmount), "\u5143"),
1244
+ validator: function validator(value) {
1245
+ if (!value) {
1246
+ return true;
1247
+ }
1248
+ return value <= maxAvailableAmount;
1249
+ }
1250
+ });
1251
+ }
1252
+ return rules;
1253
+ }
1254
+ },
1255
+ getBeginYearOptions: function getBeginYearOptions() {
1256
+ this.type;
1257
+ var addAndTakeRecordData = this.addAndTakeRecordData,
1258
+ minTakeYear = this.minTakeYear,
1259
+ insuredAge = this.insuredAge,
1260
+ interestInitData = this.interestInitData,
1261
+ addAndTakeDetailData = this.addAndTakeDetailData,
1262
+ formValues = this.formValues;
1263
+ var options = [];
1264
+ if (interestInitData && addAndTakeDetailData) {
1265
+ var startPolicyNo = interestInitData.startPolicyNo,
1266
+ startIndex = interestInitData.startIndex;
1267
+ var maxLength = addAndTakeDetailData.reduce(function (a, b) {
1268
+ return Math.max(a, b.values.length);
1269
+ }, 0);
1270
+ for (var i = 0; i < maxLength; i++) {
1271
+ var year = i + (startPolicyNo || 1);
1272
+ options.push({
1273
+ val: year,
1274
+ desc: "\u7B2C".concat(year, "\u5E74,").concat(insuredAge + (startIndex || 0) + i + 1, "\u5C81")
1275
+ });
1276
+ }
1277
+ }
1278
+ var takeAdjustData = (get(addAndTakeRecordData, 'addAndTakeData') || []).find(function (e) {
1279
+ return e.key === formValues.type;
1280
+ });
1281
+ var adjustData = get(takeAdjustData, 'adjustData') || [];
1282
+ var hadAddYearSet = new Set();
1283
+ adjustData.forEach(function (item) {
1284
+ for (var _i = item[0]; _i <= item[1]; _i++) {
1285
+ hadAddYearSet.add(_i);
1286
+ }
1287
+ });
1288
+ return options.filter(function (o) {
1289
+ return !minTakeYear || o.val >= minTakeYear;
1290
+ }).filter(function (o) {
1291
+ return !hadAddYearSet.has(o.val);
1292
+ });
1293
+ },
1294
+ onClickOpenYearPicker: function onClickOpenYearPicker(key) {
1295
+ var formValues = this.formValues,
1296
+ beginYearOptions = this.beginYearOptions;
1297
+ if (beginYearOptions.length) {
1298
+ var endYearOptions = [];
1299
+ beginYearOptions.forEach(function (o) {
1300
+ if (o.val === formValues.beginYear) {
1301
+ endYearOptions.push(o);
1302
+ }
1303
+ var lastOption = endYearOptions.length && endYearOptions[endYearOptions.length - 1];
1304
+ if (lastOption) {
1305
+ if (o.val === lastOption.val + 1) {
1306
+ endYearOptions.push(o);
1307
+ }
1308
+ }
1309
+ });
1310
+ var columns = (key === 'beginYear' ? beginYearOptions : endYearOptions).map(function (e) {
1311
+ return {
1312
+ value: e.val,
1313
+ name: e.desc
1314
+ };
1315
+ });
1316
+ var defaultIndex = columns.findIndex(function (o) {
1317
+ return o.value == formValues[key];
1318
+ });
1319
+ this.pickerConfig = {
1320
+ visible: true,
1321
+ key: key,
1322
+ title: "\u8BF7\u9009\u62E9".concat(key === 'beginYear' ? '开始' : '结束', "\u65F6\u95F4"),
1323
+ defaultIndex: defaultIndex,
1324
+ columns: columns
1325
+ };
1326
+ return;
1327
+ }
1328
+ _Toast('全部年度已设置领取,暂无可以设置的领取年度');
1329
+ },
1330
+ onConfirmPicker: function onConfirmPicker(item) {
1331
+ var formValues = this.formValues,
1332
+ pickerConfig = this.pickerConfig;
1333
+ formValues[pickerConfig.key] = item.value;
1334
+ if (formValues.beginYear > formValues.endYear) {
1335
+ formValues.endYear = formValues.beginYear;
1336
+ }
1337
+ this.onCancelPicker();
1338
+ },
1339
+ onCancelPicker: function onCancelPicker() {
1340
+ this.pickerConfig = initPickerConfig();
1341
+ },
1342
+ deleteAdjustData: function deleteAdjustData(item) {
1343
+ if (item.operate === 'delete') {
1344
+ var values = {
1345
+ type: item.type,
1346
+ beginYear: item.beginYear,
1347
+ endYear: item.endYear,
1348
+ baof: null,
1349
+ purpose: '',
1350
+ customPurpose: ''
1351
+ };
1352
+ this.$emit('update', values);
1353
+ }
1354
+ },
1355
+ confirm: function confirm() {
1356
+ var self = this;
1357
+ var $refs = self.$refs,
1358
+ formData = self.formData,
1359
+ formValues = self.formValues;
1360
+ if (!formValues.baof) {
1361
+ return;
1362
+ }
1363
+ return $refs.Form.validate().then(function () {
1364
+ self.$emit('update', cloneDeep(formValues), function () {
1365
+ self.formValues = self.initFormValues(formData);
1366
+ });
1367
+ self.$emit('openTable');
1368
+ }).catch(function () {
1369
+ _Toast('请完善表单信息');
1370
+ });
1371
+ }
1372
+ }
1373
+ };
1374
+
1375
+ /* script */
1376
+ var __vue_script__$3 = script$3;
1377
+ /* template */
1378
+ var __vue_render__$3 = function __vue_render__() {
1379
+ var _vm = this;
1380
+ var _h = _vm.$createElement;
1381
+ var _c = _vm._self._c || _h;
1382
+ return _c('section', {
1383
+ staticClass: "bxt_aat_interest_form"
1384
+ }, [_vm.adjustData.length ? _c('div', {
1385
+ staticClass: "bxt_aatif_adjust"
1386
+ }, [_c('table', _vm._l(_vm.adjustData, function (item) {
1387
+ return _c('tr', {
1388
+ key: JSON.stringify(item)
1389
+ }, [_vm._l(['index', 'typeName', 'age', 'baof', 'purpose', 'operate'], function (key) {
1390
+ return [key === 'operate' && item[key] === 'delete' ? _c('td', {
1391
+ key: JSON.stringify(item) + key,
1392
+ on: {
1393
+ "click": function click($event) {
1394
+ return _vm.deleteAdjustData(item);
1395
+ }
1396
+ }
1397
+ }, [_c('van-icon', {
1398
+ attrs: {
1399
+ "name": "delete-o",
1400
+ "size": 16
1401
+ }
1402
+ })], 1) : _c('td', {
1403
+ key: JSON.stringify(item) + key
1404
+ }, [_vm._v("\n " + _vm._s(item[key]) + "\n ")])];
1405
+ })], 2);
1406
+ }), 0)]) : _vm._e(), _c('van-form', {
1407
+ ref: "Form",
1408
+ staticClass: "bxt_aatif_form",
1409
+ attrs: {
1410
+ "show-error": false,
1411
+ "scroll-to-error": true,
1412
+ "label-width": "6em"
1413
+ }
1414
+ }, [_c('van-field', {
1415
+ attrs: {
1416
+ "label": (['take'].includes(_vm.formValues.type) ? '领取' : '追加') + "开始",
1417
+ "autocomplete": "off"
1418
+ },
1419
+ scopedSlots: _vm._u([{
1420
+ key: "input",
1421
+ fn: function fn() {
1422
+ return [_c('div', {
1423
+ staticClass: "bxt_select",
1424
+ on: {
1425
+ "click": function click($event) {
1426
+ return _vm.onClickOpenYearPicker('beginYear');
1427
+ }
1428
+ }
1429
+ }, [_c('span', {
1430
+ staticClass: "bxt_content"
1431
+ }, [_vm._v("\n " + _vm._s(_vm._f("filterOption")(_vm.formValues.beginYear, _vm.beginYearOptions)) + "\n ")]), _c('van-icon', {
1432
+ attrs: {
1433
+ "name": "arrow",
1434
+ "size": 16
1435
+ }
1436
+ })], 1)];
1437
+ },
1438
+ proxy: true
1439
+ }])
1440
+ }), _c('van-field', {
1441
+ attrs: {
1442
+ "label": (['take'].includes(_vm.formValues.type) ? '领取' : '追加') + "结束",
1443
+ "autocomplete": "off"
1444
+ },
1445
+ scopedSlots: _vm._u([{
1446
+ key: "input",
1447
+ fn: function fn() {
1448
+ return [_c('div', {
1449
+ staticClass: "bxt_select",
1450
+ on: {
1451
+ "click": function click($event) {
1452
+ return _vm.onClickOpenYearPicker('endYear');
1453
+ }
1454
+ }
1455
+ }, [_c('span', {
1456
+ staticClass: "bxt_content"
1457
+ }, [_vm._v("\n " + _vm._s(_vm._f("filterOption")(_vm.formValues.endYear, _vm.beginYearOptions)) + "\n ")]), _c('van-icon', {
1458
+ attrs: {
1459
+ "name": "arrow",
1460
+ "size": 16
1461
+ }
1462
+ })], 1)];
1463
+ },
1464
+ proxy: true
1465
+ }])
1466
+ }), _c('div', {
1467
+ staticClass: "bxt_aatif_form_item baof"
1468
+ }, [_c('van-field', {
1469
+ attrs: {
1470
+ "label": _vm.formValues.type === 'add' ? '追加金额' : '领取金额',
1471
+ "name": "baof",
1472
+ "placeholder": "请输入",
1473
+ "type": "tel",
1474
+ "clearable": "",
1475
+ "maxlength": 9,
1476
+ "rules": _vm.getElementRules('baof'),
1477
+ "error-message-align": "right",
1478
+ "autocomplete": "off"
1479
+ },
1480
+ scopedSlots: _vm._u([{
1481
+ key: "extra",
1482
+ fn: function fn() {
1483
+ return [_c('span', {
1484
+ staticClass: "bxt_aatif_form_item__extra"
1485
+ }, [_vm._v("元")])];
1486
+ },
1487
+ proxy: true
1488
+ }]),
1489
+ model: {
1490
+ value: _vm.formValues.baof,
1491
+ callback: function callback($$v) {
1492
+ _vm.$set(_vm.formValues, "baof", _vm._n($$v));
1493
+ },
1494
+ expression: "formValues.baof"
1495
+ }
1496
+ }), _vm.maxAvailableAmountTips ? _c('div', {
1497
+ staticClass: "bxt_max_baof"
1498
+ }, [_vm._v("\n " + _vm._s(_vm.maxAvailableAmountTips) + "\n ")]) : _vm._e()], 1), ['take'].includes(_vm.formValues.type) ? _c('div', {
1499
+ staticClass: "bxt_aatif_form_item purpose"
1500
+ }, [_c('CommonRadio', {
1501
+ attrs: {
1502
+ "name": "purpose",
1503
+ "label": "用途",
1504
+ "options": _vm.PURPOSE_OPTIONS,
1505
+ "border": "",
1506
+ "input-align": "right"
1507
+ },
1508
+ model: {
1509
+ value: _vm.formValues.purpose,
1510
+ callback: function callback($$v) {
1511
+ _vm.$set(_vm.formValues, "purpose", $$v);
1512
+ },
1513
+ expression: "formValues.purpose"
1514
+ }
1515
+ }), _vm.formValues.purpose === '' ? _c('van-field', {
1516
+ staticClass: "bxt_custom_purpose",
1517
+ attrs: {
1518
+ "name": "customPurpose",
1519
+ "label": " ",
1520
+ "placeholder": "请输入,5个字以内",
1521
+ "maxlength": 5,
1522
+ "clearable": "",
1523
+ "autocomplete": "off"
1524
+ },
1525
+ model: {
1526
+ value: _vm.formValues.customPurpose,
1527
+ callback: function callback($$v) {
1528
+ _vm.$set(_vm.formValues, "customPurpose", $$v);
1529
+ },
1530
+ expression: "formValues.customPurpose"
1531
+ }
1532
+ }) : _vm._e()], 1) : _vm._e()], 1), _c('footer', {
1533
+ staticClass: "bxt_add_and_take_footer"
1534
+ }, [_c('div', {
1535
+ staticClass: "bxt_add_and_take_footer_wrapper"
1536
+ }, [_vm.hasAdjustData ? _c('div', {
1537
+ staticClass: "bxt_item",
1538
+ on: {
1539
+ "click": function click($event) {
1540
+ return _vm.$emit('deleteAll');
1541
+ }
1542
+ }
1543
+ }, [_vm._v("\n 清空\n ")]) : _vm._e(), _c('div', {
1544
+ staticClass: "bxt_item primary",
1545
+ class: {
1546
+ disabled: !_vm.formValues.baof
1547
+ },
1548
+ on: {
1549
+ "click": _vm.confirm
1550
+ }
1551
+ }, [_vm._v("\n 确定\n ")])])]), _vm.limitRules && _vm.limitRules.length ? _c('div', {
1552
+ staticClass: "bxt_take_limit"
1553
+ }, [_c('h5', {
1554
+ staticClass: "bxt_take_limit_title"
1555
+ }, [_vm._v("领取限制")]), _vm._l(_vm.limitRules, function (r) {
1556
+ return _c('p', {
1557
+ key: r,
1558
+ staticClass: "bxt_take_limit_tx"
1559
+ }, [_vm._v("\n " + _vm._s(r) + "\n ")]);
1560
+ })], 2) : _vm._e(), _c('van-popup', {
1561
+ attrs: {
1562
+ "round": "",
1563
+ "position": "bottom",
1564
+ "get-container": "body"
1565
+ },
1566
+ model: {
1567
+ value: _vm.pickerConfig.visible,
1568
+ callback: function callback($$v) {
1569
+ _vm.$set(_vm.pickerConfig, "visible", $$v);
1570
+ },
1571
+ expression: "pickerConfig.visible"
1572
+ }
1573
+ }, [_c('van-picker', {
1574
+ attrs: {
1575
+ "title": _vm.pickerConfig.title,
1576
+ "columns": _vm.pickerConfig.columns,
1577
+ "default-index": _vm.pickerConfig.defaultIndex,
1578
+ "value-key": "name",
1579
+ "show-toolbar": ""
1580
+ },
1581
+ on: {
1582
+ "cancel": _vm.onCancelPicker,
1583
+ "confirm": _vm.onConfirmPicker
1584
+ }
1585
+ })], 1)], 1);
1586
+ };
1587
+ var __vue_staticRenderFns__$3 = [];
1588
+
1589
+ /* style */
1590
+ var __vue_inject_styles__$3 = undefined;
1591
+ /* style inject */
1592
+
1593
+ /* style inject SSR */
1594
+
1595
+ /* style inject shadow dom */
1596
+
1597
+ var __vue_component__$3 = /*#__PURE__*/normalizeComponent({
1598
+ render: __vue_render__$3,
1599
+ staticRenderFns: __vue_staticRenderFns__$3
1600
+ }, __vue_inject_styles__$3, __vue_script__$3);
1601
+
1602
+ function initDefaultAddAndTakeData(type) {
1603
+ var data = {
1604
+ accountPart: type,
1605
+ accountName: '',
1606
+ addAndTakeData: []
1607
+ };
1608
+ if (['addAndTake', 'add'].includes(data.accountPart)) {
1609
+ data.addAndTakeData.push({
1610
+ key: 'add',
1611
+ adjustData: []
1612
+ });
1613
+ }
1614
+ if (['addAndTake', 'take', 'reduceBaof'].includes(data.accountPart)) {
1615
+ data.addAndTakeData.push({
1616
+ key: 'take',
1617
+ adjustData: []
1618
+ });
1619
+ }
1620
+ return data;
1621
+ }
1622
+ function initInterestData(data) {
1623
+ if (!data) {
1624
+ return data;
1625
+ }
1626
+ for (var k in data) {
1627
+ if (!data[k]) {
1628
+ continue;
1629
+ }
1630
+ if (k === 'bonus') {
1631
+ data[k].title = '分红';
1632
+ }
1633
+ if (k === 'rate') {
1634
+ data[k].title = '账户利率';
1635
+ if (data[k].opts) {
1636
+ data[k].opts.forEach(function (o) {
1637
+ o.description = getBonusDesc(o);
1638
+ });
1639
+ }
1640
+ }
1641
+ if (k === 'bonusRateData') {
1642
+ for (var kk in data[k]) {
1643
+ if (data[k][kk] && ['highestEndBonusRate', 'highestYearBonusRate', 'latestEndBonusRate', 'latestYearBonusRate'].includes(kk)) {
1644
+ data[k][kk] = Number((data[k][kk] * 100).toFixed(0));
1645
+ }
1646
+ }
1647
+ }
1648
+ }
1649
+ return data;
1650
+ }
1651
+ function getBonusDesc(option) {
1652
+ var desc = "".concat(option.description, " ").concat((option.value * 100).toFixed(2), "%");
1653
+ if (option.description.search(/\$/) !== -1) {
1654
+ return "".concat(option.description.replace('$', ''));
1655
+ }
1656
+ return desc;
1657
+ }
1658
+ function initInterestFormValues(values, data) {
1659
+ var formData = {
1660
+ bonus: null,
1661
+ customBonusRate: null,
1662
+ rate: null,
1663
+ customRate: null,
1664
+ takeType: null,
1665
+ bonusTake: null,
1666
+ pensionTake: null,
1667
+ bonusRealRate: null,
1668
+ bonusShowSelector: null,
1669
+ yearRate: null,
1670
+ monthRate: null
1671
+ };
1672
+ if (data) {
1673
+ Object.keys(formData).forEach(function (k) {
1674
+ if (data[k]) {
1675
+ if (['bonus', 'rate', 'takeType', 'bonusTake', 'pensionTake'].includes(k)) {
1676
+ formData[k] = data[k].value;
1677
+ return;
1678
+ }
1679
+ formData[k] = data[k];
1680
+ }
1681
+ });
1682
+ }
1683
+ if (values) {
1684
+ Object.keys(values).forEach(function (k) {
1685
+ if (values[k]) {
1686
+ formData[k] = values[k];
1687
+ }
1688
+ });
1689
+ var _yearBonusRate = get(values, 'yearBonusRate');
1690
+ var _endBonusRate = get(values, 'endBonusRate');
1691
+ if (_yearBonusRate || _endBonusRate) {
1692
+ formData.bonus = '_custom';
1693
+ formData.customBonusRate = Number(((_yearBonusRate || _endBonusRate) * 100).toFixed(2));
1694
+ }
1695
+ }
1696
+ var _customRate = formData.customRate;
1697
+ if (_customRate) {
1698
+ formData.customRate = Number((_customRate * 100).toFixed(2));
1699
+ formData.rate = '_custom';
1700
+ } else {
1701
+ var _rateOptions = get(data, 'rate.opts', []) || [];
1702
+ var _rateOption = _rateOptions.find(function (e) {
1703
+ return e.value === formData.rate;
1704
+ });
1705
+ if (!_rateOption) {
1706
+ _customRate = formData.rate;
1707
+ }
1708
+ }
1709
+ return formData;
1710
+ }
1711
+ function convertInterestFormValues(values, data) {
1712
+ var formValues = {};
1713
+ if (values) {
1714
+ formValues = values;
1715
+ var _rate = get(data, 'rate.opts[3].value');
1716
+ var _highestYearBonusRate = get(data, 'bonusRateData.highestYearBonusRate');
1717
+ var _highestEndBonusRate = get(data, 'bonusRateData.highestEndBonusRate');
1718
+ var bonus = values.bonus,
1719
+ customBonusRate = values.customBonusRate,
1720
+ rate = values.rate,
1721
+ customRate = values.customRate;
1722
+ var _yearBonusRate = bonus === '_custom' ? customBonusRate || _highestYearBonusRate : null;
1723
+ var _endBonusRate = bonus === '_custom' ? customBonusRate || _highestEndBonusRate : null;
1724
+ var _customRate = customRate ? Number((customRate / 100).toFixed(4)) : null;
1725
+ formValues.bonus = bonus === '_custom' ? 'mid' : bonus;
1726
+ formValues.yearBonusRate = _yearBonusRate ? Number((_yearBonusRate / 100).toFixed(2)) : null;
1727
+ formValues.endBonusRate = _endBonusRate ? Number((_endBonusRate / 100).toFixed(2)) : null;
1728
+ formValues.rate = rate === '_custom' ? _customRate : rate;
1729
+ formValues.customRate = rate === '_custom' ? _customRate || _rate || 4 : null;
1730
+ }
1731
+ return formValues;
1732
+ }
1733
+ function rebuildAccountDataBySetting(values, accountData) {
1734
+ var _addAndTakeData = get(accountData, 'addAndTakeData');
1735
+ if (!values || !_addAndTakeData) {
1736
+ return accountData;
1737
+ }
1738
+ var adjustYears = [];
1739
+ var tempAddAndTake = _addAndTakeData.find(function (a) {
1740
+ return a.key === values.type;
1741
+ });
1742
+ var adjustData = get(tempAddAndTake, 'adjustData') || [];
1743
+ adjustData.map(function (ad) {
1744
+ for (var k = ad[0]; k <= ad[1]; k++) {
1745
+ adjustYears.push([k,
1746
+ // 开始年度
1747
+ k,
1748
+ // 结束年度
1749
+ ad[2],
1750
+ // 金额
1751
+ ad[3] // 用途
1752
+ ]);
1753
+ }
1754
+ });
1755
+ var _loop = function _loop(k) {
1756
+ var currentYear = adjustYears.find(function (year) {
1757
+ return year[0] === k;
1758
+ });
1759
+ var purpose = values.purpose || values.customPurpose;
1760
+ if (currentYear) {
1761
+ currentYear[2] = values.baof;
1762
+ currentYear[3] = purpose;
1763
+ return 1; // continue
1764
+ }
1765
+ adjustYears.push([k, k, values.baof, purpose]);
1766
+ };
1767
+ for (var k = values.beginYear; k <= values.endYear; k++) {
1768
+ if (_loop(k)) continue;
1769
+ }
1770
+ adjustYears.sort(function (a, b) {
1771
+ return a[0] - b[0];
1772
+ });
1773
+ var tempAdjust = [];
1774
+ adjustYears.forEach(function (item) {
1775
+ var length = tempAdjust.length;
1776
+ var last = length && tempAdjust[length - 1];
1777
+ if (last && last[2] + last[3] === item[2] + item[3] && last[1] + 1 === item[0]) {
1778
+ last[1] = item[0];
1779
+ return;
1780
+ }
1781
+ tempAdjust.push(item);
1782
+ });
1783
+ if (tempAddAndTake) {
1784
+ tempAddAndTake.adjustData = tempAdjust.filter(function (ad) {
1785
+ return !!ad[2];
1786
+ });
1787
+ } else {
1788
+ accountData.addAndTakeData.push({
1789
+ key: values.type,
1790
+ adjustData: tempAdjust.filter(function (ad) {
1791
+ return !!ad[2];
1792
+ })
1793
+ });
1794
+ }
1795
+ return accountData;
1796
+ }
1797
+ function rebuildAccountDataByResult(detailsData, accountData, popupType) {
1798
+ if (!detailsData || !accountData || !accountData.addAndTakeData) {
1799
+ return accountData;
1800
+ }
1801
+ accountData.addAndTakeData.forEach(function (item) {
1802
+ var correspondingDetailsDataKey = popupType === 'reduceBaof' && item.key === 'take' ? 'draw_value' : item.key;
1803
+ var detailData = detailsData.find(function (e) {
1804
+ return e.key === correspondingDetailsDataKey;
1805
+ });
1806
+ var values = detailData && detailData.values;
1807
+ var details = detailData && detailData.details;
1808
+ if (!(values && values.length)) {
1809
+ item.adjustData = [];
1810
+ return;
1811
+ }
1812
+ var adjustData = [];
1813
+ values.forEach(function (ele, index) {
1814
+ if (!ele) {
1815
+ return;
1816
+ }
1817
+ var lastAdjustData = adjustData[Math.max(0, adjustData.length - 1)];
1818
+ if (lastAdjustData && lastAdjustData[1] === index && lastAdjustData[2] === ele && (!details || details[index] === lastAdjustData[3])) {
1819
+ lastAdjustData[1] = index + 1;
1820
+ return;
1821
+ }
1822
+ var adjustDataItem = [index + 1,
1823
+ // 开始年度
1824
+ index + 1,
1825
+ // 结束年度
1826
+ ele,
1827
+ // 金额
1828
+ details && details[index] ? details[index] : '' // 用途
1829
+ ];
1830
+ adjustData.push(adjustDataItem);
1831
+ });
1832
+ item.adjustData = adjustData;
1833
+ });
1834
+ return accountData;
1835
+ }
1836
+ function calcColumnsWidth(tableData) {
1837
+ var widthObj = {};
1838
+ if (tableData && tableData.length) {
1839
+ var keys = Object.keys(tableData[0]).filter(function (k) {
1840
+ return !['year', 'age'].includes(k);
1841
+ });
1842
+ keys.push('purpose');
1843
+ keys.forEach(function (k) {
1844
+ if (['purpose'].includes(k)) {
1845
+ widthObj[k] = 0;
1846
+ return;
1847
+ }
1848
+ if (['take', 'add'].includes(k)) {
1849
+ widthObj[k] = 3;
1850
+ return;
1851
+ }
1852
+ widthObj[k] = 5.5;
1853
+ });
1854
+ keys.forEach(function (k) {
1855
+ tableData.forEach(function (ele, eleIndex) {
1856
+ if (eleIndex === 0) {
1857
+ return;
1858
+ }
1859
+ var contentCount = 0;
1860
+ if (k === 'purpose') {
1861
+ if (ele.purpose) {
1862
+ contentCount = ele[k].length * 10 / 12;
1863
+ }
1864
+ } else {
1865
+ contentCount = formatNumberToThousand(ele[k]).length * 0.5 + 1.5;
1866
+ }
1867
+ widthObj[k] = Math.max(contentCount, widthObj[k]);
1868
+ });
1869
+ });
1870
+ }
1871
+ return widthObj;
1872
+ }
1873
+
1874
+ const script$2 = {
1875
+ props: {
1876
+ type: {
1877
+ type: String,
1878
+ default: 'addAndTake',
1879
+ validator: function validator(value) {
1880
+ return ['addAndTake', 'add', 'take', 'reduceBaof'].includes(value);
1881
+ }
1882
+ },
1883
+ scene: {
1884
+ type: Number,
1885
+ default: 0
1886
+ },
1887
+ formValue: {
1888
+ type: Object,
1889
+ default: function _default() {
1890
+ return {};
1891
+ }
1892
+ },
1893
+ interestInitData: {
1894
+ type: Object,
1895
+ default: function _default() {
1896
+ return {};
1897
+ }
1898
+ },
1899
+ params: {
1900
+ type: Object,
1901
+ default: function _default() {
1902
+ return {};
1903
+ }
1904
+ }
1905
+ },
1906
+ data: function data() {
1907
+ return {
1908
+ cpFormValue: cloneDeep(this.formValue),
1909
+ MAX_RATE_VALUE: 6,
1910
+ historyRateList: []
1911
+ };
1912
+ },
1913
+ computed: {
1914
+ isShowBounsRate: function isShowBounsRate() {
1915
+ return this.type !== 'reduceBaof' && this.scene === 3;
1916
+ },
1917
+ interestItems: function interestItems() {
1918
+ var isShowBounsRate = this.isShowBounsRate,
1919
+ interestInitData = this.interestInitData,
1920
+ formValue = this.formValue,
1921
+ params = this.params,
1922
+ MAX_RATE_VALUE = this.MAX_RATE_VALUE,
1923
+ historyRateList = this.historyRateList;
1924
+ if (!interestInitData) {
1925
+ return [];
1926
+ }
1927
+ var _items = [];
1928
+ var _bonusLength = get(interestInitData, 'bonus.opts.length');
1929
+ var _bonusRateData = get(interestInitData, 'bonusRateData');
1930
+ if (_bonusLength) {
1931
+ var _bonusOptions = cloneDeep(get(interestInitData, 'bonus.opts', []) || []);
1932
+ var _bonusItem = {
1933
+ key: 'bonus',
1934
+ stat: 'zjlqbfhqh',
1935
+ title: get(interestInitData, 'bonus.title', ''),
1936
+ options: _bonusOptions
1937
+ };
1938
+ if (isShowBounsRate && _bonusRateData) {
1939
+ var _latestBonusRate = get(_bonusRateData, 'latestYearBonusRate') || get(_bonusRateData, 'latestEndBonusRate');
1940
+ var _highestBonusRate = Math.max(get(_bonusRateData, 'highestYearBonusRate') || 0, get(_bonusRateData, 'highestEndBonusRate') || 0);
1941
+ if (_latestBonusRate) {
1942
+ var _customBonusRate = get(formValue, 'customBonusRate') || _latestBonusRate;
1943
+ _bonusOptions.push({
1944
+ value: '_custom',
1945
+ description: "\u7EA2\u5229\u5B9E\u73B0\u7387".concat(_customBonusRate ? " ".concat(_customBonusRate, "%") : '')
1946
+ });
1947
+ _bonusItem.maxlength = 3;
1948
+ _bonusItem.placeholder = "0 - ".concat(_highestBonusRate);
1949
+ _bonusItem.recommendValue = _latestBonusRate;
1950
+ _bonusItem.maxValue = _highestBonusRate;
1951
+ _bonusItem.tips = "\u4EE5\u5B98\u7F51\u6700\u8FD1\u7EA2\u5229\u5B9E\u73B0\u7387".concat(_latestBonusRate, "%\u6F14\u793A");
1952
+ }
1953
+ }
1954
+ _items.push(_bonusItem);
1955
+ }
1956
+ var _initFormValues = initInterestFormValues(params, interestInitData);
1957
+ var _rateOptions = cloneDeep(get(interestInitData, 'rate.opts', []) || []);
1958
+ var _rateLength = get(interestInitData, 'rate.opts.length');
1959
+ var _customOption3 = get(_rateOptions, '[3]');
1960
+ if (_rateLength) {
1961
+ var _lastHistoryRate = get(historyRateList, "[".concat(historyRateList.length - 1, "].rate"));
1962
+ var _customRate = get(formValue, 'customRate') || _lastHistoryRate;
1963
+ var _rateItem = {
1964
+ key: 'rate',
1965
+ stat: 'zjlqblyqh',
1966
+ title: get(interestInitData, 'rate.title'),
1967
+ recommendValue: _customRate,
1968
+ maxValue: MAX_RATE_VALUE,
1969
+ maxlength: 4,
1970
+ placeholder: "0.00 - ".concat(MAX_RATE_VALUE.toFixed(2)),
1971
+ tips: _lastHistoryRate ? "\u4EE5\u5B98\u7F51\u6700\u8FD1\u8D26\u6237\u5229\u7387".concat(_lastHistoryRate.toFixed(2), "%\u6F14\u793A") : '',
1972
+ options: _rateOptions
1973
+ };
1974
+ var _isShowcustomRateOption = get(_initFormValues, 'customRate') && _customOption3;
1975
+ if (_isShowcustomRateOption) {
1976
+ _customOption3.value = '_custom';
1977
+ _customOption3.description = _customOption3.description.replace(/(\d|\.)+/, !isNaN(Number(_customRate)) ? " ".concat(_customRate.toFixed(2)) : '');
1978
+ }
1979
+ _items.push(_rateItem);
1980
+ }
1981
+ return _items;
1982
+ }
1983
+ },
1984
+ methods: {
1985
+ onClickOptions: function onClickOptions(item, option) {
1986
+ var formValue = this.formValue;
1987
+ var oFormValue = cloneDeep(formValue);
1988
+ formValue[item.key] = option.value;
1989
+ var _recommendValue = get(item, 'recommendValue');
1990
+ if (option.value === '_custom') {
1991
+ if (item.key === 'bonus') {
1992
+ if (!formValue.customBonusRate && _recommendValue) {
1993
+ formValue.customBonusRate = _recommendValue;
1994
+ }
1995
+ }
1996
+ if (item.key === 'rate') {
1997
+ if (!formValue.customRate && _recommendValue) {
1998
+ formValue.customRate = _recommendValue;
1999
+ }
2000
+ }
2001
+ }
2002
+ this.$emit('change', formValue, oFormValue);
2003
+ },
2004
+ onClickRecommendValue: function onClickRecommendValue(item) {
2005
+ var formValue = this.formValue,
2006
+ historyRateList = this.historyRateList;
2007
+ var _recommendValue = get(item, 'recommendValue');
2008
+ if (_recommendValue) {
2009
+ if (item.key === 'bonus') {
2010
+ formValue.customBonusRate = _recommendValue;
2011
+ }
2012
+ if (item.key === 'rate') {
2013
+ var _lastHistoryRate = get(historyRateList, "[".concat(historyRateList.length - 1, "].rate"));
2014
+ formValue.customRate = _lastHistoryRate;
2015
+ }
2016
+ }
2017
+ this.$emit('change', formValue);
2018
+ },
2019
+ onInputItemValue: function onInputItemValue(item) {
2020
+ var formValue = this.formValue;
2021
+ var _key = item.key === 'bonus' ? 'customBonusRate' : 'customRate';
2022
+ if (formValue[_key]) {
2023
+ if (item.key === 'bonus') {
2024
+ if (!/^\d{1,3}$/.test(formValue[_key])) {
2025
+ formValue[_key] = null;
2026
+ }
2027
+ }
2028
+ if (item.key === 'rate') {
2029
+ if (!/^\d?\.?\d{0,2}$/.test(formValue[_key])) {
2030
+ formValue[_key] = null;
2031
+ }
2032
+ }
2033
+ }
2034
+ },
2035
+ onChangeItemValue: function onChangeItemValue(item) {
2036
+ var _this = this;
2037
+ var cpFormValue = this.cpFormValue;
2038
+ var _key = item.key === 'bonus' ? 'customBonusRate' : 'customRate';
2039
+ if (item.maxValue && cpFormValue[_key] > item.maxValue) {
2040
+ cpFormValue[_key] = item.maxValue;
2041
+ }
2042
+ return this.validate([item.key]).then(function () {
2043
+ _this.$emit('change', _this.cpFormValue);
2044
+ }).catch(function (err) {
2045
+ _Toast(err);
2046
+ });
2047
+ },
2048
+ validate: function validate(keys) {
2049
+ var formValue = this.formValue,
2050
+ interestInitData = this.interestInitData,
2051
+ interestItems = this.interestItems,
2052
+ MAX_RATE_VALUE = this.MAX_RATE_VALUE;
2053
+ var _keys = keys || (interestItems || []).map(function (e) {
2054
+ return e.key;
2055
+ });
2056
+ var _bonusRateData = get(interestInitData, 'bonusRateData');
2057
+ var _highestBonusRate = Math.max(get(_bonusRateData, 'highestYearBonusRate') || 0, get(_bonusRateData, 'highestEndBonusRate') || 0);
2058
+ for (var k in _keys) {
2059
+ var _key = _keys[k];
2060
+ if (formValue[_key] === '_custom') {
2061
+ if (_key === 'bonus' && formValue.customBonusRate && formValue.customBonusRate > _highestBonusRate) {
2062
+ return Promise.reject("\u7EA2\u5229\u5B9E\u73B0\u7387\u4E0D\u80FD\u5927\u4E8E".concat(_highestBonusRate, "%"));
2063
+ }
2064
+ if (_key === 'rate' && formValue.customRate && formValue.customRate > MAX_RATE_VALUE) {
2065
+ return Promise.reject("\u8D26\u6237\u5229\u7387\u4E0D\u80FD\u5927\u4E8E".concat(MAX_RATE_VALUE.toFixed(2), "%"));
2066
+ }
2067
+ }
2068
+ }
2069
+ return Promise.resolve(formValue);
2070
+ }
2071
+ }
2072
+ };
2073
+
2074
+ /* script */
2075
+ var __vue_script__$2 = script$2;
2076
+ /* template */
2077
+ var __vue_render__$2 = function __vue_render__() {
2078
+ var _vm = this;
2079
+ var _h = _vm.$createElement;
2080
+ var _c = _vm._self._c || _h;
2081
+ return ['addAndTake', 'add', 'take'].includes(_vm.type) ? _c('div', {
2082
+ staticClass: "bxt_aat_interest_items"
2083
+ }, _vm._l(_vm.interestItems, function (item) {
2084
+ var _obj;
2085
+ return _c('div', {
2086
+ key: item.key,
2087
+ staticClass: "bxt_aatii_item"
2088
+ }, [_c('header', {
2089
+ staticClass: "bxt_aatii_item_left"
2090
+ }, [_vm._v("\n " + _vm._s(item.title) + "\n ")]), _c('div', {
2091
+ staticClass: "bxt_aatii_item_right"
2092
+ }, [item.options ? _c('div', {
2093
+ staticClass: "bxt_aatii_item_right_options",
2094
+ class: (_obj = {}, _obj["aatii_item_right_options__" + item.key] = true, _obj)
2095
+ }, [_vm._l(item.options, function (o, i) {
2096
+ return [!o.hiddenFlag ? _c('span', {
2097
+ key: o.value + o.description + i,
2098
+ class: {
2099
+ active: _vm.formValue[item.key] === o.value
2100
+ },
2101
+ on: {
2102
+ "click": function click($event) {
2103
+ return _vm.onClickOptions(item, o);
2104
+ }
2105
+ }
2106
+ }, [_vm._v("\n " + _vm._s(o.description) + "\n ")]) : _vm._e()];
2107
+ })], 2) : _vm._e(), _vm.isShowBounsRate && _vm.formValue[item.key] === '_custom' ? _c('div', {
2108
+ staticClass: "bxt_aatii_item_right_custom"
2109
+ }, [_c('div', {
2110
+ staticClass: "bxt_aatii_item_right_custom_input"
2111
+ }, [_c('input', {
2112
+ directives: [{
2113
+ name: "model",
2114
+ rawName: "v-model.number",
2115
+ value: _vm.cpFormValue[item.key === 'bonus' ? 'customBonusRate' : 'customRate'],
2116
+ expression: "cpFormValue[item.key === 'bonus' ? 'customBonusRate' : 'customRate']",
2117
+ modifiers: {
2118
+ "number": true
2119
+ }
2120
+ }],
2121
+ attrs: {
2122
+ "maxlength": item.maxlength,
2123
+ "placeholder": item.placeholder
2124
+ },
2125
+ domProps: {
2126
+ "value": _vm.cpFormValue[item.key === 'bonus' ? 'customBonusRate' : 'customRate']
2127
+ },
2128
+ on: {
2129
+ "input": [function ($event) {
2130
+ if ($event.target.composing) {
2131
+ return;
2132
+ }
2133
+ _vm.$set(_vm.cpFormValue, item.key === 'bonus' ? 'customBonusRate' : 'customRate', _vm._n($event.target.value));
2134
+ }, function ($event) {
2135
+ return _vm.onInputItemValue(item);
2136
+ }],
2137
+ "change": function change($event) {
2138
+ _vm.$nextTick(function () {
2139
+ return _vm.onChangeItemValue(item);
2140
+ });
2141
+ },
2142
+ "blur": function blur($event) {
2143
+ return _vm.$forceUpdate();
2144
+ }
2145
+ }
2146
+ }), _c('span', [_vm._v(" % ")])]), item.tips ? _c('div', {
2147
+ staticClass: "bxt_aatii_item_right_custom_tips",
2148
+ on: {
2149
+ "click": function click($event) {
2150
+ return _vm.onClickRecommendValue(item);
2151
+ }
2152
+ }
2153
+ }, [_c('span', [_vm._v(_vm._s(item.tips))])]) : _vm._e()]) : _vm._e()])]);
2154
+ }), 0) : _vm._e();
2155
+ };
2156
+ var __vue_staticRenderFns__$2 = [];
2157
+
2158
+ /* style */
2159
+ var __vue_inject_styles__$2 = undefined;
2160
+ /* style inject */
2161
+
2162
+ /* style inject SSR */
2163
+
2164
+ /* style inject shadow dom */
2165
+
2166
+ var __vue_component__$2 = /*#__PURE__*/normalizeComponent({
2167
+ render: __vue_render__$2,
2168
+ staticRenderFns: __vue_staticRenderFns__$2
2169
+ }, __vue_inject_styles__$2, __vue_script__$2);
2170
+
2171
+ const script$1 = {
2172
+ props: {
2173
+ type: String,
2174
+ interestInitData: {
2175
+ type: Object,
2176
+ default: function _default() {
2177
+ return {};
2178
+ }
2179
+ },
2180
+ addAndTakeDetailData: {
2181
+ type: Array,
2182
+ default: function _default() {
2183
+ return [];
2184
+ }
2185
+ },
2186
+ insuredAge: Number,
2187
+ minTakeYear: Number,
2188
+ headFixedTop: Number,
2189
+ footer: Boolean
2190
+ },
2191
+ computed: {
2192
+ detailData: function detailData() {
2193
+ var self = this;
2194
+ var type = self.type,
2195
+ addAndTakeDetailData = self.addAndTakeDetailData;
2196
+ var detailKeys = type === 'reduceBaof' ? ['draw_max'] : ['take_max'];
2197
+ var detailData = cloneDeep(addAndTakeDetailData || []).filter(function (d) {
2198
+ return !detailKeys.includes(d.key);
2199
+ });
2200
+ detailData.forEach(function (d) {
2201
+ d.values = d.values && d.values.map(function (v) {
2202
+ return v ? Math.round(v) : v;
2203
+ });
2204
+ });
2205
+ return detailData;
2206
+ },
2207
+ addAndTakeTable: function addAndTakeTable() {
2208
+ var insuredAge = this.insuredAge,
2209
+ interestInitData = this.interestInitData,
2210
+ detailData = this.detailData;
2211
+ if (!interestInitData || !detailData.length) {
2212
+ return [];
2213
+ }
2214
+ var tableHeaderData = {
2215
+ year: '年度',
2216
+ age: '年龄'
2217
+ };
2218
+ detailData.forEach(function (d, i) {
2219
+ // 为解决接口返回的数组中key相同的问题
2220
+ if (!['add', 'take', 'draw_value'].includes(d.key)) {
2221
+ d.uniKey = "".concat(d.key, "_").concat(i);
2222
+ }
2223
+ tableHeaderData[d.uniKey || d.key] = (d.name || '').replace(/([((](.*)[))])$/, '<br/>$1');
2224
+ });
2225
+ var startPolicyNo = interestInitData.startPolicyNo,
2226
+ startIndex = interestInitData.startIndex,
2227
+ reduceIndex = interestInitData.reduceIndex;
2228
+ var maxlength = detailData.reduce(function (a, b) {
2229
+ return Math.max(a, b.values ? b.values.length : 0);
2230
+ }, 0);
2231
+ var tableData = [];
2232
+ var _loop = function _loop(i) {
2233
+ var record = {
2234
+ year: i + (startPolicyNo || 1),
2235
+ // 年度
2236
+ age: insuredAge + (startIndex || 0) + i + 1 // 年龄
2237
+ };
2238
+ detailData.map(function (item) {
2239
+ if (item.values) {
2240
+ record[item.uniKey || item.key] = formatNumberToThousand(item.values[i] || 0);
2241
+ }
2242
+ if (item.details) {
2243
+ record.purpose = item.details[i] || '';
2244
+ }
2245
+ });
2246
+ tableData.push(record);
2247
+ };
2248
+ for (var i = 0; i < maxlength; i++) {
2249
+ _loop(i);
2250
+ }
2251
+ if (reduceIndex) {
2252
+ tableData = tableData.filter(function (e) {
2253
+ return e.year > reduceIndex;
2254
+ });
2255
+ }
2256
+ tableData.unshift(tableHeaderData);
2257
+ return tableData;
2258
+ },
2259
+ columnWidthObj: function columnWidthObj() {
2260
+ return calcColumnsWidth(this.addAndTakeTable);
2261
+ }
2262
+ }
2263
+ };
2264
+
2265
+ /* script */
2266
+ var __vue_script__$1 = script$1;
2267
+
2268
+ /* template */
2269
+ var __vue_render__$1 = function __vue_render__() {
2270
+ var _vm = this;
2271
+ var _h = _vm.$createElement;
2272
+ var _c = _vm._self._c || _h;
2273
+ return _c('section', {
2274
+ staticClass: "bxt_aat_interest_table"
2275
+ }, [_c('table', _vm._l(_vm.addAndTakeTable, function (record, recordIndex) {
2276
+ return _c('tr', {
2277
+ key: record.year,
2278
+ style: recordIndex === 0 ? {
2279
+ top: _vm.headFixedTop + "px"
2280
+ } : {}
2281
+ }, _vm._l(['year', 'age'].concat(Object.keys(record).filter(function (k) {
2282
+ return !['year', 'age', 'purpose'].includes(k);
2283
+ })), function (key) {
2284
+ return _c('td', {
2285
+ key: key,
2286
+ class: {
2287
+ key: true,
2288
+ disabled: recordIndex > 0 && ['take', 'draw_value'].includes(key) && record.year < _vm.minTakeYear,
2289
+ edit: recordIndex !== 0 && ['take', 'draw_value'].includes(key)
2290
+ },
2291
+ style: {
2292
+ 'min-width': (_vm.columnWidthObj[key] || 3) + (['take', 'draw_value'].includes(key) ? _vm.columnWidthObj.purpose : 0) + "em"
2293
+ },
2294
+ on: {
2295
+ "click": function click($event) {
2296
+ return _vm.$emit('clickTableCell', key, record, recordIndex);
2297
+ }
2298
+ }
2299
+ }, [recordIndex !== 0 && !(['take', 'draw_value'].includes(key) && _vm.columnWidthObj.purpose && record.purpose) ? [_vm._v("\n " + _vm._s(record[key]) + "\n ")] : [_c('span', {
2300
+ domProps: {
2301
+ "innerHTML": _vm._s(record[key])
2302
+ }
2303
+ }), record.purpose ? _c('span', {
2304
+ staticClass: "bxt_aatit_purpose"
2305
+ }, [_vm._v("\n " + _vm._s(record.purpose) + "\n ")]) : _vm._e()]], 2);
2306
+ }), 0);
2307
+ }), 0), _vm.footer ? _c('footer', {
2308
+ staticClass: "bxt_add_and_take_footer"
2309
+ }, [_c('div', {
2310
+ staticClass: "bxt_add_and_take_footer_wrapper"
2311
+ }, [['addAndTake', 'add'].includes(_vm.type) ? _c('div', {
2312
+ staticClass: "bxt_item minor",
2313
+ on: {
2314
+ "click": function click($event) {
2315
+ return _vm.$emit('openForm', 'add');
2316
+ }
2317
+ }
2318
+ }, [_vm._v("\n 追加\n ")]) : _vm._e(), ['addAndTake', 'take', 'reduceBaof'].includes(_vm.type) ? _c('div', {
2319
+ staticClass: "bxt_item minor",
2320
+ on: {
2321
+ "click": function click($event) {
2322
+ return _vm.$emit('openForm', 'take');
2323
+ }
2324
+ }
2325
+ }, [_vm._v("\n 领取设置\n ")]) : _vm._e(), _c('div', {
2326
+ staticClass: "bxt_item primary",
2327
+ on: {
2328
+ "click": function click($event) {
2329
+ return _vm.$emit('confirm');
2330
+ }
2331
+ }
2332
+ }, [_vm._v("\n 确定\n ")])])]) : _vm._e()]);
2333
+ };
2334
+ var __vue_staticRenderFns__$1 = [];
2335
+
2336
+ /* style */
2337
+ var __vue_inject_styles__$1 = undefined;
2338
+ /* style inject */
2339
+
2340
+ /* style inject SSR */
2341
+
2342
+ /* style inject shadow dom */
2343
+
2344
+ var __vue_component__$1 = /*#__PURE__*/normalizeComponent({
2345
+ render: __vue_render__$1,
2346
+ staticRenderFns: __vue_staticRenderFns__$1
2347
+ }, __vue_inject_styles__$1, __vue_script__$1);
2348
+
2349
+ Vue.use(_Vant);
2350
+ const script = {
2351
+ components: {
2352
+ InterestItems: __vue_component__$2,
2353
+ InterestTable: __vue_component__$1,
2354
+ InterestForm: __vue_component__$3
2355
+ },
2356
+ props: {
2357
+ type: {
2358
+ type: String,
2359
+ default: 'addAndTake',
2360
+ validator: function validator(value) {
2361
+ return ['addAndTake', 'add', 'take', 'reduceBaof'].includes(value);
2362
+ }
2363
+ },
2364
+ // scene: 0-投保页 1-结果页 2-计划书对比 3-利益对比 4-保司投保页 5-险种对比(利益对比2024)
2365
+ scene: {
2366
+ type: Number,
2367
+ default: 0,
2368
+ validator: function validator(value) {
2369
+ return [0, 1, 2, 3, 4, 5].includes(value);
2370
+ }
2371
+ },
2372
+ submoduleName: {
2373
+ type: String,
2374
+ default: 'Table',
2375
+ validator: function validator(value) {
2376
+ return ['Table', 'Form'].includes(value);
2377
+ }
2378
+ },
2379
+ resultUuid: String,
2380
+ inputData: Object,
2381
+ groupKey: [Number, String],
2382
+ productKey: [Number, String],
2383
+ insuredAge: {
2384
+ type: Number,
2385
+ required: true
2386
+ },
2387
+ periodNum: {
2388
+ type: Number,
2389
+ default: 0
2390
+ },
2391
+ accountData: Object,
2392
+ accountInsuranceId: Number,
2393
+ reduceBaofData: Object,
2394
+ reduceBaofInsuranceId: Number,
2395
+ interestData: Object,
2396
+ footer: {
2397
+ type: Boolean,
2398
+ default: true
2399
+ }
2400
+ },
2401
+ data: function data() {
2402
+ return {
2403
+ subName: '',
2404
+ currentAccountData: cloneDeep(this.accountData),
2405
+ currentReduceBaofData: cloneDeep(this.reduceBaofData),
2406
+ addAndTakeRecordData: null,
2407
+ interestInitData: null,
2408
+ addAndTakeDetailData: null,
2409
+ formData: {},
2410
+ interestFormValue: {}
2411
+ };
2412
+ },
2413
+ computed: {
2414
+ cpInputData: function cpInputData() {
2415
+ return cloneDeep(this.inputData);
2416
+ },
2417
+ productData: function productData() {
2418
+ var cpInputData = this.cpInputData,
2419
+ groupKey = this.groupKey,
2420
+ productKey = this.productKey;
2421
+ var groupData = (get(cpInputData, 'productGroupList') || []).find(function (g) {
2422
+ return g.key === groupKey;
2423
+ });
2424
+ return (get(groupData, 'prodOrderList') || []).find(function (p) {
2425
+ return p.key === productKey;
2426
+ });
2427
+ },
2428
+ insuranceKey: function insuranceKey() {
2429
+ return this.type === 'reduceBaof' ? this.reduceBaofInsuranceId : this.accountInsuranceId;
2430
+ },
2431
+ knowledgeData: function knowledgeData() {
2432
+ return get(this, 'interestInitData.knowledgeData') || [];
2433
+ },
2434
+ minTakeYear: function minTakeYear() {
2435
+ var type = this.type,
2436
+ periodNum = this.periodNum,
2437
+ knowledgeData = this.knowledgeData;
2438
+ var minYear = 0;
2439
+ if (type === 'reduceBaof') {
2440
+ minYear = Number(periodNum);
2441
+ var startTime = knowledgeData.find(function (e) {
2442
+ return e.key === 'start_time';
2443
+ });
2444
+ var startTimeValue = Number(get(startTime, 'value'));
2445
+ if (startTimeValue && startTimeValue !== -1) {
2446
+ minYear = startTimeValue || 0;
2447
+ }
2448
+ }
2449
+ return Math.max(minYear, 0);
2450
+ },
2451
+ isShowTips: function isShowTips() {
2452
+ var mulInsOrderList = get(this.productData, 'mulInsOrderList') || [];
2453
+ var hasReduceBaof = mulInsOrderList.find(function (ins) {
2454
+ return ins.reduceBaof && ins.reduceBaofData;
2455
+ });
2456
+ var hasAccountTake = mulInsOrderList.find(function (ins) {
2457
+ return ins.account && ins.accountData;
2458
+ });
2459
+ return hasReduceBaof && hasAccountTake;
2460
+ }
2461
+ },
2462
+ watch: {
2463
+ subName: {
2464
+ handler: function handler(name) {
2465
+ this.$emit('update:submoduleName', name);
2466
+ }
2467
+ }
2468
+ },
2469
+ created: function created() {
2470
+ this.subName = this.submoduleName;
2471
+ this.addAndTakeRecordData = this.initAddAndTakeRecordData();
2472
+ this.getInitInterestData();
2473
+ },
2474
+ methods: {
2475
+ initAddAndTakeRecordData: function initAddAndTakeRecordData() {
2476
+ var type = this.type,
2477
+ accountData = this.accountData,
2478
+ reduceBaofData = this.reduceBaofData;
2479
+ var recordData = ['reduceBaof'].includes(type) ? reduceBaofData : accountData;
2480
+ if (!get(recordData, 'addAndTakeData.length')) {
2481
+ recordData = initDefaultAddAndTakeData(type);
2482
+ if (get(recordData, 'accountName')) {
2483
+ recordData.accountName = get(recordData, 'accountName');
2484
+ }
2485
+ }
2486
+ return cloneDeep(recordData);
2487
+ },
2488
+ getInitInterestData: function getInitInterestData() {
2489
+ var _this = this;
2490
+ var scene = this.scene,
2491
+ resultUuid = this.resultUuid,
2492
+ productKey = this.productKey,
2493
+ insuranceKey = this.insuranceKey,
2494
+ interestData = this.interestData;
2495
+ var reqParams = {
2496
+ uuid: resultUuid,
2497
+ pbData: resultUuid ? '' : JSON.stringify(this.getPureInputDataForRequest()),
2498
+ productId: productKey,
2499
+ insuranceId: insuranceKey
2500
+ };
2501
+ return initInsuranceInterest(reqParams, {
2502
+ scene: scene
2503
+ }).then(function (data) {
2504
+ if (data) {
2505
+ _this.interestInitData = initInterestData(data);
2506
+ _this.interestFormValue = initInterestFormValues(interestData, _this.interestInitData);
2507
+ _this.getAddAndTakeData();
2508
+ }
2509
+ }).catch(function (error) {
2510
+ var errorMsg = '';
2511
+ if (error && typeof error === 'string') {
2512
+ errorMsg = error;
2513
+ }
2514
+ if (errorMsg) {
2515
+ _Toast(error);
2516
+ }
2517
+ console.log(error);
2518
+ });
2519
+ },
2520
+ getAddAndTakeData: function getAddAndTakeData() {
2521
+ var _arguments = arguments,
2522
+ _this2 = this;
2523
+ return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee() {
2524
+ var newRecordData, oFormValue, self, scene, resultUuid, productKey, insuranceKey, reduceBaofData, reduceBaofInsuranceId, accountInsuranceId, type, currentAccountData, currentReduceBaofData, addAndTakeRecordData, interestInitData, _formValus, bonus, bonusTake, takeType, customRate, rate, pensionTake, yearBonusRate, latestYearBonusRate, bonusRealRate, bonusShowSelector, yearRate, monthRate, effectAccountData, isReduceBaof, reqParams;
2525
+ return _regeneratorRuntime.wrap(function (_context) {
2526
+ while (1) switch (_context.prev = _context.next) {
2527
+ case 0:
2528
+ newRecordData = _arguments.length > 0 && _arguments[0] !== undefined ? _arguments[0] : null;
2529
+ oFormValue = _arguments.length > 1 ? _arguments[1] : undefined;
2530
+ self = _this2;
2531
+ scene = self.scene, resultUuid = self.resultUuid, productKey = self.productKey, insuranceKey = self.insuranceKey, reduceBaofData = self.reduceBaofData, reduceBaofInsuranceId = self.reduceBaofInsuranceId, accountInsuranceId = self.accountInsuranceId, type = self.type, currentAccountData = self.currentAccountData, currentReduceBaofData = self.currentReduceBaofData, addAndTakeRecordData = self.addAndTakeRecordData, interestInitData = self.interestInitData;
2532
+ _context.next = 1;
2533
+ return self.validateInterestFormValues().catch(function () {});
2534
+ case 1:
2535
+ _formValus = _context.sent;
2536
+ if (!_formValus) {
2537
+ _context.next = 2;
2538
+ break;
2539
+ }
2540
+ bonus = _formValus.bonus, bonusTake = _formValus.bonusTake, takeType = _formValus.takeType, customRate = _formValus.customRate, rate = _formValus.rate, pensionTake = _formValus.pensionTake, yearBonusRate = _formValus.yearBonusRate, latestYearBonusRate = _formValus.latestYearBonusRate, bonusRealRate = _formValus.bonusRealRate, bonusShowSelector = _formValus.bonusShowSelector, yearRate = _formValus.yearRate, monthRate = _formValus.monthRate;
2541
+ effectAccountData = newRecordData || addAndTakeRecordData;
2542
+ isReduceBaof = type === 'reduceBaof';
2543
+ reqParams = _defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty(_defineProperty({
2544
+ uuid: resultUuid,
2545
+ pbData: resultUuid ? '' : JSON.stringify(_this2.getPureInputDataForRequest()),
2546
+ productId: productKey,
2547
+ insuranceId: insuranceKey,
2548
+ bonus: {
2549
+ value: bonus
2550
+ },
2551
+ bonusTake: {
2552
+ value: bonusTake
2553
+ },
2554
+ takeType: {
2555
+ value: takeType
2556
+ },
2557
+ rate: {
2558
+ value: customRate || rate
2559
+ },
2560
+ pensionTake: {
2561
+ value: pensionTake
2562
+ },
2563
+ yearBonusRate: yearBonusRate,
2564
+ latestYearBonusRate: latestYearBonusRate
2565
+ }, isReduceBaof ? 'drawData' : 'addAndTakeData', effectAccountData ? effectAccountData.addAndTakeData : null), isReduceBaof ? 'drawInsuranceId' : 'accountInsuranceId', isReduceBaof ? reduceBaofInsuranceId : accountInsuranceId), "bonusRealRate", bonusRealRate), "bonusShowSelector", bonusShowSelector), "yearRate", yearRate), "monthRate", monthRate);
2566
+ if (!isReduceBaof && reduceBaofData) {
2567
+ reqParams.drawData = reduceBaofData.addAndTakeData;
2568
+ reqParams.drawInsuranceId = reduceBaofInsuranceId;
2569
+ }
2570
+ return _context.abrupt("return", getInsuranceInterestDetail(reqParams, {
2571
+ scene: scene,
2572
+ isReduceBaof: isReduceBaof
2573
+ }).then(function (data) {
2574
+ if (data) {
2575
+ self.addAndTakeDetailData = data;
2576
+ self.addAndTakeRecordData = rebuildAccountDataByResult(data, cloneDeep(addAndTakeRecordData), type);
2577
+ return Promise.resolve(data);
2578
+ }
2579
+ return Promise.reject();
2580
+ }).catch(function (error) {
2581
+ var errMessage = error.info || '请求错误';
2582
+ if (errMessage.match(/账户余额不足|不满足最大领取金额/)) {
2583
+ return new Promise(function (resolve, reject) {
2584
+ _Dialog.confirm({
2585
+ title: '温馨提示',
2586
+ message: '切换演示情形后,不满足领取设置要求(将出现余额不足或超过最大领取金额限制),请确认是否清空已设置的领取金额重新进行领取设置?如不清空,则本演示情形不展示领取后数据。'
2587
+ }).then(function () {
2588
+ var _addAndTakeData = get(cloneDeep(effectAccountData), 'addAndTakeData') || [];
2589
+ var _hasTakeData = _addAndTakeData.some(function (e) {
2590
+ return e.adjustData && e.adjustData.length;
2591
+ });
2592
+ self.addAndTakeRecordData = initDefaultAddAndTakeData(type);
2593
+ // 避免 getAddAndTakeData 循环调用
2594
+ if (_hasTakeData) {
2595
+ self.getAddAndTakeData();
2596
+ }
2597
+ // 账户余额不足,或不满足最大领取金额,减保领取、账户领取的数据都要清空。
2598
+ if (isReduceBaof) {
2599
+ if (currentAccountData) {
2600
+ self.currentAccountData = initDefaultAddAndTakeData(currentAccountData.accountPart);
2601
+ }
2602
+ } else {
2603
+ if (currentReduceBaofData) {
2604
+ self.currentReduceBaofData = initDefaultAddAndTakeData(currentReduceBaofData.accountPart);
2605
+ }
2606
+ }
2607
+ resolve();
2608
+ }).catch(function () {
2609
+ self.interestFormValue = convertInterestFormValues(oFormValue || self.interestFormValue, interestInitData);
2610
+ resolve();
2611
+ });
2612
+ });
2613
+ }
2614
+ _Toast(errMessage);
2615
+ return Promise.reject();
2616
+ }));
2617
+ case 2:
2618
+ return _context.abrupt("return", Promise.reject());
2619
+ case 3:
2620
+ case "end":
2621
+ return _context.stop();
2622
+ }
2623
+ }, _callee);
2624
+ }))();
2625
+ },
2626
+ getPureInputDataForRequest: function getPureInputDataForRequest() {
2627
+ var cpInputData = this.cpInputData,
2628
+ groupKey = this.groupKey,
2629
+ productData = this.productData;
2630
+ var _inputData = cloneDeep(cpInputData);
2631
+ var _productData = cloneDeep(productData);
2632
+ var data = {
2633
+ insuranceTypeId: null,
2634
+ personData: null,
2635
+ productGroupList: []
2636
+ };
2637
+ if (_inputData && _productData) {
2638
+ data.insuranceTypeId = _inputData.insuranceTypeId;
2639
+ delete _inputData.personData.recipientInfo;
2640
+ data.personData = _inputData.personData;
2641
+ var NONEED_PROD_KEYS = ['adjustBaoeData', 'autoImport', 'companyId', 'companyName', 'enableInspectionTest', 'enablePurchase', 'feeValidateMode', 'hadChoice', 'handTag', 'hide', 'liabilityShowType', 'multipleInsured', 'required', 'resultImport', 'salesChannelList', 'titleName', 'totalBaof', 'trade', 'valueAddedServiceIdList', 'xinCodeList', 'insShowArr', 'restrictList'];
2642
+ var NONEED_INS_KEYS = [
2643
+ // 'account',
2644
+ // 'accountData',
2645
+ 'baoeDesc', 'baofDesc', 'baseBaof', 'bonusTypeDesc', 'calcResultRules', 'calculatorType', 'eleOrderInResult', 'iDurationDesc', 'multipleInsured', 'isFollowing', 'isCheckbox', 'pPeriodDesc',
2646
+ // 'reduceBaof',
2647
+ // 'reduceBaofData',
2648
+ 'saleStatus'];
2649
+ NONEED_PROD_KEYS.forEach(function (k) {
2650
+ delete _productData[k];
2651
+ });
2652
+ _productData.mulInsOrderList.forEach(function (ins) {
2653
+ NONEED_INS_KEYS.forEach(function (k) {
2654
+ delete ins[k];
2655
+ });
2656
+ });
2657
+ data.productGroupList.push({
2658
+ key: groupKey,
2659
+ prodOrderList: [_productData]
2660
+ });
2661
+ }
2662
+ return data;
2663
+ },
2664
+ onChangeInterestFormValue: function onChangeInterestFormValue(values, oValues) {
2665
+ this.interestFormValue = values;
2666
+ this.getAddAndTakeData(null, oValues);
2667
+ },
2668
+ onClickTableCell: function onClickTableCell(key, item, index) {
2669
+ var insuredAge = this.insuredAge,
2670
+ interestInitData = this.interestInitData,
2671
+ addAndTakeDetailData = this.addAndTakeDetailData,
2672
+ minTakeYear = this.minTakeYear;
2673
+ if (index <= 0 || !['add', 'take', 'draw_value'].includes(key) || !(interestInitData && addAndTakeDetailData)) {
2674
+ return;
2675
+ }
2676
+ var purposeOption = PURPOSE_OPTIONS.find(function (o) {
2677
+ return o.val === item.purpose;
2678
+ });
2679
+ this.formData = {
2680
+ // WYJHS-13, 追加领取、减保领取并存,利益结果中的 take key 拆分为 take / draw_value,后者用于减保领取
2681
+ // 提交时的类型数据在外层区分,为 addAndTakeData: [{key: take},...], drawData: [{key: take}, ...],因此 formData.type 仍是 take
2682
+ type: key === 'draw_value' ? 'take' : key,
2683
+ beginYear: item.year,
2684
+ endYear: item.year,
2685
+ baof: Number(item[key].replace(/,/g, '')) || null,
2686
+ purpose: purposeOption ? purposeOption.val : '',
2687
+ customPurpose: item.purpose
2688
+ };
2689
+ var startIndex = interestInitData.startIndex || 0;
2690
+ if (['take'].includes(this.formData.type)) {
2691
+ var maxLength = addAndTakeDetailData.reduce(function (a, b) {
2692
+ return Math.max(a, b.values.length);
2693
+ }, 0);
2694
+ if (item.year < minTakeYear) {
2695
+ if (maxLength > minTakeYear) {
2696
+ _Toast("\u9886\u53D6\u5E74\u9F84\u5FC5\u987B\u5728".concat(insuredAge + startIndex + minTakeYear, "\u5C81\u5230").concat(insuredAge + startIndex + maxLength, "\u5C81\u4E4B\u95F4"));
2697
+ }
2698
+ return;
2699
+ }
2700
+ }
2701
+ this.subName = 'Form';
2702
+ },
2703
+ deleteAllData: function deleteAllData() {
2704
+ this.addAndTakeRecordData.addAndTakeData.forEach(function (d) {
2705
+ d.adjustData = [];
2706
+ });
2707
+ this.getAddAndTakeData();
2708
+ },
2709
+ updateAdjustData: function updateAdjustData(values, callback) {
2710
+ var newRecordData = rebuildAccountDataBySetting(values, cloneDeep(this.addAndTakeRecordData));
2711
+ return this.getAddAndTakeData(newRecordData).then(function () {
2712
+ return callback();
2713
+ }).catch(function () {});
2714
+ },
2715
+ validateInterestFormValues: function validateInterestFormValues() {
2716
+ var _formValues = convertInterestFormValues(this.interestFormValue, this.interestInitData);
2717
+ var _refInterestItems = this.$refs.InterestItems;
2718
+ if (_refInterestItems) {
2719
+ return _refInterestItems.validate().then(function () {
2720
+ return _formValues;
2721
+ }).catch(function (err) {
2722
+ _Toast(err);
2723
+ });
2724
+ }
2725
+ return Promise.resolve(_formValues);
2726
+ },
2727
+ openForm: function openForm(type) {
2728
+ this.formData = {
2729
+ type: type
2730
+ };
2731
+ this.subName = 'Form';
2732
+ },
2733
+ goToTable: function goToTable() {
2734
+ this.subName = 'Table';
2735
+ },
2736
+ tableConfirm: function tableConfirm() {
2737
+ var _this3 = this;
2738
+ return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee2() {
2739
+ var type, accountData, accountInsuranceId, reduceBaofInsuranceId, currentReduceBaofData, addAndTakeRecordData, _formValues, isReduceBaof, takeDataKey, responseData;
2740
+ return _regeneratorRuntime.wrap(function (_context2) {
2741
+ while (1) switch (_context2.prev = _context2.next) {
2742
+ case 0:
2743
+ type = _this3.type, accountData = _this3.accountData, accountInsuranceId = _this3.accountInsuranceId, reduceBaofInsuranceId = _this3.reduceBaofInsuranceId, currentReduceBaofData = _this3.currentReduceBaofData, addAndTakeRecordData = _this3.addAndTakeRecordData;
2744
+ _context2.next = 1;
2745
+ return _this3.validateInterestFormValues().catch(function () {});
2746
+ case 1:
2747
+ _formValues = _context2.sent;
2748
+ if (_formValues) {
2749
+ _context2.next = 2;
2750
+ break;
2751
+ }
2752
+ return _context2.abrupt("return");
2753
+ case 2:
2754
+ isReduceBaof = type === 'reduceBaof';
2755
+ takeDataKey = isReduceBaof ? 'reduceBaofData' : 'accountData';
2756
+ responseData = _defineProperty(_defineProperty(_defineProperty(_defineProperty({
2757
+ type: type
2758
+ }, takeDataKey, addAndTakeRecordData), "accountInsuranceId", accountInsuranceId), "reduceBaofInsuranceId", reduceBaofInsuranceId), "interestData", _formValues);
2759
+ if (isReduceBaof) {
2760
+ // 减保领取,清空账户领取的数据
2761
+ responseData.accountData = accountInsuranceId && accountData ? initDefaultAddAndTakeData(accountData.accountPart) : null;
2762
+ } else {
2763
+ responseData.reduceBaofData = currentReduceBaofData;
2764
+ }
2765
+ _this3.$emit('confirm', responseData, _this3);
2766
+ return _context2.abrupt("return", responseData);
2767
+ case 3:
2768
+ case "end":
2769
+ return _context2.stop();
2770
+ }
2771
+ }, _callee2);
2772
+ }))();
2773
+ },
2774
+ confirm: function confirm() {
2775
+ var _this4 = this;
2776
+ return _asyncToGenerator(/*#__PURE__*/_regeneratorRuntime.mark(function _callee3() {
2777
+ return _regeneratorRuntime.wrap(function (_context3) {
2778
+ while (1) switch (_context3.prev = _context3.next) {
2779
+ case 0:
2780
+ if (!(_this4.subName === 'Form')) {
2781
+ _context3.next = 1;
2782
+ break;
2783
+ }
2784
+ _this4.goToTable();
2785
+ return _context3.abrupt("return", Promise.reject());
2786
+ case 1:
2787
+ return _context3.abrupt("return", _this4.tableConfirm());
2788
+ case 2:
2789
+ case "end":
2790
+ return _context3.stop();
2791
+ }
2792
+ }, _callee3);
2793
+ }))();
2794
+ }
2795
+ }
2796
+ };
2797
+
2798
+ /* script */
2799
+ var __vue_script__ = script;
2800
+
2801
+ /* template */
2802
+ var __vue_render__ = function __vue_render__() {
2803
+ var _vm = this;
2804
+ var _h = _vm.$createElement;
2805
+ var _c = _vm._self._c || _h;
2806
+ return _vm.addAndTakeDetailData && _vm.addAndTakeDetailData.length ? _c('div', {
2807
+ class: ['bxt_add_and_take', _vm.footer ? 'bxt_add_and_take__footer' : '']
2808
+ }, [_vm.subName === 'Table' ? [_c('InterestItems', {
2809
+ ref: "InterestItems",
2810
+ attrs: {
2811
+ "type": _vm.type,
2812
+ "scene": _vm.scene,
2813
+ "form-value": _vm.interestFormValue,
2814
+ "interest-init-data": _vm.interestInitData,
2815
+ "params": {
2816
+ resultUuid: _vm.resultUuid,
2817
+ productKey: _vm.productKey,
2818
+ rate: _vm.interestFormValue.rate,
2819
+ customRate: _vm.interestFormValue.customRate
2820
+ }
2821
+ },
2822
+ on: {
2823
+ "change": _vm.onChangeInterestFormValue
2824
+ }
2825
+ }), _vm.isShowTips ? _c('div', {
2826
+ staticClass: "bxt_add_and_take_tips"
2827
+ }, [_vm._v("\n 如需同时进行领取设置,请先设置主险领取,再设置万能领取\n ")]) : _vm._e(), _c('InterestTable', {
2828
+ ref: "InterestTable",
2829
+ attrs: {
2830
+ "type": _vm.type,
2831
+ "insured-age": _vm.insuredAge,
2832
+ "interest-init-data": _vm.interestInitData,
2833
+ "add-and-take-detail-data": _vm.addAndTakeDetailData,
2834
+ "footer": _vm.footer,
2835
+ "minTakeYear": _vm.minTakeYear
2836
+ },
2837
+ on: {
2838
+ "clickTableCell": _vm.onClickTableCell,
2839
+ "openForm": _vm.openForm,
2840
+ "confirm": _vm.tableConfirm
2841
+ }
2842
+ })] : _vm._e(), _vm.subName === 'Form' ? [_c('InterestForm', {
2843
+ ref: "InterestForm",
2844
+ attrs: {
2845
+ "type": _vm.type,
2846
+ "form-data": _vm.formData,
2847
+ "insured-age": _vm.insuredAge,
2848
+ "minTakeYear": _vm.minTakeYear,
2849
+ "rate": _vm.interestFormValue.rate === '_custom' ? _vm.interestFormValue.customRate : _vm.interestFormValue.rate,
2850
+ "addAndTakeRecordData": _vm.addAndTakeRecordData,
2851
+ "interest-init-data": _vm.interestInitData,
2852
+ "add-and-take-detail-data": _vm.addAndTakeDetailData,
2853
+ "knowledgeData": _vm.knowledgeData
2854
+ },
2855
+ on: {
2856
+ "openTable": _vm.goToTable,
2857
+ "update": _vm.updateAdjustData,
2858
+ "deleteAll": _vm.deleteAllData
2859
+ }
2860
+ })] : _vm._e()], 2) : _vm._e();
2861
+ };
2862
+ var __vue_staticRenderFns__ = [];
2863
+
2864
+ /* style */
2865
+ var __vue_inject_styles__ = undefined;
2866
+ /* style inject */
2867
+
2868
+ /* style inject SSR */
2869
+
2870
+ /* style inject shadow dom */
2871
+
2872
+ var __vue_component__ = /*#__PURE__*/normalizeComponent({
2873
+ render: __vue_render__,
2874
+ staticRenderFns: __vue_staticRenderFns__
2875
+ }, __vue_inject_styles__, __vue_script__);
2876
+
2877
+ export { __vue_component__ as default };