myClient.jsx 106 KB

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