修复部分问题

This commit is contained in:
471615499@qq.com 2024-10-04 17:29:12 +08:00
parent 36e780d615
commit dc6952a381
2 changed files with 97 additions and 133 deletions

View File

@ -41,8 +41,32 @@ Page({
value: null,
},
personDict: {
list: [],
value: null,
list: [{
text: '人数',
value: ''
}, {
text: '1-10',
value: 1
}, {
text: '11-20',
value: 2
}, {
text: '21-30',
value: 3
}, {
text: '31-40',
value: 4
}, {
text: '41-50',
value: 5
}, {
text: '51-100',
value: 6
}, {
text: '100 以上',
value: 7
}],
value: '',
},
itemDict: {
list: [],
@ -80,7 +104,7 @@ Page({
app.selfShowMsg('请选择时间!', '/pages/meeting/index/index')
return
}
const _date = new Date(parseInt(time))
const _year = _date.getFullYear()
const _month = _date.getMonth() + 1 // 月份从0开始需要+1
@ -155,106 +179,26 @@ Page({
}, ...typeList]
queryParam.shapeDict.list = typeList
let numList = []
for (let key in dataObj.personNum) {
let eachObj = dataObj.personNum[key]
// const keys = Object.keys(eachObj)
numList.push({
text: eachObj,
value: eachObj
})
}
numList = [{
text: "人数",
value: null
}, ...numList]
queryParam.personDict.list = numList
// let numList = []
// for (let key in dataObj.personNum) {
// let eachObj = dataObj.personNum[key]
// // const keys = Object.keys(eachObj)
// numList.push({
// text: eachObj,
// value: eachObj
// })
// }
// numList = [{
// text: "人数",
// value: null
// }, ...numList]
// queryParam.personDict.list = numList
_this.setData({
queryParam
})
})
// 1.会议室类型2.人数3.会议室设备4.形式
// meetingRoomDict("1").then(res => {
// console.log('meetingRoomDict("1")', res);
// // 封装参数
// let list = res.roomContents.map(item => {
// return {
// text: item.typeName,
// value: item.typeValue
// }
// })
// list = [{
// text: "楼层",
// value: null
// }, ...list]
// // 赋值参数
// let queryParam = _this.data.queryParam;
// queryParam.meetingTypeDict.list = list;
// _this.setData({
// queryParam
// })
// console.log('meetingRoomDict("1")=>', list);
// })
// meetingRoomDict("2").then(res => {
// console.log('meetingRoomDict("2")', res);
// // 封装参数
// let list = res.roomContents.map(item => {
// return {
// text: item.capacityNum + '人',
// value: item.capacityNum
// }
// })
// list = [{
// text: "人数",
// value: null
// }, ...list]
// // 赋值参数
// let queryParam = _this.data.queryParam;
// queryParam.personDict.list = list;
// _this.setData({
// queryParam
// })
// console.log('meetingRoomDict("2")=>', list);
// })
// meetingRoomDict("3").then(res => {
// console.log('meetingRoomDict("3")', res);
// // 封装参数
// let list = res.roomItem.map(item => {
// return {
// text: item.name,
// value: item.id
// }
// })
// // 赋值参数
// let queryParam = _this.data.queryParam;
// queryParam.itemDict.list = list;
// _this.setData({
// queryParam
// })
// console.log('meetingRoomDict("3")=>', list);
// })
// meetingRoomDict("4").then(res => {
// console.log('meetingRoomDict("4")', res);
// // 封装参数
// let list = res.roomContents.map(item => {
// return {
// text: item.shape,
// value: item.shape
// }
// })
// list = [{
// text: "形式",
// value: null
// }, ...list]
// // 赋值参数
// let queryParam = _this.data.queryParam;
// queryParam.shapeDict.list = list;
// _this.setData({
// queryParam
// })
// console.log('meetingRoomDict("4")=>', list);
// })
// 数据-会议室列表
this.meetingRoomList()
},
@ -314,15 +258,31 @@ Page({
devicesArr.push(eachObj.value)
}
}
// let roomItemList = queryParam.itemDict.list.filter(item => item.select).map(item => {
// return {
// "id": item.value,
// "name": item.text
// }
// })
let minPerNum = 0
let maxPerNum = 1000
let perNumValue = queryParam.personDict.value
if (perNumValue == 6) {
// 51-100
maxPerNum = 100
minPerNum = 51
} else if (perNumValue == 7) {
// 100以上
minPerNum = 101
maxPerNum = 1000
} else if (perNumValue == '') {
// 全部
minPerNum = 1
maxPerNum = 1000
} else {
// 其余,符合规则即可
// perNumValue * 10 - 9 ~ perNumValue * 10
maxPerNum = parseInt(perNumValue) * 10
minPerNum = maxPerNum - 9
}
let param = {
floor: queryParam.meetingTypeDict.value, // 楼层
capacityNum: queryParam.personDict.value, // 人数
min: minPerNum, // 最小容纳人数
max: maxPerNum, // 最大容纳人数
devices: devicesArr, // 设备
typeName: queryParam.shapeDict.value, // 形状
timeFormat: queryParam.timeRangeDict.value, // 预约时间格式0 任意时间管理员1上午2下午3晚上 4 全天。值为0时读取startTime和endTime为预约会议时间范围其他值读取mrdate再拼接时间为预约会议时间范围。
@ -357,7 +317,7 @@ Page({
timeRange = timeRange ? timeRange : 0
// 跳转预约详情
wx.navigateTo({
url: "/pages/meeting/meetingRoom/meetingRoom?status="+ e.currentTarget.dataset.status +"&id=" + e.currentTarget.dataset.id + '&time=' + this.data.date + '&timeRange=' + timeRange + '&rId=' + this.data.rId + '&dep=' + this.data.dep + '&depId=' + this.data.depId
url: "/pages/meeting/meetingRoom/meetingRoom?status=" + e.currentTarget.dataset.status + "&id=" + e.currentTarget.dataset.id + '&time=' + this.data.date + '&timeRange=' + timeRange + '&rId=' + this.data.rId + '&dep=' + this.data.dep + '&depId=' + this.data.depId
})
},

View File

@ -164,22 +164,8 @@ Page({
console.log(`JSON error : ${error}`);
}
}
_this.getService(serveId)
// 提前处理服务,不需要进入页面后获取
// let serviceList = detail.roomServeList.map(item => {
// let isSel = false
// if (serveId.includes(item.id)) {
// isSel = true
// }
// return {
// serveId: item.id,
// serveName: item.serveName,
// isSelect: isSel,
// num: '',
// type: 'free'
// }
// })
console.log(detail)
let hasServeId = detail.ext1
_this.getService(hasServeId, serveId)
_this.setData({
// serviceList: serviceList,
room: detail,
@ -187,8 +173,18 @@ Page({
})
})
},
getService(serveId) {
getService(hasServeId, serveId) {
console.log(hasServeId)
let _this = this;
if (!hasServeId || hasServeId == '') {
// 为空,此时无服务
_this.setData({
serviceList: []
})
return
}
// 拆分此会议室拥有的服务id与字典比对
let hasServeIdArr = hasServeId.split(',')
meetingRoomDict().then(res => {
console.log('meetingRoomDict', res)
let queryParam = _this.data.queryParam
@ -200,16 +196,19 @@ Page({
const keys = Object.keys(eachObj)
let isSel = false
let sId = eachObj[keys[0]]
if (serveId.includes(sId)) {
isSel = true
if (hasServeIdArr.includes(sId)) {
// 此房间拥有的服务才继续处理
if (serveId.includes(sId)) {
isSel = true
}
serviceList.push({
serveId: eachObj[keys[0]],
serveName: keys[0],
isSelect: isSel,
num: '',
type: 'free'
})
}
serviceList.push({
serveId: eachObj[keys[0]],
serveName: keys[0],
isSelect: isSel,
num: '',
type: 'free'
})
}
// queryParam.shapeDict.list = typeList
_this.setData({
@ -234,7 +233,12 @@ Page({
// 跳转-空间设施
jumpMeetingFacilities() {
console.log(this.data.serviceList)
console.log('跳转', this.data.serviceList)
if (this.data.serviceList.length == 0) {
// 没有服务
Notify('此会议室不提供服务!')
return
}
let meetingRoomId = this.data.meetingRoomId;
let serviceListJsonStr = JSON.stringify(this.data.serviceList)
wx.navigateTo({