|
@@ -33,6 +33,8 @@ import DuplicateData from './duplicateData';
|
|
|
import OperationTips from './operationTips';
|
|
|
import ShowModalDiv from "@/showModal.jsx";
|
|
|
|
|
|
+import './channel.less';
|
|
|
+
|
|
|
const {TabPane} = Tabs;
|
|
|
const { RangePicker } = DatePicker;
|
|
|
|
|
@@ -40,6 +42,7 @@ class Channel extends Component{
|
|
|
constructor(props) {
|
|
|
super(props);
|
|
|
this.state={
|
|
|
+ channelAllocationStatusList : channelAllocationStatus.slice(0,channelAllocationStatus.length-1),
|
|
|
columns: [
|
|
|
{
|
|
|
title: "客户名称",
|
|
@@ -144,15 +147,15 @@ class Channel extends Component{
|
|
|
onChange: info => {
|
|
|
if (info.file.status === "done") {
|
|
|
if (info.file.response && info.file.response.error.length === 0) {
|
|
|
- if(info.file.response.data.list.length > 0){
|
|
|
+ if(info.file.response.data === 1){
|
|
|
+ message.success("导入成功!");
|
|
|
+ this.loadData();
|
|
|
+ }else if(info.file.response.data.list.length > 0){
|
|
|
message.warning('已成功导入!错误/重复客户无法导入,请查看错误渠道数据!');
|
|
|
this.setState({
|
|
|
duplicateData: [],
|
|
|
duplicateDataVisible: true
|
|
|
})
|
|
|
- }else{
|
|
|
- message.success("导入成功!");
|
|
|
- this.loadData();
|
|
|
}
|
|
|
} else {
|
|
|
message.warning(info.file.response.error[0].message);
|
|
@@ -223,6 +226,7 @@ class Channel extends Component{
|
|
|
alignItems:'center',
|
|
|
}}>
|
|
|
<Button
|
|
|
+ disabled={record.status === 2 && this.props.isEditGuidanceLv}
|
|
|
onClick={(e) => {
|
|
|
e.stopPropagation();
|
|
|
if(this.props.isEditGuidanceLv){
|
|
@@ -310,6 +314,8 @@ class Channel extends Component{
|
|
|
loadData(pageNo) {
|
|
|
this.setState({
|
|
|
listLoading: true,
|
|
|
+ selectedRows: [],
|
|
|
+ selectedRowKeys: [],
|
|
|
});
|
|
|
$.ajax({
|
|
|
method: "post",
|
|
@@ -547,13 +553,19 @@ class Channel extends Component{
|
|
|
}
|
|
|
|
|
|
changeAssigner(remarks,type,lv) {
|
|
|
+ //type 0 总监分配 1经理分配 2回收
|
|
|
let arr = this.state.selectedRows.filter(v=>v.status === 1);
|
|
|
- if(type === 0 && arr.length>0){
|
|
|
+ let arr1 = this.state.selectedRows.filter(v=>v.status === 2);
|
|
|
+ if(type === 0 && (arr.length>0 || arr1.length>0)){
|
|
|
message.warning('选中的信息中存在“已分配”数据,请取消这些选项后重新提交')
|
|
|
return;
|
|
|
}
|
|
|
+ if(type === 1 && arr1.length>0){
|
|
|
+ message.warning('选中的信息中存在“经理已分配”数据,请取消这些选项后重新提交')
|
|
|
+ return;
|
|
|
+ }
|
|
|
if(!remarks){
|
|
|
- message.warning(type === 1 ? "请输入转交原因" : type === 2 ? "请输入回收原因" : type === 0 ? "请输入分配原因" : "");
|
|
|
+ message.warning(type === 1 ? "请输入分配原因" : type === 2 ? "请输入回收原因" : type === 0 ? "请输入分配原因" : "");
|
|
|
return;
|
|
|
}
|
|
|
if (this.state.theTypes || lv) {
|
|
@@ -564,7 +576,7 @@ class Channel extends Component{
|
|
|
if(rowItem.recovery === 1 && type === 2){
|
|
|
let arr = this.state.selectedRows.filter(v => v.recovery === 1)
|
|
|
Modal.info({
|
|
|
- title: '以下数据属于回收再分配资源,无法再次回收,请前往列表取消掉标识了“回收”标识的选项',
|
|
|
+ title: '以下数据属于回收再分配资源,无法再次回收',
|
|
|
content: (
|
|
|
<div>
|
|
|
{
|
|
@@ -583,6 +595,7 @@ class Channel extends Component{
|
|
|
changeIds = this.state.selectedRows.length-1 === idx ? changeIds +rowItem.id : changeIds + rowItem.id + ',' ;
|
|
|
}
|
|
|
}
|
|
|
+
|
|
|
$.ajax({
|
|
|
method: "post",
|
|
|
dataType: "json",
|
|
@@ -590,14 +603,14 @@ class Channel extends Component{
|
|
|
url: globalConfig.context + "/api/admin/customer/channelCustomerDeliver",
|
|
|
data: {
|
|
|
userIds: changeIds, //这一行数据的ID
|
|
|
- receiveId: this.state.theTypes, //指定转交人的ID
|
|
|
+ receiveId: this.state.theTypes, //指定分配人的ID
|
|
|
remarks: remarks,
|
|
|
- type,// 0分配 1转交 2回退
|
|
|
+ type, //0总监分配 1经理分配 2回收
|
|
|
},
|
|
|
}).done(
|
|
|
function (data) {
|
|
|
if (!data.error.length) {
|
|
|
- message.success(type === 1 ? "转交成功!" : type === 2 ? "回收成功!" : type === 0 ? "分配成功!" : "");
|
|
|
+ message.success(type === 1 ? "分配成功!" : type === 2 ? "回收成功!" : type === 0 ? "分配成功!" : "");
|
|
|
this.setState({
|
|
|
auto: "",
|
|
|
loading: false,
|
|
@@ -618,7 +631,7 @@ class Channel extends Component{
|
|
|
}.bind(this)
|
|
|
);
|
|
|
} else {
|
|
|
- message.warning("请输入转交人姓名");
|
|
|
+ message.warning("请输入分配人姓名");
|
|
|
}
|
|
|
}
|
|
|
|
|
@@ -666,17 +679,16 @@ class Channel extends Component{
|
|
|
this.setState({ nameSearch: e.target.value });
|
|
|
}}
|
|
|
/>
|
|
|
- {/*0未分配 1已分配 2已存在私有 3已存在公共 4已存在签单*/}
|
|
|
<Select
|
|
|
placeholder="分配状态"
|
|
|
- style={{ width: 80 }}
|
|
|
+ style={{ width: 100 }}
|
|
|
value={this.state.statusSearch}
|
|
|
onChange={(e) => {
|
|
|
this.setState({ statusSearch: e });
|
|
|
}}
|
|
|
>
|
|
|
{
|
|
|
- channelAllocationStatus.map((v,key)=>(
|
|
|
+ this.state.channelAllocationStatusList.map((v,key)=>(
|
|
|
<Select.Option value={v.value} key={key}>
|
|
|
{v.key}
|
|
|
</Select.Option>
|
|
@@ -736,7 +748,7 @@ class Channel extends Component{
|
|
|
dropdownStyle={{ width: 120 }}
|
|
|
style={{ width: "120px" }}
|
|
|
dataSource={options}
|
|
|
- placeholder={this.props.deliver === 1 ? '输入分配人姓名' : '输入转交人姓名'}
|
|
|
+ placeholder={this.props.deliver === 1 ? '输入分配人姓名' : '输入分配人姓名'}
|
|
|
value={this.state.auto}
|
|
|
onChange={this.httpChange}
|
|
|
filterOption={true}
|
|
@@ -757,7 +769,7 @@ class Channel extends Component{
|
|
|
disabled={!hasSelected}
|
|
|
style={{ marginRight: 10 }}
|
|
|
>
|
|
|
- {this.props.deliver === 1 ? '分配' : '转交'}
|
|
|
+ {this.props.deliver === 1 ? '分配' : '分配'}
|
|
|
</Button> : ''}
|
|
|
{this.props.recovery ? <Button
|
|
|
type="primary"
|
|
@@ -900,13 +912,13 @@ class Channel extends Component{
|
|
|
})
|
|
|
}}
|
|
|
/> : '' }
|
|
|
- {/*渠道客户转交*/}
|
|
|
+ {/*渠道客户分配*/}
|
|
|
{this.state.visible ? <OperationTips
|
|
|
- title={'渠道客户转交'}
|
|
|
+ title={'渠道客户分配'}
|
|
|
selectedRows={this.state.selectedRows}
|
|
|
visible={this.state.visible}
|
|
|
onOk={(value)=>{
|
|
|
- // 0分配 1转交 2回退
|
|
|
+ // 0 总监分配 1经理分配 2回收
|
|
|
this.changeAssigner(value,this.props.deliver === 1 ? 0 : this.props.deliver === 2 ? 1 : '')
|
|
|
}}
|
|
|
onCancel={()=>{
|