diff --git a/.env b/.env index 5553335..f56b7f1 100644 --- a/.env +++ b/.env @@ -19,16 +19,16 @@ VITE_OAUTH2_APP_CLIENT='mini:mini' # --------------------------- 开发环境 api地址 ---------------------------------- # VITE_APP_DEV_SERVICE = https://stgl.pj.gov.cn/api # 域名线上 #VITE_APP_DEV_SERVICE = http://59.202.170.152:81/api # 信创线上 -VITE_APP_DEV_SERVICE = http://192.168.101.196:9999 # 邓-本地 -# VITE_APP_DEV_SERVICE = http://127.0.0.1:9999 # 邓-本地 -# VITE_APP_DEV_SERVICE = http://123.157.250.162:8089/api # 测试线上 +# VITE_APP_DEV_SERVICE = http://192.168.101.174:9999 # 邓-本地 + VITE_APP_DEV_SERVICE = http://127.0.0.1:9999 # 邓-本地 +#VITE_APP_DEV_SERVICE = http://123.157.250.162:8089/api # 测试线上 # --------------------------- 开发环境 图片访问基础地址 --------------------------- # VITE_IMAGE_DEV_PATH = https://stgl.pj.gov.cn/api # 域名线上 #VITE_IMAGE_DEV_PATH = http://59.202.170.152:81/api # 信创线上 -VITE_IMAGE_DEV_PATH = http://192.168.101.196:9999 # 邓-本地 - # VITE_IMAGE_DEV_PATH = http://127.0.0.1:9999 -# VITE_IMAGE_DEV_PATH = http://123.157.250.162:8089/api # 测试线上 +# VITE_IMAGE_DEV_PATH = http://192.168.101.174:9999 # 邓-本地 + VITE_IMAGE_DEV_PATH = http://127.0.0.1:9999 +#VITE_IMAGE_DEV_PATH = http://123.157.250.162:8089/api # 测试线上 # --------------------------- 生产环境 api地址 ---------------------------------- VITE_APP_PROD_SERVICE = https://stgl.pj.gov.cn/api # 域名线上 diff --git a/src/pages/integrated/meeting/detail.vue b/src/pages/integrated/meeting/detail.vue index 2d1ec77..b9e144d 100644 --- a/src/pages/integrated/meeting/detail.vue +++ b/src/pages/integrated/meeting/detail.vue @@ -53,7 +53,57 @@ - 发起会议 + 发起会议 + + + + + + 会议预约 + × + + + + + + 是否需要会务服务 + + + {{ option.label }} + + + + + + + 桌子摆放形态 + + + {{ layout.name }} + {{ layout.description }} + + + + + + + 取消 + + {{ isBooking ? '预约中...' : '确认预约' }} + + + + @@ -120,6 +170,19 @@ const selectedTimeText = computed(() => { }) const selectedDuration = computed(() => selectedTime.value.length * 30) +// 弹窗相关数据 +const showModal = ref(false) +const needService = ref('0') // 默认不需要会务服务 +const selectedLayout = ref('') // 选中的桌子摆放形态ID +const deskLayouts = ref([]) // 桌子摆放形态列表 +const isBooking = ref(false) // 预约中状态 + +// 会务服务选项 +const serviceOptions = [ + { value: '0', label: '不需要' }, + { value: '1', label: '需要' } +] + // 获取日期字符串 const getDateString = (index: number) => { const date = new Date() @@ -172,6 +235,24 @@ const fetchTimeSlots = async (date: string) => { } } +// 获取桌子摆放形态数据 +const fetchDeskLayouts = async () => { + try { + const res = await meetingRoomApi.getMeetingDeskLayout('') + console.log('Desk layouts response:', res) + + const response = res as unknown as ApiResponse + if (response.code === 0 && response.data) { + deskLayouts.value = response.data + console.log('Desk layouts data:', deskLayouts.value) + } else { + console.error('Failed to fetch desk layouts:', response) + } + } catch (error) { + console.error('API request failed:', error) + } +} + // 选择时间 function selectTime(index: number) { const slot = timeSlots.value[index] @@ -200,20 +281,52 @@ function selectTime(index: number) { } } -// 预约会议 -async function reserveMeeting() { +// 显示预约弹窗 +function showReserveModal() { if (selectedTime.value.length === 0) { uni.showToast({ title: '请选择时间', icon: 'none' }) return } + showModal.value = true +} +// 隐藏弹窗 +function hideModal() { + showModal.value = false +} + +// 选择会务服务 +function selectService(value: string) { + needService.value = value +} + +// 选择桌子摆放形态 +function selectLayout(layoutId: string) { + selectedLayout.value = layoutId +} + +// 确认预约 +async function confirmReserve() { if (!roomId.value) { uni.showToast({ title: '会议室ID不存在', icon: 'none' }) return } + // 防止重复点击 + if (isBooking.value) { + return + } + + // 设置预约中状态 + isBooking.value = true + + // 显示loading + uni.showLoading({ + title: '预约中...', + mask: true + }) + try { - uni.showLoading({ title: '预约中...', mask: true }) const date = getDateString(activeDate.value) const startSlot = timeSlots.value[selectedTime.value[0]] const endSlot = timeSlots.value[selectedTime.value[selectedTime.value.length - 1]] @@ -224,29 +337,83 @@ async function reserveMeeting() { endTime: endSlot.endTime, title: room.value.name || '会议', description: '', - attendees: [] + attendees: [], + need_service: needService.value, + desk_layout: selectedLayout.value }) - const response = res as unknown as ApiResponse - if (response.code === 0) { - uni.hideLoading() - uni.showToast({ title: '预约成功', icon: 'success' }) - setTimeout(() => { - uni.navigateBack() - }, 1500) + console.log('预约接口响应:', res) + console.log('响应类型:', typeof res) + console.log('响应内容:', JSON.stringify(res)) + + // 处理响应数据 + const responseData = res as any + + // 检查业务错误(HTTP 200 但 code !== 0) + if (responseData && responseData.code !== undefined) { + console.log('检测到响应码:', responseData.code) + console.log('检测到响应消息:', responseData.msg) + + if (responseData.code === 0) { + // 成功:隐藏loading,显示成功提示 + uni.hideLoading() + isBooking.value = false + uni.showToast({ title: '预约成功', icon: 'success' }) + hideModal() + setTimeout(() => { + uni.navigateBack() + }, 1500) + } else { + // 失败:隐藏loading,关闭弹窗,显示错误信息 + uni.hideLoading() + isBooking.value = false + console.log('预约失败,错误信息:', responseData.msg) + + // 先关闭弹窗,再显示错误信息 + hideModal() + + // 延迟显示错误信息,确保弹窗完全关闭 + setTimeout(() => { + uni.showToast({ + title: responseData.msg || '预约失败', + icon: 'none', + duration: 3000 + }) + }, 300) + } } else { + // 响应格式异常:隐藏loading,显示错误信息 uni.hideLoading() + isBooking.value = false + console.log('响应格式异常:', responseData) uni.showToast({ - title: response.msg || '预约失败', - icon: 'none' + title: '预约失败,响应格式异常', + icon: 'none', + duration: 3000 }) } } catch (error) { + // 确保在异常情况下也隐藏loading uni.hideLoading() - uni.showToast({ - title: '预约失败', - icon: 'none' - }) + isBooking.value = false + console.error('预约失败:', error) + + // 处理HTTP错误(如500错误) + const errorData = error as any + if (errorData?.data?.msg) { + console.log('HTTP错误信息:', errorData.data.msg) + uni.showToast({ + title: errorData.data.msg, + icon: 'none', + duration: 3000 + }) + } else { + uni.showToast({ + title: '预约失败,请重试', + icon: 'none', + duration: 3000 + }) + } } } @@ -284,6 +451,9 @@ onMounted(() => { console.log('Fetching time slots for date:', today) fetchTimeSlots(today) + // 获取桌子摆放形态数据 + fetchDeskLayouts() + // 从 localStorage 获取用户信息 try { const userInfoString = localStorage.getItem('user_info') @@ -489,4 +659,160 @@ const goBack = () => { padding: 24rpx 0; font-weight: 600; } + +/* 弹窗样式 */ +.modal-overlay { + position: fixed; + top: 0; + left: 0; + right: 0; + bottom: 0; + background: rgba(0, 0, 0, 0.5); + display: flex; + align-items: center; + justify-content: center; + z-index: 1000; +} + +.modal-content { + width: 90%; + max-width: 600rpx; + background: #fff; + border-radius: 16rpx; + overflow: hidden; +} + +.modal-header { + display: flex; + align-items: center; + justify-content: space-between; + padding: 32rpx; + border-bottom: 1px solid #f0f0f0; +} + +.modal-title { + font-size: 32rpx; + font-weight: 600; + color: #222; +} + +.modal-close { + font-size: 40rpx; + color: #999; + width: 60rpx; + height: 60rpx; + display: flex; + align-items: center; + justify-content: center; +} + +.modal-body { + padding: 32rpx; +} + +.form-item { + margin-bottom: 32rpx; +} + +.form-label { + display: block; + font-size: 28rpx; + color: #333; + margin-bottom: 16rpx; + font-weight: 500; +} + +.service-options { + display: flex; + gap: 16rpx; +} + +.service-option { + flex: 1; + padding: 20rpx; + border: 2rpx solid #e0e0e0; + border-radius: 8rpx; + text-align: center; + background: #fff; + transition: all 0.3s; +} + +.service-option.active { + border-color: #1777FF; + background: #e6f0ff; + color: #1777FF; +} + +.option-text { + font-size: 26rpx; +} + +.layout-options { + display: flex; + flex-direction: column; + gap: 12rpx; +} + +.layout-option { + padding: 20rpx; + border: 2rpx solid #e0e0e0; + border-radius: 8rpx; + background: #fff; + transition: all 0.3s; +} + +.layout-option.active { + border-color: #1777FF; + background: #e6f0ff; +} + +.layout-name { + display: block; + font-size: 26rpx; + color: #333; + font-weight: 500; + margin-bottom: 4rpx; +} + +.layout-option.active .layout-name { + color: #1777FF; +} + +.layout-desc { + display: block; + font-size: 22rpx; + color: #666; +} + +.layout-option.active .layout-desc { + color: #1777FF; +} + +.modal-footer { + display: flex; + border-top: 1px solid #f0f0f0; +} + +.modal-btn { + flex: 1; + padding: 24rpx; + text-align: center; + font-size: 28rpx; + font-weight: 500; +} + +.cancel-btn { + color: #666; + border-right: 1px solid #f0f0f0; +} + +.confirm-btn { + color: #1777FF; + font-weight: 600; +} + +.modal-btn.disabled { + opacity: 0.5; + pointer-events: none; +} \ No newline at end of file diff --git a/src/pages/integrated/todo/index.vue b/src/pages/integrated/todo/index.vue index 174e854..2e7b542 100644 --- a/src/pages/integrated/todo/index.vue +++ b/src/pages/integrated/todo/index.vue @@ -4,10 +4,10 @@ - 工作待办 + 我的待办 - 工作待办 + 我的待办 我的已办 @@ -34,8 +34,8 @@ - - + + @@ -43,6 +43,335 @@ 没有更多了 + + + + + + 提交审核 + × + + + + + 审核意见 + + {{ approvalComment.length }}/100 + + + + + 取消 + 确定 + + + + + + + + + 选择转办人员 + × + + + + + + + + + + + + + {{ item.name }} + > + + + + + + + + 部门 + + + ✓ + + 🏢 + + 下级 + + + + 员工 + + + ✓ + + + + {{ employee.name.charAt(0) }} + + + + + + + + 取消 + 确定 + + + + + + + + + 转办确认 + × + + + + + + 转办给: + {{ selectedUser?.name }} + + + + + 审核意见 * + + {{ delegateComment.length }}/100 + + + + + 取消 + 确定 + + + + + + + + + 审批处理 + × + + + + + + + {{ field.name }}{{ field.required ? ' *' : '' }} + + {{ field.props?.value || '' }} + + + {{ field.props?.value || field.placeholder || '未知' }} + + {{ field.props?.value || '未知' }} + + + + + + + + 流水号 + {{ currentTask.serialNumber || '未知流水号' }} + + + + + * 会议室 + {{ currentTask.roomName || '未知会议室' }} + + + + + * 预约人 + {{ currentTask.applicantName || '未知申请人' }} + + + + + * 预约时间 + {{ currentTask.meetingTime || '未知时间' }} + + + + + + + + + + {{ flow.status === 2 ? '✓' : '⟲' }} + + + {{ flow.name }}{{ flow.placeholder ? ` [${flow.placeholder}]` : '' }} + + + + + {{ user.name?.charAt(0) || '?' }} + + {{ user.name || '未知用户' }} + + + + + 待分配 + + + + + + + + + + ✓ + + 发起人 + + + {{ currentTask.applicantName || '未知申请人' }} + + + + + + ⟲ + + 审批人 + + + 当前用户 + + + + + + + + + + + × + 关闭 + + + + + + + + + + + + + 转办 + + + + + + + + + + 选择转办人员 + * + + + + {{ selectedUser.name }} + × + + + + + + + {{ userSelectError }} + + + + + + 审核意见 + * + + +