|
|
@ -467,46 +467,10 @@ Page({ |
|
|
|
wx.showToast({ |
|
|
|
title: title, |
|
|
|
icon: 'none', |
|
|
|
duration: 2000 |
|
|
|
duration: 5000 |
|
|
|
}) |
|
|
|
}, |
|
|
|
submit() { |
|
|
|
if (!this.data.form.name) { |
|
|
|
this.showToast('请输入姓名') |
|
|
|
return false |
|
|
|
} |
|
|
|
if (!this.data.form.idCard) { |
|
|
|
this.showToast('请填写身份证号') |
|
|
|
return false |
|
|
|
} |
|
|
|
if(!this.data.form.workUnit){ |
|
|
|
this.showToast('请填写工作单位') |
|
|
|
return false |
|
|
|
} |
|
|
|
if (!this.data.form.mobile) { |
|
|
|
this.showToast('请填写手机号') |
|
|
|
return false |
|
|
|
} |
|
|
|
if(this.data.form.shibei == '1'){ |
|
|
|
if (this.data.form.allDeptIds.length == 0) { |
|
|
|
this.showToast('请选择报到常住社区名称') |
|
|
|
return false |
|
|
|
} |
|
|
|
if (!this.data.form.homeName) { |
|
|
|
this.showToast('请填写居住小区名称') |
|
|
|
return false |
|
|
|
} |
|
|
|
if (this.data.form.couplingCommunity.length == 0) { |
|
|
|
this.showToast('请选择包联单位名称') |
|
|
|
return false |
|
|
|
} |
|
|
|
}else if(this.data.form.shibei == '0'){ |
|
|
|
if (this.data.form.allDeptIds.length == 0) { |
|
|
|
this.showToast('请选择单位包联社区名称') |
|
|
|
return false |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
const para = { |
|
|
|
...this.data.form |
|
|
|
} |
|
|
@ -523,23 +487,20 @@ Page({ |
|
|
|
para.volunteer = parseInt(para.volunteer) |
|
|
|
para.gridStaff = parseInt(para.gridStaff) |
|
|
|
console.log(para); |
|
|
|
wx.showLoading({ |
|
|
|
title: "提交中..." |
|
|
|
}) |
|
|
|
let than = this |
|
|
|
// api.submitReportparty(para).then(res => {
|
|
|
|
// wx.hideLoading()
|
|
|
|
// if(res.code == '0'){
|
|
|
|
// than.setData({
|
|
|
|
// submitStatus:true
|
|
|
|
// })
|
|
|
|
// }else{
|
|
|
|
// than.showToast(res.msg)
|
|
|
|
// }
|
|
|
|
// }).catch(err => {
|
|
|
|
// wx.hideLoading()
|
|
|
|
// console.log(err);
|
|
|
|
// wx.showLoading({
|
|
|
|
// title: "提交中..."
|
|
|
|
// })
|
|
|
|
let than = this |
|
|
|
api.submitReportparty(para).then(res => { |
|
|
|
// wx.hideLoading()
|
|
|
|
if(res.code == '0'){ |
|
|
|
than.setData({ |
|
|
|
submitStatus:true |
|
|
|
}) |
|
|
|
} |
|
|
|
}).catch(err => { |
|
|
|
// wx.hideLoading()
|
|
|
|
}) |
|
|
|
}, |
|
|
|
handleCheckbox(e) { |
|
|
|
console.log(e); |
|
|
|