<template>
	<view class="listPage" :class="{popupShow:popupShow}">
		<view class="fixedheader">
			<headers :showBack="true" :themeType="true">
				<view class="headerName">
					检查台账
				</view>
			</headers>
			<view class="tab flex2" style="background-color: white;">
				<view class="tabType" @click="changeTab(0)" :class="checkedTab==0?'checkedTab':'noCheckTab'">全部</view>
				<view class="tabType" @click="changeTab(2)" :class="checkedTab==2?'checkedTab':'noCheckTab'">待整改</view>
				<view class="tabType" @click="changeTab(3)" :class="checkedTab==3?'checkedTab':'noCheckTab'">待复查</view>
				<view class="tabType" @click="changeTab(4)" :class="checkedTab==4?'checkedTab':'noCheckTab'">待核验</view>
			</view>
			<view class="searchBox" v-if="checkedTab==0">
				<form>
					<view class="uni-form-item">
						<input class="uni-input" name="searchName" v-model="condition.search" placeholder="搜索"
							@input="handleInput" />
						<view class="screen" @click="screenData">筛选</view>
						<view class="screen" style="margin-top: 3px;
							margin-left: 5px;">
							<image src="/static/screenIcon.png" style="width: 15px;height: 15px">
							</image>
						</view>
					</view>
				</form>
			</view>
		</view>
		<view class="content" :style="{paddingTop: mobileTopHeight + 160 + 'px'}">
			<view class="item" v-if="listData.length>0" v-for="(item,index) in listData" :key="index"
				@click="goDetails(item)">
				<view class="item_header">{{item.inspectTime}}</view>
				<view v-if="item.status==2" class="rightStatus" style="background: #5181f6;">待整改</view>
				<view v-if="item.status==3" class="rightStatus" style="background:#ff9810">待复查</view>
				<view v-if="item.status==4" class="rightStatus" style="background:#6554d1">待核验</view>
				<view v-if="item.status==5" class="rightStatus" style="background:#21c28e">合格</view>
				<view v-if="item.status==6" class="rightStatus" style="background:#ccc">已撤回</view>
				<view v-if="item.overTime == true && item.status != 6" class="rightStatus"
					style="background:#ea3941;margin-right: 10px;">超期
				</view>
				<view class="item_title" v-if="item.recordType == 1 ">
					<image src="/static/zlwtIcon.png"></image>安全问题
				</view>
				<view class="item_title" v-if="item.recordType == 2 ">
					<image src="/static/pcjlIcon.png"></image>排查记录
				</view>
				<view class="item_title">{{item.dangerItemContent}}</view>
				<view class="item_content">整改人: {{item.changeName}}</view>
				<view class="item_content">检查人：{{item.inspectManName}}</view>
			</view>
			<view class="new-nodata" v-if="listData.length==0">
				<view></view>
				<text>暂无数据...</text>
			</view>
			<!-- 检查部位 -->
			<tki-tree style="z-index: 9999;" ref="locationTree" @confirm="(val)=>checkPointBtn(val,1)" idKey='id'
				:range="checkPointList" rangeKey="regionName" confirmColor="#4e8af7" :selectParent="true" />


			<!-- 筛选条件弹框 -->
			<uni-popup class="screenDialog" ref="screenShow" :maskClick="true" @change="closeMenu" :show="popupShow">

				<view class="screenContent">
					<scroll-view style="height: 100%;" scroll-y>
						<view class="closeIcon" @click="closeBtn">
							×
						</view>
						<view class="screenTitle">
							筛选条件
						</view>

						<view class="titleItem">检查时间</view>
						<view class="screenItem">
							<view class="screenI" style="width: 140px;position: relative;">
								<dateTimePiccker v-if="inspectStartTime===''" :placeholder="startTime"
									:start="startTime" fields="minute"
									@change="bindPickerChangeStart($event,'startTime')" class="dateTimePiccker">
								</dateTimePiccker>
								<view v-else>{{inspectStartTime}}</view>
								<view v-if="inspectStartTime !=''" @click="showTimePicker(1)"
									style="position: absolute;top: -1vh;left: 34vw;font-size: 16px;">×</view>
							</view>
							<span style="color: gray;margin:6% 5px">一</span>
							<view class="screenI" style="width: 140px;position: relative;">
								<dateTimePiccker v-if="inspectEndTime===''" :placeholder="startTime" :start="startTime"
									fields="minute" @change="bindPickerChangeEnd($event,'startTime')"
									class="dateTimePiccker">
								</dateTimePiccker>
								<view v-else>{{inspectEndTime}}</view>
								<view v-if="inspectEndTime !=''" @click="showTimePicker(2)"
									style="position: absolute;top: -1vh;left: 34vw;font-size: 16px;">×</view>

							</view>
						</view>
						<view class="titleItem">查询类型</view>
						<view class="screenItem">
							<view class="screenText" v-for="(item,index) in searchTypeList" :key="index"
								@click="searchItem(item,index)" :class="{active:chekItm==index}">
								{{item.name}}
							</view>
						</view>
						<view class="titleItem">问题等级</view>
						<view class="screenItem">
							<view class="screenText" v-for="(item,index) in issueLevelList" :key="index"
								@click="searchItem(item,index)" :class="{active:chekItm2==index}">
								{{item.name}}
							</view>
						</view>
						<view class="titleItem">状态</view>
						<view class="screenItem">
							<view class="screenText" v-for="(item,index) in statusList" :key="index"
								@click="searchItem(item,index)" :class="{active:chekItm3==index}">
								{{item.name}}
							</view>
						</view>
						<view class="titleItem">紧急程度</view>
						<view class="screenItem">
							<view class="screenText" v-for="(item,index) in urgencyList" :key="index"
								@click="searchItem(item,index)" :class="{active:chekItm4==index}">
								{{item.name}}
							</view>
						</view>
						<view class="titleItem">整改人</view>
						<view class="screenItem">
							<view v-for="(item, index) in displayedItems1" :key="index" class="screenText"
								@click="searchItem(item,index)" :class="{active:chekItm5==index}">
								{{ item.name }}
							</view>
							<view v-if="!isExpanded1" @click="expandItems(1)" class="screenText">
								查看更多
								<image src="/static/icon-down-ccc.png"
									style="width: 10px;height: 5px;margin-left: 5px;">
								</image>
							</view>
							<view v-else @click="collapseItems(1)" class="screenTextClose">
								收起
							</view>
						</view>
						<view class="titleItem">复查人</view>
						<view class="screenItem">
							<view v-for="(item, index) in displayedItems2" :key="index" class="screenText"
								@click="searchItem(item,index)" :class="{active:chekItm6==index}">
								{{ item.name }}
							</view>
							<view v-if="!isExpanded2" @click="expandItems(2)" class="screenText">
								查看更多
								<image src="/static/icon-down-ccc.png"
									style="width: 10px;height: 5px;margin-left: 5px;">
								</image>
							</view>
							<view v-else @click="collapseItems(2)" class="screenTextClose">
								收起
							</view>
						</view>
						<view class="titleItem">核验人</view>
						<view class="screenItem">
							<view v-for="(item, index) in displayedItems3" :key="index" class="screenText"
								@click="searchItem(item,index)" :class="{active:chekItm7==index}">
								{{ item.name }}
							</view>
							<view v-if="!isExpanded3" @click="expandItems(3)" class="screenText">
								查看更多
								<image src="/static/icon-down-ccc.png"
									style="width: 10px;height: 5px;margin-left: 5px;">
								</image>
							</view>
							<view v-else @click="collapseItems(3)" class="screenTextClose">
								收起
							</view>
						</view>
						<view class="titleItem">检查人</view>
						<view class="screenItem">
							<view v-for="(item, index) in displayedItems4" :key="index" class="screenText"
								@click="searchItem(item,index)" :class="{active:chekItm8==index}">
								{{ item.name }}
							</view>
							<view v-if="!isExpanded4" @click="expandItems(4)" class="screenText">
								查看更多
								<image src="/static/icon-down-ccc.png"
									style="width: 10px;height: 5px;margin-left: 5px;">
								</image>
							</view>
							<view v-else @click="collapseItems(4)" class="screenTextClose">
								收起
							</view>
						</view>

						<view class="titleItem">检查区域 <span class="regionText">
								<picker @click="$refs.locationTree._show()" :disabled="true">
									<view v-if="checkPointName==''" style="margin-left: 140px;color: gray;">
										请选择
									</view>
									<view v-else>
										<view style="width: 98%;text-align: center" class="ellipsis">{{checkPointName}}
										</view>
									</view>
								</picker>
							</span></span>
							<image src="/static/icon-right-ccc.png"
								style="width: 5px;height: 10px;display: inline-block;margin-bottom: 4px;"></image>
						</view>
						<view class="line"></view>

						<view class="footerBtn">
							<view class="foterLeft" @click="resettingBtn">
								重置
							</view>
							<!-- <view class="foterRight" @click="screenShow=false">
							完成
						</view> -->
							<view class="foterRight" @click="closeRed">
								查看{{ listNum }}条记录
							</view>
						</view>
					</scroll-view>
				</view>

			</uni-popup>
			<!-- 检查部位 -->
			<!-- <tki-tree ref="locationTree" @confirm="(val)=>checkPointBtn(val,1)" idKey='id' :range="checkPointList"
				rangeKey="regionName" confirmColor="#4e8af7" /> -->
		</view>
	</view>
