channel.jsx 36 KB

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