myClient.jsx 102 KB

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