From 12e402e5f9df4d48153ae99a120fb3dc0e33b771 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Fri, 7 Jul 2023 10:17:08 +0800 Subject: [PATCH] =?UTF-8?q?=E9=A6=96=E9=A1=B5=20=E7=BB=9F=E8=AE=A1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/charts.js | 20 ++ src/utils/auth.js | 29 +- src/views/dashboard/components/LineChart.vue | 143 +++++++++ src/views/dashboard/components/PanelGroup.vue | 119 ++----- src/views/dashboard/index.vue | 301 +++++++++--------- src/views/reports/components/echartsLine.vue | 25 +- src/views/reports/outbounds.vue | 201 ++++++++++-- src/views/reports/stocks.vue | 201 ++++++++++-- 8 files changed, 717 insertions(+), 322 deletions(-) create mode 100644 src/api/charts.js create mode 100644 src/views/dashboard/components/LineChart.vue diff --git a/src/api/charts.js b/src/api/charts.js new file mode 100644 index 0000000..8543069 --- /dev/null +++ b/src/api/charts.js @@ -0,0 +1,20 @@ +import request from '@/utils/request' + +export function stocksCharts(params) { + return request({ + url: '/api/admin/chart/stocks', + method: 'get', + params:params + }) +} + +export function outboundsCharts(params) { + return request({ + url: '/api/admin/chart/outbounds', + method: 'get', + params:params + }) +} + + + diff --git a/src/utils/auth.js b/src/utils/auth.js index e1a5cea..b47e5c1 100644 --- a/src/utils/auth.js +++ b/src/utils/auth.js @@ -2,14 +2,23 @@ import Cookies from 'js-cookie' const TokenKey = 'patrol_wzgl_token' -export function getToken() { - return Cookies.get(TokenKey) -} - -export function setToken(token) { - return Cookies.set(TokenKey, token) -} - -export function removeToken() { - return Cookies.remove(TokenKey) +export function getToken() { + //return Cookies.get(TokenKey) + + if (Cookies.get(TokenKey)) { + return Cookies.get(TokenKey) + } else { + return sessionStorage.getItem(TokenKey); + } +} + +export function setToken(token) { + sessionStorage.setItem(TokenKey, token); + return Cookies.set(TokenKey, token) +} + +export function removeToken() { + sessionStorage.clear(); + return Cookies.remove(TokenKey) + } diff --git a/src/views/dashboard/components/LineChart.vue b/src/views/dashboard/components/LineChart.vue new file mode 100644 index 0000000..73ffc34 --- /dev/null +++ b/src/views/dashboard/components/LineChart.vue @@ -0,0 +1,143 @@ + + + diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue index ffc9509..0635b5c 100644 --- a/src/views/dashboard/components/PanelGroup.vue +++ b/src/views/dashboard/components/PanelGroup.vue @@ -3,105 +3,43 @@
- 营业统计 + 当日出入库
-
服务金额
-
- {{totaldata.business.server_money_total}} -
- {{totaldata.business.nurse_money_total}} - 护工金额 + {{totaldata.day.ruku}} + 入库
- {{totaldata.business.remain_money_total}} - 留存金额 + {{totaldata.day.chuku}} + 出库
-
- -
-
- - 人效统计 - -
-
-
总服务时长
-
-
-
- {{totaldata.person_efficiency.server_time_total}} - 分钟 -
-
-
- - {{totaldata.person_efficiency.expect}} - 照护人员数 -
-
- {{totaldata.person_efficiency.act}} - 天数 -
-
-
-
-
- -
-
- 客户统计 - -
-
-
活跃客户
-
-
-
- {{totaldata.customer.active}}人 -
-
-
- {{totaldata.customer.add}} - 新增 -
-
- {{totaldata.customer.wash}} - 流失 -
-
-
-
-
+
- 订单统计 + 当月出入库
-
服务订单
-
{{totaldata.order.server_total}}单 -
- {{totaldata.order.cycle_total}} - 周期性订单 + {{totaldata.month.ruku}} + 入库
- {{totaldata.order.unit_total}} - 单次订单 + {{totaldata.month.chuku}} + 出库
@@ -122,27 +60,14 @@ totaldata: { type: Object, default: { - - "business": { - "server_money_total": 0, - "nurse_money_total": 0, - "remain_money_total": 0 - }, - "person_efficiency": { - "server_time_total": "0", - "expect": 0, - "act": 0 - }, - "customer": { - "active": 0, - "add": 0, - "wash": 0 - }, - "order": { - "server_total": 0, - "cycle_total": 0, - "unit_total": 0 + "day": { + "ruku": 0, + "chuku": 0 }, + "month": { + "ruku": 0, + "chuku": 0 + } } } }, @@ -185,7 +110,7 @@ .boxcontentitem-small { - font-size: 16px; + font-size: 30px; display: flex; flex-direction: column; } @@ -193,9 +118,9 @@ .box { position: relative; - width: 33%; - margin-left: 0.5%; - margin-right: 0.5%; + width: 48%; + margin-left: 1%; + margin-right: 1%; margin-bottom: 2.375rem; box-shadow: 0px 8px 15px 0px rgba(212, 84, 32, 0.3100); border-radius: 8px; diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index 3e3f399..9694708 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -4,180 +4,185 @@
+
+ + +
+
+ 出入库统计 + + +
+ +
+
+
+
diff --git a/src/views/reports/stocks.vue b/src/views/reports/stocks.vue index c3d71a8..834634b 100644 --- a/src/views/reports/stocks.vue +++ b/src/views/reports/stocks.vue @@ -4,43 +4,184 @@
-
-
- +
+
+
+ + +
+ +
- -