index.jsx 27 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945
  1. // 渠道列表
  2. import React, { Component } from "react";
  3. import {
  4. Form,
  5. Button,
  6. message,
  7. Spin,
  8. Input,
  9. DatePicker,
  10. Select,
  11. Tabs,
  12. Table,
  13. Modal,
  14. AutoComplete,
  15. } from "antd";
  16. import { ChooseList } from "../../../manageCenter/order/orderNew/chooseList";
  17. import { provinceList } from "../../../NewDicProvinceList";
  18. import $ from "jquery/src/ajax";
  19. import { ShowModal } from "@/tools";
  20. import moment from "moment";
  21. import AddChannel from "./addchannel"; //新增渠道
  22. import ChannelLog from "./channellog"; //转交日志
  23. import ChangeLog from "./changelog"; //更名日志
  24. import ChannelDetail from "./channeldetail"; //渠道详情
  25. import FollowDetail from "../../../../component/manageCenter/customer/NEW/intentionCustomer/followDetail";//新增渠道跟进
  26. const { TabPane } = Tabs;
  27. const FormItem = Form.Item;
  28. const Option = Select.Option;
  29. const { RangePicker } = DatePicker;
  30. class ChannelUnit extends Component {
  31. constructor(props) {
  32. super(props);
  33. this.state = {
  34. query: { type: 1 },
  35. changeList: undefined,
  36. selectedRowKeys: [],
  37. columns: [
  38. {
  39. title: "渠道名称",
  40. dataIndex: "name",
  41. key: "name",
  42. },
  43. {
  44. title: "地区",
  45. dataIndex: "province",
  46. key: "province",
  47. render: (text, record) => {
  48. return record.province + "-" + record.city + "-" + record.area;
  49. },
  50. },
  51. {
  52. title: "渠道类别",
  53. dataIndex: "type",
  54. key: "type",
  55. render: (text) =>
  56. [
  57. "",
  58. "政府部门",
  59. "民主党派",
  60. "园区",
  61. "民间组织",
  62. "其他战略合作单位",
  63. ][text],
  64. },
  65. {
  66. title: "初始时间",
  67. dataIndex: "createTime",
  68. key: "createTime",
  69. },
  70. {
  71. title: "跟进人",
  72. dataIndex: "aName",
  73. key: "aName",
  74. },
  75. {
  76. title: "剩余天数",
  77. dataIndex: "remainingDays",
  78. key: "remainingDays",
  79. },
  80. {
  81. title: "跟进操作",
  82. dataIndex: "op",
  83. key: "op",
  84. render: (text, record) => (
  85. <Button
  86. type="primary"
  87. onClick={(e) => {
  88. e.stopPropagation();
  89. this.setState({
  90. followData: record,
  91. visitModuls: true,
  92. });
  93. }}
  94. >
  95. 渠道跟进
  96. </Button>
  97. ),
  98. },
  99. ],
  100. dataSource: [],
  101. pagination: {
  102. defaultCurrent: 1,
  103. defaultPageSize: 10,
  104. showQuickJumper: true,
  105. pageSize: 10,
  106. onChange: function (page) {
  107. this.loadData(page);
  108. }.bind(this),
  109. showTotal: function (total) {
  110. return "共" + total + "条数据";
  111. },
  112. },
  113. channeOb: [
  114. { name: "政府部门", val: 1 },
  115. { name: "民主党派", val: 2 },
  116. { name: "园区", val: 3 },
  117. { name: "民间组织", val: 4 },
  118. { name: "其他战略合作单位", val: 5 },
  119. ],
  120. fjlist: [], // 查询到的更进人列表
  121. loading: false,
  122. cityList: [],
  123. areaList: [],
  124. searchInfor: {}, // 查询条件
  125. mvisible: "", //控制弹窗变量
  126. customerArr: [], //查询到的转交人列表
  127. rowdata: {}, //双击行数据
  128. categoryArr: [],
  129. visitModuls: false,
  130. };
  131. this.tabelContentRef = null;
  132. this.autoCompleteSearchRef = {};
  133. }
  134. componentWillMount() {
  135. this.loadData();
  136. this.category();
  137. }
  138. //
  139. getVal(arr, val) {
  140. if (!val || arr.length == 0) {
  141. return undefined;
  142. } else {
  143. for (const items of arr) {
  144. if (items.id == val) {
  145. return items.name;
  146. }
  147. }
  148. }
  149. }
  150. changeList(arr) {
  151. const newArr = [];
  152. this.state.columns.forEach((item) => {
  153. arr.forEach((val) => {
  154. if (val === item.title) {
  155. newArr.push(item);
  156. }
  157. });
  158. });
  159. this.setState({
  160. changeList: newArr,
  161. });
  162. }
  163. // 重置
  164. resetAll() {
  165. this.setState(
  166. {
  167. searchInfor: JSON.parse(JSON.stringify({})),
  168. selectedRowKeys: [],
  169. },
  170. () => {
  171. this.loadData();
  172. }
  173. );
  174. }
  175. // 列表接口
  176. loadData(pageNo) {
  177. const { searchInfor, pagination } = this.state;
  178. this.setState({
  179. loading: true,
  180. });
  181. let datas = Object.assign(searchInfor, {
  182. pageNo: pageNo || 1,
  183. pageSize: pagination.pageSize,
  184. });
  185. // delete datas.aname
  186. $.ajax({
  187. method: "get",
  188. dataType: "json",
  189. crossDomain: false,
  190. url: globalConfig.context + "/api/admin/customer/channelUserList",
  191. data: datas,
  192. success: function (data) {
  193. ShowModal(this);
  194. this.setState({
  195. loading: false,
  196. });
  197. if (data.error && data.error.length === 0) {
  198. if (data.data.list) {
  199. pagination.current = data.data.pageNo;
  200. pagination.total = data.data.totalCount;
  201. if (data.data && data.data.list && !data.data.list.length) {
  202. pagination.current = 0;
  203. pagination.total = 0;
  204. }
  205. this.setState({
  206. dataSource: data.data.list,
  207. pagination: this.state.pagination,
  208. pageNo: data.data.pageNo,
  209. });
  210. } else {
  211. this.setState({
  212. dataSource: data.data,
  213. pagination: false,
  214. });
  215. }
  216. } else {
  217. message.warning(data.error[0].message);
  218. }
  219. }.bind(this),
  220. }).always(
  221. function () {
  222. this.setState({
  223. loading: false,
  224. });
  225. }.bind(this)
  226. );
  227. }
  228. //值改变时请求客户名称
  229. httpChange(e) {
  230. if (e.length >= 1) {
  231. this.supervisor(e);
  232. }
  233. this.setState({
  234. auto: e,
  235. });
  236. }
  237. // 指定转交人自动补全
  238. supervisor(e) {
  239. $.ajax({
  240. method: "get",
  241. dataType: "json",
  242. crossDomain: false,
  243. url: globalConfig.context + "/api/admin/customer/listAdminByName",
  244. data: {
  245. adminName: e,
  246. },
  247. success: function (data) {
  248. let thedata = data.data;
  249. if (!thedata) {
  250. if (data.error && data.error.length) {
  251. message.warning(data.error[0].message);
  252. }
  253. thedata = {};
  254. }
  255. this.setState({
  256. customerArr: thedata,
  257. });
  258. }.bind(this),
  259. }).always(
  260. function () {
  261. this.setState({
  262. loading: false,
  263. });
  264. }.bind(this)
  265. );
  266. }
  267. // 失去焦点
  268. blurChange(e) {
  269. let theType = "";
  270. let contactLists = this.state.customerArr || [];
  271. if (e) {
  272. contactLists.map(function (item) {
  273. if (item.name == e.toString()) {
  274. theType = item.id;
  275. }
  276. });
  277. }
  278. this.setState({
  279. theTypes: theType,
  280. });
  281. }
  282. // 选择行
  283. onSelectChange(selectedRowKeys) {
  284. this.setState({ selectedRowKeys });
  285. }
  286. //
  287. addClick() {
  288. this.setState({
  289. mvisible: "add",
  290. });
  291. }
  292. // 关闭弹窗
  293. closeDesc() {
  294. this.setState({
  295. mvisible: "",
  296. });
  297. this.loadData();
  298. }
  299. // 转交提示
  300. showConfirm() {
  301. const { dataSource, selectedRowKeys } = this.state;
  302. if (!this.state.theTypes) {
  303. message.warning("请输入转交人姓名");
  304. return;
  305. }
  306. let _this = this;
  307. Modal.confirm({
  308. title: "提示",
  309. content: (
  310. <span style={{ color: "red" }}>
  311. 确定要转交以下渠道吗?
  312. {/* {this.state.selectedRowKeys.map((value, index) => (
  313. <div key={index} style={{ marginTop: "5px", color: "#000" }}>
  314. {value.name}
  315. </div>
  316. ))} */}
  317. <div style={{ marginTop: "5px", color: "#000" }}>
  318. {dataSource[selectedRowKeys[0]].name}
  319. </div>
  320. </span>
  321. ),
  322. onOk() {
  323. _this.setState({
  324. informationTransferVisible: true,
  325. });
  326. },
  327. onCancel() { },
  328. });
  329. }
  330. //转交
  331. changeAssigner(infor) {
  332. const { dataSource, selectedRowKeys } = this.state;
  333. if (this.state.theTypes) {
  334. this.setState({
  335. informationTransferVisible: false,
  336. });
  337. let changeIds = dataSource[selectedRowKeys[0]].id;
  338. let oldAid = dataSource[selectedRowKeys[0]].aid;
  339. let loading = message.loading("加载中...");
  340. $.ajax({
  341. method: "get",
  342. dataType: "json",
  343. crossDomain: false,
  344. url: globalConfig.context + "/api/admin/customer/transferToOther",
  345. data: {
  346. uid: changeIds, //这一行数据的ID
  347. aid: this.state.theTypes, //指定转交人的ID
  348. oldAid: oldAid, //原跟进人ID
  349. data: infor, // 资料是否一并转交 0否 1是
  350. },
  351. }).done(
  352. function (data) {
  353. loading();
  354. if (!data.error.length) {
  355. message.success("转交成功!");
  356. this.setState({
  357. auto: "",
  358. loading: false,
  359. selectedRowKeys: [],
  360. });
  361. } else {
  362. message.warning(data.error[0].message);
  363. }
  364. this.loadData(
  365. Math.min(
  366. this.state.ispage == undefined ? 1 : this.state.ispage,
  367. Math.ceil((this.state.pagination.total - 1) / 10)
  368. )
  369. );
  370. }.bind(this)
  371. );
  372. } else {
  373. message.warning("请输入转交人姓名");
  374. }
  375. }
  376. // 移出渠道
  377. remove() {
  378. const { dataSource, selectedRowKeys, ispage } = this.state;
  379. const _this = this
  380. Modal.confirm({
  381. title: "您确定将以下渠道移至公共渠道吗??",
  382. content: (
  383. <span style={{ color: "red" }}>
  384. 移除后,以下客户将被别人领取!
  385. <div style={{ marginTop: "5px", color: "#000" }}>
  386. {dataSource[selectedRowKeys[0]].name}
  387. </div>
  388. </span>
  389. ),
  390. onOk() {
  391. let deletedIds = dataSource[selectedRowKeys[0]].id;
  392. $.ajax({
  393. method: "get",
  394. dataType: "json",
  395. crossDomain: false,
  396. url: globalConfig.context + "/api/admin/customer/pushReleaseUser",
  397. data: {
  398. id: deletedIds,
  399. },
  400. success: function (data) {
  401. let thedata = data.data;
  402. if (!thedata) {
  403. if (data.error && data.error.length) {
  404. message.warning(data.error[0].message);
  405. }
  406. thedata = {};
  407. } else {
  408. message.success("移除成功");
  409. }
  410. _this.loadData(
  411. dataSource.length === 1
  412. ? ispage === 1
  413. ? 1
  414. : ispage - 1
  415. : ispage
  416. )
  417. }.bind(this),
  418. }).always(
  419. function () {
  420. _this.setState({
  421. loading: false,
  422. });
  423. }.bind(this)
  424. );
  425. },
  426. onCancel() { },
  427. });
  428. }
  429. selectAuto(value, options) {
  430. this.setState({
  431. auto: value,
  432. });
  433. }
  434. // 跟进人查询
  435. followUp(e) {
  436. const { searchInfor } = this.state;
  437. this.setState({
  438. searchInfor: Object.assign(searchInfor, {
  439. aname: e,
  440. }),
  441. });
  442. $.ajax({
  443. method: "get",
  444. dataType: "json",
  445. crossDomain: false,
  446. url: globalConfig.context + "/api/admin/customer/listAdminByName",
  447. data: {
  448. adminName: e,
  449. },
  450. success: function (data) {
  451. let thedata = data.data;
  452. if (!thedata) {
  453. if (data.error && data.error.length) {
  454. message.warning(data.error[0].message);
  455. }
  456. thedata = {};
  457. }
  458. this.setState({
  459. fjlist: thedata,
  460. });
  461. }.bind(this),
  462. }).always(
  463. function () {
  464. this.setState({
  465. loading: false,
  466. });
  467. }.bind(this)
  468. );
  469. }
  470. // 选中跟进人
  471. selectF(value) {
  472. const { searchInfor, fjlist } = this.state;
  473. const newdataSources = JSON.stringify(fjlist) == "{}" ? [] : fjlist;
  474. this.setState({
  475. searchInfor: Object.assign(searchInfor, {
  476. aid: newdataSources.find((item) => item.name == value).id,
  477. }),
  478. });
  479. }
  480. //品类数据获取
  481. category() {
  482. $.ajax({
  483. method: "get",
  484. dataType: "json",
  485. crossDomain: false,
  486. url: globalConfig.context + "/api/admin/Varieties/getSuperList",
  487. data: {},
  488. success: function (data) {
  489. let thedata = data.data;
  490. let theArr = [];
  491. if (!thedata) {
  492. if (data.error && data.error.length) {
  493. message.warning(data.error[0].message);
  494. }
  495. thedata = {};
  496. } else {
  497. thedata.map(function (item, index) {
  498. theArr.push({
  499. value: item.id,
  500. key: item.cname,
  501. });
  502. });
  503. }
  504. this.setState({
  505. categoryArr: theArr,
  506. });
  507. }.bind(this),
  508. });
  509. }
  510. //查看跟进记录列表
  511. loadVisit(pageNo) {
  512. this.setState({
  513. loading: true,
  514. });
  515. $.ajax({
  516. method: "get",
  517. dataType: "json",
  518. crossDomain: false,
  519. url: globalConfig.context + "/api/admin/customer/listFollowHistory",
  520. data: {
  521. pageNo: pageNo || 1,
  522. pageSize: this.state.paginations.pageSize,
  523. uid: this.props.data.id, //名称1
  524. },
  525. success: function (data) {
  526. let theArr = [];
  527. if (data.error.length || data.data.list == "") {
  528. if (data.error && data.error.length) {
  529. message.warning(data.error[0].message);
  530. }
  531. } else {
  532. for (let i = 0; i < data.data.list.length; i++) {
  533. let thisdata = data.data.list[i];
  534. theArr.push(thisdata);
  535. }
  536. this.state.paginations.current = data.data.pageNo;
  537. this.state.paginations.total = data.data.totalCount;
  538. this.setState({
  539. ispage: data.data.pageNo,
  540. });
  541. }
  542. if (data.data.list && !data.data.list.length) {
  543. this.state.paginations.current = 0;
  544. this.state.paginations.total = 0;
  545. }
  546. this.setState({
  547. visitArrList: theArr,
  548. paginations: this.state.paginations,
  549. });
  550. }.bind(this),
  551. }).always(
  552. function () {
  553. this.setState({
  554. loading: false,
  555. });
  556. }.bind(this)
  557. );
  558. }
  559. close(e, s) {
  560. this.setState({
  561. visitModuls: false,
  562. });
  563. }
  564. render() {
  565. const {
  566. columns,
  567. selectedRowKeys,
  568. cityList,
  569. areaList,
  570. changeList,
  571. searchInfor,
  572. channeOb,
  573. dataSource,
  574. } = this.state;
  575. const rowSelection = {
  576. selectedRowKeys,
  577. onChange: this.onSelectChange.bind(this),
  578. hideDefaultSelections: true,
  579. type: "radio",
  580. };
  581. const hasSelected = this.state.selectedRowKeys.length > 0;
  582. const dataSources = this.state.customerArr || [];
  583. const options = dataSources.map((group) => (
  584. <Select.Option key={group.id} value={group.name}>
  585. {group.name}
  586. </Select.Option>
  587. ));
  588. const newdataSources =
  589. JSON.stringify(this.state.fjlist) == "{}" ? [] : this.state.fjlist;
  590. const newoptions = newdataSources.map((group) => (
  591. <Select.Option key={group.id} value={group.name}>
  592. {group.name}
  593. </Select.Option>
  594. ));
  595. return (
  596. <div className="user-content">
  597. <div className="content-title" style={{ marginBottom: 10 }}>
  598. <span style={{ fontWeight: 900, fontSize: 16 }}>私有渠道列表</span>
  599. </div>
  600. <Tabs defaultActiveKey="1">
  601. <TabPane tab="搜索" key="1">
  602. <div>
  603. <Form layout="inline">
  604. <FormItem>
  605. <Input
  606. placeholder={"请输入渠道名称"}
  607. value={searchInfor.name || undefined}
  608. onChange={(e) => {
  609. this.setState({
  610. searchInfor: Object.assign(searchInfor, {
  611. name: e.target.value,
  612. }),
  613. });
  614. }}
  615. />
  616. </FormItem>
  617. <FormItem>
  618. <Select
  619. placeholder={"选择省份"}
  620. style={{ width: 100 }}
  621. value={this.getVal(provinceList, searchInfor.province)}
  622. onChange={(e) => {
  623. for (const items of provinceList) {
  624. if (items.id == e) {
  625. this.setState({
  626. cityList: items.cityList,
  627. areaList: [],
  628. searchInfor: Object.assign(searchInfor, {
  629. province: items.id,
  630. city: undefined,
  631. area: undefined,
  632. }),
  633. });
  634. }
  635. }
  636. }}
  637. >
  638. {provinceList.map((item, index) => (
  639. <Option key={item.id}>{item.name}</Option>
  640. ))}
  641. </Select>
  642. </FormItem>
  643. <FormItem>
  644. <Select
  645. placeholder={"选择城市"}
  646. style={{ width: 100 }}
  647. value={this.getVal(cityList, searchInfor.city)}
  648. onChange={(e) => {
  649. for (const items of cityList) {
  650. if (items.id == e) {
  651. this.setState({
  652. areaList: items.areaList,
  653. searchInfor: Object.assign(searchInfor, {
  654. city: items.id,
  655. area: undefined,
  656. }),
  657. });
  658. }
  659. }
  660. }}
  661. >
  662. {cityList.map((cit, cin) => (
  663. <Option key={cit.id}>{cit.name}</Option>
  664. ))}
  665. </Select>
  666. </FormItem>
  667. <FormItem>
  668. <Select
  669. placeholder={"选择地区"}
  670. style={{ width: 100 }}
  671. value={this.getVal(areaList, searchInfor.area)}
  672. onChange={(e) => {
  673. for (const items of areaList) {
  674. if (items.id == e) {
  675. this.setState({
  676. searchInfor: Object.assign(searchInfor, {
  677. area: items.id,
  678. }),
  679. });
  680. }
  681. }
  682. }}
  683. >
  684. {areaList.map((cit, cin) => (
  685. <Option key={cit.id}>{cit.name}</Option>
  686. ))}
  687. </Select>
  688. </FormItem>
  689. {/* <FormItem>
  690. <AutoComplete
  691. className="certain-category-search"
  692. dropdownClassName="certain-category-search-dropdown"
  693. dropdownMatchSelectWidth={false}
  694. style={{ width: "120px" }}
  695. dataSource={newoptions}
  696. placeholder="跟进人"
  697. value={searchInfor.aname || undefined}
  698. onChange={this.followUp.bind(this)}
  699. filterOption={true}
  700. onSelect={this.selectF.bind(this)}
  701. >
  702. <Input />
  703. </AutoComplete>
  704. </FormItem> */}
  705. <FormItem>
  706. <Select
  707. placeholder={"渠道类型"}
  708. style={{ width: 130 }}
  709. value={searchInfor.type || undefined}
  710. onChange={(e) => {
  711. this.setState({
  712. searchInfor: Object.assign(searchInfor, {
  713. type: e,
  714. }),
  715. });
  716. }}
  717. >
  718. {channeOb.map((it, ins) => (
  719. <Option key={it.val}>{it.name}</Option>
  720. ))}
  721. </Select>
  722. </FormItem>
  723. <FormItem>
  724. <RangePicker
  725. value={[
  726. searchInfor.startDate
  727. ? moment(searchInfor.startDate)
  728. : null,
  729. searchInfor.endDate ? moment(searchInfor.endDate) : null,
  730. ]}
  731. onChange={(data, dataString) => {
  732. this.setState({
  733. searchInfor: Object.assign(searchInfor, {
  734. startDate: dataString[0],
  735. endDate: dataString[1],
  736. }),
  737. });
  738. }}
  739. />
  740. </FormItem>
  741. <Button
  742. type="primary"
  743. onClick={() => {
  744. this.loadData();
  745. }}
  746. style={{ marginRight: "10px" }}
  747. >
  748. 搜索
  749. </Button>
  750. <Button
  751. onClick={this.resetAll.bind(this)}
  752. style={{ marginRight: "10px" }}
  753. >
  754. 重置
  755. </Button>
  756. </Form>
  757. </div>
  758. </TabPane>
  759. <TabPane tab="操作" key="2">
  760. <div
  761. style={{
  762. marginLeft: 10,
  763. paddingBottom: 10,
  764. display: "flex",
  765. }}
  766. >
  767. <div style={{ flex: 1 }}>
  768. <AutoComplete
  769. className="certain-category-search"
  770. dropdownClassName="certain-category-search-dropdown"
  771. dropdownMatchSelectWidth={false}
  772. style={{ width: "120px" }}
  773. dataSource={options}
  774. placeholder="输入转交人姓名"
  775. value={this.state.auto}
  776. onChange={this.httpChange.bind(this)}
  777. filterOption={true}
  778. onBlur={this.blurChange.bind(this)}
  779. onSelect={this.selectAuto.bind(this)}
  780. disabled={!hasSelected}
  781. >
  782. <Input />
  783. </AutoComplete>
  784. <Button
  785. type="primary"
  786. onClick={this.showConfirm.bind(this)}
  787. style={{ marginLeft: 10 }}
  788. disabled={!hasSelected}
  789. >
  790. 转交
  791. </Button>
  792. <Button
  793. type="primary"
  794. onClick={() => {
  795. this.setState({
  796. mvisible: "channellog",
  797. });
  798. }}
  799. style={{ marginLeft: "10px" }}
  800. disabled={!hasSelected}
  801. >
  802. 渠道日志
  803. </Button>
  804. <Button
  805. type="primary"
  806. onClick={this.remove.bind(this)}
  807. style={{ marginLeft: "10px" }}
  808. disabled={!hasSelected}
  809. >
  810. 移出渠道
  811. </Button>
  812. <Button
  813. type="primary"
  814. onClick={() => {
  815. this.setState({
  816. mvisible: "changelog",
  817. });
  818. }}
  819. style={{ marginLeft: "10px" }}
  820. disabled={!hasSelected}
  821. >
  822. 更改日志
  823. </Button>
  824. </div>
  825. <Button
  826. type="primary"
  827. onClick={this.addClick.bind(this)}
  828. style={{ marginLeft: "10px" }}
  829. >
  830. 新增渠道
  831. </Button>
  832. </div>
  833. </TabPane>
  834. <TabPane tab="更改表格显示数据" key="3">
  835. <div style={{ marginLeft: 10 }}>
  836. <ChooseList
  837. columns={columns}
  838. changeFn={this.changeList.bind(this)}
  839. changeList={changeList}
  840. top={55}
  841. margin={11}
  842. />
  843. </div>
  844. </TabPane>
  845. </Tabs>
  846. <div className="patent-table">
  847. <Spin spinning={this.state.loading}>
  848. <Table
  849. bordered
  850. size="middle"
  851. // scroll={this.state.scroll}
  852. columns={changeList ? changeList : columns}
  853. onRowDoubleClick={(e) => {
  854. this.setState({
  855. mvisible: "detail",
  856. rowdata: e,
  857. });
  858. }}
  859. dataSource={this.state.dataSource}
  860. pagination={this.state.pagination}
  861. rowSelection={rowSelection}
  862. />
  863. </Spin>
  864. </div>
  865. {this.state.informationTransferVisible && (
  866. <Modal
  867. visible={this.state.informationTransferVisible}
  868. title="提醒"
  869. onCancel={() => {
  870. this.setState({
  871. informationTransferVisible: false,
  872. });
  873. }}
  874. footer={[
  875. <Button
  876. key="1"
  877. size="large"
  878. type={"primary"}
  879. onClick={() => {
  880. this.changeAssigner(1);
  881. }}
  882. >
  883. 需要
  884. </Button>,
  885. <Button
  886. key="2"
  887. size="large"
  888. type={"danger"}
  889. onClick={() => {
  890. this.changeAssigner(0);
  891. }}
  892. >
  893. 不需要
  894. </Button>,
  895. ]}
  896. >
  897. 请确定,是否将客户资料一并转交!选择“需要”,系统将全部客户资料一并转交!选择“不需要”,原客户资料保存您的客户资料中,请注意客户资料的更新维护,谢谢
  898. </Modal>
  899. )}
  900. {this.state.mvisible == "add" && (
  901. <AddChannel
  902. showDesc={this.state.mvisible}
  903. closeDesc={this.closeDesc.bind(this)}
  904. />
  905. )}
  906. {this.state.mvisible == "channellog" && (
  907. <ChannelLog
  908. cancel={this.closeDesc.bind(this)}
  909. visible={this.state.mvisible}
  910. id={dataSource[selectedRowKeys[0]].id}
  911. />
  912. )}
  913. {this.state.mvisible == "changelog" && (
  914. <ChangeLog
  915. cancel={this.closeDesc.bind(this)}
  916. visible={this.state.mvisible}
  917. id={dataSource[selectedRowKeys[0]].id}
  918. />
  919. )}
  920. {this.state.mvisible == "detail" && (
  921. <ChannelDetail
  922. cancel={this.closeDesc.bind(this)}
  923. visible={this.state.mvisible}
  924. IntentionData={this.state.rowdata}
  925. categoryArr={this.state.categoryArr}
  926. />
  927. )}
  928. <FollowDetail
  929. categoryArr={this.state.categoryArr}
  930. followData={this.state.followData}
  931. visitModul={this.state.visitModuls}
  932. closeDesc={this.close.bind(this)}
  933. loadData={this.loadVisit.bind(this)}
  934. />
  935. </div>
  936. );
  937. }
  938. }
  939. export default ChannelUnit;