Ver código fonte

导出对接

Ming 4 anos atrás
pai
commit
a077a80edf

+ 14 - 1
common/common.scss

@@ -860,5 +860,18 @@ radio,checkbox {
 	}
     // 导出页面样式end
 	
-	
+	// 导出页面
+	 .uni-date-x--border, .uni-date-x{
+		border-radius:25rpx!important;
+	}
+	.uni-date__x-input{
+		line-height:72rpx;
+	}
+	.example-body {
+		margin:20rpx 20rpx;
+		uni-input, select, option{
+			border:none!important;
+		}
+		
+	}
 	

+ 18 - 0
pages.json

@@ -648,6 +648,24 @@
             }
             
         }
+        ,{
+            "path" : "pages/device-Manage/export/export",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "导出",
+                "enablePullDownRefresh": false
+            }
+            
+        }
+        ,{
+            "path" : "pages/processList/export/export",
+            "style" :                                                                                    
+            {
+                "navigationBarTitleText": "导出",
+                "enablePullDownRefresh": false
+            }
+            
+        }
     ],
 	
 	

+ 4 - 2
pages/device-Manage/device-Manage.vue

@@ -39,11 +39,13 @@
 			return {
 				deviceManage: json.deviceManage,
 				modalName: null,
-				getData:[]
+				getData:[],
+				dwtype:0
 			};
 		},
 
 		onLoad: function(option) {
+			this.dwtype=option.dwtype
 			let url = "";
 			switch (parseInt(option.dwtype)) {
 				case 1:
@@ -98,7 +100,7 @@
 		onNavigationBarButtonTap(e) {
 			console.log(e)
 			uni.navigateTo({
-				url: '/pages/export/export',
+				url: './export/export?dwtype='+this.dwtype,
 
 			});
 		},

+ 124 - 0
pages/device-Manage/export/export.vue

@@ -0,0 +1,124 @@
+<template>
+	<view class="processWrapper exportBody ">
+		<view style="height:98rpx"></view>
+		<view class="ding">
+			<!-- <calendar></calendar> -->
+			<view class="example-body">
+				<uni-datetime-picker v-model="datetimerange" type="datetimerange" start-placeholder="请选择"
+					end-placeholder="请选择" start="2000-3-20 12:00:00" end="2021-10-20 20:00:00" rangeSeparator="至" />
+			</view>
+		</view>
+
+		<block>
+			<view class="processList">
+				<view class="cu-list menu-avatar">
+					<view class="cu-item" v-for="(item,index) in getExportData" :key="index">
+						<view class="cu-avatar lg">
+							<image class="image-bg"
+								:src="item.device_state=='离线'?'/static/device-icon.png':'/static/device-icon.png'" />
+						</view>
+						<view class="content">
+							<view class="pro-title">
+								<view class="cut" >{{item.owner_name}}</view>
+							
+							</view>
+							<view class="pro-des  ">
+								<view class="text-cut">{{item.unitinfo}}</view>
+							</view>
+							<view class="pro-date ">{{item.install_time}}</view>
+						</view>
+						<view class="action" style="z-index:99">
+							<view :class="item.device_state=='离线'?'':'processed'">{{item.device_state}}</view>
+							
+						</view>
+					</view>
+					<view class=" text-center margin-top" v-if="!this.getExportData.length&&this.dataRes">暂无数据...</view>
+				</view>
+			</view>
+		</block>
+		<view class="padding-lr padding-bottom-lg" style="position:fixed;bottom:0;width:100%">
+			<view class="btn-area">
+				<button class="bg-blue  round missReport margin-top" @tap="exportButton()">导 出 </button>
+			</view>
+		</view>
+
+
+
+	</view>
+</template>
+<script>
+	export default {
+		data() {
+			return {
+				getExportData: [],
+				dataRes: 0,
+				datetimerange: ['', ''],
+				keyWords:'',
+				dwtype:0
+			};
+		},
+		onLoad: function(option) {
+			this.dwtype=option.dwtype
+			this.getData({
+				"company_code": uni.getStorageSync('selectedCode'),
+				"dwtype":this.dwtype,
+				"start_time": '',
+				"end_time": '',
+			})
+
+		},
+		watch: {
+			datetimerange(newval) {
+				this.getData({
+					"company_code": uni.getStorageSync('selectedCode'),
+					"dwtype":this.dwtype,
+					"start_time":newval[0],
+					"end_time": newval[1],
+				})
+			}
+		},
+		
+		methods: {
+			async getData(params = {}) {
+				const res = await this.$myRequest({
+					url: 'DeviceManagement/getDeviceList', //设备管理列表渲染
+					data: params,
+					showLoading: true
+				})
+				this.getExportData = res.data.data;
+				this.dataRes = 1;
+			},
+			exportButton() {
+				alert(this.dwtype)
+
+				//#ifdef H5
+				let exportUrl = this.$BASE_URL+
+					`ExportModule/getDeviceListExpor/start_time/${this.datetimerange[0]}/end_time/${this.datetimerange[1]}/dwtype/${this.dwtype}/company_code/${uni.getStorageSync('selectedCode')}/`
+				var ua = window.navigator.userAgent.toLowerCase();
+				if (ua.match(/MicroMessenger/i) == 'micromessenger') {
+					uni.showModal({
+						showCancel: false,
+						content: '如需下载,请在默认浏览器中操作',
+						success: function(res) {
+							window.location.href = exportUrl;
+						}
+					});
+				} else {
+					window.location.href = exportUrl;
+				}
+				//#endif
+
+			}
+
+
+
+
+
+		}
+	}
+</script>
+
+<style lang="scss">
+
+
+</style>

+ 13 - 39
pages/deviceOffLine/deviceOffLine.vue

@@ -108,10 +108,8 @@
 					return item
 				})
 			}
