myBusiness.jsx 67 KB

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