Browse Source

巡检计划只能选关注结构物的巡检人

master
liujiangyong 2 years ago
parent
commit
0c0e01b936
  1. 8
      web/client/src/sections/patrolManage/components/planModal.js

8
web/client/src/sections/patrolManage/components/planModal.js

@ -33,7 +33,7 @@ const PlanModal = ({ visible, onCreate, onCancel, dispatch, userLoading, userLis
useEffect(() => { useEffect(() => {
if (userList.length) { if (userList.length) {
setUserOpt(userList.map(u => ({ label: u.name, value: u.id }))) setUserOpt(userList?.filter(f => f.structure?.includes(curRecord?.project?.id))?.map(u => ({ label: u.name, value: u.id })))
} }
}, [userList]) }, [userList])
@ -104,13 +104,15 @@ const PlanModal = ({ visible, onCreate, onCancel, dispatch, userLoading, userLis
{ required: true, message: '请选择结构物' }, { required: true, message: '请选择结构物' },
]} ]}
> >
<Select disabled={type === 'view'} options={struOpt} loading={struLoading} onChange={(value) => { <Select disabled={type === 'view'} options={struOpt} loading={struLoading} onChange={(projectId) => {
dispatch(positionList({ projectId: value })).then(res => { dispatch(positionList({ projectId })).then(res => {
if (res.success) { if (res.success) {
setPoints(res.payload.data?.rows) setPoints(res.payload.data?.rows)
setPointOpt(res.payload.data?.rows[0]?.points?.map(p => ({ label: p.name, value: p.id }))) setPointOpt(res.payload.data?.rows[0]?.points?.map(p => ({ label: p.name, value: p.id })))
} }
}) })
form.setFieldsValue({ userId: null });
setUserOpt(userList?.filter(f => f.structure?.includes(projectId))?.map(u => ({ label: u.name, value: u.id })))
}} /> }} />
</Form.Item> </Form.Item>
<Form.Item <Form.Item

Loading…
Cancel
Save