From 950e277be6a245cd02e1e861db87a49b7cf96eb6 Mon Sep 17 00:00:00 2001
From: zhangyongtian <1181606322@qq.com>
Date: Thu, 29 Aug 2024 10:02:29 +0800
Subject: [PATCH] 更改命名

---
 gz-customerSystem/src/views/register/visit/component/applyDialog.jsx |   55 ++++++++++++++++++++++++++++++++++++++-----------------
 1 files changed, 38 insertions(+), 17 deletions(-)

diff --git a/gz-customerSystem/src/views/register/visit/component/applyDialog.jsx b/gz-customerSystem/src/views/register/visit/component/applyDialog.jsx
index 181b8e7..519d615 100644
--- a/gz-customerSystem/src/views/register/visit/component/applyDialog.jsx
+++ b/gz-customerSystem/src/views/register/visit/component/applyDialog.jsx
@@ -1,5 +1,5 @@
 import React, { useState, useEffect, useRef, Fragment } from "react";
-import * as $$ from '../../../../utils/utility';
+import * as $$ from '@/utils/utility';
 import { Row, Col, Space } from 'antd';
 import {
   CheckOutlined,
@@ -11,10 +11,10 @@
   caseperfection_legal_active,
   caseperfection_organize,
   caseperfection_organize_active,
-} from '../../../../assets/images/icon';
+} from '@/assets/images/icon';
 import { Form, Input, Button, Radio, Select, Modal, Cascader, Upload, Message } from '@arco-design/web-react';
-import KeyVisits from "./keyVisits";
-import SelectUnitDialog from "./selectUnitDialog";
+import KeyVisits from "./KeyVisits";
+import SelectUnitDialog from "./SelectUnitDialog";
 import {
   IconLink,
 } from '@arco-design/web-react/icon';
@@ -28,6 +28,15 @@
   const formRef = useRef();
   const [perClass, setPerClass] = useState('09_01001-1');
   const [visible, setVisible] = useState(false);
+
+  useEffect(() => {
+    if (props.editData) {
+      //编辑
+      formRef.current.setFieldsValue({
+        ...props.editData
+      })
+    }
+  }, [])
 
 
   const personIconType = (v) => {
@@ -137,12 +146,16 @@
               label='民族'
               field='nation'
             >
-              <Select placeholder='请选择' allowClear>
-                {['汉族',].map((option, index) => (
-                  <Option key={option} value={option}>
-                    {option}
-                  </Option>
-                ))}
+              <Select
+                placeholder='请选择'
+                allowClear
+                showSearch
+                options={$$.options.nation}
+                filterOption={(inputValue, option) =>
+                  option.props.value.toLowerCase().indexOf(inputValue.toLowerCase()) >= 0 ||
+                  option.props.children.toLowerCase().indexOf(inputValue.toLowerCase()) >= 0
+                }
+              >
               </Select>
             </FormItem>
           </Col>
@@ -271,12 +284,19 @@
     if (formRef.current) {
       formRef.current.validate(undefined, (errors, values) => {
         if (!errors) {
-          props.handleAddParty({
-            ...values,
-            partyType: props.dialogType,
-            perClass: perClass,
-            perClassName: props.dialogType === 0 ? '申请方当事人' : '被申请方当事人'
-          })
+          if (props.editData) {
+            props.handleAddParty({
+              ...props.editData,
+              ...values
+            })
+          } else {
+            props.handleAddParty({
+              ...values,
+              partyType: props.dialogType,
+              perClass: perClass,
+              perClassName: props.dialogType === 0 ? '申请方当事人' : '被申请方当事人'
+            })
+          }
           props.onClose()
         }
       });
@@ -319,6 +339,7 @@
               requiredSymbol={false}
               initialValues={{
               }}//默认值
+              scrollToFirstError
             >
               <Row gutter={[32, 0]} style={{ margin: '0 -10px' }}>{formType(perClass)}</Row>
             </Form>
@@ -336,7 +357,7 @@
           className="dialogPrimary"
           onClick={handleSave}
         >
-          保存信息
+          保存
         </Button>
         <Button className="dialogBack">
           重置

--
Gitblit v1.8.0