followUp.jsx 19 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621
  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. contractNo: undefined,
  316. depId: undefined,
  317. addWechat: undefined,
  318. renewal: undefined,
  319. releaseDate: [],
  320. signTimes: [],
  321. }, () => {
  322. this.Cascaders.empty();
  323. this.loadData();
  324. })
  325. }
  326. loadData(pageNo) {
  327. this.setState({
  328. listLoading: true,
  329. });
  330. $.ajax({
  331. method: "get",
  332. dataType: "json",
  333. crossDomain: false,
  334. url: globalConfig.context + "/api/admin/listOrderUseService",
  335. data: {
  336. pageNo: pageNo || 1,
  337. pageSize: this.state.pagination.pageSize,
  338. userName: this.state.customerName || undefined,
  339. deps: this.state.depId || undefined,
  340. addWechat: this.state.addWechat || undefined,
  341. renewal: this.state.renewal || undefined,
  342. startFollowTimes: this.state.releaseDate[0] || undefined,
  343. endFollowTimes: this.state.releaseDate[1] || undefined,
  344. startSignTimes: this.state.signTimes[0] || undefined,
  345. endSignTimes: this.state.signTimes[1] || undefined,
  346. contractNo: this.state.contractNo || undefined,
  347. },
  348. success: function (data) {
  349. ShowModal(this);
  350. let theArr = [];
  351. if (!data.data || !data.data.list) {
  352. if (data.error && data.error.length) {
  353. message.warning(data.error[0].message);
  354. }
  355. } else {
  356. for (let i = 0; i < data.data.list.length; i++) {
  357. let thisdata = data.data.list[i];
  358. theArr.push(thisdata);
  359. }
  360. this.state.pagination.current = data.data.pageNo;
  361. this.state.pagination.total = data.data.totalCount;
  362. if (data.data && data.data.list && !data.data.list.length) {
  363. this.state.pagination.current = 0;
  364. this.state.pagination.total = 0;
  365. }
  366. this.setState({
  367. dataSource: theArr,
  368. page: data.data.pageNo,
  369. pagination: this.state.pagination,
  370. });
  371. }
  372. }.bind(this),
  373. }).always(
  374. function () {
  375. this.setState({
  376. listLoading: false,
  377. });
  378. }.bind(this)
  379. );
  380. }
  381. changeList(arr) {
  382. const newArr = [];
  383. this.state.columns.forEach(item => {
  384. arr.forEach(val => {
  385. if (val === item.title) {
  386. newArr.push(item);
  387. }
  388. });
  389. });
  390. this.setState({
  391. changeList: newArr
  392. });
  393. }
  394. // 导出excel
  395. exportExec() {
  396. message.config({
  397. duration: 20,
  398. });
  399. let loading = message.loading("下载中...");
  400. this.setState({
  401. exportPendingLoading: true,
  402. });
  403. let data = {
  404. userName: this.state.customerName || undefined,
  405. deps: this.state.depId || undefined,
  406. addWechat: this.state.addWechat || undefined,
  407. renewal: this.state.renewal || undefined,
  408. startFollowTimes: this.state.releaseDate[0] || undefined,
  409. endFollowTimes: this.state.releaseDate[1] || undefined,
  410. startSignTimes: this.state.signTimes[0] || undefined,
  411. endSignTimes: this.state.signTimes[1] || undefined,
  412. };
  413. $.ajax({
  414. method: "get",
  415. dataType: "json",
  416. crossDomain: false,
  417. url: "/api/admin/userServiceExport",
  418. data,
  419. success: function (data) {
  420. if (data.error.length === 0) {
  421. this.download(data.data);
  422. } else {
  423. message.warning(data.error[0].message);
  424. }
  425. }.bind(this),
  426. }).always(
  427. function () {
  428. loading();
  429. this.setState({
  430. exportPendingLoading: false,
  431. });
  432. }.bind(this)
  433. );
  434. }
  435. // 下载
  436. download(fileName) {
  437. window.location.href =
  438. globalConfig.context + "/open/download?fileName=" + fileName;
  439. }
  440. render() {
  441. return (
  442. <div className="user-content">
  443. <ShowModalDiv ShowModal={this.state.showModal} onClose={() => { this.setState({ showModal: false }) }} />
  444. <div className="content-title">
  445. <span style={{ fontWeight: 900, fontSize: 16 }}>客服跟进详情</span>
  446. </div>
  447. <Tabs defaultActiveKey="1" className="test">
  448. <TabPane tab="搜索" key="1" style={{ padding: '10px 0' }}>
  449. <Input
  450. placeholder="客户名称"
  451. style={{ width: "150px", marginRight: 10, marginBottom: "10px" }}
  452. value={this.state.customerName}
  453. onChange={(e) => {
  454. this.setState({ customerName: e.target.value });
  455. }}
  456. />
  457. <Input
  458. placeholder="合同编号"
  459. style={{ width: "150px", marginRight: 10, marginBottom: "10px" }}
  460. value={this.state.contractNo}
  461. onChange={(e) => {
  462. this.setState({ contractNo: e.target.value });
  463. }}
  464. />
  465. <Cascaders
  466. ref={node => this.Cascaders = node}
  467. placeholder="订单部门"
  468. height={28}
  469. onSel={(e) => {
  470. this.setState({
  471. depId: JSON.stringify(e),
  472. });
  473. }}
  474. />
  475. <Select
  476. placeholder="是否已添微信"
  477. style={{ width: 120, marginRight: 10, marginBottom: "10px" }}
  478. value={this.state.addWechat}
  479. onChange={(e) => {
  480. this.setState({ addWechat: e });
  481. }}
  482. >
  483. <Option value={0}>否</Option>
  484. <Option value={1}>是</Option>
  485. </Select>
  486. <Select
  487. placeholder="续签情况"
  488. style={{ width: 220, marginRight: 10, marginBottom: "10px" }}
  489. value={this.state.renewal}
  490. onChange={(e) => {
  491. this.setState({ renewal: e });
  492. }}
  493. >
  494. <Option value={6}>已续签/复审、续签时间、续签项目</Option>
  495. <Option value={5}>待续签,已报价(客服维护中)</Option>
  496. <Option value={4}>待续签,未报价(客服维护中)</Option>
  497. <Option value={3}>企业不打算申报/注销</Option>
  498. <Option value={2}>企业自己申报</Option>
  499. <Option value={1}>企业已签其他机构</Option>
  500. <Option value={0}>未联系上当前联系人</Option>
  501. </Select>
  502. <span style={{ marginRight: "10px", marginBottom: "10px" }}>跟进时间 :</span>
  503. <RangePicker
  504. style={{ marginBottom: "10px", width: '187px' }}
  505. value={[
  506. this.state.releaseDate[0]
  507. ? moment(this.state.releaseDate[0])
  508. : null,
  509. this.state.releaseDate[1]
  510. ? moment(this.state.releaseDate[1])
  511. : null,
  512. ]}
  513. onChange={(data, dataString) => {
  514. this.setState({ releaseDate: dataString });
  515. }}
  516. />
  517. <span style={{ marginRight: "10px", marginLeft: "10px", marginBottom: "10px" }}>下单时间 :</span>
  518. <RangePicker
  519. style={{ marginBottom: "10px", width: '187px' }}
  520. value={[
  521. this.state.signTimes[0]
  522. ? moment(this.state.signTimes[0])
  523. : null,
  524. this.state.signTimes[1]
  525. ? moment(this.state.signTimes[1])
  526. : null,
  527. ]}
  528. onChange={(data, dataString) => {
  529. this.setState({ signTimes: dataString });
  530. }}
  531. />
  532. <Button
  533. type="primary"
  534. onClick={this.search}
  535. style={{ marginLeft: "10px", marginBottom: "10px" }}
  536. >
  537. 搜索
  538. <Icon type="search" />
  539. </Button>
  540. <Button onClick={this.reset} style={{ marginLeft: "10px", marginBottom: "10px" }}>
  541. 重置 <Icon type="reload" />
  542. </Button>
  543. </TabPane>
  544. <TabPane tab="更改表格显示数据" key="2">
  545. <div style={{ marginLeft: 10 }}>
  546. <ChooseList
  547. columns={this.state.columns}
  548. changeFn={this.changeList}
  549. changeList={this.state.changeList}
  550. top={55}
  551. margin={11}
  552. />
  553. </div>
  554. </TabPane>
  555. <TabPane tab="操作" key="3">
  556. <Button
  557. type="primary"
  558. style={{ margin: '10px' }}
  559. onClick={this.exportExec}
  560. >
  561. 导出
  562. </Button>
  563. </TabPane>
  564. </Tabs>
  565. <div className="patent-table">
  566. <Spin spinning={this.state.listLoading}>
  567. <Table
  568. columns={this.state.columns}
  569. dataSource={this.state.dataSource}
  570. pagination={this.state.pagination}
  571. scroll={{ x: "max-content", y: 0 }}
  572. bordered
  573. onRowClick={(record) => {
  574. this.setState({
  575. visible: true,
  576. orderNo: record.orderNo,
  577. uid: record.uid,
  578. })
  579. }}
  580. />
  581. </Spin>
  582. </div>
  583. {this.state.visible ? <FollowUpDetails
  584. visible={this.state.visible}
  585. orderNo={this.state.orderNo}
  586. uid={this.state.uid}
  587. onCancel={() => {
  588. this.setState({
  589. visible: false,
  590. orderNo: '',
  591. uid: '',
  592. }, () => {
  593. this.loadData(this.state.page);
  594. })
  595. }} /> : ''}
  596. {this.state.detailsVisible ?
  597. <CorrespondingDetails
  598. visible={this.state.detailsVisible}
  599. detailsInfor={this.state.detailsInfor}
  600. onCancel={() => {
  601. this.setState({
  602. detailsVisible: false,
  603. detailsInfor: [],
  604. })
  605. }} /> : ''}
  606. </div>
  607. )
  608. }
  609. }
  610. export default FollowUp;