|  |  |  | 
|---|
|  |  |  | <el-option v-for="item in status" :key="item.id" :value="item.id" :label="item.name" /> | 
|---|
|  |  |  | </el-select> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-form-item label="会议时间" prop="startTime"> | 
|---|
|  |  |  | <el-form-item label="起止时间" prop="startTime"> | 
|---|
|  |  |  | <el-date-picker | 
|---|
|  |  |  | v-model="date" | 
|---|
|  |  |  | type="datetimerange" | 
|---|
|  |  |  | 
|---|
|  |  |  | ></el-date-picker> | 
|---|
|  |  |  | <!-- <el-date-picker v-model="searchForm.startTime" value-format="yyyy-MM-dd" placeholder="请输入开始时间" @change="search"/> --> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | <el-radio-group | 
|---|
|  |  |  | v-model="searchForm.radio" | 
|---|
|  |  |  | size="small" | 
|---|
|  |  |  | @input="changeRadio" | 
|---|
|  |  |  | > | 
|---|
|  |  |  | <el-radio-button label="0">当天</el-radio-button> | 
|---|
|  |  |  | <el-radio-button label="1">近7天</el-radio-button> | 
|---|
|  |  |  | <el-radio-button label="2">近30天</el-radio-button> | 
|---|
|  |  |  | </el-radio-group> | 
|---|
|  |  |  | <!-- <el-form-item label="结束时间" prop="endTime"> | 
|---|
|  |  |  | <el-date-picker v-model="searchForm.endTime" value-format="yyyy-MM-dd" placeholder="请输入结束时间" @change="search"/> | 
|---|
|  |  |  | </el-form-item> --> | 
|---|
|  |  |  | 
|---|
|  |  |  | import Pagination from '@/components/common/Pagination' | 
|---|
|  |  |  | import OperaBookingsWindow from '@/views/meeting/components/OperaBookingsWindow' | 
|---|
|  |  |  | import OperaBookingsDetailWindow from '@/views/meeting/components/OperaBookingsDetailWindow' | 
|---|
|  |  |  | import { findList } from '@/views/meeting/api/rooms' | 
|---|
|  |  |  | import { findList } from '@/api/meeting/rooms' | 
|---|
|  |  |  | import { getSystemDictData } from '@/api/system/dictData' | 
|---|
|  |  |  | import { fetchTree } from '@/api/system/department' | 
|---|
|  |  |  | import { cancelById, bookingsDetail } from '@/views/meeting/api/bookings' | 
|---|
|  |  |  | import { fetchList } from '@/api/business/company' | 
|---|
|  |  |  | import { cancelById, bookingsDetail } from '@/api/meeting/bookings' | 
|---|
|  |  |  | import { timeForMat } from '@/utils/util' | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | name: 'Bookings', | 
|---|
|  |  |  | extends: BaseTable, | 
|---|
|  |  |  | 
|---|
|  |  |  | isdeleted: '', | 
|---|
|  |  |  | remark: '', | 
|---|
|  |  |  | name: '', | 
|---|
|  |  |  | roomId: '', | 
|---|
|  |  |  | startTime: '', | 
|---|
|  |  |  | endTime: '', | 
|---|
|  |  |  | content: '' | 
|---|
|  |  |  | content: '', | 
|---|
|  |  |  | radio: 0 | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | props: { | 
|---|
|  |  |  | label: 'name', | 
|---|
|  |  |  | 
|---|
|  |  |  | status: [ | 
|---|
|  |  |  | { name: '全部', id: '' }, | 
|---|
|  |  |  | { name: '正常', id: '0' }, | 
|---|
|  |  |  | { name: '取消', id: '1' }, | 
|---|
|  |  |  | { name: '取消', id: '1' } | 
|---|
|  |  |  | ], | 
|---|
|  |  |  | link: 'https://dmtest.ahapp.net/meeting_h5/' //H5_LINK_ADDR | 
|---|
|  |  |  | link: 'https://dmtest.ahapp.net/meeting_h5/' // H5_LINK_ADDR | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | provide() { | 
|---|
|  |  |  | provide () { | 
|---|
|  |  |  | return { | 
|---|
|  |  |  | rooms: () => this.rooms | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 
|---|
|  |  |  | created () { | 
|---|
|  |  |  | this.config({ | 
|---|
|  |  |  | module: '会议室预定信息表', | 
|---|
|  |  |  | api: '@/views/meeting/api/bookings', | 
|---|
|  |  |  | api: '/meeting/bookings', | 
|---|
|  |  |  | 'field.id': 'id', | 
|---|
|  |  |  | 'field.main': 'id' | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | fetchTree() | 
|---|
|  |  |  | fetchList(1) | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | this.department = this.newTree(res) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | getSystemDictData('H5_LINK_ADDR') | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | console.log(res); | 
|---|
|  |  |  | this.link=res.code | 
|---|
|  |  |  | console.log(res) | 
|---|
|  |  |  | this.link = res.code | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | findList({status:0}) | 
|---|
|  |  |  | findList({ status: 0 }) | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | this.rooms = res | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | this.changeRadio('0') | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | newTree(tree) { | 
|---|
|  |  |  | changeRadio (e) { | 
|---|
|  |  |  | if (e === '0') { | 
|---|
|  |  |  | this.searchForm.startTime = timeForMat(0)[0] | 
|---|
|  |  |  | this.searchForm.endTime = timeForMat(0)[1] | 
|---|
|  |  |  | this.date = timeForMat(0) | 
|---|
|  |  |  | } else if (e === '1') { | 
|---|
|  |  |  | this.searchForm.startTime = timeForMat(6)[0] | 
|---|
|  |  |  | this.searchForm.endTime = timeForMat(6)[1] | 
|---|
|  |  |  | this.date = timeForMat(6) | 
|---|
|  |  |  | } else if (e === '2') { | 
|---|
|  |  |  | this.searchForm.startTime = timeForMat(29)[0] | 
|---|
|  |  |  | this.searchForm.endTime = timeForMat(29)[1] | 
|---|
|  |  |  | this.date = timeForMat(29) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | newTree (tree) { | 
|---|
|  |  |  | if (tree == null) { | 
|---|
|  |  |  | return [] | 
|---|
|  |  |  | } | 
|---|
|  |  |  | return tree.map(item => { | 
|---|
|  |  |  | let newItem = {...item} | 
|---|
|  |  |  | if (item.children.length == 0) { | 
|---|
|  |  |  | this.$delete( newItem, 'children' ) | 
|---|
|  |  |  | const newItem = { ...item } | 
|---|
|  |  |  | if (newItem) { | 
|---|
|  |  |  | newItem.children = newItem.childList | 
|---|
|  |  |  | } | 
|---|
|  |  |  | if (item.children && item.children.length == 0) { | 
|---|
|  |  |  | this.$delete(newItem, 'children') | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | newItem.children = this.newTree(newItem.children) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | 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 () { | 
|---|
|  |  |  | this.$refs.searchForm.resetFields() | 
|---|
|  |  |  | this.date = [] | 
|---|
|  |  |  | this.searchForm.radio = '0' | 
|---|
|  |  |  | this.searchForm.startTime = '' | 
|---|
|  |  |  | this.searchForm.endTime = '' | 
|---|
|  |  |  | this.search() | 
|---|
|  |  |  | this.changeRadio('0') | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | copy(row) { | 
|---|
|  |  |  | let text = `${row.realName} 邀请您加入会议\n会议主题:${row.name}\n会议室:${row.roomName}\n会议时间:${row.meetingTime}\n点击链接直接加入会议:\n${this.link}?id=${row.id}` | 
|---|
|  |  |  | 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(() => { | 
|---|
|  |  |  | this.$message.success('会议信息复制成功,去分享给同事吧~') | 
|---|
|  |  |  | 
|---|
|  |  |  | this.$message.error(e) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | cancelMeeting(id) { | 
|---|
|  |  |  | cancelMeeting (id) { | 
|---|
|  |  |  | this.$dialog.messageWaring('取消会议', '是否取消当前会议?') | 
|---|
|  |  |  | .then(() => { | 
|---|
|  |  |  | cancelById({id}) | 
|---|
|  |  |  | cancelById({ id }) | 
|---|
|  |  |  | .then(() => { | 
|---|
|  |  |  | this.$message.success('取消成功') | 
|---|
|  |  |  | this.handlePageChange() | 
|---|
|  |  |  | 
|---|
|  |  |  | this.$message.error(e) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | showDetail(id) { | 
|---|
|  |  |  | showDetail (id) { | 
|---|
|  |  |  | bookingsDetail(id) | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | this.$refs.operaBookingsDetailWindow.open('会议详情', res) | 
|---|
|  |  |  | 
|---|
|  |  |  | this.$message.error(e) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | editBookings(id) { | 
|---|
|  |  |  | editBookings (id) { | 
|---|
|  |  |  | bookingsDetail(id) | 
|---|
|  |  |  | .then(res => { | 
|---|
|  |  |  | this.$refs.operaBookingsWindow.open('编辑会议预约', res) | 
|---|
|  |  |  | 
|---|
|  |  |  | .catch(e => { | 
|---|
|  |  |  | this.$message.error(e) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | handlePageChange (pageIndex) { | 
|---|
|  |  |  | this.__checkApi() | 
|---|
|  |  |  | this.tableData.pagination.pageIndex = pageIndex || this.tableData.pagination.pageIndex | 
|---|
|  |  |  | this.isWorking.search = true | 
|---|
|  |  |  | let form = JSON.parse(JSON.stringify(this.searchForm)) | 
|---|
|  |  |  | const form = JSON.parse(JSON.stringify(this.searchForm)) | 
|---|
|  |  |  | if (form.department.length) { | 
|---|
|  |  |  | form.departmentId = form.department[form.department.length-1] | 
|---|
|  |  |  | form.departmentId = form.department[form.department.length - 1] | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.api.fetchList({ | 
|---|
|  |  |  | page: this.tableData.pagination.pageIndex, | 
|---|
|  |  |  | 
|---|
|  |  |  | .finally(() => { | 
|---|
|  |  |  | this.isWorking.search = false | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | } | 
|---|
|  |  |  | </script> | 
|---|