From f49cf1c04d06333ace67926430c651ca3cc1752f Mon Sep 17 00:00:00 2001
From: liukangdong <898885815@qq.com>
Date: 星期二, 11 六月 2024 11:07:08 +0800
Subject: [PATCH] ''

---
 admin/src/views/meeting/bookings.vue |   83 +++++++++++++++++++++++++++--------------
 1 files changed, 55 insertions(+), 28 deletions(-)

diff --git a/admin/src/views/meeting/bookings.vue b/admin/src/views/meeting/bookings.vue
index 2be5978..a149596 100644
--- a/admin/src/views/meeting/bookings.vue
+++ b/admin/src/views/meeting/bookings.vue
@@ -58,6 +58,15 @@
         ></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> -->
@@ -143,6 +152,7 @@
 import { getSystemDictData } from '@/api/system/dictData'
 import { fetchList } from '@/api/business/company'
 import { cancelById, bookingsDetail } from '@/api/meeting/bookings'
+import { timeForMat } from '@/utils/util'
 export default {
   name: 'Bookings',
   extends: BaseTable,
@@ -165,7 +175,8 @@
         name: '',
         startTime: '',
         endTime: '',
-        content: ''
+        content: '',
+        radio: 0
       },
       props: {
         label: 'name',
@@ -181,12 +192,12 @@
       status: [
         { name: '鍏ㄩ儴', id: '' },
         { name: '姝e父', 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
     }
@@ -204,46 +215,64 @@
       })
     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) {
-      if(tree ==null){
+    changeRadio (e) {
+      if (e === '0') {
+        this.searchForm.startTime = timeForMat(0)[0]
+        this.searchForm.endTime = timeForMat(0)[1]
+        this.time = timeForMat(0)
+      } else if (e === '1') {
+        this.searchForm.startTime = timeForMat(6)[0]
+        this.searchForm.endTime = timeForMat(6)[1]
+        this.time = timeForMat(6)
+      } else if (e === '2') {
+        this.searchForm.startTime = timeForMat(29)[0]
+        this.searchForm.endTime = timeForMat(29)[1]
+        this.time = timeForMat(29)
+      }
+      this.search()
+    },
+    newTree (tree) {
+      if (tree == null) {
         return []
       }
       return tree.map(item => {
-        let newItem = {...item}
-        if(newItem){
-          newItem.children=newItem.childList
+        const newItem = { ...item }
+        if (newItem) {
+          newItem.children = newItem.childList
         }
         if (item.children && item.children.length == 0) {
-          this.$delete( newItem, 'children' )
+          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()
     },
-    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('浼氳淇℃伅澶嶅埗鎴愬姛锛屽幓鍒嗕韩缁欏悓浜嬪惂~')
@@ -252,10 +281,10 @@
           this.$message.error(e)
         })
     },
-    cancelMeeting(id) {
+    cancelMeeting (id) {
       this.$dialog.messageWaring('鍙栨秷浼氳', '鏄惁鍙栨秷褰撳墠浼氳锛�')
         .then(() => {
-          cancelById({id})
+          cancelById({ id })
             .then(() => {
               this.$message.success('鍙栨秷鎴愬姛')
               this.handlePageChange()
@@ -264,9 +293,8 @@
               this.$message.error(e)
             })
         })
-
     },
-    showDetail(id) {
+    showDetail (id) {
       bookingsDetail(id)
         .then(res => {
           this.$refs.operaBookingsDetailWindow.open('浼氳璇︽儏', res)
@@ -275,7 +303,7 @@
           this.$message.error(e)
         })
     },
-    editBookings(id) {
+    editBookings (id) {
       bookingsDetail(id)
         .then(res => {
           this.$refs.operaBookingsWindow.open('缂栬緫浼氳棰勭害', res)
@@ -283,15 +311,14 @@
         .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,
@@ -309,7 +336,7 @@
         .finally(() => {
           this.isWorking.search = false
         })
-    },
-  },
+    }
+  }
 }
 </script>

--
Gitblit v1.9.3