|  |  |  | 
|---|
|  |  |  | <template> | 
|---|
|  |  |  | <GlobalWindow width="800px" :title="title" :visible.sync="visible" @close="close" :confirm-working="isWorking" @confirm="confirm"> | 
|---|
|  |  |  | <GlobalWindow width="800px" :title="title" :visible.sync="visible" @close="close" :confirm-working="isWorking" | 
|---|
|  |  |  | @confirm="confirm"> | 
|---|
|  |  |  | <el-form :model="form" ref="form" :rules="rules"> | 
|---|
|  |  |  | <el-form-item label="位置类型" prop="areaType"> | 
|---|
|  |  |  | <el-select v-model="form.areaType"> | 
|---|
|  |  |  | 
|---|
|  |  |  | <i class="el-icon-plus avatar-uploader-icon"></i> | 
|---|
|  |  |  | <div>图片/视频</div> | 
|---|
|  |  |  | </div> | 
|---|
|  |  |  | </el-upload> | 
|---|
|  |  |  | </el-upload> | 
|---|
|  |  |  | <div v-for="(item, i) in fileList" :key="i" class="item"> | 
|---|
|  |  |  | <i @click="handleDelImg(i)" class="el-icon-error close"></i> | 
|---|
|  |  |  | <el-image :src="item.fileurlFull" :preview-src-list="[item.fileurlFull]" v-if="item.type == 0" | 
|---|
|  |  |  | 
|---|
|  |  |  | // 表单数据 | 
|---|
|  |  |  | form: { | 
|---|
|  |  |  | id: null, | 
|---|
|  |  |  | creator: '', | 
|---|
|  |  |  | createDate: '', | 
|---|
|  |  |  | editor: '', | 
|---|
|  |  |  | editDate: '', | 
|---|
|  |  |  | floor: '', | 
|---|
|  |  |  | isdeleted: '', | 
|---|
|  |  |  | title: '', | 
|---|
|  |  |  | remark: '', | 
|---|
|  |  |  | status: '', | 
|---|
|  |  |  | 
|---|
|  |  |  | floorId: '', | 
|---|
|  |  |  | roomId: '', | 
|---|
|  |  |  | userId: '', | 
|---|
|  |  |  | phone: '', | 
|---|
|  |  |  | submitDate: '', | 
|---|
|  |  |  | cateId: '', | 
|---|
|  |  |  | areaType: '0', | 
|---|
|  |  |  | 
|---|
|  |  |  | this.visible = true | 
|---|
|  |  |  | this.getProject() | 
|---|
|  |  |  | this.getCate() | 
|---|
|  |  |  | // 新建 | 
|---|
|  |  |  | // 新建 | 
|---|
|  |  |  | if (target == null) { | 
|---|
|  |  |  | this.form = { | 
|---|
|  |  |  | id: null, | 
|---|
|  |  |  | editDate: '', | 
|---|
|  |  |  | floor: '', | 
|---|
|  |  |  | title: '', | 
|---|
|  |  |  | remark: '', | 
|---|
|  |  |  | status: '', | 
|---|
|  |  |  | sortnum: '', | 
|---|
|  |  |  | content: '', | 
|---|
|  |  |  | getDate: '', | 
|---|
|  |  |  | projectId: '', | 
|---|
|  |  |  | buildingId: '', | 
|---|
|  |  |  | floorId: '', | 
|---|
|  |  |  | roomId: '', | 
|---|
|  |  |  | userId: '', | 
|---|
|  |  |  | submitDate: '', | 
|---|
|  |  |  | cateId: '', | 
|---|
|  |  |  | areaType: '0', | 
|---|
|  |  |  | code: '', | 
|---|
|  |  |  | dealStatus: '', | 
|---|
|  |  |  | dispatchUserId: '', | 
|---|
|  |  |  | dispatchDate: '', | 
|---|
|  |  |  | dispatchInfo: '', | 
|---|
|  |  |  | dealUserId: '', | 
|---|
|  |  |  | dealDate: '', | 
|---|
|  |  |  | dealInfo: '', | 
|---|
|  |  |  | dealType: '' | 
|---|
|  |  |  | } | 
|---|
|  |  |  | this.$nextTick(() => { | 
|---|
|  |  |  | this.buildList = [] | 
|---|
|  |  |  | this.roomList = [] | 
|---|
|  |  |  | this.levelList = [] | 
|---|
|  |  |  | this.$refs.form.resetFields() | 
|---|
|  |  |  | this.form[this.configData['field.id']] = null | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getProject() { | 
|---|
|  |  |  | getProjectList({}).then(res => { | 
|---|
|  |  |  | this.projectList = res | 
|---|
|  |  |  | this.projectList = res || [] | 
|---|
|  |  |  | if(this.projectList.length > 0){ | 
|---|
|  |  |  | this.$set(this.form, 'projectId', this.projectList[0].id) | 
|---|
|  |  |  | this.getBuild(this.projectList[0].id) | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getBuild(projectId) { | 
|---|
|  |  |  | 
|---|
|  |  |  | this.$set(this.form, 'floorId', '') | 
|---|
|  |  |  | this.$set(this.form, 'roomId', '') | 
|---|
|  |  |  | getBuildList({ projectId }).then(res => { | 
|---|
|  |  |  | this.buildList = res | 
|---|
|  |  |  | this.buildList = res || [] | 
|---|
|  |  |  | // if(projectId && this.buildList.length > 0){ | 
|---|
|  |  |  | //   this.$set(this.form, 'buildingId', this.buildList[0].id) | 
|---|
|  |  |  | //   this.changeBuild(this.buildList[0].id) | 
|---|
|  |  |  | // } | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | changeBuild(e) { | 
|---|
|  |  |  | this.$set(this.form, 'floorId', '') | 
|---|
|  |  |  | this.$set(this.form, 'roomId', '') | 
|---|
|  |  |  | if(this.form.areaType == 1){ | 
|---|
|  |  |  | if (this.form.areaType == 1) { | 
|---|
|  |  |  | this.getLevel(e) | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.getRoom(e) | 
|---|
|  |  |  | } | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  |  | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getLevel(buildingId) { | 
|---|
|  |  |  | getFloorList({ buildingId}).then(res => { | 
|---|
|  |  |  | getFloorList({ buildingId }).then(res => { | 
|---|
|  |  |  | this.levelList = res | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | changeSel(e) { | 
|---|
|  |  |  | if(e && e.length == 2){ | 
|---|
|  |  |  | if (e && e.length == 2) { | 
|---|
|  |  |  | this.$set(this.form, 'cateId', e[1]) | 
|---|
|  |  |  | }else{ | 
|---|
|  |  |  | } else { | 
|---|
|  |  |  | this.$set(this.form, 'cateId', '') | 
|---|
|  |  |  | } | 
|---|
|  |  |  | }, | 
|---|