|
|
@ -52,7 +52,7 @@ Page({ |
|
|
|
activeIcon: 'arrow', |
|
|
|
}, |
|
|
|
], //步骤条数据
|
|
|
|
activeForm: 0, |
|
|
|
activeForm: 3, |
|
|
|
/** 步骤条状态 */ |
|
|
|
form: { |
|
|
|
baseInfoDto: { |
|
|
@ -760,50 +760,49 @@ Page({ |
|
|
|
}, |
|
|
|
nextStep: async function () { |
|
|
|
if (this.data.activeForm === 0) { |
|
|
|
// if (!this.data.form.gridId) {
|
|
|
|
// this.showToast('请选择所在网格')
|
|
|
|
// return
|
|
|
|
// }
|
|
|
|
// if (!this.data.form.villageId) {
|
|
|
|
// this.showToast('请选择所在小区')
|
|
|
|
// return
|
|
|
|
// }
|
|
|
|
// if (!this.data.form.buildId) {
|
|
|
|
// this.showToast('请选择所在楼栋')
|
|
|
|
// return
|
|
|
|
// }
|
|
|
|
// if (!this.data.form.unitId) {
|
|
|
|
// this.showToast('请选择所在单元')
|
|
|
|
// return
|
|
|
|
// }
|
|
|
|
// if (!this.data.form.homeId) {
|
|
|
|
// this.showToast('请选择所在房屋')
|
|
|
|
// return
|
|
|
|
// }
|
|
|
|
let gridId = this.data.form.resideInfoDtos.filter(obj => !obj.gridId); |
|
|
|
let villageId = this.data.form.resideInfoDtos.filter(obj => !obj.villageId); |
|
|
|
let buildingId = this.data.form.resideInfoDtos.filter(obj => !obj.buildId); |
|
|
|
let unitId = this.data.form.resideInfoDtos.filter(obj => !obj.unitId); |
|
|
|
let houseId = this.data.form.resideInfoDtos.filter(obj => !obj.houseId); |
|
|
|
if(gridId.length>=1){ |
|
|
|
this.showToast('请选择所属组织') |
|
|
|
return false |
|
|
|
}else if (villageId.length>=1){ |
|
|
|
this.showToast('请选择所在小区') |
|
|
|
return false |
|
|
|
}else if (buildingId.length>=1){ |
|
|
|
this.showToast('请选择所在楼栋') |
|
|
|
return false |
|
|
|
}else if(unitId.length>=1){ |
|
|
|
this.showToast('请选择所在单元') |
|
|
|
}else if(houseId.legnth>= 1){ |
|
|
|
this.showToast('请选择所在门牌号') |
|
|
|
} |
|
|
|
this.setData({ |
|
|
|
activeForm: 1 |
|
|
|
}) |
|
|
|
} else if (this.data.activeForm === 1) { |
|
|
|
// if (!this.data.form.name) {
|
|
|
|
// this.showToast('请填写姓名')
|
|
|
|
// return
|
|
|
|
// }
|
|
|
|
// if (!this.data.form.idNum) {
|
|
|
|
// this.showToast('请填写证件号')
|
|
|
|
// return
|
|
|
|
// }
|
|
|
|
// if (!this.data.form.birthday) {
|
|
|
|
// this.showToast('请选择出生日期')
|
|
|
|
// return
|
|
|
|
// }
|
|
|
|
// if (!this.data.form.gender) {
|
|
|
|
// this.showToast('请选择性别')
|
|
|
|
// return
|
|
|
|
// }
|
|
|
|
// if (!this.data.form.mobile) {
|
|
|
|
// this.showToast('请填写联系电话')
|
|
|
|
// return
|
|
|
|
// }
|
|
|
|
if (!this.data.form.baseInfoDto.name) { |
|
|
|
this.showToast('请填写姓名') |
|
|
|
return |
|
|
|
} |
|
|
|
if (!this.data.form.baseInfoDto.idNum) { |
|
|
|
this.showToast('请填写证件号') |
|
|
|
return |
|
|
|
} |
|
|
|
if (!this.data.form.baseInfoDto.birthday) { |
|
|
|
this.showToast('请选择出生日期') |
|
|
|
return |
|
|
|
} |
|
|
|
if (!this.data.form.baseInfoDto.gender) { |
|
|
|
this.showToast('请选择性别') |
|
|
|
return |
|
|
|
} |
|
|
|
if (!this.data.form.baseInfoDto.mobile) { |
|
|
|
this.showToast('请填写联系电话') |
|
|
|
return |
|
|
|
} |
|
|
|
this.setData({ |
|
|
|
activeForm: 2 |
|
|
|
}) |
|
|
@ -812,12 +811,7 @@ Page({ |
|
|
|
activeForm: 3 |
|
|
|
}) |
|
|
|
} |
|
|
|
console.log(this.data.form); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
// console.log(this.data.isShowIdNum,this.data.formType != 'edit')
|
|
|
|
// const parm = {
|
|
|
|
// ...this.data.form,
|
|
|
|
|
|
|
@ -863,6 +857,13 @@ Page({ |
|
|
|
// }
|
|
|
|
// }
|
|
|
|
}, |
|
|
|
showToast(title) { |
|
|
|
wx.showToast({ |
|
|
|
title: title, |
|
|
|
duration: 2000, |
|
|
|
icon: 'none' |
|
|
|
}) |
|
|
|
}, |
|
|
|
async getDicts() { |
|
|
|
try { |
|
|
|
const requests = [ |
|
|
@ -1176,7 +1177,7 @@ Page({ |
|
|
|
bindPickerChangeGender(e) { |
|
|
|
this.setData({ |
|
|
|
genderName: this.data.dicts.genderList[e.detail.value].label, |
|
|
|
"form.gender": this.data.dicts.genderList[e.detail.value].value |
|
|
|
"form.baseInfoDto.gender": this.data.dicts.genderList[e.detail.value].value |
|
|
|
}) |
|
|
|
}, |
|
|
|
bindDateChange(e) { |
|
|
@ -1317,7 +1318,7 @@ Page({ |
|
|
|
//**人员标签start */
|
|
|
|
bindPartyFlag(e){ |
|
|
|
this.setData({ |
|
|
|
'form.baseInfoDto.categoryInfo.partyFlag':e.detail.value |
|
|
|
'form.baseInfoDto.categoryInfo.partyFlag':Number(e.detail.value) |
|
|
|
}) |
|
|
|
}, |
|
|
|
bindSpecialCategory(e){ |
|
|
@ -1391,18 +1392,27 @@ Page({ |
|
|
|
console.log(error, `获取 ${opctionParams.dictType} 字典`); |
|
|
|
} |
|
|
|
}, |
|
|
|
hideExpandForm() { |
|
|
|
hideExpandForm(e) { |
|
|
|
let form = this.data.form; |
|
|
|
delete form[e.detail.formType] |
|
|
|
console.log(form); |
|
|
|
this.setData({ |
|
|
|
showExpand: false |
|
|
|
showExpand: false, |
|
|
|
form |
|
|
|
}) |
|
|
|
}, |
|
|
|
confirmExpandForm() { |
|
|
|
confirmExpandForm(e) { |
|
|
|
let orgListCopy = this.data.orgList |
|
|
|
orgListCopy.forEach(item=>{ |
|
|
|
if(item.id === e.detail.formType){ |
|
|
|
item.children = e.detail.formList |
|
|
|
} |
|
|
|
}) |
|
|
|
this.setData({ |
|
|
|
showExpand: false |
|
|
|
}) |
|
|
|
}, |
|
|
|
changExpandForm(e){ |
|
|
|
console.log(e); |
|
|
|
this.setData({ |
|
|
|
['form.' + e.detail.formNameP+'.'+ e.detail.formName]:e.detail.formValue |
|
|
|
}) |
|
|
@ -1420,7 +1430,23 @@ Page({ |
|
|
|
delete item.optionsV |
|
|
|
}) |
|
|
|
api.submitResi(form).then(res=>{ |
|
|
|
console.log(res); |
|
|
|
if(res.code === 0){ |
|
|
|
wx.showToast({ |
|
|
|
title: '新增成功', |
|
|
|
duration: 3000, |
|
|
|
success: function () { |
|
|
|
setTimeout(() => { |
|
|
|
wx.navigateBack({ |
|
|
|
delta: 1 |
|
|
|
}) |
|
|
|
}, 3000) |
|
|
|
} |
|
|
|
}) |
|
|
|
}else{ |
|
|
|
wx.showToast({ |
|
|
|
title: res.msg, |
|
|
|
}) |
|
|
|
} |
|
|
|
}) |
|
|
|
console.log(this.data.form); |
|
|
|
} |
|
|
|