intentionCustomer.jsx 30 KB

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