12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697 |
- <template>
- <div class="myReservation">
- <div class="historyItem" v-for="item in historyList">
- <div class="tags" :class="item.slateStatusStr==='待招商确认'?'dqrTag':'yslTag'">{{item.slateStatusStr}}</div>
- <div class="historyItemTitle">{{ item.groupName + item.floorDiscName + item.buildName + item.roomNo }}</div>
- <div class="historyItemInfo">预定时间:{{item.time}}</div>
- <div class="historyItemInfo">企业联系人:{{item.projectManager}}</div>
- <div class="historyItemInfo">联系电话:{{ item.managerPhone }}</div>
- <div class="historyItemBottom">
- <button class="btn" :class="item.slateStatusStr==='招商已受理'?'yslBtn':''" @click="remove(item)">删除</button>
- <button class="btn zcBtn" :class="item.slateStatusStr==='招商已受理'?'yslBtn':''" @click="toDetail(item)">编辑</button>
- </div>
- </div>
- <van-dialog
- use-slot
- title="确认删除该数据,删除后将无法恢复确认删除吗?"
- :show="show"
- show-cancel-button
- confirm-button-open-type="getUserInfo"
- @confirm="confirm"
- @cancel="show=false"
- >
- </van-dialog>
- </div>
- </template>
- <script>
- import { getByCodes, parkRoomSlateList, getUserLocalStorageInfo, parkRoomSlateRemove } from "@/js_sdk/http";
- export default {
- name: "myReservation",
- created() {
- this.getData()
- },
- data(){
- return{
- historyList:[
- {slateStatusStr:'待招商确认'},
- {slateStatusStr:'招商已受理'},
- ],
- getUserLocalStorageInfo: getUserLocalStorageInfo(),
- show:false,
- content:'',
- id: ''
- }
- },
- methods: {
- getData(){
- this.historyList = []
- const data = {
- createdAt: getUserLocalStorageInfo().userId
- }
- parkRoomSlateList(data).then(res=>{
- if(res.code == '200'){
- res.data.forEach(item=>{
- const json = this.getItemJson(item)
- this.historyList.push(json)
- })
- }else {
- this.$showToast(res.msg);
- }
- })
- },
- getItemJson(item){
- item.time = item.createdAt == null ? item.updatedAt : item.createdAt
- return item
- },
- remove(item){
- this.show = true
- this.id = item.id
- },
- confirm(e){
- const data = {
- id: this.id
- }
- parkRoomSlateRemove(data).then(res=>{
- if(res.code == '200'){
- this.$showToast("删除成功");
- this.getData()
- }else{
- this.$showToast(res.msg);
- }
- })
- },
- toDetail(item){
- uni.navigateTo({
- url:'/pages/subPackages/housingResources/addPredetermine?id='+item.id + '&roomId=' + item.roomIds
- })
- }
- }
- }
- </script>
- <style lang="scss">
- </style>
|