From 1a725b466b30a118f92d8c655dac2401c979cc95 Mon Sep 17 00:00:00 2001 From: zzyuan <781948537@qq.com> Date: Mon, 3 Mar 2025 09:20:02 +0800 Subject: [PATCH] =?UTF-8?q?=E7=A7=9F=E6=88=BF=E7=94=B3=E8=AF=B7=E9=A1=B5?= =?UTF-8?q?=E9=9D=A2=E4=BF=AE=E6=94=B9?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- pages/house/house.vue | 688 +++++++++++++++++++++++++++++++++++------- 1 file changed, 585 insertions(+), 103 deletions(-) diff --git a/pages/house/house.vue b/pages/house/house.vue index 075405f..1c66be7 100644 --- a/pages/house/house.vue +++ b/pages/house/house.vue @@ -11,55 +11,6 @@ - - - *姓  名: - - - - *联系方式: - - - - *部  门: - - - - - - *婚姻状况: - - - - - - - *房查照片(如已婚需要夫妻双方上传房查信息) - 房查网址:http://202.103.39.35:9081 - - - - - - - - - - - - 互联网信息系统严禁存储、传输、处理涉及国家秘密企业秘密以及敏感信息,违者将严肃问责追责! - - - - *工作岗位: - - 人员类别: @@ -78,19 +29,108 @@ - - *分配房源: - {{ chosenHouse }} + + + + *住房申请人: + + + + *所在部门: + + + + *工作岗位: + + + + *联系方式: + + - - + + + + *住房申请人: + + + + *联系方式: + + + + + + *婚姻状况: + + + + + + + + + + *房查照片(如已婚需要夫妻双方上传房查信息) + 房查网址:http://202.103.39.35:9081 + + + + + + + + + + + + 互联网信息系统严禁存储、传输、处理涉及国家秘密企业秘密以及敏感信息,违者将严肃问责追责! + + + + + *身份证复印件(正反面): + + + + + + + + + + + + 互联网信息系统严禁存储、传输、处理涉及国家秘密企业秘密以及敏感信息,违者将严肃问责追责! + + + + 附件: + + + + + + + + + + + + 互联网信息系统严禁存储、传输、处理涉及国家秘密企业秘密以及敏感信息,违者将严肃问责追责! + + + 申请事由 - @@ -98,6 +138,17 @@ + + + + @@ -176,18 +227,23 @@ export default { }, currentTabIndex:0, genders: [{ id: '男', name: '男' }, { id: '女', name: '女' }], - marriageStates: [{ id: '未婚', name: '未婚' }, { id: '已婚', name: '已婚' }],//,{ id: '离婚', name: '离婚' }, { id: '丧偶', name: '丧偶' } + marriageStates: [{ id: '未婚', name: '未婚' }, { id: '已婚', name: '已婚' },{ id: '其他', name: '其他' }],//,{ id: '离婚', name: '离婚' }, { id: '丧偶', name: '丧偶' } userTypes:[], houseTypeList:[], userTypeIndex:0, houseType:[], houseTypeIndex:0, houseApply:{ - userId: getStorage('userInfo').userId, - orgId: getStorage('userInfo').department_id, - userName: getStorage('userInfo').userName, - phone: getStorage('userInfo').mobile, - orgName: getStorage('userInfo').departmentName, + // userId: getStorage('userInfo').userId, + // orgId: getStorage('userInfo').department_id, + // userName: getStorage('userInfo').userName, + // phone: getStorage('userInfo').mobile, + // orgName: getStorage('userInfo').departmentName, + userId: "", + orgId: "", + userName: "", + phone: "", + orgName: "", marriageState: "未婚", position: '', userType: '', @@ -195,9 +251,13 @@ export default { applyCause: '' }, reportType:0, - reportList:[], - imgs1: [], + reportList:[], + imgs1: [],//房查照片 imgsId1: [], + imgs2: [],//身份证照片 + imgsId2: [], + imgs3: [],//附件 + imgsId3: [], showAlert:false, submitFlag:true, chosenHouse:'请选择房源>', @@ -283,39 +343,57 @@ export default { submit() { if(this.submitFlag){ this.submitFlag = false; - if (!this.houseApply.marriageState) { - alertTip('请选择婚姻状况'); - this.submitFlag = true; - return false; - } - if (!this.houseApply.marriageState) { - alertTip('请选择婚姻状况'); - this.submitFlag = true; - return false; - } - if (this.imgsId1.length==0) { - alertTip('请选择房查照片'); - this.submitFlag = true; - return false; - } - if (this.houseApply.marriageState=='已婚') { - if (this.imgsId1.length==1) { - alertTip('已婚需要上传夫妻双方房查照片'); - this.submitFlag = true; - return false; - } - } - //房查照片 - this.houseApply.roomInspection=this.imgsId1.toString(); var regexPhone=/^1[3-9]\d{9}$/; + //外部人员 选房信息 - if (this.houseApply.userType==2) { - if (JSON.stringify(this.houseInfo) == "{}") { - alertTip('请先选择房源'); + // if (this.houseApply.userType==2) { + // if (JSON.stringify(this.houseInfo) == "{}") { + // alertTip('请先选择房源'); + // this.submitFlag = true; + // return false; + // } + // this.houseApply.houseId = this.houseInfo.UUID; + // } + + if (this.houseApply.userType==1){ + if (!this.houseApply.marriageState) { + alertTip('请选择婚姻状况'); this.submitFlag = true; return false; } - this.houseApply.houseId = this.houseInfo.UUID; + if (this.imgsId1.length==0) { + alertTip('请选择房查照片'); + this.submitFlag = true; + return false; + } + if (this.houseApply.marriageState=='已婚') { + if (this.imgsId1.length==1) { + alertTip('已婚需要上传夫妻双方房查照片'); + this.submitFlag = true; + return false; + } + } + if (this.imgsId2.length==0) { + alertTip('请选择身份证照片'); + this.submitFlag = true; + return false; + } + if (this.imgsId2.length!=2) { + alertTip('需要上传身份证正反两面照片'); + this.submitFlag = true; + return false; + } + + this.houseApply.userId = getStorage('userInfo').userId, + this.houseApply.orgId = getStorage('userInfo').department_id, + this.houseApply.userName = getStorage('userInfo').userName, + this.houseApply.phone = getStorage('userInfo').mobile, + this.houseApply.orgName = getStorage('userInfo').departmentName, + //房查照片 + this.houseApply.roomInspection=this.imgsId1.toString(); + //身份证照片 + + }else if(this.houseApply.userType==2){ if (!this.houseApply.userName) { alertTip('请输入姓名'); this.submitFlag = true; @@ -336,14 +414,73 @@ export default { this.submitFlag = true; return false; } + if (!this.houseApply.position) { + alertTip('请输入工作岗位'); + this.submitFlag = true; + return false; + } + if (!this.houseApply.marriageState) { + alertTip('请选择婚姻状况'); + this.submitFlag = true; + return false; + } + if (this.imgsId1.length==0) { + alertTip('请选择房查照片'); + this.submitFlag = true; + return false; + } + if (this.houseApply.marriageState=='已婚') { + if (this.imgsId1.length==1) { + alertTip('已婚需要上传夫妻双方房查照片'); + this.submitFlag = true; + return false; + } + } + if (this.imgsId2.length==0) { + alertTip('请选择身份证照片'); + this.submitFlag = true; + return false; + } + if (this.imgsId2.length!=2) { + alertTip('需要上传身份证正反两面照片'); + this.submitFlag = true; + return false; + } + //房查照片 + this.houseApply.roomInspection=this.imgsId1.toString(); + //身份证照片 + // this.houseApply. = this.imgsId2.toString(); + }else if(this.houseApply.userType==3){ + if (!this.houseApply.userName) { + alertTip('请输入姓名'); + this.submitFlag = true; + return false; + } + if (!this.houseApply.phone) { + alertTip('请输入联系方式'); + this.submitFlag = true; + return false; + } + if(!regexPhone.test(this.houseApply.phone)){ + alertTip('请确认联系方式手机号是否正确'); + this.submitFlag = true; + return false; + } + if (this.imgsId2.length==0) { + alertTip('请选择身份证照片'); + this.submitFlag = true; + return false; + } + if (this.imgsId2.length!=2) { + alertTip('需要上传身份证正反两面照片'); + this.submitFlag = true; + return false; + } + //身份证照片 + // this.houseApply. = this.imgsId2.toString(); + //附件 + // this.houseApply. = this.imgsId3.toString(); } - if (!this.houseApply.position) { - alertTip('请输入工作岗位'); - this.submitFlag = true; - return false; - } - - let params = { method: greenHouseApply, data: this.houseApply @@ -373,6 +510,10 @@ export default { this.houseApply.orgName=getStorage('userInfo').departmentName; this.imgs1 = []; this.imgsId1 = []; + this.imgs2 = []; + this.imgsId2 = []; + this.imgs3 = []; + this.imgsId3 = []; this.houseInfo = {} this.currentTabIndex = 1; }, 2000); @@ -382,7 +523,6 @@ export default { } }); } - }, //婚姻 radio选择 @@ -737,6 +877,348 @@ export default { this.imgs1.splice(index, 1); this.imgsId1.splice(index, 1); }, + //身份证照片 + async chooseImg2() { + let chec = 0; + let sty = []; + let _this = this; + uni.showActionSheet({ + itemList: ['拍照', '相册'], + success: function(resp) { + chec = resp.tapIndex; + if (chec == 0) { + sty = ['camera']; //从相册相机选择 + } else { + sty = ['album']; //从相册相机选择 + } + uni.chooseImage({ + count: 2, + sizeType: ['compressed'], + sourceType: sty, + quality: 1, + success: async function(res) { + let resData = res.tempFilePaths; + for (let i = 0; i < resData.length; i++) { + if (_this.imgs2.length > 2) { + break; + } + uni.getImageInfo({ + src: resData[i], + success: async (path) => { + convertImgToBase64(path.path, + async function(base64) { + if (_this.imgs2.length < 2) { + // _this.imgs.push(base64); + uni.showLoading({ + title: '图片上传中' + }) + let blength = base64.length; + let glength = 7500; + console.log("base64:",base64) + if (blength <= + glength) { + let uploadParam = { + base64: base64, + userId: getStorage('userInfo').userId +i, + groupEnd: '1' + } + await uploadImg(uploadParam) + .then( + resu => { + resu =resu.data; + uni.hideLoading(); + if (resu.returnCode !=1) { + alertTip(resu.returnMsg); + } else { + _this.imgs2.push(base64); + _this.imgsId2.push(resu.returnData +".jpg"); + } + }); + } else { + let fnum =parseInt(blength /glength); + for (let j =1; j { + resu = + resu + .data; + if (resu + .returnCode == + 1 + ) { + _this + .imgs2 + .push( + base64 + ); + _this + .imgsId2 + .push( + resu + .returnData + + ".jpg" + ); + } else { + uni + .hideLoading(); + alertTip + (resu + .returnMsg + ); + return; + } + } + ); + } else { + let groupBase = + base64 + .slice( + (j - + 1) * + glength, + glength * + j + ); + let uploadParam = { + base64: groupBase, + userId: getStorage( + 'userInfo' + ) + .userId + + i, + groupEnd: '0' + } + await uploadImg + ( + uploadParam) + .then( + resu => { + resu = + resu + .data; + if (resu + .returnCode == + 1 + ) {} else { + uni + .hideLoading(); + alertTip + (resu + .returnMsg + ); + return; + } + } + ); + } + } + uni + .hideLoading(); + } + } + }); + }, + }); + } + } + }); + }, + fail: function(resp) { + console.log(resp.errMsg); + } + }); + }, + //删除身份证照片 + removeImg2(index) { + this.imgs2.splice(index, 1); + this.imgsId2.splice(index, 1); + }, + //附件照片 + async chooseImg3() { + let chec = 0; + let sty = []; + let _this = this; + uni.showActionSheet({ + itemList: ['拍照', '相册'], + success: function(resp) { + chec = resp.tapIndex; + if (chec == 0) { + sty = ['camera']; //从相册相机选择 + } else { + sty = ['album']; //从相册相机选择 + } + uni.chooseImage({ + count: 2, + sizeType: ['compressed'], + sourceType: sty, + quality: 1, + success: async function(res) { + let resData = res.tempFilePaths; + for (let i = 0; i < resData.length; i++) { + if (_this.imgs3.length > 2) { + break; + } + uni.getImageInfo({ + src: resData[i], + success: async (path) => { + convertImgToBase64(path.path, + async function(base64) { + if (_this.imgs3.length < 2) { + // _this.imgs.push(base64); + uni.showLoading({ + title: '图片上传中' + }) + let blength = base64.length; + let glength = 7500; + console.log("base64:",base64) + if (blength <= + glength) { + let uploadParam = { + base64: base64, + userId: getStorage('userInfo').userId +i, + groupEnd: '1' + } + await uploadImg(uploadParam) + .then( + resu => { + resu =resu.data; + uni.hideLoading(); + if (resu.returnCode !=1) { + alertTip(resu.returnMsg); + } else { + _this.imgs3.push(base64); + _this.imgsId3.push(resu.returnData +".jpg"); + } + }); + } else { + let fnum =parseInt(blength /glength); + for (let j =1; j { + resu = + resu + .data; + if (resu + .returnCode == + 1 + ) { + _this + .imgs3 + .push( + base64 + ); + _this + .imgsId3 + .push( + resu + .returnData + + ".jpg" + ); + } else { + uni + .hideLoading(); + alertTip + (resu + .returnMsg + ); + return; + } + } + ); + } else { + let groupBase = + base64 + .slice( + (j - + 1) * + glength, + glength * + j + ); + let uploadParam = { + base64: groupBase, + userId: getStorage( + 'userInfo' + ) + .userId + + i, + groupEnd: '0' + } + await uploadImg + ( + uploadParam) + .then( + resu => { + resu = + resu + .data; + if (resu + .returnCode == + 1 + ) {} else { + uni + .hideLoading(); + alertTip + (resu + .returnMsg + ); + return; + } + } + ); + } + } + uni + .hideLoading(); + } + } + }); + }, + }); + } + } + }); + }, + fail: function(resp) { + console.log(resp.errMsg); + } + }); + }, + //删除附件照片 + removeImg3(index) { + this.imgs3.splice(index, 1); + this.imgsId3.splice(index, 1); + }, }, onReachBottom() {