“yueshang” 1 anno fa
parent
commit
3c6397ed92

+ 459 - 457
pagesA/fire/architecture/index.vue

@@ -1,458 +1,460 @@
-<template>
-	<view class="uni-container uni-container-bg">
-	<view class="example container" :style="'height: ' + (screenHeight - 100) + 'px'">
-			<!-- 搜索框 -->
-			<uni-row class="demo-uni-row padding-tb-sm" :gutter="20" width="100%">
-				<uni-col :span="24">
-					<view class="u-page__tag-item">
-						<u-search placeholder="请输入单位建筑名称" bgColor="#edf6f9" borderColor="#4cb2b6" v-model="keyword"
-							:show-action="true" @custom="search"></u-search>
-					</view>
-				</uni-col>
-			</uni-row>
-			<!-- 下拉框 -->
-			<view class="u-page__tag-item"
-				style="margin-bottom: 26upx;width: 700upx;border-bottom: 2px solid #55cbbf;background-color: #f5f7fa;">
-				<u-form>
-					<u-form-item prop="orgName" @click="
-						showOrg = true;
-						hideKeyboard();
-					" label="单位选择:" labelWidth="100px">
-						<u--input border="none" disabled v-model="formData.orgName" placeholder="请选择所属单位"></u--input>
-						<u-icon slot="right" name="arrow-down"></u-icon>
-					</u-form-item>
-				</u-form>
-			</view>
-			<!-- 卡片栏 -->
-			<view v-if="tableData.length>0 && isLoaded" style="margin-bottom: 120rpx">
-				<view v-for="(item, index) in tableData" :key="index"
-					v-if="formData.orgName === item.orgName || formData.orgId === item.orgId">
-					<uni-card>
-						<!-- 标题 -->
-						<view class="titles">{{ item.buildingName }}</view>
-						<!-- 简要内容 -->
-						<view style="display: flex;margin-bottom: 15rpx; color: #728f90;">
-							<text class="name-align-building">地理位置:</text>
-							<text class="conts">{{ item.dlwz }}</text>
-						</view>
-						<view style="display: flex;margin-bottom: 15rpx; color: #728f90;">
-							<text class="name-align-building">建筑面积:</text>
-							<text class="conts">{{ item.jzmj }}</text>
-						</view>
-						<view style="display: flex;margin-bottom: 15rpx; color: #728f90;">
-							<text class="name-align-building">档案负责人:</text>
-							<text class="conts max-width">{{ item.dafzr }}</text>
-						</view>
-						<view style="display: flex;margin-bottom: 15rpx; color: #728f90;">
-							<text class="name-align-building">重点部位:</text>
-							<text class="conts max-width">{{ item.zdbwpic }}</text>
-						</view>
-						<!-- 删除按钮 -->
-						<view class="an-niu" @click.native="showModal(item)">
-							<view class="detailDel">删除</view>
-						</view>
-						<view class="an-niu" @click.native="onClick(item)" link><text class="detail">查看详情</text></view>
-					</uni-card>
-				</view>
-			</view>
-			<!-- tableData为空时显示  -->
-			<view v-else-if="tableData.length==0 && isLoaded" style="text-align: center;">
-				<view class="text-gray" style="padding-top: 20px;">
-					<img :src="tan90" alt="暂无数据" />
-				</view>
-			</view>
-			<view>
-				<image :src="Group" @click="addClick" class="tiantupian"></image>
-			</view>
-			<u-action-sheet :show="showOrg" :actions="actions" title="请选择单位" @close="showOrg = false"
-				@select="sexSelect"></u-action-sheet>
-			<u-modal :show="show" @confirm="confirm" @cancel="cancel" @close="close" asyncClose closeOnClickOverlay
-				showCancelButton confirmColor="red" :title="title" :content="content" ref="uModal"></u-modal>
-			<!-- 加载中 -->
-			<isLodingModel></isLodingModel>
-		</view>
-	</view>
-</template>
-<script>
-	var that = '';
-	import {
-		getArc, //获取建筑信息列表
-		delArc, //删除建筑信息
-		getOrgId //获取orgId
-	} from '@/api/architecture';
-	import config from '@/config'
-	const baseUrlImg = config.baseUrlImg
-	export default {
-		data() {
-			return {
-				screenHeight: this.$screenHeight,
-				wheight: '',
-				isLoaded: false,
-				Group: `${baseUrlImg}/checkActive/Group.png`,
-				showOrg: false,
-				actions: [],
-				// 数据
-				tableData: {},
-				title: '是否删除该数据项?',
-				content: '确认删除?',
-				id: '',
-				tan90: `${baseUrlImg}/tan90.png`,
-				// 每页数据量
-				pageSize: 5,
-				// 当前页
-				pageNo: 1,
-				// 数据总量
-				total: 0,
-				// tableData数据加载中
-				loading: false,
-				// 初始化时搜索框的值
-				keyword: '',
-				// 存放orgid,orgname
-				formData: {},
-				show: false,
-				showtimeStart: false,
-				showtimeEnd: false
-			};
-		},
-		// 在 vue页面,向起始页通过事件传递数据
-		onLoad: function(option) {
-
-			// this.init();
-		},
-		watch: {
-			loading: {
-				handler(newLength, oldLength) {
-					this.$modal.isLoadingModel(this.loading)
-				},
-				immediate: true
-			}
-		},
-		onShow() {
-			this.actions = []
-			that = this;
-			getOrgId({
-				pageNo: this.pageNo,
-				pageSize: this.pageSize,
-				userId: this.$store.state.user.id
-			}).then(response => {
-				// 取到用户对应的单位名称与id
-				response.data.map(v => {
-					this.actions.push({
-						id: v.dwid,
-						name: v.orgName
-					});
-				});
-				this.formData.orgName = response.data[0].orgName ? response.data[0].orgName : '';
-				this.formData.orgId = response.data[0].dwid;
-				this.tableData = []
-				this.getData();
-			});
-
-		},
-		onReady() {},
-		mixins: [uni.$u.mixin],
-		methods: {
-			search(val) {
-				this.tableData = []
-				this.getData()
-			},
-			async init() {
-				var t = this;
-				t.$.getlocation()
-					.then(res => {
-					})
-					.catch(err => {
-					});
-			},
-			// 模态框内容
-			showModal(val) {
-				this.show = true;
-				this.id = val.id;
-			},
-			confirm() {
-				this.show = false;
-				delArc({
-					id: this.id
-				}).then(response => {
-					this.loading = true;
-					this.isLoaded = false
-					this.tableData = []
-					this.getData();
-				});
-			},
-			close() {
-				this.show = false;
-			},
-			cancel() {
-				this.show = false;
-			},
-			//查看详情
-			addClickDetail(val) {
-				uni.navigateTo({
-					url: `/pagesA/fire/architecture/add_architecture/add_architecture?item=${JSON.stringify(val)}`
-				});
-			},
-			// 获取数据
-			getData() {
-				this.loading = true;
-				// 获取建筑信息详细信息
-				getArc({
-					pageNo: this.pageNo,
-					pageSize: this.pageSize,
-					orgId: this.formData.orgId,
-					buildingName: this.keyword
-				}).then(response => {
-					this.isLoaded = true
-					this.tableData = [...this.tableData, ...response.data.records]
-					this.loading = false
-					this.total=response.data.total
-					// this.tableData = response.data;
-				});
-			},
-
-
-			// 传递数据
-			onClick(val) {
-				this.isLoaded = false
-				uni.navigateTo({
-					url: `/pagesA/fire/architecture/architecture_details/architecture_details?id=${val.id}`,
-					events: {
-						// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
-						acceptDataFromOpenedPage: function(val) {
-						}
-					},
-					success: function(res) {
-						// 通过eventChannel向被打开页面传送数据
-						res.eventChannel.emit('acceptDataFromOpenerPage', val);
-					}
-				});
-			},
-
-			// 删除单位建筑信息
-			onClickDel(val) {
-				this.id = val.id;
-				delArc({
-					id: this.id
-				}).then(response => {
-					this.loading = true;
-					this.isLoaded = false
-					this.tableData = []
-					this.getData();
-				});
-			},
-			addClick() {
-				this.isLoaded = false
-				uni.navigateTo({
-					url: `/pagesA/fire/architecture/add_architecture/add_architecture?&orgName=${this.formData.orgName}&orgId=${this.formData.orgId}`,
-				});
-			},
-
-			sexSelect(e) {
-				this.formData.orgId = e.id;
-				this.formData.orgName = e.name;
-				// 获取建筑信息详细信息
-				getArc({
-					pageNo: this.pageNo,
-					pageSize: this.pageSize,
-					orgId: this.formData.orgId
-				}).then(response => {
-					this.tableData = response.data;
-				});
-			},
-
-			search() {
-				getArc({
-					pageNo: this.pageNo,
-					pageSize: this.pageSize,
-					orgId: this.formData.orgId,
-					buildingName: this.keyword
-				}).then(response => {
-					this.tableData = response.data;
-				});
-			},
-
-			// 触底的事件
-			onReachBottom() {
-				// 判断是否还有下一页数据
-				if (this.pageNo * this.pageSize >= this.total)
-					return uni.showToast({
-						title: `数据加载完毕`
-					});
-				// 判断是否正在请求其它数据,如果是,则不发起额外的请求
-				if (this.loading) return;
-				this.pageNo += 1;
-				this.getData(this.pageNo);
-			},
-
-			// 隐藏键盘
-			hideKeyboard() {
-				uni.hideKeyboard();
-			},
-
-			//日期范围
-			// 开始日期
-			confirmStarttime(e) {
-				this.showtimeStart = false;
-				let value = new Date(e.value);
-				this.formData.start = uni.$u.timeFormat(e.value, 'yyyy/mm/dd');
-			}
-		}
-	};
-</script>
-
-<style lang="scss" scoped>
-	body {
-		background-color: #f5f7f9;
-	}
-	
-	page {
-		background-color: #f5f7f9;
-	}
-	
-	/deep/ .u-tabs__wrapper[data-v-0de61367],
-	.u-tabs__wrapper.data-v-0de61367 {
-		width: 99%;
-	}
-
-	/deep/.u-tabs__wrapper__nav__item[data-v-0de61367],
-	/deep/.u-tabs__wrapper__nav__item.data-v-0de61367,
-	/deep/.u-tabs__wrapper__nav__item {
-		padding: 0 60rpx;
-	}
-
-	.uni-container {
-		height: 100vh;
-		padding-right: 20upx;
-	}
-
-	.addInsp {
-		width: 40px;
-		position: fixed;
-		right: 4px;
-		z-index: 99999;
-	}
-
-	::v-deep .u-icon__icon {
-		margin-right: 0px !important;
-	}
-
-	.an-niu {
-		float: right;
-		font-size: 10px;
-		text-align: center;
-		display: flex;
-		margin-top: -64upx;
-		padding-bottom: 30rpx;
-		// margin-top: 50rpx;
-		color: #fff;
-
-		.detail {
-			width: 60px;
-			height: 60rpx;
-			padding: 0 20rpx;
-			border-radius: 30px;
-			background-color: #f7c41e;
-			margin-right: 20rpx;
-			text-align: center;
-			line-height: 60rpx;
-			font-size: 27upx;
-		}
-
-		.detailDel {
-			width: 60px;
-			height: 60rpx;
-			padding: 0 20rpx;
-			border-radius: 30px;
-			background-color: #ff2e31;
-			color: white;
-			margin-right: 20rpx;
-			text-align: center;
-			line-height: 60rpx;
-			font-size: 30upx;
-		}
-
-		.solve {
-			width: 62px;
-			height: 60rpx;
-			margin-right: 20rpx;
-			border-radius: 30px;
-			background-color: #4cb2b6;
-			line-height: 60rpx;
-		}
-
-		/deep/ .padding-tb-sm {
-			padding-top: 0px;
-			padding-bottom: 10px;
-		}
-
-		.deletes {
-			width: 62px;
-			height: 60rpx;
-			border-radius: 60rpx;
-			background-color: red;
-			color: #fff;
-			line-height: 60rpx;
-		}
-	}
-
-	/deep/.segmented-control__item--button {
-		background-color: rgb(76, 178, 182) !important;
-	}
-
-	/deep/.segmented-control__item--button--active {
-		background-color: #ffffff !important;
-	}
-
-	/deep/.uni-card {
-		box-shadow: 0px 0px 3px 0px rgba(86, 165, 168, 0.63) !important;
-		border-radius: 30rpx;
-	}
-
-	.tiantupian {
-		width: 110rpx;
-		height: 110rpx;
-		position: fixed;
-		right: 15px;
-		bottom: 10rpx;
-	}
-
-	//列表样式
-	.titles {
-		font-weight: 600;
-		margin-bottom: 10rpx;
-		color: black;
-		font-size: 32rpx;
-	}
-
-	/deep/ .u-form-item__body__left__content__label {
-		font-size: 28upx !important;
-	}
-
-	.conts {
-		max-width: 470upx;
-		display: -webkit-box;
-		/*弹性伸缩盒子模型显示*/
-		-webkit-box-orient: vertical;
-		/*排列方式*/
-		-webkit-line-clamp: 1;
-		/*显示文本行数*/
-		overflow: hidden;
-		/*溢出隐藏*/
-		color: #274647;
-		text-overflow: ellipsis;
-	}
-
-	.max-width {
-		max-width: 180upx;
-	}
-
-	/deep/.u-action-sheet {
-		overflow-y: auto;
-		height: 1000rpx;
-		background-color: #fff;
-	}
-
-	.example {
-		overflow-y: auto;
-	}
+<template>
+	<view class="uni-container uni-container-bg">
+	<view class="example container" :style="'height: ' + (screenHeight - 100) + 'px'">
+			<!-- 搜索框 -->
+			<uni-row class="demo-uni-row padding-tb-sm" :gutter="20" width="100%">
+				<uni-col :span="24">
+					<view class="u-page__tag-item">
+						<u-search placeholder="请输入单位建筑名称" bgColor="#edf6f9" borderColor="#4cb2b6" v-model="keyword"
+							:show-action="true" @custom="search"></u-search>
+					</view>
+				</uni-col>
+			</uni-row>
+			<!-- 下拉框 -->
+			<view class="u-page__tag-item"
+				style="margin-bottom: 26upx;width: 700upx;border-bottom: 2px solid #55cbbf;background-color: #f5f7fa;">
+				<u-form>
+					<u-form-item prop="orgName" @click="
+						showOrg = true;
+						hideKeyboard();
+					" label="单位选择:" labelWidth="100px">
+						<u--input border="none" disabled v-model="formData.orgName" placeholder="请选择所属单位"></u--input>
+						<u-icon slot="right" name="arrow-down"></u-icon>
+					</u-form-item>
+				</u-form>
+			</view>
+			<!-- 卡片栏 -->
+			<view v-if="tableData.length>0 && isLoaded" style="margin-bottom: 120rpx">
+				<view v-for="(item, index) in tableData" :key="index"
+					v-if="formData.orgName === item.orgName || formData.orgId === item.orgId">
+					<uni-card>
+						<!-- 标题 -->
+						<view class="titles">{{ item.buildingName }}</view>
+						<!-- 简要内容 -->
+						<view style="display: flex;margin-bottom: 15rpx; color: #728f90;">
+							<text class="name-align-building">地理位置:</text>
+							<text class="conts">{{ item.dlwz }}</text>
+						</view>
+						<view style="display: flex;margin-bottom: 15rpx; color: #728f90;">
+							<text class="name-align-building">建筑面积:</text>
+							<text class="conts">{{ item.jzmj }}</text>
+						</view>
+						<view style="display: flex;margin-bottom: 15rpx; color: #728f90;">
+							<text class="name-align-building">档案负责人:</text>
+							<text class="conts max-width">{{ item.dafzr }}</text>
+						</view>
+						<view style="display: flex;margin-bottom: 15rpx; color: #728f90;">
+							<text class="name-align-building">重点部位:</text>
+							<text class="conts max-width">{{ item.zdbwpic }}</text>
+						</view>
+						<!-- 删除按钮 -->
+						<view class="an-niu" @click.native="showModal(item)">
+							<view class="detailDel">删除</view>
+						</view>
+						<view class="an-niu" @click.native="onClick(item)" link><text class="detail">查看详情</text></view>
+					</uni-card>
+				</view>
+			</view>
+			<!-- tableData为空时显示  -->
+			<view v-else-if="tableData.length==0 && isLoaded" style="text-align: center;">
+				<view class="text-gray" style="padding-top: 20px;">
+					<img :src="tan90" alt="暂无数据" />
+				</view>
+			</view>
+			<view>
+				<image :src="Group" @click="addClick" class="tiantupian"></image>
+			</view>
+			<u-action-sheet :show="showOrg" :actions="actions" title="请选择单位" @close="showOrg = false"
+				@select="sexSelect"></u-action-sheet>
+			<u-modal :show="show" @confirm="confirm" @cancel="cancel" @close="close" asyncClose closeOnClickOverlay
+				showCancelButton confirmColor="red" :title="title" :content="content" ref="uModal"></u-modal>
+			<!-- 加载中 -->
+			<isLodingModel></isLodingModel>
+		</view>
+	</view>
+</template>
+<script>
+	var that = '';
+	import {
+		getArc, //获取建筑信息列表
+		delArc, //删除建筑信息
+		getOrgId //获取orgId
+	} from '@/api/architecture';
+	import config from '@/config'
+	const baseUrlImg = config.baseUrlImg
+	export default {
+		data() {
+			return {
+				screenHeight: this.$screenHeight,
+				wheight: '',
+				isLoaded: false,
+				Group: `${baseUrlImg}/checkActive/Group.png`,
+				showOrg: false,
+				actions: [],
+				// 数据
+				tableData: {},
+				title: '是否删除该数据项?',
+				content: '确认删除?',
+				id: '',
+				tan90: `${baseUrlImg}/tan90.png`,
+				// 每页数据量
+				pageSize: 5,
+				// 当前页
+				pageNo: 1,
+				// 数据总量
+				total: 0,
+				// tableData数据加载中
+				loading: false,
+				// 初始化时搜索框的值
+				keyword: '',
+				// 存放orgid,orgname
+				formData: {},
+				show: false,
+				showtimeStart: false,
+				showtimeEnd: false
+			};
+		},
+		// 在 vue页面,向起始页通过事件传递数据
+		onLoad: function(option) {
+
+			// this.init();
+		},
+		watch: {
+			loading: {
+				handler(newLength, oldLength) {
+					this.$modal.isLoadingModel(this.loading)
+				},
+				immediate: true
+			}
+		},
+		onShow() {
+			this.actions = []
+			that = this;
+			getOrgId({
+				pageNo: this.pageNo,
+				pageSize: this.pageSize,
+				userId: this.$store.state.user.id
+			}).then(response => {
+				// 取到用户对应的单位名称与id
+				response.data.map(v => {
+					this.actions.push({
+						id: v.dwid,
+						name: v.orgName
+					});
+				});
+				this.formData.orgName = response.data[0].orgName ? response.data[0].orgName : '';
+				this.formData.orgId = response.data[0].dwid;
+				this.tableData = []
+				this.getData();
+			});
+
+		},
+		onReady() {},
+		mixins: [uni.$u.mixin],
+		methods: {
+			search(val) {
+				this.tableData = []
+				console.log(val,'ssssssssssssssssssssddddddddddd')
+				this.getData()
+			},
+			async init() {
+				var t = this;
+				t.$.getlocation()
+					.then(res => {
+					})
+					.catch(err => {
+					});
+			},
+			// 模态框内容
+			showModal(val) {
+				this.show = true;
+				this.id = val.id;
+			},
+			confirm() {
+				this.show = false;
+				delArc({
+					id: this.id
+				}).then(response => {
+					this.loading = true;
+					this.isLoaded = false
+					this.tableData = []
+					this.getData();
+				});
+			},
+			close() {
+				this.show = false;
+			},
+			cancel() {
+				this.show = false;
+			},
+			//查看详情
+			addClickDetail(val) {
+				uni.navigateTo({
+					url: `/pagesA/fire/architecture/add_architecture/add_architecture?item=${JSON.stringify(val)}`
+				});
+			},
+			// 获取数据
+			getData() {
+				this.loading = true;
+				// 获取建筑信息详细信息
+				getArc({
+					pageNo: this.pageNo,
+					pageSize: this.pageSize,
+					orgId: this.formData.orgId,
+					buildingName: this.keyword
+				}).then(response => {
+					this.isLoaded = true
+					this.tableData = [...this.tableData, ...response.data.records]
+					this.loading = false
+					this.total=response.data.total
+					console.log(this.tableData,'ssssssssss')
+					// this.tableData = response.data;
+				});
+			},
+
+
+			// 传递数据
+			onClick(val) {
+				this.isLoaded = false
+				uni.navigateTo({
+					url: `/pagesA/fire/architecture/architecture_details/architecture_details?id=${val.id}`,
+					events: {
+						// 为指定事件添加一个监听器,获取被打开页面传送到当前页面的数据
+						acceptDataFromOpenedPage: function(val) {
+						}
+					},
+					success: function(res) {
+						// 通过eventChannel向被打开页面传送数据
+						res.eventChannel.emit('acceptDataFromOpenerPage', val);
+					}
+				});
+			},
+
+			// 删除单位建筑信息
+			onClickDel(val) {
+				this.id = val.id;
+				delArc({
+					id: this.id
+				}).then(response => {
+					this.loading = true;
+					this.isLoaded = false
+					this.tableData = []
+					this.getData();
+				});
+			},
+			addClick() {
+				this.isLoaded = false
+				uni.navigateTo({
+					url: `/pagesA/fire/architecture/add_architecture/add_architecture?&orgName=${this.formData.orgName}&orgId=${this.formData.orgId}`,
+				});
+			},
+
+			sexSelect(e) {
+				this.formData.orgId = e.id;
+				this.formData.orgName = e.name;
+				// 获取建筑信息详细信息
+				getArc({
+					pageNo: this.pageNo,
+					pageSize: this.pageSize,
+					orgId: this.formData.orgId
+				}).then(response => {
+					this.tableData = response.data;
+				});
+			},
+
+			// search() {
+			// 	getArc({
+			// 		pageNo: this.pageNo,
+			// 		pageSize: this.pageSize,
+			// 		orgId: this.formData.orgId,
+			// 		buildingName: this.keyword
+			// 	}).then(response => {
+			// 		this.tableData = response.data;
+			// 	});
+			// },
+
+			// 触底的事件
+			onReachBottom() {
+				// 判断是否还有下一页数据
+				if (this.pageNo * this.pageSize >= this.total)
+					return uni.showToast({
+						title: `数据加载完毕`
+					});
+				// 判断是否正在请求其它数据,如果是,则不发起额外的请求
+				if (this.loading) return;
+				this.pageNo += 1;
+				this.getData(this.pageNo);
+			},
+
+			// 隐藏键盘
+			hideKeyboard() {
+				uni.hideKeyboard();
+			},
+
+			//日期范围
+			// 开始日期
+			confirmStarttime(e) {
+				this.showtimeStart = false;
+				let value = new Date(e.value);
+				this.formData.start = uni.$u.timeFormat(e.value, 'yyyy/mm/dd');
+			}
+		}
+	};
+</script>
+
+<style lang="scss" scoped>
+	body {
+		background-color: #f5f7f9;
+	}
+	
+	page {
+		background-color: #f5f7f9;
+	}
+	
+	/deep/ .u-tabs__wrapper[data-v-0de61367],
+	.u-tabs__wrapper.data-v-0de61367 {
+		width: 99%;
+	}
+
+	/deep/.u-tabs__wrapper__nav__item[data-v-0de61367],
+	/deep/.u-tabs__wrapper__nav__item.data-v-0de61367,
+	/deep/.u-tabs__wrapper__nav__item {
+		padding: 0 60rpx;
+	}
+
+	.uni-container {
+		height: 100vh;
+		padding-right: 20upx;
+	}
+
+	.addInsp {
+		width: 40px;
+		position: fixed;
+		right: 4px;
+		z-index: 99999;
+	}
+
+	::v-deep .u-icon__icon {
+		margin-right: 0px !important;
+	}
+
+	.an-niu {
+		float: right;
+		font-size: 10px;
+		text-align: center;
+		display: flex;
+		margin-top: -64upx;
+		padding-bottom: 30rpx;
+		// margin-top: 50rpx;
+		color: #fff;
+
+		.detail {
+			width: 60px;
+			height: 60rpx;
+			padding: 0 20rpx;
+			border-radius: 30px;
+			background-color: #f7c41e;
+			margin-right: 20rpx;
+			text-align: center;
+			line-height: 60rpx;
+			font-size: 27upx;
+		}
+
+		.detailDel {
+			width: 60px;
+			height: 60rpx;
+			padding: 0 20rpx;
+			border-radius: 30px;
+			background-color: #ff2e31;
+			color: white;
+			margin-right: 20rpx;
+			text-align: center;
+			line-height: 60rpx;
+			font-size: 30upx;
+		}
+
+		.solve {
+			width: 62px;
+			height: 60rpx;
+			margin-right: 20rpx;
+			border-radius: 30px;
+			background-color: #4cb2b6;
+			line-height: 60rpx;
+		}
+
+		/deep/ .padding-tb-sm {
+			padding-top: 0px;
+			padding-bottom: 10px;
+		}
+
+		.deletes {
+			width: 62px;
+			height: 60rpx;
+			border-radius: 60rpx;
+			background-color: red;
+			color: #fff;
+			line-height: 60rpx;
+		}
+	}
+
+	/deep/.segmented-control__item--button {
+		background-color: rgb(76, 178, 182) !important;
+	}
+
+	/deep/.segmented-control__item--button--active {
+		background-color: #ffffff !important;
+	}
+
+	/deep/.uni-card {
+		box-shadow: 0px 0px 3px 0px rgba(86, 165, 168, 0.63) !important;
+		border-radius: 30rpx;
+	}
+
+	.tiantupian {
+		width: 110rpx;
+		height: 110rpx;
+		position: fixed;
+		right: 15px;
+		bottom: 10rpx;
+	}
+
+	//列表样式
+	.titles {
+		font-weight: 600;
+		margin-bottom: 10rpx;
+		color: black;
+		font-size: 32rpx;
+	}
+
+	/deep/ .u-form-item__body__left__content__label {
+		font-size: 28upx !important;
+	}
+
+	.conts {
+		max-width: 470upx;
+		display: -webkit-box;
+		/*弹性伸缩盒子模型显示*/
+		-webkit-box-orient: vertical;
+		/*排列方式*/
+		-webkit-line-clamp: 1;
+		/*显示文本行数*/
+		overflow: hidden;
+		/*溢出隐藏*/
+		color: #274647;
+		text-overflow: ellipsis;
+	}
+
+	.max-width {
+		max-width: 180upx;
+	}
+
+	/deep/.u-action-sheet {
+		overflow-y: auto;
+		height: 1000rpx;
+		background-color: #fff;
+	}
+
+	.example {
+		overflow-y: auto;
+	}
 </style>

