|  |  | 
 |  |  | <template> | 
 |  |  |   <TableLayout :permissions="['business:bookings:query']"> | 
 |  |  |   <TableLayout rel="tableLayoutEle" :permissions="['business:bookings:query']"> | 
 |  |  |     <!-- 搜索表单 --> | 
 |  |  |     <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> | 
 |  |  |       <el-form-item label="会议室" prop="roomId"> | 
 |  |  | 
 |  |  |       <el-form-item label="预约人" prop="realName"> | 
 |  |  |         <el-input v-model="searchForm.realName" placeholder="请输入预约人" @keypress.enter.native="search"></el-input> | 
 |  |  |       </el-form-item> | 
 |  |  |       <el-form-item label="会议状态" prop="status"> | 
 |  |  |       <el-form-item label="会议状态" prop="meetingStatus"> | 
 |  |  |         <el-select v-model="searchForm.meetingStatus" filterable clearable placeholder="请选择状态"> | 
 |  |  |           <el-option v-for="item in status" :key="item.id" :value="item.id" :label="item.name" /> | 
 |  |  |         </el-select> | 
 |  |  | 
 |  |  |     </el-form> | 
 |  |  |     <!-- 表格和分页 --> | 
 |  |  |     <template v-slot:table-wrap> | 
 |  |  |       <ul class="toolbar" v-permissions="[ | 
 |  |  |       <ul class="toolbar" ref="toolbarEle" v-permissions="[ | 
 |  |  |         'business:bookings:create', | 
 |  |  |         'business:bookings:exportExcel', | 
 |  |  |       ]"> | 
 |  |  | 
 |  |  |             @click="exportExcel">导出</el-button> | 
 |  |  |         </li> | 
 |  |  |       </ul> | 
 |  |  |       <el-table v-loading="isWorking.search" :data="tableData.list" stripe @selection-change="handleSelectionChange"> | 
 |  |  |       <el-table :height="tableHeightNew" v-loading="isWorking.search" :data="tableData.list" stripe @selection-change="handleSelectionChange"> | 
 |  |  |         <!-- <el-table-column type="selection" align="center" width="55"></el-table-column> --> | 
 |  |  |         <el-table-column prop="name" label="会议主题" align="center" min-width="120px" show-overflow-tooltip> | 
 |  |  |           <template slot-scope="{ row }"> | 
 |  |  | 
 |  |  |               <el-button type="text" | 
 |  |  |                 v-if="row.hasRole ==1 && (row.meetingStatus == '1' || row.meetingStatus == '4')" | 
 |  |  |                 @click="handleStart(row)">开始</el-button> | 
 |  |  |               <el-button type="text" v-if=" row.hasRole ==1&& row.meetingStatus == '2'" | 
 |  |  |               <el-button type="text" v-if=" row.hasRole ==1 && [2, 0].includes(row.meetingStatus)" | 
 |  |  |                 @click="handleEnd(row)">结束</el-button> | 
 |  |  |               <el-button v-if="row.hasRole ==1 && (row.meetingStatus == '1' || row.meetingStatus == '4')" type="text" @click="cancelMeeting(row.id)">撤回</el-button> | 
 |  |  |               <el-button v-if="row.hasRole ==1 && [1, 4].includes(row.meetingStatus)" type="text" @click="cancelMeeting(row.id)">撤回</el-button> | 
 |  |  |               <el-button  type="text" @click="deleteById(row)" class="red" v-permissions="['business:bookings:delete']">删除</el-button> | 
 |  |  |             </template> | 
 |  |  |           </template> | 
 |  |  | 
 |  |  |   name: 'Bookings', | 
 |  |  |   extends: BaseTable, | 
 |  |  |   components: { TableLayout, Pagination, OperaBookingsWindow, OperaBookingsDetailWindow }, | 
 |  |  |   data() { | 
 |  |  |   data () { | 
 |  |  |     return { | 
 |  |  |       date: [], | 
 |  |  |       // userInfo: this.$store.state.userInfo, | 
 |  |  | 
 |  |  |       link: 'https://dmtest.ahapp.net/meeting_h5/' // H5_LINK_ADDR | 
 |  |  |     } | 
 |  |  |   }, | 
 |  |  |   provide() { | 
 |  |  |   provide () { | 
 |  |  |     return { | 
 |  |  |       rooms: () => this.rooms | 
 |  |  |     } | 
 |  |  |   }, | 
 |  |  |   created() { | 
 |  |  |   created () { | 
 |  |  |     this.config({ | 
 |  |  |       module: '会议室预定信息表', | 
 |  |  |       api: '/meeting/bookings', | 
 |  |  | 
 |  |  |     this.changeRadio('0') | 
 |  |  |   }, | 
 |  |  |   methods: { | 
 |  |  |     changeRadio(e) { | 
 |  |  |     changeRadio (e) { | 
 |  |  |       if (e === '0') { | 
 |  |  |         this.searchForm.startTime = timeForMat(0)[0] | 
 |  |  |         this.searchForm.endTime = timeForMat(0)[1] | 
 |  |  | 
 |  |  |       } | 
 |  |  |       this.search() | 
 |  |  |     }, | 
 |  |  |     newTree(tree) { | 
 |  |  |     newTree (tree) { | 
 |  |  |       if (tree == null) { | 
 |  |  |         return [] | 
 |  |  |       } | 
 |  |  | 
 |  |  |         return newItem | 
 |  |  |       }) | 
 |  |  |     }, | 
 |  |  |     selectDate(v) { | 
 |  |  |     selectDate (v) { | 
 |  |  |       this.searchForm.endTime = v[1] + ' 23:59:59' | 
 |  |  |       this.searchForm.startTime = v[0] + ' 00:00:00' | 
 |  |  |       this.searchForm.radio = null | 
 |  |  |     }, | 
 |  |  |     reset() { | 
 |  |  |     reset () { | 
 |  |  |       this.$refs.searchForm.resetFields() | 
 |  |  |       this.date = [] | 
 |  |  |       this.searchForm.radio = '' | 
 |  |  | 
 |  |  |       // this.changeRadio('0') | 
 |  |  |       this.search() | 
 |  |  |     }, | 
 |  |  |     copy(row) { | 
 |  |  |     copy (row) { | 
 |  |  |       const text = `${row.realName} 邀请您加入会议\n会议主题:${row.name}\n会议室:${row.roomName}\n会议时间:${row.meetingTime}\n点击链接直接加入会议:\n${this.link}?id=${row.id}` | 
 |  |  |       this.$copyText(text) | 
 |  |  |         .then(() => { | 
 |  |  | 
 |  |  |         .catch(e => { | 
 |  |  |         }) | 
 |  |  |     }, | 
 |  |  |     handleStart(row) { | 
 |  |  |     handleStart (row) { | 
 |  |  |       this.$dialog.messageWaring('开始会议', '是否开始当前会议?') | 
 |  |  |         .then(() => { | 
 |  |  |           let fn = new Date(row.startTime).getTime() > new Date().getTime() ? startEarlyById : startById | 
 |  |  |           const fn = new Date(row.startTime).getTime() > new Date().getTime() ? startEarlyById : startById | 
 |  |  |           fn({ id: row.id }) | 
 |  |  |             .then(() => { | 
 |  |  |               this.$message.success('会议已开始') | 
 |  |  | 
 |  |  |             }) | 
 |  |  |         }) | 
 |  |  |     }, | 
 |  |  |     handleEnd(row) { | 
 |  |  |     handleEnd (row) { | 
 |  |  |       this.$dialog.messageWaring('结束会议', '是否结束当前会议?') | 
 |  |  |         .then(() => { | 
 |  |  |           meetingEndById({ id: row.id }) | 
 |  |  | 
 |  |  |             }) | 
 |  |  |         }) | 
 |  |  |     }, | 
 |  |  |     cancelMeeting(id) { | 
 |  |  |     cancelMeeting (id) { | 
 |  |  |       this.$dialog.messageWaring('取消会议', '是否取消当前会议?') | 
 |  |  |         .then(() => { | 
 |  |  |           cancelById({ id }) | 
 |  |  | 
 |  |  |             }) | 
 |  |  |         }) | 
 |  |  |     }, | 
 |  |  |     showDetail(id) { | 
 |  |  |     showDetail (id) { | 
 |  |  |       bookingsDetail(id) | 
 |  |  |         .then(res => { | 
 |  |  |           this.$refs.operaBookingsDetailWindow.open('会议详情', res) | 
 |  |  | 
 |  |  |         .catch(e => { | 
 |  |  |         }) | 
 |  |  |     }, | 
 |  |  |     editBookings(id) { | 
 |  |  |     editBookings (id) { | 
 |  |  |       bookingsDetail(id) | 
 |  |  |         .then(res => { | 
 |  |  |           this.$refs.operaBookingsWindow.open('编辑会议预约', res) | 
 |  |  | 
 |  |  |         .catch(e => { | 
 |  |  |         }) | 
 |  |  |     }, | 
 |  |  |     handlePageChange(pageIndex) { | 
 |  |  |     handlePageChange (pageIndex) { | 
 |  |  |       this.__checkApi() | 
 |  |  |       this.tableData.pagination.pageIndex = pageIndex || this.tableData.pagination.pageIndex | 
 |  |  |       this.isWorking.search = true |