index.vue 2.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. <template>
  2. <div class="tireSubsidySetting-mainBox">
  3. <a-tabs default-active-key="SERVICE_FEE" id="tireSubsidySetting-index" @change="handleChange" class="tireSubsidySetting-tabs">
  4. <a-tab-pane key="SERVICE_FEE" tab="服务费">
  5. </a-tab-pane>
  6. <a-tab-pane key="SHIPPING_FEE" tab="运费补贴" force-render>
  7. </a-tab-pane>
  8. <a-tab-pane key="SUBSIDY_QUARTER_FEE" tab="增量补贴(季度)" force-render>
  9. </a-tab-pane>
  10. <a-tab-pane key="SUBSIDY_YEAR_FEE" tab="增量补贴(年度)" force-render>
  11. </a-tab-pane>
  12. </a-tabs>
  13. <div v-if="tabVal=='SERVICE_FEE' || tabVal=='SHIPPING_FEE'">
  14. <costCollectionList ref="costCollection" :pageType="tabVal"></costCollectionList>
  15. </div>
  16. <div v-else>
  17. <addSubsidyList ref="addSubsidy" :pageType="tabVal"></addSubsidyList>
  18. </div>
  19. </div>
  20. </template>
  21. <script>
  22. import { commonMixin } from '@/utils/mixin'
  23. // 组件
  24. import costCollectionList from './costCollectionList.vue'
  25. import addSubsidyList from './addSubsidyList.vue'
  26. export default {
  27. name: 'TireFeeReportIndex',
  28. mixins: [commonMixin],
  29. components: { costCollectionList, addSubsidyList },
  30. data () {
  31. return {
  32. tabVal: 'SERVICE_FEE' // tab值 1轮胎月度费用报表 2轮胎季度费用报表 3轮胎年度费用报表 4轮胎费用明细报表
  33. }
  34. },
  35. methods: {
  36. // 切换tab值 change
  37. handleChange (val) {
  38. this.tabVal = val
  39. this.$nextTick(() => {
  40. if (val == 'SERVICE_FEE' || val == 'SHIPPING_FEE') {
  41. this.$refs.costCollection.pageInit()
  42. } else {
  43. this.$refs.addSubsidy.pageInit()
  44. }
  45. })
  46. },
  47. // 初始化
  48. pageInit () {
  49. if (this.tabVal == 'SERVICE_FEE') {
  50. this.$refs.costCollection.pageInit()
  51. }
  52. }
  53. },
  54. mounted () {
  55. if (!this.$store.state.app.isNewTab) { // 页签刷新时调用
  56. this.pageInit()
  57. }
  58. },
  59. activated () {
  60. // 如果是新页签打开,则重置当前页面
  61. if (this.$store.state.app.isNewTab) {
  62. this.pageInit()
  63. }
  64. }
  65. }
  66. </script>
  67. <style lang="less" scoped>
  68. .tireSubsidySetting-mainBox{
  69. .tireSubsidySetting-tabs{
  70. background:#ffffff;
  71. }
  72. }
  73. </style>