Merge branch 'shoot-hand-html' of https://gitee.com/elegant_wings/dbd-meeting-html into shoot-hand-html

This commit is contained in:
lujiang 2024-10-10 21:38:18 +08:00
commit c251517e24
19 changed files with 1741 additions and 770 deletions

3
.gitignore vendored
View File

@ -19,3 +19,6 @@ yarn-error.log*
*.njsproj *.njsproj
*.sln *.sln
*.sw* *.sw*
vue.config.js
.env.development

View File

@ -1,6 +1,9 @@
<h1 align="center">ICS Ant</h1> <h1 align="center">ICS Ant</h1>
Overview Overview
## 前端文档地址:
https://1x.antdv.com/components/
---- ----
项目下载和运行 项目下载和运行
---- ----

View File

@ -9,18 +9,21 @@
<script> <script>
import { domTitle, setDocumentTitle } from '@/utils/domUtil' import { domTitle, setDocumentTitle } from '@/utils/domUtil'
import { i18nRender } from '@/locales' import { i18nRender } from '@/locales'
import zhCN from 'ant-design-vue/lib/locale-provider/zh_CN'
export default { export default {
data () { data () {
return { return {
locale: zhCN, // ant
} }
}, },
computed: { computed: {
locale () { //
// // locale () {
const { title } = this.$route.meta // //
title && (setDocumentTitle(`${i18nRender(title)} - ${domTitle}`)) // const { title } = this.$route.meta
return this.$i18n.getLocaleMessage(this.$store.getters.lang).antLocale // title && (setDocumentTitle(`${i18nRender(title)} - ${domTitle}`))
} // return this.$i18n.getLocaleMessage(this.$store.getters.lang).antLocale
// }
} }
} }
</script> </script>

View File

@ -0,0 +1,93 @@
import { axios } from '@/utils/request'
/**
* 会议室统计数据
* /admin/ms/roomStats
* @参数 day 格式2024-09-30
* @返回
* alreadyBooking, 已预约会议室数量
* noBooking,未预约会议室数量
* going,开会中会议室数量
* free,空闲中会议室数量
* @param parameter
* @returns {AxiosPromise}
*/
export function getNum(parameter) {
return axios({
url: '/admin/ms/roomStats',
method: 'post',
params: parameter
})
}
/**
* 按日历统计数据
* /admin/ms/calendar
* @参数 month 月份格式2024-09
* @返回,月份的每一天 预约记录
* @param parameter
* @returns {AxiosPromise}
*/
export function getCalendar(parameter) {
return axios({
url: '/admin/ms/calendar',
method: 'post',
params: parameter
})
}
/**
* 按照会议状态统计
* /admin/ms/meetingStats
* 无参
* @返回
* * wait, 待开始会议数量
* * going,进行中会议数量
* * closed,已结束会议数量
* @param parameter
* @returns {AxiosPromise}
*/
export function getStatus(parameter) {
return axios({
url: '/admin/ms/meetingStats',
method: 'post',
params: parameter
})
}
/**
* 会议待办 前10条
* /admin/ms/meetingAudit
* 无参
* @param parameter
* @returns {AxiosPromise}
*/
export function getWait(parameter) {
return axios({
url: '/admin/ms/meetingAudit',
method: 'post',
params: parameter
})
}
/**
* 图表统计数据
*
*
* @参数 startDate 统计数据开始时间,日期格式示例2024-08-23
* @参数 endDate 统计数据结束时间,日期格式示例2024-09-23
* @返回
* roomRank会议室使用排名
* serve服务情况
* roomType会议室形式统计
* orgMeeting部门开会情况取前10个部门
* everyDay开会情况--按天取前20天
*/
export function getChartData(parameter) {
return axios({
url: '/admin/ms/chartStats',
method: 'post',
params: parameter
})
}

View File

