''
liukangdong
2024-07-04 5a85dcab83e969d6b21c599b512a15117e9b8651
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
<template>
  <view class="main_app">
    <template>
      <!-- <uni-calendar @change="changeCalendar" :selected="selected" /> -->
      <!-- 日历 -->
      <view class="container_b">
        <Calendar
          ref="Calendar"
          :currentTime="currentDate"
          :mark="monthMark"
          :showLunar="false"
          @dayChange="dayChange"
          @monthChange="monthChange"
          :rangeMode="false"
          :maskColor="'#ffffff'"
          :dateStart="dateStart"
          :dateEnd="dateEnd"
          :canDrag="false"
        ></Calendar>
      </view>
      <!--  -->
      <view class="card_list">
        <view class="card_title">
          <view class="name">
            <view class="icon"></view>
            <view class="text">今日会议</view>
          </view>
          <view class="meeting">
            <view class="text mr24" @click="isShowStatus = true">{{
              activeRoom.name
            }}</view>
            <u-icon name="arrow-down" size="12" color="#999999" />
          </view>
        </view>
        <view class="list">
          <view
            @click="handleDetail(item.id)"
            class="item"
            v-for="item in myMeetingList"
            :key="item.id"
          >
            <view class="head">
              <view class="name">{{ item.meetingName }}</view>
              <view class="status" v-if="item.meetingStatus == '1'"
                >未开始</view
              >
              <view class="status red" v-if="item.meetingStatus == '2'"
                >进行中</view
              >
              <view class="status" v-if="item.meetingStatus == '3'"
                >已结束</view
              >
              <view class="status padding" v-if="item.meetingStatus == '4'"
                >即将开始</view
              >
              <view class="status" v-if="item.meetingStatus == '5'"
                >已撤销</view
              >
            </view>
            <view class="line">
              <view class="label">会议时间:</view>
              <view class="value">{{ item.meetingTime }}</view>
            </view>
            <view class="line">
              <view class="label">会议室:</view>
              <view class="value">{{ item.roomName }}</view>
            </view>
            <view class="line">
              <view class="label">预约人:</view>
              <view class="value">{{ item.bookingUser }}</view>
            </view>
            <view class="line">
              <view class="label">备注:</view>
              <view class="value">{{ item.remark || item.meetingRemark }}</view>
            </view>
          </view>
          <view v-if="myMeetingList.length === 0" style="text-align: center">
            <image
              src="@/static/empty.png"
              style="width: 320rpx; margin: 120rpx auto 0"
              mode="widthFix"
            />
            <view class="placeholder9 fs24">暂无数据</view>
          </view>
        </view>
      </view>
    </template>
    <!--  -->
    <u-picker
      keyName="name"
      :show="isShowStatus"
      :columns="meetingList"
      @confirm="seletedStatus"
      @cancel="isShowStatus = false"
    ></u-picker>
  </view>
</template>
 
<script>
import Calendar from '@/components/Li-Calendar/Li-Calendar.vue'
import dayja from 'dayjs'
import { myMeetingPage, monthMeetingPage, roomsListPost } from '@/api'
function getDate(date, AddDayCount = 0) {
  if (!date) {
    date = new Date()
  }
  if (typeof date !== 'object') {
    date = date.replace(/-/g, '/')
  }
  const dd = new Date(date)
 
  dd.setDate(dd.getDate() + AddDayCount) // 获取AddDayCount天后的日期
 
  const y = dd.getFullYear()
  const m = dd.getMonth() + 1 < 10 ? '0' + (dd.getMonth() + 1) : dd.getMonth() + 1 // 获取当前月份的日期,不足10补0
  const d = dd.getDate() < 10 ? '0' + dd.getDate() : dd.getDate() // 获取当前几号,不足10补0
  return {
    fullDate: y + '-' + m + '-' + d,
    year: y,
    month: m,
    date: d,
    day: dd.getDay()
  }
}
export default {
  components: {
    Calendar
  },
  data() {
    return {
      activeTab: '0',
      recordList: [],
      recordPage: 1,
      myPage: 1,
      myMeetingList: [],
      currentDate: '',
      dateStart: '1999-05-01',
      dateEnd: '2999-06-15',
      monthMark: [],
 
      isShowStatus: false,
      activeRoom: {
        name: '全部会议室',
        id: ''
      },
      meetingList: [],
 
    }
  },
  onLoad() {
    this.currentDate = dayja().format('YYYY-MM-DD')
    this.initData()
    this.getRoomList()
  },
  onShow() {
    this.myPage = 1
    this.myMeetingList = []
    this.getDayMeeting()
  },
  onReachBottom() {
    this.myPage = this.myPage + 1
    this.getDayMeeting()
  },
  methods: {
    initData() {
      // 当月数据
      monthMeetingPage({
        yearMonth: this.currentDate.slice(0, 7)
      }).then(res => {
        this.monthMark = res.data.filter(i => i.meetingNum > 0).map(j => {
          return {
            time: j.monthDate,
            pointText: j.meetingNum,
            pointTextColor: '#fff'
          }
        })
      })
    },
    getRoomList() {
      roomsListPost({}).then(res => {
        this.meetingList = [[{ id: '', name: '全部会议室' }, ...res.data]]
      })
    },
    seletedStatus(e) {
      this.myMeetingList = []
      this.activeRoom = { ...e.value[0] }
      this.recordPage = 1
      this.isShowStatus = false
      this.getDayMeeting()
    },
    handleDetail(id) {
      uni.navigateTo({
        url: `/pages/staff/meetingDetail?id=${id}`,
        // url: `/pages/staff/meetingDetail`
      })
    },
    changeCalendar(e) {
      console.log(e)
    },
    // 点击某天
    dayChange(data) {
      let date = data.time
      let yyyy = data.time.substring(0, 4)
      let mm = Number(data.time.substring(data.time.indexOf('-') + 1, data.time.lastIndexOf('-')))
      let dd = Number(data.time.substring(data.time.lastIndexOf('-') + 1, data.time.length))
      mm = mm < 10 ? `0${mm}` : mm
      dd = dd < 10 ? `0${dd}` : dd
      let riqi = `${yyyy}-${mm}-${dd}`
      this.currentDate = riqi
      this.myMeetingList = []
      this.activeStatus = {
        name: '全部会议室',
        key: ''
      }
      this.myPage = 1
      this.getDayMeeting()
    },
    // 下一月
    monthChange(data) {
      let date = data.date.replace(/[/]/g, '-')
      let yyyy = date.substring(0, 4)
      let mm = Number(date.substring(date.indexOf('-') + 1, date.lastIndexOf('-')))
      let dd = Number(date.substring(date.lastIndexOf('-') + 1, date.length))
      mm = mm < 10 ? `0${mm}` : mm
      dd = dd < 10 ? `0${dd}` : dd
      let riqi = `${yyyy}-${mm}-${dd}`
      console.log('日期', riqi)
      this.currentDate = riqi
      this.initData()
    },
 
    getDayMeeting() {
      const { myPage, activeRoom, currentDate } = this
      // 当天我参与的会议
      myMeetingPage({
        model: {
          queryType: '1',
          roomsId: activeRoom.id,
          queryDate: currentDate
        },
        page: myPage,
        capacity: 10
      }).then(res => {
        this.myMeetingList = [...this.myMeetingList, ...res.data.records]
      })
    },
  }
};
</script>
 
