bxs-tools-ui 3.2.0 → 3.3.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/README.md +20 -20
  2. package/es/add-and-take/index.css +1 -1
  3. package/es/add-and-take/index.js +283 -64
  4. package/es/adjust-baoe/index.css +1 -1
  5. package/es/adjust-baoe/index.js +444 -195
  6. package/es/business-card/index.css +1 -1
  7. package/es/business-card/index.js +1 -0
  8. package/es/canvas-poster/index.css +1 -1
  9. package/es/canvas-poster/index.js +1 -0
  10. package/es/index.css +1 -1
  11. package/es/index.js +936 -824
  12. package/es/insure-calculate/index.css +1 -1
  13. package/es/insure-calculate/index.js +438 -265
  14. package/es/person-info/index.css +1 -1
  15. package/es/person-info/index.js +296 -1370
  16. package/es/product-info/index.css +1 -1
  17. package/es/product-info/index.js +644 -548
  18. package/es/share-sheet/index.css +1 -1
  19. package/es/share-sheet/index.js +313 -21
  20. package/es/utils/index.js +530 -429
  21. package/lib/add-and-take/index.css +1 -1
  22. package/lib/add-and-take/index.js +283 -64
  23. package/lib/adjust-baoe/index.css +1 -1
  24. package/lib/adjust-baoe/index.js +441 -194
  25. package/lib/business-card/index.css +1 -1
  26. package/lib/business-card/index.js +1 -0
  27. package/lib/canvas-poster/index.css +1 -1
  28. package/lib/canvas-poster/index.js +1 -0
  29. package/lib/index.css +1 -1
  30. package/lib/index.js +939 -826
  31. package/lib/insure-calculate/index.css +1 -1
  32. package/lib/insure-calculate/index.js +438 -268
  33. package/lib/person-info/index.css +1 -1
  34. package/lib/person-info/index.js +295 -1372
  35. package/lib/product-info/index.css +1 -1
  36. package/lib/product-info/index.js +645 -550
  37. package/lib/share-sheet/index.css +1 -1
  38. package/lib/share-sheet/index.js +313 -25
  39. package/lib/utils/index.js +531 -433
  40. package/package.json +9 -7
  41. package/packages/add-and-take/components/interest-form.less +144 -0
  42. package/packages/add-and-take/components/interest-form.vue +179 -179
  43. package/packages/add-and-take/components/interest-items.less +87 -0
  44. package/packages/add-and-take/components/interest-items.vue +67 -80
  45. package/packages/add-and-take/components/interest-table.less +111 -0
  46. package/packages/add-and-take/components/interest-table.vue +31 -31
  47. package/packages/add-and-take/constant.ts +2 -2
  48. package/packages/add-and-take/demo/index.vue +89 -86
  49. package/packages/add-and-take/handler.ts +52 -57
  50. package/packages/add-and-take/index.less +69 -0
  51. package/packages/add-and-take/index.vue +156 -156
  52. package/packages/add-and-take/readme.md +87 -98
  53. package/packages/adjust-baoe/demo/index.vue +37 -47
  54. package/packages/adjust-baoe/index.less +125 -0
  55. package/packages/adjust-baoe/index.vue +134 -147
  56. package/packages/adjust-baoe/readme.md +35 -45
  57. package/packages/business-card/demo/index.vue +7 -7
  58. package/packages/business-card/index.less +100 -0
  59. package/packages/business-card/index.vue +18 -21
  60. package/packages/business-card/readme.md +46 -53
  61. package/packages/bxs-utils/demo/index.vue +2 -2
  62. package/packages/bxs-utils/index.ts +5 -5
  63. package/packages/bxs-utils/planbook/common.ts +56 -92
  64. package/packages/bxs-utils/planbook/index.ts +4 -4
  65. package/packages/bxs-utils/planbook/insurance.ts +137 -127
  66. package/packages/bxs-utils/planbook/person.ts +143 -147
  67. package/packages/bxs-utils/planbook/product.ts +473 -509
  68. package/packages/bxs-utils/readme.md +94 -84
  69. package/packages/bxs-utils/trade/index.js +1 -1
  70. package/packages/bxs-utils/trade/insureCalculate.js +91 -204
  71. package/packages/canvas-poster/demo/index.vue +9 -13
  72. package/packages/canvas-poster/index.less +5 -0
  73. package/packages/canvas-poster/index.vue +68 -79
  74. package/packages/canvas-poster/readme.md +106 -109
  75. package/packages/index.ts +1 -1
  76. package/packages/insure-calculate/demo/index.vue +20 -20
  77. package/packages/insure-calculate/index.less +366 -0
  78. package/packages/insure-calculate/index.vue +305 -329
  79. package/packages/insure-calculate/readme.md +99 -106
  80. package/packages/person-info/crm-popup.vue +81 -80
  81. package/packages/person-info/demo/index.vue +25 -37
  82. package/packages/person-info/index-inline.less +11 -0
  83. package/packages/person-info/index.vue +53 -83
  84. package/packages/person-info/readme.md +109 -115
  85. package/packages/planbook-input/components/footer.less +54 -0
  86. package/packages/planbook-input/components/footer.vue +8 -64
  87. package/packages/planbook-input/components/handler.js +33 -44
  88. package/packages/planbook-input/components/product-table.less +235 -0
  89. package/packages/planbook-input/components/product-table.vue +114 -108
  90. package/packages/planbook-input/demo/index.vue +3 -3
  91. package/packages/planbook-input/helper.js +852 -465
  92. package/packages/planbook-input/index.less +30 -0
  93. package/packages/planbook-input/index.vue +86 -103
  94. package/packages/planbook-input/readme.md +72 -90
  95. package/packages/product-info/demo/constant.js +1 -1
  96. package/packages/product-info/demo/index.vue +31 -43
  97. package/packages/product-info/index.less +271 -0
  98. package/packages/product-info/index.vue +198 -210
  99. package/packages/product-info/readme.md +72 -75
  100. package/packages/share-sheet/constant.js +4 -4
  101. package/packages/share-sheet/demo/index.vue +10 -10
  102. package/packages/share-sheet/handler.js +14 -14
  103. package/packages/share-sheet/index.less +201 -0
  104. package/packages/share-sheet/index.vue +39 -39
  105. package/packages/share-sheet/readme.md +121 -127
  106. package/src/api/add-and-take.js +45 -0
  107. package/src/api/adjust-baoe.js +16 -0
  108. package/src/api/index.js +6 -0
  109. package/src/api/planbook.js +93 -0
  110. package/src/api/request.js +211 -0
  111. package/src/api/trade.js +56 -0
  112. package/src/api/user.js +18 -0
  113. package/src/components/common/common-age-birthday.less +66 -0
  114. package/src/components/common/common-age-birthday.vue +27 -95
  115. package/src/components/common/common-popup.less +81 -0
  116. package/src/components/common/common-popup.vue +12 -96
  117. package/src/components/common/common-radio.less +75 -0
  118. package/src/components/common/common-radio.vue +13 -91
  119. package/src/components/common/common-select.less +13 -0
  120. package/src/components/common/common-select.vue +21 -38
  121. package/src/components/common/common-title.less +115 -0
  122. package/src/components/common/common-title.vue +24 -24
  123. package/src/js/loading.js +6 -6
  124. package/src/js/md5Token.js +38 -44
  125. package/src/js/utils.js +45 -53
  126. package/src/js/variables.js +47 -25
  127. package/src/style/base.less +18 -0
  128. package/src/style/color.less +40 -0
  129. package/src/style/variables.less +21 -42
  130. package/packages/add-and-take/api.ts +0 -70
  131. package/packages/add-and-take/components/interest-form.css +0 -146
  132. package/packages/add-and-take/components/interest-items.css +0 -87
  133. package/packages/add-and-take/components/interest-table.css +0 -113
  134. package/packages/add-and-take/index.css +0 -70
  135. package/packages/adjust-baoe/index.css +0 -123
  136. package/packages/business-card/index.css +0 -101
  137. package/packages/canvas-poster/index.css +0 -5
  138. package/packages/insure-calculate/index.css +0 -368
  139. package/packages/planbook-input/api.js +0 -29
  140. package/packages/planbook-input/components/product-table.css +0 -236
  141. package/packages/planbook-input/index.css +0 -31
  142. package/packages/product-info/index.css +0 -264
  143. package/packages/share-sheet/index.css +0 -203
  144. package/src/components/common/common-title.css +0 -116
  145. package/src/js/request.js +0 -64
  146. package/src/style/apply.css +0 -25
  147. package/src/style/base.css +0 -36
  148. package/src/style/color.css +0 -74
