Browse Source

时间组件bug

lilei 3 years ago
parent
commit
7a86a774f1

+ 8 - 2
src/views/reportData/actualSalesReport/list.vue

@@ -328,7 +328,13 @@ export default {
     },
     },
     //  创建时间  change
     //  创建时间  change
     dateChange (date) {
     dateChange (date) {
-      this.queryParam.time = date
+      if (date.length) {
+        if (date[0] == '' && date[1] == '') {
+          this.resetSearchForm()
+        } else {
+          this.queryParam.time = date
+        }
+      }
       this.queryParam.beginDate = date[0]
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
       this.queryParam.endDate = date[1]
     },
     },
@@ -337,7 +343,6 @@ export default {
     },
     },
     //  重置
     //  重置
     resetSearchForm () {
     resetSearchForm () {
-      this.$refs.rangeDate.resetDate()
       this.queryParam.time = []
       this.queryParam.time = []
       this.queryParam.beginDate = ''
       this.queryParam.beginDate = ''
       this.queryParam.endDate = ''
       this.queryParam.endDate = ''
@@ -349,6 +354,7 @@ export default {
         'subareaSn': undefined,
         'subareaSn': undefined,
         'dealerLevel': undefined
         'dealerLevel': undefined
       }
       }
+      this.$refs.rangeDate.resetDate()
       this.$refs.custList.resetForm()
       this.$refs.custList.resetForm()
       this.$refs.ruleForm.resetFields()
       this.$refs.ruleForm.resetFields()
       this.$refs.table.clearTable()
       this.$refs.table.clearTable()

+ 9 - 3
src/views/reportData/allocationDetails/list.vue

@@ -271,9 +271,15 @@ export default {
     },
     },
     //  创建时间  change
     //  创建时间  change
     dateChange (date) {
     dateChange (date) {
-      this.queryParam.time = date
-      this.queryParam.beginDate = date[0] || ''
-      this.queryParam.endDate = date[1] || ''
+      if (date.length) {
+        if (date[0] == '' && date[1] == '') {
+          this.resetSearchForm()
+        } else {
+          this.queryParam.time = date
+        }
+      }
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
     },
     },
     // 合计
     // 合计
     getCount (params) {
     getCount (params) {

+ 9 - 3
src/views/reportData/allocationOrderTotal/list.vue

@@ -158,9 +158,15 @@ export default {
     },
     },
     //  创建时间  change
     //  创建时间  change
     dateChange (date) {
     dateChange (date) {
-      this.queryParam.time = date
-      this.queryParam.beginDate = date[0] || ''
-      this.queryParam.endDate = date[1] || ''
+      if (date.length) {
+        if (date[0] == '' && date[1] == '') {
+          this.resetSearchForm()
+        } else {
+          this.queryParam.time = date
+        }
+      }
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
     },
     },
     // 合计
     // 合计
     getCount (params) {
     getCount (params) {

+ 9 - 3
src/views/reportData/billingReturnReport/list.vue

@@ -327,9 +327,15 @@ export default {
     },
     },
     //  创建时间  change
     //  创建时间  change
     dateChange (date) {
     dateChange (date) {
-      this.queryParam.time = date
-      this.queryParam.beginDate = date[0] || ''
-      this.queryParam.endDate = date[1] || ''
+      if (date.length) {
+        if (date[0] == '' && date[1] == '') {
+          this.resetSearchForm()
+        } else {
+          this.queryParam.time = date
+        }
+      }
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
     },
     },
     custChange (val) {
     custChange (val) {
       this.queryParam.dealer.dealerSn = val.key
       this.queryParam.dealer.dealerSn = val.key

+ 9 - 3
src/views/reportData/returnSlipReport/list.vue

@@ -331,9 +331,15 @@ export default {
     },
     },
     //  创建时间  change
     //  创建时间  change
     dateChange (date) {
     dateChange (date) {
-      this.queryParam.time = date
-      this.queryParam.beginDate = date[0] || ''
-      this.queryParam.endDate = date[1] || ''
+      if (date.length) {
+        if (date[0] == '' && date[1] == '') {
+          this.resetSearchForm()
+        } else {
+          this.queryParam.time = date
+        }
+      }
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
     },
     },
     custChange (val) {
     custChange (val) {
       this.queryParam.dealer.dealerSn = val.key
       this.queryParam.dealer.dealerSn = val.key

+ 7 - 1
src/views/reportData/salesAmountReport/list.vue

@@ -328,7 +328,13 @@ export default {
     },
     },
     //  创建时间  change
     //  创建时间  change
     dateChange (date) {
     dateChange (date) {
-      this.queryParam.time = date
+      if (date.length) {
+        if (date[0] == '' && date[1] == '') {
+          this.resetSearchForm()
+        } else {
+          this.queryParam.time = date
+        }
+      }
       this.queryParam.beginDate = date[0]
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
       this.queryParam.endDate = date[1]
     },
     },

+ 9 - 3
src/views/reportData/salesReturnReport/list.vue

@@ -327,9 +327,15 @@ export default {
     },
     },
     //  创建时间  change
     //  创建时间  change
     dateChange (date) {
     dateChange (date) {
-      this.queryParam.time = date
-      this.queryParam.beginDate = date[0] || ''
-      this.queryParam.endDate = date[1] || ''
+      if (date.length) {
+        if (date[0] == '' && date[1] == '') {
+          this.resetSearchForm()
+        } else {
+          this.queryParam.time = date
+        }
+      }
+      this.queryParam.beginDate = date[0]
+      this.queryParam.endDate = date[1]
     },
     },
     custChange (val) {
     custChange (val) {
       this.queryParam.dealer.dealerSn = val.key
       this.queryParam.dealer.dealerSn = val.key

+ 7 - 1
src/views/reportData/salesSlipReport/list.vue

@@ -335,7 +335,13 @@ export default {
     },
     },
     //  创建时间  change
     //  创建时间  change
     dateChange (date) {
     dateChange (date) {
-      this.queryParam.time = date
+      if (date.length) {
+        if (date[0] == '' && date[1] == '') {
+          this.resetSearchForm()
+        } else {
+          this.queryParam.time = date
+        }
+      }
       this.queryParam.beginDate = date[0]
       this.queryParam.beginDate = date[0]
       this.queryParam.endDate = date[1]
       this.queryParam.endDate = date[1]
     },
     },