<template>
	<view class="index">
		<!-- <u-navbar :background="background" title-color="#ffffff" back-icon-color="#ffffff" >
			<view class="nav_box">
				
				<view class="nav_boxa" :class="navidx==1?'act':''" @click="navcheck(1)">
					<image :src="navbg" class="nav_boxb"></image>
					<view class="nav_boxa1">户籍信息</view>
				</view>
				<view class="nav_boxa" :class="navidx==0?'act':''" @click="navcheck(0)">
					<image :src="navbg" class="nav_boxb"></image>
					<view class="nav_boxa1">常住信息</view>
				</view>
			</view>
			
		</u-navbar> -->
		<p style="height: 20upx; background-color: #f2f2f2;"></p>
		<view class="sous_sear" @click="getSearch">
			<view class="sous_tit">筛选查询</view>
			<input  placeholder="请选择筛选条件" class="sous_input" disabled/>
			<image :src="searimg" class="sous_img"></image>
		</view>
		<p style="height: 28upx; background-color: #f2f2f2;"></p>
		<!-- <div class="tabld">
			<view :class="[currentTab==index ? 'one_tabhu ' : '']" v-for="(item,index) in tabsta" :key="index" @click="changeTab(index)">
				<text>{{item.text}}</text>
				<text style="color: #AAAAAA;">{{item.nume}}</text>
			</view>
		</div> -->
		<div class="tabld">
			<view  :class="navidx==1?'one_tabhu':''" @click="navcheck(1)">
				<text>户籍信息</text>
			</view>
			<view  :class="navidx==0?'one_tabhu':''" @click="navcheck(0)">
				<text>常驻信息</text>
			</view>
		</div>
		
		<view class="tab">
			<!-- //表格 -->
			<view class="exele">

				<view class="box">
					<table @change="change">
						<tr class="tr_one">
							<!-- <th style="width: 130upx; text-align: center;">编号</th> -->
							<th style="width: 100upx; text-align: center;">姓名</th>
							<th style="width: 80upx; text-align: center;">性别</th>
							<th style="width: 270upx; text-align: center;">身份证号</th>
							<th style="width: 170upx; text-align: center;">联系方式</th>
							<!-- <th style="width: 100upx;">联系方式</th> -->
							<th style="width: 50upx; text-align: center;">操作</th>
							<!-- <th style="width: 60upx;">查看</th> -->
						</tr>
						<view class="scrollbox">
						
						<scroll-view scroll-y class="scroll-view" upper-threshold="40" lower-threshold="40" @scrolltolower="bot_btn">
							<tr v-for="(item,index) in list" :key="index" :class=" [index%2  ==0 ? 'two_tr two_trtwo':'two_tr']" @click="chakn(item)">
								<!-- <td style="width: 130upx; text-align: center;" >{{ item.code == null ? '暂无信息' :  item.code}}</td> -->
								<td style="width: 100upx; text-align: center;" >{{ item.userName == null ? '暂无信息' :  item.userName}}</td>
								<td style="width: 80upx; text-align: center;" >{{ item.gender == null ? '暂无信息' :  item.gender}}</td>
								<!-- <td style="width: 40upx; text-align: center;">{{item.gender == null? '暂无信息' : item.gender }}</td> -->
								<td style="width: 270upx; text-align: center;">{{item.idCard == null? '暂无信息' : item.idCard }}</td>
								<td style="width: 170upx; text-align: center;" >{{ item.phoneNum == null? '暂无信息' :  item.phoneNum}}</td>
								<!-- <td style="width: 100upx;" :class="[item.phone == '' ? 'tdse' : '' ]" >{{ item.phone == ''? '未完善' : item.phone}}</td> -->
								<!-- <td style="width: 100upx; text-align: center;" :class="[item.addtime == null ? 'tdse' : item.addtime == ''? 'tdse' : ''  ]">{{ item.addtime ==null ? '未完善' :  item.addtime==''? '未完善' : item.addtime}}</td> -->
								<!-- <td style="width: 50upx;" class="coiu" @click.stop="dele(item.id)">删除</td> -->
								<td style="width: 50upx; color: #32B16C;" @click.stop="goDetail(item)">查看</td>
							</tr>
							<div class="shax" v-if="list.length>0">
								{{wtdt}}
							</div>
							<div class="zanwu " v-else><span>暂无数据</span></div>	
						</scroll-view>
						<!-- 水印 -->
						<view class="syone" v-if="list.length>0">{{telephone}}</view>
						<view class="sytwo" v-if="list.length>0">{{telephone}}</view>
						<view class="sythree" v-if="list.length>0">{{telephone}}</view>
						</view>
					</table>
				</view>

			</view>
		</view>
		<div class="xinse" @click="addVacFrom">新增户主</div>
		<!-- <div class="xinse" @click.stop="showPicker($event)">选择地址</div> -->
		
		<!-- 弹窗 -->
		<!-- 搜索弹窗 -->
		<view class='bgbox' v-if="searchflag" @click="getSearClose"></view>
		<view class="searfixed" v-if="searchflag">
			<view class="searf_top">
				<view class="searf_topl" @click="getSearClose">
					<image :src="searimg"></image>
				</view>
				<view class="searf_topr" @click="getClearFn">重置</view>
			</view>
			<view class="searf_cen">
				<view class="searf_cenli">
					<view class="searf_cenlitit">身份证号</view>
					<input placeholder="请输入身份证号" type="text" value="" v-model="params.idCard"  class="searf_cenlin"/>
				</view>
				<view class="searf_cenli">
					<view class="searf_cenlitit">人员姓名</view>
					<input placeholder="请输入人员姓名" type="text" value="" v-model="params.userName" class="searf_cenlin"/>
				</view>
				<view class="searf_cenli" v-if="roles">
					<view class="searf_cenlitit">手机号</view>
					<input placeholder="请输入手机号进行查询" maxlength="11" type="number" value="" v-model="params.phoneNum"  class="searf_cenlin"/>
				</view>
				<view class="searf_cenli">
					<view class="searf_cenlitit" v-if="navidx==0">居住地址</view>
					<view class="searf_cenlitit" v-else>户籍地址</view>
					<view class="searf_cenlin" @click="showPicker">
						<view class="addsa" :style="searchresult?'':'color:#AAAAAA;'">{{searchresult||'选择区域'}}</view>
						<image :src="rimg" class="addsimg"></image>
					</view>
				</view>
				<!-- 是否是户主选择 -->
				<view class="searf_cenli">
					<view class="searf_cenlitit">是否户主</view>
					<view class="searf_cenlin" @click="showHouse">
						<view class="addsa" :style="params.houseType?'':'color:#AAAAAA;'">{{params.houseType||'选择是否户主'}}</view>
						<image :src="rimg" class="addsimg"></image>
					</view>
				</view>
				<!-- 是否确认 -->
				<view class="searf_cenli">
					<view class="searf_cenlitit">是否确认</view>
					<view class="searf_cenlin" @click="showSure">
						<view class="addsa" v-if="params.isConfirm" >{{params.isConfirm=='Y'?'是':'否'}}</view>
						<view class="addsa" v-else style="color:#AAAAAA">选择是否确认</view>
						<image :src="rimg" class="addsimg"></image>
					</view>
				</view>
				<!-- 人员类别 -->
				<view class="searf_cenli">
					<view class="searf_cenlitit" style="min-width: 180rpx;">人员类别</view>
					<uni-data-checkbox multiple v-model="keyvalue" :localdata="keycategory" >
					</uni-data-checkbox>
				</view>
			</view>
			<view class="searf_fot" @click="Seach">查询</view>
		</view>
		<view class="bgbox" v-if="houseflag"></view>
		<!-- 是否户主 -->
		<selectPicker ref="houseselet" :list="houselist" title="请选择" @vacChange="vacHouseChange"></selectPicker>
		<!-- 是否确认 -->
		<selectPicker ref="sureselet" :list="surelist" title="请选择" @vacChange="vacSureChange"></selectPicker>
		
		<!-- 选择查看 -->
		<view class="housebox" v-if="houseflag">
			<view class="house_tit">
				<view class="house_titl" @click="getClose">取消</view>
				<view class="house_titc">请选择</view>
				<view class="house_titr"></view>
			</view>
			<view class="houselist" @click="getCheck(0)">查看修改</view>
			<!-- <view class="houselist" @click="getCheck(1)" v-if="housetypflag">查看家庭成员</view> -->
			<view class="houselist" @click="getCheck(1)">查看家庭成员</view>
			<view class="houselist" @click="getCheck(2)" v-if="housetypflag">添加家庭成员</view>
			<view class="houselist" @click="getCheck(3)" v-if="navidx==1&&currentTab!=2">变更记录</view>
		</view>
		<!-- 乡镇 -->
		<!-- <selectPicker ref="townsselet" :list="townslist" title="请选择乡镇" @vacChange="vacTownsChange"></selectPicker> -->
		<!-- 村 -->
		<selectPicker ref="villageselet" :list="villagelist" title="请选择村(居)" @vacChange="vacVillageChange"></selectPicker>

		<selectMorePicker 
					ref="picker" 
					:title="auiPicker.title"
					:layer="auiPicker.layer"
					:titflag='auiPicker.titflag'
					:data="auiPicker.data"
					@callback="pickerCallback"
				></selectMorePicker>
	</view>
