mirror of
https://gitee.com/elegant_wings/dbd-meeting-html.git
synced 2025-06-21 05:39:36 +08:00
后台会议室管理开发
This commit is contained in:
parent
441a813e12
commit
5435cbf135
3
.gitignore
vendored
3
.gitignore
vendored
@ -19,3 +19,6 @@ yarn-error.log*
|
||||
*.njsproj
|
||||
*.sln
|
||||
*.sw*
|
||||
|
||||
vue.config.js
|
||||
.env.development
|
@ -4,10 +4,19 @@ const api = {
|
||||
roomContent: '/meeting/roomContent'
|
||||
}
|
||||
|
||||
export function getMeetingDict(parameter) {
|
||||
return axios({
|
||||
url: '/app/mr/getConstData',
|
||||
method: 'post',
|
||||
params: parameter
|
||||
})
|
||||
}
|
||||
|
||||
export function getRoomContentList(parameter) {
|
||||
return axios({
|
||||
url: api.roomContent + '/list',
|
||||
method: 'get',
|
||||
// url: api.roomContent + '/list',
|
||||
url: '/admin/meetingRoom/list?pageNum=',
|
||||
method: 'post',
|
||||
params: parameter
|
||||
})
|
||||
}
|
||||
@ -47,7 +56,18 @@ export function selectSearchInfoByShape (parameter) {
|
||||
|
||||
export function saveRoomContent(parameter) {
|
||||
return axios({
|
||||
url: api.roomContent + (parameter.id > 0 ? '/update' : '/save'),
|
||||
url: '/admin/meetingRoom' + (parameter.id > 0 ? '/update' : '/save'),
|
||||
method: 'post',
|
||||
params: parameter,
|
||||
headers: {
|
||||
'Content-Type': 'application/json;charset=UTF-8'
|
||||
}
|
||||
})
|
||||
}
|
||||
|
||||
export function getRoomInfo(parameter) {
|
||||
return axios({
|
||||
url: '/app/mr/roomMrs',
|
||||
method: 'post',
|
||||
data: parameter,
|
||||
headers: {
|
||||
@ -150,13 +170,12 @@ export function selectRoomItemByRoom (parameter) {
|
||||
|
||||
export function delRoomContent(parameter) {
|
||||
return axios({
|
||||
url: api.roomContent + '/remove',
|
||||
// url: api.roomContent + '/remove',
|
||||
url: '/admin/meetingRoom/remove',
|
||||
method: 'post',
|
||||
params: parameter
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
export const roomContentExport = api.roomContent + '/export'
|
||||
|
@ -4,36 +4,15 @@
|
||||
<a-form layout='inline'>
|
||||
<a-row :gutter='48'>
|
||||
<a-col :md='5' :sm='15'>
|
||||
<a-form-item label='关键词'>
|
||||
<a-input placeholder='请输入关键词' v-model='queryParam.meetingName' />
|
||||
<a-form-item label='会议室名称'>
|
||||
<a-input placeholder='请输入名称' v-model='queryParam.meetingName' />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md='5' :sm='15'>
|
||||
<a-form-item label='会议室类型'>
|
||||
<a-select v-model='queryParam.typeName' placeholder='请选择会议室类型'>
|
||||
<a-select-option :value='1'>
|
||||
会议室
|
||||
</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-form-item label='所在楼层'>
|
||||
<a-select v-model='queryParam.typeName'>
|
||||
<a-select-option v-for='item in typeList' :value='item.value'>
|
||||
{{ item.text }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
@ -41,35 +20,38 @@
|
||||
<a-col :md='5' :sm='15'>
|
||||
<a-form-item label='排列形状'>
|
||||
<a-select v-model='queryParam.shape' 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 v-for='item in shapeList' :value='item.value'>
|
||||
{{ item.text }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :md='5' :sm='15'>
|
||||
<a-form-item label='容纳人数'>
|
||||
<a-select v-model='queryParam.capacityNum' placeholder='请选择类型'>
|
||||
<a-select-option v-for='(item,index) in capacityList' :key='item.id' :value='item.capacityNum'>
|
||||
{{ item.capacityNum }}
|
||||
<a-select v-model='queryParam.capacityNum' placeholder='请选择范围'>
|
||||
<a-select-option value=''>
|
||||
全部
|
||||
</a-select-option>
|
||||
<a-select-option value='1'>
|
||||
0-10
|
||||
</a-select-option>
|
||||
<a-select-option value='2'>
|
||||
11-20
|
||||
</a-select-option>
|
||||
<a-select-option value='3'>
|
||||
21-30
|
||||
</a-select-option>
|
||||
<a-select-option value='4'>
|
||||
31-40
|
||||
</a-select-option>
|
||||
<a-select-option value='5'>
|
||||
41-50
|
||||
</a-select-option>
|
||||
<a-select-option value='6'>
|
||||
50-100
|
||||
</a-select-option>
|
||||
<a-select-option value='7'>
|
||||
100以上
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
@ -77,7 +59,7 @@
|
||||
<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='() => (queryParam = {})'>重置</a-button>
|
||||
<a-button style='margin-left: 8px' @click='reset'>重置</a-button>
|
||||
</span>
|
||||
</a-col>
|
||||
</a-row>
|
||||
@ -107,9 +89,9 @@
|
||||
<a @click='handleServeTable(record)'>{{ record.serveCount }}</a>
|
||||
</span>
|
||||
<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 v-if='removeEnable' @click='deleteShow([record.id])'>删除</a>
|
||||
<a v-if='removeEnable' @click='delByIds([record.id])'>删除</a>
|
||||
</span>
|
||||
</s-table>
|
||||
|
||||
@ -125,29 +107,7 @@
|
||||
|
||||
|
||||
<roomContent-modal ref='modal' @ok='handleOk' />
|
||||
|
||||
|
||||
<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>
|
||||
<a-modal v-model='visible' title='会议设备' width='600px' @ok='itemHandleOk()'>
|
||||
<s-table
|
||||
size='default'
|
||||
ref='itemTable'
|
||||
@ -158,39 +118,7 @@
|
||||
>
|
||||
</s-table>
|
||||
</a-modal>
|
||||
<a-modal v-model='visible1' title='会议服务' width='1000px' @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>
|
||||
<a-modal v-model='visible1' title='会议服务' width='600px' @ok='serveHandleOk()'>
|
||||
<s-table
|
||||
size='default'
|
||||
ref='serveTable'
|
||||
@ -198,11 +126,7 @@
|
||||
:rowSelection='{ selectedRowKeys: selectedServeRowKeys, onChange: onServeSelectChange }'
|
||||
:columns='serveColumns'
|
||||
:data='serveLoadData'
|
||||
:scroll='{ x: true }'
|
||||
>
|
||||
<span slot='serveType' slot-scope='text'>
|
||||
{{ text | serveTypeFilter }}
|
||||
</span>
|
||||
</s-table>
|
||||
</a-modal>
|
||||
</a-card>
|
||||
@ -216,7 +140,7 @@ import { STable } from '@/components'
|
||||
import {
|
||||
getRoomContentList, delRoomContent, selectSearchInfoByType,
|
||||
selectSearchInfoByShape, selectSearchInfoByCapacity, addRoomServe,
|
||||
selectRoomServeByRoom, selectRoomItemByRoom
|
||||
selectRoomServeByRoom, selectRoomItemByRoom, getMeetingDict
|
||||
} from '@/api/admin/meeting/roomContent'
|
||||
import { getRoomServeList } from '@/api/admin/meeting/roomServe'
|
||||
import { getRoomItemList } from '@/api/admin/meeting/roomItem'
|
||||
@ -224,6 +148,7 @@ import RoomContentModal from './modules/RoomContentModal.vue'
|
||||
import { checkPermission } from '@/utils/permissions'
|
||||
import { getDictArray } from '@/utils/dict'
|
||||
import { addRoomItem } from '../../../api/admin/meeting/roomContent'
|
||||
import { delRepairDevice } from '@/api/admin/repair/repairDevice'
|
||||
|
||||
const typeMap = {}
|
||||
const serveTypeMap = {}
|
||||
@ -235,6 +160,7 @@ export default {
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
parkId: 25,
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 }
|
||||
@ -251,9 +177,13 @@ export default {
|
||||
// 高级搜索 展开/关闭
|
||||
advanced: false,
|
||||
// 查询参数
|
||||
queryParam: {},
|
||||
itemQueryParam: {
|
||||
queryParam: {
|
||||
meetingName: '',
|
||||
typeName: '',
|
||||
shape: '',
|
||||
capacityNum: ''
|
||||
},
|
||||
itemQueryParam: {},
|
||||
serveQueryParam: {},
|
||||
capacityList: [],
|
||||
shapeList: [],
|
||||
@ -269,28 +199,21 @@ export default {
|
||||
{
|
||||
title: '服务名称',
|
||||
dataIndex: 'serveName'
|
||||
},
|
||||
{
|
||||
title: '服务类型',
|
||||
dataIndex: 'serveType',
|
||||
scopedSlots: { customRender: 'serveType' }
|
||||
},
|
||||
{
|
||||
title: '金额',
|
||||
dataIndex: 'money'
|
||||
}
|
||||
],
|
||||
|
||||
// 表头
|
||||
columns: [
|
||||
{
|
||||
title: '会议室名称',
|
||||
dataIndex: 'meetingName'
|
||||
dataIndex: 'name'
|
||||
},
|
||||
{
|
||||
title: '会议室类型',
|
||||
dataIndex: 'type',
|
||||
scopedSlots: { customRender: 'type' }
|
||||
title: '所属楼层',
|
||||
dataIndex: 'floor',
|
||||
},
|
||||
{
|
||||
title: '所属房间',
|
||||
dataIndex: 'roomNum'
|
||||
},
|
||||
{
|
||||
title: '容纳人数',
|
||||
@ -298,26 +221,17 @@ export default {
|
||||
},
|
||||
{
|
||||
title: '排列形状',
|
||||
dataIndex: 'shape'
|
||||
dataIndex: 'typeName'
|
||||
},
|
||||
{
|
||||
title: '会议室设备',
|
||||
dataIndex: 'itemCount',
|
||||
scopedSlots: { customRender: 'item' }
|
||||
},
|
||||
{
|
||||
title: '关联服务',
|
||||
dataIndex: 'serveCount',
|
||||
scopedSlots: { customRender: 'serve' }
|
||||
},
|
||||
{
|
||||
title: '金额',
|
||||
dataIndex: 'money'
|
||||
},
|
||||
{
|
||||
title: '负责人',
|
||||
dataIndex: 'headName'
|
||||
dataIndex: 'device',
|
||||
},
|
||||
// {
|
||||
// title: '关联服务',
|
||||
// dataIndex: 'serveCount',
|
||||
// scopedSlots: { customRender: 'serve' }
|
||||
// },
|
||||
{
|
||||
title: '操作',
|
||||
width: '200px',
|
||||
@ -327,14 +241,27 @@ export default {
|
||||
],
|
||||
// 加载数据方法 必须为 Promise 对象
|
||||
loadData: (parameter) => {
|
||||
return getRoomContentList(Object.assign(parameter, this.queryParam))
|
||||
const param = {
|
||||
name: this.queryParam.meetingName, // 名称
|
||||
floor: this.queryParam.typeName, // 楼层名称
|
||||
typeName: this.queryParam.shape, // 形状
|
||||
capacityNum: this.queryParam.capacityNum // 容纳人数
|
||||
}
|
||||
// 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) => {
|
||||
console.log(this.parkId)
|
||||
let param = {
|
||||
parkId: this.parkId
|
||||
}
|
||||
|
||||
return getRoomItemList(Object.assign(parameter, param))
|
||||
},
|
||||
serveLoadData: (parameter) => {
|
||||
@ -358,7 +285,7 @@ export default {
|
||||
// 删除
|
||||
deleteVisible: false,
|
||||
deleteLoading: false,
|
||||
deleteIds : null,
|
||||
deleteIds: null
|
||||
}
|
||||
},
|
||||
filters: {
|
||||
@ -374,18 +301,65 @@ export default {
|
||||
TypeData.map(d => {
|
||||
typeMap[d.dictValue] = { text: d.dictLabel }
|
||||
})
|
||||
console.log(typeMap)
|
||||
// console.log(typeMap)
|
||||
const serveTypeData = await getDictArray('serve_type')
|
||||
serveTypeData.map(d => {
|
||||
serveTypeMap[d.dictValue] = { text: d.dictLabel }
|
||||
})
|
||||
},
|
||||
mounted() {
|
||||
this.selectSearchInfoByType()
|
||||
this.selectSearchInfoByShape()
|
||||
this.selectSearchInfoByCapacity()
|
||||
this.getDict()
|
||||
// this.selectSearchInfoByType()
|
||||
// this.selectSearchInfoByShape()
|
||||
// this.selectSearchInfoByCapacity()
|
||||
},
|
||||
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() {
|
||||
console.log(this.meetingId)
|
||||
let params = {
|
||||
@ -433,9 +407,9 @@ export default {
|
||||
},
|
||||
handleItemTable(record) {
|
||||
let params = {
|
||||
roomContentId: record.id,
|
||||
roomContentId: record.id
|
||||
}
|
||||
this.parkId = record.parkId
|
||||
// this.parkId = record.parkId
|
||||
|
||||
selectRoomItemByRoom(params).then((res) => {
|
||||
this.selectedItemRowKeys = res.data.map(d => d.itemId)
|
||||
@ -447,10 +421,9 @@ export default {
|
||||
},
|
||||
handleServeTable(record) {
|
||||
let params = {
|
||||
romeContentId: record.id,
|
||||
|
||||
romeContentId: record.id
|
||||
}
|
||||
this.parkId = record.parkId
|
||||
// this.parkId = record.parkId
|
||||
selectRoomServeByRoom(params).then((res) => {
|
||||
this.selectedServeRowKeys = res.data.map(d => d.serveId)
|
||||
this.selectedServeRows = res.data
|
||||
@ -461,21 +434,21 @@ export default {
|
||||
},
|
||||
|
||||
// 获取查询条件
|
||||
selectSearchInfoByType() {
|
||||
selectSearchInfoByType().then((res) => {
|
||||
this.typeList = res.roomContents
|
||||
})
|
||||
},
|
||||
selectSearchInfoByShape() {
|
||||
selectSearchInfoByShape().then((res) => {
|
||||
this.shapeList = res.roomContents
|
||||
})
|
||||
},
|
||||
selectSearchInfoByCapacity() {
|
||||
selectSearchInfoByCapacity().then((res) => {
|
||||
this.capacityList = res.roomContents
|
||||
})
|
||||
},
|
||||
// selectSearchInfoByType() {
|
||||
// selectSearchInfoByType().then((res) => {
|
||||
// this.typeList = res.roomContents
|
||||
// })
|
||||
// },
|
||||
// selectSearchInfoByShape() {
|
||||
// selectSearchInfoByShape().then((res) => {
|
||||
// this.shapeList = res.roomContents
|
||||
// })
|
||||
// },
|
||||
// selectSearchInfoByCapacity() {
|
||||
// selectSearchInfoByCapacity().then((res) => {
|
||||
// this.capacityList = res.roomContents
|
||||
// })
|
||||
// },
|
||||
onSelectChange(selectedRowKeys, selectedRows) {
|
||||
this.selectedRowKeys = selectedRowKeys
|
||||
this.selectedRows = selectedRows
|
||||
@ -483,37 +456,43 @@ export default {
|
||||
handleAdd() {
|
||||
this.$refs.modal.add()
|
||||
},
|
||||
handleEdit(record) {
|
||||
this.$refs.modal.edit(record)
|
||||
handleEdit(id) {
|
||||
this.$refs.modal.edit(id)
|
||||
},
|
||||
handleOk() {
|
||||
this.$refs.table.refresh(true)
|
||||
},
|
||||
delByIds(ids) {
|
||||
const _this = this
|
||||
if (ids === '') {
|
||||
this.$message.error('请选择后删除!')
|
||||
return
|
||||
}
|
||||
this.$confirm({
|
||||
title: '警告',
|
||||
content: '删除后不可恢复,是否确认删除?',
|
||||
okText: '是',
|
||||
okType: 'warning',
|
||||
cancelText: '否',
|
||||
onOk() {
|
||||
delRoomContent({ ids: ids.join(',') }).then((res) => {
|
||||
if (res.code === 0) {
|
||||
this.$message.success('删除成功')
|
||||
this.handleOk()
|
||||
_this.$message.success('删除成功')
|
||||
_this.handleOk()
|
||||
} else {
|
||||
this.$message.error(res.msg)
|
||||
_this.$message.error(res.msg)
|
||||
}
|
||||
this.selectedRowKeys = []
|
||||
_this.selectedRowKeys = []
|
||||
// 删除结束
|
||||
this.deleteVisible = false
|
||||
this.deleteLoading = false
|
||||
_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
|
||||
onCancel() {
|
||||
}
|
||||
})
|
||||
},
|
||||
|
||||
},
|
||||
watch: {
|
||||
/*
|
||||
|
@ -18,235 +18,71 @@
|
||||
|
||||
<a-row>
|
||||
<a-col :span='10'>
|
||||
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='所属地区'>
|
||||
<a-select v-decorator="['tenantId', {rules: [{ required: true, message: '请选择所属地区' }]}]"
|
||||
@change='selectTenant'
|
||||
:disabled='tenantEnable'>
|
||||
<a-select-option v-for='item in tenantList' :key='item.id'>{{ item.name }}</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="['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-form-item label='所属楼层' :labelCol='labelCol' :wrapperCol='wrapperCol'>
|
||||
<a-select v-decorator="['floor',{rules: [{ required: true, message: '选择所属楼层' }]}]"
|
||||
placeholder='所属楼层'>
|
||||
<a-select-option v-for='item in typeList' :value='item.value'>
|
||||
{{ item.text }}
|
||||
</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="['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-form-item label='会议室名称' :labelCol='labelCol' :wrapperCol='wrapperCol'>
|
||||
<a-input placeholder='会议室名称'
|
||||
v-decorator="['meetingName',{rules: [{ required: true, message: '输入会议室名称' }]}]" />
|
||||
v-decorator="['name',{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="['type',{rules: [{ required: true, message: '输入会议室类型' }]}]"
|
||||
placeholder='会议室类型'>
|
||||
<a-select-option :value='1'>
|
||||
会议室
|
||||
</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-form-item label='会议室形式' :labelCol='labelCol' :wrapperCol='wrapperCol'>
|
||||
<a-select v-decorator="['typeName',{rules: [{ required: true, message: '选择会议室形式' }]}]"
|
||||
placeholder='会议室形式'>
|
||||
<a-select-option v-for='item in shapeList' :value='item.value'>
|
||||
{{ item.text }}
|
||||
</a-select-option>
|
||||
</a-select>
|
||||
</a-form-item>
|
||||
</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-col :span='10'>
|
||||
<a-form-item label='会议室面积' :labelCol='labelCol' :wrapperCol='wrapperCol'>
|
||||
<a-input placeholder='会议室面积'
|
||||
v-decorator="['area',{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="['capacityNum',{rules: [{ required: true, message: '输入容纳人数' }]}]" />
|
||||
</a-form-item>
|
||||
</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-col :span='10'>
|
||||
<a-form-item label='起租时长' :labelCol='labelCol' :wrapperCol='wrapperCol'>
|
||||
<a-input placeholder='起租时长'
|
||||
v-decorator="['duration',{rules: [{ required: true, message: '请输入起租时长'}]}]" />
|
||||
<a-form-item label='会议室设备' :labelCol='labelCol' :wrapperCol='wrapperCol'>
|
||||
<a-checkbox-group :defaultValue='defaultCheckedList'
|
||||
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-select v-decorator="['isShow',{rules: [{ required: true, message: '请选择是否启用'}]}]"
|
||||
<a-select v-decorator="['enable',{rules: [{ required: true, message: '请选择是否启用'}]}]"
|
||||
placeholder='是否启用'>
|
||||
<a-select-option :value='0'>
|
||||
是
|
||||
@ -259,12 +95,6 @@
|
||||
</a-col>
|
||||
</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-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='会议室描述 '>
|
||||
<a-textarea placeholder='会议室描述 ' v-decorator="['content']" style='height: 100px' />
|
||||
@ -275,7 +105,7 @@
|
||||
<a-col :span='10'>
|
||||
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='室内图片'>
|
||||
<a-upload
|
||||
v-decorator="['indoorPicUrl', {rules: [{ required: true, message: '上传室内图片' }]}]"
|
||||
v-decorator="['files', {rules: [{ required: true, message: '上传室内图片' }]}]"
|
||||
list-type='picture-card'
|
||||
class='avatar-uploader'
|
||||
:file-list='fileList'
|
||||
@ -303,7 +133,7 @@
|
||||
import {
|
||||
saveRoomContent,
|
||||
getRoomListByFloorId,
|
||||
selectRoomById
|
||||
selectRoomById, getMeetingDict, getRoomInfo
|
||||
} from '@/api/admin/meeting/roomContent'
|
||||
import pick from 'lodash.pick'
|
||||
import storage from 'store'
|
||||
@ -326,7 +156,8 @@ export default {
|
||||
xs: { span: 24 },
|
||||
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: '',
|
||||
headers: {
|
||||
Authorization: 'Bearer ' + storage.get(ACCESS_TOKEN)
|
||||
@ -341,11 +172,17 @@ export default {
|
||||
typeData: [],
|
||||
form: this.$form.createForm(this),
|
||||
userDetail: {},
|
||||
tenantList: [], // 地区
|
||||
parkList: [], // 园区
|
||||
buildingList: [], // 楼宇
|
||||
buildingDetailList: [], // 楼层
|
||||
roomList: [], // 房间
|
||||
typeList: [],
|
||||
shapeList: [],
|
||||
deviceList: [],
|
||||
typeMap: {},
|
||||
shapeMap: {},
|
||||
deviceMap: {},
|
||||
// tenantList: [], // 地区
|
||||
// parkList: [], // 园区
|
||||
// buildingList: [], // 楼宇
|
||||
// buildingDetailList: [], // 楼层
|
||||
// roomList: [], // 房间
|
||||
tenantEnable: false,
|
||||
parkEnable: false,
|
||||
previewVisible: false,
|
||||
@ -359,152 +196,85 @@ export default {
|
||||
|
||||
},
|
||||
mounted() {
|
||||
this.getDict()
|
||||
},
|
||||
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
|
||||
})
|
||||
},
|
||||
// 获取用户详细信息
|
||||
getUserDetail() {
|
||||
getInfo().then(res => {
|
||||
console.log('getUserDetail', res)
|
||||
this.userDetail = res
|
||||
// 园区:5
|
||||
if (this.userDetail.roleIds && this.userDetail.roleIds.length > 0 && this.userDetail.roleIds[0] == 5) {
|
||||
//
|
||||
// 判断:是新增就查询园区
|
||||
let { id } = this.mdl
|
||||
if (!id) {
|
||||
// 选择地区 -> 查询园区
|
||||
this.selectTenant(this.userDetail.tenantId)
|
||||
// 选择园区 -> 查询楼宇
|
||||
this.selectPark(this.userDetail.parkId)
|
||||
}
|
||||
//
|
||||
// 不可编辑
|
||||
this.tenantEnable = true
|
||||
this.parkEnable = true
|
||||
// 关联地区和园区
|
||||
this.mdl.parkId = this.userDetail.parkId
|
||||
this.mdl.tenantId = this.userDetail.tenantId
|
||||
this.form.setFieldsValue({
|
||||
parkId: this.mdl.parkId,
|
||||
tenantId: this.mdl.tenantId
|
||||
// if (this.userDetail.roleIds && this.userDetail.roleIds.length > 0 && this.userDetail.roleIds[0] == 5) {
|
||||
// //
|
||||
// // 判断:是新增就查询园区
|
||||
// let { id } = this.mdl
|
||||
// if (!id) {
|
||||
// // 选择地区 -> 查询园区
|
||||
// this.selectTenant(this.userDetail.tenantId)
|
||||
// // 选择园区 -> 查询楼宇
|
||||
// this.selectPark(this.userDetail.parkId)
|
||||
// }
|
||||
// //
|
||||
// // 不可编辑
|
||||
// this.tenantEnable = true
|
||||
// this.parkEnable = true
|
||||
// // 关联地区和园区
|
||||
// this.mdl.parkId = this.userDetail.parkId
|
||||
// this.mdl.tenantId = this.userDetail.tenantId
|
||||
// this.form.setFieldsValue({
|
||||
// parkId: this.mdl.parkId,
|
||||
// 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,
|
||||
//
|
||||
@ -525,108 +295,123 @@ export default {
|
||||
add() {
|
||||
this.form.resetFields()
|
||||
this.mdl = {}
|
||||
this.edit({ id: 0 })
|
||||
},
|
||||
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
|
||||
},
|
||||
edit(id) {
|
||||
this.form.resetFields()
|
||||
this.mdl = {}
|
||||
this.fileList = []
|
||||
getRoomInfo({ roomId: id }).then((res) => {
|
||||
let deviceStr = res.room.device
|
||||
if (deviceStr != '') {
|
||||
deviceStr = deviceStr.replaceAll(' ', '')
|
||||
let deviceArr = deviceStr.split('#')
|
||||
if (deviceArr[0] == '') {
|
||||
deviceArr.shift()
|
||||
}
|
||||
//
|
||||
res.room.device = deviceArr
|
||||
}
|
||||
this.mdl = Object.assign(this.mdl, res.room)
|
||||
|
||||
this.visible = true
|
||||
this.$nextTick(() => {
|
||||
this.form.setFieldsValue(
|
||||
pick(
|
||||
this.mdl,
|
||||
'id',
|
||||
'type',
|
||||
'meetingName',
|
||||
'device',
|
||||
'typeName',
|
||||
'name',
|
||||
'capacityNum',
|
||||
'expandNum',
|
||||
'indoorPicUrl',
|
||||
'floor',
|
||||
'files',
|
||||
'startTime',
|
||||
'endDate',
|
||||
'money',
|
||||
'isShow',
|
||||
'shape',
|
||||
'area',
|
||||
'address',
|
||||
'headName',
|
||||
'headPhone',
|
||||
'isTicket',
|
||||
'isToll',
|
||||
'money',
|
||||
'remake',
|
||||
'duration',
|
||||
'enable',
|
||||
'typeName',
|
||||
'content',
|
||||
'tenantId',
|
||||
'parkId',
|
||||
'buildingId',
|
||||
'buildId',
|
||||
'roomId'
|
||||
'area',
|
||||
'roomNum'
|
||||
)
|
||||
)
|
||||
})
|
||||
// 图片
|
||||
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) {
|
||||
e.preventDefault()
|
||||
this.form.validateFields((err, values) => {
|
||||
if (!err) {
|
||||
console.log('Received values of form: ', values)
|
||||
this.confirmLoading = true
|
||||
const indoorPicUrl = []
|
||||
this.confirmLoading = false
|
||||
|
||||
// const indoorPicUrl = []
|
||||
const files = []
|
||||
|
||||
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
|
||||
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)
|
||||
values.files = files
|
||||
let deviceArr = values.device
|
||||
let deviceStr = ''
|
||||
for (let key in deviceArr) {
|
||||
let eachObj = deviceArr[key]
|
||||
deviceStr += '#' + eachObj + ' '
|
||||
}
|
||||
values.device = deviceStr
|
||||
values.floorId = this.typeMap[values.floor]
|
||||
values.typeId = this.shapeMap[values.typeName]
|
||||
|
||||
saveRoomContent(values)
|
||||
.then((res) => {
|
||||
if (res.code === 0) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user