@@ -84,22 +84,22 @@
84
84
  </div>
85
85
  </template>
86
86
  <script>
87
- import Vue from 'vue';
88
- import Vant, { Toast } from 'vant';
89
- import QS from 'qs';
90
- import { get as _get } from 'lodash';
91
- import { getPlanbookData } from 'packages/planbook-input/api.js';
92
- import { convertPersonData, convertProductData } from 'packages/bxs-utils/planbook/index.ts';
93
- import { initPageData, setPageDataBaseOnResult, doubleCalcProductData } from 'packages/planbook-input/helper.js';
94
- import { convertInputDataToResultData } from 'packages/planbook-input/components/handler.js';
95
- import { initAddAndTakePopupConfig } from 'packages/add-and-take/handler.ts';
96
- import { ADD_AND_TAKE_TITLE_MAP } from 'packages/add-and-take/constant.ts';
87
+ import Vue from 'vue'
88
+ import Vant, { Toast } from 'vant'
89
+ import QS from 'qs'
90
+ import { get as _get } from 'lodash'
91
+ import { getPlanbookData } from '../../../src/api/planbook.js'
92
+ import { convertPersonData, convertProductData } from 'packages/bxs-utils/planbook/index.ts'
93
+ import { initPageData, doubleCalcProductData } from 'packages/planbook-input/helper.js'
94
+ import { convertInputDataToResultData } from 'packages/planbook-input/components/handler.js'
95
+ import { initAddAndTakePopupConfig } from 'packages/add-and-take/handler.ts'
96
+ import { ADD_AND_TAKE_TITLE_MAP } from 'packages/add-and-take/constant.ts'
97
97
 
