channel.jsx 40 KB

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