+ 650 - 650
pagesA/fire/fpd_detection/add_detection/add_detection.vue

@@ -1,651 +1,651 @@
-<template>
-	<view class=" uni-container">
-		<view class="example container" :style="'height: ' + (screenHeight - wheight - 75) + 'px'">
-			<!-- 自定义表单校验 1-->
-			<u-form ref="customForm" :rules='customRules' :model="formData" labelPosition="left" labelWidth="150"
-				labelAlign="left">
-				<view class=" flex  flex-direction width100">
-					<u-form-item label="检测项目" prop="detinspect" :required="true"
-						@click="showInspOption = true;hideKeyboard();">
-						<u--input v-model="formData.detinspect" disabled disabledColor="#ffffff"
-							placeholder="请输入检测项目"></u--input>
-						<!-- <u-input v-model="formData.detinspect" placeholder="请输入检测项目" /> -->
-					</u-form-item>
-
-					<u-form-item label="预计检测时间" prop="detdate">
-						<uni-datetime-picker :show="unitTime" v-model="formData.detdate" type="datetime"
-							closeOnClickOverlay @confirm="ActiveUnitTime" @cancel="unitTime = false"
-							@change="changetime" @close="unitTime = false"></uni-datetime-picker>
-					</u-form-item>
-					<u-form-item label="检测维保结果" prop="detresult" @click="
-							showreOption = true;
-							hideKeyboard();" :required="true">
-						<u--input v-model="formData.detresult.name" disabled disabledColor="#ffffff"
-							placeholder="请输入检测维保结果"></u--input>
-						<!-- <u-input v-model="formData.detresult" placeholder="请输入检测维保结果" /> -->
-					</u-form-item>
-					<u-form-item label="所属单位" @click="
-							showSex5 = true;
-							hideKeyboard();" prop="orgName" :required="true">
-						<u--input v-model="formData.orgName" disabled disabledColor="#ffffff"
-							placeholder="请选择所属单位"></u--input>
-					</u-form-item>
-					<u-form-item label="附件">
-						<!-- 选择文件上传 -->
-						<uni-file-picker v-model="formData.File" del-icon limit="1" auto-upload file-mediatype="all"
-							@select="select" @delete="deleteFile">
-							<button type="primary" class="selectBtn"
-								style="background-color: rgba(76, 178, 182, 0.5);">选择附件</button>
-							<!-- 加载中 -->
-							<isLodingModel v-if="loading"></isLodingModel>
-						</uni-file-picker>
-					</u-form-item>
-				</view>
-			</u-form>
-			<u-action-sheet :show="showSex5" :actions="actions5" title="请选择单位" @close="showSex5 = false"
-				@select="sexSelect5"></u-action-sheet>
-			<!-- 检测结果选项框 -->
-			<u-action-sheet :show="showreOption" :actions="resultOptions" title="请选择检测维保结果"
-				@close="showreOption = false" @select="setResult"></u-action-sheet>
-			<!-- 检测项目选项框 -->
-			<!-- 			<u-action-sheet :show="showInspOption" :actions="detinspectOptions" title="请选择检测项目"
-				@close="showInspOption = false" @select="setInsp"></u-action-sheet> -->
-			<!-- ----隐患 -->
-			<u-popup :show="showInspOption" :round="10" @close="showInspOption=false">
-				<view style="width: 70vw;overflow-y: auto;margin-bottom: 80rpx;padding:0 10px">
-					<view style="position: sticky; top: 0; background-color: white;height:50px;padding-top: 10px;">
-						<text class="text-xl">选择检测项目:</text>
-						<text class="btn" @tap="onSelectAll">
-							{{selectAll?'取消全选':'全选'}}
-						</text>
-					</view>
-					<view class="person-forward" style="margin-top: 10px;">
-						<u-checkbox-group placement="column" v-model="checkArr" @change="checkboxChange2"
-							activeColor="#4CB2B6" iconSize="red">
-							<u-checkbox v-for="(items, indexs) in detinspectOptions" :key="indexs"
-								:customStyle="{marginBottom: '60rpx'}" :label="items.name" :name="items.name">
-							</u-checkbox>
-						</u-checkbox-group>
-					</view>
-					<view class="flex flex-direction-row "
-						style="position: fixed;bottom: 10px;left: 50%;transform: translate(-50%);height: 100rpx;width: 80%">
-						<u-button shape="circle" type="primary" color="#4CB2B6" text="确定" @click="checkboxConfirm2()"
-							customStyle="margin-right:20px;padding:0 30px">
-						</u-button>
-						<u-button type="primary" plain color="#4CB2B6" text="取消" shape="circle"
-							@click="checkboxCancel2()" customStyle="padding:0 30px">
-						</u-button>
-					</view>
-				</view>
-			</u-popup>
-			<!-- ----隐患 -->
-		</view>
-		<uni-row class="heigthButton">
-			<u-button @click="submit('customForm')" type="primary" shape="circle" size="large" color="#4CB2B6"
-				text="确认新增"></u-button>
-		</uni-row>
-	</view>
-</template>
-<script>
-	import {
-		createFpdDetection, // 更新
-		getOrgId,
-		upload, //上传文件
-	} from '@/api/fpdDetection/index.js';
-	import {
-		DICT_TYPE,
-		getDictDatas
-	} from '@/utils/dict';
-	import {
-		getAccessToken
-	} from '@/utils/auth';
-	import config from '@/config';
-	import store from '@/store';
-	import {
-		uploadAvatar
-	} from '@/api/system/user';
-
-	const baseUrl = config.baseUrl;
-	var that = null;
-	export default {
-		data() {
-			return {
-				isCheckAll: false,
-				screenHeight: this.$screenHeight,
-				wheight: '',
-				showSex5: false, //所属单位
-				actions: [],
-				actions2: getDictDatas(DICT_TYPE.TRAIN_DRILL),
-				actions5: [],
-				//检测维保结果
-				showreOption: false,
-				resultOptions: getDictDatas(DICT_TYPE.BACKEND_DET_RESULT), //检测维保结果选项
-				//检测项目
-				showInspOption: false,
-				detinspectOptions: getDictDatas(DICT_TYPE.DICT_INSPECT_TYPE), //检测项目选项
-				checkArr: [],
-				// 每页数据量
-				pageSize: 5,
-				// 当前页
-				pageNo: 1,
-				// 数据总量
-				total: 0,
-				unitTime: false,
-				loading: false,
-				selectAll: false,
-				title: '生成隐患',
-				content: '确认将此检查项目生成为隐患',
-				// 自定义表单数据
-				formData: {
-					status: '0',
-					File: [],
-					detresult: {
-						id: null,
-						name: null
-					}
-				},
-				// 自定义表单校验规则
-				customRules: {
-					detinspect: {
-						type: 'string',
-						required: true,
-						message: '	检测项目不能为空',
-						trigger: ['blur', 'change']
-					},
-					unitTime: {
-						type: 'string',
-						message: '预计检测时间不能为空',
-						trigger: ['blur', 'change']
-					},
-					orgName: {
-						// pattern: /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/,
-						// 自定义验证函数
-						validator: (rule, value, callback) => {
-							// 上面有说,返回true表示校验通过,返回false表示不通过
-							// uni.$u.test.mobile()就是返回true或者false的
-							//是否符合正则 且不为空
-							if (!value) {
-								return false
-							}
-						},
-						message: '请输入检测维保结果',
-						trigger: ['blur', 'change']
-					},
-					detresult: {
-						// pattern: /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/,
-						// 自定义验证函数
-						validator: (rule, value, callback) => {
-							// 上面有说,返回true表示校验通过,返回false表示不通过
-							// uni.$u.test.mobile()就是返回true或者false的
-							//是否符合正则 且不为空
-							if (!value.id) {
-								return false
-							}
-						},
-						message: '请输入检测维保结果',
-						trigger: ['blur', 'change']
-					}
-				}
-			};
-		},
-		watch: {
-			loading: {
-				handler(newLength, oldLength) {
-					this.$modal.isLoadingModel(this.loading)
-				},
-				immediate: true
-			}
-		},
-		computed: {},
-		mounted() {
-			uni.createSelectorQuery().in(this).select('.heigthButton').boundingClientRect(data => {
-				this.wheight = data.height
-			}).exec()
-		},
-		// 在 vue页面,向起始页通过事件传递数据
-		// 在 vue页面,向起始页通过事件传递数据
-		onLoad: function(option) {
-			this.formData.orgName = option.orgName ? option.orgName : ''
-			this.formData.orgId = option.orgId ? option.orgId : ''
-			this.actions2.map(i => {
-				i.name = i.label;
-				i.id = i.value;
-			});
-
-			// 获取单位id
-			getOrgId({
-				pageNo: this.pageNo,
-				pageSize: this.pageSize,
-				userId: this.$store.state.user.id
-			}).then(response => {
-				// console.log(response, 'response');
-				// 取到用户对应的单位名称与id
-				response.data.map(v => {
-					this.actions5.push({
-						id: v.dwid,
-						name: v.orgName
-					});
-				});
-			});
-			//初始化检测结果选项
-			const trueArr = []
-			this.resultOptions.forEach(item => {
-				trueArr.push({
-					id: item.value,
-					name: item.label
-				})
-			})
-			this.resultOptions = [...trueArr]
-			//初始化检测项目选项
-			const trueArr1 = []
-			// console.log('detinspectOptions', this.detinspectOptions);
-			this.detinspectOptions.forEach(item => {
-				trueArr1.push({
-					id: item.value,
-					name: item.label
-				})
-			})
-			this.detinspectOptions = [...trueArr1]
-		},
-		onReady() {
-			this.$refs.customForm.setRules(this.customRules);
-		},
-
-		methods: {
-			onSelectAll() {
-				this.selectAll = !this.selectAll;
-				this.checkArr = this.selectAll ? this.detinspectOptions.map(item => item.name) : [];
-			},
-			submit(ref) {
-				// console.log(this.formData, 'alertalertalert');
-				// if (!this.formData.orgName) {
-				// 	return this.$modal.msgError('请选择所属单位')
-				// }
-				// if (this.formData.unitTime && this.formData.unitTime.indexOf(":") === -1) {
-				// 	this.formData.unitTime = this.formData.unitTime + ' 00:00:00'
-				// }
-				this.$refs[ref]
-					.validate()
-					.then(res => {
-						this.formData['status'] = 0;
-						// console.log('this.formData', this.formData);
-						if (this.formData.File.length > 0) {
-							this.formData.att = this.formData.File[0].url.toString();
-						} else {
-							this.formData.att = ''
-						}
-						//对要提交的数据进行处理 {id,name}只保存name
-						this.$set(this.formData, 'detresult', this.formData.detresult.id)
-						var jsdata = JSON.stringify(this.formData);
-						// console.log(jsdata, 'jsdatajsdatajsdata');
-						createFpdDetection(jsdata).then(response => {
-							// console.log('response.data.msg,', response.data);
-							uni.showLoading({
-								title: response.data.msg
-							});
-							setTimeout(() => {
-								// console.log('新增成功!');
-								uni.hideLoading();
-								uni.navigateBack({
-									delta: 1
-								})
-							}, 0);
-						}).catch(err => {});
-					})
-					.catch(err => {
-						// console.log(err,'eeeeeeeeee');
-						// uni.showToast({
-						// 	icon:'none',
-						// 	title:'错误!'+ err[0].message
-						// })
-					});
-			},
-			// 上传图片 获取上传状态
-			// 选择上传触发函数
-			select(e) {
-				// 根据所选图片的个数,多次调用上传函数
-				let promises = [];
-				for (let i = 0; i < e.tempFilePaths.length; i++) {
-					const promise = this.uploadFiles(e.tempFilePaths, i);
-					promises.push(promise);
-				}
-				Promise.all(promises).then(result => {});
-			},
-			// 上传函数
-			async uploadFiles(tempFilePaths, i) {
-				const that = this;
-				this.loading = true
-				await uni.uploadFile({
-					url: baseUrl + '/admin-api/infra/file/upload', //后端用于处理图片并返回图片地址的接口
-					filePath: tempFilePaths[i],
-					name: 'file',
-					header: {
-						Authorization: 'Bearer ' + getAccessToken()
-					}, //请求token
-					success: res => {
-						// console.log('uploadres', res);
-						let data = JSON.parse(res.data);
-						// 返回的url
-						var fileLink = data.data;
-						const code = data.code;
-						// 如果成功,将返回的data数据给 formdata
-						if (code == 0) {
-							that.formData.File.push({
-								url: fileLink,
-								name: fileLink
-							});
-							uni.showToast({
-								title: '文件上传成功!'
-							});
-							that.loading = false
-							// that.formData.attId = fileLink
-						}
-						// this.formData.attId = this.formData.attId.toString();
-
-					},
-					fail: () => {
-						// console.log('err');
-						uni.showToast({
-							icon: 'error',
-							title: '文件上传失败!'
-						});
-					}
-				});
-			},
-			// 移出图片函数
-			async deleteFile(e) {
-				// console.log(e);
-				this.formData.attId = [];
-				// console.log('移除了:', this.formData.attId);
-			},
-			//检测项目多选框选中
-			checkboxChange2(arr) { //勾选的事件
-				console.log('arr', arr);
-				this.checkArr = [...arr]
-
-			},
-			//多选确定事件
-			checkboxConfirm2() {
-				this.showInspOption = false
-				this.formData.detinspect = this.checkArr.join(',')
-				// console.log('detinspect',this.formData.detinspect);
-			},
-			//多选取消事件
-			checkboxCancel2() {
-				this.showInspOption = false
-				// console.log('this.formData.detinspect',this.formData.detinspect);
-				if (this.formData.detinspect) {
-					const nowArr = this.formData.detinspect.split(',')
-					this.checkArr = [...nowArr]
-				} else {
-					this.checkArr = []
-				}
-
-			},
-			// 隐藏键盘
-			hideKeyboard() {
-
-				uni.hideKeyboard();
-			},
-
-			changetime(e) {
-				console.log('change', e);
-			},
-			// 所属单位
-			sexSelect5(e) {
-				// console.log('e',e);
-				this.formData.orgId = e.id;
-				this.formData.orgName = e.name;
-				// console.log(this.formData);
-			},
-			// 检测维保结果select事件
-			setResult(e) {
-				// console.log('e', e);
-				this.formData.detresult = {
-					id: e.id,
-					name: e.name
-				};
-				// this.formData.orgName = e.name;
-			},
-			// 检测检测项目select事件
-			setInsp(e) {
-				// console.log('e', e);
-				this.formData.detinspect = e.name;
-				// this.formData.orgName = e.name;
-				// console.log(this.formData.orgId);
-			},
-			// 生成隐患弹出层   //暂存为草稿箱弹出层
-			cancel() {
-				this.show = false;
-			},
-			confirm() {
-				setTimeout(() => {
-					// 0.5秒后自动关闭
-					this.show = false;
-				}, 500);
-			},
-
-			// 触底的事件
-			scrolltolower() {
-				// 判断是否还有下一页数据
-				if (this.pageNo * this.pageSize >= this.total)
-					return uni.showToast({
-						title: `数据加载完毕`
-					});
-				// 判断是否正在请求其它数据,如果是,则不发起额外的请求
-				if (this.loading) return;
-				this.pageNo += 1;
-				this.showCheckboxShow(this.pageNo);
-			}
-		}
-	};
-</script>
-<style lang="scss" scoped>
-	page {
-		height: 100%;
-		background-color: #f5f7f9;
-		position: relative;
-	}
-
-	.buttomBorder {
-		height: 0px;
-		border: 1px dashed #cbd5e1;
-	}
-
-	/deep/ .uni-section .uni-section-header {
-		padding: 0px;
-	}
-
-	/deep/ .u-form-item__body {
-		font-weight: 500;
-		flex-direction: column !important;
-	}
-
-	/deep/ .u-form-item__body__left__content__label {
-		margin-bottom: 16rpx;
-		font-size: 30rpx !important;
-		color: #274647 !important;
-	}
-
-	.arrow-icon {
-		//主动检查箭头
-		position: absolute;
-		right: 14px;
-		top: 49px;
-		transform: rotate(90deg);
-	}
-
-	/deep/ .u-input[data-v-fdbb9fe6],
-	/deep/ .u-input.data-v-fdbb9fe6,
-	/deep/ .u-input {
-		background-color: #fff;
-	}
-
-	/deep/.u-button[data-v-3bf2dba7],
-	/deep/.u-button.data-v-3bf2dba7,
-	/deep/.u-button {
-		width: 60% !important;
-	}
-
-	//弹框样式
-	.btnList {
-		// width: 40%;
-		display: flex;
-
-		// display:flex;
-		.u-button[data-v-3bf2dba7] {
-			width: 30%;
-		}
-	}
-
-	/deep/ .u-popup__content {
-		//弹出的宽高
-		height: 100%;
-	}
-
-	/deep/ .u-form-item__body__right__message {
-		//校验的文字的位置
-		margin-left: 10rpx !important;
-	}
-
-	/deep/ .uicon-close {
-		//关闭按钮背景色
-		background-color: rgba(199, 203, 210, 0.9);
-		border-radius: 10%;
-	}
-
-	.checkbox {
-		.checkbox-item {
-			box-sizing: border-box;
-			padding-top: 40px;
-		}
-	}
-
-	//侧边联动
-	.page-body {
-		display: flex;
-		background: #fff;
-		overflow: hidden;
-	}
-
-	.nav {
-		display: flex;
-		width: 100%;
-	}
-
-	.nav-left {
-		width: 25%;
-		background: #fafafa;
-	}
-
-	.nav-left-item {
-		height: 100upx;
-		border-right: solid 1px #f1f1f1;
-		border-bottom: solid 1px #f1f1f1;
-		font-size: 30upx;
-		display: flex;
-		align-items: center;
-		justify-content: center;
-	}
-
-	/deep/.nav-right-item[data-v-73caef23],
-	/deep/.nav-right-item {
-		display: flex;
-		flex-wrap: wrap;
-	}
-
-	.nav-left-item:last-child {
-		border-bottom: none;
-	}
-
-	.nav-right {
-		width: 75%;
-	}
-
-	.box {
-		display: block;
-		overflow: hidden;
-		border-bottom: 20upx solid #f3f3f3;
-		/* min-height: 100vh; */
-		/*若您的子分类过少想使得每个子分类占满屏请放开上边注视 */
-	}
-
-	.box:last-child {
-		border: none;
-		// min-height: 100vh;
-	}
-
-	.nav-right-item {
-		margin-top: 20px;
-		// width: 28%;
-		// min-height: 200upx;
-		float: left;
-		text-align: center;
-		padding: 11upx;
-		font-size: 28upx;
-		background: #fff;
-
-		/deep/.u-checkbox__icon-wrap[data-v-532d01c7],
-		/deep/.u-checkbox__icon-wrap {
-			//复选框的样式
-			margin: 0 20rpx;
-		}
-
-		/deep/ uni-view[data-v-3d1b15f2] {
-			//复选框上线的间距
-			margin: 20rpx 0 !important;
-		}
-
-		// /deep/ .u-checkbox__icon-wrap--square{
-		// 	margin: 20rpx;
-		// }
-		.u-checkbox-label--right[data-v-532d01c7],
-		.u-checkbox-label--right {
-			margin-right: 40rpx;
-		}
-	}
-
-	.nav-right-item image {
-		width: 150upx;
-		height: 150upx;
-	}
-
-	.active {
-		font-weight: 700;
-		color: #274647;
-		background: #fff;
-		border-right: 0;
-	}
-
-	::-webkit-scrollbar {
-		/*取消小程序的默认导航条样式*/
-		width: 0;
-		height: 0;
-		color: transparent;
-	}
-
-	.selectBtn {
-		width: 200rpx;
-		margin-left: 0;
-		font-size: 30rpx;
-		background-color: #4cb2b6;
-	}
-
-	/deep/.u-action-sheet,
-	/deep/.u-transition {
-		overflow-y: auto;
-		height: 1000rpx;
-		background-color: #fff;
-	}
-
-	.example {
-		overflow-y: auto;
-	}
-	.btn{
-		color: #4CB2B6;
-		margin-left: 20px;
-		padding:10rpx 40rpx;
-		border: 1px solid #4CB2B6;
-		border-radius: 8rpx;
-	}
+<template>
+	<view class=" uni-container">
+		<view class="example container" :style="'height: ' + (screenHeight - wheight - 75) + 'px'">
+			<!-- 自定义表单校验 1-->
+			<u-form ref="customForm" :rules='customRules' :model="formData" labelPosition="left" labelWidth="150"
+				labelAlign="left">
+				<view class=" flex  flex-direction width100">
+					<u-form-item label="检测项目" prop="detinspect" :required="true"
+						@click="showInspOption = true;hideKeyboard();">
+						<u--input v-model="formData.detinspect" disabled disabledColor="#ffffff"
+							placeholder="请选择检测项目"></u--input>
+						<!-- <u-input v-model="formData.detinspect" placeholder="请输入检测项目" /> -->
+					</u-form-item>
+
+					<u-form-item label="预计检测时间" prop="detdate">
+						<uni-datetime-picker :show="unitTime" v-model="formData.detdate" type="datetime"
+							closeOnClickOverlay @confirm="ActiveUnitTime" @cancel="unitTime = false"
+							@change="changetime" @close="unitTime = false"></uni-datetime-picker>
+					</u-form-item>
+					<u-form-item label="检测维保结果" prop="detresult" @click="
+							showreOption = true;
+							hideKeyboard();" :required="true">
+						<u--input v-model="formData.detresult.name" disabled disabledColor="#ffffff"
+							placeholder="请选择检测维保结果"></u--input>
+						<!-- <u-input v-model="formData.detresult" placeholder="请输入检测维保结果" /> -->
+					</u-form-item>
+					<u-form-item label="所属单位" @click="
+							showSex5 = true;
+							hideKeyboard();" prop="orgName" :required="true">
+						<u--input v-model="formData.orgName" disabled disabledColor="#ffffff"
+							placeholder="请选择所属单位"></u--input>
+					</u-form-item>
+					<u-form-item label="附件">
+						<!-- 选择文件上传 -->
+						<uni-file-picker v-model="formData.File" del-icon limit="1" auto-upload file-mediatype="all"
+							@select="select" @delete="deleteFile">
+							<button type="primary" class="selectBtn"
+								style="background-color: rgba(76, 178, 182, 0.5);">选择附件</button>
+							<!-- 加载中 -->
+							<isLodingModel v-if="loading"></isLodingModel>
+						</uni-file-picker>
+					</u-form-item>
+				</view>
+			</u-form>
+			<u-action-sheet :show="showSex5" :actions="actions5" title="请选择单位" @close="showSex5 = false"
+				@select="sexSelect5"></u-action-sheet>
+			<!-- 检测结果选项框 -->
+			<u-action-sheet :show="showreOption" :actions="resultOptions" title="请选择检测维保结果"
+				@close="showreOption = false" @select="setResult"></u-action-sheet>
+			<!-- 检测项目选项框 -->
+			<!-- 			<u-action-sheet :show="showInspOption" :actions="detinspectOptions" title="请选择检测项目"
+				@close="showInspOption = false" @select="setInsp"></u-action-sheet> -->
+			<!-- ----隐患 -->
+			<u-popup :show="showInspOption" :round="10" @close="showInspOption=false">
+				<view style="width: 70vw;overflow-y: auto;margin-bottom: 80rpx;padding:0 10px">
+					<view style="position: sticky; top: 0; background-color: white;height:50px;padding-top: 10px;">
+						<text class="text-xl">选择检测项目:</text>
+						<text class="btn" @tap="onSelectAll">
+							{{selectAll?'取消全选':'全选'}}
+						</text>
+					</view>
+					<view class="person-forward" style="margin-top: 10px;">
+						<u-checkbox-group placement="column" v-model="checkArr" @change="checkboxChange2"
+							activeColor="#4CB2B6" iconSize="red">
+							<u-checkbox v-for="(items, indexs) in detinspectOptions" :key="indexs"
+								:customStyle="{marginBottom: '60rpx'}" :label="items.name" :name="items.name">
+							</u-checkbox>
+						</u-checkbox-group>
+					</view>
+					<view class="flex flex-direction-row "
+						style="position: fixed;bottom: 10px;left: 50%;transform: translate(-50%);height: 100rpx;width: 80%">
+						<u-button shape="circle" type="primary" color="#4CB2B6" text="确定" @click="checkboxConfirm2()"
+							customStyle="margin-right:20px;padding:0 30px">
+						</u-button>
+						<u-button type="primary" plain color="#4CB2B6" text="取消" shape="circle"
+							@click="checkboxCancel2()" customStyle="padding:0 30px">
+						</u-button>
+					</view>
+				</view>
+			</u-popup>
+			<!-- ----隐患 -->
+		</view>
+		<uni-row class="heigthButton">
+			<u-button @click="submit('customForm')" type="primary" shape="circle" size="large" color="#4CB2B6"
+				text="确认新增"></u-button>
+		</uni-row>
+	</view>
+</template>
+<script>
+	import {
+		createFpdDetection, // 更新
+		getOrgId,
+		upload, //上传文件
+	} from '@/api/fpdDetection/index.js';
+	import {
+		DICT_TYPE,
+		getDictDatas
+	} from '@/utils/dict';
+	import {
+		getAccessToken
+	} from '@/utils/auth';
+	import config from '@/config';
+	import store from '@/store';
+	import {
+		uploadAvatar
+	} from '@/api/system/user';
+
+	const baseUrl = config.baseUrl;
+	var that = null;
+	export default {
+		data() {
+			return {
+				isCheckAll: false,
+				screenHeight: this.$screenHeight,
+				wheight: '',
+				showSex5: false, //所属单位
+				actions: [],
+				actions2: getDictDatas(DICT_TYPE.TRAIN_DRILL),
+				actions5: [],
+				//检测维保结果
+				showreOption: false,
+				resultOptions: getDictDatas(DICT_TYPE.BACKEND_DET_RESULT), //检测维保结果选项
+				//检测项目
+				showInspOption: false,
+				detinspectOptions: getDictDatas(DICT_TYPE.DICT_INSPECT_TYPE), //检测项目选项
+				checkArr: [],
+				// 每页数据量
+				pageSize: 5,
+				// 当前页
+				pageNo: 1,
+				// 数据总量
+				total: 0,
+				unitTime: false,
+				loading: false,
+				selectAll: false,
+				title: '生成隐患',
+				content: '确认将此检查项目生成为隐患',
+				// 自定义表单数据
+				formData: {
+					status: '0',
+					File: [],
+					detresult: {
+						id: null,
+						name: null
+					}
+				},
+				// 自定义表单校验规则
+				customRules: {
+					detinspect: {
+						type: 'string',
+						required: true,
+						message: '	检测项目不能为空',
+						trigger: ['blur', 'change']
+					},
+					unitTime: {
+						type: 'string',
+						message: '预计检测时间不能为空',
+						trigger: ['blur', 'change']
+					},
+					orgName: {
+						// pattern: /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/,
+						// 自定义验证函数
+						validator: (rule, value, callback) => {
+							// 上面有说,返回true表示校验通过,返回false表示不通过
+							// uni.$u.test.mobile()就是返回true或者false的
+							//是否符合正则 且不为空
+							if (!value) {
+								return false
+							}
+						},
+						message: '请输入检测维保结果',
+						trigger: ['blur', 'change']
+					},
+					detresult: {
+						// pattern: /^((0\d{2,3}-\d{7,8})|(1[3584]\d{9}))$/,
+						// 自定义验证函数
+						validator: (rule, value, callback) => {
+							// 上面有说,返回true表示校验通过,返回false表示不通过
+							// uni.$u.test.mobile()就是返回true或者false的
+							//是否符合正则 且不为空
+							if (!value.id) {
+								return false
+							}
+						},
+						message: '请输入检测维保结果',
+						trigger: ['blur', 'change']
+					}
+				}
+			};
+		},
+		watch: {
+			loading: {
+				handler(newLength, oldLength) {
+					this.$modal.isLoadingModel(this.loading)
+				},
+				immediate: true
+			}
+		},
+		computed: {},
+		mounted() {
+			uni.createSelectorQuery().in(this).select('.heigthButton').boundingClientRect(data => {
+				this.wheight = data.height
+			}).exec()
+		},
+		// 在 vue页面,向起始页通过事件传递数据
+		// 在 vue页面,向起始页通过事件传递数据
+		onLoad: function(option) {
+			this.formData.orgName = option.orgName ? option.orgName : ''
+			this.formData.orgId = option.orgId ? option.orgId : ''
+			this.actions2.map(i => {
+				i.name = i.label;
+				i.id = i.value;
+			});
+
+			// 获取单位id
+			getOrgId({
+				pageNo: this.pageNo,
+				pageSize: this.pageSize,
+				userId: this.$store.state.user.id
+			}).then(response => {
+				// console.log(response, 'response');
+				// 取到用户对应的单位名称与id
+				response.data.map(v => {
+					this.actions5.push({
+						id: v.dwid,
+						name: v.orgName
+					});
+				});
+			});
+			//初始化检测结果选项
+			const trueArr = []
+			this.resultOptions.forEach(item => {
+				trueArr.push({
+					id: item.value,
+					name: item.label
+				})
+			})
+			this.resultOptions = [...trueArr]
+			//初始化检测项目选项
+			const trueArr1 = []
+			// console.log('detinspectOptions', this.detinspectOptions);
+			this.detinspectOptions.forEach(item => {
+				trueArr1.push({
+					id: item.value,
+					name: item.label
+				})
+			})
+			this.detinspectOptions = [...trueArr1]
+		},
+		onReady() {
+			this.$refs.customForm.setRules(this.customRules);
+		},
+
+		methods: {
+			onSelectAll() {
+				this.selectAll = !this.selectAll;
+				this.checkArr = this.selectAll ? this.detinspectOptions.map(item => item.name) : [];
+			},
+			submit(ref) {
+				// console.log(this.formData, 'alertalertalert');
+				// if (!this.formData.orgName) {
+				// 	return this.$modal.msgError('请选择所属单位')
+				// }
+				// if (this.formData.unitTime && this.formData.unitTime.indexOf(":") === -1) {
+				// 	this.formData.unitTime = this.formData.unitTime + ' 00:00:00'
+				// }
+				this.$refs[ref]
+					.validate()
+					.then(res => {
+						this.formData['status'] = 0;
+						// console.log('this.formData', this.formData);
+						if (this.formData.File.length > 0) {
+							this.formData.att = this.formData.File[0].url.toString();
+						} else {
+							this.formData.att = ''
+						}
+						//对要提交的数据进行处理 {id,name}只保存name
+						this.$set(this.formData, 'detresult', this.formData.detresult.id)
+						var jsdata = JSON.stringify(this.formData);
+						// console.log(jsdata, 'jsdatajsdatajsdata');
+						createFpdDetection(jsdata).then(response => {
+							// console.log('response.data.msg,', response.data);
+							uni.showLoading({
+								title: response.data.msg
+							});
+							setTimeout(() => {
+								// console.log('新增成功!');
+								uni.hideLoading();
+								uni.navigateBack({
+									delta: 1
+								})
+							}, 0);
+						}).catch(err => {});
+					})
+					.catch(err => {
+						// console.log(err,'eeeeeeeeee');
+						// uni.showToast({
+						// 	icon:'none',
+						// 	title:'错误!'+ err[0].message
+						// })
+					});
+			},
+			// 上传图片 获取上传状态
+			// 选择上传触发函数
+			select(e) {
+				// 根据所选图片的个数,多次调用上传函数
+				let promises = [];
+				for (let i = 0; i < e.tempFilePaths.length; i++) {
+					const promise = this.uploadFiles(e.tempFilePaths, i);
+					promises.push(promise);
+				}
+				Promise.all(promises).then(result => {});
+			},
+			// 上传函数
+			async uploadFiles(tempFilePaths, i) {
+				const that = this;
+				this.loading = true
+				await uni.uploadFile({
+					url: baseUrl + '/admin-api/infra/file/upload', //后端用于处理图片并返回图片地址的接口
+					filePath: tempFilePaths[i],
+					name: 'file',
+					header: {
+						Authorization: 'Bearer ' + getAccessToken()
+					}, //请求token
+					success: res => {
+						// console.log('uploadres', res);
+						let data = JSON.parse(res.data);
+						// 返回的url
+						var fileLink = data.data;
+						const code = data.code;
+						// 如果成功,将返回的data数据给 formdata
+						if (code == 0) {
+							that.formData.File.push({
+								url: fileLink,
+								name: fileLink
+							});
+							uni.showToast({
+								title: '文件上传成功!'
+							});
+							that.loading = false
+							// that.formData.attId = fileLink
+						}
+						// this.formData.attId = this.formData.attId.toString();
+
+					},
+					fail: () => {
+						// console.log('err');
+						uni.showToast({
+							icon: 'error',
+							title: '文件上传失败!'
+						});
+					}
+				});
+			},
+			// 移出图片函数
+			async deleteFile(e) {
+				// console.log(e);
+				this.formData.attId = [];
+				// console.log('移除了:', this.formData.attId);
+			},
+			//检测项目多选框选中
+			checkboxChange2(arr) { //勾选的事件
+				console.log('arr', arr);
+				this.checkArr = [...arr]
+
+			},
+			//多选确定事件
+			checkboxConfirm2() {
+				this.showInspOption = false
+				this.formData.detinspect = this.checkArr.join(',')
+				// console.log('detinspect',this.formData.detinspect);
+			},
+			//多选取消事件
+			checkboxCancel2() {
+				this.showInspOption = false
+				// console.log('this.formData.detinspect',this.formData.detinspect);
+				if (this.formData.detinspect) {
+					const nowArr = this.formData.detinspect.split(',')
+					this.checkArr = [...nowArr]
+				} else {
+					this.checkArr = []
+				}
+
+			},
+			// 隐藏键盘
+			hideKeyboard() {
+
+				uni.hideKeyboard();
+			},
+
+			changetime(e) {
+				console.log('change', e);
+			},
+			// 所属单位
+			sexSelect5(e) {
+				// console.log('e',e);
+				this.formData.orgId = e.id;
+				this.formData.orgName = e.name;
+				// console.log(this.formData);
+			},
+			// 检测维保结果select事件
+			setResult(e) {
+				// console.log('e', e);
+				this.formData.detresult = {
+					id: e.id,
+					name: e.name
+				};
+				// this.formData.orgName = e.name;
+			},
+			// 检测检测项目select事件
+			setInsp(e) {
+				// console.log('e', e);
+				this.formData.detinspect = e.name;
+				// this.formData.orgName = e.name;
+				// console.log(this.formData.orgId);
+			},
+			// 生成隐患弹出层   //暂存为草稿箱弹出层
+			cancel() {
+				this.show = false;
+			},
+			confirm() {
+				setTimeout(() => {
+					// 0.5秒后自动关闭
+					this.show = false;
+				}, 500);
+			},
+
+			// 触底的事件
+			scrolltolower() {
+				// 判断是否还有下一页数据
+				if (this.pageNo * this.pageSize >= this.total)
+					return uni.showToast({
+						title: `数据加载完毕`
+					});
+				// 判断是否正在请求其它数据,如果是,则不发起额外的请求
+				if (this.loading) return;
+				this.pageNo += 1;
+				this.showCheckboxShow(this.pageNo);
+			}
+		}
+	};
+</script>
+<style lang="scss" scoped>
+	page {
+		height: 100%;
+		background-color: #f5f7f9;
+		position: relative;
+	}
+
+	.buttomBorder {
+		height: 0px;
+		border: 1px dashed #cbd5e1;
+	}
+
+	/deep/ .uni-section .uni-section-header {
+		padding: 0px;
+	}
+
+	/deep/ .u-form-item__body {
+		font-weight: 500;
+		flex-direction: column !important;
+	}
+
+	/deep/ .u-form-item__body__left__content__label {
+		margin-bottom: 16rpx;
+		font-size: 30rpx !important;
+		color: #274647 !important;
+	}
+
+	.arrow-icon {
+		//主动检查箭头
+		position: absolute;
+		right: 14px;
+		top: 49px;
+		transform: rotate(90deg);
+	}
+
+	/deep/ .u-input[data-v-fdbb9fe6],
+	/deep/ .u-input.data-v-fdbb9fe6,
+	/deep/ .u-input {
+		background-color: #fff;
+	}
+
+	/deep/.u-button[data-v-3bf2dba7],
+	/deep/.u-button.data-v-3bf2dba7,
+	/deep/.u-button {
+		width: 60% !important;
+	}
+
+	//弹框样式
+	.btnList {
+		// width: 40%;
+		display: flex;
+
+		// display:flex;
+		.u-button[data-v-3bf2dba7] {
+			width: 30%;
+		}
+	}
+
+	/deep/ .u-popup__content {
+		//弹出的宽高
+		height: 100%;
+	}
+
+	/deep/ .u-form-item__body__right__message {
+		//校验的文字的位置
+		margin-left: 10rpx !important;
+	}
+
+	/deep/ .uicon-close {
+		//关闭按钮背景色
+		background-color: rgba(199, 203, 210, 0.9);
+		border-radius: 10%;
+	}
+
+	.checkbox {
+		.checkbox-item {
+			box-sizing: border-box;
+			padding-top: 40px;
+		}
+	}
+
+	//侧边联动
+	.page-body {
+		display: flex;
+		background: #fff;
+		overflow: hidden;
+	}
+
+	.nav {
+		display: flex;
+		width: 100%;
+	}
+
+	.nav-left {
+		width: 25%;
+		background: #fafafa;
+	}
+
+	.nav-left-item {
+		height: 100upx;
+		border-right: solid 1px #f1f1f1;
+		border-bottom: solid 1px #f1f1f1;
+		font-size: 30upx;
+		display: flex;
+		align-items: center;
+		justify-content: center;
+	}
+
+	/deep/.nav-right-item[data-v-73caef23],
+	/deep/.nav-right-item {
+		display: flex;
+		flex-wrap: wrap;
+	}
+
+	.nav-left-item:last-child {
+		border-bottom: none;
+	}
+
+	.nav-right {
+		width: 75%;
+	}
+
+	.box {
+		display: block;
+		overflow: hidden;
+		border-bottom: 20upx solid #f3f3f3;
+		/* min-height: 100vh; */
+		/*若您的子分类过少想使得每个子分类占满屏请放开上边注视 */
+	}
+
+	.box:last-child {
+		border: none;
+		// min-height: 100vh;
+	}
+
+	.nav-right-item {
+		margin-top: 20px;
+		// width: 28%;
+		// min-height: 200upx;
+		float: left;
+		text-align: center;
+		padding: 11upx;
+		font-size: 28upx;
+		background: #fff;
+
+		/deep/.u-checkbox__icon-wrap[data-v-532d01c7],
+		/deep/.u-checkbox__icon-wrap {
+			//复选框的样式
+			margin: 0 20rpx;
+		}
+
+		/deep/ uni-view[data-v-3d1b15f2] {
+			//复选框上线的间距
+			margin: 20rpx 0 !important;
+		}
+
+		// /deep/ .u-checkbox__icon-wrap--square{
+		// 	margin: 20rpx;
+		// }
+		.u-checkbox-label--right[data-v-532d01c7],
+		.u-checkbox-label--right {
+			margin-right: 40rpx;
+		}
+	}
+
+	.nav-right-item image {
+		width: 150upx;
+		height: 150upx;
+	}
+
+	.active {
+		font-weight: 700;
+		color: #274647;
+		background: #fff;
+		border-right: 0;
+	}
+
+	::-webkit-scrollbar {
+		/*取消小程序的默认导航条样式*/
+		width: 0;
+		height: 0;
+		color: transparent;
+	}
+
+	.selectBtn {
+		width: 200rpx;
+		margin-left: 0;
+		font-size: 30rpx;
+		background-color: #4cb2b6;
+	}
+
+	/deep/.u-action-sheet,
+	/deep/.u-transition {
+		overflow-y: auto;
+		height: 1000rpx;
+		background-color: #fff;
+	}
+
+	.example {
+		overflow-y: auto;
+	}
+	.btn{
+		color: #4CB2B6;
+		margin-left: 20px;
+		padding:10rpx 40rpx;
+		border: 1px solid #4CB2B6;
+		border-radius: 8rpx;
+	}
 </style>

