index.vue 1.5 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <div>
  3. <a-card size="small" :bordered="false">
  4. <a-tabs default-active-key="1" @change="handleChange">
  5. <a-tab-pane key="1" tab="轮胎统计报表">
  6. <!-- 列表 -->
  7. <tireList ref="tireStatisticsList"></tireList>
  8. </a-tab-pane>
  9. <a-tab-pane key="2" tab="轮胎明细报表" force-render>
  10. <detailList ref="tireDetailList"></detailList>
  11. </a-tab-pane>
  12. </a-tabs>
  13. </a-card>
  14. </div>
  15. </template>
  16. <script>
  17. import { commonMixin } from '@/utils/mixin'
  18. import tireList from './list'
  19. import detailList from './detailList'
  20. export default {
  21. name: 'TireSalesReportIndex',
  22. mixins: [commonMixin],
  23. components: { tireList, detailList },
  24. data () {
  25. return {
  26. tabVal: 1
  27. }
  28. },
  29. methods: {
  30. handleChange (val) {
  31. this.tabVal = val
  32. },
  33. pageInit () {
  34. if (this.tabVal == 1) {
  35. this.$refs.tireStatisticsList.pageInit()
  36. } else {
  37. this.$refs.tireDetailList.pageInit()
  38. }
  39. }
  40. },
  41. mounted () {
  42. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  43. this.pageInit()
  44. }
  45. },
  46. activated () {
  47. // 如果是新页签打开,则重置当前页面
  48. if (this.$store.state.app.isNewTab) {
  49. this.pageInit()
  50. }
  51. }
  52. }
  53. </script>
  54. <style lang="less" scoped>
  55. .monthBox{
  56. /deep/.ant-calendar-picker-icon{
  57. display:none !important;
  58. }
  59. /deep/.ant-calendar-picker input{
  60. text-align:center;
  61. }
  62. }
  63. </style>