index.jsx 28 KB

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