channel.jsx 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954
  1. import React,{Component} from "react";
  2. import {
  3. AutoComplete,
  4. Button,
  5. Cascader,
  6. DatePicker,
  7. Input,
  8. message,
  9. Select,
  10. Spin,
  11. Table,
  12. Tabs,
  13. Tooltip,
  14. Upload,
  15. Modal
  16. } from "antd";
  17. import {ChooseList} from "../../../order/orderNew/chooseList";
  18. import $ from "jquery/src/ajax";
  19. import {
  20. getSocialAttribute,
  21. ShowModal,
  22. getChannelAllocationStatus
  23. } from "@/tools.js";
  24. import {
  25. channelAllocationStatus
  26. } from "@/dataDic.js";
  27. import { citySelect, provinceList } from '@/NewDicProvinceList';
  28. import moment from "moment";
  29. import FollowDetail from "./followDetail";
  30. import IntentionDetail from "./intentionDetail/intentionDetail";
  31. import TransferRecords from './transferRecords';
  32. import DuplicateData from './duplicateData';
  33. import OperationTips from './operationTips';
  34. import ShowModalDiv from "@/showModal.jsx";
  35. import './channel.less';
  36. const {TabPane} = Tabs;
  37. const { RangePicker } = DatePicker;
  38. class Channel extends Component{
  39. constructor(props) {
  40. super(props);
  41. this.state={
  42. channelAllocationStatusList : channelAllocationStatus.slice(0,channelAllocationStatus.length-1),
  43. columns: [
  44. {
  45. title: "客户名称",
  46. dataIndex: "userName",
  47. key: "userName",
  48. render: (text,record) => {
  49. return (
  50. <span>
  51. {record.recovery === 1 ? <div style={{
  52. background:'#ef7207',
  53. color:'#FFF',
  54. padding: '1px 7px',
  55. borderRadius:'5px',
  56. fontSize:'12px',
  57. display: 'inline-block',
  58. marginRight:'10px'
  59. }}>
  60. 回收
  61. </div> : null}
  62. {text}
  63. </span>
  64. )
  65. },
  66. },
  67. {
  68. title: "地区",
  69. dataIndex: "locationProvince",
  70. key: "locationProvince",
  71. },
  72. {
  73. title: "社会性质",
  74. dataIndex: "societyTag",
  75. key: "societyTag",
  76. render: (text) => {
  77. return getSocialAttribute(text);
  78. },
  79. },
  80. {
  81. title: "渠道专员",
  82. dataIndex: "channelName",
  83. key: "channelName",
  84. },
  85. {
  86. title: "客户联系人",
  87. dataIndex: "contacts",
  88. key: "contacts",
  89. },
  90. {
  91. title: "联系电话",
  92. dataIndex: "contactMobile",
  93. key: "contactMobile",
  94. },
  95. {
  96. title: "渠道初始时间",
  97. dataIndex: "createTimes",
  98. key: "createTimes",
  99. },
  100. {
  101. title: "分配状态",
  102. dataIndex: "status",
  103. key: "status",
  104. render: (text) => (
  105. getChannelAllocationStatus(text,true)
  106. )
  107. },
  108. ],
  109. changeList:[],
  110. dataSource:[],
  111. pagination: {
  112. defaultCurrent: 1,
  113. defaultPageSize: 10,
  114. showQuickJumper: true,
  115. pageSize: 10,
  116. onChange: function (page) {
  117. this.loadData(page);
  118. }.bind(this),
  119. showTotal: function (total) {
  120. return "共" + total + "条数据";
  121. },
  122. },
  123. pageNo:1,
  124. listLoading:false,
  125. selectedRowKeys:[],
  126. selectedRows:[],
  127. modalVisible:false,
  128. nameSearch:'',
  129. statusSearch:undefined,
  130. provinceSearch:undefined,
  131. addressSearch:[],
  132. releaseDate:[],
  133. upLoad: {
  134. name: "file",
  135. action: globalConfig.context + "/api/user/channel/import",
  136. headers: {
  137. authorization: "authorization-text"
  138. },
  139. onChange: info => {
  140. if (info.file.status === "done") {
  141. if (info.file.response && info.file.response.error.length === 0) {
  142. if(info.file.response.data === 1){
  143. message.success("导入成功!");
  144. this.loadData();
  145. }else if(info.file.response.data.list.length > 0){
  146. message.warning('已成功导入!错误/重复客户无法导入,请查看错误渠道数据!');
  147. this.setState({
  148. duplicateData: [],
  149. duplicateDataVisible: true
  150. })
  151. }
  152. } else {
  153. message.warning(info.file.response.error[0].message);
  154. }
  155. }
  156. }
  157. },
  158. followData: '',
  159. visitModul: false,
  160. categoryArr:[],
  161. tabsKey:'',
  162. }
  163. this.loadData = this.loadData.bind(this);
  164. this.search = this.search.bind(this);
  165. this.reset = this.reset.bind(this);
  166. this.changeList = this.changeList.bind(this);
  167. this.download = this.download.bind(this);
  168. this.category = this.category.bind(this);
  169. this.closeDesc = this.closeDesc.bind(this);
  170. this.guidanceRead = this.guidanceRead.bind(this);
  171. this.tableRowClick = this.tableRowClick.bind(this);
  172. this.detailCloseDesc = this.detailCloseDesc.bind(this);
  173. this.supervisor = this.supervisor.bind(this);
  174. this.httpChange = this.httpChange.bind(this);
  175. this.blurChange = this.blurChange.bind(this);
  176. this.selectAuto = this.selectAuto.bind(this);
  177. this.changeAssigner = this.changeAssigner.bind(this);
  178. }
  179. componentDidMount() {
  180. //城市
  181. let provinces = [];
  182. provinceList.map(function (item) {
  183. var id = String(item.id);
  184. provinces.push(
  185. <Select.Option value={id} key={item.name}>
  186. {item.name}
  187. </Select.Option>
  188. );
  189. });
  190. this.setState({
  191. provinces
  192. })
  193. this.loadData();
  194. this.category();
  195. if(this.props.followUp){
  196. this.state.columns.push({
  197. title: "当前跟进人",
  198. dataIndex: "adminName",
  199. key: "adminName",
  200. render: (text, record) => {
  201. return (
  202. record.status !== 0 ? text : ''
  203. )
  204. }
  205. });
  206. this.state.columns.push({
  207. title: "跟进操作",
  208. dataIndex: "abc",
  209. key: "abc",
  210. render: (text, record, index) => {
  211. return (
  212. <div style={{
  213. display: 'flex',
  214. flexFlow:'row',
  215. alignItems:'center',
  216. }}>
  217. <Button
  218. disabled={record.status === 2 && this.props.isEditGuidanceLv}
  219. onClick={(e) => {
  220. e.stopPropagation();
  221. if(this.props.isEditGuidanceLv){
  222. this.visit(record);
  223. }else{
  224. this.tableRowClick(record);
  225. }
  226. }}
  227. type="primary"
  228. >
  229. {this.props.isEditGuidanceLv ? '客户跟进' : '查看指导'}
  230. </Button>
  231. </div>
  232. );
  233. },
  234. });
  235. if(this.props.isEditGuidanceLv){
  236. this.state.columns.push({
  237. title: "指导意见",
  238. dataIndex: "guidance",
  239. key: "guidance",
  240. render: (text, record, index) => {
  241. return (
  242. <div style={{
  243. display: 'flex',
  244. flexFlow:'row',
  245. alignItems:'center',
  246. }}>
  247. {/*指导 0无 1未读 2已读*/}
  248. {text === 1 || text === 2 ? <Button
  249. style={text === 1 ? {
  250. background:'#F00000',
  251. borderColor:'#F00000'
  252. } : {}}
  253. onClick={(e)=>{
  254. e.stopPropagation();
  255. this.guidanceRead(record.uid).then(()=>{
  256. this.setState({
  257. tabsKey:"4",
  258. },()=>{
  259. this.tableRowClick(record)
  260. })
  261. })
  262. }}
  263. type="primary"
  264. >
  265. {text === 1 ? '未读' : '查看'}
  266. </Button> : <div>暂无指导</div>}
  267. </div>
  268. );
  269. },
  270. });
  271. }
  272. }
  273. this.state.columns.push({
  274. title: "备注",
  275. dataIndex: "remarks",
  276. key: "remarks",
  277. render: (text) => {
  278. return (
  279. <Tooltip placement="topLeft" title={text}>
  280. <div style={{
  281. maxWidth:'150px',
  282. overflow:'hidden',
  283. textOverflow: "ellipsis",
  284. whiteSpace:'nowrap',
  285. }}>{text}</div>
  286. </Tooltip>
  287. )
  288. }
  289. });
  290. this.setState({
  291. columns:this.state.columns
  292. })
  293. }
  294. visit(e) {
  295. this.setState({
  296. followData: e,
  297. visitModul: true,
  298. });
  299. }
  300. loadData(pageNo = 1) {
  301. this.setState({
  302. listLoading: true,
  303. selectedRows: [],
  304. selectedRowKeys: [],
  305. });
  306. $.ajax({
  307. method: "post",
  308. dataType: "json",
  309. crossDomain: false,
  310. url: globalConfig.context + '/api/admin/customer/listChannelCustomer',
  311. data: {
  312. type:this.props.channel ? 1 : undefined,
  313. pageNo: pageNo || 1,
  314. pageSize: this.state.pagination.pageSize,
  315. name: this.state.nameSearch,
  316. status:this.state.statusSearch,
  317. province: !this.state.addressSearch.length
  318. ? this.state.provinceSearch
  319. : this.state.addressSearch[0],
  320. city: !this.state.addressSearch.length
  321. ? ""
  322. : this.state.addressSearch[1],
  323. startTime: this.state.releaseDate[0],
  324. endTime: this.state.releaseDate[1],
  325. },
  326. success: function (data) {
  327. ShowModal(this);
  328. let theArr = [];
  329. if (data.error.length > 0) {
  330. message.warning(data.error[0].message);
  331. } else {
  332. if(data.data.list.length === 0 && pageNo !== 1){
  333. this.loadData(pageNo - 1)
  334. }else{
  335. for (let i = 0; i < data.data.list.length; i++) {
  336. let thisdata = data.data.list[i];
  337. let diqu =
  338. (thisdata.province == null ? "" : thisdata.province) +
  339. (thisdata.city == null ? "" : "-" + thisdata.city) +
  340. (thisdata.area == null ? "" : "-" + thisdata.area);
  341. thisdata.key = i;
  342. thisdata.id = thisdata.uid;
  343. thisdata.lastFollowTime = thisdata.lastFollowTime &&
  344. thisdata.lastFollowTime.split(" ")[0];
  345. thisdata.transferTime= thisdata.transferTime && thisdata.transferTime.split(" ")[0];
  346. thisdata.surplusFollowTime = thisdata.surplusFollowTime && thisdata.surplusFollowTime.split(" ")[0];
  347. thisdata.surplusSignTime = thisdata.surplusSignTime && thisdata.surplusSignTime.split(" ")[0];
  348. thisdata.locationProvince = diqu;
  349. theArr.push(thisdata);
  350. }
  351. this.state.pagination.current = data.data.pageNo;
  352. this.state.pagination.total = data.data.totalCount;
  353. this.setState({
  354. pageNo: data.data.pageNo,
  355. dataSource: theArr,
  356. pagination: this.state.pagination,
  357. })
  358. }
  359. }
  360. }.bind(this),
  361. }).always(
  362. function () {
  363. this.setState({
  364. listLoading: false,
  365. });
  366. }.bind(this)
  367. );
  368. }
  369. search(){
  370. this.loadData();
  371. }
  372. reset(){
  373. this.setState({
  374. nameSearch:'',
  375. provinceSearch:undefined,
  376. addressSearch:[],
  377. releaseDate:[],
  378. statusSearch:undefined,
  379. },()=>{
  380. this.loadData();
  381. })
  382. }
  383. download() {
  384. window.location.href =
  385. globalConfig.context +
  386. "/api/user/channel/downloadTemplate?" +
  387. "sign=user_channel";
  388. }
  389. changeList(arr) {
  390. const newArr = [];
  391. this.state.columns.forEach(item => {
  392. arr.forEach(val => {
  393. if (val === item.title) {
  394. newArr.push(item);
  395. }
  396. });
  397. });
  398. this.setState({
  399. changeList: newArr
  400. });
  401. }
  402. category() {
  403. $.ajax({
  404. method: "get",
  405. dataType: "json",
  406. crossDomain: false,
  407. url: globalConfig.context + "/api/admin/Varieties/getSuperList",
  408. data: {},
  409. success: function (data) {
  410. let thedata = data.data;
  411. let theArr = [];
  412. if (!thedata) {
  413. if (data.error && data.error.length) {
  414. message.warning(data.error[0].message);
  415. }
  416. thedata = {};
  417. } else {
  418. thedata.map(function (item, index) {
  419. theArr.push({
  420. value: item.id,
  421. key: item.cname,
  422. });
  423. });
  424. }
  425. this.setState({
  426. categoryArr: theArr,
  427. });
  428. }.bind(this),
  429. });
  430. }
  431. closeDesc(){
  432. this.setState({
  433. categoryArr:[],
  434. followData:'',
  435. visitModul:false
  436. })
  437. }
  438. //已读指导记录
  439. guidanceRead(id) {
  440. return new Promise((resolve,reject)=>{
  441. $.ajax({
  442. method: "post",
  443. dataType: "json",
  444. crossDomain: false,
  445. url: globalConfig.context + "/api/admin/customer/pushGuidance",
  446. data: {
  447. uid: id,
  448. }
  449. }).done(function(data) {
  450. if(!data.error.length) {
  451. resolve();
  452. } else {
  453. message.warning(data.error[0].message);
  454. reject();
  455. };
  456. }.bind(this));
  457. })
  458. }
  459. tableRowClick(record) {
  460. this.setState({
  461. rowData:record,
  462. modalVisible: true,
  463. basicState: true,
  464. contactState: true,
  465. modalName: record.userName
  466. })
  467. }
  468. detailCloseDesc(){
  469. this.setState({
  470. rowData:'',
  471. modalVisible: false,
  472. basicState: false,
  473. contactState: false,
  474. modalName: ''
  475. })
  476. }
  477. supervisor(e) {
  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. customerArr: thedata,
  496. });
  497. }.bind(this),
  498. }).always(
  499. function () {
  500. }.bind(this)
  501. );
  502. }
  503. httpChange(e) {
  504. if (e.length >= 1) {
  505. this.supervisor(e);
  506. }
  507. this.setState({
  508. auto: e,
  509. });
  510. }
  511. blurChange(e) {
  512. let theType = "";
  513. let contactLists = this.state.customerArr || [];
  514. if (e) {
  515. contactLists.map(function (item) {
  516. if (item.name == e.toString()) {
  517. theType = item.id;
  518. }
  519. });
  520. }
  521. this.setState({
  522. theTypes: theType,
  523. });
  524. }
  525. selectAuto(value, options) {
  526. this.setState({
  527. auto: value,
  528. });
  529. }
  530. changeAssigner(remarks,type,lv) {
  531. //type 0 总监分配 1经理分配 2回收
  532. let arr = this.state.selectedRows.filter(v=>v.status === 1);
  533. let arr1 = this.state.selectedRows.filter(v=>v.status === 2);
  534. let arr2 = this.state.selectedRows.filter(v=>v.status !== 1);
  535. if(type === 0 && (arr.length>0 || arr1.length>0)){
  536. message.warning('选中的信息中存在“已分配”数据,请取消这些选项后重新提交')
  537. return;
  538. }
  539. if(type === 1 && arr1.length>0){
  540. message.warning('选中的信息中存在“经理已分配”数据,请取消这些选项后重新提交')
  541. return;
  542. }
  543. //this.props.deliver && this.props.recovery 用于判断是否为经理
  544. if(this.props.deliver === 2 && this.props.recovery && type === 2 && arr2.length>0){
  545. message.warning('您只能回收分配状态为"已分配经理"的客户')
  546. return;
  547. }
  548. if(!remarks){
  549. message.warning(type === 1 ? "请输入分配原因" : type === 2 ? "请输入回收原因" : type === 0 ? "请输入分配原因" : "");
  550. return;
  551. }
  552. if (this.state.theTypes || lv) {
  553. let changeIds = '';
  554. let oldAid = '';
  555. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  556. let rowItem = this.state.selectedRows[idx];
  557. if(rowItem.recovery === 1 && type === 2){
  558. let arr = this.state.selectedRows.filter(v => v.recovery === 1)
  559. Modal.info({
  560. title: '以下数据属于回收再分配资源,无法再次回收',
  561. content: (
  562. <div>
  563. {
  564. arr.map(i=>(
  565. <div style={{paddingBottom:'7px'}}>{i.userName}</div>
  566. ))
  567. }
  568. </div>
  569. ),
  570. onOk() {},
  571. });
  572. return ;
  573. }
  574. if (rowItem.id) {
  575. oldAid = rowItem.aid;
  576. changeIds = this.state.selectedRows.length-1 === idx ? changeIds +rowItem.id : changeIds + rowItem.id + ',' ;
  577. }
  578. }
  579. $.ajax({
  580. method: "post",
  581. dataType: "json",
  582. crossDomain: false,
  583. url: globalConfig.context + "/api/admin/customer/channelCustomerDeliver",
  584. data: {
  585. userIds: changeIds, //这一行数据的ID
  586. receiveId: this.state.theTypes, //指定分配人的ID
  587. remarks: remarks,
  588. type, //0总监分配 1经理分配 2回收
  589. },
  590. }).done(
  591. function (data) {
  592. if (!data.error.length) {
  593. message.success(type === 1 ? "分配成功!" : type === 2 ? "回收成功!" : type === 0 ? "分配成功!" : "");
  594. this.setState({
  595. auto: "",
  596. loading: false,
  597. selectedRowKeys: [],
  598. visible:false,
  599. recoveryVisible: false,
  600. },()=>{
  601. this.loadData(this.state.pageNo);
  602. });
  603. } else {
  604. message.warning(data.error[0].message);
  605. }
  606. }.bind(this)
  607. );
  608. } else {
  609. message.warning("请输入分配人姓名");
  610. }
  611. }
  612. render() {
  613. const rowSelection = {
  614. hideDefaultSelections: true,
  615. selectedRowKeys: this.state.selectedRowKeys,
  616. onChange: (selectedRowKeys, selectedRows) => {
  617. this.setState({
  618. modalVisible: false,
  619. selectedRows: selectedRows,
  620. selectedRowKeys: selectedRowKeys,
  621. });
  622. },
  623. onSelect: (recordt, selected, selectedRows) => {
  624. this.setState({
  625. modalVisible: false,
  626. });
  627. },
  628. };
  629. const dataSources = this.state.customerArr || [];
  630. const options = dataSources.map((group) => (
  631. <Select.Option key={group.id} value={group.name}>
  632. {group.name}
  633. </Select.Option>
  634. ));
  635. const hasSelected = this.state.selectedRowKeys.length > 0;
  636. return (
  637. <div className="user-content">
  638. <ShowModalDiv ShowModal={this.state.showModal} />
  639. <div className="content-title">
  640. <span>渠道客户</span>
  641. </div>
  642. <div className="user-search">
  643. <Tabs
  644. defaultActiveKey="1"
  645. className="test"
  646. >
  647. <TabPane tab="搜索" key="1">
  648. <Input
  649. placeholder="请输入客户名称"
  650. value={this.state.nameSearch}
  651. style={{ width: 150, marginRight: 10, marginLeft: 10 }}
  652. onChange={(e) => {
  653. this.setState({ nameSearch: e.target.value });
  654. }}
  655. />
  656. <Select
  657. placeholder="分配状态"
  658. style={{ width: 100 }}
  659. value={this.state.statusSearch}
  660. onChange={(e) => {
  661. this.setState({ statusSearch: e });
  662. }}
  663. >
  664. {
  665. this.state.channelAllocationStatusList.map((v,key)=>(
  666. <Select.Option value={v.value} key={key}>
  667. {v.key}
  668. </Select.Option>
  669. ))
  670. }
  671. </Select>
  672. <Select
  673. placeholder="省"
  674. style={{ width: 80 }}
  675. value={this.state.provinceSearch}
  676. onChange={(e) => {
  677. this.setState({ provinceSearch: e });
  678. }}
  679. >
  680. {this.state.provinces}
  681. </Select>
  682. <span style={{ marginRight: "10px" }}>
  683. <Cascader
  684. options={citySelect()}
  685. value={this.state.addressSearch}
  686. placeholder="选择城市"
  687. onChange={(e, pre) => {
  688. this.setState({ addressSearch: e });
  689. }}
  690. />
  691. </span>
  692. <RangePicker
  693. value={[
  694. this.state.releaseDate[0]
  695. ? moment(this.state.releaseDate[0])
  696. : null,
  697. this.state.releaseDate[1]
  698. ? moment(this.state.releaseDate[1])
  699. : null,
  700. ]}
  701. onChange={(data, dataString) => {
  702. this.setState({ releaseDate: dataString });
  703. }}
  704. />
  705. <Button
  706. type="primary"
  707. style={{ marginLeft: "10px", marginRight: 10 }}
  708. onClick={this.search}
  709. >
  710. 搜索
  711. </Button>
  712. <Button onClick={this.reset}>重置</Button>
  713. </TabPane>
  714. <TabPane tab="操作" key="2">
  715. <div style={{
  716. marginTop: 10,
  717. }}>
  718. {this.props.deliver ? <AutoComplete
  719. className="certain-category-search"
  720. dropdownClassName="certain-category-search-dropdown"
  721. dropdownMatchSelectWidth={false}
  722. dropdownStyle={{ width: 120 }}
  723. style={{ width: "120px" }}
  724. dataSource={options}
  725. placeholder={this.props.deliver === 1 ? '输入分配人姓名' : '输入分配人姓名'}
  726. value={this.state.auto}
  727. onChange={this.httpChange}
  728. filterOption={true}
  729. onBlur={this.blurChange}
  730. onSelect={this.selectAuto}
  731. disabled={!hasSelected}
  732. >
  733. <Input />
  734. </AutoComplete> : ''}
  735. {this.props.deliver ? <Button
  736. type="primary"
  737. onClick={(e) => {
  738. e.stopPropagation();
  739. this.setState({
  740. visible:true
  741. })
  742. }}
  743. disabled={!hasSelected}
  744. style={{ marginRight: 10 }}
  745. >
  746. {this.props.deliver === 1 ? '分配' : '分配'}
  747. </Button> : ''}
  748. {this.props.recovery ? <Button
  749. type="primary"
  750. onClick={(e) => {
  751. e.stopPropagation();
  752. this.setState({
  753. recoveryVisible:true
  754. })
  755. }}
  756. disabled={!hasSelected}
  757. style={{ marginRight: 10 }}
  758. >
  759. 回收
  760. </Button> : ''}
  761. {this.props.deliver || this.props.recovery ? <Button
  762. type="primary"
  763. onClick={(e) => {
  764. e.stopPropagation();
  765. this.setState({
  766. transferVisible:true,
  767. transferId: this.state.selectedRows[0].uid
  768. })
  769. }}
  770. disabled={!hasSelected || this.state.selectedRows.length > 1}
  771. style={{ marginRight: 10 }}
  772. >
  773. 日志
  774. </Button> : ''}
  775. {this.props.channel ? <Upload {...this.state.upLoad}>
  776. <Button
  777. type="primary"
  778. style={{ marginRight: "10px" }}
  779. >
  780. +批量导入渠道客户
  781. </Button>
  782. </Upload> : null}
  783. {this.props.channel ? <Button
  784. onClick={(e) => {
  785. e.stopPropagation();
  786. this.download();
  787. }}
  788. type="primary"
  789. style={{
  790. marginRight: "10px",
  791. background:'#f49f36',
  792. borderColor:'#f49f36'
  793. }}
  794. >
  795. 下载渠道客户模板
  796. </Button> : ''}
  797. {this.props.channel ? <Button
  798. onClick={(e) => {
  799. e.stopPropagation();
  800. this.setState({
  801. duplicateData: [],
  802. duplicateDataVisible: true
  803. })
  804. }}
  805. type="primary"
  806. style={{
  807. marginRight: "10px",
  808. background:'#ff2f00',
  809. borderColor:'#ff2f00'
  810. }}
  811. >
  812. 查看导入失败列表
  813. </Button> : ''}
  814. </div>
  815. </TabPane>
  816. <TabPane tab="更改表格显示数据" key="3">
  817. <div style={{ marginLeft: 10 }}>
  818. <ChooseList
  819. columns={this.state.columns}
  820. changeFn={this.changeList}
  821. changeList={this.state.changeList}
  822. top={55}
  823. margin={11}
  824. />
  825. </div>
  826. </TabPane>
  827. </Tabs>
  828. </div>
  829. <div className="patent-table">
  830. <Spin spinning={this.state.listLoading}>
  831. <Table
  832. size="middle"
  833. className={'intentionCustomerTable'}
  834. columns={
  835. this.state.changeList.length !== 0
  836. ? this.state.changeList
  837. : this.state.columns
  838. }
  839. dataSource={this.state.dataSource}
  840. rowSelection={this.props.deliver || this.props.recovery ? rowSelection : ''}
  841. pagination={this.state.pagination}
  842. onRowDoubleClick={this.tableRowClick}
  843. />
  844. </Spin>
  845. </div>
  846. <FollowDetail
  847. categoryArr={this.state.categoryArr}
  848. followData={this.state.followData}
  849. visitModul={this.state.visitModul}
  850. closeDesc={this.closeDesc}
  851. />
  852. <IntentionDetail
  853. tabsKey={this.state.tabsKey}
  854. categoryArr={this.state.categoryArr}
  855. detailApi={this.props.detailApi}
  856. IntentionData={this.state.rowData}
  857. modalVisible={this.state.modalVisible}
  858. name={this.state.modalName}
  859. closeDesc={this.detailCloseDesc}
  860. basicState={this.state.basicState}
  861. contactState={this.state.contactState}
  862. isGuidanceLv={this.props.isGuidanceLv}
  863. isEditGuidanceLv={this.props.isEditGuidanceLv}
  864. />
  865. {this.state.duplicateDataVisible ? <DuplicateData
  866. duplicateData={this.state.duplicateData || []}
  867. visible={this.state.duplicateDataVisible}
  868. onCancel={()=>{
  869. this.setState({
  870. duplicateData:[],
  871. duplicateDataVisible: false
  872. },()=>{
  873. this.loadData(this.state.pageNo);
  874. })
  875. }}
  876. /> : null}
  877. {this.state.transferVisible || this.state.returnVisible ? <TransferRecords
  878. type={this.state.transferVisible ? (this.props.deliver === 1 ? 0 : 1) : this.state.returnVisible ? 2 : 0}
  879. id={this.state.transferId}
  880. visible={this.state.transferVisible || this.state.returnVisible}
  881. cancel={()=>{
  882. this.setState({
  883. transferVisible:false,
  884. returnVisible: false,
  885. transferId:''
  886. })
  887. }}
  888. /> : '' }
  889. {/*渠道客户分配*/}
  890. {this.state.visible ? <OperationTips
  891. title={'渠道客户分配'}
  892. selectedRows={this.state.selectedRows}
  893. visible={this.state.visible}
  894. onOk={(value)=>{
  895. // 0 总监分配 1经理分配 2回收
  896. this.changeAssigner(value,this.props.deliver === 1 ? 0 : this.props.deliver === 2 ? 1 : '')
  897. }}
  898. onCancel={()=>{
  899. this.setState({
  900. visible:false
  901. })
  902. }}/> : ''}
  903. {/*渠道客户回收*/}
  904. {this.state.recoveryVisible ? <OperationTips
  905. title={'渠道客户回收'}
  906. selectedRows={this.state.selectedRows}
  907. visible={this.state.recoveryVisible}
  908. onOk={(value)=>{
  909. this.changeAssigner(value,2,true)
  910. }}
  911. onCancel={()=>{
  912. this.setState({
  913. recoveryVisible:false
  914. })
  915. }}/> : ''}
  916. </div>
  917. )
  918. }
  919. }
  920. export default Channel;