myClient.jsx 101 KB

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