diff --git a/src/api/dashboard.js b/src/api/dashboard.js index c855dd0..498cdf7 100644 --- a/src/api/dashboard.js +++ b/src/api/dashboard.js @@ -1,26 +1,18 @@ import request from '@/utils/request' -export function getCounts() { - return request({ - url: '/api/admin/get-counts', - method: 'get' - }) -} - -export function getChartsData(params) { +export function getChartsHome(params) { return request({ - url: '/api/admin/get-charts-data', + url: '/api/admin/chart/index', method: 'get', params: params }) } -export function getChartsHome(params) { +export function getChartDown (params) { return request({ - url: '/api/admin/chart/home', + url: '/api/admin/chart/down', method: 'get', params: params }) } - diff --git a/src/utils/index.js b/src/utils/index.js index 32825fb..27b37ea 100644 --- a/src/utils/index.js +++ b/src/utils/index.js @@ -171,3 +171,42 @@ export function debounce(func, delay) { } } +export function getAgeByIdcard(identityCard){ + let len = (identityCard + "").length; + if (len == 0) { + return 0; + } else { + if ((len != 15) && (len != 18))//身份证号码只能为15位或18位其它不合法 + { + return 0; + } + } + let strBirthday = ""; + if (len == 18)//处理18位的身份证号码从号码中得到生日和性别代码 + { + strBirthday = identityCard.substr(6, 4) + "/" + identityCard.substr(10, 2) + "/" + identityCard.substr(12, 2); + } + if (len == 15) { + strBirthday = "19" + identityCard.substr(6, 2) + "/" + identityCard.substr(8, 2) + "/" + identityCard.substr(10, 2); + } + //时间字符串里,必须是“/” + let birthDate = new Date(strBirthday); + let nowDateTime = new Date(); + let age = nowDateTime.getFullYear() - birthDate.getFullYear(); + //再考虑月、天的因素;.getMonth()获取的是从0开始的,这里进行比较,不需要加1 + if (nowDateTime.getMonth() < birthDate.getMonth() || (nowDateTime.getMonth() == birthDate.getMonth() && nowDateTime.getDate() < birthDate.getDate())) { + age--; + } + return age; +} + +export function getSex(idCard) { + let sexStr; + if (parseInt(idCard.slice(-2, -1)) % 2 == 1) { + sexStr = '男'; + } + else { + sexStr = '女'; + } + return sexStr; +} diff --git a/src/views/dashboard/components/PanelGroup.vue b/src/views/dashboard/components/PanelGroup.vue index ea1f809..46342fa 100644 --- a/src/views/dashboard/components/PanelGroup.vue +++ b/src/views/dashboard/components/PanelGroup.vue @@ -3,24 +3,18 @@
- 营业统计 + 在档人数
-
服务金额
+
-
- {{totaldata.business.server_money_total}} -
- {{totaldata.business.nurse_money_total}} - 护工金额 -
-
- {{totaldata.business.remain_money_total}} - 留存金额 + + {{ data.total }} 人 + 在档总人数
@@ -29,27 +23,22 @@
- - 人效统计 + 困难人数
-
总服务时长
+
-
- {{totaldata.person_efficiency.server_time_total}} - 分钟 -
- {{totaldata.person_efficiency.expect}} - 照护人员数 + {{ data.kunnanleixing_1 }} 人 + 特别困难
- {{totaldata.person_efficiency.act}} - 天数 + {{ data.kunnanleixing_2 }} 人 + 深度困难
@@ -58,50 +47,22 @@
- 客户统计 - + 困难人数 +
-
活跃客户
+
-
- {{totaldata.customer.active}}人 -
- {{totaldata.customer.add}} - 新增 -
-
- {{totaldata.customer.wash}} - 流失 -
-
-
-
-
- -
-
- 订单统计 - -
-
-
服务订单
-
-
-
{{totaldata.order.server_total}}单 -
-
-
- {{totaldata.order.cycle_total}} - 周期性订单 + {{ data.kunnanleixing_3 }} 人 + 相对困难
- {{totaldata.order.unit_total}} - 单次订单 + {{ data.kunnanleixing_4 }} 人 + 意外至困
@@ -116,35 +77,9 @@ export default { props: { - countsData: { + data: { type: Object }, - 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 - }, - } - } }, components: { CountTo diff --git a/src/views/dashboard/index.vue b/src/views/dashboard/index.vue index 3e3f399..e1263de 100644 --- a/src/views/dashboard/index.vue +++ b/src/views/dashboard/index.vue @@ -1,212 +1,216 @@ diff --git a/src/views/h5/index.vue b/src/views/h5/index.vue index a47e16d..0702e89 100644 --- a/src/views/h5/index.vue +++ b/src/views/h5/index.vue @@ -1,56 +1,97 @@