Browse Source

删除对象空值

caojunjie 3 years ago
parent
commit
2bd951d44f
1 changed files with 8 additions and 0 deletions
  1. 8 0
      src/views/landTransportation/bulkReportAnalysis/index.vue

+ 8 - 0
src/views/landTransportation/bulkReportAnalysis/index.vue

@@ -1069,6 +1069,13 @@ export default {
       this.activeName = tab
       this.onLoad(this.page)
     },
+    //删除对象空值
+    removeProperty(obj) {
+      Object.keys(obj).forEach(item => {
+        if (obj[item] === '' || obj[item] === undefined || obj[item] === null || obj[item] === 'null') delete obj[item]
+      })
+      return obj
+    },
     //查询
     onLoad(page, params) {
       motorcadeDriver(4).then(res => {
@@ -1086,6 +1093,7 @@ export default {
         queryParams.endArrivalTime = queryParams.arrivalTime[1]
         delete queryParams.arrivalTime
       }
+      queryParams = this.removeProperty(queryParams)
       this.loading = true;
       if (this.loading) this.dialogVisibleTwo = false
       standingBookCollection(queryParams).then(res => {