Explorar el Código

fix: 人资部门列表

outaozhen hace 5 años
padre
commit
f92abcd6dd

+ 3 - 3
src/components/EditableForm/src/useOptions.js

@@ -8,7 +8,7 @@ const genderOptions = [
 const typeEnum = {
   NATUREIDS: 'natureIds',
   GENDER: 'gender',
-  DEPARTMENTS: 'departments'
+  DEPARTMENTS: 'category'
 }
 
 export default function useOptions(type) {
@@ -24,7 +24,7 @@ export default function useOptions(type) {
       }
     }
     if (type === typeEnum.DEPARTMENTS) {
-      if (!store.getState().staff.natures.length) {
+      if (!store.getState().staff.departments.length) {
         dispatch({
           type: 'staff/fetchDepartments'
         })
@@ -38,7 +38,7 @@ export default function useOptions(type) {
     return store.getState().customer.natures
   }
   if (type === typeEnum.DEPARTMENTS) {
-    return store.getState().staff.natures
+    return store.getState().staff.departments
   }
   return null
 }

+ 2 - 1
src/pages/Staff/Employee/components/ChangeTreeSelect/index.jsx

@@ -3,6 +3,7 @@ import { TreeSelect } from 'antd'
 
 const ChangeTreeSelect = props => {
   const { defaultValue, refinstance, options, onSave } = props
+  console.log(options)
   const [selectedObj, setSelectedObj] = useState({ value: defaultValue, label: '' })
   const handleOnChange = (value, option) => {
     let local = ''
@@ -26,7 +27,7 @@ const ChangeTreeSelect = props => {
         defaultValue={defaultValue}
         ref={refinstance}
         onBlur={() => onSave({ currentTarget: { ...selectedObj } })}
-        options={options}
+        treeData={options}
         defaultOpen={true}
         mode={Array.isArray(selectedObj.value)}
         onChange={handleOnChange}

+ 1 - 1
src/pages/Staff/Employee/components/EmployeeDetail/EmployeeForm.jsx

@@ -225,7 +225,7 @@ const EmployeeForm = props => {
         columns={columns}
         dataSource={staff}
         type="employee"
-        tartgetUrl="/data/update"
+        tartgetUrl="/staff/change/department"
       />
     </div>
   )