followUp.jsx 25 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623
  1. import React,{Component} from "react";
  2. import {Button, DatePicker, Icon, Input, message, Select, Spin, Table, Tabs, Tag, Tooltip} from "antd";
  3. import {ChooseList} from "../../order/orderNew/chooseList";
  4. import FollowUpDetails from './followUpDetails';
  5. import CorrespondingDetails from './correspondingDetails';
  6. import OrderItemStatus from '../../../../component/common/orderItemStatus';
  7. import $ from "jquery";
  8. import {ShowModal} from "@/tools";
  9. import ShowModalDiv from "@/showModal.jsx";
  10. import moment from "moment";
  11. const {TabPane} = Tabs;
  12. const { RangePicker } = DatePicker;
  13. class FollowUp extends Component{
  14. constructor(props) {
  15. super(props);
  16. this.state={
  17. columns:[
  18. {
  19. title: "合同编号",
  20. dataIndex: "contractNo",
  21. key: "contractNo",
  22. width: 120,
  23. fixed:'left',
  24. },
  25. {
  26. title: "订单编号",
  27. dataIndex: "orderNo",
  28. key: "orderNo",
  29. width: 140,
  30. fixed:'left',
  31. },
  32. {
  33. title: "状态",
  34. dataIndex: "deleteSign",
  35. key: "deleteSign",
  36. width:80,
  37. fixed:'left',
  38. render: (text) => {
  39. //0=正常, 1=作废, 2=锁定, 3=变更中
  40. return <div>
  41. <OrderItemStatus deleteSign={text}/>
  42. </div>
  43. }
  44. },
  45. {
  46. title: "订单部门",
  47. dataIndex: "depName",
  48. key: "depName",
  49. width: 160,
  50. fixed:'left',
  51. },
  52. {
  53. title: "客户名称",
  54. dataIndex: "userName",
  55. key: "userName",
  56. width:150,
  57. fixed:'left',
  58. render: text => {
  59. return (
  60. <Tooltip title={text}>
  61. <div style={{
  62. maxWidth:'150px',
  63. overflow:'hidden',
  64. textOverflow: "ellipsis",
  65. whiteSpace:'nowrap',
  66. }}>{text}</div>
  67. </Tooltip>
  68. )
  69. }
  70. },
  71. {
  72. title: "合同签订时间",
  73. dataIndex: "signTimes",
  74. key: "signTimes",
  75. },
  76. {
  77. title: "下单时间",
  78. dataIndex: "orderTimes",
  79. key: "orderTimes",
  80. },
  81. {
  82. title: "申报项目",
  83. dataIndex: "projects",
  84. key: "projects",
  85. width: 80,
  86. render: (text) => {
  87. return (
  88. <Tooltip placement="topLeft" title={text}>
  89. <div style={{
  90. maxWidth:'80px',
  91. overflow:'hidden',
  92. textOverflow: "ellipsis",
  93. whiteSpace:'nowrap',
  94. }}>{text}</div>
  95. </Tooltip>
  96. )
  97. }
  98. },
  99. {
  100. title: "咨询师",
  101. dataIndex: "consultants",
  102. key: "consultants",
  103. width: 80,
  104. render: (text) => {
  105. return (
  106. <Tooltip placement="topLeft" title={text}>
  107. <div style={{
  108. maxWidth:'80px',
  109. overflow:'hidden',
  110. textOverflow: "ellipsis",
  111. whiteSpace:'nowrap',
  112. }}>{text}</div>
  113. </Tooltip>
  114. )
  115. }
  116. },
  117. {
  118. title: "申报批次",
  119. dataIndex: "declareBatchs",
  120. key: "declareBatchs",
  121. width: 80,
  122. render: (text) => {
  123. return (
  124. <Tooltip placement="topLeft" title={text}>
  125. <div style={{
  126. maxWidth:'80px',
  127. overflow:'hidden',
  128. textOverflow: "ellipsis",
  129. whiteSpace:'nowrap',
  130. }}>{text}</div>
  131. </Tooltip>
  132. )
  133. }
  134. },
  135. {
  136. title: "证书编号",
  137. dataIndex: "certificationNos",
  138. key: "certificationNos",
  139. width: 80,
  140. render: (text) => {
  141. return (
  142. <Tooltip placement="topLeft" title={text}>
  143. <div style={{
  144. maxWidth:'80px',
  145. overflow:'hidden',
  146. textOverflow: "ellipsis",
  147. whiteSpace:'nowrap',
  148. }}>{text}</div>
  149. </Tooltip>
  150. )
  151. }
  152. },
  153. {
  154. title: "客服最新跟进",
  155. dataIndex: "newTimes",
  156. key: "newTimes",
  157. },
  158. {
  159. title: "跟进客服",
  160. dataIndex: "adminName",
  161. key: "adminName",
  162. },
  163. {
  164. title: "是否已添微信",
  165. dataIndex: "addWechat",
  166. key: "addWechat",
  167. width: 100,
  168. render: (text,record) => {
  169. let str = text === 1 ? '是('+record.wechat+')' : text === 0 ? '否' : '';
  170. return (
  171. <Tooltip placement="topLeft" title={str}>
  172. <div style={{
  173. maxWidth:'100px',
  174. overflow:'hidden',
  175. textOverflow: "ellipsis",
  176. whiteSpace:'nowrap',
  177. }}>{str}</div>
  178. </Tooltip>
  179. )
  180. }
  181. },
  182. {
  183. title: "续签情况",
  184. dataIndex: "renewal",
  185. key: "renewal",
  186. width: 80,
  187. render: (text,record) => {
  188. let str = text === 0 ? '未联系上当前联系人' :
  189. text === 1 ? '企业已签其他机构' :
  190. text === 2 ? '企业自己申报' :
  191. text === 3 ? '企业不打算申报/注销' :
  192. text === 4 ? '待续签,未报价(客服维护中)' :
  193. text === 5 ? '待续签,已报价(客服维护中)' :
  194. text === 6 ? ('已续签/复审、续签时间、续签项目' + (record.renewalTimes ? '('+record.renewalTimes+')' : '')): ''
  195. return (
  196. <Tooltip placement="topLeft" title={str}>
  197. <div style={{
  198. maxWidth:'80px',
  199. overflow:'hidden',
  200. textOverflow: "ellipsis",
  201. whiteSpace:'nowrap',
  202. }}>{str}</div>
  203. </Tooltip>
  204. )
  205. }
  206. },
  207. {
  208. title: "满意度(技术/业务)",
  209. dataIndex: "techSatisfaction",
  210. key: "techSatisfaction",
  211. render: (text,record) => (
  212. (
  213. text === 0 ? '已投诉' :
  214. text === 1 ? '不满意' :
  215. text === 2 ? '一般满意' :
  216. text === 3 ? '非常满意' : '无'
  217. )
  218. +'/'+
  219. (record.businessSatisfaction === 0 ? '已投诉' :
  220. record.businessSatisfaction === 1 ? '不满意' :
  221. record.businessSatisfaction === 2 ? '一般满意' :
  222. record.businessSatisfaction === 3 ? '非常满意' : '无')
  223. )
  224. },
  225. {
  226. title: "备注",
  227. dataIndex: "remarks",
  228. key: "remarks",
  229. width: 80,
  230. render: (text) => {
  231. return (
  232. <Tooltip placement="topLeft" title={text}>
  233. <div style={{
  234. maxWidth:'80px',
  235. overflow:'hidden',
  236. textOverflow: "ellipsis",
  237. whiteSpace:'nowrap',
  238. }}>{text}</div>
  239. </Tooltip>
  240. )
  241. }
  242. },
  243. {
  244. title: "操作",
  245. dataIndex: "a",
  246. key: "a",
  247. width: 100,
  248. render: (_,record) => {
  249. if(record.projects){
  250. let projectsArr = record.projects.split('/');
  251. let consultantsArr = record.consultants.split('/');
  252. let declareBatchsArr = record.declareBatchs.split('/');
  253. let certificationNosArr = record.certificationNos.split('/');
  254. let data = [];
  255. for (let i in projectsArr){
  256. data.push({
  257. project:projectsArr[i],
  258. consultant:consultantsArr[i],
  259. declareBatch:declareBatchsArr[i],
  260. certificationNo:certificationNosArr[i],
  261. })
  262. }
  263. return (
  264. <Button type="primary" onClick={(e)=>{
  265. e.stopPropagation();
  266. this.setState({
  267. detailsVisible:true,
  268. detailsInfor:data
  269. })
  270. }}>查看项目</Button>
  271. )
  272. }
  273. }
  274. },
  275. ],
  276. changeList:[],
  277. listLoading:false,
  278. page:1,
  279. pagination: {
  280. defaultCurrent: 1,
  281. defaultPageSize: 10,
  282. showQuickJumper: true,
  283. pageSize: 10,
  284. onChange: function (page) {
  285. this.loadData(page);
  286. }.bind(this),
  287. showTotal: function (total) {
  288. return "共" + total + "条数据";
  289. },
  290. },
  291. departmentArr:[],
  292. customerName:'',
  293. releaseDate:[],
  294. signTimes:[],
  295. }
  296. this.changeList = this.changeList.bind(this);
  297. this.loadData = this.loadData.bind(this);
  298. this.search = this.search.bind(this);
  299. this.reset = this.reset.bind(this);
  300. this.departmentList = this.departmentList.bind(this);
  301. this.download = this.download.bind(this);
  302. }
  303. componentDidMount() {
  304. this.departmentList();
  305. this.loadData();
  306. }
  307. search(){
  308. this.loadData();
  309. }
  310. reset(){
  311. this.setState({
  312. customerName:undefined,
  313. depId:undefined,
  314. addWechat:undefined,
  315. renewal:undefined,
  316. releaseDate:[],
  317. signTimes:[],
  318. },()=>{
  319. this.loadData();
  320. })
  321. }
  322. loadData(pageNo) {
  323. this.setState({
  324. listLoading: true,
  325. });
  326. $.ajax({
  327. method: "get",
  328. dataType: "json",
  329. crossDomain: false,
  330. url: globalConfig.context + "/api/admin/listOrderUseService",
  331. data: {
  332. pageNo: pageNo || 1,
  333. pageSize: this.state.pagination.pageSize,
  334. userName:this.state.customerName || undefined,
  335. depId:this.state.depId || undefined,
  336. addWechat:this.state.addWechat || undefined,
  337. renewal:this.state.renewal || undefined,
  338. startFollowTimes:this.state.releaseDate[0] || undefined,
  339. endFollowTimes:this.state.releaseDate[1] || undefined,
  340. startSignTimes:this.state.signTimes[0] || undefined,
  341. endSignTimes:this.state.signTimes[1] || undefined,
  342. },
  343. success: function (data) {
  344. ShowModal(this);
  345. let theArr = [];
  346. if (!data.data || !data.data.list) {
  347. if (data.error && data.error.length) {
  348. message.warning(data.error[0].message);
  349. }
  350. } else {
  351. for (let i = 0; i < data.data.list.length; i++) {
  352. let thisdata = data.data.list[i];
  353. theArr.push(thisdata);
  354. }
  355. this.state.pagination.current = data.data.pageNo;
  356. this.state.pagination.total = data.data.totalCount;
  357. if (data.data && data.data.list && !data.data.list.length) {
  358. this.state.pagination.current = 0;
  359. this.state.pagination.total = 0;
  360. }
  361. let obj = {
  362. userName:this.state.customerName || undefined,
  363. depId:this.state.depId || undefined,
  364. addWechat:this.state.addWechat || undefined,
  365. renewal:this.state.renewal || undefined,
  366. startFollowTimes:this.state.releaseDate[0] || undefined,
  367. endFollowTimes:this.state.releaseDate[1] || undefined,
  368. startSignTimes:this.state.signTimes[0] || undefined,
  369. endSignTimes:this.state.signTimes[1] || undefined,
  370. }
  371. let arr = Object.keys(obj);
  372. let str = '?';
  373. for(let i of arr){
  374. if(obj[i]){
  375. str+=i+'='+obj[i]+'&'
  376. }
  377. }
  378. this.setState({
  379. dataSource: theArr,
  380. page: data.data.pageNo,
  381. pagination: this.state.pagination,
  382. downloadSrc:str,
  383. });
  384. }
  385. }.bind(this),
  386. }).always(
  387. function () {
  388. this.setState({
  389. listLoading: false,
  390. });
  391. }.bind(this)
  392. );
  393. }
  394. changeList(arr) {
  395. const newArr = [];
  396. this.state.columns.forEach(item => {
  397. arr.forEach(val => {
  398. if (val === item.title) {
  399. newArr.push(item);
  400. }
  401. });
  402. });
  403. this.setState({
  404. changeList: newArr
  405. });
  406. }
  407. //部门
  408. departmentList() {
  409. $.ajax({
  410. method: "get",
  411. dataType: "json",
  412. crossDomain: false,
  413. url: globalConfig.context + "/api/admin/organization/selectSuperId",
  414. data: {},
  415. success: function (data) {
  416. let thedata = data.data;
  417. let theArr = [];
  418. if (!thedata) {
  419. if (data.error && data.error.length) {
  420. message.warning(data.error[0].message);
  421. }
  422. } else {
  423. thedata.map(function (item, index) {
  424. theArr.push({
  425. key: index,
  426. name: item.name,
  427. id: item.id,
  428. });
  429. });
  430. }
  431. this.setState({
  432. departmentArr: theArr,
  433. });
  434. }.bind(this),
  435. }).always(
  436. function () {
  437. }.bind(this)
  438. );
  439. }
  440. download() {
  441. window.location.href =
  442. globalConfig.context +
  443. "/api/admin/userServiceExport" + this.state.downloadSrc
  444. }
  445. render() {
  446. return (
  447. <div className="user-content">
  448. <ShowModalDiv ShowModal={this.state.showModal} />
  449. <div className="content-title">
  450. <span>客服跟进详情</span>
  451. </div>
  452. <Tabs defaultActiveKey="1" className="test">
  453. <TabPane tab="搜索" key="1" style={{padding:'10px 0'}}>
  454. <Input
  455. placeholder="客户名称"
  456. style={{ width: "150px", marginRight: 10,marginBottom: "10px" }}
  457. value={this.state.customerName}
  458. onChange={(e) => {
  459. this.setState({ customerName: e.target.value });
  460. }}
  461. />
  462. <Select
  463. placeholder="订单部门"
  464. style={{ width: 150, marginRight: 10,marginBottom: "10px" }}
  465. value={this.state.depId}
  466. onChange={(e) => {
  467. this.setState({ depId: e });
  468. }}
  469. >
  470. {this.state.departmentArr.map(function (item) {
  471. return <Option key={item.id}>{item.name}</Option>;
  472. })}
  473. </Select>
  474. <Select
  475. placeholder="是否已添微信"
  476. style={{ width: 150, marginRight: 10,marginBottom: "10px" }}
  477. value={this.state.addWechat}
  478. onChange={(e) => {
  479. this.setState({ addWechat: e });
  480. }}
  481. >
  482. <Option value={0}>否</Option>
  483. <Option value={1}>是</Option>
  484. </Select>
  485. <Select
  486. placeholder="续签情况"
  487. style={{ width: 250, marginRight: 10,marginBottom: "10px" }}
  488. value={this.state.renewal}
  489. onChange={(e) => {
  490. this.setState({ renewal: e });
  491. }}
  492. >
  493. <Option value={6}>已续签/复审、续签时间、续签项目</Option>
  494. <Option value={5}>待续签,已报价(客服维护中)</Option>
  495. <Option value={4}>待续签,未报价(客服维护中)</Option>
  496. <Option value={3}>企业不打算申报/注销</Option>
  497. <Option value={2}>企业自己申报</Option>
  498. <Option value={1}>企业已签其他机构</Option>
  499. <Option value={0}>未联系上当前联系人</Option>
  500. </Select>
  501. <span style={{ marginRight: "10px",marginBottom: "10px" }}>跟进时间 :</span>
  502. <RangePicker
  503. style={{marginBottom: "10px",width:'187px'}}
  504. value={[
  505. this.state.releaseDate[0]
  506. ? moment(this.state.releaseDate[0])
  507. : null,
  508. this.state.releaseDate[1]
  509. ? moment(this.state.releaseDate[1])
  510. : null,
  511. ]}
  512. onChange={(data, dataString) => {
  513. this.setState({ releaseDate: dataString });
  514. }}
  515. />
  516. <span style={{ marginRight: "10px",marginLeft: "10px",marginBottom: "10px" }}>下单时间 :</span>
  517. <RangePicker
  518. style={{marginBottom: "10px",width:'187px'}}
  519. value={[
  520. this.state.signTimes[0]
  521. ? moment(this.state.signTimes[0])
  522. : null,
  523. this.state.signTimes[1]
  524. ? moment(this.state.signTimes[1])
  525. : null,
  526. ]}
  527. onChange={(data, dataString) => {
  528. this.setState({ signTimes: dataString });
  529. }}
  530. />
  531. <Button
  532. type="primary"
  533. onClick={this.search}
  534. style={{ marginLeft: "10px",marginBottom: "10px" }}
  535. >
  536. 搜索
  537. <Icon type="search" />
  538. </Button>
  539. <Button onClick={this.reset} style={{ marginLeft: "10px",marginBottom: "10px" }}>
  540. 重置 <Icon type="reload" />
  541. </Button>
  542. </TabPane>
  543. <TabPane tab="更改表格显示数据" key="2">
  544. <div style={{ marginLeft: 10 }}>
  545. <ChooseList
  546. columns={this.state.columns}
  547. changeFn={this.changeList}
  548. changeList={this.state.changeList}
  549. top={55}
  550. margin={11}
  551. />
  552. </div>
  553. </TabPane>
  554. <TabPane tab="操作" key="3">
  555. <Button
  556. type="primary"
  557. style={{margin: '10px'}}
  558. onClick={this.download}
  559. >
  560. 导出
  561. </Button>
  562. </TabPane>
  563. </Tabs>
  564. <div className="patent-table">
  565. <Spin spinning={this.state.listLoading}>
  566. <Table
  567. columns={this.state.columns}
  568. dataSource={this.state.dataSource}
  569. pagination={this.state.pagination}
  570. scroll={{ x: "max-content", y: 0 }}
  571. bordered
  572. onRowClick={(record)=>{
  573. this.setState({
  574. visible:true,
  575. orderNo:record.orderNo,
  576. uid:record.uid,
  577. })
  578. }}
  579. />
  580. </Spin>
  581. </div>
  582. {this.state.visible ? <FollowUpDetails
  583. visible={this.state.visible}
  584. orderNo={this.state.orderNo}
  585. uid={this.state.uid}
  586. onCancel={()=>{
  587. this.setState({
  588. visible:false,
  589. orderNo:'',
  590. uid:'',
  591. },()=>{
  592. this.loadData(this.state.page);
  593. })
  594. }}/> : ''}
  595. {this.state.detailsVisible ?
  596. <CorrespondingDetails
  597. visible={this.state.detailsVisible}
  598. detailsInfor={this.state.detailsInfor}
  599. onCancel={()=>{
  600. this.setState({
  601. detailsVisible:false,
  602. detailsInfor:[],
  603. })
  604. }}/> : ''}
  605. </div>
  606. )
  607. }
  608. }
  609. export default FollowUp;