|
@@ -1,5 +1,5 @@
|
|
|
import React from 'react';
|
|
|
-import { Icon, Button, Input, Select, Spin, Table, Switch, message, DatePicker } from 'antd';
|
|
|
+import { Icon, Button, Input, Select, Spin, Table, Switch, message, DatePicker, Modal } from 'antd';
|
|
|
import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
import moment from 'moment';
|
|
@@ -7,6 +7,73 @@ import './userList.less';
|
|
|
import UserDesc from './userDesc.jsx';
|
|
|
import { auditStatusList } from '../../dataDic.js';
|
|
|
|
|
|
+const OrgAdd = React.createClass({
|
|
|
+ getInitialState() {
|
|
|
+ return {
|
|
|
+ visible: false,
|
|
|
+ loading: false
|
|
|
+ };
|
|
|
+ },
|
|
|
+ showModal() {
|
|
|
+ this.setState({
|
|
|
+ visible: true,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleCancel(e) {
|
|
|
+ this.setState({
|
|
|
+ visible: false,
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleOk() {
|
|
|
+ this.setState({
|
|
|
+ loading: true
|
|
|
+ });
|
|
|
+ $.ajax({
|
|
|
+ method: "post",
|
|
|
+ dataType: "json",
|
|
|
+ crossDomain: false,
|
|
|
+ url: globalConfig.context + "/api/admin/addNewUser",
|
|
|
+ data: {
|
|
|
+ mobile: this.state.mobile,
|
|
|
+ type: 0
|
|
|
+ }
|
|
|
+ }).done(function (data) {
|
|
|
+ this.setState({
|
|
|
+ loading: false
|
|
|
+ });
|
|
|
+ if (!data.error.length) {
|
|
|
+ message.success('新增成功!');
|
|
|
+ this.setState({
|
|
|
+ visible: false,
|
|
|
+ });
|
|
|
+ this.props.closeDesc(false, true);
|
|
|
+ } else {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ };
|
|
|
+ }.bind(this));
|
|
|
+ },
|
|
|
+ render() {
|
|
|
+ return (
|
|
|
+ <div className="patent-desc" style={{ float: 'right', marginRight: '20px' }}>
|
|
|
+ <Button type="primary" onClick={this.showModal}>添加用户</Button>
|
|
|
+ <Modal title="新增个人用户" visible={this.state.visible}
|
|
|
+ onCancel={this.handleCancel}
|
|
|
+ width='350px'
|
|
|
+ footer={[
|
|
|
+ <Button key="submit" type="primary" loading={this.state.loading} onClick={this.handleOk}>提交</Button>,
|
|
|
+ <Button key="back" onClick={this.handleCancel}>返回</Button>
|
|
|
+ ]}
|
|
|
+ className="admin-desc-content">
|
|
|
+ <div className='orgAdd-input'>
|
|
|
+ <span>用户手机号码:</span>
|
|
|
+ <Input onChange={(e) => { this.state.mobile = e.target.value }} />
|
|
|
+ </div>
|
|
|
+ </Modal>
|
|
|
+ </div>
|
|
|
+ );
|
|
|
+ }
|
|
|
+});
|
|
|
+
|
|
|
const UserList = React.createClass({
|
|
|
loadData(pageNo) {
|
|
|
this.state.data = [];
|
|
@@ -43,9 +110,9 @@ const UserList = React.createClass({
|
|
|
createTime: thisdata.createTime,
|
|
|
aftUsername: thisdata.aftUsername,
|
|
|
number: thisdata.number,
|
|
|
- auditStatus:thisdata.auditStatus,
|
|
|
+ auditStatus: thisdata.auditStatus,
|
|
|
createTimeFormattedDate: thisdata.createTimeFormattedDate,
|
|
|
- adminName:thisdata.adminName
|
|
|
+ adminName: thisdata.adminName
|
|
|
});
|
|
|
};
|
|
|
this.state.pagination.current = data.data.pageNo;
|
|
@@ -138,9 +205,11 @@ const UserList = React.createClass({
|
|
|
showDesc: true
|
|
|
});
|
|
|
},
|
|
|
- closeDesc(e) {
|
|
|
+ closeDesc(e, s) {
|
|
|
this.state.showDesc = e;
|
|
|
- this.loadData();
|
|
|
+ if (s) {
|
|
|
+ this.loadData();
|
|
|
+ };
|
|
|
},
|
|
|
search() {
|
|
|
this.loadData();
|
|
@@ -168,6 +237,7 @@ const UserList = React.createClass({
|
|
|
<div className="user-content" >
|
|
|
<div className="content-title">
|
|
|
<span>个人用户管理</span>
|
|
|
+ <OrgAdd closeDesc={this.closeDesc} />
|
|
|
</div>
|
|
|
<div className="user-search">
|
|
|
<Input placeholder="阿凡提号" value={this.state.searchAftId}
|