|
@@ -3,7 +3,6 @@ import { Button,Cascader,Input, Select, Spin, Table, message, Form } from 'antd'
|
|
|
import ajax from 'jquery/src/ajax/xhr.js';
|
|
|
import $ from 'jquery/src/ajax';
|
|
|
import { citySelect, provinceList } from '@/NewDicProvinceList';
|
|
|
-import './publicCustomer.less';
|
|
|
|
|
|
const QueryCustomer = React.createClass({
|
|
|
loadData(pageNo, apiUrl) {
|
|
@@ -39,12 +38,8 @@ const QueryCustomer = React.createClass({
|
|
|
name: thisdata.name,
|
|
|
contacts: thisdata.contacts,
|
|
|
contactMobile: thisdata.contactMobile,
|
|
|
- industry: thisdata.industry,
|
|
|
- societyTag: thisdata.societyTag,
|
|
|
- lastFollowTime:thisdata.lastFollowTime&&thisdata.lastFollowTime.split(' ')[0],
|
|
|
+ createTime:thisdata.createTime&&thisdata.createTime.split(' ')[0],
|
|
|
transferTime:thisdata.transferTime&&thisdata.transferTime.split(' ')[0],
|
|
|
- surplusFollowTime:thisdata.surplusFollowTime&&thisdata.surplusFollowTime.split(' ')[0],
|
|
|
- surplusSignTime:thisdata.surplusSignTime&&thisdata.surplusSignTime.split(' ')[0],
|
|
|
locationProvince: thisdata.province ? thisdata.province + '-' + thisdata.city + '-' + thisdata.area : '--'
|
|
|
});
|
|
|
};
|
|
@@ -127,60 +122,31 @@ const QueryCustomer = React.createClass({
|
|
|
],
|
|
|
}
|
|
|
},
|
|
|
- /*领取所有*/
|
|
|
- receiveAll(){
|
|
|
- this.setState({
|
|
|
- laodingt:true
|
|
|
- });
|
|
|
- let selectIds=[];
|
|
|
- this.state.selectedRows.map((item)=>{
|
|
|
- selectIds.push(`${item.id}`)
|
|
|
- });
|
|
|
- $.ajax({
|
|
|
- type:"get",
|
|
|
- url:"http://abc",
|
|
|
- crossDomain: false,
|
|
|
- data:{
|
|
|
- id:`${selectIds}`
|
|
|
- },
|
|
|
- success:function(data){
|
|
|
- if(data.error && data.error.length) {
|
|
|
- message.warning(data.error[0].message);
|
|
|
- }else{
|
|
|
- message.success('领取成功!')
|
|
|
- this.loadData(this.state.ispage);
|
|
|
- };
|
|
|
- }.bind(this),
|
|
|
- }).always(function(){
|
|
|
- this.setState({
|
|
|
- loading:false
|
|
|
- });
|
|
|
- }.bind(this));
|
|
|
- },
|
|
|
/*单个领取*/
|
|
|
- receive(record){
|
|
|
+ receive(e) {
|
|
|
this.setState({
|
|
|
- laodingt:true
|
|
|
+ loading: true,
|
|
|
+ selectedRowKeys: [],
|
|
|
});
|
|
|
$.ajax({
|
|
|
- type:"get",
|
|
|
- url:"http://abcttt",
|
|
|
+ method: "get",
|
|
|
+ dataType: "json",
|
|
|
crossDomain: false,
|
|
|
- data:{
|
|
|
- id:record.id
|
|
|
- },
|
|
|
- success:function(data){
|
|
|
- if(data.error && data.error.length) {
|
|
|
- message.warning(data.error[0].message);
|
|
|
- }else{
|
|
|
- message.success('领取成功!')
|
|
|
- this.loadData(this.state.ispage);
|
|
|
- };
|
|
|
- }.bind(this),
|
|
|
- }).always(function(){
|
|
|
- this.setState({
|
|
|
- loading:false
|
|
|
- });
|
|
|
+ url: globalConfig.context + "/api/admin/customer/receiveCustomer",
|
|
|
+ data: {
|
|
|
+ uid: e.id,
|
|
|
+ oldAid:e.aid
|
|
|
+ }
|
|
|
+ }).done(function(data) {
|
|
|
+ if(!data.error.length) {
|
|
|
+ message.success('领取成功!');
|
|
|
+ this.setState({
|
|
|
+ loading: false,
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ message.warning(data.error[0].message);
|
|
|
+ };
|
|
|
+ this.loadData(this.state.ispage);
|
|
|
}.bind(this));
|
|
|
},
|
|
|
closeDesc(e) {
|
|
@@ -231,7 +197,6 @@ const QueryCustomer = React.createClass({
|
|
|
},
|
|
|
|
|
|
};
|
|
|
- const hasSelected = this.state.selectedRowKeys.length > 0;
|
|
|
return(
|
|
|
<div className="user-content" >
|
|
|
<div className="content-title">
|
|
@@ -253,7 +218,6 @@ const QueryCustomer = React.createClass({
|
|
|
</span>
|
|
|
<Button type="primary" onClick={this.search}>搜索</Button>
|
|
|
<Button onClick={this.reset}>重置</Button>
|
|
|
- <Button disabled={!hasSelected} onClick={this.receiveAll}>一键领取</Button>
|
|
|
</div>
|
|
|
<div className="patent-table">
|
|
|
<Spin spinning={this.state.loading}>
|