mirror of
https://gitee.com/elegant_wings/dbd-meeting-html.git
synced 2025-06-21 05:39:36 +08:00
Merge remote-tracking branch 'origin/master' into master
This commit is contained in:
commit
6652ebce7a
@ -1,122 +1,151 @@
|
|||||||
<template>
|
<template>
|
||||||
<a-card :body-style="{padding: '24px 32px'}" :bordered="false">
|
<a-card :body-style="{padding: '24px 32px'}" :bordered='false'>
|
||||||
<a-form @submit="handleSubmit" :form="form" :label-col="{ span: 4 }" :wrapper-col="{ span: 6 }">
|
<a-form @submit='handleSubmit' :form='form' :label-col='{ span: 4 }' :wrapper-col='{ span: 6 }'>
|
||||||
<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 :labelCol="labelCol" :wrapperCol="wrapperCol" label="所属楼宇">
|
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='所属地区'>
|
||||||
<a-select ref="buildingId" v-decorator="['buildingId', {rules: [{ required: true, message: '请选择所属楼宇' }]}]" @change="onSelectBuilding">
|
<a-select v-decorator="['tenantId', {rules: [{ required: true, message: '请选择所属地区' }]}]"
|
||||||
<a-select-option v-for="item in buildingData" :key="item.value">{{ item.text }}</a-select-option>
|
@change='selectTenant'
|
||||||
|
:disabled='tenantEnable'>
|
||||||
|
<a-select-option v-for='item in tenantList' :key='item.id'>{{ item.name }}</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-select ref="buildingDetailId" v-decorator="['buildingDetailId', {rules: [{ required: true, message: '请选择所属楼层' }]}]">
|
<a-select v-decorator="['parkId', {rules: [{ required: true, message: '请选择所属园区' }]}]"
|
||||||
<a-select-option v-for="item in buildingDetailData" :key="item.value">{{ item.text }}</a-select-option>
|
@change='selectPark'
|
||||||
|
:disabled='parkEnable'>
|
||||||
|
<a-select-option v-for='item in parkList' :key='item.id'>{{ item.name }}</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-input placeholder="请输入房间名称" v-decorator="['name', {rules: [{ required: true, message: '请填写房间名称' }]}]"/>
|
<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>
|
||||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="租金">
|
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='所属楼层'>
|
||||||
|
<a-select v-decorator="['buildingDetailId', {rules: [{ required: true, message: '请选择所属楼层' }]}]">
|
||||||
|
<a-select-option v-for='item in buildingDetailList' :key='item.id'>{{ item.floorName }}</a-select-option>
|
||||||
|
</a-select>
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='房间名称'>
|
||||||
|
<a-input placeholder='请输入房间名称'
|
||||||
|
v-decorator="['name', {rules: [{ required: true, message: '请填写房间名称' }]}]" />
|
||||||
|
</a-form-item>
|
||||||
|
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='租金'>
|
||||||
<a-input-group compact>
|
<a-input-group compact>
|
||||||
<a-input-number :min="1" style="width: 150px; text-align: center" placeholder="租金" v-decorator="['rent', {rules: [{ required: true, message: '请输入租金' }]}]"/>
|
<a-input-number :min='1' style='width: 150px; text-align: center' placeholder='租金'
|
||||||
<a-select style="width: 10%" v-decorator="['rentType', {initialValue: '4', rules: [{ required: true, message: '请选择租金类型' }]}]">
|
v-decorator="['rent', {rules: [{ required: true, message: '请输入租金' }]}]" />
|
||||||
<a-select-option value="1"> 元/㎡/天 </a-select-option>
|
<a-select style='width: 10%'
|
||||||
<a-select-option value="2"> 元/㎡/月 </a-select-option>
|
v-decorator="['rentType', {initialValue: '4', rules: [{ required: true, message: '请选择租金类型' }]}]">
|
||||||
<a-select-option value="3"> 元/天 </a-select-option>
|
<a-select-option value='1'> 元/㎡/天</a-select-option>
|
||||||
<a-select-option value="4"> 元/月 </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>
|
</a-select>
|
||||||
</a-input-group>
|
</a-input-group>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="物业费">
|
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='物业费'>
|
||||||
<a-input-group compact>
|
<a-input-group compact>
|
||||||
<a-input-number :min="1" style="width: 150px; text-align: center" placeholder="物业费" v-decorator="['managementFee', {rules: [{ required: true, message: '请输入物业费' }]}]"/>
|
<a-input-number :min='1' style='width: 150px; text-align: center' placeholder='物业费'
|
||||||
<a-select style="width: 10%" v-decorator="['managementFeeType', {initialValue: '4', rules: [{ required: true, message: '请选择物业费类型' }]}]">
|
v-decorator="['managementFee', {rules: [{ required: true, message: '请输入物业费' }]}]" />
|
||||||
<a-select-option value="1"> 元/㎡/天 </a-select-option>
|
<a-select style='width: 10%'
|
||||||
<a-select-option value="2"> 元/㎡/月 </a-select-option>
|
v-decorator="['managementFeeType', {initialValue: '4', rules: [{ required: true, message: '请选择物业费类型' }]}]">
|
||||||
<a-select-option value="3"> 元/天 </a-select-option>
|
<a-select-option value='1'> 元/㎡/天</a-select-option>
|
||||||
<a-select-option value="4"> 元/月 </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>
|
</a-select>
|
||||||
</a-input-group>
|
</a-input-group>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="房间面积(平方米)">
|
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='房间面积(平方米)'>
|
||||||
<a-input-number :min="1" style="width: 20%" placeholder="请输入房间面积" v-decorator="['area', {rules: [{ required: true, message: '请输入房间面积' }]}]"/>
|
<a-input-number :min='1' style='width: 20%' placeholder='请输入房间面积'
|
||||||
<div><a-checkbox :checked="mdl.canBeDivided" @change="onChangeCheckBox" v-decorator="['canBeDivided']">可分割</a-checkbox></div>
|
v-decorator="['area', {rules: [{ required: true, message: '请输入房间面积' }]}]" />
|
||||||
|
<div>
|
||||||
|
<a-checkbox :checked='mdl.canBeDivided' @change='onChangeCheckBox' v-decorator="['canBeDivided']">可分割
|
||||||
|
</a-checkbox>
|
||||||
|
</div>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="收租面积(平方米)">
|
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='收租面积(平方米)'>
|
||||||
<a-input-number :min="1" style="width: 20%" placeholder="请输入收租面积" v-decorator="['rentArea', {rules: [{ required: true, message: '请输入收租面积' }]}]"/>
|
<a-input-number :min='1' style='width: 20%' placeholder='请输入收租面积'
|
||||||
|
v-decorator="['rentArea', {rules: [{ required: true, message: '请输入收租面积' }]}]" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="公摊面积(平方米)">
|
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='公摊面积(平方米)'>
|
||||||
<a-input-number :min="0" style="width: 20%" placeholder="请输入公摊面积" v-decorator="['commonArea', {rules: [{ required: true, message: '请输入公摊面积' }]}]"/>
|
<a-input-number :min='0' style='width: 20%' placeholder='请输入公摊面积'
|
||||||
|
v-decorator="['commonArea', {rules: [{ required: true, message: '请输入公摊面积' }]}]" />
|
||||||
</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="['layout', {initialValue:'',rules: [{ required: true, message: '请选择房型' }]}]">
|
<a-select v-decorator="['layout', {initialValue:'',rules: [{ required: true, message: '请选择房型' }]}]">
|
||||||
<a-select-option value="LOFT">loft</a-select-option>
|
<a-select-option value='LOFT'>loft</a-select-option>
|
||||||
<a-select-option value="BUSINESS">商业配套</a-select-option>
|
<a-select-option value='BUSINESS'>商业配套</a-select-option>
|
||||||
<a-select-option value="OFFICE">办公场所</a-select-option>
|
<a-select-option value='OFFICE'>办公场所</a-select-option>
|
||||||
<a-select-option value="OTHER">其他</a-select-option>
|
<a-select-option value='OTHER'>其他</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-input-number :min="1" style="width: 20%" placeholder="请输入层高" v-decorator="['floorHeight']"/>
|
<a-input-number :min='1' style='width: 20%' placeholder='请输入层高' v-decorator="['floorHeight']" />
|
||||||
</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 @change="onChange" v-decorator="['availableFrom', {rules: [{required: true, message: '请输入可入住日期'}]}]" placeholder="可入住日期" />
|
<a-date-picker @change='onChange'
|
||||||
|
v-decorator="['availableFrom', {rules: [{required: true, message: '请输入可入住日期'}]}]"
|
||||||
|
placeholder='可入住日期' />
|
||||||
</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="['decorationType', {initialValue:'',rules: [{ required: true, message: '请选择装修类型' }]}]">
|
<a-select
|
||||||
<a-select-option value="SIMPLE">简装</a-select-option>
|
v-decorator="['decorationType', {initialValue:'',rules: [{ required: true, message: '请选择装修类型' }]}]">
|
||||||
<a-select-option value="SPECIAL">精装</a-select-option>
|
<a-select-option value='SIMPLE'>简装</a-select-option>
|
||||||
<a-select-option value="ROUGH">毛坯房</a-select-option>
|
<a-select-option value='SPECIAL'>精装</a-select-option>
|
||||||
|
<a-select-option value='ROUGH'>毛坯房</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-input-number :min="1" style="width: 150px; text-align: center" placeholder="奖金" v-decorator="['bonus']"/>
|
<a-input-number :min='1' style='width: 150px; text-align: center' placeholder='奖金' v-decorator="['bonus']" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上传房间小图" extra="尺寸建议:宽160px,高160px">
|
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='上传房间小图' extra='尺寸建议:宽160px,高160px'>
|
||||||
<a-upload
|
<a-upload
|
||||||
v-decorator="['smallPic']"
|
v-decorator="['smallPic']"
|
||||||
list-type="picture-card"
|
list-type='picture-card'
|
||||||
class="avatar-uploader"
|
class='avatar-uploader'
|
||||||
:show-upload-list="false"
|
:show-upload-list='false'
|
||||||
:action="uploadUrl"
|
:action='uploadUrl'
|
||||||
:headers="headers"
|
:headers='headers'
|
||||||
:before-upload="beforeUpload"
|
:before-upload='beforeUpload'
|
||||||
@change="handleChange"
|
@change='handleChange'
|
||||||
>
|
>
|
||||||
<img v-if="imageUrl" :src="imageUrl" style="width: 102px; height: 102px"/>
|
<img v-if='imageUrl' :src='imageUrl' style='width: 102px; height: 102px' />
|
||||||
<div v-else>
|
<div v-else>
|
||||||
<a-icon :type="loading ? 'loading' : 'plus'" />
|
<a-icon :type="loading ? 'loading' : 'plus'" />
|
||||||
<div class="ant-upload-text"> 上传 </div>
|
<div class='ant-upload-text'> 上传</div>
|
||||||
</div>
|
</div>
|
||||||
</a-upload>
|
</a-upload>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<!-- <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上传园区banner图" extra="尺寸建议:宽750px,高300px">-->
|
<!-- <a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="上传园区banner图" extra="尺寸建议:宽750px,高300px">-->
|
||||||
<!-- <a-upload-->
|
<!-- <a-upload-->
|
||||||
<!-- v-decorator="['bannerImages']"-->
|
<!-- v-decorator="['bannerImages']"-->
|
||||||
<!-- list-type="picture-card"-->
|
<!-- list-type="picture-card"-->
|
||||||
<!-- class="avatar-uploader"-->
|
<!-- class="avatar-uploader"-->
|
||||||
<!-- :file-list="fileList"-->
|
<!-- :file-list="fileList"-->
|
||||||
<!-- :action="uploadUrl"-->
|
<!-- :action="uploadUrl"-->
|
||||||
<!-- :headers="headers"-->
|
<!-- :headers="headers"-->
|
||||||
<!-- @preview="handlePreview"-->
|
<!-- @preview="handlePreview"-->
|
||||||
<!-- @change="handleChangeFileList"-->
|
<!-- @change="handleChangeFileList"-->
|
||||||
<!-- >-->
|
<!-- >-->
|
||||||
<!-- <div v-if="fileList.length < 4">-->
|
<!-- <div v-if="fileList.length < 4">-->
|
||||||
<!-- <a-icon type="plus" />-->
|
<!-- <a-icon type="plus" />-->
|
||||||
<!-- <div class="ant-upload-text"> 上传 </div>-->
|
<!-- <div class="ant-upload-text"> 上传 </div>-->
|
||||||
<!-- </div>-->
|
<!-- </div>-->
|
||||||
<!-- </a-upload>-->
|
<!-- </a-upload>-->
|
||||||
<!-- <a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel">-->
|
<!-- <a-modal :visible="previewVisible" :footer="null" @cancel="handleCancel">-->
|
||||||
<!-- <img style="width: 100%" :src="previewImage" />-->
|
<!-- <img style="width: 100%" :src="previewImage" />-->
|
||||||
<!-- </a-modal>-->
|
<!-- </a-modal>-->
|
||||||
<!-- </a-form-item>-->
|
<!-- </a-form-item>-->
|
||||||
<a-form-item :labelCol="labelCol" :wrapperCol="wrapperCol" label="房间简介(可选)" extra="不要超过50个字符">
|
<a-form-item :labelCol='labelCol' :wrapperCol='wrapperCol' label='房间简介(可选)' extra='不要超过50个字符'>
|
||||||
<a-textarea placeholder="请输入房间简介" :rows="5" v-decorator="['briefIntro']"/>
|
<a-textarea placeholder='请输入房间简介' :rows='5' v-decorator="['briefIntro']" />
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
<a-form-item :wrapper-col="{ span: 12, offset: 12 }">
|
<a-form-item :wrapper-col='{ span: 12, offset: 12 }'>
|
||||||
<a-button htmlType="submit" type="primary">提交</a-button>
|
<a-button htmlType='submit' type='primary'>提交</a-button>
|
||||||
<a-button icon="rollback" style="margin-left: 8px" @click="rollback">关闭</a-button>
|
<a-button icon='rollback' style='margin-left: 8px' @click='rollback'>关闭</a-button>
|
||||||
</a-form-item>
|
</a-form-item>
|
||||||
</a-form>
|
</a-form>
|
||||||
</a-card>
|
</a-card>
|
||||||
@ -134,13 +163,15 @@ import moment from 'moment'
|
|||||||
import { getParkList } from '@/api/admin/park'
|
import { getParkList } from '@/api/admin/park'
|
||||||
import { getBuildingList } from '@/api/admin/building'
|
import { getBuildingList } from '@/api/admin/building'
|
||||||
import { getBuildingDetailList } from '@/api/admin/buildingDetail'
|
import { getBuildingDetailList } from '@/api/admin/buildingDetail'
|
||||||
|
import { getInfo } from '@/api/login'
|
||||||
|
import { getTenantList } from '@/api/tenant'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
name: 'BaseForm',
|
name: 'BaseForm',
|
||||||
components: {
|
components: {
|
||||||
WangEditor
|
WangEditor
|
||||||
},
|
},
|
||||||
data () {
|
data() {
|
||||||
return {
|
return {
|
||||||
labelCol: {
|
labelCol: {
|
||||||
xs: { span: 24 },
|
xs: { span: 24 },
|
||||||
@ -160,26 +191,21 @@ export default {
|
|||||||
previewImage: '',
|
previewImage: '',
|
||||||
fileList: [],
|
fileList: [],
|
||||||
options: [],
|
options: [],
|
||||||
parkData: [],
|
|
||||||
buildingData: [],
|
|
||||||
buildingDetailData: [],
|
|
||||||
mdl: {},
|
mdl: {},
|
||||||
// form
|
// form
|
||||||
form: this.$form.createForm(this)
|
form: this.$form.createForm(this),
|
||||||
|
userDetail: {},
|
||||||
|
tenantList: [],
|
||||||
|
parkList: [],
|
||||||
|
buildingList: [],
|
||||||
|
buildingDetailList: [],
|
||||||
|
tenantEnable: false,
|
||||||
|
parkEnable: false
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
created () {
|
created() {
|
||||||
this.onSelectPark()
|
// 获取用户信息
|
||||||
// 获取园区
|
this.getUserDetail()
|
||||||
getParkList().then(res => {
|
|
||||||
if (res.code === 0) {
|
|
||||||
const result = res.rows
|
|
||||||
result.forEach(r => {
|
|
||||||
this.parkData.push({ value: r.id, text: r.name })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
// 初始化地区
|
// 初始化地区
|
||||||
getDistVOList().then(res => {
|
getDistVOList().then(res => {
|
||||||
this.options = res.data
|
this.options = res.data
|
||||||
@ -188,44 +214,106 @@ export default {
|
|||||||
this.handleInit()
|
this.handleInit()
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
// 选择园区
|
// 获取用户详细信息
|
||||||
onSelectPark () {
|
getUserDetail() {
|
||||||
this.buildingData = []
|
getInfo().then(res => {
|
||||||
this.form.setFieldsValue({ buildingId: '' })
|
console.log('getUserDetail', res)
|
||||||
getBuildingList().then(res => {
|
this.userDetail = res
|
||||||
if (res.code === 0) {
|
// 园区:5
|
||||||
const result = res.rows
|
if (this.userDetail.roleIds && this.userDetail.roleIds.length > 0 && this.userDetail.roleIds[0] == 5) {
|
||||||
result.forEach(r => {
|
//
|
||||||
this.buildingData.push({ value: r.id, text: r.buildingName })
|
// 判断:是新增就查询园区
|
||||||
|
let { id } = this.$route.query
|
||||||
|
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
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
// 选择楼宇
|
// 查询地区
|
||||||
onSelectBuilding (buildingId) {
|
getTenantData() {
|
||||||
this.buildingDetailData = []
|
getTenantList().then(res => {
|
||||||
this.form.setFieldsValue({ buildingDetailId: '' })
|
this.tenantList = res.rows
|
||||||
if (buildingId) {
|
})
|
||||||
getBuildingDetailList({ buildingId: buildingId }).then(res => {
|
|
||||||
if (res.code === 0) {
|
|
||||||
const result = res.rows
|
|
||||||
result.forEach(r => {
|
|
||||||
this.buildingDetailData.push({ value: r.id, text: r.floorName })
|
|
||||||
})
|
|
||||||
}
|
|
||||||
})
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
onChangeCheckBox (e) {
|
// 选择地区 -> 查询园区
|
||||||
|
selectTenant(id) {
|
||||||
|
console.log('selectTenant', id)
|
||||||
|
// 清空数据
|
||||||
|
this.mdl.parkId = null
|
||||||
|
this.mdl.buildingId = null
|
||||||
|
this.mdl.buildingDetailId = null
|
||||||
|
this.form.setFieldsValue({
|
||||||
|
parkId: null,
|
||||||
|
buildingId: null,
|
||||||
|
buildingDetailId: null
|
||||||
|
})
|
||||||
|
// 查询园区
|
||||||
|
getParkList({
|
||||||
|
tenantId: id
|
||||||
|
}).then(res => {
|
||||||
|
this.parkList = res.rows
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 选择园区 -> 查询楼宇
|
||||||
|
selectPark(id) {
|
||||||
|
// 清空数据
|
||||||
|
this.mdl.buildingId = null
|
||||||
|
this.mdl.buildingDetailId = null
|
||||||
|
this.form.setFieldsValue({
|
||||||
|
buildingId: null,
|
||||||
|
buildingDetailId: null
|
||||||
|
})
|
||||||
|
// 查询楼宇
|
||||||
|
getBuildingList({
|
||||||
|
parkId: id
|
||||||
|
}).then(res => {
|
||||||
|
this.buildingList = res.rows
|
||||||
|
})
|
||||||
|
},
|
||||||
|
// 选择楼宇 -> 查询楼层
|
||||||
|
selectBuilding(id) {
|
||||||
|
// 清空数据
|
||||||
|
this.mdl.buildingDetailId = null
|
||||||
|
this.form.setFieldsValue({
|
||||||
|
buildingDetailId: null
|
||||||
|
})
|
||||||
|
// 查询楼层
|
||||||
|
getBuildingDetailList({
|
||||||
|
buildingId: id
|
||||||
|
}).then(res => {
|
||||||
|
this.buildingDetailList = res.rows
|
||||||
|
})
|
||||||
|
},
|
||||||
|
onChangeCheckBox(e) {
|
||||||
this.mdl.canBeDivided = e.target.checked
|
this.mdl.canBeDivided = e.target.checked
|
||||||
},
|
},
|
||||||
onChange (date, dateString) {
|
onChange(date, dateString) {
|
||||||
},
|
},
|
||||||
handleInit () {
|
handleInit() {
|
||||||
const { id } = this.$route.query
|
const { id } = this.$route.query
|
||||||
|
this.form.resetFields()
|
||||||
|
// 查询地区
|
||||||
|
this.getTenantData()
|
||||||
|
// 详情
|
||||||
if (id) {
|
if (id) {
|
||||||
getRoomById(id).then(record => {
|
getRoomById(id).then(record => {
|
||||||
this.mdl = Object.assign(record)
|
this.mdl = Object.assign(this.mdl, record)
|
||||||
|
let copyMdl = JSON.parse(JSON.stringify(this.mdl))
|
||||||
this.visible = true
|
this.visible = true
|
||||||
// 房间图片
|
// 房间图片
|
||||||
if (this.mdl.smallPic) {
|
if (this.mdl.smallPic) {
|
||||||
@ -239,18 +327,30 @@ export default {
|
|||||||
this.$nextTick(() => {
|
this.$nextTick(() => {
|
||||||
this.form.setFieldsValue(pick(this.mdl, 'id', 'name', 'area', 'smallPic', 'bannerImages', 'rent', 'briefIntro', 'bonus',
|
this.form.setFieldsValue(pick(this.mdl, 'id', 'name', 'area', 'smallPic', 'bannerImages', 'rent', 'briefIntro', 'bonus',
|
||||||
'rentType', 'managementFee', 'managementFeeType', 'parkingFee', 'layout', 'floorHeight', 'availableFrom',
|
'rentType', 'managementFee', 'managementFeeType', 'parkingFee', 'layout', 'floorHeight', 'availableFrom',
|
||||||
'decorationType', 'isMarketable', 'marketableTime', 'canBeDivided', 'parkId', 'buildingId', 'buildingDetailId', 'rentArea', 'commonArea'))
|
'decorationType', 'isMarketable', 'marketableTime', 'canBeDivided', 'tenantId', 'parkId', 'buildingId', 'buildingDetailId', 'rentArea', 'commonArea'))
|
||||||
})
|
})
|
||||||
if (this.mdl.parkId) {
|
//
|
||||||
this.onSelectPark(this.mdl.parkId)
|
// 选择地区 -> 查询园区
|
||||||
if (this.mdl.buildingId) {
|
if (copyMdl.tenantId) {
|
||||||
this.onSelectBuilding(this.mdl.buildingId)
|
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))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
beforeUpload (file) {
|
beforeUpload(file) {
|
||||||
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'
|
const isJpgOrPng = file.type === 'image/jpeg' || file.type === 'image/png'
|
||||||
if (!isJpgOrPng) {
|
if (!isJpgOrPng) {
|
||||||
this.$message.error('You can only upload JPG file!')
|
this.$message.error('You can only upload JPG file!')
|
||||||
@ -261,7 +361,7 @@ export default {
|
|||||||
}
|
}
|
||||||
return isJpgOrPng && isLt500KB
|
return isJpgOrPng && isLt500KB
|
||||||
},
|
},
|
||||||
handleChange (info) {
|
handleChange(info) {
|
||||||
if (info.file.status === 'uploading') {
|
if (info.file.status === 'uploading') {
|
||||||
this.loading = true
|
this.loading = true
|
||||||
return
|
return
|
||||||
@ -282,22 +382,22 @@ export default {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
async handlePreview (file) {
|
async handlePreview(file) {
|
||||||
if (!file.url && !file.preview) {
|
if (!file.url && !file.preview) {
|
||||||
file.preview = await getBase64FileList(file.originFileObj)
|
file.preview = await getBase64FileList(file.originFileObj)
|
||||||
}
|
}
|
||||||
this.previewImage = file.url || file.preview
|
this.previewImage = file.url || file.preview
|
||||||
this.previewVisible = true
|
this.previewVisible = true
|
||||||
},
|
},
|
||||||
handleCancel () {
|
handleCancel() {
|
||||||
this.previewVisible = false
|
this.previewVisible = false
|
||||||
},
|
},
|
||||||
// 上传banner
|
// 上传banner
|
||||||
handleChangeFileList ({ fileList }) {
|
handleChangeFileList({ fileList }) {
|
||||||
this.fileList = fileList
|
this.fileList = fileList
|
||||||
},
|
},
|
||||||
// handler
|
// handler
|
||||||
handleSubmit (e) {
|
handleSubmit(e) {
|
||||||
e.preventDefault()
|
e.preventDefault()
|
||||||
this.form.validateFields((err, values) => {
|
this.form.validateFields((err, values) => {
|
||||||
if (!err) {
|
if (!err) {
|
||||||
@ -335,21 +435,21 @@ export default {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
},
|
},
|
||||||
rollback () {
|
rollback() {
|
||||||
this.$router.push({ name: 'room', query: { type: this.$route.query.type } })
|
this.$router.push({ name: 'room', query: { type: this.$route.query.type } })
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// 上传园区小图
|
// 上传园区小图
|
||||||
function getBase64 (img, callback) {
|
function getBase64(img, callback) {
|
||||||
const reader = new FileReader()
|
const reader = new FileReader()
|
||||||
reader.addEventListener('load', () => callback(reader.result))
|
reader.addEventListener('load', () => callback(reader.result))
|
||||||
reader.readAsDataURL(img)
|
reader.readAsDataURL(img)
|
||||||
}
|
}
|
||||||
|
|
||||||
// 上传园区banner图
|
// 上传园区banner图
|
||||||
function getBase64FileList (file) {
|
function getBase64FileList(file) {
|
||||||
return new Promise((resolve, reject) => {
|
return new Promise((resolve, reject) => {
|
||||||
const reader = new FileReader()
|
const reader = new FileReader()
|
||||||
reader.readAsDataURL(file)
|
reader.readAsDataURL(file)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user