瀏覽代碼

修复时间筛选bug

dev01 8 月之前
父節點
當前提交
c0ec53da6e
共有 2 個文件被更改,包括 21 次插入9 次删除
  1. 6 2
      src/views/project/list/index.vue
  2. 15 7
      src/views/record/list/index.vue

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

@@ -258,7 +258,7 @@
             v-if="columns[9].visible"
           >
             <template slot-scope="scope">
-              <div style="font-size: 12px;">
+              <div style="font-size: 12px">
                 {{ scope.row.startTime + " 至 " + scope.row.endTime }}
               </div>
             </template>
@@ -649,9 +649,13 @@ export default {
     /** 查询用户列表 */
     getList() {
       this.loading = true;
-      if (this.dateRange.length > 0) {
+      let dateRange = Array.isArray(this.dateRange) ? this.dateRange : [];
+      if (dateRange.length > 0) {
         this.queryParams.startTime = this.dateRange[0];
         this.queryParams.endTime = this.dateRange[1];
+      } else {
+        this.queryParams.startTime = undefined;
+        this.queryParams.endTime = undefined;
       }
       listProject(this.queryParams).then((response) => {
         this.userList = response.rows;

+ 15 - 7
src/views/record/list/index.vue

@@ -539,16 +539,24 @@ export default {
     });
   },
   methods: {
-    /** 查询用户列表 */
+    /** 查询列表 */
     getList() {
       this.loading = true;
-      if (this.dateRange.length > 0) {
-        this.queryParams.startTime = this.dateRange[0];
-        this.queryParams.endTime = this.dateRange[1];
+      let dateRange = Array.isArray(this.dateRange) ? this.dateRange : [];
+      if (dateRange.length > 0) {
+        this.queryParams.startTime = dateRange[0];
+        this.queryParams.endTime = dateRange[1];
+      } else {
+        this.queryParams.startTime = undefined;
+        this.queryParams.endTime = undefined;
       }
-      if (this.datResearch.length > 0) {
-        this.queryParams.researchStart = this.datResearch[0];
-        this.queryParams.researchEnd = this.datResearch[1];
+      let datResearch = Array.isArray(this.datResearch) ? this.datResearch : [];
+      if (datResearch.length > 0) {
+        this.queryParams.researchStart = datResearch[0];
+        this.queryParams.researchEnd = datResearch[1];
+      } else {
+        this.queryParams.researchStart = undefined;
+        this.queryParams.researchEnd = undefined;
       }
       this.queryParams.roleType = 3;
       listRecord(this.queryParams).then((response) => {