|
@@ -3,15 +3,22 @@ import { connect } from 'react-redux';
|
|
|
import StaffHeader from '../../common/staffHeader';
|
|
|
import { actionCreators } from './store';
|
|
|
|
|
|
-import { Table, Modal, Spin, Space, Tag } from 'antd';
|
|
|
+import { Table, Radio, Spin, Space, Tag } from 'antd';
|
|
|
import 'antd/dist/antd.css';
|
|
|
import Popups from '../../common/popups';
|
|
|
|
|
|
+const radioStyle = {
|
|
|
+ display: 'block',
|
|
|
+ height: '30px',
|
|
|
+ lineHeight: '30px',
|
|
|
+};
|
|
|
+
|
|
|
let popupsObj = null;
|
|
|
class company extends PureComponent {
|
|
|
|
|
|
render() {
|
|
|
- const { handleInputChange, columnsVisible, companyList, pagination, handleCompanyData, loading, columns, handleColumnsShow } = this.props;
|
|
|
+ const { columnsVisible, companyList, pagination, handleCompanyData, loading, columns, sortField, sort,
|
|
|
+ handleColumnsShow, handleInputChange, handleCompanySortField } = this.props;
|
|
|
|
|
|
return (
|
|
|
<Fragment>
|
|
@@ -93,40 +100,31 @@ value={searchValue} onChange={handleInputSearchValue}
|
|
|
<div className="col-auto pl-0">
|
|
|
<button className="btn btn-sm btn-default" data-toggle="dropdown"><i className="fal fa-sort-amount-down"></i> 排序</button>
|
|
|
<div className="dropdown-menu dropdown-menu-right" id="paixu">
|
|
|
- {/* <ul className="list-unstyled px-3 pt-2 mb-0">
|
|
|
- <li className="mb-2">
|
|
|
- <div className="custom-control custom-radio">
|
|
|
- <input type="radio" className="custom-control-input" id="pai1" name="paizhi" checked="" />
|
|
|
- <label className="custom-control-label" forHtml="pai1">添加时间</label>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- <li className="mb-2">
|
|
|
- <div className="custom-control custom-radio">
|
|
|
- <input type="radio" className="custom-control-input" id="pai2" name="paizhi" />
|
|
|
- <label className="custom-control-label" forHtml="pai2">编辑时间</label>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
+ <ul className="list-unstyled px-3 pt-2 mb-0">
|
|
|
<li className="mb-2">
|
|
|
- <div className="custom-control custom-radio">
|
|
|
- <input type="radio" className="custom-control-input" id="pai3" name="paizhi" />
|
|
|
- <label className="custom-control-label" forHtml="pai3">记录时间</label>
|
|
|
- </div>
|
|
|
+
|
|
|
+ <Radio.Group onChange={(e) => handleCompanySortField(pagination.toJS(),this.props,e)} value={sortField}>
|
|
|
+ <Radio style={radioStyle} value='CREATETIME'>
|
|
|
+ 添加时间
|
|
|
+ </Radio>
|
|
|
+ <Radio style={radioStyle} value='UPDATETIME'>
|
|
|
+ 编辑时间
|
|
|
+ </Radio>
|
|
|
+ </Radio.Group>
|
|
|
</li>
|
|
|
</ul>
|
|
|
<ul className="list-unstyled px-3 pt-2 mb-0 border-top">
|
|
|
<li className="mb-2">
|
|
|
- <div className="custom-control custom-radio">
|
|
|
- <input type="radio" className="custom-control-input" id="pdown" name="paixu" checked="" />
|
|
|
- <label className="custom-control-label" forHtml="pdown">降序</label>
|
|
|
- </div>
|
|
|
+ <Radio.Group onChange={this.onChange} value={sort}>
|
|
|
+ <Radio style={radioStyle} value='DESC'>
|
|
|
+ 递减
|
|
|
+ </Radio>
|
|
|
+ <Radio style={radioStyle} value='ASC'>
|
|
|
+ 递增
|
|
|
+ </Radio>
|
|
|
+ </Radio.Group>
|
|
|
</li>
|
|
|
- <li className="mb-2">
|
|
|
- <div className="custom-control custom-radio">
|
|
|
- <input type="radio" className="custom-control-input" id="pup" name="paixu" />
|
|
|
- <label className="custom-control-label" forHtml="pup">升序</label>
|
|
|
- </div>
|
|
|
- </li>
|
|
|
- </ul> */}
|
|
|
+ </ul>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
@@ -147,83 +145,6 @@ value={searchValue} onChange={handleInputSearchValue}
|
|
|
dataSource={companyList.toJS()}
|
|
|
/>
|
|
|
|
|
|
- {/* <DataTable url={`/contact/client`} list={companyList} columnsData={columnsData} popups={handleCompanyPopups} /> */}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
- {/* this.constructClientColumns() this.constructClientThead() */}
|
|
|
-
|
|
|
- {/* <table id="dt-basic-example" className="table table-bordered table-hover table-striped w-100">
|
|
|
- <thead>
|
|
|
- <tr>
|
|
|
- <th>联系人</th>
|
|
|
- <th>客户名称</th>
|
|
|
- <th>手机</th>
|
|
|
- <th>电话</th>
|
|
|
- <th>QQ</th>
|
|
|
- <th>部门</th>
|
|
|
- <th>职务</th>
|
|
|
- <th>办公室</th>
|
|
|
- <th>地区</th>
|
|
|
- <th>个人标签</th>
|
|
|
- <th>协作标签</th>
|
|
|
- <th>地址</th>
|
|
|
- <th>乘车</th>
|
|
|
- <th>地标</th>
|
|
|
- <th>住宿</th>
|
|
|
- <th>备注</th>
|
|
|
- <th>软件锁</th>
|
|
|
- <th>大司空</th>
|
|
|
- <th>养护云</th>
|
|
|
- <th>创建人</th>
|
|
|
- </tr>
|
|
|
- </thead>
|
|
|
- <tbody>
|
|
|
-
|
|
|
- {
|
|
|
-
|
|
|
- companyList.map((item) => {
|
|
|
- return (
|
|
|
- <tr key={item.get('id')} >
|
|
|
- <td><a href="#detail" data-toggle="modal" data-target="#detail">{item.get('clientname')}</a></td>
|
|
|
- <td><a href="#com-detail" data-toggle="modal" data-target="#com-detail">{item.get('companyname')}</a></td>
|
|
|
- <td>{item.get('telephone')}</td>
|
|
|
- <td>{item.get('phone')}</td>
|
|
|
- <td>{item.get('qq')}</td>
|
|
|
- <td>{item.get('department')}</td>
|
|
|
- <td>{item.get('position')}</td>
|
|
|
- <td>{item.get('office')}</td>
|
|
|
- <td>{item.get('local')}</td>
|
|
|
- <td>个人标签</td>
|
|
|
- <td><span className="badge tagcol-01">
|
|
|
- <span className="d-inline-block text-truncate text-truncate-xs">这是一条标签名字很长很长的标签</span></span><span className="badge tagcol-02">
|
|
|
- <span className="d-inline-block text-truncate text-truncate-xs">特别关注</span>
|
|
|
- </span>
|
|
|
- <a data="添加标签" className="badge badge-secondary tagcol-08" href="" data-toggle="dropdown"><i className="far fa-plus"></i></a>
|
|
|
- </td>
|
|
|
- <td>{item.get('address')}</td>
|
|
|
- <td>{item.get('ride')}</td>
|
|
|
- <td>{item.get('landmarks')}</td>
|
|
|
- <td>{item.get('stay')}</td>
|
|
|
- <td>{item.get('mark')}</td>
|
|
|
- <td><a href="#lock-detail" data-toggle="modal" data-target="#lock-detail">HNYH-0654</a></td>
|
|
|
- <td>大司空</td>
|
|
|
- <td>养护云</td>
|
|
|
- <td>创建人</td>
|
|
|
- </tr>
|
|
|
- )
|
|
|
- })
|
|
|
- }
|
|
|
- </tbody>
|
|
|
-
|
|
|
- </table> */}
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
-
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -242,9 +163,9 @@ value={searchValue} onChange={handleInputSearchValue}
|
|
|
}
|
|
|
|
|
|
componentDidMount() {
|
|
|
- const { handleCompanyData, handleColumnsAllShow, pagination, handleCompanyPopups } = this.props;
|
|
|
- handleColumnsAllShow();
|
|
|
+ const { handleCompanyData, handleColumnsAllShow, pagination } = this.props;
|
|
|
handleCompanyData(pagination.toJS(), {}, {}, this.props);
|
|
|
+ //handleColumnsAllShow();
|
|
|
}
|
|
|
|
|
|
}
|
|
@@ -254,14 +175,13 @@ value={searchValue} onChange={handleInputSearchValue}
|
|
|
|
|
|
const mapStateToProps = (state) => {
|
|
|
return {
|
|
|
- companyData: state.getIn(['company', 'companyData']),
|
|
|
-
|
|
|
columnsVisible: state.getIn(['company', 'columnsVisible']),
|
|
|
companyList: state.getIn(['company', 'companyList']),
|
|
|
pagination: state.getIn(['company', 'pagination']),
|
|
|
loading: state.getIn(['company', 'loading']),
|
|
|
columns: state.getIn(['company', 'columns']),
|
|
|
-
|
|
|
+ sortField: state.getIn(['company', 'sortField']),
|
|
|
+ sort: state.getIn(['company', 'sort']),
|
|
|
|
|
|
companyDetail: state.getIn(['popups', 'companyDetail']),
|
|
|
|
|
@@ -271,21 +191,19 @@ const mapStateToProps = (state) => {
|
|
|
const mapDispathToProps = (dispatch) => {
|
|
|
return {
|
|
|
//列隐藏显示
|
|
|
- handleInputChange(e, index) {//---此方法可能废弃
|
|
|
-
|
|
|
- //dt.handleColumnVisible(index, e.target.value);
|
|
|
- },
|
|
|
handleColumnsShow(index) {
|
|
|
dispatch(actionCreators.toggleColumns(index));
|
|
|
},
|
|
|
- handleColumnsAllShow() {
|
|
|
- dispatch(actionCreators.toggleColumnsAll());
|
|
|
- },
|
|
|
//获得客户数据
|
|
|
handleCompanyData(pagination, filters, sorter, props) {
|
|
|
dispatch(actionCreators.changeLoading());
|
|
|
dispatch(actionCreators.getCompanyLIst(pagination, props));
|
|
|
- //(list.size === 0) && dispatch(actionCreators.getCompanyLIst());
|
|
|
+ },
|
|
|
+ //排序设置
|
|
|
+ handleCompanySortField(pagination, props,e) {
|
|
|
+ dispatch(actionCreators.changeSortField(e.target.value));
|
|
|
+ props.sortField;
|
|
|
+ //dispatch(actionCreators.getCompanyLIst(pagination, props));
|
|
|
},
|
|
|
//弹出详情页点击触发
|
|
|
handleCompanyPopups(key) {
|