channel.jsx 37 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949
  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) {
  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. for (let i = 0; i < data.data.list.length; i++) {
  333. let thisdata = data.data.list[i];
  334. let diqu =
  335. (thisdata.province == null ? "" : thisdata.province) +
  336. (thisdata.city == null ? "" : "-" + thisdata.city) +
  337. (thisdata.area == null ? "" : "-" + thisdata.area);
  338. thisdata.key = i;
  339. thisdata.id = thisdata.uid;
  340. thisdata.lastFollowTime = thisdata.lastFollowTime &&
  341. thisdata.lastFollowTime.split(" ")[0];
  342. thisdata.transferTime= thisdata.transferTime && thisdata.transferTime.split(" ")[0];
  343. thisdata.surplusFollowTime = thisdata.surplusFollowTime && thisdata.surplusFollowTime.split(" ")[0];
  344. thisdata.surplusSignTime = thisdata.surplusSignTime && thisdata.surplusSignTime.split(" ")[0];
  345. thisdata.locationProvince = diqu;
  346. theArr.push(thisdata);
  347. }
  348. this.state.pagination.current = data.data.pageNo;
  349. this.state.pagination.total = data.data.totalCount;
  350. this.setState({
  351. pageNo: data.data.pageNo,
  352. dataSource: theArr,
  353. pagination: this.state.pagination,
  354. })
  355. }
  356. }.bind(this),
  357. }).always(
  358. function () {
  359. this.setState({
  360. listLoading: false,
  361. });
  362. }.bind(this)
  363. );
  364. }
  365. search(){
  366. this.loadData();
  367. }
  368. reset(){
  369. this.setState({
  370. nameSearch:'',
  371. provinceSearch:undefined,
  372. addressSearch:[],
  373. releaseDate:[],
  374. statusSearch:undefined,
  375. },()=>{
  376. this.loadData();
  377. })
  378. }
  379. download() {
  380. window.location.href =
  381. globalConfig.context +
  382. "/api/user/channel/downloadTemplate?" +
  383. "sign=user_channel";
  384. }
  385. changeList(arr) {
  386. const newArr = [];
  387. this.state.columns.forEach(item => {
  388. arr.forEach(val => {
  389. if (val === item.title) {
  390. newArr.push(item);
  391. }
  392. });
  393. });
  394. this.setState({
  395. changeList: newArr
  396. });
  397. }
  398. category() {
  399. $.ajax({
  400. method: "get",
  401. dataType: "json",
  402. crossDomain: false,
  403. url: globalConfig.context + "/api/admin/Varieties/getSuperList",
  404. data: {},
  405. success: function (data) {
  406. let thedata = data.data;
  407. let theArr = [];
  408. if (!thedata) {
  409. if (data.error && data.error.length) {
  410. message.warning(data.error[0].message);
  411. }
  412. thedata = {};
  413. } else {
  414. thedata.map(function (item, index) {
  415. theArr.push({
  416. value: item.id,
  417. key: item.cname,
  418. });
  419. });
  420. }
  421. this.setState({
  422. categoryArr: theArr,
  423. });
  424. }.bind(this),
  425. });
  426. }
  427. closeDesc(){
  428. this.setState({
  429. categoryArr:[],
  430. followData:'',
  431. visitModul:false
  432. })
  433. }
  434. //已读指导记录
  435. guidanceRead(id) {
  436. return new Promise((resolve,reject)=>{
  437. $.ajax({
  438. method: "post",
  439. dataType: "json",
  440. crossDomain: false,
  441. url: globalConfig.context + "/api/admin/customer/pushGuidance",
  442. data: {
  443. uid: id,
  444. }
  445. }).done(function(data) {
  446. if(!data.error.length) {
  447. resolve();
  448. } else {
  449. message.warning(data.error[0].message);
  450. reject();
  451. };
  452. }.bind(this));
  453. })
  454. }
  455. tableRowClick(record) {
  456. this.setState({
  457. rowData:record,
  458. modalVisible: true,
  459. basicState: true,
  460. contactState: true,
  461. modalName: record.userName
  462. })
  463. }
  464. detailCloseDesc(){
  465. this.setState({
  466. rowData:'',
  467. modalVisible: false,
  468. basicState: false,
  469. contactState: false,
  470. modalName: ''
  471. })
  472. }
  473. supervisor(e) {
  474. $.ajax({
  475. method: "get",
  476. dataType: "json",
  477. crossDomain: false,
  478. url: globalConfig.context + "/api/admin/customer/listAdminByName",
  479. data: {
  480. adminName: e,
  481. },
  482. success: function (data) {
  483. let thedata = data.data;
  484. if (!thedata) {
  485. if (data.error && data.error.length) {
  486. message.warning(data.error[0].message);
  487. }
  488. thedata = {};
  489. }
  490. this.setState({
  491. customerArr: thedata,
  492. });
  493. }.bind(this),
  494. }).always(
  495. function () {
  496. }.bind(this)
  497. );
  498. }
  499. httpChange(e) {
  500. if (e.length >= 1) {
  501. this.supervisor(e);
  502. }
  503. this.setState({
  504. auto: e,
  505. });
  506. }
  507. blurChange(e) {
  508. let theType = "";
  509. let contactLists = this.state.customerArr || [];
  510. if (e) {
  511. contactLists.map(function (item) {
  512. if (item.name == e.toString()) {
  513. theType = item.id;
  514. }
  515. });
  516. }
  517. this.setState({
  518. theTypes: theType,
  519. });
  520. }
  521. selectAuto(value, options) {
  522. this.setState({
  523. auto: value,
  524. });
  525. }
  526. changeAssigner(remarks,type,lv) {
  527. //type 0 总监分配 1经理分配 2回收
  528. let arr = this.state.selectedRows.filter(v=>v.status === 1);
  529. let arr1 = this.state.selectedRows.filter(v=>v.status === 2);
  530. if(type === 0 && (arr.length>0 || arr1.length>0)){
  531. message.warning('选中的信息中存在“已分配”数据,请取消这些选项后重新提交')
  532. return;
  533. }
  534. if(type === 1 && arr1.length>0){
  535. message.warning('选中的信息中存在“经理已分配”数据,请取消这些选项后重新提交')
  536. return;
  537. }
  538. if(!remarks){
  539. message.warning(type === 1 ? "请输入分配原因" : type === 2 ? "请输入回收原因" : type === 0 ? "请输入分配原因" : "");
  540. return;
  541. }
  542. if (this.state.theTypes || lv) {
  543. let changeIds = '';
  544. let oldAid = '';
  545. for (let idx = 0; idx < this.state.selectedRows.length; idx++) {
  546. let rowItem = this.state.selectedRows[idx];
  547. if(rowItem.recovery === 1 && type === 2){
  548. let arr = this.state.selectedRows.filter(v => v.recovery === 1)
  549. Modal.info({
  550. title: '以下数据属于回收再分配资源,无法再次回收',
  551. content: (
  552. <div>
  553. {
  554. arr.map(i=>(
  555. <div style={{paddingBottom:'7px'}}>{i.userName}</div>
  556. ))
  557. }
  558. </div>
  559. ),
  560. onOk() {},
  561. });
  562. return ;
  563. }
  564. if (rowItem.id) {
  565. oldAid = rowItem.aid;
  566. changeIds = this.state.selectedRows.length-1 === idx ? changeIds +rowItem.id : changeIds + rowItem.id + ',' ;
  567. }
  568. }
  569. $.ajax({
  570. method: "post",
  571. dataType: "json",
  572. crossDomain: false,
  573. url: globalConfig.context + "/api/admin/customer/channelCustomerDeliver",
  574. data: {
  575. userIds: changeIds, //这一行数据的ID
  576. receiveId: this.state.theTypes, //指定分配人的ID
  577. remarks: remarks,
  578. type, //0总监分配 1经理分配 2回收
  579. },
  580. }).done(
  581. function (data) {
  582. if (!data.error.length) {
  583. message.success(type === 1 ? "分配成功!" : type === 2 ? "回收成功!" : type === 0 ? "分配成功!" : "");
  584. this.setState({
  585. auto: "",
  586. loading: false,
  587. selectedRowKeys: [],
  588. visible:false,
  589. recoveryVisible: false,
  590. },()=>{
  591. this.loadData(
  592. Math.min(
  593. this.state.ispage == undefined ? 1 : this.state.ispage,
  594. Math.ceil((this.state.pagination.total - 1) / 10)
  595. )
  596. );
  597. });
  598. } else {
  599. message.warning(data.error[0].message);
  600. }
  601. }.bind(this)
  602. );
  603. } else {
  604. message.warning("请输入分配人姓名");
  605. }
  606. }
  607. render() {
  608. const rowSelection = {
  609. hideDefaultSelections: true,
  610. selectedRowKeys: this.state.selectedRowKeys,
  611. onChange: (selectedRowKeys, selectedRows) => {
  612. this.setState({
  613. modalVisible: false,
  614. selectedRows: selectedRows,
  615. selectedRowKeys: selectedRowKeys,
  616. });
  617. },
  618. onSelect: (recordt, selected, selectedRows) => {
  619. this.setState({
  620. modalVisible: false,
  621. });
  622. },
  623. };
  624. const dataSources = this.state.customerArr || [];
  625. const options = dataSources.map((group) => (
  626. <Select.Option key={group.id} value={group.name}>
  627. {group.name}
  628. </Select.Option>
  629. ));
  630. const hasSelected = this.state.selectedRowKeys.length > 0;
  631. return (
  632. <div className="user-content">
  633. <ShowModalDiv ShowModal={this.state.showModal} />
  634. <div className="content-title">
  635. <span>渠道客户</span>
  636. </div>
  637. <div className="user-search">
  638. <Tabs
  639. defaultActiveKey="1"
  640. className="test"
  641. >
  642. <TabPane tab="搜索" key="1">
  643. <Input
  644. placeholder="请输入客户名称"
  645. value={this.state.nameSearch}
  646. style={{ width: 150, marginRight: 10, marginLeft: 10 }}
  647. onChange={(e) => {
  648. this.setState({ nameSearch: e.target.value });
  649. }}
  650. />
  651. <Select
  652. placeholder="分配状态"
  653. style={{ width: 100 }}
  654. value={this.state.statusSearch}
  655. onChange={(e) => {
  656. this.setState({ statusSearch: e });
  657. }}
  658. >
  659. {
  660. this.state.channelAllocationStatusList.map((v,key)=>(
  661. <Select.Option value={v.value} key={key}>
  662. {v.key}
  663. </Select.Option>
  664. ))
  665. }
  666. </Select>
  667. <Select
  668. placeholder="省"
  669. style={{ width: 80 }}
  670. value={this.state.provinceSearch}
  671. onChange={(e) => {
  672. this.setState({ provinceSearch: e });
  673. }}
  674. >
  675. {this.state.provinces}
  676. </Select>
  677. <span style={{ marginRight: "10px" }}>
  678. <Cascader
  679. options={citySelect()}
  680. value={this.state.addressSearch}
  681. placeholder="选择城市"
  682. onChange={(e, pre) => {
  683. this.setState({ addressSearch: e });
  684. }}
  685. />
  686. </span>
  687. <RangePicker
  688. value={[
  689. this.state.releaseDate[0]
  690. ? moment(this.state.releaseDate[0])
  691. : null,
  692. this.state.releaseDate[1]
  693. ? moment(this.state.releaseDate[1])
  694. : null,
  695. ]}
  696. onChange={(data, dataString) => {
  697. this.setState({ releaseDate: dataString });
  698. }}
  699. />
  700. <Button
  701. type="primary"
  702. style={{ marginLeft: "10px", marginRight: 10 }}
  703. onClick={this.search}
  704. >
  705. 搜索
  706. </Button>
  707. <Button onClick={this.reset}>重置</Button>
  708. </TabPane>
  709. <TabPane tab="操作" key="2">
  710. <div style={{
  711. marginTop: 10,
  712. }}>
  713. {this.props.deliver ? <AutoComplete
  714. className="certain-category-search"
  715. dropdownClassName="certain-category-search-dropdown"
  716. dropdownMatchSelectWidth={false}
  717. dropdownStyle={{ width: 120 }}
  718. style={{ width: "120px" }}
  719. dataSource={options}
  720. placeholder={this.props.deliver === 1 ? '输入分配人姓名' : '输入分配人姓名'}
  721. value={this.state.auto}
  722. onChange={this.httpChange}
  723. filterOption={true}
  724. onBlur={this.blurChange}
  725. onSelect={this.selectAuto}
  726. disabled={!hasSelected}
  727. >
  728. <Input />
  729. </AutoComplete> : ''}
  730. {this.props.deliver ? <Button
  731. type="primary"
  732. onClick={(e) => {
  733. e.stopPropagation();
  734. this.setState({
  735. visible:true
  736. })
  737. }}
  738. disabled={!hasSelected}
  739. style={{ marginRight: 10 }}
  740. >
  741. {this.props.deliver === 1 ? '分配' : '分配'}
  742. </Button> : ''}
  743. {this.props.recovery ? <Button
  744. type="primary"
  745. onClick={(e) => {
  746. e.stopPropagation();
  747. this.setState({
  748. recoveryVisible:true
  749. })
  750. }}
  751. disabled={!hasSelected}
  752. style={{ marginRight: 10 }}
  753. >
  754. 回收
  755. </Button> : ''}
  756. {this.props.deliver || this.props.recovery ? <Button
  757. type="primary"
  758. onClick={(e) => {
  759. e.stopPropagation();
  760. this.setState({
  761. transferVisible:true,
  762. transferId: this.state.selectedRows[0].uid
  763. })
  764. }}
  765. disabled={!hasSelected || this.state.selectedRows.length > 1}
  766. style={{ marginRight: 10 }}
  767. >
  768. 日志
  769. </Button> : ''}
  770. {this.props.channel ? <Upload {...this.state.upLoad}>
  771. <Button
  772. type="primary"
  773. style={{ marginRight: "10px" }}
  774. >
  775. +批量导入渠道客户
  776. </Button>
  777. </Upload> : null}
  778. {this.props.channel ? <Button
  779. onClick={(e) => {
  780. e.stopPropagation();
  781. this.download();
  782. }}
  783. type="primary"
  784. style={{
  785. marginRight: "10px",
  786. background:'#f49f36',
  787. borderColor:'#f49f36'
  788. }}
  789. >
  790. 下载渠道客户模板
  791. </Button> : ''}
  792. {this.props.channel ? <Button
  793. onClick={(e) => {
  794. e.stopPropagation();
  795. this.setState({
  796. duplicateData: [],
  797. duplicateDataVisible: true
  798. })
  799. }}
  800. type="primary"
  801. style={{
  802. marginRight: "10px",
  803. background:'#ff2f00',
  804. borderColor:'#ff2f00'
  805. }}
  806. >
  807. 查看导入失败列表
  808. </Button> : ''}
  809. </div>
  810. </TabPane>
  811. <TabPane tab="更改表格显示数据" key="3">
  812. <div style={{ marginLeft: 10 }}>
  813. <ChooseList
  814. columns={this.state.columns}
  815. changeFn={this.changeList}
  816. changeList={this.state.changeList}
  817. top={55}
  818. margin={11}
  819. />
  820. </div>
  821. </TabPane>
  822. </Tabs>
  823. </div>
  824. <div className="patent-table">
  825. <Spin spinning={this.state.listLoading}>
  826. <Table
  827. size="middle"
  828. className={'intentionCustomerTable'}
  829. columns={
  830. this.state.changeList.length !== 0
  831. ? this.state.changeList
  832. : this.state.columns
  833. }
  834. dataSource={this.state.dataSource}
  835. rowSelection={this.props.deliver || this.props.recovery ? rowSelection : ''}
  836. pagination={this.state.pagination}
  837. onRowDoubleClick={this.tableRowClick}
  838. />
  839. </Spin>
  840. </div>
  841. <FollowDetail
  842. categoryArr={this.state.categoryArr}
  843. followData={this.state.followData}
  844. visitModul={this.state.visitModul}
  845. closeDesc={this.closeDesc}
  846. />
  847. <IntentionDetail
  848. tabsKey={this.state.tabsKey}
  849. categoryArr={this.state.categoryArr}
  850. detailApi={this.props.detailApi}
  851. IntentionData={this.state.rowData}
  852. modalVisible={this.state.modalVisible}
  853. name={this.state.modalName}
  854. closeDesc={this.detailCloseDesc}
  855. basicState={this.state.basicState}
  856. contactState={this.state.contactState}
  857. isGuidanceLv={this.props.isGuidanceLv}
  858. isEditGuidanceLv={this.props.isEditGuidanceLv}
  859. />
  860. {this.state.duplicateDataVisible ? <DuplicateData
  861. duplicateData={this.state.duplicateData || []}
  862. visible={this.state.duplicateDataVisible}
  863. onCancel={()=>{
  864. this.setState({
  865. duplicateData:[],
  866. duplicateDataVisible: false
  867. },()=>{
  868. this.loadData();
  869. })
  870. }}
  871. /> : null}
  872. {this.state.transferVisible || this.state.returnVisible ? <TransferRecords
  873. type={this.state.transferVisible ? (this.props.deliver === 1 ? 0 : 1) : this.state.returnVisible ? 2 : 0}
  874. id={this.state.transferId}
  875. visible={this.state.transferVisible || this.state.returnVisible}
  876. cancel={()=>{
  877. this.setState({
  878. transferVisible:false,
  879. returnVisible: false,
  880. transferId:''
  881. })
  882. }}
  883. /> : '' }
  884. {/*渠道客户分配*/}
  885. {this.state.visible ? <OperationTips
  886. title={'渠道客户分配'}
  887. selectedRows={this.state.selectedRows}
  888. visible={this.state.visible}
  889. onOk={(value)=>{
  890. // 0 总监分配 1经理分配 2回收
  891. this.changeAssigner(value,this.props.deliver === 1 ? 0 : this.props.deliver === 2 ? 1 : '')
  892. }}
  893. onCancel={()=>{
  894. this.setState({
  895. visible:false
  896. })
  897. }}/> : ''}
  898. {/*渠道客户回收*/}
  899. {this.state.recoveryVisible ? <OperationTips
  900. title={'渠道客户回收'}
  901. selectedRows={this.state.selectedRows}
  902. visible={this.state.recoveryVisible}
  903. onOk={(value)=>{
  904. this.changeAssigner(value,2,true)
  905. }}
  906. onCancel={()=>{
  907. this.setState({
  908. recoveryVisible:false
  909. })
  910. }}/> : ''}
  911. </div>
  912. )
  913. }
  914. }
  915. export default Channel;