| | |
| | | <!-- </el-form-item>--> |
| | | <!-- </el-col>--> |
| | | <el-col :span="12"> |
| | | <el-form-item label="项目单位" label-width="120px" prop="investmentType" style="width: 100%"> |
| | | <el-input v-model="legalPersonForm.projectUnit" class="item" clearable maxlength="255" placeholder="请输入"/> |
| | | <el-form-item label="项目单位" label-width="120px" prop="investmentType" |
| | | > |
| | | <el-select |
| | | v-model="legalPersonForm.projectUnit" |
| | | filterable |
| | | placeholder="请选择或输入" |
| | | style="width: 100%;" |
| | | @change="handleSelectChange" |
| | | remote |
| | | :remote-method="handleBlur" |
| | | > |
| | | <el-option |
| | | v-for="item in options" |
| | | :key="item.id" |
| | | :label="item.projectUnit" |
| | | :value="item.id" |
| | | > |
| | | </el-option> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | |
| | | |
| | | <el-col :span="6"> |
| | | <el-form-item label="项目单位类型" label-width="120px" prop="projectType" style="width: 100%"> |
| | | <el-select |
| | |
| | | import { |
| | | addProjectUnitRegistrationInfo, |
| | | editProjectUnitRegistrationInfo, |
| | | getProjectUnitRegistrationInfoById |
| | | getProjectUnitRegistrationInfoById, |
| | | getUnitRegistrationInfoByName |
| | | } from "@/api/projectEngineering/projectUnitRegistrationInfo"; |
| | | |
| | | export default { |
| | |
| | | }, |
| | | data() { |
| | | return { |
| | | //项目单位选择框 |
| | | selectProjectUnit:'', |
| | | projectForm: {}, |
| | | //单位法人信息 |
| | | options:[], |
| | | legalPersonForm: { |
| | | // id: '', |
| | | // totalInvestment: '', |
| | | // projectUnit: '', |
| | | projectUnit: '', |
| | | // projectUnitType: '', |
| | | // registrationType: '', |
| | | // holdingSituation: '', |
| | |
| | | } |
| | | |
| | | this.legalPersonForm.projectId = this.projectForm.id; |
| | | this.handleBlur(); |
| | | }, |
| | | beforeDestroy() { |
| | | if(Object.keys(this.legalPersonForm).length !==0) localStorage.setItem("legalPersonForm", JSON.stringify(this.legalPersonForm)); |
| | | }, |
| | | methods: { |
| | | |
| | | handleSelectChange(row) { |
| | | if (this.options !== null) { |
| | | this.options.forEach(item => { |
| | | if (item.id === row) { |
| | | this.legalPersonForm = item; |
| | | } |
| | | }) |
| | | } |
| | | |
| | | }, |
| | | //项目单位输入时触发 |
| | | handleBlur(query){ |
| | | console.log(query) |
| | | this.legalPersonForm.projectUnit = query; |
| | | if (this.legalPersonForm.projectUnit !== null && this.legalPersonForm.projectUnit !== '' && this.legalPersonForm.projectUnit !== undefined){ |
| | | getUnitRegistrationInfoByName(this.legalPersonForm).then(res =>{ |
| | | this.options = res.data; |
| | | }) |
| | | } |
| | | }, |
| | | getProjectUnitRegistrationInfo() { |
| | | getProjectUnitRegistrationInfoById(this.$route.query.projectId).then(res => { |
| | | this.legalPersonForm = res.data; |
| | |
| | | }, |
| | | }, |
| | | watch: { |
| | | 'legalPersonForm.projectUnit':{ |
| | | deep:true, |
| | | handler(newVal) { |
| | | if (newVal === null || newVal === ''){ |
| | | this.options = null; |
| | | } |
| | | } |
| | | }, |
| | | legalPersonForm: { |
| | | deep: true, |
| | | handler(newVal) { |
| | | this.$emit('legalPersonForm', newVal) |
| | | } |
| | | } |
| | | }, |
| | | |
| | | |
| | | |
| | | } |
| | | } |
| | | </script> |