98
- import JsonTree from 'vue-json-tree';
99
- import CommonPopup from '@src/components/common/common-popup.vue';
100
- import AddAndTake from '../index.vue';
98
+ import JsonTree from 'vue-json-tree'
99
+ import CommonPopup from '../../../src/components/common/common-popup.vue'
100
+ import AddAndTake from '../index.vue'
101
101
 
102
- Vue.use(Vant);
102
+ Vue.use(Vant)
103
103
  export default {
104
104
  components: {
105
105
  CommonPopup,
@@ -112,45 +112,48 @@ export default {
112
112
  tabIndex: 1,
113
113
  planbookData: null,
114
114
  takePopupConfig: initAddAndTakePopupConfig()
115
- };
115
+ }
116
116
  },
117
117
  computed: {
118
+ exportData() {
119
+ return _get(this, 'planbookData.exportData')
120
+ },
118
121
  inputData() {
119
- return _get(this, 'planbookData.initData.inputData');
122
+ return _get(this, 'planbookData.initData.inputData')
120
123
  },
121
124
  groupData() {
122
- return _get(this, 'inputData.productGroupList[0]');
125
+ return _get(this, 'inputData.productGroupList[0]')
123
126
  },
124
127
  productData() {
125
- return _get(this, 'groupData.prodOrderList[0]');
128
+ return _get(this, 'groupData.prodOrderList[0]')
126
129
  },
127
130
  insuredAge() {
128
- const { inputData } = this;
129
- const insuredInfo = convertPersonData(inputData.personData, 'insuredInfo');
130
- return insuredInfo.age;
131
+ const { inputData } = this
132
+ const insuredInfo = convertPersonData(inputData.personData, 'insuredInfo')
133
+ return insuredInfo.age
131
134
  },
132
135
  reduceBaofInsuranceData() {
133
- const productData = convertProductData(this.productData);
134
- const mulInsOrderList = _get(productData, 'mulInsOrderList') || [];
135
- return mulInsOrderList.find(ins => ins.reduceBaof && ins.reduceBaofData);
136
+ const productData = convertProductData(this.productData)
137
+ const mulInsOrderList = _get(productData, 'mulInsOrderList') || []
138
+ return mulInsOrderList.find(ins => ins.reduceBaof && ins.reduceBaofData)
136
139
  },
137
140
  accountInsuranceData() {
138
- const productData = convertProductData(this.productData);
139
- const mulInsOrderList = _get(productData, 'mulInsOrderList') || [];
140
- return mulInsOrderList.find(ins => ins.account && ins.accountData);
141
+ const productData = convertProductData(this.productData)
142
+ const mulInsOrderList = _get(productData, 'mulInsOrderList') || []
143
+ return mulInsOrderList.find(ins => ins.account && ins.accountData)
141
144
  }
142
145
  },
143
146
  created() {
144
- this.getPlanbookData();
147
+ this.getPlanbookData()
145
148
  },
146
149
  methods: {
147
150
  getUrlParam() {
148
- return QS.parse(`${location.href.split('?')[1]}`) || {};
151
+ return QS.parse(`${location.href.split('?')[1]}`) || {}
149
152
  },
150
153
  getPlanbookData() {
151
- const self = this;
152
- const { URL_PARAM } = self;
153
- const { planbookId, publicPbUuid, uuid } = URL_PARAM;
154
+ const self = this
155
+ const { URL_PARAM } = self
156
+ const { planbookId, publicPbUuid, uuid } = URL_PARAM
154
157
  return getPlanbookData({
155
158
  insuranceTypeId: planbookId || 13767,
156
159
  resultUuid: uuid,
@@ -158,20 +161,19 @@ export default {
158
161
  // publicPbUuid: '5d6499946bbb47bb8f6a286e9d4eee77'
159
162
  })
160
163
  .then(async data => {
161
- await initPageData(data);
162
- setPageDataBaseOnResult(data);
163
- self.planbookData = data;
164
- await self.autoImportData();
165
- self.onChangeTab(1);
164
+ await initPageData(data)
165
+ self.planbookData = data
166
+ await self.autoImportData()
167
+ self.onChangeTab(1)
166
168
  })
167
169
  .catch(error => {
168
- Toast('请求错误');
169
- console.log(error);
170
- });
170
+ Toast('请求错误')
171
+ console.log(error)
172
+ })
171
173
  },
