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.loadData();
  629. }.bind(this));
  630. },
  631. informationRowClick(index){
  632. this.setModal8VisibleOk()
  633. console.log(index);
  634. $.ajax({
  635. method: "get",
  636. dataType: "json",
  637. crossDomain: false,
  638. url:globalConfig.context + '/api/admin/customer/findContactDetail',
  639. data: {
  640. contactId:index.id
  641. },
  642. success: function (data) {
  643. let theArr = [];
  644. let theDate=data.data;
  645. if (!data.data) {
  646. if (data.error && data.error.length) {
  647. message.warning(data.error[0].message);
  648. };
  649. } else {
  650. for (let i = 0; i < data.data.length; i++) {
  651. let thisdata = data.data[i];
  652. theArr.push({
  653. key:i,
  654. primaryFlg:primaryFlg,
  655. name:name,//联系人姓名
  656. sex:sex,//联系人性别
  657. mobile:mobile,//座机号
  658. telNum:telNum,//手机号
  659. email:email,//邮箱
  660. qq:qq,//qq
  661. wechat:wechat,//微信号
  662. depatrment:depatrment,//部门
  663. customerPosition:customerPosition,//职位
  664. });
  665. };
  666. };
  667. this.setState({//导出数据
  668. primaryFlg:theDate.primaryFlg,
  669. thaDate:theDate,
  670. cid:theDate.cid,//客户ID
  671. id:theDate.id,//联系人ID
  672. name:theDate.name,//联系人姓名
  673. sex:theDate.sex,//联系人性别
  674. mobile:theDate.mobile,//座机号
  675. telNum:theDate.telNum,//手机号
  676. email:theDate.email,//邮箱
  677. qq:theDate.qq,//qq
  678. wechat:theDate.wechat,//微信号
  679. depatrment:theDate.depatrment,//部门
  680. customerPosition:theDate.customerPosition,//职位
  681. companyName:theDate.companyName,//公司
  682. });
  683. }.bind(this),
  684. }).always(function () {
  685. this.setState({
  686. loading: false
  687. });
  688. }.bind(this));
  689. },
  690. componentWillReceiveProps(nextProps) {
  691. if (!this.props.visible && nextProps.visible) {
  692. if (nextProps.data && nextProps.data.id) {
  693. this.loadData(nextProps.data.id, nextProps.detailApiUrl);
  694. };
  695. this.state.technicalPictureUrl = [];
  696. };
  697. },
  698. //添加一条跟进记录,点击保存按钮进行添加
  699. addFollowSubmit(e) {
  700. e.preventDefault();
  701. this.state.data = []
  702. this.setState({
  703. selectedRowKeys: [],
  704. //loading: deletedIds.length > 0
  705. });
  706. let deletedIds;
  707. this.state.data = [];
  708. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  709. let rowItem = this.state.selectedRows[idx];
  710. if (rowItem.id) {
  711. deletedIds=rowItem.id
  712. };
  713. };
  714. this.props.form.validateFields((err, values) => {
  715. if (!err) {
  716. this.setState({
  717. loading: true
  718. });
  719. let custype=values._shareType;
  720. let customerTypechange="";
  721. switch(custype){
  722. case "个人客户":customerTypechange=0;break;
  723. case "公司客户":customerTypechange=1;break;
  724. }
  725. console.log(this.state.kid)
  726. let customerStatus= getcustomerStatueOn(this.state.customerStatus);
  727. let followSituation= getfllowSituationOn(this.state.followSituation);
  728. $.ajax({
  729. method: "POST",
  730. dataType: "json",
  731. crossDomain: false,
  732. url:globalConfig.context + '/api/admin/customer/addFollowUpRecord',
  733. data: {
  734. id: deletedIds,//编号id
  735. cuid:this.state.kid,//联系人ID
  736. followDates:(values.createTime ? values.createTime.format('YYYY-MM-DD'):undefined)+" "+(values.createTim ? values.createTim.format('YYYY:MM:DD'):undefined),//跟进时间
  737. followResult:values.remarks,//跟进结果
  738. attachment:"",//附件地址
  739. customerStatus:values.customerStatus,//跟进客户状态
  740. followSituation:values.followSituation,//跟进进度
  741. contactInfo:(this.state.conts?this.state.conts:"电话")+"-"+(this.state.nub?this.state.nub:""),
  742. }
  743. }).done(function (data) {
  744. this.setState({
  745. loading: false
  746. });
  747. if (!data.error.length) {
  748. message.success('保存成功!');
  749. this.setModal1Visiblecancel()
  750. } else {
  751. message.warning(data.error[0].message);
  752. }
  753. //this.loadData();
  754. }.bind(this));
  755. }
  756. })
  757. },
  758. //当选择联系人的列表变化时,则执行
  759. hundleName(e){
  760. let changNub=this.state.telNum[e];
  761. let changEmail=this.state.email[e];
  762. let kid=this.state.contactIds[e];
  763. console.log(kid)
  764. this.setState({
  765. kid:kid,
  766. contacts:'电话',
  767. nub:this.state.telNum[e],
  768. lastName: e,
  769. changNub:changNub,
  770. changEmail:changEmail,
  771. });
  772. },
  773. //所有资料修改保存提交,点击保存按钮进行更新
  774. handleSubmit(e) {
  775. e.preventDefault();
  776. let deletedIds;
  777. let adminName;
  778. let customerStatus;
  779. let companyIntention;
  780. let followSituation;
  781. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  782. let rowItem = this.state.selectedRows[idx];
  783. if (rowItem.id) {
  784. deletedIds=rowItem.id;
  785. adminName=rowItem.adminName;
  786. customerStatus=rowItem.customerStatus;
  787. companyIntention=rowItem.companyIntention;
  788. followSituation=rowItem.followSituation;
  789. };
  790. };
  791. //this.state.data = []
  792. this.setState({
  793. //selectedRowKeys: [],
  794. // loading: deletedIds.length > 0
  795. });
  796. this.props.form.validateFields((err, values) => {
  797. if (!err) {
  798. this.setState({
  799. loading: true
  800. });
  801. let custype=values._customerType;
  802. let customerTypechange="";
  803. switch(custype){
  804. case "个人客户":customerTypechange=0;break;
  805. case "公司客户":customerTypechange=1;break;
  806. }
  807. let companyIntentions= getCompanyIntentionOn(values.companyIntention);
  808. let followSituations= getfllowSituationOn(values.followSituation);
  809. let becompanyIntentions=getCompanyIntentionOn();
  810. let city=getcityArr(values.locationProvince);
  811. $.ajax({
  812. method: "POST",
  813. dataType: "json",
  814. crossDomain: false,
  815. url:globalConfig.context + '/api/admin/customer/updateCustomer',
  816. data: {
  817. id: this.state.cid,//编号id
  818. customerType:this.state.customerType,//客户信息 1
  819. //createTime: values.createTime ? values.createTime.format('YYYY-MM-DD') : undefined,//时间 1\
  820. companyName: values.companyName,//公司名称 1
  821. companyIndustry: values.companyIndustry,//公司行业
  822. tag: values.tag,
  823. locationProvince:values.locationProvince ,//省份1
  824. adress: values.adress,//详细地址1
  825. remarks: values.remarks,//备注1
  826. companyIntention:this.state.companyIntention,//公司意向
  827. followSituation:this.state.followSituation,//最新跟进1
  828. customerStatus:this.state.customerStatus,//客户状态1
  829. //name: values.name,//客户姓名1
  830. // beforeCustomerStatus:this.state.customerStatus,//客户状态
  831. // beforeCompanyIntention:this.state.companyIntention,
  832. // beforeFollowSituation:this.state.followSituation,//最新跟进
  833. beforeAdminName:this.state.adminName,
  834. name:this.state.companyName,
  835. }
  836. }).done(function (data) {
  837. this.setState({
  838. loading: false
  839. });
  840. if (!data.error.length) {
  841. message.success('修改成功!');
  842. this.setModal5Visiblecancel();
  843. } else {
  844. message.warning(data.error[0].message);
  845. }
  846. this.loadData();
  847. }.bind(this));
  848. }
  849. })
  850. },
  851. submitcontactman(e){
  852. let deletedIds;
  853. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  854. let rowItem = this.state.selectedRows[idx];
  855. if (rowItem.id) {
  856. deletedIds=rowItem.id
  857. };
  858. };
  859. this.setState({
  860. selectedRowKeys: [],
  861. });
  862. e.preventDefault();
  863. this.props.form.validateFields((err, values) => {
  864. if (!err) {
  865. this.setState({
  866. loading: true
  867. });
  868. $.ajax({
  869. method: "POST",
  870. dataType: "json",
  871. crossDomain: false,
  872. url: globalConfig.context + '/api/admin/customer/addContacter',
  873. data: {
  874. cid: deletedIds,//编号id
  875. sex:this.state.hot,//性别
  876. primaryFlg:this.state.hots,//是否是主要联系人
  877. name:this.state.paymentId,//联系人姓名
  878. mobile:this.state.paym,//座机
  879. telNum:this.state.pay,//电话
  880. qq:this.state.entId,//qq
  881. wechat:this.state.payId,//微信
  882. customerPosition:this.state.paentId,//职位
  883. depatrment:this.state.paytId,//部门
  884. email:this.state.emails,//邮箱
  885. }
  886. }).done(function (data) {
  887. this.setState({
  888. loading: false
  889. });
  890. if (!data.error.length) {
  891. message.success('保存成功!');
  892. this.setModal2Visiblecancel()
  893. } else {
  894. message.warning(data.error[0].message);
  895. }
  896. //this.loadData();
  897. }.bind(this));
  898. }
  899. });
  900. },
  901. getTechnicalPictureUrl(e) {
  902. this.setState({ technicalPictureUrl: e });
  903. },
  904. //新建联系人modal框显示
  905. showModal(){
  906. this.setState({
  907. visible: true,
  908. });
  909. },
  910. //指定转交人的点击函数
  911. showModa(){
  912. this.setState({
  913. visible: true,
  914. });
  915. let changeIds;
  916. let adminName;
  917. let customerStatus;
  918. let companyIntention;
  919. let followSituation;
  920. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  921. let rowItem = this.state.selectedRows[idx];
  922. if (rowItem.id) {
  923. changeIds=rowItem.id;
  924. adminName=rowItem.adminName;
  925. customerStatus=rowItem.customerStatus;
  926. companyIntention=rowItem.companyIntention;
  927. followSituation=rowItem.followSituation;
  928. };
  929. };
  930. $.ajax({
  931. method: "post",
  932. dataType: "json",
  933. crossDomain: false,
  934. url: globalConfig.context + "/api/admin/customer/findAdmin",
  935. data: {
  936. id: changeIds,//这一行数据的ID
  937. beforeCompanyIntention:companyIntention,//意向服务
  938. beforeCustomerStatus:customerStatus,//客户状态
  939. beforeFollowSituation:followSituation,//最新跟进状态
  940. beforeAdminName:adminName,//跟进人
  941. }
  942. }).done(function (data) {
  943. if (data.error && data.error.length) {
  944. message.warning(data.error[0].message);
  945. } else {
  946. let theAssigne = [];
  947. if (!data.data) {
  948. if (data.error && data.error.length) {
  949. message.warning(data.error[0].message);
  950. };
  951. } else {
  952. for (let i = 0; i < data.data.length; i++) {
  953. let thisdata = data.data[i];
  954. //处理数据 进行循环
  955. theAssigne.push({
  956. key: thisdata.name,
  957. id: thisdata.id,
  958. ids: thisdata.cid,
  959. mobile:thisdata.mobile,
  960. adminName: thisdata.beforeAdminName,
  961. customerStatus: thisdata.beforeCustomerStatus,
  962. companyIntention: thisdata.beforeCompanyIntention,
  963. followSituation: thisdata.beforeFollowSituation,
  964. });
  965. };
  966. };
  967. this.setState({
  968. dataman: theAssigne,
  969. });
  970. }
  971. }.bind(this));
  972. },
  973. //选择了指定人之后的保存点击函数,需要修改函数
  974. changeAssigner() {
  975. this.setState({
  976. visible: false,
  977. });
  978. let changeId;
  979. let changeIds;
  980. let adminName;
  981. let beforeAdminName;
  982. let customerStatus;
  983. let companyIntention;
  984. let followSituation;
  985. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  986. let rowItem = this.state.selectedRows[idx];
  987. if (rowItem.id) {
  988. changeId=rowItem.id;
  989. beforeAdminName=rowItem.adminName;
  990. adminName=rowItem.key;
  991. customerStatus=rowItem.customerStatus;
  992. companyIntention=rowItem.companyIntention;
  993. followSituation=rowItem.followSituation;
  994. changeIds=rowItem.ids;
  995. };
  996. };
  997. $.ajax({
  998. method: "post",
  999. dataType: "json",
  1000. crossDomain: false,
  1001. url: globalConfig.context + "/api/admin/customer/transferCustomer",
  1002. data: {
  1003. id: changeIds,//这一行数据的ID
  1004. aid:changeId,//指定转交人的ID
  1005. beforeCompanyIntention:companyIntention,//意向服务
  1006. beforeCustomerStatus:customerStatus,//客户状态
  1007. beforeFollowSituation:followSituation,//最新跟进状态
  1008. beforeAdminName:beforeAdminName,//之前的跟进人
  1009. adminName:adminName,//转交的跟进人
  1010. }
  1011. }).done(function (data) {
  1012. if (!data.error.length) {
  1013. message.success('转交成功!');
  1014. this.setState({
  1015. loading: false,
  1016. });
  1017. } else {
  1018. message.warning(data.error[0].message);
  1019. };
  1020. this.loadData();
  1021. }.bind(this));
  1022. },
  1023. handleOk(e){
  1024. this.setState({
  1025. visible: false,
  1026. });
  1027. },
  1028. handleCancel(e){
  1029. this.setState({
  1030. visible: false,
  1031. });
  1032. },
  1033. //点击公司名称,进行弹出框动作,同时进行资料详情查询
  1034. getInitialState() {
  1035. return {
  1036. technicalPictureUrl: [],
  1037. modal1Visible: false,
  1038. modal2Visible: false,
  1039. visible: false ,
  1040. searchMore: true,
  1041. searchType: 0,
  1042. validityPeriodDate: [],
  1043. releaseDate: [],
  1044. selectedRowKeys: [],
  1045. selectedRows: [],
  1046. loading: false,
  1047. pagination: {
  1048. defaultCurrent: 1,
  1049. defaultPageSize: 10,
  1050. showQuickJumper: true,
  1051. pageSize: 10,
  1052. onChange: function (page) {
  1053. this.loadData(page);
  1054. }.bind(this),
  1055. showTotal: function (total) {
  1056. return '共' + total + '条数据';
  1057. }
  1058. },
  1059. contactInformation:[
  1060. {
  1061. title: '姓名',
  1062. dataIndex: 'contactName',
  1063. key: 'contactName'
  1064. },{
  1065. title: '性别',
  1066. dataIndex: 'sex',
  1067. key: 'sex',
  1068. render: text => { return getsex(text); }
  1069. },
  1070. {
  1071. title: '手机号码',
  1072. dataIndex: 'telNum',
  1073. key: 'telNum'
  1074. },{
  1075. title: '座机号',
  1076. dataIndex: 'mobile',
  1077. key: 'mobile'
  1078. },{
  1079. title: 'QQ号码',
  1080. dataIndex: 'qq',
  1081. key: 'qq'
  1082. },{
  1083. title: '邮箱号',
  1084. dataIndex: 'email',
  1085. key: 'email'
  1086. },{
  1087. title: '微信',
  1088. dataIndex: 'wechat',
  1089. key: 'wechat'
  1090. },{
  1091. title: '部门',
  1092. dataIndex: 'depatrment',
  1093. key: 'depatrment'
  1094. },{
  1095. title: '职位',
  1096. dataIndex: 'customerPosition',
  1097. key: 'customerPosition'
  1098. }
  1099. ],
  1100. columnsman:[{
  1101. title: '姓名',
  1102. dataIndex: 'key',
  1103. key: 'key'
  1104. },{
  1105. title: '手机号码',
  1106. dataIndex: 'mobile',
  1107. key: 'mobile'
  1108. }
  1109. ],
  1110. columns: [
  1111. {
  1112. title: '公司名称',
  1113. dataIndex: 'companyName',
  1114. key: 'companyName',
  1115. render: text => {
  1116. const theData = this.state.data || {};
  1117. const contactsOption="";
  1118. const { getFieldDecorator } = this.props.form;
  1119. const FormItem = Form.Item;
  1120. const rowSelection = {
  1121. selectedRowKeys: this.state.selectedRowKeys,
  1122. onChange: (selectedRowKeys, selectedRows) => {
  1123. this.setState({
  1124. selectedRows: selectedRows.slice(-1),
  1125. selectedRowKeys: selectedRowKeys.slice(-1)
  1126. });
  1127. }
  1128. };
  1129. const hasSelected = this.state.selectedRowKeys.length > 0;
  1130. const formItemLayout = {
  1131. labelCol: { span: 8 },
  1132. wrapperCol: { span: 14 },
  1133. };
  1134. return (
  1135. <div>
  1136. <span>{text}</span>
  1137. <Modal
  1138. footer=''
  1139. title="客户详情"
  1140. width='1000px'
  1141. visible={this.state.modal5Visible}
  1142. onOk={this.setModal5Visiblecancel}
  1143. onCancel={this.setModal5Visiblecancel}
  1144. >
  1145. <Form horizontal onSubmit={this.handleSubmit} id="demand-form">
  1146. <Spin spinning={this.state.loading}>
  1147. <div className="clearfix">
  1148. <FormItem className="half-item"
  1149. {...formItemLayout}
  1150. label="客户类型" >
  1151. <span>{theData._customerType}</span>
  1152. </FormItem>
  1153. </div>
  1154. <div className="clearfix" style={{marginLeft:'40px',marginBottom:'20px',color:'#000000'}}>基本资料:</div>
  1155. <div>
  1156. <FormItem className="half-item"
  1157. {...formItemLayout}
  1158. label="跟进记录" >
  1159. <span style={{marginRight:"10px"}}>{theData._followSituation}</span>
  1160. <a href='#' onClick={this.setModal3VisibleOk } style={{marginRight:'50px',display:'inlineBlock'}}>查看更多</a>
  1161. </FormItem>
  1162. <FormItem className="half-item"
  1163. {...formItemLayout}
  1164. label="修改次数" >
  1165. <span></span>
  1166. </FormItem>
  1167. <FormItem className="half-item"
  1168. {...formItemLayout}
  1169. label="转为共享用户时间" >
  1170. <span></span>
  1171. </FormItem>
  1172. <FormItem className="half-item"
  1173. {...formItemLayout}
  1174. label="修改日志" >
  1175. <span></span>
  1176. </FormItem>
  1177. <FormItem className="half-item"
  1178. {...formItemLayout}
  1179. label="注册账号" >
  1180. <span></span>
  1181. </FormItem>
  1182. {/* <FormItem className="half-item"
  1183. {...formItemLayout}
  1184. label="最后联系时间" >
  1185. <span></span>
  1186. </FormItem> */}
  1187. <FormItem className="half-item"
  1188. {...formItemLayout}
  1189. label="业务操作" >
  1190. <span>查询</span>
  1191. </FormItem>
  1192. <FormItem className="half-item"
  1193. {...formItemLayout}
  1194. label="录入时间" >
  1195. <span>{theData.createTime}</span>
  1196. </FormItem>
  1197. <FormItem className="half-item"
  1198. {...formItemLayout}
  1199. label="跟单人" >
  1200. <span>{theData.adminName}</span>
  1201. </FormItem>
  1202. </div>
  1203. <div className="clearfix" style={{marginLeft:'40px',marginBottom:'20px',color:'#000000'}}>公司资料:</div>
  1204. <div>
  1205. <FormItem className="half-item"
  1206. {...formItemLayout}
  1207. label="公司名称" >
  1208. {getFieldDecorator('companyName', {
  1209. initialValue: theData.companyName
  1210. })(
  1211. <Input />
  1212. )}
  1213. </FormItem>
  1214. <FormItem className="half-item"
  1215. {...formItemLayout}
  1216. label="公司行业" >
  1217. {getFieldDecorator('companyIndustry', {
  1218. initialValue: theData.companyIndustry
  1219. })(
  1220. <Input />
  1221. )}
  1222. </FormItem>
  1223. <FormItem className="half-item"
  1224. {...formItemLayout}
  1225. label="意向服务" >
  1226. <Select placeholder="选择服务类型" value={getCompanyIntention(this.state.companyIntention)} onChange={(e) => {
  1227. this.setState({ companyIntention: e}) }}>
  1228. {
  1229. intentionalService.map(function (item) {
  1230. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1231. })
  1232. }
  1233. </Select>
  1234. </FormItem>
  1235. <FormItem className="half-item"
  1236. {...formItemLayout}
  1237. label="地区" >
  1238. {getFieldDecorator('locationProvince', {
  1239. initialValue: getcityArr(theData.locationProvince)
  1240. })(
  1241. <Select placeholder="选择地区" style={{ width: 160 }} >
  1242. {
  1243. cityArr.map(function (item) {
  1244. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1245. })
  1246. }
  1247. </Select>
  1248. )}
  1249. </FormItem>
  1250. <FormItem className="half-item"
  1251. {...formItemLayout}
  1252. label="最新跟进" >
  1253. <Select placeholder="选择跟进进度" value={getfllowSituation(this.state.followSituation)} style={{ width: 160 }} onChange={(e) => { this.setState({ followSituation: e}) }}>
  1254. {
  1255. newFollow.map(function (item) {
  1256. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1257. })
  1258. }
  1259. </Select>
  1260. </FormItem>
  1261. <FormItem className="half-item"
  1262. {...formItemLayout}
  1263. label="客户状态" >
  1264. <Select placeholder="选择客户状态" value={getcustomerStatue(this.state.customerStatus)} style={{ width: 160 }} onChange={(e) => { this.setState({ customerStatus: e }) }}>
  1265. {
  1266. customerStatus.map(function (item) {
  1267. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1268. })
  1269. }
  1270. </Select>
  1271. </FormItem>
  1272. <FormItem className="half-item"
  1273. {...formItemLayout}
  1274. label="详细地址" >
  1275. {getFieldDecorator('adress', {
  1276. initialValue: theData.adress
  1277. })(
  1278. <Input />
  1279. )}
  1280. </FormItem>
  1281. <FormItem className="half-item"
  1282. {...formItemLayout}
  1283. label="标签" >
  1284. {getFieldDecorator('tag', {
  1285. initialValue: theData.tag
  1286. })(
  1287. <Select placeholder="选择客户标签" >
  1288. {
  1289. tag.map(function (item) {
  1290. return <Select.Option key={item.key} >{item.key}</Select.Option>
  1291. })
  1292. }
  1293. </Select>
  1294. )}
  1295. </FormItem>
  1296. <div className="clearfix">
  1297. <FormItem
  1298. labelCol={{ span: 4 }}
  1299. wrapperCol={{ span: 18 }}
  1300. label="备注" >
  1301. {getFieldDecorator('remarks', {
  1302. initialValue: theData.remarks
  1303. })(
  1304. <Input type="textarea" rows={4} />
  1305. )}
  1306. </FormItem>
  1307. </div>
  1308. </div>
  1309. <div className="clearfix" style={{marginLeft:'40px',marginBottom:'20px',color:'#000000'}}>联系资料:<a href="#" style={{marginLeft:'15px'}} onClick={this.setModal7VisibleOk}>查看所有的联系人</a></div>
  1310. <Modal
  1311. width="1000px"
  1312. footer=''
  1313. title="联系人列表"
  1314. visible={this.state.modal7Visible}
  1315. onOk={this.setModal7Visiblecancel}
  1316. onCancel={this.setModal7Visiblecancel}>
  1317. <Spin spinning={this.state.loading}>
  1318. <Table
  1319. columns={this.state.contactInformation}
  1320. dataSource={this.state.information}
  1321. onRowClick={this.informationRowClick}
  1322. />
  1323. </Spin>
  1324. </Modal>
  1325. <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  1326. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  1327. <Button className="set-submit" type="ghost" onClick={this.setModal5Visiblecancel}>取消</Button>
  1328. </FormItem>
  1329. </Spin>
  1330. </Form>
  1331. </Modal>
  1332. <Modal
  1333. width="600px"
  1334. footer=''
  1335. title="联系人详细信息"
  1336. visible={this.state.modal8Visible}
  1337. onOk={this.setModal8Visiblecancel}
  1338. onCancel={this.setModal8Visiblecancel}>
  1339. <div style={{paddingRight:"50px"}}>
  1340. <FormItem className="half-item"
  1341. {...formItemLayout}
  1342. label="姓名" >
  1343. {getFieldDecorator('name', {
  1344. initialValue: this.state.name
  1345. })(
  1346. <Input onChange={(e) => { this.setState({ name: e.target.value }) }}/>
  1347. )}
  1348. </FormItem>
  1349. <FormItem className="half-item"
  1350. {...formItemLayout}
  1351. label="性别" >
  1352. {getFieldDecorator('sex', {
  1353. initialValue: this.state.sex
  1354. })(
  1355. <Radio.Group onChange={(e) => { this.setState({ sex: e.target.value }); }}>
  1356. <Radio value="0">男</Radio>
  1357. <Radio value="1">女</Radio>
  1358. </Radio.Group>
  1359. )}
  1360. </FormItem>
  1361. <FormItem
  1362. labelCol={{ span: 6 }}
  1363. wrapperCol={{ span: 14 }}
  1364. label="是否是主要联系人:" style={{marginLeft:"65px"}}>
  1365. {getFieldDecorator('primaryFlg', {
  1366. initialValue: this.state.primaryFlg
  1367. })(
  1368. <Radio.Group onChange={(e) => {this.setState({primaryFlg: e.target.value });}}>
  1369. <Radio value={0}>是</Radio>
  1370. <Radio value={1}>否</Radio>
  1371. </Radio.Group>
  1372. )}
  1373. </FormItem>
  1374. <FormItem className="half-item"
  1375. {...formItemLayout}
  1376. label="手机号码" >
  1377. {getFieldDecorator('telNum', {
  1378. initialValue: this.state.telNum
  1379. })(
  1380. <Input onChange={(e) => { this.setState({ telNum: e.target.value }) }}/>
  1381. )}
  1382. </FormItem>
  1383. <FormItem className="half-item"
  1384. {...formItemLayout}
  1385. label="座机号" >
  1386. {getFieldDecorator('mobile', {
  1387. initialValue: this.state.mobile
  1388. })(
  1389. <Input onChange={(e) => { this.setState({ mobile: e.target.value }) }}/>
  1390. )}
  1391. </FormItem>
  1392. <FormItem className="half-item"
  1393. {...formItemLayout}
  1394. label="QQ号码" >
  1395. {getFieldDecorator('qq', {
  1396. initialValue: this.state.qq
  1397. })(
  1398. <Input onChange={(e) => { this.setState({ qq: e.target.value }) }}/>
  1399. )}
  1400. </FormItem>
  1401. <FormItem className="half-item"
  1402. {...formItemLayout}
  1403. label="邮箱号" >
  1404. {getFieldDecorator('email', {
  1405. initialValue: this.state.email
  1406. })(
  1407. <Input onChange={(e) => { this.setState({ email: e.target.value }) }}/>
  1408. )}
  1409. </FormItem>
  1410. <FormItem className="half-item"
  1411. {...formItemLayout}
  1412. label="微信" >
  1413. {getFieldDecorator('wechat', {
  1414. initialValue: this.state.wechat
  1415. })(
  1416. <Input onChange={(e) => { this.setState({ wechat: e.target.value }) }}/>
  1417. )}
  1418. </FormItem>
  1419. <FormItem className="half-item"
  1420. {...formItemLayout}
  1421. label="部门" >
  1422. {getFieldDecorator('depatrment', {
  1423. initialValue: this.state.depatrment
  1424. })(
  1425. <Input onChange={(e) => { this.setState({ depatrment: e.target.value }) }}/>
  1426. )}
  1427. </FormItem>
  1428. <FormItem className="half-item"
  1429. {...formItemLayout}
  1430. label="职位" >
  1431. {getFieldDecorator('customerPosition', {
  1432. initialValue: this.state.customerPosition
  1433. })(
  1434. <Input onChange={(e) => { this.setState({ customerPosition: e.target.value }); }}/>
  1435. )}
  1436. </FormItem>
  1437. </div>
  1438. <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  1439. <Button className="set-submit" type="primary" htmlType="submit" onClick={this.changefollow} style={{marginRight:"50px"}}>保存</Button>
  1440. <Button className="set-submit" type="ghost" onClick={this.setModal8Visiblecancel}>取消</Button>
  1441. </FormItem>
  1442. </Modal>
  1443. </div>
  1444. )
  1445. }
  1446. }, {
  1447. title: '客户类型',
  1448. dataIndex: '_customerType',
  1449. key: '_customerType'
  1450. // render: text => { return getcustomerTyp(text); }
  1451. }, {
  1452. title: '地区',
  1453. dataIndex: 'locationProvince',
  1454. key: 'locationProvince',
  1455. render: text => { return getcityArr(text); }
  1456. }, {
  1457. title: '联系人姓名',
  1458. dataIndex: 'contactName',
  1459. key: 'contactName',
  1460. },
  1461. {
  1462. title: '手机号',
  1463. dataIndex: 'telNum',
  1464. key:'telNum',
  1465. },
  1466. {
  1467. title: '客户状态',
  1468. dataIndex: '_customerStatus',
  1469. key: '_customerStatus'
  1470. //render: text => { return getcustomerStatue(text) }
  1471. },
  1472. {
  1473. title: '意向服务',
  1474. dataIndex: '_companyIntention',
  1475. key: '_companyIntention',
  1476. //render: text => { return getCompanyIntention(text) }
  1477. },
  1478. {
  1479. title: '最新跟进',
  1480. dataIndex: '_followSituation',
  1481. key: '_followSituation',
  1482. render:text => {
  1483. const theData = this.state.data || {};
  1484. const contactsOption="";
  1485. const rowSelection = {
  1486. selectedRowKeys: this.state.selectedRowKeys,
  1487. onChange: (selectedRowKeys, selectedRows) => {
  1488. this.setState({
  1489. selectedRows: selectedRows.slice(-1),
  1490. selectedRowKeys: selectedRowKeys.slice(-1)
  1491. });
  1492. }
  1493. };
  1494. //const lastwomen=this.state.wemon || {};
  1495. const FormItem = Form.Item;
  1496. const { getFieldDecorator } = this.props.form;
  1497. const formItemLayout = {
  1498. labelCol: { span: 8 },
  1499. wrapperCol: { span: 14 },
  1500. };
  1501. const formItemLayput = {
  1502. labelCol: { span: 10 },
  1503. wrapperCol: { span: 14 },
  1504. };
  1505. return (
  1506. <div>
  1507. <span>{text}</span>
  1508. <Modal
  1509. style={{left:'500px'}}
  1510. footer=''
  1511. title="客户详细信息"
  1512. width='400px'
  1513. visible={this.state.modal4Visible}
  1514. onOk={this.setModal4Visiblecancel}
  1515. onCancel={this.setModal4Visiblecancel}
  1516. >
  1517. <Form horizontal onSubmit={this.submitcontact} id="demand-form">
  1518. <Spin spinning={this.state.loading}>
  1519. <div className='clearfix'>
  1520. <FormItem className="half-item"
  1521. {...formItemLayput}
  1522. label="所属公司" >
  1523. <span>{this.state.companyName}</span>
  1524. </FormItem>
  1525. <FormItem className="half-item"
  1526. {...formItemLayput}
  1527. label="性别" >
  1528. <span>{getsex(this.state.sex)}</span>
  1529. </FormItem>
  1530. <FormItem className="half-item"
  1531. {...formItemLayput}
  1532. label="姓名" >
  1533. <span>{this.state.name}</span>
  1534. </FormItem>
  1535. <FormItem className="half-item"
  1536. {...formItemLayput}
  1537. label="QQ号" >
  1538. <span>{this.state.qq}</span>
  1539. </FormItem>
  1540. <FormItem className="half-item"
  1541. {...formItemLayput}
  1542. label="手机号" >
  1543. <span>{this.state.telNum}</span>
  1544. </FormItem>
  1545. <FormItem className="half-item"
  1546. {...formItemLayput}
  1547. label="部门" >
  1548. <span>{this.state.depatrment}</span>
  1549. </FormItem>
  1550. <FormItem className="half-item"
  1551. {...formItemLayput}
  1552. label="职位" >
  1553. <span>{this.state.customerPosition}</span>
  1554. </FormItem>
  1555. <FormItem className="half-item"
  1556. {...formItemLayput}
  1557. label="微信号" >
  1558. <span>{this.state.wechat}</span>
  1559. </FormItem>
  1560. </div>
  1561. </Spin>
  1562. </Form>
  1563. </Modal>
  1564. <Modal
  1565. footer=''
  1566. title="历史记录列表"
  1567. width='800px'
  1568. visible={this.state.modal3Visible}
  1569. onOk={this.setModal3Visiblecancel}
  1570. onCancel={this.setModal3Visiblecancel}
  1571. >
  1572. <Spin spinning={this.state.loading}>
  1573. <Table dataSource={this.state.datahistory} >
  1574. <Column
  1575. title="时间"
  1576. dataIndex="_followDate"
  1577. key="_followDate"
  1578. />
  1579. <Column
  1580. title="客户"
  1581. dataIndex="contactName"
  1582. key="contactName"
  1583. render={(text, record,index) => (
  1584. <a href="#" onClick={() => this.setModal4Visible(true,index)}>{text}</a>
  1585. )}
  1586. />
  1587. <Column
  1588. title="跟进人"
  1589. dataIndex="adminName"
  1590. key="adminName"
  1591. />
  1592. <Column
  1593. title="联系方式"
  1594. dataIndex="contactInfo"
  1595. key="contactInfo"
  1596. />
  1597. <Column
  1598. title="最新跟进状态"
  1599. dataIndex="_followSituation"
  1600. key="_followSituation"
  1601. />
  1602. <Column
  1603. title="跟进结果"
  1604. dataIndex="followResult"
  1605. key="followResult"
  1606. render={(text, record) => (
  1607. <div>
  1608. <a href="#" onClick={this.setModal6VisibleOk}>{text}</a>
  1609. <Modal
  1610. footer=''
  1611. title="更多详情"
  1612. visible={this.state.modal6Visible}
  1613. onOk={this.setModal6Visiblecancel}
  1614. onCancel={this.setModal6Visiblecancel}>
  1615. <Spin spinning={this.state.loading}>
  1616. <div className="clearfix">
  1617. <FormItem
  1618. labelCol={{ span: 5 }}
  1619. wrapperCol={{ span: 18 }}
  1620. label="跟进结果" >
  1621. <span>{}</span>
  1622. </FormItem>
  1623. </div>
  1624. <FormItem
  1625. labelCol={{ span: 5 }}
  1626. wrapperCol={{ span: 18 }}
  1627. label="附件" >
  1628. <div className="clearfix">
  1629. <Upload className="demandDetailShow-upload"
  1630. listType="picture-card"
  1631. fileList={this.state.attachment}
  1632. onPreview={(file) => {
  1633. this.setState({
  1634. previewImage: file.url || file.thumbUrl,
  1635. previewVisible: true,
  1636. });
  1637. }} >
  1638. </Upload>
  1639. <Modal maskClosable={false} footer={null}
  1640. visible={this.state.previewVisible}
  1641. onCancel={() => { this.setState({ previewVisible: false }) }}>
  1642. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  1643. </Modal>
  1644. </div>
  1645. </FormItem>
  1646. </Spin>
  1647. </Modal>
  1648. </div>
  1649. )}
  1650. />
  1651. <Column
  1652. title="删除记录"
  1653. key="del"
  1654. render={(text, record, index) => (
  1655. <Popconfirm title="是否删除?" onConfirm={() => this.onDelete(index)}>
  1656. <a href="#" style={{color:"#f00"}}>删除</a>
  1657. </Popconfirm>
  1658. )}
  1659. />
  1660. </Table>
  1661. </Spin>
  1662. </Modal>
  1663. <Modal
  1664. footer=''
  1665. title="新增跟进记录"
  1666. width='1000px'
  1667. visible={this.state.modal1Visible}
  1668. onOk={this.setModal1Visiblecancel}
  1669. onCancel={this.setModal1Visiblecancel}
  1670. >
  1671. <Form horizontal onSubmit={this.handleSubmit} id="demand-form">
  1672. <Spin spinning={this.state.loading}>
  1673. <div className="user-search">
  1674. <div className="clearfix">
  1675. <FormItem className="half-item"
  1676. {...formItemLayout}
  1677. label="客户公司名称:" >
  1678. <span>{theData.companyName}</span>
  1679. </FormItem>
  1680. </div>
  1681. <FormItem className="half-item"
  1682. {...formItemLayout}
  1683. label="最新联系人:" >
  1684. <Select placeholder="选择联系人" style={{ width: 140 }}
  1685. value={this.state.lastName}
  1686. onChange={this.hundleName}>
  1687. {this.state.orderStatusOption}
  1688. </Select>
  1689. <span style={{width:'120px',display:'inline-block',marginLeft:'20px'}}>{getcustomerTyp(theData.customerTyp)}
  1690. <Button type="primary" onClick={this.setModal2VisibleOk}>添加</Button>
  1691. </span>
  1692. <Modal
  1693. footer=''
  1694. width='800px'
  1695. title="新增联系人"
  1696. visible={this.state.modal2Visible}
  1697. onOk={this.setModal2Visiblecancel}
  1698. onCancel={this.setModal2Visiblecancel}
  1699. >
  1700. <Form horizontal onSubmit={this.submitcontactman} id="demand-form">
  1701. <Spin spinning={this.state.loading}>
  1702. {/* <Row>
  1703. <FormItem className="half-item"
  1704. {...formItemLayout}
  1705. label="所属公司" >
  1706. <span>{theData.id}</span>
  1707. </FormItem>
  1708. </Row>*/}
  1709. <Row>
  1710. <FormItem
  1711. labelCol={{ span: 4 }}
  1712. wrapperCol={{ span: 14 }}
  1713. label="是否是主要联系人:" style={{marginRight:'10px'}}>
  1714. <Radio.Group value={this.state.hots} onChange={(e) => {
  1715. this.setState({ hots: e.target.value })
  1716. }}>
  1717. <Radio value={0}>是</Radio>
  1718. <Radio value={1}>否</Radio>
  1719. </Radio.Group>
  1720. </FormItem>
  1721. <FormItem
  1722. labelCol={{ span: 4 }}
  1723. wrapperCol={{ span: 14 }}
  1724. label="性别:" style={{marginRight:'10px',marginTop: '-15px'}}>
  1725. <Radio.Group value={this.state.hot} onChange={(e) => {
  1726. this.setState({ hot: e.target.value })
  1727. }}>
  1728. <Radio value={0}>男</Radio>
  1729. <Radio value={1}>女</Radio>
  1730. </Radio.Group>
  1731. </FormItem>
  1732. </Row>
  1733. <Row style={{ paddingLeft:'50px' }}>
  1734. <Col span={2}>姓名:</Col>
  1735. <Col span={8}>
  1736. <Input value={this.state.paymentId}
  1737. onChange={(e) => { this.setState({ paymentId: e.target.value }) }} />
  1738. </Col>
  1739. <Col span={2} style={{ marginLeft: '50px' }}>QQ号:</Col>
  1740. <Col span={8}>
  1741. <Input value={this.state.entId}
  1742. onChange={(e) => { this.setState({ entId: e.target.value }) }} />
  1743. </Col>
  1744. </Row>
  1745. <Row style={{ marginTop: '20px',paddingLeft:'50px' }}>
  1746. <Col span={2}>手机号:</Col>
  1747. <Col span={8}>
  1748. <Input value={this.state.pay}
  1749. onChange={(e) => { this.setState({ pay: e.target.value }) }} />
  1750. </Col>
  1751. <Col span={2} style={{ marginLeft: '50px' }}>座机号:</Col>
  1752. <Col span={8}>
  1753. <Input value={this.state.paym}
  1754. onChange={(e) => { this.setState({ paym: e.target.value }) }} />
  1755. </Col>
  1756. </Row>
  1757. <Row style={{ marginTop: '20px' ,paddingLeft:'50px'}}>
  1758. <Col span={2}>部门:</Col>
  1759. <Col span={8}>
  1760. <Input value={this.state.paytId}
  1761. onChange={(e) => { this.setState({ paytId: e.target.value }) }} />
  1762. </Col>
  1763. <Col span={2} style={{ marginLeft: '50px' }}>职位:</Col>
  1764. <Col span={8}>
  1765. <Input value={this.state.paentId}
  1766. onChange={(e) => { this.setState({ paentId: e.target.value }) }} />
  1767. </Col>
  1768. </Row>
  1769. <Row style={{ marginTop: '20px',paddingLeft:'50px' }}>
  1770. <Col span={2}>微信号:</Col>
  1771. <Col span={8}>
  1772. <Input value={this.state.payId}
  1773. onChange={(e) => { this.setState({ payId: e.target.value }) }} />
  1774. </Col>
  1775. <Col span={2} style={{ marginLeft: '50px' }}>邮箱:</Col>
  1776. <Col span={8}>
  1777. <Input value={this.state.emails}
  1778. onChange={(e) => { this.setState({ emails: e.target.value }) }} />
  1779. </Col>
  1780. </Row>
  1781. <Row style={{ marginTop: '20px',paddingLeft:'50px' ,marginBottom:'50px'}}>
  1782. <Button className="set-submit" type="primary" htmlType="submit" id="change_keep" style={{marginLeft:'60px'}}>保存</Button>
  1783. <Button className="set-submit" type="ghost" onClick={this.setModal2Visiblecancel} id='change_rem'>取消</Button>
  1784. </Row>
  1785. </Spin>
  1786. </Form>
  1787. </Modal>
  1788. </FormItem>
  1789. <FormItem className="half-item"
  1790. {...formItemLayout}
  1791. label="联系方式" >
  1792. <Select placeholder="选择方式" style={{width:'100px'}} value={this.state.contacts}
  1793. onChange={this.contacts}>
  1794. <Select.Option value="0">电话</Select.Option>
  1795. <Select.Option value="1">邮件</Select.Option>
  1796. <Select.Option value="2">面谈</Select.Option>
  1797. <Select.Option value="3">短信</Select.Option>
  1798. </Select>
  1799. <span style={{marginLeft:'20px'}}>{this.state.nub}</span>
  1800. </FormItem>
  1801. <FormItem className="half-item"
  1802. {...formItemLayout}
  1803. label="最近跟进时间:" >
  1804. <span>{theData.createTime}</span>
  1805. </FormItem>
  1806. <div>
  1807. <FormItem className="half-item"
  1808. {...formItemLayout}
  1809. label="最新跟进时间" >
  1810. {getFieldDecorator('createTime', {
  1811. rules: [{ required: true, message: '此项为必填项!' }],
  1812. initialValue: theData.createTime ? moment(theData.createTime) : null
  1813. })(
  1814. <DatePicker />
  1815. )}
  1816. {getFieldDecorator('createTim', {
  1817. rules: [{ required: true, message: '此项为必填项!' }],
  1818. initialValue: theData.createTime ? moment(theData.createTime) : null
  1819. })(
  1820. <TimePicker />
  1821. )}
  1822. </FormItem>
  1823. </div>
  1824. <FormItem className="half-item"
  1825. {...formItemLayout}
  1826. label="客户状态:" >
  1827. <span>{this.state._customerStatus}</span>
  1828. </FormItem>
  1829. <FormItem className="half-item"
  1830. {...formItemLayout}
  1831. label="最新客户状态" >
  1832. {getFieldDecorator('customerStatus', {
  1833. initialValue: ""
  1834. })(
  1835. <Select placeholder="选择客户状态" style={{width:'200px'}}>
  1836. {
  1837. customerStatus.map(function (item) {
  1838. return <Select.Option key={item.value} style={{width:'200px'}}>{item.key}</Select.Option>
  1839. })
  1840. }
  1841. </Select>
  1842. )}
  1843. </FormItem>
  1844. <FormItem className="half-item"
  1845. {...formItemLayout}
  1846. label="跟进状态:" >
  1847. <span>{this.state._followSituation}</span>
  1848. </FormItem>
  1849. <FormItem className="half-item"
  1850. {...formItemLayout}
  1851. label="最新跟进状态" >
  1852. {getFieldDecorator('followSituation', {
  1853. initialValue: ""
  1854. })(
  1855. <Select placeholder="选择跟进状态" style={{width:'200px'}}>
  1856. {
  1857. newFollow.map(function (item) {
  1858. return <Select.Option key={item.value} style={{width:'200px'}}>{item.key}</Select.Option>
  1859. })
  1860. }
  1861. </Select>
  1862. )}
  1863. </FormItem>
  1864. <div className="clearfix">
  1865. <FormItem
  1866. labelCol={{ span: 4 }}
  1867. wrapperCol={{ span: 18 }}
  1868. label="跟进结果" >
  1869. {getFieldDecorator('remarks', {
  1870. initialValue: theData.remarks
  1871. })(
  1872. <Input type="textarea" rows={4} />
  1873. )}
  1874. </FormItem>
  1875. </div>
  1876. <div className="clearfix">
  1877. <FormItem
  1878. labelCol={{ span: 4 }}
  1879. wrapperCol={{ span: 18 }}
  1880. label="技术图片" >
  1881. <PicturesWall
  1882. pictureSign="achievement_technical_picture"
  1883. fileList={this.getTechnicalPictureUrl}
  1884. pictureUrl={this.state.technicalPictureUrl} />
  1885. <p>图片建议:图片要清晰。</p>
  1886. </FormItem>
  1887. </div>
  1888. <Button style={{ marginRight: '20px' ,marginLeft:'160px',marginBottom:'50px'}} type="primary" onClick={this.addFollowSubmit}>保存</Button>
  1889. <Button className="set-submit" type="ghost" onClick={this.setModal1Visiblecancel} id='change_rem'>取消</Button>
  1890. </div>
  1891. </Spin>
  1892. </Form >
  1893. </Modal>
  1894. </div>
  1895. )
  1896. }
  1897. },
  1898. {
  1899. title: '跟单人',
  1900. dataIndex: 'adminName',
  1901. key: 'adminName',
  1902. },
  1903. {
  1904. title: '时间',
  1905. dataIndex: 'followDate',
  1906. key: 'followDate',
  1907. }
  1908. ],
  1909. dataSource: [],
  1910. searchTime: [,]
  1911. };
  1912. },
  1913. componentWillMount() {
  1914. let theArr = [];
  1915. customerStatus.map(function (item) {
  1916. theArr.push(
  1917. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  1918. )
  1919. });
  1920. let auditArr = [];
  1921. cityArr.map(function (item) {
  1922. auditArr.push(
  1923. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  1924. )
  1925. });
  1926. let intentionalArr = [];
  1927. intentionalService.map(function (item) {
  1928. intentionalArr.push(
  1929. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  1930. )
  1931. });
  1932. let newArr = [];
  1933. newFollow.map(function (item) {
  1934. newArr.push(
  1935. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  1936. )
  1937. });
  1938. this.state.customerStatuarr = theArr;
  1939. this.state.auditStatusOption = auditArr;
  1940. this.state.intentionalOption = intentionalArr;
  1941. this.state.newOption = newArr;
  1942. this.loadData();
  1943. },
  1944. tableRowClick(record, index) {
  1945. this.state.RowData = record;
  1946. this.setModal5VisibleOk(record);
  1947. this.setState({
  1948. rowId:record.id ,
  1949. before_customerStatus:record._customerStatus,
  1950. before_companyIntention:record._companyIntention,
  1951. before_followSituation:record._followSituation
  1952. })
  1953. console.log(record);
  1954. },
  1955. //删除功能,已经完成
  1956. delectRow() {
  1957. let deletedIds;
  1958. let adminName;
  1959. let customerStatus;
  1960. let companyIntention;
  1961. let followSituation;
  1962. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  1963. let rowItem = this.state.selectedRows[idx];
  1964. if (rowItem.id) {
  1965. deletedIds=rowItem.id;
  1966. adminName=rowItem.adminName;
  1967. customerStatus=rowItem.customerStatus;
  1968. companyIntention=rowItem.companyIntention;
  1969. followSituation=rowItem.followSituation;
  1970. };
  1971. };
  1972. this.state.data = []
  1973. this.setState({
  1974. selectedRowKeys: [],
  1975. });
  1976. $.ajax({
  1977. method: "post",
  1978. dataType: "json",
  1979. crossDomain: false,
  1980. url: globalConfig.context + "/api/admin/customer/deleteCustomer",
  1981. data: {
  1982. id: deletedIds,//删除的ID
  1983. beforeCustomerStatus:customerStatus,
  1984. beforeCompanyIntention:companyIntention,
  1985. beforeFollowSituation:followSituation,
  1986. beforeAdminName:adminName
  1987. }
  1988. }).done(function (data) {
  1989. if (!data.error.length) {
  1990. message.success('删除成功!');
  1991. this.setState({
  1992. loading: false,
  1993. });
  1994. } else {
  1995. message.warning(data.error[0].message);
  1996. };
  1997. this.loadData();
  1998. }.bind(this));
  1999. },
  2000. //删除功能
  2001. delectRowFollow() {
  2002. let deletedIds;
  2003. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  2004. let rowItem = this.state.selectedRows[idx];
  2005. if (rowItem.id) {
  2006. deletedIds=rowItem.id;
  2007. };
  2008. };
  2009. this.state.data = []
  2010. this.setState({
  2011. selectedRowKeys: [],
  2012. });
  2013. $.ajax({
  2014. method: "post",
  2015. dataType: "json",
  2016. crossDomain: false,
  2017. url: globalConfig.context + "/api/admin/customer/deleteContacter",
  2018. data: {
  2019. contactId: deletedIds,//删除的ID
  2020. }
  2021. }).done(function (data) {
  2022. if (!data.error.length) {
  2023. message.success('删除成功!');
  2024. this.setState({
  2025. loading: false,
  2026. });
  2027. } else {
  2028. message.warning(data.error[0].message);
  2029. };
  2030. this.loadData();
  2031. }.bind(this));
  2032. },
  2033. //转为公共客户功能
  2034. changeRow() {
  2035. let deletedIds;
  2036. let customerStatus;
  2037. let companyIntention;
  2038. let followSituation;
  2039. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  2040. let rowItem = this.state.selectedRows[idx];
  2041. if (rowItem.id) {
  2042. deletedIds=rowItem.id;
  2043. customerStatus=rowItem.customerStatus;
  2044. companyIntention=rowItem.companyIntention;
  2045. followSituation=rowItem.followSituation;
  2046. };
  2047. };
  2048. this.setState({
  2049. selectedRowKeys: [],
  2050. });
  2051. $.ajax({
  2052. method: "post",
  2053. dataType: "json",
  2054. crossDomain: false,
  2055. url: globalConfig.context + "/api/admin/customer/transferToPublic",
  2056. data: {
  2057. aid:this.state.aid,
  2058. id: deletedIds,
  2059. beforeCompanyIntention:companyIntention,//意向服务
  2060. beforeCustomerStatus:customerStatus,//客户状态
  2061. beforeFollowSituation:followSituation,//最新跟进状态
  2062. }
  2063. }).done(function (data) {
  2064. if (!data.error.length) {
  2065. message.success('已转为公共客户!');
  2066. this.setState({
  2067. loading: false,
  2068. });
  2069. } else {
  2070. message.warning(data.error[0].message);
  2071. };
  2072. this.loadData();
  2073. }.bind(this));
  2074. },
  2075. addClick() {
  2076. this.state.RowData = {};
  2077. this.setState({
  2078. showDesc: true
  2079. });
  2080. },
  2081. closeDesc(e, s) {
  2082. this.state.showDesc = e;
  2083. if (s) {
  2084. this.loadData();
  2085. };
  2086. },
  2087. search() {
  2088. this.loadData1();
  2089. },
  2090. reset() {
  2091. this.state.companyName='';
  2092. this.state.customerType = undefined;
  2093. this.state.id = undefined;
  2094. this.state.shareType = undefined;
  2095. this.state.companyIntention = undefined;
  2096. this.state.followSituation = undefined;
  2097. this.state.locationProvince = undefined;
  2098. this.state.customerStatus = undefined;
  2099. this.state.contactName = undefined;
  2100. this.state.contactTel = undefined;
  2101. this.state.contactName = undefined;
  2102. this.state.releaseDate = [];
  2103. this.loadData();
  2104. },
  2105. searchSwitch() {
  2106. this.setState({
  2107. searchMore: !this.state.searchMore
  2108. });
  2109. },
  2110. render() {
  2111. const FormItem = Form.Item
  2112. const rowSelection = {
  2113. selectedRowKeys: this.state.selectedRowKeys,
  2114. onChange: (selectedRowKeys, selectedRows) => {
  2115. this.setState({
  2116. selectedRows: selectedRows.slice(-1),
  2117. selectedRowKeys: selectedRowKeys.slice(-1)
  2118. });
  2119. }
  2120. };
  2121. const hasSelected = this.state.selectedRowKeys.length > 0;
  2122. const { RangePicker } = DatePicker;
  2123. const theData = this.props.data || {};
  2124. const { getFieldDecorator } = this.props.form;
  2125. const formItemLayout = {
  2126. labelCol: { span: 8 },
  2127. wrapperCol: { span: 14 },
  2128. };
  2129. return (
  2130. <div className="user-content" >
  2131. <div className="content-title">
  2132. <span>客户管理</span>
  2133. <div className="patent-addNew clearfix" style={{marginRight:"22px"}}>
  2134. <Button type="primary" className="addButton" onClick={this.addClick}>新建客户<Icon type="plus" /></Button>
  2135. </div>
  2136. </div>
  2137. <div className="user-search">
  2138. <Input placeholder="公司名称"
  2139. value={this.state.companyName}
  2140. onChange={(e) => { this.setState({ companyName: e.target.value }); }} />
  2141. <Select placeholder="客户类型" style={{ width: 120 }}
  2142. value={this.state.customerType }
  2143. onChange={(e) => { this.setState({ customerType : e }) }}>
  2144. <Select.Option value="0" >个人客户</Select.Option>
  2145. <Select.Option value="1" >公司客户</Select.Option>
  2146. </Select>
  2147. <Select placeholder="意向服务"
  2148. style={{ width: 160 }}
  2149. value={this.state.companyIntention}
  2150. onChange={(e) => { this.setState({ companyIntention: e }) }}>
  2151. {this.state.intentionalOption}
  2152. </Select>
  2153. <Select placeholder="跟进进度"
  2154. style={{ width: 160 }}
  2155. value={this.state.followSituation}
  2156. onChange={(e) => { this.setState({ followSituation: e }) }}>
  2157. {this.state.newOption}
  2158. </Select>
  2159. <Select placeholder="地区"
  2160. style={{ width: 160 }}
  2161. value={this.state.locationProvince}
  2162. onChange={(e) => { this.setState({ locationProvince: e }) }}>
  2163. {this.state.auditStatusOption}
  2164. </Select>
  2165. <Select placeholder="客户状态" style={{ width: 120 }}
  2166. value={this.state.customerStatus}
  2167. onChange={(e) => { this.setState({customerStatus: e }) }}>
  2168. {this.state.customerStatuarr}
  2169. </Select>
  2170. <Button type="primary" onClick={this.search}>搜索</Button>
  2171. <Button onClick={this.reset}>重置</Button>
  2172. <Button onClick={this.setModal3VisibleOk} style={{marginRight:'10px'}} disabled={!hasSelected}>查看跟进记录</Button>
  2173. <Button type="primary" onClick={this.setModal1VisibleOk} disabled={!hasSelected}>添加跟进记录</Button>
  2174. <Button type="primary" onClick={this.showModa} disabled={!hasSelected}>指定转交人</Button>
  2175. <Modal
  2176. footer=''
  2177. title="选择指定人"
  2178. visible={this.state.visible}
  2179. onOk={this.handleOk}
  2180. onCancel={this.handleCancel}
  2181. >
  2182. <Spin spinning={this.state.loading}>
  2183. <Table
  2184. columns={this.state.columnsman}
  2185. rowSelection={rowSelection}
  2186. dataSource={this.state.dataman}
  2187. />
  2188. <FormItem wrapperCol={{ span: 12, offset: 12 }}>
  2189. <Button className="set-submit" type="primary" htmlType="submit" id="change_keep" style={{marginLeft:"50px"}} onClick={this.changeAssigner }>保存</Button>
  2190. <Button className="set-submit" type="ghost" onClick={this.handleCancel } style={{marginLeft:"30px"}} id='change_rem'>取消</Button>
  2191. </FormItem>
  2192. </Spin>
  2193. </Modal>
  2194. <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
  2195. disabled={!hasSelected}
  2196. onClick={this.changeRow}>转为公共客户<Icon /></Button>
  2197. <Button style={{ background: "#ea0862", border: "none", color: "#fff" }}
  2198. disabled={!hasSelected}
  2199. onClick={this.delectRow}>删除<Icon type="minus" /></Button>
  2200. <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
  2201. <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
  2202. <Input placeholder="联系人姓名" style={{width:'140px',marginRight:'10px'}}
  2203. value={this.state.contactName}
  2204. onChange={(e) => { this.setState({ contactName: e.target.value }); }} />
  2205. <Input placeholder="手机号码" style={{width:'140px',marginRight:'10px'}}
  2206. value={this.state.contactTel }
  2207. onChange={(e) => { this.setState({ contactTel: e.target.value }); }} />
  2208. </div>
  2209. </div>
  2210. <div className="patent-table">
  2211. <Spin spinning={this.state.loading}>
  2212. <Table columns={this.state.columns}
  2213. dataSource={this.state.dataSource}
  2214. rowSelection={rowSelection}
  2215. pagination={this.state.pagination}
  2216. onRowClick={this.tableRowClick}
  2217. />
  2218. </Spin>
  2219. </div>
  2220. <TechAchievementDesc
  2221. data={this.state.RowData}
  2222. detailApiUrl={this.props['data-detailApiUrl']}
  2223. achievementCategoryOption={this.state.achievementCategoryOption}
  2224. showDesc={this.state.showDesc}
  2225. closeDesc={this.closeDesc} />
  2226. </div >
  2227. );
  2228. }
  2229. }));
  2230. export default AchievementList;