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