myReservation.vue 1.9 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465
  1. <template>
  2. <div class="myReservation">
  3. <div class="historyItem" v-for="item in historyList">
  4. <div class="tags" :class="item.slateStatusStr==='待招商确认'?'dqrTag':'yslTag'">{{item.slateStatusStr}}</div>
  5. <div class="historyItemTitle">{{ item.groupName + item.floorDiscName + item.buildName + item.roomNo }}</div>
  6. <div class="historyItemInfo">预定时间:{{item.time}}</div>
  7. <div class="historyItemInfo">企业联系人:{{item.projectManager}}</div>
  8. <div class="historyItemInfo">联系电话:{{ item.managerPhone }}</div>
  9. <div class="historyItemBottom">
  10. <button class="btn" :class="item.slateStatusStr==='招商已受理'?'yslBtn':''" @click="remove(item)">删除</button>
  11. <button class="btn zcBtn" :class="item.slateStatusStr==='招商已受理'?'yslBtn':''">编辑</button>
  12. </div>
  13. </div>
  14. </div>
  15. </template>
  16. <script>
  17. import { getByCodes, parkRoomSlateList, getUserLocalStorageInfo } from "@/js_sdk/http";
  18. export default {
  19. name: "myReservation",
  20. created() {
  21. this.getData()
  22. },
  23. data(){
  24. return{
  25. historyList:[
  26. {slateStatusStr:'待招商确认'},
  27. {slateStatusStr:'招商已受理'},
  28. ],
  29. getUserLocalStorageInfo: getUserLocalStorageInfo(),
  30. }
  31. },
  32. methods: {
  33. getData(){
  34. this.historyList = []
  35. const data = {
  36. createdAt: getUserLocalStorageInfo().userId
  37. }
  38. parkRoomSlateList(data).then(res=>{
  39. if(res.code == '200'){
  40. res.data.forEach(item=>{
  41. const json = this.getItemJson(item)
  42. this.historyList.push(json)
  43. })
  44. }else {
  45. this.$showToast(res.msg);
  46. }
  47. })
  48. },
  49. getItemJson(item){
  50. item.time = item.createdAt == null ? item.updatedAt : item.createdAt
  51. return item
  52. },
  53. remove(item){
  54. }
  55. }
  56. }
  57. </script>
  58. <style lang="scss">
  59. </style>