pro
1.会议申请开始结束时间没法选择问题
2.会议审批、发布、总结人数无法显示问题
已修改5个文件
194 ■■■■■ 文件已修改
src/views/collaborativeApproval/notificationManagement/meetApplication/index.vue 165 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/notificationManagement/meetExamine/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/notificationManagement/meetIndex/index.vue 9 ●●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/notificationManagement/meetPublish/index.vue 6 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/notificationManagement/summary/index.vue 8 ●●●● 补丁 | 查看 | 原始文档 | blame | 历史
src/views/collaborativeApproval/notificationManagement/meetApplication/index.vue
@@ -84,34 +84,28 @@
        <el-row :gutter="20">
          <el-col :span="12">
            <el-form-item label="开始时间" prop="startTime">
              <el-select
                            <el-time-picker
                  v-model="meetingForm.startTime"
                  placeholder="请选择开始时间"
                                format="HH:mm"
                                value-format="HH:mm"
                                :disabled-hours="disabledStartHours"
                                :disabled-minutes="disabledStartMinutes"
                  style="width: 100%"
              >
                <el-option
                    v-for="time in startTimeOptions"
                    :key="time.value"
                    :label="time.label"
                    :value="time.value"
                />
              </el-select>
            </el-form-item>
          </el-col>
          <el-col :span="12">
            <el-form-item label="结束时间" prop="endTime">
              <el-select
                            <el-time-picker
                  v-model="meetingForm.endTime"
                  placeholder="请选择结束时间"
                                format="HH:mm"
                                value-format="HH:mm"
                                :disabled-hours="disabledEndHours"
                                :disabled-minutes="disabledEndMinutes"
                  style="width: 100%"
              >
                <el-option
                    v-for="time in endTimeOptions"
                    :key="time.value"
                    :label="time.label"
                    :value="time.value"
                />
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
@@ -205,9 +199,6 @@
// 员工列表
const employees = ref([])
// 时间选项(以半小时为间隔)
const timeOptions = ref([])
const getTimeInMinutes = (time) => {
  if (!time) return -1
  const [hour, minute] = time.split(':').map(Number)
@@ -226,16 +217,6 @@
    callback()
    return
  }
  if (isToday(meetingForm.meetingDate)) {
    const now = new Date()
    const currentMinutes = now.getHours() * 60 + now.getMinutes()
    if (getTimeInMinutes(value) > currentMinutes) {
      callback(new Error('当天开始时间不能晚于当前时间'))
      return
    }
  }
  callback()
}
@@ -244,16 +225,13 @@
    callback()
    return
  }
  if (getTimeInMinutes(value) <= getTimeInMinutes(meetingForm.startTime)) {
    callback(new Error('结束时间必须大于开始时间'))
    return
  }
  callback()
}
// 表单校验规则
const rules = {
  title: [{required: true, message: '请输入会议主题', trigger: 'blur'}],
  roomId: [{required: true, message: '请选择会议室', trigger: 'change'}],
@@ -270,77 +248,70 @@
  participants: [{required: true, message: '请选择参会人员', trigger: 'change'}]
}
const startTimeOptions = computed(() => {
  if (!isToday(meetingForm.meetingDate)) {
    return timeOptions.value
// 时间选择器禁用逻辑
const disabledStartHours = () => {
    const hours = []
    for (let h = 0; h < 24; h++) {
        if (h < 8 || h > 18) hours.push(h)
  }
    if (isToday(meetingForm.meetingDate)) {
  const now = new Date()
  const currentMinutes = now.getHours() * 60 + now.getMinutes()
  return timeOptions.value.filter(item => getTimeInMinutes(item.value) <= currentMinutes)
})
const endTimeOptions = computed(() => {
  if (!meetingForm.startTime) {
    return timeOptions.value
        for (let h = 8; h < now.getHours(); h++) {
            if (!hours.includes(h)) hours.push(h)
  }
  const startMinutes = getTimeInMinutes(meetingForm.startTime)
  return timeOptions.value.filter(item => getTimeInMinutes(item.value) > startMinutes)
})
    }
    return hours
}
// 初始化时间选项
const initTimeOptions = () => {
  const options = []
const disabledStartMinutes = (hour) => {
    const minutes = []
    for (let m = 0; m < 60; m++) {
        if (m !== 0 && m !== 30) minutes.push(m)
    }
    if (isToday(meetingForm.meetingDate)) {
  const now = new Date()
  const currentHour = now.getHours()
  const currentMinute = now.getMinutes()
  // meetingDate 是 "yyyy-MM-dd"
  const meetingDate = new Date(meetingForm.meetingDate)
  const isSameDay =
    now.getFullYear() === meetingDate.getFullYear() &&
    now.getMonth() === meetingDate.getMonth() &&
    now.getDate() === meetingDate.getDate()
  console.log('是否同一天:', isSameDay)
  for (let hour = 8; hour <= 18; hour++) {
    // 开始时间必须晚于当前时间
    if (hour < currentHour && isSameDay) {
      continue
    }
    if (hour === currentHour && currentMinute > 30 && isSameDay) {
      continue
    }
    // 每个小时添加两个选项:整点和半点
    options.push({
      value: `${hour.toString().padStart(2, '0')}:00`,
      label: `${hour.toString().padStart(2, '0')}:00`
    })
    if (hour < 18) { // 18:00之后没有半点选项
      options.push({
        value: `${hour.toString().padStart(2, '0')}:30`,
        label: `${hour.toString().padStart(2, '0')}:30`
      })
        if (hour === now.getHours()) {
            if (now.getMinutes() >= 30) {
                minutes.push(0)
    }
  }
  timeOptions.value = options
    }
    return minutes
}
watch(() => meetingForm.meetingDate, () => {
  if (meetingForm.startTime && !startTimeOptions.value.some(item => item.value === meetingForm.startTime)) {
    meetingForm.startTime = ''
  }
  if (meetingForm.endTime && !endTimeOptions.value.some(item => item.value === meetingForm.endTime)) {
    meetingForm.endTime = ''
const disabledEndHours = () => {
    const hours = []
    for (let h = 0; h < 24; h++) {
        if (h < 8 || h > 18) hours.push(h)
  }
  if (meetingForm.startTime) {
    meetingFormRef.value?.validateField('startTime')
        const startHour = parseInt(meetingForm.startTime.split(':')[0])
        for (let h = 8; h < startHour; h++) {
            if (!hours.includes(h)) hours.push(h)
  }
  if (meetingForm.endTime) {
    meetingFormRef.value?.validateField('endTime')
  }
  initTimeOptions()
})
    return hours
}
const disabledEndMinutes = (hour) => {
    const minutes = []
    for (let m = 0; m < 60; m++) {
        if (m !== 0 && m !== 30) minutes.push(m)
    }
    if (meetingForm.startTime) {
        const startHour = parseInt(meetingForm.startTime.split(':')[0])
        const startMinute = parseInt(meetingForm.startTime.split(':')[1])
        if (hour === startHour) {
            if (startMinute >= 0) minutes.push(0)
            if (startMinute >= 30) minutes.push(30)
            // only keep minutes > startMinute
            for (let m = 0; m <= startMinute; m++) {
                if (!minutes.includes(m)) minutes.push(m)
            }
        }
    }
    return minutes
}
watch(() => meetingForm.startTime, () => {
  if (meetingForm.endTime && getTimeInMinutes(meetingForm.endTime) <= getTimeInMinutes(meetingForm.startTime)) {
@@ -389,19 +360,6 @@
        // 模拟提交操作
        ElMessage.success(`${getCurrentTypeName()}提交成功`)
        // 根据不同类型执行不同操作
        switch (currentType.value) {
          case 'approval':
            ElMessage.info('会议已提交审批流程')
            break
          case 'department':
            ElMessage.info('部门级会议申请已提交')
            break
          case 'notification':
            ElMessage.info('会议通知已发布')
            break
        }
        resetForm()
      })
@@ -411,7 +369,6 @@
// 页面加载时初始化
onMounted(() => {
  initTimeOptions()
  getRoomEnum().then(res => {
    meetingRooms.value = res.data
  })
src/views/collaborativeApproval/notificationManagement/meetExamine/index.vue
@@ -36,7 +36,7 @@
        <el-table-column prop="location" label="会议地点" align="center" width="150"/>
        <el-table-column prop="participants" label="参会人数" align="center" width="100">
          <template #default="scope">
            {{ scope.row.participants.length }}人
            {{ scope.row.staffCount }}人
          </template>
        </el-table-column>
        <el-table-column prop="status" label="审批状态" align="center" width="120">
@@ -233,9 +233,9 @@
  let resp = await getExamineList({...searchForm, ...queryParams})
  approvalList.value = resp.data.records.map(it => {
    let room = roomEnum.value.find(room => it.roomId === room.id)
    it.location = `${room.name}(${room.location})`
    it.location = room ? `${room.name}(${room.location})` : ''
    let staffs = JSON.parse(it.participants)
    it.staffCount = staffs.size
    it.staffCount = staffs.length
    it.meetingTime = `${it.meetingDate} ${dayjs(it.startTime).format('HH:mm:ss')} ~ ${dayjs(it.endTime).format('HH:mm:ss')}`
    it.participants = staffList.value.filter(staff => staffs.some(id=>id === staff.id)).map(staff => {
      return {
src/views/collaborativeApproval/notificationManagement/meetIndex/index.vue
@@ -145,10 +145,11 @@
    if (endIdx === -1) {
      endIdx = timeSlots.value.length
    }
    console.log('endIdx111', endIdx)
    if (startIdx !== -1 && endIdx !== -1) {
    // 往后延伸一格,让会议格子覆盖到结束时间列上
    const displayEndIdx = Math.min(endIdx + 1, timeSlots.value.length)
    if (startIdx !== -1) {
      // 标记被占用的时间段
      for (let i = startIdx; i < endIdx; i++) {
      for (let i = startIdx; i < displayEndIdx; i++) {
        occupiedSlots.add(timeSlots.value[i].value)
      }
@@ -156,7 +157,7 @@
      cells.push({
        type: 'meeting',
        meeting: meeting,
        span: endIdx - startIdx,
        span: displayEndIdx - startIdx,
        startTime: meeting.startTime,
        endTime: meeting.endTime
      })
src/views/collaborativeApproval/notificationManagement/meetPublish/index.vue
@@ -34,7 +34,7 @@
        <el-table-column prop="location" label="会议地点" align="center" width="150"/>
        <el-table-column prop="participants" label="参会人数" align="center" width="100">
          <template #default="scope">
            {{ scope.row.participants.length }}人
            {{ scope.row.staffCount }}人
          </template>
        </el-table-column>
        <el-table-column prop="status" label="发布状态" align="center" width="120">
@@ -231,9 +231,9 @@
  let resp = await getMeetingPublish({...searchForm, ...queryParams})
  approvalList.value = resp.data.records.map(it => {
    let room = roomEnum.value.find(room => it.roomId === room.id)
    it.location = `${room.name}(${room.location})`
    it.location = room ? `${room.name}(${room.location})` : ''
    let staffs = JSON.parse(it.participants)
    it.staffCount = staffs.size
    it.staffCount = staffs.length
    it.status = it.publishStatus
    it.meetingTime = `${it.meetingDate} ${dayjs(it.startTime).format('HH:mm:ss')} ~ ${dayjs(it.endTime).format('HH:mm:ss')}`
    it.participants = staffList.value.filter(staff => staffs.some(id=>id === staff.id)).map(staff => {
src/views/collaborativeApproval/notificationManagement/summary/index.vue
@@ -28,7 +28,7 @@
        <el-table-column prop="location" label="会议地点" align="center" width="150" />
        <el-table-column prop="participants" label="参会人数" align="center" width="100">
          <template #default="scope">
            {{ scope.row.participants.length }}人
            {{ scope.row.staffCount }}人
          </template>
        </el-table-column>
        <el-table-column label="操作" align="center" width="200" fixed="right">
@@ -207,9 +207,9 @@
  let resp = await getMeetingPublish({ ...searchForm, ...queryParams })
  meetingList.value = resp.data.records.map(it => {
    let room = roomEnum.value.find(room => it.roomId === room.id)
    it.location = `${room.name}(${room.location})`
    it.location = room ? `${room.name}(${room.location})` : ''
    let staffs = JSON.parse(it.participants)
    it.staffCount = staffs.size
    it.staffCount = staffs.length
    it.meetingTime = `${it.meetingDate} ${dayjs(it.startTime).format('HH:mm:ss')} ~ ${dayjs(it.endTime).format('HH:mm:ss')}`
    it.participants = staffList.value.filter(staff => staffs.some(id => id === staff.id)).map(staff => {
      return {
@@ -260,7 +260,7 @@
<p><strong>主持人:</strong>${row.host}</p>
<p><strong>参会人员:</strong></p>
<ol>
  ${row.participants.map(p => `<li>${p.name}</li>`).join('')}
  ${(row.participants || []).map(p => `<li>${p?.name || ''}</li>`).join('')}
</ol>
<p><strong>会议内容:</strong></p>
<ol>