followUp.jsx 25 KB

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