描述:展厅

This commit is contained in:
SelfRidicule 2024-04-04 18:00:33 +08:00
parent 0ae23b4e85
commit debd83f551
2 changed files with 273 additions and 106 deletions

View File

@ -39,4 +39,13 @@ export function delShowroom (parameter) {
}) })
} }
export function showroomListRq (parameter) {
return axios({
url: api.showroom + '/showroomList',
method: 'get',
params: parameter
})
}
export const showroomExport = api.showroom + '/export' export const showroomExport = api.showroom + '/export'

View File

@ -1,77 +1,109 @@
<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 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-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="主题">
<a-input placeholder="展厅主题" v-decorator="['title',{rules: [{ required: true, message: '主题'}]}]"/> <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>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="预约开始时间"> <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="['showroomId',{rules: [{ required: true, message: '请选择展厅' }]}]"
placeholder='请选择展厅'>
<a-select-option v-for='item in showRoomList' :key='item.id' :value='item.id'>
{{ item.meetingName }}
</a-select-option>
</a-select>
</a-form-item>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='主题'>
<a-input placeholder='展厅主题' v-decorator="['title',{rules: [{ required: true, message: '主题'}]}]" />
</a-form-item>
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='预约开始时间'>
<a-date-picker <a-date-picker
format='YYYY-MM-DD HH:mm:ss' format='YYYY-MM-DD HH:mm:ss'
valueFormat='YYYY-MM-DD HH:mm:ss' valueFormat='YYYY-MM-DD HH:mm:ss'
v-decorator="['startTime',{rules: [{ required: true, message: '预约开始时间'}]}]" v-decorator="['startTime',{rules: [{ required: true, message: '预约开始时间'}]}]"
:show-time="{ defaultValue: moment('00:00:00', 'HH:mm:ss') }" :show-time="{ defaultValue: moment('00:00:00', 'HH:mm:ss') }"
type="date" type='date'
placeholder="选择时间" placeholder='选择时间'
style="width: 100%;" style='width: 100%;'
/> />
</a-form-item> </a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="预约开始时间"> <a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='预约开始时间'>
<a-date-picker <a-date-picker
format='YYYY-MM-DD HH:mm:ss' format='YYYY-MM-DD HH:mm:ss'
valueFormat='YYYY-MM-DD HH:mm:ss' valueFormat='YYYY-MM-DD HH:mm:ss'
v-decorator="['endDate',{rules: [{ required: true, message: '预约结束时间'}]}]" v-decorator="['endDate',{rules: [{ required: true, message: '预约结束时间'}]}]"
:show-time="{ defaultValue: moment('00:00:00', 'HH:mm:ss') }" :show-time="{ defaultValue: moment('00:00:00', 'HH:mm:ss') }"
type="date" type='date'
placeholder="选择时间" placeholder='选择时间'
style="width: 100%;" style='width: 100%;'
/> />
</a-form-item> </a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="拟参观区域"> <a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='拟参观区域'>
<a-select <a-select
mode="multiple" mode='multiple'
placeholder="拟参观区域" placeholder='拟参观区域'
style="width: 200px" style='width: 200px'
@change="handleChange" @change='handleChange'
@popupScroll="popupScroll" @popupScroll='popupScroll'
v-decorator="['visitArea',{rules: [{ required: true, message: '请选择拟参观区域'}]}]" v-decorator="['visitArea',{rules: [{ required: true, message: '请选择拟参观区域'}]}]"
> >
<a-select-option value="展厅(2楼)"> <a-select-option value='展厅(2楼)'>
展厅(2) 展厅(2)
</a-select-option> </a-select-option>
<a-select-option value="公共服务配套区(15 楼)"> <a-select-option value='公共服务配套区(15 楼)'>
公共服务配套区(15) 公共服务配套区(15)
</a-select-option> </a-select-option>
<a-select-option value="中电郑州、生态企业(16楼)"> <a-select-option value='中电郑州、生态企业(16楼)'>
中电郑州生态企业(16) 中电郑州生态企业(16)
</a-select-option> </a-select-option>
</a-select> </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-button type="dashed" icon="plus" @click="addRow" class="addRowBtn"> <a-button type='dashed' icon='plus' @click='addRow' class='addRowBtn'>
新增一行 新增一行
</a-button> </a-button>
</a-form-item> </a-form-item>
<div style='margin-left: 80px'> <div style='margin-left: 80px'>
<div class="dynamic-wrap" :style="{ maxHeight: wrapHeight + 'px' }"> <div class='dynamic-wrap' :style="{ maxHeight: wrapHeight + 'px' }">
<div v-for="item in keysList" :key="item"> <div v-for='item in keysList' :key='item'>
<a-row :gutter="24"> <a-row :gutter='24'>
<a-col :span="6"> <a-col :span='6'>
<a-form-item label="名称" :labelCol="{span: 8}" :wrapperCol="{span: 16}"> <a-form-item label='名称' :labelCol='{span: 8}' :wrapperCol='{span: 16}'>
<a-input <a-input
placeholder="请填写名称" placeholder='请填写名称'
v-decorator="[ v-decorator="[
`${title}Name[${item}]`, `${title}Name[${item}]`,
{ {
@ -83,10 +115,10 @@
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="6"> <a-col :span='6'>
<a-form-item label="职位" :labelCol="{span: 9}" :wrapperCol="{span: 15}"> <a-form-item label='职位' :labelCol='{span: 9}' :wrapperCol='{span: 15}'>
<a-input <a-input
placeholder="请填职位" placeholder='请填职位'
v-decorator="[ v-decorator="[
`${title}Job[${item}]`, `${title}Job[${item}]`,
{ {
@ -97,23 +129,23 @@
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="6"> <a-col :span='6'>
<a-form-item label="手机号" :labelCol="{span: 8}" :wrapperCol="{span: 16}"> <a-form-item label='手机号' :labelCol='{span: 8}' :wrapperCol='{span: 16}'>
<a-input <a-input
placeholder="请填手机号" placeholder='请填手机号'
v-decorator="[ v-decorator='[
`${title}Phone[${item}]`, `${title}Phone[${item}]`,
{ {
initialValue: arr[item] ? arr[item].phone : undefined, initialValue: arr[item] ? arr[item].phone : undefined,
} }
]" ]'
/> />
</a-form-item> </a-form-item>
</a-col> </a-col>
<a-col :span="2" style="padding-left: 0px"> <a-col :span='2' style='padding-left: 0px'>
<a-form-item :labelCol="{span: 0}" :wrapperCol="{span: 24}"> <a-form-item :labelCol='{span: 0}' :wrapperCol='{span: 24}'>
<template v-if="keysList.length > 1"> <template v-if='keysList.length > 1'>
<a-button type="dashed" icon="minus" @click="removeRow(item)" class="minusRowBtn"></a-button> <a-button type='dashed' icon='minus' @click='removeRow(item)' class='minusRowBtn'></a-button>
</template> </template>
</a-form-item> </a-form-item>
</a-col> </a-col>
@ -122,41 +154,49 @@
</div> </div>
</div> </div>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="拟参观区域"> <a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='拟参观区域'>
<a-select <a-select
placeholder="选择参观目的" placeholder='选择参观目的'
style="width: 200px" style='width: 200px'
v-decorator="['visitType',{rules: [{ required: true, message: '拟参观区域'}]}]" v-decorator="['visitType',{rules: [{ required: true, message: '拟参观区域'}]}]"
> >
<a-select-option v-for="item in recordOptions" :key="item" :value="item.value"> <a-select-option v-for='item in recordOptions' :key='item' :value='item.value'>
{{ item.text }} {{ item.text }}
</a-select-option> </a-select-option>
</a-select> </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-switch v-decorator="['explainNeedType',{valuePropName: 'checked' , rules: [{ required: true, message: '讲解需求'}]}]" /> <a-switch
v-decorator="['explainNeedType',{valuePropName: 'checked' , rules: [{ message: '讲解需求'}]}]" />
</a-form-item> </a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="会议室需求"> <a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='会议室需求'>
<a-switch v-decorator="['meetingNeedType',{valuePropName: 'checked' ,rules: [{ required: true, message: '会议室需求'}]}]" /> <a-switch
v-decorator="['meetingNeedType',{valuePropName: 'checked' ,rules: [{ message: '会议室需求'}]}]" />
</a-form-item> </a-form-item>
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="摄影需求"> <a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='摄影需求'>
<a-switch v-decorator="['photographType',{valuePropName: 'checked' ,rules: [{ required: true, message: '摄影需求'}]}]" /> <a-switch
v-decorator="['photographType',{valuePropName: 'checked' ,rules: [{ message: '摄影需求'}]}]" />
</a-form-item> </a-form-item>
</a-form> </a-form>
</a-modal> </a-modal>
</template> </template>
<script> <script>
import {saveShowroomRecord,get} from '@/api/admin/meeting/showroomRecord' import { saveShowroomRecord, get } from '@/api/admin/meeting/showroomRecord'
import pick from 'lodash.pick' import { showroomListRq } from '@/api/admin/meeting/showroom'
import storage from 'store' import pick from 'lodash.pick'
import moment from 'moment' import storage from 'store'
import { getDictArray } from '@/utils/dict' import moment from 'moment'
import { getDictArray } from '@/utils/dict'
import { getInfo } from '@/api/login'
import { getTenantList } from '@/api/tenant'
import { getParkList } from '@/api/admin/park'
import { getBuildingList } from '@/api/admin/building'
import { roomContentList } from '@/api/admin/meeting/reservation'
let id = 0; let id = 0
export default { export default {
name: 'ShowroomRecordModal', name: 'ShowroomRecordModal',
props: { props: {
title: { title: {
@ -169,20 +209,19 @@
}, },
arr: { arr: {
type: Array, type: Array,
default: function () { default: function() {
return [] return []
} }
} }
}, },
components: { components: {},
},
data () { data() {
return { return {
ids: 0, ids: 0,
keysList: [], keysList: [],
recordOptions:[], recordOptions: [],
visible: false, visible: false,
labelCol: { labelCol: {
xs: { span: 24 }, xs: { span: 24 },
@ -194,12 +233,18 @@
}, },
confirmLoading: false, confirmLoading: false,
mdl: {}, mdl: {},
form: this.$form.createForm(this) form: this.$form.createForm(this),
tenantList: [], //
parkList: [], //
buildingList: [], //
showRoomList: [], //
tenantEnable: false,
parkEnable: false
} }
}, },
beforeCreate () { beforeCreate() {
}, },
async created () { async created() {
this.form = this.$form.createForm(this) this.form = this.$form.createForm(this)
this.init() this.init()
const recordData = await getDictArray('visit_type') const recordData = await getDictArray('visit_type')
@ -209,7 +254,95 @@
}) })
}, },
methods: { methods: {
init () { //
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.showroomId = null //
this.form.setFieldsValue({
parkId: null, //
buildingId: null, //
showroomId: null //
})
//
getParkList({
tenantId: id
}).then(res => {
this.parkList = res.rows
})
},
// ->
selectPark(id) {
//
this.mdl.buildingId = null //
this.mdl.showroomId = null //
this.form.setFieldsValue({
buildingId: null, //
showroomId: null //
})
//
getBuildingList({
parkId: id
}).then(res => {
this.buildingList = res.rows
})
},
// ->
selectBuilding(id) {
//
this.mdl.showroomId = null //
this.form.setFieldsValue({
showroomId: null //
})
showroomListRq({
buildingId: id
}).then(res => {
console.log('showroomListRq', res)
this.showRoomList = res.data
})
},
init() {
const arr = [0] const arr = [0]
if (this.arr.length !== 0) { if (this.arr.length !== 0) {
for (let i = 1; i < (this.arr).length; i++) { for (let i = 1; i < (this.arr).length; i++) {
@ -220,65 +353,88 @@
this.keysList = arr this.keysList = arr
}, },
// //
removeRow (k) { removeRow(k) {
if (this.keysList.length === 1) { // this.keysList.length === 0 if (this.keysList.length === 1) { // this.keysList.length === 0
return return
} }
this.keysList = this.keysList.filter(item => item !== k) this.keysList = this.keysList.filter(item => item !== k)
}, },
// //
addRow () { addRow() {
this.ids = this.ids + 1 this.ids = this.ids + 1
this.keysList = this.keysList.concat(this.ids) this.keysList = this.keysList.concat(this.ids)
console.log(this.keysList) console.log(this.keysList)
}, },
moment, moment,
handleChange(value) { handleChange(value) {
}, },
popupScroll(){ popupScroll() {
}, },
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(this.mdl, record)
let copyMdl = JSON.parse(JSON.stringify(this.mdl))
this.getUserDetail()
this.getTenantData()
//
this.visible = true this.visible = true
get(record.id).then(res =>{ if (record.id) {
res.visitArea =res.visitArea.split(",") get(record.id).then(res => {
res.visitArea = res.visitArea.split(',')
let persons = JSON.parse(res.persons) let persons = JSON.parse(res.persons)
let names =persons.map(item=> item.name) let names = persons.map(item => item.name)
let jobs =persons.map(item=> item.job) let jobs = persons.map(item => item.job)
let phones =persons.map(item=> item.phone) let phones = persons.map(item => item.phone)
this.form.setFieldsValue({ this.form.setFieldsValue({
visitType:res.visitType.toString(), visitType: res.visitType.toString(),
visitArea:res.visitArea, visitArea: res.visitArea,
Name:names, Name: names,
Job:jobs, Job: jobs,
Phone:phones Phone: phones
}) })
}) })
// ->
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))
}
this.$nextTick(() => { this.$nextTick(() => {
this.form.setFieldsValue(pick(this.mdl, 'id', 'showroomId', 'userId', 'title', 'stauts',"explainNeedType","meetingNeedType","photographType", this.form.setFieldsValue(pick(this.mdl, 'id', 'userId', 'title', 'stauts',
'reservationNumber', 'cancelTime', 'cancelResaon', 'startTime', 'endDate', 'deleteFlag', 'createBy', 'createTime', 'updateBy', 'updateTime', 'remake')) 'explainNeedType', 'meetingNeedType', 'photographType',
'reservationNumber', 'cancelTime', 'cancelResaon',
'startTime', 'endDate', 'deleteFlag', 'createBy', 'createTime',
'updateBy', 'updateTime', 'remake',
'tenantId', 'parkId', 'buildingId', 'showroomId'))
}) })
}, },
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 = true
const partOneArr = []; const partOneArr = []
values[`Name`].forEach((item, index) => { values[`Name`].forEach((item, index) => {
console.log(index) console.log(index)
const obj = { const obj = {
id:new Date().getTime(), id: new Date().getTime(),
name: item, name: item,
job: values[`Job`][index], job: values[`Job`][index],
phone: values[`Phone`][index] phone: values[`Phone`][index]
@ -286,7 +442,7 @@
partOneArr.push(obj) partOneArr.push(obj)
}) })
values.persons = JSON.stringify(partOneArr) values.persons = JSON.stringify(partOneArr)
values.visitArea =values.visitArea.join(",") values.visitArea = values.visitArea.join(',')
values.explainNeedType = values.explainNeedType === true ? 1 : 0 values.explainNeedType = values.explainNeedType === true ? 1 : 0
values.meetingNeedType = values.meetingNeedType === true ? 1 : 0 values.meetingNeedType = values.meetingNeedType === true ? 1 : 0
@ -336,9 +492,11 @@
color: #999; color: #999;
transition: all 0.3s; transition: all 0.3s;
} }
.dynamic-delete-button:hover { .dynamic-delete-button:hover {
color: #777; color: #777;
} }
.dynamic-delete-button[disabled] { .dynamic-delete-button[disabled] {
cursor: not-allowed; cursor: not-allowed;
opacity: 0.5; opacity: 0.5;