</template>

<script>
	import selectPicker from '@/_components/picker/selectPicker.vue'
	import selectMorePicker from '@/_components/picker/selectMorePicker.vue'
	export default {
		components:{selectPicker,selectMorePicker},
		data() {
			return {
				background: {
					backgroundColor: '#009FE8'
				},
				navidx:1,
				navbg:require("@/static/image/titbg.png"),
				searimg:require("@/static/image/icon_mine_listenter.png"),
				closeimg:require("@/static/image/del.png"),
				searchflag:false,
				rimg:require('@/static/image/upr.png'),
				upimg:require("@/static/image/up.png"),
				activeTab: 0, //tab切换
				//列表数据
				list: [],
				roles:false,
				show: false,
				tabsta: [{
						"text": '全部',
						"nume": 0
					},
					{
						"text": '已认领',
						"nume": 0
					},
					{
						"text": '未认领',
						"nume": 0
					},
				],
				currentTab: 0, //tab切换
				Collected: false, //判断已采集未采集   false 已采集  true未采集
				params: { //上拉刷新
					pageNum: 1,
					pageSize: 20,
					idCard:'',
					queryType:'hj',
					houseType:'',
					isConfirm:'',
					userName:'',
					isRl:'',
					phoneNum:'',
					keyCategory:''
				},
				
				villageTowns:'',
				village:'',
				keyword: '',
				haveMore: true,
				wtdt: '上拉加载更多',
				
				listShow: true, //判断是否有数据 true 有
				areaList: {}, //班级数据
				xuan: ['请选择', '请选择', '请选择'],
				columns: [

				],
				cites: [],
				tehu: '请选择班级',
				companyId: '',
				arrbq: [],
				startDate:'选择开始时间',
				endDate:'选择结束时间',
				showtime:false, 
				minDate:0 ,
				maxDate: 0,
				currentDate: 0,
				shwtie:0,
				townslist:[],//乡镇
				villagelist:[],//村,
				villageTownsId:'',
				villageId:'',
				gridIdJz:'',//居住片区
				villagerGroupIdJz:'',//居住片区下一级
				gridId:'',//户籍片区
				villagerGroupId: '',//户籍
				
				searchresult:'',//搜索区域显示
				houselist:[{
					"label": '是',
					"value":0
				},{
					"label": '否',
					"value":1
				}],
				surelist:[{
					"label": '是',
					"value":'Y'
				},{
					"label": '否',
					"value":'N'
				}],
				sureselet:false,
				houseflag:false,
				keyselet:false,
				auiPicker: {
					title: '选择区域',
					layer: null,
					titflag:true,
					data: []
				},
				houseobj:{
					id:'',
					code:''
				},
				housetypflag:false,
				telephone:'',
				keycategory:[],//人员类别
				keyvalue:[],
			};
		},
		onShow() {
			let type = uni.getStorageSync('token')
			if (!type) {
				uni.reLaunch({
					url: '/pages/login/login'
				})
			}else{
				let roles=uni.getStorageSync('roles')||false
				this.roles=roles
			}
			
			// var iutem = new Date().getFullYear() + 1
			// this.maxDate  = new Date(iutem,12,1).getTime()
			// this.minDate= new Date(2017, 10, 1).getTime()
		},
		onLoad(option) {
			
			// 水印
			this.telephone = uni.getStorageSync('phone')||''
			// 水印
			// 获取人员列表
			this.getKeyCateFn()
			// 获取类别
			// var  value=option.value;
			// console.log(value)
			if(option.detail==1){
				this.params.keyCategory=option.text;
				this.keyvalue[0]=option.value
			}
			uni.$on('refreshData',(data) => {
				// this.params.userName='';
				// this.params.deptId='';
				// this.villageTowns='';
				// this.village='';
				// this.villageTownsId='';
				// this.villageId='';
				this.params.pageNum = 1;
				// this.currentTab=0;
				this.list = []
				// 修改 获取列表的
				// 获取统计
				this.getAlllist()
				this.lists(this.params)
			})
			 // this.getTownsFn();
			 this.params.pageNum = 1
			 this.list = []
			 // 修改 获取列表的
			 // 获取统计
			 this.getAlllist()
			 this.lists(this.params)
			 
			 this.getRegionListFirst()
		},
		beforeDestroy() {
			uni.$off("refreshData")
		},
		created() {

		},
		//下拉刷新
		// onPullDownRefresh() {
		// 	wx.showNavigationBarLoading()
		// 	this.params.pageNum = 1
		// 	this.shwtie = 0;
		// 	this.params = { //上拉刷新
		// 			pageSize: 20,
		// 			pageNum: 1,
		// 	}, //查询

		// 	this.keyword = ''
		// 	this.list = []

		// },
		methods: {
			getKeyCateFn(){
				var that = this;
				this.$http.get('system/dict/data/type/key_category').then(res => {
					if (res.code == 200) {
						this.keycategory = res.data.map(v => {
							return {
								text: v.dictLabel,
								value: v.dictValue
							}
						})
					}
				})
			},
			getSearch(){
				this.searchflag=true
			},
			getSearClose(){
				this.searchflag=false
			},
			
			
			getClose(){
				this.houseflag=false
			},
			getSure(){
				this.houseflag=false
			},
			// 查看修改
			getCheck(e){
				this.houseflag=false
				var id=this.houseobj.id;
				var code=this.houseobj.code;
				if(e==0){
					var isnrl=0
					if(this.currentTab==2){
						isnrl=1
					}
					uni.navigateTo({
						url: '/add/pages/addvacfrom/addpeople?id=' + id+'&isnrl='+isnrl+'&navidx='+this.navidx
					})
					// uni.navigateTo({
					// 	url: '/add/pages/addvacfrom/addpeople?id=' + id
					// })
				}else if(e==1){
					if(this.housetypflag){
						uni.navigateTo({
							url: '/home/pages/recordthree/familylist?code='+code
						})
					}else{
						uni.navigateTo({
							url: '/home/pages/recordthree/familylist?code='+code+'&nohousetypflag=1'
						})
					}
					
				}else if(e==2){
					// 添加家庭成员
					uni.navigateTo({
						url: '/add/pages/addvacfrom/addpeople?code='+code
					})
				}else if(e==3){
					uni.navigateTo({
						url: '/home/pages/recordthree/changerecord?id='+id
					})
				}
				
			},
			// 是否户主
			showHouse(){
				this.$refs.houseselet.show()
			},
			//是否确认
			showSure(){
				this.$refs.sureselet.show()
			},
			vacHouseChange(e){
				this.params.houseType=e[0].label;
				//搜索
				// this.list = []
				// this.params.pageNum = 1
				// this.params.pageSize = 20
				// this.lists(this.params);
				// this.getAlllist();
			},
			vacSureChange(e){
				this.params.isConfirm=e[0].value;
				//搜索
				// this.list = []
				// this.params.pageNum = 1
				// this.params.pageSize = 20
				// this.lists(this.params);
				// this.getAlllist();
			},
			
			getRegionListFirst(){
				this.$http.post('boman-system/chinaArea/treeSelect',{pid: 0},true).then(res=>{
					this.auiPicker.data=res.data	
				})
			},
			//显示picker多级联动弹窗
			showPicker(e){
				const _this = this;
				_this.$refs.picker.open().then(function(){
					console.log('picker打开');
				});
			},
			//picker多级联动回调
			pickerCallback(e){
				const _this = this;
				let result = '';
				e.data.forEach(function(item, index){
					if(index==0){
						result += item.name;
					}else{
						result +='/'+ item.name;
					}
				});
				_this.searchresult=result;
				var params={
					idCard:this.params.idCard,
					queryType:this.params.queryType,
					isRl:this.params.isRl,
					houseType:this.params.houseType,
					isConfirm:this.params.isConfirm,
					userName:this.params.userName,
					phoneNum:this.params.phoneNum,
					keyCategory:this.params.keyCategory,
					pageNum:this.params.pageNum,
					pageSize:20
				}
				var length=e.data.length;
				// console.log(this.params.queryType,33)
				// console.log(e,8)
				if(this.params.queryType=='hj'){
					switch (length) {
						case 0:
							break;
						case 1:
							params.provinceId = e.data[0].areaid;
							break;
						case 2:
							params.cityId = e.data[1].areaid;
							break;
						case 3:
							params.regionId = e.data[2].areaid;
							break;
						case 4:
							params.villageTownsId = e.data[3].areaid;
							break;
						case 5:
							params.villageId = e.data[4].areaid;
							break;
						case 6:
							params.gridId = e.data[5].areaid;
							break;
						case 7:
							params.villagerGroupId = e.data[6].areaid;
							break;
						default:
							break;
					}	
				}else{
					switch (length) {
						case 0:
							break;
						case 1:
							params.provinceIdXjd = e.data[0].areaid;
							break;
						case 2:
							params.cityIdXjd = e.data[1].areaid;
							break;
						case 3:
							params.regionIdXjd = e.data[2].areaid;
							break;
						case 4:
							params.villageTownsIdXjd = e.data[3].areaid;
							break;
						case 5:
							params.villageIdXjd = e.data[4].areaid;
							break;
						case 6:
							params.gridIdJz = e.data[5].areaid;
							break;
						case 7:
							params.villagerGroupIdJz = e.data[6].areaid;
							break;
						default:
							break;
					}
				}
				
				//搜索
				// this.list = []
				this.params=JSON.parse(JSON.stringify(params));
				// this.params.pageNum = 1
				// this.params.pageSize = 20
				// this.lists(this.params);
				// this.getAlllist();
			},
			navcheck(e){
				if(this.navidx==e){
					return
				}

				this.navidx=e;
				var params={
					idCard:this.params.idCard,
					queryType:this.params.queryType,
					houseType:this.params.houseType,
					pageNum: 1,
					pageSize: 20,
					isRl:this.params.isRl,
					isConfirm:this.params.isConfirm,
					keyCategory:this.params.keyCategory,
					userName:this.params.userName,
					phoneNum:this.params.phoneNum
				}
				// 判断是不是认领的
				if(e==0){
					params.queryType='cz'
					// 常驻
					for(var i in this.params){
						if(i!='pageNum'&&i!='pageSize'&&i!='isRl'){
							if(i=='provinceId'){
								params.provinceIdXjd=this.params[i]
							}else if(i=='cityId'){
								params.cityIdXjd=this.params[i]
							}else if(i=='regionId'){
								params.regionIdXjd=this.params[i]
							}else if(i=='villageTownsId'){
								params.villageTownsIdXjd=this.params[i]
							}else if(i=='villageId'){
								params.villageIdXjd=this.params[i]
							}else if(i=='gridId'){
								params.gridIdJz=this.params[i]
							}else if(i=='villagerGroupId'){
								params.villagerGroupIdJz=this.params[i]
							}
						}
					}
					// gridIdJz:'',//居住片区
				// villagerGroupIdJz:'',//居住片区下一级
				// gridId:'',//户籍片区
				// villagerGroupId: '',//户籍
				}else{
					// 户籍
					params.queryType='hj'
					for(var i in this.params){
						if(i!='pageNum'&&i!='pageSize'&&i!='isRl'){
							if(i=='provinceIdXjd'){
								params.provinceId=this.params[i]
							}else if(i=='cityIdXjd'){
								params.cityId=this.params[i]
							}else if(i=='regionIdXjd'){
								params.regionId=this.params[i]
							}else if(i=='villageTownsIdXjd'){
								params.villageTownsId=this.params[i]
							}else if(i=='villageIdXjd'){
								params.villageId=this.params[i]
							}else if(i=='gridIdJz'){
								params.gridId=this.params[i]
							}else if(i=='villagerGroupIdJz'){
								params.villagerGroupId=this.params[i]
							}
						}
					}
				}
				
				
				this.list = []
				this.params=JSON.parse(JSON.stringify(params));
				this.$nextTick(function(){
					this.getAlllist()
					if(this.currentTab==2){
						// 未认领
						this.getListRyrlFn();
						return
					}else{
						// 认领
						this.lists(params)
					}
				})
				
				
			},
			getClearFn(){
				// this.params.userName='';
				// this.params.deptId='';
				// this.villageTowns='';
				// this.village='';
				// this.villageTownsId='';
				// this.villageId='';
				this.searchresult='';
				var params={
					pageNum: 1,
					pageSize: 20,
					idCard:'',
					queryType:this.params.queryType,
					isRl:this.params.isRl,
					houseType:'',
					isConfirm:'',
					keyCategory:"",
					userName:'',
					phoneNum:''
				}
				this.keyvalue=[];
				// this.list = []
				this.params=JSON.parse(JSON.stringify(params));
				// this.getAlllist()
				// this.lists(this.params)
			},
			// showTownsSelect(){
			// 	this.$refs.townsselet.show()
			// },
			// showVillageSelect(){
			// 	if(!this.villageTownsId){
			// 		uni.showToast({
			// 			title:"请先选择乡镇",
			// 			icon:"none"
			// 		})
			// 		return
			// 	}
			// 	this.$refs.villageselet.show()
			// },
			// getTownsFn(){
			// 	var that=this;
			// 	that.$http.get('boman-system/dept/list/towns').then(res=>{
			// 		if(res.code&&res.code != 200) {
			// 		}else{
			// 			this.townslist = res.map(v=>{
			// 				return {label: v.deptName,value:v.id}
			// 			})
			// 		}
			// 	})
			// },
			// getVillageFn(){
			// 	var that=this;
			// 	var params={
			// 		deptId:this.villageTownsId
			// 	}
			// 	that.$http.get('boman-system/dept/list/towns',params).then(res=>{
			// 		if(res.code&&res.code != 200) {
			// 		}else{
			// 			this.villagelist = res.map(v=>{
			// 				return {label: v.deptName,value:v.id}
			// 			})
			// 		}
			// 	})
			// },
			// vacTownsChange(e){
			// 	var id = e[0].value;
			// 	if(this.villageTownsId==id){
					
			// 	}else{
			// 		this.villageId='';
			// 		this.village='';
			// 		this.villageTowns=e[0].label;
			// 		this.villageTownsId=e[0].value;
			// 		this.params.deptId=e[0].value
			// 		this.getVillageFn();
			// 		this.list = []
			// 		this.params.pageNum = 1;
			// 		this.getAlllist()
			// 		this.lists(this.params)
			// 	}
			// },
			// vacVillageChange(e){
			// 	var id = e[0].value;
			// 	if(this.villageTownsId==id){
					
			// 	}else{
			// 		this.village=e[0].label;
			// 		this.villageId=e[0].value;
			// 		this.params.deptId=e[0].value
			// 		this.list = []
			// 		this.params.pageNum = 1;
			// 		this.getAlllist()
			// 		this.lists(this.params)
			// 	}
			// },
			getAlllist(){
				// var params={
				// 	userName:this.params.userName,
				// };
				// if(this.villageId){
				// 	params.townId=this.villageTownsId
				// 	params.villageId=this.villageId
				// }else if(this.villageTownsId){
				// 	params.townId=this.villageTownsId
				// }
				return
				
				
				var params={}
				for(var i in this.params){
					if(i!='pageNum'&&i!='pageSize'&&i!='isRl'){
						// if(i=='provinceIdXjd'){
						// 	params.provinceId=this.params[i]
						// }else if(i=='cityIdXjd'){
						// 	params.cityId=this.params[i]
						// }else if(i=='regionIdXjd'){
						// 	params.regionId=this.params[i]
						// }else if(i=='villageTownsIdXjd'){
						// 	params.townId=this.params[i]
						// }else if(i=='villageTownsId'){
						// 	params.townId=this.params[i]
						// }else if(i=='villageIdXjd'){
						// 	params.villageId=this.params[i]
						// }else{
							params[i]=this.params[i]
						// }
					}
				}
				this.$http.post("boman-web-core/core/ryrl/sts", params).then(res => {
					if (res.code == 200) {
						this.tabsta[0].nume = res.data.total;
						this.tabsta[1].nume = res.data.yrl;
						this.tabsta[2].nume = res.data.wrl;
					} else {
						uni.showToast({
							title: res.msg,
							duration: 1000,
							icon: 'none'
						});

					}
				})
			},
			goDetail(e) {
				// 弹窗弹窗
				// 记录选择的
				
				// 判断是不是常驻
				
				if(this.navidx==1){
					// 户籍
					this.houseflag=true;
					this.houseobj.code=e.code;
					this.houseobj.id=e.id;
					if(e.houseType=='是'){
						this.housetypflag=true
					}else{
						this.housetypflag=false
					}
				}else{
					//常驻
					if(e.houseType=='是'){
						this.houseflag=true;
						this.houseobj.code=e.code;
						this.houseobj.id=e.id;
						this.housetypflag=true
					}else{
						this.housetypflag=false
						var isnrl=0
						if(this.currentTab==2){
							isnrl=1
						}
						uni.navigateTo({
							url: '/add/pages/addvacfrom/addpeople?id=' + e.id+'&isnrl='+isnrl+'&navidx='+this.navidx
						})
					}
					// 未认领
					
				}
				
			},
			//查询列表
			
			// 户籍地址
			getListHjFn(params){
				// var params=this.params;
				this.$http.get("boman-web-core/core/czrk/list", params).then(res => {
					//停止下拉加载
					uni.hideNavigationBarLoading()
					uni.stopPullDownRefresh()
					if (res.code == 200) {
						if (res.rows.length < params.pageSize) {
							this.haveMore = false
							this.wtdt='到底了~';
						} else {
							var num=parseInt(res.rows.length)+parseInt(params.pageSize)*parseInt(params.pageNum-1)
							if(num<res.total){
								this.haveMore = true
								this.wtdt='上拉加载更多'
							}else{
								this.haveMore = false
								this.wtdt='到底了~';
							}	
						}
						if(params.pageNum==1){
							this.list = res.rows
						}else{
							this.list = this.list.concat(res.rows) 
						}
					} else {
						uni.showToast({
							title: res.msg,
							duration: 1000,
							icon: 'none'
						});
				
				
					}
				})
			},
			//常驻信息
			getListCzFn(params){
				// console.log(params)
				// var params=this.params;
				this.$http.get("boman-web-core/core/jzdz/list", params).then(res => {
					//停止下拉加载
					uni.hideNavigationBarLoading()
					uni.stopPullDownRefresh()
					if (res.code == 200) {
						if (res.rows.length < params.pageSize) {
							this.haveMore = false
							this.wtdt='到底了~';
						} else {
							var num=parseInt(res.rows.length)+parseInt(params.pageSize)*parseInt(params.pageNum-1)
							if(num<res.total){
								this.haveMore = true
								this.wtdt='上拉加载更多'
							}else{
								this.haveMore = false
								this.wtdt='到底了~';
							}	
						}
						if(params.pageNum==1){
							this.list = res.rows
						}else{
							this.list = this.list.concat(res.rows) 
						}
					} else {
						uni.showToast({
							title: res.msg,
							duration: 1000,
							icon: 'none'
						});
				
				
					}
				})
			},
			// 人员未认领接口
			getListRyrlFn(){
				var params=this.params;
				// 户籍
				if(this.navidx==1){
					this.$http.get("boman-web-core/core/ryrl/listHj", params).then(res => {
						//停止下拉加载
						uni.hideNavigationBarLoading()
						uni.stopPullDownRefresh()
						if (res.code == 200) {
							if (res.rows.length < params.pageSize) {
								this.haveMore = false
								this.wtdt='到底了~';
							} else {
								var num=parseInt(res.rows.length)+parseInt(params.pageSize)*parseInt(params.pageNum-1)
								if(num<res.total){
									this.haveMore = true
									this.wtdt='上拉加载更多'
								}else{
									this.haveMore = false
									this.wtdt='到底了~';
								}	
							}
							if(params.pageNum==1){
								this.list = res.rows
							}else{
								this.list = this.list.concat(res.rows) 
							}
						} else {
							uni.showToast({
								title: res.msg,
								duration: 1000,
								icon: 'none'
							});
					
					
						}
					})
				}else{
					this.$http.get("boman-web-core/core/ryrl/listCz", params).then(res => {
						//停止下拉加载
						uni.hideNavigationBarLoading()
						uni.stopPullDownRefresh()
						if (res.code == 200) {
							if (res.rows.length < params.pageSize) {
								this.haveMore = false
								this.wtdt='到底了~';
							} else {
								var num=parseInt(res.rows.length)+parseInt(params.pageSize)*parseInt(params.pageNum-1)
								if(num<res.total){
									this.haveMore = true
									this.wtdt='上拉加载更多'
								}else{
									this.haveMore = false
									this.wtdt='到底了~';
								}	
							}
							if(params.pageNum==1){
								this.list = res.rows
							}else{
								this.list = this.list.concat(res.rows) 
							}
						} else {
							uni.showToast({
								title: res.msg,
								duration: 1000,
								icon: 'none'
							});
					
					
						}
					})
				}
				// 常驻
				
				
			},
			lists(params) {
				if(this.navidx==1){
					this.getListHjFn(params)
				}else{
					this.getListCzFn(params)
				}
				
				// this.$http.get("boman-web-core/core/ryrl/list", params).then(res => {
				// 	//停止下拉加载
				// 	uni.hideNavigationBarLoading()
				// 	uni.stopPullDownRefresh()
				// 	if (res.code == 200) {
				// 		if (res.rows.length < params.pageSize) {
							// 	this.haveMore = false
							// 	this.wtdt='到底了~';
							// } else {
							// 	var num=parseInt(res.rows.length)+parseInt(params.pageSize)*parseInt(params.pageNum-1)
							// 	if(num<res.total){
							// 		this.haveMore = true
							// 		this.wtdt='上拉加载更多'
							// 	}else{
							// 		this.haveMore = false
							// 		this.wtdt='到底了~';
							// 	}	
							// }
				// 		if(params.pageNum==1){
				// 			this.list = res.rows
				// 		}else{
				// 			this.list = this.list.concat(res.rows) 
				// 		}
				// 	} else {
				// 		uni.showToast({
				// 			title: res.msg,
				// 			duration: 1000,
				// 			icon: 'none'
				// 		});
				
				
				// 	}
				
				
				// })
			},
			//刷新
			bot_btn() {
				if (this.haveMore) {
					this.params.pageNum++
					this.lists(this.params)
				}
			},
			//查看
			chakn(item) {
				// uni.setStorageSync('item', item)
				// wx.navigateTo({
				// 	url: '/pages/home/recordtwo'
				// })
			},
			// 删除
			dele(item){
				this.$http.dele("boman-web-core/core/info/" + item).then(res => {
					if(res.code == 200){
						this.params.pageNum = 1
						this.list = []
						this.getAlllist()
						this.lists(this.params)
					}
				
				})
			},
			//搜索
			Seach() {
				this.list = [];
				this.searchflag=false;
				this.params.pageNum = 1;
				this.params.pageSize=20;
				
				//人员类别
				if(this.keyvalue.length){
					var keyArr=this.keycategory;
					var newKey=[];
					this.keyvalue.forEach((item,idx)=>{
						newKey[idx]=keyArr[item].text
					})
					this.params.keyCategory=newKey.join(',')
				}
				this.getAlllist();
				// 判断tab
				if(this.currentTab==2){
					this.getListRyrlFn()
				}else{
					this.lists(this.params)
				}
				
			},

			//弹
			changeTab(index){
				this.currentTab = index
				this.params.pageNum=1;
				this.params.pageSize=20;
				this.list = []
				if(index == 0){
					this.params.isRl = ''
					this.lists(this.params)
				}else if(index == 1){
					// 已认领
					this.params.isRl = "是"
					this.lists(this.params)
				}else if(index == 2){
					// 未认领
					this.params.isRl = "否"
					this.getListRyrlFn()
				}
				
				
			},
			// formatter(type, value){
			// 	 if (type === 'year') {
			// 	        return `${value}年`;
			// 	      } else if (type === 'month') {
			// 	        return `${value}月`;
			// 	      }
			// 	      return value;
			// },
			// 点击新增
			addVacFrom () {
				uni.navigateTo({
					url: '/add/pages/addvacfrom/addpeople?type=house'
				})
			}


		}
	}
