myBusiness.jsx 67 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585158615871588158915901591159215931594159515961597159815991600160116021603160416051606160716081609161016111612161316141615161616171618161916201621162216231624162516261627162816291630163116321633163416351636163716381639164016411642164316441645164616471648164916501651165216531654
  1. import React from 'react';
  2. import { Radio,Icon, Popconfirm,Button, AutoComplete ,Input,Select,Spin,Table, Switch, message, DatePicker, Modal,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. const Option = AutoComplete.Option;
  7. const OptGroup = AutoComplete.OptGroup;
  8. import './myClient.less';
  9. const { Column, ColumnGroup } = Table;
  10. import {socialAttribute,newFollow,lvl, customerStatus,intentionalService} from '../../../dataDic.js';
  11. import {getcustomerStatue,getprovince,getCompanyIntention,getfllowSituation,getContactType } from '../../../tools.js';
  12. const MyBusiness = Form.create()(React.createClass({
  13. loadData(pageNo, apiUrl) {
  14. this.state.data = [];
  15. this.setState({
  16. loading: true
  17. });
  18. $.ajax({
  19. method: "post",
  20. dataType: "json",
  21. crossDomain: false,
  22. url:globalConfig.context + '/api/admin/customer/listBusiness',
  23. data: {
  24. pageNo: pageNo || 1,
  25. pageSize: this.state.pagination.pageSize,
  26. businessGlossoryId: this.state.businessIdS, //业务意向
  27. identifyName:this.state.identifyNameS,
  28. followSituation:this.state.followSituationS,
  29. customerStatus:this.state.customerStatusS,
  30. adminName: this.state.adminNameS,
  31. startDate: this.state.releaseDate[0],
  32. endDate: this.state.releaseDate[1],
  33. },
  34. success: function (data) {
  35. let theArr = [];
  36. if (data.error.length || data.data.list=="") {
  37. if (data.error && data.error.length) {
  38. message.warning(data.error[0].message);
  39. };
  40. } else {
  41. for (let i = 0; i < data.data.list.length; i++) {
  42. let thisdata = data.data.list[i];
  43. theArr.push({
  44. key: i,
  45. id: thisdata.id,
  46. businessId:thisdata.businessId,
  47. businessName:thisdata.businessName,
  48. identifyName:thisdata.identifyName,
  49. followSituation:thisdata.followSituation,
  50. customerStatus:thisdata.customerStatus,
  51. customerStatust:thisdata.customerStatus,
  52. adminName:thisdata.adminName,
  53. createTime:thisdata.createTime,
  54. updateTime:thisdata.updateTime,
  55. });
  56. };
  57. this.state.pagination.current = data.data.pageNo;
  58. this.state.pagination.total = data.data.totalCount;
  59. };
  60. if(!data.data.list.length){
  61. this.state.pagination.current=0;
  62. this.state.pagination.total=0;
  63. }
  64. this.setState({
  65. dataSource: theArr,
  66. pagination: this.state.pagination,
  67. selectedRowKeys:[]
  68. });
  69. }.bind(this),
  70. }).always(function () {
  71. this.setState({
  72. loading: false
  73. });
  74. }.bind(this));
  75. },
  76. //点击出现函数
  77. setModal2VisibleOk(e) {
  78. this.setState({
  79. modal2Visible:true
  80. });
  81. },
  82. //点击消失函数
  83. setModal2Visiblecancel(e) {
  84. this.setState({
  85. modal2Visible:false
  86. });
  87. },
  88. getPictureUrl(e) {
  89. this.setState({pictureUrl: e });
  90. },
  91. handleOk(e){
  92. this.setState({
  93. visible: false,
  94. });
  95. },
  96. handleCancel(e){
  97. this.setState({
  98. visible: false,
  99. });
  100. },
  101. getInitialState() {
  102. return {
  103. dataSources:[],
  104. customerName:[],
  105. orgCodeUrl:[],
  106. companyLogoUrl:[],
  107. visible: false ,
  108. searchMore: true,
  109. releaseDate: [],
  110. releaseDate: [],
  111. selectedRowKeys: [],
  112. selectedRowKey: [],
  113. selectedRows: [],
  114. loading: false,
  115. pagination: {
  116. defaultCurrent: 1,
  117. defaultPageSize: 10,
  118. showQuickJumper: true,
  119. pageSize: 10,
  120. onChange: function (page) {
  121. this.loadData(page);
  122. }.bind(this),
  123. showTotal: function (total) {
  124. return '共' + total + '条数据';
  125. }
  126. },
  127. paginations: {
  128. defaultCurrent: 1,
  129. defaultPageSize: 10,
  130. showQuickJumper: true,
  131. pageSize: 10,
  132. onChange: function (page) {
  133. this.loadVisit(page);
  134. }.bind(this),
  135. showTotal: function (total) {
  136. return '共' + total + '条数据';
  137. }
  138. },
  139. businessFollowList: [
  140. {
  141. title: '跟进时间',
  142. dataIndex: 'followTime',
  143. key: 'followTime',
  144. }, {
  145. title: '营销员',
  146. dataIndex: 'adminName',
  147. key: 'adminName',
  148. }, {
  149. title: '意向进度',
  150. dataIndex: 'followSituation',
  151. key: 'followSituation',
  152. render:text=>{return getfllowSituation(text)}
  153. }, {
  154. title: '客户状态',
  155. dataIndex: 'customerStatus',
  156. key: 'customerStatus',
  157. render:text=>{return getcustomerStatue(text)}
  158. },
  159. {
  160. title: '拜访方式',
  161. dataIndex: 'contactType',
  162. key:'contactType',
  163. render:text=>{return getContactType(text)}
  164. }, {
  165. title: '联系人',
  166. dataIndex: 'contacts',
  167. key: 'contacts',
  168. },
  169. {
  170. title: '联系电话',
  171. dataIndex: 'contactMobile',
  172. key:'contactMobile',
  173. },
  174. {
  175. title: '操作',
  176. dataIndex: 'ccc',
  177. key:'ccc',
  178. render: (text, record, index) => {
  179. return <div>
  180. <Popconfirm title="是否删除?" onConfirm={(e)=>{this.intentionDelet(record)}} okText="删除" cancelText="不删除">
  181. <Button style={{marginRight:'10px',color:'#ffffff',background:'#f00',border:'none'}} onClick={(e)=>{e.stopPropagation()}}>删除</Button>
  182. </Popconfirm>
  183. </div>
  184. }
  185. }
  186. ],
  187. columns: [
  188. {
  189. title: '业务名称',
  190. dataIndex: 'businessName',
  191. key: 'businessName',
  192. }, {
  193. title: '意向时间',
  194. dataIndex: 'createTime',
  195. key: 'createTime',
  196. }, {
  197. title: '更新时间',
  198. dataIndex: 'updateTime',
  199. key: 'updateTime',
  200. }, {
  201. title: '客户名称',
  202. dataIndex: 'identifyName',
  203. key: 'identifyName',
  204. }, {
  205. title: '营销员',
  206. dataIndex: 'adminName',
  207. key: 'adminName',
  208. },
  209. {
  210. title: '意向进度',
  211. dataIndex: 'followSituation',
  212. key:'followSituation',
  213. render: text => { return getfllowSituation(text) }
  214. },
  215. {
  216. title: '客户状态',
  217. dataIndex: 'customerStatus',
  218. key: 'customerStatus',
  219. render: text => { return getcustomerStatue(text) }
  220. },
  221. {
  222. title: '操作',
  223. dataIndex: 'abc',
  224. key: 'abc',
  225. render: (text, record, index) => {
  226. return <div>
  227. <Button onClick={(e) =>{ e.stopPropagation(), this.addModify(record); }} type="primary" style={{marginRight:'10px',}} disabled={record.customerStatust=='6'?true:false}>跟进</Button>
  228. <Popconfirm title="是否停止?" onConfirm={(e)=>{this.followStop(record)}} okText="停止" cancelText="不停止">
  229. <Button type="primary" style={{marginRight:'10px'}} onClick={(e) =>{ e.stopPropagation()}} disabled={record.customerStatust=='6'?true:false}>停止</Button>
  230. </Popconfirm>
  231. </div>
  232. }
  233. }
  234. ],
  235. dataSource: [],
  236. searchTime: [,]
  237. };
  238. },
  239. //删除跟进记录
  240. intentionDelet(uids){
  241. this.setState({
  242. loading:true
  243. });
  244. $.ajax({
  245. method: "get",
  246. dataType: "json",
  247. crossDomain: false,
  248. url: globalConfig.context + "/api/admin/customer/deleteFollowOneBusiness",
  249. data: {
  250. ufbId: uids.ufbId,//删除的ID
  251. }
  252. }).done(function (data) {
  253. if (!data.error.length) {
  254. message.success('删除成功!');
  255. this.setState({
  256. loading: false,
  257. });
  258. } else {
  259. message.warning(data.error[0].message);
  260. };
  261. this.loadVisit();
  262. this.loadData();
  263. }.bind(this));
  264. },
  265. //更多操作
  266. ModalOperation(){
  267. this.setState({
  268. visible: true,
  269. });
  270. },
  271. //列表删除功能
  272. delectRow() {
  273. let deletedIds;
  274. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  275. let rowItem = this.state.selectedRows[idx];
  276. if (rowItem.businessId) {
  277. deletedIds=rowItem.businessId;
  278. };
  279. };
  280. this.setState({
  281. selectedRowKeys: [],
  282. });
  283. $.ajax({
  284. method: "get",
  285. dataType: "json",
  286. crossDomain: false,
  287. url: globalConfig.context + "/api/admin/customer/deleteBusiness",
  288. data: {
  289. businessId: deletedIds,//删除的ID
  290. }
  291. }).done(function (data) {
  292. if (!data.error.length) {
  293. message.success('删除成功!');
  294. this.setState({
  295. loading: false,
  296. });
  297. } else {
  298. message.warning(data.error[0].message);
  299. };
  300. this.loadData();
  301. }.bind(this));
  302. },
  303. //停止跟进
  304. followStop(uids) {
  305. this.setState({
  306. loading:true
  307. });
  308. $.ajax({
  309. method: "get",
  310. dataType: "json",
  311. crossDomain: false,
  312. url: globalConfig.context + "/api/admin/customer/stopBusiness",
  313. data: {
  314. businessId: uids.businessId,//删除的ID
  315. }
  316. }).done(function (data) {
  317. if (!data.error.length) {
  318. message.success('成功停止跟进!');
  319. this.setState({
  320. loading: false,
  321. });
  322. } else {
  323. message.warning(data.error[0].message);
  324. };
  325. this.loadData();
  326. }.bind(this));
  327. },
  328. getOrgCodeUrl(e) {
  329. this.setState({ orgCodeUrl: e });
  330. },
  331. getCompanyLogoUrl(e) {
  332. this.setState({ companyLogoUrl: e });
  333. },
  334. componentWillMount() {
  335. //意向服务
  336. let intentionalArr = [];
  337. newFollow.map(function (item) {
  338. intentionalArr.push(
  339. <Select.Option value={item.value} key={item.key}>{item.key}</Select.Option>
  340. )
  341. });
  342. this.state.intentionalOption = intentionalArr;
  343. this.loadData();
  344. },
  345. //新建
  346. addClick() {
  347. this.state.businessGlossoryId=undefined;
  348. this.state.followSituation='0';
  349. this.state.customerStatus='0';
  350. this.state.contactType=undefined;
  351. this.state.superior='';
  352. this.state.remarks='';
  353. this.state.result='';
  354. this.state.keys=false;
  355. this.state.lastName=undefined;
  356. this.addTime();
  357. this.setState({
  358. showDesc: true,
  359. });
  360. },
  361. addClickOk(){
  362. this.setState({
  363. businessId:'',
  364. showDesc: false,
  365. });
  366. },
  367. addClickCancel(){
  368. this.setState({
  369. businessId:'',
  370. showDesc: false,
  371. });
  372. },
  373. search() {
  374. this.loadData();
  375. },
  376. reset() {
  377. this.state.businessIdS=undefined; //名称1
  378. this.state.identifyNameS='';
  379. this.state.followSituationS=undefined;
  380. this.state.customerStatusS=undefined;
  381. this.state.adminNameS='';
  382. this.state.releaseDate[0]=undefined;
  383. this.state.releaseDate[1]=undefined;
  384. this.loadData();
  385. },
  386. searchSwitch() {
  387. this.setState({
  388. searchMore: !this.state.searchMore
  389. });
  390. },
  391. //详情保存函数
  392. detailsSubmint(){
  393. this.setState({
  394. modal5Visible:false,
  395. })
  396. },
  397. //基本信息提交
  398. newSubmit(e){
  399. e.preventDefault();
  400. this.setState({
  401. selectedRowKeys: [],
  402. });
  403. this.props.form.validateFields((err, values) => {
  404. if (!err) {
  405. this.setState({
  406. loading: true
  407. });
  408. $.ajax({
  409. method: "post",
  410. dataType: "json",
  411. url:globalConfig.context + '/api/admin/customer/updateBusiness',
  412. data: {
  413. businessId:this.state.rowId,
  414. followSituation:this.state.followSituation,
  415. customerStatus:this.state.customerStatus,
  416. remarks:this.state.remarks,
  417. }
  418. }).done(function (data) {
  419. this.setState({
  420. loading: false
  421. });
  422. if (!data.error.length) {
  423. message.success('保存成功!');
  424. this.detailsModal() ;
  425. this.loadData();
  426. } else {
  427. message.warning(data.error[0].message);
  428. }
  429. ;
  430. }.bind(this));
  431. }
  432. })
  433. },
  434. //查看基本详情基本信息
  435. loadInformation(record){
  436. $.ajax({
  437. method: "get",
  438. dataType: "json",
  439. crossDomain: false,
  440. url: globalConfig.context + '/api/admin/customer/toUpdateBusiness',
  441. data: {
  442. businessId: record
  443. },
  444. success: function (data) {
  445. let thisData = data.data;
  446. if (!thisData) {
  447. if (data.error && data.error.length) {
  448. message.warning(data.error[0].message);
  449. };
  450. thisData = {};
  451. };
  452. this.setState({
  453. uids:thisData.uid,
  454. dataInformation:thisData,
  455. followSituation:thisData.followSituation,
  456. businessGlossoryId:thisData.businessGlossoryId,
  457. customerStatus:thisData.customerStatus,
  458. remarks:thisData.remarks,
  459. });
  460. }.bind(this),
  461. }).always(function () {
  462. this.loadVisit();
  463. this.setState({
  464. loading: false
  465. });
  466. }.bind(this));
  467. },
  468. detailsModalOk(e) {
  469. this.setState({ modal5Visible:true });//需要一个请求数据
  470. this.loadInformation(e.businessId)
  471. },
  472. //点击消失函数
  473. detailsModal(e) {
  474. this.setState({
  475. modal5Visible:false
  476. });
  477. },
  478. //拜访保存函数
  479. visitSubmit(){
  480. this.setState({
  481. visitModul:false,
  482. })
  483. },
  484. //新增联系人
  485. addcontactModulOK(){
  486. this.setState({
  487. addcontactModul:false
  488. });
  489. },
  490. addcontactModulcancel(){
  491. this.setState({
  492. addcontactModul:false
  493. });
  494. },
  495. businessFollowOk(){
  496. this.setState({
  497. businessFollowModul:false
  498. });
  499. },
  500. businessFollowCancel(){
  501. this.setState({
  502. businessFollowModul:false
  503. });
  504. },
  505. //点击新增详情
  506. newContacts(){
  507. if(this.state.uids||this.state.khId){
  508. this.state.newsex =undefined;
  509. this.state.newname ='';
  510. this.state.newmobile='';
  511. this.state.newwechat='';
  512. this.state.newqq='';
  513. this.state.newdepatrment='';
  514. this.state.newposition='';
  515. this.state.newemail='';
  516. this.setState({
  517. uids:this.state.uids?this.state.uids:this.state.khId,
  518. addcontactModul:true
  519. });
  520. }else{
  521. message.warning('请输入客户名称')
  522. }
  523. },
  524. //新增联系人保存函数
  525. submitcontactman(e){
  526. e.preventDefault();
  527. this.setState({
  528. loading:true
  529. })
  530. $.ajax({
  531. method: "post",
  532. dataType: "json",
  533. crossDomain: false,
  534. url: globalConfig.context + "/api/admin/customer/addOneContact",
  535. data:{
  536. uid:this.state.uids,
  537. name:this.state.newname,
  538. mobile:this.state.newmobile,
  539. email:this.state.newemail,
  540. wechat:this.state.newwechat,
  541. depatrment:this.state.newdepatrment,
  542. position:this.state.newposition,
  543. sex:this.state.newsex,
  544. qq:this.state.newqq
  545. },
  546. success: function (data) {
  547. if (!data.error.length) {
  548. this.addcontactModulOK()
  549. this.getNewWoman(this.state.uids)
  550. this.setState({
  551. loading: false,
  552. })
  553. } else {
  554. message.warning(data.error[0].message);
  555. };
  556. }.bind(this)
  557. });
  558. },
  559. //跟进
  560. addModify(e) {
  561. this.addTime();
  562. this.HttpFollowUp(e.businessId);
  563. this.state.keys=true;
  564. this.setState({
  565. showDesc: true,
  566. });
  567. },
  568. //当选择联系人的列表变化时,则执行
  569. hundleName(e){
  570. let changNub=this.state.telNum[e];
  571. this.setState({
  572. nub:this.state.telNum[e],
  573. lastName: e,
  574. });
  575. },
  576. //新建保存
  577. addSubmit(e){
  578. e.preventDefault();
  579. if(this.state.businessGlossoryId==undefined){
  580. message.warning('请选择业务意向')
  581. return false;
  582. }
  583. if(!this.state.businessId){
  584. if(!this.state.theTypes){
  585. message.warning('客户名为空或不存在')
  586. return false;
  587. }
  588. }
  589. if(this.state.contactType==undefined){
  590. message.warning('请选择联系方式')
  591. return false;
  592. }
  593. if(this.state.lastName==undefined){
  594. message.warning('请选择联系人')
  595. return false;
  596. }
  597. this.props.form.validateFields((err, values) => {
  598. if (!err) {
  599. this.setState({
  600. loading: true
  601. });
  602. let conts=this.state.lastName;
  603. let contactsId= this.state.contactsIdArr[conts].id;
  604. $.ajax({
  605. method: "post",
  606. dataType: "json",
  607. crossDomain: false,
  608. url:!this.state.keys?globalConfig.context + '/api/admin/customer/addBusinessAndFollow':globalConfig.context + '/api/admin/customer/addFollowOneBusiness ',
  609. data:!this.state.businessId?{
  610. uid:this.state.khId,
  611. businessGlossoryId: this.state.businessGlossoryId,
  612. followSituation:this.state.followSituation,
  613. customerStatus: this.state.customerStatus,
  614. contactType: this.state.contactType,
  615. ocbId: contactsId,
  616. createTime:this.state.createYear+''+this.state.creatMent,
  617. followTime:this.state.followTime,
  618. remarks: this.state.remarks,
  619. result: this.state.result,
  620. }:{
  621. uid:this.state.uids,
  622. businessId:this.state.businessId,
  623. businessGlossoryId: this.state.businessGlossoryId,
  624. followSituation:this.state.followSituation,
  625. customerStatus: this.state.customerStatus,
  626. contactType: this.state.contactType,
  627. ocbId: contactsId,
  628. followTime:this.state.followTime,
  629. remarks: this.state.remarks,
  630. result: this.state.result,
  631. }
  632. }).done(function (data) {
  633. this.setState({
  634. loading: false
  635. });
  636. if (!data.error.length) {
  637. message.success('保存成功!');
  638. this.addClickCancel();
  639. this.loadData();
  640. this.state.businessId='';
  641. } else {
  642. message.warning(data.error[0].message);
  643. }
  644. }.bind(this));
  645. }
  646. });
  647. },
  648. //列表保存
  649. addlistSubmit(e){
  650. e.preventDefault();
  651. this.props.form.validateFields((err, values) => {
  652. if (!err) {
  653. this.setState({
  654. loading: true
  655. });
  656. let conts=this.state.lastName;
  657. let contactsId= conts?this.state.contactsIdArr[conts].id:'';
  658. $.ajax({
  659. method: "post",
  660. dataType: "json",
  661. crossDomain: false,
  662. url:globalConfig.context + '/api/admin/customer/updateFollowOneBusiness',
  663. data:{
  664. ufbId:this.state.ufbIds,
  665. followId:this.state.followId,
  666. customerStatus: this.state.customerStatusV,
  667. followSituation:this.state.followSituationV,
  668. contactType: this.state.contactTypeV,
  669. ocbId:contactsId,
  670. remarks: this.state.remarksV,
  671. result: this.state.resultV,
  672. }
  673. }).done(function (data) {
  674. this.setState({
  675. loading: false
  676. });
  677. if (!data.error.length) {
  678. message.success('保存成功!');
  679. this.businessFollowCancel();
  680. this.loadVisit()
  681. } else {
  682. message.warning(data.error[0].message);
  683. }
  684. }.bind(this));
  685. }
  686. });
  687. },
  688. //进入修改时
  689. listFollowUp(e){
  690. $.ajax({
  691. method: "get",
  692. dataType: "json",
  693. crossDomain: false,
  694. url: globalConfig.context + "/api/admin/customer/toUpdateFollowOneBusiness",
  695. data:{
  696. ufbId:e.ufbId
  697. },
  698. success: function (data) {
  699. let thedata=data.data;
  700. if (!thedata) {
  701. if (data.error && data.error.length) {
  702. message.warning(data.error[0].message);
  703. };
  704. thedata = {};
  705. };
  706. this.setState({
  707. businessGlossoryId:thedata.businessGlossoryId,
  708. followSituationV:thedata.followSituation,
  709. customerStatusV:thedata.customerStatus,
  710. followTime:thedata.followTime,
  711. createTime:thedata.createTime,
  712. identifyName:thedata.identifyName,
  713. contactTypeV:parseInt(thedata.contactType),
  714. resultV:thedata.result,
  715. remarksV:thedata.remarks,
  716. adminName:thedata.adminName,
  717. contacts:thedata.contacts,
  718. contactMobile:thedata.contactMobile,
  719. ufbId:thedata.ufbId,
  720. followId:thedata.followId,
  721. });
  722. }.bind(this),
  723. }).always(function () {
  724. this.getNewWoman(this.state.uids)
  725. this.setState({
  726. ufbIds:e.ufbId,
  727. loading: false
  728. });
  729. }.bind(this));
  730. },
  731. //新建HTTP获取数据
  732. addTime(){
  733. $.ajax({
  734. method: "get",
  735. dataType: "json",
  736. crossDomain: false,
  737. url: globalConfig.context + "/api/admin/customer/toAddBusinessAndFollow",
  738. data:{
  739. },
  740. success: function (data) {
  741. let theArr = [];
  742. let thedata=data.data;
  743. if (!thedata) {
  744. if (data.error && data.error.length) {
  745. message.warning(data.error[0].message);
  746. };
  747. thedata = {};
  748. };
  749. let creatMent=thedata.createTime.substr(10,9);
  750. let createYear=thedata.createTime.substr(0,10);
  751. this.setState({
  752. createTime:thedata.createTime,
  753. creatMent:creatMent,
  754. createYear:createYear,
  755. followTime:thedata.followTime,
  756. adminName: thedata.adminName,
  757. });
  758. }.bind(this),
  759. }).always(function () {
  760. this.setState({
  761. loading: false
  762. });
  763. }.bind(this));
  764. },
  765. //客户名称初始加载
  766. customerList(e){
  767. $.ajax({
  768. method: "get",
  769. dataType: "json",
  770. crossDomain: false,
  771. url: globalConfig.context + "/api/admin/customer/findCustomerByName",
  772. data:{
  773. name:e
  774. },
  775. success: function (data) {
  776. let thedata=data.data;
  777. if (!thedata) {
  778. if (data.error && data.error.length) {
  779. message.warning(data.error[0].message);
  780. };
  781. thedata = {};
  782. };
  783. this.setState({
  784. uids:thedata.id,
  785. customerArr:thedata,
  786. });
  787. }.bind(this),
  788. }).always(function () {
  789. this.setState({
  790. loading: false
  791. });
  792. }.bind(this));
  793. },
  794. //值改变时请求客户名称
  795. httpChange(e){
  796. if(e.length>=2){
  797. this.customerList(e);
  798. }
  799. this.setState({
  800. superior:e
  801. })
  802. },
  803. //选择值时值匹配及联系人函数加载
  804. autoChange(e){
  805. let theType='';
  806. let contactLists=this.state.customerArr||[];
  807. if (e) {
  808. contactLists.map(function (item) {
  809. if (item.name == e.toString()) {
  810. theType = item.id;
  811. }
  812. });
  813. }
  814. console.log(theType);
  815. this.setState({
  816. khId:theType
  817. })
  818. this.getNewWoman(theType)
  819. },
  820. //上级主管输入框失去焦点是判断客户是否存在
  821. selectAuto(value,options){
  822. console.log(value);
  823. console.log(options);
  824. let theType='';
  825. let contactLists=this.state.customerArr||[];
  826. if (value) {
  827. contactLists.map(function (item) {
  828. if (item.name == value.toString()) {
  829. theType = item.id;
  830. }
  831. });
  832. }
  833. console.log(theType);
  834. this.setState({
  835. superior:value,
  836. khId:theType
  837. })
  838. this.getNewWoman(theType) ;
  839. },
  840. //客户输入框失去焦点是判断客户是否存在
  841. blurChange(e){
  842. let theType='';
  843. let contactLists=this.state.customerArr||[];
  844. if (e) {
  845. contactLists.map(function (item) {
  846. if (item.name == e.toString()) {
  847. theType = item.id;
  848. }
  849. });
  850. }
  851. console.log(theType);
  852. this.setState({
  853. theTypes:theType
  854. })
  855. },
  856. //点击跟进时数据处理
  857. HttpFollowUp(e){
  858. $.ajax({
  859. method: "get",
  860. dataType: "json",
  861. crossDomain: false,
  862. url: globalConfig.context + "/api/admin/customer/toAddFollowOneBusiness",
  863. data:{
  864. businessId:e
  865. },
  866. success: function (data) {
  867. let thedata=data.data;
  868. if (!thedata) {
  869. if (data.error && data.error.length) {
  870. message.warning(data.error[0].message);
  871. };
  872. thedata = {};
  873. };
  874. this.setState({
  875. uids:thedata.uid,
  876. businessId:thedata.businessId,
  877. businessGlossoryId:thedata.businessGlossoryId,
  878. followSituation:thedata.followSituation,
  879. customerStatus:thedata.customerStatus,
  880. followTime:thedata.followTime,
  881. createTime:thedata.createTime,
  882. identifyName:thedata.identifyName,
  883. contactType:undefined,
  884. result:'',
  885. remarks:'',
  886. });
  887. }.bind(this),
  888. }).always(function () {
  889. this.getNewWoman(this.state.uids)
  890. this.setState({
  891. loading: false
  892. });
  893. }.bind(this));
  894. },
  895. //获取联系人下拉框
  896. getNewWoman(ids) {
  897. this.state.data = []
  898. $.ajax({
  899. method: "get",
  900. dataType: "json",
  901. crossDomain: false,
  902. url: globalConfig.context + "/api/admin/customer/findCustomerContacts",
  903. data:{
  904. uid:ids,
  905. },
  906. success: function (data) {
  907. let theArr = [];
  908. let thedata=data.data;
  909. if (!thedata) {
  910. if (data.error && data.error.length) {
  911. message.warning(data.error[0].message);
  912. };
  913. thedata = {};
  914. };
  915. var telNum=[];
  916. var contactIds=[];
  917. thedata.map(function (item,index) {
  918. telNum.push(thedata[index].mobile);
  919. });
  920. for (let item in data.data) {
  921. let theData = data.data[item];
  922. theArr.push(
  923. <Select.Option value={item} key={theData.name}>{theData.name}</Select.Option>
  924. );
  925. };
  926. this.setState({
  927. contactsIdArr:thedata,
  928. telNum:telNum,
  929. orderStatusOption: theArr,
  930. });
  931. }.bind(this),
  932. }).always(function () {
  933. this.setState({
  934. loading: false
  935. });
  936. }.bind(this));
  937. },
  938. //获取拜访详情ajax
  939. loadVisit(pageNo) {
  940. this.setState({
  941. loading: true
  942. });
  943. $.ajax({
  944. method: "get",
  945. dataType: "json",
  946. crossDomain: false,
  947. url:globalConfig.context + '/api/admin/customer/listFollowHistory',
  948. data: {
  949. pageNo: pageNo || 1,
  950. pageSize: this.state.paginations.pageSize,
  951. uid: this.state.uids, //名称1
  952. businessGlossoryId:this.state.businessGlossoryId,
  953. },
  954. success: function (data) {
  955. let theArr = [];
  956. if (data.error.length || data.data.list=="") {
  957. if (data.error && data.error.length) {
  958. message.warning(data.error[0].message);
  959. };
  960. } else {
  961. for (let i = 0; i < data.data.list.length; i++) {
  962. let thisdata = data.data.list[i];
  963. theArr.push({
  964. followId:thisdata.followId,
  965. followTime:thisdata.followTime,
  966. identifyName:thisdata.identifyName,
  967. contacts:thisdata.contacts,
  968. contactMobile:thisdata.contactMobile,
  969. result:thisdata.result,
  970. ufbId:thisdata.ufbId,
  971. adminName:thisdata.adminName,
  972. followSituation:thisdata.followSituation,
  973. customerStatus:thisdata.customerStatus,
  974. contactType:thisdata.contactType
  975. });
  976. };
  977. this.state.paginations.current = data.data.pageNo;
  978. this.state.paginations.total = data.data.totalCount;
  979. };
  980. this.setState({
  981. visitArrList: theArr,
  982. paginations: this.state.paginations
  983. });
  984. }.bind(this),
  985. }).always(function () {
  986. this.setState({
  987. loading: false
  988. });
  989. }.bind(this));
  990. },
  991. componentWillReceiveProps(nextProps) {
  992. if (!this.props.visible && nextProps.visible) {
  993. if (nextProps.data && nextProps.data.id) {
  994. this.loadData(nextProps.data.id, nextProps.detailApiUrl);
  995. };
  996. this.state.data = {};
  997. this.state.companyLogoUrl = [];
  998. this.state.orgCodeUrl = [];
  999. };
  1000. },
  1001. tableRowClick(record, index) {
  1002. this.state.RowData = record;
  1003. this.detailsModalOk(record);
  1004. this.setState({
  1005. selectedRowKeys:[],
  1006. rowId:record.businessId,
  1007. })
  1008. },
  1009. followRowClick(record, index) {
  1010. this.state.RowData = record;
  1011. this.listFollowUp(record);
  1012. this.setState({
  1013. businessFollowModul: true,
  1014. selectedRowKeys:[],
  1015. });
  1016. },
  1017. render() {
  1018. const FormItem = Form.Item
  1019. const rowSelection = {
  1020. selectedRowKeys: this.state.selectedRowKeys,
  1021. onChange: (selectedRowKeys, selectedRows) => {
  1022. this.setState({
  1023. selectedRows: selectedRows.slice(-1),
  1024. selectedRowKeys: selectedRowKeys.slice(-1)
  1025. });
  1026. },
  1027. onSelect: (recordt, selected, selectedRows) => {
  1028. this.setState({
  1029. recordt:recordt.id
  1030. })
  1031. },
  1032. };
  1033. const rowSelections = {
  1034. selectedRowKeys: this.state.selectedRowKey,
  1035. onChange: (selectedRowKey, selectedRow) => {
  1036. this.setState({
  1037. selectedRow: selectedRow.slice(-1),
  1038. selectedRowKey: selectedRowKey.slice(-1)
  1039. });
  1040. },
  1041. onSelect: (records, selected, selectedRow) => {
  1042. this.setState({
  1043. selectedRow: selectedRow.slice(-1),
  1044. records:records.id,
  1045. })
  1046. },
  1047. };
  1048. const hasSelected = this.state.selectedRowKeys.length > 0;
  1049. const { RangePicker } = DatePicker;
  1050. const { getFieldDecorator } = this.props.form;
  1051. const formItemLayout = {
  1052. labelCol: { span: 8 },
  1053. wrapperCol: { span: 14 },
  1054. };
  1055. const theInformation=this.state.dataInformation || {}
  1056. const contactsOption="";
  1057. const formItemLayput = {
  1058. labelCol: { span: 10 },
  1059. wrapperCol: { span: 14 },
  1060. };
  1061. const businessIds=this.state.businessId||'';
  1062. const dataSources=this.state.customerArr || [];
  1063. const options = dataSources.map((group) =>
  1064. <Option key={group.id} value={group.name}>{group.name}</Option>
  1065. )
  1066. return (
  1067. <div className="user-content" >
  1068. <div className="content-title">
  1069. <span>我的业务</span>
  1070. </div>
  1071. <div className="user-search">
  1072. <Input placeholder="客户名称"
  1073. value={this.state.identifyNameS}
  1074. onChange={(e) => { this.setState({ identifyNameS: e.target.value }); }} />
  1075. <Select placeholder="服务意向" value={this.state.businessIdS} onChange={(e) => {
  1076. this.setState({businessIdS:e})}} style={{width:'150px'}}>
  1077. {
  1078. intentionalService.map(function (item) {
  1079. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1080. })
  1081. }
  1082. </Select>
  1083. <Button type="primary" onClick={this.search}>搜索</Button>
  1084. <Button onClick={this.reset}>重置</Button>
  1085. <Popconfirm title="是否删除?" onConfirm={this.delectRow} okText="是" cancelText="否">
  1086. <Button style={{ marginRight:'10px' ,marginLeft:'10px'}} type='danger'
  1087. disabled={!hasSelected}
  1088. >删除<Icon type="minus" />
  1089. </Button>
  1090. </Popconfirm>
  1091. <span style={{marginLeft:'10px',marginRight:'20px'}}>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
  1092. <Button type="primary" className="addButton" onClick={this.addClick}>新增业务<Icon type="plus" /></Button>
  1093. <div className='clearfix' style={{marginTop:'5px'}}>
  1094. <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
  1095. <RangePicker
  1096. value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
  1097. this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
  1098. onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />
  1099. <Select placeholder="客户状态"
  1100. style={{ width: 150 }}
  1101. value={this.state.customerStatusS}
  1102. onChange={(e) => { this.setState({ customerStatusS: e }) }}>
  1103. {
  1104. customerStatus.map(function (item) {
  1105. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1106. })
  1107. }
  1108. </Select>
  1109. <Select placeholder="业务进度"
  1110. style={{ width: 150 }}
  1111. value={this.state.followSituationS}
  1112. onChange={(e) => { this.setState({ followSituationS: e }) }}>
  1113. {this.state.intentionalOption}
  1114. </Select>
  1115. <Input placeholder="营销员" style={{width:'150px'}}
  1116. value={this.state.adminNameS}
  1117. onChange={(e) => { this.setState({ adminNameS: e.target.value }); }} />
  1118. </div>
  1119. </div>
  1120. </div>
  1121. <div className="patent-table">
  1122. <Spin spinning={this.state.loading}>
  1123. <Table columns={this.state.columns}
  1124. dataSource={this.state.dataSource}
  1125. rowSelection={rowSelection}
  1126. pagination={this.state.pagination}
  1127. onRowClick={this.tableRowClick}
  1128. />
  1129. </Spin>
  1130. </div>
  1131. <Modal
  1132. footer=''
  1133. title="我的业务"
  1134. width='1000px'
  1135. visible={this.state.showDesc}
  1136. onOk={this.addClickOk}
  1137. onCancel={this.addClickCancel}
  1138. >
  1139. <Form horizontal id="demand-form" onSubmit={this.addSubmit}>
  1140. <Spin spinning={this.state.loading}>
  1141. <div className="clearfix">
  1142. {businessIds!=''?<div><FormItem className="half-item"
  1143. {...formItemLayout}
  1144. label="意向名称"
  1145. >
  1146. <span>{getCompanyIntention(this.state.businessGlossoryId)}</span>
  1147. </FormItem>
  1148. <FormItem className="half-item"
  1149. {...formItemLayout}
  1150. >
  1151. <Button type="primary" onClick={this.newContacts} style={{marginLeft:'160px'}}>添加新联系人</Button>
  1152. </FormItem>
  1153. <FormItem className="half-item"
  1154. {...formItemLayout}
  1155. label="意向时间"
  1156. >
  1157. <span>{this.state.createTime}</span>
  1158. </FormItem>
  1159. <FormItem className="half-item"
  1160. {...formItemLayout}
  1161. label="客户名称"
  1162. >
  1163. <span>{this.state.identifyName}</span>
  1164. </FormItem></div>
  1165. :<div><FormItem className="half-item"
  1166. {...formItemLayout}
  1167. label="意向名称"
  1168. >
  1169. <Select placeholder="服务意向名称" value={this.state.businessGlossoryId} onChange={(e) => {
  1170. this.setState({businessGlossoryId:e})}} style={{width:'150px'}}>
  1171. {
  1172. intentionalService.map(function (item) {
  1173. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1174. })
  1175. }
  1176. </Select>
  1177. <span style={{color:'red'}}> *</span>
  1178. </FormItem>
  1179. <FormItem className="half-item"
  1180. {...formItemLayout}
  1181. >
  1182. <Button type="primary" onClick={this.newContacts} style={{marginLeft:'160px'}}>添加新联系人</Button>
  1183. </FormItem>
  1184. <div className="clearfix">
  1185. <FormItem className="half-item"
  1186. {...formItemLayout}
  1187. label="意向时间" >
  1188. <DatePicker placeholder="更新日期" value={moment(this.state.createYear,'YYYY-MM-DD')} onChange={(time) => {this.setState({createYear: time});}}/>
  1189. <TimePicker placeholder="更新时间" value={moment(this.state.creatMent, 'HH:mm:ss')} onChange={(time) => { this.setState({creatMent: time}); }}/>
  1190. </FormItem>
  1191. <FormItem className="half-item"
  1192. {...formItemLayout}
  1193. label="客户名称"
  1194. >
  1195. <AutoComplete
  1196. className="certain-category-search"
  1197. dropdownClassName="certain-category-search-dropdown"
  1198. dropdownMatchSelectWidth={false}
  1199. dropdownStyle={{ width: 300 }}
  1200. size="large"
  1201. style={{ width: '200px' }}
  1202. dataSource={options}
  1203. placeholder="输入名称"
  1204. value={this.state.superior}
  1205. onChange={this.httpChange}
  1206. filterOption={true}
  1207. onBlur={this.blurChange}
  1208. onSelect={this.selectAuto}
  1209. filterOption={true}
  1210. >
  1211. <Input/>
  1212. </AutoComplete>
  1213. <span className="mandatory">*</span>
  1214. </FormItem>
  1215. </div>
  1216. </div>
  1217. }
  1218. <FormItem className="half-item"
  1219. {...formItemLayout}
  1220. label="营销员"
  1221. >
  1222. <span>{this.state.adminName}</span>
  1223. </FormItem>
  1224. <FormItem className="half-item"
  1225. {...formItemLayout}
  1226. label="意向进度"
  1227. >
  1228. <Select placeholder="意向进度" value={this.state.followSituation}
  1229. onChange={(e) => { this.setState({ followSituation: e }) }}>
  1230. {
  1231. newFollow.map(function (item) {
  1232. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1233. })
  1234. }
  1235. </Select>
  1236. </FormItem>
  1237. <FormItem className="half-item"
  1238. {...formItemLayout}
  1239. label="客户状态"
  1240. >
  1241. <Select placeholder="客户状态" value={this.state.customerStatus}
  1242. onChange={(e) => { this.setState({ customerStatus: e }) }}>
  1243. {
  1244. customerStatus.map(function (item) {
  1245. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1246. })
  1247. }
  1248. </Select>
  1249. </FormItem>
  1250. <div className="clearfix">
  1251. <FormItem
  1252. labelCol={{ span: 4 }}
  1253. wrapperCol={{ span: 16 }}
  1254. label="意向说明" >
  1255. <Input type="textarea" rows={4} placeholder="意向说明" value={this.state.remarks}
  1256. onChange={(e) => { this.setState({ remarks: e.target.value }) }}/>
  1257. </FormItem>
  1258. </div>
  1259. <div style={{fontSize:'18px',marginLeft:'30px'}}>拜访情况</div>
  1260. <div className="clearfix">
  1261. <FormItem className="half-item"
  1262. labelCol={{ span: 8 }}
  1263. wrapperCol={{ span: 16 }}
  1264. label="拜访方式" >
  1265. <Radio.Group value={this.state.contactType} onChange={(e) => {
  1266. this.setState({ contactType: e.target.value })
  1267. }}>
  1268. <Radio value={0}>外出</Radio>
  1269. <Radio value={1}>电话</Radio>
  1270. <Radio value={2}>QQ</Radio>
  1271. <Radio value={3}>微信</Radio>
  1272. <Radio value={4}>邮箱</Radio>
  1273. </Radio.Group>
  1274. </FormItem>
  1275. </div>
  1276. <FormItem className="half-item"
  1277. {...formItemLayout}
  1278. label="联系人"
  1279. >
  1280. <Select placeholder="联系人姓名" style={{ width: 140 }}
  1281. value={this.state.lastName}
  1282. onChange={this.hundleName}>
  1283. {this.state.orderStatusOption}
  1284. </Select>
  1285. </FormItem>
  1286. <FormItem className="half-item"
  1287. {...formItemLayout}
  1288. label="联系电话"
  1289. >
  1290. <span>{this.state.nub}</span>
  1291. </FormItem>
  1292. <div className="clearfix">
  1293. <FormItem className="half-item"
  1294. {...formItemLayout}
  1295. label="拜访人"
  1296. >
  1297. <span>{this.state.adminName}</span>
  1298. </FormItem>
  1299. <FormItem className="half-item"
  1300. {...formItemLayout}
  1301. label="拜访时间" >
  1302. <span>{this.state.followTime}</span>
  1303. </FormItem>
  1304. </div>
  1305. <div className="clearfix">
  1306. <FormItem
  1307. labelCol={{ span: 4 }}
  1308. wrapperCol={{ span: 16 }}
  1309. label="拜访备注" >
  1310. <Input type="textarea" rows={4} value={this.state.result} placeholder="来电备注"
  1311. onChange={(e) => { this.setState({ result: e.target.value }); }}/>
  1312. </FormItem>
  1313. </div>
  1314. </div>
  1315. <Button type="primary" size="large" htmlType="submit" style={{margin:'15px 15px 20px 160px'}}>保存</Button>
  1316. <Button size="large" onClick={this.addClickCancel}>取消</Button>
  1317. </Spin>
  1318. </Form>
  1319. </Modal>
  1320. <Modal
  1321. className="customeDetails"
  1322. title="我的业务意向详情"
  1323. width='1000px'
  1324. visible={this.state.modal5Visible}
  1325. onOk={this.detailsModal}
  1326. onCancel={this.detailsModal}
  1327. footer=''
  1328. >
  1329. <Form horizontal onSubmit={this.newSubmit} id="demand-form">
  1330. <Spin spinning={this.state.loading}>
  1331. <div className="clearfix">
  1332. <FormItem className="half-item"
  1333. {...formItemLayout}
  1334. label="意向名称"
  1335. >
  1336. <span>{getCompanyIntention(theInformation.businessGlossoryId)}</span>
  1337. </FormItem>
  1338. <FormItem className="half-item"
  1339. {...formItemLayout}
  1340. label="意向时间"
  1341. >
  1342. <span>{theInformation.createTime}</span>
  1343. </FormItem>
  1344. <FormItem className="half-item"
  1345. {...formItemLayout}
  1346. label="客户名称"
  1347. >
  1348. <span>{theInformation.identifyName}</span>
  1349. </FormItem>
  1350. <FormItem className="half-item"
  1351. {...formItemLayout}
  1352. label="营销员"
  1353. >
  1354. <span>{theInformation.adminName}</span>
  1355. </FormItem>
  1356. <FormItem className="half-item"
  1357. {...formItemLayout}
  1358. label="意向进度"
  1359. >
  1360. <Select placeholder="意向进度" value={this.state.followSituation}
  1361. onChange={(e) => { this.setState({ followSituation: e }) }}>
  1362. {
  1363. newFollow.map(function (item) {
  1364. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1365. })
  1366. }
  1367. </Select>
  1368. </FormItem>
  1369. <FormItem className="half-item"
  1370. {...formItemLayout}
  1371. label="客户状态"
  1372. >
  1373. <Select placeholder="客户状态" value={this.state.customerStatus} disabled={this.state.customerStatus=='6'?true:false}
  1374. onChange={(e) => { this.setState({ customerStatus: e }) }}>
  1375. {
  1376. customerStatus.map(function (item) {
  1377. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1378. })
  1379. }
  1380. </Select>
  1381. </FormItem>
  1382. <div className="clearfix">
  1383. <FormItem
  1384. labelCol={{ span: 4 }}
  1385. wrapperCol={{ span: 16 }}
  1386. label="意向说明" >
  1387. <Input type="textarea" rows={4} placeholder="意向说明" value={this.state.remarks}
  1388. onChange={(e) => { this.setState({ remarks: e.target.value }) }}/>
  1389. </FormItem>
  1390. </div>
  1391. <Button className="set-submit" type="primary" htmlType="submit" style={{marginLeft:'160px',marginBottom:'30px'}}>保存</Button>
  1392. <Button className="set-submit" type="ghost" onClick={this.detailsModal}>取消</Button>
  1393. </div>
  1394. <div className="clearfix">
  1395. <div style={{fontSize:'18px',marginLeft:'40px',marginBottom:'20px'}}>业务跟进</div>
  1396. <div className="clearfix" style={{paddingLeft:'40px',paddingRight:'40px'}}>
  1397. <Spin spinning={this.state.loading}>
  1398. <Table
  1399. pagination={this.state.paginations}
  1400. columns={this.state.businessFollowList}
  1401. dataSource={this.state.visitArrList}
  1402. onRowClick={this.followRowClick}
  1403. />
  1404. </Spin>
  1405. </div>
  1406. </div>
  1407. </Spin>
  1408. </Form>
  1409. </Modal>
  1410. <Modal
  1411. footer=''
  1412. width='800px'
  1413. title="新增联系人"
  1414. visible={this.state.addcontactModul}
  1415. onOk={this.addcontactModulOK}
  1416. onCancel={this.addcontactModulcancel}
  1417. >
  1418. <Form horizontal onSubmit={this.submitcontactman} id="demand-form">
  1419. <Spin spinning={this.state.loading}>
  1420. <Row>
  1421. <FormItem
  1422. labelCol={{ span: 3 }}
  1423. wrapperCol={{ span: 14 }}
  1424. label="性别:" style={{marginRight:'10px',marginTop: '-15px'}}>
  1425. <Radio.Group value={this.state.newsex} onChange={(e) => {
  1426. this.setState({ newsex: e.target.value })
  1427. }}>
  1428. <Radio value='男'>男</Radio>
  1429. <Radio value='女'>女</Radio>
  1430. </Radio.Group>
  1431. </FormItem>
  1432. </Row>
  1433. <Row style={{ paddingLeft:'50px' }}>
  1434. <Col span={2}><span style={{color:'red'}}>*</span>姓名:</Col>
  1435. <Col span={8}>
  1436. <Input value={this.state.newname} required="required"
  1437. onChange={(e) => { this.setState({ newname: e.target.value }) }} />
  1438. </Col>
  1439. <Col span={2} style={{ marginLeft: '50px' }}><span style={{color:'red'}}>*</span>手机:</Col>
  1440. <Col span={8}>
  1441. <Input value={this.state.newmobile} required="required"
  1442. onChange={(e) => { this.setState({ newmobile: e.target.value }) }} />
  1443. </Col>
  1444. </Row>
  1445. <Row style={{ marginTop: '20px',paddingLeft:'50px' }}>
  1446. <Col span={2}>微信:</Col>
  1447. <Col span={8}>
  1448. <Input value={this.state.newwechat}
  1449. onChange={(e) => { this.setState({ newwechat: e.target.value }) }} />
  1450. </Col>
  1451. <Col span={2} style={{ marginLeft: '50px' }}>Q Q:</Col>
  1452. <Col span={8}>
  1453. <Input value={this.state.newqq}
  1454. onChange={(e) => { this.setState({ newqq: e.target.value }) }} />
  1455. </Col>
  1456. </Row>
  1457. <Row style={{ marginTop: '20px' ,paddingLeft:'50px'}}>
  1458. <Col span={2}>部门:</Col>
  1459. <Col span={8}>
  1460. <Input value={this.state.newdepatrment}
  1461. onChange={(e) => { this.setState({ newdepatrment: e.target.value }) }} />
  1462. </Col>
  1463. <Col span={2} style={{ marginLeft: '50px' }}>职位:</Col>
  1464. <Col span={8}>
  1465. <Input value={this.state.newposition}
  1466. onChange={(e) => { this.setState({ newposition: e.target.value }) }} />
  1467. </Col>
  1468. </Row>
  1469. <Row style={{ marginTop: '20px',paddingLeft:'50px' }}>
  1470. <Col span={2}>邮箱:</Col>
  1471. <Col span={8}>
  1472. <Input value={this.state.newemail}
  1473. onChange={(e) => { this.setState({ newemail: e.target.value }) }} />
  1474. </Col>
  1475. </Row>
  1476. <Row style={{ marginTop: '20px',paddingLeft:'50px' ,marginBottom:'50px'}}>
  1477. <Button className="set-submit" type="primary" htmlType="submit" id="change_keep" style={{marginLeft:'60px'}}>保存</Button>
  1478. <Button className="set-submit" type="ghost" onClick={this.addcontactModulcancel} id='change_rem'>取消</Button>
  1479. </Row>
  1480. </Spin>
  1481. </Form>
  1482. </Modal>
  1483. <Modal
  1484. footer=''
  1485. title="业务跟进详情"
  1486. width='1000px'
  1487. visible={this.state.businessFollowModul}
  1488. onOk={this.businessFollowOk}
  1489. onCancel={this.businessFollowCancel}
  1490. >
  1491. <div className="clearfix">
  1492. <Form horizontal id="demand-form" onSubmit={this.addlistSubmit}>
  1493. <Spin spinning={this.state.loading}>
  1494. <div className="clearfix">
  1495. <FormItem className="half-item"
  1496. {...formItemLayout}
  1497. label="意向名称"
  1498. >
  1499. <span>{getCompanyIntention(this.state.businessGlossoryId)}</span>
  1500. </FormItem>
  1501. <FormItem className="half-item"
  1502. {...formItemLayout}
  1503. >
  1504. <Button type="primary" onClick={this.newContacts} style={{marginLeft:'160px'}}>添加新联系人</Button>
  1505. </FormItem>
  1506. <FormItem className="half-item"
  1507. {...formItemLayout}
  1508. label="意向时间"
  1509. >
  1510. <span>{this.state.createTime}</span>
  1511. </FormItem>
  1512. <FormItem className="half-item"
  1513. {...formItemLayout}
  1514. label="客户名称"
  1515. >
  1516. <span>{this.state.identifyName}</span>
  1517. </FormItem>
  1518. <FormItem className="half-item"
  1519. {...formItemLayout}
  1520. label="营销员"
  1521. >
  1522. <span>{this.state.adminName}</span>
  1523. </FormItem>
  1524. <FormItem className="half-item"
  1525. {...formItemLayout}
  1526. label="意向进度"
  1527. >
  1528. <Select placeholder="意向进度" value={this.state.followSituationV}
  1529. onChange={(e) => { this.setState({ followSituationV: e }) }}>
  1530. {
  1531. newFollow.map(function (item) {
  1532. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1533. })
  1534. }
  1535. </Select>
  1536. </FormItem>
  1537. <FormItem className="half-item"
  1538. {...formItemLayout}
  1539. label="客户状态"
  1540. >
  1541. <Select placeholder="客户状态" value={this.state.customerStatusV}
  1542. onChange={(e) => { this.setState({ customerStatusV: e }) }}>
  1543. {
  1544. customerStatus.map(function (item) {
  1545. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1546. })
  1547. }
  1548. </Select>
  1549. </FormItem>
  1550. <div className="clearfix">
  1551. <FormItem
  1552. labelCol={{ span: 4 }}
  1553. wrapperCol={{ span: 16 }}
  1554. label="意向说明" >
  1555. <Input type="textarea" rows={4} placeholder="意向说明" value={this.state.remarksV}
  1556. onChange={(e) => { this.setState({ remarksV: e.target.value }) }}/>
  1557. </FormItem>
  1558. </div>
  1559. <div style={{fontSize:'18px',marginLeft:'30px'}}>拜访情况</div>
  1560. <div className="clearfix">
  1561. <FormItem className="half-item"
  1562. labelCol={{ span: 8 }}
  1563. wrapperCol={{ span: 16 }}
  1564. label="拜访方式" >
  1565. <Radio.Group value={this.state.contactTypeV} onChange={(e) => {
  1566. this.setState({ contactTypeV: e.target.value })
  1567. }}>
  1568. <Radio value={0}>外出</Radio>
  1569. <Radio value={1}>电话</Radio>
  1570. <Radio value={2}>QQ</Radio>
  1571. <Radio value={3}>微信</Radio>
  1572. <Radio value={4}>邮箱</Radio>
  1573. </Radio.Group>
  1574. </FormItem>
  1575. </div>
  1576. <FormItem className="half-item"
  1577. {...formItemLayout}
  1578. label="联系人"
  1579. >
  1580. <Select placeholder="联系人姓名" style={{ width: 140 }}
  1581. value={this.state.lastName}
  1582. onChange={this.hundleName}>
  1583. {this.state.orderStatusOption}
  1584. </Select>
  1585. </FormItem>
  1586. <FormItem className="half-item"
  1587. {...formItemLayout}
  1588. label="当前联系人"
  1589. >
  1590. <span>{this.state.contacts}</span>
  1591. </FormItem>
  1592. <FormItem className="half-item"
  1593. {...formItemLayout}
  1594. label="联系电话"
  1595. >
  1596. <span>{this.state.nub}</span>
  1597. </FormItem>
  1598. <div className="clearfix">
  1599. <FormItem className="half-item"
  1600. {...formItemLayout}
  1601. label="拜访人"
  1602. >
  1603. <span>{this.state.adminName}</span>
  1604. </FormItem>
  1605. <FormItem className="half-item"
  1606. {...formItemLayout}
  1607. label="拜访时间" >
  1608. <span>{this.state.followTime}</span>
  1609. </FormItem>
  1610. </div>
  1611. <div className="clearfix">
  1612. <FormItem
  1613. labelCol={{ span: 4 }}
  1614. wrapperCol={{ span: 16 }}
  1615. label="拜访备注" >
  1616. <Input type="textarea" rows={4} value={this.state.resultV} placeholder="来电备注"
  1617. onChange={(e) => { this.setState({ resultV: e.target.value }); }}/>
  1618. </FormItem>
  1619. </div>
  1620. </div>
  1621. <Button type="primary" size="large" htmlType="submit" style={{margin:'15px 15px 20px 160px'}}>保存</Button>
  1622. <Button size="large" onClick={this.businessFollowCancel}>取消</Button>
  1623. </Spin>
  1624. </Form>
  1625. </div>
  1626. </Modal>
  1627. </div >
  1628. );
  1629. }
  1630. }));
  1631. export default MyBusiness;