| ¶Ô±ÈÐÂÎļþ |
| | |
| | | <template> |
| | | <TableLayout :permissions="['business:bookings:query']"> |
| | | <!-- æç´¢è¡¨å --> |
| | | <el-form ref="searchForm" slot="search-form" :model="searchForm" label-width="100px" inline> |
| | | <el-form-item label="ä¼è®®å®¤" prop="roomId"> |
| | | <el-select |
| | | v-model="searchForm.roomId" |
| | | filterable |
| | | clearable |
| | | placeholder="è¯·éæ©ä¼è®®å®¤" |
| | | > |
| | | <el-option v-for="item in rooms" :key="item.id" :value="item.id" :label="item.name" /> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="é¢çº¦é¨é¨" prop="department"> |
| | | <el-cascader |
| | | v-model="searchForm.department" |
| | | :options="department" |
| | | :show-all-levels="false" |
| | | clearable |
| | | :props="props" |
| | | ></el-cascader> |
| | | <!-- @change="handleChange" --> |
| | | <!-- <el-select |
| | | v-model="searchForm.departmentId" |
| | | filterable |
| | | clearable |
| | | placeholder="è¯·éæ©é¨é¨" |
| | | > |
| | | <el-option v-for="item in department" :key="item.id" :value="item.id" :label="item.name" /> |
| | | </el-select> --> |
| | | </el-form-item> |
| | | <el-form-item label="ä¼è®®ä¸»é¢" prop="name"> |
| | | <el-input v-model="searchForm.name" placeholder="请è¾å
¥ä¼è®®ä¸»é¢" @keypress.enter.native="search"></el-input> |
| | | </el-form-item> |
| | | <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-select |
| | | v-model="searchForm.status" |
| | | filterable |
| | | clearable |
| | | placeholder="è¯·éæ©ç¶æ" |
| | | > |
| | | <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-date-picker |
| | | v-model="date" |
| | | type="datetimerange" |
| | | range-separator="è³" |
| | | value-format="yyyy-MM-dd HH:mm:ss" |
| | | start-placeholder="å¼å§æ¶é´" |
| | | end-placeholder="ç»ææ¶é´" |
| | | @change="selectDate" |
| | | ></el-date-picker> |
| | | <!-- <el-date-picker v-model="searchForm.startTime" value-format="yyyy-MM-dd" placeholder="请è¾å
¥å¼å§æ¶é´" @change="search"/> --> |
| | | </el-form-item> |
| | | <!-- <el-form-item label="ç»ææ¶é´" prop="endTime"> |
| | | <el-date-picker v-model="searchForm.endTime" value-format="yyyy-MM-dd" placeholder="请è¾å
¥ç»ææ¶é´" @change="search"/> |
| | | </el-form-item> --> |
| | | <section> |
| | | <el-button type="primary" @click="search">æç´¢</el-button> |
| | | <el-button @click="reset">éç½®</el-button> |
| | | </section> |
| | | </el-form> |
| | | <!-- è¡¨æ ¼åå页 --> |
| | | <template v-slot:table-wrap> |
| | | <ul class="toolbar" v-permissions="['business:bookings:create', 'business:bookings:exportExcel']"> |
| | | <li><el-button type="primary" @click="$refs.operaBookingsWindow.open('æ°å»ºä¼è®®')" v-permissions="['business:bookings:create']">æ°å»º</el-button></li> |
| | | <!-- <li><el-button @click="deleteByIdInBatch" v-permissions="['business:bookings:delete']">å é¤</el-button></li> --> |
| | | <li><el-button :loading="isWorking.export" v-permissions="['business:bookings:exportExcel']" @click="exportExcel">导åº</el-button></li> |
| | | </ul> |
| | | <el-table |
| | | v-loading="isWorking.search" |
| | | :data="tableData.list" |
| | | stripe |
| | | border |
| | | @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}"> |
| | | <span class="long-title-style">{{ row.name }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="roomName" label="ä¼è®®å®¤" align="center" min-width="120px" show-overflow-tooltip> |
| | | <template slot-scope="{row}"> |
| | | <span class="long-title-style">{{ row.roomName }}</span> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="meetingTime" label="ä¼è®®æ¶é´" align="center" min-width="120px"></el-table-column> |
| | | <el-table-column prop="managerInfo" label="é¢çº¦äºº" align="center" min-width="100px"></el-table-column> |
| | | <el-table-column label="ç¶æ" align="center" min-width="60px"> |
| | | <template slot-scope="{row}"> |
| | | <span v-if="row.status==0" style="color:rgb(127, 178, 53)">æ£å¸¸</span> |
| | | <span v-else style="color:rgb(234, 54, 38)">åæ¶</span> |
| | | <!-- {{ row.status==0 ? 'æ£å¸¸' : 'åæ¶' }} --> |
| | | </template> |
| | | </el-table-column> |
| | | <el-table-column prop="createDate" label="å建æ¶é´" align="center" min-width="100px"></el-table-column> |
| | | <!-- <el-table-column prop="content" label="ä¼è®®å
容" min-width="100px"></el-table-column> --> |
| | | <el-table-column |
| | | v-if="containPermissions(['business:bookings:update', 'business:bookings:delete'])" |
| | | label="æä½" |
| | | min-width="120" |
| | | align="center" |
| | | fixed="right" |
| | | > |
| | | <template slot-scope="{row}"> |
| | | <template v-if="row.status==0"> |
| | | <el-button type="text" @click="$refs.operaBookingsDetailWindow.open('ä¼è®®è¯¦æ
', row)">æ¥ç</el-button> |
| | | <el-button v-if="row.flag == 0" type="text" @click="$refs.operaBookingsWindow.open('ç¼è¾ä¼è®®é¢çº¦', row)" v-permissions="['business:bookings:update']">ä¿®æ¹</el-button> |
| | | <el-button type="text" @click="copy(row)">å¤å¶</el-button> |
| | | <el-button v-if="row.flag == 0" type="text" @click="cancelMeeting(row.id)" v-permissions="['business:bookings:update']">åæ¶</el-button> |
| | | </template> |
| | | <el-button v-else type="text" @click="deleteById(row)" v-permissions="['business:bookings:delete']">å é¤</el-button> |
| | | </template> |
| | | </el-table-column> |
| | | </el-table> |
| | | <pagination |
| | | @size-change="handleSizeChange" |
| | | @current-change="handlePageChange" |
| | | :pagination="tableData.pagination" |
| | | > |
| | | </pagination> |
| | | </template> |
| | | <!-- æ°å»º/ä¿®æ¹ --> |
| | | <OperaBookingsWindow ref="operaBookingsWindow" @success="handlePageChange"/> |
| | | <OperaBookingsDetailWindow ref="operaBookingsDetailWindow"/> |
| | | </TableLayout> |
| | | </template> |
| | | |
| | | <script> |
| | | import BaseTable from '@/components/base/BaseTable' |
| | | import TableLayout from '@/layouts/TableLayout' |
| | | import Pagination from '@/components/common/Pagination' |
| | | import OperaBookingsWindow from '@/views/meeting/components/OperaBookingsWindow' |
| | | import OperaBookingsDetailWindow from '@/views/meeting/components/OperaBookingsDetailWindow' |
| | | import { findList } from '@/api/meeting/rooms' |
| | | import { getSystemDictData } from '@/api/system/dictData' |
| | | import { fetchTree } from '@/api/system/department' |
| | | import { cancelById, bookingsDetail } from '@/api/meeting/bookings' |
| | | export default { |
| | | name: 'Bookings', |
| | | extends: BaseTable, |
| | | components: { TableLayout, Pagination, OperaBookingsWindow, OperaBookingsDetailWindow }, |
| | | data () { |
| | | return { |
| | | date: [], |
| | | // æç´¢ |
| | | searchForm: { |
| | | roomId: '', |
| | | // departmentId: [], |
| | | department: [], |
| | | realName: '', |
| | | status: '', |
| | | createDate: '', |
| | | editor: '', |
| | | editDate: '', |
| | | isdeleted: '', |
| | | remark: '', |
| | | name: '', |
| | | roomId: '', |
| | | startTime: '', |
| | | endTime: '', |
| | | content: '' |
| | | }, |
| | | props: { |
| | | label: 'name', |
| | | value: 'id', |
| | | checkStrictly: true |
| | | }, |
| | | rooms: [ |
| | | { name: '201ä¼è®®å®¤', id: '0' } |
| | | ], |
| | | department: [ |
| | | { name: 'å¼åé¨é¨', id: '0' } |
| | | ], |
| | | status: [ |
| | | { name: 'å
¨é¨', id: '' }, |
| | | { name: 'æ£å¸¸', id: '0' }, |
| | | { name: 'åæ¶', id: '1' }, |
| | | ], |
| | | link: 'https://dmtest.ahapp.net/meeting_h5/' //H5_LINK_ADDR |
| | | } |
| | | }, |
| | | provide() { |
| | | return { |
| | | rooms: () => this.rooms |
| | | } |
| | | }, |
| | | created () { |
| | | this.config({ |
| | | module: 'ä¼è®®å®¤é¢å®ä¿¡æ¯è¡¨', |
| | | api: '/meeting/bookings', |
| | | 'field.id': 'id', |
| | | 'field.main': 'id' |
| | | }) |
| | | fetchTree() |
| | | .then(res => { |
| | | this.department = this.newTree(res) |
| | | }) |
| | | getSystemDictData('H5_LINK_ADDR') |
| | | .then(res => { |
| | | console.log(res); |
| | | this.link=res.code |
| | | }) |
| | | findList({status:0}) |
| | | .then(res => { |
| | | this.rooms = res |
| | | }) |
| | | this.search() |
| | | }, |
| | | methods: { |
| | | newTree(tree) { |
| | | return tree.map(item => { |
| | | let newItem = {...item} |
| | | if (item.children.length == 0) { |
| | | this.$delete( newItem, 'children' ) |
| | | } else { |
| | | newItem.children = this.newTree(newItem.children) |
| | | } |
| | | return newItem |
| | | }); |
| | | }, |
| | | selectDate(v) { |
| | | this.searchForm.endTime = v[1] + ' 23:59:59' |
| | | this.searchForm.startTime = v[0] + ' 00:00:00' |
| | | }, |
| | | reset () { |
| | | this.$refs.searchForm.resetFields() |
| | | this.date = [] |
| | | this.searchForm.startTime = '' |
| | | this.searchForm.endTime = '' |
| | | this.search() |
| | | }, |
| | | copy(row) { |
| | | let 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('ä¼è®®ä¿¡æ¯å¤å¶æåï¼å»å享ç»åäºå§~') |
| | | }) |
| | | .catch(e => { |
| | | this.$message.error(e) |
| | | }) |
| | | }, |
| | | cancelMeeting(id) { |
| | | this.$dialog.messageWaring('åæ¶ä¼è®®', 'æ¯å¦åæ¶å½åä¼è®®ï¼') |
| | | .then(() => { |
| | | cancelById({id}) |
| | | .then(() => { |
| | | this.$message.success('åæ¶æå') |
| | | this.handlePageChange() |
| | | }) |
| | | .catch(e => { |
| | | this.$message.error(e) |
| | | }) |
| | | }) |
| | | |
| | | }, |
| | | showDetail(id) { |
| | | bookingsDetail(id) |
| | | .then(res => { |
| | | this.$refs.operaBookingsDetailWindow.open('ä¼è®®è¯¦æ
', res) |
| | | }) |
| | | .catch(e => { |
| | | this.$message.error(e) |
| | | }) |
| | | }, |
| | | 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)) |
| | | if (form.department.length) { |
| | | form.departmentId = form.department[form.department.length-1] |
| | | } |
| | | this.api.fetchList({ |
| | | page: this.tableData.pagination.pageIndex, |
| | | capacity: this.tableData.pagination.pageSize, |
| | | model: form, |
| | | sorts: this.tableData.sorts |
| | | }) |
| | | .then(data => { |
| | | this.tableData.list = data.records |
| | | this.tableData.pagination.total = data.total |
| | | }) |
| | | .catch(e => { |
| | | this.$tip.apiFailed(e) |
| | | }) |
| | | .finally(() => { |
| | | this.isWorking.search = false |
| | | }) |
| | | }, |
| | | }, |
| | | } |
| | | </script> |