| | |
| | | <template> |
| | | <GlobalWindow :title="title" :visible.sync="visible" :confirm-working="isWorking" @confirm="confirm"> |
| | | <GlobalWindow width="720px" :title="title" :visible.sync="visible" :confirm-working="isWorking" @confirm="confirm"> |
| | | <el-form :model="form" ref="form" :rules="rules"> |
| | | <el-form-item label="所属项目" prop="projectId"> |
| | | <el-select v-model="form.projectId" @change="changeProject" placeholder="请选择项目" clearable> |
| | |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="所属楼宇" prop="buildingId"> |
| | | <el-select v-model="form.buildingId" placeholder="请选择楼宇" clearable> |
| | | <el-select v-model="form.buildingId" @change="changeBuild" placeholder="请选择楼宇" clearable> |
| | | <el-option v-for="item in buildList" :key="item.id" :label="item.name" :value="item.id"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="楼层" prop="floor"> |
| | | <el-input v-model="form.floor" placeholder="请输入楼层" v-trim /> |
| | | <el-select v-model="form.floor" placeholder="请选择楼层" clearable> |
| | | <el-option v-for="item in floorList" :key="item.id" :label="item.name" :value="item.id"></el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | <el-form-item label="房号" prop="roomNum"> |
| | | <el-input v-model="form.roomNum" placeholder="请输入房号" v-trim /> |
| | |
| | | <el-input v-model="form.code" placeholder="请输入房间编号" v-trim /> |
| | | </el-form-item> |
| | | <el-form-item label="是否招商" prop="isInvestment"> |
| | | <el-switch v-model="form.isInvestment" active-value="1" inactive-value="0"> |
| | | <el-switch v-model="form.isInvestment" :active-value="1" :inactive-value="0"> |
| | | </el-switch> |
| | | </el-form-item> |
| | | <el-form-item label="建筑面积(m²)" prop="area"> |
| | |
| | | import GlobalWindow from '@/components/common/GlobalWindow' |
| | | import { getProjectList } from '@/api/project/ywProject' |
| | | import { getBuildList } from '@/api/project/ywBuilding' |
| | | import { getFloorList } from '@/api/project/yeFloor' |
| | | import { detailById } from '@/api/project/ywRoom' |
| | | export default { |
| | | name: 'OperaYwRoomWindow', |
| | | extends: BaseOpera, |
| | |
| | | imgurl: '', |
| | | code: '', |
| | | roomNum: '', |
| | | isInvestment: '0', |
| | | isInvestment: 0, |
| | | area: '', |
| | | feeArea: '', |
| | | rentArea: '', |
| | |
| | | }, |
| | | projectList: [], |
| | | buildList: [], |
| | | floorList: [], |
| | | } |
| | | }, |
| | | created() { |
| | |
| | | }) |
| | | }, |
| | | methods: { |
| | | open(title, target, type) { |
| | | this.title = title |
| | | this.visible = true |
| | | this.getProject() |
| | | this.buildList = [] |
| | | this.floorList = [] |
| | | // 新建组织 |
| | | if (target == null) { |
| | | this.$nextTick(() => { |
| | | this.$refs.form.resetFields() |
| | | this.form[this.configData['field.id']] = null |
| | | this.form.type = type |
| | | }) |
| | | return |
| | | } |
| | | // 编辑 |
| | | this.$nextTick(() => { |
| | | this.getDetail(target.id) |
| | | }) |
| | | }, |
| | | confirm() { |
| | | if (!this.form.feeArea) { |
| | | this.form.feeArea = this.form.rentArea |
| | | } |
| | | if (this.form.id == null || this.form.id === '') { |
| | | this.__confirmCreate() |
| | | return |
| | | } |
| | | this.__confirmEdit() |
| | | }, |
| | | getDetail(id) { |
| | | detailById(id).then(res => { |
| | | this.form = res || {} |
| | | if (res.projectId) { |
| | | getBuildList({ projectId: res.projectId }).then(res => { |
| | | this.buildList = res || [] |
| | | }) |
| | | } |
| | | if (res.buildingId) { |
| | | getFloorList({ buildingId: res.buildingId }).then(res => { |
| | | this.floorList = res || [] |
| | | }) |
| | | } |
| | | }) |
| | | }, |
| | | getProject() { |
| | | getProjectList({}).then(res => { |
| | | this.projectList = res || [] |
| | | if (this.projectList.length > 0) { |
| | | this.$set(this.form, 'projectId', this.projectList[0].id) |
| | | this.changeProject(this.projectList[0].id) |
| | | } |
| | | }) |
| | | |
| | | }, |
| | | changeProject(e) { |
| | | this.form.buildingId = '' |
| | | getBuildList({id: e}).then(res => { |
| | | getBuildList({ projectId: e }).then(res => { |
| | | this.buildList = res || [] |
| | | // if(this.buildList.length > 0){ |
| | | // this.form.buildingId = this.buildList[0].id |
| | | // } |
| | | }) |
| | | }, |
| | | changeBuild(e) { |
| | | this.form.floor = '' |
| | | getFloorList({ buildingId: e }).then(res => { |
| | | this.floorList = res || [] |
| | | }) |
| | | }, |
| | | } |