You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

weekListComponent.vue 2.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879
  1. <template>
  2. <div>
  3. <div v-if="filteredWeeks.length > 0">
  4. <table class="table table-bordered">
  5. <thead>
  6. <tr>
  7. <th>Province</th>
  8. <th>Resort</th>
  9. <th>Unit</th>
  10. <th>Week</th>
  11. <th>Arrival</th>
  12. <th>Departure</th>
  13. <th>Bedrooms</th>
  14. <th style="width:15%">Price</th>
  15. <!-- <th>Status</th> -->
  16. <th>Interested</th>
  17. </tr>
  18. </thead>
  19. <tbody>
  20. <tr v-for="(item, i) in filteredWeeks" :key="i">
  21. <td>{{item.region ? item.region.regionName : ''}}</td>
  22. <td>{{item.resort ? item.resort.resortName : ''}}</td>
  23. <td>{{item.unitNumber}}</td>
  24. <td>{{item.weekNumber}}</td>
  25. <td>{{item.arrivalDate | toDate}}</td>
  26. <td>{{item.departureDate | toDate}}</td>
  27. <td>{{item.bedrooms}}</td>
  28. <td>{{item.sellPrice | toCurrency}}</td>
  29. <!-- <td>{{item.status ? item.status.description : ''}}</td> -->
  30. <td>
  31. <div class="col-md-12">
  32. <button type="button" class="btn btn-b-n" @click="View(item)">View</button>
  33. </div>
  34. </td>
  35. </tr>
  36. </tbody>
  37. </table>
  38. </div>
  39. <div v-else>
  40. <div class="row">
  41. <div class="col-md-12">
  42. <hr />No Results Found
  43. <hr />
  44. </div>
  45. </div>
  46. </div>
  47. </div>
  48. </template>
  49. <script>
  50. import { mapState, mapActions, mapGetters } from 'vuex';
  51. export default {
  52. props: {
  53. resortCode: undefined,
  54. },
  55. components: {},
  56. computed: {
  57. ...mapState('weekList', ['weeks']),
  58. ...mapGetters({
  59. filteredWeeks: 'weekList/filteredWeeks',
  60. }),
  61. },
  62. mounted() {
  63. if (this.resortCode) {
  64. this.applyResortFilter(this.resortCode);
  65. }
  66. this.getWeeks();
  67. },
  68. methods: {
  69. View(item) {
  70. console.log(item);
  71. this.$router.push(`/resort/${item.resort.resortCode}/${item.id}`);
  72. },
  73. ...mapActions('weekList', ['getWeeks', 'applyResortFilter']),
  74. },
  75. };
  76. </script>
  77. <style>
  78. </style>