bxs-tools-ui 3.2.0 → 3.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +20 -20
- package/es/add-and-take/index.css +1 -1
- package/es/add-and-take/index.js +283 -64
- package/es/adjust-baoe/index.css +1 -1
- package/es/adjust-baoe/index.js +444 -195
- package/es/business-card/index.css +1 -1
- package/es/business-card/index.js +1 -0
- package/es/canvas-poster/index.css +1 -1
- package/es/canvas-poster/index.js +1 -0
- package/es/index.css +1 -1
- package/es/index.js +936 -824
- package/es/insure-calculate/index.css +1 -1
- package/es/insure-calculate/index.js +438 -265
- package/es/person-info/index.css +1 -1
- package/es/person-info/index.js +296 -1370
- package/es/product-info/index.css +1 -1
- package/es/product-info/index.js +644 -548
- package/es/share-sheet/index.css +1 -1
- package/es/share-sheet/index.js +313 -21
- package/es/utils/index.js +530 -429
- package/lib/add-and-take/index.css +1 -1
- package/lib/add-and-take/index.js +283 -64
- package/lib/adjust-baoe/index.css +1 -1
- package/lib/adjust-baoe/index.js +441 -194
- package/lib/business-card/index.css +1 -1
- package/lib/business-card/index.js +1 -0
- package/lib/canvas-poster/index.css +1 -1
- package/lib/canvas-poster/index.js +1 -0
- package/lib/index.css +1 -1
- package/lib/index.js +939 -826
- package/lib/insure-calculate/index.css +1 -1
- package/lib/insure-calculate/index.js +438 -268
- package/lib/person-info/index.css +1 -1
- package/lib/person-info/index.js +295 -1372
- package/lib/product-info/index.css +1 -1
- package/lib/product-info/index.js +645 -550
- package/lib/share-sheet/index.css +1 -1
- package/lib/share-sheet/index.js +313 -25
- package/lib/utils/index.js +531 -433
- package/package.json +9 -7
- package/packages/add-and-take/components/interest-form.less +144 -0
- package/packages/add-and-take/components/interest-form.vue +179 -179
- package/packages/add-and-take/components/interest-items.less +87 -0
- package/packages/add-and-take/components/interest-items.vue +67 -80
- package/packages/add-and-take/components/interest-table.less +111 -0
- package/packages/add-and-take/components/interest-table.vue +31 -31
- package/packages/add-and-take/constant.ts +2 -2
- package/packages/add-and-take/demo/index.vue +89 -86
- package/packages/add-and-take/handler.ts +52 -57
- package/packages/add-and-take/index.less +69 -0
- package/packages/add-and-take/index.vue +156 -156
- package/packages/add-and-take/readme.md +87 -98
- package/packages/adjust-baoe/demo/index.vue +37 -47
- package/packages/adjust-baoe/index.less +125 -0
- package/packages/adjust-baoe/index.vue +134 -147
- package/packages/adjust-baoe/readme.md +35 -45
- package/packages/business-card/demo/index.vue +7 -7
- package/packages/business-card/index.less +100 -0
- package/packages/business-card/index.vue +18 -21
- package/packages/business-card/readme.md +46 -53
- package/packages/bxs-utils/demo/index.vue +2 -2
- package/packages/bxs-utils/index.ts +5 -5
- package/packages/bxs-utils/planbook/common.ts +56 -92
- package/packages/bxs-utils/planbook/index.ts +4 -4
- package/packages/bxs-utils/planbook/insurance.ts +137 -127
- package/packages/bxs-utils/planbook/person.ts +143 -147
- package/packages/bxs-utils/planbook/product.ts +473 -509
- package/packages/bxs-utils/readme.md +94 -84
- package/packages/bxs-utils/trade/index.js +1 -1
- package/packages/bxs-utils/trade/insureCalculate.js +91 -204
- package/packages/canvas-poster/demo/index.vue +9 -13
- package/packages/canvas-poster/index.less +5 -0
- package/packages/canvas-poster/index.vue +68 -79
- package/packages/canvas-poster/readme.md +106 -109
- package/packages/index.ts +1 -1
- package/packages/insure-calculate/demo/index.vue +20 -20
- package/packages/insure-calculate/index.less +366 -0
- package/packages/insure-calculate/index.vue +305 -329
- package/packages/insure-calculate/readme.md +99 -106
- package/packages/person-info/crm-popup.vue +81 -80
- package/packages/person-info/demo/index.vue +25 -37
- package/packages/person-info/index-inline.less +11 -0
- package/packages/person-info/index.vue +53 -83
- package/packages/person-info/readme.md +109 -115
- package/packages/planbook-input/components/footer.less +54 -0
- package/packages/planbook-input/components/footer.vue +8 -64
- package/packages/planbook-input/components/handler.js +33 -44
- package/packages/planbook-input/components/product-table.less +235 -0
- package/packages/planbook-input/components/product-table.vue +114 -108
- package/packages/planbook-input/demo/index.vue +3 -3
- package/packages/planbook-input/helper.js +852 -465
- package/packages/planbook-input/index.less +30 -0
- package/packages/planbook-input/index.vue +86 -103
- package/packages/planbook-input/readme.md +72 -90
- package/packages/product-info/demo/constant.js +1 -1
- package/packages/product-info/demo/index.vue +31 -43
- package/packages/product-info/index.less +271 -0
- package/packages/product-info/index.vue +198 -210
- package/packages/product-info/readme.md +72 -75
- package/packages/share-sheet/constant.js +4 -4
- package/packages/share-sheet/demo/index.vue +10 -10
- package/packages/share-sheet/handler.js +14 -14
- package/packages/share-sheet/index.less +201 -0
- package/packages/share-sheet/index.vue +39 -39
- package/packages/share-sheet/readme.md +121 -127
- package/src/api/add-and-take.js +45 -0
- package/src/api/adjust-baoe.js +16 -0
- package/src/api/index.js +6 -0
- package/src/api/planbook.js +93 -0
- package/src/api/request.js +211 -0
- package/src/api/trade.js +56 -0
- package/src/api/user.js +18 -0
- package/src/components/common/common-age-birthday.less +66 -0
- package/src/components/common/common-age-birthday.vue +27 -95
- package/src/components/common/common-popup.less +81 -0
- package/src/components/common/common-popup.vue +12 -96
- package/src/components/common/common-radio.less +75 -0
- package/src/components/common/common-radio.vue +13 -91
- package/src/components/common/common-select.less +13 -0
- package/src/components/common/common-select.vue +21 -38
- package/src/components/common/common-title.less +115 -0
- package/src/components/common/common-title.vue +24 -24
- package/src/js/loading.js +6 -6
- package/src/js/md5Token.js +38 -44
- package/src/js/utils.js +45 -53
- package/src/js/variables.js +47 -25
- package/src/style/base.less +18 -0
- package/src/style/color.less +40 -0
- package/src/style/variables.less +21 -42
- package/packages/add-and-take/api.ts +0 -70
- package/packages/add-and-take/components/interest-form.css +0 -146
- package/packages/add-and-take/components/interest-items.css +0 -87
- package/packages/add-and-take/components/interest-table.css +0 -113
- package/packages/add-and-take/index.css +0 -70
- package/packages/adjust-baoe/index.css +0 -123
- package/packages/business-card/index.css +0 -101
- package/packages/canvas-poster/index.css +0 -5
- package/packages/insure-calculate/index.css +0 -368
- package/packages/planbook-input/api.js +0 -29
- package/packages/planbook-input/components/product-table.css +0 -236
- package/packages/planbook-input/index.css +0 -31
- package/packages/product-info/index.css +0 -264
- package/packages/share-sheet/index.css +0 -203
- package/src/components/common/common-title.css +0 -116
- package/src/js/request.js +0 -64
- package/src/style/apply.css +0 -25
- package/src/style/base.css +0 -36
- package/src/style/color.css +0 -74
|
@@ -52,16 +52,16 @@
|
|
|
52
52
|
</template>
|
|
53
53
|
|
|
54
54
|
<script>
|
|
55
|
-
import Vue from 'vue'
|
|
56
|
-
import Vant from 'vant'
|
|
57
|
-
import { Toast, Dialog } from 'vant'
|
|
58
|
-
import { get as _get, cloneDeep } from 'lodash'
|
|
59
|
-
import { initInsuranceInterest, getInsuranceInterestDetail } from '
|
|
60
|
-
import { PURPOSE_OPTIONS } from './constant.ts'
|
|
55
|
+
import Vue from 'vue'
|
|
56
|
+
import Vant from 'vant'
|
|
57
|
+
import { Toast, Dialog } from 'vant'
|
|
58
|
+
import { get as _get, cloneDeep } from 'lodash'
|
|
59
|
+
import { initInsuranceInterest, getInsuranceInterestDetail } from '../../src/api/add-and-take.js'
|
|
60
|
+
import { PURPOSE_OPTIONS } from './constant.ts'
|
|
61
61
|
|
|
62
|
-
import InterestForm from './components/interest-form.vue'
|
|
63
|
-
import InterestItems from './components/interest-items.vue'
|
|
64
|
-
import InterestTable from './components/interest-table.vue'
|
|
62
|
+
import InterestForm from './components/interest-form.vue'
|
|
63
|
+
import InterestItems from './components/interest-items.vue'
|
|
64
|
+
import InterestTable from './components/interest-table.vue'
|
|
65
65
|
import {
|
|
66
66
|
convertInterestFormValues,
|
|
67
67
|
initInterestData,
|
|
@@ -69,10 +69,10 @@ import {
|
|
|
69
69
|
initInterestFormValues,
|
|
70
70
|
rebuildAccountDataByResult,
|
|
71
71
|
rebuildAccountDataBySetting
|
|
72
|
-
} from './handler'
|
|
73
|
-
import './index.
|
|
72
|
+
} from './handler'
|
|
73
|
+
import './index.less'
|
|
74
74
|
|
|
75
|
-
Vue.use(Vant)
|
|
75
|
+
Vue.use(Vant)
|
|
76
76
|
export default {
|
|
77
77
|
components: {
|
|
78
78
|
InterestItems,
|
|
@@ -130,102 +130,102 @@ export default {
|
|
|
130
130
|
addAndTakeDetailData: null,
|
|
131
131
|
formData: {},
|
|
132
132
|
interestFormValue: {}
|
|
133
|
-
}
|
|
133
|
+
}
|
|
134
134
|
},
|
|
135
135
|
computed: {
|
|
136
136
|
cpInputData() {
|
|
137
|
-
return cloneDeep(this.inputData)
|
|
137
|
+
return cloneDeep(this.inputData)
|
|
138
138
|
},
|
|
139
139
|
productData() {
|
|
140
|
-
const { cpInputData, groupKey, productKey } = this
|
|
141
|
-
const groupData = (_get(cpInputData, 'productGroupList') || []).find(g => g.key === groupKey)
|
|
142
|
-
return (_get(groupData, 'prodOrderList') || []).find(p => p.key === productKey)
|
|
140
|
+
const { cpInputData, groupKey, productKey } = this
|
|
141
|
+
const groupData = (_get(cpInputData, 'productGroupList') || []).find(g => g.key === groupKey)
|
|
142
|
+
return (_get(groupData, 'prodOrderList') || []).find(p => p.key === productKey)
|
|
143
143
|
},
|
|
144
144
|
insuranceKey() {
|
|
145
|
-
return this.type === 'reduceBaof' ? this.reduceBaofInsuranceId : this.accountInsuranceId
|
|
145
|
+
return this.type === 'reduceBaof' ? this.reduceBaofInsuranceId : this.accountInsuranceId
|
|
146
146
|
},
|
|
147
147
|
knowledgeData() {
|
|
148
|
-
return _get(this, 'interestInitData.knowledgeData') || []
|
|
148
|
+
return _get(this, 'interestInitData.knowledgeData') || []
|
|
149
149
|
},
|
|
150
150
|
minTakeYear() {
|
|
151
|
-
const { type, periodNum, knowledgeData } = this
|
|
152
|
-
let minYear = 0
|
|
151
|
+
const { type, periodNum, knowledgeData } = this
|
|
152
|
+
let minYear = 0
|
|
153
153
|
if (type === 'reduceBaof') {
|
|
154
|
-
minYear = Number(periodNum)
|
|
155
|
-
const startTime = knowledgeData.find(e => e.key === 'start_time')
|
|
156
|
-
const startTimeValue = Number(_get(startTime, 'value'))
|
|
154
|
+
minYear = Number(periodNum)
|
|
155
|
+
const startTime = knowledgeData.find(e => e.key === 'start_time')
|
|
156
|
+
const startTimeValue = Number(_get(startTime, 'value'))
|
|
157
157
|
if (startTimeValue && startTimeValue !== -1) {
|
|
158
|
-
minYear = startTimeValue || 0
|
|
158
|
+
minYear = startTimeValue || 0
|
|
159
159
|
}
|
|
160
160
|
}
|
|
161
|
-
return Math.max(minYear, 0)
|
|
161
|
+
return Math.max(minYear, 0)
|
|
162
162
|
},
|
|
163
163
|
isShowTips() {
|
|
164
|
-
const mulInsOrderList = _get(this.productData, 'mulInsOrderList') || []
|
|
165
|
-
const hasReduceBaof = mulInsOrderList.find(ins => ins.reduceBaof && ins.reduceBaofData)
|
|
166
|
-
const hasAccountTake = mulInsOrderList.find(ins => ins.account && ins.accountData)
|
|
167
|
-
return hasReduceBaof && hasAccountTake
|
|
164
|
+
const mulInsOrderList = _get(this.productData, 'mulInsOrderList') || []
|
|
165
|
+
const hasReduceBaof = mulInsOrderList.find(ins => ins.reduceBaof && ins.reduceBaofData)
|
|
166
|
+
const hasAccountTake = mulInsOrderList.find(ins => ins.account && ins.accountData)
|
|
167
|
+
return hasReduceBaof && hasAccountTake
|
|
168
168
|
}
|
|
169
169
|
},
|
|
170
170
|
watch: {
|
|
171
171
|
subName: {
|
|
172
172
|
handler(name) {
|
|
173
|
-
this.$emit('update:submoduleName', name)
|
|
173
|
+
this.$emit('update:submoduleName', name)
|
|
174
174
|
}
|
|
175
175
|
}
|
|
176
176
|
},
|
|
177
177
|
created() {
|
|
178
|
-
this.subName = this.submoduleName
|
|
179
|
-
this.addAndTakeRecordData = this.initAddAndTakeRecordData()
|
|
180
|
-
this.getInitInterestData()
|
|
178
|
+
this.subName = this.submoduleName
|
|
179
|
+
this.addAndTakeRecordData = this.initAddAndTakeRecordData()
|
|
180
|
+
this.getInitInterestData()
|
|
181
181
|
},
|
|
182
182
|
methods: {
|
|
183
183
|
initAddAndTakeRecordData() {
|
|
184
|
-
const { type, accountData, reduceBaofData } = this
|
|
185
|
-
let recordData = ['reduceBaof'].includes(type) ? reduceBaofData : accountData
|
|
184
|
+
const { type, accountData, reduceBaofData } = this
|
|
185
|
+
let recordData = ['reduceBaof'].includes(type) ? reduceBaofData : accountData
|
|
186
186
|
if (!_get(recordData, 'addAndTakeData.length')) {
|
|
187
|
-
recordData = initDefaultAddAndTakeData(type)
|
|
187
|
+
recordData = initDefaultAddAndTakeData(type)
|
|
188
188
|
if (_get(recordData, 'accountName')) {
|
|
189
|
-
recordData.accountName = _get(recordData, 'accountName')
|
|
189
|
+
recordData.accountName = _get(recordData, 'accountName')
|
|
190
190
|
}
|
|
191
191
|
}
|
|
192
|
-
return cloneDeep(recordData)
|
|
192
|
+
return cloneDeep(recordData)
|
|
193
193
|
},
|
|
194
194
|
getInitInterestData() {
|
|
195
|
-
const { scene, resultUuid, productKey, insuranceKey, interestData, currentReduceBaofData2 } = this
|
|
195
|
+
const { scene, resultUuid, productKey, insuranceKey, interestData, currentReduceBaofData2 } = this
|
|
196
196
|
const reqParams = {
|
|
197
197
|
uuid: resultUuid,
|
|
198
198
|
pbData: resultUuid ? '' : JSON.stringify(this.getPureInputDataForRequest()),
|
|
199
199
|
productId: productKey,
|
|
200
200
|
insuranceId: insuranceKey
|
|
201
|
-
}
|
|
201
|
+
}
|
|
202
202
|
return initInsuranceInterest(reqParams, { scene })
|
|
203
203
|
.then(data => {
|
|
204
204
|
if (data) {
|
|
205
|
-
this.interestInitData = initInterestData(data)
|
|
206
|
-
this.interestFormValue = initInterestFormValues(interestData, this.interestInitData)
|
|
205
|
+
this.interestInitData = initInterestData(data)
|
|
206
|
+
this.interestFormValue = initInterestFormValues(interestData, this.interestInitData)
|
|
207
207
|
if (data.duplicateFlag) {
|
|
208
208
|
if (!_get(currentReduceBaofData2, 'addAndTakeData.length')) {
|
|
209
|
-
this.currentReduceBaofData2 = initDefaultAddAndTakeData('take')
|
|
209
|
+
this.currentReduceBaofData2 = initDefaultAddAndTakeData('take')
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
|
-
this.getAddAndTakeData()
|
|
212
|
+
this.getAddAndTakeData()
|
|
213
213
|
}
|
|
214
214
|
})
|
|
215
215
|
.catch(error => {
|
|
216
|
-
let errorMsg = ''
|
|
216
|
+
let errorMsg = ''
|
|
217
217
|
if (error && typeof error === 'string') {
|
|
218
|
-
errorMsg = error
|
|
218
|
+
errorMsg = error
|
|
219
219
|
}
|
|
220
220
|
if (errorMsg) {
|
|
221
|
-
Toast(error)
|
|
221
|
+
Toast(error)
|
|
222
222
|
}
|
|
223
|
-
console.log(error)
|
|
224
|
-
})
|
|
223
|
+
console.log(error)
|
|
224
|
+
})
|
|
225
225
|
},
|
|
226
226
|
async getAddAndTakeData(newRecordData = null, oFormValue, params = {}) {
|
|
227
|
-
const self = this
|
|
228
|
-
const columnKey = _get(params, 'columnKey')
|
|
227
|
+
const self = this
|
|
228
|
+
const columnKey = _get(params, 'columnKey')
|
|
229
229
|
const {
|
|
230
230
|
scene,
|
|
231
231
|
resultUuid,
|
|
@@ -241,9 +241,9 @@ export default {
|
|
|
241
241
|
currentReduceBaofData2,
|
|
242
242
|
addAndTakeRecordData,
|
|
243
243
|
interestInitData
|
|
244
|
-
} = self
|
|
244
|
+
} = self
|
|
245
245
|
|
|
246
|
-
const _formValus = await self.validateInterestFormValues().catch(() => {})
|
|
246
|
+
const _formValus = await self.validateInterestFormValues().catch(() => {})
|
|
247
247
|
if (_formValus) {
|
|
248
248
|
const {
|
|
249
249
|
bonus,
|
|
@@ -258,11 +258,11 @@ export default {
|
|
|
258
258
|
bonusShowSelector,
|
|
259
259
|
yearRate,
|
|
260
260
|
monthRate
|
|
261
|
-
} = _formValus
|
|
262
|
-
const effectAddAndTakeData = _get(newRecordData || addAndTakeRecordData, 'addAndTakeData') || null
|
|
263
|
-
const reduceAddAndTakeData = _get(addAndTakeRecordData, 'addAndTakeData') || null
|
|
264
|
-
const reduce2AddAndTakeData = _get(currentReduceBaofData2, 'addAndTakeData') || null
|
|
265
|
-
const isReduceBaof = type === 'reduceBaof'
|
|
261
|
+
} = _formValus
|
|
262
|
+
const effectAddAndTakeData = _get(newRecordData || addAndTakeRecordData, 'addAndTakeData') || null
|
|
263
|
+
const reduceAddAndTakeData = _get(addAndTakeRecordData, 'addAndTakeData') || null
|
|
264
|
+
const reduce2AddAndTakeData = _get(currentReduceBaofData2, 'addAndTakeData') || null
|
|
265
|
+
const isReduceBaof = type === 'reduceBaof'
|
|
266
266
|
const reqParams = {
|
|
267
267
|
uuid: resultUuid,
|
|
268
268
|
pbData: resultUuid ? '' : JSON.stringify(this.getPureInputDataForRequest()),
|
|
@@ -280,34 +280,34 @@ export default {
|
|
|
280
280
|
bonusShowSelector,
|
|
281
281
|
yearRate,
|
|
282
282
|
monthRate
|
|
283
|
-
}
|
|
283
|
+
}
|
|
284
284
|
// 这里是为支持双减保领取,即保证和红利两档都可以领取
|
|
285
285
|
if (isReduceBaof) {
|
|
286
286
|
if (!columnKey) {
|
|
287
|
-
reqParams.drawData = effectAddAndTakeData
|
|
288
|
-
reqParams.duplicateDrawData = reduce2AddAndTakeData
|
|
287
|
+
reqParams.drawData = effectAddAndTakeData
|
|
288
|
+
reqParams.duplicateDrawData = reduce2AddAndTakeData
|
|
289
289
|
}
|
|
290
290
|
if (columnKey === 'draw_value') {
|
|
291
|
-
reqParams.drawData = effectAddAndTakeData
|
|
292
|
-
reqParams.duplicateDrawData = reduce2AddAndTakeData
|
|
291
|
+
reqParams.drawData = effectAddAndTakeData
|
|
292
|
+
reqParams.duplicateDrawData = reduce2AddAndTakeData
|
|
293
293
|
}
|
|
294
294
|
if (columnKey === 'draw_value2') {
|
|
295
|
-
reqParams.drawData = reduceAddAndTakeData
|
|
296
|
-
reqParams.duplicateDrawData = _get(newRecordData || currentReduceBaofData2, 'addAndTakeData') || null
|
|
295
|
+
reqParams.drawData = reduceAddAndTakeData
|
|
296
|
+
reqParams.duplicateDrawData = _get(newRecordData || currentReduceBaofData2, 'addAndTakeData') || null
|
|
297
297
|
}
|
|
298
298
|
} else {
|
|
299
|
-
reqParams.addAndTakeData = effectAddAndTakeData
|
|
299
|
+
reqParams.addAndTakeData = effectAddAndTakeData
|
|
300
300
|
}
|
|
301
301
|
|
|
302
302
|
if (!isReduceBaof && reduceBaofData) {
|
|
303
|
-
reqParams.drawData = reduceBaofData.addAndTakeData
|
|
304
|
-
reqParams.duplicateDrawData = _get(reduceBaofData2, 'addAndTakeData')
|
|
305
|
-
reqParams.drawInsuranceId = reduceBaofInsuranceId
|
|
303
|
+
reqParams.drawData = reduceBaofData.addAndTakeData
|
|
304
|
+
reqParams.duplicateDrawData = _get(reduceBaofData2, 'addAndTakeData')
|
|
305
|
+
reqParams.drawInsuranceId = reduceBaofInsuranceId
|
|
306
306
|
}
|
|
307
307
|
|
|
308
308
|
// 减保1领取,清空减保2领取的数据
|
|
309
309
|
if (newRecordData && columnKey === 'draw_value') {
|
|
310
|
-
reqParams.duplicateDrawData = initDefaultAddAndTakeData('take').addAndTakeData
|
|
310
|
+
reqParams.duplicateDrawData = initDefaultAddAndTakeData('take').addAndTakeData
|
|
311
311
|
}
|
|
312
312
|
|
|
313
313
|
return getInsuranceInterestDetail(reqParams, {
|
|
@@ -316,15 +316,15 @@ export default {
|
|
|
316
316
|
})
|
|
317
317
|
.then(data => {
|
|
318
318
|
if (data) {
|
|
319
|
-
self.addAndTakeDetailData = data
|
|
320
|
-
self.addAndTakeRecordData = rebuildAccountDataByResult(data, cloneDeep(addAndTakeRecordData), { columnKey: isReduceBaof ? 'draw_value' : null })
|
|
321
|
-
self.currentReduceBaofData2 = rebuildAccountDataByResult(data, cloneDeep(currentReduceBaofData2), { columnKey: 'draw_value2' })
|
|
322
|
-
return Promise.resolve(data)
|
|
319
|
+
self.addAndTakeDetailData = data
|
|
320
|
+
self.addAndTakeRecordData = rebuildAccountDataByResult(data, cloneDeep(addAndTakeRecordData), { columnKey: isReduceBaof ? 'draw_value' : null })
|
|
321
|
+
self.currentReduceBaofData2 = rebuildAccountDataByResult(data, cloneDeep(currentReduceBaofData2), { columnKey: 'draw_value2' })
|
|
322
|
+
return Promise.resolve(data)
|
|
323
323
|
}
|
|
324
|
-
return Promise.reject()
|
|
324
|
+
return Promise.reject()
|
|
325
325
|
})
|
|
326
326
|
.catch(error => {
|
|
327
|
-
const errMessage = error.info || '请求错误'
|
|
327
|
+
const errMessage = error.info || '请求错误'
|
|
328
328
|
if (errMessage.match(/账户余额不足|不满足最大领取金额/)) {
|
|
329
329
|
return new Promise((resolve, reject) => {
|
|
330
330
|
Dialog.confirm({
|
|
@@ -333,51 +333,51 @@ export default {
|
|
|
333
333
|
'切换演示情形后,不满足领取设置要求(将出现余额不足或超过最大领取金额限制),请确认是否清空已设置的领取金额重新进行领取设置?如不清空,则本演示情形不展示领取后数据。'
|
|
334
334
|
})
|
|
335
335
|
.then(() => {
|
|
336
|
-
const _addAndTakeData = _get(cloneDeep(effectAddAndTakeData), 'addAndTakeData') || []
|
|
337
|
-
const _hasTakeData = _addAndTakeData.some(e => e.adjustData && e.adjustData.length)
|
|
338
|
-
self.addAndTakeRecordData = initDefaultAddAndTakeData(type)
|
|
336
|
+
const _addAndTakeData = _get(cloneDeep(effectAddAndTakeData), 'addAndTakeData') || []
|
|
337
|
+
const _hasTakeData = _addAndTakeData.some(e => e.adjustData && e.adjustData.length)
|
|
338
|
+
self.addAndTakeRecordData = initDefaultAddAndTakeData(type)
|
|
339
339
|
// 避免 getAddAndTakeData 循环调用
|
|
340
340
|
if (_hasTakeData) {
|
|
341
|
-
self.getAddAndTakeData()
|
|
341
|
+
self.getAddAndTakeData()
|
|
342
342
|
}
|
|
343
343
|
// 账户余额不足,或不满足最大领取金额,减保领取、账户领取的数据都要清空。
|
|
344
344
|
if (isReduceBaof) {
|
|
345
345
|
if (currentAccountData) {
|
|
346
|
-
self.currentAccountData = initDefaultAddAndTakeData(currentAccountData.accountPart)
|
|
346
|
+
self.currentAccountData = initDefaultAddAndTakeData(currentAccountData.accountPart)
|
|
347
347
|
}
|
|
348
348
|
} else {
|
|
349
349
|
if (currentReduceBaofData) {
|
|
350
|
-
self.currentReduceBaofData = initDefaultAddAndTakeData(currentReduceBaofData.accountPart)
|
|
351
|
-
self.currentReduceBaofData2 = initDefaultAddAndTakeData('take')
|
|
350
|
+
self.currentReduceBaofData = initDefaultAddAndTakeData(currentReduceBaofData.accountPart)
|
|
351
|
+
self.currentReduceBaofData2 = initDefaultAddAndTakeData('take')
|
|
352
352
|
}
|
|
353
353
|
}
|
|
354
|
-
resolve()
|
|
354
|
+
resolve()
|
|
355
355
|
})
|
|
356
356
|
.catch(() => {
|
|
357
|
-
self.interestFormValue = convertInterestFormValues(oFormValue || self.interestFormValue, interestInitData)
|
|
358
|
-
resolve()
|
|
359
|
-
})
|
|
360
|
-
})
|
|
357
|
+
self.interestFormValue = convertInterestFormValues(oFormValue || self.interestFormValue, interestInitData)
|
|
358
|
+
resolve()
|
|
359
|
+
})
|
|
360
|
+
})
|
|
361
361
|
}
|
|
362
|
-
Toast(errMessage)
|
|
363
|
-
return Promise.reject()
|
|
364
|
-
})
|
|
362
|
+
Toast(errMessage)
|
|
363
|
+
return Promise.reject()
|
|
364
|
+
})
|
|
365
365
|
}
|
|
366
|
-
return Promise.reject()
|
|
366
|
+
return Promise.reject()
|
|
367
367
|
},
|
|
368
368
|
getPureInputDataForRequest() {
|
|
369
|
-
const { cpInputData, groupKey, productData } = this
|
|
370
|
-
const _inputData = cloneDeep(cpInputData)
|
|
371
|
-
const _productData = cloneDeep(productData)
|
|
369
|
+
const { cpInputData, groupKey, productData } = this
|
|
370
|
+
const _inputData = cloneDeep(cpInputData)
|
|
371
|
+
const _productData = cloneDeep(productData)
|
|
372
372
|
const data = {
|
|
373
373
|
insuranceTypeId: null,
|
|
374
374
|
personData: null,
|
|
375
375
|
productGroupList: []
|
|
376
|
-
}
|
|
376
|
+
}
|
|
377
377
|
if (_inputData && _productData) {
|
|
378
|
-
data.insuranceTypeId = _inputData.insuranceTypeId
|
|
379
|
-
delete _inputData.personData.recipientInfo
|
|
380
|
-
data.personData = _inputData.personData
|
|
378
|
+
data.insuranceTypeId = _inputData.insuranceTypeId
|
|
379
|
+
delete _inputData.personData.recipientInfo
|
|
380
|
+
data.personData = _inputData.personData
|
|
381
381
|
|
|
382
382
|
const NONEED_PROD_KEYS = [
|
|
383
383
|
'adjustBaoeData',
|
|
@@ -402,7 +402,7 @@ export default {
|
|
|
402
402
|
'xinCodeList',
|
|
403
403
|
'insShowArr',
|
|
404
404
|
'restrictList'
|
|
405
|
-
]
|
|
405
|
+
]
|
|
406
406
|
const NONEED_INS_KEYS = [
|
|
407
407
|
// 'account',
|
|
408
408
|
// 'accountData',
|
|
@@ -422,32 +422,32 @@ export default {
|
|
|
422
422
|
// 'reduceBaofData',
|
|
423
423
|
// 'duplicateReduceBaofData',
|
|
424
424
|
'saleStatus'
|
|
425
|
-
]
|
|
425
|
+
]
|
|
426
426
|
NONEED_PROD_KEYS.forEach(k => {
|
|
427
|
-
delete _productData[k]
|
|
428
|
-
})
|
|
427
|
+
delete _productData[k]
|
|
428
|
+
})
|
|
429
429
|
_productData.mulInsOrderList.forEach(ins => {
|
|
430
430
|
NONEED_INS_KEYS.forEach(k => {
|
|
431
|
-
delete ins[k]
|
|
432
|
-
})
|
|
433
|
-
})
|
|
431
|
+
delete ins[k]
|
|
432
|
+
})
|
|
433
|
+
})
|
|
434
434
|
data.productGroupList.push({
|
|
435
435
|
key: groupKey,
|
|
436
436
|
prodOrderList: [_productData]
|
|
437
|
-
})
|
|
437
|
+
})
|
|
438
438
|
}
|
|
439
|
-
return data
|
|
439
|
+
return data
|
|
440
440
|
},
|
|
441
441
|
onChangeInterestFormValue(values, oValues) {
|
|
442
|
-
this.interestFormValue = values
|
|
443
|
-
this.getAddAndTakeData(null, oValues)
|
|
442
|
+
this.interestFormValue = values
|
|
443
|
+
this.getAddAndTakeData(null, oValues)
|
|
444
444
|
},
|
|
445
445
|
onClickTableCell(key, item, index) {
|
|
446
|
-
const { insuredAge, interestInitData, addAndTakeDetailData, minTakeYear } = this
|
|
446
|
+
const { insuredAge, interestInitData, addAndTakeDetailData, minTakeYear } = this
|
|
447
447
|
if (index <= 0 || !['add', 'take', 'draw_value', 'draw_value2'].includes(key) || !(interestInitData && addAndTakeDetailData)) {
|
|
448
|
-
return
|
|
448
|
+
return
|
|
449
449
|
}
|
|
450
|
-
const purposeOption = PURPOSE_OPTIONS.find(o => o.val === item.purpose)
|
|
450
|
+
const purposeOption = PURPOSE_OPTIONS.find(o => o.val === item.purpose)
|
|
451
451
|
const formData = {
|
|
452
452
|
// WYJHS-13, 追加领取、减保领取并存,利益结果中的 take key 拆分为 take / draw_value,后者用于减保领取
|
|
453
453
|
// 提交时的类型数据在外层区分,为 addAndTakeData: [{key: take},...], drawData: [{key: take}, ...],因此 formData.type 仍是 take
|
|
@@ -458,66 +458,66 @@ export default {
|
|
|
458
458
|
baof: Number(item[key].replace(/,/g, '')) || null,
|
|
459
459
|
purpose: purposeOption ? purposeOption.val : '',
|
|
460
460
|
customPurpose: item.purpose
|
|
461
|
-
}
|
|
462
|
-
const startIndex = interestInitData.startIndex || 0
|
|
461
|
+
}
|
|
462
|
+
const startIndex = interestInitData.startIndex || 0
|
|
463
463
|
if (['take'].includes(formData.type)) {
|
|
464
|
-
const maxLength = addAndTakeDetailData.reduce((a, b) => Math.max(a, b.values.length), 0)
|
|
464
|
+
const maxLength = addAndTakeDetailData.reduce((a, b) => Math.max(a, b.values.length), 0)
|
|
465
465
|
if (item.year < minTakeYear) {
|
|
466
466
|
if (maxLength > minTakeYear) {
|
|
467
|
-
Toast(`领取年龄必须在${insuredAge + startIndex + minTakeYear}岁到${insuredAge + startIndex + maxLength}岁之间`)
|
|
467
|
+
Toast(`领取年龄必须在${insuredAge + startIndex + minTakeYear}岁到${insuredAge + startIndex + maxLength}岁之间`)
|
|
468
468
|
}
|
|
469
|
-
return
|
|
469
|
+
return
|
|
470
470
|
}
|
|
471
471
|
}
|
|
472
|
-
this.formData = formData
|
|
473
|
-
this.subName = 'Form'
|
|
472
|
+
this.formData = formData
|
|
473
|
+
this.subName = 'Form'
|
|
474
474
|
},
|
|
475
475
|
deleteAllData() {
|
|
476
|
-
const { addAndTakeRecordData, currentReduceBaofData2, formData } = this
|
|
477
|
-
const _columnKey = _get(formData, 'columnKey')
|
|
476
|
+
const { addAndTakeRecordData, currentReduceBaofData2, formData } = this
|
|
477
|
+
const _columnKey = _get(formData, 'columnKey')
|
|
478
478
|
if (_columnKey === 'draw_value2') {
|
|
479
479
|
if (currentReduceBaofData2) {
|
|
480
480
|
currentReduceBaofData2.addAndTakeData.forEach(d => {
|
|
481
|
-
d.adjustData = []
|
|
482
|
-
})
|
|
481
|
+
d.adjustData = []
|
|
482
|
+
})
|
|
483
483
|
}
|
|
484
484
|
} else {
|
|
485
485
|
addAndTakeRecordData.addAndTakeData.forEach(d => {
|
|
486
|
-
d.adjustData = []
|
|
487
|
-
})
|
|
486
|
+
d.adjustData = []
|
|
487
|
+
})
|
|
488
488
|
}
|
|
489
|
-
this.getAddAndTakeData()
|
|
489
|
+
this.getAddAndTakeData()
|
|
490
490
|
},
|
|
491
491
|
updateAdjustData(values, callback) {
|
|
492
|
-
const { addAndTakeRecordData, currentReduceBaofData2, formData } = this
|
|
493
|
-
const _columnKey = _get(formData, 'columnKey')
|
|
494
|
-
const _currentReduceBaofData2 = currentReduceBaofData2 || initDefaultAddAndTakeData('take')
|
|
495
|
-
const _newRecordData = rebuildAccountDataBySetting(values, cloneDeep(_columnKey === 'draw_value2' ? _currentReduceBaofData2 : addAndTakeRecordData))
|
|
492
|
+
const { addAndTakeRecordData, currentReduceBaofData2, formData } = this
|
|
493
|
+
const _columnKey = _get(formData, 'columnKey')
|
|
494
|
+
const _currentReduceBaofData2 = currentReduceBaofData2 || initDefaultAddAndTakeData('take')
|
|
495
|
+
const _newRecordData = rebuildAccountDataBySetting(values, cloneDeep(_columnKey === 'draw_value2' ? _currentReduceBaofData2 : addAndTakeRecordData))
|
|
496
496
|
return this.getAddAndTakeData(_newRecordData, null, { columnKey: _columnKey })
|
|
497
497
|
.then(() => callback())
|
|
498
|
-
.catch(() => {})
|
|
498
|
+
.catch(() => {})
|
|
499
499
|
},
|
|
500
500
|
validateInterestFormValues() {
|
|
501
|
-
const _formValues = convertInterestFormValues(this.interestFormValue, this.interestInitData)
|
|
502
|
-
const _refInterestItems = this.$refs.InterestItems
|
|
501
|
+
const _formValues = convertInterestFormValues(this.interestFormValue, this.interestInitData)
|
|
502
|
+
const _refInterestItems = this.$refs.InterestItems
|
|
503
503
|
if (_refInterestItems) {
|
|
504
504
|
return _refInterestItems
|
|
505
505
|
.validate()
|
|
506
506
|
.then(() => _formValues)
|
|
507
507
|
.catch(err => {
|
|
508
|
-
Toast(err)
|
|
509
|
-
})
|
|
508
|
+
Toast(err)
|
|
509
|
+
})
|
|
510
510
|
}
|
|
511
|
-
return Promise.resolve(_formValues)
|
|
511
|
+
return Promise.resolve(_formValues)
|
|
512
512
|
},
|
|
513
513
|
openForm(type) {
|
|
514
514
|
this.formData = {
|
|
515
515
|
type
|
|
516
|
-
}
|
|
517
|
-
this.subName = 'Form'
|
|
516
|
+
}
|
|
517
|
+
this.subName = 'Form'
|
|
518
518
|
},
|
|
519
519
|
goToTable() {
|
|
520
|
-
this.subName = 'Table'
|
|
520
|
+
this.subName = 'Table'
|
|
521
521
|
},
|
|
522
522
|
async tableConfirm() {
|
|
523
523
|
const {
|
|
@@ -529,13 +529,13 @@ export default {
|
|
|
529
529
|
currentReduceBaofData,
|
|
530
530
|
currentReduceBaofData2,
|
|
531
531
|
addAndTakeRecordData
|
|
532
|
-
} = this
|
|
533
|
-
const _formValues = await this.validateInterestFormValues().catch(() => {})
|
|
532
|
+
} = this
|
|
533
|
+
const _formValues = await this.validateInterestFormValues().catch(() => {})
|
|
534
534
|
if (!_formValues) {
|
|
535
|
-
return
|
|
535
|
+
return
|
|
536
536
|
}
|
|
537
|
-
const isReduceBaof = type === 'reduceBaof'
|
|
538
|
-
const takeDataKey = isReduceBaof ? 'reduceBaofData' : 'accountData'
|
|
537
|
+
const isReduceBaof = type === 'reduceBaof'
|
|
538
|
+
const takeDataKey = isReduceBaof ? 'reduceBaofData' : 'accountData'
|
|
539
539
|
const responseData = {
|
|
540
540
|
type,
|
|
541
541
|
[takeDataKey]: addAndTakeRecordData,
|
|
@@ -544,24 +544,24 @@ export default {
|
|
|
544
544
|
accountInsuranceId,
|
|
545
545
|
reduceBaofInsuranceId,
|
|
546
546
|
interestData: _formValues
|
|
547
|
-
}
|
|
547
|
+
}
|
|
548
548
|
if (isReduceBaof) {
|
|
549
549
|
// 减保领取,清空账户领取的数据
|
|
550
|
-
responseData.accountData = accountInsuranceId && accountData ? initDefaultAddAndTakeData(accountData.accountPart) : null
|
|
550
|
+
responseData.accountData = accountInsuranceId && accountData ? initDefaultAddAndTakeData(accountData.accountPart) : null
|
|
551
551
|
} else {
|
|
552
|
-
responseData.reduceBaofData = currentReduceBaofData
|
|
553
|
-
responseData.reduceBaofData2 = reduceBaofData2
|
|
552
|
+
responseData.reduceBaofData = currentReduceBaofData
|
|
553
|
+
responseData.reduceBaofData2 = reduceBaofData2
|
|
554
554
|
}
|
|
555
|
-
this.$emit('confirm', responseData, this)
|
|
556
|
-
return responseData
|
|
555
|
+
this.$emit('confirm', responseData, this)
|
|
556
|
+
return responseData
|
|
557
557
|
},
|
|
558
558
|
async confirm() {
|
|
559
559
|
if (this.subName === 'Form') {
|
|
560
|
-
this.goToTable()
|
|
561
|
-
return Promise.reject()
|
|
560
|
+
this.goToTable()
|
|
561
|
+
return Promise.reject()
|
|
562
562
|
}
|
|
563
|
-
return this.tableConfirm()
|
|
563
|
+
return this.tableConfirm()
|
|
564
564
|
}
|
|
565
565
|
}
|
|
566
|
-
}
|
|
566
|
+
}
|
|
567
567
|
</script>
|