Parcourir la source

项目列表时间筛选bug修复

dev01 il y a 1 an
Parent
commit
44b34d01e6
1 fichiers modifiés avec 8 ajouts et 2 suppressions
  1. 8 2
      src/views/project/list/index.vue

+ 8 - 2
src/views/project/list/index.vue

@@ -37,7 +37,7 @@
               <el-option v-for="dict in year" :key="dict.value" :label="dict.label" :value="dict.value" />
             </el-select>
           </el-form-item>
-          <el-form-item label="创建时间">
+          <el-form-item label="起止时间">
             <el-date-picker v-model="dateRange" style="width: 240px" value-format="yyyy-MM-dd" type="daterange"
               range-separator="-" start-placeholder="开始日期" end-placeholder="结束日期"></el-date-picker>
           </el-form-item>
@@ -390,7 +390,11 @@ export default {
     /** 查询用户列表 */
     getList() {
       this.loading = true;
-      listProject(this.addDateRange(this.queryParams, this.dateRange)).then(response => {
+      if (this.dateRange.length > 0) {
+        this.queryParams.startTime = this.dateRange[0];
+        this.queryParams.endTime = this.dateRange[1];
+      }
+      listProject(this.queryParams).then(response => {
         this.userList = response.rows;
         this.total = response.total;
         this.loading = false;
@@ -448,6 +452,8 @@ export default {
     resetQuery() {
       this.dateRange = [];
       this.resetForm("queryForm");
+      this.queryParams.startTime = undefined;
+      this.queryParams.endTime = undefined;
       this.queryParams.deptId = undefined;
       this.superiorName = undefined
       // this.$refs.tree.setCurrentKey(null);