| | |
| | | |
| | | export default function AgentDialog(props) { |
| | | const formRef = useRef(); |
| | | const [visitList, setVisitList] = useState([]) |
| | | |
| | | useEffect(() => { |
| | | //过滤代理人 |
| | | setVisitList(props.fakeData.filter(item => { |
| | | console.log(item,props.dialogType); |
| | | if (props.dialogType === 2) { |
| | | return item.partyType === 0 |
| | | } else { |
| | | return item.partyType === 1 |
| | | } |
| | | })) |
| | | }, [props.fakeData]) |
| | | |
| | | //保存信息 |
| | | const handleSave = () => { |
| | | if (formRef.current) { |
| | | formRef.current.validate(undefined, (errors, values) => { |
| | | props.handleAddParty({ |
| | | ...values, |
| | | // partyType: props.dialogType, |
| | | // perClass: perClass, |
| | | // perClassName: props.dialogType === 0 ? '申请方代理人' : '被申请方当事人' |
| | | }) |
| | | props.onClose() |
| | | if (!errors) { |
| | | props.handleAddParty({ |
| | | ...values, |
| | | partyType: props.dialogType, |
| | | perClassName: props.dialogType === 2 ? '申请方代理人' : '被申请方代理人', |
| | | }) |
| | | props.onClose() |
| | | } |
| | | }); |
| | | } |
| | | } |
| | | |
| | | return ( |
| | | <div className="applyDialog"> |
| | | <div style={{ height: '590px', overflowY: 'scroll' }}> |
| | |
| | | > |
| | | <CheckboxGroup |
| | | direction='vertical' |
| | | options={props.fakeData.map(x => ({ |
| | | options={visitList.map(x => ({ |
| | | label: <span>{x.trueName} <span style={{ color: '#86909c' }}>({x.perClassName})</span></span>, |
| | | value: x.id, |
| | | }))} |