From 62a240df3ff2f1bcddea834ccb15fccefc51ae26 Mon Sep 17 00:00:00 2001
From: liuwh <hugeinfo123>
Date: Sat, 09 May 2020 09:18:16 +0800
Subject: [PATCH] 5-8开发任务

---
 SunshineIns/src/page/UnderAgeList.jsx |   74 ++++++++++++++++++++++++++++++++----
 1 files changed, 65 insertions(+), 9 deletions(-)

diff --git a/SunshineIns/src/page/UnderAgeList.jsx b/SunshineIns/src/page/UnderAgeList.jsx
index 272a96d..eadc91b 100644
--- a/SunshineIns/src/page/UnderAgeList.jsx
+++ b/SunshineIns/src/page/UnderAgeList.jsx
@@ -2,6 +2,7 @@
 
 import HeadView from '../view/HeadView';
 import TableBtnView from '../view/TableBtnView';
+import CommonSearchForm from '../view/CommonSearchForm';
 import { Input, Button, DatePicker, Divider, Modal, message } from 'antd'
 import moment from 'moment'
 import Fetch from '../fetch';
@@ -15,25 +16,57 @@
       loading: false,
       visible: false,
       savedate: {},
-      formdata: {},
+      formData: {
+        __key: Date.now(),
+        companyName: '',
+        companyLegal: '',
+        companyTel: '',
+      },
       resetKey: Date.now(),
       closeKey: Date.now()
     };
   }
 
   componentDidMount() {
-    document.title = '涉未成年负责部门组织';
+    document.title = '社会组织维护';
     this.getData();
   }
-  getData = () => {
-    const { formdata } = this.state;
-    Fetch.socialCompany(formdata)
+
+  setFormData = data => {
+    console.log('form', data);
+    this.setState({
+      formData: data,
+    });
+  }
+
+  searchonClick = data => {
+    console.log('form', data);
+    this.setState({
+      formData: data,
+    });
+    this.setState({ loading: true })
+    Fetch.socialCompany({ ...data })
       .then(res => {
         for (var i = 0; i < res.length; i++) {
           res[i]['index'] = i + 1;
         }
         this.setState({
-          data: res
+          data: res,
+          loading: false
+        });
+      });
+  }
+  getData = () => {
+    const { formdata } = this.state;
+    this.setState({ loading: true })
+    Fetch.socialCompany({ formdata })
+      .then(res => {
+        for (var i = 0; i < res.length; i++) {
+          res[i]['index'] = i + 1;
+        }
+        this.setState({
+          data: res,
+          loading: false
         });
       });
   }
@@ -186,12 +219,35 @@
         </span>
       ),
     }];
-    const { data, resetKey, visible, loading, savedate, closeKey } = this.state;
+    const { data, resetKey, visible, loading, savedate, closeKey, formData } = this.state;
     return (
 
       <div className="app-page">
         <HeadView history={this.props.history} />
-        <TableBtnView key={-resetKey} type="infoManage" name='涉未成年负责部门组织' btnName='新建公司' onClick={() => this.showModal('new')}>
+        <div style={{ marginLeft: '90%', marginBottom: '20px', marginTop: '20px' }}>
+          <Button type="primary" size='large' onClick={() => this.showModal('new')}>新增</Button>
+        </div>
+        <div style={{ background: '#fff', margin: 20 }}>
+          <CommonSearchForm
+            {...this.props}
+            formData={formData}
+            setFormData={this.setFormData}
+            searchonClick={this.searchonClick}
+            pathName={this.props.location.pathname}
+            data={[
+              {
+                type: 'input', name: '公司名称', label: '公司名称', key: 'companyName'
+              },
+              {
+                type: 'input', name: '法人姓名', label: '法人姓名', key: 'companyLegal'
+              },
+              {
+                type: 'input', name: '联系电话', label: '联系电话', key: 'companyTel'
+              },
+            ]} />
+          <TableView columns={columns} data={data} pageSize='10' size='default' loading={loading} />
+        </div>
+        {/* <TableBtnView key={-resetKey} type="infoManage" name='社会组织维护' btnName='新建公司' onClick={() => this.showModal('new')}>
           <Input placeholder="根据公司名称模糊查询" style={{ width: "200px" }} name='companyName' onChange={this.onInputChange} />
           <Input placeholder="根据法人姓名模糊查询" style={{ width: "200px" }} name='companyLegal' onChange={this.onInputChange} />
           <Input placeholder="根据联系电话模糊查询" style={{ width: "200px" }} name='companyTel' onChange={this.onInputChange} />
@@ -200,7 +256,7 @@
           <Button type="primary" onClick={this.Seaech}>查询</Button>
           <Button onClick={this.Reset}>重置</Button>
         </TableBtnView>
-        <TableView columns={columns} data={data} pageSize='10' size='default' />
+        <TableView columns={columns} data={data} pageSize='10' size='default' /> */}
         <Modal
           key={closeKey}
           confirmLoading={loading}

--
Gitblit v1.8.0