forked from gzzfw/frontEnd/gzDyh

dminyi
2024-08-22 9673dbc197de4fd393a9b0b19b91009e5d61ab6c
gz-customerSystem/src/views/register/visit/component/agentDialog.jsx
@@ -14,21 +14,36 @@
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' }}>
@@ -217,7 +232,7 @@
                  >
                    <CheckboxGroup
                      direction='vertical'
                      options={props.fakeData.map(x => ({
                      options={visitList.map(x => ({
                        label: <span>{x.trueName}&nbsp;&nbsp;<span style={{ color: '#86909c' }}>({x.perClassName})</span></span>,
                        value: x.id,
                      }))}