From 9673dbc197de4fd393a9b0b19b91009e5d61ab6c Mon Sep 17 00:00:00 2001
From: dminyi <1301963064@qq.com>
Date: Thu, 22 Aug 2024 14:12:41 +0800
Subject: [PATCH] Merge branch 'master' of http://120.79.193.119:9090/r/gzzfw/frontEnd/gzDyh into master

---
 gz-customerSystem/src/views/register/visit/component/agentDialog.jsx |   31 +++++++++++++++++++++++--------
 1 files changed, 23 insertions(+), 8 deletions(-)

diff --git a/gz-customerSystem/src/views/register/visit/component/agentDialog.jsx b/gz-customerSystem/src/views/register/visit/component/agentDialog.jsx
index 0f92863..5dfe16e 100644
--- a/gz-customerSystem/src/views/register/visit/component/agentDialog.jsx
+++ b/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,
                       }))}

--
Gitblit v1.8.0