172
174
  autoImportData() {
173
- const { URL_PARAM, inputData } = this;
174
- const { planbookId, publicPbUuid } = URL_PARAM;
175
+ const { URL_PARAM, exportData, inputData } = this
176
+ const { planbookId, publicPbUuid } = URL_PARAM
175
177
  if (inputData) {
176
178
  const gPromises = inputData.productGroupList
177
179
  .filter(g => g.prodOrderList)
@@ -179,35 +181,36 @@ export default {
179
181
  const pPromises = g.prodOrderList.map(p => {
180
182
  return doubleCalcProductData(inputData, {
181
183
  planbookId: Number(planbookId) || 13767,
184
+ executeSource: exportData ? 'import' : 'init',
182
185
  publicPbUuid,
183
186
  groupKey: g.key,
184
187
  productKey: p.key,
185
188
  isIgnoreError: true
186
- });
187
- });
188
- return Promise.all(pPromises);
189
- });
190
- return Promise.all(gPromises);
189
+ })
190
+ })
191
+ return Promise.all(pPromises)
192
+ })
193
+ return Promise.all(gPromises)
191
194
  }
192
- return Promise.resolve();
195
+ return Promise.resolve()
193
196
  },
194
197
  onChangeTab(index) {
195
198
  if (index === 1) {
196
199
  if (this.reduceBaofInsuranceData) {
197
- this.openAddAndTakePopup(this.reduceBaofInsuranceData, 'reduceBaofData');
200
+ this.openAddAndTakePopup(this.reduceBaofInsuranceData, 'reduceBaofData')
198
201
  }
199
202
  if (this.accountInsuranceData) {
200
- this.openAddAndTakePopup(this.accountInsuranceData, 'accountData');
203
+ this.openAddAndTakePopup(this.accountInsuranceData, 'accountData')
201
204
  }
202
- this.takePopupConfig.visible = false;
205
+ this.takePopupConfig.visible = false
203
206
  }
204
207
  },
205
208
  openAddAndTakePopup(insurance, name) {
206
- const { URL_PARAM, inputData, groupData, productData, insuredAge } = this;
207
- const { uuid: resultUuid } = URL_PARAM;
209
+ const { URL_PARAM, inputData, groupData, productData, insuredAge } = this
210
+ const { uuid: resultUuid } = URL_PARAM
208
211
  if (insurance && insurance[name]) {
209
- const isReduceBaof = name === 'reduceBaofData';
210
- const type = isReduceBaof ? 'reduceBaof' : insurance[name].accountPart;
212
+ const isReduceBaof = name === 'reduceBaofData'
213
+ const type = isReduceBaof ? 'reduceBaof' : insurance[name].accountPart
211
214
  const takePopupConfig = {
212
215
  visible: true,
213
216
  title: ADD_AND_TAKE_TITLE_MAP[type],
@@ -240,80 +243,80 @@ export default {
240
243
  customRate: 0.047
241
244
  },
242
245
  params: {}
243
- };
244
- const resultData = convertInputDataToResultData(inputData);
246
+ }
247
+ const resultData = convertInputDataToResultData(inputData)
245
248
  if (resultData) {
246
249
  takePopupConfig.inputData = {
247
250
  personData: resultData.personData,
248
251
  productGroupList: resultData.productGroupList
249
- };
250
- const productGroupList = (resultData.productGroupList || []).filter(g => g.prodOrderList);
252
+ }
253
+ const productGroupList = (resultData.productGroupList || []).filter(g => g.prodOrderList)
251
254
  productGroupList.forEach(g => {
252
- const product = g.prodOrderList.find(p => p.key === takePopupConfig.productKey && p.hadChoice && p.mulInsOrderList);
255
+ const product = g.prodOrderList.find(p => p.key === takePopupConfig.productKey && p.hadChoice && p.mulInsOrderList)
253
256
  product.mulInsOrderList.forEach(ins => {
254
- const { key, account, accountData, reduceBaof, reduceBaofData, duplicateReduceBaofData } = ins;
257
+ const { key, account, accountData, reduceBaof, reduceBaofData, duplicateReduceBaofData } = ins
255
258
  if (name === 'reduceBaofData') {
256
259
  if (account && accountData) {
257
- takePopupConfig.accountData = accountData;
258
- takePopupConfig.accountInsuranceId = key;
260
+ takePopupConfig.accountData = accountData
261
+ takePopupConfig.accountInsuranceId = key
259
262
  }
260
263
  } else {
261
264
  if (reduceBaof && reduceBaofData) {
262
- takePopupConfig.reduceBaofData = reduceBaofData;
263
- takePopupConfig.reduceBaofData2 = duplicateReduceBaofData;
264
- takePopupConfig.reduceBaofInsuranceId = key;
265
+ takePopupConfig.reduceBaofData = reduceBaofData
266
+ takePopupConfig.reduceBaofData2 = duplicateReduceBaofData
267
+ takePopupConfig.reduceBaofInsuranceId = key
265
268
  }
266
269
  }
267
- });
268
- });
270
+ })
271
+ })
269
272
  }
