123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621 |
- import React, { Component } from "react";
- import { Button, DatePicker, Icon, Input, message, Select, Spin, Table, Tabs, Tag, Tooltip } from "antd";
- import { ChooseList } from "../../order/orderNew/chooseList";
- import FollowUpDetails from './followUpDetails';
- import CorrespondingDetails from './correspondingDetails';
- import OrderItemStatus from '../../../../component/common/orderItemStatus';
- import $ from "jquery";
- import { ShowModal } from "@/tools";
- import ShowModalDiv from "@/showModal.jsx";
- import moment from "moment";
- import Cascaders from "../../../../component/common/cascaders";
- const { TabPane } = Tabs;
- const { RangePicker } = DatePicker;
- class FollowUp extends Component {
- constructor(props) {
- super(props);
- this.state = {
- columns: [
- {
- title: "合同编号",
- dataIndex: "contractNo",
- key: "contractNo",
- width: 120,
- fixed: 'left',
- },
- {
- title: "订单编号",
- dataIndex: "orderNo",
- key: "orderNo",
- width: 140,
- fixed: 'left',
- },
- {
- title: "状态",
- dataIndex: "deleteSign",
- key: "deleteSign",
- width: 80,
- fixed: 'left',
- render: (text) => {
- //0=正常, 1=作废, 2=锁定, 3=变更中
- return <div>
- <OrderItemStatus deleteSign={text} />
- </div>
- }
- },
- {
- title: "订单部门",
- dataIndex: "depName",
- key: "depName",
- width: 160,
- fixed: 'left',
- },
- {
- title: "客户名称",
- dataIndex: "userName",
- key: "userName",
- width: 150,
- fixed: 'left',
- render: text => {
- return (
- <Tooltip title={text}>
- <div
- // style={{
- // maxWidth: '150px',
- // overflow: 'hidden',
- // textOverflow: "ellipsis",
- // whiteSpace: 'nowrap',
- // }}
- >{text}</div>
- </Tooltip>
- )
- }
- },
- {
- title: "合同签订时间",
- dataIndex: "signTimes",
- key: "signTimes",
- },
- {
- title: "下单时间",
- dataIndex: "orderTimes",
- key: "orderTimes",
- },
- {
- title: "申报项目",
- dataIndex: "projects",
- key: "projects",
- width: 80,
- render: (text) => {
- return (
- <Tooltip placement="topLeft" title={text}>
- <div style={{
- maxWidth: '80px',
- overflow: 'hidden',
- textOverflow: "ellipsis",
- whiteSpace: 'nowrap',
- }}>{text}</div>
- </Tooltip>
- )
- }
- },
- {
- title: "咨询师",
- dataIndex: "consultants",
- key: "consultants",
- width: 80,
- render: (text) => {
- return (
- <Tooltip placement="topLeft" title={text}>
- <div style={{
- maxWidth: '80px',
- overflow: 'hidden',
- textOverflow: "ellipsis",
- whiteSpace: 'nowrap',
- }}>{text}</div>
- </Tooltip>
- )
- }
- },
- {
- title: "申报批次",
- dataIndex: "declareBatchs",
- key: "declareBatchs",
- width: 80,
- render: (text) => {
- return (
- <Tooltip placement="topLeft" title={text}>
- <div style={{
- maxWidth: '80px',
- overflow: 'hidden',
- textOverflow: "ellipsis",
- whiteSpace: 'nowrap',
- }}>{text}</div>
- </Tooltip>
- )
- }
- },
- {
- title: "证书编号",
- dataIndex: "certificationNos",
- key: "certificationNos",
- width: 80,
- render: (text) => {
- return (
- <Tooltip placement="topLeft" title={text}>
- <div style={{
- maxWidth: '80px',
- overflow: 'hidden',
- textOverflow: "ellipsis",
- whiteSpace: 'nowrap',
- }}>{text}</div>
- </Tooltip>
- )
- }
- },
- {
- title: "客服最新跟进",
- dataIndex: "newTimes",
- key: "newTimes",
- },
- {
- title: "跟进客服",
- dataIndex: "adminName",
- key: "adminName",
- },
- {
- title: "是否已添微信",
- dataIndex: "addWechat",
- key: "addWechat",
- width: 100,
- render: (text, record) => {
- let str = text === 1 ? '是(' + record.wechat + ')' : text === 0 ? '否' : '';
- return (
- <Tooltip placement="topLeft" title={str}>
- <div style={{
- maxWidth: '100px',
- overflow: 'hidden',
- textOverflow: "ellipsis",
- whiteSpace: 'nowrap',
- }}>{str}</div>
- </Tooltip>
- )
- }
- },
- {
- title: "续签情况",
- dataIndex: "renewal",
- key: "renewal",
- width: 80,
- render: (text, record) => {
- let str = text === 0 ? '未联系上当前联系人' :
- text === 1 ? '企业已签其他机构' :
- text === 2 ? '企业自己申报' :
- text === 3 ? '企业不打算申报/注销' :
- text === 4 ? '待续签,未报价(客服维护中)' :
- text === 5 ? '待续签,已报价(客服维护中)' :
- text === 6 ? ('已续签/复审、续签时间、续签项目' + (record.renewalTimes ? '(' + record.renewalTimes + ')' : '')) : ''
- return (
- <Tooltip placement="topLeft" title={str}>
- <div style={{
- maxWidth: '80px',
- overflow: 'hidden',
- textOverflow: "ellipsis",
- whiteSpace: 'nowrap',
- }}>{str}</div>
- </Tooltip>
- )
- }
- },
- {
- title: "满意度(技术/业务)",
- dataIndex: "techSatisfaction",
- key: "techSatisfaction",
- render: (text, record) => (
- (
- text === 0 ? '已投诉' :
- text === 1 ? '不满意' :
- text === 2 ? '一般满意' :
- text === 3 ? '非常满意' : '无'
- )
- + '/' +
- (record.businessSatisfaction === 0 ? '已投诉' :
- record.businessSatisfaction === 1 ? '不满意' :
- record.businessSatisfaction === 2 ? '一般满意' :
- record.businessSatisfaction === 3 ? '非常满意' : '无')
- )
- },
- {
- title: "备注",
- dataIndex: "remarks",
- key: "remarks",
- width: 80,
- render: (text) => {
- return (
- <Tooltip placement="topLeft" title={text}>
- <div style={{
- maxWidth: '80px',
- overflow: 'hidden',
- textOverflow: "ellipsis",
- whiteSpace: 'nowrap',
- }}>{text}</div>
- </Tooltip>
- )
- }
- },
- {
- title: "操作",
- dataIndex: "a",
- key: "a",
- width: 100,
- render: (_, record) => {
- if (record.projects) {
- let projectsArr = record.projects.split('/');
- let consultantsArr = record.consultants.split('/');
- let declareBatchsArr = record.declareBatchs.split('/');
- let certificationNosArr = record.certificationNos.split('/');
- let data = [];
- for (let i in projectsArr) {
- data.push({
- project: projectsArr[i],
- consultant: consultantsArr[i],
- declareBatch: declareBatchsArr[i],
- certificationNo: certificationNosArr[i],
- })
- }
- return (
- <Button type="primary" onClick={(e) => {
- e.stopPropagation();
- this.setState({
- detailsVisible: true,
- detailsInfor: data
- })
- }}>查看项目</Button>
- )
- }
- }
- },
- ],
- changeList: [],
- listLoading: false,
- page: 1,
- pagination: {
- defaultCurrent: 1,
- defaultPageSize: 10,
- showQuickJumper: true,
- pageSize: 10,
- onChange: function (page) {
- this.loadData(page);
- }.bind(this),
- showTotal: function (total) {
- return "共" + total + "条数据";
- },
- },
- departmentArr: [],
- customerName: '',
- releaseDate: [],
- signTimes: [],
- }
- this.changeList = this.changeList.bind(this);
- this.loadData = this.loadData.bind(this);
- this.search = this.search.bind(this);
- this.reset = this.reset.bind(this);
- this.exportExec = this.exportExec.bind(this);
- this.download = this.download.bind(this);
- }
- componentDidMount() {
- this.loadData();
- }
- search() {
- this.loadData();
- }
- reset() {
- this.setState({
- customerName: undefined,
- contractNo: undefined,
- depId: undefined,
- addWechat: undefined,
- renewal: undefined,
- releaseDate: [],
- signTimes: [],
- }, () => {
- this.Cascaders.empty();
- this.loadData();
- })
- }
- loadData(pageNo) {
- this.setState({
- listLoading: true,
- });
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: globalConfig.context + "/api/admin/listOrderUseService",
- data: {
- pageNo: pageNo || 1,
- pageSize: this.state.pagination.pageSize,
- userName: this.state.customerName || undefined,
- deps: this.state.depId || undefined,
- addWechat: this.state.addWechat || undefined,
- renewal: this.state.renewal || undefined,
- startFollowTimes: this.state.releaseDate[0] || undefined,
- endFollowTimes: this.state.releaseDate[1] || undefined,
- startSignTimes: this.state.signTimes[0] || undefined,
- endSignTimes: this.state.signTimes[1] || undefined,
- contractNo: this.state.contractNo || undefined,
- },
- success: function (data) {
- ShowModal(this);
- let theArr = [];
- if (!data.data || !data.data.list) {
- if (data.error && data.error.length) {
- message.warning(data.error[0].message);
- }
- } else {
- for (let i = 0; i < data.data.list.length; i++) {
- let thisdata = data.data.list[i];
- theArr.push(thisdata);
- }
- this.state.pagination.current = data.data.pageNo;
- this.state.pagination.total = data.data.totalCount;
- if (data.data && data.data.list && !data.data.list.length) {
- this.state.pagination.current = 0;
- this.state.pagination.total = 0;
- }
- this.setState({
- dataSource: theArr,
- page: data.data.pageNo,
- pagination: this.state.pagination,
- });
- }
- }.bind(this),
- }).always(
- function () {
- this.setState({
- listLoading: false,
- });
- }.bind(this)
- );
- }
- changeList(arr) {
- const newArr = [];
- this.state.columns.forEach(item => {
- arr.forEach(val => {
- if (val === item.title) {
- newArr.push(item);
- }
- });
- });
- this.setState({
- changeList: newArr
- });
- }
- // 导出excel
- exportExec() {
- message.config({
- duration: 20,
- });
- let loading = message.loading("下载中...");
- this.setState({
- exportPendingLoading: true,
- });
- let data = {
- userName: this.state.customerName || undefined,
- deps: this.state.depId || undefined,
- addWechat: this.state.addWechat || undefined,
- renewal: this.state.renewal || undefined,
- startFollowTimes: this.state.releaseDate[0] || undefined,
- endFollowTimes: this.state.releaseDate[1] || undefined,
- startSignTimes: this.state.signTimes[0] || undefined,
- endSignTimes: this.state.signTimes[1] || undefined,
- };
- $.ajax({
- method: "get",
- dataType: "json",
- crossDomain: false,
- url: "/api/admin/userServiceExport",
- data,
- success: function (data) {
- if (data.error.length === 0) {
- this.download(data.data);
- } else {
- message.warning(data.error[0].message);
- }
- }.bind(this),
- }).always(
- function () {
- loading();
- this.setState({
- exportPendingLoading: false,
- });
- }.bind(this)
- );
- }
- // 下载
- download(fileName) {
- window.location.href =
- globalConfig.context + "/open/download?fileName=" + fileName;
- }
- render() {
- return (
- <div className="user-content">
- <ShowModalDiv ShowModal={this.state.showModal} onClose={() => { this.setState({ showModal: false }) }} />
- <div className="content-title">
- <span style={{ fontWeight: 900, fontSize: 16 }}>客服跟进详情</span>
- </div>
- <Tabs defaultActiveKey="1" className="test">
- <TabPane tab="搜索" key="1" style={{ padding: '10px 0' }}>
- <Input
- placeholder="客户名称"
- style={{ width: "150px", marginRight: 10, marginBottom: "10px" }}
- value={this.state.customerName}
- onChange={(e) => {
- this.setState({ customerName: e.target.value });
- }}
- />
- <Input
- placeholder="合同编号"
- style={{ width: "150px", marginRight: 10, marginBottom: "10px" }}
- value={this.state.contractNo}
- onChange={(e) => {
- this.setState({ contractNo: e.target.value });
- }}
- />
- <Cascaders
- ref={node => this.Cascaders = node}
- placeholder="订单部门"
- height={28}
- onSel={(e) => {
- this.setState({
- depId: JSON.stringify(e),
- });
- }}
- />
- <Select
- placeholder="是否已添微信"
- style={{ width: 120, marginRight: 10, marginBottom: "10px" }}
- value={this.state.addWechat}
- onChange={(e) => {
- this.setState({ addWechat: e });
- }}
- >
- <Option value={0}>否</Option>
- <Option value={1}>是</Option>
- </Select>
- <Select
- placeholder="续签情况"
- style={{ width: 220, marginRight: 10, marginBottom: "10px" }}
- value={this.state.renewal}
- onChange={(e) => {
- this.setState({ renewal: e });
- }}
- >
- <Option value={6}>已续签/复审、续签时间、续签项目</Option>
- <Option value={5}>待续签,已报价(客服维护中)</Option>
- <Option value={4}>待续签,未报价(客服维护中)</Option>
- <Option value={3}>企业不打算申报/注销</Option>
- <Option value={2}>企业自己申报</Option>
- <Option value={1}>企业已签其他机构</Option>
- <Option value={0}>未联系上当前联系人</Option>
- </Select>
- <span style={{ marginRight: "10px", marginBottom: "10px" }}>跟进时间 :</span>
- <RangePicker
- style={{ marginBottom: "10px", width: '187px' }}
- value={[
- this.state.releaseDate[0]
- ? moment(this.state.releaseDate[0])
- : null,
- this.state.releaseDate[1]
- ? moment(this.state.releaseDate[1])
- : null,
- ]}
- onChange={(data, dataString) => {
- this.setState({ releaseDate: dataString });
- }}
- />
- <span style={{ marginRight: "10px", marginLeft: "10px", marginBottom: "10px" }}>下单时间 :</span>
- <RangePicker
- style={{ marginBottom: "10px", width: '187px' }}
- value={[
- this.state.signTimes[0]
- ? moment(this.state.signTimes[0])
- : null,
- this.state.signTimes[1]
- ? moment(this.state.signTimes[1])
- : null,
- ]}
- onChange={(data, dataString) => {
- this.setState({ signTimes: dataString });
- }}
- />
- <Button
- type="primary"
- onClick={this.search}
- style={{ marginLeft: "10px", marginBottom: "10px" }}
- >
- 搜索
- <Icon type="search" />
- </Button>
- <Button onClick={this.reset} style={{ marginLeft: "10px", marginBottom: "10px" }}>
- 重置 <Icon type="reload" />
- </Button>
- </TabPane>
- <TabPane tab="更改表格显示数据" key="2">
- <div style={{ marginLeft: 10 }}>
- <ChooseList
- columns={this.state.columns}
- changeFn={this.changeList}
- changeList={this.state.changeList}
- top={55}
- margin={11}
- />
- </div>
- </TabPane>
- <TabPane tab="操作" key="3">
- <Button
- type="primary"
- style={{ margin: '10px' }}
- onClick={this.exportExec}
- >
- 导出
- </Button>
- </TabPane>
- </Tabs>
- <div className="patent-table">
- <Spin spinning={this.state.listLoading}>
- <Table
- columns={this.state.columns}
- dataSource={this.state.dataSource}
- pagination={this.state.pagination}
- scroll={{ x: "max-content", y: 0 }}
- bordered
- onRowClick={(record) => {
- this.setState({
- visible: true,
- orderNo: record.orderNo,
- uid: record.uid,
- })
- }}
- />
- </Spin>
- </div>
- {this.state.visible ? <FollowUpDetails
- visible={this.state.visible}
- orderNo={this.state.orderNo}
- uid={this.state.uid}
- onCancel={() => {
- this.setState({
- visible: false,
- orderNo: '',
- uid: '',
- }, () => {
- this.loadData(this.state.page);
- })
- }} /> : ''}
- {this.state.detailsVisible ?
- <CorrespondingDetails
- visible={this.state.detailsVisible}
- detailsInfor={this.state.detailsInfor}
- onCancel={() => {
- this.setState({
- detailsVisible: false,
- detailsInfor: [],
- })
- }} /> : ''}
- </div>
- )
- }
- }
- export default FollowUp;
|