소스 검색

修复时间筛选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) => {