</script>

<style lang="scss" scoped>
	// 水印
	.syone{position: absolute;font-size: 40rpx;color: rgba(0,0,0,0.3);top: 200rpx;left: 50%;transform: translateX(-50%) rotate(45deg);}
	.sytwo{position: absolute;font-size: 40rpx;color: rgba(0,0,0,0.3);top: 420rpx;left: 50%;transform: translateX(-50%) rotate(45deg);}
	.sythree{position: absolute;font-size: 40rpx;color: rgba(0,0,0,0.3);top: 620rpx;left: 50%;transform: translateX(-50%) rotate(45deg);}
	
	.bgbox{position: fixed;left: 0;right: 0;top: 0;bottom: 0;z-index: 999;
    background: rgba(0,0,0,0.5);}
	.housebox{position: fixed;left: 0;right: 0;bottom: 0;z-index: 1000;background: #FFFFFF;border-radius: 30rpx 30rpx 0 0;
	.house_tit{width: 100%;height: 100rpx;position: relative;z-index: 999;background: #F2F2F2;border-radius: 30rpx 30rpx 0 0;display: flex;align-items: center;margin-bottom: 10rpx;
		.house_titl{font-size: 30rpx;color: #333333;flex: 0 0 auto;height: 100rpx;width: 120rpx;text-align: center;line-height:100rpx;}
		.house_titr{flex: 0 0 auto;font-size: 30rpx;color: #197DE0;height:100rpx;width:120rpx;text-align: center;line-height: 100rpx;}
		.house_titc{line-height: 40rpx;font-size: 34rpx;color: #333;padding: 30rpx;box-sizing: border-box;flex: 1;text-align: center;}
	
	}
	.houselist{width: 100%;text-align: center;font-size: 30rpx;color: #333333;line-height: 88rpx;
		&.act{color: #197DE0;}
		&:last-child{padding-bottom: 20rpx;}
	}
	}
	
	
	.nav_box{display: flex;align-items: center;justify-content: center;flex: 1;
		.nav_boxa{position: relative;width: 214rpx;height: 86rpx;
			.nav_boxb{width: 100%;height: 100%;display: none;}
			.nav_boxa1{font-size: 34rpx;font-weight: bold;color: #0678AC;text-align: center;padding-top: 14rpx;box-sizing: border-box;position: absolute;left: 0;top: 0;right: 0;bottom: 0;}
			&.act{color: #FFFFFF;
				.nav_boxb{display: block;}
				.nav_boxa1{color: #FFFFFF;}
			}
		}
	}
	.address{
		display: flex;align-items: center;
		margin-top: 38rpx;
		.addtita{flex: 0 0 auto;font-size: 28rpx;font-weight: bold;
color: #343434;}
		.addressa{
			display: flex;align-items: center;
			flex: 1;
			display: flex;align-items: center;justify-content: flex-end;
			overflow: hidden;
			.addsa{font-size: 26rpx;color: #333333;overflow: hidden;white-space: nowrap;text-overflow: ellipsis;
			flex: 1;text-align: right;
			}
			.addsimg{width: 16rpx;height: 24rpx;margin-left: 10rpx;flex: 0 0 auto;}
			// .adds{
			// 	display: flex;align-items: center;justify-content: flex-start;padding:10rpx 20rpx;min-width: 220rpx;box-sizing: border-box;}
		}
		
		.addclear{color: #EA2929;font-size: 26rpx;flex: 0 0 auto;height: 60rpx;line-height: 60rpx;width: 128rpx;text-align:center}
	}
	
	
	.coie{
		width: 100%;
		box-sizing: border-box;
		padding:  0 33upx;
		.coie_nav{
			border-top: 1upx solid #E5E5E5;
			display: flex;
			flex-wrap: wrap;
			padding-bottom: 28upx;
			p{
				width: 33.33%;
				text-align: center;
				display: flex;
				flex-direction: column;
				margin-top: 53upx;
				span{
					font-size: 28upx;
				}
				i{
					font-size: 28upx;
					color: #333;
					margin-top: 28upx;
				}
			}
		}
	}
	.ieju{
		height: 17upx;
		width: 100%;
		background-color: #eee;
		margin-bottom: 33upx;
	}
	//暂无数据
	.zanwu {
		text-align: center;
		padding-top: 20upx;

		span {
			font-size: 24upx;
		}
	}
	.scrollbox{position: relative;}
	.scroll-view {
		max-height: calc(100vh - 401upx);
	}

	.shax {
		// height: 83upx;
		font-size: 25upx;
		color: #666;
		text-align: center;
	}

	.index {
		// padding-top: 33upx;
		max-height: 100vh;
		.sous {
			padding: 24upx 33upx 0;
			// display: flex;
            
			.input {
				height: 80upx;
				border: 1upx solid #E5E5E5;
				flex: 1;
				margin-right: 28upx;
				padding-left: 10upx;
				box-sizing: border-box;
			}

			button {
				// width: 125upx;
				height: 80upx;
				background-color: #1678FF;
				text-size: 28upx;
				color: #fff;
				text-align: center;
				line-height: 80upx;
			}
		}

		//tab
		.tab {
			padding-top:33upx;
            padding-bottom: 100upx;
			.tabs {
				display: flex;
				padding: 0 20upx;
				box-sizing: border-box;
				height: 111upx;
				justify-content: space-between;
				box-shadow: 0px 7px 7px 0px rgba(229, 229, 229, 0.5);

				.one_tab {
					color: #1678FF !important;
					// width: 140upx;
					// text-align: center;

					// .twotabs {
					// 	font-size: 31upx;
					// 	color: #666666;
					// 	;
					// 	font-weight: 500;
					// }

					// .twosrtabs {
					// 	color: #1678FF;
					// }

					// .twotabstwo {
					// 	font-size: 24upx;
					// 	color: #AAAAAA;
					// }
				}

				.one_tabqie {
					border-bottom: 8upx solid #1678FF;

				}
			}
		}

		//表格
		.exele {
			.box {
				.tr_one {
					display: flex;
					padding: 0 20upx;
					box-sizing: border-box;
					justify-content: space-between;

					th {
						// flex: 1;

						font-size: 24upx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #333333;
						line-height: 14upx;
						overflow: hidden;
						text-overflow: ellipsis;
						white-space: nowrap;
						line-height: 83upx;
						height: 83upx;
					}
				}

				.two_tr {
					display: flex;
					padding: 0 20upx;
					box-sizing: border-box;
					justify-content: space-between;

					td {
						// flex: 1;

						font-size: 24upx;
						font-family: PingFang SC;
						font-weight: 500;
						color: #333333;
						line-height: 83upx;
						height: 83upx;
						overflow: hidden;
						text-overflow: ellipsis;
						white-space: nowrap;

					}

					.tdse {
						color: #E60012 !important;
					}
					.apply_span_xl{
						color: #32B16C !important;
					}
					.apply_span_xltwo{
						color: #ffa200 !important;
					}
					.apply_span_xlfive{
						color: #4c4b4b !important;
					}
					.apply_span_xlthreo{
						color: #f00404 !important;
					}
					.apply_span_xlforu{
						color: #aaaaaa !important;
					}
					// .apply_span_xla{
					// 	color: #1678FF;
					// 	text-decoration: underline ;
					// }

					.coiu {
						color: #EC1717;
					}
				}

				.two_trtwo {
					background-color: #EBEFF2;
				}
			}

		}
	}

	.banj {
		height: 86upx;
		width: 100%;
		// text-align: center;
		line-height: 86upx;
		// background-color: #F6F9FC;
		color: #AAAAAA;
		margin-top: 20upx;
		display: flex;
		justify-content: space-around;
	}
	.apply_box{
		.apply_item_input{
			padding: 0 33upx;
			// border-top: 1upx solid #F4F4F4;
			display: flex;
			height: 68upx;
			align-items: center;
			.apply_span_x{
				font-size: 28upx;
				color: #363535;
				span{
					color: #F22346;
				}
			}
			.input_r{
				font-size: 28upx;
				height: 100%;
				flex: 1;
				text-align: right;
			}
			.input_rtwo{
				line-height:68upx;
			}
			.input_rtwoss{
				color: #1678FF;
			}
			.input_rtwosss{
				color: #FF0000;
			}
		}
		.apply_title_jt{
			height: 130upx;
			border-top: 1upx solid #F4F4F4;
			display: flex;
			justify-content: space-between;
			align-items: center;
			padding: 0 32upx;
			span{
				font-size: 36upx;
				color: #333;
				font-weight: bold;
			}
			.apply_title_btn{
				width: 160upx;
				height: 60upx;
				font-size: 24upx;
				color: #fff;
				display: flex;
				justify-content: center;
				align-items: center;
				background: #FF568C;
				border-radius: 8upx;
				.img{
					width: 30upx;
					height: 30upx;
					margin-right: 10upx;
				}
			}
		}
		.apply_title_jts{
			border:none;
		}
		.apply_title_jt_item{
			border-bottom: 9upx solid #F4F4F4;
			.apply_item_input_qx{
				color: #FF5185;
				height: 100%;
				display: flex;
				justify-content: center;
				align-items: center;
				height: 112upx;
				font-size: 30upx;
			}
		}
		.apply_item_sfz{
			padding: 42upx 20upx;
			border-bottom: 9upx solid #F4F4F4;
			.apply_item_sfz_title{
				font-weight: bold;
				font-size: 34upx;
				margin-bottom: 40upx;
				margin-left: 2upx;
			}
			.apply_item_phones{
				display: flex;
				justify-content: space-between;
				.apply_item_phone{
					width: 340upx;
					height: 218upx;
					.img{
						width: 100%;
						height: 100%;
						border-radius: 20upx;
					}
				}
			}
		}
		.apply_item_zdxx{
			padding: 0 26upx;
			font-size: 34upx;
			font-weight: bold;
			color: #333;
			height: 112upx;
			line-height: 112upx;
			border: 1upx solid #F4F4F4;
		}
		.qt_div{
			height: 112upx;
			border-top: 1upx solid #F4F4F4;
			padding: 0 32upx;
			border-bottom: 9upx solid #F9F9F9;
			.input_l{
				height: 100%;
				font-size: 30upx;
			}
		}
	}
	.tabld{
		display: flex;
		// height: 90upx;
		box-shadow: 0px 7px 5px 0px rgba(218, 218, 218, 0.35);
		view {
			font-size:26upx ;
			font-family: PingFang SC;
			font-weight: 500;
			color: #191919;
			text-align: center;
			flex: 1;
			// line-height: 70upx;
			display: flex;
			flex-direction: column;
			padding: 18rpx 0 20rpx;
		}
		.one_tabhu{
			color: #009FE8;
			position: relative;
		::after{width: 28rpx;height: 6rpx;background: #009FE8;position: absolute;left: 50%;margin-left: -14rpx;bottom: 0;content: "";}
		}
	}
	.nbhe{
		display: flex;
		margin-bottom: 44upx;
		p{
			font-size: 25upx;
			flex: 1;
			padding: 0 77upx;
			display: flex;
			align-items: center;
		}
		p:nth-child(2){
			justify-content: flex-end;
		}
		img{
			width: 31upx;
			height: 29upx;
			margin-right: 11upx;
		}
	}
	.xinse{
		position: fixed;
		width: 100%;
		bottom: 0;
		left: 0;
		font-size: 33upx;
		font-family: PingFang SC;
		font-weight: 500;
		color: #FFFFFF;
		height: 90upx;
		text-align: center;
		line-height: 90upx;
		z-index: 2;
		background: linear-gradient(-40deg, #3C6AF8, #5E8AC6);
	}
	.sous_sear{
		padding: 0rpx 32rpx;background: #FFFFFF;height: 112rpx;box-sizing: border-box;display: flex;align-items: center;
		.sous_tit{font-size: 28rpx;color: #343434;flex: 0 0 auto;}
		.sous_img{width: 18rpx;height: 32rpx;margin-left: 20rpx;flex: 0 0 auto;}
		.sous_input{font-size: 30rpx;color: #AAAAAA;flex: 1;text-align: right;}
	}
	// 搜索条件width: 562rpx;
	.sfixed{min-height: 840rpx;background: #FFFFFF;border-radius: 14rpx;padding: 40rpx 34rpx;box-sizing: border-box;position: fixed;left: 60rpx;right: 60rpx;top: 50%;transform: translateY(-50%);
	z-index: 1100;max-height: calc(100vh - 280rpx);overflow-y: auto;
		.sfixed_tit{font-size: 28rpx;font-weight: bold;color: #343434;line-height: 44rpx;text-align: center;}
		.sfixed_clo{width: 34rpx;height: 34rpx;position: absolute;right: 34rpx;top: 44rpx;}
		.sfixed_box{
			padding-top: 20rpx;
			.sfixed_inp{width: 100%;height: 76rpx;background:#F2F2F2;padding: 0 34rpx;box-sizing: border-box;font-size: 28rpx;color: #333333;margin-top: 30rpx;}
			.sfixed_line{width: 62rpx;height: 6rpx;background: #009FE8;margin: 38rpx auto 32rpx;}
			.sfixed_flex{display: flex;align-items: center;justify-content: space-between;
				.sfixed_a{font-size: 26rpx;font-weight: bold;color: #666666;}
				.sfixed_ar{font-size: 26rpx;font-weight: bold;color: #DF0024;}
			}
		}
		.sfixed_btn{width: 100%;height: 76rpx;background: #00B034;border: 0px solid #00B034;border-radius: 6rpx;font-size: 28rpx;font-weight: bold;
color: #FFFFFF;text-align: center;line-height: 76rpx;margin-top: 62rpx;}
		
	}
	
	
	// 搜索弹窗新
.searfixed{width: 648rpx;background: #FFFFFF;z-index: 1200;position: fixed;right: 0;top: 0;bottom: 0;display: flex;flex-direction: column;
	.searf_top{display: flex;align-items: center;justify-content: space-between;padding:20rpx 34rpx 20rpx 0;margin-bottom: 20rpx;flex:0 0 auto;
		.searf_topl{width: 80rpx;height: 50rpx;display: flex;align-items: center;padding-left: 34rpx;box-sizing: border-box;
			image{width: 18rpx;height: 32rpx;transform: rotate(180deg);}
		}
		.searf_topr{width: 98rpx;height: 42rpx;
background: linear-gradient(-90deg, #3C6AF8, #5E8AC6);
border-radius: 20rpx;font-size: 26rpx;color: #FFFFFF;line-height: 42rpx;text-align: center;}
	}
	.searf_cen{flex: 1;overflow-y: auto;padding: 0 34rpx;
		.searf_cenli{margin-bottom: 40rpx;
			.searf_cenlitit{font-size: 28rpx;font-weight: bold;color: #343434;margin-bottom: 24rpx;}
			.searf_cenlin{width: 100%;height: 70rpx;background: #F2F2F2;border-radius: 34rpx;padding: 0 40rpx;box-sizing: border-box;line-height: 70rpx;font-size: 28rpx;color: #333333;display: flex;align-items: center;overflow: hidden;
			.addsa{flex: 1;font-size: 28rpx;color: #333333;white-space: nowrap;overflow: hidden;text-overflow: ellipsis;}
			.addsimg{width: 32rpx;height: 18rpx;flex: 0 0 auto;}
			}
		}
	
	}
	.searf_fot{width: 100%;height: 90rpx;
background: linear-gradient(-90deg, #3C6AF8, #5E8AC6);line-height: 90rpx;text-align: center;font-weight: bold;
color: #FFFFFF;font-size: 30rpx;}
}
</style>

