myReservation.vue 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  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':''" @click="toDetail(item)">编辑</button>
  12. </div>
  13. </div>
  14. <van-dialog
  15. use-slot
  16. title="确认删除该数据,删除后将无法恢复确认删除吗?"
  17. :show="show"
  18. show-cancel-button
  19. confirm-button-open-type="getUserInfo"
  20. @confirm="confirm"
  21. @cancel="show=false"
  22. >
  23. </van-dialog>
  24. </div>
  25. </template>
  26. <script>
  27. import { getByCodes, parkRoomSlateList, getUserLocalStorageInfo, parkRoomSlateRemove } from "@/js_sdk/http";
  28. export default {
  29. name: "myReservation",
  30. created() {
  31. this.getData()
  32. },
  33. data(){
  34. return{
  35. historyList:[
  36. {slateStatusStr:'待招商确认'},
  37. {slateStatusStr:'招商已受理'},
  38. ],
  39. getUserLocalStorageInfo: getUserLocalStorageInfo(),
  40. show:false,
  41. content:'',
  42. id: ''
  43. }
  44. },
  45. methods: {
  46. getData(){
  47. this.historyList = []
  48. const data = {
  49. createdAt: getUserLocalStorageInfo().userId
  50. }
  51. parkRoomSlateList(data).then(res=>{
  52. if(res.code == '200'){
  53. res.data.forEach(item=>{
  54. const json = this.getItemJson(item)
  55. this.historyList.push(json)
  56. })
  57. }else {
  58. this.$showToast(res.msg);
  59. }
  60. })
  61. },
  62. getItemJson(item){
  63. item.time = item.createdAt == null ? item.updatedAt : item.createdAt
  64. return item
  65. },
  66. remove(item){
  67. this.show = true
  68. this.id = item.id
  69. },
  70. confirm(e){
  71. const data = {
  72. id: this.id
  73. }
  74. parkRoomSlateRemove(data).then(res=>{
  75. if(res.code == '200'){
  76. this.$showToast("删除成功");
  77. this.getData()
  78. }else{
  79. this.$showToast(res.msg);
  80. }
  81. })
  82. },
  83. toDetail(item){
  84. uni.navigateTo({
  85. url:'/pages/subPackages/housingResources/addPredetermine?id='+item.id + '&roomId=' + item.roomIds
  86. })
  87. }
  88. }
  89. }
  90. </script>
  91. <style lang="scss">
  92. </style>