reservation.vue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071
  1. <template>
  2. <div class="hui-flex hui-content">
  3. <div class="hui-content-title">
  4. <div class="hui-title-item active">预约列表</div>
  5. </div>
  6. <div class="hui-flex-box hui-table">
  7. <el-table :data="tableData" row-key="id" border height="100%">
  8. <el-table-column label="序号" width="50">
  9. <template slot-scope="scope">
  10. <div style="text-align: center;">{{scope.$index + 1}}</div>
  11. </template>
  12. </el-table-column>
  13. <el-table-column label="预约人" prop="userName"></el-table-column>
  14. <el-table-column label="预约时间" prop="date"></el-table-column>
  15. <el-table-column label="预约房源" width="150">
  16. <template slot-scope="scope">
  17. <div class="hui-table-operation">
  18. <span class="table-operation" @click="look(scope.row)">详情</span>
  19. </div>
  20. </template>
  21. </el-table-column>
  22. <template slot="empty">
  23. <empty description="暂无数据"></empty>
  24. </template>
  25. </el-table>
  26. </div>
  27. <el-drawer title="房源详情" :visible.sync="drawer" :size="400" :append-to-body="true">
  28. <detail v-if="drawer" :detailId="detailId"></detail>
  29. </el-drawer>
  30. </div>
  31. </template>
  32. <script>
  33. import {
  34. getReservationList
  35. } from '@/httpApi/space'
  36. import detail from '@/components/work/space/house/detail'
  37. export default {
  38. data() {
  39. return {
  40. tableData: [],
  41. detailId: '',
  42. drawer: false
  43. }
  44. },
  45. created() {
  46. this.init();
  47. },
  48. methods: {
  49. init() {
  50. getReservationList({
  51. userId: 20,
  52. projectId: this.$store.getters.project.id
  53. }).then(res => {
  54. if (res.state) {
  55. this.tableData = res.data;
  56. }
  57. })
  58. },
  59. look(val) {
  60. this.detailId = val.projectItemTargetRoomId;
  61. this.drawer = true;
  62. }
  63. },
  64. components: {
  65. detail
  66. },
  67. }
  68. </script>
  69. <style lang="scss"></style>