myClient.jsx 104 KB

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