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