forked from gzzfw/frontEnd/gzDyh

zhangyongtian
2024-08-15 c5ab5d65e8ed45a0d8afdef512d2265a554dfb71
gz-customerSystem/src/views/register/visit/index.jsx
@@ -14,8 +14,8 @@
import "@arco-design/web-react/dist/css/arco.css";
import '../index.less';
import { Space } from 'antd';
import {Button } from '@arco-design/web-react';
import VisitorRegister from './visitorRegister';
import { Button } from '@arco-design/web-react';
import VisitorRegister from './component/visitorRegister';
import Preview from './preview';
@@ -27,8 +27,9 @@
const Organization = () => {
   // tabs当前选择的标签信息
   const [tabsActive, setTabsActive] = useState('1');
   const formRef = useRef();
   const [tabsActive, setTabsActive] = useState('1');// tabs当前选择的标签信息
   const [isReview, setIsReview] = useState(false);//预览页面控制
   const tabs = [
@@ -41,9 +42,22 @@
   ];
   //保存信息
  const handleSubmit = async () => {
  }
   //提交信息,需要校验规则
   const handleSubmit = async () => {
      if (formRef.current) {
         formRef.current.validate(undefined, (errors, values) => {
            console.log(errors, values);
         });
      }
   }
   //保存草稿信息,不需要校验规则
   const handleSave = async () => {
      if (formRef.current) {
         const data = formRef.current.getFields()
         console.log(data);
      }
   }
   //预览信息
   const handleReview = () => {
@@ -61,10 +75,10 @@
            <RegisterTab tabs={tabs} activeKey={tabsActive} onChange={(activeKey) => setTabsActive(activeKey)} style={{ background: '#fff' }} />
            {tabsActive === '1' &&
               <Fragment>
                  {isReview ? <Preview /> : <VisitorRegister />}
                  {isReview ? <Preview /> : <VisitorRegister formRef={formRef} />}
                  <div className="dataSync-excel">
                     <Space size="large" style={{ margin: '4px 14px' }}>
                        <Button type="primary" style={{ backgroundColor: '#1A6FB8' }} >保存信息</Button>
                        <Button type="primary" style={{ backgroundColor: '#1A6FB8' }} onClick={handleSave} >保存信息</Button>
                        <Button type='outline' style={{ color: '#1A6FB8', border: '1px solid #1A6FB8' }} onClick={handleReview}>预览信息</Button>
                        <Button type='outline' style={{ color: '#1A6FB8', border: '1px solid #1A6FB8' }} onClick={handleSubmit}>提交信息</Button>
                        <Button type='outline' style={{ color: '#1A6FB8', border: '1px solid #1A6FB8' }}>自行受理</Button>