From d7004986135c0885c1b9a92fb48919179732c00d Mon Sep 17 00:00:00 2001
From: xuxj <hugeinfo123>
Date: Sat, 09 May 2020 09:20:13 +0800
Subject: [PATCH] BUG修改

---
 SunshineIns/src/page/UnderAgeList.jsx |   26 +++++++++++++++++++++++---
 1 files changed, 23 insertions(+), 3 deletions(-)

diff --git a/SunshineIns/src/page/UnderAgeList.jsx b/SunshineIns/src/page/UnderAgeList.jsx
index 4cc1ae6..2861502 100644
--- a/SunshineIns/src/page/UnderAgeList.jsx
+++ b/SunshineIns/src/page/UnderAgeList.jsx
@@ -21,7 +21,7 @@
         companyName: '',
         companyLegal: '',
         companyTel: '',
-    },
+      },
       resetKey: Date.now(),
       closeKey: Date.now()
     };
@@ -45,7 +45,7 @@
       formData: data,
     });
     this.setState({ loading: true })
-    Fetch.socialCompany({...data})
+    Fetch.socialCompany({ ...data })
       .then(res => {
         for (var i = 0; i < res.length; i++) {
           res[i]['index'] = i + 1;
@@ -59,7 +59,7 @@
   getData = () => {
     const { formdata } = this.state;
     this.setState({ loading: true })
-    Fetch.socialCompany({formdata})
+    Fetch.socialCompany({ formdata })
       .then(res => {
         for (var i = 0; i < res.length; i++) {
           res[i]['index'] = i + 1;
@@ -118,6 +118,12 @@
   handleOk = () => {
     this.setState({ loading: true });
     const { savedate } = this.state;
+    if (!savedate.companyName) {
+      this.setState({
+        loading: false
+      });
+      return message.warning("公司名称不能为空");
+    }
     if (savedate.companyTel) {
       if (!validator.mobile(savedate.companyTel)) {
         this.setState({
@@ -125,11 +131,22 @@
         });
         return message.warning("电话号码格式不正确");
       }
+    }else{
+      this.setState({
+        loading: false
+      });
+      return message.warning("电话号码为空");
     }
     if (!savedate.companyAccount) {
+      this.setState({
+        loading: false
+      });
       return message.warning("账号不能为空");
     }
     if (!savedate.companyPassword) {
+      this.setState({
+        loading: false
+      });
       return message.warning("密码不能为控");
     }
     Fetch.socialCompanySave(savedate)
@@ -224,6 +241,9 @@
 
       <div className="app-page">
         <HeadView history={this.props.history} />
+        <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}

--
Gitblit v1.8.0