From ede4834577b0c780081f26e9b78ffbccb64ed8d1 Mon Sep 17 00:00:00 2001
From: Jimmy Liow <18777396951@163.com>
Date: Wed, 14 Dec 2022 10:47:36 +0800
Subject: [PATCH 1/9] =?UTF-8?q?=E5=AE=8C=E6=88=90=E5=9C=B0=E6=8E=A5?=
=?UTF-8?q?=E7=A4=BE=E5=9B=A2=E4=BF=A1=E6=81=AF=EF=BC=8C=E5=A2=9E=E5=8A=A0?=
=?UTF-8?q?=E6=9F=A5=E8=AF=A2=E6=9D=A1=E4=BB=B6=EF=BC=8C=E8=B0=83=E6=95=B4?=
=?UTF-8?q?=20URL?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/App.js | 6 +-
src/stores/CustomerServices.js | 64 +++++++++++--
src/views/AgentGroupCount.js | 167 +++++++++++++++++++++++++++++++++
src/views/AgentList.js | 87 -----------------
src/views/GroupList.js | 2 +-
5 files changed, 228 insertions(+), 98 deletions(-)
create mode 100644 src/views/AgentGroupCount.js
delete mode 100644 src/views/AgentList.js
diff --git a/src/App.js b/src/App.js
index 207e392..18ea10f 100644
--- a/src/App.js
+++ b/src/App.js
@@ -13,7 +13,7 @@ import Customer_care_potential from "./charts/Customer_care_potential";
import Customer_care_regular from "./charts/Customer_care_regular";
import Wechat_session from "./charts/Wechat_session";
import WhatsApp_session from "./charts/WhatsApp_session";
-import AgentList from "./views/AgentList";
+import AgentGroupCount from "./views/AgentGroupCount";
import GroupList from "./views/GroupList";
import Credit_card_bill from "./views/Credit_card_bill";
import exchange_rate from "./charts/ExchangeRate";
@@ -71,7 +71,7 @@ const App = () => {
label: "客服",
icon: ,
children: [
- { key: 61, label: 地接社接团 },
+ { key: 61, label: 地接社接团 },
],
}
];
@@ -105,7 +105,7 @@ const App = () => {
} />
} />
} />
- } />
+ } />
} />
}>
diff --git a/src/stores/CustomerServices.js b/src/stores/CustomerServices.js
index ebaea7a..4e3a665 100644
--- a/src/stores/CustomerServices.js
+++ b/src/stores/CustomerServices.js
@@ -3,6 +3,7 @@ import moment from "moment";
import { NavLink } from "react-router-dom";
import * as config from "../config";
import * as req from '../utils/request';
+import { prepareUrl } from '../utils/commons';
class CustomerServices {
@@ -14,19 +15,47 @@ class CustomerServices {
this.endDateString = this.endDate.format(config.DATE_FORMAT) + '%2023:59';
this.dateType = 'startDate';
this.inProgress = false;
- this.selectedAgent = {VendorName: '请选择地接社'};
+ this.selectedAgent = '';
+ this.selectedTeam = '';
+ this.selectedCountry = '';
makeAutoObservable(this);
}
- fetchAgentList() {
+ fetchAllAgent() {
this.inProgress = true;
- req.fetchJSON(config.HT_HOST + '/service-web/QueryData/GetAgentGroupInfoALL?DateType=' + this.dateType + '&Date1=' + this.startDateString + '&Date2=' + this.endDateString + '&OldDate1=' + this.startDateString + '&OldDate2=' + this.endDateString)
+ req.fetchJSON(config.HT_HOST + '/service-web/QueryData/GetVEIName')
.then(json => {
if (json.errcode === 0) {
runInAction(() => {
this.agentList = json.result1;
+ });
+ }
+ })
+ .then(() => {
+ this.inProgress = false;
+ });
+ }
+
+ fetchAgentGroupList() {
+ this.inProgress = true;
+ const fetchUrl = prepareUrl(config.HT_HOST + '/service-web/QueryData/GetAgentGroupInfoALL')
+ .append('DateType', this.dateType)
+ .append('Date1', this.startDateString)
+ .append('Date2', this.endDateString)
+ .append('OldDate1', this.startDateString)
+ .append('OldDate2', this.endDateString)
+ .append('VEI_SN', this.selectedAgent)
+ .append('DepList', this.selectedTeam)
+ .append('Country', this.selectedCountry)
+ .build();
+ console.info('fetchUrl: ' + fetchUrl);
+ req.fetchJSON(fetchUrl)
+ .then(json => {
+ if (json.errcode === 0) {
+ runInAction(() => {
+ this.agentGroupList = json.result1;
const total1 = json.total1;
- this.agentListColumns = [
+ this.agentGroupListColumns = [
{
title: '地接社名称',
dataIndex: 'VendorName',
@@ -77,6 +106,16 @@ class CustomerServices {
}
]
},
+ {
+ title: '前勤分',
+ dataIndex: 'qianqin',
+ sorter: (a, b) => a.qianqin - b.qianqin,
+ children: [{
+ title: total1.qianqin,
+ dataIndex: 'qianqin'
+ }
+ ]
+ },
{
title: '好评数',
dataIndex: 'GoodCount',
@@ -249,7 +288,14 @@ class CustomerServices {
selectAgent(agent) {
this.selectedAgent = agent;
- this.fetchGroupListByAgent();
+ }
+
+ selectTeam(team) {
+ this.selectedTeam = team;
+ }
+
+ selectCountry(country) {
+ this.selectedCountry = country;
}
startDate;
@@ -258,13 +304,17 @@ class CustomerServices {
endDateString;
dateType;
selectedAgent;
+ selectedTeam;
+ selectedCountry;
inProgress;
+
+ agentList = [];
groupList = [];
groupListColumns = [];
- agentList = [{
+ agentGroupList = [{
EOI_ObjSN: 1,
VendorName: '---',
GroupCount: 0,
@@ -278,7 +328,7 @@ class CustomerServices {
key: 1
}];
- agentListColumns = [
+ agentGroupListColumns = [
{
title: '地接社名称',
dataIndex: 'VendorName',
diff --git a/src/views/AgentGroupCount.js b/src/views/AgentGroupCount.js
new file mode 100644
index 0000000..ccfb7e6
--- /dev/null
+++ b/src/views/AgentGroupCount.js
@@ -0,0 +1,167 @@
+import React, {useContext, useEffect} from 'react';
+import { Row, Col, Typography, Space, DatePicker, Button, Select, Table, Divider } from 'antd';
+import {
+ SearchOutlined,
+} from '@ant-design/icons';
+import { stores_Context } from '../config'
+import * as config from "../config";
+import { observer } from 'mobx-react';
+import 'moment/locale/zh-cn';
+import moment from "moment";
+import zhCNlocale from 'antd/es/date-picker/locale/zh_CN';
+import { utils, writeFileXLSX } from "xlsx";
+
+const AgentGroupCount = () => {
+
+ const {customerServicesStore} = useContext(stores_Context);
+ const agentList = customerServicesStore.agentList;
+ const agentGroupList = customerServicesStore.agentGroupList;
+ const agentGroupListColumns = customerServicesStore.agentGroupListColumns;
+ const {startDate, endDate, dateType, inProgress} = customerServicesStore;
+
+ useEffect(() => {
+ customerServicesStore.fetchAllAgent();
+ }, []);
+
+ const handleSearchClick = () => {
+ customerServicesStore.fetchAgentGroupList();
+ }
+
+ const renderAgentItem = (agent) => {
+ return (
+
+ {agent.VEI2_CompanyBN}
+
+ );
+ }
+
+ return (
+ <>
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ { customerServicesStore.selectDateRange(dates[0], dates[1]) }}
+ ranges={{
+ '本周': [moment().startOf('week'), moment().endOf('week')],
+ '上周': [moment().startOf('week').subtract(7, 'days'), moment().endOf('week').subtract(7, 'days')],
+ '本月': [moment().startOf('month'), moment().endOf('month')],
+ '上个月': [moment().subtract(1, 'months').startOf('month'), moment(new Date()).subtract(1, 'months').endOf('month')],
+ '近30天': [moment().subtract(30, 'days'), moment()],
+ '近三个月': [moment().subtract(2, 'month').startOf('month'), moment().endOf('month')],
+ '今年': [moment().startOf('year').subtract(1, 'month'), moment().endOf('year').subtract(1, 'month')],
+ '去年': [moment().subtract(1, 'year').startOf('year').subtract(1, 'month'), moment().subtract(1, 'year').endOf('year').subtract(1, 'month')],
+ }}
+ />
+
+
+ }
+ loading={inProgress}
+ onClick={() => {
+ handleSearchClick();
+ }}>
+ 统计
+
+
+
+
+
+ 地接社团信息
+ record.key}
+ loading={inProgress}
+ pagination={false}
+ scroll={{ x: "100%" }}
+ />
+
+ {
+ const wb = utils.table_to_book(document.getElementById("agentGroupList").getElementsByTagName("table")[0]);
+ writeFileXLSX(wb, "地接社团信息.xlsx");
+ }}>
+ 导出excel
+
+
+
+
+
+ >
+ );
+}
+
+export default observer(AgentGroupCount);
\ No newline at end of file
diff --git a/src/views/AgentList.js b/src/views/AgentList.js
deleted file mode 100644
index 70d26da..0000000
--- a/src/views/AgentList.js
+++ /dev/null
@@ -1,87 +0,0 @@
-import React, {useContext} from 'react';
-import { Row, Col, Typography, Space, DatePicker, Button, Select, Table } from 'antd';
-import {
- SearchOutlined,
-} from '@ant-design/icons';
-import { stores_Context } from '../config'
-import * as config from "../config";
-import { observer } from 'mobx-react';
-import 'moment/locale/zh-cn';
-import moment from "moment";
-import zhCNlocale from 'antd/es/date-picker/locale/zh_CN';
-
-const AgentList = () => {
-
- const {customerServicesStore} = useContext(stores_Context);
- const agentList = customerServicesStore.agentList;
- const agentListColumns = customerServicesStore.agentListColumns;
- const {startDate, endDate, dateType, inProgress} = customerServicesStore;
-
- const handleSearchClick = () => {
- customerServicesStore.fetchAgentList();
- }
-
- return (
- <>
-
-
-
-
-
-
- { customerServicesStore.selectDateRange(dates[0], dates[1]) }}
- ranges={{
- '本周': [moment().startOf('week'), moment().endOf('week')],
- '上周': [moment().startOf('week').subtract(7, 'days'), moment().endOf('week').subtract(7, 'days')],
- '本月': [moment().startOf('month'), moment().endOf('month')],
- '上个月': [moment().subtract(1, 'months').startOf('month'), moment(new Date()).subtract(1, 'months').endOf('month')],
- '近30天': [moment().subtract(30, 'days'), moment()],
- '近三个月': [moment().subtract(2, 'month').startOf('month'), moment().endOf('month')],
- '今年': [moment().startOf('year').subtract(1, 'month'), moment().endOf('year').subtract(1, 'month')],
- '去年': [moment().subtract(1, 'year').startOf('year').subtract(1, 'month'), moment().subtract(1, 'year').endOf('year').subtract(1, 'month')],
- }}
- />
-
-
- }
- loading={inProgress}
- onClick={() => {
- handleSearchClick();
- }}>
- 统计
-
-
-
-
-
- 地接社团信息
- record.key}
- loading={inProgress}
- pagination={false}
- scroll={{ x: "100%" }}
- />
-
-
-
- >
- );
-}
-
-export default observer(AgentList);
\ No newline at end of file
diff --git a/src/views/GroupList.js b/src/views/GroupList.js
index beaf307..99e795d 100644
--- a/src/views/GroupList.js
+++ b/src/views/GroupList.js
@@ -29,7 +29,7 @@ const GroupList = () => {
- 返回
+ 返回