myClient.jsx 106 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205220622072208220922102211221222132214221522162217221822192220222122222223222422252226222722282229223022312232223322342235223622372238223922402241224222432244224522462247224822492250225122522253225422552256225722582259226022612262226322642265226622672268226922702271227222732274227522762277227822792280228122822283228422852286228722882289229022912292229322942295229622972298229923002301230223032304230523062307230823092310231123122313231423152316231723182319232023212322232323242325232623272328232923302331233223332334233523362337233823392340234123422343234423452346234723482349235023512352235323542355235623572358235923602361236223632364236523662367236823692370237123722373237423752376237723782379238023812382238323842385238623872388238923902391239223932394239523962397239823992400240124022403240424052406240724082409241024112412241324142415241624172418241924202421242224232424242524262427242824292430243124322433243424352436243724382439244024412442244324442445244624472448244924502451245224532454245524562457245824592460246124622463246424652466246724682469247024712472247324742475247624772478247924802481248224832484248524862487248824892490249124922493
  1. import React from 'react';
  2. import { Radio, Icon, Button, Input, Select, Tabs,Spin,Popconfirm, Table, Switch, message, DatePicker, Modal, Upload,Form ,Row,Col,TimePicker} from 'antd';
  3. import ajax from 'jquery/src/ajax/xhr.js';
  4. import $ from 'jquery/src/ajax';
  5. import moment from 'moment';
  6. import './myClient.less';
  7. const { Column, ColumnGroup } = Table;
  8. const TabPane = Tabs.TabPane;
  9. import TechAchievementDesc from './myClientDesc.jsx';
  10. import { achievementCategoryList, techAuditStatusList,cityArr,tag,customerStatus,intentionalService,newFollow ,contact,sex} from '../../dataDic.js';
  11. import { beforeUploadFile, companySearch, getAchievementCategory,getsex,getSearchUrl,getTechAuditStatus,getcustomerTyp,getcityArr,getCompanyIntentionOn,getcustomerStatue,getCompanyIntention,getfllowSituation,getcontact,getfllowSituationOn,getcustomerStatueOn} from '../../tools.js';
  12. import BatchImport from './batchImport';
  13. //图片组件
  14. const PicturesWall = React.createClass({
  15. getInitialState() {
  16. return {
  17. previewVisible: false,
  18. previewImage: '',
  19. fileList: [],
  20. }
  21. },
  22. handleCancel() {
  23. this.setState({ previewVisible: false })
  24. },
  25. handlePreview(file) {
  26. this.setState({
  27. previewImage: file.url || file.thumbUrl,
  28. previewVisible: true,
  29. });
  30. },
  31. handleChange(info) {
  32. let fileList = info.fileList;
  33. this.setState({ fileList });
  34. this.props.fileList(fileList);
  35. },
  36. componentWillReceiveProps(nextProps) {
  37. this.state.fileList = nextProps.pictureUrl;
  38. },
  39. render() {
  40. const { previewVisible, previewImage, fileList } = this.state;
  41. const uploadButton = (
  42. <div>
  43. <Icon type="plus" />
  44. <div className="ant-upload-text">点击上传</div>
  45. </div>
  46. );
  47. return (
  48. <div className="clearfix">
  49. <Upload
  50. action={globalConfig.context + "/api/admin/customer/attachmentUpload"}
  51. data={{ 'sign': this.props.pictureSign }}
  52. listType="picture-card"
  53. fileList={fileList}
  54. onPreview={this.handlePreview}
  55. onChange={this.handleChange} >
  56. {fileList.length >= 5 ? null : uploadButton}
  57. </Upload>
  58. <Modal maskClosable={false} visible={previewVisible} footer={null} onCancel={this.handleCancel}>
  59. <img alt="example" style={{ width: '100%' }} src={previewImage} />
  60. </Modal>
  61. </div>
  62. );
  63. }
  64. });
  65. const AchievementList = Form.create()(React.createClass({
  66. loadData(pageNo, apiUrl) {
  67. this.state.data = [];
  68. this.setState({
  69. loading: true
  70. });
  71. $.ajax({
  72. method: "post",
  73. dataType: "json",
  74. crossDomain: false,
  75. url:globalConfig.context + '/api/admin/customer/listPrivateCustomer',
  76. data: {
  77. pageNo: pageNo || 1,
  78. pageSize: this.state.pagination.pageSize,
  79. companyName: this.state.companyNamet, //名称1
  80. customerType: this.state.customerTypet, //客户类型1
  81. locationProvince:this.state.locationProvincet,//地区
  82. customerStatus:this.state.customerStatust,//客户状态1
  83. contactName:this.state.contactNamet,//联系人姓名1
  84. contactTel:this.state.contactTelt,//联系人手机
  85. companyIntention:this.state.companyIntentiont,//意向服务
  86. followSituation:this.state.followSituationt,//最新跟进进度
  87. },
  88. success: function (data) {
  89. let theArr = [];
  90. let ad;
  91. if (data.error.length || data.data.list=="") {
  92. if (data.error && data.error.length) {
  93. message.warning(data.error[0].message);
  94. };
  95. } else {
  96. ad=data.data.list[0].aid;
  97. for (let i = 0; i < data.data.list.length; i++) {
  98. let thisdata = data.data.list[i];
  99. let intentionText=thisdata._companyIntention.split("-");
  100. let intentionstring=intentionText.slice("0","1").join('-')
  101. theArr.push({
  102. key: i,
  103. id: thisdata.id,
  104. companyName:thisdata.companyName,//公司名称
  105. _shareType:thisdata._shareType,//客户类型
  106. locationProvince:thisdata.locationProvince,//地区
  107. contactName:thisdata.contactName, //联系人姓名
  108. telNum:thisdata.telNum,//手机号
  109. _customerStatus:thisdata._customerStatus,//客户状态
  110. _companyIntention:intentionstring,//意向服务
  111. _followSituation:thisdata._followSituation,//最新跟进
  112. customerStatus:thisdata.customerStatus,//客户状态
  113. companyIntention:thisdata.companyIntention,//意向服务
  114. followSituation:thisdata.followSituation,//最新跟进
  115. adminName:thisdata.adminName, //跟进人
  116. followDate:thisdata.followDate,
  117. _customerType:thisdata._customerType,//客户类型
  118. });
  119. };
  120. this.state.pagination.current = data.data.pageNo;
  121. this.state.pagination.total = data.data.totalCount;
  122. };
  123. this.setState({
  124. aid:ad,
  125. dataSource: theArr,
  126. pagination: this.state.pagination
  127. });
  128. }.bind(this),
  129. }).always(function () {
  130. this.setState({
  131. loading: false
  132. });
  133. }.bind(this));
  134. },
  135. //点击+号进行两次查询,这个是查询联系人的函数
  136. getNewWoman(index) {
  137. this.state.data = []
  138. $.ajax({
  139. method: "post",
  140. dataType: "json",
  141. crossDomain: false,
  142. url: globalConfig.context + "/api/admin/customer/findCustomerUserList",
  143. data:{
  144. cid:index
  145. },
  146. success: function (data) {
  147. let theArr = [];
  148. let thedata=data.data;
  149. var email=[];
  150. var telNum=[];
  151. var contactIds=[];
  152. thedata.map(function (item,index) {
  153. email.push(thedata[index].email);
  154. contactIds.push(thedata[index].id);
  155. telNum.push(thedata[index].telNum);
  156. theArr.push(<Select.Option value={index}>{item.name}</Select.Option>)
  157. });
  158. var lastName= thedata[thedata.length-1].name;
  159. var nub=thedata[thedata.length-1].telNum;
  160. var kid=thedata[thedata.length-1].id;
  161. var contacts='电话';
  162. this.setState({
  163. idt:thedata[0].id,
  164. kid:kid,
  165. contactIds:contactIds,
  166. contacts:contacts,
  167. nub:nub,
  168. telNum:telNum,
  169. email:email,
  170. lastName:lastName,
  171. orderStatusOption: theArr,
  172. technicalPictureUrl: thedata.sign ? splitUrl(thedata.sign, ',', globalConfig.avatarHost + '/upload') : [],
  173. });
  174. }.bind(this),
  175. }).always(function () {
  176. this.setState({
  177. loading: false
  178. });
  179. }.bind(this));
  180. },
  181. //在添加联系记录页面,选择联系方式查看号码
  182. contacts(e){
  183. let conts='';
  184. if(e==0){
  185. conts='电话'
  186. this.state.nub=this.state.changNub
  187. }
  188. if(e==1){
  189. conts='邮件'
  190. this.state.nub=this.state.changEmail
  191. }
  192. if(e==2){
  193. conts='面谈'
  194. this.state.nub=''
  195. }
  196. if(e==3){
  197. conts='短信'
  198. this.state.nub=''
  199. }
  200. this.setState({
  201. conts:conts,
  202. contacts: e,
  203. });
  204. },
  205. //通过ID查询这一条的信息
  206. Detailload(deletedIds,record){
  207. this.RowClick;
  208. $.ajax({
  209. method: "post",
  210. dataType: "json",
  211. crossDomain: false,
  212. url: globalConfig.context + '/api/admin/customer/findCustomerDetails',
  213. data: {
  214. id: deletedIds
  215. },
  216. success: function (data) {
  217. let thisData = data.data;
  218. if (!thisData) {
  219. if (data.error && data.error.length) {
  220. message.warning(data.error[0].message);
  221. };
  222. thisData = {};
  223. };
  224. //意向服务多选
  225. // let companyArr=[];
  226. // let companyString=thisData.companyIntention;
  227. // companyArr=companyString.split(",") ;
  228. let creatMent=thisData.createTime.substr(10,9)
  229. let createYear=thisData.createTime.substr(0,10)
  230. this.setState({
  231. locationProvince:thisData.locationProvince,
  232. addId:thisData.id,
  233. creatMent:creatMent,
  234. createYear:createYear,
  235. addCid:thisData.cid,
  236. datak: thisData,
  237. companyIndustry:thisData.companyIndustry,
  238. adress:thisData.adress,
  239. followSituation:thisData.followSituation,
  240. customerStatus:thisData.customerStatus.toString(),
  241. companyIntention:thisData.companyIntention,
  242. _followSituation:thisData._followSituation,
  243. _customerStatus:thisData._customerStatus,
  244. _companyIntention:thisData._companyIntention,
  245. cid:thisData.cid,
  246. customerType:thisData.customerType,
  247. companyName:thisData.companyName,
  248. adminName:thisData.adminName
  249. });
  250. if (thisData.ownerId) {
  251. this.getContactsList(thisData.ownerId);
  252. };
  253. }.bind(this),
  254. }).always(function () {
  255. this.setState({
  256. loading: false
  257. });
  258. }.bind(this));
  259. },
  260. //点击出现函数
  261. //点击消失函数
  262. setModal1Visiblecancel(e) {
  263. this.setState({
  264. modal1Visible:false
  265. });
  266. this.reset();
  267. },
  268. //点击添加跟进记录,点击最新跟进下的+号,将会查询出很多数据,展示在列表里面,
  269. setModal1VisibleOk(e) {
  270. this.setState({modal1Visible:true});
  271. let deletedIds;
  272. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  273. let rowItem = this.state.selectedRows[idx];
  274. if (rowItem.id) {
  275. deletedIds=rowItem.id;
  276. };
  277. };
  278. this.setState({
  279. remarks:'',
  280. selectedRowKeys: [],
  281. });
  282. this.Detailload(deletedIds);
  283. this.getNewWoman(deletedIds);
  284. },
  285. //点击出现函数
  286. setModal2VisibleOk(e) {
  287. this.setState({
  288. modal2Visible:true
  289. });
  290. this.state.hotst=undefined;
  291. this.state.hott=undefined;
  292. this.state.paymentIdt='';
  293. this.state.entIdt='';
  294. this.state.payt='';
  295. this.state.paymt='';
  296. this.state.paytIdtt='';
  297. this.state.paentIdt='';
  298. this.state.payIdt='';
  299. this.state.emailst='';
  300. },
  301. //点击消失函数
  302. setModal2Visiblecancel(e) {
  303. this.setState({
  304. modal2Visible:false
  305. });
  306. },
  307. //点击消失函数
  308. setModal3Visiblecancel(e) {
  309. this.setState({
  310. modal3Visible:false
  311. });
  312. },
  313. rescordlist(deletedIds){
  314. this.setState({
  315. selectedRowKeys:[],
  316. });
  317. this.state.data = [];
  318. $.ajax({
  319. method: "get",
  320. dataType: "json",
  321. crossDomain: false,
  322. url:globalConfig.context + '/api/admin/customer/listFollowUpRecord',
  323. data: {
  324. customerId:deletedIds
  325. },
  326. success: function (data) {
  327. let theArr = [];
  328. let theWomanID=[];
  329. let theFollowID=[];
  330. if (!data.data) {
  331. if (data.error && data.error.length) {
  332. message.warning(data.error[0].message);
  333. };
  334. } else {
  335. data.data.map(function (item,index) {
  336. theWomanID.push(data.data[index].contactId);
  337. });
  338. data.data.map(function (item,index) {
  339. theFollowID.push(data.data[index].followId);
  340. });
  341. for (let i = 0; i < data.data.length; i++) {
  342. let thisdata = data.data[i];
  343. theArr.push({
  344. key:i,
  345. _followDate:thisdata._followDate,//跟进时间
  346. adminName:thisdata.adminName,//跟进人
  347. contactName:thisdata.contactName, //联系人姓名
  348. contactId:thisdata.contactId, //联系人ID
  349. contactInfo:thisdata.contactInfo,//联系信息
  350. _customerStatus:thisdata._customerStatus,//客户状态
  351. _followSituation:thisdata._followSituation,//最新跟进
  352. followResult:thisdata.followResult,//跟进结果
  353. attachment:thisdata.attachment,//附件地址
  354. });
  355. };
  356. };
  357. this.setState({//导出数据
  358. datahistory: theArr,
  359. theWomanID:theWomanID,
  360. theFollowID:theFollowID,
  361. });
  362. }.bind(this),
  363. }).always(function () {
  364. this.setState({
  365. loading: false
  366. });
  367. }.bind(this));
  368. },
  369. //点击查看跟进记录,点击最新跟进的第一个按钮(跟进状态)执行的函数,将会出现很多跟进列表
  370. setModal3VisibleOk(e) {
  371. this.setState({ modal3Visible:true });
  372. this.setState({
  373. loading: true
  374. });
  375. let deletedIds;
  376. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  377. let rowItem = this.state.selectedRows[idx];
  378. if (rowItem.id) {
  379. deletedIds=rowItem.id;
  380. };
  381. };
  382. this.rescordlist(deletedIds)
  383. },
  384. //删除历史记录
  385. onDelete(index){
  386. let deleteID=this.state.theFollowID[index];
  387. $.ajax({
  388. method: "get",
  389. dataType: "json",
  390. crossDomain: false,
  391. url: globalConfig.context + "/api/admin/customer/deleteFollowUpRecord",
  392. data: {
  393. followId:deleteID,//删除的ID
  394. }
  395. }).done(function (data) {
  396. if (!data.error.length) {
  397. message.success('删除成功!');
  398. this.setModal3Visiblecancel();
  399. this.setModal3VisibleOk();
  400. this.setState({
  401. loading: false,
  402. });
  403. } else {
  404. message.warning(data.error[0].message);
  405. };
  406. this.loadData();
  407. }.bind(this));
  408. },
  409. //点击消失函数
  410. setModal4Visiblecancel(e) {
  411. this.setState({
  412. modal4Visible:false
  413. });
  414. },
  415. //点击客户的名字,进行详情的查询
  416. setModal4Visible(e,index) {
  417. this.setState({ modal4Visible:true });
  418. let changeIds=this.state.datahistory[index].contactId;
  419. $.ajax({
  420. method: "get",
  421. dataType: "json",
  422. crossDomain: false,
  423. url:globalConfig.context + '/api/admin/customer/findContactDetail',
  424. data: {
  425. contactId:changeIds
  426. },
  427. success: function (data) {
  428. let theArr = [];
  429. let theDate=data.data;
  430. if (!data.data) {
  431. if (data.error && data.error.length) {
  432. message.warning(data.error[0].message);
  433. };
  434. } else {
  435. for (let i = 0; i < data.data.length; i++) {
  436. let thisdata = data.data[i];
  437. theArr.push({
  438. key:i,
  439. name:name,//联系人姓名
  440. sex:sex,//联系人性别
  441. mobile:mobile,//座机号
  442. telNum:telNum,//手机号
  443. email:email,//邮箱
  444. qq:qq,//qq
  445. wechat:wechat,//微信号
  446. depatrment:depatrment,//部门
  447. customerPosition:customerPosition,//职位
  448. });
  449. };
  450. };
  451. this.setState({//导出数据
  452. theDate:theDate,
  453. name:theDate.name,//联系人姓名
  454. sex:theDate.sex,//联系人性别
  455. mobile:theDate.mobile,//座机号
  456. telNum:theDate.telNum,//手机号
  457. email:theDate.email,//邮箱
  458. qq:theDate.qq,//qq
  459. wechat:theDate.wechat,//微信号
  460. depatrment:theDate.depatrment,//部门
  461. customerPosition:theDate.customerPosition,//职位
  462. companyName:theDate.companyName,//公司
  463. });
  464. }.bind(this),
  465. }).always(function () {
  466. this.setState({
  467. loading: false
  468. });
  469. }.bind(this));
  470. },
  471. //点击消失函数
  472. setModal5Visiblecancel(e) {
  473. this.setState({
  474. modal5Visible:false
  475. });
  476. },
  477. setModal6Visiblecancel(e) {
  478. this.setState({
  479. modal6Visible:false
  480. });
  481. },
  482. setModal8Visiblecancel(e) {
  483. this.setState({
  484. modal8Visible:false
  485. });
  486. },
  487. //点击名称时获取列表
  488. setModal5VisibleOk(e) {
  489. this.setState({ modal5Visible:true }); //需要一个请求数据
  490. this.Detailload(e.id);
  491. },
  492. //历史记录查看更多,还是历史记录接口
  493. setModal6VisibleOk(e) {
  494. this.setState({ modal6Visible:true }); //需要一个请求数据
  495. },
  496. getPictureUrl(e) {
  497. this.setState({pictureUrl: e });
  498. },
  499. //查看所有的联系人setModal7VisibleOk
  500. contactList(index) {
  501. $.ajax({
  502. method: "post",
  503. dataType: "json",
  504. crossDomain: false,
  505. url: globalConfig.context + "/api/admin/customer/findCustomerUserList",
  506. data:{
  507. cid:index
  508. },
  509. success: function (data) {
  510. let theArr = [];
  511. let thedata=data.data;
  512. let cidArr=[];
  513. for (let i = 0; i < data.data.length; i++) {
  514. cidArr.push({
  515. i:thedata[i].cid,
  516. })
  517. }
  518. for (let i = 0; i < data.data.length; i++) {
  519. let thisdata = data.data[i];
  520. theArr.push({
  521. cid:thisdata.cid,//客户的ID
  522. id:thisdata.id,//联系人ID
  523. contactName:thisdata.name,//联系人姓名
  524. sex:thisdata.sex,//联系人性别
  525. mobile:thisdata.mobile,//座机号
  526. telNum:thisdata.telNum,//手机号
  527. email:thisdata.email,//邮箱
  528. qq:thisdata.qq,//qq
  529. wechat:thisdata.wechat,//微信号
  530. depatrment:thisdata.depatrment,//部门
  531. customerPosition:thisdata.customerPosition,//职位
  532. });
  533. };
  534. this.setState({
  535. information: theArr,
  536. cidArr:cidArr,
  537. });
  538. }.bind(this),
  539. }).always(function () {
  540. this.setState({
  541. loading: false
  542. });
  543. }.bind(this));
  544. },
  545. //修改联系人列表数据
  546. setModal8VisibleOk(e) {
  547. this.setState({ modal8Visible:true }); //需要一个请求数据
  548. let deletedIds=this.state.rowId;
  549. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  550. let rowItem = this.state.selectedRows[idx];
  551. if (rowItem.id) {
  552. deletedIds=rowItem.id;
  553. };
  554. };
  555. },
  556. changefollow(e){
  557. e.preventDefault();
  558. $.ajax({
  559. method: "post",
  560. dataType: "json",
  561. crossDomain: false,
  562. url: globalConfig.context + "/api/admin/customer/updateContacter",
  563. data: {
  564. id:this.state.id,//联系人ID
  565. cid:this.state.cid,//客户的ID
  566. name:this.state.name,//客户名
  567. sex:this.state.sex,//性别
  568. mobile:this.state.mobile,//座机号
  569. telNum:this.state.telNum,//手机号
  570. email:this.state.email,//邮箱
  571. qq:this.state.qq,//qq
  572. wechat:this.state.wechat,//微信号
  573. depatrment:this.state.depatrment,//部门
  574. customerPosition:this.state.customerPosition,//职位
  575. primaryFlg:this.state.primaryFlg,//是否是主要联系人
  576. }
  577. }).done(function (data) {
  578. if (!data.error.length) {
  579. message.success('修改成功!');
  580. this.setState({
  581. loading: false,
  582. });
  583. this.setModal8Visiblecancel()
  584. } else {
  585. message.warning(data.error[0].message);
  586. };
  587. this.Detailload(this.state.rowId);
  588. this.contactList(this.state.rowId);
  589. this.loadData();
  590. }.bind(this));
  591. },
  592. informationRowClick(index){
  593. this.setModal8VisibleOk()
  594. $.ajax({
  595. method: "get",
  596. dataType: "json",
  597. crossDomain: false,
  598. url:globalConfig.context + '/api/admin/customer/findContactDetail',
  599. data: {
  600. contactId:index.id
  601. },
  602. success: function (data) {
  603. let theArr = [];
  604. let theDate=data.data;
  605. if (!data.data) {
  606. if (data.error && data.error.length) {
  607. message.warning(data.error[0].message);
  608. };
  609. } else {
  610. for (let i = 0; i < data.data.length; i++) {
  611. let thisdata = data.data[i];
  612. theArr.push({
  613. key:i,
  614. primaryFlg:primaryFlg,
  615. name:name,//联系人姓名
  616. sex:sex,//联系人性别
  617. mobile:mobile,//座机号
  618. telNum:telNum,//手机号
  619. email:email,//邮箱
  620. qq:qq,//qq
  621. wechat:wechat,//微信号
  622. depatrment:depatrment,//部门
  623. customerPosition:customerPosition,//职位
  624. });
  625. };
  626. };
  627. this.setState({//导出数据
  628. primaryFlg:theDate.primaryFlg,
  629. thaDate:theDate,
  630. cid:theDate.cid,//客户ID
  631. id:theDate.id,//联系人ID
  632. name:theDate.name,//联系人姓名
  633. sex:theDate.sex,//联系人性别
  634. mobile:theDate.mobile,//座机号
  635. telNum:theDate.telNum,//手机号
  636. email:theDate.email,//邮箱
  637. qq:theDate.qq,//qq
  638. wechat:theDate.wechat,//微信号
  639. depatrment:theDate.depatrment,//部门
  640. customerPosition:theDate.customerPosition,//职位
  641. companyName:theDate.companyName,//公司
  642. });
  643. }.bind(this),
  644. }).always(function () {
  645. this.setState({
  646. loading: false
  647. });
  648. }.bind(this));
  649. },
  650. componentWillReceiveProps(nextProps) {
  651. if (!this.props.visible && nextProps.visible) {
  652. if (nextProps.data && nextProps.data.id) {
  653. this.loadData(nextProps.data.id, nextProps.detailApiUrl);
  654. };
  655. this.state.technicalPictureUrl = [];
  656. };
  657. },
  658. //添加一条跟进记录,点击保存按钮进行添加
  659. addFollowSubmit(e) {
  660. e.preventDefault();
  661. this.state.data = []
  662. this.setState({
  663. selectedRowKeys: [],
  664. });
  665. let deletedIds=this.state.addId;
  666. this.props.form.validateFields((err, values) => {
  667. if (!err) {
  668. this.setState({
  669. loading: true
  670. });
  671. let custype=values._shareType;
  672. let customerTypechange="";
  673. switch(custype){
  674. case "个人客户":customerTypechange=0;break;
  675. case "公司客户":customerTypechange=1;break;
  676. }
  677. let customerStatus= getcustomerStatueOn(this.state.customerStatus);
  678. let followSituation= getfllowSituationOn(this.state.followSituation);
  679. //图片转换
  680. let thetechnicalPictureUrl = [];
  681. if (this.state.technicalPictureUrl.length) {
  682. let picArr = [];
  683. this.state.technicalPictureUrl.map(function (item) {
  684. picArr.push(item.response.data);
  685. });
  686. thetechnicalPictureUrl = picArr.join(",");
  687. };
  688. let yearMonth = new Date(this.state.createYear).toLocaleDateString();
  689. let yearString = yearMonth.split('/').join('-');
  690. let pjstringY='';
  691. let days = new Date(this.state.creatMent);
  692. let hours = days.getHours().length==1?"0"+days.getHours():days.getHours();
  693. let minutes = days.getMinutes().length==1?"0"+days.getMinutes():days.getMinutes();
  694. let seconds = days.getSeconds().length==1?"0"+days.getSeconds():days.getSeconds();
  695. if(this.state.creatMent.length==9){
  696. pjstringY=this.state.creatMent
  697. }else{
  698. pjstringY=hours+':'+minutes+':'+seconds
  699. }
  700. $.ajax({
  701. method: "POST",
  702. dataType: "json",
  703. crossDomain: false,
  704. url:globalConfig.context + '/api/admin/customer/addFollowUpRecord',
  705. data: {
  706. id: this.state.addCid,//编号id
  707. cuid:this.state.idt,//联系人ID
  708. followDates:yearString+' '+pjstringY,
  709. followResult:values.remarks,//跟进结果
  710. attachment:"",//附件地址
  711. customerStatus:this.state.customerStatusi,//跟进客户状态
  712. followSituation:this.state.followSituationi,//跟进进度
  713. contactInfo:(this.state.conts?this.state.conts:"电话")+"-"+(this.state.nub?this.state.nub:""),
  714. sign:thetechnicalPictureUrl
  715. }
  716. }).done(function (data) {
  717. this.setState({
  718. loading: false
  719. });
  720. if (!data.error.length) {
  721. message.success('保存成功!');
  722. this.setModal1Visiblecancel()
  723. } else {
  724. message.warning(data.error[0].message);
  725. }
  726. this.rescordlist(this.state.rowId);
  727. }.bind(this));
  728. }
  729. })
  730. },
  731. //当选择联系人的列表变化时,则执行
  732. hundleName(e){
  733. let changNub=this.state.telNum[e];
  734. let changEmail=this.state.email[e];
  735. let kid=this.state.contactIds[e];
  736. this.setState({
  737. kid:kid,
  738. contacts:'电话',
  739. nub:this.state.telNum[e],
  740. lastName: e,
  741. changNub:changNub,
  742. changEmail:changEmail,
  743. });
  744. },
  745. //所有资料修改保存提交,点击保存按钮进行更新
  746. handleSubmit(e) {
  747. e.preventDefault();
  748. this.state.data=[]
  749. let deletedIds;
  750. let adminName;
  751. let customerStatus;
  752. let companyIntention;
  753. let followSituation;
  754. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  755. let rowItem = this.state.selectedRows[idx];
  756. if (rowItem.id) {
  757. deletedIds=rowItem.id;
  758. adminName=rowItem.adminName;
  759. customerStatus=rowItem.customerStatus;
  760. companyIntention=rowItem.companyIntention;
  761. followSituation=rowItem.followSituation;
  762. };
  763. };
  764. this.props.form.validateFields((err, values) => {
  765. if (!err) {
  766. this.setState({
  767. loading: true
  768. });
  769. let custype=values._customerType;
  770. let customerTypechange="";
  771. switch(custype){
  772. case "个人客户":customerTypechange=0;break;
  773. case "公司客户":customerTypechange=1;break;
  774. case "团体单位":customerTypechange=2;break;
  775. }
  776. let companyIntentions= getCompanyIntentionOn(values.companyIntention);
  777. let followSituations= getfllowSituationOn(values.followSituation);
  778. let becompanyIntentions=getCompanyIntentionOn();
  779. let city=getcityArr(values.locationProvince);
  780. //let companyMore = [];
  781. const theDatak = this.state.datak || {};
  782. //意向服务多选
  783. // if (this.state.companyIntention.length) {
  784. // let companyList = [];
  785. // this.state.companyIntention.map(function (item) {
  786. // companyList.push(item);
  787. // });
  788. // companyMore = companyList.join(",");
  789. // };
  790. $.ajax({
  791. method: "POST",
  792. dataType: "json",
  793. crossDomain: false,
  794. url:globalConfig.context + '/api/admin/customer/updateCustomer',
  795. data: {
  796. id: this.state.cid,//编号id
  797. customerType:this.state.customerType,//客户信息 1
  798. companyName: this.state.companyName,//公司名称 1
  799. companyIndustry: this.state.companyIndustry,//公司行业
  800. tag: theDatak.tag,
  801. locationProvince:this.state.locationProvince ,//省份1
  802. adress: this.state.adress,//详细地址1
  803. remarks: values.remarks,//备注1
  804. companyIntention:this.state.companyIntention,//公司意向
  805. followSituation:this.state.followSituation,//最新跟进1
  806. customerStatus:this.state.customerStatus,//客户状态1
  807. beforeAdminName:this.state.adminName,
  808. }
  809. }).done(function (data) {
  810. this.setState({
  811. loading: false
  812. });
  813. if (!data.error.length) {
  814. message.success('修改成功!');
  815. this.setModal5Visiblecancel();
  816. } else {
  817. message.warning(data.error[0].message);
  818. }
  819. this.Detailload(this.state.rowId);
  820. this.loadData()
  821. }.bind(this));
  822. }
  823. })
  824. },
  825. submitcontactman(e){
  826. let deletedIds;
  827. this.state.data=[];
  828. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  829. let rowItem = this.state.selectedRows[idx];
  830. if (rowItem.id) {
  831. deletedIds=rowItem.id
  832. }
  833. };
  834. if(!deletedIds){
  835. deletedIds=this.state.cid
  836. }
  837. this.setState({
  838. selectedRowKeys: [],
  839. });
  840. e.preventDefault();
  841. this.props.form.validateFields((err, values) => {
  842. if (!err) {
  843. this.setState({
  844. loading: true
  845. });
  846. $.ajax({
  847. method: "POST",
  848. dataType: "json",
  849. crossDomain: false,
  850. url: globalConfig.context + '/api/admin/customer/addContacter',
  851. data: {
  852. cid: deletedIds,//编号id
  853. sex:this.state.hott,//性别
  854. primaryFlg:this.state.hotst,//是否是主要联系人
  855. name:this.state.paymentIdt,//联系人姓名
  856. mobile:this.state.paymt,//座机
  857. telNum:this.state.payt,//电话
  858. qq:this.state.entIdt,//qq
  859. wechat:this.state.payIdt,//微信
  860. customerPosition:this.state.paentIdt,//职位
  861. depatrment:this.state.paytIdtt,//部门
  862. email:this.state.emailst,//邮箱
  863. }
  864. }).done(function (data) {
  865. this.setState({
  866. loading: false
  867. });
  868. if (!data.error.length) {
  869. message.success('保存成功!');
  870. this.setModal2Visiblecancel()
  871. } else {
  872. message.warning(data.error[0].message);
  873. }
  874. this.Detailload(this.state.rowId);
  875. this.getNewWoman(this.state.rowId);
  876. this.contactList(this.state.rowId);
  877. //this.loadData();
  878. }.bind(this));
  879. }
  880. });
  881. },
  882. getTechnicalPictureUrl(e) {
  883. this.setState({ technicalPictureUrl: e });
  884. },
  885. //新建联系人modal框显示
  886. showModal(){
  887. this.setState({
  888. visible: true,
  889. });
  890. },
  891. //指定转交人的点击函数
  892. showModa(){
  893. this.setState({
  894. visible: true,
  895. });
  896. let changeIds;
  897. let adminName;
  898. let customerStatus;
  899. let companyIntention;
  900. let followSituation;
  901. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  902. let rowItem = this.state.selectedRows[idx];
  903. if (rowItem.id) {
  904. changeIds=rowItem.id;
  905. adminName=rowItem.adminName;
  906. customerStatus=rowItem.customerStatus;
  907. companyIntention=rowItem.companyIntention;
  908. followSituation=rowItem.followSituation;
  909. };
  910. };
  911. $.ajax({
  912. method: "post",
  913. dataType: "json",
  914. crossDomain: false,
  915. url: globalConfig.context + "/api/admin/customer/findAdmin",
  916. data: {
  917. id: changeIds,//这一行数据的ID
  918. beforeCompanyIntention:companyIntention,//意向服务
  919. beforeCustomerStatus:customerStatus,//客户状态
  920. beforeFollowSituation:followSituation,//最新跟进状态
  921. beforeAdminName:adminName,//跟进人
  922. }
  923. }).done(function (data) {
  924. if (data.error && data.error.length) {
  925. message.warning(data.error[0].message);
  926. } else {
  927. let theAssigne = [];
  928. if (!data.data) {
  929. if (data.error && data.error.length) {
  930. message.warning(data.error[0].message);
  931. };
  932. } else {
  933. for (let i = 0; i < data.data.length; i++) {
  934. let thisdata = data.data[i];
  935. //处理数据 进行循环
  936. theAssigne.push({
  937. key: thisdata.name,
  938. id: thisdata.id,
  939. ids: thisdata.cid,
  940. mobile:thisdata.mobile,
  941. adminName: thisdata.beforeAdminName,
  942. customerStatus: thisdata.beforeCustomerStatus,
  943. companyIntention: thisdata.beforeCompanyIntention,
  944. followSituation: thisdata.beforeFollowSituation,
  945. });
  946. };
  947. };
  948. this.setState({
  949. dataman: theAssigne,
  950. });
  951. }
  952. }.bind(this));
  953. },
  954. //选择了指定人之后的保存点击函数,需要修改函数
  955. changeAssigner() {
  956. this.setState({
  957. visible: false,
  958. });
  959. let changeId;
  960. let changeIds;
  961. let adminName;
  962. let beforeAdminName;
  963. let customerStatus;
  964. let companyIntention;
  965. let followSituation;
  966. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  967. let rowItem = this.state.selectedRows[idx];
  968. if (rowItem.id) {
  969. changeId=rowItem.id;
  970. beforeAdminName=rowItem.adminName;
  971. adminName=rowItem.key;
  972. customerStatus=rowItem.customerStatus;
  973. companyIntention=rowItem.companyIntention;
  974. followSituation=rowItem.followSituation;
  975. changeIds=rowItem.ids;
  976. };
  977. };
  978. $.ajax({
  979. method: "post",
  980. dataType: "json",
  981. crossDomain: false,
  982. url: globalConfig.context + "/api/admin/customer/transferCustomer",
  983. data: {
  984. id: changeIds,//这一行数据的ID
  985. aid:changeId,//指定转交人的ID
  986. beforeCompanyIntention:companyIntention,//意向服务
  987. beforeCustomerStatus:customerStatus,//客户状态
  988. beforeFollowSituation:followSituation,//最新跟进状态
  989. beforeAdminName:beforeAdminName,//之前的跟进人
  990. adminName:adminName,//转交的跟进人
  991. }
  992. }).done(function (data) {
  993. if (!data.error.length) {
  994. message.success('转交成功!');
  995. this.setState({
  996. loading: false,
  997. });
  998. } else {
  999. message.warning(data.error[0].message);
  1000. };
  1001. this.loadData();
  1002. }.bind(this));
  1003. },
  1004. handleOk(e){
  1005. this.setState({
  1006. visible: false,
  1007. });
  1008. },
  1009. handleCancel(e){
  1010. this.setState({
  1011. visible: false,
  1012. });
  1013. },
  1014. //点击公司名称,进行弹出框动作,同时进行资料详情查询
  1015. getInitialState() {
  1016. return {
  1017. technicalPictureUrl: [],
  1018. modal1Visible: false,
  1019. modal2Visible: false,
  1020. visible: false ,
  1021. searchMore: true,
  1022. searchType: 0,
  1023. validityPeriodDate: [],
  1024. releaseDate: [],
  1025. selectedRowKeys: [],
  1026. selectedRows: [],
  1027. loading: false,
  1028. pagination: {
  1029. defaultCurrent: 1,
  1030. defaultPageSize: 10,
  1031. showQuickJumper: true,
  1032. pageSize: 10,
  1033. onChange: function (page) {
  1034. this.loadData(page);
  1035. }.bind(this),
  1036. showTotal: function (total) {
  1037. return '共' + total + '条数据';
  1038. }
  1039. },
  1040. contactInformation:[
  1041. {
  1042. title: '姓名',
  1043. dataIndex: 'contactName',
  1044. key: 'contactName'
  1045. },{
  1046. title: '性别',
  1047. dataIndex: 'sex',
  1048. key: 'sex',
  1049. render: text => { return getsex(text); }
  1050. },
  1051. {
  1052. title: '手机号码',
  1053. dataIndex: 'telNum',
  1054. key: 'telNum'
  1055. },{
  1056. title: '座机号',
  1057. dataIndex: 'mobile',
  1058. key: 'mobile'
  1059. },{
  1060. title: 'QQ号码',
  1061. dataIndex: 'qq',
  1062. key: 'qq'
  1063. },{
  1064. title: '邮箱号',
  1065. dataIndex: 'email',
  1066. key: 'email'
  1067. },{
  1068. title: '微信',
  1069. dataIndex: 'wechat',
  1070. key: 'wechat'
  1071. },
  1072. ],
  1073. addFollow:[
  1074. {
  1075. title: '时间',
  1076. dataIndex: '_followDate',
  1077. key: '_followDate'
  1078. },{
  1079. title: '客户',
  1080. dataIndex: 'contactName',
  1081. key: 'contactName',
  1082. },
  1083. {
  1084. title: '跟进人',
  1085. dataIndex: 'adminName',
  1086. key: 'adminName'
  1087. },{
  1088. title: '联系方式',
  1089. dataIndex: 'contactInfo',
  1090. key: 'contactInfo'
  1091. },{
  1092. title: '客户状态',
  1093. dataIndex: '_customerStatus',
  1094. key: '_customerStatus'
  1095. },{
  1096. title: '跟进状态',
  1097. dataIndex: '_followSituation',
  1098. key: '_followSituation'
  1099. },{
  1100. title: '备注',
  1101. dataIndex: 'remarks',
  1102. key: 'remarks'
  1103. },
  1104. ],
  1105. achievement:[
  1106. {
  1107. title: '编号',
  1108. dataIndex: 'contactName',
  1109. key: 'contactName'
  1110. },{
  1111. title: '成果名称',
  1112. dataIndex: 'sex',
  1113. key: 'sex',
  1114. render: text => { return getsex(text); }
  1115. },
  1116. {
  1117. title: '关键字',
  1118. dataIndex: 'telNum',
  1119. key: 'telNum'
  1120. },{
  1121. title: '类型',
  1122. dataIndex: 'mobile',
  1123. key: 'mobile'
  1124. },{
  1125. title: '所有人名称',
  1126. dataIndex: 'qq',
  1127. key: 'qq'
  1128. },{
  1129. title: '审核状态',
  1130. dataIndex: 'email11',
  1131. key: 'email11'
  1132. },{
  1133. title: '是否精品',
  1134. dataIndex: 'wechat323',
  1135. key: 'wechat323'
  1136. },{
  1137. title: '首页展示',
  1138. dataIndex: 'email33',
  1139. key: 'email33'
  1140. },{
  1141. title: '发布时间',
  1142. dataIndex: 'wechat211',
  1143. key: 'wechat211'
  1144. },
  1145. ],
  1146. demand:[
  1147. {
  1148. title: '编号',
  1149. dataIndex: 'contactName',
  1150. key: 'contactName'
  1151. },{
  1152. title: '需求名称',
  1153. dataIndex: 'sex',
  1154. key: 'sex',
  1155. render: text => { return getsex(text); }
  1156. },
  1157. {
  1158. title: '是否精品',
  1159. dataIndex: 'telNum',
  1160. key: 'telNum'
  1161. },{
  1162. title: '首页展示',
  1163. dataIndex: 'mobile',
  1164. key: 'mobile'
  1165. },{
  1166. title: '关键字',
  1167. dataIndex: 'qq',
  1168. key: 'qq'
  1169. },{
  1170. title: '需求类型',
  1171. dataIndex: 'email44',
  1172. key: 'email44'
  1173. },{
  1174. title: '信息来源',
  1175. dataIndex: 'wechat',
  1176. key: 'wechat'
  1177. },{
  1178. title: '雇主名称',
  1179. dataIndex: 'email12',
  1180. key: 'email12'
  1181. },{
  1182. title: '审核状态',
  1183. dataIndex: 'wechat33',
  1184. key: 'wechat33'
  1185. },{
  1186. title: '需求状态',
  1187. dataIndex: 'email23',
  1188. key: 'email23'
  1189. },{
  1190. title: '有效期限',
  1191. dataIndex: 'wechat212',
  1192. key: 'wechat212'
  1193. },{
  1194. title: '发布时间',
  1195. dataIndex: 'wechat44',
  1196. key: 'wechat44'
  1197. },
  1198. ],
  1199. operationLog:[
  1200. {
  1201. title: '操作员姓名',
  1202. dataIndex: 'operatorName',
  1203. key: 'operatorName'
  1204. },{
  1205. title: '操作类型',
  1206. dataIndex: 'operatorType',
  1207. key: 'operatorType',
  1208. },
  1209. {
  1210. title: '操作时间',
  1211. dataIndex: 'operatorTime',
  1212. key: 'operatorTime'
  1213. },{
  1214. title: '修改前客户状态',
  1215. dataIndex: 'beforeCustomerStatus',
  1216. key: 'beforeCustomerStatus'
  1217. },{
  1218. title: '修改后客户状态',
  1219. dataIndex: 'afterCustomerStatus',
  1220. key: 'afterCustomerStatus'
  1221. },{
  1222. title: '修改前客户意向',
  1223. dataIndex: 'beforeCustomerIntention',
  1224. key: 'beforeCustomerIntention'
  1225. },{
  1226. title: '修改后客户意向',
  1227. dataIndex: 'afterCustomerIntention',
  1228. key: 'afterCustomerIntention'
  1229. },{
  1230. title: '修改前跟进进度',
  1231. dataIndex: 'beforeFollowSituation',
  1232. key: 'beforeFollowSituation'
  1233. },{
  1234. title: '修改后跟进进度',
  1235. dataIndex: 'afterFollowSituation',
  1236. key: 'afterFollowSituation'
  1237. },{
  1238. title: '修改前跟进人',
  1239. dataIndex: 'beforeAdminName',
  1240. key: 'beforeAdminName'
  1241. },{
  1242. title: '修改后跟进人',
  1243. dataIndex: 'afterAdminName',
  1244. key: 'afterAdminName'
  1245. },
  1246. ],
  1247. columnsman:[{
  1248. title: '姓名',
  1249. dataIndex: 'key',
  1250. key: 'key'
  1251. },{
  1252. title: '手机号码',
  1253. dataIndex: 'mobile',
  1254. key: 'mobile'
  1255. }
  1256. ],
  1257. columns: [
  1258. {
  1259. title: '公司名称',
  1260. dataIndex: 'companyName',
  1261. key: 'companyName',
  1262. }, {
  1263. title: '客户类型',
  1264. dataIndex: '_customerType',
  1265. key: '_customerType'
  1266. // render: text => { return getcustomerTyp(text); }
  1267. }, {
  1268. title: '地区',
  1269. dataIndex: 'locationProvince',
  1270. key: 'locationProvince',
  1271. render: text => { return getcityArr(text); }
  1272. }, {
  1273. title: '联系人姓名',
  1274. dataIndex: 'contactName',
  1275. key: 'contactName',
  1276. },
  1277. {
  1278. title: '手机号',
  1279. dataIndex: 'telNum',
  1280. key:'telNum',
  1281. },
  1282. {
  1283. title: '客户状态',
  1284. dataIndex: '_customerStatus',
  1285. key: '_customerStatus'
  1286. //render: text => { return getcustomerStatue(text) }
  1287. },
  1288. {
  1289. title: '意向服务',
  1290. dataIndex: '_companyIntention',
  1291. key: '_companyIntention',
  1292. },
  1293. {
  1294. title: '最新跟进',
  1295. dataIndex: '_followSituation',
  1296. key: '_followSituation',
  1297. },
  1298. {
  1299. title: '跟单人',
  1300. dataIndex: 'adminName',
  1301. key: 'adminName',
  1302. },
  1303. {
  1304. title: '时间',
  1305. dataIndex: 'followDate',
  1306. key: 'followDate',
  1307. }
  1308. ],
  1309. dataSource: [],
  1310. searchTime: [,]
  1311. };
  1312. },
  1313. componentWillMount() {
  1314. let theArr = [];
  1315. customerStatus.map(function (item) {
  1316. theArr.push(
  1317. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  1318. )
  1319. });
  1320. let auditArr = [];
  1321. cityArr.map(function (item) {
  1322. auditArr.push(
  1323. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  1324. )
  1325. });
  1326. let intentionalArr = [];
  1327. intentionalService.map(function (item) {
  1328. intentionalArr.push(
  1329. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  1330. )
  1331. });
  1332. let newArr = [];
  1333. newFollow.map(function (item) {
  1334. newArr.push(
  1335. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  1336. )
  1337. });
  1338. this.state.customerStatuarr = theArr;
  1339. this.state.auditStatusOption = auditArr;
  1340. this.state.intentionalOption = intentionalArr;
  1341. this.state.newOption = newArr;
  1342. this.loadData();
  1343. },
  1344. tableRowClick(record, index) {
  1345. this.state.RowData = record;
  1346. this.setModal5VisibleOk(record);
  1347. this.contactList(record.id);
  1348. this.rescordlist(record.id);
  1349. this.findCustomerHistory(record.id);
  1350. this.historyList(record.id);
  1351. this.setState({
  1352. rowId:record.id ,
  1353. before_customerStatus:record._customerStatus,
  1354. before_companyIntention:record._companyIntention,
  1355. before_followSituation:record._followSituation
  1356. })
  1357. },
  1358. //删除功能,已经完成
  1359. delectRow() {
  1360. let deletedIds;
  1361. let adminName;
  1362. let customerStatus;
  1363. let companyIntention;
  1364. let followSituation;
  1365. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  1366. let rowItem = this.state.selectedRows[idx];
  1367. if (rowItem.id) {
  1368. deletedIds=rowItem.id;
  1369. adminName=rowItem.adminName;
  1370. customerStatus=rowItem.customerStatus;
  1371. companyIntention=rowItem.companyIntention;
  1372. followSituation=rowItem.followSituation;
  1373. };
  1374. };
  1375. this.state.data = []
  1376. this.setState({
  1377. selectedRowKeys: [],
  1378. });
  1379. $.ajax({
  1380. method: "post",
  1381. dataType: "json",
  1382. crossDomain: false,
  1383. url: globalConfig.context + "/api/admin/customer/deleteCustomer",
  1384. data: {
  1385. id: deletedIds,//删除的ID
  1386. beforeCustomerStatus:customerStatus,
  1387. beforeCompanyIntention:companyIntention,
  1388. beforeFollowSituation:followSituation,
  1389. beforeAdminName:adminName
  1390. }
  1391. }).done(function (data) {
  1392. if (!data.error.length) {
  1393. message.success('删除成功!');
  1394. this.setState({
  1395. loading: false,
  1396. });
  1397. } else {
  1398. message.warning(data.error[0].message);
  1399. };
  1400. this.loadData();
  1401. }.bind(this));
  1402. },
  1403. //删除功能
  1404. delectRowFollow() {
  1405. let deletedIds;
  1406. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  1407. let rowItem = this.state.selectedRows[idx];
  1408. if (rowItem.id) {
  1409. deletedIds=rowItem.id;
  1410. };
  1411. };
  1412. this.state.data = []
  1413. this.setState({
  1414. selectedRowKeys: [],
  1415. });
  1416. $.ajax({
  1417. method: "post",
  1418. dataType: "json",
  1419. crossDomain: false,
  1420. url: globalConfig.context + "/api/admin/customer/deleteContacter",
  1421. data: {
  1422. contactId: deletedIds,//删除的ID
  1423. }
  1424. }).done(function (data) {
  1425. if (!data.error.length) {
  1426. message.success('删除成功!');
  1427. this.setState({
  1428. loading: false,
  1429. });
  1430. } else {
  1431. message.warning(data.error[0].message);
  1432. };
  1433. this.loadData();
  1434. }.bind(this));
  1435. },
  1436. //列表历史记录查询不带单选的
  1437. findCustomerHistory(cid){
  1438. $.ajax({
  1439. method: "get",
  1440. dataType: "json",
  1441. crossDomain: false,
  1442. url: globalConfig.context + "/api/admin/customer/findCustomerHistory",
  1443. data: {
  1444. customerId: cid,//这一行数据的ID
  1445. }
  1446. }).done(function (data) {
  1447. if (data.error && data.error.length) {
  1448. message.warning(data.error[0].message);
  1449. } else {
  1450. let theAssigne = [];
  1451. if (!data.data) {
  1452. if (data.error && data.error.length) {
  1453. message.warning(data.error[0].message);
  1454. };
  1455. }
  1456. this.setState({
  1457. dataRowhistory: data.data,
  1458. });
  1459. }
  1460. }.bind(this));
  1461. },
  1462. //历史记录列表查询
  1463. historyList(cid){
  1464. this.state.data = [];
  1465. this.setState({
  1466. loading: true
  1467. });
  1468. $.ajax({
  1469. method: "get",
  1470. dataType: "json",
  1471. crossDomain: false,
  1472. url:globalConfig.context + '/api/admin/customer/listCustomerLog',
  1473. data: {
  1474. customerId:cid
  1475. },
  1476. success: function (data) {
  1477. let theArr = [];
  1478. if (!data.data) {
  1479. if (data.error && data.error.length) {
  1480. message.warning(data.error[0].message);
  1481. };
  1482. } else {
  1483. for (let i = 0; i < data.data.length; i++) {
  1484. let thisdata = data.data[i];
  1485. // let intentionText=thisdata.beforeCustomerIntention.split(",");
  1486. // let intentionstring=intentionText.slice("0","2").join('-')
  1487. //console.log(intentionstring)
  1488. // let afterIntentionText=thisdata.afterCustomerIntention.split(",");
  1489. // let afterIntentionstring=afterIntentionText.slice("0","2").join('-')
  1490. theArr.push({
  1491. key:i,
  1492. operatorName:thisdata.operatorName,//操作员姓名
  1493. operatorType:thisdata.operatorType,//操作类型
  1494. operatorTime:thisdata.operatorTime, //操作时间
  1495. beforeCustomerStatus:thisdata.beforeCustomerStatus, //修改前客户状态
  1496. afterCustomerStatus:thisdata.afterCustomerStatus,//修改后客户状态
  1497. beforeCustomerIntention:thisdata.beforeCustomerIntention,//修改前客户意向
  1498. afterCustomerIntention:thisdata.afterCustomerIntention,//修改后客户意向
  1499. beforeFollowSituation:thisdata.beforeFollowSituation,//修改前跟进进度
  1500. afterFollowSituation:thisdata.afterFollowSituation,//修改后跟进进度
  1501. beforeAdminName:thisdata.beforeAdminName,//修改前跟进人
  1502. afterAdminName:thisdata.afterAdminName,//修改后跟进人
  1503. });
  1504. };
  1505. };
  1506. this.setState({//导出数据
  1507. Logrecord: theArr,
  1508. });
  1509. }.bind(this),
  1510. }).always(function () {
  1511. this.setState({
  1512. loading: false
  1513. });
  1514. }.bind(this));
  1515. },
  1516. //转为公共客户功能
  1517. callback(e){
  1518. if(e==1){
  1519. this.Detailload(this.state.rowId)
  1520. this.getNewWoman(this.state.rowId);
  1521. }
  1522. if(e==2){
  1523. this.rescordlist(this.state.rowId)
  1524. }
  1525. if(e==3){
  1526. this.Detailload(this.state.rowId)
  1527. }
  1528. if(e==4){
  1529. this.findCustomerHistory(this.state.rowId)
  1530. this.historyList(this.state.rowId)
  1531. }
  1532. },
  1533. changeRow() {
  1534. let deletedIds;
  1535. let customerStatus;
  1536. let companyIntention;
  1537. let followSituation;
  1538. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  1539. let rowItem = this.state.selectedRows[idx];
  1540. if (rowItem.id) {
  1541. deletedIds=rowItem.id;
  1542. customerStatus=rowItem.customerStatus;
  1543. companyIntention=rowItem.companyIntention;
  1544. followSituation=rowItem.followSituation;
  1545. };
  1546. };
  1547. this.setState({
  1548. selectedRowKeys: [],
  1549. });
  1550. $.ajax({
  1551. method: "post",
  1552. dataType: "json",
  1553. crossDomain: false,
  1554. url: globalConfig.context + "/api/admin/customer/transferToPublic",
  1555. data: {
  1556. aid:this.state.aid,
  1557. id: deletedIds,
  1558. beforeCompanyIntention:companyIntention,//意向服务
  1559. beforeCustomerStatus:customerStatus,//客户状态
  1560. beforeFollowSituation:followSituation,//最新跟进状态
  1561. }
  1562. }).done(function (data) {
  1563. if (!data.error.length) {
  1564. message.success('已转为公共客户!');
  1565. this.setState({
  1566. loading: false,
  1567. });
  1568. } else {
  1569. message.warning(data.error[0].message);
  1570. };
  1571. this.loadData();
  1572. }.bind(this));
  1573. },
  1574. addClick() {
  1575. this.state.RowData = {};
  1576. this.setState({
  1577. showDesc: true
  1578. });
  1579. },
  1580. closeDesc(e, s) {
  1581. this.state.showDesc = e;
  1582. if (s) {
  1583. this.loadData();
  1584. };
  1585. },
  1586. search() {
  1587. this.loadData();
  1588. },
  1589. reset() {
  1590. this.state.companyNamet='';
  1591. this.state.customerTypet = undefined;
  1592. this.state.id = undefined;
  1593. this.state.shareTypet = undefined;
  1594. this.state.companyIntentiont = undefined;
  1595. this.state.followSituationt = undefined;
  1596. this.state.locationProvincet = undefined;
  1597. this.state.customerStatust = undefined;
  1598. this.state.contactNamet = undefined;
  1599. this.state.contactTelt = undefined;
  1600. this.state.contactNamet = undefined;
  1601. this.state.releaseDatet = [];
  1602. this.loadData();
  1603. },
  1604. searchSwitch() {
  1605. this.setState({
  1606. searchMore: !this.state.searchMore
  1607. });
  1608. },
  1609. //快速新增联系人
  1610. addContant(){
  1611. this.setModal2VisibleOk()
  1612. this.state.hotst=undefined;
  1613. this.state.hott=undefined;
  1614. this.state.paymentIdt='';
  1615. this.state.entIdt='';
  1616. this.state.payt='';
  1617. this.state.paymt='';
  1618. this.state.paytIdtt='';
  1619. this.state.paentIdt='';
  1620. this.state.payIdt='';
  1621. this.state.emailst='';
  1622. },
  1623. //添加跟进记录没单选的情况下
  1624. addcord(){
  1625. var addcord=this.state.rowId
  1626. this.setState({modal1Visible:true});
  1627. this.setState({
  1628. remarks:''
  1629. });
  1630. this.Detailload(addcord);
  1631. this.getNewWoman(addcord)
  1632. },
  1633. render() {
  1634. const FormItem = Form.Item
  1635. const rowSelection = {
  1636. selectedRowKeys: this.state.selectedRowKeys,
  1637. onChange: (selectedRowKeys, selectedRows) => {
  1638. this.setState({
  1639. selectedRows: selectedRows.slice(-1),
  1640. selectedRowKeys: selectedRowKeys.slice(-1)
  1641. });
  1642. }
  1643. };
  1644. const hasSelected = this.state.selectedRowKeys.length > 0;
  1645. const { RangePicker } = DatePicker;
  1646. const theData = this.props.data || {};
  1647. const { getFieldDecorator } = this.props.form;
  1648. const formItemLayout = {
  1649. labelCol: { span: 8 },
  1650. wrapperCol: { span: 14 },
  1651. };
  1652. const theDatak = this.state.datak || {};
  1653. const theDatat = this.state.data || {};
  1654. const theDatahistory=this.state.dataRowhistory || {};
  1655. const contactsOption="";
  1656. const formItemLayput = {
  1657. labelCol: { span: 10 },
  1658. wrapperCol: { span: 14 },
  1659. };
  1660. return (
  1661. <div className="user-content" >
  1662. <div className="content-title">
  1663. <span>客户管理</span>
  1664. <div className="patent-addNew clearfix" style={{marginRight:"22px"}}>
  1665. <Button type="primary" className="addButton" onClick={this.addClick}>新建客户<Icon type="plus" /></Button>
  1666. </div>
  1667. </div>
  1668. <div className="user-search">
  1669. <Input placeholder="公司名称"
  1670. value={this.state.companyNamet}
  1671. onChange={(e) => { this.setState({ companyNamet: e.target.value }); }} />
  1672. <Select placeholder="客户类型" style={{ width: 120 }}
  1673. value={this.state.customerTypet }
  1674. onChange={(e) => { this.setState({ customerTypet : e }) }}>
  1675. <Select.Option value="0" >个人客户</Select.Option>
  1676. <Select.Option value="1" >公司客户</Select.Option>
  1677. <Select.Option value="2" >团体单位</Select.Option>
  1678. </Select>
  1679. <Select placeholder="意向服务"
  1680. style={{ width: 160 }}
  1681. value={this.state.companyIntentiont}
  1682. onChange={(e) => { this.setState({ companyIntentiont: e }) }}>
  1683. {this.state.intentionalOption}
  1684. </Select>
  1685. <Select placeholder="跟进进度"
  1686. style={{ width: 160 }}
  1687. value={this.state.followSituationt}
  1688. onChange={(e) => { this.setState({ followSituationt: e }) }}>
  1689. {this.state.newOption}
  1690. </Select>
  1691. <Select placeholder="地区"
  1692. style={{ width: 160 }}
  1693. value={this.state.locationProvincet}
  1694. onChange={(e) => { this.setState({ locationProvincet: e }) }}>
  1695. {this.state.auditStatusOption}
  1696. </Select>
  1697. <Select placeholder="客户状态" style={{ width: 120 }}
  1698. value={this.state.customerStatust}
  1699. onChange={(e) => { this.setState({customerStatust: e }) }}>
  1700. {this.state.customerStatuarr}
  1701. </Select>
  1702. <Button type="primary" onClick={this.search}>搜索</Button>
  1703. <Button onClick={this.reset}>重置</Button>
  1704. <Button onClick={this.setModal3VisibleOk} style={{marginRight:'10px'}} disabled={!hasSelected}>查看跟进记录</Button>
  1705. <Button type="primary" onClick={this.setModal1VisibleOk} disabled={!hasSelected}>添加跟进记录</Button>
  1706. <Button type="primary" onClick={this.showModa} disabled={!hasSelected}>指定转交人</Button>
  1707. <Modal
  1708. footer=''
  1709. title="选择指定人"
  1710. visible={this.state.visible}
  1711. onOk={this.handleOk}
  1712. onCancel={this.handleCancel}
  1713. >
  1714. <Spin spinning={this.state.loading}>
  1715. <Table
  1716. columns={this.state.columnsman}
  1717. rowSelection={rowSelection}
  1718. dataSource={this.state.dataman}
  1719. />
  1720. <FormItem wrapperCol={{ span: 12, offset: 12 }}>
  1721. <Button className="set-submit" type="primary" htmlType="submit" id="change_keep" style={{marginLeft:"50px"}} onClick={this.changeAssigner }>保存</Button>
  1722. <Button className="set-submit" type="ghost" onClick={this.handleCancel } style={{marginLeft:"30px"}} id='change_rem'>取消</Button>
  1723. </FormItem>
  1724. </Spin>
  1725. </Modal>
  1726. <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
  1727. disabled={!hasSelected}
  1728. onClick={this.changeRow}>转为公共客户<Icon /></Button>
  1729. <Button style={{ background: "#ea0862", border: "none", color: "#fff" }}
  1730. disabled={!hasSelected}
  1731. onClick={this.delectRow}>删除<Icon type="minus" /></Button>
  1732. <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
  1733. <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
  1734. <Input placeholder="联系人姓名" style={{width:'140px',marginRight:'10px'}}
  1735. value={this.state.contactNamet}
  1736. onChange={(e) => { this.setState({ contactNamet: e.target.value }); }} />
  1737. <Input placeholder="手机号码" style={{width:'140px',marginRight:'10px'}}
  1738. value={this.state.contactTelt }
  1739. onChange={(e) => { this.setState({ contactTelt: e.target.value }); }} />
  1740. </div>
  1741. </div>
  1742. <div className="patent-table">
  1743. <Spin spinning={this.state.loading}>
  1744. <Table columns={this.state.columns}
  1745. dataSource={this.state.dataSource}
  1746. rowSelection={rowSelection}
  1747. pagination={this.state.pagination}
  1748. onRowClick={this.tableRowClick}
  1749. />
  1750. </Spin>
  1751. </div>
  1752. <Modal
  1753. style={{left:'500px'}}
  1754. footer=''
  1755. title="客户详细信息"
  1756. width='400px'
  1757. visible={this.state.modal4Visible}
  1758. onOk={this.setModal4Visiblecancel}
  1759. onCancel={this.setModal4Visiblecancel}
  1760. >
  1761. <Form horizontal onSubmit={this.submitcontact} id="demand-form">
  1762. <Spin spinning={this.state.loading}>
  1763. <div className='clearfix'>
  1764. <FormItem className="half-item"
  1765. {...formItemLayput}
  1766. label="所属公司" >
  1767. <span>{this.state.companyName}</span>
  1768. </FormItem>
  1769. <FormItem className="half-item"
  1770. {...formItemLayput}
  1771. label="性别" >
  1772. <span>{getsex(this.state.sex)}</span>
  1773. </FormItem>
  1774. <FormItem className="half-item"
  1775. {...formItemLayput}
  1776. label="姓名" >
  1777. <span>{this.state.name}</span>
  1778. </FormItem>
  1779. <FormItem className="half-item"
  1780. {...formItemLayput}
  1781. label="QQ号" >
  1782. <span>{this.state.qq}</span>
  1783. </FormItem>
  1784. <FormItem className="half-item"
  1785. {...formItemLayput}
  1786. label="手机号" >
  1787. <span>{this.state.telNum}</span>
  1788. </FormItem>
  1789. <FormItem className="half-item"
  1790. {...formItemLayput}
  1791. label="部门" >
  1792. <span>{this.state.depatrment}</span>
  1793. </FormItem>
  1794. <FormItem className="half-item"
  1795. {...formItemLayput}
  1796. label="职位" >
  1797. <span>{this.state.customerPosition}</span>
  1798. </FormItem>
  1799. <FormItem className="half-item"
  1800. {...formItemLayput}
  1801. label="微信号" >
  1802. <span>{this.state.wechat}</span>
  1803. </FormItem>
  1804. </div>
  1805. </Spin>
  1806. </Form>
  1807. </Modal>
  1808. <Modal
  1809. footer=''
  1810. title="历史记录列表"
  1811. width='800px'
  1812. visible={this.state.modal3Visible}
  1813. onOk={this.setModal3Visiblecancel}
  1814. onCancel={this.setModal3Visiblecancel}
  1815. >
  1816. <Spin spinning={this.state.loading}>
  1817. <Table dataSource={this.state.datahistory} >
  1818. <Column
  1819. title="时间"
  1820. dataIndex="_followDate"
  1821. key="_followDate"
  1822. />
  1823. <Column
  1824. title="客户"
  1825. dataIndex="contactName"
  1826. key="contactName"
  1827. render={(text, record,index) => (
  1828. <a href="#" onClick={() => this.setModal4Visible(true,index)}>{text}</a>
  1829. )}
  1830. />
  1831. <Column
  1832. title="跟进人"
  1833. dataIndex="adminName"
  1834. key="adminName"
  1835. />
  1836. <Column
  1837. title="联系方式"
  1838. dataIndex="contactInfo"
  1839. key="contactInfo"
  1840. />
  1841. <Column
  1842. title="最新跟进状态"
  1843. dataIndex="_followSituation"
  1844. key="_followSituation"
  1845. />
  1846. <Column
  1847. title="跟进结果"
  1848. dataIndex="followResult"
  1849. key="followResult"
  1850. render={(text, record) => (
  1851. <div>
  1852. <a href="#" onClick={this.setModal6VisibleOk}>{text}</a>
  1853. </div>
  1854. )}
  1855. />
  1856. <Column
  1857. title="删除记录"
  1858. key="del"
  1859. render={(text, record, index) => (
  1860. <Popconfirm title="是否删除?" onConfirm={() => this.onDelete(index)}>
  1861. <a href="#" style={{color:"#f00"}}>删除</a>
  1862. </Popconfirm>
  1863. )}
  1864. />
  1865. </Table>
  1866. </Spin>
  1867. </Modal>
  1868. <Modal
  1869. className="followrecord"
  1870. style={{zIndex:'120'}}
  1871. footer=''
  1872. title="新增跟进记录"
  1873. width='1000px'
  1874. visible={this.state.modal1Visible}
  1875. onOk={this.setModal1Visiblecancel}
  1876. onCancel={this.setModal1Visiblecancel}
  1877. >
  1878. <Form horizontal onSubmit={this.handleSubmit} id="demand-form">
  1879. <Spin spinning={this.state.loading}>
  1880. <div className="user-search">
  1881. <div className="clearfix">
  1882. <FormItem className="half-item"
  1883. {...formItemLayout}
  1884. label="客户公司名称:" >
  1885. <span>{theDatak.companyName}</span>
  1886. </FormItem>
  1887. </div>
  1888. <FormItem className="half-item"
  1889. {...formItemLayout}
  1890. label="最新联系人:" >
  1891. <Select placeholder="选择联系人" style={{ width: 140 }}
  1892. value={this.state.lastName}
  1893. onChange={this.hundleName}>
  1894. {this.state.orderStatusOption}
  1895. </Select>
  1896. <span style={{width:'120px',display:'inline-block',marginLeft:'20px'}}>{getcustomerTyp(theDatat.customerTyp)}
  1897. <Button type="primary" onClick={this.setModal2VisibleOk}>添加</Button>
  1898. </span>
  1899. </FormItem>
  1900. <FormItem className="half-item"
  1901. {...formItemLayout}
  1902. label="联系方式" >
  1903. <Select placeholder="选择方式" style={{width:'100px'}} value={this.state.contacts}
  1904. onChange={this.contacts}>
  1905. <Select.Option value="0">电话</Select.Option>
  1906. <Select.Option value="1">邮件</Select.Option>
  1907. <Select.Option value="2">面谈</Select.Option>
  1908. <Select.Option value="3">短信</Select.Option>
  1909. </Select>
  1910. <span style={{marginLeft:'20px'}}>{this.state.nub}</span>
  1911. </FormItem>
  1912. <FormItem className="half-item"
  1913. {...formItemLayout}
  1914. label="最近跟进时间:" >
  1915. <span>{theDatak.createTime}</span>
  1916. </FormItem>
  1917. <div>
  1918. <FormItem className="half-item"
  1919. {...formItemLayout}
  1920. label="最新跟进时间" >
  1921. <DatePicker placeholder="更新日期" value={moment(this.state.createYear,'YYYY-MM-DD')} onChange={(time) => {this.setState({createYear: time});}}/>
  1922. <TimePicker placeholder="更新时间" value={moment(this.state.creatMent, 'HH:mm:ss')} onChange={(time) => { this.setState({creatMent: time}); }}/>
  1923. </FormItem>
  1924. </div>
  1925. <FormItem className="half-item"
  1926. {...formItemLayout}
  1927. label="客户状态:" >
  1928. <span>{this.state._customerStatus}</span>
  1929. </FormItem>
  1930. <FormItem className="half-item"
  1931. {...formItemLayout}
  1932. label="最新客户状态" >
  1933. <Select placeholder="选择客户状态" style={{width:'200px'}} value={this.state.customerStatusi} onChange={(e) => { this.setState({customerStatusi: e}); }}>
  1934. {
  1935. customerStatus.map(function (item) {
  1936. return <Select.Option key={item.value} style={{width:'200px'}}>{item.key}</Select.Option>
  1937. })
  1938. }
  1939. </Select>
  1940. </FormItem>
  1941. <FormItem className="half-item"
  1942. {...formItemLayout}
  1943. label="跟进状态:" >
  1944. <span>{this.state._followSituation}</span>
  1945. </FormItem>
  1946. <FormItem className="half-item"
  1947. {...formItemLayout}
  1948. label="最新跟进状态" >
  1949. <Select placeholder="选择跟进状态" style={{width:'200px'}} value={this.state.followSituationi} onChange={(e) => { this.setState({followSituationi: e}); }}>
  1950. {
  1951. newFollow.map(function (item) {
  1952. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1953. })
  1954. }
  1955. </Select>
  1956. </FormItem>
  1957. <div className="clearfix">
  1958. <FormItem
  1959. labelCol={{ span: 4 }}
  1960. wrapperCol={{ span: 18 }}
  1961. label="跟进结果" >
  1962. {getFieldDecorator('remarks', {
  1963. initialValue: this.state.remarks
  1964. })(
  1965. <Input type="textarea" rows={4} />
  1966. )}
  1967. </FormItem>
  1968. </div>
  1969. <div className="clearfix">
  1970. <FormItem
  1971. labelCol={{ span: 4 }}
  1972. wrapperCol={{ span: 18 }}
  1973. label="技术图片" >
  1974. <PicturesWall
  1975. pictureSign="customer_sys_file"
  1976. fileList={this.getTechnicalPictureUrl}
  1977. pictureUrl={this.state.technicalPictureUrl} />
  1978. <p>图片建议:图片要清晰。</p>
  1979. </FormItem>
  1980. </div>
  1981. <Button style={{ marginRight: '20px' ,marginLeft:'160px',marginBottom:'50px'}} type="primary" onClick={this.addFollowSubmit}>保存</Button>
  1982. <Button className="set-submit" type="ghost" onClick={this.setModal1Visiblecancel} id='change_rem'>取消</Button>
  1983. </div>
  1984. </Spin>
  1985. </Form >
  1986. </Modal>
  1987. <Modal
  1988. className="customeDetails"
  1989. style={{zIndex:'100'}}
  1990. footer=''
  1991. title="客户详情"
  1992. width='1200px'
  1993. visible={this.state.modal5Visible}
  1994. onOk={this.setModal5Visiblecancel}
  1995. onCancel={this.setModal5Visiblecancel}
  1996. >
  1997. <Tabs defaultActiveKey="1" onChange={this.callback}>
  1998. <TabPane tab="基本资料" key="1">
  1999. <Form horizontal onSubmit={this.handleSubmit} id="demand-form">
  2000. <Spin spinning={this.state.loading}>
  2001. <div className="clearfix">
  2002. <p style={{marginLeft:'50px',marginBottom:'20px',marginTop:'10px',fontSize:'18px'}}>公司资料</p>
  2003. </div>
  2004. <div className="clearfix">
  2005. <FormItem className="half-item"
  2006. {...formItemLayout}
  2007. label="公司名称" >
  2008. <Input type="text" value={this.state.companyName} onChange={(e) => { this.setState({companyName: e.target.value }); }}/>
  2009. </FormItem>
  2010. <FormItem className="half-item"
  2011. {...formItemLayout}
  2012. label="地区" >
  2013. <Select placeholder="选择地区" style={{ width: 160 }} value={this.state.locationProvince} onChange={(e) => { this.setState({locationProvince: e }); }}>
  2014. {
  2015. cityArr.map(function (item) {
  2016. return <Select.Option key={item.value} >{item.key}</Select.Option>
  2017. })
  2018. }
  2019. </Select>
  2020. </FormItem>
  2021. </div>
  2022. <FormItem className="half-item"
  2023. {...formItemLayout}
  2024. label="公司行业" >
  2025. <Input type="text" value={this.state.companyIndustry} onChange={(e) => { this.setState({companyIndustry: e.target.value }); }}/>
  2026. </FormItem>
  2027. <FormItem className="half-item"
  2028. {...formItemLayout}
  2029. label="详细地址" >
  2030. <Input type="text" value={this.state.adress} onChange={(e) => { this.setState({adress: e.target.value }); }}/>
  2031. </FormItem>
  2032. <FormItem className="half-item"
  2033. {...formItemLayout}
  2034. label="客户状态" >
  2035. <Select placeholder="选择客户状态" style={{ width: 120 }}
  2036. value={getcustomerStatue(this.state.customerStatus)}
  2037. onChange={(e) => { this.setState({customerStatus: e }) }}>
  2038. {this.state.customerStatuarr}
  2039. </Select>
  2040. </FormItem>
  2041. <FormItem className="half-item" style={{marginLeft:'96px'}}
  2042. labelCol={{ span: 4 }}
  2043. wrapperCol={{ span: 18 }}
  2044. label="意向服务" >
  2045. <Select placeholder="选择意向服务" style={{width:'200px'}} value={this.state.companyIntention} onChange={(e) => { this.setState({companyIntention: e}); }}>
  2046. {
  2047. intentionalService.map(function (item) {
  2048. return <Select.Option key={item.value} >{item.key}</Select.Option>
  2049. })
  2050. }
  2051. </Select>
  2052. </FormItem>
  2053. <FormItem className="half-item"
  2054. {...formItemLayout}
  2055. label="客户来源" >
  2056. <span>{this.state.laiyuan}</span>
  2057. </FormItem>
  2058. <FormItem className="half-item"
  2059. {...formItemLayout}
  2060. label="标签" >
  2061. <span>{theDatak.tag}</span>
  2062. </FormItem>
  2063. <FormItem className="half-item"
  2064. {...formItemLayout}
  2065. label="最新跟进" >
  2066. <span>{this.state._followSituation}</span>
  2067. </FormItem>
  2068. <div className="clearfix">
  2069. <FormItem
  2070. labelCol={{ span: 4 }}
  2071. wrapperCol={{ span: 18 }}
  2072. label="备注" >
  2073. <span>{theDatak.remarks}</span>
  2074. </FormItem>
  2075. </div>
  2076. <FormItem wrapperCol={{ span: 12, offset: 4 }} style={{marginTop:'25px'}}>
  2077. <Button className="set-submit" type="primary" htmlType="submit" style={{marginRight:"40px"}}>保存</Button>
  2078. <Button className="set-submit" type="ghost" onClick={this.setModal5Visiblecancel}>取消</Button>
  2079. </FormItem>
  2080. <div className="clearfix">
  2081. <p style={{marginLeft:'50px',marginBottom:'20px',marginTop:'10px',fontSize:'18px'}}>联系人<Button type="primary" onClick={this.addContant} style={{marginLeft:'20px'}}>快速新增联系人</Button></p>
  2082. </div>
  2083. <div className="clearfix" style={{marginBottom:'100px'}}>
  2084. <Table style={{width:'1100px',marginLeft:'50px',background:'none'}} className="tabcolor"
  2085. columns={this.state.contactInformation}
  2086. dataSource={this.state.information}
  2087. onRowClick={this.informationRowClick}
  2088. />
  2089. </div>
  2090. </Spin>
  2091. </Form>
  2092. </TabPane>
  2093. <TabPane tab="跟进记录" key="2">
  2094. <Button type="primary" onClick={this.addcord} style={{marginLeft:"75px"}}>添加跟进记录</Button>
  2095. <div className="clearfix" style={{marginBottom:'100px'}}>
  2096. <Table style={{width:'1100px',marginLeft:'50px',background:'none'}} className="tabcolor"
  2097. columns={this.state.addFollow}
  2098. dataSource={this.state.datahistory}
  2099. />
  2100. </div>
  2101. </TabPane>
  2102. <TabPane tab="业务操作" key="3">
  2103. <div style={{marginLeft:"50px",fontSize:'18px'}}>科技成果</div>
  2104. <div className="clearfix">
  2105. <Table style={{width:'1100px',marginLeft:'50px',background:'none'}} className="tabcolor"
  2106. columns={this.state.achievement}
  2107. dataSource={this.state.achievementrecord}
  2108. />
  2109. </div>
  2110. <div style={{marginLeft:"50px",marginTop:'20px',fontSize:'18px'}}>科技需求</div>
  2111. <div className="clearfix" style={{marginBottom:'100px'}}>
  2112. <Table style={{width:'1100px',marginLeft:'50px',background:'none'}} className="tabcolor"
  2113. columns={this.state.demand}
  2114. dataSource={this.state.demandrecord}
  2115. />
  2116. </div>
  2117. </TabPane>
  2118. <TabPane tab="历史记录" key="4">
  2119. <Form horizontal id="demand-form">
  2120. <Spin spinning={this.state.loading}>
  2121. <div className="clearfix">
  2122. <FormItem className="half-item"
  2123. {...formItemLayout}
  2124. label="注册账号" >
  2125. <span>{theDatahistory.customerName}</span>
  2126. </FormItem>
  2127. </div>
  2128. <FormItem className="half-item"
  2129. {...formItemLayout}
  2130. label="录入时间" >
  2131. <span>{theDatahistory.createTime}</span>
  2132. </FormItem>
  2133. <FormItem className="half-item"
  2134. {...formItemLayout}
  2135. label="跟单人" >
  2136. <span>{theDatahistory.adminName}</span>
  2137. </FormItem>
  2138. <FormItem className="half-item"
  2139. {...formItemLayout}
  2140. label="跟进次数" >
  2141. <span>{theDatahistory.followCount}</span>
  2142. </FormItem>
  2143. <FormItem className="half-item"
  2144. {...formItemLayout}
  2145. label="当前客户状态持续时间" >
  2146. <span>{theDatahistory.diffDate}</span>
  2147. </FormItem>
  2148. <FormItem className="half-item"
  2149. {...formItemLayout}
  2150. label="最后跟进联系人" >
  2151. <span>{theDatahistory.contactName}</span>
  2152. </FormItem>
  2153. <FormItem className="half-item"
  2154. {...formItemLayout}
  2155. label="最后跟进时间" >
  2156. <span>{theDatahistory.followDate}</span>
  2157. </FormItem>
  2158. <FormItem className="half-item"
  2159. {...formItemLayout}
  2160. label="最后客户状态" >
  2161. <span>{getcustomerStatue(theDatahistory.customerStatus)}</span>
  2162. </FormItem>
  2163. <FormItem className="half-item"
  2164. {...formItemLayout}
  2165. label="最后跟进状态" >
  2166. <span>{getfllowSituation(theDatahistory.followSituation)}</span>
  2167. </FormItem>
  2168. <FormItem className="half-item"
  2169. {...formItemLayout}
  2170. label="操作日志" >
  2171. <span>查看列表<Switch defaultChecked={false} onChange={this.searchSwitch} style={{marginLeft:'10px'}}/></span>
  2172. </FormItem>
  2173. <FormItem className="half-item" style={{marginBottom:'50px'}}
  2174. {...formItemLayout}
  2175. label="最后修改时间" >
  2176. <span>{theDatahistory.operatorTime}</span>
  2177. </FormItem>
  2178. <div className="search-more clearfix" style={this.state.searchMore ? { display: 'none' } : {}}>
  2179. <Table style={{background:'none',textAlign:'center'}} className="tabcolor"
  2180. columns={this.state.operationLog}
  2181. dataSource={this.state.Logrecord}
  2182. bordered
  2183. />
  2184. </div>
  2185. </Spin>
  2186. </Form>
  2187. </TabPane>
  2188. </Tabs>
  2189. </Modal>
  2190. <Modal
  2191. className="newContacts"
  2192. style={{zIndex:'300'}}
  2193. footer=''
  2194. width='800px'
  2195. title="新增联系人"
  2196. visible={this.state.modal2Visible}
  2197. onOk={this.setModal2Visiblecancel}
  2198. onCancel={this.setModal2Visiblecancel}
  2199. >
  2200. <Form horizontal onSubmit={this.submitcontactman} id="demand-form">
  2201. <Spin spinning={this.state.loading}>
  2202. <Row>
  2203. <FormItem
  2204. labelCol={{ span: 4 }}
  2205. wrapperCol={{ span: 14 }}
  2206. label="是否是主要联系人:" style={{marginRight:'10px'}}>
  2207. <Radio.Group value={this.state.hotst} onChange={(e) => {
  2208. this.setState({ hotst: e.target.value })
  2209. }}>
  2210. <Radio value={0}>是</Radio>
  2211. <Radio value={1}>否</Radio>
  2212. </Radio.Group>
  2213. </FormItem>
  2214. <FormItem
  2215. labelCol={{ span: 4 }}
  2216. wrapperCol={{ span: 14 }}
  2217. label="性别:" style={{marginRight:'10px',marginTop: '-15px'}}>
  2218. <Radio.Group value={this.state.hott} onChange={(e) => {
  2219. this.setState({ hott: e.target.value })
  2220. }}>
  2221. <Radio value={0}>男</Radio>
  2222. <Radio value={1}>女</Radio>
  2223. </Radio.Group>
  2224. </FormItem>
  2225. </Row>
  2226. <Row style={{ paddingLeft:'50px' }}>
  2227. <Col span={2}>姓名:</Col>
  2228. <Col span={8}>
  2229. <Input value={this.state.paymentIdt}
  2230. onChange={(e) => { this.setState({ paymentIdt: e.target.value }) }} />
  2231. </Col>
  2232. <Col span={2} style={{ marginLeft: '50px' }}>QQ号:</Col>
  2233. <Col span={8}>
  2234. <Input value={this.state.entIdt}
  2235. onChange={(e) => { this.setState({ entIdt: e.target.value }) }} />
  2236. </Col>
  2237. </Row>
  2238. <Row style={{ marginTop: '20px',paddingLeft:'50px' }}>
  2239. <Col span={2}>手机号:</Col>
  2240. <Col span={8}>
  2241. <Input value={this.state.payt}
  2242. onChange={(e) => { this.setState({ payt: e.target.value }) }} />
  2243. </Col>
  2244. <Col span={2} style={{ marginLeft: '50px' }}>座机号:</Col>
  2245. <Col span={8}>
  2246. <Input value={this.state.paymt}
  2247. onChange={(e) => { this.setState({ paymt: e.target.value }) }} />
  2248. </Col>
  2249. </Row>
  2250. <Row style={{ marginTop: '20px' ,paddingLeft:'50px'}}>
  2251. <Col span={2}>部门:</Col>
  2252. <Col span={8}>
  2253. <Input value={this.state.paytIdtt}
  2254. onChange={(e) => { this.setState({ paytIdtt: e.target.value }) }} />
  2255. </Col>
  2256. <Col span={2} style={{ marginLeft: '50px' }}>职位:</Col>
  2257. <Col span={8}>
  2258. <Input value={this.state.paentIdt}
  2259. onChange={(e) => { this.setState({ paentIdt: e.target.value }) }} />
  2260. </Col>
  2261. </Row>
  2262. <Row style={{ marginTop: '20px',paddingLeft:'50px' }}>
  2263. <Col span={2}>微信号:</Col>
  2264. <Col span={8}>
  2265. <Input value={this.state.payIdt}
  2266. onChange={(e) => { this.setState({ payIdt: e.target.value }) }} />
  2267. </Col>
  2268. <Col span={2} style={{ marginLeft: '50px' }}>邮箱:</Col>
  2269. <Col span={8}>
  2270. <Input value={this.state.emailst}
  2271. onChange={(e) => { this.setState({ emailst: e.target.value }) }} />
  2272. </Col>
  2273. </Row>
  2274. <Row style={{ marginTop: '20px',paddingLeft:'50px' ,marginBottom:'50px'}}>
  2275. <Button className="set-submit" type="primary" htmlType="submit" id="change_keep" style={{marginLeft:'60px'}}>保存</Button>
  2276. <Button className="set-submit" type="ghost" onClick={this.setModal2Visiblecancel} id='change_rem'>取消</Button>
  2277. </Row>
  2278. </Spin>
  2279. </Form>
  2280. </Modal>
  2281. <Modal
  2282. width="600px"
  2283. footer=''
  2284. title="联系人详细信息"
  2285. visible={this.state.modal8Visible}
  2286. onOk={this.setModal8Visiblecancel}
  2287. onCancel={this.setModal8Visiblecancel}>
  2288. <div style={{paddingRight:"50px"}}>
  2289. <FormItem className="half-item"
  2290. {...formItemLayout}
  2291. label="姓名" >
  2292. {getFieldDecorator('name', {
  2293. initialValue: this.state.name
  2294. })(
  2295. <Input onChange={(e) => { this.setState({ name: e.target.value }) }}/>
  2296. )}
  2297. </FormItem>
  2298. <FormItem className="half-item"
  2299. {...formItemLayout}
  2300. label="性别" >
  2301. {getFieldDecorator('sex', {
  2302. initialValue: this.state.sex
  2303. })(
  2304. <Radio.Group onChange={(e) => { this.setState({ sex: e.target.value }); }}>
  2305. <Radio value="0">男</Radio>
  2306. <Radio value="1">女</Radio>
  2307. </Radio.Group>
  2308. )}
  2309. </FormItem>
  2310. <FormItem
  2311. labelCol={{ span: 6 }}
  2312. wrapperCol={{ span: 14 }}
  2313. label="是否是主要联系人:" style={{marginLeft:"65px"}}>
  2314. {getFieldDecorator('primaryFlg', {
  2315. initialValue: this.state.primaryFlg
  2316. })(
  2317. <Radio.Group onChange={(e) => {this.setState({primaryFlg: e.target.value });}}>
  2318. <Radio value={0}>是</Radio>
  2319. <Radio value={1}>否</Radio>
  2320. </Radio.Group>
  2321. )}
  2322. </FormItem>
  2323. <FormItem className="half-item"
  2324. {...formItemLayout}
  2325. label="手机号码" >
  2326. {getFieldDecorator('telNum', {
  2327. initialValue: this.state.telNum
  2328. })(
  2329. <Input onChange={(e) => { this.setState({ telNum: e.target.value }) }}/>
  2330. )}
  2331. </FormItem>
  2332. <FormItem className="half-item"
  2333. {...formItemLayout}
  2334. label="座机号" >
  2335. {getFieldDecorator('mobile', {
  2336. initialValue: this.state.mobile
  2337. })(
  2338. <Input onChange={(e) => { this.setState({ mobile: e.target.value }) }}/>
  2339. )}
  2340. </FormItem>
  2341. <FormItem className="half-item"
  2342. {...formItemLayout}
  2343. label="QQ号码" >
  2344. {getFieldDecorator('qq', {
  2345. initialValue: this.state.qq
  2346. })(
  2347. <Input onChange={(e) => { this.setState({ qq: e.target.value }) }}/>
  2348. )}
  2349. </FormItem>
  2350. <FormItem className="half-item"
  2351. {...formItemLayout}
  2352. label="邮箱号" >
  2353. {getFieldDecorator('email', {
  2354. initialValue: this.state.email
  2355. })(
  2356. <Input onChange={(e) => { this.setState({ email: e.target.value }) }}/>
  2357. )}
  2358. </FormItem>
  2359. <FormItem className="half-item"
  2360. {...formItemLayout}
  2361. label="微信" >
  2362. {getFieldDecorator('wechat', {
  2363. initialValue: this.state.wechat
  2364. })(
  2365. <Input onChange={(e) => { this.setState({ wechat: e.target.value }) }}/>
  2366. )}
  2367. </FormItem>
  2368. <FormItem className="half-item"
  2369. {...formItemLayout}
  2370. label="部门" >
  2371. {getFieldDecorator('depatrment', {
  2372. initialValue: this.state.depatrment
  2373. })(
  2374. <Input onChange={(e) => { this.setState({ depatrment: e.target.value }) }}/>
  2375. )}
  2376. </FormItem>
  2377. <FormItem className="half-item"
  2378. {...formItemLayout}
  2379. label="职位" >
  2380. {getFieldDecorator('customerPosition', {
  2381. initialValue: this.state.customerPosition
  2382. })(
  2383. <Input onChange={(e) => { this.setState({ customerPosition: e.target.value }); }}/>
  2384. )}
  2385. </FormItem>
  2386. </div>
  2387. <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  2388. <Button className="set-submit" type="primary" htmlType="submit" onClick={this.changefollow} style={{marginRight:"50px"}}>保存</Button>
  2389. <Button className="set-submit" type="ghost" onClick={this.setModal8Visiblecancel}>取消</Button>
  2390. </FormItem>
  2391. </Modal>
  2392. <Modal
  2393. footer=''
  2394. title="更多详情"
  2395. visible={this.state.modal6Visible}
  2396. onOk={this.setModal6Visiblecancel}
  2397. onCancel={this.setModal6Visiblecancel}>
  2398. <Spin spinning={this.state.loading}>
  2399. <div className="clearfix">
  2400. <FormItem
  2401. labelCol={{ span: 5 }}
  2402. wrapperCol={{ span: 18 }}
  2403. label="跟进结果" >
  2404. <span>{}</span>
  2405. </FormItem>
  2406. </div>
  2407. <FormItem
  2408. labelCol={{ span: 5 }}
  2409. wrapperCol={{ span: 18 }}
  2410. label="附件" >
  2411. <div className="clearfix">
  2412. <Upload className="demandDetailShow-upload"
  2413. listType="picture-card"
  2414. fileList={this.state.attachment}
  2415. onPreview={(file) => {
  2416. this.setState({
  2417. previewImage: file.url || file.thumbUrl,
  2418. previewVisible: true,
  2419. });
  2420. }} >
  2421. </Upload>
  2422. <Modal maskClosable={false} footer={null}
  2423. visible={this.state.previewVisible}
  2424. onCancel={() => { this.setState({ previewVisible: false }) }}>
  2425. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  2426. </Modal>
  2427. </div>
  2428. </FormItem>
  2429. </Spin>
  2430. </Modal>
  2431. <TechAchievementDesc
  2432. data={this.state.RowData}
  2433. detailApiUrl={this.props['data-detailApiUrl']}
  2434. achievementCategoryOption={this.state.achievementCategoryOption}
  2435. showDesc={this.state.showDesc}
  2436. closeDesc={this.closeDesc} />
  2437. </div >
  2438. );
  2439. }
  2440. }));
  2441. export default AchievementList;