intentionCustomer.jsx 30 KB

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