followUp.jsx 19 KB

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