myClient.jsx 84 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654165516561657165816591660166116621663166416651666166716681669167016711672167316741675167616771678167916801681168216831684168516861687168816891690169116921693169416951696169716981699170017011702170317041705170617071708170917101711171217131714171517161717171817191720172117221723172417251726172717281729173017311732173317341735173617371738173917401741174217431744174517461747174817491750175117521753175417551756175717581759176017611762176317641765
  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} from '../../dataDic.js';
  10. import { beforeUploadFile, companySearch, getAchievementCategory,getsex,getSearchUrl,getTechAuditStatus,getcustomerTyp,getcityArr,getCompanyIntentionOn,getcustomerStatue,getCompanyIntention,getfllowSituation,getcontact,getfllowSituationOn} 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. customerName: this.state.customerName, //名称1
  130. shareTyp: this.state.shareTyp, //客户类型1
  131. province:this.state.province,//地区
  132. customerStatus:this.state.customerStatus,//客户状态1
  133. contactName:this.state.contactName,//联系人姓名1
  134. adminName:this.state.adminName,//跟单人1
  135. companyIntention:this.state.companyIntention,//意向服务
  136. followSituation:this.state.followSituation,//最新跟进
  137. //releaseDateStartDate: this.state.releaseDate[0],
  138. //releaseDateEndDate: this.state.releaseDate[1],
  139. },
  140. success: function (data) {
  141. let theArr = [];
  142. if (!data.data || !data.data.list) {
  143. if (data.error && data.error.length) {
  144. message.warning(data.error[0].message);
  145. };
  146. } else {
  147. for (let i = 0; i < data.data.list.length; i++) {
  148. let thisdata = data.data.list[i];
  149. theArr.push({
  150. key: i,
  151. id: thisdata.id,
  152. companyName:thisdata.companyName,//公司名称
  153. _shareType:thisdata._shareType,//客户类型
  154. locationProvince:thisdata.locationProvince,//地区
  155. contactName:thisdata.contactName, //联系人姓名
  156. telNum:thisdata.telNum,//手机号
  157. _customerStatus:thisdata._customerStatus,//客户状态
  158. _companyIntention:thisdata._companyIntention,//意向服务
  159. _followSituation:thisdata._followSituation,//最新跟进
  160. customerStatus:thisdata.customerStatus,//客户状态
  161. companyIntention:thisdata.companyIntention,//意向服务
  162. followSituation:thisdata.followSituation,//最新跟进
  163. adminName:thisdata.adminName, //跟进人
  164. followDate:thisdata.followDate,
  165. customerStatus:thisdata.customerStatus,//客户状态
  166. companyIntention:thisdata.companyIntention,//意向服务
  167. });
  168. };
  169. this.state.pagination.current = data.data.pageNumber;
  170. this.state.pagination.total = data.data.totalCount;
  171. };
  172. this.setState({
  173. dataSource: theArr,
  174. pagination: this.state.pagination
  175. });
  176. }.bind(this),
  177. }).always(function () {
  178. this.setState({
  179. loading: false
  180. });
  181. }.bind(this));
  182. },
  183. //通过ID查询这个个公司的跟进记录
  184. getNewWoman(theUid) {
  185. const contactsOptionWoman=[]
  186. $.ajax({
  187. method: "post",
  188. dataType: "json",
  189. crossDomain: false,
  190. url: globalConfig.context + "/api/admin/customer/findCustomerUserNameList",
  191. data: {
  192. cid: theUid
  193. },
  194. success: function (data) {
  195. let theOption = [];
  196. if (!data.data) {
  197. if (data.error && data.error.length) {
  198. message.warning(data.error[0].message);
  199. return;
  200. };
  201. };
  202. for (let item in data.data) {
  203. let theDataName = data.data[item].name;
  204. let theDataId = data.data[item].id;
  205. contactsOptionWoman.push("{value:"+theDataName+",key:"+theDataId+"}");
  206. };
  207. console.log(contactsOptionWoman);
  208. this.setState({
  209. contactsOption: contactsOptionWoman
  210. });
  211. }.bind(this),
  212. });
  213. },
  214. getNewWoman: function (e) {
  215. if (e) {
  216. let theType = '';
  217. contactsOptionWoman.map(function (item) {
  218. if (item.value == e) {
  219. theType = item.key;
  220. };
  221. });
  222. return theType;
  223. }
  224. },
  225. //通过ID查询这一条的信息
  226. Detailload(deletedIds){
  227. $.ajax({
  228. method: "post",
  229. dataType: "json",
  230. crossDomain: false,
  231. url: globalConfig.context + '/api/admin/customer/findCustomerUserDetails',
  232. data: {
  233. id: deletedIds
  234. },
  235. success: function (data) {
  236. let thisData = data.data;
  237. if (!thisData) {
  238. if (data.error && data.error.length) {
  239. message.warning(data.error[0].message);
  240. };
  241. thisData = {};
  242. };
  243. this.setState({
  244. data: thisData,
  245. orgDisplay: thisData.ownerType,
  246. switchValue: Boolean(!thisData.ownerId),
  247. radios:thisData.hot==='1'?true:false,
  248. tags: thisData.keyword ? (thisData.keyword.replace(/(,|、)/g, ",")).split(',') : [],
  249. technicalPictureUrl: thisData.technicalPictureUrl ? splitUrl(thisData.technicalPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
  250. coverImg: thisData.coverImg ? splitUrl(thisData.coverImg, ',', globalConfig.avatarHost + '/upload') : [],
  251. maturityPictureUrl: thisData.maturityPictureUrl ? splitUrl(thisData.maturityPictureUrl, ',', globalConfig.avatarHost + '/upload') : [],
  252. });
  253. if (thisData.ownerId) {
  254. this.getContactsList(thisData.ownerId);
  255. };
  256. }.bind(this),
  257. }).always(function () {
  258. this.setState({
  259. loading: false
  260. });
  261. }.bind(this));
  262. },
  263. //点击便捷记录
  264. setModal1Visible(modal1Visible) {
  265. this.setState({ modal1Visible });
  266. let deletedIds;
  267. let adminName;
  268. let customerStatus;
  269. let companyIntention;
  270. let followSituation;
  271. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  272. let rowItem = this.state.selectedRows[idx];
  273. if (rowItem.id) {
  274. deletedIds=rowItem.id;
  275. adminName=rowItem.adminName;
  276. companyIntention=rowItem.companyIntention;
  277. followSituation=rowItem.followSituation;
  278. };
  279. };
  280. this.Detailload(deletedIds);
  281. this.getNewWoman(deletedIds);
  282. },
  283. setModal2Visible(modal2Visible) {
  284. this.setState({ modal2Visible });
  285. },
  286. //历史记录中点击跟进人模板出现
  287. setModal3Visible(modal3Visible) {
  288. this.setState({ modal3Visible });
  289. this.state.data = [];
  290. this.setState({
  291. loading: true
  292. });
  293. $.ajax({
  294. method: "post",
  295. dataType: "json",
  296. crossDomain: false,
  297. url:globalConfig.context + '/api/admin/customer/listPrivateCustomer',
  298. data: {
  299. },
  300. success: function (data) {
  301. let theArr = [];
  302. if (!data.data || !data.data.list) {
  303. if (data.error && data.error.length) {
  304. message.warning(data.error[0].message);
  305. };
  306. } else {
  307. for (let i = 0; i < data.data.list.length; i++) {
  308. let thisdata = data.data.list[i];
  309. theArr.push({
  310. key: i,
  311. id: thisdata.id,
  312. companyName:thisdata.companyName,//公司名称
  313. _shareType:thisdata._shareType,//客户类型
  314. locationProvince:thisdata.locationProvince,//地区
  315. contactName:thisdata.contactName, //联系人姓名
  316. telNum:thisdata.telNum,//手机号
  317. _customerStatus:thisdata._customerStatus,//客户状态
  318. _companyIntention:thisdata._companyIntention,//意向服务
  319. _followSituation:thisdata._followSituation,//最新跟进
  320. adminName:thisdata.adminName, //跟进人
  321. followDate:thisdata.followDate
  322. });
  323. };
  324. };
  325. this.setState({
  326. datahistory: theArr,
  327. });
  328. }.bind(this),
  329. }).always(function () {
  330. this.setState({
  331. loading: false
  332. });
  333. }.bind(this));
  334. },
  335. //删除历史记录
  336. onDelete(){
  337. },
  338. setModal4Visible(modal4Visible) {
  339. this.setState({ modal4Visible }); //需要一个请求数据
  340. },
  341. //点击名称时获取列表
  342. setModal5Visible(modal5Visible) {
  343. this.setState({ modal5Visible });
  344. let deletedIds;
  345. let adminName;
  346. let customerStatus;
  347. let companyIntention;
  348. let followSituation;
  349. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  350. let rowItem = this.state.selectedRows[idx];
  351. if (rowItem.id) {
  352. deletedIds=rowItem.id;
  353. adminName=rowItem.adminName;
  354. companyIntention=rowItem.companyIntention;
  355. followSituation=rowItem.followSituation;
  356. };
  357. };
  358. this.setState({ modal5Visible }); //需要一个请求数据
  359. this.Detailload(deletedIds);
  360. },
  361. //历史记录查看更多,还是历史记录接口
  362. setModal6Visible(modal6Visible) {
  363. this.setState({ modal6Visible }); //需要一个请求数据
  364. },
  365. getPictureUrl(e) {
  366. this.setState({pictureUrl: e });
  367. },
  368. componentWillReceiveProps(nextProps) {
  369. if (!this.props.visible && nextProps.visible) {
  370. if (nextProps.data && nextProps.data.id) {
  371. this.loadData(nextProps.data.id, nextProps.detailApiUrl);
  372. };
  373. this.state.technicalPictureUrl = [];
  374. };
  375. },
  376. //快捷设置保存提交
  377. handleSubmit(e) {
  378. e.preventDefault();
  379. let adminName;
  380. let customerStatus;
  381. let companyIntention;
  382. let followSituation;
  383. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  384. let rowItem = this.state.selectedRows[idx];
  385. if (rowItem.id) {
  386. deletedIds=rowItem.id;
  387. adminName=rowItem.adminName;
  388. customerStatus=rowItem.customerStatus;
  389. companyIntention=rowItem.companyIntention;
  390. followSituation=rowItem.followSituation;
  391. };
  392. };
  393. this.state.data = []
  394. this.setState({
  395. selectedRowKeys: [],
  396. loading: deletedIds.length > 0
  397. });
  398. let deletedIds;
  399. this.state.data = [];
  400. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  401. let rowItem = this.state.selectedRows[idx];
  402. if (rowItem.id) {
  403. deletedIds=rowItem.id
  404. };
  405. };
  406. this.setState({
  407. selectedRowKeys: [],
  408. });
  409. this.props.form.validateFields((err, values) => {
  410. if (!err) {
  411. this.setState({
  412. loading: true
  413. });
  414. let custype=values._shareType;
  415. let customerTypechange="";
  416. switch(custype){
  417. case "个人客户":customerTypechange=0;break;
  418. case "公司客户":customerTypechange=1;break;
  419. }
  420. let companyIntentions= getCompanyIntentionOn(values.companyIntention);
  421. let followSituations= getfllowSituationOn(values.followSituation);
  422. console.log(values.followSituation)
  423. $.ajax({
  424. method: "POST",
  425. dataType: "json",
  426. crossDomain: false,
  427. url:globalConfig.context + '/api/admin/customer/updCustomer',
  428. data: {
  429. id: deletedIds,//编号id
  430. customerTyp :customerTypechange,//客户信息 1
  431. createTime: values.createTime ? values.createTime.format('YYYY-MM-DD') : undefined,//时间 1\
  432. companyIntention: companyIntentions,
  433. companyName: values.companyName,//公司名称 1
  434. companyIndustry: values.companyIndustry,//公司行业
  435. tag: values.tag,
  436. locationProvince: values.locationProvince,//省份1
  437. adress: values.adress,//详细地址1
  438. remarks: values.remarks,//备注1
  439. followSituation:this.state.followSituation?this.state.followSituation:followSituations,//最新跟进1
  440. customerStatus: values.customerStatus,//客户状态1
  441. name: values.name,//客户姓名1
  442. mobile: values.mobile,//座机1
  443. telNum: values.telNum,//手机号码1
  444. sex: values.sex,//性别1
  445. customerPosition: values.customerPosition,//职位1
  446. wechat: values.wechat,//微信号1
  447. qq: values.qq,//qq 1
  448. depatrment: values.depatrment,//部门 1
  449. email: values.email,//邮箱 1
  450. shareTyp:0,
  451. customerStatus:customerStatus,
  452. beforeCustomerStatus:customerStatus,
  453. beforeCompanyIntention:companyIntention,
  454. beforeFollowSituation:followSituation,
  455. beforeAdminName:adminName,
  456. }
  457. }).done(function (data) {
  458. this.setState({
  459. loading: false
  460. });
  461. if (!data.error.length) {
  462. message.success('保存成功!');
  463. this.setModal1Visible(false)
  464. } else {
  465. message.warning(data.error[0].message);
  466. }
  467. this.loadData();
  468. }.bind(this));
  469. }
  470. })
  471. this.setModal5Visible(false);
  472. },
  473. submitcontact(e){
  474. let deletedIds;
  475. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  476. let rowItem = this.state.selectedRows[idx];
  477. if (rowItem.id) {
  478. deletedIds=rowItem.id
  479. };
  480. };
  481. this.setState({
  482. selectedRowKeys: [],
  483. });
  484. e.preventDefault();
  485. this.props.form.validateFields((err, values) => {
  486. if (!err) {
  487. this.setState({
  488. loading: true
  489. });
  490. $.ajax({
  491. method: "POST",
  492. dataType: "json",
  493. crossDomain: false,
  494. url: globalConfig.context + '/api/admin/customer/addCustomer',
  495. data: {
  496. id: deletedIds,//编号id
  497. // serialNumber: values.serialNumber,//联系方式
  498. // serialNumber: values.serialNumber,//更新的客户状态
  499. // serialNumber: values.serialNumber,//最新跟进状态
  500. // serialNumber: values.serialNumber,//跟进结果
  501. // ownerEmail: this.state.switchValue ? values.ownerEmail : undefined,//开关控制下详细资料
  502. }
  503. }).done(function (data) {
  504. this.setState({
  505. loading: false
  506. });
  507. if (!data.error.length) {
  508. message.success('保存成功!');
  509. this.setModal2Visible(false)
  510. } else {
  511. message.warning(data.error[0].message);
  512. }
  513. this.loadData();
  514. }.bind(this));
  515. }
  516. });
  517. },
  518. getTechnicalPictureUrl(e) {
  519. this.setState({ technicalPictureUrl: e });
  520. },
  521. //新建联系人modal框显示
  522. showModal(){
  523. this.setState({
  524. visible: true,
  525. });
  526. },
  527. //指定转交人的点击函数
  528. showModa(){
  529. alert("147");
  530. this.setState({
  531. visible: true,
  532. });
  533. let changeIds;
  534. let adminName;
  535. let customerStatus;
  536. let companyIntention;
  537. let followSituation;
  538. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  539. let rowItem = this.state.selectedRows[idx];
  540. if (rowItem.id) {
  541. changeIds=rowItem.id;
  542. adminName=rowItem.adminName;
  543. customerStatus=rowItem.customerStatus;
  544. companyIntention=rowItem.companyIntention;
  545. followSituation=rowItem.followSituation;
  546. };
  547. };
  548. $.ajax({
  549. method: "post",
  550. dataType: "json",
  551. crossDomain: false,
  552. url: globalConfig.context + "/api/admin/customer/findAdmin",
  553. data: {
  554. id: changeIds,//这一行数据的ID
  555. BeforeCompanyIntention:companyIntention,//意向服务
  556. getBeforeCustomerStatus:customerStatus,//客户状态
  557. BeforeFollowSituation:followSituation,//最新跟进状态
  558. BeforeAdminName:adminName,//跟进人
  559. }
  560. }).done(function (data) {
  561. if (data.error && data.error.length) {
  562. message.warning(data.error[0].message);
  563. } else {
  564. let theAssigne = [];
  565. if (!data.data) {
  566. if (data.error && data.error.length) {
  567. message.warning(data.error[0].message);
  568. };
  569. alert(111);
  570. } else {
  571. for (let i = 0; i < data.data.length; i++) {
  572. let thisdata = data.data[i];
  573. //处理数据 进行循环
  574. theAssigne.push({
  575. key: thisdata.name,
  576. ids: thisdata.id,
  577. mobile:thisdata.mobile,
  578. adminName: thisdata.adminName,
  579. customerStatus: thisdata.customerStatus,
  580. companyIntention: thisdata.companyIntention,
  581. followSituation: thisdata.followSituation,
  582. });
  583. };
  584. console.log(theAssigne);
  585. };
  586. this.setState({
  587. dataman: theAssigne,
  588. });
  589. }
  590. }.bind(this));
  591. },
  592. //选择了指定人之后的保存点击函数,需要修改函数
  593. changeAssigner() {
  594. alert("选好了开始转交");
  595. this.setState({
  596. visible: false,
  597. });
  598. let changeIds;
  599. let adminName;
  600. let customerStatus;
  601. let companyIntention;
  602. let followSituation;
  603. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  604. let rowItem = this.state.selectedRows[idx];
  605. if (rowItem.id) {
  606. changeId=rowItem.id;
  607. adminName=rowItem.adminName;
  608. customerStatus=rowItem.customerStatus;
  609. companyIntention=rowItem.companyIntention;
  610. followSituation=rowItem.followSituation;
  611. changeIds=rowItem.ids;
  612. };
  613. };
  614. $.ajax({
  615. method: "GET",
  616. dataType: "json",
  617. crossDomain: false,
  618. url: globalConfig.context + "/api/admin/customer/deleteCustomer",
  619. data: {
  620. id: changeId,//这一行数据的ID
  621. followId:changeIds,//指定转交人的ID
  622. BeforeCompanyIntention:companyIntention,//意向服务
  623. getBeforeCustomerStatus:customerStatus,//客户状态
  624. BeforeFollowSituation:followSituation,//最新跟进状态
  625. BeforeAdminName:adminName,//跟进人
  626. }
  627. }).done(function (data) {
  628. if (!data.data.error.length) {
  629. message.success('转交成功!');
  630. this.setState({
  631. loading: false,
  632. });
  633. } else {
  634. message.warning(data.error[0].message);
  635. };
  636. this.loadData();
  637. }.bind(this));
  638. },
  639. handleOk(e){
  640. this.setState({
  641. visible: false,
  642. });
  643. },
  644. handleCancel(e){
  645. this.setState({
  646. visible: false,
  647. });
  648. },
  649. getInitialState() {
  650. return {
  651. technicalPictureUrl: [],
  652. modal1Visible: false,
  653. modal2Visible: false,
  654. visible: false ,
  655. searchMore: true,
  656. searchType: 0,
  657. validityPeriodDate: [],
  658. releaseDate: [],
  659. selectedRowKeys: [],
  660. selectedRows: [],
  661. loading: false,
  662. pagination: {
  663. defaultCurrent: 1,
  664. defaultPageSize: 10,
  665. showQuickJumper: true,
  666. pageSize: 10,
  667. onChange: function (page) {
  668. this.loadData(page);
  669. }.bind(this),
  670. showTotal: function (total) {
  671. return '共' + total + '条数据';
  672. }
  673. },
  674. columnsman:[{
  675. title: '姓名',
  676. dataIndex: 'key',
  677. key: 'key'
  678. },{
  679. title: '手机号码',
  680. dataIndex: 'mobile',
  681. key: 'mobile'
  682. }
  683. ],
  684. columns: [
  685. {
  686. title: '公司名称',
  687. dataIndex: 'companyName',
  688. key: 'companyName',
  689. render: text => {
  690. const theData = this.state.data || {};
  691. const contactsOption="";
  692. const { getFieldDecorator } = this.props.form;
  693. const FormItem = Form.Item
  694. const formItemLayout = {
  695. labelCol: { span: 8 },
  696. wrapperCol: { span: 14 },
  697. };
  698. return (
  699. <div>
  700. <Button onClick={() => this.setModal5Visible(true)}>{text}</Button>
  701. <Modal
  702. footer=''
  703. title="客户详情"
  704. width='1000px'
  705. visible={this.state.modal5Visible}
  706. onOk={() => this.setModal5Visible(false)}
  707. onCancel={() => this.setModal5Visible(false)}
  708. >
  709. <Form horizontal onSubmit={this.handleSubmit} id="demand-form">
  710. <Spin spinning={this.state.loading}>
  711. <div className="clearfix">
  712. <FormItem className="half-item"
  713. {...formItemLayout}
  714. label="客户类型1223" >
  715. {getFieldDecorator('_shareType', {
  716. rules: [{ required: true, message: '此项为必填项!' }],
  717. initialValue: theData._shareType
  718. })(
  719. <Select placeholder="选择客户类型" style={{ width: 160 }} >
  720. <Select.Option value="0" >个人客户</Select.Option>
  721. <Select.Option value="1" >公司客户</Select.Option>
  722. </Select>
  723. )}
  724. </FormItem>
  725. <FormItem className="half-item"
  726. {...formItemLayout}
  727. label="" >
  728. <span>{theData.id}</span>
  729. </FormItem>
  730. <div className="clearfix" style={{marginLeft:'40px',marginBottom:'20px',color:'#000000'}}>基本资料:</div>
  731. <div>
  732. <FormItem className="half-item"
  733. {...formItemLayout}
  734. label="跟单人" >
  735. {getFieldDecorator('adminName', {
  736. initialValue: theData.adminName
  737. })(
  738. <Input />
  739. )}
  740. </FormItem>
  741. </div>
  742. <div className="clearfix" style={{marginLeft:'40px',marginBottom:'20px',color:'#000000'}}>公司资料:</div>
  743. <div>
  744. <FormItem className="half-item"
  745. {...formItemLayout}
  746. label="公司名称" >
  747. {getFieldDecorator('companyName', {
  748. rules: [{ required: true, message: '此项为必填项!' }],
  749. initialValue: theData.companyName
  750. })(
  751. <Input />
  752. )}
  753. </FormItem>
  754. <FormItem className="half-item"
  755. {...formItemLayout}
  756. label="公司行业" >
  757. {getFieldDecorator('companyIndustry', {
  758. initialValue: theData.companyIndustry
  759. })(
  760. <Input />
  761. )}
  762. </FormItem>
  763. <FormItem className="half-item"
  764. {...formItemLayout}
  765. label="意向服务" >
  766. {getFieldDecorator('companyIntention', {
  767. rules: [{ required: true, message: '此项为必填项!' }],
  768. initialValue: getCompanyIntention(theData.companyIntention)
  769. })(
  770. <Select placeholder="选择服务类型" >
  771. {
  772. intentionalService.map(function (item) {
  773. return <Select.Option key={item.value} >{item.key}</Select.Option>
  774. })
  775. }
  776. </Select>
  777. )}
  778. </FormItem>
  779. <FormItem className="half-item"
  780. {...formItemLayout}
  781. label="地区" >
  782. {getFieldDecorator('locationProvince', {
  783. initialValue: getcityArr(theData.locationProvince)
  784. })(
  785. <Select placeholder="选择地区" style={{ width: 160 }} >
  786. {
  787. cityArr.map(function (item) {
  788. return <Select.Option key={item.value} >{item.key}</Select.Option>
  789. })
  790. }
  791. </Select>
  792. )}
  793. </FormItem>
  794. <FormItem className="half-item"
  795. {...formItemLayout}
  796. label="最新跟进" >
  797. {getFieldDecorator('followSituation', {
  798. rules: [{ required: true, message: '此项为必填项!' }],
  799. initialValue: getfllowSituation(theData.followSituation)
  800. })(
  801. <Select placeholder="选择跟进进度" style={{ width: 160 }} >
  802. {
  803. newFollow.map(function (item) {
  804. return <Select.Option key={item.value} >{item.key}</Select.Option>
  805. })
  806. }
  807. </Select>
  808. )}
  809. </FormItem>
  810. <FormItem className="half-item"
  811. {...formItemLayout}
  812. label="客户状态" >
  813. {getFieldDecorator('customerStatus', {
  814. rules: [{ required: true, message: '此项为必填项!' }],
  815. initialValue: getcustomerStatue(theData.customerStatus)
  816. })(
  817. <Select placeholder="选择客户状态" style={{ width: 160 }} >
  818. {
  819. customerStatus.map(function (item) {
  820. return <Select.Option key={item.value} >{item.key}</Select.Option>
  821. })
  822. }
  823. </Select>
  824. )}
  825. </FormItem>
  826. <FormItem className="half-item"
  827. {...formItemLayout}
  828. label="详细地址" >
  829. {getFieldDecorator('adress', {
  830. initialValue: theData.adress
  831. })(
  832. <Input />
  833. )}
  834. </FormItem>
  835. <FormItem className="half-item"
  836. {...formItemLayout}
  837. label="标签" >
  838. {getFieldDecorator('tag', {
  839. initialValue: theData.tag
  840. })(
  841. <Select placeholder="选择客户标签" >
  842. {
  843. tag.map(function (item) {
  844. return <Select.Option key={item.key} >{item.key}</Select.Option>
  845. })
  846. }
  847. </Select>
  848. )}
  849. </FormItem>
  850. <div className="clearfix">
  851. <FormItem
  852. labelCol={{ span: 4 }}
  853. wrapperCol={{ span: 18 }}
  854. label="备注" >
  855. {getFieldDecorator('remarks', {
  856. initialValue: theData.remarks
  857. })(
  858. <Input type="textarea" rows={4} />
  859. )}
  860. </FormItem>
  861. </div>
  862. </div>
  863. <div className="clearfix" style={{marginLeft:'40px',marginBottom:'20px',color:'#000000'}}>联系资料:</div>
  864. <div>
  865. <FormItem className="half-item"
  866. {...formItemLayout}
  867. label="姓名" >
  868. {getFieldDecorator('contactName', {
  869. rules: [{ required: true, message: '此项为必填项!' }],
  870. initialValue: theData.contactName
  871. })(
  872. <Input />
  873. )}
  874. </FormItem>
  875. <FormItem className="half-item"
  876. {...formItemLayout}
  877. label="性别" >
  878. {getFieldDecorator('sex', {
  879. rules: [{ required: true, message: '此项为必填项!' }],
  880. initialValue: theData.sex
  881. })(
  882. <Radio.Group onChange={(e) => { this.setState({ sex: e.target.value }); }}>
  883. <Radio value="0">男</Radio>
  884. <Radio value="1">女</Radio>
  885. </Radio.Group>
  886. )}
  887. </FormItem>
  888. <FormItem className="half-item"
  889. {...formItemLayout}
  890. label="手机号码" >
  891. {getFieldDecorator('telNum', {
  892. initialValue: theData.telNum
  893. })(
  894. <Input />
  895. )}
  896. </FormItem>
  897. <FormItem className="half-item"
  898. {...formItemLayout}
  899. label="座机号" >
  900. {getFieldDecorator('mobile', {
  901. initialValue: theData.mobile
  902. })(
  903. <Input />
  904. )}
  905. </FormItem>
  906. <FormItem className="half-item"
  907. {...formItemLayout}
  908. label="QQ号码" >
  909. {getFieldDecorator('qq', {
  910. initialValue: theData.qq
  911. })(
  912. <Input />
  913. )}
  914. </FormItem>
  915. <FormItem className="half-item"
  916. {...formItemLayout}
  917. label="邮箱号" >
  918. {getFieldDecorator('email', {
  919. initialValue: theData.email
  920. })(
  921. <Input />
  922. )}
  923. </FormItem>
  924. <FormItem className="half-item"
  925. {...formItemLayout}
  926. label="微信" >
  927. {getFieldDecorator('wechat', {
  928. initialValue: theData.wechat
  929. })(
  930. <Input />
  931. )}
  932. </FormItem>
  933. <FormItem className="half-item"
  934. {...formItemLayout}
  935. label="部门" >
  936. {getFieldDecorator('depatrment', {
  937. initialValue: theData.depatrment
  938. })(
  939. <Input />
  940. )}
  941. </FormItem>
  942. <FormItem className="half-item"
  943. {...formItemLayout}
  944. label="职位" >
  945. {getFieldDecorator('customerPosition', {
  946. initialValue: theData.customerPosition
  947. })(
  948. <Input />
  949. )}
  950. </FormItem>
  951. </div>
  952. </div>
  953. <FormItem wrapperCol={{ span: 12, offset: 4 }}>
  954. <Button className="set-submit" type="primary" htmlType="submit">保存</Button>
  955. <Button className="set-submit" type="ghost" onClick={() => this.setModal5Visible(false)}>取消</Button>
  956. </FormItem>
  957. </Spin>
  958. </Form >
  959. </Modal>
  960. </div>
  961. )
  962. }
  963. }, {
  964. title: '客户类型',
  965. dataIndex: '_shareType',
  966. key: '_shareType'
  967. // render: text => { return getcustomerTyp(text); }
  968. }, {
  969. title: '地区',
  970. dataIndex: 'locationProvince',
  971. key: 'locationProvince',
  972. render: text => { return getcityArr(text); }
  973. }, {
  974. title: '联系人姓名',
  975. dataIndex: 'contactName',
  976. key: 'contactName',
  977. },
  978. {
  979. title: '手机号',
  980. dataIndex: 'telNum',
  981. key:'telNum',
  982. },
  983. {
  984. title: '客户状态',
  985. dataIndex: '_customerStatus',
  986. key: '_customerStatus'
  987. //render: text => { return getcustomerStatue(text) }
  988. },
  989. {
  990. title: '意向服务',
  991. dataIndex: 'companyIntention',
  992. key: 'companyIntention',
  993. render: text => { return getCompanyIntention(text) }
  994. },
  995. {
  996. title: '最新跟进',
  997. dataIndex: '_followSituation',
  998. key: '_followSituation',
  999. render:text => {
  1000. const theData = this.state.data || {};
  1001. const theDate = this.state.date || {};
  1002. const contactsOption="";
  1003. const rowSelection = {
  1004. selectedRowKeys: this.state.selectedRowKeys,
  1005. onChange: (selectedRowKeys, selectedRows) => {
  1006. this.setState({
  1007. selectedRows: selectedRows.slice(-1),
  1008. selectedRowKeys: selectedRowKeys.slice(-1)
  1009. });
  1010. }
  1011. };
  1012. const FormItem = Form.Item;
  1013. const { getFieldDecorator } = this.props.form;
  1014. const formItemLayout = {
  1015. labelCol: { span: 8 },
  1016. wrapperCol: { span: 14 },
  1017. };
  1018. const formItemLayput = {
  1019. labelCol: { span: 10 },
  1020. wrapperCol: { span: 14 },
  1021. };
  1022. return (
  1023. <div>
  1024. <Button onClick={() => this.setModal3Visible(true)} style={{marginRight:'10px'}}>{text}</Button>
  1025. <Button type="primary" onClick={() => this.setModal1Visible(true)} ><Icon type="plus" /></Button>
  1026. <Modal
  1027. style={{left:'500px'}}
  1028. footer=''
  1029. title="跟进人详细信息"
  1030. width='400px'
  1031. visible={this.state.modal4Visible}
  1032. onOk={() => this.setModal4Visible(false)}
  1033. onCancel={() => this.setModal4Visible(false)}
  1034. >
  1035. <Form horizontal onSubmit={this.submitcontact} id="demand-form">
  1036. <Spin spinning={this.state.loading}>
  1037. <div className='clearfix'>
  1038. <FormItem className="half-item"
  1039. {...formItemLayput}
  1040. label="所属公司" >
  1041. <span>{theData.id}</span>
  1042. </FormItem>
  1043. <FormItem className="half-item"
  1044. {...formItemLayput}
  1045. label="主要联系人" >
  1046. <span>{theData.id}</span>
  1047. </FormItem>
  1048. <FormItem className="half-item"
  1049. {...formItemLayput}
  1050. label="性别" >
  1051. <span>{theData.id}</span>
  1052. </FormItem>
  1053. <FormItem className="half-item"
  1054. {...formItemLayput}
  1055. label="姓名" >
  1056. <span>{theData.id}</span>
  1057. </FormItem>
  1058. <FormItem className="half-item"
  1059. {...formItemLayput}
  1060. label="QQ号" >
  1061. <span>{theData.id}</span>
  1062. </FormItem>
  1063. <FormItem className="half-item"
  1064. {...formItemLayput}
  1065. label="手机号" >
  1066. <span>{theData.id}</span>
  1067. </FormItem>
  1068. <FormItem className="half-item"
  1069. {...formItemLayput}
  1070. label="部门" >
  1071. <span>{theData.id}</span>
  1072. </FormItem>
  1073. <FormItem className="half-item"
  1074. {...formItemLayput}
  1075. label="职位" >
  1076. <span>{theData.id}</span>
  1077. </FormItem>
  1078. <FormItem className="half-item"
  1079. {...formItemLayput}
  1080. label="微信号" >
  1081. <span>{theData.id}</span>
  1082. </FormItem>
  1083. </div>
  1084. </Spin>
  1085. </Form>
  1086. </Modal>
  1087. <Modal
  1088. footer=''
  1089. title="历史记录列表"
  1090. width='600px'
  1091. visible={this.state.modal3Visible}
  1092. onOk={() => this.setModal3Visible(false)}
  1093. onCancel={() => this.setModal3Visible(false)}
  1094. >
  1095. <Spin spinning={this.state.loading}>
  1096. <Table dataSource={datas}>
  1097. <Column
  1098. title="时间"
  1099. dataIndex="firstName"
  1100. key="firstName"
  1101. />
  1102. <Column
  1103. title="跟进人"
  1104. dataIndex="lastName"
  1105. key="lastName"
  1106. render={(text, record) => (
  1107. <span style={{color:'#f00'}} onClick={() => this.setModal4Visible(true)}>{text}</span>
  1108. )}
  1109. />
  1110. <Column
  1111. title="客户"
  1112. dataIndex="age"
  1113. key="age"
  1114. />
  1115. <Column
  1116. title="联系方式"
  1117. dataIndex="address"
  1118. key="address"
  1119. />
  1120. <Column
  1121. title="最新跟进状态"
  1122. dataIndex="addres"
  1123. key="addres"
  1124. />
  1125. <Column
  1126. title="跟进结果"
  1127. dataIndex="查看更多"
  1128. key="查看更多"
  1129. render={(text, record) => (
  1130. <div>
  1131. <span onClick={() => this.setModal6Visible(true)}>查看更多</span>
  1132. <Modal
  1133. footer=''
  1134. title="更多详情"
  1135. visible={this.state.modal6Visible}
  1136. onOk={() => this.setModal6Visible(false)}
  1137. onCancel={() => this.setModal6Visible(false)}>
  1138. <Spin spinning={this.state.loading}>
  1139. <div className="clearfix">
  1140. <FormItem
  1141. labelCol={{ span: 5 }}
  1142. wrapperCol={{ span: 18 }}
  1143. label="跟进结果" >
  1144. <span>{this.state.cagory}</span>
  1145. </FormItem>
  1146. </div>
  1147. <FormItem
  1148. labelCol={{ span: 5 }}
  1149. wrapperCol={{ span: 18 }}
  1150. label="附件" >
  1151. <div className="clearfix">
  1152. <Upload className="demandDetailShow-upload"
  1153. listType="picture-card"
  1154. fileList={this.state.technicalPictureUrl}
  1155. onPreview={(file) => {
  1156. this.setState({
  1157. previewImage: file.url || file.thumbUrl,
  1158. previewVisible: true,
  1159. });
  1160. }} >
  1161. </Upload>
  1162. <Modal maskClosable={false} footer={null}
  1163. visible={this.state.previewVisible}
  1164. onCancel={() => { this.setState({ previewVisible: false }) }}>
  1165. <img alt="" style={{ width: '100%' }} src={this.state.previewImage || ''} />
  1166. </Modal>
  1167. </div>
  1168. </FormItem>
  1169. </Spin>
  1170. </Modal>
  1171. </div>
  1172. )}
  1173. />
  1174. <Column
  1175. title="删除记录"
  1176. key="del"
  1177. render={(text, record, index) => (
  1178. <Popconfirm title="是否删除?" onConfirm={() => this.onDelete(index)}>
  1179. <a href="#">Delete</a>
  1180. </Popconfirm>
  1181. )}
  1182. />
  1183. </Table>
  1184. </Spin>
  1185. </Modal>
  1186. <Modal
  1187. footer=''
  1188. title="便捷修改"
  1189. width='1000px'
  1190. visible={this.state.modal1Visible}
  1191. onOk={() => this.setModal1Visible(false)}
  1192. onCancel={() => this.setModal1Visible(false)}
  1193. >
  1194. <Form horizontal onSubmit={this.handleSubmit} id="demand-form">
  1195. <Spin spinning={this.state.loading}>
  1196. <div className="user-search">
  1197. <Row>
  1198. <FormItem className="half-item"
  1199. {...formItemLayout}
  1200. label="客户公司名称:" >
  1201. <span>{theData.companyName}</span>
  1202. </FormItem>
  1203. <FormItem className="half-item"
  1204. {...formItemLayout}
  1205. label="最新联系人:" >
  1206. {getFieldDecorator('contactsOptionWoman', {
  1207. initialValue:contactsOptionWoman
  1208. })(
  1209. <Select placeholder="" style={{width:'140px'}} id={"newselect"}>
  1210. {
  1211. contactsOptionWoman.map(function (item) {
  1212. return <Select.Option key={item.value} style={{width:'140px'}}>{item.key}</Select.Option>
  1213. })
  1214. }
  1215. </Select>
  1216. )}
  1217. <span style={{width:'120px',display:'inline-block',marginLeft:'20px'}}>{getcustomerTyp(theData.customerTyp)}
  1218. <Button type="primary" onClick={() => this.setModal2Visible(true)}>添加</Button>
  1219. </span>
  1220. <Modal
  1221. footer=''
  1222. width='800px'
  1223. title="添加详情"
  1224. visible={this.state.modal2Visible}
  1225. onOk={() => this.setModal2Visible(false)}
  1226. onCancel={() => this.setModal2Visible(false)}
  1227. >
  1228. <Form horizontal onSubmit={this.submitcontact} id="demand-form">
  1229. <Spin spinning={this.state.loading}>
  1230. <Row>
  1231. <FormItem className="half-item"
  1232. {...formItemLayout}
  1233. label="所属公司" >
  1234. <span>{theData.id}</span>
  1235. </FormItem>
  1236. </Row>
  1237. <Row>
  1238. <FormItem
  1239. labelCol={{ span: 4 }}
  1240. wrapperCol={{ span: 14 }}
  1241. label="是否是主要联系人:" style={{marginRight:'10px'}}>
  1242. <Radio.Group value={this.state.hots} onChange={(e) => {
  1243. this.setState({ hots: e.target.value })
  1244. }}>
  1245. <Radio value={0}>是</Radio>
  1246. <Radio value={1}>否</Radio>
  1247. </Radio.Group>
  1248. </FormItem>
  1249. <FormItem
  1250. labelCol={{ span: 4 }}
  1251. wrapperCol={{ span: 14 }}
  1252. label="性别:" style={{marginRight:'10px',marginTop: '-15px'}}>
  1253. <Radio.Group value={this.state.hot} onChange={(e) => {
  1254. this.setState({ hot: e.target.value })
  1255. }}>
  1256. <Radio value={0}>男</Radio>
  1257. <Radio value={1}>女</Radio>
  1258. </Radio.Group>
  1259. </FormItem>
  1260. </Row>
  1261. <Row style={{ paddingLeft:'50px' }}>
  1262. <Col span={2}>*姓名:</Col>
  1263. <Col span={8}>
  1264. <Input value={this.state.paymentId} required
  1265. onChange={(e) => { this.setState({ paymentId: e.target.value }) }} />
  1266. </Col>
  1267. <Col span={2} style={{ marginLeft: '50px' }}>QQ号:</Col>
  1268. <Col span={8}>
  1269. <Input value={this.state.entId}
  1270. onChange={(e) => { this.setState({ entId: e.target.value }) }} />
  1271. </Col>
  1272. </Row>
  1273. <Row style={{ marginTop: '20px',paddingLeft:'50px' }}>
  1274. <Col span={2}>*手机号:</Col>
  1275. <Col span={8}>
  1276. <Input value={this.state.pay} required
  1277. onChange={(e) => { this.setState({ pay: e.target.value }) }} />
  1278. </Col>
  1279. <Col span={2} style={{ marginLeft: '50px' }}>座机号:</Col>
  1280. <Col span={8}>
  1281. <Input value={this.state.paym}
  1282. onChange={(e) => { this.setState({ paym: e.target.value }) }} />
  1283. </Col>
  1284. </Row>
  1285. <Row style={{ marginTop: '20px' ,paddingLeft:'50px'}}>
  1286. <Col span={2}>部门:</Col>
  1287. <Col span={8}>
  1288. <Input value={this.state.paytId}
  1289. onChange={(e) => { this.setState({ paytId: e.target.value }) }} />
  1290. </Col>
  1291. <Col span={2} style={{ marginLeft: '50px' }}>职位:</Col>
  1292. <Col span={8}>
  1293. <Input value={this.state.paentId}
  1294. onChange={(e) => { this.setState({ paentId: e.target.value }) }} />
  1295. </Col>
  1296. </Row>
  1297. <Row style={{ marginTop: '20px',paddingLeft:'50px' }}>
  1298. <Col span={2}>微信号:</Col>
  1299. <Col span={8}>
  1300. <Input value={this.state.payId}
  1301. onChange={(e) => { this.setState({ payId: e.target.value }) }} />
  1302. </Col>
  1303. </Row>
  1304. <Row style={{ marginTop: '20px',paddingLeft:'50px' ,marginBottom:'50px'}}>
  1305. <Button className="set-submit" type="primary" htmlType="submit" id="change_keep" style={{marginLeft:'60px'}}>保存</Button>
  1306. <Button className="set-submit" type="ghost" onClick={() => this.setModal2Visible(false)} id='change_rem'>取消</Button>
  1307. </Row>
  1308. </Spin>
  1309. </Form>
  1310. </Modal>
  1311. </FormItem>
  1312. </Row>
  1313. <FormItem className="half-item"
  1314. {...formItemLayout}
  1315. label="最新跟进时间:" >
  1316. <span>{theData.createTime}</span>
  1317. </FormItem>
  1318. <FormItem className="half-item"
  1319. {...formItemLayout}
  1320. label="联系方式" >
  1321. {getFieldDecorator('contact', {
  1322. initialValue: getcontact(theData.contact)
  1323. })(
  1324. <Select placeholder="选择方式" style={{width:'100px'}} >
  1325. <Select.Option value="电话">电话</Select.Option>
  1326. <Select.Option value="邮件">邮件</Select.Option>
  1327. <Select.Option value="面谈">面谈</Select.Option>
  1328. <Select.Option value="短信">短信</Select.Option>
  1329. </Select>
  1330. )}
  1331. {getFieldDecorator('contacts', {
  1332. initialValue: getcontact(theData.mobile)
  1333. })(
  1334. <Input style={{width:'180px'}}/>
  1335. )}
  1336. </FormItem>
  1337. <FormItem className="half-item"
  1338. {...formItemLayout}
  1339. label="客户状态:" >
  1340. <span>{getcustomerStatue(theData.customerStatus)}</span>
  1341. </FormItem>
  1342. <div className="clearfix">
  1343. <FormItem className="half-item"
  1344. {...formItemLayout}
  1345. label="更新当前客户状态" >
  1346. {getFieldDecorator('customerStatue', {
  1347. initialValue: getcustomerStatue(theData.customerStatus)
  1348. })(
  1349. <Select placeholder="选择客户状态" style={{width:'200px'}}>
  1350. {
  1351. customerStatus.map(function (item) {
  1352. return <Select.Option key={item.value} style={{width:'200px'}}>{item.key}</Select.Option>
  1353. })
  1354. }
  1355. </Select>
  1356. )}
  1357. </FormItem>
  1358. </div>
  1359. <FormItem className="half-item"
  1360. {...formItemLayout}
  1361. label="最新跟进状态" >
  1362. {getFieldDecorator('fllowSituation', {
  1363. initialValue: getfllowSituation(theData.followSituation)
  1364. })(
  1365. <Select placeholder="选择跟进状态" style={{width:'200px'}}>
  1366. {
  1367. newFollow.map(function (item) {
  1368. return <Select.Option key={item.value} style={{width:'200px'}}>{item.key}</Select.Option>
  1369. })
  1370. }
  1371. </Select>
  1372. )}
  1373. </FormItem>
  1374. <div className="clearfix">
  1375. <FormItem
  1376. labelCol={{ span: 4 }}
  1377. wrapperCol={{ span: 18 }}
  1378. label="跟进结果" >
  1379. {getFieldDecorator('remarks', {
  1380. initialValue: ""
  1381. })(
  1382. <Input type="textarea" rows={4} />
  1383. )}
  1384. </FormItem>
  1385. </div>
  1386. <div className="clearfix">
  1387. <FormItem
  1388. labelCol={{ span: 4 }}
  1389. wrapperCol={{ span: 18 }}
  1390. label="技术图片" >
  1391. <PicturesWall
  1392. pictureSign="achievement_technical_picture"
  1393. fileList={this.getTechnicalPictureUrl}
  1394. pictureUrl={this.state.technicalPictureUrl} />
  1395. <p>图片建议:图片要清晰。</p>
  1396. </FormItem>
  1397. </div>
  1398. <Button style={{ marginRight: '20px' ,marginLeft:'160px',marginBottom:'50px'}} type="primary" onClick={this.handleSubmit}>保存</Button>
  1399. <Button className="set-submit" type="ghost" onClick={() => this.setModal1Visible(false)} id='change_rem'>取消</Button>
  1400. </div>
  1401. </Spin>
  1402. </Form >
  1403. </Modal>
  1404. </div>
  1405. )
  1406. }
  1407. },
  1408. {
  1409. title: '跟单人',
  1410. dataIndex: 'adminName',
  1411. key: 'adminName',
  1412. },
  1413. {
  1414. title: '时间',
  1415. dataIndex: 'followDate',
  1416. key: 'followDate',
  1417. }
  1418. ],
  1419. dataSource: [],
  1420. searchTime: [,]
  1421. };
  1422. },
  1423. componentWillMount() {
  1424. let theArr = [];
  1425. customerStatus.map(function (item) {
  1426. theArr.push(
  1427. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  1428. )
  1429. });
  1430. let auditArr = [];
  1431. cityArr.map(function (item) {
  1432. auditArr.push(
  1433. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  1434. )
  1435. });
  1436. let intentionalArr = [];
  1437. intentionalService.map(function (item) {
  1438. intentionalArr.push(
  1439. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  1440. )
  1441. });
  1442. let newArr = [];
  1443. newFollow.map(function (item) {
  1444. newArr.push(
  1445. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  1446. )
  1447. });
  1448. this.state.customerStatuarr = theArr;
  1449. this.state.auditStatusOption = auditArr;
  1450. this.state.intentionalOption = intentionalArr;
  1451. this.state.newOption = newArr;
  1452. if (window.location.search) {
  1453. let theObj = getSearchUrl(window.location.search);
  1454. if (theObj.rid) {
  1455. theObj.id = theObj.rid;
  1456. if (theObj.rid != 'null') {
  1457. this.tableRowClick(theObj);
  1458. };
  1459. };
  1460. };
  1461. this.loadData();
  1462. },
  1463. tableRowClick(record, index) {
  1464. this.state.RowData = record;
  1465. this.setState({
  1466. showDesc: true
  1467. });
  1468. },
  1469. //删除功能
  1470. delectRow() {
  1471. let deletedIds;
  1472. let adminName;
  1473. let customerStatus;
  1474. let companyIntention;
  1475. let followSituation;
  1476. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  1477. let rowItem = this.state.selectedRows[idx];
  1478. if (rowItem.id) {
  1479. deletedIds=rowItem.id;
  1480. adminName=rowItem.adminName;
  1481. customerStatus=rowItem.customerStatus;
  1482. companyIntention=rowItem.companyIntention;
  1483. followSituation=rowItem.followSituation;
  1484. };
  1485. };
  1486. this.state.data = []
  1487. this.setState({
  1488. selectedRowKeys: [],
  1489. loading: deletedIds.length > 0
  1490. });
  1491. $.ajax({
  1492. method: "post",
  1493. dataType: "json",
  1494. crossDomain: false,
  1495. url: globalConfig.context + "/api/admin/customer/deleteCustomer",
  1496. data: {
  1497. id: deletedIds,//删除的ID
  1498. beforeCustomerStatus:customerStatus,
  1499. beforeCompanyIntention:companyIntention,
  1500. beforeFollowSituation:followSituation,
  1501. adminName:adminName
  1502. }
  1503. }).done(function (data) {
  1504. if (!data.error.length) {
  1505. message.success('删除成功!');
  1506. this.setState({
  1507. loading: false,
  1508. });
  1509. } else {
  1510. message.warning(data.error[0].message);
  1511. };
  1512. this.loadData();
  1513. }.bind(this));
  1514. },
  1515. //转为公共客户功能
  1516. changeRow() {
  1517. let deletedIds;
  1518. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  1519. let rowItem = this.state.selectedRows[idx];
  1520. if (rowItem.id) {
  1521. deletedIds=rowItem.id
  1522. };
  1523. };
  1524. this.setState({
  1525. selectedRowKeys: [],
  1526. loading: deletedIds.length > 0
  1527. });
  1528. $.ajax({
  1529. method: "GET",
  1530. dataType: "json",
  1531. crossDomain: false,
  1532. url: globalConfig.context + "/api/admin/customer/deleteCustomer", //等待接口
  1533. data: {
  1534. id: deletedIds
  1535. }
  1536. }).done(function (data) {
  1537. if (!data.data.error.length) {
  1538. message.success('已转为公共客户!');
  1539. this.setState({
  1540. loading: false,
  1541. });
  1542. } else {
  1543. message.warning(data.error[0].message);
  1544. };
  1545. this.loadData();
  1546. }.bind(this));
  1547. },
  1548. addClick() {
  1549. this.state.RowData = {};
  1550. this.setState({
  1551. showDesc: true
  1552. });
  1553. },
  1554. closeDesc(e, s) {
  1555. this.state.showDesc = e;
  1556. if (s) {
  1557. this.loadData();
  1558. };
  1559. },
  1560. search() {
  1561. this.loadData();
  1562. },
  1563. reset() {
  1564. this.state.id = undefined;
  1565. this.state.customerName = undefined;
  1566. this.state.shareTyp = undefined;
  1567. this.state.province = undefined;
  1568. this.state.ownerType = undefined;
  1569. this.state.customerStatus = undefined;
  1570. this.state.auditStatus = undefined;
  1571. this.state.adminName = undefined;
  1572. this.state.contactName = undefined;
  1573. this.state.releaseDate = [];
  1574. this.loadData();
  1575. },
  1576. searchSwitch() {
  1577. this.setState({
  1578. searchMore: !this.state.searchMore
  1579. });
  1580. },
  1581. render() {
  1582. const FormItem = Form.Item
  1583. const rowSelection = {
  1584. selectedRowKeys: this.state.selectedRowKeys,
  1585. onChange: (selectedRowKeys, selectedRows) => {
  1586. this.setState({
  1587. selectedRows: selectedRows.slice(-1),
  1588. selectedRowKeys: selectedRowKeys.slice(-1)
  1589. });
  1590. }
  1591. };
  1592. const hasSelected = this.state.selectedRowKeys.length > 0;
  1593. const { RangePicker } = DatePicker;
  1594. const theData = this.props.data || {};
  1595. const { getFieldDecorator } = this.props.form;
  1596. const formItemLayout = {
  1597. labelCol: { span: 8 },
  1598. wrapperCol: { span: 14 },
  1599. };
  1600. return (
  1601. <div className="user-content" >
  1602. <div className="content-title">
  1603. <span>客户管理</span>
  1604. <div className="patent-addNew clearfix">
  1605. <Upload
  1606. action={globalConfig.context + "/api/admin/achievement/uploadTemplate"}
  1607. data={{ 'sign': 'achievement_template' }}
  1608. beforeUpload={beforeUploadFile}
  1609. showUploadList={false}
  1610. onChange={(info) => {
  1611. if (info.file.status !== 'uploading') {
  1612. console.log(info.file, info.fileList);
  1613. }
  1614. if (info.file.status === 'done') {
  1615. if (!info.file.response.error.length) {
  1616. message.success(`${info.file.name} 文件上传成功!`);
  1617. } else {
  1618. message.warning(info.file.response.error[0].message);
  1619. return;
  1620. };
  1621. } else if (info.file.status === 'error') {
  1622. message.error(`${info.file.name} 文件上传失败。`);
  1623. };
  1624. }} >
  1625. <Button>上传批量导入模板</Button>
  1626. </Upload>
  1627. <Button onClick={() => { window.open(globalConfig.context + '/api/admin/achievement/downloadTemplate?sign=achievement_template') }}>下载批量导入模板</Button>
  1628. <Button type="primary" className="addButton" onClick={this.addClick}>新建客户<Icon type="plus" /></Button>
  1629. <BatchImport closeDesc={this.closeDesc} />
  1630. </div>
  1631. </div>
  1632. <div className="user-search">
  1633. <Input placeholder="公司名称"
  1634. value={this.state.customerName}
  1635. onChange={(e) => { this.setState({ customerName: e.target.value }); }} />
  1636. <Select placeholder="客户类型" style={{ width: 120 }}
  1637. value={this.state.shareTyp }
  1638. onChange={(e) => { this.setState({ shareTyp : e }) }}>
  1639. <Select.Option value="0" >个人客户</Select.Option>
  1640. <Select.Option value="1" >公司客户</Select.Option>
  1641. </Select>
  1642. <Select placeholder="意向服务"
  1643. style={{ width: 160 }}
  1644. value={this.state.companyIntention}
  1645. onChange={(e) => { this.setState({ companyIntention: e }) }}>
  1646. {this.state.intentionalOption}
  1647. </Select>
  1648. <Select placeholder="跟进进度"
  1649. style={{ width: 160 }}
  1650. value={this.state.followSituation}
  1651. onChange={(e) => { this.setState({ followSituation: e }) }}>
  1652. {this.state.newOption}
  1653. </Select>
  1654. <Select placeholder="地区"
  1655. style={{ width: 160 }}
  1656. value={this.state.province}
  1657. onChange={(e) => { this.setState({ province: e }) }}>
  1658. {this.state.auditStatusOption}
  1659. </Select>
  1660. <Select placeholder="客户状态" style={{ width: 120 }}
  1661. value={this.state.customerStatus}
  1662. onChange={(e) => { this.setState({ customerStatus: e }) }}>
  1663. {this.state.customerStatuarr}
  1664. </Select>
  1665. <Button type="primary" onClick={this.search}>搜索</Button>
  1666. <Button onClick={this.reset}>重置</Button>
  1667. <Button style={{ background: "#ea0862", border: "none", color: "#fff" }}
  1668. disabled={!hasSelected}
  1669. onClick={this.delectRow}>删除<Icon type="minus" /></Button>
  1670. <Button type="primary" onClick={this.showModa} disabled={!hasSelected}>指定转交人<Icon type="plus" /></Button>
  1671. <Modal
  1672. footer=''
  1673. title="选择指定人"
  1674. visible={this.state.visible}
  1675. onOk={this.handleOk}
  1676. onCancel={this.handleCancel}
  1677. >
  1678. <Spin spinning={this.state.loading}>
  1679. <Table
  1680. columns={this.state.columnsman}
  1681. rowSelection={rowSelection}
  1682. dataSource={this.state.dataman}
  1683. pagination={this.state.pagination} />
  1684. <FormItem wrapperCol={{ span: 12, offset: 12 }}>
  1685. <Button className="set-submit" type="primary" htmlType="submit" id="change_keep" style={{marginLeft:"50px"}} onClick={this.changeAssigner }>保存</Button>
  1686. <Button className="set-submit" type="ghost" onClick={this.handleCancel } style={{marginLeft:"30px"}} id='change_rem'>取消</Button>
  1687. </FormItem>
  1688. </Spin>
  1689. </Modal>
  1690. <Button style={{ background: "#3fcf9e", border: "none", color: "#fff" }}
  1691. disabled={!hasSelected}
  1692. onClick={this.changeRow}>转为公共客户<Icon /></Button>
  1693. <span>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
  1694. <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
  1695. <Input placeholder="跟单人" style={{width:'140px',marginRight:'10px'}}
  1696. value={this.state.adminName}
  1697. onChange={(e) => { this.setState({ adminName: e.target.value }); }} />
  1698. <Input placeholder="联系人姓名" style={{width:'140px',marginRight:'10px'}}
  1699. value={this.state.contactName}
  1700. onChange={(e) => { this.setState({ contactName: e.target.value }); }} />
  1701. <span>发布时间 :</span>
  1702. <RangePicker
  1703. value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
  1704. this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
  1705. onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />
  1706. </div>
  1707. </div>
  1708. <div className="patent-table">
  1709. <Spin spinning={this.state.loading}>
  1710. <Table columns={this.state.columns}
  1711. dataSource={this.state.dataSource}
  1712. rowSelection={rowSelection}
  1713. pagination={this.state.pagination}
  1714. />
  1715. </Spin>
  1716. </div>
  1717. <TechAchievementDesc
  1718. data={this.state.RowData}
  1719. detailApiUrl={this.props['data-detailApiUrl']}
  1720. achievementCategoryOption={this.state.achievementCategoryOption}
  1721. showDesc={this.state.showDesc}
  1722. closeDesc={this.closeDesc} />
  1723. </div >
  1724. );
  1725. }
  1726. }));
  1727. export default AchievementList;