intentionCustomer.jsx 29 KB

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