租房申请页面修改

This commit is contained in:
zzyuan 2025-03-03 09:20:02 +08:00
parent 17db37592c
commit 1a725b466b
1 changed files with 585 additions and 103 deletions

View File

@ -11,55 +11,6 @@
<view class="content" v-if="currentTabIndex == 0" style="position: relative;"> <view class="content" v-if="currentTabIndex == 0" style="position: relative;">
<view class="interviewee"> <view class="interviewee">
<view class="form-box" style="border-radius: 10upx;"> <view class="form-box" style="border-radius: 10upx;">
<view v-show="houseApply.userType==2">
<view class="form-item" >
<text class="label"><text style="color: red;">*</text>  :</text>
<view class="ipt-box"><input class="top-t" v-model="houseApply.userName" placeholder="请输入姓名" type="text" maxlength="15"/></view>
</view>
<view class="form-item" >
<text class="label"><text style="color: red;">*</text>联系方式:</text>
<view class="ipt-box"><input class="top-t" v-model="houseApply.phone" placeholder="请输入联系方式" type="text" maxlength="11"/></view>
</view>
<view class="form-item" >
<text class="label"><text style="color: red;">*</text>  :</text>
<view class="ipt-box"><input class="top-t" v-model="houseApply.orgName" placeholder="请输入部门" type="text" maxlength="15"/></view>
</view>
</view>
<view class="form-item" >
<text class="label"><text style="color: red;">*</text>婚姻状况:</text>
<view class="ipt-box select">
<radio-group @change="changeMarriageState" style="display: flex;justify-content: flex-start;align-items: center">
<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in marriageStates" :key="item.id" style="font-size: 26upx;display: flex;justify-content: flex-start;align-items: center;margin-right: 40upx;min-width: 140upx;">
<view>
<radio color="#4db4ea" :value="item.id" :checked="item.id ==houseApply.marriageState"/>
</view>
<view>{{item.name}}</view>
</label>
</radio-group>
</view>
</view>
<view style="margin: 20upx;"><text style="font-size: 28upx;font-weight: bold;"><text style="color: red;">*</text>房查照片(如已婚需要夫妻双方上传房查信息)</text></view>
<view style="font-size: 20upx;margin-left: 40upx;"><text>房查网址</text><text style="color: #0078B8;margin-left: 20upx;" @longpress="copyText" @click="copyText">http://202.103.39.35:9081</text> </view>
<view class="pic" style="border-bottom: 1px solid #eee;">
<view class="img-box">
<view class="img-item" v-for="(item, index) in imgs1" :key="index">
<image class="remove-btn" @click="removeImg(index)" src="/static/icons/delete-icon.png"
mode=""></image>
<image class="img" :src="item.replace(/[\r\n]/g,'')" mode=""></image>
</view>
<view class="img-item upload-btn" @click="chooseImg()" v-if="imgs1.length < 2">
<image class="img" src="/static/imgs/tianjia-img.png" mode=""></image>
</view>
</view>
</view>
<view style="font-size: 28rpx;font-weight: 600;color: red;border-bottom: 1px solid #eee;">互联网信息系统严禁存储传输处理涉及国家秘密企业秘密以及敏感信息违者将严肃问责追责!</view>
<view class="form-item" >
<text class="label"><text style="color: red;">*</text>工作岗位:</text>
<view class="ipt-box"><input class="top-t" v-model="houseApply.position" placeholder="请输入工作岗位" type="text" maxlength="18" /></view>
</view>
<view class="form-item"> <view class="form-item">
<text class="label">人员类别:</text> <text class="label">人员类别:</text>
<view class="ipt-box select"> <view class="ipt-box select">
@ -78,19 +29,108 @@
</picker> </picker>
</view> </view>
</view> </view>
<view class="form-item" v-if="userTypeIndex==1">
<text class="label"><text style="color: red;">*</text>分配房源 </text> <view v-show="houseApply.userType==2">
<text class="infoSpan" @click="houseSelect" style="color:aquamarine;">{{ chosenHouse }}</text> <view class="form-item" >
<text class="label"><text style="color: red;">*</text>住房申请人:</text>
<view class="ipt-box"><input class="top-t" v-model="houseApply.userName" placeholder="请输入姓名" type="text" maxlength="15"/></view>
</view>
<view class="form-item" >
<text class="label"><text style="color: red;">*</text>所在部门:</text>
<view class="ipt-box"><input class="top-t" v-model="houseApply.orgName" placeholder="请输入部门" type="text" maxlength="15"/></view>
</view>
<view class="form-item">
<text class="label"><text style="color: red;">*</text>工作岗位:</text>
<view class="ipt-box"><input class="top-t" v-model="houseApply.position" placeholder="请输入工作岗位" type="text" maxlength="18" /></view>
</view>
<view class="form-item" >
<text class="label"><text style="color: red;">*</text>联系方式:</text>
<view class="ipt-box"><input class="top-t" v-model="houseApply.phone" placeholder="请输入联系方式" type="text" maxlength="11"/></view>
</view>
</view> </view>
<!-- <view class="info-item" v-if="examineBatch>=3||item.houseId">
<text class="label">租金 </text> <view v-show="houseApply.userType==3">
<text class="infoSpan" v-if="!item.houseId">{{ chosenHouseCost }}</text> <view class="form-item" >
<text class="infoSpan" v-if="item.houseId">{{ item.rent }}</text> <text class="label"><text style="color: red;">*</text>住房申请人:</text>
</view> --> <view class="ipt-box"><input class="top-t" v-model="houseApply.userName" placeholder="请输入姓名" type="text" maxlength="15"/></view>
<view class="radio"> </view>
<view class="form-item" >
<text class="label"><text style="color: red;">*</text>联系方式:</text>
<view class="ipt-box"><input class="top-t" v-model="houseApply.phone" placeholder="请输入联系方式" type="text" maxlength="11"/></view>
</view>
</view>
<view class="form-item" v-show="houseApply.userType==1||houseApply.userType==2">
<text class="label"><text style="color: red;">*</text>婚姻状况:</text>
<view class="ipt-box select">
<radio-group @change="changeMarriageState" style="display: flex;justify-content: flex-start;align-items: center">
<label class="uni-list-cell uni-list-cell-pd" v-for="(item, index) in marriageStates" :key="item.id" style="font-size: 26upx;display: flex;justify-content: flex-start;align-items: center;margin-right: 40upx;min-width: 140upx;">
<view>
<radio color="#4db4ea" :value="item.id" :checked="item.id ==houseApply.marriageState"/>
</view>
<view>{{item.name}}</view>
</label>
</radio-group>
</view>
</view>
<!-- 房查照片 -->
<view v-if="houseApply.userType==1||houseApply.userType==2">
<view style="margin: 20upx;"><text style="font-size: 28upx;font-weight: bold;"><text style="color: red;">*</text>房查照片(如已婚需要夫妻双方上传房查信息)</text></view>
<view style="font-size: 20upx;margin-left: 40upx;"><text>房查网址</text><text style="color: #0078B8;margin-left: 20upx;" @longpress="copyText" @click="copyText">http://202.103.39.35:9081</text> </view>
<view class="pic" style="border-bottom: 1px solid #eee;">
<view class="img-box">
<view class="img-item" v-for="(item, index) in imgs1" :key="index">
<image class="remove-btn" @click="removeImg(index)" src="/static/icons/delete-icon.png"
mode=""></image>
<image class="img" :src="item.replace(/[\r\n]/g,'')" mode=""></image>
</view>
<view class="img-item upload-btn" @click="chooseImg()" v-if="imgs1.length < 2">
<image class="img" src="/static/imgs/tianjia-img.png" mode=""></image>
</view>
</view>
</view>
<view style="font-size: 24rpx;font-weight: 600;color: red;border-bottom: 1px solid #eee;padding: 0 20rpx;">互联网信息系统严禁存储传输处理涉及国家秘密企业秘密以及敏感信息违者将严肃问责追责!</view>
</view>
<!-- 身份证复印件 -->
<view>
<view style="margin: 20upx;"><text style="font-size: 28upx;font-weight: bold;"><text style="color: red;">*</text>身份证复印件正反面</text></view>
<view class="pic" style="border-bottom: 1px solid #eee;">
<view class="img-box">
<view class="img-item" v-for="(item, index) in imgs2" :key="index">
<image class="remove-btn" @click="removeImg2(index)" src="/static/icons/delete-icon.png"
mode=""></image>
<image class="img" :src="item.replace(/[\r\n]/g,'')" mode=""></image>
</view>
<view class="img-item upload-btn" @click="chooseImg2()" v-if="imgs2.length < 2">
<image class="img" src="/static/imgs/tianjia-img.png" mode=""></image>
</view>
</view>
</view>
<view style="font-size: 24rpx;font-weight: 600;color: red;border-bottom: 1px solid #eee;padding: 0 20rpx;">互联网信息系统严禁存储传输处理涉及国家秘密企业秘密以及敏感信息违者将严肃问责追责!</view>
</view>
<!-- 附件 -->
<view v-if="houseApply.userType==3">
<view style="margin: 20upx;"><text style="font-size: 28upx;font-weight: bold;">附件</text></view>
<view class="pic" style="border-bottom: 1px solid #eee;">
<view class="img-box">
<view class="img-item" v-for="(item, index) in imgs3" :key="index">
<image class="remove-btn" @click="removeImg3(index)" src="/static/icons/delete-icon.png"
mode=""></image>
<image class="img" :src="item.replace(/[\r\n]/g,'')" mode=""></image>
</view>
<view class="img-item upload-btn" @click="chooseImg3()" v-if="imgs3.length < 2">
<image class="img" src="/static/imgs/tianjia-img.png" mode=""></image>
</view>
</view>
</view>
<view style="font-size: 24rpx;font-weight: 600;color: red;border-bottom: 1px solid #eee;padding: 0 20rpx;">互联网信息系统严禁存储传输处理涉及国家秘密企业秘密以及敏感信息违者将严肃问责追责!</view>
</view>
<view class="radio" v-if="houseApply.userType==1||houseApply.userType==2">
<view class="r-div"> <view class="r-div">
<text class="input_left">申请事由</text> <text class="input_left">申请事由</text>
<!-- <text class="input_right" @click="navTo('/pages/repair-record/repair-record')"><image class="right-img" src="../../static/imgs/liebiao.png"></image></text> -->
</view> </view>
<view class="" style="border-top:0.5px solid #eeeeee;"> <view class="" style="border-top:0.5px solid #eeeeee;">
<view style="width: 100%;height: 200upx;margin: 20upx;color: #666;text-align: left;font-size: 26upx;"> <view style="width: 100%;height: 200upx;margin: 20upx;color: #666;text-align: left;font-size: 26upx;">
@ -98,6 +138,17 @@
</view> </view>
</view> </view>
</view> </view>
<!-- <view class="form-item" v-if="houseApply.userType==2">
<text class="label"><text style="color: red;">*</text>分配房源 </text>
<text class="infoSpan" @click="houseSelect" style="color:aquamarine;">{{ chosenHouse }}</text>
</view> -->
<!-- <view class="info-item" v-if="examineBatch>=3||item.houseId">
<text class="label">租金 </text>
<text class="infoSpan" v-if="!item.houseId">{{ chosenHouseCost }}</text>
<text class="infoSpan" v-if="item.houseId">{{ item.rent }}</text>
</view> -->
</view> </view>
<view class="form-box" style="border-radius: 10upx;"> <view class="form-box" style="border-radius: 10upx;">
@ -176,18 +227,23 @@ export default {
}, },
currentTabIndex:0, currentTabIndex:0,
genders: [{ id: '男', name: '男' }, { id: '女', name: '女' }], 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:[], userTypes:[],
houseTypeList:[], houseTypeList:[],
userTypeIndex:0, userTypeIndex:0,
houseType:[], houseType:[],
houseTypeIndex:0, houseTypeIndex:0,
houseApply:{ houseApply:{
userId: getStorage('userInfo').userId, // userId: getStorage('userInfo').userId,
orgId: getStorage('userInfo').department_id, // orgId: getStorage('userInfo').department_id,
userName: getStorage('userInfo').userName, // userName: getStorage('userInfo').userName,
phone: getStorage('userInfo').mobile, // phone: getStorage('userInfo').mobile,
orgName: getStorage('userInfo').departmentName, // orgName: getStorage('userInfo').departmentName,
userId: "",
orgId: "",
userName: "",
phone: "",
orgName: "",
marriageState: "未婚", marriageState: "未婚",
position: '', position: '',
userType: '', userType: '',
@ -195,9 +251,13 @@ export default {
applyCause: '' applyCause: ''
}, },
reportType:0, reportType:0,
reportList:[], reportList:[],
imgs1: [], imgs1: [],//
imgsId1: [], imgsId1: [],
imgs2: [],//
imgsId2: [],
imgs3: [],//
imgsId3: [],
showAlert:false, showAlert:false,
submitFlag:true, submitFlag:true,
chosenHouse:'请选择房源>', chosenHouse:'请选择房源>',
@ -283,39 +343,57 @@ export default {
submit() { submit() {
if(this.submitFlag){ if(this.submitFlag){
this.submitFlag = false; 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}$/; var regexPhone=/^1[3-9]\d{9}$/;
// //
if (this.houseApply.userType==2) { // if (this.houseApply.userType==2) {
if (JSON.stringify(this.houseInfo) == "{}") { // if (JSON.stringify(this.houseInfo) == "{}") {
alertTip('请先选择房源'); // 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; this.submitFlag = true;
return false; 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) { if (!this.houseApply.userName) {
alertTip('请输入姓名'); alertTip('请输入姓名');
this.submitFlag = true; this.submitFlag = true;
@ -336,14 +414,73 @@ export default {
this.submitFlag = true; this.submitFlag = true;
return false; 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 = { let params = {
method: greenHouseApply, method: greenHouseApply,
data: this.houseApply data: this.houseApply
@ -373,6 +510,10 @@ export default {
this.houseApply.orgName=getStorage('userInfo').departmentName; this.houseApply.orgName=getStorage('userInfo').departmentName;
this.imgs1 = []; this.imgs1 = [];
this.imgsId1 = []; this.imgsId1 = [];
this.imgs2 = [];
this.imgsId2 = [];
this.imgs3 = [];
this.imgsId3 = [];
this.houseInfo = {} this.houseInfo = {}
this.currentTabIndex = 1; this.currentTabIndex = 1;
}, 2000); }, 2000);
@ -382,7 +523,6 @@ export default {
} }
}); });
} }
}, },
// radio // radio
@ -737,6 +877,348 @@ export default {
this.imgs1.splice(index, 1); this.imgs1.splice(index, 1);
this.imgsId1.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 <fnum +1; j++) {
if (j ==fnum) {
let groupBase =base64.slice((j -1) *glength);
console.log(groupBase.length,"groupBaselength");
let uploadParam = {
base64: groupBase,
userId: getStorage(
'userInfo'
)
.userId +
i,
groupEnd: '1'
}
await uploadImg
(
uploadParam)
.then(
resu => {
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 <fnum +1; j++) {
if (j ==fnum) {
let groupBase =base64.slice((j -1) *glength);
console.log(groupBase.length,"groupBaselength");
let uploadParam = {
base64: groupBase,
userId: getStorage(
'userInfo'
)
.userId +
i,
groupEnd: '1'
}
await uploadImg
(
uploadParam)
.then(
resu => {
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() { onReachBottom() {