diff --git a/package-lock.json b/package-lock.json index 3b3629a1..5c37c8c3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -15,7 +15,7 @@ "dayjs": "^1.8.14", "decimal.js": "^10.4.3", "echarts": "^5.2.2", - "element-ui": "^2.15.9", + "element-ui": "^2.15.13", "less": "^4.1.3", "less-loader": "^11.1.3", "qrcode": "^1.5.4", diff --git a/package.json b/package.json index 891d8c7f..c526540e 100644 --- a/package.json +++ b/package.json @@ -16,7 +16,7 @@ "dayjs": "^1.8.14", "decimal.js": "^10.4.3", "echarts": "^5.2.2", - "element-ui": "^2.15.9", + "element-ui": "^2.15.13", "less": "^4.1.3", "less-loader": "^11.1.3", "qrcode": "^1.5.4", diff --git a/src/api/kpi.js b/src/api/kpi.js index 6165bc29..7fb4ed8e 100644 --- a/src/api/kpi.js +++ b/src/api/kpi.js @@ -81,4 +81,31 @@ export function getDriverName(key) { key: key , } }); -} \ No newline at end of file +} + +// 车辆 总览 +export function vehicleTotalInfo(data) { + return request({ + url: '/supplier/supplierKPI/querySupplierVehicleStatisticsKpi', + method: 'POST', + data + }); +} + +// 服务商维度查询车辆 +export function vehicleInfoBySupplier(data) { + return request({ + url: '/supplier/supplierKPI/querySupplierStatisticsKpiBySupplier', + method: 'POST', + data + }); +} + +// 车辆维度查询车辆 +export function vehicleInfoByVehicle(data) { + return request({ + url: '/supplier/supplierKPI/querySupplierVehicleKpi', + method: 'POST', + data + }); +} diff --git a/src/router/kpi-router.js b/src/router/kpi-router.js index f0663a45..67065d11 100644 --- a/src/router/kpi-router.js +++ b/src/router/kpi-router.js @@ -7,5 +7,13 @@ const kpiRouter = [ title: 'kpi首页', } }, + { + path: '/kpiCaseNew', + name: 'kpiCaseNew', + component: () => import('@/views/kpi/kpiCaseNew'), + meta:{ + title: 'kpi服务商案件&车辆情况', + } + }, ] export default kpiRouter diff --git a/src/utils/kpiMixins.js b/src/utils/kpiMixins.js new file mode 100644 index 00000000..ca97ae11 --- /dev/null +++ b/src/utils/kpiMixins.js @@ -0,0 +1,102 @@ +import dayjs from "dayjs"; + +export const kpiMixins = { + data() { + return { + isMobile: false, + isZd: '', + current:'2024-10', + supplierId:'', + supplierName:'', + startMonthTime: '', + startTime: '', + endTime: '', + } + }, + methods: { + applicateHandle() { + if (window.parent) { + const hasListener = window.parent.dispatchEvent(new Event('checkCloseDialog')); + if (hasListener) { + const data = { + action: 'closeDialog', + message: this.supplierId, + // 其他需要传递的参数 + }; + window.parent.postMessage(data, '*'); + } else { + window.history.back(); + } + } + }, + toOnlineHours(minutes) { + let _hours = parseInt(minutes / 60); + let _minutes = parseInt(minutes % 60); + return _hours + '时' + _minutes + '分' + }, + // 初始化获取当月日期 + initDate() { + const today = dayjs(); // 获取当前日期 + const currentDay = today.date(); // 获取今天是几号(1-31) + let targetMonth = today; // 默认目标月份是当前月 + if (currentDay === 1) { + targetMonth = today.subtract(1, 'month'); // 上个月 + } + this.current = targetMonth.format('YYYY-MM'); + this.startTime = targetMonth.startOf('month').format('YYYY-MM-DD HH:mm:ss'); + let endTime; + if (targetMonth.isSame(today, 'month')) { + endTime = today.subtract(1, 'day').endOf('day'); + } else { + endTime = targetMonth.endOf('month'); + } + this.endTime = endTime.format('YYYY-MM-DD HH:mm:ss'); + this.startMonthTime=this.getStartTimeFromEndTime(this.endTime) + }, + //获取近四个月的开始时间 + getStartTimeFromEndTime(endTimeStr) { + const startTime = dayjs(endTimeStr).subtract(3, 'month').startOf('month'); + return startTime.format('YYYY-MM-DD HH:mm:ss'); + }, + padZero(num) { + return num < 10 ? `0${num}` : num; + }, + checkMobile() { + const userAgent = navigator.userAgent || navigator.vendor || window.opera; + this.isMobile = /android|webos|iphone|ipad|ipod|blackberry|iemobile|opera mini/i.test(userAgent); + }, + // 通用函数,用于处理百分比数据 + processPercentage(value) { + value *= 100; + if (value % 1 !== 0) { + value = value.toFixed(2); + } + return value; + }, + formatPercentage(value) { + let result = value * 100; + if (Number.isInteger(result)) { + return result.toString() + '%'; + } else { + return result.toFixed(2) + '%'; + } + }, + // 格式化承接案件量数据 + formatCurrency(value) { + if (!value) return ''; + let num = parseInt(value); + return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','); + }, + formatCurrency1(value) { + if (!value) return ''; // 如果值为空,返回空字符串 + // 如果值已经包含逗号,直接返回原值 + if (value.toString().includes(',')) { + return value; + } + // 否则,添加千分号 + let num = parseInt(value); + if (isNaN(num)) return ''; // 如果转换失败,返回空字符串 + return num.toString().replace(/\B(?=(\d{3})+(?!\d))/g, ','); + }, + } +} diff --git a/src/views/kpi/components/fit-table.vue b/src/views/kpi/components/fit-table.vue new file mode 100644 index 00000000..3f995c25 --- /dev/null +++ b/src/views/kpi/components/fit-table.vue @@ -0,0 +1,46 @@ + + + + + diff --git a/src/views/kpi/kpiCaseNew.vue b/src/views/kpi/kpiCaseNew.vue new file mode 100644 index 00000000..35dd8e86 --- /dev/null +++ b/src/views/kpi/kpiCaseNew.vue @@ -0,0 +1,1152 @@ + + + + diff --git a/src/views/report/reportIndex-copy.vue b/src/views/report/reportIndex-copy.vue new file mode 100644 index 00000000..e3b3c771 --- /dev/null +++ b/src/views/report/reportIndex-copy.vue @@ -0,0 +1,581 @@ + + + + +