intentionCustomer.jsx 29 KB

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