...
|
...
|
@@ -53,7 +53,9 @@ Page({ |
|
|
guarantee: [],
|
|
|
InfoId: 0,
|
|
|
def_id: '',
|
|
|
edit_state: false
|
|
|
edit_state: false,
|
|
|
risk_listitm: '',
|
|
|
storge_state: false,
|
|
|
},
|
|
|
|
|
|
//保单号
|
...
|
...
|
@@ -152,9 +154,10 @@ Page({ |
|
|
let index = e.currentTarget.dataset.xulie;
|
|
|
let tempProjectlist = Object.assign(this.data.projectlist, {});
|
|
|
// 已经添加的附加险
|
|
|
let rist_list = Object.assign(this.data.risk_list, {});
|
|
|
console.log(rist_list)
|
|
|
let tempRist = rist_list[index].mo;
|
|
|
let risk_list = Object.assign(this.data.risk_list, {});
|
|
|
console.log(risk_list)
|
|
|
let tempRist = risk_list[index].mo;
|
|
|
console.log(tempRist)
|
|
|
// 已经添加的主险
|
|
|
let tempMain_list = Object.assign(this.data.main_array, {})
|
|
|
if (type == 'zhuxian') {
|
...
|
...
|
@@ -271,29 +274,15 @@ Page({ |
|
|
let type = this.data.addType;
|
|
|
var that = this
|
|
|
var main_array = []
|
|
|
|
|
|
var projectlist = Object.assign(this.data.projectlist, {})
|
|
|
for (var i = 0; i < projectlist.length; i++) {
|
|
|
// for (var j = 0; j < projectlist[i].title.length; j++) {
|
|
|
if (projectlist[i].choose_status) {
|
|
|
// if (projectlist[i].title[j].current == ''){
|
|
|
// projectlist[i].title[j].label_state=false
|
|
|
main_array.push(projectlist[i])
|
|
|
// }
|
|
|
|
|
|
console.log(main_array)
|
|
|
}
|
|
|
// }
|
|
|
}
|
|
|
// for (var i = 0; i < projectlist.length; i++) {
|
|
|
// for (var j = 0; j < projectlist[i].title.length; j++) {
|
|
|
// if (projectlist[i].choose_status) {
|
|
|
// if (projectlist[i].title[j].current == '') {
|
|
|
// projectlist[i].title[j].label_state = false
|
|
|
// main_array.push(projectlist[i])
|
|
|
// }
|
|
|
|
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
if (main_array != '') {
|
|
|
wx.showToast({
|
|
|
title: '添加成功',
|
...
|
...
|
@@ -306,27 +295,15 @@ Page({ |
|
|
tempRist[index]['mo'] = main_array;
|
|
|
that.setData({
|
|
|
risk_list: tempRist,
|
|
|
risk_listitm: tempRist
|
|
|
})
|
|
|
|
|
|
console.log(this.data.risk_list)
|
|
|
} else {
|
|
|
that.setData({
|
|
|
main_array: main_array,
|
|
|
})
|
|
|
}
|
|
|
|
|
|
console.log(this.data.main_array)
|
|
|
// var temp = main_array
|
|
|
// for (var i = 0; i < main_array.length; i++) {
|
|
|
// for (var j = 0; j < main_array[i].title.length; j++) {
|
|
|
// if (main_array[i].title[j].label_state) {
|
|
|
// main_array[i].title = main_array[i].title[j].name
|
|
|
// }
|
|
|
// console.log(main_array)
|
|
|
// }
|
|
|
// }
|
|
|
// that.setData({
|
|
|
// main_array: main_array
|
|
|
// })
|
|
|
}
|
|
|
setTimeout(function() {
|
|
|
that.ensureProjectList()
|
...
|
...
|
@@ -336,18 +313,20 @@ Page({ |
|
|
wx.setNavigationBarTitle({
|
|
|
title: '添加保单',
|
|
|
})
|
|
|
}, 1000)
|
|
|
}, 800)
|
|
|
|
|
|
|
|
|
console.log(this.data.risk_list)
|
|
|
},
|
|
|
|
|
|
//重组主险的保障项目
|
|
|
tempMain() {
|
|
|
var main_array = this.data.main_array
|
|
|
var warranty_one1 = []
|
|
|
console.log(main_array)
|
|
|
// console.log(main_array)
|
|
|
for (var i = 0; i < main_array.length; i++) {
|
|
|
var temp = {}
|
|
|
for (var j = 0; j < main_array[i].title.length; j++) {
|
|
|
|
|
|
if (main_array[i].choose_status) {
|
|
|
if (main_array[i].title[j].label_state) {
|
|
|
temp.id = main_array[i].id
|
...
|
...
|
@@ -359,7 +338,6 @@ Page({ |
|
|
}
|
|
|
}
|
|
|
warranty_one1.push(temp)
|
|
|
console.log(warranty_one1)
|
|
|
this.setData({
|
|
|
guarantee: warranty_one1
|
|
|
})
|
...
|
...
|
@@ -390,35 +368,34 @@ Page({ |
|
|
//重组附加险整体数据结构
|
|
|
tempAddRisk() {
|
|
|
var risk_list = this.data.risk_list
|
|
|
var temp_risk = []
|
|
|
|
|
|
var sub_array = []
|
|
|
console.log(risk_list)
|
|
|
for (var i = 0; i < risk_list.length; i++) {
|
|
|
var temp = {}
|
|
|
for (var j = 0; j < risk_list[i].mo.length; j++) {
|
|
|
var subtemp = {}
|
|
|
for (var k = 0; k < risk_list[i].mo[j].title.length; k++) {
|
|
|
if (risk_list[i].name != '') {
|
|
|
if (risk_list[i].mo[j].choose_status) {
|
|
|
if (risk_list[i].mo[j].title[k].label_state) {
|
|
|
temp.name = risk_list[i].name
|
|
|
temp.num = risk_list[i].num
|
|
|
temp.title = risk_list[i].title
|
|
|
subtemp.id = risk_list[i].mo[j].id
|
|
|
subtemp.name = risk_list[i].mo[j].name
|
|
|
subtemp.num = risk_list[i].mo[j].num
|
|
|
subtemp.title = risk_list[i].mo[j].title[k].name
|
|
|
subtemp.t_id = risk_list[i].mo[j].title[k].t_id
|
|
|
var temp_risk = this.data.risk_listitm;
|
|
|
var temp = this.data.risk_listitm;
|
|
|
|
|
|
for (var i = 0; i < temp.length; i++) {
|
|
|
for (var j = 0; j < temp[i].mo.length; j++) {
|
|
|
for (var k = 0; k < temp[i].mo[j].title.length; k++) {
|
|
|
if (temp[i].name != '') {
|
|
|
// var temp = {}
|
|
|
// var subtemp = {}
|
|
|
if (temp[i].mo[j].choose_status) {
|
|
|
if (temp[i].mo[j].title[k].label_state) {
|
|
|
temp_risk[i].name = temp[i].name
|
|
|
temp_risk[i].num = temp[i].num
|
|
|
temp_risk[i].title = temp[i].title
|
|
|
temp_risk[i].mo[j].t_id = temp[i].mo[j].title[k].t_id
|
|
|
temp_risk[i].mo[j].id = temp[i].mo[j].id
|
|
|
temp_risk[i].mo[j].name = temp[i].mo[j].name
|
|
|
temp_risk[i].mo[j].num = temp[i].mo[j].num
|
|
|
temp_risk[i].mo[j].title = temp[i].mo[j].title[k].name
|
|
|
console.log(temp_risk)
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
}
|
|
|
sub_array.push(subtemp)
|
|
|
}
|
|
|
|
|
|
temp.mo = sub_array
|
|
|
temp_risk.push(temp)
|
|
|
console.log(temp_risk)
|
|
|
this.setData({
|
|
|
more: temp_risk
|
|
|
})
|
...
|
...
|
@@ -443,7 +420,6 @@ Page({ |
|
|
const add = tempBenefice.every((tempBenefice) => {
|
|
|
return tempBenefice != nowPerson
|
|
|
})
|
|
|
console.log()
|
|
|
if (add) {
|
|
|
beneficiary_list[index].beneficiary_name = nowPerson;
|
|
|
tempBenefice.push(nowPerson)
|
...
|
...
|
@@ -665,8 +641,6 @@ Page({ |
|
|
});
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
//保障期
|
|
|
warrantyTwo(e) {
|
|
|
if (this.data.inforid != 0) {
|
...
|
...
|
@@ -690,7 +664,6 @@ Page({ |
|
|
this.countImpletionTime2()
|
|
|
},
|
|
|
|
|
|
|
|
|
//重组保障期数据格式
|
|
|
tempWarranty() {
|
|
|
var guarantee_name = this.data.guarantee_name
|
...
|
...
|
@@ -779,7 +752,6 @@ Page({ |
|
|
tempburningTime() {
|
|
|
var time_name = this.data.time_name
|
|
|
var unit = this.data.unit2
|
|
|
console.log(unit)
|
|
|
var long_money = this.data.long_money
|
|
|
long_money.num = time_name
|
|
|
long_money.title = unit
|
...
|
...
|
@@ -793,7 +765,6 @@ Page({ |
|
|
countImpletionTime() {
|
|
|
var time_name = parseInt(this.data.time_name)
|
|
|
var unit = this.data.unit2
|
|
|
|
|
|
var compact_time = this.data.compact_time
|
|
|
var year = parseInt(new Date(compact_time).getFullYear())
|
|
|
var month = parseInt(new Date(compact_time).getMonth() + 1)
|
...
|
...
|
@@ -858,7 +829,6 @@ Page({ |
|
|
})
|
|
|
},
|
|
|
|
|
|
|
|
|
//家庭成员
|
|
|
familyMember() {
|
|
|
var FamilyId = this.data.FamilyId
|
...
|
...
|
@@ -884,6 +854,7 @@ Page({ |
|
|
})
|
|
|
},
|
|
|
|
|
|
//设置缓存
|
|
|
setStorge(e) {
|
|
|
this.tempBeneficiary()
|
|
|
this.tempWarranty()
|
...
|
...
|
@@ -937,6 +908,11 @@ Page({ |
|
|
wx.navigateBack({
|
|
|
delta: 1,
|
|
|
})
|
|
|
this.setData({
|
|
|
storge_state: true
|
|
|
})
|
|
|
var storge_state = true
|
|
|
wx.setStorageSync('storge_state', storge_state)
|
|
|
}
|
|
|
})
|
|
|
},
|
...
|
...
|
@@ -993,9 +969,8 @@ Page({ |
|
|
})
|
|
|
},
|
|
|
|
|
|
// 保单验证&&上传保单
|
|
|
//完成保单添加
|
|
|
listVerify(e) {
|
|
|
console.log(this.data.inforid)
|
|
|
if (this.data.inforid == 0 || this.data.inforid == undefined) {
|
|
|
this.tempBeneficiary()
|
|
|
this.tempWarranty()
|
...
|
...
|
@@ -1043,6 +1018,9 @@ Page({ |
|
|
var bank_num = e.detail.value.bank_num
|
|
|
var picurl = JSON.stringify(this.data.imgs)
|
|
|
|
|
|
var continue1 = e.detail.target.dataset.type
|
|
|
var complete = e.detail.target.dataset.type
|
|
|
|
|
|
if (in_num == '') {
|
|
|
warn = '请输入保单号!'
|
|
|
} else if (firm == '') {
|
...
|
...
|
@@ -1107,9 +1085,48 @@ Page({ |
|
|
}
|
|
|
app.post(url, params).then((res) => {
|
|
|
if (res.data.code == 200) {
|
|
|
wx.navigateBack({
|
|
|
delta: 1,
|
|
|
})
|
|
|
if (continue1 == 'continue1') {
|
|
|
wx.showToast({
|
|
|
title: '添加成功',
|
|
|
icon: 'none',
|
|
|
duration: 2000,
|
|
|
})
|
|
|
this.setData({
|
|
|
in_num:'',
|
|
|
firm:'',
|
|
|
applicant_name:'',
|
|
|
recognizee_name:'',
|
|
|
// beneficiary_list: [{
|
|
|
// name_array: [],
|
|
|
// unit: ''
|
|
|
// }],
|
|
|
main_risks:'',
|
|
|
main_array:'',
|
|
|
year_money:'',
|
|
|
compact_time:'',
|
|
|
warranty_two:'',
|
|
|
long_money:'',
|
|
|
bank:'',
|
|
|
bank_num:'',
|
|
|
impletion_time:'',
|
|
|
warranty_one:'',
|
|
|
// risk_list:'',
|
|
|
imgs:'',
|
|
|
unit:'',
|
|
|
unit2: '',
|
|
|
unit3: '',
|
|
|
unit4: '',
|
|
|
})
|
|
|
} else if (complete == 'complete') {
|
|
|
wx.showToast({
|
|
|
title: '添加成功',
|
|
|
icon: 'none',
|
|
|
duration: 2000,
|
|
|
})
|
|
|
wx.navigateBack({
|
|
|
delta: 1,
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
}
|
...
|
...
|
@@ -1132,7 +1149,6 @@ Page({ |
|
|
InfoId: this.data.inforid,
|
|
|
}
|
|
|
app.post(url, params).then((res) => {
|
|
|
console.log(res)
|
|
|
if (res.data.code == 200) {
|
|
|
var warranty_two = res.data.data.def.warranty_two
|
|
|
var unit = this.data.unit
|
...
|
...
|
@@ -1151,6 +1167,7 @@ Page({ |
|
|
|
|
|
var risk_list = res.data.data.def.more
|
|
|
var projectlist = this.data.projectlist
|
|
|
|
|
|
for (var i = 0; i < risk_list.length; i++) {
|
|
|
for (var j = 0; j < projectlist.length; j++) {
|
|
|
for (var k = 0; k < projectlist[j].title.length; k++) {
|
...
|
...
|
@@ -1158,7 +1175,6 @@ Page({ |
|
|
if (risk_list[i].title == projectlist[j].title[k].name) {
|
|
|
var title = {}
|
|
|
title.name = projectlist[j].title[k]
|
|
|
// risk_list[i].push(title)
|
|
|
}
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -1222,8 +1238,10 @@ Page({ |
|
|
}
|
|
|
if (options.inforid != undefined) {
|
|
|
this.getlistVerify()
|
|
|
} else {
|
|
|
// this.getStorage()
|
|
|
}
|
|
|
|
|
|
if (wx.getStorageSync('storge_state') && options.inforid == undefined) {
|
|
|
this.getStorage()
|
|
|
}
|
|
|
},
|
|
|
|
...
|
...
|
|