From fe4270178f36baa172b9b63c5bab3c101146b6ff Mon Sep 17 00:00:00 2001
From: qsh <>
Date: Fri, 8 Nov 2024 16:02:28 +0800
Subject: [PATCH 1/4] sc
---
.../Home/Comp/DialogSalerReportDetail.vue | 12 +++-
src/views/Home/SalesReport.vue | 61 +++++++++++++++++--
2 files changed, 66 insertions(+), 7 deletions(-)
diff --git a/src/views/Home/Comp/DialogSalerReportDetail.vue b/src/views/Home/Comp/DialogSalerReportDetail.vue
index 89f6e84..3804b7a 100644
--- a/src/views/Home/Comp/DialogSalerReportDetail.vue
+++ b/src/views/Home/Comp/DialogSalerReportDetail.vue
@@ -25,7 +25,12 @@
/>
-
+
-
+
-
-
+
+
{{
@@ -164,22 +176,61 @@ function handleReset() {
const month = new Date().getMonth() + 1
searchForm.value = {
nickname: undefined,
- consultTime: [`${year}-${month}-01`, formatDate(new Date())]
+ consultTime: [`${year}-${month}-01`, formatDate(new Date())],
+ licenseTypeList: [],
+ sourceId: undefined
}
}
const loading = ref(false)
const tableList = ref([])
+const avgData = ref({})
async function handleSearch() {
loading.value = true
try {
const data = await reportApi.getList(removeNullField(searchForm.value))
- tableList.value = data
+ tableList.value = data.personDataVOList
+ avgData.value = data.averageDataVO
} finally {
loading.value = false
}
}
+function getSummaries({ columns, data }) {
+ const sums = []
+ columns.forEach((column, index) => {
+ if (index == 0) {
+ sums[index] = '统计'
+ return
+ }
+
+ const doubleSumsColumns = [
+ 'newClueNumber',
+ 'signNumber',
+ 'clueCostTotal',
+ 'payPriceTotal',
+ 'profitTotal'
+ ]
+ if (column.property in avgData.value) {
+ sums[index] = `均值: ${avgData.value[column.property]}`
+ } else if (doubleSumsColumns.includes(column.property)) {
+ const values = data.map((item) => Number(item[column.property]))
+ let sum = values.reduce((prev, curr) => prev + curr, 0)
+ let avg = sum / values.length
+ if (['newClueNumber', 'signNumber'].includes(column.property)) {
+ avg = Math.floor(avg)
+ } else {
+ sum = sum.toFixed(2)
+ avg = avg.toFixed(2)
+ }
+ sums[index] = h('div', {}, [h('div', {}, `合计:${sum}`), h('div', {}, `均值:${avg}`)])
+ } else {
+ sums[index] = ''
+ }
+ })
+ return sums
+}
+
const SalerDetailDialog = ref()
function handleDetail(info) {
SalerDetailDialog.value.open(info, searchForm.value)
From 15179707d9d90e628bf9d9b05340e34ab15d52d1 Mon Sep 17 00:00:00 2001
From: qsh <>
Date: Fri, 8 Nov 2024 16:43:56 +0800
Subject: [PATCH 2/4] sc
---
src/styles/index.scss | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/src/styles/index.scss b/src/styles/index.scss
index 1aabdd0..0516f94 100644
--- a/src/styles/index.scss
+++ b/src/styles/index.scss
@@ -78,3 +78,7 @@
left: 2px;
}
}
+
+.el-table--default .cell {
+ padding: 0 2px;
+}
From af84640a4b135f14da53d2a2c373fbff7099aa3c Mon Sep 17 00:00:00 2001
From: qsh <>
Date: Fri, 8 Nov 2024 16:57:43 +0800
Subject: [PATCH 3/4] sc
---
src/styles/index.scss | 2 +-
src/views/Home/SalesReport.vue | 2 +-
2 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/styles/index.scss b/src/styles/index.scss
index 0516f94..4e64725 100644
--- a/src/styles/index.scss
+++ b/src/styles/index.scss
@@ -80,5 +80,5 @@
}
.el-table--default .cell {
- padding: 0 2px;
+ padding: 0 5px;
}
diff --git a/src/views/Home/SalesReport.vue b/src/views/Home/SalesReport.vue
index 44aac3e..29fd990 100644
--- a/src/views/Home/SalesReport.vue
+++ b/src/views/Home/SalesReport.vue
@@ -56,7 +56,7 @@
show-summary
:summary-method="getSummaries"
>
-
+
{{
From 9cdfa01d33ac5c50de081583147fa2ac8bcfac51 Mon Sep 17 00:00:00 2001
From: qsh <>
Date: Mon, 11 Nov 2024 15:19:53 +0800
Subject: [PATCH 4/4] sc
---
.env.base | 4 ++--
src/views/Basic/Role/Comp/RoleEmployee.vue | 12 ++++++++++++
src/views/Home/Comp/DialogSalerReportDetail.vue | 1 +
src/views/Home/SalesReport.vue | 1 +
4 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/.env.base b/.env.base
index b37d409..d470c46 100644
--- a/.env.base
+++ b/.env.base
@@ -4,8 +4,8 @@ VITE_NODE_ENV=development
VITE_DEV=true
# 请求路径
-# VITE_BASE_URL='http://118.31.23.45:48080'
-VITE_BASE_URL='http://114.55.169.15:48080'
+VITE_BASE_URL='http://118.31.23.45:48080'
+# VITE_BASE_URL='http://114.55.169.15:48080'
# 上传路径
VITE_UPLOAD_URL='http://118.31.23.45:48080/admin-api/system/file/upload'
diff --git a/src/views/Basic/Role/Comp/RoleEmployee.vue b/src/views/Basic/Role/Comp/RoleEmployee.vue
index 5360843..d14f7f6 100644
--- a/src/views/Basic/Role/Comp/RoleEmployee.vue
+++ b/src/views/Basic/Role/Comp/RoleEmployee.vue
@@ -9,6 +9,18 @@
:label="col.label"
:width="col.width"
/>
+
+
+
+
+