</template>

<script>
	import dateTimePiccker from '@/components/dateTimePicker/index.vue'

	export default {
		components: {
			dateTimePiccker,
		},
		data() {
			return {
				mobileTopHeight: 0,
				popupShow: false,
				startTime: '请选择日期',
				searchTypeList: [{
					name: '全部',
					type: 1,
					value: -1
				}, {
					name: '安全问题',
					type: 1,
					value: 1
				}, {
					name: '排查记录',
					type: 1,
					value: 2
				}], //查询类型

				issueLevelList: [{
						name: '全部',
						type: 2,
						value: -1
					},
					{
						name: '一级',
						type: 2,
						value: 1
					},
					{
						name: '二级',
						type: 2,
						value: 2
					},
					{
						name: '三级',
						type: 2,
						value: 3
					}, {
						name: '四级',
						type: 2,
						value: 4
					}
				], //问题等级
				statusList: [{
					name: '全部',
					type: 3,
					value: -1
				}, {
					name: '待整改',
					type: 3,
					value: 2
				}, {
					name: '待复查',
					type: 3,
					value: 3
				}, {
					name: '待核验',
					type: 3,
					value: 4
				}, {
					name: '合格',
					type: 3,
					value: 5
				}, {
					name: '已撤回',
					type: 3,
					value: 6
				}], //状态
				urgencyList: [{
					name: '全部',
					type: 4,
					value: -1
				}, {
					name: '一般',
					type: 4,
					value: 1
				}, {
					name: '严重',
					type: 4,
					value: 2
				}, {
					name: '紧要',
					type: 4,
					value: 3
				}], //紧急程度
				items: [], //人员列表
				itemsList: [], //检查人员
				displayedItems1: [],
				displayedItems2: [],
				displayedItems3: [],
				displayedItems4: [],
				isExpanded1: false,
				isExpanded2: false,
				isExpanded3: false,
				isExpanded4: false,
				valueList: [],
				listNum: 0,
				params: {
					year: true,
					month: true,
					day: true,
					hour: false,
					minute: false,
					second: false
				},
				inspectStartTime: '', //开始
				inspectEndTime: '', //结束
				show: false,
				screenShow: false,
				//------------------------------------
				checkPointList: [], //获取检查部位数据
				checkPointName: '',
				type: 1,
				listData: [],
				checkedTab: 0,
				condition: {
					pageNo: 1,
					pageSize: 10,
					projectSn: "",
					status: 2,
					search: '', //搜索字段
				},
				teach: true,
				userInfo: '',
				regionId: [],
				chekItm: '',
				chekItm2: '',
				chekItm3: '',
				chekItm4: '',
				chekItm5: '',
				chekItm6: '',
				chekItm7: '',
				chekItm8: '',
				sourceIdList: [],
			}
		},
		onLoad(option) {
			this.condition.projectSn = JSON.parse(uni.getStorageSync('projectDetail')).projectSn;
			this.userInfo = JSON.parse(uni.getStorageSync('userInfo'))
			// console.log(JSON.parse(uni.getStorageSync('userInfo')))
			if (option.sourceIdList) {
				this.sourceIdList = JSON.parse(option.sourceIdList);
			}
			this.getCheckPointList();
		},
		mounted() {
			var that = this
			uni.getSystemInfo({
				success(res) {
					that.mobileTopHeight = res.statusBarHeight ? res.statusBarHeight : 0;
					uni.setStorageSync('systemInfo', res)
					console.log(res)
				}
			})
			console.log('this.mobileTopHeight', this.mobileTopHeight)
		},
		onShow() {
			this.listData = [];
			this.condition.pageNo = 1;
			this.condition.pageSize = 10;
			this.getListData();
			this.getPeopleList()
			this.getPeopleData()
		},
		//上拉触底时间
		onReachBottom() {
			if (this.teach) {
				this.condition.pageNo = this.condition.pageNo + 1;
				// this.condition.pageNo = this.condition.pageNo;
				this.getListData();
			}
		},
		methods: {
			//点击重新选择时间
			showTimePicker(type) {
				if (type == 1) {
					this.inspectStartTime = '';

				} else {
					this.inspectEndTime = '';

				}
			},
			closeMenu(e) {
				console.log("关闭！！！！", e)
				if (e.show == false) {
					// this.$refs.screenShow.close()
					this.popupShow = false;
					// this.resettingBtn()
				}
			},
			//关闭筛选
			closeBtn() {
				this.$refs.screenShow.close()

				this.popupShow = false;
				this.resettingBtn()
			},
			//重置
			resettingBtn() {
				this.listData = []
				this.inspectStartTime = ""
				this.inspectEndTime = ""
				this.condition.inspectStartTime = ''
				this.condition.inspectEndTime = ''
				this.condition.recordType = null
				this.condition.level = null
				this.condition.status = null
				this.condition.urgentLevel = null
				this.condition.changeId = null
				this.condition.reviewId = null
				this.condition.verifyManId = null
				this.condition.inspectManId = null
				this.condition.projectSn = this.condition.projectSn
				this.condition.regionId = null
				this.condition.pageNo = 1;
				this.condition.pageSize = 10;
				this.checkPointName = ""
				this.chekItm = 0
				this.chekItm2 = 0
				this.chekItm3 = 0
				this.chekItm4 = 0
				this.chekItm5 = 0
				this.chekItm6 = 0
				this.chekItm7 = 0
				this.chekItm8 = 0
				this.getListData()
			},
			closeRed() {
				this.$refs.screenShow.close()

				this.popupShow = false;
			},
			//点击筛选项
			searchItem(item, index) {

				if (item.type === 1) {
					this.chekItm = index
				}
				if (item.type === 2) {
					this.chekItm2 = index
				}
				if (item.type === 3) {
					this.chekItm3 = index
				}
				if (item.type === 4) {
					this.chekItm4 = index
				}
				if (item.type === 5) {
					this.chekItm5 = index
				}
				if (item.type === 6) {
					this.chekItm6 = index
				}
				if (item.type === 7) {
					this.chekItm7 = index
				}
				if (item.type === 8) {
					this.chekItm8 = index
				}
				if (item.value === -1) {
					this.valueList = this.valueList.filter(v => v.type !== item.type)
					console.log('过滤list :{}', this.valueList.length)
				}
				let isSet = true;

				for (var i = 0; i < this.valueList.length; i++) {
					if (this.valueList[i].type === item.type) {
						this.valueList[i] = item;
						isSet = false;
					}
				}
				if (isSet && item.value !== -1) {
					this.valueList.push(item)
				}
				//点击筛选查看数据
				this.condition.inspectStartTime = this.inspectStartTime
				this.condition.inspectEndTime = this.inspectEndTime
				this.condition.recordType = this.fileValueList(1)
				this.condition.level = this.fileValueList(2)
				this.condition.status = this.fileValueList(3)
				this.condition.urgentLevel = this.fileValueList(4)
				this.condition.changeId = this.fileValueList(5)
				this.condition.reviewId = this.fileValueList(6)
				this.condition.verifyManId = this.fileValueList(7)
				this.condition.inspectManId = this.fileValueList(8)
				this.condition.projectSn = this.condition.projectSn
				this.condition.regionId = this.regionId

				let that = this;
				this.sendRequest({
					url: 'xmgl/xzSecurityQualityInspectionRecord/list',
					method: 'post',
					data: that.condition,
					success: res => {
						that.listData = []
						that.listNum = res.result.page.total
						let arr = JSON.parse(JSON.stringify(that.listData));
						if (res.result.page.records.length > 0) {
							let newArr = arr.concat(res.result.page.records);
							if (res.result.page.records.length < 10) {
								that.teach = false;
							} else {
								that.teach = true;
							}
							that.listData = newArr;
						} else {
							that.teach = false;
						}
					}
				})
				console.log('点击的参数数量 :{}', JSON.stringify(this.valueList))
			},
			fileValueList(type) {
				for (var i = 0; i < this.valueList.length; i++) {
					if (this.valueList[i].type == type) {
						return this.valueList[i].value;
					}
				}
				return null;
			},
			//搜索
			handleInput(e) {
				this.listData = []
				this.inspectStartTime = ""
				this.inspectEndTime = ""
				this.condition.recordType = null
				this.condition.level = null
				this.condition.status = null
				this.condition.urgentLevel = null
				this.condition.changeId = null
				this.condition.reviewId = null
				this.condition.verifyManId = null
				this.condition.inspectManId = null
				this.condition.projectSn = this.condition.projectSn
				this.condition.regionId = null
				this.checkPointName = ""
				this.chekItm = 0
				this.chekItm2 = 0
				this.chekItm3 = 0
				this.chekItm4 = 0
				this.chekItm5 = 0
				this.chekItm6 = 0
				this.chekItm7 = 0
				this.chekItm8 = 0
				this.condition.search = e.detail.value
				let that = this;
				// uni.showLoading({title: '加载中'})
				this.sendRequest({
					url: 'xmgl/xzSecurityQualityInspectionRecord/list',
					method: 'post',
					data: that.condition,
					success: res => {
						console.log(res)
						that.listNum = res.result.page.total
						// uni.hideLoading()
						let arr = JSON.parse(JSON.stringify(that.listData));
						if (res.result.page.records.length > 0) {
							let newArr = arr.concat(res.result.page.records);
							if (res.result.page.records.length < 10) {
								that.teach = false;
							} else {
								that.teach = true;
							}
							that.listData = newArr;
						} else {
							that.teach = false;
						}
					}
				})
			},
			// 展开所有数据
			expandItems(type) {
				let netArr = [];
				let sliceArr = this.items
				if (type == 1) {
					netArr.push({
						name: '全部',
						type: 5,
						value: -1
					})
					sliceArr.forEach(s => {
						netArr.push({
							name: s.realName,
							type: 5,
							value: s.userId
						})

					})
					this.displayedItems1 = netArr;
					this.isExpanded1 = true;
				} else if (type == 2) {
					netArr.push({
						name: '全部',
						type: 6,
						value: -1
					})
					sliceArr.forEach(s => {
						netArr.push({
							name: s.realName,
							type: 6,
							value: s.userId
						})

					})
					this.displayedItems2 = netArr;
					this.isExpanded2 = true;
				} else if (type == 3) {
					netArr.push({
						name: '全部',
						type: 7,
						value: -1
					})
					sliceArr.forEach(s => {
						netArr.push({
							name: s.realName,
							type: 7,
							value: s.userId
						})

					})
					this.displayedItems3 = netArr;
					this.isExpanded3 = true;
				} else {
					netArr.push({
						name: '全部',
						type: 8,
						value: -1
					})
					this.itemsList.forEach(s => {
						netArr.push({
							name: s.realName,
							type: 8,
							value: s.userId
						})

					})
					this.displayedItems4 = netArr;
					this.isExpanded4 = true;
				}


			},
			// 收起数据，只显示前两个
			collapseItems(type) {
				let sliceArr = this.items.slice(0, 2);
				let sliceArr2 = this.itemsList.slice(0, 2)
				let netArr = [];
				if (type == 1) {
					netArr.push({
						name: "全部",
						type: 5,
						value: -1
					})
					sliceArr.forEach(s => {
						netArr.push({
							name: s.realName,
							type: 5,
							value: s.userId
						})

					})
					this.displayedItems1 = netArr;
					this.isExpanded1 = false;
				} else if (type == 2) {
					netArr.push({
						name: "全部",
						type: 6,
						value: -1
					})
					sliceArr.forEach(s => {
						netArr.push({
							name: s.realName,
							type: 6,
							value: s.userId
						})

					})
					this.displayedItems2 = netArr;
					this.isExpanded2 = false;
				} else if (type == 3) {
					netArr.push({
						name: "全部",
						type: 7,
						value: -1
					})
					sliceArr.forEach(s => {
						netArr.push({
							name: s.realName,
							type: 7,
							value: s.userId
						})

					})
					this.displayedItems3 = netArr;
					this.isExpanded3 = false;
				} else {
					netArr.push({
						name: "全部",
						type: 8,
						value: -1
					})
					sliceArr2.forEach(s => {
						netArr.push({
							name: s.realName,
							type: 8,
							value: s.userId
						})

					})
					this.displayedItems4 = netArr;
					this.isExpanded4 = false;
				}
			},
			//筛选开始时间
			bindPickerChangeStart(e, type) {

				if (type == 'startTime') {
					this.inspectStartTime = e.f3;
				}
				let userInfo = {
					type: 9,
					value: -1
				}
				if (this.inspectStartTime && this.inspectEndTime) {
					this.searchItem(userInfo, 1)
				}


			},
			//筛选结束时间
			bindPickerChangeEnd(e, type) {
				if (type == 'startTime') {
					this.inspectEndTime = e.f3;
				}
				let userInfo = {
					type: 10,
					value: -1
				}
				if (this.inspectStartTime && this.inspectEndTime) {
					this.searchItem(userInfo, 1)
				}
			},
			//点击打开筛选
			screenData() {
				this.$refs.screenShow.open()

				this.popupShow = true
				// 默认显示前面2个数据
				let sliceArr = this.items.slice(0, 2);
				let sliceArr2 = this.itemsList.slice(0, 2)
				this.condition.pageNo = 1;
				this.condition.pageSize = 10;
				this.displayedItems1 = []
				this.displayedItems2 = []
				this.displayedItems3 = []
				this.displayedItems4 = []

				this.displayedItems1.push({
					name: '全部',
					type: 5,
					value: -1
				})
				this.displayedItems2.push({
					name: '全部',
					type: 6,
					value: -1
				})
				this.displayedItems3.push({
					name: '全部',
					type: 7,
					value: -1
				})
				this.displayedItems4.push({
					name: '全部',
					type: 8,
					value: -1
				})
				console.log("人员数组：", JSON.stringify(sliceArr))

				sliceArr.forEach(s => {

					this.displayedItems1.push({
						name: s.realName,
						type: 5,
						value: s.userId
					})
					this.displayedItems2.push({
						name: s.realName,
						type: 6,
						value: s.userId
					})
					this.displayedItems3.push({
						name: s.realName,
						type: 7,
						value: s.userId
					})
				})
				sliceArr2.forEach(v => {
					this.displayedItems4.push({
						name: v.realName,
						type: 8,
						value: v.userId
					})
				})


			},
			//获取检查人员列表
			getPeopleData() {
				this.sendRequest({
					url: 'xmgl/systemUser/getSystemUserList',
					method: 'post',
					data: {
						sn: this.condition.projectSn
					},
					success: res => {
						if (res.code == 200) {
							this.itemsList = res.result
						}
					}
				})
			}, //获取人员列表
			getPeopleList() {
				this.sendRequest({
					url: 'xmgl/systemUser/getProjectChilderSystemUserList',
					method: 'post',
					data: {
						projectSn: this.condition.projectSn
					},
					success: res => {
						if (res.code == 200) {
							this.items = res.result
						}
					}
				})
			},
			//--------------------------------------
			//确定选中--回显
			checkPointBtn(val, type) {
				if (type == 1) {

					this.regionId = []
					let arr = JSON.parse(JSON.stringify(val[0].parents));
					let obj = {
						id: val[0].id,
						regionName: val[0].regionName
					};

					arr.push(obj);
					this.regionId.push(obj.id)

					//获取选中的字符串 名称
					var regionName = arr.map(function(item, index) {
						return item.regionName;
					}).join("/");
					this.checkPointName = regionName;
					let userInfo = {
						type: 11,
						value: -1
					}
					this.searchItem(userInfo, 1)
				}
				// this.listData = [];
				// this.getListData()
			},
			//获取检查部位 列表
			getCheckPointList() {
				this.sendRequest({
					url: 'xmgl/qualityRegion/list',
					method: 'post',
					data: {
						projectSn: this.condition.projectSn
					},
					success: res => {
						if (res.code == 200) {
							this.checkPointList = res.result;
						}
					}
				})
			},
			//切换tab
			changeTab(type) {
				if (type == this.checkedTab) return;
				this.checkedTab = type;
				this.condition.status = type;
				this.condition.pageNo = 1;
				this.condition.pageSize = 10;
				this.listData = [];
				this.checkPointName = ''
				this.regionId = []
				this.getListData()
			},
			//获取列表数据
			getListData() {
				if (this.checkedTab == 2 || this.checkedTab == 5) {
					this.condition.changeId = this.userInfo.userId
					this.condition.reviewId = ''
					this.condition.verifyManId = ''
					this.condition.regionId = []
				} else if (this.checkedTab == 3) {
					this.condition.reviewId = this.userInfo.userId
					this.condition.changeId = '';
					this.condition.verifyManId = ''
					this.condition.regionId = []
				} else if (this.checkedTab == 4) {
					this.condition.verifyManId = this.userInfo.userId
					this.condition.changeId = '';
					this.condition.reviewId = ''
					this.condition.regionId = []
				} else if (this.checkedTab == 6) {
					this.condition.status = ''
					this.condition.verifyManId = ''
					this.condition.changeId = '';
					this.condition.reviewId = ''
					this.condition.regionId = this.regionId
				} else {
					this.condition.status = ''
					this.condition.reviewId = '';
					this.condition.changeId = '';
					this.condition.verifyManId = ''
					this.condition.regionId = ''

				}
				console.log('查询列表条件数据', this.checkedTab)
				let that = this;
				// uni.showLoading({title: '加载中'})
				console.log(this.sourceIdList)
				this.sendRequest({
					url: 'xmgl/xzSecurityQualityInspectionRecord/list',
					method: 'post',
					data: {
						...that.condition,
						// recordType: 2,
						// type: 10,
						// engineeringId: this.pointId,
					},
					success: res => {
						console.log(res)
						that.listNum = res.result.page.total
						// uni.hideLoading()
						let arr = JSON.parse(JSON.stringify(that.listData));
						if (res.result.page.records.length > 0) {
							let newArr = arr.concat(res.result.page.records);
							if (res.result.page.records.length < 10) {
								that.teach = false;
							} else {
								that.teach = true;
							}
							that.listData = newArr;
						} else {
							that.teach = false;
						}
					}
				})
			},
			goDetails(obj) {
				// uni.navigateTo({
				//   url: './details?id=' + id + '&type=' + this.checkedTab
				// })
				uni.navigateTo({
					url: './details?id=' + obj.id + '&type=' + obj.status
				})
			}
		}
	}
