...
|
...
|
@@ -64,7 +64,8 @@ Page({ |
|
|
edit_state3: false,
|
|
|
coverage: '',
|
|
|
focus: false,
|
|
|
sub_index: ''
|
|
|
sub_index: '',
|
|
|
birthday:''
|
|
|
},
|
|
|
|
|
|
//回到顶部
|
...
|
...
|
@@ -81,32 +82,13 @@ Page({ |
|
|
}
|
|
|
},
|
|
|
|
|
|
|
|
|
//取消弹窗
|
|
|
cancleMask() {
|
|
|
// if (this.data.inforid != 0) {
|
|
|
// if (this.data.edit_state3) {
|
|
|
// this.setData({
|
|
|
// edit_state: false,
|
|
|
// edit_state2: false
|
|
|
// })
|
|
|
// } else {
|
|
|
// this.setData({
|
|
|
// edit_state: true,
|
|
|
// edit_state2: true
|
|
|
// })
|
|
|
// }
|
|
|
// } else {
|
|
|
// this.setData({
|
|
|
// edit_state: false,
|
|
|
// edit_state2: false
|
|
|
// })
|
|
|
// }
|
|
|
// console.log(this.data.edit_state)
|
|
|
|
|
|
this.setData({
|
|
|
popup_state: false,
|
|
|
})
|
|
|
},
|
|
|
|
|
|
//保单号
|
|
|
policyNum(e) {
|
|
|
this.setData({
|
...
|
...
|
@@ -124,9 +106,10 @@ Page({ |
|
|
//投保人
|
|
|
insureSelect(e) {
|
|
|
var insure = this.data.insure
|
|
|
console.log(insure)
|
|
|
this.setData({
|
|
|
insureindex: e.detail.value,
|
|
|
applicant_name: insure[e.detail.value],
|
|
|
applicant_name: insure[e.detail.value].name,
|
|
|
})
|
|
|
},
|
|
|
|
...
|
...
|
@@ -153,7 +136,6 @@ Page({ |
|
|
})
|
|
|
},
|
|
|
|
|
|
|
|
|
//保费
|
|
|
yearMoney(e) {
|
|
|
this.setData({
|
...
|
...
|
@@ -203,18 +185,30 @@ Page({ |
|
|
let that = this;
|
|
|
let type = e.currentTarget.dataset.type;
|
|
|
let index = e.currentTarget.dataset.xulie;
|
|
|
|
|
|
// 复制保障项目模板
|
|
|
// let tempProjectlist = Object.assign({}, this.data.projectlist);
|
|
|
let tempProjectlist = JSON.parse(JSON.stringify(this.data.projectlist));
|
|
|
|
|
|
|
|
|
// for (var i = 0; i < tempProjectlist.length; i++) {
|
|
|
// for (var j = 0; j < tempProjectlist[i].title.length; j++) {
|
|
|
// tempProjectlist[i].title[0].label_state = true
|
|
|
// }
|
|
|
// }
|
|
|
|
|
|
|
|
|
|
|
|
var sub_index = that.data.sub_index
|
|
|
var edit_state3 = that.data.edit_state3
|
|
|
|
|
|
// 已经添加的附加险
|
|
|
let risk_list = Object.assign([],this.data.risk_list);
|
|
|
this.setData({
|
|
|
type: type,
|
|
|
xielie: index
|
|
|
})
|
|
|
let risk_list = Object.assign([], this.data.risk_list);
|
|
|
|
|
|
// this.setData({
|
|
|
// type: type,
|
|
|
// xielie: index
|
|
|
// })
|
|
|
|
|
|
if (type == 'fujiaxian') {
|
|
|
this.setData({
|
...
|
...
|
@@ -222,7 +216,7 @@ Page({ |
|
|
})
|
|
|
}
|
|
|
// 已经添加的主险
|
|
|
let tempMain_list = Object.assign([],this.data.main_array)
|
|
|
let tempMain_list = Object.assign([], this.data.main_array)
|
|
|
this.data.inforid != 0 && this.data.inforid != undefined
|
|
|
if (type == 'zhuxian') {
|
|
|
if (tempMain_list.length > 0) {
|
...
|
...
|
@@ -234,6 +228,8 @@ Page({ |
|
|
for (let g in tempProjectlist[i].title) {
|
|
|
if (tempProjectlist[i].title[g].t_id == tempMain_list[j].t_id) {
|
|
|
tempProjectlist[i].title[g].label_state = true
|
|
|
} else {
|
|
|
tempProjectlist[i].title[g].label_state = false
|
|
|
}
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -251,6 +247,8 @@ Page({ |
|
|
for (let g in tempProjectlist[i].title) {
|
|
|
if (tempProjectlist[i].title[g].t_id == tempRist[j].t_id) {
|
|
|
tempProjectlist[i].title[g].label_state = true
|
|
|
} else {
|
|
|
tempProjectlist[i].title[g].label_state = false
|
|
|
}
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -258,10 +256,11 @@ Page({ |
|
|
}
|
|
|
}
|
|
|
}
|
|
|
// }
|
|
|
|
|
|
wx.setNavigationBarTitle({
|
|
|
title: '选择保障项目',
|
|
|
})
|
|
|
|
|
|
this.setData({
|
|
|
popup_state: true,
|
|
|
addType: type,
|
...
|
...
|
@@ -285,7 +284,7 @@ Page({ |
|
|
projectlist[i].title[j].label_state = false
|
|
|
}
|
|
|
// projectlist[i].title[0].current = 0
|
|
|
// projectlist[i].title[0].label_state = true
|
|
|
projectlist[i].title[0].label_state = true
|
|
|
}
|
|
|
this.setData({
|
|
|
projectlist: res.data.data.def,
|
...
|
...
|
@@ -339,6 +338,7 @@ Page({ |
|
|
this.setData({
|
|
|
showProjectlist: projectlist,
|
|
|
})
|
|
|
|
|
|
if (this.data.inforid != 0) {
|
|
|
edit_state: false;
|
|
|
edit_state2: false
|
...
|
...
|
@@ -347,34 +347,23 @@ Page({ |
|
|
|
|
|
//确认选择的推荐方案
|
|
|
confirmCase() {
|
|
|
// if (this.data.type == 'fujiaxian') {
|
|
|
// this.setData({
|
|
|
// edit_state2: false
|
|
|
// })
|
|
|
// } else {
|
|
|
// this.setData({
|
|
|
// edit_state: false
|
|
|
// })
|
|
|
// }
|
|
|
|
|
|
|
|
|
let index = this.data.xulie;
|
|
|
let type = this.data.addType;
|
|
|
var that = this
|
|
|
var main_array = []
|
|
|
|
|
|
var projectlist = Object.assign([], this.data.showProjectlist)
|
|
|
|
|
|
for (var i = 0; i < projectlist.length; i++) {
|
|
|
if (projectlist[i].choose_status) {
|
|
|
let baseData = Object.assign({}, projectlist[i]);
|
|
|
console.log(baseData)
|
|
|
let temprist = projectlist[i];
|
|
|
for (var j in temprist.title){
|
|
|
if (temprist.title[j].label_state){
|
|
|
for (var j in temprist.title) {
|
|
|
if (temprist.title[j].label_state) {
|
|
|
baseData.title = temprist.title[j].name;
|
|
|
baseData.t_id = temprist.title[j].t_id;
|
|
|
baseData.choose_status = temprist.title[j].choose_status;
|
|
|
}else{
|
|
|
break;
|
|
|
} else {
|
|
|
baseData.title = '';
|
|
|
}
|
|
|
}
|
...
|
...
|
@@ -390,7 +379,6 @@ Page({ |
|
|
|
|
|
if (type == 'fujiaxian') {
|
|
|
let tempRist = that.data.risk_list;
|
|
|
console.log(tempRist)
|
|
|
tempRist[index]['mo'] = main_array;
|
|
|
that.setData({
|
|
|
risk_list: tempRist,
|
...
|
...
|
@@ -401,6 +389,7 @@ Page({ |
|
|
})
|
|
|
}
|
|
|
}
|
|
|
|
|
|
setTimeout(function() {
|
|
|
that.ensureProjectList()
|
|
|
that.setData({
|
...
|
...
|
@@ -410,6 +399,7 @@ Page({ |
|
|
title: '添加保单',
|
|
|
})
|
|
|
}, 800)
|
|
|
|
|
|
},
|
|
|
|
|
|
//重组主险的保障项目
|
...
|
...
|
@@ -443,7 +433,8 @@ Page({ |
|
|
var index = e.currentTarget.dataset.index
|
|
|
risk_list[index].name = e.detail.value
|
|
|
this.setData({
|
|
|
risk_list: risk_list
|
|
|
risk_list: risk_list,
|
|
|
focus: false
|
|
|
})
|
|
|
},
|
|
|
|
...
|
...
|
@@ -483,7 +474,6 @@ Page({ |
|
|
// }
|
|
|
// }
|
|
|
// }
|
|
|
// console.log(temp_risk)
|
|
|
|
|
|
// }
|
|
|
this.setData({
|
...
|
...
|
@@ -493,29 +483,20 @@ Page({ |
|
|
|
|
|
//选择受益人姓名
|
|
|
beneficiarySelect(e) {
|
|
|
if (this.data.inforid != 0) {
|
|
|
// this.setData({
|
|
|
// edit_state: true,
|
|
|
// edit_state2: true
|
|
|
// })
|
|
|
}
|
|
|
var index = e.currentTarget.dataset.mindex
|
|
|
var beneficiary_list = Object.assign({}, this.data.projectlist)
|
|
|
// 获取当前已选择的收益人
|
|
|
let tempBenefice = Object.assign({}, this.data.projectlist)
|
|
|
// 当前选择的收益人
|
|
|
// let nowPerson = beneficiary_list[index].name_array[e.detail.value];
|
|
|
// let nowPerson = beneficiary_list[index].beneficiary_name
|
|
|
let nowPerson = beneficiary_list[index].name
|
|
|
// 判断受益人是否已经添加
|
|
|
const add = tempBenefice.every((tempBenefice) => {
|
|
|
return tempBenefice != nowPerson
|
|
|
})
|
|
|
if (add) {
|
|
|
// beneficiary_list[index].beneficiary_name = nowPerson;
|
|
|
beneficiary_list[index].name = nowPerson;
|
|
|
tempBenefice.push(nowPerson)
|
|
|
console.log(tempBenefice)
|
|
|
} else {
|
|
|
wx.showToast({
|
|
|
title: '请不要重复添加受益人',
|
...
|
...
|
@@ -545,6 +526,7 @@ Page({ |
|
|
beneficiary_list: beneficiary_list,
|
|
|
})
|
|
|
},
|
|
|
|
|
|
//添加收益比例
|
|
|
addUnit2(e) {
|
|
|
var beneficiary_list = this.data.beneficiary_list;
|
...
|
...
|
@@ -613,7 +595,6 @@ Page({ |
|
|
icon: 'none'
|
|
|
})
|
|
|
} else if (list[len - 1].unit == '') {
|
|
|
console.log('unit')
|
|
|
wx.showToast({
|
|
|
title: '请输入收益比',
|
|
|
icon: 'none'
|
...
|
...
|
@@ -628,7 +609,6 @@ Page({ |
|
|
this.setData({
|
|
|
beneficiary_list: list
|
|
|
})
|
|
|
console.log(this.data.beneficiary_list)
|
|
|
},
|
|
|
|
|
|
//重组添加受益人
|
...
|
...
|
@@ -646,15 +626,14 @@ Page({ |
|
|
this.setData({
|
|
|
tempfavoree: tempfavoree1
|
|
|
})
|
|
|
|
|
|
}
|
|
|
},
|
|
|
|
|
|
//删除收益人
|
|
|
deletebenefict(e) {
|
|
|
let index = e.currentTarget.dataset.index;
|
|
|
let tempbenefict = Object.assign({},this.data.beneficiary_list);
|
|
|
let beneficiaryList = Object.assign({},this.data.beneficiaryList);
|
|
|
let tempbenefict = this.data.beneficiary_list
|
|
|
let beneficiaryList = this.data.beneficiaryList
|
|
|
// 获取当前选项的受益人
|
|
|
// let person = tempbenefict[index].beneficiary_name;
|
|
|
let person = tempbenefict[index].name;
|
...
|
...
|
@@ -669,13 +648,8 @@ Page({ |
|
|
|
|
|
//添加附加险
|
|
|
addRisk() {
|
|
|
if (this.data.inforid != 0) {
|
|
|
// this.setData({
|
|
|
// edit_state: false,
|
|
|
// edit_state2: false
|
|
|
// })
|
|
|
}
|
|
|
var risk_list = Object.assign({},this.data.risk_list);
|
|
|
// var risk_list = Object.assign({}, this.data.risk_list);
|
|
|
var risk_list = this.data.risk_list;
|
|
|
var len = risk_list.length
|
|
|
risk_list[len] = {
|
|
|
name: '',
|
...
|
...
|
@@ -685,14 +659,15 @@ Page({ |
|
|
num: ''
|
|
|
}
|
|
|
this.setData({
|
|
|
risk_list: risk_list
|
|
|
risk_list: risk_list,
|
|
|
focus: false
|
|
|
})
|
|
|
},
|
|
|
|
|
|
//删除附加险
|
|
|
deleteRisk(e) {
|
|
|
let index = e.currentTarget.dataset.index;
|
|
|
let risk_list = Object.assign({},this.data.risk_list);
|
|
|
let risk_list = this.data.risk_list;
|
|
|
risk_list.splice(index, 1);
|
|
|
this.setData({
|
|
|
risk_list: risk_list
|
...
|
...
|
@@ -770,10 +745,7 @@ Page({ |
|
|
},
|
|
|
complete: () => {
|
|
|
i++;
|
|
|
if (i == length) {
|
|
|
|
|
|
} else { //递归调用uploadDIY函数
|
|
|
|
|
|
if (i == length) {} else { //递归调用uploadDIY函数
|
|
|
this.uploadAllfile(filePaths, successUp, failUp, i, length);
|
|
|
}
|
|
|
},
|
...
|
...
|
@@ -785,9 +757,7 @@ Page({ |
|
|
var imgs = this.data.imgs
|
|
|
var current = e.currentTarget.dataset.index
|
|
|
wx.previewImage({
|
|
|
//当前显示图片
|
|
|
current: imgs[current],
|
|
|
//所有图片
|
|
|
urls: imgs
|
|
|
})
|
|
|
},
|
...
|
...
|
@@ -804,12 +774,6 @@ Page({ |
|
|
|
|
|
//保障期
|
|
|
warrantyTwo(e) {
|
|
|
if (this.data.inforid != 0) {
|
|
|
// this.setData({
|
|
|
// edit_state: false,
|
|
|
// edit_state2: false
|
|
|
// })
|
|
|
}
|
|
|
var guarantee_name = e.detail.value
|
|
|
var warranty_two = this.data.warranty_two
|
|
|
var impletion_time = this.data.impletion_time
|
...
|
...
|
@@ -823,7 +787,6 @@ Page({ |
|
|
|
|
|
//选择各项单位
|
|
|
selectUnit(e) {
|
|
|
console.log(e)
|
|
|
var unit = e.currentTarget.dataset.unit
|
|
|
this.setData({
|
|
|
unit: unit,
|
...
|
...
|
@@ -832,7 +795,7 @@ Page({ |
|
|
if (unit == '终身') {
|
|
|
this.setData({
|
|
|
'warranty_two.num': '',
|
|
|
'warranty_one':''
|
|
|
'warranty_one': ''
|
|
|
})
|
|
|
this.setData({
|
|
|
warranty_info: '',
|
...
|
...
|
@@ -857,7 +820,6 @@ Page({ |
|
|
// warranty_two: warranty_two
|
|
|
// })
|
|
|
this.data.warranty_two.title = this.data.unit
|
|
|
console.log(this.data.warranty_two)
|
|
|
},
|
|
|
|
|
|
|
...
|
...
|
@@ -871,9 +833,8 @@ Page({ |
|
|
var day = parseInt(new Date(compact_time).getDate())
|
|
|
var warranty_one = this.data.warranty_one
|
|
|
var tempbirth_time = ''
|
|
|
var birthday = ''
|
|
|
var birthday = this.data.birthday
|
|
|
var birthday_year = parseInt(new Date(birthday).getFullYear())
|
|
|
|
|
|
if (compact_time == '') {
|
|
|
wx.showToast({
|
|
|
title: '请选择合同生效日',
|
...
|
...
|
@@ -885,16 +846,16 @@ Page({ |
|
|
var temp_day = day - 1
|
|
|
if (month < 10) month = "0" + month;
|
|
|
if (temp_day < 10) temp_day = "0" + temp_day;
|
|
|
warranty_one = guarantee_name ? (temp_year + '-' + month + '-' + temp_day):''
|
|
|
// warranty_one = temp_year + '-' + month + '-' + temp_day
|
|
|
warranty_one = guarantee_name ? (temp_year + '-' + month + '-' + temp_day) : ''
|
|
|
warranty_one = temp_year + '-' + month + '-' + temp_day
|
|
|
} else if (unit == '岁') {
|
|
|
var temp_year = (birthday_year + guarantee_name - 1)
|
|
|
var temp_year2 = (birthday_year + guarantee_name)
|
|
|
// var temp_year = (birthday_year + guarantee_name - 1)
|
|
|
var temp_year = (birthday_year + guarantee_name)
|
|
|
var temp_month = month
|
|
|
if (temp_month < 10) temp_month = "0" + temp_month;
|
|
|
if (month < 10) month = "0" + month;
|
|
|
if (day < 10) day = "0" + day;
|
|
|
warranty_one = guarantee_name ? (temp_year2 + '-' + month + '-' + day) : ''
|
|
|
warranty_one = guarantee_name ? (temp_year + '-' + month + '-' + day) : ''
|
|
|
// warranty_one = temp_year2 + '-' + month + '-' + day
|
|
|
} else if (unit == '终身') {
|
|
|
warranty_one = '终身'
|
...
|
...
|
@@ -928,7 +889,7 @@ Page({ |
|
|
this.data.long_money.title = unit;
|
|
|
if (unit == '终身') {
|
|
|
this.setData({
|
|
|
'long_money.num':''
|
|
|
'long_money.num': ''
|
|
|
})
|
|
|
this.setData({
|
|
|
warranty_info1: '',
|
...
|
...
|
@@ -968,7 +929,7 @@ Page({ |
|
|
var day = parseInt(new Date(compact_time).getDate())
|
|
|
var impletion_time = this.data.impletion_time
|
|
|
var tempbirth_time = ''
|
|
|
var birthday = ''
|
|
|
var birthday = this.data.birthday
|
|
|
var birthday_year = parseInt(new Date(birthday).getFullYear())
|
|
|
|
|
|
if (compact_time == '') {
|
...
|
...
|
@@ -1015,20 +976,17 @@ Page({ |
|
|
selectUnit4(e) {
|
|
|
var unit = e.currentTarget.dataset.unit;
|
|
|
let index = e.currentTarget.dataset.index;
|
|
|
let risk_list = Object.assign([],this.data.risk_list);
|
|
|
var focus=this.data.focus
|
|
|
// let risk_list = Object.assign([], this.data.risk_list);
|
|
|
let risk_list = this.data.risk_list
|
|
|
risk_list[index].title = unit
|
|
|
if (risk_list[index].title == '终身') {
|
|
|
risk_list[index].num = ''
|
|
|
this.setData({
|
|
|
risk_state: true
|
|
|
})
|
|
|
} else {
|
|
|
this.setData({
|
|
|
risk_state: false
|
|
|
})
|
|
|
focus=true
|
|
|
}
|
|
|
this.setData({
|
|
|
risk_list: risk_list
|
|
|
risk_list: risk_list,
|
|
|
focus: focus
|
|
|
})
|
|
|
},
|
|
|
|
...
|
...
|
@@ -1040,17 +998,17 @@ Page({ |
|
|
FamilyId: FamilyId || id,
|
|
|
}
|
|
|
app.post(url, params).then((res) => {
|
|
|
console.log(res)
|
|
|
// 受益人数组
|
|
|
// var beneficiary_list = this.data.beneficiary_list
|
|
|
// for (var i in beneficiary_list) {
|
|
|
// beneficiary_list[i].name_array = res.data.data.list
|
|
|
// }
|
|
|
|
|
|
|
|
|
if (res.data.code == 200) {
|
|
|
this.setData({
|
|
|
insure: res.data.data.list,
|
|
|
recognizee: res.data.data.list,
|
|
|
birthday:res.data.data.list[0].birthday
|
|
|
// beneficiary_list: beneficiary_list,
|
|
|
})
|
|
|
}
|
...
|
...
|
@@ -1129,7 +1087,6 @@ Page({ |
|
|
def_id: this.data.def_id,
|
|
|
}
|
|
|
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
|
...
|
...
|
@@ -1176,10 +1133,6 @@ Page({ |
|
|
bank_num: res.data.data.def.bank_num,
|
|
|
risk_list: res.data.data.def.more,
|
|
|
beneficiary_list: beneficiary_list,
|
|
|
// edit_state: true,
|
|
|
// edit_state2: true,
|
|
|
// edit_state3: true,
|
|
|
temp_state: true
|
|
|
})
|
|
|
}
|
|
|
})
|
...
|
...
|
@@ -1187,7 +1140,6 @@ Page({ |
|
|
|
|
|
//完成保单添加
|
|
|
listVerify(e) {
|
|
|
console.log(e)
|
|
|
if (this.data.inforid == 0 || this.data.inforid == undefined) {
|
|
|
this.tempBeneficiary()
|
|
|
this.tempWarranty()
|
...
|
...
|
@@ -1380,7 +1332,6 @@ Page({ |
|
|
|
|
|
},
|
|
|
|
|
|
|
|
|
//获取编辑保单接口
|
|
|
getlistVerify(id) {
|
|
|
let url = 'counselor/infordef'
|
...
|
...
|
@@ -1388,7 +1339,6 @@ Page({ |
|
|
InfoId: this.data.inforid || id,
|
|
|
}
|
|
|
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
|
...
|
...
|
@@ -1409,7 +1359,7 @@ Page({ |
|
|
}
|
|
|
|
|
|
var risk_list = res.data.data.def.more
|
|
|
var projectlist = Object.assign({},this.data.projectlist)
|
|
|
var projectlist = Object.assign({}, this.data.projectlist)
|
|
|
|
|
|
for (var i = 0; i < risk_list.length; i++) {
|
|
|
for (var j = 0; j < projectlist.length; j++) {
|
...
|
...
|
@@ -1453,10 +1403,6 @@ Page({ |
|
|
bank_num: res.data.data.def.bank_num,
|
|
|
risk_list: risk_list,
|
|
|
beneficiary_list: beneficiary_list,
|
|
|
// edit_state: true,
|
|
|
// edit_state2: true,
|
|
|
// edit_state3: true,
|
|
|
temp_state: true,
|
|
|
guarantee_name: guarantee_name,
|
|
|
time_name: time_name,
|
|
|
})
|
...
|
...
|
|