| 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142 | import React,{Component} from "react";import {    AutoComplete,    Button,    Cascader,    DatePicker,    Input,    message,    Select,    Spin,    Table,    Tabs,    Tooltip,    Upload,    Modal, Tag} from "antd";import {ChooseList} from "../../../order/orderNew/chooseList";import $ from "jquery/src/ajax";import {    getSocialAttribute,    ShowModal,    getChannelAllocationStatus} from "@/tools.js";import {    channelAllocationStatus} from "@/dataDic.js";import { citySelect, provinceList } from '@/NewDicProvinceList';import moment from "moment";import FollowDetail from "./followDetail";import IntentionDetail from "./intentionDetail/intentionDetail";import TransferRecords from './transferRecords';import DuplicateData from './duplicateData';import OperationTips from './operationTips';import ShowModalDiv from "@/showModal.jsx";import './channel.less';import EnterpriseNameChange from "../../../../common/enterpriseNameChange";const {TabPane} = Tabs;const { RangePicker } = DatePicker;const Option = Select.Option;class Channel extends Component{    constructor(props) {        super(props);        this.state={            isGuidance:false,            isEditGuidance: true,            upLoadFileLoading:false,            channelAllocationStatusList : channelAllocationStatus.slice(0,channelAllocationStatus.length-2),            columns: [                {                    title: "客户名称",                    dataIndex: "userName",                    key: "userName",                    render: (text,record) => {                        return (                            <span>                                {record.recovery === 1 ? <div style={{                                    background:'#ef7207',                                    color:'#FFF',                                    padding: '1px 7px',                                    borderRadius:'5px',                                    fontSize:'12px',                                    display: 'inline-block',                                    marginRight:'10px'                                }}>                                    回收                                </div> : null}                                <Tooltip title={text}>                                    <div style={{                                        maxWidth:'150px',                                        overflow:'hidden',                                        textOverflow: "ellipsis",                                        whiteSpace:'nowrap',                                    }}>{text}</div>                                 </Tooltip>				            </span>                        )                    },                },                {                    title: "地区",                    dataIndex: "locationProvince",                    key: "locationProvince",                },                {                    title: "社会性质",                    dataIndex: "societyTag",                    key: "societyTag",                    render: (text) => {                        return getSocialAttribute(text);                    },                },                {                    title: "渠道专员",                    dataIndex: "channelName",                    key: "channelName",                },                {                    title: "客户联系人",                    dataIndex: "contacts",                    key: "contacts",                },                {                    title: "联系电话",                    dataIndex: "contactMobile",                    key: "contactMobile",                },                {                    title: "渠道初始时间",                    dataIndex: "createTimes",                    key: "createTimes",                },                {                    title: "分配状态",                    dataIndex: "status",                    key: "status",                    render: (text) => (                        getChannelAllocationStatus(text,true)                    )                },            ],            changeList:[],            dataSource:[],            pagination: {                defaultCurrent: 1,                defaultPageSize: 10,                showQuickJumper: true,                pageSize: 10,                onChange: function (page) {                    this.loadData(page);                }.bind(this),                showTotal: function (total) {                    return "共" + total + "条数据";                },            },            pageNo:1,            listLoading:false,            selectedRowKeys:[],            selectedRows:[],            modalVisible:false,            nameSearch:'',            statusSearch:undefined,            provinceSearch:undefined,            addressSearch:[],            releaseDate:[],            upLoad: {                customRequest: (options) => {                    this.setState({                        upLoadFileLoading: true,                    })                    let params = new FormData();                    params.append("file", options.file);                    $.ajax({                        method: "post",                        url: globalConfig.context + "/api/user/channel/import",                        async: true,                        cache: false,                        contentType: false,                        processData: false,                        data:params                    }).done(                        function (data) {                            this.setState({                                upLoadFileLoading: false,                            })                            if (data.error.length === 0) {                                if(data.data === 1){                                    message.success("导入成功!");                                }else if(data.data.list.length > 0){                                    message.warning('已成功导入!错误/重复客户无法导入,请查看错误渠道数据!');                                    this.setState({                                        duplicateData: [],                                        duplicateDataVisible: true                                    })                                }                                this.loadData();                            } else {                                message.warning(data.error[0].message);                                this.loadData();                            }                        }.bind(this)                    ).always(                        function () {                            this.loadData();                            this.setState({                                upLoadFileLoading: false,                            });                        }.bind(this)                    );                },                name: "file",                action: globalConfig.context + "/api/user/channel/import",            },            followData: '',            visitModul: false,            categoryArr:[],            tabsKey:'',            adminList:[],        }        this.loadData = this.loadData.bind(this);        this.search = this.search.bind(this);        this.reset = this.reset.bind(this);        this.changeList = this.changeList.bind(this);        this.download = this.download.bind(this);        this.category = this.category.bind(this);        this.closeDesc = this.closeDesc.bind(this);        this.guidanceRead = this.guidanceRead.bind(this);        this.tableRowClick = this.tableRowClick.bind(this);        this.detailCloseDesc = this.detailCloseDesc.bind(this);        this.supervisor = this.supervisor.bind(this);        this.httpChange = this.httpChange.bind(this);        this.blurChange = this.blurChange.bind(this);        this.selectAuto = this.selectAuto.bind(this);        this.changeAssigner = this.changeAssigner.bind(this);        this.getAdminList = this.getAdminList.bind(this);    }    componentWillReceiveProps (nextProps) {        let next = JSON.stringify(nextProps);        let props = JSON.stringify(this.props);        if(next !== props){            location.reload();        }    }    componentDidMount() {        this.initialization();    }    //获取渠道专员列表    getAdminList(value = '') {        this.setState({            adminListLoading:true        })        $.ajax({            method: "get",            dataType: "json",            crossDomain: false,            url: globalConfig.context + "/api/admin/superviser/adminList",            data: {                pageNo: 1,                pageSize: 99,                name: value,                roleName: '渠道专员',            },            success: function (data) {                let thedata = data.data.list;                let theArr = [];                if (data.error && data.error.length) {                    message.warning(data.error[0].message);                }else{                    thedata.map(function (item, _) {                        theArr.push({                            value: item.id,                            label: item.name,                        });                    });                }                this.setState({                    adminList: theArr,                });            }.bind(this),        }).always(            function () {                this.setState({                    adminListLoading:false                })            }.bind(this)        );    }    initialization(){        //城市        let provinces = [];        provinceList.map(function (item) {            var id = String(item.id);            provinces.push(                <Select.Option value={id} key={item.name}>                    {item.name}                </Select.Option>            );        });        this.setState({            provinces        })        this.loadData();        this.category();        if(this.props.type === 0 || this.props.type === 3){            this.state.columns.push({                title: "分配时间",                dataIndex: "distributionTimes",                key: "distributionTimes",            });            this.state.columns.push({                title: "剩余签单(天)",                dataIndex: "days",                key: "days",                render: (text,record) => (                    record.status !== 7 ? <Tag color='#f00'>{text}天</Tag> : ''                )            });        }        if(this.props.followUp){            this.state.columns.push({                title: "当前跟进人",                dataIndex: "adminName",                key: "adminName",                render: (text, record) => {                    return (                        record.status !== 0 ? text : ''                    )                }            });            this.state.columns.push({                title: "跟进操作",                dataIndex: "abc",                key: "abc",                render: (text, record, index) => {                    return (                        <div style={{                            display: 'flex',                            flexFlow:'row',                            alignItems:'center',                        }}>                            <Button                                disabled={this.props.deliver === 2 && record.status === 2 && this.props.isEditGuidanceLv}                                onClick={(e) => {                                    e.stopPropagation();                                    if(this.props.isEditGuidanceLv){                                        this.visit(record);                                    }else{                                        this.tableRowClick(record);                                    }                                }}                                type="primary"                            >                                {this.props.isEditGuidanceLv ? '客户跟进' : '查看指导'}                            </Button>                        </div>                    );                },            });            if(this.props.isEditGuidanceLv){                this.state.columns.push({                    title: "指导意见",                    dataIndex: "guidance",                    key: "guidance",                    render: (text, record, index) => {                        return (                            <div style={{                                display: 'flex',                                flexFlow:'row',                                alignItems:'center',                            }}>                                {/*指导 0无 1未读 2已读*/}                                {text === 1 || text === 2 ? <Button                                    style={text === 1 ? {                                        background:'#F00000',                                        borderColor:'#F00000'                                    } : {}}                                    onClick={(e)=>{                                        e.stopPropagation();                                        this.guidanceRead(record.uid).then(()=>{                                            this.setState({                                                tabsKey:"4",                                            },()=>{                                                this.tableRowClick(record)                                            })                                        })                                    }}                                    type="primary"                                >                                    {text === 1 ? '未读' : '查看'}                                </Button> : <div>暂无指导</div>}                            </div>                        );                    },                });            }        }        this.state.columns.push({            title: "备注",            dataIndex: "remarks",            key: "remarks",            render: (text) => {                return (                    <Tooltip placement="topLeft" title={text}>                        <div style={{                            maxWidth:'150px',                            overflow:'hidden',                            textOverflow: "ellipsis",                            whiteSpace:'nowrap',                        }}>{text}</div>                    </Tooltip>                )            }        });        this.setState({            columns:this.state.columns        })    }    visit(e) {        this.setState({            followData: e,            visitModul: true,        });    }    loadData(pageNo = 1) {        this.setState({            listLoading: true,            selectedRows: [],            selectedRowKeys: [],        });        $.ajax({            method: "post",            dataType: "json",            crossDomain: false,            url: globalConfig.context + '/api/admin/customer/listChannelCustomer',            data: {                type:this.props.type,                pageNo: pageNo || 1,                pageSize: this.state.pagination.pageSize,                name: this.state.nameSearch,                status:this.state.statusSearch,                province: !this.state.addressSearch.length                    ? this.state.provinceSearch                    : this.state.addressSearch[0],                city: !this.state.addressSearch.length                    ? ""                    : this.state.addressSearch[1],                startTime: this.state.releaseDate[0],                endTime: this.state.releaseDate[1],                aid:this.state.adminValue,            },            success: function (data) {                ShowModal(this);                let theArr = [];                if (data.error.length > 0) {                    message.warning(data.error[0].message);                } else {                    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,                        })                    }                }            }.bind(this),        }).always(            function () {                this.setState({                    listLoading: false,                });            }.bind(this)        );    }    search(){        this.loadData();    }    reset(){        this.setState({            nameSearch:'',            provinceSearch:undefined,            addressSearch:[],            releaseDate:[],            statusSearch:undefined,            adminValue:undefined,        },()=>{            this.loadData();        })    }    download() {        window.location.href =            globalConfig.context +            "/api/user/channel/downloadTemplate?" +            "sign=user_channel";    }    changeList(arr) {        const newArr = [];        this.state.columns.forEach(item => {            arr.forEach(val => {                if (val === item.title) {                    newArr.push(item);                }            });        });        this.setState({            changeList: newArr        });    }    category() {        $.ajax({            method: "get",            dataType: "json",            crossDomain: false,            url: globalConfig.context + "/api/admin/Varieties/getSuperList",            data: {},            success: function (data) {                let thedata = data.data;                let theArr = [];                if (!thedata) {                    if (data.error && data.error.length) {                        message.warning(data.error[0].message);                    }                    thedata = {};                } else {                    thedata.map(function (item, index) {                        theArr.push({                            value: item.id,                            key: item.cname,                        });                    });                }                this.setState({                    categoryArr: theArr,                });            }.bind(this),        });    }    closeDesc(){        this.setState({            followData:'',            visitModul:false        })    }    //已读指导记录    guidanceRead(id) {        return new Promise((resolve,reject)=>{            $.ajax({                method: "post",                dataType: "json",                crossDomain: false,                url: globalConfig.context + "/api/admin/customer/pushGuidance",                data: {                    uid: id,                }            }).done(function(data) {                if(!data.error.length) {                    resolve();                } else {                    message.warning(data.error[0].message);                    reject();                };            }.bind(this));        })    }    tableRowClick(record) {        if(this.props.deliver === 2 && record.status === 2 && this.props.isEditGuidanceLv){            this.setState({                isGuidance: true,                tabsKey:"4",            })        }        //营销经理人员 取消指导自己的操作        if(this.props.deliver === 2 && record.status === 1 && this.props.isEditGuidanceLv){            this.setState({                isEditGuidance: false,            })        }        //营销人员 取消指导的操作        if(this.props.deliver === 0 && record.status === 2 && this.props.isEditGuidanceLv){            this.setState({                isEditGuidance: false,            })        }        this.setState({            rowData:record,            modalVisible: true,            basicState: true,            contactState: true,            modalName: record.userName        })    }    detailCloseDesc(){        this.setState({            rowData:'',            modalVisible: false,            basicState: false,            contactState: false,            modalName: '',            isGuidance: false,            isEditGuidance: true,            tabsKey: '',        },()=>{            this.loadData(this.state.pageNo);        })    }    supervisor(e) {        $.ajax({            method: "get",            dataType: "json",            crossDomain: false,            url: globalConfig.context + "/api/admin/customer/listAdminByName",            data: {                adminName: e,            },            success: function (data) {                let thedata = data.data;                if (!thedata) {                    if (data.error && data.error.length) {                        message.warning(data.error[0].message);                    }                    thedata = {};                }                this.setState({                    customerArr: thedata,                });            }.bind(this),        }).always(            function () {            }.bind(this)        );    }    httpChange(e) {        if (e.length >= 1) {            this.supervisor(e);        }        this.setState({            auto: e,        });    }    blurChange(e) {        let theType = "";        let contactLists = this.state.customerArr || [];        if (e) {            contactLists.map(function (item) {                if (item.name == e.toString()) {                    theType = item.id;                }            });        }        this.setState({            theTypes: theType,        });    }    selectAuto(value, options) {        this.setState({            auto: value,        });    }    changeAssigner(remarks,type,lv) {        //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 === 7);        let arr3 = this.state.selectedRows.filter(v=>v.status === 6);        if(type === 0 && (arr.length>0 || arr1.length>0)){            message.warning('选中的信息中存在“已分配”数据,请取消这些选项后重新提交')            return;        }        if(type === 1 && arr1.length>0){            message.warning('选中的信息中存在“经理已分配”数据,请取消这些选项后重新提交')            return;        }        //处于回收状态的客户经理和营销员不能点击回收        if(this.props.deliver !== 1 && arr3.length>0){            message.warning('渠道客户已回收!待营销总监,重新分配')            return;        }        //this.props.deliver && this.props.recovery   用于判断是否为经理        if(this.props.deliver === 2 && this.props.recovery && type === 2 && arr1.length>0){            message.warning('操作失败,存在客户已被分配营销员')            return;        }        if(arr2.length>0){            message.warning('不能操作已签单客户')            return;        }        if(!remarks){            message.warning(type === 1 ? "请输入分配原因" : type === 2 ? "请输入回收原因" : type === 0 ? "请输入分配原因" : "");            return;        }        if (this.state.theTypes || lv) {            this.setState({                listLoading: true,            })            let changeIds  = '';            let oldAid = '';            for (let idx = 0; idx < this.state.selectedRows.length; idx++) {                let rowItem = this.state.selectedRows[idx];                if(rowItem.recovery === 1 && type === 2){                    let arr = this.state.selectedRows.filter(v => v.recovery === 1)                    Modal.info({                        title: '以下数据属于回收再分配资源,无法再次回收',                        content: (                            <div>                                {                                    arr.map(i=>(                                        <div style={{paddingBottom:'7px'}}>{i.userName}</div>                                    ))                                }                            </div>                        ),                        onOk() {},                    });                    return ;                }                if (rowItem.id) {                    oldAid = rowItem.aid;                    changeIds = this.state.selectedRows.length-1 === idx ? changeIds +rowItem.id : changeIds + rowItem.id + ',' ;                }            }            $.ajax({                method: "post",                dataType: "json",                crossDomain: false,                url: globalConfig.context + "/api/admin/customer/channelCustomerDeliver",                data: {                    userIds: changeIds, //这一行数据的ID                    receiveId: this.state.theTypes, //指定分配人的ID                    remarks: remarks,                    type,           //0总监分配  1经理分配 2回收                },            }).done(                function (data) {                    this.setState({                        listLoading: false,                    })                    if (!data.error.length) {                        message.success(type === 1 ? "分配成功!" : type === 2 ? "回收成功!" : type === 0 ? "分配成功!" : "");                        this.setState({                            auto: "",                            loading: false,                            selectedRowKeys: [],                            visible:false,                            recoveryVisible: false,                        },()=>{                            this.loadData(this.state.pageNo);                        });                    } else {                        message.warning(data.error[0].message);                    }                }.bind(this)            );        } else {            message.warning("请输入分配人姓名");        }    }    render() {        const rowSelection = {            hideDefaultSelections: true,            selectedRowKeys: this.state.selectedRowKeys,            onChange: (selectedRowKeys, selectedRows) => {                this.setState({                    modalVisible: false,                    selectedRows: selectedRows,                    selectedRowKeys: selectedRowKeys,                });            },            onSelect: (recordt, selected, selectedRows) => {                this.setState({                    modalVisible: false,                });            },        };        const dataSources = this.state.customerArr || [];        const options = dataSources.map((group) => (            <Select.Option key={group.id} value={group.name}>                {group.name}            </Select.Option>        ));        const hasSelected = this.state.selectedRowKeys.length > 0;        return (            <div className="user-content channel">                <ShowModalDiv ShowModal={this.state.showModal} />                <div className="content-title">                    <span>渠道客户</span>                </div>                <div className="user-search">                    <Tabs                        defaultActiveKey="1"                        className="test"                    >                        <TabPane tab="搜索" key="1">                            <Input                                placeholder="请输入客户名称"                                value={this.state.nameSearch}                                style={{ width: 150, marginRight: 10, marginLeft: 10 }}                                onChange={(e) => {                                    this.setState({ nameSearch: e.target.value });                                }}                            />                            <Select                                placeholder="分配状态"                                style={{ width: 170 }}                                value={this.state.statusSearch}                                onChange={(e) => {                                    this.setState({ statusSearch: e });                                }}                            >                                {                                    this.state.channelAllocationStatusList.map((v,key)=>(                                        <Select.Option value={v.value} key={key}>                                            {v.key}                                        </Select.Option>                                    ))                                }                            </Select>                            <Select                                placeholder="省"                                style={{ width: 80 }}                                value={this.state.provinceSearch}                                onChange={(e) => {                                    this.setState({ provinceSearch: e });                                }}                            >                                {this.state.provinces}                            </Select>                            <span style={{ marginRight: "10px" }}>                              <Cascader                                  options={citySelect()}                                  value={this.state.addressSearch}                                  placeholder="选择城市"                                  onChange={(e, pre) => {                                      this.setState({ addressSearch: e });                                  }}                              />                            </span>                            <RangePicker                                value={[                                    this.state.releaseDate[0]                                        ? moment(this.state.releaseDate[0])                                        : null,                                    this.state.releaseDate[1]                                        ? moment(this.state.releaseDate[1])                                        : null,                                ]}                                onChange={(data, dataString) => {                                    this.setState({ releaseDate: dataString });                                }}                            />                            {this.props.type !== 1 ? <Select                                showSearch                                value={this.state.adminValue}                                style={{ width: 150,marginLeft:'10px' }}                                onSearch={this.getAdminList}                                onSelect={(v)=>{                                    this.setState({                                        adminValue:v                                    })                                }}                                onFocus={this.getAdminList}                                filterOption={false}                                placeholder="请输入渠道专员名称"                            >                                {this.state.adminList.map((v,k)=>(                                    <Option key={k} value={v.value}>{v.label}</Option>                                ))}                            </Select> : null}                            <Button                                type="primary"                                style={{ marginLeft: "10px", marginRight: 10 }}                                onClick={this.search}                            >                                搜索                            </Button>                            <Button onClick={this.reset}>重置</Button>                        </TabPane>                        <TabPane tab="操作" key="2">                            <div style={{                                marginTop: 10,                            }}>                                {this.props.deliver ? <AutoComplete                                    className="certain-category-search"                                    dropdownClassName="certain-category-search-dropdown"                                    dropdownMatchSelectWidth={false}                                    style={{ width: "120px" }}                                    dataSource={options}                                    placeholder={this.props.deliver === 1 ? '输入分配人姓名' : '输入分配人姓名'}                                    value={this.state.auto}                                    onChange={this.httpChange}                                    filterOption={true}                                    onBlur={this.blurChange}                                    onSelect={this.selectAuto}                                    disabled={!hasSelected}                                >                                    <Input />                                </AutoComplete> : ''}                                {this.props.deliver ? <Button                                    type="primary"                                    onClick={(e) => {                                        e.stopPropagation();                                        this.setState({                                            visible:true                                        })                                    }}                                    disabled={!hasSelected}                                    style={{ marginRight: 10 }}                                >                                    {this.props.deliver === 1 ? '分配' : '分配'}                                </Button> : ''}                                {this.props.recovery ? <Button                                    type="primary"                                    onClick={(e) => {                                        e.stopPropagation();                                        this.setState({                                            recoveryVisible:true                                        })                                    }}                                    disabled={!hasSelected}                                    style={{ marginRight: 10 }}                                >                                    回收                                </Button> : ''}                                {this.props.deliver || this.props.recovery ? <Button                                    type="primary"                                    onClick={(e) => {                                        e.stopPropagation();                                        this.setState({                                            transferVisible:true,                                            transferId: this.state.selectedRows[0].uid                                        })                                    }}                                    disabled={!hasSelected || this.state.selectedRows.length > 1}                                    style={{ marginRight: 10 }}                                >                                    日志                                </Button> : ''}                                {this.props.channel ? <Upload {...this.state.upLoad} disabled={this.state.upLoadFileLoading}>                                    <Button                                        loading={this.state.upLoadFileLoading}                                        type="primary"                                        style={{ marginRight: "10px" }}                                    >                                        +批量导入渠道客户                                    </Button>                                </Upload> : null}                                {this.props.channel ? <Button                                    onClick={(e) => {                                        e.stopPropagation();                                        this.download();                                    }}                                    type="primary"                                    style={{                                        marginRight: "10px",                                        background:'#f49f36',                                        borderColor:'#f49f36'                                    }}                                >                                    下载渠道客户模板                                </Button> : ''}                                {this.props.channel ? <Button                                    onClick={(e) => {                                        e.stopPropagation();                                        this.setState({                                            duplicateData: [],                                            duplicateDataVisible: true                                        })                                    }}                                    type="primary"                                    style={{                                        marginRight: "10px",                                        background:'#ff2f00',                                        borderColor:'#ff2f00'                                    }}                                >                                    查看导入失败列表                                </Button> : ''}                                <EnterpriseNameChange                                    type='journal'                                    disabled={!(hasSelected && this.state.selectedRows.length === 1)}                                    style={{ marginLeft: 10 }}                                    enterpriseId={this.state.selectedRows[0] && this.state.selectedRows[0].id}/>                            </div>                        </TabPane>                        <TabPane tab="更改表格显示数据" key="3">                            <div style={{ marginLeft: 10 }}>                                <ChooseList                                    columns={this.state.columns}                                    changeFn={this.changeList}                                    changeList={this.state.changeList}                                    top={55}                                    margin={11}                                />                            </div>                        </TabPane>                    </Tabs>                </div>                <div className="patent-table">                    <Spin spinning={this.state.listLoading}>                        <Table                            size="middle"                            className={'intentionCustomerTable'}                            columns={                                this.state.changeList.length !== 0                                    ? this.state.changeList                                    : this.state.columns                            }                            dataSource={this.state.dataSource}                            rowSelection={this.props.deliver || this.props.recovery ? rowSelection : ''}                            pagination={this.state.pagination}                            onRowDoubleClick={this.tableRowClick}                        />                    </Spin>                </div>                <FollowDetail                    categoryArr={this.state.categoryArr}                    followData={this.state.followData}                    visitModul={this.state.visitModul}                    closeDesc={this.closeDesc}                />                <IntentionDetail                    tabsKey={this.state.tabsKey}                    categoryArr={this.state.categoryArr}                    detailApi={this.props.detailApi}                    IntentionData={this.state.rowData}                    modalVisible={this.state.modalVisible}                    name={this.state.modalName}                    closeDesc={this.detailCloseDesc}                    basicState={this.state.basicState}                    contactState={this.state.contactState}                    isGuidanceLv={this.props.isGuidanceLv || this.state.isGuidance}                    isEditGuidanceLv={this.props.isEditGuidanceLv && this.state.isEditGuidance}                />                {this.state.duplicateDataVisible ? <DuplicateData                    duplicateData={this.state.duplicateData || []}                    visible={this.state.duplicateDataVisible}                    onCancel={()=>{                        this.setState({                            duplicateData:[],                            duplicateDataVisible: false                        },()=>{                            this.loadData(this.state.pageNo);                        })                    }}                /> : null}                {this.state.transferVisible || this.state.returnVisible ? <TransferRecords                    type={this.state.transferVisible ? (this.props.deliver === 1 ? 0 : 1) : this.state.returnVisible ? 2 : 0}                    id={this.state.transferId}                    visible={this.state.transferVisible || this.state.returnVisible}                    cancel={()=>{                        this.setState({                            transferVisible:false,                            returnVisible: false,                            transferId:''                        })                    }}                /> : '' }                {/*渠道客户分配*/}                {this.state.visible ? <OperationTips                    title={'渠道客户分配'}                    selectedRows={this.state.selectedRows}                    visible={this.state.visible}                    onOk={(value)=>{                        // 0 总监分配 1经理分配 2回收                        this.changeAssigner(value,this.props.deliver === 1 ? 0 : this.props.deliver === 2 ? 1 : '')                    }}                    onCancel={()=>{                        this.setState({                            visible:false                        })                    }}/> : ''}                {/*渠道客户回收*/}                {this.state.recoveryVisible ? <OperationTips                    title={'渠道客户回收'}                    selectedRows={this.state.selectedRows}                    visible={this.state.recoveryVisible}                    onOk={(value)=>{                        this.changeAssigner(value,2,true)                    }}                    onCancel={()=>{                        this.setState({                            recoveryVisible:false                        })                    }}/> : ''}                {this.state.upLoadFileLoading ? <div style={{                    position:'fixed',                    display:'flex',                    flexFlow:'column',                    justifyContent:'center',                    alignItems:'center',                    top:0,                    bottom:0,                    left:0,                    right:0,                    background:'rgba(0,0,0,.7)',                    color:"#58a3ff",                    fontSize:'20px',                    zIndex:99999,                }}>                    <Spin spinning={this.state.upLoadFileLoading}/>                    <div style={{paddingTop:'10px'}}>客户名称匹配中...</div>                </div>: null}            </div>        )    }}export default Channel;
 |