123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007 |
- import React from 'react';
- import { Radio, Icon, Button, Input, Select, Spin,Popconfirm, Table, Switch, message, DatePicker, Modal, Upload,Form ,Row,Col,TimePicker} from 'antd';
- import ajax from 'jquery/src/ajax/xhr.js';
- import $ from 'jquery/src/ajax';
- import moment from 'moment';
- import './myClient.less';
- const { Column, ColumnGroup } = Table;
- import TechAchievementDesc from './myClientDesc.jsx';
- import { achievementCategoryList, techAuditStatusList,cityArr,tag,customerStatus,intentionalService,newFollow ,newFollowOn,contact,sex,intentionalServiceOn} from '../../dataDic.js';
- import { beforeUploadFile, companySearch, getAchievementCategory,getsex,getSearchUrl,getTechAuditStatus,getcustomerTyp,getcityArr,getCompanyIntentionOn,getcustomerStatue,getCompanyIntention,getfllowSituation,getcontact,getfllowSituationOn} from '../../tools.js';
- import BatchImport from './batchImport';
- //历史记录
- const datas = [{
- key: '1',
- firstName: 'John',
- lastName: 'Brown',
- age: 32,
- address: 'New York No. 1 Lake Park',
- addres:'31232',
- addre:'31231',
- addr:'231321',
- }, {
- key: '2',
- firstName: 'Jim',
- lastName: 'Green',
- age: 42,
- address: 'London No. 1 Lake Park',
- addres:'31232',
- addre:'31231',
- addr:'231321',
- }, {
- key: '3',
- firstName: 'Joe',
- lastName: 'Black',
- age: 32,
- address: 'Sidney No. 1 Lake Park',
- addres:'31232',
- addre:'31231',
- addr:'231321',
- }, {
- key: '4',
- firstName: 'Jim',
- lastName: 'Green',
- age: 42,
- address: 'London No. 1 Lake Park',
- addres:'31232',
- addre:'31231',
- addr:'231321',
- },
- ];
-
- //图片组件
- const PicturesWall = React.createClass({
- getInitialState() {
- return {
- previewVisible: false,
- previewImage: '',
- fileList: [],
- }
- },
- handleCancel() {
- this.setState({ previewVisible: false })
- },
- handlePreview(file) {
- this.setState({
- previewImage: file.url || file.thumbUrl,
- previewVisible: true,
- });
- },
- handleChange(info) {
- let fileList = info.fileList;
- this.setState({ fileList });
- this.props.fileList(fileList);
- },
- componentWillReceiveProps(nextProps) {
- this.state.fileList = nextProps.pictureUrl;
- },
- render() {
- const { previewVisible, previewImage, fileList } = this.state;
- const uploadButton = (
- <div>
- <Icon type="plus" />
- <div className="ant-upload-text">点击上传</div>
- </div>
- );
- return (
- <div className="clearfix">
- <Upload
- action={globalConfig.context + "/api/admin/achievement/uploadPicture"}
- data={{ 'sign': this.props.pictureSign }}
- listType="picture-card"
- fileList={fileList}
- onPreview={this.handlePreview}
- onChange={this.handleChange} >
- {fileList.length >= 5 ? null : uploadButton}
- </Upload>
- <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
- <img alt="example" style={{ width: '100%' }} src={previewImage} />
- </Modal>
- </div>
- );
- }
- });
- const contactsOptionWoman=[];
- const datat = [{
- key: 1,
- name: 'John Brown sr.',
- },
- {
- key: 12,
- name: 'John Brown jr.',
- }, {
- key: 13,
- name: 'Jim Green sr.',
- }];
- const AchievementList = Form.create()(React.createClass({
-
- loadData(pageNumber, apiUrl) {
- this.state.data = [];
- this.setState({
- loading: true
- });
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url:globalConfig.context + '/api/admin/customer/listPrivateCustomer',
- data: {
- pageNumber: pageNumber || 1,
- pageSize: this.state.pagination.pageSize,
- // customerName: this.state.customerName, //名称1
- // shareTyp: this.state.shareTyp, //客户类型1
- // province:this.state.province,//地区
- // customerStatus:this.state.customerStatus,//客户状态1
- // contactName:this.state.contactName,//联系人姓名1
- // adminName:this.state.adminName,//跟单人1
- // companyIntention:this.state.companyIntention,//意向服务
- // followSituation:this.state.followSituation,//最新跟进
- //releaseDateStartDate: this.state.releaseDate[0],
- //releaseDateEndDate: this.state.releaseDate[1],
- },
- success: function (data) {
- let theArr = [];
- if (!data.data || !data.data.list) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- } else {
- for (let i = 0; i < data.data.list.length; i++) {
- let thisdata = data.data.list[i];
- theArr.push({
- key: i,
- id: thisdata.id,
- companyName:thisdata.companyName,//公司名称
- _shareType:thisdata._shareType,//客户类型
- locationProvince:thisdata.locationProvince,//地区
- contactName:thisdata.contactName, //联系人姓名
- telNum:thisdata.telNum,//手机号
- _customerStatus:thisdata._customerStatus,//客户状态
- _companyIntention:thisdata._companyIntention,//意向服务
- _followSituation:thisdata._followSituation,//最新跟进
- customerStatus:thisdata.customerStatus,//客户状态
- companyIntention:thisdata.companyIntention,//意向服务
- followSituation:thisdata.followSituation,//最新跟进
- adminName:thisdata.adminName, //跟进人
- followDate:thisdata.followDate,
- customerStatus:thisdata.customerStatus,//客户状态
- companyIntention:thisdata.companyIntention,//意向服务
-
- });
- };
- this.state.pagination.current = data.data.pageNumber;
- this.state.pagination.total = data.data.totalCount;
- };
- this.setState({
- dataSource: theArr,
- pagination: this.state.pagination
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- //通过ID查询这个个公司的跟进记录
- getNewWoman(deletedIds) {
- const contactsOptionWoman=[]
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/customer/findCustomerUserList",
- data:{
- cid:deletedIds
- },
- success: function (data) {
- let theArr = [];
- let thedata=data.data;
- var email=[];
- var telNum=[];
- var contactId=[];
- thedata.map(function (item,index) {
- email.push(thedata[index].email);
- contactId.push(thedata[index].id);
- telNum.push(thedata[index].telNum);
- theArr.push(<Select.Option value={index}>{item.name}</Select.Option>)
- });
- var lastName= thedata[thedata.length-1].name;
- var nub=thedata[thedata.length-1].telNum;
- var kid=thedata[thedata.length-1].id;
- var contacts='电话';
- this.setState({
- kid:kid,
- contactId:contactId,
- contacts:contacts,
- nub:nub,
- telNum:telNum,
- email:email,
- lastName:lastName,
- orderStatusOption: theArr,
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- //在添加联系记录页面,选择联系方式查看号码
- contacts(e){
- let conts='';
- if(e==0){
- conts='电话'
- this.state.nub=this.state.changNub
- }
- if(e==1){
- conts='邮件'
- this.state.nub=this.state.changEmail
- }
- if(e==2){
- conts='面谈'
- this.state.nub=''
- }
- if(e==3){
- conts='短信'
- this.state.nub=''
- }
- this.setState({
- conts:conts,
- contacts: e,
- });
- },
-
- //通过ID查询这一条的信息
- Detailload(deletedIds){
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/customer/findCustomerUserDetails',
- data: {
- id: deletedIds
- },
- success: function (data) {
- let thisData = data.data;
- if (!thisData) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- thisData = {};
- };
- this.setState({
- data: thisData,
- followSituation:thisData.followSituation,
- customerStatus:thisData.customerStatus,
- });
- if (thisData.ownerId) {
- this.getContactsList(thisData.ownerId);
- };
-
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- //点击便捷记录,点击最新跟进下的+号,将会查询出很多数据,展示在列表里面
- setModal1Visible(modal1Visible) {
- this.setState({ modal1Visible });
- let deletedIds;
- let adminName;
- let customerStatus;
- let companyIntention;
- let followSituation;
-
- for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
- let rowItem = this.state.selectedRows[idx];
- if (rowItem.id) {
- deletedIds=rowItem.id;
- adminName=rowItem.adminName;
- companyIntention=rowItem.companyIntention;
- followSituation=rowItem.followSituation;
- };
- };
- this.Detailload(deletedIds);
- this.getNewWoman(deletedIds);
- },
- setModal2Visible(modal2Visible) {
- this.setState({ modal2Visible });
- alert(1111111);
-
- },
- //历史记录中点击跟进人模板出现,点击最新跟进的第一个按钮(跟进状态)执行的函数,将会出现很多跟进列表
- setModal3Visible(modal3Visible) {
- this.setState({ modal3Visible });
- this.state.data = [];
- this.setState({
- loading: true
- });
- let deletedIds;
- for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
- let rowItem = this.state.selectedRows[idx];
- if (rowItem.id) {
- deletedIds=rowItem.id;
- };
- };
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url:globalConfig.context + '/api/admin/customer/listFollowUpRecord',
- data: {
- customerId:deletedIds
- },
- success: function (data) {
- let theArr = [];
- let theWomanID=[];
- if (!data.data) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- } else {
- data.data.map(function (item,index) {
- theWomanID.push(data.data[index].id);
- });
- for (let i = 0; i < data.data.length; i++) {
- let thisdata = data.data[i];
-
- theArr.push({
- key:i,
- _followDate:thisdata._followDate,//跟进时间
- adminName:thisdata.adminName,//跟进人
- contactName:thisdata.contactName, //联系人姓名
- contactId:thisdata.contactId, //联系人ID
- contactInfo:thisdata.contactInfo,//联系信息
- _customerStatus:thisdata._customerStatus,//客户状态
- _followSituation:thisdata._followSituation,//最新跟进
- followResult:thisdata.followResult,//跟进结果
- attachment:thisdata.attachment,//附件地址
- });
- };
- };
- this.setState({//导出数据
- datahistory: theArr,
- theWomanID:theWomanID,
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
-
- },
- //删除历史记录
- onDelete(){
-
- },
- //点击客户的名字,进行详情的查询
-
- setModal4Visible(modal4Visible) {
- console.log()
-
- let changeIds=this.state.datahistory[1].contactId;
- this.setState({ modal4Visible }); //需要一个请求数据
- // for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
- // let rowItem = this.state.selectedRows[idx];
- // if (rowItem.id) {
- // changeIds=rowItem.id;
- // };
- // };
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url:globalConfig.context + '/api/admin/customer/findContactDetail',
- data: {
- contactId:changeIds
- },
- success: function (data) {
- let theArr = [];
- let theDate=data.data;
- if (!data.data) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- } else {
- for (let i = 0; i < data.data.length; i++) {
- let thisdata = data.data[i];
- theArr.push({
- key:i,
- name:name,//联系人姓名
- sex:sex,//联系人性别
- mobile:mobile,//座机号
- telNum:telNum,//手机号
- email:email,//邮箱
- qq:qq,//qq
- wechat:wechat,//微信号
- depatrment:depatrment,//部门
- customerPosition:customerPosition,//职位
-
- // _followSituation:thisdata._followSituation,//最新跟进
-
- });
- };
- };
- this.setState({//导出数据
- theDate:theDate,
- name:theDate.name,//联系人姓名
- sex:theDate.sex,//联系人性别
- mobile:theDate.mobile,//座机号
- telNum:theDate.telNum,//手机号
- email:theDate.email,//邮箱
- qq:theDate.qq,//qq
- wechat:theDate.wechat,//微信号
- depatrment:theDate.depatrment,//部门
- customerPosition:theDate.customerPosition,//职位
- companyName:theDate.companyName,//公司
- });
- }.bind(this),
- }).always(function () {
- this.setState({
- loading: false
- });
- }.bind(this));
- },
- //点击名称时获取列表
- setModal5Visible(modal5Visible) {
- this.setState({ modal5Visible });
- let deletedIds;
- let adminName;
- let customerStatus;
- let companyIntention;
- let followSituation;
- for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
- let rowItem = this.state.selectedRows[idx];
- if (rowItem.id) {
- deletedIds=rowItem.id;
- adminName=rowItem.adminName;
- companyIntention=rowItem.companyIntention;
- followSituation=rowItem.followSituation;
- };
- };
- this.setState({ modal5Visible }); //需要一个请求数据
- this.Detailload(deletedIds);
- },
- //历史记录查看更多,还是历史记录接口
- setModal6Visible(modal6Visible) {
- this.setState({ modal6Visible }); //需要一个请求数据
- },
- getPictureUrl(e) {
- this.setState({pictureUrl: e });
- },
- componentWillReceiveProps(nextProps) {
- if (!this.props.visible && nextProps.visible) {
- if (nextProps.data && nextProps.data.id) {
- this.loadData(nextProps.data.id, nextProps.detailApiUrl);
- };
- this.state.technicalPictureUrl = [];
- };
- },
- //添加一条跟进记录,点击保存按钮进行添加
- addFollowSubmit(e) {
- e.preventDefault();
- this.state.data = []
- this.setState({
- selectedRowKeys: [],
- //loading: deletedIds.length > 0
- });
- let deletedIds;
- this.state.data = [];
- for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
- let rowItem = this.state.selectedRows[idx];
- if (rowItem.id) {
- deletedIds=rowItem.id
- };
- };
- this.props.form.validateFields((err, values) => {
- // let theMaturityPictureUrl = [];
- // if (this.state.maturityPictureUrl.length) {
- // let picArr = [];
- // this.state.maturityPictureUrl.map(function (item) {
- // picArr.push(item.response.data);
- // });
- // theMaturityPictureUrl = picArr.join(",");
- // };
- if (!err) {
- this.setState({
- loading: true
- });
- let custype=values._shareType;
- let customerTypechange="";
- switch(custype){
- case "个人客户":customerTypechange=0;break;
- case "公司客户":customerTypechange=1;break;
- }
- console.log(this.state.kid)
- let companyIntentions= getCompanyIntentionOn(values.companyIntention);
- let followSituations= getfllowSituationOn(values.followSituation);
- alert("这是1234");
- $.ajax({
- method: "POST",
- dataType: "json",
- crossDomain: false,
- url:globalConfig.context + '/api/admin/customer/addFollow',
- data: {
- id: deletedIds,//编号id
- cuid:this.state.kid,//联系人ID
- followDates:(values.createTime ? values.createTime.format('YYYY-MM-DD'):undefined)+" "+(values.createTim ? values.createTim.format('YYYY:MM:DD'):undefined),//跟进时间
- followResult:values.remarks,//跟进结果
- attachment:"",//附件地址
- contactInfo:values.contacts,//联系信息,
- customerStatus:values.customerStatus,//跟进客户状态
- followSituation:values.followSituation,//跟进进度
- contactInfo:this.state.conts+"-"+(this.state.nub?this.state.nub:""),
-
-
- }
- }).done(function (data) {
- this.setState({
- loading: false
- });
- if (!data.error.length) {
- message.success('保存成功!');
- this.setModal1Visible(false)
- } else {
- message.warning(data.error[0].message);
- }
- this.loadData();
- }.bind(this));
- }
- })
- this.setModal5Visible(false);
- },
- //当选择联系人的列表变化时,则执行
- hundleName(e){
- let changNub=this.state.telNum[e];
- let changEmail=this.state.email[e];
- let kid=this.state.contactId[e];
- console.log(kid)
- this.setState({
- kid:kid,
- contacts:'电话',
- nub:this.state.telNum[e],
- lastName: e,
- changNub:changNub,
- changEmail:changEmail,
- });
- },
-
- //所有资料修改保存提交,点击保存按钮进行更新
- handleSubmit(e) {
- e.preventDefault();
- let adminName;
- let customerStatus;
- let companyIntention;
- let followSituation;
- for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
- let rowItem = this.state.selectedRows[idx];
- if (rowItem.id) {
- deletedIds=rowItem.id;
- adminName=rowItem.adminName;
- customerStatus=rowItem.customerStatus;
- companyIntention=rowItem.companyIntention;
- followSituation=rowItem.followSituation;
- };
- };
- this.state.data = []
- this.setState({
- selectedRowKeys: [],
- loading: deletedIds.length > 0
- });
- let deletedIds;
- this.state.data = [];
- for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
- let rowItem = this.state.selectedRows[idx];
- if (rowItem.id) {
- deletedIds=rowItem.id
- };
- };
- this.setState({
- selectedRowKeys: [],
-
- });
- this.props.form.validateFields((err, values) => {
- if (!err) {
- this.setState({
- loading: true
- });
- let custype=values._shareType;
- let customerTypechange="";
- switch(custype){
- case "个人客户":customerTypechange=0;break;
- case "公司客户":customerTypechange=1;break;
- }
- let companyIntentions= getCompanyIntentionOn(values.companyIntention);
- let followSituations= getfllowSituationOn(values.followSituation);
- alert("这是112233");
- $.ajax({
- method: "POST",
- dataType: "json",
- crossDomain: false,
- url:globalConfig.context + '/api/admin/customer/updCustomer',
- data: {
- id: deletedIds,//编号id
- customerTyp :customerTypechange,//客户信息 1
- createTime: values.createTime ? values.createTime.format('YYYY-MM-DD') : undefined,//时间 1\
- companyIntention: companyIntentions,
- companyName: values.companyName,//公司名称 1
- companyIndustry: values.companyIndustry,//公司行业
- tag: values.tag,
- locationProvince: values.locationProvince,//省份1
- adress: values.adress,//详细地址1
- remarks: values.remarks,//备注1
- followSituation:followSituations,//最新跟进1
- customerStatus: values.customerStatus,//客户状态1
- name: values.name,//客户姓名1
- mobile: values.mobile,//座机1
- telNum: values.telNum,//手机号码1
- sex: values.sex,//性别1
- customerPosition: values.customerPosition,//职位1
- wechat: values.wechat,//微信号1
- qq: values.qq,//qq 1
- depatrment: values.depatrment,//部门 1
- email: values.email,//邮箱 1
- shareTyp:0,
- customerStatus:customerStatus,
- beforeCustomerStatus:customerStatus,
- beforeCompanyIntention:companyIntention,
- beforeFollowSituation:followSituation,
- beforeAdminName:adminName,
- }
- }).done(function (data) {
- this.setState({
- loading: false
- });
- if (!data.error.length) {
- message.success('保存成功!');
- this.setModal1Visible(false)
- } else {
- message.warning(data.error[0].message);
- }
- this.loadData();
- }.bind(this));
- }
- })
- this.setModal5Visible(false);
- },
-
- submitcontact(e){
- let deletedIds;
- for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
- let rowItem = this.state.selectedRows[idx];
- if (rowItem.id) {
- deletedIds=rowItem.id
- };
- };
- this.setState({
- selectedRowKeys: [],
- });
- e.preventDefault();
- this.props.form.validateFields((err, values) => {
- if (!err) {
- this.setState({
- loading: true
- });
- alert(23333);
- $.ajax({
- method: "POST",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + '/api/admin/customer/addContacter',
- data: {
- cid: deletedIds,//编号id
- sex:this.state.hot,//性别
- primaryFlg:this.state.hots,//是否是主要联系人
- name:this.state.paymentId,//联系人姓名
- mobile:this.state.paym,//座机
- telNum:this.state.pay,//电话
- qq:this.state.entId,//qq
- wechat:this.state.payId,//微信
- customerPosition:this.state.paentId,//职位
- depatrment:this.state.paytId,//部门
- email:this.state.email,//邮箱
- }
- }).done(function (data) {
- this.setState({
- loading: false
- });
- if (!data.error.length) {
- message.success('保存成功!');
- this.setModal2Visible(false)
- } else {
- message.warning(data.error[0].message);
- }
- this.loadData();
- }.bind(this));
- }
- });
- },
- getTechnicalPictureUrl(e) {
- this.setState({ technicalPictureUrl: e });
- },
-
- //新建联系人modal框显示
- showModal(){
- this.setState({
- visible: true,
- });
- },
-
- //指定转交人的点击函数
- showModa(){
- this.setState({
- visible: true,
- });
- let changeIds;
- let adminName;
- let customerStatus;
- let companyIntention;
- let followSituation;
- for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
- let rowItem = this.state.selectedRows[idx];
- if (rowItem.id) {
- changeIds=rowItem.id;
- adminName=rowItem.adminName;
- customerStatus=rowItem.customerStatus;
- companyIntention=rowItem.companyIntention;
- followSituation=rowItem.followSituation;
-
- };
- };
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/customer/findAdmin",
- data: {
- id: changeIds,//这一行数据的ID
- beforeCompanyIntention:companyIntention,//意向服务
- beforeCustomerStatus:customerStatus,//客户状态
- beforeFollowSituation:followSituation,//最新跟进状态
- beforeAdminName:adminName,//跟进人
- }
- }).done(function (data) {
-
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- } else {
- let theAssigne = [];
- if (!data.data) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- };
- alert(111);
- } else {
- for (let i = 0; i < data.data.length; i++) {
-
- let thisdata = data.data[i];
- //处理数据 进行循环
- theAssigne.push({
- key: thisdata.name,
- id: thisdata.id,
- ids: thisdata.cid,
- mobile:thisdata.mobile,
- adminName: thisdata.beforeAdminName,
- customerStatus: thisdata.beforeCustomerStatus,
- companyIntention: thisdata.beforeCompanyIntention,
- followSituation: thisdata.beforeFollowSituation,
- });
- };
-
- };
- this.setState({
- dataman: theAssigne,
- });
- }
- }.bind(this));
- },
- //选择了指定人之后的保存点击函数,需要修改函数
- changeAssigner() {
- this.setState({
- visible: false,
- });
- let changeId;
- let changeIds;
- let adminName;
- let beforeAdminName;
- let customerStatus;
- let companyIntention;
- let followSituation;
- for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
- let rowItem = this.state.selectedRows[idx];
- if (rowItem.id) {
- changeId=rowItem.id;
- beforeAdminName=rowItem.adminName;
- adminName=rowItem.key;
- customerStatus=rowItem.customerStatus;
- companyIntention=rowItem.companyIntention;
- followSituation=rowItem.followSituation;
- changeIds=rowItem.ids;
- };
- };
-
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/customer/transferCustomer",
- data: {
- id: changeIds,//这一行数据的ID
- aid:changeId,//指定转交人的ID
- beforeCompanyIntention:companyIntention,//意向服务
- beforeCustomerStatus:customerStatus,//客户状态
- beforeFollowSituation:followSituation,//最新跟进状态
- beforeAdminName:beforeAdminName,//之前的跟进人
- adminName:adminName,//转交的跟进人
- }
- }).done(function (data) {
- if (!data.error.length) {
- message.success('转交成功!');
- this.setState({
- loading: false,
- });
- } else {
- message.warning(data.error[0].message);
- };
- this.loadData();
- }.bind(this));
- },
- handleOk(e){
- this.setState({
- visible: false,
- });
- },
- handleCancel(e){
- this.setState({
- visible: false,
- });
- },
- //点击公司名称,进行弹出框动作,同时进行资料详情查询
- getInitialState() {
- return {
- technicalPictureUrl: [],
- modal1Visible: false,
- modal2Visible: false,
- visible: false ,
- searchMore: true,
- searchType: 0,
- validityPeriodDate: [],
- releaseDate: [],
- selectedRowKeys: [],
- selectedRows: [],
- loading: false,
- pagination: {
- defaultCurrent: 1,
- defaultPageSize: 10,
- showQuickJumper: true,
- pageSize: 10,
- onChange: function (page) {
- this.loadData(page);
- }.bind(this),
- showTotal: function (total) {
- return '共' + total + '条数据';
- }
- },
- columnsman:[{
- title: '姓名',
- dataIndex: 'key',
- key: 'key'
- },{
- title: '手机号码',
- dataIndex: 'mobile',
- key: 'mobile'
- }
- ],
- columns: [
- {
- title: '公司名称',
- dataIndex: 'companyName',
- key: 'companyName',
- render: text => {
- const theData = this.state.data || {};
- const contactsOption="";
- const { getFieldDecorator } = this.props.form;
- const FormItem = Form.Item
- const formItemLayout = {
- labelCol: { span: 8 },
- wrapperCol: { span: 14 },
- };
- return (
- <div>
- <Button onClick={() => this.setModal5Visible(true)}>{text}</Button>
- <Modal
- footer=''
- title="客户详情"
- width='1000px'
- visible={this.state.modal5Visible}
- onOk={() => this.setModal5Visible(false)}
- onCancel={() => this.setModal5Visible(false)}
- >
- <Form horizontal onSubmit={this.handleSubmit} id="demand-form">
- <Spin spinning={this.state.loading}>
- <div className="clearfix">
- <FormItem className="half-item"
- {...formItemLayout}
- label="客户类型1223" >
- {getFieldDecorator('_shareType', {
- rules: [{ required: true, message: '此项为必填项!' }],
- initialValue: theData._shareType
- })(
- <Select placeholder="选择客户类型" style={{ width: 160 }} >
- <Select.Option value="0" >个人客户</Select.Option>
- <Select.Option value="1" >公司客户</Select.Option>
- </Select>
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="" >
- <span>{theData.id}</span>
- </FormItem>
- <div className="clearfix" style={{marginLeft:'40px',marginBottom:'20px',color:'#000000'}}>基本资料:</div>
- <div>
- <FormItem className="half-item"
- {...formItemLayout}
- label="跟进记录" >
- <a href='#' onClick={() => this.setModal3Visible(true)} style={{marginRight:'50px',display:'inlineBlock'}}>已面谈</a><a href='#' onClick={() => this.setModal1Visible(true)}>新建</a>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="修改次数" >
- <span></span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="转为共享用户时间" >
- <span></span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="修改日志" >
- <span></span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="注册账号" >
- <span></span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="最后联系时间" >
- <span></span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="业务操作" >
- <a href="#">查询</a>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="录入时间" >
- <span></span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="跟单人" >
- <span>{theData.adminName}</span>
- </FormItem>
- </div>
- <div className="clearfix" style={{marginLeft:'40px',marginBottom:'20px',color:'#000000'}}>公司资料:</div>
- <div>
- <FormItem className="half-item"
- {...formItemLayout}
- label="公司名称" >
- {getFieldDecorator('companyName', {
- rules: [{ required: true, message: '此项为必填项!' }],
- initialValue: theData.companyName
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="公司行业" >
- {getFieldDecorator('companyIndustry', {
- initialValue: theData.companyIndustry
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="意向服务111" >
- {getFieldDecorator('companyIntention', {
- rules: [{ required: true, message: '此项为必填项!' }],
- initialValue: getCompanyIntention(theData.companyIntention)
- })(
- <Select placeholder="选择服务类型" >
- {
- intentionalService.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="地区" >
- {getFieldDecorator('locationProvince', {
- initialValue: getcityArr(theData.locationProvince)
- })(
- <Select placeholder="选择地区" style={{ width: 160 }} >
- {
- cityArr.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="最新跟进" >
- {getFieldDecorator('followSituation', {
- rules: [{ required: true, message: '此项为必填项!' }],
- initialValue: getfllowSituation(theData.followSituation)
- })(
- <Select placeholder="选择跟进进度" style={{ width: 160 }} >
- {
- newFollow.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="客户状态" >
- {getFieldDecorator('customerStatus', {
- rules: [{ required: true, message: '此项为必填项!' }],
- initialValue: getcustomerStatue(theData.customerStatus)
- })(
- <Select placeholder="选择客户状态" style={{ width: 160 }} >
- {
- customerStatus.map(function (item) {
- return <Select.Option key={item.value} >{item.key}</Select.Option>
- })
- }
- </Select>
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="详细地址" >
- {getFieldDecorator('adress', {
- initialValue: theData.adress
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="标签" >
- {getFieldDecorator('tag', {
- initialValue: theData.tag
- })(
- <Select placeholder="选择客户标签" >
- {
- tag.map(function (item) {
- return <Select.Option key={item.key} >{item.key}</Select.Option>
- })
- }
- </Select>
- )}
- </FormItem>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="备注" >
- {getFieldDecorator('remarks', {
- initialValue: theData.remarks
- })(
- <Input type="textarea" rows={4} />
- )}
- </FormItem>
- </div>
- </div>
- <div className="clearfix" style={{marginLeft:'40px',marginBottom:'20px',color:'#000000'}}>联系资料:</div>
- <div>
- <FormItem className="half-item"
- {...formItemLayout}
- label="姓名" >
- {getFieldDecorator('contactName', {
- rules: [{ required: true, message: '此项为必填项!' }],
- initialValue: theData.contactName
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="性别" >
- {getFieldDecorator('sex', {
- rules: [{ required: true, message: '此项为必填项!' }],
- initialValue: theData.sex
- })(
- <Radio.Group onChange={(e) => { this.setState({ sex: e.target.value }); }}>
- <Radio value="0">男</Radio>
- <Radio value="1">女</Radio>
- </Radio.Group>
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="手机号码" >
- {getFieldDecorator('telNum', {
- initialValue: theData.telNum
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="座机号" >
- {getFieldDecorator('mobile', {
- initialValue: theData.mobile
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="QQ号码" >
- {getFieldDecorator('qq', {
- initialValue: theData.qq
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="邮箱号" >
- {getFieldDecorator('email', {
- initialValue: theData.email
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="微信" >
- {getFieldDecorator('wechat', {
- initialValue: theData.wechat
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="部门" >
- {getFieldDecorator('depatrment', {
- initialValue: theData.depatrment
- })(
- <Input />
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="职位" >
- {getFieldDecorator('customerPosition', {
- initialValue: theData.customerPosition
- })(
- <Input />
- )}
- </FormItem>
- </div>
- </div>
- <FormItem wrapperCol={{ span: 12, offset: 4 }}>
- <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
- <Button className="set-submit" type="ghost" onClick={() => this.setModal5Visible(false)}>取消</Button>
- </FormItem>
- </Spin>
- </Form >
- </Modal>
- </div>
- )
- }
- }, {
- title: '客户类型',
- dataIndex: '_shareType',
- key: '_shareType'
- // render: text => { return getcustomerTyp(text); }
- }, {
- title: '地区',
- dataIndex: 'locationProvince',
- key: 'locationProvince',
- render: text => { return getcityArr(text); }
- }, {
- title: '联系人姓名',
- dataIndex: 'contactName',
- key: 'contactName',
- },
- {
- title: '手机号',
- dataIndex: 'telNum',
- key:'telNum',
- },
- {
- title: '客户状态',
- dataIndex: '_customerStatus',
- key: '_customerStatus'
- //render: text => { return getcustomerStatue(text) }
- },
- {
- title: '意向服务',
- dataIndex: 'companyIntention',
- key: 'companyIntention',
- render: text => { return getCompanyIntention(text) }
- },
- {
- title: '最新跟进',
- dataIndex: '_followSituation',
- key: '_followSituation',
- render:text => {
- const theData = this.state.data || {};
- const contactsOption="";
- const rowSelection = {
- selectedRowKeys: this.state.selectedRowKeys,
- onChange: (selectedRowKeys, selectedRows) => {
- this.setState({
- selectedRows: selectedRows.slice(-1),
- selectedRowKeys: selectedRowKeys.slice(-1)
- });
- }
- };
- //const lastwomen=this.state.wemon || {};
-
- const FormItem = Form.Item;
- const { getFieldDecorator } = this.props.form;
- const formItemLayout = {
- labelCol: { span: 8 },
- wrapperCol: { span: 14 },
- };
- const formItemLayput = {
- labelCol: { span: 10 },
- wrapperCol: { span: 14 },
- };
- return (
- <div>
- <Button onClick={() => this.setModal3Visible(true)} style={{marginRight:'10px'}}>{text}</Button>
- <Button type="primary" onClick={() => this.setModal1Visible(true)} ><Icon type="plus" /></Button>
- <Modal
- style={{left:'500px'}}
- footer=''
- title="客户详细信息"
- width='400px'
- visible={this.state.modal4Visible}
- onOk={() => this.setModal4Visible(false)}
- onCancel={() => this.setModal4Visible(false)}
- >
- <Form horizontal onSubmit={this.submitcontact} id="demand-form">
- <Spin spinning={this.state.loading}>
- <div className='clearfix'>
- <FormItem className="half-item"
- {...formItemLayput}
- label="所属公司" >
- <span>{this.state.companyName}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayput}
- label="性别" >
- <span>{getsex(this.state.sex)}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayput}
- label="姓名" >
- <span>{this.state.name}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayput}
- label="QQ号" >
- <span>{this.state.qq}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayput}
- label="手机号" >
- <span>{this.state.telNum}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayput}
- label="部门" >
- <span>{this.state.depatrment}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayput}
- label="职位" >
- <span>{this.state.customerPosition}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayput}
- label="微信号" >
- <span>{this.state.wechat}</span>
- </FormItem>
- </div>
- </Spin>
- </Form>
- </Modal>
- <Modal
- footer=''
- title="历史记录列表"
- width='600px'
- visible={this.state.modal3Visible}
- onOk={() => this.setModal3Visible(false)}
- onCancel={() => this.setModal3Visible(false)}
- >
- <Spin spinning={this.state.loading}>
- <Table dataSource={this.state.datahistory} >
- <Column
- title="时间"
- dataIndex="_followDate"
- key="_followDate"
- />
- <Column
- title="客户"
- dataIndex="contactName"
- key="contactName"
- render={(text, record) => (
- <a href="#" onClick={() => this.setModal4Visible(true)}>{text}</a>
- )}
- />
- <Column
- title="跟进人"
- dataIndex="adminName"
- key="adminName"
- />
- <Column
- title="联系方式"
- dataIndex="contactInfo"
- key="contactInfo"
- />
- <Column
- title="最新跟进状态"
- dataIndex="_followSituation"
- key="_followSituation"
- />
- <Column
- title="跟进结果"
- dataIndex="查看更多"
- key="查看更多"
- render={(text, record) => (
- <div>
- <a href="#" onClick={() => this.setModal6Visible(true)}>查看更多</a>
- <Modal
- footer=''
- title="更多详情"
- visible={this.state.modal6Visible}
- onOk={() => this.setModal6Visible(false)}
- onCancel={() => this.setModal6Visible(false)}>
- <Spin spinning={this.state.loading}>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 5 }}
- wrapperCol={{ span: 18 }}
- label="跟进结果" >
- <span>{}</span>
- </FormItem>
- </div>
- <FormItem
- labelCol={{ span: 5 }}
- wrapperCol={{ span: 18 }}
- label="附件" >
- <div className="clearfix">
- <Upload className="demandDetailShow-upload"
- listType="picture-card"
- fileList={this.state.attachment}
- onPreview={(file) => {
- this.setState({
- previewImage: file.url || file.thumbUrl,
- previewVisible: true,
- });
- }} >
- </Upload>
- <Modal maskClosable={false} footer={null}
- visible={this.state.previewVisible}
- onCancel={() => { this.setState({ previewVisible: false }) }}>
- <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
- </Modal>
- </div>
- </FormItem>
- </Spin>
- </Modal>
- </div>
- )}
- />
- <Column
- title="删除记录"
- key="del"
- render={(text, record, index) => (
- <Popconfirm title="是否删除?" onConfirm={() => this.onDelete(index)}>
- <a href="#" style={{color:"#f00"}}>Delete</a>
- </Popconfirm>
- )}
- />
- </Table>
- </Spin>
- </Modal>
- <Modal
- footer=''
- title="便捷修改"
- width='1000px'
- visible={this.state.modal1Visible}
- onOk={() => this.setModal1Visible(false)}
- onCancel={() => this.setModal1Visible(false)}
- >
-
- <Form horizontal onSubmit={this.handleSubmit} id="demand-form">
- <Spin spinning={this.state.loading}>
- <div className="user-search">
-
- <div className="clearfix">
- <FormItem className="half-item"
- {...formItemLayout}
- label="客户公司名称:" >
- <span>{theData.companyName}</span>
- </FormItem>
- </div>
- <FormItem className="half-item"
- {...formItemLayout}
- label="最新联系人:" >
- <Select placeholder="选择联系人" style={{ width: 140 }}
- value={this.state.lastName}
- onChange={this.hundleName}>
- {this.state.orderStatusOption}
- </Select>
- <span style={{width:'120px',display:'inline-block',marginLeft:'20px'}}>{getcustomerTyp(theData.customerTyp)}
- <Button type="primary" onClick={() => this.setModal2Visible(true)}>添加</Button>
- </span>
- <Modal
- footer=''
- width='800px'
- title="添加详情"
- visible={this.state.modal2Visible}
- onOk={() => this.setModal2Visible(false)}
- onCancel={() => this.setModal2Visible(false)}
- >
- <Form horizontal onSubmit={this.submitcontact} id="demand-form">
- <Spin spinning={this.state.loading}>
- {/* <Row>
- <FormItem className="half-item"
- {...formItemLayout}
- label="所属公司" >
- <span>{theData.id}</span>
- </FormItem>
- </Row>*/}
- <Row>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 14 }}
- label="是否是主要联系人:" style={{marginRight:'10px'}}>
- <Radio.Group value={this.state.hots} onChange={(e) => {
- this.setState({ hots: e.target.value })
- }}>
- <Radio value={0}>是</Radio>
- <Radio value={1}>否</Radio>
- </Radio.Group>
- </FormItem>
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 14 }}
- label="性别:" style={{marginRight:'10px',marginTop: '-15px'}}>
- <Radio.Group value={this.state.hot} onChange={(e) => {
- this.setState({ hot: e.target.value })
- }}>
- <Radio value={0}>男</Radio>
- <Radio value={1}>女</Radio>
- </Radio.Group>
- </FormItem>
- </Row>
- <Row style={{ paddingLeft:'50px' }}>
- <Col span={2}>姓名:</Col>
- <Col span={8}>
- <Input value={this.state.paymentId}
- onChange={(e) => { this.setState({ paymentId: e.target.value }) }} />
- </Col>
- <Col span={2} style={{ marginLeft: '50px' }}>QQ号:</Col>
- <Col span={8}>
- <Input value={this.state.entId}
- onChange={(e) => { this.setState({ entId: e.target.value }) }} />
- </Col>
- </Row>
- <Row style={{ marginTop: '20px',paddingLeft:'50px' }}>
- <Col span={2}>手机号:</Col>
- <Col span={8}>
- <Input value={this.state.pay}
- onChange={(e) => { this.setState({ pay: e.target.value }) }} />
- </Col>
- <Col span={2} style={{ marginLeft: '50px' }}>座机号:</Col>
- <Col span={8}>
- <Input value={this.state.paym}
- onChange={(e) => { this.setState({ paym: e.target.value }) }} />
- </Col>
- </Row>
-
- <Row style={{ marginTop: '20px' ,paddingLeft:'50px'}}>
- <Col span={2}>部门:</Col>
- <Col span={8}>
- <Input value={this.state.paytId}
- onChange={(e) => { this.setState({ paytId: e.target.value }) }} />
- </Col>
- <Col span={2} style={{ marginLeft: '50px' }}>职位:</Col>
- <Col span={8}>
- <Input value={this.state.paentId}
- onChange={(e) => { this.setState({ paentId: e.target.value }) }} />
- </Col>
- </Row>
- <Row style={{ marginTop: '20px',paddingLeft:'50px' }}>
- <Col span={2}>微信号:</Col>
- <Col span={8}>
- <Input value={this.state.payId}
- onChange={(e) => { this.setState({ payId: e.target.value }) }} />
- </Col>
- <Col span={2} style={{ marginLeft: '50px' }}>邮箱:</Col>
- <Col span={8}>
- <Input value={this.state.email}
- onChange={(e) => { this.setState({ email: e.target.value }) }} />
- </Col>
- </Row>
- <Row style={{ marginTop: '20px',paddingLeft:'50px' ,marginBottom:'50px'}}>
- <Button className="set-submit" type="primary" htmlType="submit" id="change_keep" style={{marginLeft:'60px'}}>保存</Button>
- <Button className="set-submit" type="ghost" onClick={() => this.setModal2Visible(false)} id='change_rem'>取消</Button>
- </Row>
- </Spin>
- </Form>
- </Modal>
- </FormItem>
-
- <FormItem className="half-item"
- {...formItemLayout}
- label="联系方式" >
- <Select placeholder="选择方式" style={{width:'100px'}} value={this.state.contacts}
- onChange={this.contacts}>
- <Select.Option value="0">电话</Select.Option>
- <Select.Option value="1">邮件</Select.Option>
- <Select.Option value="2">面谈</Select.Option>
- <Select.Option value="3">短信</Select.Option>
- </Select>
- <span style={{marginLeft:'20px'}}>{this.state.nub}</span>
- </FormItem>
-
- <FormItem className="half-item"
- {...formItemLayout}
- label="最近跟进时间:" >
- <span>{theData.createTime}</span>
- </FormItem>
- <div>
- <FormItem className="half-item"
- {...formItemLayout}
- label="最新跟进时间" >
- {getFieldDecorator('createTime', {
- initialValue: theData.createTime ? moment(theData.createTime) : null
- })(
- <DatePicker />
- )}
- {getFieldDecorator('createTim', {
- initialValue: theData.createTime ? moment(theData.createTime) : null
- })(
- <TimePicker />
- )}
- </FormItem>
-
- </div>
- <FormItem className="half-item"
- {...formItemLayout}
- label="客户状态:" >
- <span>{getcustomerStatue(theData.customerStatus)}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="更新客户状态" >
- {getFieldDecorator('customerStatus', {
- initialValue: getcustomerStatue(theData.customerStatus)
- })(
- <Select placeholder="选择客户状态" style={{width:'200px'}}>
- {
- customerStatus.map(function (item) {
- return <Select.Option key={item.value} style={{width:'200px'}}>{item.key}</Select.Option>
- })
- }
- </Select>
- )}
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="跟进状态:" >
- <span>{getfllowSituation(theData.followSituation)}</span>
- </FormItem>
- <FormItem className="half-item"
- {...formItemLayout}
- label="最新跟进状态" >
- {getFieldDecorator('followSituation', {
- initialValue: getfllowSituation(theData.followSituation)
- })(
- <Select placeholder="选择跟进状态" style={{width:'200px'}}>
- {
- newFollow.map(function (item) {
- return <Select.Option key={item.value} style={{width:'200px'}}>{item.key}</Select.Option>
- })
- }
- </Select>
- )}
- </FormItem>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="跟进结果" >
- {getFieldDecorator('remarks', {
- initialValue: theData.remarks
- })(
- <Input type="textarea" rows={4} />
- )}
- </FormItem>
- </div>
- <div className="clearfix">
- <FormItem
- labelCol={{ span: 4 }}
- wrapperCol={{ span: 18 }}
- label="技术图片" >
- <PicturesWall
- pictureSign="achievement_technical_picture"
- fileList={this.getTechnicalPictureUrl}
- pictureUrl={this.state.technicalPictureUrl} />
- <p>图片建议:图片要清晰。</p>
- </FormItem>
- </div>
- <Button style={{ marginRight: '20px' ,marginLeft:'160px',marginBottom:'50px'}} type="primary" onClick={this.addFollowSubmit}>保存</Button>
- <Button className="set-submit" type="ghost" onClick={() => this.setModal1Visible(false)} id='change_rem'>取消</Button>
- </div>
- </Spin>
- </Form >
- </Modal>
- </div>
- )
- }
- },
- {
- title: '跟单人',
- dataIndex: 'adminName',
- key: 'adminName',
- },
- {
- title: '时间',
- dataIndex: 'followDate',
- key: 'followDate',
- }
- ],
- dataSource: [],
- searchTime: [,]
- };
- },
-
-
- componentWillMount() {
- let theArr = [];
- customerStatus.map(function (item) {
- theArr.push(
- <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
- )
- });
- let auditArr = [];
- cityArr.map(function (item) {
- auditArr.push(
- <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
- )
- });
- let intentionalArr = [];
- intentionalService.map(function (item) {
- intentionalArr.push(
- <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
- )
- });
- let newArr = [];
- newFollow.map(function (item) {
- newArr.push(
- <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
- )
- });
- this.state.customerStatuarr = theArr;
- this.state.auditStatusOption = auditArr;
- this.state.intentionalOption = intentionalArr;
- this.state.newOption = newArr;
- if (window.location.search) {
- let theObj = getSearchUrl(window.location.search);
- if (theObj.rid) {
- theObj.id = theObj.rid;
- if (theObj.rid != 'null') {
- this.tableRowClick(theObj);
- };
- };
- };
- this.loadData();
- },
- tableRowClick(record, index) {
- this.state.RowData = record;
- this.setState({
- showDesc: true
- });
- },
-
- //删除功能,已经完成
- delectRow() {
- let deletedIds;
- let adminName;
- let customerStatus;
- let companyIntention;
- let followSituation;
-
- for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
- let rowItem = this.state.selectedRows[idx];
- if (rowItem.id) {
- deletedIds=rowItem.id;
- adminName=rowItem.adminName;
- customerStatus=rowItem.customerStatus;
- companyIntention=rowItem.companyIntention;
- followSituation=rowItem.followSituation;
- };
- };
- this.state.data = []
- this.setState({
- selectedRowKeys: [],
- loading: deletedIds.length > 0
- });
- $.ajax({
- method: "post",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/customer/deleteCustomer",
- data: {
- id: deletedIds,//删除的ID
- beforeCustomerStatus:customerStatus,
- beforeCompanyIntention:companyIntention,
- beforeFollowSituation:followSituation,
- adminName:adminName
- }
- }).done(function (data) {
- if (!data.error.length) {
- message.success('删除成功!');
- this.setState({
- loading: false,
- });
- } else {
- message.warning(data.error[0].message);
- };
- this.loadData();
- }.bind(this));
- },
- //转为公共客户功能
- changeRow() {
- let deletedIds;
- for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
- let rowItem = this.state.selectedRows[idx];
- if (rowItem.id) {
- deletedIds=rowItem.id
- };
- };
- this.setState({
- selectedRowKeys: [],
- loading: deletedIds.length > 0
- });
- $.ajax({
- method: "GET",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/customer/deleteCustomer", //等待接口
- data: {
- id: deletedIds
- }
- }).done(function (data) {
- if (!data.data.error.length) {
- message.success('已转为公共客户!');
- this.setState({
- loading: false,
- });
- } else {
- message.warning(data.error[0].message);
- };
- this.loadData();
- }.bind(this));
- },
- addClick() {
- this.state.RowData = {};
- this.setState({
- showDesc: true
- });
- },
-
- closeDesc(e, s) {
- this.state.showDesc = e;
- if (s) {
- this.loadData();
- };
- },
- search() {
- this.loadData();
- },
- reset() {
- this.state.id = undefined;
- this.state.customerName = undefined;
- this.state.shareTyp = undefined;
- this.state.province = undefined;
- this.state.ownerType = undefined;
- this.state.customerStatus = undefined;
- this.state.auditStatus = undefined;
- this.state.adminName = undefined;
- this.state.contactName = undefined;
- this.state.releaseDate = [];
- this.loadData();
- },
- searchSwitch() {
- this.setState({
- searchMore: !this.state.searchMore
- });
- },
- render() {
- const FormItem = Form.Item
- const rowSelection = {
- selectedRowKeys: this.state.selectedRowKeys,
- onChange: (selectedRowKeys, selectedRows) => {
- this.setState({
- selectedRows: selectedRows.slice(-1),
- selectedRowKeys: selectedRowKeys.slice(-1)
- });
- }
- };
- const hasSelected = this.state.selectedRowKeys.length > 0;
- const { RangePicker } = DatePicker;
- const theData = this.props.data || {};
- const { getFieldDecorator } = this.props.form;
- const formItemLayout = {
- labelCol: { span: 8 },
- wrapperCol: { span: 14 },
- };
- return (
- <div className="user-content" >
- <div className="content-title">
- <span>客户管理</span>
- <div className="patent-addNew clearfix">
- <Upload
- action={globalConfig.context + "/api/admin/achievement/uploadTemplate"}
- data={{ 'sign': 'achievement_template' }}
- beforeUpload={beforeUploadFile}
- showUploadList={false}
- onChange={(info) => {
- if (info.file.status !== 'uploading') {
- console.log(info.file, info.fileList);
- }
- if (info.file.status === 'done') {
- if (!info.file.response.error.length) {
- message.success(`${info.file.name} 文件上传成功!`);
- } else {
- message.warning(info.file.response.error[0].message);
- return;
- };
- } else if (info.file.status === 'error') {
- message.error(`${info.file.name} 文件上传失败。`);
- };
- }} >
- <Button>上传批量导入模板</Button>
- </Upload>
- <Button onClick={() => { window.open(globalConfig.context + '/api/admin/achievement/downloadTemplate?sign=achievement_template') }}>下载批量导入模板</Button>
- <Button type="primary" className="addButton" onClick={this.addClick}>新建客户<Icon type="plus" /></Button>
- <BatchImport closeDesc={this.closeDesc} />
- </div>
- </div>
- <div className="user-search">
- <Input placeholder="公司名称"
- value={this.state.customerName}
- onChange={(e) => { this.setState({ customerName: e.target.value }); }} />
- <Select placeholder="客户类型" style={{ width: 120 }}
- value={this.state.shareTyp }
- onChange={(e) => { this.setState({ shareTyp : e }) }}>
- <Select.Option value="0" >个人客户</Select.Option>
- <Select.Option value="1" >公司客户</Select.Option>
- </Select>
- <Select placeholder="意向服务"
- style={{ width: 160 }}
- value={this.state.companyIntention}
- onChange={(e) => { this.setState({ companyIntention: e }) }}>
- {this.state.intentionalOption}
- </Select>
- <Select placeholder="跟进进度"
- style={{ width: 160 }}
- value={this.state.followSituation}
- onChange={(e) => { this.setState({ followSituation: e }) }}>
- {this.state.newOption}
- </Select>
- <Select placeholder="地区"
- style={{ width: 160 }}
- value={this.state.province}
- onChange={(e) => { this.setState({ province: e }) }}>
- {this.state.auditStatusOption}
- </Select>
- <Select placeholder="客户状态" style={{ width: 120 }}
- value={this.state.customerStatus}
- onChange={(e) => { this.setState({ customerStatus: e }) }}>
- {this.state.customerStatuarr}
- </Select>
- <Button type="primary" onClick={this.search}>搜索</Button>
- <Button onClick={this.reset}>重置</Button>
- <Button style={{ background: "#ea0862", border: "none", color: "#fff" }}
- disabled={!hasSelected}
- onClick={this.delectRow}>删除<Icon type="minus" /></Button>
- <Button type="primary" onClick={this.showModa} disabled={!hasSelected}>指定转交人<Icon type="plus" /></Button>
- <Modal
- footer=''
- title="选择指定人"
- visible={this.state.visible}
- onOk={this.handleOk}
- onCancel={this.handleCancel}
-
- >
- <Spin spinning={this.state.loading}>
- <Table
- columns={this.state.columnsman}
- rowSelection={rowSelection}
- dataSource={this.state.dataman}
- scroll={{ y: 300 }}/>
-
- <FormItem wrapperCol={{ span: 12, offset: 12 }}>
- <Button className="set-submit" type="primary" htmlType="submit" id="change_keep" style={{marginLeft:"50px"}} onClick={this.changeAssigner }>保存</Button>
- <Button className="set-submit" type="ghost" onClick={this.handleCancel } style={{marginLeft:"30px"}} id='change_rem'>取消</Button>
- </FormItem>
- </Spin>
- </Modal>
- <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
- disabled={!hasSelected}
- onClick={this.changeRow}>转为公共客户<Icon /></Button>
- <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
- <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
- <Input placeholder="跟单人" style={{width:'140px',marginRight:'10px'}}
- value={this.state.adminName}
- onChange={(e) => { this.setState({ adminName: e.target.value }); }} />
- <Input placeholder="联系人姓名" style={{width:'140px',marginRight:'10px'}}
- value={this.state.contactName}
- onChange={(e) => { this.setState({ contactName: e.target.value }); }} />
- <span>发布时间 :</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 }); }} />
-
- </div>
- </div>
- <div className="patent-table">
- <Spin spinning={this.state.loading}>
- <Table columns={this.state.columns}
- dataSource={this.state.dataSource}
- rowSelection={rowSelection}
- pagination={this.state.pagination}
- />
- </Spin>
- </div>
- <TechAchievementDesc
- data={this.state.RowData}
- detailApiUrl={this.props['data-detailApiUrl']}
- achievementCategoryOption={this.state.achievementCategoryOption}
- showDesc={this.state.showDesc}
- closeDesc={this.closeDesc} />
-
- </div >
- );
- }
- }));
- export default AchievementList;
|