mirror of
https://gitee.com/elegant_wings/dbd-meeting-html.git
synced 2025-06-21 03:19:36 +08:00
描述:展厅管理增加 地区、园区、楼宇、楼层
This commit is contained in:
parent
22aced73cd
commit
b50b1f32f3
@ -334,8 +334,7 @@ export default {
|
|||||||
parkList: [], // 园区
|
parkList: [], // 园区
|
||||||
buildingList: [], // 楼宇
|
buildingList: [], // 楼宇
|
||||||
buildingDetailList: [], // 楼层
|
buildingDetailList: [], // 楼层
|
||||||
floorList: [],
|
roomList: [], // 房间
|
||||||
roomList: [],
|
|
||||||
tenantEnable: false,
|
tenantEnable: false,
|
||||||
parkEnable: false
|
parkEnable: false
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
<a-modal
|
<a-modal
|
||||||
title='操作'
|
title='操作'
|
||||||
style='top: 20px;'
|
style='top: 20px;'
|
||||||
:width='1000'
|
:width='1200'
|
||||||
v-model='visible'
|
v-model='visible'
|
||||||
:confirmLoading='confirmLoading'
|
:confirmLoading='confirmLoading'
|
||||||
@ok='handleSubmit'
|
@ok='handleSubmit'
|
||||||
@ -14,53 +14,79 @@
|
|||||||
<a-form-item style='display:none'>
|
<a-form-item style='display:none'>
|
||||||
<a-input v-decorator="['version']" />
|
<a-input v-decorator="['version']" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
|
|
||||||
|
|
||||||
<a-row>
|
<a-row>
|
||||||
<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-input placeholder='所属建筑' v-decorator="['build']" disabled='disabled' defaultValue='创智大厦' />
|
<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-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 :labelCol='labelCol' :wrapperCol='wrapperCol' label='所属园区'>
|
||||||
<a-input placeholder='展厅名称'
|
<a-select v-decorator="['parkId', {rules: [{ required: true, message: '请选择所属园区' }]}]"
|
||||||
v-decorator="['meetingName',{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-form-item>
|
||||||
</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-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-col :span='10'>
|
||||||
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='所属楼层'>
|
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='所属楼层'>
|
||||||
<a-select v-decorator="['buildId',{rules: [{ required: true, message: '请选择所属楼层' }]}]"
|
<a-select v-decorator="['buildId',{rules: [{ required: true, message: '请选择所属楼层' }]}]"
|
||||||
placeholder='所属楼层'
|
placeholder='所属楼层'
|
||||||
@change='getRoomList'>
|
@change='selectBuildingDetail'>
|
||||||
<a-select-option v-for='item in floorList' :key='item.id' :value='item.id'>
|
<a-select-option v-for='item in buildingDetailList' :key='item.id' :value='item.id'>
|
||||||
{{ item.floorName }}
|
{{ 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-col :span='10'>
|
||||||
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='所属房间'>
|
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='所属房间'>
|
||||||
<a-select v-decorator="['roomId',{rules: [{ required: true, message: '选择所属房间' }]}]"
|
<a-select v-decorator="['roomId',{rules: [{ required: true, message: '选择所属房间' }]}]"
|
||||||
placeholder='所属房间'
|
placeholder='所属房间'
|
||||||
@change='getArea'>
|
@change='selectRoom'>
|
||||||
<a-select-option v-for='item in roomList' :key='item.id' :value='item.id'>
|
<a-select-option v-for='item in roomList' :key='item.id' :value='item.id'>
|
||||||
{{ item.name }}
|
{{ item.name }}
|
||||||
</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-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="['area',{rules: [{ required: true, message: '请输入会议面积' }]}]"
|
v-decorator="['area',{rules: [{ required: true, message: '请输入会议室面积' }]}]"
|
||||||
disabled='disabled' />
|
disabled='disabled' />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-col>
|
</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: '输入会议名称' }]}]" />
|
||||||
|
</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='容纳人数'
|
||||||
@ -138,7 +164,7 @@
|
|||||||
</a-row>
|
</a-row>
|
||||||
<a-row>
|
<a-row>
|
||||||
<a-col :span='10'>
|
<a-col :span='10'>
|
||||||
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='室内图片url'>
|
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='室内图片'>
|
||||||
<!-- <a-input placeholder="室内图片url" v-decorator="['indoorPicUrl']" />-->
|
<!-- <a-input placeholder="室内图片url" v-decorator="['indoorPicUrl']" />-->
|
||||||
<a-upload
|
<a-upload
|
||||||
v-decorator="['indoorPicUrl']"
|
v-decorator="['indoorPicUrl']"
|
||||||
@ -164,15 +190,16 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import { saveShowroom, get } from '@/api/admin/meeting/showroom'
|
import { saveShowroom, get } from '@/api/admin/meeting/showroom'
|
||||||
import {
|
|
||||||
getFloorList,
|
|
||||||
getRoomListByFloorId,
|
|
||||||
selectRoomById
|
|
||||||
} from '@/api/admin/meeting/roomContent'
|
|
||||||
import pick from 'lodash.pick'
|
import pick from 'lodash.pick'
|
||||||
import moment from 'moment'
|
import moment from 'moment'
|
||||||
import storage from 'store'
|
import storage from 'store'
|
||||||
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
import { ACCESS_TOKEN } from '@/store/mutation-types'
|
||||||
|
import { getInfo } from '@/api/login'
|
||||||
|
import { getTenantList } from '@/api/tenant'
|
||||||
|
import { getParkList } from '@/api/admin/park'
|
||||||
|
import { getBuildingList } from '@/api/admin/building'
|
||||||
|
import { getBuildingDetailList } from '@/api/admin/buildingDetail'
|
||||||
|
import { getRoomListByFloorId, selectRoomById } from '@/api/admin/meeting/roomContent'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'ShowroomModal',
|
name: 'ShowroomModal',
|
||||||
@ -186,7 +213,7 @@ export default {
|
|||||||
visible: false,
|
visible: false,
|
||||||
labelCol: {
|
labelCol: {
|
||||||
xs: { span: 24 },
|
xs: { span: 24 },
|
||||||
sm: { span: 5 }
|
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',
|
||||||
imageUrl: '',
|
imageUrl: '',
|
||||||
@ -201,8 +228,15 @@ export default {
|
|||||||
mdl: {},
|
mdl: {},
|
||||||
floorList: [],
|
floorList: [],
|
||||||
|
|
||||||
roomList: [],
|
form: this.$form.createForm(this),
|
||||||
form: this.$form.createForm(this)
|
userDetail: {},
|
||||||
|
tenantList: [], // 地区
|
||||||
|
parkList: [], // 园区
|
||||||
|
buildingList: [], // 楼宇
|
||||||
|
buildingDetailList: [], // 楼层
|
||||||
|
roomList: [], // 房间
|
||||||
|
tenantEnable: false,
|
||||||
|
parkEnable: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeCreate() {
|
beforeCreate() {
|
||||||
@ -210,6 +244,147 @@ export default {
|
|||||||
created() {
|
created() {
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
|
// 获取用户详细信息
|
||||||
|
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
|
||||||
|
})
|
||||||
|
}
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 查询地区
|
||||||
|
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
|
||||||
|
})
|
||||||
|
})
|
||||||
|
},
|
||||||
moment,
|
moment,
|
||||||
|
|
||||||
beforeUpload(file) {
|
beforeUpload(file) {
|
||||||
@ -245,54 +420,58 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|
||||||
getArea(value) {
|
|
||||||
let param = {
|
|
||||||
'id': value
|
|
||||||
}
|
|
||||||
selectRoomById(param).then((res) => {
|
|
||||||
this.form.setFieldsValue({
|
|
||||||
area: res.data.area
|
|
||||||
})
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getFloorList() {
|
|
||||||
getFloorList().then((res) => {
|
|
||||||
this.floorList = res.data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
getRoomList(value) {
|
|
||||||
let param = {
|
|
||||||
'buildingDetailId': value
|
|
||||||
}
|
|
||||||
getRoomListByFloorId(param).then((res) => {
|
|
||||||
this.roomList = res.data
|
|
||||||
})
|
|
||||||
},
|
|
||||||
add() {
|
add() {
|
||||||
this.form.resetFields()
|
this.form.resetFields()
|
||||||
this.edit({ id: 0 })
|
this.edit({ id: 0 })
|
||||||
},
|
},
|
||||||
edit(record) {
|
edit(record) {
|
||||||
this.mdl = Object.assign(record)
|
this.mdl = Object.assign(record)
|
||||||
console.log('this.mdl.indoorPicUrl' , this.mdl.indoorPicUrl)
|
let copyMdl = JSON.parse(JSON.stringify(this.mdl))
|
||||||
|
// 查询地区
|
||||||
|
this.getTenantData()
|
||||||
|
//
|
||||||
|
if (record.id) { // 编辑
|
||||||
|
// 选择地区 -> 查询园区
|
||||||
|
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) {
|
if (this.mdl.indoorPicUrl) {
|
||||||
this.imageUrl = process.env.VUE_APP_API_BASE_URL + this.mdl.indoorPicUrl
|
this.imageUrl = process.env.VUE_APP_API_BASE_URL + this.mdl.indoorPicUrl
|
||||||
|
} else {
|
||||||
|
this.imageUrl = ''
|
||||||
}
|
}
|
||||||
this.visible = true
|
this.visible = true
|
||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.form.setFieldsValue(pick(this.mdl, 'id', 'showroomCode', 'meetingName', 'capacityNum', 'expandNum', 'buildId', 'indoorPicUrl', 'address', 'startTime', 'endDate', 'isShow', 'headName', 'headPhone', 'content', 'createBy', 'createTime', 'updateBy', 'updateTime', 'version', 'deleteFlag', 'roomId', 'area'))
|
this.form.setFieldsValue(pick(this.mdl, 'id', 'showroomCode', 'meetingName', 'capacityNum', 'expandNum',
|
||||||
})
|
'indoorPicUrl', 'address', 'startTime', 'endDate', 'isShow',
|
||||||
get(record.id).then(res => {
|
'headName', 'headPhone', 'content', 'createBy', 'createTime',
|
||||||
let param = {
|
'updateBy', 'updateTime', 'version', 'deleteFlag',
|
||||||
'buildingDetailId': res.buildId
|
'tenantId', 'parkId', 'buildingId', 'buildId', 'roomId', 'area'))
|
||||||
}
|
|
||||||
getRoomListByFloorId(param).then((res) => {
|
|
||||||
this.roomList = res.data
|
|
||||||
})
|
|
||||||
this.form.setFieldsValue({})
|
|
||||||
|
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
handleSubmit(e) {
|
handleSubmit(e) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user