From c5ab5d65e8ed45a0d8afdef512d2265a554dfb71 Mon Sep 17 00:00:00 2001
From: zhangyongtian <1181606322@qq.com>
Date: Thu, 15 Aug 2024 09:36:09 +0800
Subject: [PATCH] feat:定义弹窗

---
 gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx |  193 ++++++++++++++++++++++++------------------------
 1 files changed, 97 insertions(+), 96 deletions(-)

diff --git a/gz-customerSystem/src/views/register/visit/visitorRegister.jsx b/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx
similarity index 74%
rename from gz-customerSystem/src/views/register/visit/visitorRegister.jsx
rename to gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx
index 9c659c9..a4be24d 100644
--- a/gz-customerSystem/src/views/register/visit/visitorRegister.jsx
+++ b/gz-customerSystem/src/views/register/visit/component/visitorRegister.jsx
@@ -1,12 +1,13 @@
 import React, { useState, useEffect, useRef } from "react";
-import PersonCard from '../../../components/personCard';
-import * as $$ from '../../../utils/utility';
-import { question1 } from '../../../assets/images';
+import PersonCard from '../../../../components/personCard';
+import * as $$ from '../../../../utils/utility';
+import { question1 } from '../../../../assets/images';
 import { Row, Col, Space, Tooltip } from 'antd';
-import { Form, Input, Button, Radio, Select, DatePicker, Cascader } from '@arco-design/web-react';
+import { Form, Input, Button, Radio, Select, DatePicker, Cascader, Modal } from '@arco-design/web-react';
 import "@arco-design/web-react/dist/css/arco.css";
-import TableView from '../../../components/TableView';
-import '../index.less';
+import TableView from '../../../../components/TableView';
+import '../../index.less';
+import ApplyDialog from "./applyDialog";
 
 const RadioGroup = Radio.Group;// 根据调解案号获取纠纷登记信息
 const FormItem = Form.Item;
@@ -14,77 +15,75 @@
 const InputSearch = Input.Search;
 
 
