lanjianrong 3 years ago
parent
commit
412da00831
1 changed files with 7 additions and 3 deletions
  1. 7 3
      src/pages/Institutions/Staff/components/StaffDetail.tsx

+ 7 - 3
src/pages/Institutions/Staff/components/StaffDetail.tsx

@@ -143,8 +143,10 @@ const StaffDrawer: React.FC<StaffModalProps> = ({
         })
         })
       }
       }
     } else {
     } else {
-      if (type === ModalType.ADD && institutionID) {
-        form.setValues({ institutionID })
+      if (type === ModalType.ADD) {
+        const values = {}
+        if (institutionID) values.institutionID = institutionID
+        form.setValues(values)
       }
       }
     }
     }
     form.setSchemaByPath('accountType', {
     form.setSchemaByPath('accountType', {
@@ -163,8 +165,10 @@ const StaffDrawer: React.FC<StaffModalProps> = ({
         disabled: true
         disabled: true
       })
       })
     }
     }
+
     form.setSchemaByPath('organizationalStructureID', {
     form.setSchemaByPath('organizationalStructureID', {
-      disabled: hiddenOrganization
+      disabled: hiddenOrganization,
+      hidden: !institutionID
     })
     })
     if (type === ModalType.UPDATE || type === ModalType.PREVIEW) {
     if (type === ModalType.UPDATE || type === ModalType.PREVIEW) {
       form.setSchemaByPath('password', {
       form.setSchemaByPath('password', {