1
|
// pages/addListDetail/addListDetail.js
|
1
|
// pages/addListDetail/addListDetail.js
|
2
|
const app = getApp()
|
2
|
const app = getApp()
|
3
|
Page({
|
3
|
Page({
|
4
|
- /**
|
|
|
5
|
- * 页面的初始数据
|
|
|
6
|
- */
|
|
|
7
|
- data: {
|
|
|
8
|
- recognizee: ['被保人', '被保人2'],
|
|
|
9
|
- recognizee_index: 0,
|
|
|
10
|
- period_time: ['10年', '20年'],
|
|
|
11
|
- period_index: -1,
|
|
|
12
|
- compact_time: '',
|
|
|
13
|
- impletion_time: '',
|
|
|
14
|
- popup_state: false,
|
|
|
15
|
- projectlist: [],
|
|
|
16
|
- label_state: false,
|
|
|
17
|
- insure: ['投保人', '投保人2'],
|
|
|
18
|
- insureindex: -1,
|
|
|
19
|
- beneficiary_list: [{
|
|
|
20
|
- name_array: ['受益人1', '受益人2'],
|
|
|
21
|
- unit: ''
|
|
|
22
|
- }],
|
|
|
23
|
- beneficiaryindex: -1,
|
|
|
24
|
- tempfavoree: [], // 已选择的受益人
|
|
|
25
|
- beneficiaryList: [],
|
|
|
26
|
- name: '', //受益人的名字,
|
|
|
27
|
- beneficiary_name: '',
|
|
|
28
|
- imgs: [],
|
|
|
29
|
- main_risk: [],
|
|
|
30
|
- unit: '',
|
|
|
31
|
- unit2: '',
|
|
|
32
|
- unit3: '',
|
|
|
33
|
- unit4: '',
|
|
|
34
|
- applicant_name: '',
|
|
|
35
|
- recognizee_name: '',
|
|
|
36
|
- rang_beneficiary: [],
|
|
|
37
|
- risk_list: [{
|
|
|
38
|
- name: '',
|
|
|
39
|
- mo: [],
|
|
|
40
|
- project_time: '',
|
|
|
41
|
- title: '',
|
|
|
42
|
- num: ''
|
|
|
43
|
- }],
|
|
|
44
|
- main_array: [],
|
|
|
45
|
- warranty_one: '',
|
|
|
46
|
- warranty_two: {},
|
|
|
47
|
- guarantee_name: '',
|
|
|
48
|
- long_money: {},
|
|
|
49
|
- time_name: '',
|
|
|
50
|
- type_money: '',
|
|
|
51
|
- more: [],
|
|
|
52
|
- guarantee: [],
|
|
|
53
|
- InfoId: 0,
|
|
|
54
|
- def_id: '',
|
|
|
55
|
- edit_state: false,
|
|
|
56
|
- risk_listitm: '',
|
|
|
57
|
- storge_state: false,
|
|
|
58
|
- },
|
|
|
59
|
-
|
|
|
60
|
- //保单号
|
|
|
61
|
- policyNum(e) {
|
4
|
+ /**
|
|
|
5
|
+ * 页面的初始数据
|
|
|
6
|
+ */
|
|
|
7
|
+ data: {
|
|
|
8
|
+ recognizee: ['被保人', '被保人2'],
|
|
|
9
|
+ recognizee_index: 0,
|
|
|
10
|
+ period_time: ['10年', '20年'],
|
|
|
11
|
+ period_index: -1,
|
|
|
12
|
+ compact_time: '',
|
|
|
13
|
+ impletion_time: '',
|
|
|
14
|
+ popup_state: false,
|
|
|
15
|
+ projectlist: [],
|
|
|
16
|
+ label_state: false,
|
|
|
17
|
+ insure: ['投保人', '投保人2'],
|
|
|
18
|
+ insureindex: -1,
|
|
|
19
|
+ beneficiary_list: [{
|
|
|
20
|
+ name_array: ['受益人1', '受益人2'],
|
|
|
21
|
+ unit: ''
|
|
|
22
|
+ }],
|
|
|
23
|
+ beneficiaryindex: -1,
|
|
|
24
|
+ tempfavoree: [], // 已选择的受益人
|
|
|
25
|
+ beneficiaryList: [],
|
|
|
26
|
+ name: '', //受益人的名字,
|
|
|
27
|
+ beneficiary_name: '',
|
|
|
28
|
+ imgs: [],
|
|
|
29
|
+ main_risk: [],
|
|
|
30
|
+ unit: '',
|
|
|
31
|
+ unit2: '',
|
|
|
32
|
+ unit3: '',
|
|
|
33
|
+ unit4: '',
|
|
|
34
|
+ applicant_name: '',
|
|
|
35
|
+ recognizee_name: '',
|
|
|
36
|
+ rang_beneficiary: [],
|
|
|
37
|
+ risk_list: [{
|
|
|
38
|
+ name: '',
|
|
|
39
|
+ mo: [],
|
|
|
40
|
+ project_time: '',
|
|
|
41
|
+ title: '',
|
|
|
42
|
+ num: ''
|
|
|
43
|
+ }],
|
|
|
44
|
+ main_array: [],
|
|
|
45
|
+ warranty_one: '',
|
|
|
46
|
+ warranty_two: {},
|
|
|
47
|
+ guarantee_name: '',
|
|
|
48
|
+ long_money: {},
|
|
|
49
|
+ time_name: '',
|
|
|
50
|
+ type_money: '',
|
|
|
51
|
+ more: [],
|
|
|
52
|
+ guarantee: [],
|
|
|
53
|
+ InfoId: 0,
|
|
|
54
|
+ def_id: '',
|
|
|
55
|
+ edit_state: false,
|
|
|
56
|
+ risk_listitm: '',
|
|
|
57
|
+ storge_state: false,
|
|
|
58
|
+ },
|
|
|
59
|
+
|
|
|
60
|
+ //保单号
|
|
|
61
|
+ policyNum(e) {
|
|
|
62
|
+ this.setData({
|
|
|
63
|
+ in_num: e.detail.value,
|
|
|
64
|
+ })
|
|
|
65
|
+ },
|
|
|
66
|
+
|
|
|
67
|
+ //保单号
|
|
|
68
|
+ setFirm(e) {
|
|
|
69
|
+ this.setData({
|
|
|
70
|
+ firm: e.detail.value,
|
|
|
71
|
+ })
|
|
|
72
|
+ },
|
|
|
73
|
+
|
|
|
74
|
+ //投保人
|
|
|
75
|
+ insureSelect(e) {
|
|
|
76
|
+ var insure = this.data.insure
|
|
|
77
|
+ this.setData({
|
|
|
78
|
+ insureindex: e.detail.value,
|
|
|
79
|
+ applicant_name: insure[e.detail.value],
|
|
|
80
|
+ })
|
|
|
81
|
+ },
|
|
|
82
|
+
|
|
|
83
|
+ //选择被保险人
|
|
|
84
|
+ recognizeeSelect(e) {
|
|
|
85
|
+ var recognizee = this.data.recognizee
|
|
|
86
|
+ this.setData({
|
|
|
87
|
+ recognizeeindex: e.detail.value,
|
|
|
88
|
+ recognizee_name: recognizee[e.detail.value]
|
|
|
89
|
+ })
|
|
|
90
|
+ },
|
|
|
91
|
+
|
|
|
92
|
+ //主险名称
|
|
|
93
|
+ setRiskName(e) {
|
|
|
94
|
+ // console.log(e)
|
|
|
95
|
+ this.setData({
|
|
|
96
|
+ main_risks: e.detail.value,
|
|
|
97
|
+ })
|
|
|
98
|
+ // console.log(this.data.main_risks)
|
|
|
99
|
+ },
|
|
|
100
|
+
|
|
|
101
|
+ //保费
|
|
|
102
|
+ yearMoney(e) {
|
|
|
103
|
+ this.setData({
|
|
|
104
|
+ year_money: e.detail.value,
|
|
|
105
|
+ })
|
|
|
106
|
+ },
|
|
|
107
|
+
|
|
|
108
|
+ //设置银行
|
|
|
109
|
+ setBank(e) {
|
|
|
110
|
+ this.setData({
|
|
|
111
|
+ bank: e.detail.value,
|
|
|
112
|
+ })
|
|
|
113
|
+ },
|
|
|
114
|
+
|
|
|
115
|
+ //设置账号
|
|
|
116
|
+ setBankNum(e) {
|
|
|
117
|
+ this.setData({
|
|
|
118
|
+ bank_num: e.detail.value,
|
|
|
119
|
+ })
|
|
|
120
|
+ },
|
|
|
121
|
+
|
|
|
122
|
+ //合同生效日
|
|
|
123
|
+ compactTime(e) {
|
|
|
124
|
+ this.setData({
|
|
|
125
|
+ compact_time: e.detail.value,
|
|
|
126
|
+ })
|
|
|
127
|
+ this.countImpletionTime()
|
|
|
128
|
+ this.countImpletionTime2()
|
|
|
129
|
+ },
|
|
|
130
|
+
|
|
|
131
|
+ //缴费期满日
|
|
|
132
|
+ impletionTime(e) {
|
|
|
133
|
+ this.setData({
|
|
|
134
|
+ impletion_time: e.detail.value,
|
|
|
135
|
+ })
|
|
|
136
|
+ },
|
|
|
137
|
+
|
|
|
138
|
+ //主险保障期
|
|
|
139
|
+ periodTime(e) {
|
|
|
140
|
+ this.setData({
|
|
|
141
|
+ period_index: e.detail.value,
|
|
|
142
|
+ })
|
|
|
143
|
+ },
|
|
|
144
|
+
|
|
|
145
|
+ //保障项目弹窗
|
|
|
146
|
+ ensureProject(e) {
|
|
|
147
|
+ this.setData({
|
|
|
148
|
+ edit_state: false
|
|
|
149
|
+ })
|
|
|
150
|
+
|
|
|
151
|
+ let that = this;
|
|
|
152
|
+ let type = e.currentTarget.dataset.type;
|
|
|
153
|
+ let index = e.currentTarget.dataset.xulie;
|
|
|
154
|
+ let tempProjectlist = Object.assign(this.data.projectlist, {});
|
|
|
155
|
+ // 已经添加的附加险
|
|
|
156
|
+ let risk_list = Object.assign(this.data.risk_list, {});
|
|
|
157
|
+ console.log(risk_list)
|
|
|
158
|
+ let tempRist = risk_list[index].mo;
|
|
|
159
|
+ console.log(tempRist)
|
|
|
160
|
+ // 已经添加的主险
|
|
|
161
|
+ let tempMain_list = Object.assign(this.data.main_array, {})
|
|
|
162
|
+ console.log(type)
|
|
|
163
|
+ if (type == 'zhuxian') {
|
|
|
164
|
+ if (tempMain_list.length > 0) {
|
|
|
165
|
+ for (let i in tempProjectlist) {
|
|
|
166
|
+ for (let j in tempMain_list) {
|
|
|
167
|
+ if (tempProjectlist[i].id == tempMain_list[j].id) {
|
|
|
168
|
+ tempProjectlist[i].choose_status = true
|
|
|
169
|
+ for (let g in tempProjectlist[i].title) {
|
|
|
170
|
+ tempProjectlist[i].title[g].t_id == tempMain_list[j].t_id ? tempProjectlist[i].title[g].label_state = true : ''
|
|
|
171
|
+ }
|
|
|
172
|
+ }
|
|
|
173
|
+ }
|
|
|
174
|
+ }
|
|
|
175
|
+ }
|
|
|
176
|
+ } else {
|
|
|
177
|
+ if (tempRist.length) {
|
|
|
178
|
+ for (let i in tempProjectlist) {
|
|
|
179
|
+ for (let j in tempRist) {
|
|
|
180
|
+ if (tempProjectlist[i].id == tempRist[j].id) {
|
|
|
181
|
+ tempProjectlist[i].choose_status = true
|
|
|
182
|
+ for (let g in tempProjectlist[i].title) {
|
|
|
183
|
+ console.log(tempProjectlist[i].title[g])
|
|
|
184
|
+ tempProjectlist[i].title[g].t_id == tempMain_list[j].t_id ? tempProjectlist[i].title[g].label_state = true : ''
|
|
|
185
|
+ }
|
|
|
186
|
+ }
|
|
|
187
|
+ }
|
|
|
188
|
+ }
|
|
|
189
|
+ }
|
|
|
190
|
+ }
|
|
|
191
|
+
|
|
|
192
|
+ wx.setNavigationBarTitle({
|
|
|
193
|
+ title: '选择保障项目',
|
|
|
194
|
+ })
|
|
|
195
|
+
|
|
|
196
|
+ this.setData({
|
|
|
197
|
+ popup_state: true,
|
|
|
198
|
+ addType: type,
|
|
|
199
|
+ xulie: index,
|
|
|
200
|
+ projectlist: tempProjectlist
|
|
|
201
|
+ })
|
|
|
202
|
+ },
|
|
|
203
|
+
|
|
|
204
|
+ // 调取保障项目接口
|
|
|
205
|
+ ensureProjectList() {
|
|
|
206
|
+ var main_risk = this.data.main_risk
|
|
|
207
|
+ let url = 'counselor/sageguard'
|
|
|
208
|
+ let params = {}
|
|
|
209
|
+ app.post(url, params).then((res) => {
|
|
|
210
|
+ if (res.data.code == 200) {
|
|
|
211
|
+ var projectlist = res.data.data.def;
|
|
|
212
|
+ for (var i = 0; i < projectlist.length; i++) {
|
|
|
213
|
+ projectlist[i].choose_status = false
|
|
|
214
|
+ for (var j = 0; j < projectlist[i].title.length; j++) {
|
|
|
215
|
+ projectlist[i].title[j].label_state = false
|
|
|
216
|
+ }
|
|
|
217
|
+ projectlist[i].title[0].current = 0
|
|
|
218
|
+ projectlist[i].title[0].label_state = true
|
|
|
219
|
+ }
|
62
|
this.setData({
|
220
|
this.setData({
|
63
|
- in_num: e.detail.value,
|
221
|
+ projectlist: res.data.data.def
|
64
|
})
|
222
|
})
|
65
|
- },
|
|
|
66
|
-
|
|
|
67
|
- //保单号
|
|
|
68
|
- setFirm(e) {
|
|
|
69
|
- this.setData({
|
|
|
70
|
- firm: e.detail.value,
|
223
|
+ // console.log(this.data.projectlist)
|
|
|
224
|
+ }
|
|
|
225
|
+ })
|
|
|
226
|
+ },
|
|
|
227
|
+
|
|
|
228
|
+ //保障项目单位
|
|
|
229
|
+ getUnit(e) {
|
|
|
230
|
+ var main_risk = this.data.main_risk
|
|
|
231
|
+ var index = e.currentTarget.dataset.index;
|
|
|
232
|
+ var sindex = e.currentTarget.dataset.sindex;
|
|
|
233
|
+ var projectlist = this.data.projectlist;
|
|
|
234
|
+ var title = projectlist[index].title
|
|
|
235
|
+ for (var i = 0; i < title.length; i++) {
|
|
|
236
|
+ title[i].current = ''
|
|
|
237
|
+ if (title[i].current == '') {
|
|
|
238
|
+ title[i].label_state = false
|
|
|
239
|
+ }
|
|
|
240
|
+ }
|
|
|
241
|
+ projectlist[index].title[sindex].current = sindex
|
|
|
242
|
+ if (projectlist[index].title[sindex].current == sindex) {
|
|
|
243
|
+ projectlist[index].title[sindex].label_state = true
|
|
|
244
|
+ }
|
|
|
245
|
+ this.setData({
|
|
|
246
|
+ projectlist: projectlist,
|
|
|
247
|
+ })
|
|
|
248
|
+ },
|
|
|
249
|
+
|
|
|
250
|
+ //保障项目金额
|
|
|
251
|
+ popupNum(e) {
|
|
|
252
|
+ var index = e.currentTarget.dataset.index;
|
|
|
253
|
+ var projectlist = this.data.projectlist;
|
|
|
254
|
+ if (projectlist[index].choose_status) {
|
|
|
255
|
+ projectlist[index].num = e.detail.value
|
|
|
256
|
+ }
|
|
|
257
|
+ this.setData({
|
|
|
258
|
+ projectlist: projectlist
|
|
|
259
|
+ })
|
|
|
260
|
+ },
|
|
|
261
|
+
|
|
|
262
|
+ //选择保障项目
|
|
|
263
|
+ popupState(e) {
|
|
|
264
|
+ var index = e.currentTarget.dataset.index;
|
|
|
265
|
+ var projectlist = this.data.projectlist;
|
|
|
266
|
+ projectlist[index].choose_status = !projectlist[index].choose_status;
|
|
|
267
|
+ // console.log(projectlist)
|
|
|
268
|
+ this.setData({
|
|
|
269
|
+ projectlist: projectlist,
|
|
|
270
|
+ })
|
|
|
271
|
+ if (this.data.inforid != 0) {
|
|
|
272
|
+ edit_state: false
|
|
|
273
|
+ }
|
|
|
274
|
+ },
|
|
|
275
|
+
|
|
|
276
|
+ //确认选择的推荐方案
|
|
|
277
|
+ confirmCase() {
|
|
|
278
|
+ let index = this.data.xulie;
|
|
|
279
|
+ let type = this.data.addType;
|
|
|
280
|
+ var that = this
|
|
|
281
|
+ var main_array = []
|
|
|
282
|
+
|
|
|
283
|
+ var projectlist = Object.assign(this.data.projectlist, {})
|
|
|
284
|
+ for (var i = 0; i < projectlist.length; i++) {
|
|
|
285
|
+ if (projectlist[i].choose_status) {
|
|
|
286
|
+ main_array.push(projectlist[i])
|
|
|
287
|
+ console.log(main_array)
|
|
|
288
|
+ }
|
|
|
289
|
+ }
|
|
|
290
|
+
|
|
|
291
|
+ if (main_array != '') {
|
|
|
292
|
+ wx.showToast({
|
|
|
293
|
+ title: '添加成功',
|
|
|
294
|
+ icon: 'none'
|
|
|
295
|
+ })
|
|
|
296
|
+
|
|
|
297
|
+ if (type == 'fujiaxian') {
|
|
|
298
|
+ let tempRist = that.data.risk_list;
|
|
|
299
|
+ console.log(tempRist)
|
|
|
300
|
+ tempRist[index]['mo'] = main_array;
|
|
|
301
|
+ that.setData({
|
|
|
302
|
+ risk_list: tempRist,
|
|
|
303
|
+ risk_listitm: tempRist
|
71
|
})
|
304
|
})
|
72
|
- },
|
|
|
73
|
-
|
|
|
74
|
- //投保人
|
|
|
75
|
- insureSelect(e) {
|
|
|
76
|
- var insure = this.data.insure
|
|
|
77
|
- this.setData({
|
|
|
78
|
- insureindex: e.detail.value,
|
|
|
79
|
- applicant_name: insure[e.detail.value],
|
305
|
+ console.log(this.data.risk_list)
|
|
|
306
|
+ } else {
|
|
|
307
|
+ that.setData({
|
|
|
308
|
+ main_array: main_array,
|
80
|
})
|
309
|
})
|
81
|
- },
|
|
|
82
|
-
|
|
|
83
|
- //选择被保险人
|
|
|
84
|
- recognizeeSelect(e) {
|
|
|
85
|
- var recognizee = this.data.recognizee
|
|
|
86
|
- this.setData({
|
|
|
87
|
- recognizeeindex: e.detail.value,
|
|
|
88
|
- recognizee_name: recognizee[e.detail.value]
|
310
|
+ }
|
|
|
311
|
+ console.log(this.data.main_array)
|
|
|
312
|
+ }
|
|
|
313
|
+ setTimeout(function() {
|
|
|
314
|
+ that.ensureProjectList()
|
|
|
315
|
+ that.setData({
|
|
|
316
|
+ popup_state: false
|
|
|
317
|
+ })
|
|
|
318
|
+ wx.setNavigationBarTitle({
|
|
|
319
|
+ title: '添加保单',
|
|
|
320
|
+ })
|
|
|
321
|
+ }, 800)
|
|
|
322
|
+
|
|
|
323
|
+
|
|
|
324
|
+ console.log(this.data.risk_list)
|
|
|
325
|
+ },
|
|
|
326
|
+
|
|
|
327
|
+ //重组主险的保障项目
|
|
|
328
|
+ tempMain() {
|
|
|
329
|
+ var main_array = this.data.main_array
|
|
|
330
|
+ var warranty_one1 = []
|
|
|
331
|
+ // console.log(main_array)
|
|
|
332
|
+ for (var i = 0; i < main_array.length; i++) {
|
|
|
333
|
+ var temp = {}
|
|
|
334
|
+ for (var j = 0; j < main_array[i].title.length; j++) {
|
|
|
335
|
+ if (main_array[i].choose_status) {
|
|
|
336
|
+ if (main_array[i].title[j].label_state) {
|
|
|
337
|
+ temp.id = main_array[i].id
|
|
|
338
|
+ temp.name = main_array[i].name
|
|
|
339
|
+ temp.num = main_array[i].num
|
|
|
340
|
+ temp.title = main_array[i].title[j].name
|
|
|
341
|
+ temp.t_id = main_array[i].title[j].t_id
|
|
|
342
|
+ }
|
|
|
343
|
+ }
|
|
|
344
|
+ }
|
|
|
345
|
+ warranty_one1.push(temp)
|
|
|
346
|
+ this.setData({
|
|
|
347
|
+ guarantee: warranty_one1
|
|
|
348
|
+ })
|
|
|
349
|
+ }
|
|
|
350
|
+
|
|
|
351
|
+ },
|
|
|
352
|
+
|
|
|
353
|
+ //主险名称
|
|
|
354
|
+ addRiskName(e) {
|
|
|
355
|
+ var risk_list = this.data.risk_list
|
|
|
356
|
+ var index = e.currentTarget.dataset.index
|
|
|
357
|
+ risk_list[index].name = e.detail.value
|
|
|
358
|
+ this.setData({
|
|
|
359
|
+ risk_list: risk_list
|
|
|
360
|
+ })
|
|
|
361
|
+ },
|
|
|
362
|
+
|
|
|
363
|
+ //主险保障其
|
|
|
364
|
+ addRiskUnit(e) {
|
|
|
365
|
+ var risk_list = this.data.risk_list
|
|
|
366
|
+ var index = e.currentTarget.dataset.index
|
|
|
367
|
+ risk_list[index].num = e.detail.value
|
|
|
368
|
+ this.setData({
|
|
|
369
|
+ risk_list: risk_list
|
|
|
370
|
+ })
|
|
|
371
|
+ },
|
|
|
372
|
+
|
|
|
373
|
+ //重组附加险整体数据结构
|
|
|
374
|
+ tempAddRisk() {
|
|
|
375
|
+ var risk_list = this.data.risk_list
|
|
|
376
|
+
|
|
|
377
|
+ var sub_array = []
|
|
|
378
|
+ var temp_risk = this.data.risk_listitm;
|
|
|
379
|
+ var temp = this.data.risk_listitm;
|
|
|
380
|
+
|
|
|
381
|
+ for (var i = 0; i < temp.length; i++) {
|
|
|
382
|
+ for (var j = 0; j < temp[i].mo.length; j++) {
|
|
|
383
|
+ for (var k = 0; k < temp[i].mo[j].title.length; k++) {
|
|
|
384
|
+ if (temp[i].name != '') {
|
|
|
385
|
+ // var temp = {}
|
|
|
386
|
+ // var subtemp = {}
|
|
|
387
|
+ if (temp[i].mo[j].choose_status) {
|
|
|
388
|
+ if (temp[i].mo[j].title[k].label_state) {
|
|
|
389
|
+ temp_risk[i].name = temp[i].name
|
|
|
390
|
+ temp_risk[i].num = temp[i].num
|
|
|
391
|
+ temp_risk[i].title = temp[i].title
|
|
|
392
|
+ temp_risk[i].mo[j].t_id = temp[i].mo[j].title[k].t_id
|
|
|
393
|
+ temp_risk[i].mo[j].id = temp[i].mo[j].id
|
|
|
394
|
+ temp_risk[i].mo[j].name = temp[i].mo[j].name
|
|
|
395
|
+ temp_risk[i].mo[j].num = temp[i].mo[j].num
|
|
|
396
|
+ temp_risk[i].mo[j].title = temp[i].mo[j].title[k].name
|
|
|
397
|
+ console.log(temp_risk)
|
|
|
398
|
+ }
|
|
|
399
|
+ }
|
|
|
400
|
+ }
|
|
|
401
|
+ }
|
|
|
402
|
+ }
|
|
|
403
|
+
|
|
|
404
|
+ this.setData({
|
|
|
405
|
+ more: temp_risk
|
|
|
406
|
+ })
|
|
|
407
|
+ }
|
|
|
408
|
+
|
|
|
409
|
+ },
|
|
|
410
|
+
|
|
|
411
|
+ //选择受益人姓名
|
|
|
412
|
+ beneficiarySelect(e) {
|
|
|
413
|
+ if (this.data.inforid != 0) {
|
|
|
414
|
+ this.setData({
|
|
|
415
|
+ edit_state: false
|
|
|
416
|
+ })
|
|
|
417
|
+ }
|
|
|
418
|
+ var index = e.currentTarget.dataset.mindex
|
|
|
419
|
+ var beneficiary_list = Object.assign(this.data.beneficiary_list, {});
|
|
|
420
|
+ // 获取当前已选择的收益人
|
|
|
421
|
+ let tempBenefice = Object.assign(this.data.beneficiaryList, {})
|
|
|
422
|
+ // 当前选择的收益人
|
|
|
423
|
+ let nowPerson = beneficiary_list[index].name_array[e.detail.value];
|
|
|
424
|
+ // 判断受益人是否已经添加
|
|
|
425
|
+ const add = tempBenefice.every((tempBenefice) => {
|
|
|
426
|
+ return tempBenefice != nowPerson
|
|
|
427
|
+ })
|
|
|
428
|
+ if (add) {
|
|
|
429
|
+ beneficiary_list[index].beneficiary_name = nowPerson;
|
|
|
430
|
+ tempBenefice.push(nowPerson)
|
|
|
431
|
+ } else {
|
|
|
432
|
+ wx.showToast({
|
|
|
433
|
+ title: '请不要重复添加受益人',
|
|
|
434
|
+ icon: 'none'
|
|
|
435
|
+ })
|
|
|
436
|
+ }
|
|
|
437
|
+
|
|
|
438
|
+ this.setData({
|
|
|
439
|
+ beneficiary_list: beneficiary_list,
|
|
|
440
|
+ beneficiaryList: tempBenefice
|
|
|
441
|
+ })
|
|
|
442
|
+
|
|
|
443
|
+ },
|
|
|
444
|
+
|
|
|
445
|
+ //添加收益比例
|
|
|
446
|
+ addUnit(e) {
|
|
|
447
|
+ var beneficiary_list = this.data.beneficiary_list;
|
|
|
448
|
+ beneficiary_list[beneficiary_list.length - 1].unit = e.detail.value;
|
|
|
449
|
+ this.setData({
|
|
|
450
|
+ beneficiary_list: beneficiary_list,
|
|
|
451
|
+ })
|
|
|
452
|
+ },
|
|
|
453
|
+
|
|
|
454
|
+ //添加受益人
|
|
|
455
|
+ addPersons(e) {
|
|
|
456
|
+ var list = this.data.beneficiary_list;
|
|
|
457
|
+ var len = list.length
|
|
|
458
|
+ if (list[len - 1].beneficiary_name == undefined) {
|
|
|
459
|
+ wx.showToast({
|
|
|
460
|
+ title: '请选择受益人',
|
|
|
461
|
+ icon: 'none'
|
|
|
462
|
+ })
|
|
|
463
|
+ } else if (list[len - 1].unit == '') {
|
|
|
464
|
+ console.log('unit')
|
|
|
465
|
+ wx.showToast({
|
|
|
466
|
+ title: '请输入收益比',
|
|
|
467
|
+ icon: 'none'
|
|
|
468
|
+ })
|
|
|
469
|
+ } else {
|
|
|
470
|
+ list[len] = {
|
|
|
471
|
+ name_array: this.data.insure,
|
|
|
472
|
+ unit: ''
|
|
|
473
|
+ }
|
|
|
474
|
+ }
|
|
|
475
|
+ this.setData({
|
|
|
476
|
+ beneficiary_list: list
|
|
|
477
|
+ })
|
|
|
478
|
+ console.log(this.data.beneficiary_list)
|
|
|
479
|
+ },
|
|
|
480
|
+
|
|
|
481
|
+ //重组添加受益人
|
|
|
482
|
+ tempBeneficiary() {
|
|
|
483
|
+ var beneficiary_list = this.data.beneficiary_list
|
|
|
484
|
+ var len = beneficiary_list.length;
|
|
|
485
|
+ var tempfavoree1 = [];
|
|
|
486
|
+ for (var i = 0; i < beneficiary_list.length; i++) {
|
|
|
487
|
+ var temp = {}
|
|
|
488
|
+ if (beneficiary_list[i].unit != '') {
|
|
|
489
|
+ temp.name = beneficiary_list[i].beneficiary_name
|
|
|
490
|
+ temp.unit = beneficiary_list[i].unit;
|
|
|
491
|
+ }
|
|
|
492
|
+ tempfavoree1.push(temp)
|
|
|
493
|
+ this.setData({
|
|
|
494
|
+ tempfavoree: tempfavoree1
|
|
|
495
|
+ })
|
|
|
496
|
+
|
|
|
497
|
+ }
|
|
|
498
|
+ },
|
|
|
499
|
+
|
|
|
500
|
+ //删除收益人
|
|
|
501
|
+ deletebenefict(e) {
|
|
|
502
|
+ let index = e.currentTarget.dataset.index;
|
|
|
503
|
+ let tempbenefict = Object.assign(this.data.beneficiary_list, {});
|
|
|
504
|
+ let beneficiaryList = Object.assign(this.data.beneficiaryList, {});
|
|
|
505
|
+ // 获取当前选项的受益人
|
|
|
506
|
+ let person = tempbenefict[index].beneficiary_name;
|
|
|
507
|
+ tempbenefict.splice(index, 1);
|
|
|
508
|
+ if (person) beneficiaryList.splice(beneficiaryList.indexOf(person), 1)
|
|
|
509
|
+
|
|
|
510
|
+ this.setData({
|
|
|
511
|
+ beneficiaryList: beneficiaryList,
|
|
|
512
|
+ beneficiary_list: tempbenefict
|
|
|
513
|
+ })
|
|
|
514
|
+ },
|
|
|
515
|
+
|
|
|
516
|
+ //添加附加险
|
|
|
517
|
+ addRisk() {
|
|
|
518
|
+ if (this.data.inforid != 0) {
|
|
|
519
|
+ this.setData({
|
|
|
520
|
+ edit_state: false
|
|
|
521
|
+ })
|
|
|
522
|
+ }
|
|
|
523
|
+ var risk_list = Object.assign(this.data.risk_list, {});
|
|
|
524
|
+ var len = risk_list.length
|
|
|
525
|
+ risk_list[len] = {
|
|
|
526
|
+ name: '',
|
|
|
527
|
+ mo: [],
|
|
|
528
|
+ project_time: '',
|
|
|
529
|
+ title: '',
|
|
|
530
|
+ num: ''
|
|
|
531
|
+ }
|
|
|
532
|
+ this.setData({
|
|
|
533
|
+ risk_list: risk_list
|
|
|
534
|
+ })
|
|
|
535
|
+ },
|
|
|
536
|
+
|
|
|
537
|
+ //删除附加险
|
|
|
538
|
+ deleteRisk(e) {
|
|
|
539
|
+ let index = e.currentTarget.dataset.index;
|
|
|
540
|
+ let risk_list = Object.assign(this.data.risk_list, {});
|
|
|
541
|
+ risk_list.splice(index, 1);
|
|
|
542
|
+ this.setData({
|
|
|
543
|
+ risk_list: risk_list
|
|
|
544
|
+ })
|
|
|
545
|
+ },
|
|
|
546
|
+
|
|
|
547
|
+ //上传图片
|
|
|
548
|
+ uploadImage() {
|
|
|
549
|
+ let that = this;
|
|
|
550
|
+ wx.chooseImage({
|
|
|
551
|
+ count: 6,
|
|
|
552
|
+ sizeType: ['original', 'compressed'],
|
|
|
553
|
+ success: function(res) {
|
|
|
554
|
+ let successUp = 0; //成功个数
|
|
|
555
|
+ let failUp = 0; //失败个数
|
|
|
556
|
+ let i = 0; //第几个
|
|
|
557
|
+ let tempFilePaths = res.tempFilePaths //总文件
|
|
|
558
|
+ let length = res.tempFilePaths.length //总共个数
|
|
|
559
|
+ wx.showNavigationBarLoading()
|
|
|
560
|
+ wx.showLoading({
|
|
|
561
|
+ title: '上传中',
|
89
|
})
|
562
|
})
|
|
|
563
|
+ that.uploadAllfile(tempFilePaths, successUp, failUp, i, length)
|
90
|
},
|
564
|
},
|
91
|
-
|
|
|
92
|
- //主险名称
|
|
|
93
|
- setRiskName(e) {
|
|
|
94
|
- // console.log(e)
|
|
|
95
|
- this.setData({
|
|
|
96
|
- main_risks: e.detail.value,
|
|
|
97
|
- })
|
|
|
98
|
- // console.log(this.data.main_risks)
|
565
|
+ fail: function(res) {}
|
|
|
566
|
+ })
|
|
|
567
|
+ },
|
|
|
568
|
+
|
|
|
569
|
+ //上传图片接口调取
|
|
|
570
|
+ uploadAllfile(filePaths, successUp, failUp, i, length) {
|
|
|
571
|
+ let that = this
|
|
|
572
|
+ let strtime = +new Date()
|
|
|
573
|
+ wx.uploadFile({
|
|
|
574
|
+ url: 'https://insurance.w.broteam.cn/pubilc/upload', //仅为示例,非真实的接口地址
|
|
|
575
|
+ filePath: filePaths[i],
|
|
|
576
|
+ name: 'picurl',
|
|
|
577
|
+ formData: {
|
|
|
578
|
+ 'strtime': strtime,
|
|
|
579
|
+ 'token': app.strTime(strtime)
|
99
|
},
|
580
|
},
|
100
|
-
|
|
|
101
|
- //保费
|
|
|
102
|
- yearMoney(e) {
|
|
|
103
|
- this.setData({
|
|
|
104
|
- year_money: e.detail.value,
|
|
|
105
|
- })
|
581
|
+ success: function(res) {
|
|
|
582
|
+ wx.hideNavigationBarLoading()
|
|
|
583
|
+ wx.hideLoading()
|
|
|
584
|
+ if (res.statusCode == '200') {
|
|
|
585
|
+ let imgTemp = that.data.imgs;
|
|
|
586
|
+ let curImg = JSON.parse(res.data).data.picurl;
|
|
|
587
|
+ if (imgTemp.length < 6) {
|
|
|
588
|
+ imgTemp.push("http://" + curImg)
|
|
|
589
|
+ that.setData({
|
|
|
590
|
+ imgs: imgTemp
|
|
|
591
|
+ })
|
|
|
592
|
+ wx.showToast({
|
|
|
593
|
+ title: '上传成功',
|
|
|
594
|
+ icon: 'none',
|
|
|
595
|
+ duration: 2000,
|
|
|
596
|
+ })
|
|
|
597
|
+ } else {
|
|
|
598
|
+ wx.showToast({
|
|
|
599
|
+ title: '图片上限6张',
|
|
|
600
|
+ icon: 'none',
|
|
|
601
|
+ duration: 2000,
|
|
|
602
|
+ })
|
|
|
603
|
+ }
|
|
|
604
|
+ } else {
|
|
|
605
|
+ wx.showModal({
|
|
|
606
|
+ title: '提示',
|
|
|
607
|
+ content: res.msg,
|
|
|
608
|
+ showCancel: false
|
|
|
609
|
+ })
|
|
|
610
|
+ }
|
106
|
},
|
611
|
},
|
107
|
-
|
|
|
108
|
- //设置银行
|
|
|
109
|
- setBank(e) {
|
|
|
110
|
- this.setData({
|
|
|
111
|
- bank: e.detail.value,
|
|
|
112
|
- })
|
612
|
+ fail: function(res) {
|
|
|
613
|
+ wx.hideNavigationBarLoading()
|
|
|
614
|
+ wx.hideLoading()
|
113
|
},
|
615
|
},
|
114
|
-
|
|
|
115
|
- //设置账号
|
|
|
116
|
- setBankNum(e) {
|
|
|
117
|
- this.setData({
|
|
|
118
|
- bank_num: e.detail.value,
|
|
|
119
|
- })
|
616
|
+ complete: () => {
|
|
|
617
|
+ i++;
|
|
|
618
|
+ if (i == length) {
|
|
|
619
|
+ // console.log('总共' + successUp + '张上传成功,' + failUp + '张上传失败!');
|
|
|
620
|
+ } else { //递归调用uploadDIY函数
|
|
|
621
|
+ this.uploadAllfile(filePaths, successUp, failUp, i, length);
|
|
|
622
|
+ }
|
120
|
},
|
623
|
},
|
121
|
-
|
|
|
122
|
- //合同生效日
|
|
|
123
|
- compactTime(e) {
|
624
|
+ })
|
|
|
625
|
+ },
|
|
|
626
|
+
|
|
|
627
|
+ //预览图片
|
|
|
628
|
+ viewImg(e) {
|
|
|
629
|
+ var imgs = this.data.imgs
|
|
|
630
|
+ var current = e.currentTarget.dataset.index
|
|
|
631
|
+ wx.previewImage({
|
|
|
632
|
+ //当前显示图片
|
|
|
633
|
+ current: imgs[current],
|
|
|
634
|
+ //所有图片
|
|
|
635
|
+ urls: imgs
|
|
|
636
|
+ })
|
|
|
637
|
+ },
|
|
|
638
|
+
|
|
|
639
|
+ //删除图片
|
|
|
640
|
+ deleteImg(e) {
|
|
|
641
|
+ var imgs = this.data.imgs;
|
|
|
642
|
+ var index = e.currentTarget.dataset.index;
|
|
|
643
|
+ imgs.splice(index, 1);
|
|
|
644
|
+ this.setData({
|
|
|
645
|
+ imgs: imgs
|
|
|
646
|
+ });
|
|
|
647
|
+ },
|
|
|
648
|
+
|
|
|
649
|
+ //保障期
|
|
|
650
|
+ warrantyTwo(e) {
|
|
|
651
|
+ if (this.data.inforid != 0) {
|
|
|
652
|
+ this.setData({
|
|
|
653
|
+ edit_state: false
|
|
|
654
|
+ })
|
|
|
655
|
+ }
|
|
|
656
|
+ var guarantee_name = e.detail.value
|
|
|
657
|
+ this.setData({
|
|
|
658
|
+ guarantee_name: e.detail.value
|
|
|
659
|
+ })
|
|
|
660
|
+ this.countImpletionTime2()
|
|
|
661
|
+ },
|
|
|
662
|
+
|
|
|
663
|
+ //选择各项单位
|
|
|
664
|
+ selectUnit(e) {
|
|
|
665
|
+ var unit = e.currentTarget.dataset.unit
|
|
|
666
|
+ this.setData({
|
|
|
667
|
+ unit: unit
|
|
|
668
|
+ })
|
|
|
669
|
+ this.countImpletionTime2()
|
|
|
670
|
+ },
|
|
|
671
|
+
|
|
|
672
|
+ //重组保障期数据格式
|
|
|
673
|
+ tempWarranty() {
|
|
|
674
|
+ var guarantee_name = this.data.guarantee_name
|
|
|
675
|
+ var unit = this.data.unit
|
|
|
676
|
+ var warranty_two = this.data.warranty_two
|
|
|
677
|
+ warranty_two.num = guarantee_name
|
|
|
678
|
+ warranty_two.title = unit
|
|
|
679
|
+ this.setData({
|
|
|
680
|
+ warranty_two: warranty_two
|
|
|
681
|
+ })
|
|
|
682
|
+ },
|
|
|
683
|
+
|
|
|
684
|
+
|
|
|
685
|
+ //计算缴费期满日,主线保障其
|
|
|
686
|
+ countImpletionTime2() {
|
|
|
687
|
+ var guarantee_name = parseInt(this.data.guarantee_name)
|
|
|
688
|
+ var unit = this.data.unit
|
|
|
689
|
+ var compact_time = this.data.compact_time
|
|
|
690
|
+ var year = parseInt(new Date(compact_time).getFullYear())
|
|
|
691
|
+ console.log(year)
|
|
|
692
|
+ var month = parseInt(new Date(compact_time).getMonth() + 1)
|
|
|
693
|
+ var day = parseInt(new Date(compact_time).getDate())
|
|
|
694
|
+ // var impletion_time = this.data.impletion_time
|
|
|
695
|
+ var warranty_one = this.data.warranty_one
|
|
|
696
|
+
|
|
|
697
|
+ var tempbirth_time = ''
|
|
|
698
|
+ var birthday = '1995-04-20'
|
|
|
699
|
+ var birthday_year = parseInt(new Date(birthday).getFullYear())
|
|
|
700
|
+
|
|
|
701
|
+ if (compact_time == '') {
|
|
|
702
|
+ wx.showToast({
|
|
|
703
|
+ title: '请选择合同生效日',
|
|
|
704
|
+ icon: 'none'
|
|
|
705
|
+ })
|
|
|
706
|
+ } else {
|
|
|
707
|
+ if (unit == '年') {
|
|
|
708
|
+ var temp_year = (year + guarantee_name)
|
|
|
709
|
+ var temp_day = day - 1
|
|
|
710
|
+ if (month < 10) month = "0" + month;
|
|
|
711
|
+ if (temp_day < 10) temp_day = "0" + temp_day;
|
|
|
712
|
+ // impletion_time = temp_year + '-' + month + '-' + temp_day
|
|
|
713
|
+ warranty_one = temp_year + '-' + month + '-' + temp_day
|
|
|
714
|
+ } else if (unit == '岁') {
|
|
|
715
|
+ var temp_year = (birthday_year + guarantee_name - 1)
|
|
|
716
|
+ var temp_year2 = (birthday_year + guarantee_name)
|
|
|
717
|
+ var temp_month = month
|
|
|
718
|
+ if (temp_month < 10) temp_month = "0" + temp_month;
|
|
|
719
|
+ if (month < 10) month = "0" + month;
|
|
|
720
|
+ if (day < 10) day = "0" + day;
|
|
|
721
|
+ // impletion_time = temp_year + '-' + temp_month + '-' + day
|
|
|
722
|
+ warranty_one = temp_year2 + '-' + month + '-' + day
|
|
|
723
|
+ } else if (unit == '终身') {
|
|
|
724
|
+ // impletion_time = '终身缴费'
|
|
|
725
|
+ warranty_one = '终身'
|
|
|
726
|
+ }
|
|
|
727
|
+ this.setData({
|
|
|
728
|
+ // impletion_time: impletion_time,
|
|
|
729
|
+ warranty_one: warranty_one
|
|
|
730
|
+ })
|
|
|
731
|
+ }
|
|
|
732
|
+ },
|
|
|
733
|
+
|
|
|
734
|
+ //缴费时长
|
|
|
735
|
+ burningTime(e) {
|
|
|
736
|
+ if (this.data.inforid != 0) {
|
|
|
737
|
+ this.setData({
|
|
|
738
|
+ edit_state: false
|
|
|
739
|
+ })
|
|
|
740
|
+ }
|
|
|
741
|
+ var time_name = e.detail.value
|
|
|
742
|
+ this.setData({
|
|
|
743
|
+ time_name: time_name
|
|
|
744
|
+ })
|
|
|
745
|
+ this.countImpletionTime()
|
|
|
746
|
+ },
|
|
|
747
|
+
|
|
|
748
|
+ selectUnit2(e) {
|
|
|
749
|
+ var unit = e.currentTarget.dataset.unit
|
|
|
750
|
+ this.setData({
|
|
|
751
|
+ unit2: unit
|
|
|
752
|
+ })
|
|
|
753
|
+ this.countImpletionTime()
|
|
|
754
|
+ },
|
|
|
755
|
+
|
|
|
756
|
+ //重组缴费时长数据格式
|
|
|
757
|
+ tempburningTime() {
|
|
|
758
|
+ var time_name = this.data.time_name
|
|
|
759
|
+ var unit = this.data.unit2
|
|
|
760
|
+ var long_money = this.data.long_money
|
|
|
761
|
+ long_money.num = time_name
|
|
|
762
|
+ long_money.title = unit
|
|
|
763
|
+ this.setData({
|
|
|
764
|
+ long_money: long_money
|
|
|
765
|
+ })
|
|
|
766
|
+ },
|
|
|
767
|
+
|
|
|
768
|
+
|
|
|
769
|
+ //计算缴费期满日,主线保障其
|
|
|
770
|
+ countImpletionTime() {
|
|
|
771
|
+ var time_name = parseInt(this.data.time_name)
|
|
|
772
|
+ var unit = this.data.unit2
|
|
|
773
|
+ var compact_time = this.data.compact_time
|
|
|
774
|
+ var year = parseInt(new Date(compact_time).getFullYear())
|
|
|
775
|
+ var month = parseInt(new Date(compact_time).getMonth() + 1)
|
|
|
776
|
+ var day = parseInt(new Date(compact_time).getDate())
|
|
|
777
|
+ var impletion_time = this.data.impletion_time
|
|
|
778
|
+ // var warranty_one = this.data.warranty_one
|
|
|
779
|
+
|
|
|
780
|
+ var tempbirth_time = ''
|
|
|
781
|
+ var birthday = '1995-04-20'
|
|
|
782
|
+ var birthday_year = parseInt(new Date(birthday).getFullYear())
|
|
|
783
|
+
|
|
|
784
|
+ if (compact_time == '') {
|
|
|
785
|
+ wx.showToast({
|
|
|
786
|
+ title: '请选择合同生效日',
|
|
|
787
|
+ icon: 'none'
|
|
|
788
|
+ })
|
|
|
789
|
+ } else {
|
|
|
790
|
+ if (unit == '年') {
|
|
|
791
|
+ var temp_year = (year + time_name)
|
|
|
792
|
+ var temp_day = day - 1
|
|
|
793
|
+ if (month < 10) month = "0" + month;
|
|
|
794
|
+ if (temp_day < 10) temp_day = "0" + temp_day;
|
|
|
795
|
+ impletion_time = temp_year + '-' + month + '-' + temp_day
|
|
|
796
|
+ // warranty_one = temp_year + '-' + month + '-' + temp_day
|
|
|
797
|
+ } else if (unit == '岁') {
|
|
|
798
|
+ var temp_year = (birthday_year + time_name - 1)
|
|
|
799
|
+ var temp_year2 = (birthday_year + time_name)
|
|
|
800
|
+ var temp_month = month
|
|
|
801
|
+ if (temp_month < 10) temp_month = "0" + temp_month;
|
|
|
802
|
+ if (month < 10) month = "0" + month;
|
|
|
803
|
+ if (day < 10) day = "0" + day;
|
|
|
804
|
+ impletion_time = temp_year + '-' + temp_month + '-' + day
|
|
|
805
|
+ // warranty_one = temp_year2 + '-' + month + '-' + day
|
|
|
806
|
+ } else if (unit == '终身') {
|
|
|
807
|
+ impletion_time = '终身缴费'
|
|
|
808
|
+ // warranty_one = '终身'
|
|
|
809
|
+ }
|
|
|
810
|
+ this.setData({
|
|
|
811
|
+ impletion_time: impletion_time,
|
|
|
812
|
+ // warranty_one: warranty_one
|
|
|
813
|
+ })
|
|
|
814
|
+ }
|
|
|
815
|
+ },
|
|
|
816
|
+
|
|
|
817
|
+ //缴费方式
|
|
|
818
|
+ selectUnit3(e) {
|
|
|
819
|
+ var unit = e.currentTarget.dataset.unit
|
|
|
820
|
+ this.setData({
|
|
|
821
|
+ unit3: unit,
|
|
|
822
|
+ type_money: unit
|
|
|
823
|
+ })
|
|
|
824
|
+ },
|
|
|
825
|
+
|
|
|
826
|
+ //附加险保障其
|
|
|
827
|
+ selectUnit4(e) {
|
|
|
828
|
+ var unit = e.currentTarget.dataset.unit;
|
|
|
829
|
+ let index = e.currentTarget.dataset.index;
|
|
|
830
|
+ let risk_list = Object.assign(this.data.risk_list, {});
|
|
|
831
|
+ risk_list[index].title = unit
|
|
|
832
|
+ this.setData({
|
|
|
833
|
+ risk_list: risk_list
|
|
|
834
|
+ })
|
|
|
835
|
+ },
|
|
|
836
|
+
|
|
|
837
|
+ //家庭成员
|
|
|
838
|
+ familyMember(id) {
|
|
|
839
|
+ var FamilyId = this.data.FamilyId
|
|
|
840
|
+ let url = 'counselor/familyname'
|
|
|
841
|
+ let params = {
|
|
|
842
|
+ FamilyId: FamilyId || id,
|
|
|
843
|
+ }
|
|
|
844
|
+ app.post(url, params).then((res) => {
|
|
|
845
|
+ // console.log(res)
|
|
|
846
|
+ var beneficiary_list = this.data.beneficiary_list
|
|
|
847
|
+ for (var i in beneficiary_list) {
|
|
|
848
|
+ beneficiary_list[i].name_array = res.data.data.list
|
|
|
849
|
+ }
|
|
|
850
|
+ // console.log(beneficiary_list)
|
|
|
851
|
+
|
|
|
852
|
+ if (res.data.code == 200) {
|
124
|
this.setData({
|
853
|
this.setData({
|
125
|
- compact_time: e.detail.value,
|
854
|
+ insure: res.data.data.list,
|
|
|
855
|
+ recognizee: res.data.data.list,
|
|
|
856
|
+ beneficiary_list: beneficiary_list,
|
126
|
})
|
857
|
})
|
127
|
- this.countImpletionTime()
|
|
|
128
|
- this.countImpletionTime2()
|
|
|
129
|
- },
|
|
|
130
|
-
|
|
|
131
|
- //缴费期满日
|
|
|
132
|
- impletionTime(e) {
|
|
|
133
|
- this.setData({
|
|
|
134
|
- impletion_time: e.detail.value,
|
858
|
+ }
|
|
|
859
|
+ })
|
|
|
860
|
+ },
|
|
|
861
|
+
|
|
|
862
|
+ //设置缓存
|
|
|
863
|
+ setStorge(e) {
|
|
|
864
|
+ this.tempBeneficiary()
|
|
|
865
|
+ this.tempWarranty()
|
|
|
866
|
+ this.tempburningTime()
|
|
|
867
|
+ this.tempMain()
|
|
|
868
|
+ this.tempAddRisk()
|
|
|
869
|
+ var favoree = JSON.stringify(this.data.tempfavoree)
|
|
|
870
|
+ var warranty_two = JSON.stringify(this.data.warranty_two)
|
|
|
871
|
+ var long_money = JSON.stringify(this.data.long_money)
|
|
|
872
|
+ var more = JSON.stringify(this.data.more)
|
|
|
873
|
+ var guarantee = JSON.stringify(this.data.guarantee)
|
|
|
874
|
+ var warn = ""; //弹框时提示的内容
|
|
|
875
|
+ var in_num = this.data.in_num
|
|
|
876
|
+ var firm = this.data.firm
|
|
|
877
|
+ var applicant = this.data.applicant_name
|
|
|
878
|
+ var recognizee = this.data.recognizee_name
|
|
|
879
|
+ var main_risks = this.data.main_risks
|
|
|
880
|
+ var year_money = this.data.year_money
|
|
|
881
|
+ var compact_time = this.data.compact_time
|
|
|
882
|
+ var impletion_time = this.data.impletion_time
|
|
|
883
|
+ var warranty_one = JSON.stringify(this.data.warranty_one)
|
|
|
884
|
+ var type_money = this.data.type_money
|
|
|
885
|
+ var bank = this.data.bank
|
|
|
886
|
+ var bank_num = this.data.bank_num
|
|
|
887
|
+ var picurl = JSON.stringify(this.data.imgs)
|
|
|
888
|
+ let url = 'counselor/inforsave'
|
|
|
889
|
+ let params = {
|
|
|
890
|
+ // InfoId: this.data.inforid,
|
|
|
891
|
+ def_id: this.data.def_id,
|
|
|
892
|
+ in_num: in_num,
|
|
|
893
|
+ firm: firm,
|
|
|
894
|
+ applicant: applicant,
|
|
|
895
|
+ recognizee: recognizee,
|
|
|
896
|
+ favoree: favoree,
|
|
|
897
|
+ main_risks: main_risks,
|
|
|
898
|
+ guarantee: guarantee,
|
|
|
899
|
+ year_money: year_money,
|
|
|
900
|
+ warranty_two: warranty_two,
|
|
|
901
|
+ compact_time: compact_time,
|
|
|
902
|
+ impletion_time: impletion_time,
|
|
|
903
|
+ warranty_one: warranty_one,
|
|
|
904
|
+ long_money: long_money,
|
|
|
905
|
+ type_money: type_money,
|
|
|
906
|
+ bank: bank,
|
|
|
907
|
+ bank_num: bank_num,
|
|
|
908
|
+ more: more,
|
|
|
909
|
+ picurl: picurl,
|
|
|
910
|
+ }
|
|
|
911
|
+ app.post(url, params).then((res) => {
|
|
|
912
|
+ if (res.data.code == 200) {
|
|
|
913
|
+ wx.navigateBack({
|
|
|
914
|
+ delta: 1,
|
135
|
})
|
915
|
})
|
136
|
- },
|
|
|
137
|
-
|
|
|
138
|
- //主险保障期
|
|
|
139
|
- periodTime(e) {
|
|
|
140
|
this.setData({
|
916
|
this.setData({
|
141
|
- period_index: e.detail.value,
|
917
|
+ storge_state: true
|
142
|
})
|
918
|
})
|
143
|
- },
|
919
|
+ var storge_state = true
|
|
|
920
|
+ wx.setStorageSync('storge_state', storge_state)
|
|
|
921
|
+ }
|
|
|
922
|
+ })
|
|
|
923
|
+ },
|
|
|
924
|
+
|
|
|
925
|
+ //获取缓存内容
|
|
|
926
|
+ getStorage() {
|
|
|
927
|
+ let url = 'counselor/inforCopy'
|
|
|
928
|
+ let params = {
|
|
|
929
|
+ def_id: this.data.def_id,
|
|
|
930
|
+ }
|
|
|
931
|
+ app.post(url, params).then((res) => {
|
|
|
932
|
+ console.log(res)
|
|
|
933
|
+ if (res.data.code == 200) {
|
|
|
934
|
+ var warranty_two = res.data.data.def.warranty_two
|
|
|
935
|
+ var unit = this.data.unit
|
|
|
936
|
+ unit = warranty_two.title
|
|
|
937
|
+ var long_money = res.data.data.def.long_money
|
|
|
938
|
+ var unit2 = this.data.unit2
|
|
|
939
|
+ unit2 = long_money.title
|
|
|
940
|
+ var type_money = res.data.data.def.type_money
|
|
|
941
|
+ var unit3 = this.data.unit3
|
|
|
942
|
+ unit3 = type_money
|
|
|
943
|
+ var beneficiary_list = res.data.data.def.favoree
|
|
|
944
|
+ for (var obj in beneficiary_list) {
|
|
|
945
|
+ beneficiary_list[obj].beneficiary_name = beneficiary_list[obj].name
|
|
|
946
|
+ beneficiary_list[obj].name_array = this.data.insure
|
|
|
947
|
+ }
|
144
|
|
948
|
|
145
|
- //保障项目弹窗
|
|
|
146
|
- ensureProject(e) {
|
|
|
147
|
this.setData({
|
949
|
this.setData({
|
148
|
- edit_state: false
|
950
|
+ imgs: res.data.data.def.picurl,
|
|
|
951
|
+ type_money: res.data.data.def.type_money,
|
|
|
952
|
+ unit3: unit3,
|
|
|
953
|
+ year_money: res.data.data.def.year_money,
|
|
|
954
|
+ long_money: res.data.data.def.long_money,
|
|
|
955
|
+ unit2: unit2,
|
|
|
956
|
+ in_num: res.data.data.def.in_num,
|
|
|
957
|
+ firm: res.data.data.def.firm,
|
|
|
958
|
+ main_risks: res.data.data.def.main_risks,
|
|
|
959
|
+ main_array: res.data.data.def.guarantee,
|
|
|
960
|
+ applicant_name: res.data.data.def.applicant,
|
|
|
961
|
+ recognizee_name: res.data.data.def.recognizee,
|
|
|
962
|
+ warranty_one: res.data.data.def.warranty_one,
|
|
|
963
|
+ warranty_two: res.data.data.def.warranty_two,
|
|
|
964
|
+ unit: unit,
|
|
|
965
|
+ compact_time: res.data.data.def.compact_time,
|
|
|
966
|
+ impletion_time: res.data.data.def.impletion_time,
|
|
|
967
|
+ bank: res.data.data.def.bank,
|
|
|
968
|
+ bank_num: res.data.data.def.bank_num,
|
|
|
969
|
+ risk_list: res.data.data.def.more,
|
|
|
970
|
+ beneficiary_list: beneficiary_list,
|
|
|
971
|
+ edit_state: true,
|
149
|
})
|
972
|
})
|
150
|
-
|
|
|
151
|
- let that = this;
|
|
|
152
|
- let type = e.currentTarget.dataset.type;
|
|
|
153
|
- let index = e.currentTarget.dataset.xulie;
|
|
|
154
|
- let tempProjectlist = Object.assign(this.data.projectlist, {});
|
|
|
155
|
- // 已经添加的附加险
|
|
|
156
|
- let risk_list = Object.assign(this.data.risk_list, {});
|
|
|
157
|
- console.log(risk_list)
|
|
|
158
|
- let tempRist = risk_list[index].mo;
|
|
|
159
|
- console.log(tempRist)
|
|
|
160
|
- // 已经添加的主险
|
|
|
161
|
- let tempMain_list = Object.assign(this.data.main_array, {})
|
|
|
162
|
- if (type == 'zhuxian') {
|
|
|
163
|
- if (tempMain_list.length > 0) {
|
|
|
164
|
- for (let i in tempProjectlist) {
|
|
|
165
|
- for (let j in tempMain_list) {
|
|
|
166
|
- if (tempProjectlist[i].id == tempMain_list[j].id) {
|
|
|
167
|
- tempProjectlist[i].choose_status = true
|
|
|
168
|
- for (let g in tempProjectlist[i].title) {
|
|
|
169
|
- tempProjectlist[i].title[g].t_id == tempMain_list[j].t_id ? tempProjectlist[i].title[g].label_state = true : ''
|
|
|
170
|
-
|
|
|
171
|
- }
|
|
|
172
|
- }
|
|
|
173
|
- }
|
|
|
174
|
- }
|
|
|
175
|
- }
|
|
|
176
|
- } else {
|
|
|
177
|
- if (tempRist.length) {
|
|
|
178
|
- for (let i in tempProjectlist) {
|
|
|
179
|
- for (let j in tempRist) {
|
|
|
180
|
- if (tempProjectlist[i].id == tempRist[j].id) {
|
|
|
181
|
- tempProjectlist[i].choose_status = true
|
|
|
182
|
- for (let g in tempProjectlist[i].title) {
|
|
|
183
|
- console.log(tempProjectlist[i].title[g])
|
|
|
184
|
- tempProjectlist[i].title[g].t_id == tempMain_list[j].t_id ? tempProjectlist[i].title[g].label_state = true : ''
|
|
|
185
|
- }
|
|
|
186
|
- }
|
|
|
187
|
- }
|
|
|
188
|
- }
|
|
|
189
|
- }
|
|
|
190
|
- }
|
|
|
191
|
-
|
|
|
192
|
- wx.setNavigationBarTitle({
|
|
|
193
|
- title: '选择保障项目',
|
|
|
194
|
- })
|
|
|
195
|
-
|
|
|
196
|
- this.setData({
|
|
|
197
|
- popup_state: true,
|
|
|
198
|
- addType: type,
|
|
|
199
|
- xulie: index,
|
|
|
200
|
- projectlist: tempProjectlist
|
|
|
201
|
- })
|
|
|
202
|
- },
|
|
|
203
|
-
|
|
|
204
|
- // 调取保障项目接口
|
|
|
205
|
- ensureProjectList() {
|
|
|
206
|
- var main_risk = this.data.main_risk
|
|
|
207
|
- let url = 'counselor/sageguard'
|
|
|
208
|
- let params = {}
|
|
|
209
|
- app.post(url, params).then((res) => {
|
|
|
210
|
- if (res.data.code == 200) {
|
|
|
211
|
- var projectlist = res.data.data.def;
|
|
|
212
|
- for (var i = 0; i < projectlist.length; i++) {
|
|
|
213
|
- projectlist[i].choose_status = false
|
|
|
214
|
- for (var j = 0; j < projectlist[i].title.length; j++) {
|
|
|
215
|
- projectlist[i].title[j].label_state = false
|
|
|
216
|
- }
|
|
|
217
|
- projectlist[i].title[0].current = 0
|
|
|
218
|
- projectlist[i].title[0].label_state = true
|
|
|
219
|
- }
|
|
|
220
|
- this.setData({
|
|
|
221
|
- projectlist: res.data.data.def
|
|
|
222
|
- })
|
|
|
223
|
- // console.log(this.data.projectlist)
|
|
|
224
|
- }
|
|
|
225
|
- })
|
|
|
226
|
- },
|
|
|
227
|
-
|
|
|
228
|
- //保障项目单位
|
|
|
229
|
- getUnit(e) {
|
|
|
230
|
- var main_risk = this.data.main_risk
|
|
|
231
|
- var index = e.currentTarget.dataset.index;
|
|
|
232
|
- var sindex = e.currentTarget.dataset.sindex;
|
|
|
233
|
- var projectlist = this.data.projectlist;
|
|
|
234
|
- var title = projectlist[index].title
|
|
|
235
|
- for (var i = 0; i < title.length; i++) {
|
|
|
236
|
- title[i].current = ''
|
|
|
237
|
- if (title[i].current == '') {
|
|
|
238
|
- title[i].label_state = false
|
|
|
239
|
- }
|
|
|
240
|
- }
|
|
|
241
|
- projectlist[index].title[sindex].current = sindex
|
|
|
242
|
- if (projectlist[index].title[sindex].current == sindex) {
|
|
|
243
|
- projectlist[index].title[sindex].label_state = true
|
|
|
244
|
- }
|
|
|
245
|
- this.setData({
|
|
|
246
|
- projectlist: projectlist,
|
973
|
+ }
|
|
|
974
|
+ })
|
|
|
975
|
+ },
|
|
|
976
|
+
|
|
|
977
|
+ //完成保单添加
|
|
|
978
|
+ listVerify(e) {
|
|
|
979
|
+ if (this.data.inforid == 0 || this.data.inforid == undefined) {
|
|
|
980
|
+ this.tempBeneficiary()
|
|
|
981
|
+ this.tempWarranty()
|
|
|
982
|
+ this.tempburningTime()
|
|
|
983
|
+ this.tempMain()
|
|
|
984
|
+ this.tempAddRisk()
|
|
|
985
|
+ var favoree = JSON.stringify(this.data.tempfavoree)
|
|
|
986
|
+ var warranty_two = JSON.stringify(this.data.warranty_two)
|
|
|
987
|
+ var long_money = JSON.stringify(this.data.long_money)
|
|
|
988
|
+ var more = JSON.stringify(this.data.more)
|
|
|
989
|
+ var guarantee = JSON.stringify(this.data.guarantee)
|
|
|
990
|
+ } else if (this.data.edit_state) {
|
|
|
991
|
+ var favoree = JSON.stringify(this.data.beneficiary_list)
|
|
|
992
|
+ var warranty_two = JSON.stringify(this.data.warranty_two)
|
|
|
993
|
+ var long_money = JSON.stringify(this.data.long_money)
|
|
|
994
|
+ var more = JSON.stringify(this.data.risk_list)
|
|
|
995
|
+ var guarantee = JSON.stringify(this.data.main_array)
|
|
|
996
|
+ } else {
|
|
|
997
|
+ this.tempBeneficiary()
|
|
|
998
|
+ this.tempWarranty()
|
|
|
999
|
+ this.tempburningTime()
|
|
|
1000
|
+ this.tempMain()
|
|
|
1001
|
+ this.tempAddRisk()
|
|
|
1002
|
+ var favoree = JSON.stringify(this.data.tempfavoree)
|
|
|
1003
|
+ var warranty_two = JSON.stringify(this.data.warranty_two)
|
|
|
1004
|
+ var long_money = JSON.stringify(this.data.long_money)
|
|
|
1005
|
+ var more = JSON.stringify(this.data.more)
|
|
|
1006
|
+ var guarantee = JSON.stringify(this.data.guarantee)
|
|
|
1007
|
+ }
|
|
|
1008
|
+
|
|
|
1009
|
+ var warn = ""; //弹框时提示的内容
|
|
|
1010
|
+ var flag = true; //判断信息输入是否完整判断弹窗
|
|
|
1011
|
+ var in_num = e.detail.value.policy_num
|
|
|
1012
|
+ var firm = e.detail.value.company;
|
|
|
1013
|
+ var applicant = this.data.applicant_name
|
|
|
1014
|
+ var recognizee = this.data.recognizee_name
|
|
|
1015
|
+ var main_risks = e.detail.value.main_risks
|
|
|
1016
|
+
|
|
|
1017
|
+ var year_money = e.detail.value.year_money
|
|
|
1018
|
+ var compact_time = this.data.compact_time
|
|
|
1019
|
+ var impletion_time = this.data.impletion_time
|
|
|
1020
|
+ var warranty_one = JSON.stringify(this.data.warranty_one)
|
|
|
1021
|
+ var type_money = this.data.type_money
|
|
|
1022
|
+ var bank = e.detail.value.bank
|
|
|
1023
|
+ var bank_num = e.detail.value.bank_num
|
|
|
1024
|
+ var picurl = JSON.stringify(this.data.imgs)
|
|
|
1025
|
+
|
|
|
1026
|
+ var continue1 = e.detail.target.dataset.type
|
|
|
1027
|
+ var complete = e.detail.target.dataset.type
|
|
|
1028
|
+
|
|
|
1029
|
+ if (in_num == '') {
|
|
|
1030
|
+ warn = '请输入保单号!'
|
|
|
1031
|
+ } else if (firm == '') {
|
|
|
1032
|
+ warn = '请输入所属公司!'
|
|
|
1033
|
+ } else if (applicant == '') {
|
|
|
1034
|
+ warn = '请输入投保人!'
|
|
|
1035
|
+ } else if (recognizee == '') {
|
|
|
1036
|
+ warn = '请输入被保险人!'
|
|
|
1037
|
+ } else if (favoree == '') {
|
|
|
1038
|
+ warn = '请输入受益人!'
|
|
|
1039
|
+ } else if (main_risks == '') {
|
|
|
1040
|
+ warn = '请输入主险名称!'
|
|
|
1041
|
+ } else if (year_money == '') {
|
|
|
1042
|
+ warn = '请输入年交保费!'
|
|
|
1043
|
+ } else if (compact_time == '') {
|
|
|
1044
|
+ warn = '请输入合同生效日!'
|
|
|
1045
|
+ } else if (warranty_two.num == '') {
|
|
|
1046
|
+ warn = '请输入保障期!'
|
|
|
1047
|
+ } else if (long_money.num == '') {
|
|
|
1048
|
+ warn = '请输入缴费时长!'
|
|
|
1049
|
+ } else if (type_money == '') {
|
|
|
1050
|
+ warn = '请输入缴费方式!'
|
|
|
1051
|
+ } else if (bank == '') {
|
|
|
1052
|
+ warn = '请输入续费银行!'
|
|
|
1053
|
+ } else if (bank_num == '') {
|
|
|
1054
|
+ warn = '请输入续费账号!'
|
|
|
1055
|
+ } else if (!(/^[0-9]+.?[0-9]*/.test(bank_num))) {
|
|
|
1056
|
+ warn = '请输入正确续费账号!'
|
|
|
1057
|
+ } else if (impletion_time == '') {
|
|
|
1058
|
+ warn = '请输入缴费期满日!'
|
|
|
1059
|
+ } else if (warranty_one == '') {
|
|
|
1060
|
+ warn = '请输入主险保障期!'
|
|
|
1061
|
+ } else if (more == '') {
|
|
|
1062
|
+ warn = '请输入附加险!'
|
|
|
1063
|
+ } else if (picurl.length == 2) {
|
|
|
1064
|
+ warn = '请选择图片!'
|
|
|
1065
|
+ } else {
|
|
|
1066
|
+ flag = false
|
|
|
1067
|
+ // 添加、修改保单接口调取
|
|
|
1068
|
+ let url = 'counselor/inforuodate'
|
|
|
1069
|
+ let params = {
|
|
|
1070
|
+ InfoId: this.data.inforid,
|
|
|
1071
|
+ def_id: this.data.def_id,
|
|
|
1072
|
+ in_num: in_num,
|
|
|
1073
|
+ firm: firm,
|
|
|
1074
|
+ applicant: applicant,
|
|
|
1075
|
+ recognizee: recognizee,
|
|
|
1076
|
+ favoree: favoree,
|
|
|
1077
|
+ main_risks: main_risks,
|
|
|
1078
|
+ guarantee: guarantee,
|
|
|
1079
|
+ year_money: year_money,
|
|
|
1080
|
+ warranty_two: warranty_two,
|
|
|
1081
|
+ compact_time: compact_time,
|
|
|
1082
|
+ impletion_time: impletion_time,
|
|
|
1083
|
+ warranty_one: warranty_one,
|
|
|
1084
|
+ long_money: long_money,
|
|
|
1085
|
+ type_money: type_money,
|
|
|
1086
|
+ bank: bank,
|
|
|
1087
|
+ bank_num: bank_num,
|
|
|
1088
|
+ more: more,
|
|
|
1089
|
+ picurl: picurl,
|
|
|
1090
|
+ }
|
|
|
1091
|
+ app.post(url, params).then((res) => {
|
|
|
1092
|
+ if (res.data.code == 200) {
|
|
|
1093
|
+ if (continue1 == 'continue1') {
|
|
|
1094
|
+ wx.showToast({
|
|
|
1095
|
+ title: '添加成功',
|
|
|
1096
|
+ icon: 'none',
|
|
|
1097
|
+ duration: 2000,
|
247
|
})
|
1098
|
})
|
248
|
- },
|
|
|
249
|
-
|
|
|
250
|
- //保障项目金额
|
|
|
251
|
- popupNum(e) {
|
|
|
252
|
- var index = e.currentTarget.dataset.index;
|
|
|
253
|
- var projectlist = this.data.projectlist;
|
|
|
254
|
- if (projectlist[index].choose_status) {
|
|
|
255
|
- projectlist[index].num = e.detail.value
|
|
|
256
|
- }
|
|
|
257
|
this.setData({
|
1099
|
this.setData({
|
258
|
- projectlist: projectlist
|
1100
|
+ in_num: '',
|
|
|
1101
|
+ firm: '',
|
|
|
1102
|
+ applicant_name: '',
|
|
|
1103
|
+ recognizee_name: '',
|
|
|
1104
|
+ // beneficiary_list: [{
|
|
|
1105
|
+ // name_array: [],
|
|
|
1106
|
+ // unit: ''
|
|
|
1107
|
+ // }],
|
|
|
1108
|
+ main_risks: '',
|
|
|
1109
|
+ main_array: '',
|
|
|
1110
|
+ year_money: '',
|
|
|
1111
|
+ compact_time: '',
|
|
|
1112
|
+ warranty_two: '',
|
|
|
1113
|
+ long_money: '',
|
|
|
1114
|
+ bank: '',
|
|
|
1115
|
+ bank_num: '',
|
|
|
1116
|
+ impletion_time: '',
|
|
|
1117
|
+ warranty_one: '',
|
|
|
1118
|
+ // risk_list:'',
|
|
|
1119
|
+ imgs: '',
|
|
|
1120
|
+ unit: '',
|
|
|
1121
|
+ unit2: '',
|
|
|
1122
|
+ unit3: '',
|
|
|
1123
|
+ unit4: '',
|
259
|
})
|
1124
|
})
|
260
|
- },
|
|
|
261
|
-
|
|
|
262
|
- //选择保障项目
|
|
|
263
|
- popupState(e) {
|
|
|
264
|
- var index = e.currentTarget.dataset.index;
|
|
|
265
|
- var projectlist = this.data.projectlist;
|
|
|
266
|
- projectlist[index].choose_status = !projectlist[index].choose_status;
|
|
|
267
|
- // console.log(projectlist)
|
|
|
268
|
- this.setData({
|
|
|
269
|
- projectlist: projectlist,
|
1125
|
+ } else if (complete == 'complete') {
|
|
|
1126
|
+ wx.showToast({
|
|
|
1127
|
+ title: '添加成功',
|
|
|
1128
|
+ icon: 'none',
|
|
|
1129
|
+ duration: 2000,
|
270
|
})
|
1130
|
})
|
271
|
- if (this.data.inforid != 0) {
|
|
|
272
|
- edit_state: false
|
|
|
273
|
- }
|
|
|
274
|
- },
|
|
|
275
|
-
|
|
|
276
|
- //确认选择的推荐方案
|
|
|
277
|
- confirmCase() {
|
|
|
278
|
- let index = this.data.xulie;
|
|
|
279
|
- let type = this.data.addType;
|
|
|
280
|
- var that = this
|
|
|
281
|
- var main_array = []
|
|
|
282
|
-
|
|
|
283
|
- var projectlist = Object.assign(this.data.projectlist, {})
|
|
|
284
|
- for (var i = 0; i < projectlist.length; i++) {
|
|
|
285
|
- if (projectlist[i].choose_status) {
|
|
|
286
|
- main_array.push(projectlist[i])
|
|
|
287
|
- console.log(main_array)
|
|
|
288
|
- }
|
|
|
289
|
- }
|
|
|
290
|
-
|
|
|
291
|
- if (main_array != '') {
|
|
|
292
|
- wx.showToast({
|
|
|
293
|
- title: '添加成功',
|
|
|
294
|
- icon: 'none'
|
|
|
295
|
- })
|
|
|
296
|
-
|
|
|
297
|
- if (type == 'fujiaxian') {
|
|
|
298
|
- let tempRist = that.data.risk_list;
|
|
|
299
|
- console.log(tempRist)
|
|
|
300
|
- tempRist[index]['mo'] = main_array;
|
|
|
301
|
- that.setData({
|
|
|
302
|
- risk_list: tempRist,
|
|
|
303
|
- risk_listitm: tempRist
|
|
|
304
|
- })
|
|
|
305
|
- console.log(this.data.risk_list)
|
|
|
306
|
- } else {
|
|
|
307
|
- that.setData({
|
|
|
308
|
- main_array: main_array,
|
|
|
309
|
- })
|
|
|
310
|
- }
|
|
|
311
|
- console.log(this.data.main_array)
|
|
|
312
|
- }
|
|
|
313
|
- setTimeout(function() {
|
|
|
314
|
- that.ensureProjectList()
|
|
|
315
|
- that.setData({
|
|
|
316
|
- popup_state: false
|
|
|
317
|
- })
|
|
|
318
|
- wx.setNavigationBarTitle({
|
|
|
319
|
- title: '添加保单',
|
|
|
320
|
- })
|
|
|
321
|
- }, 800)
|
|
|
322
|
-
|
|
|
323
|
-
|
|
|
324
|
- console.log(this.data.risk_list)
|
|
|
325
|
- },
|
|
|
326
|
-
|
|
|
327
|
- //重组主险的保障项目
|
|
|
328
|
- tempMain() {
|
|
|
329
|
- var main_array = this.data.main_array
|
|
|
330
|
- var warranty_one1 = []
|
|
|
331
|
- // console.log(main_array)
|
|
|
332
|
- for (var i = 0; i < main_array.length; i++) {
|
|
|
333
|
- var temp = {}
|
|
|
334
|
- for (var j = 0; j < main_array[i].title.length; j++) {
|
|
|
335
|
- if (main_array[i].choose_status) {
|
|
|
336
|
- if (main_array[i].title[j].label_state) {
|
|
|
337
|
- temp.id = main_array[i].id
|
|
|
338
|
- temp.name = main_array[i].name
|
|
|
339
|
- temp.num = main_array[i].num
|
|
|
340
|
- temp.title = main_array[i].title[j].name
|
|
|
341
|
- temp.t_id = main_array[i].title[j].t_id
|
|
|
342
|
- }
|
|
|
343
|
- }
|
|
|
344
|
- }
|
|
|
345
|
- warranty_one1.push(temp)
|
|
|
346
|
- this.setData({
|
|
|
347
|
- guarantee: warranty_one1
|
|
|
348
|
- })
|
|
|
349
|
- }
|
|
|
350
|
-
|
|
|
351
|
- },
|
|
|
352
|
-
|
|
|
353
|
- //主险名称
|
|
|
354
|
- addRiskName(e) {
|
|
|
355
|
- var risk_list = this.data.risk_list
|
|
|
356
|
- var index = e.currentTarget.dataset.index
|
|
|
357
|
- risk_list[index].name = e.detail.value
|
|
|
358
|
- this.setData({
|
|
|
359
|
- risk_list: risk_list
|
|
|
360
|
- })
|
|
|
361
|
- },
|
|
|
362
|
-
|
|
|
363
|
- //主险保障其
|
|
|
364
|
- addRiskUnit(e) {
|
|
|
365
|
- var risk_list = this.data.risk_list
|
|
|
366
|
- var index = e.currentTarget.dataset.index
|
|
|
367
|
- risk_list[index].num = e.detail.value
|
|
|
368
|
- this.setData({
|
|
|
369
|
- risk_list: risk_list
|
|
|
370
|
- })
|
|
|
371
|
- },
|
|
|
372
|
-
|
|
|
373
|
- //重组附加险整体数据结构
|
|
|
374
|
- tempAddRisk() {
|
|
|
375
|
- var risk_list = this.data.risk_list
|
|
|
376
|
-
|
|
|
377
|
- var sub_array = []
|
|
|
378
|
- var temp_risk = this.data.risk_listitm;
|
|
|
379
|
- var temp = this.data.risk_listitm;
|
|
|
380
|
-
|
|
|
381
|
- for (var i = 0; i < temp.length; i++) {
|
|
|
382
|
- for (var j = 0; j < temp[i].mo.length; j++) {
|
|
|
383
|
- for (var k = 0; k < temp[i].mo[j].title.length; k++) {
|
|
|
384
|
- if (temp[i].name != '') {
|
|
|
385
|
- // var temp = {}
|
|
|
386
|
- // var subtemp = {}
|
|
|
387
|
- if (temp[i].mo[j].choose_status) {
|
|
|
388
|
- if (temp[i].mo[j].title[k].label_state) {
|
|
|
389
|
- temp_risk[i].name = temp[i].name
|
|
|
390
|
- temp_risk[i].num = temp[i].num
|
|
|
391
|
- temp_risk[i].title = temp[i].title
|
|
|
392
|
- temp_risk[i].mo[j].t_id = temp[i].mo[j].title[k].t_id
|
|
|
393
|
- temp_risk[i].mo[j].id = temp[i].mo[j].id
|
|
|
394
|
- temp_risk[i].mo[j].name = temp[i].mo[j].name
|
|
|
395
|
- temp_risk[i].mo[j].num = temp[i].mo[j].num
|
|
|
396
|
- temp_risk[i].mo[j].title = temp[i].mo[j].title[k].name
|
|
|
397
|
- console.log(temp_risk)
|
|
|
398
|
- }
|
|
|
399
|
- }
|
|
|
400
|
- }
|
|
|
401
|
- }
|
|
|
402
|
- }
|
|
|
403
|
-
|
|
|
404
|
- this.setData({
|
|
|
405
|
- more: temp_risk
|
|
|
406
|
- })
|
|
|
407
|
- }
|
|
|
408
|
-
|
|
|
409
|
- },
|
|
|
410
|
-
|
|
|
411
|
- //选择受益人姓名
|
|
|
412
|
- beneficiarySelect(e) {
|
|
|
413
|
- if (this.data.inforid != 0) {
|
|
|
414
|
- this.setData({
|
|
|
415
|
- edit_state: false
|
|
|
416
|
- })
|
|
|
417
|
- }
|
|
|
418
|
- var index = e.currentTarget.dataset.mindex
|
|
|
419
|
- var beneficiary_list = Object.assign(this.data.beneficiary_list, {});
|
|
|
420
|
- // 获取当前已选择的收益人
|
|
|
421
|
- let tempBenefice = Object.assign(this.data.beneficiaryList, {})
|
|
|
422
|
- // 当前选择的收益人
|
|
|
423
|
- let nowPerson = beneficiary_list[index].name_array[e.detail.value];
|
|
|
424
|
- // 判断受益人是否已经添加
|
|
|
425
|
- const add = tempBenefice.every((tempBenefice) => {
|
|
|
426
|
- return tempBenefice != nowPerson
|
|
|
427
|
- })
|
|
|
428
|
- if (add) {
|
|
|
429
|
- beneficiary_list[index].beneficiary_name = nowPerson;
|
|
|
430
|
- tempBenefice.push(nowPerson)
|
|
|
431
|
- } else {
|
|
|
432
|
- wx.showToast({
|
|
|
433
|
- title: '请不要重复添加受益人',
|
|
|
434
|
- icon: 'none'
|
|
|
435
|
- })
|
|
|
436
|
- }
|
|
|
437
|
-
|
|
|
438
|
- this.setData({
|
|
|
439
|
- beneficiary_list: beneficiary_list,
|
|
|
440
|
- beneficiaryList: tempBenefice
|
1131
|
+ wx.navigateBack({
|
|
|
1132
|
+ delta: 1,
|
441
|
})
|
1133
|
})
|
442
|
-
|
|
|
443
|
- },
|
|
|
444
|
-
|
|
|
445
|
- //添加收益比例
|
|
|
446
|
- addUnit(e) {
|
|
|
447
|
- var beneficiary_list = this.data.beneficiary_list;
|
|
|
448
|
- beneficiary_list[beneficiary_list.length - 1].unit = e.detail.value;
|
|
|
449
|
- this.setData({
|
|
|
450
|
- beneficiary_list: beneficiary_list,
|
|
|
451
|
- })
|
|
|
452
|
- },
|
|
|
453
|
-
|
|
|
454
|
- //添加受益人
|
|
|
455
|
- addPersons(e) {
|
|
|
456
|
- var list = this.data.beneficiary_list;
|
|
|
457
|
- var len = list.length
|
|
|
458
|
- if (list[len - 1].beneficiary_name == undefined) {
|
|
|
459
|
- wx.showToast({
|
|
|
460
|
- title: '请选择受益人',
|
|
|
461
|
- icon: 'none'
|
|
|
462
|
- })
|
|
|
463
|
- } else if (list[len - 1].unit == '') {
|
|
|
464
|
- console.log('unit')
|
|
|
465
|
- wx.showToast({
|
|
|
466
|
- title: '请输入收益比',
|
|
|
467
|
- icon: 'none'
|
|
|
468
|
- })
|
|
|
469
|
- } else {
|
|
|
470
|
- list[len] = {
|
|
|
471
|
- name_array: this.data.insure,
|
|
|
472
|
- unit: ''
|
|
|
473
|
- }
|
|
|
474
|
- }
|
|
|
475
|
- this.setData({
|
|
|
476
|
- beneficiary_list: list
|
|
|
477
|
- })
|
|
|
478
|
- console.log(this.data.beneficiary_list)
|
|
|
479
|
- },
|
|
|
480
|
-
|
|
|
481
|
- //重组添加受益人
|
|
|
482
|
- tempBeneficiary() {
|
|
|
483
|
- var beneficiary_list = this.data.beneficiary_list
|
|
|
484
|
- var len = beneficiary_list.length;
|
|
|
485
|
- var tempfavoree1 = [];
|
|
|
486
|
- for (var i = 0; i < beneficiary_list.length; i++) {
|
|
|
487
|
- var temp = {}
|
|
|
488
|
- if (beneficiary_list[i].unit != '') {
|
|
|
489
|
- temp.name = beneficiary_list[i].beneficiary_name
|
|
|
490
|
- temp.unit = beneficiary_list[i].unit;
|
|
|
491
|
- }
|
|
|
492
|
- tempfavoree1.push(temp)
|
|
|
493
|
- this.setData({
|
|
|
494
|
- tempfavoree: tempfavoree1
|
|
|
495
|
- })
|
|
|
496
|
-
|
|
|
497
|
- }
|
|
|
498
|
- },
|
|
|
499
|
-
|
|
|
500
|
- //删除收益人
|
|
|
501
|
- deletebenefict(e) {
|
|
|
502
|
- let index = e.currentTarget.dataset.index;
|
|
|
503
|
- let tempbenefict = Object.assign(this.data.beneficiary_list, {});
|
|
|
504
|
- let beneficiaryList = Object.assign(this.data.beneficiaryList, {});
|
|
|
505
|
- // 获取当前选项的受益人
|
|
|
506
|
- let person = tempbenefict[index].beneficiary_name;
|
|
|
507
|
- tempbenefict.splice(index, 1);
|
|
|
508
|
- if (person) beneficiaryList.splice(beneficiaryList.indexOf(person), 1)
|
|
|
509
|
-
|
|
|
510
|
- this.setData({
|
|
|
511
|
- beneficiaryList: beneficiaryList,
|
|
|
512
|
- beneficiary_list: tempbenefict
|
|
|
513
|
- })
|
|
|
514
|
- },
|
|
|
515
|
-
|
|
|
516
|
- //添加附加险
|
|
|
517
|
- addRisk() {
|
|
|
518
|
- if (this.data.inforid != 0) {
|
|
|
519
|
- this.setData({
|
|
|
520
|
- edit_state: false
|
|
|
521
|
- })
|
|
|
522
|
- }
|
|
|
523
|
- var risk_list = Object.assign(this.data.risk_list, {});
|
|
|
524
|
- var len = risk_list.length
|
|
|
525
|
- risk_list[len] = {
|
|
|
526
|
- name: '',
|
|
|
527
|
- mo: [],
|
|
|
528
|
- project_time: '',
|
|
|
529
|
- title: '',
|
|
|
530
|
- num: ''
|
|
|
531
|
- }
|
|
|
532
|
- this.setData({
|
|
|
533
|
- risk_list: risk_list
|
|
|
534
|
- })
|
|
|
535
|
- },
|
|
|
536
|
-
|
|
|
537
|
- //删除附加险
|
|
|
538
|
- deleteRisk(e) {
|
|
|
539
|
- let index = e.currentTarget.dataset.index;
|
|
|
540
|
- let risk_list = Object.assign(this.data.risk_list, {});
|
|
|
541
|
- risk_list.splice(index, 1);
|
|
|
542
|
- this.setData({
|
|
|
543
|
- risk_list: risk_list
|
|
|
544
|
- })
|
|
|
545
|
- },
|
|
|
546
|
-
|
|
|
547
|
- //上传图片
|
|
|
548
|
- uploadImage() {
|
|
|
549
|
- let that = this;
|
|
|
550
|
- wx.chooseImage({
|
|
|
551
|
- count: 6,
|
|
|
552
|
- sizeType: ['original', 'compressed'],
|
|
|
553
|
- success: function(res) {
|
|
|
554
|
- let successUp = 0; //成功个数
|
|
|
555
|
- let failUp = 0; //失败个数
|
|
|
556
|
- let i = 0; //第几个
|
|
|
557
|
- let tempFilePaths = res.tempFilePaths //总文件
|
|
|
558
|
- let length = res.tempFilePaths.length //总共个数
|
|
|
559
|
- wx.showNavigationBarLoading()
|
|
|
560
|
- wx.showLoading({
|
|
|
561
|
- title: '上传中',
|
|
|
562
|
- })
|
|
|
563
|
- that.uploadAllfile(tempFilePaths, successUp, failUp, i, length)
|
|
|
564
|
- },
|
|
|
565
|
- fail: function(res) {}
|
|
|
566
|
- })
|
|
|
567
|
- },
|
|
|
568
|
-
|
|
|
569
|
- //上传图片接口调取
|
|
|
570
|
- uploadAllfile(filePaths, successUp, failUp, i, length) {
|
|
|
571
|
- let that = this
|
|
|
572
|
- let strtime = +new Date()
|
|
|
573
|
- wx.uploadFile({
|
|
|
574
|
- url: 'https://insurance.w.broteam.cn/pubilc/upload', //仅为示例,非真实的接口地址
|
|
|
575
|
- filePath: filePaths[i],
|
|
|
576
|
- name: 'picurl',
|
|
|
577
|
- formData: {
|
|
|
578
|
- 'strtime': strtime,
|
|
|
579
|
- 'token': app.strTime(strtime)
|
|
|
580
|
- },
|
|
|
581
|
- success: function(res) {
|
|
|
582
|
- wx.hideNavigationBarLoading()
|
|
|
583
|
- wx.hideLoading()
|
|
|
584
|
- if (res.statusCode == '200') {
|
|
|
585
|
- let imgTemp = that.data.imgs;
|
|
|
586
|
- let curImg = JSON.parse(res.data).data.picurl;
|
|
|
587
|
- if (imgTemp.length < 6) {
|
|
|
588
|
- imgTemp.push("http://" + curImg)
|
|
|
589
|
- that.setData({
|
|
|
590
|
- imgs: imgTemp
|
|
|
591
|
- })
|
|
|
592
|
- wx.showToast({
|
|
|
593
|
- title: '上传成功',
|
|
|
594
|
- icon: 'none',
|
|
|
595
|
- duration: 2000,
|
|
|
596
|
- })
|
|
|
597
|
- } else {
|
|
|
598
|
- wx.showToast({
|
|
|
599
|
- title: '图片上限6张',
|
|
|
600
|
- icon: 'none',
|
|
|
601
|
- duration: 2000,
|
|
|
602
|
- })
|
|
|
603
|
- }
|
|
|
604
|
- } else {
|
|
|
605
|
- wx.showModal({
|
|
|
606
|
- title: '提示',
|
|
|
607
|
- content: res.msg,
|
|
|
608
|
- showCancel: false
|
|
|
609
|
- })
|
|
|
610
|
- }
|
|
|
611
|
- },
|
|
|
612
|
- fail: function(res) {
|
|
|
613
|
- wx.hideNavigationBarLoading()
|
|
|
614
|
- wx.hideLoading()
|
|
|
615
|
- },
|
|
|
616
|
- complete: () => {
|
|
|
617
|
- i++;
|
|
|
618
|
- if (i == length) {
|
|
|
619
|
- // console.log('总共' + successUp + '张上传成功,' + failUp + '张上传失败!');
|
|
|
620
|
- } else { //递归调用uploadDIY函数
|
|
|
621
|
- this.uploadAllfile(filePaths, successUp, failUp, i, length);
|
|
|
622
|
- }
|
|
|
623
|
- },
|
|
|
624
|
- })
|
|
|
625
|
- },
|
|
|
626
|
-
|
|
|
627
|
- //预览图片
|
|
|
628
|
- viewImg(e) {
|
|
|
629
|
- var imgs = this.data.imgs
|
|
|
630
|
- var current = e.currentTarget.dataset.index
|
|
|
631
|
- wx.previewImage({
|
|
|
632
|
- //当前显示图片
|
|
|
633
|
- current: imgs[current],
|
|
|
634
|
- //所有图片
|
|
|
635
|
- urls: imgs
|
|
|
636
|
- })
|
|
|
637
|
- },
|
|
|
638
|
-
|
|
|
639
|
- //删除图片
|
|
|
640
|
- deleteImg(e) {
|
|
|
641
|
- var imgs = this.data.imgs;
|
|
|
642
|
- var index = e.currentTarget.dataset.index;
|
|
|
643
|
- imgs.splice(index, 1);
|
|
|
644
|
- this.setData({
|
|
|
645
|
- imgs: imgs
|
|
|
646
|
- });
|
|
|
647
|
- },
|
|
|
648
|
-
|
|
|
649
|
- //保障期
|
|
|
650
|
- warrantyTwo(e) {
|
|
|
651
|
- if (this.data.inforid != 0) {
|
|
|
652
|
- this.setData({
|
|
|
653
|
- edit_state: false
|
|
|
654
|
- })
|
|
|
655
|
- }
|
|
|
656
|
- var guarantee_name = e.detail.value
|
|
|
657
|
- this.setData({
|
|
|
658
|
- guarantee_name: e.detail.value
|
|
|
659
|
- })
|
|
|
660
|
- this.countImpletionTime2()
|
|
|
661
|
- },
|
|
|
662
|
-
|
|
|
663
|
- //选择各项单位
|
|
|
664
|
- selectUnit(e) {
|
|
|
665
|
- var unit = e.currentTarget.dataset.unit
|
|
|
666
|
- this.setData({
|
|
|
667
|
- unit: unit
|
|
|
668
|
- })
|
|
|
669
|
- this.countImpletionTime2()
|
|
|
670
|
- },
|
|
|
671
|
-
|
|
|
672
|
- //重组保障期数据格式
|
|
|
673
|
- tempWarranty() {
|
|
|
674
|
- var guarantee_name = this.data.guarantee_name
|
|
|
675
|
- var unit = this.data.unit
|
|
|
676
|
- var warranty_two = this.data.warranty_two
|
|
|
677
|
- warranty_two.num = guarantee_name
|
|
|
678
|
- warranty_two.title = unit
|
|
|
679
|
- this.setData({
|
|
|
680
|
- warranty_two: warranty_two
|
|
|
681
|
- })
|
|
|
682
|
- },
|
|
|
683
|
-
|
|
|
684
|
-
|
|
|
685
|
- //计算缴费期满日,主线保障其
|
|
|
686
|
- countImpletionTime2() {
|
|
|
687
|
- var guarantee_name = parseInt(this.data.guarantee_name)
|
|
|
688
|
- var unit = this.data.unit
|
|
|
689
|
- var compact_time = this.data.compact_time
|
|
|
690
|
- var year = parseInt(new Date(compact_time).getFullYear())
|
|
|
691
|
- console.log(year)
|
|
|
692
|
- var month = parseInt(new Date(compact_time).getMonth() + 1)
|
|
|
693
|
- var day = parseInt(new Date(compact_time).getDate())
|
|
|
694
|
- // var impletion_time = this.data.impletion_time
|
|
|
695
|
- var warranty_one = this.data.warranty_one
|
|
|
696
|
-
|
|
|
697
|
- var tempbirth_time = ''
|
|
|
698
|
- var birthday = '1995-04-20'
|
|
|
699
|
- var birthday_year = parseInt(new Date(birthday).getFullYear())
|
|
|
700
|
-
|
|
|
701
|
- if (compact_time == '') {
|
|
|
702
|
- wx.showToast({
|
|
|
703
|
- title: '请选择合同生效日',
|
|
|
704
|
- icon: 'none'
|
|
|
705
|
- })
|
|
|
706
|
- } else {
|
|
|
707
|
- if (unit == '年') {
|
|
|
708
|
- var temp_year = (year + guarantee_name)
|
|
|
709
|
- var temp_day = day - 1
|
|
|
710
|
- if (month < 10) month = "0" + month;
|
|
|
711
|
- if (temp_day < 10) temp_day = "0" + temp_day;
|
|
|
712
|
- // impletion_time = temp_year + '-' + month + '-' + temp_day
|
|
|
713
|
- warranty_one = temp_year + '-' + month + '-' + temp_day
|
|
|
714
|
- } else if (unit == '岁') {
|
|
|
715
|
- var temp_year = (birthday_year + guarantee_name - 1)
|
|
|
716
|
- var temp_year2 = (birthday_year + guarantee_name)
|
|
|
717
|
- var temp_month = month
|
|
|
718
|
- if (temp_month < 10) temp_month = "0" + temp_month;
|
|
|
719
|
- if (month < 10) month = "0" + month;
|
|
|
720
|
- if (day < 10) day = "0" + day;
|
|
|
721
|
- // impletion_time = temp_year + '-' + temp_month + '-' + day
|
|
|
722
|
- warranty_one = temp_year2 + '-' + month + '-' + day
|
|
|
723
|
- } else if (unit == '终身') {
|
|
|
724
|
- // impletion_time = '终身缴费'
|
|
|
725
|
- warranty_one = '终身'
|
|
|
726
|
- }
|
|
|
727
|
- this.setData({
|
|
|
728
|
- // impletion_time: impletion_time,
|
|
|
729
|
- warranty_one: warranty_one
|
|
|
730
|
- })
|
|
|
731
|
- }
|
|
|
732
|
- },
|
|
|
733
|
-
|
|
|
734
|
- //缴费时长
|
|
|
735
|
- burningTime(e) {
|
|
|
736
|
- if (this.data.inforid != 0) {
|
|
|
737
|
- this.setData({
|
|
|
738
|
- edit_state: false
|
|
|
739
|
- })
|
|
|
740
|
- }
|
|
|
741
|
- var time_name = e.detail.value
|
|
|
742
|
- this.setData({
|
|
|
743
|
- time_name: time_name
|
|
|
744
|
- })
|
|
|
745
|
- this.countImpletionTime()
|
|
|
746
|
- },
|
|
|
747
|
-
|
|
|
748
|
- selectUnit2(e) {
|
|
|
749
|
- var unit = e.currentTarget.dataset.unit
|
|
|
750
|
- this.setData({
|
|
|
751
|
- unit2: unit
|
|
|
752
|
- })
|
|
|
753
|
- this.countImpletionTime()
|
|
|
754
|
- },
|
|
|
755
|
-
|
|
|
756
|
- //重组缴费时长数据格式
|
|
|
757
|
- tempburningTime() {
|
|
|
758
|
- var time_name = this.data.time_name
|
|
|
759
|
- var unit = this.data.unit2
|
|
|
760
|
- var long_money = this.data.long_money
|
|
|
761
|
- long_money.num = time_name
|
|
|
762
|
- long_money.title = unit
|
|
|
763
|
- this.setData({
|
|
|
764
|
- long_money: long_money
|
|
|
765
|
- })
|
|
|
766
|
- },
|
|
|
767
|
-
|
|
|
768
|
-
|
|
|
769
|
- //计算缴费期满日,主线保障其
|
|
|
770
|
- countImpletionTime() {
|
|
|
771
|
- var time_name = parseInt(this.data.time_name)
|
|
|
772
|
- var unit = this.data.unit2
|
|
|
773
|
- var compact_time = this.data.compact_time
|
|
|
774
|
- var year = parseInt(new Date(compact_time).getFullYear())
|
|
|
775
|
- var month = parseInt(new Date(compact_time).getMonth() + 1)
|
|
|
776
|
- var day = parseInt(new Date(compact_time).getDate())
|
|
|
777
|
- var impletion_time = this.data.impletion_time
|
|
|
778
|
- // var warranty_one = this.data.warranty_one
|
|
|
779
|
-
|
|
|
780
|
- var tempbirth_time = ''
|
|
|
781
|
- var birthday = '1995-04-20'
|
|
|
782
|
- var birthday_year = parseInt(new Date(birthday).getFullYear())
|
|
|
783
|
-
|
|
|
784
|
- if (compact_time == '') {
|
|
|
785
|
- wx.showToast({
|
|
|
786
|
- title: '请选择合同生效日',
|
|
|
787
|
- icon: 'none'
|
|
|
788
|
- })
|
|
|
789
|
- } else {
|
|
|
790
|
- if (unit == '年') {
|
|
|
791
|
- var temp_year = (year + time_name)
|
|
|
792
|
- var temp_day = day - 1
|
|
|
793
|
- if (month < 10) month = "0" + month;
|
|
|
794
|
- if (temp_day < 10) temp_day = "0" + temp_day;
|
|
|
795
|
- impletion_time = temp_year + '-' + month + '-' + temp_day
|
|
|
796
|
- // warranty_one = temp_year + '-' + month + '-' + temp_day
|
|
|
797
|
- } else if (unit == '岁') {
|
|
|
798
|
- var temp_year = (birthday_year + time_name - 1)
|
|
|
799
|
- var temp_year2 = (birthday_year + time_name)
|
|
|
800
|
- var temp_month = month
|
|
|
801
|
- if (temp_month < 10) temp_month = "0" + temp_month;
|
|
|
802
|
- if (month < 10) month = "0" + month;
|
|
|
803
|
- if (day < 10) day = "0" + day;
|
|
|
804
|
- impletion_time = temp_year + '-' + temp_month + '-' + day
|
|
|
805
|
- // warranty_one = temp_year2 + '-' + month + '-' + day
|
|
|
806
|
- } else if (unit == '终身') {
|
|
|
807
|
- impletion_time = '终身缴费'
|
|
|
808
|
- // warranty_one = '终身'
|
|
|
809
|
- }
|
|
|
810
|
- this.setData({
|
|
|
811
|
- impletion_time: impletion_time,
|
|
|
812
|
- // warranty_one: warranty_one
|
|
|
813
|
- })
|
|
|
814
|
- }
|
|
|
815
|
- },
|
|
|
816
|
-
|
|
|
817
|
- //缴费方式
|
|
|
818
|
- selectUnit3(e) {
|
|
|
819
|
- var unit = e.currentTarget.dataset.unit
|
|
|
820
|
- this.setData({
|
|
|
821
|
- unit3: unit,
|
|
|
822
|
- type_money: unit
|
|
|
823
|
- })
|
|
|
824
|
- },
|
|
|
825
|
-
|
|
|
826
|
- //附加险保障其
|
|
|
827
|
- selectUnit4(e) {
|
|
|
828
|
- var unit = e.currentTarget.dataset.unit;
|
|
|
829
|
- let index = e.currentTarget.dataset.index;
|
|
|
830
|
- let risk_list = Object.assign(this.data.risk_list, {});
|
|
|
831
|
- risk_list[index].title = unit
|
|
|
832
|
- this.setData({
|
|
|
833
|
- risk_list: risk_list
|
|
|
834
|
- })
|
|
|
835
|
- },
|
|
|
836
|
-
|
|
|
837
|
- //家庭成员
|
|
|
838
|
- familyMember(id) {
|
|
|
839
|
- var FamilyId = this.data.FamilyId
|
|
|
840
|
- let url = 'counselor/familyname'
|
|
|
841
|
- let params = {
|
|
|
842
|
- FamilyId: FamilyId||id,
|
|
|
843
|
- }
|
|
|
844
|
- app.post(url, params).then((res) => {
|
|
|
845
|
- // console.log(res)
|
|
|
846
|
- var beneficiary_list = this.data.beneficiary_list
|
|
|
847
|
- for (var i in beneficiary_list) {
|
|
|
848
|
- beneficiary_list[i].name_array = res.data.data.list
|
|
|
849
|
- }
|
|
|
850
|
- // console.log(beneficiary_list)
|
|
|
851
|
-
|
|
|
852
|
- if (res.data.code == 200) {
|
|
|
853
|
- this.setData({
|
|
|
854
|
- insure: res.data.data.list,
|
|
|
855
|
- recognizee: res.data.data.list,
|
|
|
856
|
- beneficiary_list: beneficiary_list,
|
|
|
857
|
- })
|
|
|
858
|
- }
|
|
|
859
|
- })
|
|
|
860
|
- },
|
|
|
861
|
-
|
|
|
862
|
- //设置缓存
|
|
|
863
|
- setStorge(e) {
|
|
|
864
|
- this.tempBeneficiary()
|
|
|
865
|
- this.tempWarranty()
|
|
|
866
|
- this.tempburningTime()
|
|
|
867
|
- this.tempMain()
|
|
|
868
|
- this.tempAddRisk()
|
|
|
869
|
- var favoree = JSON.stringify(this.data.tempfavoree)
|
|
|
870
|
- var warranty_two = JSON.stringify(this.data.warranty_two)
|
|
|
871
|
- var long_money = JSON.stringify(this.data.long_money)
|
|
|
872
|
- var more = JSON.stringify(this.data.more)
|
|
|
873
|
- var guarantee = JSON.stringify(this.data.guarantee)
|
|
|
874
|
- var warn = ""; //弹框时提示的内容
|
|
|
875
|
- var in_num = this.data.in_num
|
|
|
876
|
- var firm = this.data.firm
|
|
|
877
|
- var applicant = this.data.applicant_name
|
|
|
878
|
- var recognizee = this.data.recognizee_name
|
|
|
879
|
- var main_risks = this.data.main_risks
|
|
|
880
|
- var year_money = this.data.year_money
|
|
|
881
|
- var compact_time = this.data.compact_time
|
|
|
882
|
- var impletion_time = this.data.impletion_time
|
|
|
883
|
- var warranty_one = JSON.stringify(this.data.warranty_one)
|
|
|
884
|
- var type_money = this.data.type_money
|
|
|
885
|
- var bank = this.data.bank
|
|
|
886
|
- var bank_num = this.data.bank_num
|
|
|
887
|
- var picurl = JSON.stringify(this.data.imgs)
|
|
|
888
|
- let url = 'counselor/inforsave'
|
|
|
889
|
- let params = {
|
|
|
890
|
- // InfoId: this.data.inforid,
|
|
|
891
|
- def_id: this.data.def_id,
|
|
|
892
|
- in_num: in_num,
|
|
|
893
|
- firm: firm,
|
|
|
894
|
- applicant: applicant,
|
|
|
895
|
- recognizee: recognizee,
|
|
|
896
|
- favoree: favoree,
|
|
|
897
|
- main_risks: main_risks,
|
|
|
898
|
- guarantee: guarantee,
|
|
|
899
|
- year_money: year_money,
|
|
|
900
|
- warranty_two: warranty_two,
|
|
|
901
|
- compact_time: compact_time,
|
|
|
902
|
- impletion_time: impletion_time,
|
|
|
903
|
- warranty_one: warranty_one,
|
|
|
904
|
- long_money: long_money,
|
|
|
905
|
- type_money: type_money,
|
|
|
906
|
- bank: bank,
|
|
|
907
|
- bank_num: bank_num,
|
|
|
908
|
- more: more,
|
|
|
909
|
- picurl: picurl,
|
|
|
910
|
- }
|
|
|
911
|
- app.post(url, params).then((res) => {
|
|
|
912
|
- if (res.data.code == 200) {
|
|
|
913
|
- wx.navigateBack({
|
|
|
914
|
- delta: 1,
|
|
|
915
|
- })
|
|
|
916
|
- this.setData({
|
|
|
917
|
- storge_state: true
|
|
|
918
|
- })
|
|
|
919
|
- var storge_state = true
|
|
|
920
|
- wx.setStorageSync('storge_state', storge_state)
|
|
|
921
|
- }
|
|
|
922
|
- })
|
|
|
923
|
- },
|
|
|
924
|
-
|
|
|
925
|
- //获取缓存内容
|
|
|
926
|
- getStorage() {
|
|
|
927
|
- let url = 'counselor/inforCopy'
|
|
|
928
|
- let params = {
|
|
|
929
|
- def_id: this.data.def_id,
|
|
|
930
|
- }
|
|
|
931
|
- app.post(url, params).then((res) => {
|
|
|
932
|
- console.log(res)
|
|
|
933
|
- if (res.data.code == 200) {
|
|
|
934
|
- var warranty_two = res.data.data.def.warranty_two
|
|
|
935
|
- var unit = this.data.unit
|
|
|
936
|
- unit = warranty_two.title
|
|
|
937
|
- var long_money = res.data.data.def.long_money
|
|
|
938
|
- var unit2 = this.data.unit2
|
|
|
939
|
- unit2 = long_money.title
|
|
|
940
|
- var type_money = res.data.data.def.type_money
|
|
|
941
|
- var unit3 = this.data.unit3
|
|
|
942
|
- unit3 = type_money
|
|
|
943
|
- var beneficiary_list = res.data.data.def.favoree
|
|
|
944
|
- for (var obj in beneficiary_list) {
|
|
|
945
|
- beneficiary_list[obj].beneficiary_name = beneficiary_list[obj].name
|
|
|
946
|
- beneficiary_list[obj].name_array = this.data.insure
|
|
|
947
|
- }
|
|
|
948
|
-
|
|
|
949
|
- this.setData({
|
|
|
950
|
- imgs: res.data.data.def.picurl,
|
|
|
951
|
- type_money: res.data.data.def.type_money,
|
|
|
952
|
- unit3: unit3,
|
|
|
953
|
- year_money: res.data.data.def.year_money,
|
|
|
954
|
- long_money: res.data.data.def.long_money,
|
|
|
955
|
- unit2: unit2,
|
|
|
956
|
- in_num: res.data.data.def.in_num,
|
|
|
957
|
- firm: res.data.data.def.firm,
|
|
|
958
|
- main_risks: res.data.data.def.main_risks,
|
|
|
959
|
- main_array: res.data.data.def.guarantee,
|
|
|
960
|
- applicant_name: res.data.data.def.applicant,
|
|
|
961
|
- recognizee_name: res.data.data.def.recognizee,
|
|
|
962
|
- warranty_one: res.data.data.def.warranty_one,
|
|
|
963
|
- warranty_two: res.data.data.def.warranty_two,
|
|
|
964
|
- unit: unit,
|
|
|
965
|
- compact_time: res.data.data.def.compact_time,
|
|
|
966
|
- impletion_time: res.data.data.def.impletion_time,
|
|
|
967
|
- bank: res.data.data.def.bank,
|
|
|
968
|
- bank_num: res.data.data.def.bank_num,
|
|
|
969
|
- risk_list: res.data.data.def.more,
|
|
|
970
|
- beneficiary_list: beneficiary_list,
|
|
|
971
|
- edit_state: true,
|
|
|
972
|
- })
|
|
|
973
|
- }
|
|
|
974
|
- })
|
|
|
975
|
- },
|
|
|
976
|
-
|
|
|
977
|
- //完成保单添加
|
|
|
978
|
- listVerify(e) {
|
|
|
979
|
- if (this.data.inforid == 0 || this.data.inforid == undefined) {
|
|
|
980
|
- this.tempBeneficiary()
|
|
|
981
|
- this.tempWarranty()
|
|
|
982
|
- this.tempburningTime()
|
|
|
983
|
- this.tempMain()
|
|
|
984
|
- this.tempAddRisk()
|
|
|
985
|
- var favoree = JSON.stringify(this.data.tempfavoree)
|
|
|
986
|
- var warranty_two = JSON.stringify(this.data.warranty_two)
|
|
|
987
|
- var long_money = JSON.stringify(this.data.long_money)
|
|
|
988
|
- var more = JSON.stringify(this.data.more)
|
|
|
989
|
- var guarantee = JSON.stringify(this.data.guarantee)
|
|
|
990
|
- } else if (this.data.edit_state) {
|
|
|
991
|
- var favoree = JSON.stringify(this.data.beneficiary_list)
|
|
|
992
|
- var warranty_two = JSON.stringify(this.data.warranty_two)
|
|
|
993
|
- var long_money = JSON.stringify(this.data.long_money)
|
|
|
994
|
- var more = JSON.stringify(this.data.risk_list)
|
|
|
995
|
- var guarantee = JSON.stringify(this.data.main_array)
|
|
|
996
|
- } else {
|
|
|
997
|
- this.tempBeneficiary()
|
|
|
998
|
- this.tempWarranty()
|
|
|
999
|
- this.tempburningTime()
|
|
|
1000
|
- this.tempMain()
|
|
|
1001
|
- this.tempAddRisk()
|
|
|
1002
|
- var favoree = JSON.stringify(this.data.tempfavoree)
|
|
|
1003
|
- var warranty_two = JSON.stringify(this.data.warranty_two)
|
|
|
1004
|
- var long_money = JSON.stringify(this.data.long_money)
|
|
|
1005
|
- var more = JSON.stringify(this.data.more)
|
|
|
1006
|
- var guarantee = JSON.stringify(this.data.guarantee)
|
|
|
1007
|
- }
|
|
|
1008
|
-
|
|
|
1009
|
- var warn = ""; //弹框时提示的内容
|
|
|
1010
|
- var flag = true; //判断信息输入是否完整判断弹窗
|
|
|
1011
|
- var in_num = e.detail.value.policy_num
|
|
|
1012
|
- var firm = e.detail.value.company;
|
|
|
1013
|
- var applicant = this.data.applicant_name
|
|
|
1014
|
- var recognizee = this.data.recognizee_name
|
|
|
1015
|
- var main_risks = e.detail.value.main_risks
|
|
|
1016
|
-
|
|
|
1017
|
- var year_money = e.detail.value.year_money
|
|
|
1018
|
- var compact_time = this.data.compact_time
|
|
|
1019
|
- var impletion_time = this.data.impletion_time
|
|
|
1020
|
- var warranty_one = JSON.stringify(this.data.warranty_one)
|
|
|
1021
|
- var type_money = this.data.type_money
|
|
|
1022
|
- var bank = e.detail.value.bank
|
|
|
1023
|
- var bank_num = e.detail.value.bank_num
|
|
|
1024
|
- var picurl = JSON.stringify(this.data.imgs)
|
|
|
1025
|
-
|
|
|
1026
|
- var continue1 = e.detail.target.dataset.type
|
|
|
1027
|
- var complete = e.detail.target.dataset.type
|
|
|
1028
|
-
|
|
|
1029
|
- if (in_num == '') {
|
|
|
1030
|
- warn = '请输入保单号!'
|
|
|
1031
|
- } else if (firm == '') {
|
|
|
1032
|
- warn = '请输入所属公司!'
|
|
|
1033
|
- } else if (applicant == '') {
|
|
|
1034
|
- warn = '请输入投保人!'
|
|
|
1035
|
- } else if (recognizee == '') {
|
|
|
1036
|
- warn = '请输入被保险人!'
|
|
|
1037
|
- } else if (favoree == '') {
|
|
|
1038
|
- warn = '请输入受益人!'
|
|
|
1039
|
- } else if (main_risks == '') {
|
|
|
1040
|
- warn = '请输入主险名称!'
|
|
|
1041
|
- } else if (year_money == '') {
|
|
|
1042
|
- warn = '请输入年交保费!'
|
|
|
1043
|
- } else if (compact_time == '') {
|
|
|
1044
|
- warn = '请输入合同生效日!'
|
|
|
1045
|
- } else if (warranty_two.num == '') {
|
|
|
1046
|
- warn = '请输入保障期!'
|
|
|
1047
|
- } else if (long_money.num == '') {
|
|
|
1048
|
- warn = '请输入缴费时长!'
|
|
|
1049
|
- } else if (type_money == '') {
|
|
|
1050
|
- warn = '请输入缴费方式!'
|
|
|
1051
|
- } else if (bank == '') {
|
|
|
1052
|
- warn = '请输入续费银行!'
|
|
|
1053
|
- } else if (bank_num == '') {
|
|
|
1054
|
- warn = '请输入续费账号!'
|
|
|
1055
|
- } else if (!(/^[0-9]+.?[0-9]*/.test(bank_num))) {
|
|
|
1056
|
- warn = '请输入正确续费账号!'
|
|
|
1057
|
- } else if (impletion_time == '') {
|
|
|
1058
|
- warn = '请输入缴费期满日!'
|
|
|
1059
|
- } else if (warranty_one == '') {
|
|
|
1060
|
- warn = '请输入主险保障期!'
|
|
|
1061
|
- } else if (more == '') {
|
|
|
1062
|
- warn = '请输入附加险!'
|
|
|
1063
|
- } else if (picurl.length == 2) {
|
|
|
1064
|
- warn = '请选择图片!'
|
|
|
1065
|
- } else {
|
|
|
1066
|
- flag = false
|
|
|
1067
|
- // 添加、修改保单接口调取
|
|
|
1068
|
- let url = 'counselor/inforuodate'
|
|
|
1069
|
- let params = {
|
|
|
1070
|
- InfoId: this.data.inforid,
|
|
|
1071
|
- def_id: this.data.def_id,
|
|
|
1072
|
- in_num: in_num,
|
|
|
1073
|
- firm: firm,
|
|
|
1074
|
- applicant: applicant,
|
|
|
1075
|
- recognizee: recognizee,
|
|
|
1076
|
- favoree: favoree,
|
|
|
1077
|
- main_risks: main_risks,
|
|
|
1078
|
- guarantee: guarantee,
|
|
|
1079
|
- year_money: year_money,
|
|
|
1080
|
- warranty_two: warranty_two,
|
|
|
1081
|
- compact_time: compact_time,
|
|
|
1082
|
- impletion_time: impletion_time,
|
|
|
1083
|
- warranty_one: warranty_one,
|
|
|
1084
|
- long_money: long_money,
|
|
|
1085
|
- type_money: type_money,
|
|
|
1086
|
- bank: bank,
|
|
|
1087
|
- bank_num: bank_num,
|
|
|
1088
|
- more: more,
|
|
|
1089
|
- picurl: picurl,
|
|
|
1090
|
- }
|
|
|
1091
|
- app.post(url, params).then((res) => {
|
|
|
1092
|
- if (res.data.code == 200) {
|
|
|
1093
|
- if (continue1 == 'continue1') {
|
|
|
1094
|
- wx.showToast({
|
|
|
1095
|
- title: '添加成功',
|
|
|
1096
|
- icon: 'none',
|
|
|
1097
|
- duration: 2000,
|
|
|
1098
|
- })
|
|
|
1099
|
- this.setData({
|
|
|
1100
|
- in_num: '',
|
|
|
1101
|
- firm: '',
|
|
|
1102
|
- applicant_name: '',
|
|
|
1103
|
- recognizee_name: '',
|
|
|
1104
|
- // beneficiary_list: [{
|
|
|
1105
|
- // name_array: [],
|
|
|
1106
|
- // unit: ''
|
|
|
1107
|
- // }],
|
|
|
1108
|
- main_risks: '',
|
|
|
1109
|
- main_array: '',
|
|
|
1110
|
- year_money: '',
|
|
|
1111
|
- compact_time: '',
|
|
|
1112
|
- warranty_two: '',
|
|
|
1113
|
- long_money: '',
|
|
|
1114
|
- bank: '',
|
|
|
1115
|
- bank_num: '',
|
|
|
1116
|
- impletion_time: '',
|
|
|
1117
|
- warranty_one: '',
|
|
|
1118
|
- // risk_list:'',
|
|
|
1119
|
- imgs: '',
|
|
|
1120
|
- unit: '',
|
|
|
1121
|
- unit2: '',
|
|
|
1122
|
- unit3: '',
|
|
|
1123
|
- unit4: '',
|
|
|
1124
|
- })
|
|
|
1125
|
- } else if (complete == 'complete') {
|
|
|
1126
|
- wx.showToast({
|
|
|
1127
|
- title: '添加成功',
|
|
|
1128
|
- icon: 'none',
|
|
|
1129
|
- duration: 2000,
|
|
|
1130
|
- })
|
|
|
1131
|
- wx.navigateBack({
|
|
|
1132
|
- delta: 1,
|
|
|
1133
|
- })
|
|
|
1134
|
- }
|
|
|
1135
|
- }
|
|
|
1136
|
- })
|
|
|
1137
|
- }
|
|
|
1138
|
-
|
|
|
1139
|
- if (flag == true) {
|
|
|
1140
|
- wx.showToast({
|
|
|
1141
|
- title: warn,
|
|
|
1142
|
- icon: 'none'
|
|
|
1143
|
- })
|
|
|
1144
|
- }
|
|
|
1145
|
-
|
|
|
1146
|
- },
|
|
|
1147
|
-
|
|
|
1148
|
-
|
|
|
1149
|
-
|
|
|
1150
|
- //获取编辑保单接口
|
|
|
1151
|
- getlistVerify(id) {
|
|
|
1152
|
- let url = 'counselor/infordef'
|
|
|
1153
|
- let params = {
|
|
|
1154
|
- InfoId: this.data.inforid||id,
|
|
|
1155
|
- }
|
|
|
1156
|
- app.post(url, params).then((res) => {
|
|
|
1157
|
- if (res.data.code == 200) {
|
|
|
1158
|
- var warranty_two = res.data.data.def.warranty_two
|
|
|
1159
|
- var unit = this.data.unit
|
|
|
1160
|
- unit = warranty_two.title
|
|
|
1161
|
- var long_money = res.data.data.def.long_money
|
|
|
1162
|
- var unit2 = this.data.unit2
|
|
|
1163
|
- unit2 = long_money.title
|
|
|
1164
|
- var type_money = res.data.data.def.type_money
|
|
|
1165
|
- var unit3 = this.data.unit3
|
|
|
1166
|
- unit3 = type_money
|
|
|
1167
|
- var beneficiary_list = res.data.data.def.favoree
|
|
|
1168
|
- for (var obj in beneficiary_list) {
|
|
|
1169
|
- beneficiary_list[obj].beneficiary_name = beneficiary_list[obj].name
|
|
|
1170
|
- beneficiary_list[obj].name_array = this.data.insure
|
|
|
1171
|
- }
|
|
|
1172
|
-
|
|
|
1173
|
- var risk_list = res.data.data.def.more
|
|
|
1174
|
- var projectlist = this.data.projectlist
|
|
|
1175
|
-
|
|
|
1176
|
- for (var i = 0; i < risk_list.length; i++) {
|
|
|
1177
|
- for (var j = 0; j < projectlist.length; j++) {
|
|
|
1178
|
- for (var k = 0; k < projectlist[j].title.length; k++) {
|
|
|
1179
|
- if (risk_list[i].id == projectlist[j].id) {
|
|
|
1180
|
- if (risk_list[i].title == projectlist[j].title[k].name) {
|
|
|
1181
|
- var title = {}
|
|
|
1182
|
- title.name = projectlist[j].title[k]
|
|
|
1183
|
- }
|
|
|
1184
|
- }
|
|
|
1185
|
- }
|
|
|
1186
|
- }
|
1134
|
+ }
|
|
|
1135
|
+ }
|
|
|
1136
|
+ })
|
|
|
1137
|
+ }
|
|
|
1138
|
+
|
|
|
1139
|
+ if (flag == true) {
|
|
|
1140
|
+ wx.showToast({
|
|
|
1141
|
+ title: warn,
|
|
|
1142
|
+ icon: 'none'
|
|
|
1143
|
+ })
|
|
|
1144
|
+ }
|
|
|
1145
|
+
|
|
|
1146
|
+ },
|
|
|
1147
|
+
|
|
|
1148
|
+
|
|
|
1149
|
+
|
|
|
1150
|
+ //获取编辑保单接口
|
|
|
1151
|
+ getlistVerify(id) {
|
|
|
1152
|
+ wx.setNavigationBarTitle({
|
|
|
1153
|
+ title: '编辑保单',
|
|
|
1154
|
+ })
|
|
|
1155
|
+ let url = 'counselor/infordef'
|
|
|
1156
|
+ let params = {
|
|
|
1157
|
+ InfoId: this.data.inforid || id,
|
|
|
1158
|
+ }
|
|
|
1159
|
+ app.post(url, params).then((res) => {
|
|
|
1160
|
+ if (res.data.code == 200) {
|
|
|
1161
|
+ var warranty_two = res.data.data.def.warranty_two
|
|
|
1162
|
+ var unit = this.data.unit
|
|
|
1163
|
+ unit = warranty_two.title
|
|
|
1164
|
+ var long_money = res.data.data.def.long_money
|
|
|
1165
|
+ var unit2 = this.data.unit2
|
|
|
1166
|
+ unit2 = long_money.title
|
|
|
1167
|
+ var type_money = res.data.data.def.type_money
|
|
|
1168
|
+ var unit3 = this.data.unit3
|
|
|
1169
|
+ unit3 = type_money
|
|
|
1170
|
+ var beneficiary_list = res.data.data.def.favoree
|
|
|
1171
|
+ for (var obj in beneficiary_list) {
|
|
|
1172
|
+ beneficiary_list[obj].beneficiary_name = beneficiary_list[obj].name
|
|
|
1173
|
+ beneficiary_list[obj].name_array = this.data.insure
|
|
|
1174
|
+ }
|
|
|
1175
|
+
|
|
|
1176
|
+ var risk_list = res.data.data.def.more
|
|
|
1177
|
+ var projectlist = this.data.projectlist
|
|
|
1178
|
+
|
|
|
1179
|
+ for (var i = 0; i < risk_list.length; i++) {
|
|
|
1180
|
+ for (var j = 0; j < projectlist.length; j++) {
|
|
|
1181
|
+ for (var k = 0; k < projectlist[j].title.length; k++) {
|
|
|
1182
|
+ if (risk_list[i].id == projectlist[j].id) {
|
|
|
1183
|
+ if (risk_list[i].title == projectlist[j].title[k].name) {
|
|
|
1184
|
+ var title = {}
|
|
|
1185
|
+ title.name = projectlist[j].title[k]
|
1187
|
}
|
1186
|
}
|
1188
|
-
|
|
|
1189
|
- var warranty_two = res.data.data.def.warranty_two
|
|
|
1190
|
- var guarantee_name = warranty_two.num
|
|
|
1191
|
-
|
|
|
1192
|
- var long_money = res.data.data.def.long_money
|
|
|
1193
|
- var time_name = long_money.num
|
|
|
1194
|
-
|
|
|
1195
|
- this.setData({
|
|
|
1196
|
- imgs: res.data.data.def.picurl,
|
|
|
1197
|
- type_money: res.data.data.def.type_money,
|
|
|
1198
|
- unit3: unit3,
|
|
|
1199
|
- year_money: res.data.data.def.year_money,
|
|
|
1200
|
- long_money: res.data.data.def.long_money,
|
|
|
1201
|
- unit2: unit2,
|
|
|
1202
|
- in_num: res.data.data.def.in_num,
|
|
|
1203
|
- firm: res.data.data.def.firm,
|
|
|
1204
|
- main_risks: res.data.data.def.main_risks,
|
|
|
1205
|
- main_array: res.data.data.def.guarantee,
|
|
|
1206
|
- applicant_name: res.data.data.def.applicant,
|
|
|
1207
|
- recognizee_name: res.data.data.def.recognizee,
|
|
|
1208
|
- warranty_one: res.data.data.def.warranty_one,
|
|
|
1209
|
- warranty_two: res.data.data.def.warranty_two,
|
|
|
1210
|
- unit: unit,
|
|
|
1211
|
- compact_time: res.data.data.def.compact_time,
|
|
|
1212
|
- impletion_time: res.data.data.def.impletion_time,
|
|
|
1213
|
- bank: res.data.data.def.bank,
|
|
|
1214
|
- bank_num: res.data.data.def.bank_num,
|
|
|
1215
|
- risk_list: risk_list,
|
|
|
1216
|
- beneficiary_list: beneficiary_list,
|
|
|
1217
|
- edit_state: true,
|
|
|
1218
|
- guarantee_name: guarantee_name,
|
|
|
1219
|
- time_name: time_name,
|
|
|
1220
|
- })
|
|
|
1221
|
}
|
1187
|
}
|
1222
|
- })
|
|
|
1223
|
- },
|
|
|
1224
|
-
|
|
|
1225
|
- /**
|
|
|
1226
|
- * 生命周期函数--监听页面加载
|
|
|
1227
|
- */
|
|
|
1228
|
- onLoad: function(options) {
|
|
|
1229
|
-
|
|
|
1230
|
- this.ensureProjectList()
|
|
|
1231
|
- let that = this;
|
|
|
1232
|
- // this.setData({
|
|
|
1233
|
- // def_id: options.def_id,
|
|
|
1234
|
- // inforid: options.inforid,
|
|
|
1235
|
- // FamilyId: options.FamilyId,
|
|
|
1236
|
- // recognizee_name: options.name
|
|
|
1237
|
- // })
|
|
|
1238
|
- // if (options.inforid == undefined) {
|
|
|
1239
|
- // this.setData({
|
|
|
1240
|
- // inforid: 0
|
|
|
1241
|
- // })
|
|
|
1242
|
- // }
|
|
|
1243
|
- options.inforid ? (that.getlistVerify(options.inforid),that.setData({
|
|
|
1244
|
- inforid: options.inforid,
|
|
|
1245
|
- edit_state: true
|
|
|
1246
|
- })): ""
|
|
|
1247
|
- options.def_id ? that.setData({
|
|
|
1248
|
- def_id: options.def_id,
|
|
|
1249
|
- }) : ""
|
|
|
1250
|
- options.FamilyId ? (that.familyMember(options.FamilyId),that.setData({
|
|
|
1251
|
- FamilyId: options.FamilyId
|
|
|
1252
|
- })):'';
|
|
|
1253
|
-
|
|
|
1254
|
- // if (options.FamilyId != '') {
|
|
|
1255
|
- // this.familyMember()
|
|
|
1256
|
- // }
|
|
|
1257
|
- // if (options.inforid != undefined) {
|
|
|
1258
|
- // this.getlistVerify()
|
|
|
1259
|
- // }
|
|
|
1260
|
-
|
|
|
1261
|
- if (wx.getStorageSync('storge_state') && options.inforid == undefined) {
|
|
|
1262
|
- this.getStorage()
|
|
|
1263
|
}
|
1188
|
}
|
1264
|
- },
|
|
|
1265
|
-
|
|
|
1266
|
- /**
|
|
|
1267
|
- * 生命周期函数--监听页面初次渲染完成
|
|
|
1268
|
- */
|
|
|
1269
|
- onReady: function() {
|
|
|
1270
|
-
|
|
|
1271
|
- },
|
|
|
1272
|
-
|
|
|
1273
|
- /**
|
|
|
1274
|
- * 生命周期函数--监听页面显示
|
|
|
1275
|
- */
|
|
|
1276
|
- onShow: function() {
|
|
|
1277
|
-
|
|
|
1278
|
- },
|
|
|
1279
|
-
|
|
|
1280
|
- /**
|
|
|
1281
|
- * 生命周期函数--监听页面隐藏
|
|
|
1282
|
- */
|
|
|
1283
|
- onHide: function() {
|
|
|
1284
|
-
|
|
|
1285
|
- },
|
|
|
1286
|
-
|
|
|
1287
|
- /**
|
|
|
1288
|
- * 生命周期函数--监听页面卸载
|
|
|
1289
|
- */
|
|
|
1290
|
- onUnload: function() {
|
|
|
1291
|
-
|
|
|
1292
|
- },
|
|
|
1293
|
-
|
|
|
1294
|
- /**
|
|
|
1295
|
- * 页面相关事件处理函数--监听用户下拉动作
|
|
|
1296
|
- */
|
|
|
1297
|
- onPullDownRefresh: function() {
|
|
|
1298
|
-
|
|
|
1299
|
- },
|
|
|
1300
|
-
|
|
|
1301
|
- /**
|
|
|
1302
|
- * 页面上拉触底事件的处理函数
|
|
|
1303
|
- */
|
|
|
1304
|
- onReachBottom: function() {
|
1189
|
+ }
|
|
|
1190
|
+ }
|
1305
|
|
1191
|
|
1306
|
- },
|
1192
|
+ var warranty_two = res.data.data.def.warranty_two
|
|
|
1193
|
+ var guarantee_name = warranty_two.num
|
1307
|
|
1194
|
|
1308
|
- /**
|
|
|
1309
|
- * 用户点击右上角分享
|
|
|
1310
|
- */
|
|
|
1311
|
- onShareAppMessage: function() {
|
1195
|
+ var long_money = res.data.data.def.long_money
|
|
|
1196
|
+ var time_name = long_money.num
|
1312
|
|
1197
|
|
1313
|
- }
|
|
|
1314
|
- }) |
|
|
|
|
1198
|
+ this.setData({
|
|
|
1199
|
+ imgs: res.data.data.def.picurl,
|
|
|
1200
|
+ type_money: res.data.data.def.type_money,
|
|
|
1201
|
+ unit3: unit3,
|
|
|
1202
|
+ year_money: res.data.data.def.year_money,
|
|
|
1203
|
+ long_money: res.data.data.def.long_money,
|
|
|
1204
|
+ unit2: unit2,
|
|
|
1205
|
+ in_num: res.data.data.def.in_num,
|
|
|
1206
|
+ firm: res.data.data.def.firm,
|
|
|
1207
|
+ main_risks: res.data.data.def.main_risks,
|
|
|
1208
|
+ main_array: res.data.data.def.guarantee,
|
|
|
1209
|
+ applicant_name: res.data.data.def.applicant,
|
|
|
1210
|
+ recognizee_name: res.data.data.def.recognizee,
|
|
|
1211
|
+ warranty_one: res.data.data.def.warranty_one,
|
|
|
1212
|
+ warranty_two: res.data.data.def.warranty_two,
|
|
|
1213
|
+ unit: unit,
|
|
|
1214
|
+ compact_time: res.data.data.def.compact_time,
|
|
|
1215
|
+ impletion_time: res.data.data.def.impletion_time,
|
|
|
1216
|
+ bank: res.data.data.def.bank,
|
|
|
1217
|
+ bank_num: res.data.data.def.bank_num,
|
|
|
1218
|
+ risk_list: risk_list,
|
|
|
1219
|
+ beneficiary_list: beneficiary_list,
|
|
|
1220
|
+ edit_state: true,
|
|
|
1221
|
+ guarantee_name: guarantee_name,
|
|
|
1222
|
+ time_name: time_name,
|
|
|
1223
|
+ })
|
|
|
1224
|
+ }
|
|
|
1225
|
+ })
|
|
|
1226
|
+ },
|
|
|
1227
|
+
|
|
|
1228
|
+ /**
|
|
|
1229
|
+ * 生命周期函数--监听页面加载
|
|
|
1230
|
+ */
|
|
|
1231
|
+ onLoad: function(options) {
|
|
|
1232
|
+
|
|
|
1233
|
+ this.ensureProjectList()
|
|
|
1234
|
+ let that = this;
|
|
|
1235
|
+ // this.setData({
|
|
|
1236
|
+ // def_id: options.def_id,
|
|
|
1237
|
+ // inforid: options.inforid,
|
|
|
1238
|
+ // FamilyId: options.FamilyId,
|
|
|
1239
|
+ // recognizee_name: options.name
|
|
|
1240
|
+ // })
|
|
|
1241
|
+ // if (options.inforid == undefined) {
|
|
|
1242
|
+ // this.setData({
|
|
|
1243
|
+ // inforid: 0
|
|
|
1244
|
+ // })
|
|
|
1245
|
+ // }
|
|
|
1246
|
+ options.inforid ? (that.getlistVerify(options.inforid), that.setData({
|
|
|
1247
|
+ inforid: options.inforid,
|
|
|
1248
|
+ edit_state: true
|
|
|
1249
|
+ })) : ""
|
|
|
1250
|
+ options.def_id ? that.setData({
|
|
|
1251
|
+ def_id: options.def_id,
|
|
|
1252
|
+ }) : ""
|
|
|
1253
|
+ options.FamilyId ? (that.familyMember(options.FamilyId), that.setData({
|
|
|
1254
|
+ FamilyId: options.FamilyId
|
|
|
1255
|
+ })) : '';
|
|
|
1256
|
+
|
|
|
1257
|
+ // if (options.FamilyId != '') {
|
|
|
1258
|
+ // this.familyMember()
|
|
|
1259
|
+ // }
|
|
|
1260
|
+ // if (options.inforid != undefined) {
|
|
|
1261
|
+ // this.getlistVerify()
|
|
|
1262
|
+ // }
|
|
|
1263
|
+
|
|
|
1264
|
+ if (wx.getStorageSync('storge_state') && options.inforid == undefined) {
|
|
|
1265
|
+ this.getStorage()
|
|
|
1266
|
+ }
|
|
|
1267
|
+ },
|
|
|
1268
|
+
|
|
|
1269
|
+ /**
|
|
|
1270
|
+ * 生命周期函数--监听页面初次渲染完成
|
|
|
1271
|
+ */
|
|
|
1272
|
+ onReady: function() {
|
|
|
1273
|
+
|
|
|
1274
|
+ },
|
|
|
1275
|
+
|
|
|
1276
|
+ /**
|
|
|
1277
|
+ * 生命周期函数--监听页面显示
|
|
|
1278
|
+ */
|
|
|
1279
|
+ onShow: function() {
|
|
|
1280
|
+
|
|
|
1281
|
+ },
|
|
|
1282
|
+
|
|
|
1283
|
+ /**
|
|
|
1284
|
+ * 生命周期函数--监听页面隐藏
|
|
|
1285
|
+ */
|
|
|
1286
|
+ onHide: function() {
|
|
|
1287
|
+
|
|
|
1288
|
+ },
|
|
|
1289
|
+
|
|
|
1290
|
+ /**
|
|
|
1291
|
+ * 生命周期函数--监听页面卸载
|
|
|
1292
|
+ */
|
|
|
1293
|
+ onUnload: function() {
|
|
|
1294
|
+
|
|
|
1295
|
+ },
|
|
|
1296
|
+
|
|
|
1297
|
+ /**
|
|
|
1298
|
+ * 页面相关事件处理函数--监听用户下拉动作
|
|
|
1299
|
+ */
|
|
|
1300
|
+ onPullDownRefresh: function() {
|
|
|
1301
|
+
|
|
|
1302
|
+ },
|
|
|
1303
|
+
|
|
|
1304
|
+ /**
|
|
|
1305
|
+ * 页面上拉触底事件的处理函数
|
|
|
1306
|
+ */
|
|
|
1307
|
+ onReachBottom: function() {
|
|
|
1308
|
+
|
|
|
1309
|
+ },
|
|
|
1310
|
+
|
|
|
1311
|
+ /**
|
|
|
1312
|
+ * 用户点击右上角分享
|
|
|
1313
|
+ */
|
|
|
1314
|
+ onShareAppMessage: function() {
|
|
|
1315
|
+
|
|
|
1316
|
+ }
|
|
|
1317
|
+}) |