diff --git a/common/http.api.js b/common/http.api.js index 4faf4a7..22b6319 100644 --- a/common/http.api.js +++ b/common/http.api.js @@ -23,6 +23,8 @@ const install = (Vue, vm) => { //报事报修 getOrderList:(params = {})=>vm.$u.get(config.adminPath+'/property/workOrders/list',params), + //会议列表 + getMeetings:(params = {})=>vm.$u.get(config.adminPath+'/property/roomBooking/list',params), // 基础服务:登录登出、身份信息、菜单授权、切换系统、字典数据等 lang: (params = {}) => vm.$u.get('/lang/'+params.lang), diff --git a/common/upload.js b/common/upload.js index fead158..fe11031 100644 --- a/common/upload.js +++ b/common/upload.js @@ -1,72 +1,94 @@ -// utils/upload.js - -export const uploadFiles = ({ - files = [], - url = '', - name = 'file', - formData = {}, - fileType = 'image', - vm, // 关键:传入 vm 以便访问 vuex_token、vuex_remember 等 -}) => { - return new Promise(async (resolve, reject) => { - if (!url) return reject(new Error('上传地址不能为空')); - if (!Array.isArray(files) || files.length === 0) return reject(new Error('文件列表不能为空')); - - const results = []; - for (let i = 0; i < files.length; i++) { - const filePath = files[i]; - try { - const res = await uploadSingleFile({ filePath, url, name, formData, fileType, vm }); - results.push(res); - } catch (err) { - reject(err); - return; - } - } - resolve(results); - }); -}; - -function uploadSingleFile({ filePath, url, name, formData = {}, fileType = 'image', vm }) { - return new Promise((resolve, reject) => { - const headers = { - 'x-requested-with': 'XMLHttpRequest', - source: 'uniapp', - clientId: 'dab457a1ea14411787c240db05bb0832', - }; - - // 手动加上 Token - if (vm?.vuex_token) { - headers.Authorization = `Bearer ${vm.vuex_token}`; - } - - // 加上 rememberMe - if (vm?.vuex_remember) { - headers['x-remember'] = vm.vuex_remember; - } - console.log('request', headers); - uni.uploadFile({ - url, - filePath, - name, - formData, - header: headers, - fileType, - success: (res) => { - try { - const data = JSON.parse(res.data); - if (res.statusCode === 200) { - resolve(data); - } else { - reject(data); - } - } catch (e) { - reject(e); - } - }, - fail: (err) => { - reject(err); - } - }); - }); -} +// utils/upload.js + +export const uploadFiles = ({ + files = [], + url = '', + name = 'file', + formData = {}, + fileType = 'image', + vm, // 关键:传入 vm 以便访问 vuex_token、vuex_remember 等 +}) => { + return new Promise(async (resolve, reject) => { + if (!url) return reject(new Error('上传地址不能为空')); + if (!Array.isArray(files) || files.length === 0) return reject(new Error('文件列表不能为空')); + + const results = []; + for (let i = 0; i < files.length; i++) { + const filePath = files[i]; + try { + const res = await uploadSingleFile({ + filePath, + url, + name, + formData, + fileType, + vm + }); + results.push(res); + } catch (err) { + reject(err); + return; + } + } + resolve(results); + }); +}; + +function uploadSingleFile({ + filePath, + url, + name, + formData = {}, + fileType = 'image', + vm +}) { + return new Promise((resolve, reject) => { + const headers = { + 'x-requested-with': 'XMLHttpRequest', + source: 'uniapp', + clientId: 'dab457a1ea14411787c240db05bb0832', + }; + + // 手动加上 Token + if (vm?.vuex_token) { + headers.Authorization = `Bearer ${vm.vuex_token}`; + } + + // 加上 rememberMe + if (vm?.vuex_remember) { + headers['x-remember'] = vm.vuex_remember; + } + console.log('request', headers); + console.log('request:', { + url: url, + filePath: filePath, + name: name, + formData: formData + }); + uni.uploadFile({ + url, + filePath, + name, + formData, + header: headers, + fileType, + success: (res) => { + try { + const data = JSON.parse(res.data); + console.log('request', data); + if (res.statusCode === 200) { + resolve(data); + } else { + reject(data); + } + } catch (e) { + reject(e); + } + }, + fail: (err) => { + reject(err); + console.log('request', err); + } + }); + }); +} \ No newline at end of file diff --git a/pages.json b/pages.json index c019a3b..c525253 100644 --- a/pages.json +++ b/pages.json @@ -303,6 +303,12 @@ "style": { "navigationBarTitleText": "发起邀约" } + }, + { + "path": "pages/sys/user/myVisitor/selectRoom", + "style": { + "navigationBarTitleText": "选择服务地址" + } }, { "path": "pages/sys/user/myVisitor/visitorInfo", @@ -376,6 +382,48 @@ "style": { "navigationStyle": "custom" } + }, + { + "path" : "pages/sys/workbench/order/order", + "style" : + { + "navigationBarTitleText": "工单管理" + } + }, + { + "path" : "pages/sys/workbench/order/createOrder", + "style" : + { + "navigationBarTitleText": "创建工单" + } + }, + { + "path" : "pages/sys/workbench/order/orderDetail", + "style" : + { + "navigationBarTitleText": "工单详情" + } + }, + { + "path" : "pages/sys/workbench/meet/meet", + "style" : + { + "navigationBarTitleText" : "会议预约" + } + }, + { + "path" : "pages/sys/workbench/meet/createMeet", + "style" : + { + "navigationBarTitleText" : "会议室预约" + } + }, + { + "path" : "pages/sys/workbench/camera", + "style" : + { + "navigationStyle": "custom" + } } ], "tabBar": { diff --git a/pages/sys/user/myVisitor/creatVisitor.vue b/pages/sys/user/myVisitor/creatVisitor.vue index 3519e0c..410247c 100644 --- a/pages/sys/user/myVisitor/creatVisitor.vue +++ b/pages/sys/user/myVisitor/creatVisitor.vue @@ -7,8 +7,8 @@ 访客信息 - 上传正脸照 - + 上传正脸照 + @@ -73,7 +73,8 @@ } from '@/common/upload.js'; export default { data() { - return { + return { + header:'', form: { visitorName: '', visitorPhone: '', @@ -104,7 +105,7 @@ count: 1 // 根据剩余数量选择 }); // 将选择的图片添加到selectedImages数组 - this.form.facePictures = images[0].path + this.header = images[0].path } catch (error) { @@ -112,7 +113,7 @@ }, async submit(){ let images = ['']; - let filePath = this.form.facePictures.replace('file://', ''); + let filePath = this.header.replace('file://', ''); images[0] = filePath; console.log("t1",images) const result = await uploadFiles({ @@ -121,10 +122,19 @@ name: 'file', vm: this // 关键:用于注入 token 等 }); - console.log("t1",result) + + if (result.code == '200') { + data = result.data.url + console.log("t1",result.data.url) + } + + this.form.facePictures = result.url }, chooseRoom() { - // 这里可弹出选择房间号 + // 这里可弹出选择房间号 + uni.navigateTo({ + url: '/pages/sys/user/myVisitor/selectRoom' + }); }, chooseCarNumber() { // 这里可弹出选择车牌号 diff --git a/pages/sys/user/myVisitor/myVisitor.vue b/pages/sys/user/myVisitor/myVisitor.vue index dda5e7f..1fe1917 100644 --- a/pages/sys/user/myVisitor/myVisitor.vue +++ b/pages/sys/user/myVisitor/myVisitor.vue @@ -146,32 +146,7 @@ display: flex; flex-direction: column; } - - .visitor-navbar { - width: 100%; - height: 120rpx; - padding-top: 40rpx; - display: flex; - align-items: center; - justify-content: center; - position: relative; - background: #fff; - flex-shrink: 0; - /* 防止被压缩 */ - } - - .visitor-back { - position: absolute; - left: 37rpx; - width: 15rpx; - height: 33rpx; - } - - .visitor-title { - font-size: 36rpx; - color: #000; - } - + .visitor-tabs { display: flex; align-items: center; diff --git a/pages/sys/user/myVisitor/selectRoom.vue b/pages/sys/user/myVisitor/selectRoom.vue new file mode 100644 index 0000000..fdd846f --- /dev/null +++ b/pages/sys/user/myVisitor/selectRoom.vue @@ -0,0 +1,155 @@ + + + + + \ No newline at end of file diff --git a/pages/sys/workbench/camera.vue b/pages/sys/workbench/camera.vue new file mode 100644 index 0000000..e871bd9 --- /dev/null +++ b/pages/sys/workbench/camera.vue @@ -0,0 +1,815 @@ + + + + + \ No newline at end of file diff --git a/pages/sys/workbench/meet/createMeet.vue b/pages/sys/workbench/meet/createMeet.vue new file mode 100644 index 0000000..cac10dd --- /dev/null +++ b/pages/sys/workbench/meet/createMeet.vue @@ -0,0 +1,471 @@ + + + + + \ No newline at end of file diff --git a/pages/sys/workbench/meet/meet.vue b/pages/sys/workbench/meet/meet.vue new file mode 100644 index 0000000..572beb4 --- /dev/null +++ b/pages/sys/workbench/meet/meet.vue @@ -0,0 +1,390 @@ + + + + + \ No newline at end of file diff --git a/pages/sys/workbench/oa/oaDetail.vue b/pages/sys/workbench/oa/oaDetail.vue index 53454c2..7872c95 100644 --- a/pages/sys/workbench/oa/oaDetail.vue +++ b/pages/sys/workbench/oa/oaDetail.vue @@ -1,498 +1,407 @@ \ No newline at end of file +.detail-container { + background-color: #f7f7f7; + min-height: 100vh; + position: relative; +} + +/* 渐变背景导航栏 */ +.detail-navbar { + width: 100%; + height: 372rpx; + padding-top: 115rpx; + display: flex; + justify-content: space-between; + background: linear-gradient(180deg, #0a60ed 0%, #ffffff 100%); +} + +/* 卡片区域盖住导航背景 */ +.card-wrapper { + position: relative; + z-index: 10; + margin-top: -200rpx; /* 向上覆盖导航背景 */ +} + +/* 通用卡片 */ +.detail-card { + background-color: #fff; + margin: 20rpx 30rpx; + border-radius: 16rpx; + padding: 30rpx; + box-shadow: 0 4rpx 8rpx rgba(0, 0, 0, 0.04); +} + +.detail-back { + margin-left: 37rpx; + width: 15rpx; + height: 33rpx; +} + +.detail-right { + margin-right: 37rpx; +} + +.detail-scan { + width: 36rpx; + height: 35rpx; +} + +.leave-header { + display: flex; + justify-content: space-between; + align-items: center; + margin-bottom: 30rpx; +} + +.leave-type { + font-weight: 600; + font-size: 26rpx; + padding: 10rpx 20rpx; + border-radius: 8rpx; + color: #2186ff; + background: rgba(33, 134, 255, 0.1); + border: 1px solid #2186ff; +} + +.leave-status { + font-size: 26rpx; + padding: 6rpx 20rpx; + border-radius: 8rpx; + color: #07c78e; + background-color: rgba(7, 199, 142, 0.1); + border: 1px solid #07c78e; +} + +.applicant-info { + display: flex; + align-items: center; + margin-bottom: 20rpx; +} + +.applicant-avatar { + width: 60rpx; + height: 60rpx; + border-radius: 30rpx; + color: #fff; + display: flex; + align-items: center; + justify-content: center; + font-size: 28rpx; + margin-right: 20rpx; +} + +.applicant-detail { + display: flex; + flex-direction: column; +} + +.applicant-name { + font-size: 28rpx; + color: #333; + font-weight: 500; + margin-bottom: 6rpx; +} + +.applicant-dept { + font-size: 24rpx; + color: #666; +} + +.submit-time { + font-size: 24rpx; + color: #999; +} + +.detail-title { + font-size: 30rpx; + color: #333; + font-weight: bold; + margin-bottom: 30rpx; +} + +.detail-item-vertical { + display: flex; + flex-direction: column; + margin-bottom: 20rpx; +} + +.detail-label-vertical { + font-size: 26rpx; + color: #666; + margin-bottom: 10rpx; +} + +.detail-value-vertical { + font-size: 26rpx; + color: #333; + margin-bottom: 10rpx; +} + +.attachment { + display: flex; + align-items: center; +} + +.attachment-preview { + width: 80rpx; + height: 80rpx; + background-color: #f5f5f5; + display: flex; + align-items: center; + justify-content: center; + margin-right: 20rpx; + border-radius: 8rpx; + overflow: hidden; +} + +.attachment-img { + width: 80rpx; + height: 80rpx; +} + +.attachment-info { + display: flex; + flex-direction: column; +} + +.attachment-name { + font-size: 26rpx; + color: #333; + margin-bottom: 6rpx; +} + +.attachment-size { + font-size: 22rpx; + color: #999; +} + +/* 审批记录 */ +.approval-item { + display: flex; + margin-bottom: 30rpx; +} + +.approval-status { + width: 30rpx; + display: flex; + flex-direction: column; + align-items: center; + margin-right: 20rpx; +} + +.status-dot { + width: 20rpx; + height: 20rpx; + border-radius: 10rpx; + border: 1px solid #ddd; + background-color: #fff; + margin-bottom: 10rpx; +} + +.status-dot.selected { + background-color: #2186ff; + border-color: #2186ff; +} + +.status-line { + width: 2rpx; + flex: 1; + background-color: #ddd; +} + +.approval-content { + flex: 1; +} + +.approval-type { + font-size: 26rpx; + color: #333; + margin-bottom: 10rpx; +} + +.approver-info { + display: flex; + align-items: center; + margin-bottom: 10rpx; +} + +.approver-avatar { + width: 40rpx; + height: 40rpx; + border-radius: 20rpx; + color: #fff; + display: flex; + align-items: center; + justify-content: center; + font-size: 22rpx; + margin-right: 10rpx; +} + +.approver-name { + font-size: 26rpx; + color: #333; + margin-right: 20rpx; +} + +.approval-result { + font-size: 24rpx; + color: #07c78e; +} + +.approval-time { + font-size: 24rpx; + color: #999; +} + diff --git a/pages/sys/workbench/order/createOrder.vue b/pages/sys/workbench/order/createOrder.vue new file mode 100644 index 0000000..38f8300 --- /dev/null +++ b/pages/sys/workbench/order/createOrder.vue @@ -0,0 +1,162 @@ +