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: [], // 园区
|
||||
buildingList: [], // 楼宇
|
||||
buildingDetailList: [], // 楼层
|
||||
floorList: [],
|
||||
roomList: [],
|
||||
roomList: [], // 房间
|
||||
tenantEnable: false,
|
||||
parkEnable: false
|
||||
}
|
||||
|
@ -2,7 +2,7 @@
|
||||
<a-modal
|
||||
title='操作'
|
||||
style='top: 20px;'
|
||||
:width='1000'
|
||||
:width='1200'
|
||||
v-model='visible'
|
||||
:confirmLoading='confirmLoading'
|
||||
@ok='handleSubmit'
|
||||
@ -14,53 +14,79 @@
|
||||
<a-form-item style='display:none'>
|
||||
<a-input v-decorator="['version']" />
|
||||
</a-form-item>
|
||||
|
||||
|
||||
<a-row>
|
||||
<a-col :span='10'>
|
||||
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='所属建筑'>
|
||||
<a-input placeholder='所属建筑' v-decorator="['build']" disabled='disabled' defaultValue='创智大厦' />
|
||||
<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 label='展厅名称' :labelCol='labelCol' :wrapperCol='wrapperCol'>
|
||||
<a-input placeholder='展厅名称'
|
||||
v-decorator="['meetingName',{rules: [{ required: true, message: '输入会议名称' }]}]" />
|
||||
<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='getRoomList'>
|
||||
<a-select-option v-for='item in floorList' :key='item.id' :value='item.id'>
|
||||
@change='selectBuildingDetail'>
|
||||
<a-select-option v-for='item in buildingDetailList' :key='item.id' :value='item.id'>
|
||||
{{ item.floorName }}
|
||||
</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='getArea'>
|
||||
@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-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 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: '输入会议名称' }]}]" />
|
||||
</a-form-item>
|
||||
</a-col>
|
||||
<a-col :span='10'>
|
||||
<a-form-item label='容纳人数' :labelCol='labelCol' :wrapperCol='wrapperCol'>
|
||||
<a-input placeholder='容纳人数'
|
||||
@ -138,7 +164,7 @@
|
||||
</a-row>
|
||||
<a-row>
|
||||
<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-upload
|
||||
v-decorator="['indoorPicUrl']"
|
||||
@ -164,15 +190,16 @@
|
||||
</template>
|
||||
<script>
|
||||
import { saveShowroom, get } from '@/api/admin/meeting/showroom'
|
||||
import {
|
||||
getFloorList,
|
||||
getRoomListByFloorId,
|
||||
selectRoomById
|
||||
} from '@/api/admin/meeting/roomContent'
|
||||
import pick from 'lodash.pick'
|
||||
import moment from 'moment'
|
||||
import storage from 'store'
|
||||
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 {
|
||||
name: 'ShowroomModal',
|
||||
@ -186,7 +213,7 @@ export default {
|
||||
visible: false,
|
||||
labelCol: {
|
||||
xs: { span: 24 },
|
||||
sm: { span: 5 }
|
||||
sm: { span: 8 }
|
||||
},
|
||||
uploadUrl: process.env.VUE_APP_API_BASE_URL + '/api/dfs/upload',
|
||||
imageUrl: '',
|
||||
@ -201,8 +228,15 @@ export default {
|
||||
mdl: {},
|
||||
floorList: [],
|
||||
|
||||
roomList: [],
|
||||
form: this.$form.createForm(this)
|
||||
form: this.$form.createForm(this),
|
||||
userDetail: {},
|
||||
tenantList: [], // 地区
|
||||
parkList: [], // 园区
|
||||
buildingList: [], // 楼宇
|
||||
buildingDetailList: [], // 楼层
|
||||
roomList: [], // 房间
|
||||
tenantEnable: false,
|
||||
parkEnable: false
|
||||
}
|
||||
},
|
||||
beforeCreate() {
|
||||
@ -210,6 +244,147 @@ export default {
|
||||
created() {
|
||||
},
|
||||
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,
|
||||
|
||||
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() {
|
||||
this.form.resetFields()
|
||||
this.edit({ id: 0 })
|
||||
},
|
||||
edit(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) {
|
||||
this.imageUrl = process.env.VUE_APP_API_BASE_URL + this.mdl.indoorPicUrl
|
||||
} else {
|
||||
this.imageUrl = ''
|
||||
}
|
||||
this.visible = true
|
||||
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'))
|
||||
})
|
||||
get(record.id).then(res => {
|
||||
let param = {
|
||||
'buildingDetailId': res.buildId
|
||||
}
|
||||
getRoomListByFloorId(param).then((res) => {
|
||||
this.roomList = res.data
|
||||
})
|
||||
this.form.setFieldsValue({})
|
||||
|
||||
this.form.setFieldsValue(pick(this.mdl, 'id', 'showroomCode', 'meetingName', 'capacityNum', 'expandNum',
|
||||
'indoorPicUrl', 'address', 'startTime', 'endDate', 'isShow',
|
||||
'headName', 'headPhone', 'content', 'createBy', 'createTime',
|
||||
'updateBy', 'updateTime', 'version', 'deleteFlag',
|
||||
'tenantId', 'parkId', 'buildingId', 'buildId', 'roomId', 'area'))
|
||||
})
|
||||
},
|
||||
handleSubmit(e) {
|
||||
|
Loading…
x
Reference in New Issue
Block a user