|
@@ -3,76 +3,78 @@ import { connect } from 'react-redux';
|
|
|
import StaffHeader from '../../common/staffHeader';
|
|
|
import { actionCreators } from './store';
|
|
|
|
|
|
-import { Table, Tag, Space } from 'antd';
|
|
|
+import { Table, Modal,Spin, Space, Tag } from 'antd';
|
|
|
import 'antd/dist/antd.css';
|
|
|
-
|
|
|
-// import DataTable from '../../common/dataTable/dataTable.react';
|
|
|
-const columns = [
|
|
|
- {
|
|
|
- title: '客户名称',
|
|
|
- dataIndex: 'clientname',
|
|
|
- key: 'clientname',
|
|
|
- render: text => <a>{text}</a>,
|
|
|
- },
|
|
|
- {
|
|
|
- title: '地区',
|
|
|
- dataIndex: 'companyname',
|
|
|
- key: 'companyname',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '标签',
|
|
|
- dataIndex: 'telephone',
|
|
|
- key: 'telephone',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '标签',
|
|
|
- dataIndex: 'telephone',
|
|
|
- key: 'telephone',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '标签',
|
|
|
- dataIndex: 'telephone',
|
|
|
- key: 'telephone',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '标签',
|
|
|
- dataIndex: 'telephone',
|
|
|
- key: 'telephone',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '标签',
|
|
|
- dataIndex: 'telephone',
|
|
|
- key: 'telephone',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '标签',
|
|
|
- dataIndex: 'telephone',
|
|
|
- key: 'telephone',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '标签',
|
|
|
- dataIndex: 'telephone',
|
|
|
- key: 'telephone',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '标签',
|
|
|
- dataIndex: 'telephone',
|
|
|
- key: 'telephone',
|
|
|
- },
|
|
|
- {
|
|
|
- title: '标签',
|
|
|
- dataIndex: 'telephone',
|
|
|
- key: 'telephone',
|
|
|
- },
|
|
|
-
|
|
|
-];
|
|
|
+import Popups from '../../common/popups';
|
|
|
|
|
|
|
|
|
+// import DataTable from '../../common/dataTable/dataTable.react';
|
|
|
+// const columns = [
|
|
|
+// {
|
|
|
+// title: '客户名称',
|
|
|
+// dataIndex: 'clientname',
|
|
|
+// key: 'clientname',
|
|
|
+// render: text => <a >{text}</a>,
|
|
|
+// },
|
|
|
+// {
|
|
|
+// title: '地区',
|
|
|
+// dataIndex: 'companyname',
|
|
|
+// key: 'companyname',
|
|
|
+// },
|
|
|
+// {
|
|
|
+// title: '标签',
|
|
|
+// dataIndex: 'telephone',
|
|
|
+// key: 'telephone',
|
|
|
+// },
|
|
|
+// {
|
|
|
+// title: '标签',
|
|
|
+// dataIndex: 'telephone',
|
|
|
+// key: 'telephone',
|
|
|
+// },
|
|
|
+// {
|
|
|
+// title: '标签',
|
|
|
+// dataIndex: 'telephone',
|
|
|
+// key: 'telephone',
|
|
|
+// },
|
|
|
+// {
|
|
|
+// title: '标签',
|
|
|
+// dataIndex: 'telephone',
|
|
|
+// key: 'telephone',
|
|
|
+// },
|
|
|
+// {
|
|
|
+// title: '标签',
|
|
|
+// dataIndex: 'telephone',
|
|
|
+// key: 'telephone',
|
|
|
+// },
|
|
|
+// {
|
|
|
+// title: '标签',
|
|
|
+// dataIndex: 'telephone',
|
|
|
+// key: 'telephone',
|
|
|
+// },
|
|
|
+// {
|
|
|
+// title: '标签',
|
|
|
+// dataIndex: 'telephone',
|
|
|
+// key: 'telephone',
|
|
|
+// },
|
|
|
+// {
|
|
|
+// title: '标签',
|
|
|
+// dataIndex: 'telephone',
|
|
|
+// key: 'telephone',
|
|
|
+// },
|
|
|
+// {
|
|
|
+// title: '标签',
|
|
|
+// dataIndex: 'telephone',
|
|
|
+// key: 'telephone',
|
|
|
+// },
|
|
|
+
|
|
|
+// ];
|
|
|
+
|
|
|
+let popupsObj=null;
|
|
|
|
|
|
class company extends PureComponent {
|
|
|
|
|
|
render() {
|
|
|
- const { companyData, columnsData, companyList, pagination, handleCompanyData, loading, handleCompanyPopups } = this.props;
|
|
|
+ const { companyData, columnsData, companyList, pagination, handleCompanyData, loading, columns, handleCompanyPopups } = this.props;
|
|
|
|
|
|
return (
|
|
|
<Fragment>
|
|
@@ -199,7 +201,14 @@ value={searchValue} onChange={handleInputSearchValue}
|
|
|
<div className="panel-container show ">
|
|
|
<div className="panel-content " >
|
|
|
|
|
|
- <Table onChange={handleCompanyData} pagination={pagination.toJS()} loading={loading} bordered columns={columns} dataSource={companyList.toJS()} />
|
|
|
+ <Table
|
|
|
+ onChange={(pagination, filters, sorter) => handleCompanyData(pagination, filters, sorter, this.props)}
|
|
|
+ pagination={pagination.toJS()}
|
|
|
+ loading={loading}
|
|
|
+ bordered
|
|
|
+ columns={columns.toJS()}
|
|
|
+ dataSource={companyList.toJS()}
|
|
|
+ />
|
|
|
|
|
|
{/* <DataTable url={`/contact/client`} list={companyList} columnsData={columnsData} popups={handleCompanyPopups} /> */}
|
|
|
|
|
@@ -285,14 +294,20 @@ value={searchValue} onChange={handleInputSearchValue}
|
|
|
</div>
|
|
|
|
|
|
</main>
|
|
|
+
|
|
|
+
|
|
|
+
|
|
|
+ <Popups mainView={'company'} onRef={(ref) => popupsObj = ref} />
|
|
|
+
|
|
|
|
|
|
</Fragment>
|
|
|
)
|
|
|
}
|
|
|
|
|
|
componentDidMount() {
|
|
|
- const { handleCompanyData, companyList,pagination } = this.props;
|
|
|
- handleCompanyData(pagination.toJS());
|
|
|
+ const { handleCompanyData, companyList, pagination, handleCompanyPopups } = this.props;
|
|
|
+
|
|
|
+ handleCompanyData(pagination.toJS(), {}, {}, this.props);
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -304,22 +319,28 @@ const mapStateToProps = (state) => {
|
|
|
return {
|
|
|
companyData: state.getIn(['company', 'companyData']),
|
|
|
columnsData: state.getIn(['company', 'columnsData']),
|
|
|
+
|
|
|
companyList: state.getIn(['company', 'companyList']),
|
|
|
pagination: state.getIn(['company', 'pagination']),
|
|
|
loading: state.getIn(['company', 'loading']),
|
|
|
+ columns: state.getIn(['company', 'columns']),
|
|
|
+
|
|
|
+ companyDetail: state.getIn(['popups', 'companyDetail']),
|
|
|
+
|
|
|
}
|
|
|
}
|
|
|
|
|
|
const mapDispathToProps = (dispatch) => {
|
|
|
return {
|
|
|
- handleCompanyData(pagination,filters,sorter) {
|
|
|
+ handleCompanyData(pagination, filters, sorter, props) {
|
|
|
dispatch(actionCreators.changeLoading());
|
|
|
- dispatch(actionCreators.getCompanyLIst(pagination));
|
|
|
+ dispatch(actionCreators.getCompanyLIst(pagination, props));
|
|
|
//(list.size === 0) && dispatch(actionCreators.getCompanyLIst());
|
|
|
},
|
|
|
- handleCompanyPopups(e) {
|
|
|
- console.log('sdd');
|
|
|
- console.log(e);
|
|
|
+ handleCompanyPopups(key) {
|
|
|
+ popupsObj.handleCompanyPopups(key);
|
|
|
+ // console.log(popupsObj);
|
|
|
+ // console.log(key);
|
|
|
},
|
|
|
}
|
|
|
}
|