Ver código fonte

优化轮胎费用报表

chenrui 9 meses atrás
pai
commit
9e6d45de3b

+ 9 - 2
src/views/reportData/tireFeeReport/index.vue

@@ -6,10 +6,10 @@
           <monthQueryList ref="tireMonthQueryList"></monthQueryList>
           <monthQueryList ref="tireMonthQueryList"></monthQueryList>
         </a-tab-pane>
         </a-tab-pane>
         <a-tab-pane key="2" tab="轮胎季度费用报表" force-render>
         <a-tab-pane key="2" tab="轮胎季度费用报表" force-render>
-          <quarterQueryList></quarterQueryList>
+          <quarterQueryList ref="tireQuarterQueryList"></quarterQueryList>
         </a-tab-pane>
         </a-tab-pane>
         <a-tab-pane key="3" tab="轮胎年度费用报表" force-render>
         <a-tab-pane key="3" tab="轮胎年度费用报表" force-render>
-          <yearQueryList></yearQueryList>
+          <yearQueryList ref="tireYearQueryList"></yearQueryList>
         </a-tab-pane>
         </a-tab-pane>
       </a-tabs>
       </a-tabs>
     </a-card>
     </a-card>
@@ -34,6 +34,13 @@ export default {
     // 切换tab值  change
     // 切换tab值  change
     handleChange (val) {
     handleChange (val) {
       this.tabVal = val
       this.tabVal = val
+      if (val == 1) {
+        this.$refs.tireMonthQueryList.pageInit()
+      } else if (val == 2) {
+        this.$refs.tireQuarterQueryList.pageInit()
+      } else {
+        this.$refs.tireYearQueryList.pageInit()
+      }
     },
     },
     // 初始化
     // 初始化
     pageInit () {
     pageInit () {

+ 1 - 14
src/views/reportData/tireFeeReport/monthQueryList.vue

@@ -378,26 +378,13 @@ export default {
       this.$nextTick(() => { // 页面渲染完成后的回调
       this.$nextTick(() => { // 页面渲染完成后的回调
         this.setTableH()
         this.setTableH()
       })
       })
+      this.resetSearchForm()
     },
     },
     // 计算表格高度
     // 计算表格高度
     setTableH () {
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 280
       this.tableHeight = window.innerHeight - tableSearchH - 280
     }
     }
-  },
-  mounted () {
-    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.pageInit()
-    }
-  },
-  activated () {
-    // 如果是新页签打开,则重置当前页面
-    if (this.$store.state.app.isNewTab) {
-      this.pageInit()
-    }
-  },
-  beforeRouteEnter (to, from, next) {
-    next(vm => {})
   }
   }
 }
 }
 </script>
 </script>

+ 1 - 15
src/views/reportData/tireFeeReport/quarterQueryList.vue

@@ -318,27 +318,13 @@ export default {
       this.$nextTick(() => { // 页面渲染完成后的回调
       this.$nextTick(() => { // 页面渲染完成后的回调
         this.setTableH()
         this.setTableH()
       })
       })
-      this.getQuarterVal()
+      this.resetSearchForm()
     },
     },
     // 计算表格高度
     // 计算表格高度
     setTableH () {
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 280
       this.tableHeight = window.innerHeight - tableSearchH - 280
     }
     }
-  },
-  mounted () {
-    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.pageInit()
-    }
-  },
-  activated () {
-    // 如果是新页签打开,则重置当前页面
-    if (this.$store.state.app.isNewTab) {
-      this.pageInit()
-    }
-  },
-  beforeRouteEnter (to, from, next) {
-    next(vm => {})
   }
   }
 }
 }
 </script>
 </script>

+ 3 - 16
src/views/reportData/tireFeeReport/yearQueryList.vue

@@ -281,8 +281,8 @@ export default {
     //  重置
     //  重置
     resetSearchForm () {
     resetSearchForm () {
       this.queryParam.queryType = 'year'
       this.queryParam.queryType = 'year'
-      const lastYear = moment().year()
-      this.queryParam.queryDate = lastYear
+      const nowYear = moment().year()
+      this.queryParam.queryDate = nowYear
       this.queryParam.dealerEntity.provinceSn = undefined
       this.queryParam.dealerEntity.provinceSn = undefined
       this.queryParam.dealerEntity.citySn = undefined
       this.queryParam.dealerEntity.citySn = undefined
       this.queryParam.dealerEntity.districtSn = undefined
       this.queryParam.dealerEntity.districtSn = undefined
@@ -329,26 +329,13 @@ export default {
       this.$nextTick(() => { // 页面渲染完成后的回调
       this.$nextTick(() => { // 页面渲染完成后的回调
         this.setTableH()
         this.setTableH()
       })
       })
+      this.resetSearchForm()
     },
     },
     // 计算表格高度
     // 计算表格高度
     setTableH () {
     setTableH () {
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       const tableSearchH = this.$refs.tableSearch.offsetHeight
       this.tableHeight = window.innerHeight - tableSearchH - 280
       this.tableHeight = window.innerHeight - tableSearchH - 280
     }
     }
-  },
-  mounted () {
-    if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
-      this.pageInit()
-    }
-  },
-  activated () {
-    // 如果是新页签打开,则重置当前页面
-    if (this.$store.state.app.isNewTab) {
-      this.pageInit()
-    }
-  },
-  beforeRouteEnter (to, from, next) {
-    next(vm => {})
   }
   }
 }
 }
 </script>
 </script>