From 69a1b3bf45738f048361ee4ccb6bdc64fce35720 Mon Sep 17 00:00:00 2001
From: MrShi <1878285526@qq.com>
Date: 星期三, 12 三月 2025 11:31:46 +0800
Subject: [PATCH] 更新
---
admin/src/views/meeting/bookings.vue | 395 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
1 files changed, 395 insertions(+), 0 deletions(-)
diff --git a/admin/src/views/meeting/bookings.vue b/admin/src/views/meeting/bookings.vue
new file mode 100644
index 0000000..5d9ee9b
--- /dev/null
+++ b/admin/src/views/meeting/bookings.vue
@@ -0,0 +1,395 @@
+<template>
+ <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-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="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-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"
+ :default-time="['00:00:00', '23:59:59']" start-placeholder="寮�濮嬫椂闂�" end-placeholder="缁撴潫鏃堕棿"
+ @change="selectDate"></el-date-picker> -->
+ <el-date-picker type="datetime" v-model="searchForm.startTime" value-format="yyyy-MM-dd HH:mm:ss"
+ placeholder="璇烽�夋嫨寮�濮嬫椂闂�" @change="changeRadio" />
+ <el-date-picker type="datetime" v-model="searchForm.endTime" value-format="yyyy-MM-dd HH:mm:ss"
+ placeholder="璇烽�夋嫨缁撴潫鏃堕棿" @change="changeRadio" />
+ </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> -->
+ <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" ref="toolbarEle" 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 :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 }">
+ <span class="long-title-style">{{ row.name }}</span>
+ </template>
+ </el-table-column>
+ <el-table-column prop="meetingTime" label="浼氳鏃堕棿" align="center" min-width="160px"></el-table-column>
+
+ <!-- <el-table-column prop="meetingTime" label="浼氳鏃堕棿" align="center" min-width="120px"></el-table-column> -->
+ <!-- <el-table-column prop="meetingTime" label="浼氳鏃堕棿" align="center" min-width="120px"></el-table-column> -->
+ <!-- <el-table-column prop="meetingTime" label="浼氳鏃堕棿" align="center" min-width="120px"></el-table-column> -->
+ <!-- <el-table-column prop="meetingTime" label="浼氳鏃堕棿" align="center" min-width="400px"></el-table-column> -->
+
+ <el-table-column prop="managerInfo" label="棰勭害浜�" align="center" min-width="100px"></el-table-column>
+
+ <el-table-column prop="createDate" label="鎿嶄綔鏃堕棿" align="center" min-width="150px"></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 label="浼氳鐘舵��" align="center" min-width="60px">
+ <template slot-scope="{ row }">
+ <span v-if="row.meetingStatus == 1">鏈紑濮�</span>
+ <span v-if="row.meetingStatus == 2">杩涜涓�</span>
+ <span v-if="row.meetingStatus == 3">宸茬粨鏉�</span>
+ <span v-if="row.meetingStatus == 4">鍗冲皢寮�濮�</span>
+ <span v-if="row.meetingStatus == 5">宸叉挙閿�</span>
+ <!-- {{ row.status==0 ? '姝e父' : '鍙栨秷' }} -->
+ </template>
+ </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="140" align="center" fixed="right">
+ <template slot-scope="{ row }">
+ <template>
+ <el-button type="text" @click="$refs.operaBookingsDetailWindow.open('浼氳璇︽儏', row)">鏌ョ湅璇︽儏</el-button>
+ <el-button v-if=" (row.meetingStatus == '1' || row.meetingStatus == '4') &&row.creator === userInfo.id " type="text" @click="$refs.operaBookingsWindow.open('缂栬緫浼氳棰勭害', row)">缂栬緫</el-button>
+ <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'"
+ @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 type="text" @click="deleteById(row)" class="red" v-permissions="['business:bookings:delete']">鍒犻櫎</el-button>
+ </template>
+ </template>
+ </el-table-column>
+ </el-table>
+ <pagination @size-change="handleSizeChange" @current-change="handlePageChange" :pagination="tableData.pagination">
+ </pagination>
+ </template>
+ <!-- 鏂板缓/淇敼 -->
+ <OperaBookingsWindow ref="operaBookingsWindow" @success="handlePageChange" />
+ <OperaBookingsDetailWindow @success="search" 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 { fetchList } from '@/api/business/company'
+import { cancelById, bookingsDetail, startEarlyById, startById, meetingEndById } from '@/api/meeting/bookings'
+import { timeForMat } from '@/utils/util'
+export default {
+ name: 'Bookings',
+ extends: BaseTable,
+ components: { TableLayout, Pagination, OperaBookingsWindow, OperaBookingsDetailWindow },
+ data () {
+ return {
+ date: [],
+ // userInfo: this.$store.state.userInfo,
+ // 鎼滅储
+ searchForm: {
+ roomId: '',
+ // departmentId: [],
+ department: [],
+ realName: '',
+ meetingStatus: '',
+ createDate: '',
+ editor: '',
+ editDate: '',
+ isdeleted: '',
+ remark: '',
+ name: '',
+ startTime: '',
+ endTime: '',
+ content: '',
+ radio: 0
+ },
+ props: {
+ label: 'name',
+ value: 'id',
+ checkStrictly: true
+ },
+ rooms: [
+ { name: '201浼氳瀹�', id: '0' }
+ ],
+ department: [
+ { name: '寮�鍙戦儴闂�', id: '0' }
+ ],
+ status: [
+ { name: '鏈紑濮�', id: 1 },
+ { name: '鍗冲皢寮�濮�', id: 4 },
+ { name: '杩涜涓�', id: 2 },
+ { name: '宸叉挙閿�', id: 5 },
+ { name: '宸茬粨鏉�', id: 3 }
+ ],
+ 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'
+ })
+ fetchList(1)
+ .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.changeRadio('0')
+ },
+ methods: {
+ changeRadio (e) {
+ if (e === '0') {
+ this.searchForm.startTime = timeForMat(0)[0]
+ this.searchForm.endTime = timeForMat(0)[1]
+ } else if (e === '1') {
+ this.searchForm.startTime = timeForMat(6)[0]
+ this.searchForm.endTime = timeForMat(6)[1]
+ } else if (e === '2') {
+ this.searchForm.startTime = timeForMat(29)[0]
+ this.searchForm.endTime = timeForMat(29)[1]
+ } else {
+ this.searchForm.radio = ''
+ }
+ if (this.searchForm.startTime && this.searchForm.endTime && new Date(this.searchForm.startTime).getTime() > new Date(this.searchForm.endTime).getTime()) {
+ this.$message.error('寮�濮嬫椂闂翠笉鑳藉ぇ浜庣粨鏉熸椂闂�')
+ this.searchForm.startTime = ''
+ return
+ }
+ this.search()
+ },
+ newTree (tree) {
+ if (tree == null) {
+ return []
+ }
+ return tree.map(item => {
+ 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) {
+ 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 = ''
+ this.searchForm.startTime = ''
+ this.searchForm.endTime = ''
+ // this.changeRadio('0')
+ this.search()
+ },
+ 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('浼氳淇℃伅澶嶅埗鎴愬姛锛屽幓鍒嗕韩缁欏悓浜嬪惂~')
+ })
+ .catch(e => {
+ })
+ },
+ handleStart (row) {
+ this.$dialog.messageWaring('寮�濮嬩細璁�', '鏄惁寮�濮嬪綋鍓嶄細璁紵')
+ .then(() => {
+ const fn = new Date(row.startTime).getTime() > new Date().getTime() ? startEarlyById : startById
+ fn({ id: row.id })
+ .then(() => {
+ this.$message.success('浼氳宸插紑濮�')
+ this.handlePageChange()
+ })
+ .catch(e => {
+ })
+ })
+ },
+ handleEnd (row) {
+ this.$dialog.messageWaring('缁撴潫浼氳', '鏄惁缁撴潫褰撳墠浼氳锛�')
+ .then(() => {
+ meetingEndById({ id: row.id })
+ .then(() => {
+ this.$message.success('浼氳宸茬粨鏉�')
+ this.handlePageChange()
+ })
+ .catch(e => {
+ })
+ })
+ },
+ cancelMeeting (id) {
+ this.$dialog.messageWaring('鍙栨秷浼氳', '鏄惁鍙栨秷褰撳墠浼氳锛�')
+ .then(() => {
+ cancelById({ id })
+ .then(() => {
+ this.$message.success('鍙栨秷鎴愬姛')
+ this.handlePageChange()
+ })
+ .catch(e => {
+ })
+ })
+ },
+ showDetail (id) {
+ bookingsDetail(id)
+ .then(res => {
+ this.$refs.operaBookingsDetailWindow.open('浼氳璇︽儏', res)
+ })
+ .catch(e => {
+ })
+ },
+ editBookings (id) {
+ bookingsDetail(id)
+ .then(res => {
+ this.$refs.operaBookingsWindow.open('缂栬緫浼氳棰勭害', res)
+ })
+ .catch(e => {
+ })
+ },
+ handlePageChange (pageIndex) {
+ this.__checkApi()
+ this.tableData.pagination.pageIndex = pageIndex || this.tableData.pagination.pageIndex
+ this.isWorking.search = true
+ const 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>
+
+<style lang="scss" scoped>
+.detail_modal {
+ padding: 20px 16px;
+
+ .title {
+ text-align: center;
+ font-weight: 600;
+ font-size: 16px;
+ margin-bottom: 20px;
+ }
+
+ .h1 {
+ font-weight: 600;
+ font-size: 16px;
+ margin-bottom: 15px;
+ }
+
+ .line {
+ display: flex;
+ margin-bottom: 10px;
+
+ .label {
+ width: 70px;
+ color: #888888;
+ }
+
+ .value {
+ color: #333333;
+ }
+ }
+}
+</style>
--
Gitblit v1.9.3