+const VisitorRegister = (props) => {
+  const [fakeData, setFakeData] = useState([
+    // {
+    //   id: 3,
+    //   perClassName: '申请方当事人',
+    //   trueName: '蓝海科技有限公司',
+    //   mobile: '9144010188453Z',
+    //   company: true,
+    //   companyName: '张晓梅',//公司法人
+    //   partyType: 'applicant',//申请人
+    // },
+    // {
+    //   id: 1,
+    //   perClassName: '申请方代理人',
+    //   trueName: '王小明',
+    //   mobile: '410106198802121125',
+    //   person: true,
+    //   personNumber: '13388888888',//联系方式
+    //   partyType: 'applicant',
+    // },
+    // {
+    //   id: 2,
+    //   perClassName: '被申请方当事人',
+    //   trueName: '大海科技有限公司',
+    //   mobile: '13800000002',
+    //   company: true,
+    //   companyName: '郭小聪',//公司法人
+    //   partyType: 'respondent',//被申请方
+    //   remark: [{ label: '精神障碍', color: '#C64FBE' }, { label: '吸毒', color: '#D8A247' }, { label: '社区矫正', color: '#B82F6E' }, { label: '刑满释放', color: '#199C8F' }, { label: '流浪', color: '#3ECB7A' }, { label: '重点青少年', color: '#117AC1' }, { label: '涉稳涉访', color: '#6865D7' }, { label: '潜在风险', color: '#2661CE' }]
+    // },
+    // {
+    //   id: 2,
+    //   perClassName: '被申请方代理人',
+    //   trueName: '张三',
+    //   mobile: '13800000002',
+    //   person: true,
+    //   personNumber: '13399999999',//联系方式
+    //   partyType: 'respondent',
+    //   remark: [{ label: '精神障碍', color: '#C64FBE' }]
+    // },
+    // {
+    //   id: 2,
+    //   perClassName: '被申请方代理人',
+    //   trueName: '张三',
+    //   mobile: '13800000002',
+    //   person: true,
+    //   personNumber: '13399999999',//联系方式
+    //   partyType: 'respondent',
+    //   remark: [{ label: '精神障碍', color: '#C64FBE' }]
+    // },
+    // {
+    //   id: 2,
+    //   perClassName: '被申请方代理人',
+    //   trueName: '张三',
+    //   mobile: '13800000002',
+    //   person: true,
+    //   personNumber: '13399999999',//联系方式
+    //   partyType: 'respondent',
+    //   remark: [{ label: '精神障碍', color: '#C64FBE' }]
+    // },
+  ]);//当事人信息数据
+  const [dialogType, setDialogType] = useState(0);//添加当事人的类型
+  const [addVisabled, setAddVisabled] = useState(false);//添加当事人弹窗控制
 
-function getCaseDataApi(submitData) {
-  return $$.ax.request({ url: `caseInfo/getCaseInfo?id=${submitData}`, type: 'get', service: 'mediate' });
-}
-
-
-
-const Organization = () => {
-  const formRef = useRef();
-
-
-  const fakeData = [
-    {
-      id: 3,
-      perClassName: '申请方当事人',
-      trueName: '蓝海科技有限公司',
-      mobile: '9144010188453Z',
-      company: true,
-      companyName: '张晓梅',//公司法人
-      partyType: 'applicant',//申请人
-    },
-    {
-      id: 1,
-      perClassName: '申请方代理人',
-      trueName: '王小明',
-      mobile: '410106198802121125',
-      person: true,
-      personNumber: '13388888888',//联系方式
-      partyType: 'applicant',
-    },
-    {
-      id: 2,
-      perClassName: '被申请方当事人',
-      trueName: '大海科技有限公司',
-      mobile: '13800000002',
-      company: true,
-      companyName: '郭小聪',//公司法人
-      partyType: 'respondent',//被申请方
-      remark: [{ label: '精神障碍', color: '#C64FBE' }, { label: '吸毒', color: '#D8A247' }, { label: '社区矫正', color: '#B82F6E' }, { label: '刑满释放', color: '#199C8F' }, { label: '流浪', color: '#3ECB7A' }, { label: '重点青少年', color: '#117AC1' }, { label: '涉稳涉访', color: '#6865D7' }, { label: '潜在风险', color: '#2661CE' }]
-    },
-    {
-      id: 2,
-      perClassName: '被申请方代理人',
-      trueName: '张三',
-      mobile: '13800000002',
-      person: true,
-      personNumber: '13399999999',//联系方式
-      partyType: 'respondent',
-      remark: [{ label: '精神障碍', color: '#C64FBE' }]
-    },
-    {
-      id: 2,
-      perClassName: '被申请方代理人',
-      trueName: '张三',
-      mobile: '13800000002',
-      person: true,
-      personNumber: '13399999999',//联系方式
-      partyType: 'respondent',
-      remark: [{ label: '精神障碍', color: '#C64FBE' }]
-    },
-    {
-      id: 2,
-      perClassName: '被申请方代理人',
-      trueName: '张三',
-      mobile: '13800000002',
-      person: true,
-      personNumber: '13399999999',//联系方式
-      partyType: 'respondent',
-      remark: [{ label: '精神障碍', color: '#C64FBE' }]
-    },
-  ];
+  const peopleMap = {
+    0: '申请方',
+    1: '被申请方',
+    2: '代理人'
+  }
 
   const fakeData1 = [
     {
@@ -191,13 +190,12 @@
     },
   ];
 
-
-  function handleCheckParty() {
+  const handleCheckParty = () => {
     console.log('check party');
   }
 
   //获取当前时间
-  function getFormattedDateTime() {
+  const getFormattedDateTime = () => {
     let now = new Date();
     let year = now.getFullYear();
     let month = (now.getMonth() + 1).toString().padStart(2, '0'); // 月份是从0开始的,所以要+1  
@@ -208,21 +206,11 @@
     return `${year}-${month}-${day} ${hours}:${minutes}`;
   }
 
-  //保存信息
-  const handleSubmit = async () => {
-    if (formRef.current) {
-      try {
-        await formRef.current.validate((errors, values) => {
-          console.log(errors, values);
-        });
-        // Message.info('校验通过,提交成功!');
-      } catch (_) {
-        console.log(formRef.current.getFieldsError());
-        // Message.error('校验失败,请检查字段!');
-      }
-    }
+  //添加申请人: 0、被申请人: 1、代理人: 2
+  const handleAdd = (type) => {
+    setDialogType(type)
+    setAddVisabled(true)
   }
-
 
   return (
     <div className='dataSync-page'>
@@ -231,12 +219,13 @@
           <div className='MediationInfo-subTitle' style={{ marginTop: '-6px' }}></div><h5>当事人信息</h5>
         </Space>
       </Col>
-      <div>
+      <div style={{ margin: '16px 0' }}>
         <PersonCard
           isCheck={true}
           partyType={'applicant'} // 这里设定为申请人
           data={fakeData}
           handleCheckParty={handleCheckParty}
+          handleAdd={handleAdd}
         />
       </div>
       <Col span={24} style={{ display: 'flex', alignItems: 'center', marginBottom: '8px' }}>
@@ -245,7 +234,7 @@
         </Space>
       </Col>
       <Form
-        ref={formRef}
+        ref={props.formRef}
         layout='vertical'
         requiredSymbol={false}
         initialValues={{
@@ -414,8 +403,20 @@
         bordered={true}
         style={{ marginBottom: '60px' }}
       />
+      <Modal
+        title={'添加' + peopleMap[dialogType]}
+        visible={addVisabled}
+        onOk={() => setAddVisabled(false)}
+        onCancel={() => setAddVisabled(false)}
+        autoFocus={false}
+        focusLock={true}
+        footer={null}
+      // style={{ width: '1000px' }}
+      >
+        <ApplyDialog />
+      </Modal>
     </div>
   )
 }
 
-export default Organization;
\ No newline at end of file
+export default VisitorRegister;
\ No newline at end of file

--
Gitblit v1.8.0