channel.jsx 35 KB

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