+ 480 - 479
pagesA/fire/fpd_detection/fpd_detection.vue

@@ -1,480 +1,481 @@
-<template>
-	<view class="uni-container uni-container-bg">
-		<!-- 搜索框 -->
-		<uni-row class="demo-uni-row padding-tb-sm" :gutter="20" width="100%">
-			<uni-col :span="24">
-				<view class="u-page__tag-item">
-					<u-search placeholder="请输入检测项目名称" bgColor="#edf6f9" borderColor="#4cb2b6" v-model="keyword"
-						:show-action="true" @custom="search"></u-search>
-				</view>
-			</uni-col>
-		</uni-row>
-		<!-- 下拉框 -->
-		<view class="u-page__tag-item"
-			style="margin-bottom: 26upx;width: 700upx;border-bottom: 2px solid #55cbbf;background-color: #f5f7fa;">
-			<u-form>
-				<u-form-item prop="orgName" @click="
-						showOrg = true;
-						hideKeyboard();
-					" label="单位选择:" labelWidth="100px">
-					<!-- <u-picker :show="showOrg" :columns="actions"></u-picker> -->
-					<u--input border="none" disabled v-model="formData.orgName" placeholder="请选择所属单位"></u--input>
-					<u-icon slot="right" name="arrow-down"></u-icon>
-				</u-form-item>
-			</u-form>
-		</view>
-		<!-- 卡片栏 -->
-		<view v-if="tableData.length>0 && isLoaded">
-			<view v-for="(item, index) in tableData" :key="index">
-				<uni-card>
-					<!-- 标题 -->
-					<view class="titles">{{ item.detinspect }}</view>
-					<!-- 简要内容 -->
-					<view style="display: flex;margin-bottom: 15rpx; color: #728f90;">
-						<text class="name-align-drill">检测项目:</text>
-						<text class="conts">{{ item.detinspect }}</text>
-					</view>
-					<view style="display: flex;margin-bottom: 15rpx; color: #728f90;">
-						<text class="name-align-drill">所属单位:</text>
-						<text class="conts">{{ item.orgName }}</text>
-					</view>
-					<view style="display: flex;margin-bottom: 15rpx; color: #728f90;">
-						<text class="name-align-drill"> 检测维保结果:</text>
-						<text class="conts max-width">{{ item.detresult.name }}</text>
-					</view>
-					<!-- 删除按钮 -->
-					<view class="an-niu" @click.native="showModal(item)">
-						<view class="detailDel">删除</view>
-					</view>
-					<view class="an-niu" @click.native="onClick(item,formData.orgName)" link><text
-							class="detail">查看详情</text></view>
-				</uni-card>
-			</view>
-		</view>
-		<!-- tableData为空时显示  -->
-		<view v-else-if="tableData.length==0 && isLoaded" style="text-align: center;">
-			<view class="text-gray" style="padding-top: 20px;" v-if="tableData.length == 0">
-				<img :src="tan90" alt="暂无数据" />
-			</view>
-		</view>
-		<view>
-			<image :src="Group" @click="addClick" class="tiantupian"></image>
-		</view>
-		<u-action-sheet :show="showOrg" :actions="actions" title="请选择单位" @close="showOrg = false"
-			@select="sexSelect"></u-action-sheet>
-		<u-modal :show="show" @confirm="confirm" @cancel="cancel" @close="close" asyncClose closeOnClickOverlay
-			showCancelButton confirmColor="red" :title="title" :content="content" ref="uModal"></u-modal>
-		<!-- 加载中 -->
-		<isLodingModel></isLodingModel>
-	</view>
-</template>
-
-<script>
-	var that = '';
-	import {
-		createFpdDetection, //创建消防设备维护和检测台账
-		updateFpdDetection, //更新消防设备维护和检测台账
-		deleteFpdDetection, //删除消防设备维护和检测台账
-		getFpdDetection, //获得消防设备维护和检测台账
-		getFpdDetectionPage, //获得消防设备维护和检测台账分页
-		exportFpdDetectionExcel, //导出消防设备维护和检测台账 Excel
-		getOrgId
-	} from '@/api/fpdDetection/index.js';
-	import config from '@/config'
-	import {
-		DICT_TYPE,
-		getDictDatas
-	} from '@/utils/dict';
-	const baseUrlImg = config.baseUrlImg
-	export default {
-		data() {
-			return {
-				isLoaded: false,
-				Group: `${baseUrlImg}/checkActive/Group.png`,
-				showOrg: false,
-				actions: [],
-				// 数据
-				tableData: [],
-				title: '是否删除该数据项?',
-				content: '确认删除?',
-				id: '',
-				tan90: `${baseUrlImg}/tan90.png`,
-				// 每页数据量
-				pageSize: 10,
-				// 当前页
-				pageNo: 1,
-				// 数据总量
-				total: 0,
-				// tableData数据加载中
-				loading: false,
-				// 初始化时搜索框的值
-				keyword: '',
-				// 存放orgid,orgname
-				formData: {
-					orgName: '',
-					orgId: '',
-					orgIds:['']
-				},
-				show: false,
-				showtimeStart: false,
-				showtimeEnd: false,
-				// 查询参数
-				queryParams: {
-					pageNo: 1,
-					pageSize: 10,
-					detdate: [],
-					detinspect: null,
-					detresult: null,
-					orgIds:['']
-				},
-
-			}
-		},
-		methods: {
-			//搜索
-			search() {
-				this.getData()
-				// console.log('keyword', this.keyword);
-				// getFpdDetectionPage({
-				// 	detinspect: this.keyword
-				// }).then(res => {
-				// 	// console.log('res', res);
-				// 	if (res.data) {
-				// 		//对检测结果进行初始化
-				// 		const reArr = getDictDatas(DICT_TYPE.BACKEND_DET_RESULT)
-				// 		// console.log('reArr',reArr);
-				// 		this.tableData = res.data.list.map(item => {
-				// 			const thisItem = reArr.find(par => par.value === item.detresult)
-				// 			// console.log('thisItem',thisItem);
-				// 			if (thisItem) {
-				// 				item.detresult = {
-				// 					id: thisItem.value,
-				// 					name: thisItem.label
-				// 				}
-				// 			}
-				// 			return item
-				// 		})
-				// 	} else {
-				// 		this.tableData = []
-				// 	}
-				// })
-			},
-			//新增
-			addClick() {
-				this.isLoaded = false
-				uni.navigateTo({
-					url: `/pagesA/fire/fpd_detection/add_detection/add_detection?&orgName=${this.formData.orgName}&orgId=${this.formData.orgId}`,
-				});
-			},
-			// 模态框内容
-			showModal(val) {
-				this.show = true;
-				this.id = val.id;
-				// console.log('val', this.id);
-			},
-			close() {
-				this.show = false;
-				// console.log('close');
-			},
-			cancel() {
-				this.show = false;
-				// console.log('cancel');
-			},
-			// 隐藏键盘
-			hideKeyboard() {
-				uni.hideKeyboard();
-			},
-			//确定删除
-			confirm() {
-				this.show = false;
-				deleteFpdDetection(this.id).then(response => {
-					this.loading = true;
-					this.isLoaded = false
-					this.tableData = []
-					this.getData();
-					// console.log(this.tableData, '删除后重新获取');
-				});
-			},
-			sexSelect(e) {
-				this.queryParams.orgIds=[]
-				this.formData.orgId= e.isd;
-				this.formData.orgName = e.name;
-				this.tableData=[]
-				console.log(e,'eeeeeeeee');
-				this.getData(e);
-				// 获取培训演练信息详细信息
-				// getFpdDetectionPage({
-				// 	pageNo: this.pageNo,
-				// 	pageSize: this.pageSize,
-				// 	orgIds: this.formData.orgIds
-				// }).then(response => {
-				// 	this.tableData = response.data.list;
-				// });
-			},
-			//获取表格数据
-			getData(e) {
-				this.loading = true;
-				if(e){
-						this.queryParams.orgIds.push(e.id)
-						this.queryParams.orgName=e.name
-				}
-				this.queryParams.detinspect=this.keyword
-				getFpdDetectionPage(this.queryParams).then(response => {
-					this.total = response.data.total
-					this.tableData = [...this.tableData,...response.data.list]
-					if (response.data) {
-						this.loading = false;
-						//对检测结果进行初始化
-						const reArr = getDictDatas(DICT_TYPE.BACKEND_DET_RESULT)
-						// console.log('reArr',reArr);
-						this.tableData = this.tableData.map(item => {
-							const thisItem = reArr.find(par => par.value === item.detresult)
-							// console.log('thisItem',thisItem);
-							if (thisItem) {
-								item.detresult = {
-									id: thisItem.value,
-									name: thisItem.label
-								}
-							}
-							return item
-						})
-						// this.tableData = response.data.list;
-
-					}
-					this.isLoaded = true
-					this.loading = false;
-					// console.log('tableData', this.tableData);
-
-				}).catch(err => {
-						this.isLoaded = true
-						this.loading = false;
-					}
-
-				);
-			},
-			// 传递数据
-			onClick(val, orgName) {
-				// console.log(val.orgName, val, 'val');
-				const navData = JSON.stringify({
-					...val
-				})
-				// console.log('navData', navData);
-				this.isLoaded = false
-				uni.navigateTo({
-					url: '/pagesA/fire/fpd_detection/detection_details/detection_details?id=' + val.id
-				});
-			},
-			// 触底的事件
-			onReachBottom() {
-				// 判断是否还有下一页数据
-				if (this.queryParams.pageNo * this.queryParams.pageSize >= this.total)
-					return uni.showToast({
-						title: `数据加载完毕`
-					});
-				// 判断是否正在请求其它数据,如果是,则不发起额外的请求
-				if (this.loading) return;
-				// this.pageNo += 1;
-				this.queryParams.pageNo += 1
-				this.getData();
-			},
-		},
-		watch: {
-			loading: {
-				handler(newLength, oldLength) {
-					this.$modal.isLoadingModel(this.loading)
-				},
-				immediate: true
-			}
-		},
-		onShow() {
-			// 执行查询
-			// console.log('par',this.queryParams);
-			// this.$set(this.queryParams,'detresult',this.keyword)
-			this.keyword = ''
-			this.actions = []
-			getOrgId({
-				pageNo: this.pageNo,
-				pageSize: this.pageSize,
-				userId: this.$store.state.user.id
-			}).then(response => {
-				// console.log(response, 'response');
-				// 取到用户对应的单位名称与id
-				response.data.map(v => {
-					this.actions.push({
-						id: v.dwid,
-						name: v.orgName
-					});
-				});
-				// console.log(response.data, '21321312');
-				this.formData.orgName = response.data[0].orgName;
-				this.formData.orgId = response.data[0].dwid;
-				this.queryParams.orgName = response.data[0].orgName;
-				this.queryParams.orgIds[0] = response.data[0].dwid;
-				this.tableData = []
-                this.getData()
-				// this.search();
-			}).catch(err => {
-				this.loading = false
-				this.$modal.msg(err)
-			})
-			// this.tableData={}
-			// this.getData();
-		}
-
-	}
-</script>
-
-<style lang="scss" scoped>
-	body {
-		background-color: #f5f7f9;
-	}
-
-	page {
-		background-color: #f5f7f9;
-	}
-
-	/deep/ .u-tabs__wrapper[data-v-0de61367],
-	/deep/ .u-tabs__wrapper.data-v-0de61367,
-	/deep/ .u-tabs__wrapper {
-		width: 99%;
-	}
-
-	/deep/.u-tabs__wrapper__nav__item[data-v-0de61367],
-	/deep/.u-tabs__wrapper__nav__item.data-v-0de61367,
-	/deep/.u-tabs__wrapper__nav__item {
-		padding: 0 60rpx;
-	}
-
-	.uni-container {
-		height: 100vh;
-		padding-right: 20upx;
-	}
-
-	.addInsp {
-		width: 40px;
-		position: fixed;
-		right: 4px;
-		z-index: 99999;
-	}
-
-	::v-deep .u-icon__icon {
-		margin-right: 0px !important;
-	}
-
-	.an-niu {
-		float: right;
-		font-size: 10px;
-		text-align: center;
-		display: flex;
-		margin-top: -64upx;
-		padding-bottom: 30rpx;
-		// margin-top: 50rpx;
-		color: #fff;
-
-		.detail {
-			width: 60px;
-			height: 60rpx;
-			padding: 0 20rpx;
-			border-radius: 30px;
-			background-color: #f7c41e;
-			margin-right: 20rpx;
-			text-align: center;
-			line-height: 60rpx;
-			font-size: 27upx;
-		}
-
-		.detailDel {
-			width: 60px;
-			height: 60rpx;
-			padding: 0 20rpx;
-			border-radius: 30px;
-			background-color: #ff2e31;
-			color: white;
-			margin-right: 20rpx;
-			text-align: center;
-			line-height: 60rpx;
-			font-size: 30upx;
-		}
-
-		.solve {
-			width: 62px;
-			height: 60rpx;
-
-			margin-right: 20rpx;
-			border-radius: 30px;
-			background-color: #4cb2b6;
-			line-height: 60rpx;
-		}
-
-		/deep/ .padding-tb-sm {
-			padding-top: 0px;
-			padding-bottom: 10px;
-		}
-
-		.deletes {
-			width: 62px;
-			height: 60rpx;
-			border-radius: 60rpx;
-			background-color: red;
-			color: #fff;
-			line-height: 60rpx;
-		}
-	}
-
-	/deep/.segmented-control__item--button {
-		background-color: rgb(76, 178, 182) !important;
-	}
-
-	/deep/.segmented-control__item--button--active {
-		background-color: #ffffff !important;
-	}
-
-	/deep/.uni-card {
-		box-shadow: 0px 0px 3px 0px rgba(86, 165, 168, 0.63) !important;
-		border-radius: 30rpx;
-	}
-
-	.tiantupian {
-		width: 110rpx;
-		height: 110rpx;
-		position: fixed;
-		right: 15px;
-		bottom: 80rpx;
-	}
-
-	//列表样式
-	.titles {
-		font-weight: 600;
-		margin-bottom: 10rpx;
-		color: black;
-		font-size: 26rpx;
-	}
-
-	.conts {
-		max-width: 470rpx;
-		display: -webkit-box;
-		/*弹性伸缩盒子模型显示*/
-		-webkit-box-orient: vertical;
-		/*排列方式*/
-		-webkit-line-clamp: 1;
-		/*显示文本行数*/
-		overflow: hidden;
-		/*溢出隐藏*/
-		color: #274647;
-		text-overflow: ellipsis;
-		/*不知道干嘛的*/
-
-		.conts-title {
-			margin-right: 10rpx;
-			color: #728f90;
-		}
-	}
-
-	.max-width {
-		max-width: 180upx;
-	}
-
-	/deep/ .u-form-item__body__left__content__label {
-		font-size: 28upx !important;
-	}
+<template>
+	<view class="uni-container uni-container-bg">
+		<!-- 搜索框 -->
+		<uni-row class="demo-uni-row padding-tb-sm" :gutter="20" width="100%">
+			<uni-col :span="24">
+				<view class="u-page__tag-item">
+					<u-search placeholder="请输入检测项目名称" bgColor="#edf6f9" borderColor="#4cb2b6" v-model="keyword"
+						:show-action="true" @custom="search"></u-search>
+				</view>
+			</uni-col>
+		</uni-row>
+		<!-- 下拉框 -->
+		<view class="u-page__tag-item"
+			style="margin-bottom: 26upx;width: 700upx;border-bottom: 2px solid #55cbbf;background-color: #f5f7fa;">
+			<u-form>
+				<u-form-item prop="orgName" @click="
+						showOrg = true;
+						hideKeyboard();
+					" label="单位选择:" labelWidth="100px">
+					<!-- <u-picker :show="showOrg" :columns="actions"></u-picker> -->
+					<u--input border="none" disabled v-model="formData.orgName" placeholder="请选择所属单位"></u--input>
+					<u-icon slot="right" name="arrow-down"></u-icon>
+				</u-form-item>
+			</u-form>
+		</view>
+		<!-- 卡片栏 -->
+		<view v-if="tableData.length>0 && isLoaded">
+			<view v-for="(item, index) in tableData" :key="index">
+				<uni-card>
+					<!-- 标题 -->
+					<view class="titles">{{ item.detinspect }}</view>
+					<!-- 简要内容 -->
+					<view style="display: flex;margin-bottom: 15rpx; color: #728f90;">
+						<text class="name-align-drill">检测项目:</text>
+						<text class="conts">{{ item.detinspect }}</text>
+					</view>
+					<view style="display: flex;margin-bottom: 15rpx; color: #728f90;">
+						<text class="name-align-drill">所属单位:</text>
+						<text class="conts">{{ item.orgName }}</text>
+					</view>
+					<view style="display: flex;margin-bottom: 15rpx; color: #728f90;">
+						<text class="name-align-drill"> 检测维保结果:</text>
+						<text class="conts max-width">{{ item.detresult.name }}</text>
+					</view>
+					<!-- 删除按钮 -->
+					<view class="an-niu" @click.native="showModal(item)">
+						<view class="detailDel">删除</view>
+					</view>
+					<view class="an-niu" @click.native="onClick(item,formData.orgName)" link><text
+							class="detail">查看详情</text></view>
+				</uni-card>
+			</view>
+		</view>
+		<!-- tableData为空时显示  -->
+		<view v-else-if="tableData.length==0 && isLoaded" style="text-align: center;">
+			<view class="text-gray" style="padding-top: 20px;" v-if="tableData.length == 0">
+				<img :src="tan90" alt="暂无数据" />
+			</view>
+		</view>
+		<view>
+			<image :src="Group" @click="addClick" class="tiantupian"></image>
+		</view>
+		<u-action-sheet :show="showOrg" :actions="actions" title="请选择单位" @close="showOrg = false"
+			@select="sexSelect"></u-action-sheet>
+		<u-modal :show="show" @confirm="confirm" @cancel="cancel" @close="close" asyncClose closeOnClickOverlay
+			showCancelButton confirmColor="red" :title="title" :content="content" ref="uModal"></u-modal>
+		<!-- 加载中 -->
+		<isLodingModel></isLodingModel>
+	</view>
+</template>
+
+<script>
+	var that = '';
+	import {
+		createFpdDetection, //创建消防设备维护和检测台账
+		updateFpdDetection, //更新消防设备维护和检测台账
+		deleteFpdDetection, //删除消防设备维护和检测台账
+		getFpdDetection, //获得消防设备维护和检测台账
+		getFpdDetectionPage, //获得消防设备维护和检测台账分页
+		exportFpdDetectionExcel, //导出消防设备维护和检测台账 Excel
+		getOrgId
+	} from '@/api/fpdDetection/index.js';
+	import config from '@/config'
+	import {
+		DICT_TYPE,
+		getDictDatas
+	} from '@/utils/dict';
+	const baseUrlImg = config.baseUrlImg
+	export default {
+		data() {
+			return {
+				isLoaded: false,
+				Group: `${baseUrlImg}/checkActive/Group.png`,
+				showOrg: false,
+				actions: [],
+				// 数据
+				tableData: [],
+				title: '是否删除该数据项?',
+				content: '确认删除?',
+				id: '',
+				tan90: `${baseUrlImg}/tan90.png`,
+				// 每页数据量
+				pageSize: 10,
+				// 当前页
+				pageNo: 1,
+				// 数据总量
+				total: 0,
+				// tableData数据加载中
+				loading: false,
+				// 初始化时搜索框的值
+				keyword: '',
+				// 存放orgid,orgname
+				formData: {
+					orgName: '',
+					orgId: '',
+					orgIds:['']
+				},
+				show: false,
+				showtimeStart: false,
+				showtimeEnd: false,
+				// 查询参数
+				queryParams: {
+					pageNo: 1,
+					pageSize: 10,
+					detdate: [],
+					detinspect: null,
+					detresult: null,
+					orgIds:['']
+				},
+
+			}
+		},
+		methods: {
+			//搜索
+			search() {
+				this.tableData=[];
+				this.getData()
+				// console.log('keyword', this.keyword);
+				// getFpdDetectionPage({
+				// 	detinspect: this.keyword
+				// }).then(res => {
+				// 	// console.log('res', res);
+				// 	if (res.data) {
+				// 		//对检测结果进行初始化
+				// 		const reArr = getDictDatas(DICT_TYPE.BACKEND_DET_RESULT)
+				// 		// console.log('reArr',reArr);
+				// 		this.tableData = res.data.list.map(item => {
+				// 			const thisItem = reArr.find(par => par.value === item.detresult)
+				// 			// console.log('thisItem',thisItem);
+				// 			if (thisItem) {
+				// 				item.detresult = {
+				// 					id: thisItem.value,
+				// 					name: thisItem.label
+				// 				}
+				// 			}
+				// 			return item
+				// 		})
+				// 	} else {
+				// 		this.tableData = []
+				// 	}
+				// })
+			},
+			//新增
+			addClick() {
+				this.isLoaded = false
+				uni.navigateTo({
+					url: `/pagesA/fire/fpd_detection/add_detection/add_detection?&orgName=${this.formData.orgName}&orgId=${this.formData.orgId}`,
+				});
+			},
+			// 模态框内容
+			showModal(val) {
+				this.show = true;
+				this.id = val.id;
+				// console.log('val', this.id);
+			},
+			close() {
+				this.show = false;
+				// console.log('close');
+			},
+			cancel() {
+				this.show = false;
+				// console.log('cancel');
+			},
+			// 隐藏键盘
+			hideKeyboard() {
+				uni.hideKeyboard();
+			},
+			//确定删除
+			confirm() {
+				this.show = false;
+				deleteFpdDetection(this.id).then(response => {
+					this.loading = true;
+					this.isLoaded = false
+					this.tableData = []
+					this.getData();
+					// console.log(this.tableData, '删除后重新获取');
+				});
+			},
+			sexSelect(e) {
+				this.queryParams.orgIds=[]
+				this.formData.orgId= e.isd;
+				this.formData.orgName = e.name;
+				this.tableData=[]
+				console.log(e,'eeeeeeeee');
+				this.getData(e);
+				// 获取培训演练信息详细信息
+				// getFpdDetectionPage({
+				// 	pageNo: this.pageNo,
+				// 	pageSize: this.pageSize,
+				// 	orgIds: this.formData.orgIds
+				// }).then(response => {
+				// 	this.tableData = response.data.list;
+				// });
+			},
+			//获取表格数据
+			getData(e) {
+				this.loading = true;
+				if(e){
+						this.queryParams.orgIds.push(e.id)
+						this.queryParams.orgName=e.name
+				}
+				this.queryParams.detinspect=this.keyword
+				getFpdDetectionPage(this.queryParams).then(response => {
+					this.total = response.data.total
+					this.tableData = [...this.tableData,...response.data.list]
+					if (response.data) {
+						this.loading = false;
+						//对检测结果进行初始化
+						const reArr = getDictDatas(DICT_TYPE.BACKEND_DET_RESULT)
+						// console.log('reArr',reArr);
+						this.tableData = this.tableData.map(item => {
+							const thisItem = reArr.find(par => par.value === item.detresult)
+							// console.log('thisItem',thisItem);
+							if (thisItem) {
+								item.detresult = {
+									id: thisItem.value,
+									name: thisItem.label
+								}
+							}
+							return item
+						})
+						// this.tableData = response.data.list;
+
+					}
+					this.isLoaded = true
+					this.loading = false;
+					// console.log('tableData', this.tableData);
+
+				}).catch(err => {
+						this.isLoaded = true
+						this.loading = false;
+					}
+
+				);
+			},
+			// 传递数据
+			onClick(val, orgName) {
+				// console.log(val.orgName, val, 'val');
+				const navData = JSON.stringify({
+					...val
+				})
+				// console.log('navData', navData);
+				this.isLoaded = false
+				uni.navigateTo({
+					url: '/pagesA/fire/fpd_detection/detection_details/detection_details?id=' + val.id
+				});
+			},
+			// 触底的事件
+			onReachBottom() {
+				// 判断是否还有下一页数据
+				if (this.queryParams.pageNo * this.queryParams.pageSize >= this.total)
+					return uni.showToast({
+						title: `数据加载完毕`
+					});
+				// 判断是否正在请求其它数据,如果是,则不发起额外的请求
+				if (this.loading) return;
+				// this.pageNo += 1;
+				this.queryParams.pageNo += 1
+				this.getData();
+			},
+		},
+		watch: {
+			loading: {
+				handler(newLength, oldLength) {
+					this.$modal.isLoadingModel(this.loading)
+				},
+				immediate: true
+			}
+		},
+		onShow() {
+			// 执行查询
+			// console.log('par',this.queryParams);
+			// this.$set(this.queryParams,'detresult',this.keyword)
+			this.keyword = ''
+			this.actions = []
+			getOrgId({
+				pageNo: this.pageNo,
+				pageSize: this.pageSize,
+				userId: this.$store.state.user.id
+			}).then(response => {
+				// console.log(response, 'response');
+				// 取到用户对应的单位名称与id
+				response.data.map(v => {
+					this.actions.push({
+						id: v.dwid,
+						name: v.orgName
+					});
+				});
+				// console.log(response.data, '21321312');
+				this.formData.orgName = response.data[0].orgName;
+				this.formData.orgId = response.data[0].dwid;
+				this.queryParams.orgName = response.data[0].orgName;
+				this.queryParams.orgIds[0] = response.data[0].dwid;
+				this.tableData = []
+                this.getData()
+				// this.search();
+			}).catch(err => {
+				this.loading = false
+				this.$modal.msg(err)
+			})
+			// this.tableData={}
+			// this.getData();
+		}
+
+	}
+</script>
+
+<style lang="scss" scoped>
+	body {
+		background-color: #f5f7f9;
+	}
+
+	page {
+		background-color: #f5f7f9;
+	}
+
+	/deep/ .u-tabs__wrapper[data-v-0de61367],
+	/deep/ .u-tabs__wrapper.data-v-0de61367,
+	/deep/ .u-tabs__wrapper {
+		width: 99%;
+	}
+
+	/deep/.u-tabs__wrapper__nav__item[data-v-0de61367],
+	/deep/.u-tabs__wrapper__nav__item.data-v-0de61367,
+	/deep/.u-tabs__wrapper__nav__item {
+		padding: 0 60rpx;
+	}
+
+	.uni-container {
+		height: 100vh;
+		padding-right: 20upx;
+	}
+
+	.addInsp {
+		width: 40px;
+		position: fixed;
+		right: 4px;
+		z-index: 99999;
+	}
+
+	::v-deep .u-icon__icon {
+		margin-right: 0px !important;
+	}
+
+	.an-niu {
+		float: right;
+		font-size: 10px;
+		text-align: center;
+		display: flex;
+		margin-top: -64upx;
+		padding-bottom: 30rpx;
+		// margin-top: 50rpx;
+		color: #fff;
+
+		.detail {
+			width: 60px;
+			height: 60rpx;
+			padding: 0 20rpx;
+			border-radius: 30px;
+			background-color: #f7c41e;
+			margin-right: 20rpx;
+			text-align: center;
+			line-height: 60rpx;
+			font-size: 27upx;
+		}
+
+		.detailDel {
+			width: 60px;
+			height: 60rpx;
+			padding: 0 20rpx;
+			border-radius: 30px;
+			background-color: #ff2e31;
+			color: white;
+			margin-right: 20rpx;
+			text-align: center;
+			line-height: 60rpx;
+			font-size: 30upx;
+		}
+
+		.solve {
+			width: 62px;
+			height: 60rpx;
+
+			margin-right: 20rpx;
+			border-radius: 30px;
+			background-color: #4cb2b6;
+			line-height: 60rpx;
+		}
+
+		/deep/ .padding-tb-sm {
+			padding-top: 0px;
+			padding-bottom: 10px;
+		}
+
+		.deletes {
+			width: 62px;
+			height: 60rpx;
+			border-radius: 60rpx;
+			background-color: red;
+			color: #fff;
+			line-height: 60rpx;
+		}
+	}
+
+	/deep/.segmented-control__item--button {
+		background-color: rgb(76, 178, 182) !important;
+	}
+
+	/deep/.segmented-control__item--button--active {
+		background-color: #ffffff !important;
+	}
+
+	/deep/.uni-card {
+		box-shadow: 0px 0px 3px 0px rgba(86, 165, 168, 0.63) !important;
+		border-radius: 30rpx;
+	}
+
+	.tiantupian {
+		width: 110rpx;
+		height: 110rpx;
+		position: fixed;
+		right: 15px;
+		bottom: 80rpx;
+	}
+
+	//列表样式
+	.titles {
+		font-weight: 600;
+		margin-bottom: 10rpx;
+		color: black;
+		font-size: 26rpx;
+	}
+
+	.conts {
+		max-width: 470rpx;
+		display: -webkit-box;
+		/*弹性伸缩盒子模型显示*/
+		-webkit-box-orient: vertical;
+		/*排列方式*/
+		-webkit-line-clamp: 1;
+		/*显示文本行数*/
+		overflow: hidden;
+		/*溢出隐藏*/
+		color: #274647;
+		text-overflow: ellipsis;
+		/*不知道干嘛的*/
+
+		.conts-title {
+			margin-right: 10rpx;
+			color: #728f90;
+		}
+	}
+
+	.max-width {
+		max-width: 180upx;
+	}
+
+	/deep/ .u-form-item__body__left__content__label {
+		font-size: 28upx !important;
+	}
 </style>