@ -4,24 +4,33 @@ const api = {
roomContent: '/meeting/roomContent' roomContent: '/meeting/roomContent'
} }
export function getRoomContentList (parameter) { export function getMeetingDict(parameter) {
return axios({ return axios({
url: api.roomContent + '/list', url: '/app/mr/getConstData',
method: 'get', method: 'post',
params: parameter params: parameter
}) })
} }
export function get (id) { export function getRoomContentList(parameter) {
return axios({ return axios({
url: api.roomContent + '/get/'+id, // url: api.roomContent + '/list',
url: '/admin/meetingRoom/list',
method: 'post',
params: parameter
})
}
export function get(id) {
return axios({
url: api.roomContent + '/get/' + id,
method: 'get', method: 'get',
params: {} params: {}
}) })
} }
export function selectSearchInfoByType (parameter) { export function selectSearchInfoByType(parameter) {
return axios({ return axios({
url: api.roomContent + '/searchInfo/1', url: api.roomContent + '/searchInfo/1',
method: 'get', method: 'get',
@ -29,7 +38,7 @@ export function selectSearchInfoByType (parameter) {
}) })
} }
export function selectSearchInfoByCapacity (parameter) { export function selectSearchInfoByCapacity(parameter) {
return axios({ return axios({
url: api.roomContent + '/searchInfo/2', url: api.roomContent + '/searchInfo/2',
method: 'get', method: 'get',
@ -37,7 +46,7 @@ export function selectSearchInfoByCapacity (parameter) {
}) })
} }
export function selectSearchInfoByShape (parameter) { export function selectSearchInfoByShape(parameter) {
return axios({ return axios({
url: api.roomContent + '/searchInfo/4', url: api.roomContent + '/searchInfo/4',
method: 'get', method: 'get',
@ -45,9 +54,23 @@ export function selectSearchInfoByShape (parameter) {
}) })
} }
export function saveRoomContent (parameter) { export function saveRoomContent(parameter, files) {
return axios({ return axios({
url: api.roomContent + (parameter.id > 0 ? '/update' : '/save'), url: '/admin/meetingRoom' + (parameter.id > 0 ? '/update' : '/save'),
method: 'post',
data: {
room: parameter,
files: files
},
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}
export function getRoomInfo(parameter) {
return axios({
url: '/app/mr/roomMrs',
method: 'post', method: 'post',
data: parameter, data: parameter,
headers: { headers: {
@ -56,7 +79,7 @@ export function saveRoomContent (parameter) {
}) })
} }
export function addRoomServe (parameter) { export function addRoomServe(parameter) {
return axios({ return axios({
url: api.roomContent + '/addRoomServe', url: api.roomContent + '/addRoomServe',
method: 'post', method: 'post',
@ -67,7 +90,7 @@ export function addRoomServe (parameter) {
}) })
} }
export function addRoomItem (parameter) { export function addRoomItem(parameter) {
return axios({ return axios({
url: api.roomContent + '/addRoomItem', url: api.roomContent + '/addRoomItem',
method: 'post', method: 'post',
@ -79,7 +102,7 @@ export function addRoomItem (parameter) {
} }
//根据会议室id 获取服务列表 //根据会议室id 获取服务列表
export function selectRoomServeByRoom (parameter) { export function selectRoomServeByRoom(parameter) {
return axios({ return axios({
url: api.roomContent + '/selectRoomServeByRoom', url: api.roomContent + '/selectRoomServeByRoom',
method: 'post', method: 'post',
@ -91,7 +114,7 @@ export function selectRoomServeByRoom (parameter) {
} }
export function getFloorList (parameter) { export function getFloorList(parameter) {
return axios({ return axios({
url: api.roomContent + '/getFloorList', url: api.roomContent + '/getFloorList',
method: 'get', method: 'get',
@ -99,7 +122,7 @@ export function getFloorList (parameter) {
}) })
} }
export function getCustomerList (parameter) { export function getCustomerList(parameter) {
return axios({ return axios({
url: api.roomContent + '/customerList', url: api.roomContent + '/customerList',
method: 'get', method: 'get',
@ -108,7 +131,7 @@ export function getCustomerList (parameter) {
} }
export function selectRoomById (parameter) { export function selectRoomById(parameter) {
return axios({ return axios({
url: api.roomContent + '/selectRoomById', url: api.roomContent + '/selectRoomById',
method: 'get', method: 'get',
@ -117,7 +140,7 @@ export function selectRoomById (parameter) {
} }
export function getRoomListByFloorId (parameter) { export function getRoomListByFloorId(parameter) {
return axios({ return axios({
url: api.roomContent + '/getRoomListByFloorId', url: api.roomContent + '/getRoomListByFloorId',
method: 'get', method: 'get',
@ -125,7 +148,7 @@ export function getRoomListByFloorId (parameter) {
}) })
} }
export function getRoomListByBuildIdsRq (parameter) { export function getRoomListByBuildIdsRq(parameter) {
return axios({ return axios({
url: api.roomContent + '/getRoomListByBuildIds', url: api.roomContent + '/getRoomListByBuildIds',
method: 'post', method: 'post',
@ -136,7 +159,7 @@ export function getRoomListByBuildIdsRq (parameter) {
}) })
} }
export function selectRoomItemByRoom (parameter) { export function selectRoomItemByRoom(parameter) {
return axios({ return axios({
url: api.roomContent + '/selectRoomItemByRoom', url: api.roomContent + '/selectRoomItemByRoom',
method: 'post', method: 'post',
@ -148,15 +171,14 @@ export function selectRoomItemByRoom (parameter) {
} }
export function delRoomContent (parameter) { export function delRoomContent(parameter) {
return axios({ return axios({
url: api.roomContent + '/remove', // url: api.roomContent + '/remove',
url: '/admin/meetingRoom/remove',
method: 'post', method: 'post',
params: parameter params: parameter
}) })
} }
export const roomContentExport = api.roomContent + '/export' export const roomContentExport = api.roomContent + '/export'

View File

@ -0,0 +1,34 @@
import { axios } from '@/utils/request'
const api = {
meetingUto: '/admin/uto'
}
export function getMeetingUtoList (parameter) {
return axios({
url: api.meetingUto + '/list',
method: 'get',
params: parameter
})
}
export function saveMeetingUto (parameter) {
return axios({
url: api.meetingUto + (parameter.id > 0 ? '/update' : '/save'),
method: 'post',
data: parameter,
headers: {
'Content-Type': 'application/json;charset=UTF-8'
}
})
}
export function delMeetingUto (parameter) {
return axios({
url: api.meetingUto + '/remove',
method: 'post',
params: parameter
})
}
export const meetingUtoExport = api.meetingUto + '/export'

View File

@ -36,20 +36,39 @@
:columns='columns' :columns='columns'
:data='loadData' :data='loadData'
> >
<!-- 数据类型1.普通用户3派单员5 维修人, 7管理员, 9 楼层管理员-->
<span slot='dataType' slot-scope='text,record'> <span slot='dataType' slot-scope='text,record'>
<a-tag v-if='record.dataType == 1' color='pink'> <a-tag v-if='record.dataType == 1' color='pink'>
维修员 普通用户
</a-tag> </a-tag>
<a-tag v-if='record.dataType == 2' color='green'> <a-tag v-if='record.dataType == 3' color='green'>
派单员 派单员
</a-tag> </a-tag>
<a-tag v-if='record.dataType == 3' color='green'> <a-tag v-if='record.dataType == 5' color='cyan'>
网格长 维修人
</a-tag>
<a-tag v-if='record.dataType == 7' color='blue'>
管理员
</a-tag>
<a-tag v-if='record.dataType == 9' color='purple'>
楼层管理员
</a-tag> </a-tag>
</span>
<span slot='roomRole' slot-scope='text,record'>
<a-tag v-if='record.roomRole == 1' color='pink'>
普通用户
</a-tag>
<a-tag v-if='record.roomRole == 3' color='green'>
会议服务人员
</a-tag>
<a-tag v-if='record.roomRole == 5' color='cyan'>
会议管理员
</a-tag>
</span> </span>
<span slot='action' slot-scope='text, record'> <span slot='action' slot-scope='text, record'>
<!-- <a v-if='editEnabel' @click='handleEdit(record)'>编辑</a>--> <a v-if='editEnabel' @click='handleEdit(record)'>编辑</a>
<!-- <a-divider type='vertical' />--> <a-divider type='vertical' />
<a v-if='removeEnable' @click='delByIds([record.id])'>删除</a> <a v-if='removeEnable' @click='delByIds([record.id])'>删除</a>
</span> </span>
</s-table> </s-table>
@ -97,10 +116,15 @@ export default {
dataIndex: 'mobile' dataIndex: 'mobile'
}, },
{ {
title: '角色类型', title: '报修角色类型',
dataIndex: 'dataType', dataIndex: 'dataType',
scopedSlots: { customRender: 'dataType' } scopedSlots: { customRender: 'dataType' }
}, },
{
title: '会议角色类型',
dataIndex: 'roomRole',
scopedSlots: { customRender: 'roomRole' }
},
{ {
title: '创建时间', title: '创建时间',
dataIndex: 'createTime' dataIndex: 'createTime'

View File

@ -103,6 +103,7 @@
size='default' size='default'
ref='table' ref='table'
rowKey='id' rowKey='id'
showPagination="true"
:rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}' :rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
:columns='columns' :columns='columns'
:data='loadData' :data='loadData'

View File

@ -0,0 +1,665 @@
<template>
<div class='container'>
<a-card title='会议室管理'>
<a slot='extra'>
<a-date-picker @change='onChangeNumCount' :default-value='nowDate' />
</a>
<a-row>
<a-col :span='6'>
<div class='eachNum'>
<div class='icon' style='background-color: #58A3F7;'>
<a-icon type='ordered-list' style='font-size: 50px;color: #FFF' />
</div>
<div class='des'>
<div class='title'>
已预约会议室
</div>
<div class='num'>
{{ roomNum.alreadyBooking }}
</div>
</div>
</div>
</a-col>
<a-col :span='6'>
<div class='eachNum'>
<div class='icon' style='background-color: #52C1F5;'>
<a-icon type='unordered-list' style='font-size: 50px;color: #FFF' />
</div>
<div class='des'>
<div class='title'>
未预约会议室
</div>
<div class='num'>
{{ roomNum.noBooking }}
</div>
</div>
</div>
</a-col>
<a-col :span='6'>
<div class='eachNum'>
<div class='icon' style='background-color: #4BCED0;'>
<a-icon type='team' style='font-size: 50px;color: #FFF' />
</div>
<div class='des'>
<div class='title'>
开会中会议室
</div>
<div class='num'>
{{ roomNum.going }}
</div>
</div>
</div>
</a-col>
<a-col :span='6'>
<div class='eachNum'>
<div class='icon' style='background-color: #FB6260;'>
<a-icon type='profile' style='font-size: 50px;color: #FFF' />
</div>
<div class='des'>
<div class='title'>
空闲中会议室
</div>
<div class='num'>
{{ roomNum.free }}
</div>
</div>
</div>
</a-col>
</a-row>
</a-card>
<a-row>
<a-col :span='18'>
<a-card title='会议日历' bodyStyle='height: 780px'>
<a-calendar :header-render='headerRender'>
<ul slot='dateCellRender' slot-scope='value' class='c_meeting' style='padding: 0'>
<a-popover :title='item.title' v-for='item in getListData(value)'>
<template slot='content'>
<div>预约部门{{ item.org }}</div>
<div>会议时间{{ item.time }}</div>
</template>
<li>
{{ item.time }}
</li>
</a-popover>
</ul>
</a-calendar>
</a-card>
</a-col>
<a-col :span='6'>
<a-card title='会议状态'>
<a-row>
<a-col :span='18'>
<a-icon type='message' theme='filled' style='font-size: 24px;color: #E6A23C' />
<label style='position: relative;top: -1px;left: 10px;font-size: 20px'>
进行中
</label>
</a-col>
<a-col :span='6'>
<div style='text-align: right; font-weight: 700;font-size: 20px; position: relative;top: -1px;'>
{{ statusNum.going }}
</div>
</a-col>
</a-row>
<a-row style='margin-top: 15px'>
<a-col :span='18'>
<a-icon type='flag' theme='filled' style='font-size: 24px;color: #409EFF' />
<label style='position: relative;top: -1px;left: 10px;font-size: 20px'>
未开始
</label>
</a-col>
<a-col :span='6'>
<div style='text-align: right; font-weight: 700;font-size: 20px; position: relative;top: -1px;'>
{{ statusNum.wait }}
</div>
</a-col>
</a-row>
<a-row style='margin-top: 15px'>
<a-col :span='18'>
<a-icon type='carry-out' theme='filled' style='font-size: 24px;color: #919399' />
<label style='position: relative;top: -1px;left: 10px;font-size: 20px'>
已结束
</label>
</a-col>
<a-col :span='6'>
<div style='text-align: right; font-weight: 700;font-size: 20px; position: relative;top: -1px;'>
{{ statusNum.closed }}
</div>
</a-col>
</a-row>
</a-card>
<a-card title='任务代办(小程序审核)' bodyStyle='height: 554px'>
<a-list item-layout='horizontal' :data-source='waitList'>
<a-list-item slot='renderItem' slot-scope='item, index'>
<!-- <a slot='actions'>审核</a>-->
<a-list-item-meta
:description="item.time + '' +item.org + ''"
>
<a slot='title'>{{ item.title }}</a>
</a-list-item-meta>
</a-list-item>
</a-list>
</a-card>
</a-col>
</a-row>
<a-card title='数据统计'>
<a slot='extra'>
<a-range-picker @change='onChangeChartCount' :default-value='[nowMonthStart,nowMonthEnd]' />
</a>
</a-card>
<a-row>
<a-col :span='8'>
<a-card title='会议室使用排名'>
<div id='chartUse' style='width: 100%; height: 500px'></div>
</a-card>
</a-col>
<a-col :span='16'>
<a-row>
<a-col :span='12'>
<a-card title='服务情况'>
<div id='chartServe' style='width: 100%; height: 200px'></div>
</a-card>
</a-col>
<a-col :span='12'>
<a-card title='形式统计'>
<div id='chartType' style='width: 100%; height: 200px'></div>
</a-card>
</a-col>
</a-row>
<a-row>
<a-col :span='24'>
<a-card title='部门开会情况'>
<div id='chartDep' style='width: 100%; height: 194px'></div>
</a-card>
</a-col>
</a-row>
</a-col>
</a-row>
<a-row>
<a-col :span='24'>
<a-card title='开会情况'>
<div id='chartMeeting' style='width: 100%; height: 300px'></div>
</a-card>
</a-col>
</a-row>
</div>
</template>
<style>
.eachNum {
margin-left: 50px;
}
.eachNum .icon {
width: 90px;
height: 90px;
float: left;
text-align: center;
border-radius: 10px;
padding-top: 18px;
}
.eachNum .des {
margin-left: 110px;
}
.eachNum .title {
width: 100%;
height: 45px;
line-height: 45px;
font-size: 20px;
color: #9D9D9D;
}
.eachNum .num {
width: 100%;
height: 45px;
line-height: 25px;
font-size: 30px;
color: #666666;
font-weight: 700;
}
.c_meeting li {
background-color: #F0F2F6;
margin-bottom: 5px;
padding: 2px 5px;
font-size: 0.8rem;
}
</style>
<script>
import * as echarts from 'echarts'
import moment from 'moment'
import { STable } from '@/components'
import {
getNum,
getCalendar,
getStatus,
getWait,
getChartData
} from '@/api/admin/meeting/count'
export default {
name: 'MeetingCount',
components: {
STable
},
data() {
return {
nowDate: moment().format('YYYY-MM-DD'), //
nowMonth: moment().format('YYYY-MM'),
nowMonthStart: moment().startOf('months').format('YYYY-MM-DD'), //
nowMonthEnd: moment().endOf('months').format('YYYY-MM-DD'), //
roomNum: {
alreadyBooking: 0, //
noBooking: 0, //
going: 0, //
free: 0 //
},
calendarData: {}, //
statusNum: {
going: 0,
closed: 0,
wait: 0
}, //
waitList: [] //
}
},
mounted() {
this.getRoomNum()
this.getCalendarCount()
this.getStatusCount()
this.getWaitList()
this.getChartCount()
// this.drawChart()
},
methods: {
/**
* 改变会议室管理统计日期
* @param date
* @param dateString
*/
onChangeNumCount(date, dateString) {
this.nowDate = dateString
this.getRoomNum()
},
onChangeCalendar(date, dateString) {
console.log(date)
console.log(dateString)
},
/**
* 获取第一行数据统计
*/
getRoomNum() {
getNum({
day: this.nowDate
}).then(res => {
const data = res.data
this.roomNum = {
alreadyBooking: data.alreadyBooking, //
noBooking: data.noBooking, //
going: data.going, //
free: data.free //
}
})
},
/**
* 日历选择器顶部改写方法
* @param value
* @param type
* @param onChange
* @param onTypeChange
* @returns {JSX.Element}
*/
headerRender({ value, type, onChange, onTypeChange }) {
const nowMonth = this.nowMonth
return (
<div slot='extra' style={{ textAlign: 'center', position: 'relative', top: '-88px' }}>
<div style={{ position: 'absolute', right: '15px', top: '20px' }}>
<a-month-picker onChange={(date, dateString) => {
this.onChangeCalendar(date, dateString, value, onChange)
}} defaultValue={nowMonth} />
</div>
</div>
)
},
/**
*
* 改变会议日历日期事件先获取数据再改写日期
* @param date
* @param dateString
* @param value
* @param onChange
*/
onChangeCalendar(date, dateString, value, onChange) {
let year = date.year()
let month = date.month()
this.nowMonth = dateString
const newValue = value.clone()
this.getCalendarCount()
newValue.year(year)
newValue.month(month)
onChange(newValue)
},
/**
* 获取日历统计数据方法
*/
getCalendarCount() {
let calendarData = {}
getCalendar({
month: this.nowMonth
}).then(res => {
let data = res.data
for (let key in data) {
let date = key
let meeting = data[key]
if (meeting.length > 0) {
//
let newMeeting = []
for (let each in meeting) {
let eachM = meeting[each]
let timeArr = eachM.time.split(' ')
eachM.time = timeArr[1]
newMeeting.push(eachM)
}
calendarData[date] = newMeeting
}
}
this.calendarData = calendarData
})
},
/**
* 比对日历日期返回当日会议方法
* @param value
* @returns {*[]}
*/
getListData(value) {
let nowDate = moment(value).format('YYYY-MM-DD')
let listData
let calendarData = this.calendarData
if (calendarData[nowDate] && calendarData[nowDate].length > 1) {
listData = calendarData[nowDate]
}
return listData || []
},
/**
* 获取状态统计
*/
getStatusCount() {
getStatus().then(res => {
this.statusNum = {
going: res.data.going,
closed: res.data.closed,
wait: res.data.wait
}
})
},
/**
* 获取待办列表
*/
getWaitList() {
getWait().then(res => {
let data = res.data
if (data.length > 6) {
// 610
data = data.splice(0, 6)
}
this.waitList = data
})
},
/**
* 统计图顶部时间范围选择变化方法
* @param date
* @param dateStringArr
* @param dateString
*/
onChangeChartCount(date, dateStringArr, dateString) {
console.log(dateStringArr)
this.nowMonthStart = dateStringArr[0]
this.nowMonthEnd = dateStringArr[1]
this.getChartCount()
},
/**
* 获取统计图数据
*/
getChartCount() {
getChartData({
startDate: this.nowMonthStart,
endDate: this.nowMonthEnd
}).then(res => {
this.drawChart(res.data)
})
},
drawChart(data) {
// 使
let chartUse = echarts.init(document.getElementById('chartUse'))
let useData = data.roomRank
let chartUseOp = {
yAxis: {
type: 'category',
data: useData.y
},
xAxis: {
type: 'value'
},
grid: {
top: '0',
left: '2%',
right: '2%',
bottom: '1%',
containLabel: true
},
series: [
{
data: useData.total,
type: 'bar',
label: {
show: true, //
position: 'inside' //
},
barWidth: '20px',
itemStyle: {
color: '#50B5FF', //
borderRadius: [0, 5, 5, 0] //
}
}
]
}
chartUse.setOption(chartUseOp)
//
let chartServe = echarts.init(document.getElementById('chartServe'))
let serveData = data.serve
let serveNumAll = 0
for (let key in serveData) {
let eachNum = serveData[key].value
serveNumAll = serveNumAll + eachNum
}
let chartServeOp = {
tooltip: {
trigger: 'item'
},
legend: {
orient: 'vertical', //
right: 10, // 10px
top: 'bottom' //
}, //
grid: {
top: '0',
left: '2%',
right: '2%',
bottom: '1%',
containLabel: true
},
graphic: {
type: 'text',
left: 'center',
top: 'center',
style: {
text: serveNumAll, //
textAlign: 'center',
fill: '#000', //
fontSize: 20
}
},
series: [
{
name: '服务情况',
type: 'pie',
radius: ['50%', '70%'],
avoidLabelOverlap: false,
label: {
show: true
},
emphasis: {
label: {
show: true,
fontSize: 40,
fontWeight: 'bold'
}
},
data: serveData
}
]
}
chartServe.setOption(chartServeOp)
//
let chartType = echarts.init(document.getElementById('chartType'))
let typeData = data.roomType
let typeNumAll = 0
for (let key in typeData) {
let eachNum = typeData[key].value
typeNumAll = typeNumAll + eachNum
}
let chartTypeOp = {
tooltip: {
trigger: 'item'
},
legend: {
orient: 'vertical', //
right: 10, // 10px
top: 'bottom' //
}, //
grid: {
top: '0',
left: '2%',
right: '2%',
bottom: '1%',
containLabel: true
},
graphic: {
type: 'text',
left: 'center',
top: 'center',
style: {
text: typeNumAll, //
textAlign: 'center',
fill: '#000', //
fontSize: 20
}
},
series: [
{
name: '会议室形式',
type: 'pie',
radius: ['50%', '70%'],
avoidLabelOverlap: false,
label: {
show: true
},
emphasis: {
label: {
show: true,
fontSize: 40,
fontWeight: 'bold'
}
},
data: typeData
// data: [
// { value: 1048, name: 'U' },
// { value: 735, name: '' },
// { value: 580, name: '' },
// ]
}
]
}
chartType.setOption(chartTypeOp)
//
let chartDep = echarts.init(document.getElementById('chartDep'))
let depData = data.orgMeeting
let chartDepOp = {
xAxis: {
type: 'category',
data: depData.x
},
yAxis: {
type: 'value'
},
grid: {
top: '3%',
left: '2%',
right: '2%',
bottom: '0%',
containLabel: true
},
series: [
{
data: depData.total,
label: {
show: true, //
position: 'inside' //
},
type: 'bar',
barWidth: '20px',
itemStyle: {
color: '#FFEC6D', //
}
}
]
}
chartDep.setOption(chartDepOp)
//
let chartMeeting = echarts.init(document.getElementById('chartMeeting'))
let meetingData = data.everyDay
let chartMeetingOp = {
xAxis: {
type: 'category',
boundaryGap: false,
data: meetingData.x
},
yAxis: {
type: 'value'
},
grid: {
top: '3%',
left: '2%',
right: '2%',
bottom: '0%',
containLabel: true
},
series: [
{
data: meetingData.total,
type: 'line',
label: {
show: true, //
position: 'top' //
},
itemStyle: {
color: new echarts.graphic.LinearGradient(
0, 0, 0, 1, // (x1, y1) (x2, y2)
[
{offset: 0, color: '#28A9FF'}, // 0%
{offset: 1, color: '#C8E8FE'} // 100%
]
)
},
areaStyle: {}
}
]
}
chartMeeting.setOption(chartMeetingOp)
}
}
}
</script>

View File

@ -4,36 +4,15 @@
<a-form layout='inline'> <a-form layout='inline'>
<a-row :gutter='48'> <a-row :gutter='48'>
<a-col :md='5' :sm='15'> <a-col :md='5' :sm='15'>
<a-form-item label='关键词'> <a-form-item label='会议室名称'>
<a-input placeholder='请输入关键词' v-model='queryParam.meetingName' /> <a-input placeholder='请输入名称' v-model='queryParam.meetingName' />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md='5' :sm='15'> <a-col :md='5' :sm='15'>
<a-form-item label='会议室类型'> <a-form-item label='所在楼层'>
<a-select v-model='queryParam.typeName' placeholder='请选择会议室类型'> <a-select v-model='queryParam.typeName'>
<a-select-option :value='1'> <a-select-option v-for='item in typeList' :value='item.value'>
会议室 {{ item.text }}
</a-select-option>
<a-select-option :value='2'>
路演厅
</a-select-option>
<a-select-option :value='3'>
洽谈室
</a-select-option>
<a-select-option :value='4'>
直播间
</a-select-option>
<a-select-option :value='5'>
茶室
</a-select-option>
<a-select-option :value='6'>
长阳会客厅
</a-select-option>
<a-select-option :value='7'>
多功能厅
</a-select-option>
<a-select-option :value='8'>
数据要素
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
@ -41,35 +20,29 @@
<a-col :md='5' :sm='15'> <a-col :md='5' :sm='15'>
<a-form-item label='排列形状'> <a-form-item label='排列形状'>
<a-select v-model='queryParam.shape' placeholder='请选择排列形状'> <a-select v-model='queryParam.shape' placeholder='请选择排列形状'>
<a-select-option value='围桌式'> <a-select-option v-for='item in shapeList' :value='item.value'>
围桌式 {{ item.text }}
</a-select-option>
<a-select-option value='课桌式'>
课桌式
</a-select-option>
<a-select-option value='长方形'>
长方形
</a-select-option>
<a-select-option value='U形'>
U形
</a-select-option>
<a-select-option value='鱼骨形'>
鱼骨形
</a-select-option>
<a-select-option value='开放形'>
开放形
</a-select-option>
<a-select-option value='会议形'>
会议形
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :md='5' :sm='15'> <a-col :md='5' :sm='15'>
<a-form-item label='容纳人数'> <a-form-item label='容纳人数'>
<a-select v-model='queryParam.capacityNum' placeholder='请选择类型'> <a-select v-model='queryParam.capacityNum' placeholder='请选择范围'>
<a-select-option v-for='(item,index) in capacityList' :key='item.id' :value='item.capacityNum'> <a-select-option value=''>
{{ item.capacityNum }} 全部
</a-select-option>
<a-select-option value='1'>
0-20
</a-select-option>
<a-select-option value='2'>
21-50
</a-select-option>
<a-select-option value='3'>
51-100
</a-select-option>
<a-select-option value='4'>
100以上
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
@ -77,7 +50,7 @@
<a-col :md='8' :sm='24'> <a-col :md='8' :sm='24'>
<span class='table-page-search-submitButtons'> <span class='table-page-search-submitButtons'>
<a-button type='primary' @click='$refs.table.refresh(true)'>查询</a-button> <a-button type='primary' @click='$refs.table.refresh(true)'>查询</a-button>
<a-button style='margin-left: 8px' @click='() => (queryParam = {})'>重置</a-button> <a-button style='margin-left: 8px' @click='reset'>重置</a-button>
</span> </span>
</a-col> </a-col>
</a-row> </a-row>
@ -93,6 +66,7 @@
size='default' size='default'
ref='table' ref='table'
rowKey='id' rowKey='id'
showPagination='true'
:rowSelection='{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }' :rowSelection='{ selectedRowKeys: selectedRowKeys, onChange: onSelectChange }'
:columns='columns' :columns='columns'
:data='loadData' :data='loadData'
@ -107,47 +81,14 @@
<a @click='handleServeTable(record)'>{{ record.serveCount }}</a> <a @click='handleServeTable(record)'>{{ record.serveCount }}</a>
</span> </span>
<span slot='action' slot-scope='text, record'> <span slot='action' slot-scope='text, record'>
<a v-if='editEnabel' @click='handleEdit(record)'>编辑</a> <a v-if='editEnabel' @click='handleEdit(record.id)'>编辑</a>
<a-divider type='vertical' /> <a-divider type='vertical' />
<a v-if='removeEnable' @click='deleteShow([record.id])'>删除</a> <a v-if='removeEnable' @click='delByIds([record.id])'>删除</a>
</span> </span>
</s-table> </s-table>
<a-modal
title='提示'
:visible='deleteVisible'
:confirm-loading='deleteLoading'
@ok='deleteOk'
@cancel='deleteCancel'
>
<p>是否确认删除</p>
</a-modal>
<roomContent-modal ref='modal' @ok='handleOk' /> <roomContent-modal ref='modal' @ok='handleOk' />
<a-modal v-model='visible' title='会议设备' width='600px' @ok='itemHandleOk()'>
<a-modal v-model='visible' title='会议设备' width='500px' @ok='itemHandleOk()'>
<div class='table-page-search-wrapper'>
<a-form layout='inline'>
<a-row :gutter='48'>
<!-- <a-col :md='8' :sm='15'>-->
<!-- <a-form-item label='关键词'>-->
<!-- <a-input placeholder='请输入关键词' v-model='itemQueryParam.itemName' />-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<a-col :md='8' :sm='24'>
<span class='table-page-search-submitButtons'>
<!-- 查询有问题-->
<a-button type='primary' @click='$refs.table.refresh(true)'>查询</a-button>
<a-button style='margin-left: 8px' @click='() => (itemQueryParam = {})'>重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<div class='table-operator'>
</div>
<s-table <s-table
size='default' size='default'
ref='itemTable' ref='itemTable'
@ -158,39 +99,7 @@
> >
</s-table> </s-table>
</a-modal> </a-modal>
<a-modal v-model='visible1' title='会议服务' width='1000px' @ok='serveHandleOk()'> <a-modal v-model='visible1' title='会议服务' width='600px' @ok='serveHandleOk()'>
<div class='table-page-search-wrapper'>
<a-form layout='inline'>
<a-row :gutter='48'>
<!-- <a-col :md='8' :sm='15'>-->
<!-- <a-form-item label='关键词'>-->
<!-- <a-input placeholder='请输入关键词' v-model='serveQueryParam.serveName' />-->
<!-- </a-form-item>-->
<!-- </a-col>-->
<a-col :md='8' :sm='30'>
<a-form-item label='服务类型'>
<a-select v-model='serveQueryParam.itemType' placeholder='请选择服务类型'>
<a-select-option value='1'>
免费服务
</a-select-option>
<a-select-option value='2'>
增值服务
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :md='8' :sm='24'>
<span class='table-page-search-submitButtons'>
<!-- 查询有问题-->
<a-button type='primary' @click='$refs.table.refresh(true)'>查询</a-button>
<a-button style='margin-left: 8px' @click='() => (serveQueryParam = {})'>重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<div class='table-operator'>
</div>
<s-table <s-table
size='default' size='default'
ref='serveTable' ref='serveTable'
@ -198,11 +107,7 @@
:rowSelection='{ selectedRowKeys: selectedServeRowKeys, onChange: onServeSelectChange }' :rowSelection='{ selectedRowKeys: selectedServeRowKeys, onChange: onServeSelectChange }'
:columns='serveColumns' :columns='serveColumns'
:data='serveLoadData' :data='serveLoadData'
:scroll='{ x: true }'
> >
<span slot='serveType' slot-scope='text'>
{{ text | serveTypeFilter }}
</span>
</s-table> </s-table>
</a-modal> </a-modal>
</a-card> </a-card>
@ -216,7 +121,7 @@ import { STable } from '@/components'
import { import {
getRoomContentList, delRoomContent, selectSearchInfoByType, getRoomContentList, delRoomContent, selectSearchInfoByType,
selectSearchInfoByShape, selectSearchInfoByCapacity, addRoomServe, selectSearchInfoByShape, selectSearchInfoByCapacity, addRoomServe,
selectRoomServeByRoom, selectRoomItemByRoom selectRoomServeByRoom, selectRoomItemByRoom, getMeetingDict
} from '@/api/admin/meeting/roomContent' } from '@/api/admin/meeting/roomContent'
import { getRoomServeList } from '@/api/admin/meeting/roomServe' import { getRoomServeList } from '@/api/admin/meeting/roomServe'
import { getRoomItemList } from '@/api/admin/meeting/roomItem' import { getRoomItemList } from '@/api/admin/meeting/roomItem'
@ -224,6 +129,7 @@ import RoomContentModal from './modules/RoomContentModal.vue'
import { checkPermission } from '@/utils/permissions' import { checkPermission } from '@/utils/permissions'
import { getDictArray } from '@/utils/dict' import { getDictArray } from '@/utils/dict'
import { addRoomItem } from '../../../api/admin/meeting/roomContent' import { addRoomItem } from '../../../api/admin/meeting/roomContent'
import { delRepairDevice } from '@/api/admin/repair/repairDevice'
const typeMap = {} const typeMap = {}
const serveTypeMap = {} const serveTypeMap = {}
@ -235,6 +141,7 @@ export default {
}, },
data() { data() {
return { return {
parkId: 25,
labelCol: { labelCol: {
xs: { span: 24 }, xs: { span: 24 },
sm: { span: 5 } sm: { span: 5 }
@ -251,9 +158,13 @@ export default {
// / // /
advanced: false, advanced: false,
// //
queryParam: {}, queryParam: {
itemQueryParam: { meetingName: '',
typeName: '',
shape: '',
capacityNum: ''
}, },
itemQueryParam: {},
serveQueryParam: {}, serveQueryParam: {},
capacityList: [], capacityList: [],
shapeList: [], shapeList: [],
@ -269,28 +180,21 @@ export default {
{ {
title: '服务名称', title: '服务名称',
dataIndex: 'serveName' dataIndex: 'serveName'
},
{
title: '服务类型',
dataIndex: 'serveType',
scopedSlots: { customRender: 'serveType' }
},
{
title: '金额',
dataIndex: 'money'
} }
], ],
// //
columns: [ columns: [
{ {
title: '会议室名称', title: '会议室名称',
dataIndex: 'meetingName' dataIndex: 'name'
}, },
{ {
title: '会议室类型', title: '所属楼层',
dataIndex: 'type', dataIndex: 'floor',
scopedSlots: { customRender: 'type' } },
{
title: '所属房间',
dataIndex: 'roomNum'
}, },
{ {
title: '容纳人数', title: '容纳人数',
@ -298,26 +202,17 @@ export default {
}, },
{ {
title: '排列形状', title: '排列形状',
dataIndex: 'shape' dataIndex: 'typeName'
}, },
{ {
title: '会议室设备', title: '会议室设备',
dataIndex: 'itemCount', dataIndex: 'device',
scopedSlots: { customRender: 'item' }
},
{
title: '关联服务',
dataIndex: 'serveCount',
scopedSlots: { customRender: 'serve' }
},
{
title: '金额',
dataIndex: 'money'
},
{
title: '负责人',
dataIndex: 'headName'
}, },
// {
// title: '',
// dataIndex: 'serveCount',
// scopedSlots: { customRender: 'serve' }
// },
{ {
title: '操作', title: '操作',
width: '200px', width: '200px',
@ -327,19 +222,59 @@ export default {
], ],
// Promise // Promise
loadData: (parameter) => { loadData: (parameter) => {
return getRoomContentList(Object.assign(parameter, this.queryParam)) let minPerNum = 0
}, let maxPerNum = 1000
itemLoadData: (parameter) => { let perNumValue = this.queryParam.capacityNum
console.log(this.parkId) if (perNumValue == 1) {
let param ={ // 1-20
parkId:this.parkId maxPerNum = 20
minPerNum = 1
} else if (perNumValue == 2) {
// 21-50
minPerNum = 21
maxPerNum = 50
} else if (perNumValue == 3) {
// 51-100
minPerNum = 51
maxPerNum = 100
} else if (perNumValue == 4) {
// 51-100
minPerNum = 101
maxPerNum = 1000
} else {
//
minPerNum = 1
maxPerNum = 1000
} }
const param = {
name: this.queryParam.meetingName, //
floor: this.queryParam.typeName, //
typeName: this.queryParam.shape, //
// capacityNum: this.queryParam.capacityNum //
min: minPerNum, //
max: maxPerNum, //
}
// if (param.typeName === '') {
// delete param.typeName
// }
// if (param.shape === '') {
// delete param.shape
// }
// if (param.capacityNum === '') {
// delete param.capacityNum
// }
return getRoomContentList(Object.assign(parameter, param))
},
itemLoadData: (parameter) => {
let param = {
parkId: this.parkId
}
return getRoomItemList(Object.assign(parameter, param)) return getRoomItemList(Object.assign(parameter, param))
}, },
serveLoadData: (parameter) => { serveLoadData: (parameter) => {
let param ={ let param = {
parkId:this.parkId parkId: this.parkId
} }
return getRoomServeList(Object.assign(parameter, param)) return getRoomServeList(Object.assign(parameter, param))
}, },
@ -358,7 +293,7 @@ export default {
// //
deleteVisible: false, deleteVisible: false,
deleteLoading: false, deleteLoading: false,
deleteIds : null, deleteIds: null
} }
}, },
filters: { filters: {
@ -374,18 +309,65 @@ export default {
TypeData.map(d => { TypeData.map(d => {
typeMap[d.dictValue] = { text: d.dictLabel } typeMap[d.dictValue] = { text: d.dictLabel }
}) })
console.log(typeMap) // console.log(typeMap)
const serveTypeData = await getDictArray('serve_type') const serveTypeData = await getDictArray('serve_type')
serveTypeData.map(d => { serveTypeData.map(d => {
serveTypeMap[d.dictValue] = { text: d.dictLabel } serveTypeMap[d.dictValue] = { text: d.dictLabel }
}) })
}, },
mounted() { mounted() {
this.selectSearchInfoByType() this.getDict()
this.selectSearchInfoByShape() // this.selectSearchInfoByType()
this.selectSearchInfoByCapacity() // this.selectSearchInfoByShape()
// this.selectSearchInfoByCapacity()
}, },
methods: { methods: {
//
getDict() {
getMeetingDict().then((res) => {
//
let _typeList = []
let dataObj = res.data
for (let key in dataObj.floors) {
let eachObj = dataObj.floors[key]
const keys = Object.keys(eachObj)
_typeList.push({
text: keys[0],
value: keys[0]
})
}
_typeList = [{
text: '全部',
value: ''
}, ..._typeList]
this.typeList = _typeList
//
let _shapeList = []
for (let key in dataObj.types) {
let eachObj = dataObj.types[key]
const keys = Object.keys(eachObj)
_shapeList.push({
text: keys[0],
value: keys[0]
})
}
_shapeList = [{
text: '全部',
value: ''
}, ..._shapeList]
this.shapeList = _shapeList
})
},
reset() {
this.queryParam = {
meetingName: '',
typeName: '',
shape: '',
capacityNum: ''
}
this.$refs.table.refresh(true)
},
itemHandleOk() { itemHandleOk() {
console.log(this.meetingId) console.log(this.meetingId)
let params = { let params = {
@ -433,9 +415,9 @@ export default {
}, },
handleItemTable(record) { handleItemTable(record) {
let params = { let params = {
roomContentId: record.id, roomContentId: record.id
} }
this.parkId = record.parkId // this.parkId = record.parkId
selectRoomItemByRoom(params).then((res) => { selectRoomItemByRoom(params).then((res) => {
this.selectedItemRowKeys = res.data.map(d => d.itemId) this.selectedItemRowKeys = res.data.map(d => d.itemId)
@ -447,10 +429,9 @@ export default {
}, },
handleServeTable(record) { handleServeTable(record) {
let params = { let params = {
romeContentId: record.id, romeContentId: record.id
} }
this.parkId = record.parkId // this.parkId = record.parkId
selectRoomServeByRoom(params).then((res) => { selectRoomServeByRoom(params).then((res) => {
this.selectedServeRowKeys = res.data.map(d => d.serveId) this.selectedServeRowKeys = res.data.map(d => d.serveId)
this.selectedServeRows = res.data this.selectedServeRows = res.data
@ -461,21 +442,21 @@ export default {
}, },
// //
selectSearchInfoByType() { // selectSearchInfoByType() {
selectSearchInfoByType().then((res) => { // selectSearchInfoByType().then((res) => {
this.typeList = res.roomContents // this.typeList = res.roomContents
}) // })
}, // },
selectSearchInfoByShape() { // selectSearchInfoByShape() {
selectSearchInfoByShape().then((res) => { // selectSearchInfoByShape().then((res) => {
this.shapeList = res.roomContents // this.shapeList = res.roomContents
}) // })
}, // },
selectSearchInfoByCapacity() { // selectSearchInfoByCapacity() {
selectSearchInfoByCapacity().then((res) => { // selectSearchInfoByCapacity().then((res) => {
this.capacityList = res.roomContents // this.capacityList = res.roomContents
}) // })
}, // },
onSelectChange(selectedRowKeys, selectedRows) { onSelectChange(selectedRowKeys, selectedRows) {
this.selectedRowKeys = selectedRowKeys this.selectedRowKeys = selectedRowKeys
this.selectedRows = selectedRows this.selectedRows = selectedRows
@ -483,37 +464,43 @@ export default {
handleAdd() { handleAdd() {
this.$refs.modal.add() this.$refs.modal.add()
}, },
handleEdit(record) { handleEdit(id) {
this.$refs.modal.edit(record) this.$refs.modal.edit(id)
}, },
handleOk() { handleOk() {
this.$refs.table.refresh(true) this.$refs.table.refresh(true)
}, },
delByIds(ids) { delByIds(ids) {
delRoomContent({ ids: ids.join(',') }).then((res) => { const _this = this
if (res.code === 0) { if (ids === '') {
this.$message.success('删除成功') this.$message.error('请选择后删除!')
this.handleOk() return
} else { }
this.$message.error(res.msg) this.$confirm({
title: '警告',
content: '删除后不可恢复,是否确认删除?',
okText: '是',
okType: 'warning',
cancelText: '否',
onOk() {
delRoomContent({ ids: ids.join(',') }).then((res) => {
if (res.code === 0) {
_this.$message.success('删除成功')
_this.handleOk()
} else {
_this.$message.error(res.msg)
}
_this.selectedRowKeys = []
//
_this.deleteVisible = false
_this.deleteLoading = false
})
},
onCancel() {
} }
this.selectedRowKeys = []
//
this.deleteVisible = false
this.deleteLoading = false
}) })
}, },
deleteShow(ids) {
this.deleteVisible = true
this.deleteIds = ids
},
deleteOk() {
this.deleteLoading = true;
this.delByIds(this.deleteIds)
},
deleteCancel() {
this.deleteVisible = false
},
}, },
watch: { watch: {
/* /*

View File

@ -0,0 +1,184 @@
<template>
<a-card :bordered="false">
<div class="table-page-search-wrapper">
<a-form layout="inline">
<a-row :gutter="48">
<a-col :md="5" :sm="15">
<a-form-item label="部门名称">
<a-input placeholder="请输入部门名称" v-model="queryParam.orgName"/>
</a-form-item>
</a-col>
<a-col :md="8" :sm="24">
<span class="table-page-search-submitButtons">
<a-button type="primary" @click="$refs.table.refresh(true)">查询</a-button>
<a-button style="margin-left: 8px" @click="reset()">重置</a-button>
</span>
</a-col>
</a-row>
</a-form>
</div>
<div class="table-operator">
<a-button v-if="addEnable" type="primary" icon="plus" @click="$refs.modal.add()">新建</a-button>
<a-dropdown v-if="removeEnable&&selectedRowKeys.length > 0">
<a-button type="danger" icon="delete" @click="delByIds(selectedRowKeys)">删除</a-button>
</a-dropdown>
</div>
<s-table
size="default"
ref="table"
rowKey="id"
showPagination="true"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
:columns="columns"
:data="loadData"
>
<span slot="action" slot-scope="text, record">
<a v-if="editEnabel" @click="handleEdit(record)">编辑</a>
<a-divider type="vertical" />
<a v-if="removeEnable" @click="delByIds([record.id])">删除</a>
</span>
</s-table>
<meetingUto-modal ref="modal" @ok="handleOk"/>
</a-card>
</template>
<script>
import {STable} from '@/components'
import {getMeetingUtoList,delMeetingUto} from '@/api/admin/meeting/uto'
import MeetingUtoModal from './modules/UtoModal.vue'
import {checkPermission} from '@/utils/permissions'
import { delRoomContent } from '@/api/admin/meeting/roomContent'
export default {
name: 'TableList',
components: {
STable,
MeetingUtoModal
},
data () {
return {
labelCol: {
xs: { span: 24 },
sm: { span: 5 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 }
},
form: this.$form.createForm(this),
mdl: {},
// /
advanced: false,
//
queryParam: {},
//
columns: [
{
title: '部门编号',
dataIndex: 'orgId'
},
{
title: '部门名称',
dataIndex: 'orgName'
},
{
title: '登录名',
dataIndex: 'loginName'
},
{
title: '密码',
dataIndex: 'password'
},
{
title: '备注',
dataIndex: 'remark'
},
{
title: '操作',
width: '200px',
dataIndex: 'action',
scopedSlots: { customRender: 'action' }
}
],
// Promise
loadData: parameter => {
return getMeetingUtoList(Object.assign(parameter, this.queryParam))
},
selectedRowKeys: [],
selectedRows: [],
// addEnable: checkPermission('admin:meetingUto:add'),
// editEnabel: checkPermission('admin:meetingUto:edit'),
// removeEnable: checkPermission('admin:meetingUto:remove'),
addEnable: true,
editEnabel: true,
removeEnable: true
}
},
filters: {
},
created () {
},
methods: {
reset() {
this.queryParam = {}
this.handleOk()
},
onSelectChange (selectedRowKeys, selectedRows) {
this.selectedRowKeys = selectedRowKeys
this.selectedRows = selectedRows
},
handleAdd () {
this.$refs.modal.add()
},
handleEdit (record) {
this.$refs.modal.edit(record)
},
handleOk () {
this.$refs.table.refresh(true)
console.log('handleSaveOk')
},
delByIds (ids) {
const _this = this
if (ids === '') {
this.$message.error('请选择后删除!')
return
}
this.$confirm({
title: '警告',
content: '删除后不可恢复,是否确认删除?',
okText: '是',
okType: 'warning',
cancelText: '否',
onOk() {
delMeetingUto({ ids: ids.join(',') }).then(res => {
if (res.code === 0) {
_this.$message.success('删除成功')
_this.handleOk()
} else {
_this.$message.error(res.msg)
}
this.selectedRowKeys = []
})
},
onCancel() {
}
})
}
},
watch: {
/*
'selectedRows': function (selectedRows) {
this.needTotalList = this.needTotalList.map(item => {
return {
...item,
total: selectedRows.reduce( (sum, val) => {
return sum + val[item.dataIndex]
}, 0)
}
})
}
*/
}
}
</script>

View File

@ -18,235 +18,81 @@
<a-row> <a-row>
<a-col :span='10'> <a-col :span='10'>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='所属地区'> <a-form-item label='所属楼层' :labelCol='labelCol' :wrapperCol='wrapperCol'>
<a-select v-decorator="['tenantId', {rules: [{ required: true, message: '请选择所属地区' }]}]" <a-select v-decorator="['floor',{rules: [{ required: true, message: '选择所属楼层' }]}]"
@change='selectTenant' placeholder='所属楼层'>
:disabled='tenantEnable'> <a-select-option v-for='item in typeList' :value='item.value'>
<a-select-option v-for='item in tenantList' :key='item.id'>{{ item.name }}</a-select-option> {{ item.text }}
</a-select>
</a-form-item>
</a-col>
<a-col :span='10'>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='所属园区'>
<a-select v-decorator="['parkId', {rules: [{ required: true, message: '请选择所属园区' }]}]"
@change='selectPark'
:disabled='parkEnable'>
<a-select-option v-for='item in parkList' :key='item.id'>{{ item.name }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span='10'>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='所属楼宇'>
<a-select v-decorator="['buildingId', {rules: [{ required: true, message: '请选择所属楼宇' }]}]"
@change='selectBuilding'>
<a-select-option v-for='item in buildingList' :key='item.id'>{{ item.buildingName }}</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span='10'>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='所属楼层'>
<a-select v-decorator="['buildId',{rules: [{ required: true, message: '请选择所属楼层' }]}]"
placeholder='所属楼层'
@change='selectBuildingDetail'>
<a-select-option v-for='item in buildingDetailList' :key='item.id' :value='item.id'>
{{ item.floorName }}
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row>
<a-row>
<a-col :span='10'>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='所属房间'>
<a-select v-decorator="['roomId',{rules: [{ required: true, message: '选择所属房间' }]}]"
placeholder='所属房间'
@change='selectRoom'>
<a-select-option v-for='item in roomList' :key='item.id' :value='item.id'>
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span='10'>
<a-form-item label='会议室面积' :labelCol='labelCol' :wrapperCol='wrapperCol'>
<a-input placeholder='会议室面积'
v-decorator="['area',{rules: [{ required: true, message: '请输入会议室面积' }]}]"
disabled='disabled' />
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span='10'> <a-col :span='10'>
<a-form-item label='会议室名称' :labelCol='labelCol' :wrapperCol='wrapperCol'> <a-form-item label='会议室名称' :labelCol='labelCol' :wrapperCol='wrapperCol'>
<a-input placeholder='会议室名称' <a-input placeholder='会议室名称'
v-decorator="['meetingName',{rules: [{ required: true, message: '输入会议室名称' }]}]" /> v-decorator="['name',{rules: [{ required: true, message: '输入会议室名称' }]}]" />
</a-form-item> </a-form-item>
</a-col> </a-col>
</a-row>
<a-row>
<a-col :span='10'> <a-col :span='10'>
<a-form-item label='会议室类型' :labelCol='labelCol' :wrapperCol='wrapperCol'> <a-form-item label='会议室形式' :labelCol='labelCol' :wrapperCol='wrapperCol'>
<a-select v-decorator="['type',{rules: [{ required: true, message: '输入会议室类型' }]}]" <a-select v-decorator="['typeName',{rules: [{ required: true, message: '选择会议室形式' }]}]"
placeholder='会议室类型'> placeholder='会议室形式'>
<a-select-option :value='1'> <a-select-option v-for='item in shapeList' :value='item.value'>
会议室 {{ item.text }}
</a-select-option>
<a-select-option :value='2'>
路演厅
</a-select-option>
<a-select-option :value='3'>
洽谈室
</a-select-option>
<a-select-option :value='4'>
直播间
</a-select-option>
<a-select-option :value='5'>
茶室
</a-select-option>
<a-select-option :value='6'>
长阳会客厅
</a-select-option>
<a-select-option :value='7'>
多功能厅
</a-select-option>
<a-select-option :value='8'>
数据要素
</a-select-option> </a-select-option>
</a-select> </a-select>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span='10'>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='所属房间 '>
<a-input placeholder='所属房间'
v-decorator="['roomNum',{rules: [{ required: true, message: '输入所属房间' }]}]" />
</a-form-item>
</a-col>
</a-row> </a-row>
<a-row> <a-row>
<a-col :span='10'>
<a-form-item label='会议室面积' :labelCol='labelCol' :wrapperCol='wrapperCol'>
<a-input placeholder='会议室面积'
v-decorator="['area']" />
</a-form-item>
</a-col>
<a-col :span='10'> <a-col :span='10'>
<a-form-item label='容纳人数' :labelCol='labelCol' :wrapperCol='wrapperCol'> <a-form-item label='容纳人数' :labelCol='labelCol' :wrapperCol='wrapperCol'>
<a-input placeholder='容纳人数' <a-input placeholder='容纳人数'
v-decorator="['capacityNum',{rules: [{ required: true, message: '输入容纳人数' }]}]" /> v-decorator="['capacityNum',{rules: [{ required: true, message: '输入容纳人数' }]}]" />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span='10'>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='会议室地址 '>
<a-input placeholder='会议室地址'
v-decorator="['address',{rules: [{ required: true, message: '输入会议室地址' }]}]" />
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span='10'>
<a-form-item label='排列形状' :labelCol='labelCol' :wrapperCol='wrapperCol'>
<a-select v-decorator="['shape',{rules: [{ required: true, message: '输入排列形状' }]}]"
placeholder='排列形状'>
<a-select-option value='围桌式'>
围桌式
</a-select-option>
<a-select-option value='课桌式'>
课桌式
</a-select-option>
<a-select-option value='长方形'>
长方形
</a-select-option>
<a-select-option value='U形'>
U形
</a-select-option>
<a-select-option value='鱼骨形'>
鱼骨形
</a-select-option>
<a-select-option value='开放形'>
开放形
</a-select-option>
<a-select-option value='会议形'>
会议形
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span='10'>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='负责人'>
<a-input placeholder='负责人'
v-decorator="['headName',{rules: [{ required: true, message: '输入负责人' }]}]" />
</a-form-item>
</a-col>
<a-col :span='10'>
<a-form-item label='负责人联系方式' :labelCol='labelCol' :wrapperCol='wrapperCol'>
<a-input placeholder='负责人联系方式'
v-decorator="['headPhone',{rules: [{ required: true, message: '输入负责人联系方式'}]}]" />
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span='10'>
<a-form-item label='预约开始时间' :labelCol='labelCol' :wrapperCol='wrapperCol'>
<a-time-picker v-decorator="['startTime',{rules: [{ required: true, message: '请选择预约开始时间'}]}]"
format='HH:mm'
valueFormat='YYYY-MM-DD HH:mm:ss'
placeholder='选择时间'
:show-time="{ defaultValue: moment('00:00:00', 'HH:mm:ss') }"
style='width: 100%;' />
</a-form-item>
</a-col>
<a-col :span='10'>
<a-form-item label='预约结束时间' :labelCol='labelCol' :wrapperCol='wrapperCol'>
<a-time-picker v-decorator="['endDate',{rules: [{ required: true, message: '请选择预约结束时间'}]}]"
format='HH:mm'
valueFormat='YYYY-MM-DD HH:mm:ss'
placeholder='选择时间'
:show-time="{ defaultValue: moment('00:00:00', 'HH:mm:ss') }"
style='width: 100%;' />
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span='10'>
<a-form-item label='是否使用优惠劵' :labelCol='labelCol' :wrapperCol='wrapperCol'>
<a-select v-decorator="['isTicket',{rules: [{ required: true, message: '请选择优惠券'}]}]"
placeholder='是否使用优惠劵'>
<a-select-option :value='0'>
</a-select-option>
<a-select-option :value='1'>
</a-select-option>
</a-select>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span='10'>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='是否收费'>
<a-select v-decorator="['isToll',{rules: [{ required: true, message: '请选择是否收费'}]}]"
@change='selectChangeIsToll' placeholder='是否收费'>
<a-select-option :value='0'>
</a-select-option>
<a-select-option :value='1'>
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span='10'>
<a-form-item v-if='mdl.isToll === 0' :labelCol='labelCol' :wrapperCol='wrapperCol' label='收费金额 '>
<a-input placeholder='收费金额 '
v-decorator="['money',{rules: [{ required: true, message: '请输入收费金额'}]}]" />
</a-form-item>
</a-col>
</a-row> </a-row>
<a-row> <a-row>
<a-col :span='10'> <a-col :span='10'>
<a-form-item label='起租时长' :labelCol='labelCol' :wrapperCol='wrapperCol'> <a-form-item label='会议室设备' :labelCol='labelCol' :wrapperCol='wrapperCol'>
<a-input placeholder='起租时长' <a-checkbox-group
v-decorator="['duration',{rules: [{ required: true, message: '请输入起租时长'}]}]" /> v-decorator="['device',{rules: [{ required: true, message: '请选择会议室设备' }]}]">
<a-checkbox v-for='item in deviceList' :value='item.value'>
{{ item.text }}
</a-checkbox>
</a-checkbox-group>
</a-form-item>
</a-col>
<a-col :span='10'>
<a-form-item label='会议室服务' :labelCol='labelCol' :wrapperCol='wrapperCol'>
<a-checkbox-group
v-decorator="['service',{rules: [{ required: true, message: '请选择会议室服务' }]}]">
<a-checkbox v-for='item in serviceList' :value='item.value'>
{{ item.text }}
</a-checkbox>
</a-checkbox-group>
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span='10'> <a-col :span='10'>
<a-form-item label='是否启用' :labelCol='labelCol' :wrapperCol='wrapperCol'> <a-form-item label='是否启用' :labelCol='labelCol' :wrapperCol='wrapperCol'>
<a-select v-decorator="['isShow',{rules: [{ required: true, message: '请选择是否启用'}]}]" <a-select v-decorator="['enable',{rules: [{ required: true, message: '请选择是否启用'}]}]"
placeholder='是否启用'> placeholder='是否启用'>
<a-select-option :value='0'> <a-select-option :value='0'>
@ -259,12 +105,6 @@
</a-col> </a-col>
</a-row> </a-row>
<a-row> <a-row>
<a-col :span='10'>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='金额备注 '>
<a-textarea placeholder='如起租时长为x小时,超过x小时后,按照每小时x元计算 ' v-decorator="['remake']"
style='height: 100px' />
</a-form-item>
</a-col>
<a-col :span='10'> <a-col :span='10'>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='会议室描述 '> <a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='会议室描述 '>
<a-textarea placeholder='会议室描述 ' v-decorator="['content']" style='height: 100px' /> <a-textarea placeholder='会议室描述 ' v-decorator="['content']" style='height: 100px' />
@ -275,7 +115,7 @@
<a-col :span='10'> <a-col :span='10'>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='室内图片'> <a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='室内图片'>
<a-upload <a-upload
v-decorator="['indoorPicUrl', {rules: [{ required: true, message: '上传室内图片' }]}]" v-decorator="['files', {rules: [{ required: true, message: '上传室内图片' }]}]"
list-type='picture-card' list-type='picture-card'
class='avatar-uploader' class='avatar-uploader'
:file-list='fileList' :file-list='fileList'
@ -303,7 +143,7 @@
import { import {
saveRoomContent, saveRoomContent,
getRoomListByFloorId, getRoomListByFloorId,
selectRoomById selectRoomById, getMeetingDict, getRoomInfo
} from '@/api/admin/meeting/roomContent' } from '@/api/admin/meeting/roomContent'
import pick from 'lodash.pick' import pick from 'lodash.pick'
import storage from 'store' import storage from 'store'
@ -326,7 +166,8 @@ export default {
xs: { span: 24 }, xs: { span: 24 },
sm: { span: 8 } sm: { span: 8 }
}, },
uploadUrl: process.env.VUE_APP_API_BASE_URL + '/api/dfs/upload', // uploadUrl: process.env.VUE_APP_API_BASE_URL + '/api/dfs/upload',
uploadUrl: process.env.VUE_APP_API_BASE_URL + '/admin/meetingRoom/upload',
imageUrl: '', imageUrl: '',
headers: { headers: {
Authorization: 'Bearer ' + storage.get(ACCESS_TOKEN) Authorization: 'Bearer ' + storage.get(ACCESS_TOKEN)
@ -341,11 +182,19 @@ export default {
typeData: [], typeData: [],
form: this.$form.createForm(this), form: this.$form.createForm(this),
userDetail: {}, userDetail: {},
tenantList: [], // typeList: [],
parkList: [], // shapeList: [],
buildingList: [], // deviceList: [],
buildingDetailList: [], // serviceList: [],
roomList: [], // typeMap: {},
shapeMap: {},
deviceMap: {},
serviceMap: {},
// tenantList: [], //
// parkList: [], //
// buildingList: [], //
// buildingDetailList: [], //
// roomList: [], //
tenantEnable: false, tenantEnable: false,
parkEnable: false, parkEnable: false,
previewVisible: false, previewVisible: false,
@ -359,153 +208,99 @@ export default {
}, },
mounted() { mounted() {
this.getDict()
}, },
methods: { methods: {
getDict() {
getMeetingDict().then((res) => {
//
let _typeList = []
let _typeMap = {}
let dataObj = res.data
for (let key in dataObj.floors) {
let eachObj = dataObj.floors[key]
const keys = Object.keys(eachObj)
_typeList.push({
text: keys[0],
value: keys[0]
})
this.typeMap[keys[0]] = eachObj[keys[0]]
// this.typeMap.keys[0] = eachObj[keys[0]]
}
this.typeList = _typeList
//
let _shapeList = []
for (let key in dataObj.types) {
let eachObj = dataObj.types[key]
const keys = Object.keys(eachObj)
_shapeList.push({
text: keys[0],
value: keys[0]
})
this.shapeMap[keys[0]] = eachObj[keys[0]]
}
this.shapeList = _shapeList
//
let _deviceList = []
for (let key in dataObj.devices) {
let eachObj = dataObj.devices[key]
const keys = Object.keys(eachObj)
_deviceList.push({
text: keys[0],
value: keys[0]
})
this.deviceMap[keys[0]] = eachObj[keys[0]]
}
this.deviceList = _deviceList
//
let _serviceList = []
for (let key in dataObj.services) {
let eachObj = dataObj.services[key]
const keys = Object.keys(eachObj)
_serviceList.push({
text: keys[0],
value: eachObj[keys[0]]
})
this.serviceMap[keys[0]] = eachObj[keys[0]]
}
this.serviceList = _serviceList
})
},
// //
getUserDetail() { getUserDetail() {
getInfo().then(res => { getInfo().then(res => {
console.log('getUserDetail', res) console.log('getUserDetail', res)
this.userDetail = res this.userDetail = res
// 5 // 5
if (this.userDetail.roleIds && this.userDetail.roleIds.length > 0 && this.userDetail.roleIds[0] == 5) { // if (this.userDetail.roleIds && this.userDetail.roleIds.length > 0 && this.userDetail.roleIds[0] == 5) {
// // //
// // //
let { id } = this.mdl // let { id } = this.mdl
if (!id) { // if (!id) {
// -> // // ->
this.selectTenant(this.userDetail.tenantId) // this.selectTenant(this.userDetail.tenantId)
// -> // // ->
this.selectPark(this.userDetail.parkId) // this.selectPark(this.userDetail.parkId)
} // }
// // //
// // //
this.tenantEnable = true // this.tenantEnable = true
this.parkEnable = true // this.parkEnable = true
// // //
this.mdl.parkId = this.userDetail.parkId // this.mdl.parkId = this.userDetail.parkId
this.mdl.tenantId = this.userDetail.tenantId // this.mdl.tenantId = this.userDetail.tenantId
this.form.setFieldsValue({ // this.form.setFieldsValue({
parkId: this.mdl.parkId, // parkId: this.mdl.parkId,
tenantId: this.mdl.tenantId // tenantId: this.mdl.tenantId
}) // })
} // }
console.log(this.mdl)
}) })
}, },
//
getTenantData() {
getTenantList().then(res => {
this.tenantList = res.rows
})
},
// ->
selectTenant(id) {
console.log('selectTenant', id)
//
this.mdl.parkId = null //
this.mdl.buildingId = null //
this.mdl.buildId = null //
this.mdl.roomId = null //
this.mdl.area = null //
this.form.setFieldsValue({
parkId: null, //
buildingId: null, //
buildId: null, //
roomId: null, //
area: null //
})
//
getParkList({
tenantId: id
}).then(res => {
this.parkList = res.rows
})
},
// ->
selectPark(id) {
//
this.mdl.buildingId = null //
this.mdl.buildId = null //
this.mdl.roomId = null //
this.mdl.area = null //
this.form.setFieldsValue({
buildingId: null, //
buildId: null, //
roomId: null, //
area: null //
})
//
getBuildingList({
parkId: id
}).then(res => {
this.buildingList = res.rows
})
},
// ->
selectBuilding(id) {
//
this.mdl.buildId = null //
this.mdl.roomId = null //
this.mdl.area = null //
this.form.setFieldsValue({
buildId: null, //
roomId: null, //
area: null //
})
//
getBuildingDetailList({
buildingId: id
}).then(res => {
this.buildingDetailList = res.rows
})
},
// ->
selectBuildingDetail(buildingDetailId) {
//
this.getRoomListByFloorIdMethod(buildingDetailId)
},
//
getRoomListByFloorIdMethod(buildingDetailId, id) {
//
this.mdl.roomId = null //
this.mdl.area = null //
this.form.setFieldsValue({
roomId: null, //
area: null //
})
//
getRoomListByFloorId({
'id': id,
'buildingDetailId': buildingDetailId,
'type': 0
}).then((res) => {
this.roomList = res.data
})
},
// ->
selectRoom(id) {
//
this.mdl.area = null //
this.form.setFieldsValue({
area: null //
})
//
selectRoomById({
'id': id
}).then((res) => {
this.form.setFieldsValue({
area: res.data.area
})
})
},
//
selectChangeIsToll(value) {
this.mdl.isToll = value
},
moment, moment,
// //
async handlePreview(file) { async handlePreview(file) {
@ -525,109 +320,142 @@ export default {
add() { add() {
this.form.resetFields() this.form.resetFields()
this.mdl = {} this.mdl = {}
this.edit({ id: 0 }) this.fileList = []
},
edit(record) {
this.mdl = Object.assign(this.mdl, record)
let copyMdl = JSON.parse(JSON.stringify(this.mdl))
//
this.getTenantData()
//
if (record.id != 0) { //
// ->
if (copyMdl.tenantId) {
this.mdl = JSON.parse(JSON.stringify(copyMdl))
this.selectTenant(copyMdl.tenantId)
}
// ->
if (copyMdl.parkId) {
this.mdl = JSON.parse(JSON.stringify(copyMdl))
this.selectPark(copyMdl.parkId)
}
// ->
if (copyMdl.buildingId) {
this.mdl = JSON.parse(JSON.stringify(copyMdl))
this.selectBuilding(copyMdl.buildingId)
}
// ->
if (copyMdl.buildId) {
this.mdl = JSON.parse(JSON.stringify(copyMdl))
this.getRoomListByFloorIdMethod(copyMdl.buildId, copyMdl.roomId)
}
//
this.mdl = JSON.parse(JSON.stringify(copyMdl))
} else { //
}
//
this.getUserDetail()
//
if (this.mdl.indoorPicUrl) {
this.mdl.indoorPicUrl = JSON.parse(this.mdl.indoorPicUrl)
this.mdl.indoorPicUrl.forEach((item, i) => {
item.url = process.env.VUE_APP_API_BASE_URL + item.url
})
this.fileList = this.mdl.indoorPicUrl
} else {
this.fileList = []
}
//
this.visible = true this.visible = true
this.$nextTick(() => { },
this.form.setFieldsValue( edit(id) {
pick( this.form.resetFields()
this.mdl, this.mdl = {}
'id', this.fileList = []
'type', getRoomInfo({ roomId: id }).then((res) => {
'meetingName', let deviceStr = res.room.device
'capacityNum', if (deviceStr != '') {
'expandNum', deviceStr = deviceStr.replaceAll(' ', '')
'indoorPicUrl', let deviceArr = deviceStr.split('#')
'startTime', if (deviceArr[0] == '') {
'endDate', deviceArr.shift()
'money', }
'isShow', res.room.device = deviceArr
'shape', }
'area', let serviceStr = res.room.ext1
'address', if (serviceStr && serviceStr != '') {
'headName', let serviceArr = serviceStr.split(',')
'headPhone', res.room.service = serviceArr
'isTicket', }
'isToll', this.mdl = Object.assign(this.mdl, res.room)
'money',
'remake', this.visible = true
'duration', this.$nextTick(() => {
'content', this.form.setFieldsValue(
'tenantId', pick(
'parkId', this.mdl,
'buildingId', 'id',
'buildId', 'device',
'roomId' 'typeName',
'name',
'capacityNum',
'floor',
'files',
'startTime',
'endDate',
'money',
'enable',
'typeName',
'content',
'area',
'roomNum',
'service'
)
) )
) })
//
console.log(this.mdl)
if (this.mdl.imgs) {
let files = []
let fileId = []
for (let key in this.mdl.imgs) {
let eachObj = this.mdl.imgs[key]
files.push({
uid: '0',
id: eachObj.id,
url: process.env.VUE_APP_MODEL_BASE_URL + eachObj.url,
status: 'done',
name: eachObj.url
})
fileId.push(eachObj.id)
}
this.fileList = files
this.mdl.files = fileId
} else {
this.fileList = []
}
}) })
// // let copyMdl = JSON.parse(JSON.stringify(this.mdl))
// //
// // this.getTenantData()
// //
// if (record.id != 0) { //
// } else { //
// }
// //
// this.getUserDetail()
// //
}, },
handleSubmit(e) { handleSubmit(e) {
e.preventDefault() e.preventDefault()
this.form.validateFields((err, values) => { this.form.validateFields((err, values) => {
if (!err) { if (!err) {
console.log('Received values of form: ', values) console.log('Received values of form: ', values)
this.confirmLoading = true this.confirmLoading = false
const indoorPicUrl = []
// const indoorPicUrl = []
const files = []
this.fileList.forEach((file, index) => { this.fileList.forEach((file, index) => {
// //
if (file.hasOwnProperty('name') && file.hasOwnProperty('url') && file.hasOwnProperty('uid')) {
indoorPicUrl.push({ 'name': file.name, 'url': file.name, 'uid': index }) if (file.hasOwnProperty('url') && file.hasOwnProperty('id')) {
// indoorPicUrl.push({ 'name': file.name, 'url': file.name, 'id': file.id })
files.push(file.id)
} }
if (file.status === 'done' && file.response.code === 0) { if (file.hasOwnProperty('response') && file.status === 'done' && file.response.code === 0) {
const data = file.response const data = file.response
indoorPicUrl.push({ 'name': data.fileName, 'url': data.fileName, 'uid': index }) // indoorPicUrl.push({ 'name': data.fileName, 'url': data.fileName, 'uid': index })
files.push(file.response.id)
} }
}) })
// //
values.indoorPicUrl = JSON.stringify(indoorPicUrl) // values.indoorPicUrl = JSON.stringify(indoorPicUrl)
saveRoomContent(values) // values.files = files
let deviceArr = values.device
let deviceStr = ''
for (let key in deviceArr) {
let eachObj = deviceArr[key]
deviceStr += '#' + eachObj + ' '
}
values.device = deviceStr
let serviceArr = values.service
let serviceStr = ''
for (let key in serviceArr) {
let eachObj = serviceArr[key]
serviceStr += eachObj + ','
}
// ,
if (serviceStr != '') {
serviceStr = serviceStr.substring(0, serviceStr.length - 1)
}
// ext1
values.ext1 = serviceStr
values.floorId = this.typeMap[values.floor]
values.typeId = this.shapeMap[values.typeName]
saveRoomContent(values, files)
.then((res) => { .then((res) => {
if (res.code === 0) { if (res.code === 0) {
this.$message.success('保存成功') this.$message.success('保存成功')

View File

@ -0,0 +1,115 @@
<template>
<a-modal
title='操作'
style='top: 20px;'
:width='800'
v-model='visible'
:confirmLoading='confirmLoading'
@ok='handleSubmit'
>
<a-form :form='form'>
<a-form-item style='display:none'>
<a-input v-decorator="['id']" />
</a-form-item>
<a-form-item style='display:none'>
<a-input v-decorator="['version']" />
</a-form-item>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='部门编号'>
<a-input placeholder='部门id' v-decorator="['orgId', {rules: [{required: true, message: '请输入部门编号'}]}]" />
</a-form-item>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='部门名称'>
<a-input placeholder='部门名称' v-decorator="['orgName', {rules: [{required: true, message: '请输入部门名称'}]}]" />
</a-form-item>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='登录名'>
<a-input placeholder='登录名'
v-decorator="['loginName', {rules: [{required: true, message: '请输入登录名'}]}]" />
</a-form-item>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='密码'>
<a-input placeholder='密码' v-decorator="['password', {rules: [{required: true, message: '请输入密码'}]}]" />
</a-form-item>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='备注'>
<a-input placeholder='备注' v-decorator="['remark']" />
</a-form-item>
</a-form>
</a-modal>
</template>
<script>
import { saveMeetingUto } from '@/api/admin/meeting/uto'
import pick from 'lodash.pick'
export default {
name: 'MeetingUtoModal',
props: {},
components: {},
data() {
return {
visible: false,
labelCol: {
xs: { span: 24 },
sm: { span: 5 }
},
wrapperCol: {
xs: { span: 24 },
sm: { span: 16 }
},
confirmLoading: false,
mdl: {},
form: this.$form.createForm(this)
}
},
beforeCreate() {
},
created() {
},
methods: {
add() {
this.form.resetFields()
this.edit({ id: 0 })
},
edit(record) {
this.mdl = Object.assign(record)
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.mdl, 'id', 'orgId', 'orgName', 'loginName', 'password', 'remark'))
})
},
handleSubmit(e) {
e.preventDefault()
this.form.validateFields((err, values) => {
if (!err) {
console.log('Received values of form: ', values)
// this.confirmLoading = true
values.userName = values.orgName
saveMeetingUto(values).then(res => {
if (res.code === 0) {
this.$message.success('保存成功')
this.$emit('ok')
this.visible = false
} else {
this.$message.error(res.msg)
}
}).catch(() => {
this.$message.error('系统错误,请稍后再试')
}).finally(() => {
// this.confirmLoading = false
})
}
})
}
},
watch: {
/*
'selectedRows': function (selectedRows) {
this.needTotalList = this.needTotalList.map(item => {
return {
...item,
total: selectedRows.reduce( (sum, val) => {
return sum + val[item.dataIndex]
}, 0)
}
})
}
*/
}
}
</script>

View File

@ -1,89 +1,89 @@
<template> <template>
<a-modal <a-modal
title='操作' title="操作"
style='top: 20px;' style="top: 20px;"
:width='800' :width="800"
v-model='visible' v-model="visible"
:confirmLoading='confirmLoading' :confirmLoading="confirmLoading"
@ok='handleSubmit' @ok="handleSubmit"
> >
<a-form :form='form'> <a-form :form="form">
<a-form-item style='display:none'> <a-form-item style="display:none">
<a-input v-decorator="['id']" /> <a-input v-decorator="['id']" />
</a-form-item> </a-form-item>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='企业'> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="姓名">
<a-select v-decorator="['icsCustomerId',{rules: [{ required: true, message: '请选择企业' }]}]" <a-input placeholder="姓名" v-decorator="['name', {rules: [{required: true, message: '请输入姓名'}]}]" />
placeholder='企业'>
<a-select-option v-for='item in customerList' :key='item.id' :value='item.id'>
{{ item.name }}
</a-select-option>
</a-select>
</a-form-item> </a-form-item>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='姓名'> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="电话">
<a-input placeholder='姓名' v-decorator="['name', {rules: [{required: true, message: '请输入姓名'}]}]" /> <a-input placeholder="电话" v-decorator="['mobile', {rules: [{required: true, message: '请输入电话'}]}]" />
</a-form-item> </a-form-item>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='电话'> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="用户性别">
<a-input placeholder='电话' v-decorator="['mobile', {rules: [{required: true, message: '请输入电话'}]}]" /> <a-radio-group @change="onChange" v-decorator="['gender',{rules: [{required: true, message: '请选择性别'}]}]">
</a-form-item>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='用户性别'>
<a-radio-group @change='onChange' v-decorator="['gender',{rules: [{required: true, message: '请选择性别'}]}]">
<a-radio :value="'0'"></a-radio> <a-radio :value="'0'"></a-radio>
<a-radio :value="'1'"></a-radio> <a-radio :value="'1'"></a-radio>
</a-radio-group> </a-radio-group>
</a-form-item> </a-form-item>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='照片'> <!-- <a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='照片'>-->
<a-upload <!-- <a-upload-->
v-decorator="['photo' ,{rules: [{required: true, message: '请上传照片'}]}]" <!-- v-decorator="['photo' ,{rules: [{required: true, message: '请上传照片'}]}]"-->
list-type='picture-card' <!-- list-type='picture-card'-->
class='avatar-uploader' <!-- class='avatar-uploader'-->
:show-upload-list='false' <!-- :show-upload-list='false'-->
:action='uploadUrl' <!-- :action='uploadUrl'-->
:headers='headers' <!-- :headers='headers'-->
:before-upload='photoBeforeUpload' <!-- :before-upload='photoBeforeUpload'-->
@change='photoHandleChange' <!-- @change='photoHandleChange'-->
> <!-- >-->
<img v-if='photoImageUrl' :src='photoImageUrl' style='width: 102px; height: 102px' /> <!-- <img v-if='photoImageUrl' :src='photoImageUrl' style='width: 102px; height: 102px' />-->
<div v-else> <!-- <div v-else>-->
<a-icon :type="photoLoading ? 'loading' : 'plus'" /> <!-- <a-icon :type="photoLoading ? 'loading' : 'plus'" />-->
<div class='ant-upload-text'> 上传</div> <!-- <div class='ant-upload-text'> 上传</div>-->
</div> <!-- </div>-->
</a-upload> <!-- </a-upload>-->
<!-- </a-form-item>-->
<!-- <a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='头像'>-->
<!-- <a-upload-->
<!-- v-decorator="['avatar']"-->
<!-- list-type='picture-card'-->
<!-- class='avatar-uploader'-->
<!-- :show-upload-list='false'-->
<!-- :action='uploadUrl'-->
<!-- :headers='headers'-->
<!-- :before-upload='avatarBeforeUpload'-->
<!-- @change='avatarHandleChange'-->
<!-- >-->
<!-- <img v-if='avatarImageUrl' :src='avatarImageUrl' style='width: 102px; height: 102px' />-->
<!-- <div v-else>-->
<!-- <a-icon :type="avatarLoading ? 'loading' : 'plus'" />-->
<!-- <div class='ant-upload-text'> 上传</div>-->
<!-- </div>-->
<!-- </a-upload>-->
<!-- </a-form-item>-->
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="随手拍角色">
<a-radio-group v-decorator="['dataType',{rules: [{required: true, message: '请选择随手拍角色'}]}]">
<a-radio :value="'1'">普通用户</a-radio>
<a-radio :value="'3'">派单员</a-radio>
<a-radio :value="'5'">维修人</a-radio>
<a-radio :value="'7'">管理员</a-radio>
<a-radio :value="'9'">楼层管理员</a-radio>
</a-radio-group>
</a-form-item> </a-form-item>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='头像'> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="会议室角色">
<a-upload <a-radio-group v-decorator="['roomRole']">
v-decorator="['avatar']" <a-radio :value="1">普通用户</a-radio>
list-type='picture-card' <a-radio :value="3">会议服务人员</a-radio>
class='avatar-uploader' <a-radio :value="5">会议管理员</a-radio>
:show-upload-list='false' </a-radio-group>
:action='uploadUrl'
:headers='headers'
:before-upload='avatarBeforeUpload'
@change='avatarHandleChange'
>
<img v-if='avatarImageUrl' :src='avatarImageUrl' style='width: 102px; height: 102px' />
<div v-else>
<a-icon :type="avatarLoading ? 'loading' : 'plus'" />
<div class='ant-upload-text'> 上传</div>
</div>
</a-upload>
</a-form-item> </a-form-item>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='昵称'> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="会议服务组">
<a-input placeholder='昵称' v-decorator="['username']" /> <a-radio-group v-decorator="['roomRoleType']">
<a-radio :value="1">音控组</a-radio>
<a-radio :value="3">会务服务组</a-radio>
</a-radio-group>
</a-form-item> </a-form-item>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='身份证号'>
<a-input placeholder='身份证号' v-decorator="['cardNo']" /> <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="昵称">
</a-form-item> <a-input placeholder="昵称" v-decorator="['username']" />
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='地址'>
<a-input placeholder='地址' v-decorator="['address' ,{rules: [{required: true, message: '请输入地址'}]}]" />
</a-form-item>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='邮箱'>
<a-input placeholder='邮箱' v-decorator="['email']" />
</a-form-item>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='学历'>
<a-input placeholder='学历' v-decorator="['degree']" />
</a-form-item>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='紧急联系人'>
<a-input placeholder='紧急联系人' v-decorator="['urgent']" />
</a-form-item> </a-form-item>
</a-form> </a-form>
@ -103,7 +103,7 @@ export default {
name: 'IcsCustomerStaffModal', name: 'IcsCustomerStaffModal',
props: {}, props: {},
components: {}, components: {},
data() { data () {
return { return {
visible: false, visible: false,
labelCol: { labelCol: {
@ -129,13 +129,13 @@ export default {
avatarLoading: false avatarLoading: false
} }
}, },
beforeCreate() { beforeCreate () {
}, },
created() { created () {
}, },
methods: { methods: {
// //
photoBeforeUpload(file) { photoBeforeUpload (file) {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'
if (!isJpgOrPng) { if (!isJpgOrPng) {
this.$message.error('You can only upload JPG file!') this.$message.error('You can only upload JPG file!')
@ -146,7 +146,7 @@ export default {
} }
return isJpgOrPng && isLt2M return isJpgOrPng && isLt2M
}, },
photoHandleChange(info) { photoHandleChange (info) {
if (info.file.status === 'uploading') { if (info.file.status === 'uploading') {
this.photoLoading = true this.photoLoading = true
return return
@ -169,7 +169,7 @@ export default {
} }
}, },
// //
avatarBeforeUpload(file) { avatarBeforeUpload (file) {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png' const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'
if (!isJpgOrPng) { if (!isJpgOrPng) {
this.$message.error('You can only upload JPG file!') this.$message.error('You can only upload JPG file!')
@ -180,7 +180,7 @@ export default {
} }
return isJpgOrPng && isLt2M return isJpgOrPng && isLt2M
}, },
avatarHandleChange(info) { avatarHandleChange (info) {
if (info.file.status === 'uploading') { if (info.file.status === 'uploading') {
this.avatarLoading = true this.avatarLoading = true
return return
@ -202,16 +202,17 @@ export default {
}) })
} }
}, },
getBase64(img, callback) { getBase64 (img, callback) {
const reader = new FileReader() const reader = new FileReader()
reader.addEventListener('load', () => callback(reader.result)) reader.addEventListener('load', () => callback(reader.result))
reader.readAsDataURL(img) reader.readAsDataURL(img)
}, },
add() { add () {
this.form.resetFields() this.form.resetFields()
this.edit({ id: 0 }) this.edit({ id: 0 })
}, },
edit(record) { edit (record) {
console.log(record)
// //
getCustomerList().then(res => { getCustomerList().then(res => {
console.log('getCustomerList', res) console.log('getCustomerList', res)
@ -220,7 +221,7 @@ export default {
this.mdl = Object.assign(record) this.mdl = Object.assign(record)
this.visible = true this.visible = true
this.$nextTick(() => { this.$nextTick(() => {
this.form.setFieldsValue(pick(this.mdl, 'id', 'icsCustomerId', 'name', 'mobile', 'gender', 'photo', 'avatar', 'username', 'cardNo', 'address', 'email', 'degree', 'urgent')) this.form.setFieldsValue(pick(this.mdl, 'id', 'icsCustomerId', 'name', 'mobile', 'gender', 'photo', 'avatar', 'dataType', 'roomRole', 'roomRoleType', 'username', 'cardNo', 'address', 'email', 'degree', 'urgent'))
}) })
// //
if (this.mdl.photo) { if (this.mdl.photo) {
@ -234,7 +235,7 @@ export default {
this.avatarImageUrl = '' this.avatarImageUrl = ''
} }
}, },
handleSubmit(e) { handleSubmit (e) {
e.preventDefault() e.preventDefault()
this.form.validateFields((err, values) => { this.form.validateFields((err, values) => {
if (!err) { if (!err) {
@ -242,6 +243,7 @@ export default {
this.confirmLoading = true this.confirmLoading = true
console.log('Received values of form: ') console.log('Received values of form: ')
saveIcsCustomerStaff(values).then(res => { saveIcsCustomerStaff(values).then(res => {
console.log(111)
if (res.code === 0) { if (res.code === 0) {
this.$message.success('保存成功') this.$message.success('保存成功')
this.$emit('ok') this.$emit('ok')

View File

@ -28,6 +28,7 @@
size='default' size='default'
ref='tableFloor' ref='tableFloor'
rowKey='id' rowKey='id'
showPagination="true"
:columns='floorColumns' :columns='floorColumns'
:data='loadFloor' :data='loadFloor'
> >
@ -58,6 +59,7 @@
size='default' size='default'
ref='tableFloorCreate' ref='tableFloorCreate'
rowKey='id' rowKey='id'
showPagination="true"
:columns='floorCreateColumns' :columns='floorCreateColumns'
:data='loadFloorCreate' :data='loadFloorCreate'
> >
@ -88,6 +90,7 @@
size='default' size='default'
ref='tableWorker' ref='tableWorker'
rowKey='id' rowKey='id'
showPagination="true"
:columns='columns' :columns='columns'
:data='loadWorker' :data='loadWorker'
> >

View File

@ -22,6 +22,7 @@
size="default" size="default"
ref="table" ref="table"
rowKey="id" rowKey="id"
showPagination="true"
:rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}" :rowSelection="{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}"
:columns="columns" :columns="columns"
:data="loadData" :data="loadData"

View File

@ -27,6 +27,7 @@
size='default' size='default'
ref='table' ref='table'
rowKey='id' rowKey='id'
showPagination="true"
:rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}' :rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
:columns='columns' :columns='columns'
:data='loadData' :data='loadData'

View File

@ -28,6 +28,7 @@
size='default' size='default'
ref='table' ref='table'
rowKey='id' rowKey='id'
showPagination="true"
:rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}' :rowSelection='{selectedRowKeys: selectedRowKeys, onChange: onSelectChange}'
:columns='columns' :columns='columns'
:data='loadData' :data='loadData'

View File

@ -51,6 +51,7 @@
size='default' size='default'
ref='table' ref='table'
rowKey='id' rowKey='id'
showPagination="true"
:columns='columns' :columns='columns'
:data='loadData' :data='loadData'
> >