Merge remote-tracking branch 'origin/master' into master

This commit is contained in:
chendaze 2024-04-04 16:24:30 +08:00
commit b1bd8b5faf
4 changed files with 418 additions and 84 deletions

View File

@ -28,11 +28,11 @@ export function get (id) {
})
}
export function roomContentList () {
export function roomContentList (params) {
return axios({
url: '/meeting/roomContent/roomContentList',
method: 'get',
params: {}
params: params
})
}

View File

@ -12,15 +12,39 @@
<a-form-model :model='form' :label-col='labelCol' :wrapper-col='wrapperCol'>
<a-row>
<a-col :span='10'>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='会议主题'>
{{ form.title }}
<a-form-item label='地区' :labelCol='labelCol' :wrapperCol='wrapperCol'>
{{ form.tenantName }}
</a-form-item>
</a-col>
<a-col :span='10'>
<a-form-item label='园区' :labelCol='labelCol' :wrapperCol='wrapperCol'>
{{ form.roomContent.parkName }}
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span='10'>
<a-form-item label='楼宇' :labelCol='labelCol' :wrapperCol='wrapperCol'>
{{ form.buildingName }}
</a-form-item>
</a-col>
<a-col :span='10'>
<a-form-item label='楼层' :labelCol='labelCol' :wrapperCol='wrapperCol'>
{{ form.roomContent.buildName }}
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span='10'>
<a-form-item label='会议室名称' :labelCol='labelCol' :wrapperCol='wrapperCol'>
{{ form.roomContent.meetingName }}
</a-form-item>
</a-col>
<a-col :span='10'>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='会议主题'>
{{ form.title }}
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span='10'>

View File

@ -16,24 +16,82 @@
</a-form-item>
<div style='display: flex;margin-bottom: 20px'>
<span style='width: 20px;display: block;font-size: 25px;color: #1890ff;font-weight: bold;'>|</span>
<span style='display: block;margin-top: 11px;font-size: 15px'>新增设备</span>
<span style='display: block;margin-top: 11px;font-size: 15px'>设备管理</span>
</div>
<a-row>
<a-col :span='11'>
<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='11'>
<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='11'>
<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='11'>
<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>
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span='11'>
<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-row>
<a-row>
<a-col :span='11'>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='设备编号'>
<a-input placeholder='设备编号' v-decorator="['equipmentNum', {rules: [{required: true, message: '请输入设备编号'}]}]" />
<a-input placeholder='设备编号'
v-decorator="['equipmentNum', {rules: [{required: true, message: '请输入设备编号'}]}]" />
</a-form-item>
</a-col>
<a-col :span='11'>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='设备名称'>
<a-input placeholder='设备名称' v-decorator="['equipmentName',{rules: [{required: true, message: '请输入设备名称'}]}]" />
<a-input placeholder='设备名称'
v-decorator="['equipmentName',{rules: [{required: true, message: '请输入设备名称'}]}]" />
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span='11'>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='设备类型'>
<a-select v-decorator="['type',{rules: [{ required: true, message: '请选择设备类型'}]}]" placeholder='请选择设备类型'>
<a-select v-decorator="['type',{rules: [{ required: true, message: '请选择设备类型'}]}]"
placeholder='请选择设备类型'>
<a-select-option :value='0'>
门禁
</a-select-option>
@ -49,32 +107,11 @@
</a-form-item>
</a-col>
</a-row>
<a-row>
<a-col :span='11'>
<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' >
{{ item.floorName }}
</a-select-option>
</a-select>
</a-form-item>
</a-col>
<a-col :span='11'>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='存放地点'>
<a-select v-decorator="['roomId']" placeholder='所属房间'
>
<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='11'>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='设备状态'>
<a-select v-decorator="['status',{rules: [{ required: true, message: '请选择设备状态'}]}]" placeholder='请选择设备状态'>
<a-select v-decorator="['status',{rules: [{ required: true, message: '请选择设备状态'}]}]"
placeholder='请选择设备状态'>
<a-select-option :value='0'>
开启
</a-select-option>
@ -130,9 +167,14 @@
<script>
import { saveEquipment, get, recordByDeviceId, getRoomList } from '@/api/admin/meeting/equipment'
import pick from 'lodash.pick'
import { getFloorList } from '@/api/admin/meeting/roomContent'
import { getFloorList, getRoomListByFloorId } from '@/api/admin/meeting/roomContent'
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'
export default {
name: 'EquipmentModal',
@ -159,8 +201,6 @@ export default {
confirmLoading: false,
mdl: {},
form: this.$form.createForm(this),
floorList: [],
roomList: [],
columns: [
{
title: '开门时间',
@ -168,34 +208,145 @@ export default {
},
{
title: '开门方式',
dataIndex: 'type',
dataIndex: 'type'
},
{
title: '开门人',
dataIndex: 'userName'
},
}
],
//
userDetail: {},
tenantList: [], //
parkList: [], //
buildingList: [], //
buildingDetailList: [], //
roomList: [], //
tenantEnable: false,
parkEnable: false
}
},
beforeCreate() {
},
created() {
this.getFloorList()
},
methods: {
getFloorList() {
getFloorList().then((res) => {
this.floorList = res.data
//
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
})
}
})
},
getRoomList(value) {
getRoomList({ 'buildingDetailId': value, }).then((res) => {
//
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.form.setFieldsValue({
parkId: null, //
buildingId: null, //
buildId: null, //
roomId: 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.form.setFieldsValue({
buildingId: null, //
buildId: null, //
roomId: null //
})
//
getBuildingList({
parkId: id
}).then(res => {
this.buildingList = res.rows
})
},
// ->
selectBuilding(id) {
//
this.mdl.buildId = null //
this.mdl.roomId = null //
this.form.setFieldsValue({
buildId: null, //
roomId: null //
})
//
getBuildingDetailList({
buildingId: id
}).then(res => {
this.buildingDetailList = res.rows
})
},
// ->
selectBuildingDetail(buildingDetailId) {
//
this.getRoomListByFloorIdMethod(buildingDetailId)
},
//
getRoomListByFloorIdMethod(buildingDetailId, id) {
//
this.mdl.roomId = null //
this.form.setFieldsValue({
roomId: null //
})
//
getRoomListByFloorId({
'id': id,
'buildingDetailId': buildingDetailId
}).then((res) => {
this.roomList = res.data
})
},
//
beforeUpload(file) {
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'
if (!isJpgOrPng) {
@ -234,32 +385,53 @@ export default {
this.edit({ id: 0 })
},
edit(record) {
if (record.id != 0){
get(record.id).then((res) => {
this.form.setFieldsValue({
})
})
//
this.getTenantData()
//
this.mdl = Object.assign(this.mdl, record)
let copyMdl = JSON.parse(JSON.stringify(this.mdl))
//
this.getUserDetail()
//
if (record.id) {
//
recordByDeviceId(record.id).then(res => {
this.loadData = res.data
})
// ->
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))
}
this.mdl = Object.assign(record)
if (this.mdl.pic) {
this.imageUrl = process.env.VUE_APP_API_BASE_URL + this.mdl.pic
} else {
this.imageUrl = ''
}
getRoomList({ 'buildingDetailId': this.mdl.buildId, }).then((res) => {
this.roomList = res.data
})
//
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.mdl, 'id', 'type', 'equipmentName', 'status', 'createDate', 'equipmentNum','buildId','ip','roomId', 'pic', 'deleteFlag', 'createBy', 'createTime', 'updateBy', 'updateTime'))
this.form.setFieldsValue(pick(this.mdl, 'id', 'type', 'equipmentName', 'status', 'createDate',
'equipmentNum', 'ip', 'tenantId', 'parkId', 'buildingId', 'buildId', 'roomId', 'pic',
'deleteFlag', 'createBy', 'createTime', 'updateBy', 'updateTime'))
})
},
handleSubmit(e) {

View File

@ -36,6 +36,29 @@
v-decorator="['endDate', {rules: [{required: true, message: '请选择结束时间'}]}]"
placeholder='结束时间' />
</a-form-item>
<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-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-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-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='会议室'>
<a-select v-decorator="['roomContentId',{rules: [{ required: true, message: '请选择会议室' }]}]"
placeholder='请选择会议室'>
@ -55,6 +78,11 @@ import { saveReservation, get, roomContentList } from '@/api/admin/meeting/reser
import pick from 'lodash.pick'
import moment from 'moment'
import { selectRoomById } from '@/api/admin/meeting/roomContent'
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'
export default {
name: 'ReservationModal',
@ -74,44 +102,154 @@ export default {
confirmLoading: false,
mdl: {},
form: this.$form.createForm(this),
roomContentList: []
tenantList: [], //
parkList: [], //
buildingList: [], //
roomContentList: [], //
tenantEnable: false,
parkEnable: false
}
},
beforeCreate() {
},
created() {
this.getRoomContentDataList()
//
this.getTenantData()
},
methods: {
moment,
onRangeChangeSign() {
//
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
})
}
})
},
getRoomContentDataList() {
roomContentList().then(res => {
//
getTenantData() {
getTenantList().then(res => {
this.tenantList = res.rows
})
},
// ->
selectTenant(id) {
console.log('selectTenant', id)
//
this.mdl.parkId = null //
this.mdl.buildingId = null //
this.mdl.roomContentId = null //
this.form.setFieldsValue({
parkId: null, //
buildingId: null, //
roomContentId: null //
})
//
getParkList({
tenantId: id
}).then(res => {
this.parkList = res.rows
})
},
// ->
selectPark(id) {
//
this.mdl.buildingId = null //
this.mdl.roomContentId = null //
this.form.setFieldsValue({
buildingId: null, //
roomContentId: null //
})
//
getBuildingList({
parkId: id
}).then(res => {
this.buildingList = res.rows
})
},
// ->
selectBuilding(id) {
//
this.mdl.roomContentId = null //
this.form.setFieldsValue({
roomContentId: null //
})
roomContentList({
buildingId: id
}).then(res => {
console.log('roomContentList', res)
this.roomContentList = res.data
})
},
moment,
onRangeChangeSign() {
},
add() {
this.form.resetFields()
this.edit({ id: 0 })
},
edit(record) {
this.mdl = Object.assign(record)
this.mdl = Object.assign(this.mdl, record)
let copyMdl = JSON.parse(JSON.stringify(this.mdl))
//
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)
}
//
this.mdl = JSON.parse(JSON.stringify(copyMdl))
} else { //
}
//
this.getUserDetail()
this.visible = true
this.$nextTick(() => {
this.form.setFieldsValue(pick(this.mdl, 'id', 'roomContentId', 'userId', 'ticketId', 'customerId', 'title', 'stauts', 'isAfterSale', 'oderNumber', 'orderMoney', 'cancelTime', 'cancelResaon', 'visitType', 'explainNeedType', 'meetingNeedType', 'meetingId', 'photographType', 'startTime', 'endTime', 'deleteFlag', 'createBy', 'createTime', 'updateBy', 'updateTime', 'remake'))
this.form.setFieldsValue(pick(this.mdl, 'id', 'tenantId', 'parkId', 'buildingId', 'roomContentId', 'userId', 'ticketId', 'customerId',
'title', 'stauts', 'isAfterSale', 'oderNumber', 'orderMoney', 'cancelTime', 'cancelResaon',
'visitType', 'explainNeedType', 'meetingNeedType', 'meetingId', 'photographType',
'startTime', 'endTime', 'endDate', 'deleteFlag', 'createBy', 'createTime', 'updateBy', 'updateTime', 'remake'))
})
if (record.id !== 0){
get(record.id).then(res => {
this.form.setFieldsValue({
endDate: res.endDate,
duration: res.duration
})
})
}
},
handleSubmit(e) {