270
- this.takePopupConfig = takePopupConfig;
273
+ this.takePopupConfig = takePopupConfig
271
274
  }
272
275
  },
273
276
  confirmAddAndTake(data) {
274
- const { reduceBaofData, reduceBaofData2, reduceBaofInsuranceId, accountData, accountInsuranceId } = data;
277
+ const { reduceBaofData, reduceBaofData2, reduceBaofInsuranceId, accountData, accountInsuranceId } = data
275
278
  this.productData.mulInsOrderList.forEach(ins => {
276
279
  if (ins.key === reduceBaofInsuranceId) {
277
280
  if (reduceBaofData) {
278
- ins.reduceBaofData = reduceBaofData;
281
+ ins.reduceBaofData = reduceBaofData
279
282
  }
280
283
  if (reduceBaofData2) {
281
- ins.duplicateReduceBaofData = reduceBaofData2;
284
+ ins.duplicateReduceBaofData = reduceBaofData2
282
285
  }
283
286
  }
284
287
  if (ins.key === accountInsuranceId) {
285
288
  if (accountData) {
286
- ins.accountData = accountData;
289
+ ins.accountData = accountData
287
290
  }
288
291
  }
289
- });
290
- this.takePopupConfig = initAddAndTakePopupConfig();
291
- console.log(data);
292
- Toast('追加领取成功');
292
+ })
293
+ this.takePopupConfig = initAddAndTakePopupConfig()
294
+ console.log(data)
295
+ Toast('追加领取成功')
293
296
  },
294
297
  onClickNormalConfirm() {
295
- const refAddAndTake = this.$refs.AddAndTake;
298
+ const refAddAndTake = this.$refs.AddAndTake
296
299
  refAddAndTake
297
300
  .confirm()
298
301
  .then(data => {
299
- this.confirmAddAndTake(data);
302
+ this.confirmAddAndTake(data)
300
303
  })
301
304
  .catch(error => {
302
- console.log(error);
303
- });
305
+ console.log(error)
306
+ })
304
307
  },
305
308
  closeAddAndTake() {
306
- const { $refs, takePopupConfig } = this;
309
+ const { $refs, takePopupConfig } = this
307
310
  if (!takePopupConfig.visible) {
308
- const refAddAndTake = $refs.AddAndTake;
311
+ const refAddAndTake = $refs.AddAndTake
309
312
  if (refAddAndTake && refAddAndTake.subName === 'Form') {
310
- refAddAndTake.goToTable();
311
- takePopupConfig.visible = true;
313
+ refAddAndTake.goToTable()
314
+ takePopupConfig.visible = true
312
315
  }
313
316
  }
314
317
  }
315
318
  }
316
- };
319
+ }
317
320
  </script>
318
321
  <style>
