myClient.jsx 102 KB

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