myBusiness.jsx 64 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&&data.data.list&&!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. this.setState({
  816. khId:theType
  817. })
  818. this.getNewWoman(theType)
  819. },
  820. //上级主管输入框失去焦点是判断客户是否存在
  821. selectAuto(value,options){
  822. let theType='';
  823. let contactLists=this.state.customerArr||[];
  824. if (value) {
  825. contactLists.map(function (item) {
  826. if (item.name == value.toString()) {
  827. theType = item.id;
  828. }
  829. });
  830. }
  831. this.setState({
  832. superior:value,
  833. khId:theType
  834. })
  835. this.getNewWoman(theType) ;
  836. },
  837. //客户输入框失去焦点是判断客户是否存在
  838. blurChange(e){
  839. let theType='';
  840. let contactLists=this.state.customerArr||[];
  841. if (e) {
  842. contactLists.map(function (item) {
  843. if (item.name == e.toString()) {
  844. theType = item.id;
  845. }
  846. });
  847. }
  848. this.setState({
  849. theTypes:theType
  850. })
  851. },
  852. //点击跟进时数据处理
  853. HttpFollowUp(e){
  854. $.ajax({
  855. method: "get",
  856. dataType: "json",
  857. crossDomain: false,
  858. url: globalConfig.context + "/api/admin/customer/toAddFollowOneBusiness",
  859. data:{
  860. businessId:e
  861. },
  862. success: function (data) {
  863. let thedata=data.data;
  864. if (!thedata) {
  865. if (data.error && data.error.length) {
  866. message.warning(data.error[0].message);
  867. };
  868. thedata = {};
  869. };
  870. this.setState({
  871. uids:thedata.uid,
  872. businessId:thedata.businessId,
  873. businessGlossoryId:thedata.businessGlossoryId,
  874. followSituation:thedata.followSituation,
  875. customerStatus:thedata.customerStatus,
  876. followTime:thedata.followTime,
  877. createTime:thedata.createTime,
  878. identifyName:thedata.identifyName,
  879. contactType:undefined,
  880. result:'',
  881. remarks:'',
  882. });
  883. }.bind(this),
  884. }).always(function () {
  885. this.getNewWoman(this.state.uids)
  886. this.setState({
  887. loading: false
  888. });
  889. }.bind(this));
  890. },
  891. //获取联系人下拉框
  892. getNewWoman(ids) {
  893. this.state.data = []
  894. $.ajax({
  895. method: "get",
  896. dataType: "json",
  897. crossDomain: false,
  898. url: globalConfig.context + "/api/admin/customer/findCustomerContacts",
  899. data:{
  900. uid:ids,
  901. },
  902. success: function (data) {
  903. let theArr = [];
  904. let thedata=data.data;
  905. if (!thedata) {
  906. if (data.error && data.error.length) {
  907. message.warning(data.error[0].message);
  908. };
  909. thedata = {};
  910. };
  911. var telNum=[];
  912. var contactIds=[];
  913. thedata.map(function (item,index) {
  914. telNum.push(thedata[index].mobile);
  915. });
  916. for (let item in data.data) {
  917. let theData = data.data[item];
  918. theArr.push(
  919. <Select.Option value={item} key={theData.name}>{theData.name}</Select.Option>
  920. );
  921. };
  922. this.setState({
  923. contactsIdArr:thedata,
  924. telNum:telNum,
  925. orderStatusOption: theArr,
  926. });
  927. }.bind(this),
  928. }).always(function () {
  929. this.setState({
  930. loading: false
  931. });
  932. }.bind(this));
  933. },
  934. //获取拜访详情ajax
  935. loadVisit(pageNo) {
  936. this.setState({
  937. loading: true
  938. });
  939. $.ajax({
  940. method: "get",
  941. dataType: "json",
  942. crossDomain: false,
  943. url:globalConfig.context + '/api/admin/customer/listFollowHistory',
  944. data: {
  945. pageNo: pageNo || 1,
  946. pageSize: this.state.paginations.pageSize,
  947. uid: this.state.uids, //名称1
  948. businessGlossoryId:this.state.businessGlossoryId,
  949. },
  950. success: function (data) {
  951. let theArr = [];
  952. if (data.error.length || data.data.list=="") {
  953. if (data.error && data.error.length) {
  954. message.warning(data.error[0].message);
  955. };
  956. } else {
  957. for (let i = 0; i < data.data.list.length; i++) {
  958. let thisdata = data.data.list[i];
  959. theArr.push({
  960. followId:thisdata.followId,
  961. followTime:thisdata.followTime,
  962. identifyName:thisdata.identifyName,
  963. contacts:thisdata.contacts,
  964. contactMobile:thisdata.contactMobile,
  965. result:thisdata.result,
  966. ufbId:thisdata.ufbId,
  967. adminName:thisdata.adminName,
  968. followSituation:thisdata.followSituation,
  969. customerStatus:thisdata.customerStatus,
  970. contactType:thisdata.contactType
  971. });
  972. };
  973. this.state.paginations.current = data.data.pageNo;
  974. this.state.paginations.total = data.data.totalCount;
  975. };
  976. this.setState({
  977. visitArrList: theArr,
  978. paginations: this.state.paginations
  979. });
  980. }.bind(this),
  981. }).always(function () {
  982. this.setState({
  983. loading: false
  984. });
  985. }.bind(this));
  986. },
  987. componentWillReceiveProps(nextProps) {
  988. if (!this.props.visible && nextProps.visible) {
  989. if (nextProps.data && nextProps.data.id) {
  990. this.loadData(nextProps.data.id, nextProps.detailApiUrl);
  991. };
  992. this.state.data = {};
  993. this.state.companyLogoUrl = [];
  994. this.state.orgCodeUrl = [];
  995. };
  996. },
  997. tableRowClick(record, index) {
  998. this.state.RowData = record;
  999. this.detailsModalOk(record);
  1000. this.setState({
  1001. selectedRowKeys:[],
  1002. rowId:record.businessId,
  1003. })
  1004. },
  1005. followRowClick(record, index) {
  1006. this.state.RowData = record;
  1007. this.listFollowUp(record);
  1008. this.setState({
  1009. businessFollowModul: true,
  1010. selectedRowKeys:[],
  1011. });
  1012. },
  1013. render() {
  1014. const FormItem = Form.Item
  1015. const rowSelection = {
  1016. selectedRowKeys: this.state.selectedRowKeys,
  1017. onChange: (selectedRowKeys, selectedRows) => {
  1018. this.setState({
  1019. selectedRows: selectedRows.slice(-1),
  1020. selectedRowKeys: selectedRowKeys.slice(-1)
  1021. });
  1022. },
  1023. onSelect: (recordt, selected, selectedRows) => {
  1024. this.setState({
  1025. recordt:recordt.id
  1026. })
  1027. },
  1028. };
  1029. const rowSelections = {
  1030. selectedRowKeys: this.state.selectedRowKey,
  1031. onChange: (selectedRowKey, selectedRow) => {
  1032. this.setState({
  1033. selectedRow: selectedRow.slice(-1),
  1034. selectedRowKey: selectedRowKey.slice(-1)
  1035. });
  1036. },
  1037. onSelect: (records, selected, selectedRow) => {
  1038. this.setState({
  1039. selectedRow: selectedRow.slice(-1),
  1040. records:records.id,
  1041. })
  1042. },
  1043. };
  1044. const hasSelected = this.state.selectedRowKeys.length > 0;
  1045. const { RangePicker } = DatePicker;
  1046. const { getFieldDecorator } = this.props.form;
  1047. const formItemLayout = {
  1048. labelCol: { span: 8 },
  1049. wrapperCol: { span: 14 },
  1050. };
  1051. const theInformation=this.state.dataInformation || {}
  1052. const contactsOption="";
  1053. const formItemLayput = {
  1054. labelCol: { span: 10 },
  1055. wrapperCol: { span: 14 },
  1056. };
  1057. const businessIds=this.state.businessId||'';
  1058. const dataSources=this.state.customerArr || [];
  1059. const options = dataSources.map((group) =>
  1060. <Option key={group.id} value={group.name}>{group.name}</Option>
  1061. )
  1062. return (
  1063. <div className="user-content" >
  1064. <div className="content-title">
  1065. <span>我的业务</span>
  1066. </div>
  1067. <div className="user-search">
  1068. <Input placeholder="客户名称"
  1069. value={this.state.identifyNameS}
  1070. onChange={(e) => { this.setState({ identifyNameS: e.target.value }); }} />
  1071. <Select placeholder="服务意向" value={this.state.businessIdS} onChange={(e) => {
  1072. this.setState({businessIdS:e})}} style={{width:'150px'}}>
  1073. {
  1074. intentionalService.map(function (item) {
  1075. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1076. })
  1077. }
  1078. </Select>
  1079. <Button type="primary" onClick={this.search}>搜索</Button>
  1080. <Button onClick={this.reset}>重置</Button>
  1081. <Popconfirm title="是否删除?" onConfirm={this.delectRow} okText="是" cancelText="否">
  1082. <Button style={{ marginRight:'10px' ,marginLeft:'10px'}} type='danger'
  1083. disabled={!hasSelected}
  1084. >删除<Icon type="minus" />
  1085. </Button>
  1086. </Popconfirm>
  1087. <span style={{marginLeft:'10px',marginRight:'20px'}}>更多搜索<Switch defaultChecked={false} onChange={this.searchSwitch} /></span>
  1088. <Button type="primary" className="addButton" onClick={this.addClick}>新增业务<Icon type="plus" /></Button>
  1089. <div className='clearfix' style={{marginTop:'5px'}}>
  1090. <div className="search-more" style={this.state.searchMore ? { display: 'none' } : {}}>
  1091. <RangePicker
  1092. value={[this.state.releaseDate[0] ? moment(this.state.releaseDate[0]) : null,
  1093. this.state.releaseDate[1] ? moment(this.state.releaseDate[1]) : null]}
  1094. onChange={(data, dataString) => { this.setState({ releaseDate: dataString }); }} />
  1095. <Select placeholder="客户状态"
  1096. style={{ width: 150 }}
  1097. value={this.state.customerStatusS}
  1098. onChange={(e) => { this.setState({ customerStatusS: e }) }}>
  1099. {
  1100. customerStatus.map(function (item) {
  1101. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1102. })
  1103. }
  1104. </Select>
  1105. <Select placeholder="业务进度"
  1106. style={{ width: 150 }}
  1107. value={this.state.followSituationS}
  1108. onChange={(e) => { this.setState({ followSituationS: e }) }}>
  1109. {this.state.intentionalOption}
  1110. </Select>
  1111. <Input placeholder="营销员" style={{width:'150px'}}
  1112. value={this.state.adminNameS}
  1113. onChange={(e) => { this.setState({ adminNameS: e.target.value }); }} />
  1114. </div>
  1115. </div>
  1116. </div>
  1117. <div className="patent-table">
  1118. <Spin spinning={this.state.loading}>
  1119. <Table columns={this.state.columns}
  1120. dataSource={this.state.dataSource}
  1121. rowSelection={rowSelection}
  1122. pagination={this.state.pagination}
  1123. onRowClick={this.tableRowClick}
  1124. />
  1125. </Spin>
  1126. </div>
  1127. <Modal
  1128. maskClosable={false}
  1129. footer=''
  1130. title="我的业务"
  1131. width='1000px'
  1132. visible={this.state.showDesc}
  1133. onOk={this.addClickOk}
  1134. onCancel={this.addClickCancel}
  1135. >
  1136. <Form horizontal id="demand-form" onSubmit={this.addSubmit}>
  1137. <Spin spinning={this.state.loading}>
  1138. <div className="clearfix">
  1139. {businessIds!=''?<div><FormItem className="half-item"
  1140. {...formItemLayout}
  1141. label="意向名称"
  1142. >
  1143. <span>{getCompanyIntention(this.state.businessGlossoryId)}</span>
  1144. </FormItem>
  1145. <FormItem className="half-item"
  1146. {...formItemLayout}
  1147. >
  1148. <Button type="primary" onClick={this.newContacts} style={{marginLeft:'160px'}}>添加新联系人</Button>
  1149. </FormItem>
  1150. <FormItem className="half-item"
  1151. {...formItemLayout}
  1152. label="意向时间"
  1153. >
  1154. <span>{this.state.createTime}</span>
  1155. </FormItem>
  1156. <FormItem className="half-item"
  1157. {...formItemLayout}
  1158. label="客户名称"
  1159. >
  1160. <span>{this.state.identifyName}</span>
  1161. </FormItem></div>
  1162. :<div><FormItem className="half-item"
  1163. {...formItemLayout}
  1164. label="意向名称"
  1165. >
  1166. <Select placeholder="服务意向名称" value={this.state.businessGlossoryId} onChange={(e) => {
  1167. this.setState({businessGlossoryId:e})}} style={{width:'150px'}}>
  1168. {
  1169. intentionalService.map(function (item) {
  1170. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1171. })
  1172. }
  1173. </Select>
  1174. <span style={{color:'red'}}> *</span>
  1175. </FormItem>
  1176. <FormItem className="half-item"
  1177. {...formItemLayout}
  1178. >
  1179. <Button type="primary" onClick={this.newContacts} style={{marginLeft:'160px'}}>添加新联系人</Button>
  1180. </FormItem>
  1181. <div className="clearfix">
  1182. <FormItem className="half-item"
  1183. {...formItemLayout}
  1184. label="意向时间" >
  1185. <DatePicker placeholder="更新日期" value={moment(this.state.createYear,'YYYY-MM-DD')} onChange={(time) => {this.setState({createYear: time});}}/>
  1186. <TimePicker placeholder="更新时间" value={moment(this.state.creatMent, 'HH:mm:ss')} onChange={(time) => { this.setState({creatMent: time}); }}/>
  1187. </FormItem>
  1188. <FormItem className="half-item"
  1189. {...formItemLayout}
  1190. label="客户名称"
  1191. >
  1192. <AutoComplete
  1193. className="certain-category-search"
  1194. dropdownClassName="certain-category-search-dropdown"
  1195. dropdownMatchSelectWidth={false}
  1196. dropdownStyle={{ width: 300 }}
  1197. size="large"
  1198. style={{ width: '200px' }}
  1199. dataSource={options}
  1200. placeholder="输入名称"
  1201. value={this.state.superior}
  1202. onChange={this.httpChange}
  1203. filterOption={true}
  1204. onBlur={this.blurChange}
  1205. onSelect={this.selectAuto}
  1206. filterOption={true}
  1207. >
  1208. <Input/>
  1209. </AutoComplete>
  1210. <span className="mandatory">*</span>
  1211. </FormItem>
  1212. </div>
  1213. </div>
  1214. }
  1215. <FormItem className="half-item"
  1216. {...formItemLayout}
  1217. label="营销员"
  1218. >
  1219. <span>{this.state.adminName}</span>
  1220. </FormItem>
  1221. <FormItem className="half-item"
  1222. {...formItemLayout}
  1223. label="意向进度"
  1224. >
  1225. <Select placeholder="意向进度" value={this.state.followSituation}
  1226. onChange={(e) => { this.setState({ followSituation: e }) }}>
  1227. {
  1228. newFollow.map(function (item) {
  1229. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1230. })
  1231. }
  1232. </Select>
  1233. </FormItem>
  1234. <FormItem className="half-item"
  1235. {...formItemLayout}
  1236. label="客户状态"
  1237. >
  1238. <Select placeholder="客户状态" value={this.state.customerStatus}
  1239. onChange={(e) => { this.setState({ customerStatus: e }) }}>
  1240. {
  1241. customerStatus.map(function (item) {
  1242. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1243. })
  1244. }
  1245. </Select>
  1246. </FormItem>
  1247. <div className="clearfix">
  1248. <FormItem
  1249. labelCol={{ span: 4 }}
  1250. wrapperCol={{ span: 16 }}
  1251. label="意向说明" >
  1252. <Input type="textarea" rows={4} placeholder="意向说明" value={this.state.remarks}
  1253. onChange={(e) => { this.setState({ remarks: e.target.value }) }}/>
  1254. </FormItem>
  1255. </div>
  1256. <div style={{fontSize:'18px',marginLeft:'30px'}}>拜访情况</div>
  1257. <div className="clearfix">
  1258. <FormItem className="half-item"
  1259. labelCol={{ span: 8 }}
  1260. wrapperCol={{ span: 16 }}
  1261. label="拜访方式" >
  1262. <Radio.Group value={this.state.contactType} onChange={(e) => {
  1263. this.setState({ contactType: e.target.value })
  1264. }}>
  1265. <Radio value={0}>外出</Radio>
  1266. <Radio value={1}>电话</Radio>
  1267. <Radio value={2}>QQ</Radio>
  1268. <Radio value={3}>微信</Radio>
  1269. <Radio value={4}>邮箱</Radio>
  1270. </Radio.Group>
  1271. </FormItem>
  1272. </div>
  1273. <FormItem className="half-item"
  1274. {...formItemLayout}
  1275. label="联系人"
  1276. >
  1277. <Select placeholder="联系人姓名" style={{ width: 140 }}
  1278. value={this.state.lastName}
  1279. onChange={this.hundleName}>
  1280. {this.state.orderStatusOption}
  1281. </Select>
  1282. </FormItem>
  1283. <FormItem className="half-item"
  1284. {...formItemLayout}
  1285. label="联系电话"
  1286. >
  1287. <span>{this.state.nub}</span>
  1288. </FormItem>
  1289. <div className="clearfix">
  1290. <FormItem className="half-item"
  1291. {...formItemLayout}
  1292. label="拜访人"
  1293. >
  1294. <span>{this.state.adminName}</span>
  1295. </FormItem>
  1296. <FormItem className="half-item"
  1297. {...formItemLayout}
  1298. label="拜访时间" >
  1299. <span>{this.state.followTime}</span>
  1300. </FormItem>
  1301. </div>
  1302. <div className="clearfix">
  1303. <FormItem
  1304. labelCol={{ span: 4 }}
  1305. wrapperCol={{ span: 16 }}
  1306. label="拜访备注" >
  1307. <Input type="textarea" rows={4} value={this.state.result} placeholder="来电备注"
  1308. onChange={(e) => { this.setState({ result: e.target.value }); }}/>
  1309. </FormItem>
  1310. </div>
  1311. </div>
  1312. <Button type="primary" size="large" htmlType="submit" style={{margin:'15px 15px 20px 160px'}}>保存</Button>
  1313. <Button size="large" onClick={this.addClickCancel}>取消</Button>
  1314. </Spin>
  1315. </Form>
  1316. </Modal>
  1317. <Modal
  1318. maskClosable={false}
  1319. className="customeDetails"
  1320. title="我的业务意向详情"
  1321. width='1000px'
  1322. visible={this.state.modal5Visible}
  1323. onOk={this.detailsModal}
  1324. onCancel={this.detailsModal}
  1325. footer=''
  1326. >
  1327. <Form horizontal onSubmit={this.newSubmit} id="demand-form">
  1328. <Spin spinning={this.state.loading}>
  1329. <div className="clearfix">
  1330. <FormItem className="half-item"
  1331. {...formItemLayout}
  1332. label="意向名称"
  1333. >
  1334. <span>{getCompanyIntention(theInformation.businessGlossoryId)}</span>
  1335. </FormItem>
  1336. <FormItem className="half-item"
  1337. {...formItemLayout}
  1338. label="意向时间"
  1339. >
  1340. <span>{theInformation.createTime}</span>
  1341. </FormItem>
  1342. <FormItem className="half-item"
  1343. {...formItemLayout}
  1344. label="客户名称"
  1345. >
  1346. <span>{theInformation.identifyName}</span>
  1347. </FormItem>
  1348. <FormItem className="half-item"
  1349. {...formItemLayout}
  1350. label="营销员"
  1351. >
  1352. <span>{theInformation.adminName}</span>
  1353. </FormItem>
  1354. <FormItem className="half-item"
  1355. {...formItemLayout}
  1356. label="意向进度"
  1357. >
  1358. <Select placeholder="意向进度" value={this.state.followSituation}
  1359. onChange={(e) => { this.setState({ followSituation: e }) }}>
  1360. {
  1361. newFollow.map(function (item) {
  1362. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1363. })
  1364. }
  1365. </Select>
  1366. </FormItem>
  1367. <FormItem className="half-item"
  1368. {...formItemLayout}
  1369. label="客户状态"
  1370. >
  1371. <Select placeholder="客户状态" value={this.state.customerStatus} disabled={this.state.customerStatus=='6'?true:false}
  1372. onChange={(e) => { this.setState({ customerStatus: e }) }}>
  1373. {
  1374. customerStatus.map(function (item) {
  1375. return <Select.Option key={item.value} >{item.key}</Select.Option>
  1376. })
  1377. }
  1378. </Select>
  1379. </FormItem>
  1380. <div className="clearfix">
  1381. <FormItem
  1382. labelCol={{ span: 4 }}
  1383. wrapperCol={{ span: 16 }}
  1384. label="意向说明" >
  1385. <Input type="textarea" rows={4} placeholder="意向说明" value={this.state.remarks}
  1386. onChange={(e) => { this.setState({ remarks: e.target.value }) }}/>
  1387. </FormItem>
  1388. </div>
  1389. <Button className="set-submit" type="primary" htmlType="submit" style={{marginLeft:'160px',marginBottom:'30px'}}>保存</Button>
  1390. <Button className="set-submit" type="ghost" onClick={this.detailsModal}>取消</Button>
  1391. </div>
  1392. <div className="clearfix">
  1393. <div style={{fontSize:'18px',marginLeft:'40px',marginBottom:'20px'}}>业务跟进</div>
  1394. <div className="clearfix" style={{paddingLeft:'40px',paddingRight:'40px'}}>
  1395. <Spin spinning={this.state.loading}>
  1396. <Table
  1397. pagination={this.state.paginations}
  1398. columns={this.state.businessFollowList}
  1399. dataSource={this.state.visitArrList}
  1400. onRowClick={this.followRowClick}
  1401. />
  1402. </Spin>
  1403. </div>
  1404. </div>
  1405. </Spin>
  1406. </Form>
  1407. </Modal>
  1408. <Modal
  1409. maskClosable={false}
  1410. footer=''
  1411. width='800px'
  1412. title="新增联系人"
  1413. visible={this.state.addcontactModul}
  1414. onOk={this.addcontactModulOK}
  1415. onCancel={this.addcontactModulcancel}
  1416. >
  1417. <Form horizontal onSubmit={this.submitcontactman} id="demand-form">
  1418. <Spin spinning={this.state.loading}>
  1419. <Row>
  1420. <FormItem
  1421. labelCol={{ span: 3 }}
  1422. wrapperCol={{ span: 14 }}
  1423. label="性别:" style={{marginRight:'10px',marginTop: '-15px'}}>
  1424. <Radio.Group value={this.state.newsex} onChange={(e) => {
  1425. this.setState({ newsex: e.target.value })
  1426. }}>
  1427. <Radio value='男'>男</Radio>
  1428. <Radio value='女'>女</Radio>
  1429. </Radio.Group>
  1430. </FormItem>
  1431. </Row>
  1432. <Row style={{ paddingLeft:'50px' }}>
  1433. <Col span={2}><span style={{color:'red'}}>*</span>姓名:</Col>
  1434. <Col span={8}>
  1435. <Input value={this.state.newname} required="required"
  1436. onChange={(e) => { this.setState({ newname: e.target.value }) }} />
  1437. </Col>
  1438. <Col span={2} style={{ marginLeft: '50px' }}><span style={{color:'red'}}>*</span>手机:</Col>
  1439. <Col span={8}>
  1440. <Input value={this.state.newmobile} required="required"
  1441. onChange={(e) => { this.setState({ newmobile: e.target.value }) }} />
  1442. </Col>
  1443. </Row>
  1444. <Row style={{ marginTop: '20px',paddingLeft:'50px' }}>
  1445. <Col span={2}>微信:</Col>
  1446. <Col span={8}>
  1447. <Input value={this.state.newwechat}
  1448. onChange={(e) => { this.setState({ newwechat: e.target.value }) }} />
  1449. </Col>
  1450. <Col span={2} style={{ marginLeft: '50px' }}>Q Q:</Col>
  1451. <Col span={8}>
  1452. <Input value={this.state.newqq}
  1453. onChange={(e) => { this.setState({ newqq: e.target.value }) }} />
  1454. </Col>
  1455. </Row>
  1456. <Row style={{ marginTop: '20px' ,paddingLeft:'50px'}}>
  1457. <Col span={2}>部门:</Col>
  1458. <Col span={8}>
  1459. <Input value={this.state.newdepatrment}
  1460. onChange={(e) => { this.setState({ newdepatrment: e.target.value }) }} />
  1461. </Col>
  1462. <Col span={2} style={{ marginLeft: '50px' }}>职位:</Col>
  1463. <Col span={8}>
  1464. <Input value={this.state.newposition}
  1465. onChange={(e) => { this.setState({ newposition: e.target.value }) }} />
  1466. </Col>
  1467. </Row>
  1468. <Row style={{ marginTop: '20px',paddingLeft:'50px' }}>
  1469. <Col span={2}>邮箱:</Col>
  1470. <Col span={8}>
  1471. <Input value={this.state.newemail}
  1472. onChange={(e) => { this.setState({ newemail: e.target.value }) }} />
  1473. </Col>
  1474. </Row>
  1475. <Row style={{ marginTop: '20px',paddingLeft:'50px' ,marginBottom:'50px'}}>
  1476. <Button className="set-submit" type="primary" htmlType="submit" id="change_keep" style={{marginLeft:'60px'}}>保存</Button>
  1477. <Button className="set-submit" type="ghost" onClick={this.addcontactModulcancel} id='change_rem'>取消</Button>
  1478. </Row>
  1479. </Spin>
  1480. </Form>
  1481. </Modal>
  1482. <Modal
  1483. maskClosable={false}
  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;