intentionCustomer.jsx 30 KB

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