-
 		},
 
-
 		mounted() {
 			document.addEventListener('click', (e) => {
 				if (e.target.className != 'showDetail') {
@@ -142,48 +140,24 @@
 			});
 		},
 		
-		// 自定义导航事件
+		// 自定义导航事件   (导出操作)
 		onNavigationBarButtonTap(e) {
 			if (e.float == 'right') {
-				alert("你点击了导出");
-				
-					//#ifdef H5
-				
-			// 	this.exportData({
-			// 		"status_type":this.status_type,
-			// 		"transfer_type":this. transfer_type1,
-			// 		dwtype:this.dwtype1,
-			// 		company_code:uni.getStorageSync('selectedCode')
-					
-			// 	})
-				
-			// return;
-		
-			
+				//#ifdef H5
 				let exportUrl= this.$BASE_URL+`ExportModule/getStatusDetailsListExpor/status_type/${this.status_type}/company_code/${uni.getStorageSync('selectedCode')}/ transfer_type/${this. transfer_type1}/dwtype/${this.dwtype1}/`
+				var ua = window.navigator.userAgent.toLowerCase();
+				if(ua.match(/MicroMessenger/i) == 'micromessenger'){
+					uni.showModal({
+						showCancel: false,
+						content: '如需下载,请在默认浏览器中操作',
+						success:function(res){
+							window.location.href=exportUrl;
+						}
+					});
+				}else{
 					window.location.href=exportUrl;
-					
-					
-					
-					
-			
-				
-				// window.open(URL,name,features,replace)
-				
-				
-				// 通过创建a标签实现
-				const link = document.createElement("a");
-				link.href = exportUrl;
-				// 对下载的文件命名
-				// link.open = "设备注册管理数据表.xls";
-				link.target="_blank"
-				console.log(link)
-				link.click();
-				
-				// window.open(exportUrl,true)
+				}
 				//#endif
-				
-			
 			} 
 		},
 

+ 137 - 122
pages/export/export.vue

@@ -1,148 +1,163 @@
 <template>
-	<view class="processWrapper ">
-		<view style="height:98rpx"></view>
-		<view class="ding">
-			<calendar></calendar>
+	<view class="processWrapper exportBody ">
+		<view style="height:98rpx"></view>
+		<view class="ding">
+			<!-- <calendar></calendar> -->
+			<view class="example-body">
+				<uni-datetime-picker v-model="datetimerange" type="datetimerange" start-placeholder="请选择"
+					end-placeholder="请选择" start="2000-3-20 12:00:00" end="2021-10-20 20:00:00" rangeSeparator="至" />
+			</view>
 		</view>
 
-		<block v-if="TabCur==0">
-			<view class="processList" >
-					<view class="cu-list menu-avatar">
-						
-						<view class="cu-item" v-for="(item,index) in unporcessList" :key="index">
-							<view class="cu-avatar lg" >
-								<image class="image-bg" src="/static/process-icon.png"/>
-							</view>
-							<view class="content">
-								<view class="pro-title">
-									<view class="cut">{{item.title}}</view>
-								</view>
-								<view class="pro-des  ">
-									<view class="text-cut">
-										{{item.des}}
-									</view>
-								</view>
-								<view class="pro-date ">{{item.time}}</view>
+		<block>
+			<view class="processList">
+				<view class="cu-list menu-avatar">
+					<view class="cu-item" v-for="(item,index) in getExportData" :key="index">
+						<view class="cu-avatar lg">
+							<image class="image-bg"
+								:src="item.clzt==0?'/static/process-icon.png':'/static/processed-icon.png'" />
+						</view>
+						<view class="content">
+							<view class="pro-title">
+								<view class="cut" v-if="keyWords=='人工督察单'">{{item.artificial_code}}</view>
+								<view class="cut" v-if="keyWords=='电子督察单'">{{item.supervise_code}}</view>
 							</view>
-							<view class="action" style="z-index:99">
-								<view class="unProcess" v-if="type==1" >未处理</view>
-								<view class="unProcess" v-else>未处理</view>
+							<view class="pro-des  ">
+								<view class="text-cut">{{item.content}}</view>
 							</view>
-						</view>
-						<view class=" text-center margin-top" v-if="unporcessList.length === 0">暂无数据...</view>
+							<view class="pro-date ">{{item.timestamp}}</view>
+						</view>
+						<view class="action" style="z-index:99">
+							<view class="unProcess" v-if="item.clzt==0">未处理</view>
+							<view class="processed" v-else>已处理</view>
+						</view>
 					</view>
+					<view class=" text-center margin-top" v-if="!this.getExportData.length&&this.dataRes">暂无数据...</view>
+				</view>
 			</view>
-		</block>
-		<view class="padding-lr padding-bottom-lg" style="position:fixed;bottom:0;width:100%">
-			<view class="btn-area">
-				<button class="bg-blue  round missReport margin-top" @tap="showModal" data-target="DialogModal" >导 出 </button>
-			</view>
-		</view>
-		
-		
-		<!-- 弹框 -->
-		<view class="cu-modal export-modal" :class="modalName=='DialogModal'?'show':''">
-			<view class="cu-dialog">
-				<view class="cu-bar bg-white justify-end">
-					<view class="action" @tap="hideModal">
-						<text class="cuIcon-close"></text>
-					</view>
-				</view>
-				<view class="padding-sm bg-white">
-					<image src="../../static/ok.png" style="width:100rpx;height:100rpx"></image>
-					<view style="margin:20rpx 0">已导出文件,是否打开?</view>
-				</view>
-				<view class="cu-bar bg-white  operate" style="min-height: 100rpx;">
-					<view class="action margin-0  " @tap="hideModal">
-						另存为</view>
-					<view class="action margin-0  solid-left text-blue" @tap="hideModal">打开</view>
-				</view>
-			</view>
-		</view>
-		
-		
+		</block>
+		<view class="padding-lr padding-bottom-lg" style="position:fixed;bottom:0;width:100%">
+			<view class="btn-area">
+				<button class="bg-blue  round missReport margin-top" @tap="exportButton()">导 出 </button>
+			</view>
+		</view>
+
+
+
 	</view>
 </template>
+<script>
+	
+	
+	
+	
+	
+</script>
 
 <script>
 	import json from '../../data/json.js';
 	export default {
 		data() {
 			return {
-				 unporcessList: json.unprocessList,
-				 porcessedList: json.processedList,
-	
-				type: '0',
-				modalName: null,
-				listTouchStart: 0,
-				listTouchDirection: null,
-				CustomBar: this.CustomBar,
-				TabCur: 0,
-				tabNav: ['未处理', '已处理'],
-				
-				
-				CustomBar: this.CustomBar,
-				modalName: null,
+				getExportData: [],
+				dataRes: 0,
+				// datetimerange: ['2021-03-20 20:10:10', '2021-05-10 10:10:10'],
+				datetimerange: ['', ''],
+				keyWords:'',
+		
 			};
 		},
-		onLoad: function(option) {
-			
-
-			
-		},
-		
-		onNavigationBarButtonTap(e) {
-			console.log(e)
-			uni.navigateTo({
-				url: '/pages/export/export',
-				success: res => {},
-				fail: () => {},
-				complete: () => {}
-			});
+		onLoad: function(option) {
+			this.keyWords=option.keywords;
+			alert(this.keyWords)
+			this.getData({
+				"company_code": uni.getStorageSync('selectedCode'),
+				"start_time": '',
+				"end_time": '',
+			})
+
+		},
+		watch: {
+			datetimerange(newval) {
+				this.getData({
+					"company_code": uni.getStorageSync('selectedCode'),
+					
+					"start_time":newval[0],
+					"end_time": newval[1],
+				})
+			}
 		},
-		methods: {
-			
-			showModal(e) {
-				this.modalName = e.currentTarget.dataset.target
-			},
-			hideModal(e) {
-				this.modalName = null
-			},
-			
-			// exportData(){
-			// 	uni.showModal({
-			// 	    title: '提示',
-			// 	    content: '已导出文件是否打开?',
-			// 	    success: function (res) {
-			// 	        if (res.confirm) {
-			// 	            console.log('用户点击确定');
-			// 	        } else if (res.cancel) {
-			// 	            console.log('用户点击取消');
-			// 	        }
-			// 	    }
-			// 	});
-			// },
-			
-			InputFocus(e) {
-				this.InputBottom = e.detail.height
-			},
-			InputBlur(e) {
-				this.InputBottom = 0
-			},
-			
-			
-
-			tabSelect(e) {
-				console.log(e.currentTarget);
-				this.TabCur = e.currentTarget.dataset.id;
-				this.scrollLeft = (e.currentTarget.dataset.id - 1) * 60;
+		
+		methods: {
+
+			async getData(params = {}) {
+				
+				let listUrl = "";
+				switch (this.keyWords) {
+					case '人工督察单':
+						listUrl = "FireInspector/getManualInspectorList"
+						break;
+					case '电子督察单':
+						listUrl = "FireInspector/getElectronicInspectorList"
+						break;
+					default:
+						break;
+				}
+				alert(listUrl)
+
+				
+				const res = await this.$myRequest({
+					url: listUrl, //人员督察单渲染
+					data: params,
+					showLoading: true
+				})
+				this.getExportData = res.data.data;
+				this.dataRes = 1;
 			},
+			exportButton() {
+				let url2 = "";
+				switch (this.keyWords) {
+					case '人工督察单':
+						url2 = "ExportModule/getManualInspectorListExpor"
+						break;
+					case '电子督察单':
+						url2 = "ExportModule/getElectronicInspectorListExpor"
+						break;
+					default:
+						break;
+				}
+				
+				
+				//#ifdef H5
+				alert(this.$BASE_URL)
+				alert(url2)
+				let exportUrl = this.$BASE_URL +url2+
+					`/start_time/${this.datetimerange[0]}/end_time/${this.datetimerange[1]}/company_code/${uni.getStorageSync('selectedCode')}/`
+				var ua = window.navigator.userAgent.toLowerCase();
+				if (ua.match(/MicroMessenger/i) == 'micromessenger') {
+					uni.showModal({
+						showCancel: false,
+						content: '如需下载,请在默认浏览器中操作',
+						success: function(res) {
+							window.location.href = exportUrl;
+						}
+					});
+				} else {
+					window.location.href = exportUrl;
+				}
+				//#endif
+
+			}
+
+
+
+
 
-			
 		}
 	}
 </script>
 
 <style lang="scss">
-	
+
+
 </style>

+ 5 - 2
pages/inspectList/processList/processList.vue

@@ -87,7 +87,8 @@
 				record_count: '',
 				record_count1: '',
 				
-				requestUrl:''
+				requestUrl:'',
+				keyWords:''
 
 
 			};
@@ -95,10 +96,12 @@
 		onLoad: function(option) {
 			this.type=option.type;
 			if(option.type==1){
+				this.keyWords='人工督察单';
 				uni.setNavigationBarTitle({
 					title: "消防支队人工督察单",
 				});
 			}else{
+				this.keyWords='电子督察单';
 				uni.setNavigationBarTitle({
 					title: "消防支队电子督察单",
 				});
@@ -115,7 +118,7 @@
 		onNavigationBarButtonTap(e) {
 			console.log(e)
 			uni.navigateTo({
-				url: '/pages/export/export',
+				url: '/pages/export/export?keywords='+this.keyWords,
 				success: res => {},
 				fail: () => {},
 				complete: () => {}

+ 129 - 0
pages/processList/export/export.vue

@@ -0,0 +1,129 @@
+<template>
+	<view class="processWrapper exportBody ">
+		<view style="height:98rpx"></view>
+		<view class="ding">
+			<!-- <calendar></calendar> -->
+			<view class="example-body">
+				<uni-datetime-picker v-model="datetimerange" type="datetimerange" start-placeholder="请选择"
+					end-placeholder="请选择" start="2000-3-20 12:00:00" end="2021-10-20 20:00:00" rangeSeparator="至" />
+			</view>
+		</view>
+
+		<block>
+			<view class="processList">
+				<view class="cu-list menu-avatar">
+					<view class="cu-item" v-for="(item,index) in getExportData" :key="index">
+						<view class="cu-avatar lg">
+							
+							<image class="image-bg" :src="item.clzt==1?'/static/process-icon.png':'/static/processed-icon.png'"/>
+							<!-- <image class="image-bg"
+								:src="item.device_state=='离线'?'/static/device-icon.png':'/static/device-icon.png'" /> -->
+						</view>
+						<view class="content">
+							<view class="pro-title">
+								<view class="cut" >{{item.owner_name}}</view>
+							
+							</view>
+							<view class="pro-des  ">
+								<view class="text-cut">{{item.unitinfo}}</view>
+							</view>
+							<view class="pro-date ">{{item.time}}</view>
+						</view>
+						<view class="action" style="z-index:99">
+							<view class="unProcess"  v-if="item.clzt==1">未处理</view>
+							<view class="processed" v-else>已处理</view>
+							
+							<!-- <view :class="item.device_state=='离线'?'':'processed'">{{item.device_state}}</view> -->
+							
+						</view>
+					</view>
+					<view class=" text-center margin-top" v-if="!this.getExportData.length&&this.dataRes">暂无数据...</view>
+				</view>
+			</view>
+		</block>
+		<view class="padding-lr padding-bottom-lg" style="position:fixed;bottom:0;width:100%">
+			<view class="btn-area">
+				<button class="bg-blue  round missReport margin-top" @tap="exportButton()">导 出 </button>
+			</view>
+		</view>
+
+
+
+	</view>
+</template>
+<script>
+	export default {
+		data() {
+			return {
+				getExportData: [],
+				dataRes: 0,
+				datetimerange: ['', ''],
+				keyWords:'',
+				type:0
+			};
+		},
+		onLoad: function(option) {
+			this.type=option.type
+			this.getData({
+				"company_code": uni.getStorageSync('selectedCode'),
+				"type":this.type,
+				"start_time": '',
+				"end_time": '',
+			})
+
+		},
+		watch: {
+			datetimerange(newval) {
+				this.getData({
+					"company_code": uni.getStorageSync('selectedCode'),
+					"type":this.type,
+					"start_time":newval[0],
+					"end_time": newval[1],
+				})
+			}
+		},
+		
+		methods: {
+			async getData(params = {}) {
+				const res = await this.$myRequest({
+					url: 'ComprehensiveAlarm/getIntegratedAlarmList', //综合告警列表渲染
+					data: params,
+					showLoading: true
+				})
+				this.getExportData = res.data.data;
+				this.dataRes = 1;
+			},
+			exportButton() {
+				alert(this.type)
+
+				//#ifdef H5
+				let exportUrl = this.$BASE_URL+
+					`ExportModule/getDeviceListExpor/start_time/${this.datetimerange[0]}/end_time/${this.datetimerange[1]}/type/${this.type}/company_code/${uni.getStorageSync('selectedCode')}/`
+				var ua = window.navigator.userAgent.toLowerCase();
+				if (ua.match(/MicroMessenger/i) == 'micromessenger') {
+					uni.showModal({
+						showCancel: false,
+						content: '如需下载,请在默认浏览器中操作',
+						success: function(res) {
+							window.location.href = exportUrl;
+						}
+					});
+				} else {
+					window.location.href = exportUrl;
+				}
+				//#endif
+
+			}
+
+
+
+
+
+		}
+	}
+</script>
+
+<style lang="scss">
+
+
+</style>

+ 1 - 1
pages/processList/processList.vue

@@ -163,7 +163,7 @@
 		onNavigationBarButtonTap(e) {
 			console.log(e)
 			uni.navigateTo({
-				url: '/pages/export/export',
+				url: './export/export?type='+this.type,
 				success: res => {},
 				fail: () => {},
 				complete: () => {}