Browse Source

时间查询问题

Shannon_mu 3 years ago
parent
commit
31945ec122
1 changed files with 10 additions and 18 deletions
  1. 10 18
      operationSupport/src/views/propertyManagement/index.vue

+ 10 - 18
operationSupport/src/views/propertyManagement/index.vue

@@ -27,9 +27,10 @@
                 start-placeholder="开始日期"
                 end-placeholder="结束日期"
                 :picker-options="pickerOptions"
+                @change="timeToggle"
                 :editable="false"
             ></el-date-picker>
-            <el-button type="primary" placeholder="状态" class="search-btn" @click="searchInfo" icon="el-icon-search" v-preventReClick
+            <el-button type="primary" placeholder="状态" class="search-btn" @click="mixins_search" icon="el-icon-search" v-preventReClick
                 >查询
             </el-button>
         </div>
@@ -414,25 +415,16 @@ export default {
                 }
             }
         },
-        /**
-         * 查询按钮
-         */
-        searchInfo() {
-            let detaH = this.$moment(new Date()).format('HH');
-            let detaM = this.$moment(new Date()).format('mm');
-            let detaS = this.$moment(new Date()).format('ss');
-            // let d = detaH + ':' + detaM + ':' + detaS;
-            let d = ' 00:00:00';
-            if (this.pickerTime && this.pickerTime.length) {
-                this.mixins_query.startTime = this.pickerTime[0] + '' + d;
-                this.mixins_query.endTime = this.pickerTime[1] + '' + d;
+        timeToggle(e) {
+            let start = '00:00:00',
+                end = '23:59:59';
+            if (!!e) {
+                this.mixins_query.startTime = `${e[0]} ${start}`;
+                this.mixins_query.endTime = `${e[1]} ${end}`;
             } else {
-                this.mixins_query.startTime = this.$moment(new Date())
-                    .subtract(1, 'months')
-                    .format('YYYY-MM-DD' + d);
-                this.mixins_query.endTime = this.$moment(new Date()).format('YYYY-MM-DD' + d);
+                this.mixins_query.startTime = ``;
+                this.mixins_query.endTime = ``;
             }
-            this.mixins_search();
         },
         /**
          *  弹框按钮