intentionCustomer.jsx 28 KB

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