// pages/censusEdit/censusEdit.js const app = getApp(); Page({ /** * 页面的初始数据 */ data: { token: '', id: '', name: '',//名字 cardType: null,//证件类型 cardNum: '',//证件号码 birthDay: '',//生日 gender: null,//性别 nation: null,//民族 edu: null,//学历 relation: null,//与户主关系 phoneNum: '', keys: { value: 'dictionaryId', label: 'dictionaryName' }, showPicker: false, dicList: [], currentDicType: -1, date: new Date().getTime(), showDate: false, dateType: -1, academy: '',//就读院校 political: null,//所属党派 religion: null,//宗教信仰 marry: null,//婚姻状况 marryChangeDate: '',//婚变日期 marryDate: '',//初婚日期 insure: null,//社保情况 health: null,//健康状况 jobStatus: '已就业',//就业状况 workPlace: '',//工作单位 jobTitle: '',//工作职务 technical: '',//专业技术职称 speciality: '',//专长 fatherName: '',//父亲 fatherCardNum: '', fatherPhone: '', matherName: '', matherCardNum: '', matherPhone: '', censusAddress: null,//户籍地址 censusDetail: '',//户籍详细地址 nativeAddress: '',//籍贯地址 flowDate: '',//流动日期 flowReason: null,//流动原因 flowOtherReason: '',//流动其他原因 isOld: '否',//是否老年人 oldType: null, retireWorkUnit: '',//离退休前单位 liveTakeCare: null,//生活照料情况 oldHealthStatus: null,//老年人健康状况 oldSelfCare: null,//老年人生活自理能力 oldLiveStatus: null,//老年人居住状况 isDeformity: '否',//是否为残疾人 deformityType: null,//残疾人类型 deformityLevel: null,//残疾人等级 deformityCardNum: '',//残疾证号 deformityCarNum: '',//残疾车牌 deformityLiveAddress: null,//残疾人居住地址 deformityEarning: null,//残疾人收入情况 deformityHouseSource: null,//残疾人住房来源 cerDate: '',//残疾人办证时间 deformityGuarder: '',//残疾人监护人 deformityGuarderPhone: '',//监护人电话 deformityGuarderRelation: null,//监护人关系 isSoldier: '否',//是否退役 soldierRetireDate: '',//退役日期 soldierRetireLevel: null,//退役时职级 isSocial: '否',//是否社会救助 isLow: '否',//是否低保户 isMedical: '否',//是否医疗救助 isHard: '否',//是否困难 isSubsidy: '否',//是否老龄补贴 isPartyMember: '否',//是否党员 partyName: '',//党组织名称 intoPartyDate: '',//入党时间 partyMemberDesc: '',//党员其他说明 scrollHeight: 0, }, /** * 生命周期函数--监听页面加载 */ onLoad(options) { var _self = this; wx.getStorage({ key: 'token', success: function (res) { _self.setData({ token: res.data, id: options.id }) //获取详情 _self.getDetailData(); } }) let screenHeight = wx.getSystemInfoSync().windowHeight; this.setData({ scrollHeight: screenHeight }) }, //获取详情 getDetailData() { var _self = this; wx.showLoading({ title: '加载中...', }) app.restAjax.get(app.restAjax.path('{reqesutUrl}app/populationinfo/get/' + _self.data.id, [app.personUrl]), null, { headers: { token: _self.data.token } }, function (code, data) { wx.hideLoading(); _self.setDataToView(data); }, function (code, error) { wx.hideLoading(); wx.showToast({ title: '加载失败', success: () => { wx.navigateBack(); } }) }); }, //回显数据 setDataToView(b) { var _self = this; _self.setData({ name: b.name,//姓名 cardType: { label: b.idcardType },//证件类型 cardNum: b.idcard,//证件号码 birthDay: b.birthday,//出生日期 gender: { label: b.sex },//性别 nation: { label: b.nation },//民族 edu: { label: b.education },//文化程度 relation: { label: b.relationship },//与户主关系 phoneNum: b.phone,//联系电话 academy: b.description,//就读院校及专业 political: { label: b.organization },//所属党派 religion: { label: b.religion },//宗教信仰 marry: { label: b.marriageStatus },//婚姻状况 marryChangeDate: b.marriageChangeTime,//婚变日期 marryDate: b.marriageFirstTime,//首次结婚日期 insure: { label: b.socialSecurity },//社保情况 health: { label: b.healthStatus },//健康状况 jobStatus: b.departmentType,//就业状况 workPlace: b.department,//工作单位 jobTitle: b.pastion,//工作职务 technical: b.pastionTitle,//专业技术职称 speciality: b.expertise,//专长 fatherName: b.fatherName, fatherCardNum: b.fatherIdcard, fatherPhone: b.fatherPhone, matherName: b.motherName, matherCardNum: b.motherIdcard, matherPhone: b.motherPhone, censusAddress: { name: b.domicileAreaName, code: b.domicileAreaCode },//户籍地址 censusDetail: b.domicileAddress,//户籍详细地址 nativeAddress: b.originAddress,//籍贯地址 flowDate: _self.checkEmpty(b.flowTime) ? '' : b.flowTime,//流动日期 flowReason: _self.checkEmpty(b.flowReason) ? null : { label: b.flowReason },//流动原因 flowOtherReason: b.flowReasontext,//流动其他原因 isOld: b.isOldage,//是否老年人 oldType: _self.checkEmpty(b.oldageType) ? null : { label: b.oldageType },//老年人类别 retireWorkUnit: b.oldageDepartment,//离退休前单位 liveTakeCare: _self.checkEmpty(b.oldageLift) ? null : { label: b.oldageLift },//生活照料情况 oldHealthStatus: _self.checkEmpty(b.oldageHealthStatus) ? null : { label: b.oldageHealthStatus },//老年人健康状况 oldSelfCare: _self.checkEmpty(b.oldageSelfcare) ? null : { label: b.oldageSelfcare },//生活自理能力 oldLiveStatus: _self.checkEmpty(b.oldageLive) ? null : { label: b.oldageLive },//居住状况 isDeformity: b.isDisability,//是否残疾人 deformityType: _self.checkEmpty(b.disabilityType) ? null : { label: b.disabilityType },//残疾人类别 deformityLevel: _self.checkEmpty(b.disabilityLevel) ? null : { label: b.deformityLevel },//残疾等级 deformityCardNum: b.disabilityNumber,//残疾证号 deformityCarNum: b.disabilityCarnumber,//残疾车牌号 deformityLiveAddress: _self.checkEmpty(b.disabilityAreaCode) ? null : { name: b.disabilityAreaName, code: b.disabilityAreaCode },//残疾居住地址 deformityEarning: _self.checkEmpty(b.disabilityIncome) ? null : { label: b.disabilityIncome },//残疾收入情况 deformityHouseSource: _self.checkEmpty(b.disabilityHouse) ? null : { label: b.disabilityHouse },//残疾住房来源 cerDate: _self.checkEmpty(b.disabilityTime) ? '' : b.disabilityTime,//办证时间 deformityGuarder: b.disabilityGuardian,//监护人 deformityGuarderPhone: b.disabilityGuardianPhone,//监护人联系电话 deformityGuarderRelation: _self.checkEmpty(b.disabilityGuardianRelation) ? null : { label: b.disabilityGuardianRelation },//监护人关系 isSoldier: b.isMilitary,//是否服役 soldierRetireDate: _self.checkEmpty(b.militaryTime) ? '' : b.militaryTime,//退役时间 soldierRetireLevel: _self.checkEmpty(b.militaryPosition) ? null : { label: b.militaryPosition },//服役等级 isSocial: b.isSuccour,//是否社会救助 isLow: b.succourDibao,//是否低保 isMedical: b.succourHelp,//是否医疗救助 isHard: b.succourDifficulty,//是否困难职工 isSubsidy: b.succourSubsidy,//是否老龄补贴 isPartyMember: b.isParty,//是否党员 partyName: b.partyOrganization,//党组织名称 intoPartyDate: _self.checkEmpty(b.partyTime) ? '' : b.partyTime,//入党时间 partyMemberDesc: b.othertext,//入党其他说 }) }, //姓名 inputName(e) { this.setData({ name: e.detail.value }) }, //证件类型 onShowCardType() { var _self = this; _self.getDicList(1, app.dics.dics.DIC_CARD_TYPE); }, //证件号码 inputCardNum(e) { this.setData({ cardNum: e.detail.value }) }, //出生日期 onShowBirthDay() { console.log('点击了') this.setData({ showDate: true, dateType: 1 }) }, //性别 onShowGender() { var _self = this; _self.getDicList(2, app.dics.dics.DIC_GENDER); }, //民族 onShowNation() { this.getDicList(3, app.dics.dics.DIC_NATION); }, //文化程度 onShowEdu() { this.getDicList(4, app.dics.dics.DIC_EDU); }, //与户主关系 onShowRelation() { this.getDicList(5, app.dics.dics.DIC_RELATION); }, //联系电话 inputPhoneNum(e) { this.setData({ phoneNum: e.detail.value }) }, //就读院校 inputAcademy(e) { this.setData({ academy: e.detail.value }) }, //所属党派 onShowPolitical() { this.getDicList(6, app.dics.dics.DIC_POLITICS); }, //宗教信仰 onShowReligion() { this.getDicList(7, app.dics.dics.DIC_RELIGION); }, onShowMarry() { this.getDicList(8, app.dics.dics.DIC_MARRIAGE); }, //婚变日期 onShowMarryChangeDate() { this.setData({ showDate: true, dateType: 2 }) }, //初婚日期 onShowMarryDate() { this.setData({ showDate: true, dateType: 3 }) }, //社保情况 onShowInsure() { this.getDicList(9, app.dics.dics.DIC_INSURE); }, onShowHealth() { this.getDicList(10, app.dics.dics.DIC_HEALTH); }, //就业状况 onSelJobStatus(e) { this.setData({ jobStatus: e.detail.value }) }, //工作单位 inputWorkPlace(e) { this.setData({ workPlace: e.detail.value }) }, //工作职务 inputJobTitle(e) { this.setData({ jobTitle: e.detail.value }) }, //技术职称 inputTechnical(e) { this.setData({ technical: e.detail.value }) }, //专长 inputSpeciality(e) { this.setData({ speciality: e.detail.value }) }, //父亲 inputFather(e) { this.setData({ fatherName: e.detail.value }) }, inputFatherCardNum(e) { this.setData({ fatherCardNum: e.detail.value }) }, inputFatherPhone(e) { this.setData({ fatherPhone: e.detail.value }) }, //母亲 inputMather(e) { this.setData({ matherName: e.detail.value }) }, inputMatherCardNum(e) { this.setData({ matherCardNum: e.detail.value }) }, inputMatherPhone(e) { this.setData({ matherPhone: e.detail.value }) }, //户籍地址 onShowCensus() { wx.navigateTo({ url: '/pages/chooseArea/chooseArea', events: { getBackData: res => { this.setData({ censusAddress: res.backData }) } } }) }, //户籍详细地址 inputCensusDetail(e) { this.setData({ censusDetail: e.detail.value }) }, //籍贯地址 inputNative(e) { this.setData({ nativeAddress: e.detail.value }) }, //流动日期 onShowFlowDate() { this.setData({ showDate: true, dateType: 4 }) }, //流动原因 onShowFlowReason() { this.getDicList(11, app.dics.dics.DIC_FLOW_CAUSE); }, //流动其他原因 inputFlowOtherReason(e) { this.setData({ flowOtherReason: e.detail.value }) }, //是否老人 onSelIsOld(e) { this.setData({ isOld: e.detail.value ? '是' : '否' }) }, onShowOldType() { this.getDicList(12, app.dics.dics.DIC_OLD_TYPE); }, //离退休前单位 inputRetireWorkUnit(e) { this.setData({ retireWorkUnit: e.detail.value }) }, //生活照料情况 onShowLiveTakeCare() { this.getDicList(13, app.dics.dics.DIC_OLD_LIVE_CARE); }, //老年人健康情况 onShowOldHealthStatus() { this.getDicList(14, app.dics.dics.DIC_HEALTH); }, //老年人生活自理能力 onShowOldSelfCare() { this.getDicList(15, app.dics.dics.DIC_OLD_LIVE_ABILITY); }, //老年人居住状况 onShowOldLiveStatus() { this.getDicList(16, app.dics.dics.DIC_OLD_LIVE_HOUSE); }, //是否为残疾人 onSelIsDeformity(e) { this.setData({ isDeformity: e.detail.value ? '是' : '否' }) }, //残疾类别 onShowDeformityType() { this.getDicList(17, app.dics.dics.DIC_DEF_TYPE); }, //残疾等级 onShowDeformityLevel() { this.getDicList(18, app.dics.dics.DIC_DEF_LEVEL); }, //残疾证号 inputDeformityCardNum(e) { this.setData({ deformityCardNum: e.detail.value }) }, //残疾车牌 inputDeformityCarNum(e) { this.setData({ deformityCarNum: e.detail.value }) }, //残疾人居住地址 onShowDeformityLiveAddress() { wx.navigateTo({ url: '/pages/chooseArea/chooseArea?isDefault=true', events: { getDeformityLiveAddress: res => { this.setData({ deformityLiveAddress: res.backData }) } } }) }, //残疾人收入情况 onShowDeformityEarning() { this.getDicList(19, app.dics.dics.DIC_DEF_EARNING); }, //住房来源 onShowDeformityHouseSource() { this.getDicList(20, app.dics.dics.DIC_DEF_HOUSE_SOURCE); }, //残疾人办证时间 onShowCerDate() { this.setData({ showDate: true, dateType: 5 }) }, //残疾人监护人 inputGuarder(e) { this.setData({ deformityGuarder: e.detail.value }) }, //监护人联系电话 inputGuarderPhone(e) { this.setData({ deformityGuarderPhone: e.detail.value }) }, //残疾人监护人关系 onShowGuarderRelation() { this.getDicList(21, app.dics.dics.DIC_GUARDER_RELATION); }, //是否服役/现役 onSelIsSoldier(e) { this.setData({ isSoldier: e.detail.value ? '是' : '否' }) }, //退役日期 onShowSoldierRetireDate() { this.setData({ showDate: true, dateType: 6, }) }, //退役时职级 onShowSoldierRetireLevel() { this.getDicList(22, app.dics.dics.DIC_SOLDIER_LEVEL); }, //是否社会救助 onSelIsSocial(e) { this.setData({ isSocial: e.detail.value ? '是' : '否' }) }, //是否低保户 onShowIsLow(e) { this.setData({ isLow: e.detail.value ? '是' : '否' }) }, //是否医疗救助 onSelIsMedical(e) { this.setData({ isMedical: e.detail.value ? '是' : '否' }) }, //是否困难职工 onSelIsHard(e) { this.setData({ isHard: e.detail.value ? '是' : '否' }) }, //是否老龄补贴 onSelIsSubsidy(e) { this.setData({ isSubsidy: e.detail.value ? '是' : '否' }) }, //是否党员 onSelIsPartyMember(e) { this.setData({ isPartyMember: e.detail.value ? '是' : '否' }) }, //党组织名称 inputPartyName(e) { this.setData({ partyName: e.detail.value }) }, //入党时间 onShowIntoPartyDate() { this.setData({ showDate: true, dateType: 7, }) }, //党员其他说明 inputPartyMemberDesc(e) { this.setData({ partyMemberDesc: e.detail.value }) }, //字典确定 onDicPickerChange(e) { console.log(e) var type = e.target.dataset.type; var label = e.detail.label[0]; var value = e.detail.value[0]; var _self = this; var temp = {}; temp.label = label; temp.value = value; switch (type) { case 1://证件类型 _self.setData({ cardType: temp, showPicker: false, currentDicType: -1, }) break; case 2://性别 _self.setData({ gender: temp, showPicker: false, currentDicType: -1, }) break; case 3://民族 _self.setData({ nation: temp, showPicker: false, currentDicType: -1, }) break; case 4://学历 _self.setData({ edu: temp, showPicker: false, currentDicType: -1 }) break; case 5://户主关系 _self.setData({ relation: temp, showPicker: false, currentDicType: -1 }) break; case 6://党派 _self.setData({ political: temp, showPicker: false, currentDicType: -1 }) break; case 7://宗教信仰 _self.setData({ religion: temp, showPicker: false, currentDicType: -1 }); break; case 8://婚姻状况 _self.setData({ marry: temp, showPicker: false, currentDicType: -1 }) break; case 9://社保情况 _self.setData({ insure: temp, showPicker: false, currentDicType: -1 }) break; case 10://健康状况 _self.setData({ health: temp, showPicker: false, currentDicType: -1 }) break; case 11://流动原因 _self.setData({ flowReason: temp, showPicker: false, currentDicType: -1 }) break; case 12://老人类别 _self.setData({ oldType: temp, showPicker: false, currentDicType: -1 }) break; case 13://生活照料情况 _self.setData({ liveTakeCare: temp, showPicker: false, currentDicType: -1 }) break; case 14://老年人健康状况 _self.setData({ oldHealthStatus: temp, showPicker: false, currentDicType: -1 }) break; case 15://老年人生活自理能力 _self.setData({ oldSelfCare: temp, showPicker: false, currentDicType: -1, }) break; case 16://老年人居住状况 _self.setData({ oldLiveStatus: temp, showPicker: false, currentDicType: -1, }) break; case 17://残疾类别 _self.setData({ deformityType: temp, showPicker: false, currentDicType: -1 }) break; case 18://残疾等级 _self.setData({ deformityLevel: temp, showPicker: false, currentDicType: -1 }) break; case 19://收入情况 _self.setData({ deformityEarning: temp, showPicker: false, currentDicType: -1 }) break; case 20://住房来源 _self.setData({ deformityHouseSource: temp, showPicker: false, currentDicType: -1 }) break; case 21://残疾人监护人关系 _self.setData({ deformityGuarderRelation: temp, showPicker: false, currentDicType: -1 }) break; case 22://服役时等级 _self.setData({ soldierRetireLevel: temp, showPicker: false, currentDicType: -1 }) break; } }, //日期确定 onConfirmDate(e) { var _self = this; var type = e.target.dataset.type; switch (type) { case 1://出生日期 _self.setData({ birthDay: e.detail.value, dateType: -1, showDate: false }) break; case 2://婚变日期 _self.setData({ marryChangeDate: e.detail.value, dateType: -1, showDate: false, }) break; case 3://初婚日期 _self.setData({ marryDate: e.detail.value, dateType: -1, showDate: false }) break; case 4: _self.setData({ flowDate: e.detail.value, dateType: -1, showDate: false }) break; case 5: _self.setData({ cerDate: e.detail.value, dateType: -1, showDate: false }) break; case 6: _self.setData({ soldierRetireDate: e.detail.value, dateType: -1, showDate: false }) break; case 7://入党时间 _self.setData({ intoPartyDate: e.detail.value, dateType: -1, showDate: false }) break; } }, onDicPickerCancel() { this.setData({ showPicker: false, }) }, onCardTypePick(e) { }, onDateChange(e) { }, hideDatePicker() { this.setData({ dateVisibel: false }) }, getDicList(type, id) { console.log(type + "" + id) var _self = this; wx.showLoading({ title: '加载中...', }) _self.setData({ dicList: [] }) app.restAjax.get(app.restAjax.path('{reqesutUrl}app/datadictionary/listdictionarybyparentid/' + id, [app.personUrl]), null, { headers: { token: _self.data.token } }, function (code, data) { wx.hideLoading(); if (data && data.length > 0) { _self.setData({ dicList: data, showPicker: true, currentDicType: type }) } else { wx.showToast({ title: '暂无数据', icon: 'error' }) } }); }, //提交 doConfirm() { var _self = this; var isLegal = _self.checkParams(); if (isLegal) { wx.showLoading({ title: '保存中...', }) var body = { name: _self.data.name,//姓名 idcardType: _self.data.cardType.label,//证件类型 idcard: _self.data.cardNum,//证件号码 birthday: _self.data.birthDay,//出生日期 sex: _self.data.gender.label,//性别 nation: _self.data.nation.label,//民族 education: _self.data.edu.label,//文化程度 relationship: _self.data.relation.label,//与户主关系 phone: _self.data.phoneNum,//联系电话 description: _self.data.academy,//就读院校及专业 organization: _self.data.political.label,//所属党派 religion: _self.data.religion.label,//宗教信仰 marriageStatus: _self.data.marry.label,//婚姻状况 marriageChangeTime: _self.data.marryChangeDate,//婚变日期 marriageFirstTime: _self.data.marryDate,//初婚日期 socialSecurity: _self.data.insure.label,//社保情况 healthStatus: _self.data.health.label,//健康状态 departmentType: _self.data.jobStatus,//就业状况 department: _self.data.workPlace,//工作单位 pastion: _self.data.jobTitle,//工作职务 pastionTitle: _self.data.technical,//专业技术职称 expertise: _self.data.speciality,//专长 fatherName: _self.data.fatherName,//父亲 fatherIdcard: _self.data.fatherCardNum, fatherPhone: _self.data.fatherPhone, motherName: _self.data.matherName, motherIdcard: _self.data.matherCardNum, motherPhone: _self.data.matherPhone, domicileAreaName: _self.data.censusAddress.name,//户籍地址 domicileAreaCode: _self.data.censusAddress.code,//户籍地址 domicileAddress: _self.data.censusDetail,//户籍详细地址 originAddress: _self.data.nativeAddress,//籍贯地址 flowTime: _self.data.flowDate,//流动日期 flowReason: _self.data.flowReason == null ? '' : _self.data.flowReason.label,//流动原因 flowReasontext: _self.data.flowOtherReason,//流动其他原因 isOldage: _self.data.isOld,//是否老年人 oldageType: _self.data.oldType == null ? '' : _self.data.oldType.label,//老年人类别 oldageDepartment: _self.data.retireWorkUnit,//离退休前单位 oldageLift: _self.data.liveTakeCare == null ? '' : _self.data.liveTakeCare.label,//生活照料情况 oldageHealthStatus: _self.data.oldHealthStatus == null ? '' : _self.data.oldHealthStatus.label,//老年人健康状况 oldageSelfcare: _self.data.oldSelfCare == null ? '' : _self.data.oldSelfCare.label,//生活自理能力 oldageLive: _self.data.oldLiveStatus == null ? '' : _self.data.oldLiveStatus.label,//居住状况 isDisability: _self.data.isDeformity,//是否残疾人 disabilityType: _self.data.deformityType == null ? '' : _self.data.deformityType.label,//残疾人类别 disabilityLevel: _self.data.deformityLevel == null ? '' : _self.data.deformityLevel.label,//残疾人等级 disabilityNumber: _self.data.deformityCardNum,//残疾证号 disabilityCarnumber: _self.data.deformityCarNum,//残疾车牌 disabilityAddress: _self.data.deformityLiveAddress == null ? '' : _self.data.deformityLiveAddress.name, disabilityAreaName: _self.data.deformityLiveAddress == null ? '' : _self.data.deformityLiveAddress.name, disabilityAreaCode: _self.data.deformityLiveAddress == null ? '' : _self.data.deformityLiveAddress.code, disabilityIncome: _self.data.deformityEarning == null ? '' : _self.data.deformityEarning.label,//收入情况 disabilityHouse: _self.data.deformityHouseSource == null ? '' : _self.data.deformityHouseSource.label,//住房来源 disabilityTime: _self.data.cerDate,//残疾人办证时间 disabilityGuardian: _self.data.deformityGuarder,//残疾人监护人 disabilityGuardianPhone: _self.data.deformityGuarderPhone,//监护人联系电话 disabilityGuardianRelation: _self.data.deformityGuarderRelation == null ? '' : _self.data.deformityGuarderRelation.label,//监护人关系 isMilitary: _self.data.isSoldier,//是否服役 militaryTime: _self.data.soldierRetireDate,//退役日期 militaryPosition: _self.data.soldierRetireLevel == null ? '' : _self.data.soldierRetireLevel.label,//服役等级 isSuccour: _self.data.isSocial,//是否社会救助 succourDibao: _self.data.isLow,//是否低保 succourHelp: _self.data.isMedical,//是否医疗救助 succourDifficulty: _self.data.isHard,//是否困难职工 succourSubsidy: _self.data.isSubsidy,//是否老龄补贴 isParty: _self.data.isPartyMember,//是否党员 partyOrganization: _self.data.partyName,//党组织名称 partyTime: _self.data.intoPartyDate,//入党时间 othertext: _self.data.partyMemberDesc,//党员其他说明 } app.restAjax.put(app.restAjax.path('{url}app/populationinfo/updatepopulationinfo/' + _self.data.id, [app.personUrl]), body, { headers: { token: _self.data.token } }, function (code, data) { wx.hideLoading() wx.showToast({ title: '保存成功', icon: 'success' }) const eventChannel = _self.getOpenerEventChannel(); eventChannel.emit('doNeedRefresh', { data: true }); wx.navigateBack(); }, (code, data) => { wx.hideLoading() wx.showToast({ title: data.msg ? data.msg : '保存失败', icon: 'error' }) console.log(data) }); } }, //校验参数 checkParams() { var _self = this; var data = _self.data; if (data.name == '') { wx.showToast({ title: '请输入姓名', icon: 'error' }) return false; } if (data.cardType == null) { wx.showToast({ title: '请选择证件类型', icon: 'error' }) return false; } if (data.cardNum == '') { wx.showToast({ title: '请输入证件号码', icon: 'error' }) return false; } if (data.birthDay == '') { wx.showToast({ title: '请选择出生日期', icon: 'error' }) return false; } if (data.gender == null) { wx.showToast({ title: '请选择性别', icon: 'error' }) return false; } if (data.nation == null) { wx.showToast({ title: '请选择民族', icon: 'error' }) return false; } if (data.edu == null) { wx.showToast({ title: '请选择文化程度', icon: 'error' }) return false; } if (data.relation == null) { wx.showToast({ title: '请选择与户主关系', icon: 'none' }) return false; } if (data.phoneNum == '') { wx.showToast({ title: '请输入联系电话', icon: 'error' }) return false; } if (data.political == null) { wx.showToast({ title: '请选择所属党派', icon: 'error' }) return false; } if (data.religion == null) { wx.showToast({ title: '请选择宗教信仰', icon: 'error' }) return false; } if (data.marry == null) { wx.showToast({ title: '请选择婚姻状况', icon: 'error' }) return false; } if (data.insure == null) { wx.showToast({ title: '请选择社保情况', icon: 'error' }) return false; } if (data.health == null) { wx.showToast({ title: '请选择健康状况', icon: 'error' }) return false; } if (data.censusAddress == null) { wx.showToast({ title: '请选择户籍地址', icon: 'error' }) return false; } return true; }, //空值 checkEmpty(str) { return str == null || str == ''; }, })