lanjianrong преди 3 години
родител
ревизия
55bd1f16d4

+ 5 - 5
config/routes.ts

@@ -59,11 +59,11 @@
           }
           }
         ]
         ]
       },
       },
-      {
-        path: '/project/verification',
-        name: 'verification',
-        component: './Project/Verification'
-      },
+      // {
+      //   path: '/project/verification',
+      //   name: 'verification',
+      //   component: './Project/Verification'
+      // },
       {
       {
         path: '/project/created',
         path: '/project/created',
         name: 'created',
         name: 'created',

+ 8 - 1
src/pages/Institutions/Company/Detail/components/Role.tsx

@@ -1,6 +1,8 @@
 import type { FC } from 'react'
 import type { FC } from 'react'
+import { useEffect, useRef } from 'react'
 import { Card, Form, InputNumber, message } from 'antd'
 import { Card, Form, InputNumber, message } from 'antd'
 
 
+import type { ProFormInstance } from '@ant-design/pro-form'
 import ProForm, { ProFormSelect } from '@ant-design/pro-form'
 import ProForm, { ProFormSelect } from '@ant-design/pro-form'
 import consts from '@/utils/consts'
 import consts from '@/utils/consts'
 import { queryAcountList, saveInstitutionSetting } from '@/services/api/institution'
 import { queryAcountList, saveInstitutionSetting } from '@/services/api/institution'
@@ -13,16 +15,21 @@ interface RoleProps {
 }
 }
 
 
 const Role: FC<RoleProps> = ({ dataID, memberTotal, managerID }) => {
 const Role: FC<RoleProps> = ({ dataID, memberTotal, managerID }) => {
+  const ref = useRef<ProFormInstance>(null)
   const { run: trySave } = useRequest(saveInstitutionSetting, {
   const { run: trySave } = useRequest(saveInstitutionSetting, {
     manual: true,
     manual: true,
     onSuccess: () => {
     onSuccess: () => {
       return message.success('设置成功')
       return message.success('设置成功')
     }
     }
   })
   })
+  useEffect(() => {
+    // eslint-disable-next-line no-unused-expressions
+    ref.current?.setFieldsValue({ accountID: managerID, memberTotal })
+  }, [])
   return (
   return (
     <Card>
     <Card>
       <ProForm
       <ProForm
-        initialValues={{ accountID: managerID, memberTotal }}
+        formRef={ref}
         wrapperCol={{ span: 6 }}
         wrapperCol={{ span: 6 }}
         onFinish={async values => {
         onFinish={async values => {
           await trySave({ ...values, ID: dataID })
           await trySave({ ...values, ID: dataID })

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

@@ -132,12 +132,13 @@ const StaffDrawer: React.FC<StaffModalProps> = ({
       })
       })
       onFieldReact('organizationalStructureID', async field => {
       onFieldReact('organizationalStructureID', async field => {
         if (type === ModalType.PREVIEW) {
         if (type === ModalType.PREVIEW) {
-          field.dataSource = [
-            {
-              label: defaultFormData.organizationalStructure.name,
-              value: defaultFormData.organizationalStructure.ID
-            }
-          ]
+          defaultFormData.organizationalStructure &&
+            (field.dataSource = [
+              {
+                label: defaultFormData.organizationalStructure.name,
+                value: defaultFormData.organizationalStructure.ID
+              }
+            ])
         } else {
         } else {
           const institutionID = form.values.institutionID
           const institutionID = form.values.institutionID
           const dataSource = await loadOrganizationalStructureList({ dataID: institutionID })
           const dataSource = await loadOrganizationalStructureList({ dataID: institutionID })

+ 4 - 3
src/pages/Project/Management/Detail/index.tsx

@@ -50,12 +50,12 @@ const ProjectDetail: React.FC<RouteComponentProps> = ({ location }) => {
             dataID={state.projectInfo?.ID}
             dataID={state.projectInfo?.ID}
             defaultFormData={{
             defaultFormData={{
               createdID: state.projectInfo?.created?.ID,
               createdID: state.projectInfo?.created?.ID,
-              reportAccount: state.projectInfo?.reportAccount.map(item => item.ID)
+              reportAccount: state.projectInfo?.reportAccount?.map(item => item.ID)
             }}
             }}
           />
           />
         )
         )
       case TabEnum.AUDIT_ROLE:
       case TabEnum.AUDIT_ROLE:
-        return <AuditPerm></AuditPerm>
+        return <AuditPerm />
       default:
       default:
         break
         break
     }
     }
@@ -70,7 +70,8 @@ const ProjectDetail: React.FC<RouteComponentProps> = ({ location }) => {
           // { tab: menuMap[TabEnum.AUDIT_ROLE], key: TabEnum.AUDIT_ROLE },
           // { tab: menuMap[TabEnum.AUDIT_ROLE], key: TabEnum.AUDIT_ROLE },
           { tab: menuMap[TabEnum.STAFF_ROLE], key: TabEnum.STAFF_ROLE }
           { tab: menuMap[TabEnum.STAFF_ROLE], key: TabEnum.STAFF_ROLE }
         ]}
         ]}
-        onTabChange={key => setState({ ...state, selectKey: key })}>
+        onTabChange={key => setState({ ...state, selectKey: key })}
+      >
         {renderChildren()}
         {renderChildren()}
       </PageContainer>
       </PageContainer>
     )
     )