|  |  |  | 
|---|
|  |  |  | <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" clearable placeholder="请选择项目"> | 
|---|
|  |  |  | <el-select v-model="form.projectId"> | 
|---|
|  |  |  | <el-select v-model="form.projectId" filterable clearable> | 
|---|
|  |  |  | <el-option v-for="item in projectList" :key="item.id" :label="item.name" :value="item.id"></el-option> | 
|---|
|  |  |  | </el-select> | 
|---|
|  |  |  | </el-form-item> | 
|---|
|  |  |  | 
|---|
|  |  |  | import BaseOpera from '@/components/base/BaseOpera' | 
|---|
|  |  |  | import GlobalWindow from '@/components/common/GlobalWindow' | 
|---|
|  |  |  | import { getProjectList } from '@/api/project/ywProject' | 
|---|
|  |  |  | import { detailById } from '@/api/project/ywBuilding' | 
|---|
|  |  |  | export default { | 
|---|
|  |  |  | name: 'OperaYwBuildingWindow', | 
|---|
|  |  |  | extends: BaseOpera, | 
|---|
|  |  |  | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | methods: { | 
|---|
|  |  |  | open (title, target,type) { | 
|---|
|  |  |  | this.title = title | 
|---|
|  |  |  | this.visible = true | 
|---|
|  |  |  | this.getProject() | 
|---|
|  |  |  | // 新建组织 | 
|---|
|  |  |  | if (target == null) { | 
|---|
|  |  |  | this.$nextTick(() => { | 
|---|
|  |  |  | this.$refs.form.resetFields() | 
|---|
|  |  |  | this.form[this.configData['field.id']] = null | 
|---|
|  |  |  | this.form.type=type | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | return | 
|---|
|  |  |  | } | 
|---|
|  |  |  | // 编辑 | 
|---|
|  |  |  | this.$nextTick(() => { | 
|---|
|  |  |  | console.log('----'); | 
|---|
|  |  |  |  | 
|---|
|  |  |  | this.getDetail(target.id) | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getDetail(id) { | 
|---|
|  |  |  | detailById(id).then(res => { | 
|---|
|  |  |  | this.form = res | 
|---|
|  |  |  | }) | 
|---|
|  |  |  | }, | 
|---|
|  |  |  | getProject() { | 
|---|
|  |  |  | getProjectList({}).then(res => { | 
|---|
|  |  |  | this.projectList = res || [] | 
|---|