<template>
|
<view class="confirm">
|
<view class="confirm_a">
|
<view class="confirm_a_item">
|
<view class="label">会议时间</view>
|
<view class="content">
|
{{time}}
|
</view>
|
</view>
|
<view class="confirm_a_item">
|
<view class="label">会议室</view>
|
<view class="content">
|
{{info.name}} <template v-if="info.limitNum">(可容纳{{info.limitNum}}人)</template>
|
</view>
|
</view>
|
<view class="confirm_a_item">
|
<view class="label">预约人</view>
|
<view class="content">
|
{{user.departmentName ? user.departmentName : userInfo.departmentName}} {{user.realname ? user.realname : userInfo.realname}} {{user.mobile ? user.mobile : userInfo.mobile}}
|
</view>
|
</view>
|
</view>
|
<view class="confirm_b">
|
<view class="confirm_b_item">
|
<view class="label">
|
<text>会议主题</text>
|
<text>*</text>
|
</view>
|
<view class="input">
|
<input type="text" v-model="from.theme" placeholder="请输入会议主题" placeholder-class="placeholder" />
|
</view>
|
</view>
|
<view class="confirm_b_item">
|
<view class="label">
|
<text>会议内容</text>
|
</view>
|
<view class="input">
|
<textarea class="textarea" placeholder="请按要求输入内容" maxlength="300" v-model="from.content" />
|
<!-- <view class="num">{{ from.content.length }}/300</view> -->
|
<!-- <textarea
|
v-model="from.content"
|
placeholder="请按要求输入内容"
|
placeholder-style="color: #999999;font-size: 30rpx;font-weight: 400;"
|
:maxlength="300"/> -->
|
|
<!-- <u--textarea
|
border="none"
|
v-model="from.content"
|
maxlength="300"
|
height="150"
|
placeholder="请按要求输入内容"
|
count></u--textarea> -->
|
</view>
|
</view>
|
</view>
|
<view class="confirm_b">
|
<view class="confirm_b_item" @click="jump">
|
<view class="label">
|
<text>参会人员</text>
|
<text>*</text>
|
</view>
|
<view class="select">
|
<text :style="{color: usersName ? '#000' : ''}">{{usersName ? usersName : '请选择'}}</text>
|
<view class="select_right">></view>
|
</view>
|
</view>
|
<view class="confirm_b_item" v-if="info.projectList && info.projectList.length > 0">
|
<view class="label">
|
<text>选择服务项</text>
|
</view>
|
<view class="multiple">
|
<view
|
:class="item.active ? 'multiple_item active' : 'multiple_item'" v-for="(item, index) in info.projectList"
|
:key="index"
|
@click="serviceItems(index)">
|
{{item.projectName}}
|
</view>
|
</view>
|
</view>
|
<view class="confirm_b_item">
|
<view class="label">
|
<text>附件</text>
|
</view>
|
<view class="uplaod">
|
<view class="uplaod_item" v-for="(item, index) in from.files" :key="index">
|
<view class="uplaod_item_url">
|
<text @click="linkAddress(item.url)">{{item.name}}</text>
|
<!-- <u--text :lines="1" mode="link" :text="item.name" :href="item.url" ></u--text> -->
|
</view>
|
<text class="dele" @click="dele(index)">删除</text>
|
</view>
|
<view class="uplaod_box" @click="uploadFile">
|
<image src="@/static/meeting/icon/ic_upload@2x.png" mode="widthFix"></image>
|
<text>点击上传</text>
|
</view>
|
</view>
|
</view>
|
<view class="confirm_b_item">
|
<view class="label">
|
<text>会议需求</text>
|
</view>
|
<view class="input">
|
<textarea
|
v-model="from.notes"
|
placeholder="请输入"
|
placeholder-style="color: #999999;font-size: 30rpx;font-weight: 400;"
|
:maxlength="300"/>
|
<!-- <u--textarea
|
border="none"
|
v-model="from.notes"
|
height="150"
|
placeholder="请输入"></u--textarea> -->
|
</view>
|
</view>
|
</view>
|
<view class="confirm_footer">
|
<view class="confirm_footer_btn" @click="submit">{{id ? '确认编辑' : '确认预约'}}</view>
|
</view>
|
</view>
|
</template>
|
|
<script>
|
import { mapState } from 'vuex'
|
export default {
|
data() {
|
return {
|
id: '',
|
roomId: '',
|
value2: '',
|
time: '',
|
info: {},
|
usersName: '',
|
timelist: [],
|
userList: [],
|
startTime: '',
|
endTime: '',
|
from: {
|
theme: '',
|
content: '',
|
files: [],
|
notes: ''
|
},
|
user: {}
|
};
|
},
|
computed: {
|
...mapState(['userInfo'])
|
},
|
async onLoad(option) {
|
if (option.descid) {
|
uni.setNavigationBarTitle({
|
title: "编辑会议"
|
});
|
this.roomId = option.roomId
|
this.id = option.descid
|
this.timelist = JSON.parse(option.timeList)
|
await this.getDesc()
|
this.getdesc()
|
} else {
|
this.time = option.time
|
this.roomId = option.id
|
this.startTime = option.startTime
|
this.endTime = option.endTime
|
this.timelist = JSON.parse(option.list)
|
this.getDesc()
|
}
|
},
|
onShow() {
|
uni.$once('user', (data) => {
|
this.userList = data.userList
|
this.usersName = data.usersName
|
})
|
},
|
methods: {
|
linkAddress(link) {
|
uni.setClipboardData({
|
data: link,
|
success: function () {
|
uni.showToast({
|
title: '链接已复制,请在浏览器打开',
|
icon: 'none',
|
duration: 2000
|
});
|
}
|
});
|
},
|
dele(index) {
|
this.from.files.splice(index, 1)
|
},
|
getdesc() {
|
this.$u.api.meetingDetail({ id: this.id })
|
.then(res => {
|
this.time = res.data.meetingDate + ' ' + res.data.meetingTime
|
this.from.notes = res.data.remark
|
this.from.theme = res.data.meetingName
|
this.from.content = res.data.meetingContent
|
this.user = res.data.bookingUser
|
this.startTime = res.data.meetingDate + ' ' + res.data.meetingTime.substring(0, 5)
|
this.endTime = res.data.meetingDate + ' ' + res.data.meetingTime.substring(8, 13)
|
|
if (res.data.projectsResponseList.length > 0) {
|
res.data.projectsResponseList.forEach(item => {
|
this.info.projectList.forEach(child => {
|
if (item.id === child.projectId) {
|
child.active = true
|
}
|
})
|
})
|
}
|
|
if (res.data.multiFileList.length > 0) {
|
this.from.files = res.data.multiFileList.map(item => {
|
return {
|
fileurl: item.fileurl,
|
name: item.name,
|
url: item.fileurl + item.name
|
}
|
})
|
}
|
if (res.data.userResponseList.length > 0) {
|
this.userList = res.data.userResponseList.map(item => {
|
return {
|
userId: item.id
|
}
|
})
|
let name = res.data.userResponseList.map(item => item.realname)
|
this.usersName = name.join(';')
|
}
|
})
|
},
|
submit() {
|
if (!this.from.theme) return uni.showToast({
|
title: '会议主题不能为空',
|
icon: 'none',
|
duration: 2000
|
});
|
if (this.userList.length === 0) return uni.showToast({
|
title: '请先选择参会人员',
|
icon: 'none',
|
duration: 2000
|
});
|
var that = this
|
uni.requestSubscribeMessage({
|
tmplIds: [
|
'_-HjcxNFJQU3O6P_I_bFzEQsiuUsT_0vbCLUxRL4zRA',
|
'6dc1gVYwRVm7kTnjdZRtzMGa48iBPZ5kX2N_S7TnDac',
|
'lEWpQak_nN9iC3re0Ub2RH7vgBxvB-EX8yp_Q5SdQTA'
|
],
|
success (res) {
|
let projectList = []
|
that.info.projectList.forEach(item => {
|
if (item.active) {
|
projectList.push({ projectId: item.projectId })
|
}
|
})
|
that.$u.api.reservationMeeting({
|
id: that.id,
|
bookingTimeList: that.timelist,
|
content: that.from.content.substring(0, 300),
|
fileList: that.from.files,
|
name: that.from.theme,
|
projectList,
|
remark: that.from.notes,
|
roomId: that.roomId,
|
sysList: that.userList,
|
startTime: (that.startTime + ':00').replace(/年/g, '-').replace(/月/g, '-').replace(/日/g, ''),
|
endTime: (that.endTime + ':00').replace(/年/g, '-').replace(/月/g, '-').replace(/日/g, '')
|
}).then(res => {
|
if (res.code === 200) {
|
let url = `/packagesMine/meetingDetails/meetingDetails?id=${res.data}`
|
if (that.id) {
|
uni.showToast({
|
title: '编辑成功',
|
icon: 'none',
|
duration: 2000,
|
complete() {
|
setTimeout(() => {
|
uni.reLaunch({
|
url: url
|
});
|
}, 2000)
|
}
|
});
|
} else {
|
uni.showToast({
|
title: '预约成功',
|
icon: 'none',
|
duration: 2000,
|
complete() {
|
setTimeout(() => {
|
uni.reLaunch({
|
url: url
|
});
|
}, 2000)
|
}
|
});
|
}
|
}
|
})
|
},
|
fail(err) {
|
console.log(err)
|
// uni.showToast({
|
// title: '订阅失败',
|
// icon: 'error',
|
// duration: 2000
|
// });
|
}
|
})
|
},
|
serviceItems(i) {
|
this.info.projectList[i].active = !this.info.projectList[i].active
|
},
|
getDesc() {
|
this.$u.api.getRoomDetail({ roomId: this.roomId })
|
.then(res => {
|
res.data.projectList.forEach(item => {
|
item.active = false
|
})
|
this.info = res.data
|
})
|
},
|
uploadFile() {
|
var that = this
|
uni.chooseImage({
|
success: (chooseImageRes) => {
|
for (let i = 0; i < chooseImageRes.tempFilePaths.length; i++) {
|
uni.uploadFile({
|
url: `${that.$baseUrl}public/uploadLocal`,
|
filePath: chooseImageRes.tempFilePaths[i],
|
name: 'file',
|
formData: {
|
'folder': 'projects'
|
},
|
success: (uploadFileRes) => {
|
console.log(JSON.parse(uploadFileRes.data));
|
let res = JSON.parse(uploadFileRes.data).data
|
that.from.files.push({
|
fileurl: res.imgaddr,
|
name: res.imgname,
|
url: res.url
|
})
|
}
|
});
|
}
|
}
|
});
|
},
|
jump() {
|
uni.navigateTo({
|
url: `/packagesMine/selectPersonnel/selectPersonnel?startTime=${this.startTime}&endTime=${this.endTime}`
|
});
|
}
|
}
|
}
|
</script>
|
|
<style lang="scss">
|
.confirm {
|
width: 100%;
|
padding-bottom: calc(108rpx + env(safe-area-inset-bottom));
|
.confirm_a {
|
width: 100%;
|
padding: 30rpx;
|
box-sizing: border-box;
|
background-color: #fff;
|
.confirm_a_item {
|
width: 100%;
|
display: flex;
|
flex-direction: column;
|
padding-bottom: 30rpx;
|
margin-bottom: 30rpx;
|
border-bottom: 1rpx solid #E5E5E5;
|
&:last-child {
|
margin-bottom: 0 !important;
|
border: none !important;
|
padding-bottom: 0 !important;
|
}
|
.label {
|
font-size: 28rpx;
|
font-family: PingFangSC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #666666;
|
margin-bottom: 30rpx;
|
}
|
.content {
|
font-size: 30rpx;
|
font-family: PingFangSC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #222222;
|
}
|
}
|
}
|
.confirm_b {
|
width: 100%;
|
margin-top: 20rpx;
|
padding: 30rpx;
|
background: #fff;
|
box-sizing: border-box;
|
.confirm_b_item {
|
display: flex;
|
flex-direction: column;
|
padding-bottom: 30rpx;
|
margin-bottom: 30rpx;
|
border-bottom: 1rpx solid #E5E5E5;
|
&:last-child {
|
margin-bottom: 0 !important;
|
border: none !important;
|
padding-bottom: 0 !important;
|
}
|
.select {
|
width: 100%;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
.select_right {
|
flex-shrink: 0;
|
margin-left: 20rpx;
|
color: #999999;
|
font-size: 24rpx;
|
}
|
text {
|
flex: 1;
|
font-size: 30rpx;
|
font-family: PingFangSC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #999999;
|
overflow:hidden;
|
white-space: nowrap;
|
text-overflow: ellipsis;
|
-o-text-overflow:ellipsis;
|
}
|
}
|
.uplaod {
|
width: 100%;
|
.uplaod_item {
|
width: 100%;
|
// word-break: break-all;
|
margin-bottom: 20rpx;
|
display: flex;
|
align-items: center;
|
justify-content: space-between;
|
&:last-child {
|
margin-bottom: 0 !important;
|
}
|
.uplaod_item_url {
|
flex: 1;
|
overflow: hidden;
|
white-space: nowrap;
|
text-overflow: ellipsis;
|
text {
|
font-size: 28rpx;
|
font-family: PingFangSC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #0055FF;
|
text-decoration: underline;
|
}
|
// .u-link {
|
// width: 200rpx !important;
|
// overflow: hidden !important;
|
// white-space: nowrap !important;
|
// text-overflow: ellipsis !important;
|
// }
|
}
|
.dele {
|
font-size: 26rpx;
|
font-family: PingFangSC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #666666;
|
flex-shrink: 0;
|
margin-left: 20rpx;
|
}
|
}
|
.uplaod_box {
|
width: 212rpx;
|
height: 64rpx;
|
line-height: 64rpx;
|
text-align: center;
|
border-radius: 4rpx;
|
border: 1rpx solid #0055FF;
|
image {
|
width: 28rpx;
|
height: 28rpx;
|
margin-right: 8rpx;
|
}
|
text {
|
font-size: 28rpx;
|
font-family: PingFangSC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #0055FF;
|
}
|
}
|
}
|
.multiple {
|
width: 100%;
|
display: flex;
|
align-items: center;
|
flex-wrap: wrap;
|
.active {
|
background: #0055FF !important;
|
color: #FFFFFF !important;
|
}
|
.multiple_item {
|
padding: 18rpx 32rpx;
|
background: #F7F7F7;
|
border-radius: 4rpx;
|
box-sizing: border-box;
|
font-size: 28rpx;
|
font-family: PingFangSC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #333333;
|
margin-right: 20rpx;
|
margin-bottom: 20rpx;
|
}
|
}
|
.label {
|
display: flex;
|
align-items: center;
|
margin-bottom: 30rpx;
|
text {
|
&:nth-child(1) {
|
font-size: 28rpx;
|
font-family: PingFangSC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #666666;
|
margin-right: 8rpx;
|
}
|
&:nth-child(2) {
|
font-size: 28rpx;
|
font-family: PingFangSC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #F62710;
|
}
|
}
|
}
|
.input /deep/ {
|
width: 100%;
|
display: flex;
|
flex-direction: column;
|
align-items: flex-end;
|
textarea {
|
width: 100%;
|
}
|
.u-textarea {
|
padding: 0 !important;
|
}
|
.placeholder {
|
font-size: 30rpx;
|
font-family: PingFangSC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #999999;
|
}
|
input {
|
width: 100%;
|
font-size: 30rpx;
|
font-family: PingFangSC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #000000;
|
}
|
}
|
}
|
}
|
.confirm_footer {
|
width: 100%;
|
position: fixed;
|
bottom: 0;
|
box-sizing: border-box;
|
padding: 10rpx 30rpx calc(10rpx + env(safe-area-inset-bottom)) 30rpx;
|
z-index: 9;
|
.confirm_footer_btn {
|
width: 690rpx;
|
height: 88rpx;
|
line-height: 88rpx;
|
text-align: center;
|
background: #0055FF;
|
border-radius: 4rpx;
|
font-size: 30rpx;
|
font-family: PingFangSC-Regular, PingFang SC;
|
font-weight: 400;
|
color: #FFFFFF;
|
}
|
}
|
}
|
</style>
|