319
322
  .bxt_addtake_demo {
@@ -1,7 +1,7 @@
1
1
  import { formatNumberToThousand } from 'packages/bxs-utils/planbook/index'
2
2
  import { get as _get } from 'lodash'
3
3
 
4
- export function initAddAndTakePopupConfig () {
4
+ export function initAddAndTakePopupConfig() {
5
5
  return {
6
6
  visible: false,
7
7
  title: '',
@@ -24,22 +24,22 @@ export function initAddAndTakePopupConfig () {
24
24
  }
25
25
  }
26
26
 
27
- export function initDefaultAddAndTakeData (type) {
28
- const data : any = {
27
+ export function initDefaultAddAndTakeData(type) {
28
+ const data: any = {
29
29
  accountPart: type,
30
30
  accountName: '',
31
- addAndTakeData: [],
31
+ addAndTakeData: []
32
32
  }
33
33
  if (['addAndTake', 'add'].includes(data.accountPart)) {
34
34
  data.addAndTakeData.push({
35
35
  key: 'add',
36
- adjustData: [],
36
+ adjustData: []
37
37
  })
38
38
  }
39
39
  if (['addAndTake', 'take', 'reduceBaof'].includes(data.accountPart)) {
40
40
  data.addAndTakeData.push({
41
41
  key: 'take',
42
- adjustData: [],
42
+ adjustData: []
43
43
  })
44
44
  }
45
45
  return data
@@ -59,17 +59,14 @@ export function initInterestData(data) {
59
59
  if (k === 'rate') {
60
60
  data[k].title = '账户利率'
61
61
  if (data[k].opts) {
62
- data[k].opts.forEach((o) => {
62
+ data[k].opts.forEach(o => {
63
63
  o.description = getBonusDesc(o)
64
64
  })
65
65
  }
66
66
  }
67
67
  if (k === 'bonusRateData') {
68
68
  for (const kk in data[k]) {
69
- if (
70
- data[k][kk]
71
- && ['highestEndBonusRate', 'highestYearBonusRate', 'latestEndBonusRate', 'latestYearBonusRate'].includes(kk)
72
- ) {
69
+ if (data[k][kk] && ['highestEndBonusRate', 'highestYearBonusRate', 'latestEndBonusRate', 'latestYearBonusRate'].includes(kk)) {
73
70
  data[k][kk] = Number((data[k][kk] * 100).toFixed(0))
74
71
  }
75
72
  }
@@ -87,7 +84,7 @@ export function getBonusDesc(option) {
87
84
  }
88
85
 
89
86
  export function initInterestFormValues(values, data) {
90
- const formData : any = {
87
+ const formData: any = {
91
88
  bonus: null,
92
89
  customBonusRate: null,
93
90
  rate: null,
@@ -101,7 +98,7 @@ export function initInterestFormValues(values, data) {
101
98
  monthRate: null
102
99
  }
103
100
  if (data) {
104
- Object.keys(formData).forEach((k) => {
101
+ Object.keys(formData).forEach(k => {
105
102
  if (data[k]) {
106
103
  if (['bonus', 'rate', 'takeType', 'bonusTake', 'pensionTake'].includes(k)) {
107
104
  formData[k] = data[k].value
@@ -112,7 +109,7 @@ export function initInterestFormValues(values, data) {
112
109
  })
113
110
  }
114
111
  if (values) {
115
- Object.keys(values).forEach((k) => {
112
+ Object.keys(values).forEach(k => {
116
113
  if (values[k]) {
117
114
  formData[k] = values[k]
118
115
  }
@@ -142,14 +139,14 @@ export function initInterestFormValues(values, data) {
142
139
  }
143
140
 
144
141
  export function convertInterestFormValues(values, data) {
145
- let formValues : any = {}
142
+ let formValues: any = {}
146
143
  if (values) {
147
144
  formValues = values
148
145
 
149
146
  const _rate = _get(data, 'rate.opts[3].value')
150
147
  const _highestYearBonusRate = _get(data, 'bonusRateData.highestYearBonusRate')
151
148
  const _highestEndBonusRate = _get(data, 'bonusRateData.highestEndBonusRate')
152
-
149
+
153
150
  const { bonus, customBonusRate, rate, customRate } = values
154
151
  const _yearBonusRate = bonus === '_custom' ? customBonusRate || _highestYearBonusRate : null
155
152
  const _endBonusRate = bonus === '_custom' ? customBonusRate || _highestEndBonusRate : null
@@ -165,19 +162,19 @@ export function convertInterestFormValues(values, data) {
165
162
  return formValues
166
163
  }
167
164
 
168
- export function getBeginYearOpts(values, options : any = {}) {
165
+ export function getBeginYearOpts(values, options: any = {}) {
169
166
  const { data, startPolicyNo, startIndex, age, adjustData } = options
170
167
  if (!data) {
171
168
  return []
172
169
  }
173
170
  const maxLength = data.reduce((a, b) => Math.max(a, b.values.length), 0)
174
- let yearOptions : any = []
171
+ let yearOptions: any = []
175
172
  for (let i = 0; i < maxLength; i++) {
176
173
  const year = i + (startPolicyNo || 1)
177
174
  if (year >= values.beginYear) {
178
175
  yearOptions.push({
179
176
  val: year,
180
- desc: `第${year}年, ${age + (startIndex || 0) + i + 1}岁`,
177
+ desc: `第${year}年, ${age + (startIndex || 0) + i + 1}岁`
181
178
  })
182
179
  }
183
180
  }
@@ -196,16 +193,16 @@ export function rebuildAccountDataBySetting(values, accountData) {
196
193
  return accountData
197
194
  }
198
195
 
199
- const adjustYears : any = []
196
+ const adjustYears: any = []
200
197
  const tempAddAndTake = _addAndTakeData.find(a => a.key === values.type)
201
198
  const adjustData = _get(tempAddAndTake, 'adjustData') || []
202
- adjustData.map((ad) => {
199
+ adjustData.map(ad => {
203
200
  for (let k = ad[0]; k <= ad[1]; k++) {
204
201
  adjustYears.push([
205
202
  k, // 开始年度
206
203
  k, // 结束年度
207
204
  ad[2], // 金额
208
- ad[3], // 用途
205
+ ad[3] // 用途
209
206
  ])
210
207
  }
211
208
  })
@@ -222,11 +219,11 @@ export function rebuildAccountDataBySetting(values, accountData) {
222
219
  }
223
220
  adjustYears.sort((a, b) => a[0] - b[0])
224
221
 
225
- const tempAdjust : any = []
226
- adjustYears.forEach((item : any) => {
222
+ const tempAdjust: any = []
223
+ adjustYears.forEach((item: any) => {
227
224
  const length = tempAdjust.length
228
- const last : any = length && tempAdjust[length - 1]
229
- if (last && (last[2] + last[3]) === (item[2] + item[3]) && last[1] + 1 === item[0]) {
225
+ const last: any = length && tempAdjust[length - 1]
226
+ if (last && last[2] + last[3] === item[2] + item[3] && last[1] + 1 === item[0]) {
230
227
  last[1] = item[0]
231
228
  return
232
229
  }
@@ -234,11 +231,10 @@ export function rebuildAccountDataBySetting(values, accountData) {
234
231
  })
235
232
  if (tempAddAndTake) {
236
233
  tempAddAndTake.adjustData = tempAdjust.filter(ad => !!ad[2])
237
- }
238
- else {
234
+ } else {
239
235
  accountData.addAndTakeData.push({
240
236
  key: values.type,
241
- adjustData: tempAdjust.filter(ad => !!ad[2]),
237
+ adjustData: tempAdjust.filter(ad => !!ad[2])
242
238
  })
243
239
  }
244
240
  return accountData
@@ -248,8 +244,8 @@ export function rebuildAccountDataByResult(detailsData, accountData, options = {
248
244
  if (!detailsData || !accountData || !accountData.addAndTakeData) {
249
245
  return accountData
250
246
  }
251
- const columnKey = _get(options, 'columnKey');
252
- accountData.addAndTakeData.forEach((item) => {
247
+ const columnKey = _get(options, 'columnKey')
248
+ accountData.addAndTakeData.forEach(item => {
253
249
  const correspondingDetailsDataKey = columnKey || item.key
254
250
  const detailData = detailsData.find(e => e.key === correspondingDetailsDataKey)
255
251
  const values = detailData && detailData.values
@@ -258,21 +254,21 @@ export function rebuildAccountDataByResult(detailsData, accountData, options = {
258
254
  item.adjustData = []
259
255
  return
260
256
  }
261
- const adjustData : any = []
257
+ const adjustData: any = []
262
258
  values.forEach((ele, index) => {
263
259
  if (!ele) {
264
260
  return
265
261
  }
266
- const lastAdjustData : any = adjustData[Math.max(0, adjustData.length - 1)]
262
+ const lastAdjustData: any = adjustData[Math.max(0, adjustData.length - 1)]
267
263
  if (lastAdjustData && lastAdjustData[1] === index && lastAdjustData[2] === ele && (!details || details[index] === lastAdjustData[3])) {
268
264
  lastAdjustData[1] = index + 1
269
265
  return
270
266
  }
271
- const adjustDataItem : any = [
267
+ const adjustDataItem: any = [
272
268
  index + 1, // 开始年度
273
269
  index + 1, // 结束年度
274
270
  ele, // 金额
275
- details && details[index] ? details[index] : '', // 用途
271
+ details && details[index] ? details[index] : '' // 用途
276
272
  ]
277
273
  adjustData.push(adjustDataItem)
278
274
  })
@@ -281,12 +277,12 @@ export function rebuildAccountDataByResult(detailsData, accountData, options = {
281
277
  return accountData
282
278
  }
283
279
 
284
- export function getEnsureCanTakeAmount(initialData, options : any = {}) {
280
+ export function getEnsureCanTakeAmount(initialData, options: any = {}) {
285
281
  if (!initialData || !options) {
286
282
  return 0
287
283
  }
288
- const { beginYear, endYear } : any = options
289
- const rate : any = options.rate + 1
284
+ const { beginYear, endYear }: any = options
285
+ const rate: any = options.rate + 1
290
286
  const accountValue = initialData.find(ele => ele.uniKey === 'account_value_1')
291
287
  let ensureAmount = 0
292
288
  if (beginYear && endYear && rate && accountValue && accountValue.values) {
@@ -299,10 +295,7 @@ export function getEnsureCanTakeAmount(initialData, options : any = {}) {
299
295
  const numMaxlength = accountValue && accountValue.values ? accountValue.values.length : 0
300
296
  if (beginYear && endYear && numMaxlength && endYear <= numMaxlength) {
301
297
  for (let i = endYear + 1; i <= numMaxlength; i++) {
302
- ensureAmount = Math.min(
303
- ensureAmount,
304
- accountValue.values[i - 1] / (endYear - beginYear + 1) / rate ** (i - (beginYear + endYear - 1) / 2),
305
- )
298
+ ensureAmount = Math.min(ensureAmount, accountValue.values[i - 1] / (endYear - beginYear + 1) / rate ** (i - (beginYear + endYear - 1) / 2))
306
299
  }
307
300
  }
308
301
 
@@ -311,31 +304,33 @@ export function getEnsureCanTakeAmount(initialData, options : any = {}) {
311
304
  }
312
305
 
313
306
  export function calcColumnsWidth(tableData) {
314
- const widthObj : any = {}
307
+ const widthObj: any = {}
315
308
  if (tableData && tableData.length) {
316
309
  const keys = Object.keys(tableData[0]).concat('purpose', 'purpose2')
317
- keys.forEach((k) => {
310
+ keys.forEach(k => {
318
311
  widthObj[k] = 0
319
312
  })
320
- keys.forEach((k) => {
321
- tableData.filter((e, i) => i !== 0).forEach((e, i) => {
322
- let contentCount = 0
323
- if (['purpose', 'purpose2'].includes(k)) {
324
- if (e[k]) {
325
- contentCount = e[k].length * 10 / 12 + 0.5
313
+ keys.forEach(k => {
314
+ tableData
315
+ .filter((e, i) => i !== 0)
316
+ .forEach((e, i) => {
317
+ let contentCount = 0
318
+ if (['purpose', 'purpose2'].includes(k)) {
319
+ if (e[k]) {
320
+ contentCount = (e[k].length * 10) / 12 + 0.5
321
+ }
322
+ } else {
323
+ contentCount = formatNumberToThousand(e[k]).length * 0.5 + 0.5
326
324
  }
327
- } else {
328
- contentCount = formatNumberToThousand(e[k]).length * 0.5 + 0.5
329
- }
330
- widthObj[k] = Math.max(contentCount, widthObj[k])
331
- })
325
+ widthObj[k] = Math.max(contentCount, widthObj[k])
326
+ })
332
327
  })
333
328
  for (const k in widthObj) {
334
329
  if (['take', 'draw_value'].includes(k)) {
335
- widthObj[k] += (widthObj.purpose || 0)
330
+ widthObj[k] += widthObj.purpose || 0
336
331
  }
337
332
  if (['draw_value2'].includes(k)) {
338
- widthObj[k] += (widthObj.purpose2 || 0)
333
+ widthObj[k] += widthObj.purpose2 || 0
339
334
  }
340
335
  }
341
336
  for (const k in widthObj) {
@@ -0,0 +1,69 @@
1
+ @import (reference) 'variables.less';
2
+ @import 'color.less';
3
+
4
+ .bxt_add_and_take {
5
+ display: flex;
6
+ flex-direction: column;
7
+ height: 100%;
8
+ background: white;
9
+
10
+ & .bxt_add_and_take_tips {
11
+ margin-bottom: 8px;
12
+ font-size: 13px;
13
+ text-align: center;
14
+ color: var(--bxt-text-patch);
15
+ }
16
+
17
+ & .bxt_add_and_take_footer {
18
+ .bxt-safe-area-inset-bottom();
19
+
20
+ position: fixed;
21
+ bottom: 0;
22
+ left: 0;
23
+ width: 100%;
24
+ padding: 7px 16px;
25
+ background: white;
26
+ box-shadow: 0 -6px 10px 0 rgba(23, 32, 77, 0.05);
27
+ box-sizing: border-box;
28
+ z-index: 2;
29
+
30
+ & .bxt_add_and_take_footer_wrapper {
31
+ display: flex;
32
+ font-size: 14px;
33
+ line-height: 20px;
34
+
35
+ & .bxt_item {
36
+ flex: 1;
37
+ margin-right: 12px;
38
+ padding: 7px 0;
39
+ color: var(--bxt-text-primary);
40
+ border: 1px solid var(--bxt-line-split);
41
+ background: white;
42
+ border-radius: 8px;
43
+ text-align: center;
44
+ }
45
+
46
+ & .bxt_item.primary {
47
+ color: white;
48
+ border: 1px solid var(--bxt-primary);
49
+ background: var(--bxt-primary);
50
+ }
51
+
52
+ & .bxt_item.minor {
53
+ color: var(--bxt-primary);
54
+ border: 1px solid var(--bxt-primary);
55
+ background: white;
56
+ }
57
+
58
+ & .bxt_item.disabled {
59
+ color: white;
60
+ border: 1px solid transparent;
61
+ background: rgba(2, 92, 234, 0.3);
62
+ }
63
+
64
+ & .bxt_item:last-child {
65
+ margin-right: 0;
66
+ }
67
+ }
68
+ }
69
+ }