myClient.jsx 101 KB

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