<style lang="scss">
page {
  background-color: #f7f7f7;
}
.main_app {
  padding: 0;
  background-color: #f7f7f7;
  ::v-deep .uni-calendar-item--checked {
    background-color: $uni-color-primary;
    border-radius: 8rpx;
  }
  ::v-deep .uni-calendar-item--isDay-text {
    color: $uni-color-primary;
  }
  ::v-deep .uni-calendar-item--isDay {
    background-color: $uni-color-primary;
    color: #fff;
    border-radius: 8rpx;
  }
  .tabs {
    display: flex;
    background-color: #fff;
    .tab {
      flex: 1;
      height: 88rpx;
      display: flex;
      justify-content: center;
      align-items: center;
      font-size: 28rpx;
      color: #666666;
      position: relative;
      .line {
        width: 60rpx;
        height: 4rpx;
        background: #fff;
        border-radius: 3rpx;
        position: absolute;
        bottom: 0;
        left: 50%;
        transform: translate(-50%, 0);
      }
    }
    .active {
      font-weight: 600;
      font-size: 30rpx;
      color: #222222;
      .line {
        background-color: $uni-color-primary;
      }
    }
  }
  //
  .card_list {
    padding: 30rpx;
    .card_title {
      display: flex;
      justify-content: space-between;
      align-items: center;
      margin-bottom: 22rpx;
      .name {
        display: flex;
        align-items: center;
        .icon {
          width: 6rpx;
          height: 32rpx;
          background: $uni-color-primary;
          border-radius: 4rpx;
          margin-right: 16rpx;
        }
        .text {
          font-weight: 600;
          font-size: 32rpx;
          color: #222222;
        }
      }
      .meeting {
        display: flex;
        height: 52rpx;
        line-height: 52rpx;
        background: #ffffff;
        border-radius: 26rpx;
        border: 2rpx solid #eeeeee;
        padding: 0 24rpx;
        .text {
          font-size: 24rpx;
          color: #333333;
        }
      }
    }
    .list {
      .item {
        padding: 0rpx 30rpx 30rpx;
        background: #ffffff;
        border-radius: 8rpx;
        margin-bottom: 24rpx;
        .head {
          display: flex;
          justify-content: space-between;
          align-items: center;
          border-bottom: 1rpx solid #e5e5e5;
          padding: 22rpx 0;
          margin-bottom: 22rpx;
          .name {
            font-weight: 600;
            font-size: 32rpx;
            color: #222222;
            flex: 1;
            overflow: hidden;
            white-space: nowrap;
            text-overflow: ellipsis;
          }
          .status {
            height: 38rpx;
            margin-left: 20rpx;
            line-height: 38rpx;
            padding: 0 16rpx;
            border-radius: 4rpx;
            border: 1rpx solid #999999;
            font-size: 22rpx;
            color: #999999;
          }
          .padding {
            color: $uni-color-primary;
            border: 1rpx solid $uni-color-primary;
          }
          .red {
            color: #e23f29;
            border: 1rpx solid #e23f29;
          }
        }
        .line {
          display: flex;
          margin-bottom: 12rpx;
          .label {
            width: 140rpx;
            color: #666666;
          }
          .value {
            flex: 1;
          }
        }
      }
    }
  }
}
.container_b {
  width: 100%;
  padding: 30rpx;
  background: #ffffff;
  padding-top: 20rpx;
  box-sizing: border-box;
}
</style>