diff --git a/src/api/inspect/inspectorg/index.ts b/src/api/inspect/inspectorg/index.ts index ac14300..a676e8c 100644 --- a/src/api/inspect/inspectorg/index.ts +++ b/src/api/inspect/inspectorg/index.ts @@ -2,7 +2,7 @@ import request from '@/config/axios' // 机构 VO export interface InspectOrgVO { - orgID: string // 机构ID + orgid: string // 机构ID orgName: string // 机构名称 address: string // 机构地址 contactTel: string // 联系电话 diff --git a/src/views/inspect/inspectorg/InspectOrgForm.vue b/src/views/inspect/inspectorg/InspectOrgForm.vue index 76d0480..4063393 100644 --- a/src/views/inspect/inspectorg/InspectOrgForm.vue +++ b/src/views/inspect/inspectorg/InspectOrgForm.vue @@ -19,7 +19,7 @@ - + @@ -86,6 +86,7 @@ const formRules = reactive({ orgType: [{ required: true, message: '请选择医院机构类型', trigger: 'change' }], orgName: [{ required: true, message: '请输入机构名称', trigger: 'change' }], contactPerson: [{ required: true, message: '请输入联系人姓名', trigger: 'change' }], + inHisCode: [{ required: true, message: '请输入机构码', trigger: 'change' }], contactTel: [ { required: true, message: '请填入正确的手机号', trigger: 'blur' }, { diff --git a/src/views/inspect/inspectorg/index.vue b/src/views/inspect/inspectorg/index.vue index 46b4732..2e0dccd 100644 --- a/src/views/inspect/inspectorg/index.vue +++ b/src/views/inspect/inspectorg/index.vue @@ -54,7 +54,7 @@ - + diff --git a/src/views/system/user/DeptTree.vue b/src/views/system/user/DeptTree.vue index 5675219..7322afd 100644 --- a/src/views/system/user/DeptTree.vue +++ b/src/views/system/user/DeptTree.vue @@ -1,6 +1,6 @@ @@ -24,29 +24,31 @@ import { ElTree } from 'element-plus' import * as DeptApi from '@/api/system/dept' import { defaultProps, handleTree } from '@/utils/tree' import { DepartmentApi, DepartmentVO } from '@/api/inspect/inspectdepartment/index' +import { InspectOrgApi, InspectOrgVO } from '@/api/inspect/inspectorg/index' defineOptions({ name: 'SystemUserDeptTree' }) -const deptName = ref('') -const deptList = ref([]) // 改为普通数组 +const orgName = ref('') +const orgList = ref([]) // 改为普通数组 const selectedDept = ref('') /** 获取科室列表 */ const getList = async () => { - const res = await DepartmentApi.getListDepartment() - deptList.value = res + const res = await InspectOrgApi.getInspectOrgAll({}) + orgList.value = res + console.log(orgList.value) } /** 过滤后的科室列表 */ const filteredDeptList = computed(() => { - if (!deptName.value) return deptList.value - return deptList.value.filter(item => - item.departmentName.includes(deptName.value) + if (!orgName.value) return orgList.value.list + return orgList.value.list.filter(item => + item.orgName.includes(orgName.value) ) }) /** 处理科室选择 */ const handleDeptChange = (deptId: string | number) => { - const selectedDepartment = deptList.value.find(item => item.departmentCode === deptId) + const selectedDepartment = orgList.value.list.find(item => item.orgid === deptId) emits('node-click', selectedDepartment) } diff --git a/src/views/system/user/UserForm.vue b/src/views/system/user/UserForm.vue index 74551d8..f39f4bd 100644 --- a/src/views/system/user/UserForm.vue +++ b/src/views/system/user/UserForm.vue @@ -14,13 +14,13 @@ - - + + @@ -103,7 +103,7 @@ import * as PostApi from '@/api/system/post' import * as DeptApi from '@/api/system/dept' import * as UserApi from '@/api/system/user' import { FormRules } from 'element-plus' -import { DepartmentApi, DepartmentVO } from '@/api/inspect/inspectdepartment/index' +import { InspectOrgApi, InspectOrgVO } from '@/api/inspect/inspectorg/index' defineOptions({ name: 'SystemUserForm' }) @@ -148,7 +148,7 @@ const formRules = reactive({ ] }) const formRef = ref() // 表单 Ref -const deptList = ref([]) // 树形结构 +const orgList = ref([]) // 树形结构 const postList = ref([] as PostApi.PostVO[]) // 岗位列表 /** 打开弹窗 */ @@ -168,7 +168,8 @@ const open = async (type: string, id?: number) => { } // 加载科室 // deptList.value = handleTree(await DeptApi.getSimpleDeptList()) - deptList.value = await DepartmentApi.getListDepartment() + orgList.value = await InspectOrgApi.getInspectOrgAll({}) + console.log(orgList.value) // 加载岗位列表 // postList.value = await PostApi.getSimplePostList() } diff --git a/src/views/system/user/index.vue b/src/views/system/user/index.vue index 53ce655..e02c6c7 100644 --- a/src/views/system/user/index.vue +++ b/src/views/system/user/index.vue @@ -110,7 +110,7 @@ :show-overflow-tooltip="true" /> { /** 处理部门被点击 */ const handleDeptNodeClick = async (row) => { - queryParams.deptId = row.departmentCode + queryParams.deptId = row.orgid await getList() }