index.vue 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. <template>
  2. <zj-page-container>
  3. <div class="tab">
  4. <el-radio-group v-model="tabType" size="small" @change="tabTypeChange">
  5. <el-radio-button label="collect">汇总</el-radio-button>
  6. <el-radio-button label="offline">明细</el-radio-button>
  7. </el-radio-group>
  8. </div>
  9. <zj-page-fill>
  10. <collect v-if="tabTypeCk == 'collect'" key="collect" />
  11. <offline v-if="tabTypeCk == 'offline'" key="offline" :workerId="workerId" :detailParams="detailParams" />
  12. </zj-page-fill>
  13. </zj-page-container>
  14. </template>
  15. <script>
  16. import { EventBus } from '@/utils/eventBus'
  17. import collect from './pages/collect.vue'
  18. import offline from './pages/offline.vue'
  19. export default {
  20. components: { collect, offline },
  21. data() {
  22. return {
  23. tabType: 'collect',
  24. tabTypeCk: 'collect',
  25. workerId: "",
  26. detailParams: [],
  27. }
  28. },
  29. created() {
  30. EventBus.$on("orderMasterSplitAccount", ({ workerId, detailParams, tabTypeCk }) => {
  31. this.workerId = workerId
  32. this.detailParams = detailParams
  33. this.$nextTick(() => {
  34. this.tabTypeCk = tabTypeCk
  35. this.tabType = tabTypeCk
  36. })
  37. })
  38. },
  39. methods: {
  40. tabTypeChange() {
  41. this.workerId = ""
  42. this.detailParams = []
  43. this.$nextTick(() => {
  44. this.tabTypeCk = this.tabType
  45. })
  46. }
  47. },
  48. }
  49. </script>
  50. <style lang="scss" scoped>
  51. .tab {
  52. padding: 20px 20px 0 20px;
  53. }
  54. </style>