|
@ -31,7 +31,7 @@ function adminModal (props) { |
|
|
} |
|
|
} |
|
|
setPeopleList(departmentList) |
|
|
setPeopleList(departmentList) |
|
|
setDepartmentId(editObj.departments[0].id) |
|
|
setDepartmentId(editObj.departments[0].id) |
|
|
setPeopleId(editObj.id) |
|
|
setPeopleId(editObj.pepUserId) |
|
|
setDisablePeople(false) |
|
|
setDisablePeople(false) |
|
|
} |
|
|
} |
|
|
}, []); |
|
|
}, []); |
|
@ -42,13 +42,19 @@ function adminModal (props) { |
|
|
.validate() |
|
|
.validate() |
|
|
.then((values) => { |
|
|
.then((values) => { |
|
|
if (adminEdit) { |
|
|
if (adminEdit) { |
|
|
|
|
|
dispatch(install.deteleOrganizationAdmin(editObj.id)).then( |
|
|
dispatch(install.postOrganizationUser({ role: ['admin'], pepUserId: values.pepUserId })).then((res) => {//获取项企(PEP)全部部门及其下用户 |
|
|
dispatch(install.postOrganizationUser({ role: ['admin'], pepUserId: values.pepUserId })).then((res) => {//获取项企(PEP)全部部门及其下用户 |
|
|
|
|
|
if(res.success){ |
|
|
close(); |
|
|
close(); |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
|
|
|
) |
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
dispatch(install.postOrganizationUser({ role: ['admin'], pepUserId: values.pepUserId })).then((res) => {//获取项企(PEP)全部部门及其下用户 |
|
|
dispatch(install.postOrganizationUser({ role: ['admin'], pepUserId: values.pepUserId })).then((res) => {//获取项企(PEP)全部部门及其下用户 |
|
|
|
|
|
if(res.success){ |
|
|
close(); |
|
|
close(); |
|
|
|
|
|
} |
|
|
}) |
|
|
}) |
|
|
} |
|
|
} |
|
|
}) |
|
|
}) |
|
@ -79,6 +85,8 @@ function adminModal (props) { |
|
|
labelAlign="right" |
|
|
labelAlign="right" |
|
|
labelWidth="90px" |
|
|
labelWidth="90px" |
|
|
onValueChange={(values, field) => { |
|
|
onValueChange={(values, field) => { |
|
|
|
|
|
for (var key in field) { |
|
|
|
|
|
if (key == 'department') { |
|
|
if (values.department >= 0) { |
|
|
if (values.department >= 0) { |
|
|
let departmentList = [] |
|
|
let departmentList = [] |
|
|
for (let i = 0; i < pepList.length; i++) { |
|
|
for (let i = 0; i < pepList.length; i++) { |
|
@ -88,13 +96,14 @@ function adminModal (props) { |
|
|
} |
|
|
} |
|
|
setPeopleList(departmentList) |
|
|
setPeopleList(departmentList) |
|
|
setDisablePeople(false) |
|
|
setDisablePeople(false) |
|
|
// if(disablePeople){ |
|
|
form.current.setValue('pepUserId', undefined); |
|
|
// form.current.setValue(pepUserId, undefined); |
|
|
|
|
|
// } |
|
|
|
|
|
} |
|
|
} |
|
|
else { |
|
|
else { |
|
|
setPeopleList([]) |
|
|
setPeopleList([]) |
|
|
setDisablePeople(true) |
|
|
setDisablePeople(true) |
|
|
|
|
|
form.current.setValue('pepUserId', undefined); |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
} |
|
|
} |
|
|
}} |
|
|
}} |
|
|
getFormApi={(formApi) => (form.current = formApi)} |
|
|
getFormApi={(formApi) => (form.current = formApi)} |
|
|