</script>

<style lang="scss">
	.listPage {
		background: #EFF3F7;
		min-height: 100vh;
	}
	.fixedheader {
		position: fixed;
		top: 0;
		left: 0;
		width: 100%;
		z-index: 2;

		.headerName {
			z-index: 1;
		}
	}

	.line {
		width: 100%;
		height: 1px;
		background-color: #ccc;
		margin-top: 3%;
	}

	.popupShow {
		overflow: hidden;
		position: fixed;
	}

	.screenDialog {
		position: absolute;
		// top: 11%;
		height: 95%;
		/* background: pink; */
		background: white;
		width: 100%;
		border-radius: 20px;
		margin-left: -4%;
		background-color: white;
		/* 设置为半透明的灰色 */
		z-index: 9;
		/* 设置一个较大的 z-index 值，保证遮罩层在最上层 */


		.closeIcon {
			float: right;
			font-size: 25px;
			color: gray;
			margin-right: 3%;
		}

		.screenTitle {
			text-align: center;
			margin-top: 4%;
			font-size: 18px;
			font-weight: 500;
		}

		.uni-popup__wrapper-box {
			height: 70vh;
			overflow: scroll;
			position: fixed;
			bottom: 0,
		}

		.screenContent {
			width: 100vw;
			height: 70%;
			// width: 90%;
			// margin: -65% 0%;
			overflow: scroll;
			// position: relative;
			// margin-top: 180%;
			border-radius: 20px 20px 0 0;
			// margin-left: -4%;
			background-color: white;
			padding-left: 10%;
			position: fixed;
			left: 0;
			bottom: 0;

			.titleItem {
				font-size: 14px;

				.regionText {
					display: inline-block;
					margin-left: 16%;
					width: 190px;
					white-space: nowrap;
					text-overflow: ellipsis;
					overflow: hidden;
				}
			}
		}

		.screenItem {
			display: flex;
			flex-wrap: wrap;

			.screenI {
				width: 100px;
				font-size: 12px;
				height: 30px;
				background: #f7f8fa;
				border-radius: 15px;
				text-align: center;
				line-height: 30px;
				color: gray;
				margin: 5% 0;
			}

			.screenText {
				width: 90px;
				font-size: 12px;
				height: 30px;
				background: #f7f8fa;
				border-radius: 15px;
				text-align: center;
				line-height: 30px;
				color: #000;
				margin: 5% 5% 5% 0%;
			}

			.active {
				width: 90px;
				font-size: 12px;
				height: 30px;
				background: #edf2fe;
				border-radius: 15px;
				text-align: center;
				line-height: 30px;
				color: #000;
				margin: 5% 5% 5% 0%;
				border: 1px solid #5181f6;
			}

			.screenTextClose {
				width: 90px;
				font-size: 12px;
				height: 30px;
				text-align: center;
				line-height: 30px;
				color: #000;
				margin: 5% 5% 5% 0%;
			}
		}

		.footerBtn {
			display: flex;
			text-align: center;
			line-height: 40px;
			margin-top: 2%;
			margin-left: 6%;

			.foterLeft {
				width: 43%;
				background: #f6f7f8;
				height: 40px;
				border-top-left-radius: 20px;
				border-bottom-left-radius: 20px;
				color: #5181f6;
			}

			.foterRight {
				width: 43%;
				background: #5181f6;
				height: 40px;
				border-top-right-radius: 20px;
				border-bottom-right-radius: 20px;
				color: #fff;
			}
		}

	}

	.searchBox {
		background-color: white;
	}

	.uni-form-item {
		position: relative;
		display: flex;
		font-size: 14px;
		/* .search-icon{
			position: absolute;
			top: 50%;
			right: 50rpx;
			transform: translateY(-50%);
		} */
	}

	.uni-input {
		border-radius: 20px;
		margin: 10px 10px;
		background-color: #f7f8fa;
		height: 35px;
		line-height: 30px;
		padding: 0 20px;
		font-size: 14px;
		width: 70%;
	}

	.screen {
		line-height: 50px;
		color: gray;
	}

	.picker {
		margin-bottom: 15px;
		margin-left: 100px;
		width: 164px;
		border: 1px solid #ccc;
		height: 30px;
		border-radius: 10px;
	}

	.flex {
		display: flex;
		align-items: center;
	}

	.flex2 {
		display: flex;
		align-items: center;
		justify-content: space-between;
	}

	.tab {
		width: 100%;
		height: 45px;
		text-align: center;
		box-shadow: 0 0 10px rgba(194, 194, 194, 0.5);
	}

	.tabType {
		width: 33%;
		line-height: 43px;
		border-bottom: 1px solid rgba(194, 194, 194, 0.2);

	}

	.checkedTab {
		color: #498CEC;
		border-bottom: 4rpx solid #498CEC;

	}

	.noCheckTab {
		padding-bottom: 2px;
	}

	.content {
		// padding: 0px 30rpx 0;
		box-sizing: border-box;
		width: 100%;
	}

	.item {
		// height: 330rpx;
		width: 100%;
		padding: 26rpx;
		// box-sizing: border-box;
		// box-shadow: 0 0 10px rgba(194, 194, 194, 0.5);
		border-radius: 4px;
		margin-bottom: 15px;
		color: rgba(51, 51, 51, 1);
		font-size: 32rpx;
		font-family: PingFangSC-Medium;
		background-color: #FFFFFF;

	}

	.rightStatus {
		// margin-top: -18px;
		float: right;
		font-size: 28rpx;
		margin-top: -44rpx;
		width: 120rpx;
		height: 48rpx;
		text-align: center;
		color: #fff;
		line-height: 48rpx;
	}

	.item_title {
		font-weight: 500;
		font-size: 30rpx;
		color: #1A1A1A;
		margin-top: 20rpx;
		display: flex;
		align-items: center;
		> image {
			width: 40rpx;
			height: 40rpx;
			margin-right: 10rpx;
		}
	}

	.item_content {
		width: 100%;
		font-family: PingFangSC-Regular;
		white-space: nowrap;
		text-overflow: ellipsis;
		overflow: hidden;
		color: #999;
		font-size: 28rpx;
		color: #808080;
		margin-top: 20rpx;
	}
	.item_header {
		font-size: 24rpx;
		color: #808080;
	}
	.item_info {
		font-size: 26rpx;
		line-height: 24px;
		font-family: PingFangSC-Regular;
		color: #999;
	}

	.state {
		padding: 0px 8px;
		color: #fff;
		box-sizing: border-box;
		border-radius: 30px;
		font-size: 24rpx;
	}

	.bg1 {
		background-color: rgba(245, 166, 35, 1);
		box-shadow: 0px 2px 0px rgba(242, 76, 50, 0.28);
	}

	.bg2 {
		background-color: rgba(88, 86, 214, 1);
		box-shadow: 0px 2px 0px rgba(87, 81, 217, 0.28);
	}

	.bg3 {
		background-color: rgba(238, 94, 94, 1);
		box-shadow: 0px 2px 0px rgba(236, 92, 98, 0.28);
	}

	.bg4 {
		background-color: rgba(76, 217, 100, 1);
		box-shadow: 0px 2px 0px rgba(68, 219, 94, 0.28);
	}

	.new-nodata {
		position: absolute;
		top: 50%;
		left: 50%;
		transform: translate(-50%, -50%);
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	
		>view {
			width: 300rpx;
			height: 300rpx;
			background-image: url('@/static/staffAttendance/nodata.png');
			background-repeat: no-repeat;
			background-size: 100% 100%;
		}
	
		>text {
			font-size: 22rpx;
			color: #808080;
			margin-top: 60rpx;
		}
	}

	::v-deep .tki-tree-cnt {
		z-index: 99999;
		border-radius: 20px;
	}

	::v-deep .tki-tree-bar {
		border-top-left-radius: 20px;
		border-top-right-radius: 20px;
	}

	::v-deep .placeholder {
		padding-left: 40px;
	}

	.popupShow {
		overflow: hidden;
		position: fixed;
		width: 100%;
	}
</style>