From 58ae2ba21efcd85df331cf996a94038a77302b51 Mon Sep 17 00:00:00 2001
From: Mr Ke <kelq@hugeinfo.com.cn>
Date: Wed, 27 May 2020 17:07:48 +0800
Subject: [PATCH] 修改报错问题
---
SunshineIns/src/page/UnderAgeList.jsx | 30 +++++++++++++++++++++++++-----
1 files changed, 25 insertions(+), 5 deletions(-)
diff --git a/SunshineIns/src/page/UnderAgeList.jsx b/SunshineIns/src/page/UnderAgeList.jsx
index 4cc1ae6..83bd989 100644
--- a/SunshineIns/src/page/UnderAgeList.jsx
+++ b/SunshineIns/src/page/UnderAgeList.jsx
@@ -21,14 +21,14 @@
companyName: '',
companyLegal: '',
companyTel: '',
- },
+ },
resetKey: Date.now(),
closeKey: Date.now()
};
}
componentDidMount() {
- document.title = '涉未成年负责部门组织';
+ document.title = '社会组织维护';
this.getData();
}
@@ -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}
@@ -244,7 +264,7 @@
]} />
<TableView columns={columns} data={data} pageSize='10' size='default' loading={loading} />
</div>
- {/* <TableBtnView key={-resetKey} type="infoManage" name='涉未成年负责部门组织' btnName='新建公司' onClick={() => this.showModal('new')}>
+ {/* <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} />
--
Gitblit v1.8.0