intentionCustomer.jsx 32 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007
  1. import React from 'react';
  2. import {Icon, Button, AutoComplete,Cascader,Input, Select, Spin, Table, message, DatePicker, Form,Tabs,Modal, Tag } from 'antd';
  3. import $ from 'jquery/src/ajax';
  4. import moment from 'moment';
  5. import { citySelect, provinceList } from '@/NewDicProvinceList';
  6. import AddIntention from './addIntention.jsx';
  7. import {industry, lvl, currentMember } from '@/dataDic.js';
  8. import ZhuanjiaoDetail from "@/zhuanjiaoDetail.jsx";
  9. import {
  10. getSocialAttribute,
  11. ShowModal
  12. } from "@/tools.js";
  13. import FollowDetail from './followDetail.jsx'
  14. import IntentionDetail from './intentionDetail/intentionDetail.jsx'
  15. import ShowModalDiv from "@/showModal.jsx";
  16. import './customer.less';
  17. const {TabPane} = Tabs
  18. const IntentionCustomer = Form.create()(
  19. React.createClass({
  20. loadData(pageNo, apiUrl) {
  21. this.setState({
  22. visitModul: false,
  23. loading: true,
  24. modalVisible: false,
  25. });
  26. let api = apiUrl ? apiUrl : this.props.ApiUrl;
  27. $.ajax({
  28. method: "post",
  29. dataType: "json",
  30. crossDomain: false,
  31. url: globalConfig.context + api,
  32. data: {
  33. pageNo: pageNo || 1,
  34. pageSize: this.state.pagination.pageSize,
  35. level: this.state.level ? this.state.level : undefined,
  36. name: this.state.nameSearch,
  37. province: !this.state.addressSearch.length
  38. ? this.state.provinceSearch
  39. : this.state.addressSearch[0],
  40. city: !this.state.addressSearch.length
  41. ? ""
  42. : this.state.addressSearch[1],
  43. startDate: this.state.releaseDate[0],
  44. endDate: this.state.releaseDate[1],
  45. },
  46. success: function (data) {
  47. ShowModal(this);
  48. let theArr = [];
  49. if (data.error.length || data.data.list == "") {
  50. if (data.error && data.error.length) {
  51. message.warning(data.error[0].message);
  52. }
  53. } else {
  54. for (let i = 0; i < data.data.list.length; i++) {
  55. let thisdata = data.data.list[i];
  56. let diqu =
  57. (thisdata.province == null ? "" : thisdata.province) +
  58. (thisdata.city == null ? "" : "-" + thisdata.city) +
  59. (thisdata.area == null ? "" : "-" + thisdata.area);
  60. thisdata.key = i;
  61. thisdata.id = thisdata.uid;
  62. thisdata.lastFollowTime = thisdata.lastFollowTime &&
  63. thisdata.lastFollowTime.split(" ")[0];
  64. thisdata.transferTime= thisdata.transferTime && thisdata.transferTime.split(" ")[0];
  65. thisdata.surplusFollowTime = thisdata.surplusFollowTime && thisdata.surplusFollowTime.split(" ")[0];
  66. thisdata.surplusSignTime = thisdata.surplusSignTime && thisdata.surplusSignTime.split(" ")[0];
  67. thisdata.locationProvince = diqu;
  68. theArr.push(thisdata);
  69. }
  70. this.state.pagination.current = data.data.pageNo;
  71. this.state.pagination.total = data.data.totalCount;
  72. this.setState({
  73. ispage: data.data.pageNo,
  74. })
  75. }
  76. if (data.data && data.data.list && !data.data.list.length) {
  77. this.state.pagination.current = 0;
  78. this.state.pagination.total = 0;
  79. }
  80. if(JSON.stringify(theArr) !== JSON.stringify(this.state.dataSource)){
  81. this.setState({
  82. selectedRowKeys: [],
  83. })
  84. }
  85. this.setState({
  86. dataSource: theArr,
  87. pagination: this.state.pagination,
  88. });
  89. }.bind(this),
  90. }).always(
  91. function () {
  92. this.setState({
  93. loading: false,
  94. });
  95. }.bind(this)
  96. );
  97. },
  98. //品类数据获取
  99. category() {
  100. $.ajax({
  101. method: "get",
  102. dataType: "json",
  103. crossDomain: false,
  104. url: globalConfig.context + "/api/admin/Varieties/getSuperList",
  105. data: {},
  106. success: function (data) {
  107. let thedata = data.data;
  108. let theArr = [];
  109. if (!thedata) {
  110. if (data.error && data.error.length) {
  111. message.warning(data.error[0].message);
  112. }
  113. thedata = {};
  114. } else {
  115. thedata.map(function (item, index) {
  116. theArr.push({
  117. value: item.id,
  118. key: item.cname,
  119. });
  120. });
  121. }
  122. this.setState({
  123. categoryArr: theArr,
  124. });
  125. }.bind(this),
  126. });
  127. },
  128. getInitialState() {
  129. return {
  130. addressSearch: [],
  131. orgCodeUrl: [],
  132. companyLogoUrl: [],
  133. visible: false,
  134. zhuanjiaoVisible: false,
  135. searchMore: true,
  136. releaseDate: [],
  137. categoryArr: [],
  138. visitModul: false,
  139. keys: false,
  140. detailApi: "",
  141. followData: {},
  142. selectedRowKeys: [],
  143. selectedRowKey: [],
  144. selectedRows: [],
  145. loading: false,
  146. modalVisible: false,
  147. pagination: {
  148. defaultCurrent: 1,
  149. defaultPageSize: 10,
  150. showQuickJumper: true,
  151. pageSize: 10,
  152. onChange: function (page) {
  153. this.loadData(page);
  154. }.bind(this),
  155. showTotal: function (total) {
  156. return "共" + total + "条数据";
  157. },
  158. },
  159. columns: [
  160. {
  161. title: "客户名称",
  162. dataIndex: "name",
  163. key: "name",
  164. },
  165. {
  166. title: "地区",
  167. dataIndex: "locationProvince",
  168. key: "locationProvince",
  169. },
  170. // {
  171. // title: "联系人",
  172. // dataIndex: "contacts",
  173. // key: "contacts",
  174. // },
  175. // {
  176. // title: "联系电话",
  177. // dataIndex: "contactMobile",
  178. // key: "contactMobile",
  179. // },
  180. {
  181. title: "社会性质",
  182. dataIndex: "societyTag",
  183. key: "societyTag",
  184. render: (text) => {
  185. return getSocialAttribute(text);
  186. },
  187. },
  188. {
  189. title: "客户初始时间",
  190. dataIndex: "transferTime",
  191. key: "transferTime",
  192. },
  193. {
  194. title: "剩余私有天数",
  195. dataIndex: "surplusFollowTime",
  196. key: "surplusFollowTime",
  197. },
  198. {
  199. title: "剩余签单天数",
  200. dataIndex: "surplusSignTime",
  201. key: "surplusSignTime",
  202. },
  203. {
  204. title: "最新跟进时间",
  205. dataIndex: "lastFollowTime",
  206. key: "lastFollowTime",
  207. },
  208. {
  209. title: "客户等级",
  210. dataIndex: "level",
  211. key: "level",
  212. render: (text) => {
  213. if(text == 0) {
  214. return <Tag color="#87d068">一般客户</Tag>;
  215. }else if(text == 1) {
  216. return <Tag color="#D2691E">意向客户</Tag>;
  217. }else if(text == 2) {
  218. return <Tag color="#FF0000">重点客户</Tag>;
  219. }else {
  220. return "";
  221. }
  222. },
  223. },
  224. {
  225. title: "跟进操作",
  226. dataIndex: "abc",
  227. key: "abc",
  228. render: (text, record, index) => {
  229. return (
  230. <div style={{
  231. display: 'flex',
  232. flexFlow:'row',
  233. alignItems:'center',
  234. }}>
  235. <Button
  236. onClick={(e) => {
  237. e.stopPropagation(), this.visit(record);
  238. }}
  239. type="primary"
  240. >
  241. 客户跟进
  242. </Button>
  243. </div>
  244. );
  245. },
  246. },
  247. {
  248. title: "指导意见",
  249. dataIndex: "guidance",
  250. key: "guidance",
  251. render: (text, record, index) => {
  252. return (
  253. <div style={{
  254. display: 'flex',
  255. flexFlow:'row',
  256. alignItems:'center',
  257. }}>
  258. {/*指导 0无 1未读 2已读*/}
  259. {text === 1 || text === 2 ? <Button
  260. style={text === 1 ? {
  261. background:'#F00000',
  262. borderColor:'#F00000'
  263. } : {}}
  264. onClick={(e)=>{
  265. e.stopPropagation();
  266. this.guidanceRead(record.uid).then(()=>{
  267. this.setState({
  268. tabsKey:"4",
  269. },()=>{
  270. this.tableRowClick(record)
  271. })
  272. })
  273. }}
  274. type="primary"
  275. >
  276. {text === 1 ? '未读' : '查看'}
  277. </Button> : <div>暂无指导</div>}
  278. </div>
  279. );
  280. },
  281. }
  282. ],
  283. tabsKey:'',
  284. data: [],
  285. dataman: [],
  286. dataSource: [],
  287. visitArrList: [],
  288. searchTime: [,],
  289. };
  290. },
  291. //已读指导记录
  292. guidanceRead(id) {
  293. return new Promise((resolve,reject)=>{
  294. $.ajax({
  295. method: "post",
  296. dataType: "json",
  297. crossDomain: false,
  298. url: globalConfig.context + "/api/admin/customer/pushGuidance",
  299. data: {
  300. uid: id,
  301. }
  302. }).done(function(data) {
  303. if(!data.error.length) {
  304. resolve();
  305. } else {
  306. message.warning(data.error[0].message);
  307. reject();
  308. };
  309. }.bind(this));
  310. })
  311. },
  312. rankO(rank) {
  313. let deletedIds ='';
  314. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  315. let rowItem = this.state.selectedRows[idx];
  316. if (rowItem.id) {
  317. deletedIds = this.state.selectedRows.length-1 === idx ? deletedIds +rowItem.id : deletedIds + rowItem.id + ',';
  318. }
  319. }
  320. $.ajax({
  321. method: "get",
  322. dataType: "json",
  323. crossDomain: false,
  324. url: globalConfig.context + "/api/admin/customer/updateUserLevel",
  325. data: {
  326. id: deletedIds, //客户的ID
  327. level: rank,
  328. },
  329. }).done(
  330. function (data) {
  331. if (!data.error.length && data.data !== 0) {
  332. message.success("操作成功!");
  333. this.setState({
  334. loading: false,
  335. });
  336. this.loadData(this.state.ispage);
  337. } else {
  338. message.warning(data.data === 0 ? '操作失败,请联系管理员!' : data.error[0].message);
  339. }
  340. }.bind(this)
  341. );
  342. },
  343. //进入新增拜访记录
  344. visit(e) {
  345. this.setState({
  346. followData: e,
  347. visitModul: true,
  348. modalVisible: false,
  349. });
  350. },
  351. //列表删除功能
  352. delectRow() {
  353. let deletedIds='';
  354. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  355. let rowItem = this.state.selectedRows[idx];
  356. if (rowItem.id) {
  357. deletedIds = this.state.selectedRows.length-1 === idx ? deletedIds +rowItem.id : deletedIds + rowItem.id + ',';
  358. }
  359. }
  360. this.setState({
  361. loading: true,
  362. selectedRowKeys: [],
  363. });
  364. $.ajax({
  365. method: "get",
  366. dataType: "json",
  367. crossDomain: false,
  368. url: globalConfig.context + "/api/admin/customer/deleteCustomer",
  369. data: {
  370. uid: deletedIds, //删除的ID
  371. },
  372. }).done(
  373. function (data) {
  374. if (!data.error.length) {
  375. message.success("删除成功!");
  376. this.setState({
  377. loading: false,
  378. });
  379. } else {
  380. message.warning(data.error[0].message);
  381. }
  382. this.loadData(this.state.ispage);
  383. }.bind(this)
  384. );
  385. },
  386. componentWillMount() {
  387. //城市
  388. let Province = [];
  389. provinceList.map(function (item) {
  390. var id = String(item.id);
  391. Province.push(
  392. <Select.Option value={id} key={item.name}>
  393. {item.name}
  394. </Select.Option>
  395. );
  396. });
  397. //行业
  398. let intentionalArr = [];
  399. industry.map(function (item) {
  400. intentionalArr.push(
  401. <Select.Option value={item.value} key={item.key}>
  402. {item.key}
  403. </Select.Option>
  404. );
  405. });
  406. //会员等级
  407. let lvlArr = [];
  408. lvl.map(function (item) {
  409. lvlArr.push(
  410. <Select.Option value={item.value} key={item.key}>
  411. {item.key}
  412. </Select.Option>
  413. );
  414. });
  415. //会员状态customerStatus
  416. let currentMemberArr = [];
  417. currentMember.map(function (item) {
  418. currentMemberArr.push(
  419. <Select.Option value={item.value} key={item.key}>
  420. {item.key}
  421. </Select.Option>
  422. );
  423. });
  424. this.state.Provinces = Province;
  425. this.state.intentionalOption = intentionalArr;
  426. this.state.lvlArrOption = lvlArr;
  427. this.state.currentMemberArrOption = currentMemberArr;
  428. this.loadData();
  429. this.category();
  430. },
  431. addClick() {
  432. this.state.RowData = {};
  433. this.setState({
  434. detailApi: this.props.detailApi,
  435. showDesc: true,
  436. modalVisible: false,
  437. visitModul: false,
  438. });
  439. },
  440. closeDesc(e, s) {
  441. this.state.basicState = e;
  442. this.state.visitModul = e;
  443. this.state.modalVisible = e;
  444. this.state.showDesc = e;
  445. this.setState({
  446. tabsKey: '',
  447. })
  448. if (s) {
  449. this.loadData(this.state.ispage);
  450. }
  451. },
  452. search() {
  453. this.loadData();
  454. },
  455. reset() {
  456. this.state.nameSearch = "";
  457. this.state.level = undefined;
  458. this.state.addressSearch = [];
  459. this.state.provinceSearch = undefined;
  460. this.state.citySearch = undefined;
  461. this.state.releaseDate[0] = undefined;
  462. this.state.releaseDate[1] = undefined;
  463. this.loadData();
  464. },
  465. searchSwitch() {
  466. this.setState({
  467. visitModul: false,
  468. searchMore: !this.state.searchMore,
  469. });
  470. },
  471. //整行点击
  472. tableRowClick(record, index) {
  473. this.state.visitModul = false;
  474. this.state.RowData = record;
  475. this.setState({
  476. // selectedRowKeys: [],
  477. modalVisible: true,
  478. basicState: true,
  479. contactState: true,
  480. modalName: record.name
  481. });
  482. },
  483. //指定转交人自动补全
  484. supervisor(e) {
  485. $.ajax({
  486. method: "get",
  487. dataType: "json",
  488. crossDomain: false,
  489. url: globalConfig.context + "/api/admin/customer/listAdminByName",
  490. data: {
  491. adminName: e,
  492. },
  493. success: function (data) {
  494. let thedata = data.data;
  495. if (!thedata) {
  496. if (data.error && data.error.length) {
  497. message.warning(data.error[0].message);
  498. }
  499. thedata = {};
  500. }
  501. this.setState({
  502. customerArr: thedata,
  503. });
  504. }.bind(this),
  505. }).always(
  506. function () {
  507. this.setState({
  508. loading: false,
  509. });
  510. }.bind(this)
  511. );
  512. },
  513. //上级主管输入框失去焦点是判断客户是否存在
  514. selectAuto(value, options) {
  515. this.setState({
  516. auto: value,
  517. });
  518. },
  519. blurChange(e) {
  520. let theType = "";
  521. let contactLists = this.state.customerArr || [];
  522. if (e) {
  523. contactLists.map(function (item) {
  524. if (item.name == e.toString()) {
  525. theType = item.id;
  526. }
  527. });
  528. }
  529. this.setState({
  530. theTypes: theType,
  531. });
  532. },
  533. //值改变时请求客户名称
  534. httpChange(e) {
  535. if (e.length >= 1) {
  536. this.supervisor(e);
  537. }
  538. this.setState({
  539. auto: e,
  540. });
  541. },
  542. //转交
  543. changeAssigner() {
  544. if (this.state.theTypes) {
  545. let changeIds = '';
  546. let oldAid = '';
  547. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  548. let rowItem = this.state.selectedRows[idx];
  549. if (rowItem.id) {
  550. oldAid = rowItem.aid;
  551. changeIds = this.state.selectedRows.length-1 === idx ? changeIds +rowItem.id : changeIds + rowItem.id + ',' ;
  552. }
  553. }
  554. $.ajax({
  555. method: "get",
  556. dataType: "json",
  557. crossDomain: false,
  558. url: globalConfig.context + "/api/admin/customer/transferToOther",
  559. data: {
  560. uid: changeIds, //这一行数据的ID
  561. aid: this.state.theTypes, //指定转交人的ID
  562. oldAid: oldAid,
  563. },
  564. }).done(
  565. function (data) {
  566. if (!data.error.length) {
  567. message.success("转交成功!");
  568. this.setState({
  569. auto: "",
  570. loading: false,
  571. selectedRowKeys: [],
  572. });
  573. } else {
  574. message.warning(data.error[0].message);
  575. }
  576. this.loadData(
  577. Math.min(
  578. this.state.ispage == undefined ? 1 : this.state.ispage,
  579. Math.ceil((this.state.pagination.total - 1) / 10)
  580. )
  581. );
  582. }.bind(this)
  583. );
  584. } else {
  585. message.warning("请输入转交人姓名");
  586. }
  587. },
  588. //导出
  589. exportExec() {
  590. let departmentName = "",
  591. depart = this.state.departmentArr || [];
  592. depart.map((item) => {
  593. if (this.state.departmentId == item.id) {
  594. departmentName = item.name;
  595. return;
  596. }
  597. });
  598. let data = {
  599. name: this.state.nameSearch,
  600. province: this.state.provinceSearch,
  601. city: this.state.addressSearch,
  602. level: this.state.level,
  603. startDate: this.state.releaseDate[0],
  604. endDate: this.state.releaseDate[1],
  605. };
  606. window.location.href =
  607. globalConfig.context +
  608. "/api/admin/customer/privateUnitCustomerOutXls?" +
  609. $.param(data);
  610. },
  611. componentWillReceiveProps(nextProps) {
  612. if (nextProps.ApiUrl != this.props.ApiUrl) {
  613. if (!this.state.searchMore) {
  614. this.state.searchMore = true;
  615. }
  616. this.state.nameSearch = "";
  617. this.state.addressSearch = [];
  618. this.state.provinceSearch = undefined;
  619. this.state.citySearch = undefined;
  620. this.state.releaseDate[0] = undefined;
  621. this.state.releaseDate[1] = undefined;
  622. this.loadData(null, nextProps.ApiUrl);
  623. }
  624. },
  625. zhuanjiaoDetail(record) {
  626. this.setState({
  627. zhuanjiaoVisible: true,
  628. zhuanjiaoId: record.id,
  629. });
  630. },
  631. zhuanjiaoDetailCancel() {
  632. this.setState({
  633. zhuanjiaoVisible: false,
  634. });
  635. },
  636. showConfirm(fn, record) {
  637. Modal.confirm({
  638. title: "提示",
  639. content: (
  640. <span style={{ color: "red" }}>
  641. 确定要转交以下客户吗?
  642. {
  643. this.state.selectedRows.map((value,index)=>(
  644. <div key={index} style={{marginTop:'5px',color: "#000"}}>
  645. {value.name}
  646. </div>
  647. ))
  648. }
  649. </span>
  650. ),
  651. onOk() {
  652. fn(record);
  653. },
  654. onCancel() {},
  655. });
  656. },
  657. showConfirms(fn, record) {
  658. Modal.confirm({
  659. title: "您确定将以下客户移至公共客户吗?",
  660. content: (
  661. <span style={{ color: "red" }}>
  662. 移除后,以下客户将被别人领取!
  663. {
  664. this.state.selectedRows.map((value,index)=>(
  665. <div key={index} style={{marginTop:'5px',color: "#000"}}>
  666. {value.name}
  667. </div>
  668. ))
  669. }
  670. </span>
  671. ),
  672. onOk() {
  673. fn(record);
  674. },
  675. onCancel() {},
  676. });
  677. },
  678. release() {
  679. this.setState({
  680. loading: true
  681. })
  682. let deletedIds='';
  683. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  684. let rowItem = this.state.selectedRows[idx];
  685. if (rowItem.id) {
  686. deletedIds = this.state.selectedRows.length-1 === idx ? deletedIds +rowItem.id : deletedIds + rowItem.id + ',';
  687. }
  688. }
  689. $.ajax({
  690. method: "get",
  691. dataType: "json",
  692. crossDomain: false,
  693. url: globalConfig.context + "/api/admin/customer/pushReleaseUser",
  694. data: {
  695. id: deletedIds,
  696. },
  697. success: function (data) {
  698. let thedata = data.data;
  699. if (!thedata) {
  700. if (data.error && data.error.length) {
  701. message.warning(data.error[0].message);
  702. }
  703. thedata = {};
  704. }else {
  705. message.success("移除成功");
  706. this.loadData()
  707. }
  708. }.bind(this),
  709. }).always(
  710. function () {
  711. this.setState({
  712. loading: false,
  713. });
  714. }.bind(this)
  715. );
  716. },
  717. render() {
  718. const FormItem = Form.Item;
  719. const rowSelection = {
  720. hideDefaultSelections: true,
  721. selectedRowKeys: this.state.selectedRowKeys,
  722. onChange: (selectedRowKeys, selectedRows) => {
  723. this.setState({
  724. modalVisible: false,
  725. selectedRows: selectedRows,
  726. selectedRowKeys: selectedRowKeys,
  727. });
  728. },
  729. onSelect: (recordt, selected, selectedRows) => {
  730. this.setState({
  731. modalVisible: false,
  732. recordt: recordt.id,
  733. });
  734. },
  735. };
  736. const hasSelected = this.state.selectedRowKeys.length > 0;
  737. const { RangePicker } = DatePicker;
  738. const dataSources = this.state.customerArr || [];
  739. const options = dataSources.map((group) => (
  740. <Select.Option key={group.id} value={group.name}>
  741. {group.name}
  742. </Select.Option>
  743. ));
  744. const intentionState = this.props.intentionState || "";
  745. return (
  746. <div className="user-content">
  747. <ShowModalDiv ShowModal={this.state.showModal} />
  748. <div className="content-title">
  749. <span>{!intentionState ? "私有单位客户" : "私有专家客户"}</span>
  750. </div>
  751. <div className="user-search">
  752. <Tabs
  753. defaultActiveKey="1"
  754. onChange={this.callback}
  755. className="test"
  756. >
  757. <TabPane tab="搜索" key="1">
  758. <Input
  759. placeholder="客户名称"
  760. value={this.state.nameSearch}
  761. style={{ width: 150, marginRight: 10, marginLeft: 10 }}
  762. onChange={(e) => {
  763. this.setState({ nameSearch: e.target.value });
  764. }}
  765. />
  766. <Select
  767. placeholder="省"
  768. style={{ width: 80 }}
  769. value={this.state.provinceSearch}
  770. onChange={(e) => {
  771. this.setState({ provinceSearch: e });
  772. }}
  773. >
  774. {this.state.Provinces}
  775. </Select>
  776. <span style={{ marginRight: "10px" }}>
  777. <Cascader
  778. options={citySelect()}
  779. value={this.state.addressSearch}
  780. placeholder="选择城市"
  781. onChange={(e, pre) => {
  782. this.setState({ addressSearch: e });
  783. }}
  784. />
  785. </span>
  786. <Select
  787. style={{ width: 120 }}
  788. value={this.state.level}
  789. onChange={(e) => {
  790. this.setState({ level: e });
  791. }}
  792. placeholder="请选择客户等级"
  793. >
  794. <Select.Option value="0">一般客户</Select.Option>
  795. <Select.Option value="1">意向客户</Select.Option>
  796. <Select.Option value="2">重点客户</Select.Option>
  797. </Select>
  798. <RangePicker
  799. value={[
  800. this.state.releaseDate[0]
  801. ? moment(this.state.releaseDate[0])
  802. : null,
  803. this.state.releaseDate[1]
  804. ? moment(this.state.releaseDate[1])
  805. : null,
  806. ]}
  807. onChange={(data, dataString) => {
  808. this.setState({ releaseDate: dataString });
  809. }}
  810. />
  811. <Button
  812. type="primary"
  813. style={{ marginLeft: "10px", marginRight: 10 }}
  814. onClick={this.search}
  815. >
  816. 搜索
  817. </Button>
  818. <Button onClick={this.reset}>重置</Button>
  819. </TabPane>
  820. {/*<Button onClick={() => { window.open(globalConfig.context + '/api/admin/customer/downloadTemplate?type=1') }}>下载批量导入模板</Button>
  821. <Upload
  822. name="file"
  823. action={globalConfig.context + "/api/admin/customer/uploadExcel"}
  824. beforeUpload={beforeUploadFile}
  825. showUploadList={false}
  826. onChange={(info) => {
  827. if (info.file.status !== 'uploading') {
  828. console.log(info.file, info.fileList);
  829. }
  830. if (info.file.status === 'done') {
  831. if (!info.file.response.error.length) {
  832. message.success(`${info.file.name} 文件上传成功!`);
  833. this.loadData();
  834. } else {
  835. message.warning(info.file.response.error[0].message);
  836. return;
  837. };
  838. } else if (info.file.status === 'error') {
  839. message.error(`${info.file.name} 文件上传失败。`);
  840. };
  841. }} >
  842. <Button>上传批量内容</Button>
  843. </Upload>
  844. {adminData.isSuperAdmin?<Popconfirm title="是否删除?" onConfirm={this.delectRow} okText="是" cancelText="否">
  845. <Button type="danger" style={{marginLeft:'10px'}}
  846. disabled={!hasSelected}
  847. >删除<Icon type="minus" />
  848. </Button>
  849. </Popconfirm>:''
  850. }*/}
  851. <TabPane tab="操作" key="2">
  852. <AutoComplete
  853. className="certain-category-search"
  854. dropdownClassName="certain-category-search-dropdown"
  855. dropdownMatchSelectWidth={false}
  856. dropdownStyle={{ width: 120 }}
  857. style={{ width: "120px" }}
  858. dataSource={options}
  859. placeholder="输入转交人姓名"
  860. value={this.state.auto}
  861. onChange={this.httpChange}
  862. filterOption={true}
  863. onBlur={this.blurChange}
  864. onSelect={this.selectAuto}
  865. disabled={!hasSelected}
  866. >
  867. <Input />
  868. </AutoComplete>
  869. <Button
  870. type="primary"
  871. // onClick={this.changeAssigner}
  872. onClick={(e) => {
  873. e.stopPropagation();
  874. this.showConfirm(this.changeAssigner);
  875. }}
  876. disabled={!hasSelected}
  877. style={{ marginRight: 10 }}
  878. >
  879. 转交
  880. </Button>
  881. <Button
  882. type="primary"
  883. style={{
  884. float: "right",
  885. marginTop: 10,
  886. marginLeft: 10,
  887. marginRight: 10,
  888. }}
  889. onClick={this.addClick}
  890. >
  891. 新增客户
  892. <Icon type="plus" />
  893. </Button>
  894. {/*<Button type="default" className="addButton" onClick={this.exportExec}>导出excel<Icon type="plus" /></Button>*/}
  895. {/* <div className="clearfix" style={{ marginTop: "5px" }}> */}
  896. <Button
  897. onClick={(e) => {
  898. e.stopPropagation(), this.rankO(0);
  899. }}
  900. type="primary"
  901. style={{ marginRight: "10px" }}
  902. disabled={!hasSelected}
  903. >
  904. 一般客户
  905. </Button>
  906. <Button
  907. onClick={(e) => {
  908. e.stopPropagation(), this.rankO(1);
  909. }}
  910. type="primary"
  911. style={{ marginRight: "10px" }}
  912. disabled={!hasSelected}
  913. >
  914. 意向客户
  915. </Button>
  916. <Button
  917. onClick={(e) => {
  918. e.stopPropagation(), this.rankO(2);
  919. }}
  920. type="primary"
  921. disabled={!hasSelected}
  922. >
  923. 重点客户
  924. </Button>
  925. <Button
  926. style={{ marginLeft: 10 }}
  927. onClick={(e) => {
  928. e.stopPropagation(),
  929. this.zhuanjiaoDetail(this.state.selectedRows[0]);
  930. }}
  931. type="primary"
  932. disabled={!hasSelected || this.state.selectedRows.length > 1}
  933. >
  934. 转交记录
  935. </Button>
  936. <Button
  937. style={{ marginLeft: 10 }}
  938. onClick={(e) => {
  939. e.stopPropagation(), this.showConfirms(this.release);
  940. }}
  941. type="primary"
  942. disabled={!hasSelected}
  943. >
  944. 移除客户
  945. </Button>
  946. </TabPane>
  947. </Tabs>
  948. </div>
  949. <div className="patent-table">
  950. <Spin spinning={this.state.loading}>
  951. <Table
  952. className={'intentionCustomerTable'}
  953. columns={this.state.columns}
  954. dataSource={this.state.dataSource}
  955. rowSelection={rowSelection}
  956. pagination={this.state.pagination}
  957. onRowDoubleClick={this.tableRowClick}
  958. />
  959. </Spin>
  960. </div>
  961. <AddIntention
  962. api={this.state.detailApi}
  963. showDesc={this.state.showDesc}
  964. closeDesc={this.closeDesc}
  965. />
  966. <FollowDetail
  967. categoryArr={this.state.categoryArr}
  968. followData={this.state.followData}
  969. visitModul={this.state.visitModul}
  970. closeDesc={this.closeDesc}
  971. />
  972. <IntentionDetail
  973. tabsKey={this.state.tabsKey}
  974. categoryArr={this.state.categoryArr}
  975. detailApi={this.props.detailApi}
  976. IntentionData={this.state.RowData}
  977. modalVisible={this.state.modalVisible}
  978. name={this.state.modalName}
  979. closeDesc={this.closeDesc}
  980. basicState={this.state.basicState}
  981. contactState={this.state.contactState}
  982. />
  983. {this.state.zhuanjiaoVisible ? (
  984. <ZhuanjiaoDetail
  985. cancel={this.zhuanjiaoDetailCancel}
  986. visible={this.state.zhuanjiaoVisible}
  987. id={this.state.zhuanjiaoId}
  988. />
  989. ) : (
  990. ""
  991. )}
  992. </div>
  993. );
  994. },
  995. })
  996. );
  997. export default IntentionCustomer;