|
@@ -311,7 +311,7 @@ class Channel extends Component{
|
|
|
});
|
|
|
}
|
|
|
|
|
|
- loadData(pageNo) {
|
|
|
+ loadData(pageNo = 1) {
|
|
|
this.setState({
|
|
|
listLoading: true,
|
|
|
selectedRows: [],
|
|
@@ -343,29 +343,33 @@ class Channel extends Component{
|
|
|
if (data.error.length > 0) {
|
|
|
message.warning(data.error[0].message);
|
|
|
} else {
|
|
|
- for (let i = 0; i < data.data.list.length; i++) {
|
|
|
- let thisdata = data.data.list[i];
|
|
|
- let diqu =
|
|
|
- (thisdata.province == null ? "" : thisdata.province) +
|
|
|
- (thisdata.city == null ? "" : "-" + thisdata.city) +
|
|
|
- (thisdata.area == null ? "" : "-" + thisdata.area);
|
|
|
- thisdata.key = i;
|
|
|
- thisdata.id = thisdata.uid;
|
|
|
- thisdata.lastFollowTime = thisdata.lastFollowTime &&
|
|
|
- thisdata.lastFollowTime.split(" ")[0];
|
|
|
- thisdata.transferTime= thisdata.transferTime && thisdata.transferTime.split(" ")[0];
|
|
|
- thisdata.surplusFollowTime = thisdata.surplusFollowTime && thisdata.surplusFollowTime.split(" ")[0];
|
|
|
- thisdata.surplusSignTime = thisdata.surplusSignTime && thisdata.surplusSignTime.split(" ")[0];
|
|
|
- thisdata.locationProvince = diqu;
|
|
|
- theArr.push(thisdata);
|
|
|
+ if(data.data.list.length === 0 && pageNo !== 1){
|
|
|
+ this.loadData(pageNo - 1)
|
|
|
+ }else{
|
|
|
+ for (let i = 0; i < data.data.list.length; i++) {
|
|
|
+ let thisdata = data.data.list[i];
|
|
|
+ let diqu =
|
|
|
+ (thisdata.province == null ? "" : thisdata.province) +
|
|
|
+ (thisdata.city == null ? "" : "-" + thisdata.city) +
|
|
|
+ (thisdata.area == null ? "" : "-" + thisdata.area);
|
|
|
+ thisdata.key = i;
|
|
|
+ thisdata.id = thisdata.uid;
|
|
|
+ thisdata.lastFollowTime = thisdata.lastFollowTime &&
|
|
|
+ thisdata.lastFollowTime.split(" ")[0];
|
|
|
+ thisdata.transferTime= thisdata.transferTime && thisdata.transferTime.split(" ")[0];
|
|
|
+ thisdata.surplusFollowTime = thisdata.surplusFollowTime && thisdata.surplusFollowTime.split(" ")[0];
|
|
|
+ thisdata.surplusSignTime = thisdata.surplusSignTime && thisdata.surplusSignTime.split(" ")[0];
|
|
|
+ thisdata.locationProvince = diqu;
|
|
|
+ theArr.push(thisdata);
|
|
|
+ }
|
|
|
+ this.state.pagination.current = data.data.pageNo;
|
|
|
+ this.state.pagination.total = data.data.totalCount;
|
|
|
+ this.setState({
|
|
|
+ pageNo: data.data.pageNo,
|
|
|
+ dataSource: theArr,
|
|
|
+ pagination: this.state.pagination,
|
|
|
+ })
|
|
|
}
|
|
|
- this.state.pagination.current = data.data.pageNo;
|
|
|
- this.state.pagination.total = data.data.totalCount;
|
|
|
- this.setState({
|
|
|
- pageNo: data.data.pageNo,
|
|
|
- dataSource: theArr,
|
|
|
- pagination: this.state.pagination,
|
|
|
- })
|
|
|
}
|
|
|
}.bind(this),
|
|
|
}).always(
|
|
@@ -556,6 +560,7 @@ class Channel extends Component{
|
|
|
//type 0 总监分配 1经理分配 2回收
|
|
|
let arr = this.state.selectedRows.filter(v=>v.status === 1);
|
|
|
let arr1 = this.state.selectedRows.filter(v=>v.status === 2);
|
|
|
+ let arr2 = this.state.selectedRows.filter(v=>v.status !== 1);
|
|
|
if(type === 0 && (arr.length>0 || arr1.length>0)){
|
|
|
message.warning('选中的信息中存在“已分配”数据,请取消这些选项后重新提交')
|
|
|
return;
|
|
@@ -564,6 +569,11 @@ class Channel extends Component{
|
|
|
message.warning('选中的信息中存在“经理已分配”数据,请取消这些选项后重新提交')
|
|
|
return;
|
|
|
}
|
|
|
+ //this.props.deliver && this.props.recovery 用于判断是否为经理
|
|
|
+ if(this.props.deliver === 2 && this.props.recovery && type === 2 && arr2.length>0){
|
|
|
+ message.warning('您只能回收分配状态为"已分配经理"的客户')
|
|
|
+ return;
|
|
|
+ }
|
|
|
if(!remarks){
|
|
|
message.warning(type === 1 ? "请输入分配原因" : type === 2 ? "请输入回收原因" : type === 0 ? "请输入分配原因" : "");
|
|
|
return;
|
|
@@ -618,12 +628,7 @@ class Channel extends Component{
|
|
|
visible:false,
|
|
|
recoveryVisible: false,
|
|
|
},()=>{
|
|
|
- this.loadData(
|
|
|
- Math.min(
|
|
|
- this.state.ispage == undefined ? 1 : this.state.ispage,
|
|
|
- Math.ceil((this.state.pagination.total - 1) / 10)
|
|
|
- )
|
|
|
- );
|
|
|
+ this.loadData(this.state.pageNo);
|
|
|
});
|
|
|
} else {
|
|
|
message.warning(data.error[0].message);
|
|
@@ -896,7 +901,7 @@ class Channel extends Component{
|
|
|
duplicateData:[],
|
|
|
duplicateDataVisible: false
|
|
|
},()=>{
|
|
|
- this.loadData();
|
|
|
+ this.loadData(this.state.pageNo);
|
|
|
})
|
|
|
}}
|
|
|
/> : null}
|