myClient.jsx 106 KB

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