Browse Source

时间参数

FinalYu 1 year ago
parent
commit
da36b4e2e9
1 changed files with 8 additions and 2 deletions
  1. 8 2
      reado-app/pages/reportForm/data-item.vue

+ 8 - 2
reado-app/pages/reportForm/data-item.vue

@@ -145,8 +145,14 @@
 			},
 			//确认按钮查询
 			handelQuery() {
-				this.queryParams.startTime = this.range[0] + ' 00:00:00'
-				this.queryParams.endTime = this.range[1] + ' 00:00:00'
+				var date = new Date()
+				var timestr = date.getHours() < 10 ? ('0' + date.getHours()) : date.getHours()
+				timestr += ':'
+				timestr += date.getMinutes() < 10 ? ('0' + date.getMinutes()) : date.getMinutes()
+				timestr += ':'
+				timestr += date.getSeconds() < 10 ? ('0' + date.getSeconds()) : date.getSeconds()
+				this.queryParams.startTime = this.range[0] + ' ' + timestr
+				this.queryParams.endTime = this.range[1] + ' ' + timestr
 				uni.$http.get('/itemGroup/itemDataQuery', this.queryParams).then(res => {
 					const data = res.data
 					if (data.code === 200) {