appointment.vue 4.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126
  1. <template>
  2. <div id="appointment">
  3. <el-row>
  4. <el-col :span="24">
  5. <appointment-detail
  6. :liebiaoList="liebiaoList"
  7. @query="search"
  8. @onsave="onsaveClick"
  9. :nextData="nextData"
  10. :nextTotal="nextTotal"
  11. :pastData="pastData"
  12. :pastTotal="pastTotal"
  13. ></appointment-detail>
  14. </el-col>
  15. </el-row>
  16. </div>
  17. </template>
  18. <script>
  19. import appointmentDetail from '@/components/enterprise/appointment.vue';
  20. import { createNamespacedHelpers, mapGetters, mapState } from 'vuex';
  21. const { mapActions: dock } = createNamespacedHelpers('dock');
  22. const { mapActions: apply } = createNamespacedHelpers('apply');
  23. const { mapActions: login } = createNamespacedHelpers('login');
  24. const { mapActions: place } = createNamespacedHelpers('place');
  25. export default {
  26. name: 'appointment',
  27. props: {},
  28. components: {
  29. appointmentDetail,
  30. },
  31. data: () => ({
  32. liebiaoList: [
  33. { name: '基本信息' },
  34. { name: '消息管理' },
  35. { name: '我的发布' },
  36. { name: '事项管理' },
  37. { name: '展会管理' },
  38. // // { name: '返回首页' },
  39. { name: '修改密码' },
  40. { name: '退出账号' },
  41. ],
  42. // 下期直播
  43. nextData: [],
  44. nextTotal: 0,
  45. // 以往直播
  46. pastData: [],
  47. pastTotal: 0,
  48. }),
  49. created() {
  50. this.search();
  51. },
  52. computed: {
  53. ...mapState(['user']),
  54. },
  55. methods: {
  56. ...dock(['query', 'delete', 'update']),
  57. ...apply({ applyupdate: 'update' }),
  58. ...login({ logout: 'logout', transactiondtetle: 'delete' }),
  59. ...place({ palcequery: 'query', palcefetch: 'fetch' }),
  60. async search({ skip = 0, limit = 0 } = { skip: 0, limit: 0 }) {
  61. let res = await this.query({ skip, limit, status: '0' });
  62. for (const val of res.data) {
  63. let parent = val.province;
  64. let places = val.place;
  65. let reslte = await this.palcequery({ level: 1, parent });
  66. let resltes = await this.palcequery({ level: 2, parent });
  67. var arr = reslte.data.filter(item => item.code === parent);
  68. var cre = resltes.data.filter(item => item.code === places);
  69. for (const shi of cre) {
  70. val.shi = shi.name;
  71. }
  72. for (const sheng of arr) {
  73. val.sheng = sheng.name;
  74. }
  75. }
  76. this.$set(this, `nextData`, res.data);
  77. this.$set(this, `nextTotal`, res.total);
  78. res = await this.query({ skip, limit, status: '2' });
  79. for (const val of res.data) {
  80. let parent = val.province;
  81. let places = val.place;
  82. let reslte = await this.palcequery({ level: 1, parent });
  83. let resltes = await this.palcequery({ level: 2, parent });
  84. var arr = reslte.data.filter(item => item.code === parent);
  85. var cre = resltes.data.filter(item => item.code === places);
  86. for (const shi of cre) {
  87. val.shi = shi.name;
  88. }
  89. for (const sheng of arr) {
  90. val.sheng = sheng.name;
  91. }
  92. }
  93. this.$set(this, `pastData`, res.data);
  94. this.$set(this, `pastTotal`, res.total);
  95. },
  96. // 切换菜单
  97. async onsaveClick({ id }) {
  98. if (id === '基本信息') {
  99. this.$router.push({ path: '/enterprise/enterprisejb' });
  100. } else if (id === '消息管理') {
  101. this.$router.push({ path: '/enterprise/enterprisexx' });
  102. } else if (id === '我的发布') {
  103. this.$router.push({ path: '/enterprise/enterprisefabu' });
  104. } else if (id === '事项管理') {
  105. this.$router.push({ path: '/enterprise/enterprisedg' });
  106. } else if (id === '展会管理') {
  107. this.$router.push({ path: '/enterprise/appointment' });
  108. } else if (id === '修改密码') {
  109. this.$router.push({ path: '/enterprise/xiugai' });
  110. } else if (id === '返回首页') {
  111. this.$router.push({ path: '/home' });
  112. } else if (id === '退出账号') {
  113. this.logout();
  114. this.$message({
  115. message: '注销成功',
  116. type: 'success',
  117. });
  118. this.toLogin();
  119. }
  120. },
  121. },
  122. };
  123. </script>
  124. <style lang="less" scoped></style>