| | |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | <el-row :gutter="20"> |
| | | <el-col :span="6"> |
| | | <el-form-item label="行业主管部门" label-width="100px" prop="industryCompetentDepartment" style="width: 100%"> |
| | | <el-select |
| | | v-model="projectForm.industryCompetentDepartment" |
| | | clearable |
| | | @change="handleDepartmentChange" |
| | | placeholder="请选择" |
| | | style="width: 100%;" |
| | | > |
| | | <el-option |
| | | v-for="item in approvalList" |
| | | :key="item.id" |
| | | :value="item.id" |
| | | :label="item.value" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="联系人" label-width="100px" style="width: 100%"> |
| | | <el-select |
| | | v-model="projectForm.industryCompetentDepartmentPerson" |
| | | clearable |
| | | placeholder="请选择" |
| | | @change="handleContactChange" |
| | | style="width: 100%;" |
| | | > |
| | | <el-option |
| | | v-for="person in personList" |
| | | :key="person.userId" |
| | | :value="person.userId" |
| | | :label="person.nickName" |
| | | /> |
| | | </el-select> |
| | | </el-form-item> |
| | | </el-col> |
| | | <el-col :span="6"> |
| | | <el-form-item label="联系人联系方式" label-width="100px" style="width: 100%"> |
| | | <el-input |
| | | v-model="projectForm.departmentPersonPhone" |
| | | clearable |
| | | placeholder="请输入联系方式" |
| | | /> |
| | | </el-form-item> |
| | | </el-col> |
| | | </el-row> |
| | | </div> |
| | | </div> |
| | | <div class="label"> |
| | |
| | | // import { getList } from '@/api/engineeringLibrary/index'; |
| | | // import RemoteSelect from '@/components/RemoteSelect/index.vue'; |
| | | import Cookies from "js-cookie"; |
| | | import {addProject, getProject, updateProject, getProjectCode} from '@/api/projectEngineering/projectInfo'; |
| | | import {addProject, getProject, updateProject, getProjectCode, editProject} from '@/api/projectEngineering/projectInfo'; |
| | | import {approvalList} from "@/api/system/dept"; |
| | | import {getByDept} from "@/api/system/user"; |
| | | |
| | | export default { |
| | | name: 'BasicInfo', |
| | |
| | | engineeringInfos: [], |
| | | competentDepartmentList: [], |
| | | managementCentralizationList: [], |
| | | remark: '' |
| | | remark: '', |
| | | industryCompetentDepartment: null, |
| | | industryCompetentDepartmentPerson: null, |
| | | departmentPersonPhone: null, |
| | | }, |
| | | personList: [], |
| | | subclass: '', |
| | | largeCategory: '', |
| | | approvalList: [], |
| | |
| | | const projectForm = localStorage.getItem("projectForm"); |
| | | //初始化主管部门下拉框 |
| | | this.getApprovalList(); |
| | | |
| | | if (projectForm) { |
| | | this.projectForm = JSON.parse(projectForm); |
| | | if (this.projectForm.industryCompetentDepartment) { |
| | | // 根据选中的部门ID查询人员 |
| | | getByDept(this.projectForm.industryCompetentDepartment).then((res) => { |
| | | this.personList = res.data; |
| | | }) |
| | | } |
| | | this.$emit('updateIsShow', true); |
| | | } else { |
| | | this.projectForm.id = this.$route.query.projectId; |
| | |
| | | // localStorage.setItem("projectForm", JSON.stringify(this.projectForm)); |
| | | }, |
| | | methods: { |
| | | // 监听联系人选择事件 |
| | | handleContactChange(userId) { |
| | | if (userId) { |
| | | // 根据选中的userId查找对应的联系人 |
| | | const selectedPerson = this.personList.find(person => person.userId === userId); |
| | | if (selectedPerson) { |
| | | // 将联系人的phone字段回填到联系电话输入框 |
| | | this.projectForm.departmentPersonPhone = selectedPerson.phonenumber; |
| | | } else { |
| | | // 如果未找到联系人,清空联系电话 |
| | | this.projectForm.departmentPersonPhone = ''; |
| | | } |
| | | } else { |
| | | // 如果userId为空,清空联系电话 |
| | | this.projectForm.departmentPersonPhone = ''; |
| | | } |
| | | }, |
| | | handleDepartmentChange(departmentId) { |
| | | if (departmentId) { |
| | | // 根据选中的部门ID查询人员 |
| | | getByDept(departmentId).then((res) => { |
| | | this.personList = res.data; |
| | | }) |
| | | } else { |
| | | // 如果未选择部门,清空人员列表 |
| | | this.personList = []; |
| | | } |
| | | this.$set(this.projectForm, 'industryCompetentDepartmentPerson', null); |
| | | this.$set(this.projectForm, 'departmentPersonPhone', ''); |
| | | }, |
| | | addWinUnit() { |
| | | this.projectForm.winUnitList.push({ |
| | | winUnit: '', |
| | |
| | | getProjectInfo(id) { |
| | | getProject(id).then(res => { |
| | | this.projectForm = res.data; |
| | | if (this.projectForm.industryCompetentDepartment) { |
| | | // 根据选中的部门ID查询人员 |
| | | getByDept(this.projectForm.industryCompetentDepartment).then((res) => { |
| | | this.personList = res.data; |
| | | }) |
| | | } |
| | | this.$emit('updateIsShow', true); |
| | | |
| | | }); |
| | | }, |
| | | getApprovalList() { |