Compare commits
37 Commits
prod-26-01
...
3438a7f9b3
| Author | SHA1 | Date | |
|---|---|---|---|
| 3438a7f9b3 | |||
| edbc60d3f3 | |||
| 914249cc3a | |||
| 1217b7671c | |||
| bd3e358ec7 | |||
| 9788542b38 | |||
| 65a53ab267 | |||
| 0f70e55e66 | |||
| e800ee1b7e | |||
| 3fbcc7a125 | |||
| c90bf52b4d | |||
| c9ac87b104 | |||
| 47fdf8f528 | |||
| 9192625165 | |||
| 5ebbce5c1f | |||
| dc5327c8e4 | |||
| 044832a8f7 | |||
| 19c5809af2 | |||
| d41684d7ed | |||
| 60445b1523 | |||
| 534ef90f2e | |||
| f8484391b8 | |||
| 414f2cd320 | |||
| d12ef20726 | |||
| ed7ce35a91 | |||
| 6b5bc0494c | |||
| fed4ae6edf | |||
| 87546848d2 | |||
| 3a6d0878aa | |||
| d18fec1ddc | |||
| 62f2c166c6 | |||
| 14a14e2c87 | |||
| 8a457952fa | |||
| c657f3b5ac | |||
| 31d1388890 | |||
| dc94c6d261 | |||
| 97c86dbee3 |
160
public/res/year-statistic/README.md
Normal file
160
public/res/year-statistic/README.md
Normal file
@@ -0,0 +1,160 @@
|
|||||||
|
# 年终总结看板 Dashboard
|
||||||
|
|
||||||
|
道路救援服务年终数据可视化看板项目。
|
||||||
|
|
||||||
|
## 项目结构
|
||||||
|
|
||||||
|
```
|
||||||
|
dashboard-demo/
|
||||||
|
├── index.html # 主看板页面(支持URL参数动态加载数据)
|
||||||
|
├── data/
|
||||||
|
│ ├── 供应商年度KPI.xlsx # 服务商KPI数据(主数据源)
|
||||||
|
│ ├── 师傅案件top3.xlsx # 案件量TOP3师傅数据
|
||||||
|
│ ├── 师傅在线top3.xlsx # 在线时长TOP3师傅数据
|
||||||
|
│ ├── 拒单率最高地区.xlsx # 拒单率最高地区数据
|
||||||
|
│ └── 拒单率最高时段.xlsx # 拒单率最高时段数据
|
||||||
|
└── README.md # 项目说明
|
||||||
|
```
|
||||||
|
|
||||||
|
## 功能特性
|
||||||
|
|
||||||
|
- 深色主题数据可视化看板
|
||||||
|
- **直接读取Excel文件**,无需转换为JSON
|
||||||
|
- 支持通过URL参数 `?providerId=XXX` 切换不同服务商
|
||||||
|
- 右上角下拉框可实时切换服务商(自动从Excel读取服务商列表)
|
||||||
|
- 使用 Chart.js 实现饼状图和雷达图
|
||||||
|
- 使用 SheetJS (xlsx) 解析Excel文件
|
||||||
|
- 响应式布局,支持不同屏幕尺寸
|
||||||
|
- 数据与页面分离,便于维护
|
||||||
|
|
||||||
|
## 数据指标
|
||||||
|
|
||||||
|
看板展示以下数据指标:
|
||||||
|
|
||||||
|
1. **总案件量分布**(饼状图)
|
||||||
|
- 小修、困境、拖车三类案件占比
|
||||||
|
|
||||||
|
2. **年度聚合案件量**
|
||||||
|
|
||||||
|
3. **案件量TOP3师傅**
|
||||||
|
|
||||||
|
4. **车辆平均总在线时长**
|
||||||
|
|
||||||
|
5. **在线时长TOP3师傅**
|
||||||
|
|
||||||
|
6. **拒单率最高地区**
|
||||||
|
|
||||||
|
7. **拒单率最高时段**
|
||||||
|
|
||||||
|
8. **APP使用率**
|
||||||
|
- 年度APP使用率展示
|
||||||
|
|
||||||
|
## Excel数据结构
|
||||||
|
|
||||||
|
### 1. 供应商年度KPI.xlsx
|
||||||
|
|
||||||
|
| 列名 | 说明 |
|
||||||
|
|------|------|
|
||||||
|
| 服务商id | 服务商唯一标识 |
|
||||||
|
| 服务商 | 服务商名称 |
|
||||||
|
| 完成案件量 | 总案件数量 |
|
||||||
|
| 拖车完成量 | 拖车案件数 |
|
||||||
|
| 小修完成量 | 小修案件数 |
|
||||||
|
| 困境完成量 | 困境案件数 |
|
||||||
|
| 聚合案件量 | 聚合案件数量 |
|
||||||
|
| APP使用率. | APP使用率(小数形式,如0.998) |
|
||||||
|
| 年度车辆平均总在线时长(小时) | 车辆平均在线时长 |
|
||||||
|
|
||||||
|
### 2. 师傅案件top3.xlsx
|
||||||
|
|
||||||
|
| 列名 | 说明 |
|
||||||
|
|------|------|
|
||||||
|
| 服务商id | 服务商唯一标识 |
|
||||||
|
| 服务商 | 服务商名称 |
|
||||||
|
| 服务人员工号 | 师傅姓名/工号 |
|
||||||
|
| 完成案件量 | 该师傅完成的案件数 |
|
||||||
|
|
||||||
|
### 3. 师傅在线top3.xlsx
|
||||||
|
|
||||||
|
| 列名 | 说明 |
|
||||||
|
|------|------|
|
||||||
|
| 服务商名称 | 服务商名称 |
|
||||||
|
| 司机姓名 | 师傅姓名 |
|
||||||
|
| 年度总在线时长(小时) | 在线时长 |
|
||||||
|
|
||||||
|
### 4. 拒单率最高地区.xlsx
|
||||||
|
|
||||||
|
| 列名 | 说明 |
|
||||||
|
|------|------|
|
||||||
|
| 供应商名称 | 服务商名称 |
|
||||||
|
| 地区 | 拒单率最高的地区 |
|
||||||
|
| 拒单率 | 拒单率(小数形式) |
|
||||||
|
|
||||||
|
### 5. 拒单率最高时段.xlsx
|
||||||
|
|
||||||
|
| 列名 | 说明 |
|
||||||
|
|------|------|
|
||||||
|
| 供应商名称 | 服务商名称 |
|
||||||
|
| 时段 | 拒单率最高的时段 |
|
||||||
|
| 拒单率 | 拒单率(小数形式) |
|
||||||
|
|
||||||
|
## 使用方式
|
||||||
|
|
||||||
|
### 1. 启动本地服务器
|
||||||
|
|
||||||
|
由于页面使用 `fetch` 加载JSON数据,需要通过HTTP服务器访问:
|
||||||
|
|
||||||
|
```bash
|
||||||
|
cd C:\Users\Administrator\dashboard-demo
|
||||||
|
|
||||||
|
# 使用 Python
|
||||||
|
python -m http.server 8080
|
||||||
|
|
||||||
|
# 或使用 Node.js
|
||||||
|
npx serve .
|
||||||
|
|
||||||
|
# 或使用 PHP
|
||||||
|
php -S localhost:8080
|
||||||
|
```
|
||||||
|
|
||||||
|
### 2. 访问页面
|
||||||
|
|
||||||
|
- 默认服务商:`http://localhost:8080`(自动加载第一个服务商)
|
||||||
|
- 指定服务商:`http://localhost:8080?providerId=1128`(使用服务商id)
|
||||||
|
- 切换服务商:使用页面右上角的下拉框
|
||||||
|
|
||||||
|
### 3. 更新数据
|
||||||
|
|
||||||
|
直接替换 `data/` 目录下的Excel文件即可,页面会自动读取最新数据。
|
||||||
|
服务商列表从Excel自动生成,无需手动配置。
|
||||||
|
|
||||||
|
## 技术栈
|
||||||
|
|
||||||
|
- HTML5 / CSS3
|
||||||
|
- JavaScript (ES6+)
|
||||||
|
- Chart.js - 图表库(饼图、雷达图)
|
||||||
|
- SheetJS (xlsx) - Excel文件解析
|
||||||
|
- CSS Grid / Flexbox - 布局
|
||||||
|
|
||||||
|
## 后续优化方向
|
||||||
|
|
||||||
|
- [ ] 添加更多图表类型(柱状图、折线图等)
|
||||||
|
- [ ] 支持时间范围筛选
|
||||||
|
- [ ] 添加数据导出功能
|
||||||
|
- [ ] 移动端适配优化
|
||||||
|
- [ ] 添加数据加载骨架屏
|
||||||
|
- [ ] 支持主题切换(深色/浅色)
|
||||||
|
|
||||||
|
## 更新日志
|
||||||
|
|
||||||
|
### 2025-01-21
|
||||||
|
- 改为直接读取Excel文件,无需JSON转换
|
||||||
|
- 服务商列表从Excel自动生成
|
||||||
|
- 将"AB段里程对比"改为"APP使用率"展示
|
||||||
|
- 新增服务商选择下拉框
|
||||||
|
|
||||||
|
### 2025-01-20
|
||||||
|
- 初始版本
|
||||||
|
- 实现基础看板布局
|
||||||
|
- 支持URL参数切换服务商
|
||||||
|
- 数据JSON化,与页面分离
|
||||||
47
public/res/year-statistic/data/SP001.json
Normal file
47
public/res/year-statistic/data/SP001.json
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
{
|
||||||
|
"serviceProviderId": "SP001",
|
||||||
|
"serviceProviderName": "上海道路救援服务中心",
|
||||||
|
"year": 2025,
|
||||||
|
"summary": {
|
||||||
|
"totalCases": 100,
|
||||||
|
"caseBreakdown": {
|
||||||
|
"minorRepair": 20,
|
||||||
|
"predicament": 20,
|
||||||
|
"towing": 60
|
||||||
|
},
|
||||||
|
"aggregatedCases": 15
|
||||||
|
},
|
||||||
|
"topMastersByCases": [
|
||||||
|
{ "rank": 1, "name": "小王", "cases": 18 },
|
||||||
|
{ "rank": 2, "name": "小张", "cases": 16 },
|
||||||
|
{ "rank": 3, "name": "小李", "cases": 12 }
|
||||||
|
],
|
||||||
|
"onlineHours": {
|
||||||
|
"averageTotal": 2920,
|
||||||
|
"topMasters": [
|
||||||
|
{ "rank": 1, "name": "小王", "hours": 3230 },
|
||||||
|
{ "rank": 2, "name": "小张", "hours": 3028 },
|
||||||
|
{ "rank": 3, "name": "小李", "hours": 2996 }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"rejectionRate": {
|
||||||
|
"highestRegion": {
|
||||||
|
"name": "崇明",
|
||||||
|
"rate": 21.2
|
||||||
|
},
|
||||||
|
"highestTimeSlot": {
|
||||||
|
"period": "18:00-22:00",
|
||||||
|
"description": "晚高峰时段"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"abMileage": {
|
||||||
|
"highest": {
|
||||||
|
"region": "崇明",
|
||||||
|
"distance": 62
|
||||||
|
},
|
||||||
|
"lowest": {
|
||||||
|
"region": "黄浦",
|
||||||
|
"distance": 6
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
47
public/res/year-statistic/data/SP002.json
Normal file
47
public/res/year-statistic/data/SP002.json
Normal file
@@ -0,0 +1,47 @@
|
|||||||
|
{
|
||||||
|
"serviceProviderId": "SP002",
|
||||||
|
"serviceProviderName": "浦东汽车救援有限公司",
|
||||||
|
"year": 2025,
|
||||||
|
"summary": {
|
||||||
|
"totalCases": 156,
|
||||||
|
"caseBreakdown": {
|
||||||
|
"minorRepair": 35,
|
||||||
|
"predicament": 41,
|
||||||
|
"towing": 80
|
||||||
|
},
|
||||||
|
"aggregatedCases": 22
|
||||||
|
},
|
||||||
|
"topMastersByCases": [
|
||||||
|
{ "rank": 1, "name": "老陈", "cases": 28 },
|
||||||
|
{ "rank": 2, "name": "大刘", "cases": 24 },
|
||||||
|
{ "rank": 3, "name": "阿强", "cases": 19 }
|
||||||
|
],
|
||||||
|
"onlineHours": {
|
||||||
|
"averageTotal": 3150,
|
||||||
|
"topMasters": [
|
||||||
|
{ "rank": 1, "name": "老陈", "hours": 3580 },
|
||||||
|
{ "rank": 2, "name": "大刘", "hours": 3420 },
|
||||||
|
{ "rank": 3, "name": "阿强", "hours": 3210 }
|
||||||
|
]
|
||||||
|
},
|
||||||
|
"rejectionRate": {
|
||||||
|
"highestRegion": {
|
||||||
|
"name": "奉贤",
|
||||||
|
"rate": 18.5
|
||||||
|
},
|
||||||
|
"highestTimeSlot": {
|
||||||
|
"period": "07:00-09:00",
|
||||||
|
"description": "早高峰时段"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"abMileage": {
|
||||||
|
"highest": {
|
||||||
|
"region": "金山",
|
||||||
|
"distance": 55
|
||||||
|
},
|
||||||
|
"lowest": {
|
||||||
|
"region": "静安",
|
||||||
|
"distance": 8
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
44612
public/res/year-statistic/data/cases_top3.json
Normal file
44612
public/res/year-statistic/data/cases_top3.json
Normal file
File diff suppressed because it is too large
Load Diff
29016
public/res/year-statistic/data/kpi.json
Normal file
29016
public/res/year-statistic/data/kpi.json
Normal file
File diff suppressed because it is too large
Load Diff
21112
public/res/year-statistic/data/online_top3.json
Normal file
21112
public/res/year-statistic/data/online_top3.json
Normal file
File diff suppressed because it is too large
Load Diff
17205
public/res/year-statistic/data/rejection_region.json
Normal file
17205
public/res/year-statistic/data/rejection_region.json
Normal file
File diff suppressed because it is too large
Load Diff
18286
public/res/year-statistic/data/rejection_time.json
Normal file
18286
public/res/year-statistic/data/rejection_time.json
Normal file
File diff suppressed because it is too large
Load Diff
BIN
public/res/year-statistic/data/供应商年度KPI.xlsx
Normal file
BIN
public/res/year-statistic/data/供应商年度KPI.xlsx
Normal file
Binary file not shown.
BIN
public/res/year-statistic/data/师傅在线top3.xlsx
Normal file
BIN
public/res/year-statistic/data/师傅在线top3.xlsx
Normal file
Binary file not shown.
BIN
public/res/year-statistic/data/师傅案件top3.xlsx
Normal file
BIN
public/res/year-statistic/data/师傅案件top3.xlsx
Normal file
Binary file not shown.
BIN
public/res/year-statistic/data/拒单率最高地区.xlsx
Normal file
BIN
public/res/year-statistic/data/拒单率最高地区.xlsx
Normal file
Binary file not shown.
BIN
public/res/year-statistic/data/拒单率最高时段.xlsx
Normal file
BIN
public/res/year-statistic/data/拒单率最高时段.xlsx
Normal file
Binary file not shown.
1553
public/res/year-statistic/index.html
Normal file
1553
public/res/year-statistic/index.html
Normal file
File diff suppressed because it is too large
Load Diff
@@ -77,6 +77,15 @@ export function updateOrderSettlement(data){
|
|||||||
data
|
data
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// 获取司机信息
|
||||||
|
export function getDriverInfo(data){
|
||||||
|
return request({
|
||||||
|
url:'/supplierAppV2/dispatchApp/order/getDriverInfo',
|
||||||
|
method:'POST',
|
||||||
|
contentType:'application/json',
|
||||||
|
data
|
||||||
|
})
|
||||||
|
}
|
||||||
// 电瓶数量列表
|
// 电瓶数量列表
|
||||||
export function batteryCountList(){
|
export function batteryCountList(){
|
||||||
return request({
|
return request({
|
||||||
|
|||||||
@@ -264,6 +264,10 @@
|
|||||||
this.$toast('营业执照未上传')
|
this.$toast('营业执照未上传')
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
if( !this.licensePhoto ) {
|
||||||
|
this.$toast('开户许可证未上传')
|
||||||
|
return
|
||||||
|
}
|
||||||
if( !(this.form.serviceAreaCode.length > 0) ) {
|
if( !(this.form.serviceAreaCode.length > 0) ) {
|
||||||
this.$toast('服务区域不能为空')
|
this.$toast('服务区域不能为空')
|
||||||
return
|
return
|
||||||
|
|||||||
@@ -74,6 +74,7 @@
|
|||||||
<div class="item">
|
<div class="item">
|
||||||
<span class="leftTitle fontColor">服务师傅:</span><span class="rightContent">{{ orderDetailInfo.driverName }} {{orderDetailInfo.drivePhone ? '/' : ''}} {{orderDetailInfo.drivePhone }}
|
<span class="leftTitle fontColor">服务师傅:</span><span class="rightContent">{{ orderDetailInfo.driverName }} {{orderDetailInfo.drivePhone ? '/' : ''}} {{orderDetailInfo.drivePhone }}
|
||||||
<span v-if="queryType == 5" class="driverPoiBtn" @click="noMultipleClicks(showMap)">查看司机位置</span>
|
<span v-if="queryType == 5" class="driverPoiBtn" @click="noMultipleClicks(showMap)">查看司机位置</span>
|
||||||
|
<span v-if="orderDetailInfo.driverName && orderDetailInfo.proprietary?.code==1" class="driverPoiBtn" @click="noMultipleClicks(createDriverInfo)">生成司机信息</span>
|
||||||
</span>
|
</span>
|
||||||
</div>
|
</div>
|
||||||
<div class="item" v-if="queryType == 9 || queryType ==11 || queryType ==12">
|
<div class="item" v-if="queryType == 9 || queryType ==11 || queryType ==12">
|
||||||
@@ -114,7 +115,7 @@
|
|||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
import {myMixins} from '@/utils/myMixins'
|
import {myMixins} from '@/utils/myMixins'
|
||||||
import {getOrderDetail,showVehiclePositionInfo, getConfigByCode} from "@/api/order"
|
import {getOrderDetail,showVehiclePositionInfo, getConfigByCode,getDriverInfo} from "@/api/order"
|
||||||
import minePosition from '@/assets/minePosition.png';
|
import minePosition from '@/assets/minePosition.png';
|
||||||
import vehiclePosition from '@/assets/vehiclePosition.png';
|
import vehiclePosition from '@/assets/vehiclePosition.png';
|
||||||
import desitationPosition from '@/assets/desitationPosition.png'
|
import desitationPosition from '@/assets/desitationPosition.png'
|
||||||
@@ -161,6 +162,30 @@ export default {
|
|||||||
});
|
});
|
||||||
this.carTypeList = res?.data?.userVehicleType
|
this.carTypeList = res?.data?.userVehicleType
|
||||||
},
|
},
|
||||||
|
async getDriverInfo(){
|
||||||
|
let result=await getDriverInfo({
|
||||||
|
driverId:this.orderDetailInfo.driverId
|
||||||
|
})
|
||||||
|
if(result.data){
|
||||||
|
// console.log('--result--',result.data)
|
||||||
|
let params={
|
||||||
|
'姓名:':this.orderDetailInfo.driverName,
|
||||||
|
'身份证:':result.data.identityCardNumber,
|
||||||
|
'车牌:':this.orderDetailInfo.plateNumber,
|
||||||
|
'手机:':this.orderDetailInfo.driverPhone,
|
||||||
|
}
|
||||||
|
let data = {"action":"copyToClipboard","params":JSON.stringify(params)}
|
||||||
|
var u = navigator.userAgent;
|
||||||
|
var isiOS = !!u.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/);
|
||||||
|
if(isiOS){
|
||||||
|
window.webkit.messageHandlers.nativeObject.postMessage(data);
|
||||||
|
}else {
|
||||||
|
window.android.copyToClipboard(JSON.stringify(params));
|
||||||
|
}
|
||||||
|
}else {
|
||||||
|
this.$toast('未获取到司机信息')
|
||||||
|
}
|
||||||
|
},
|
||||||
async getDetail(){
|
async getDetail(){
|
||||||
let result=await getOrderDetail({
|
let result=await getOrderDetail({
|
||||||
queryType:this.queryType,
|
queryType:this.queryType,
|
||||||
@@ -176,6 +201,9 @@ export default {
|
|||||||
this.showPopup = true;
|
this.showPopup = true;
|
||||||
this.mapMarkers();
|
this.mapMarkers();
|
||||||
},
|
},
|
||||||
|
async createDriverInfo(){//生成司机信息
|
||||||
|
await this.getDriverInfo()
|
||||||
|
},
|
||||||
checkPhoto(){
|
checkPhoto(){
|
||||||
let isAllowImage = this.queryType == 9 ? 0 : 1
|
let isAllowImage = this.queryType == 9 ? 0 : 1
|
||||||
let data = {
|
let data = {
|
||||||
|
|||||||
Reference in New Issue
Block a user