描述:预约会议选择参会人员

This commit is contained in:
SelfRidicule 2024-09-02 12:00:01 +08:00
parent 2eaa688633
commit ca4ddbf76f
8 changed files with 96 additions and 17 deletions

View File

@ -71,3 +71,12 @@ export function getChangyangPersonListRq() {
method: "get", method: "get",
}); });
} }
// 修改参会人员
export function updatePersonListRq(data) {
return request({
url: '/api/roomContent/updatePersonList',
method: "post",
data
});
}

View File

@ -102,7 +102,7 @@ Page({
jumpMeetingPerson() { jumpMeetingPerson() {
let ids = JSON.stringify(this.data.reservationPersonList.map(item => item.id)) let ids = JSON.stringify(this.data.reservationPersonList.map(item => item.id))
wx.navigateTo({ wx.navigateTo({
url: `/pages/meeting/meetingRoom/meetingPerson/meetingPerson?ids=${ids}` url: `/pages/meeting/meetingRoom/meetingPerson/meetingPerson?pageType=add&ids=${ids}`
}) })
}, },

View File

@ -1,5 +1,10 @@
const app = getApp()
import Notify from '@vant/weapp/notify/notify';
import { import {
getChangyangPersonListRq getChangyangPersonListRq,
updatePersonListRq
} from "../../../../api/meeting/visitorIinvitation.js" } from "../../../../api/meeting/visitorIinvitation.js"
Page({ Page({
@ -10,7 +15,11 @@ Page({
/** 数据*/ /** 数据*/
dataList: [], dataList: [],
// //
reservationId: null,
roomContentId: null,
ids: [], ids: [],
pageType: '',
userData: null,
}, },
/** /**
@ -18,9 +27,11 @@ Page({
*/ */
onLoad(options) { onLoad(options) {
let _this = this; let _this = this;
let ids = JSON.parse(options.ids) options.ids = JSON.parse(options.ids)
//
_this.setData({ _this.setData({
ids ...options,
userData: wx.getStorageSync('user'),
}) })
// //
// 获取数据 // 获取数据
@ -122,6 +133,7 @@ Page({
// 提交 // 提交
submit() { submit() {
let _this = this; let _this = this;
let pageType = _this.data.pageType
let personList = [] let personList = []
_this.data.dataList.map(data => { _this.data.dataList.map(data => {
personList = personList.concat(data.list.filter(item => item.isSelect)) personList = personList.concat(data.list.filter(item => item.isSelect))
@ -132,10 +144,32 @@ Page({
// 上个页面数据 // 上个页面数据
// let detail = prevPage.data.detail; // let detail = prevPage.data.detail;
// 赋值上个页面的数据 if (pageType == 'add') { // 添加
prevPage.setData({ // 赋值上个页面的数据
reservationPersonList: personList prevPage.setData({
}) reservationPersonList: personList
})
} else if (pageType == 'update') { // 修改
updatePersonListRq({
userId: _this.data.userData.id,
roomContentId: _this.data.roomContentId,
id: _this.data.reservationId,
reservationPersonList: personList.map(item => {
return {
userId: item.id,
roomContentId: _this.data.roomContentId
}
})
}).then(res => {
console.log('updatePersonListRq', res);
if (res.code == 0) {
app.vantNotifySuccess(Notify, res.msg)
} else {
app.vantNotifyErr(Notify, res.msg)
}
})
}
// 后退页面 // 后退页面
wx.navigateBack(); wx.navigateBack();
}, },

View File

@ -5,6 +5,7 @@
"van-index-bar": "@vant/weapp/index-bar/index", "van-index-bar": "@vant/weapp/index-bar/index",
"van-index-anchor": "@vant/weapp/index-anchor/index", "van-index-anchor": "@vant/weapp/index-anchor/index",
"van-divider": "@vant/weapp/divider/index", "van-divider": "@vant/weapp/divider/index",
"van-checkbox": "@vant/weapp/checkbox/index" "van-checkbox": "@vant/weapp/checkbox/index",
"van-notify": "@vant/weapp/notify/index"
} }
} }

View File

@ -15,3 +15,6 @@
<view class="space"></view> <view class="space"></view>
<view class="submitBtn" bind:tap="submit">提交</view> <view class="submitBtn" bind:tap="submit">提交</view>
<!-- 提示 -->
<van-notify id="van-notify" />

View File

@ -31,7 +31,8 @@ Page({
id: null, id: null,
detail: null, detail: null,
facilities: {}, facilities: {},
joinPersonList: [] joinPersonList: [],
dataChange: false,
}, },
/** /**
@ -42,8 +43,6 @@ Page({
_this.setData({ _this.setData({
...options ...options
}) })
// 获取详情
_this.getDetail();
}, },
// 获取详情 // 获取详情
@ -223,6 +222,20 @@ Page({
}) })
}, },
// 跳转-人员列表
jumpMeetingPerson() {
let _this = this
// 人员列表id
let ids = _this.data.detail.reservationPersonList.map(item => item.userId)
ids = JSON.stringify(ids)
// 预约id
let reservationId = _this.data.detail.id
let roomContentId = _this.data.detail.roomContentId
wx.navigateTo({
url: `/pages/meeting/meetingRoom/meetingPerson/meetingPerson?reservationId=${reservationId}&roomContentId=${roomContentId}&pageType=update&ids=${ids}`
})
},
/** /**
* 生命周期函数--监听页面初次渲染完成 * 生命周期函数--监听页面初次渲染完成
*/ */
@ -234,7 +247,11 @@ Page({
* 生命周期函数--监听页面显示 * 生命周期函数--监听页面显示
*/ */
onShow() { onShow() {
let _this = this
setTimeout(() => {
// 获取详情
_this.getDetail();
}, 100);
}, },
/** /**

View File

@ -73,7 +73,12 @@
<!-- 参与人员 --> <!-- 参与人员 -->
<view class="basicView"> <view class="basicView">
<view class="labelTitle leftLineTitle">参会人员({{joinPersonList.length}}/{{detail.reservationPersonList.length}}</view> <view class="labelTitle leftLineTitle">
<view class="titleContainer">
<view class="left">参会人员({{joinPersonList.length}}/{{detail.reservationPersonList.length}}</view>
<view class="right" bind:tap="jumpMeetingPerson">管理</view>
</view>
</view>
<view class="cellView borderNone"> <view class="cellView borderNone">
<view class="joinView"> <view class="joinView">
<view class="joinPersonView" wx:for="{{joinPersonList}}" wx:key="*this"> <view class="joinPersonView" wx:for="{{joinPersonList}}" wx:key="*this">

View File

@ -63,6 +63,17 @@
.basicView {} .basicView {}
.basicView .titleContainer {
display: flex;
justify-content: space-between;
align-items: center;
}
.basicView .titleContainer .right {
font-size: 30rpx;
color: #3794FF;
}
.basicView .labelTitle { .basicView .labelTitle {
margin: 40rpx 20rpx; margin: 40rpx 20rpx;
font-size: 32rpx; font-size: 32rpx;
@ -219,8 +230,7 @@
} }
.facilitiesView { .facilitiesView {}
}
.facilitiesView .itemView { .facilitiesView .itemView {
display: flex; display: flex;