From 03b0791863813b8ce15b2c29418fbf12f1f34e1f Mon Sep 17 00:00:00 2001
From: Lx <935448346@qq.com>
Date: Tue, 1 Jul 2025 14:26:40 +0800
Subject: [PATCH] 0701
---
.../drivingSchool/BusinessRecord/index.vue | 1 +
.../drivingSchool/DriveSchoolPay/api/index.js | 9 ++
.../DriveSchoolPay/form/ExportDialog.vue | 67 ++++++++++++-
.../form/SchoolCourseOrderForm.vue | 32 ++++++-
.../form/cashierConfirmForm.vue | 23 +++++
.../drivingSchool/DriveSchoolPay/index.vue | 10 +-
.../driveSchoolExamPass/api/pass.js | 9 ++
.../driveSchoolExamPass/form/ExportDialog.vue | 93 ++++++++++++++++++-
.../driveSchoolExamPass/index.vue | 2 +
9 files changed, 237 insertions(+), 9 deletions(-)
diff --git a/src/views/drivingSchool/BusinessRecord/index.vue b/src/views/drivingSchool/BusinessRecord/index.vue
index 6732d95..4c4fd6e 100644
--- a/src/views/drivingSchool/BusinessRecord/index.vue
+++ b/src/views/drivingSchool/BusinessRecord/index.vue
@@ -73,6 +73,7 @@
+
-->
+
@@ -147,6 +176,7 @@
+
@@ -210,6 +240,8 @@ import * as SchoolOrderApi from "../api/index";
import { listDriveSchoolCourse } from "@/views/drivingSchool/schoolCourse/api/driveSchoolCourse";
import {listCoach} from "@/views/drivingSchool/drivingSchoolCar/api/car";
import { exportSchoolOrderExcel, getSchoolOrderPage } from '../api/index'
+import { getDictDatas } from '@/utils/dict'
+import * as SchoolCommissionApi from '@/views/drivingSchool/driveSchoolExamPass/api/pass'
// import { getSchoolCommissionPageNew } from '../api/pass'
export default {
name: "ExportDialog",
@@ -274,6 +306,14 @@ export default {
}
],
selectedTimeType: 'cashierConfirm',
+ sourceList: [],
+
+ stats: {
+ studentCount: 0,
+ totalAmount: 0,
+ subject2DeductTotal: 0,
+ subject3DeductTotal: 0,
+ },
};
},
computed: {
@@ -292,6 +332,7 @@ export default {
// 获取教练信息
const coachRes = await listCoach()
this.coachList = coachRes.data
+ this.sourceList = getDictDatas('drive_school_channel')
},
// 关闭弹窗时重置状态
handleClose() {
@@ -316,10 +357,32 @@ export default {
});
this.tableData = res.data.records;
this.total = res.data.total;
+ this.getStatistics(this.queryParams);
} finally {
this.loading = false;
}
},
+ async getStatistics(queryParams) {
+ console.log('queryParams', queryParams)
+ try {
+ // 构造查询参数,与列表查询一致
+
+ // 调用统计API
+ const statsRes = await SchoolOrderApi.getOrderStatistics(queryParams);
+ console.log(statsRes)
+
+ // 更新统计数据,处理可能的null值
+ this.stats = {
+ studentCount: statsRes.data.studentCount || 0,
+ totalAmount: statsRes.data.totalAmount || 0,
+ subject2DeductTotal: statsRes.data.subject2DeductTotal || 0,
+ subject3DeductTotal: statsRes.data.subject3DeductTotal || 0
+ };
+ } catch (error) {
+ console.error('获取统计数据失败:', error);
+ this.$message.error('获取统计数据失败');
+ }
+ },
// 搜索
handleSearch() {
this.queryParams.pageNo = 1;
diff --git a/src/views/drivingSchool/DriveSchoolPay/form/SchoolCourseOrderForm.vue b/src/views/drivingSchool/DriveSchoolPay/form/SchoolCourseOrderForm.vue
index 975893f..0b47069 100644
--- a/src/views/drivingSchool/DriveSchoolPay/form/SchoolCourseOrderForm.vue
+++ b/src/views/drivingSchool/DriveSchoolPay/form/SchoolCourseOrderForm.vue
@@ -29,7 +29,9 @@
-
+
+
+
@@ -212,6 +214,8 @@
import * as SchoolCourseOrderApi from '@/views/drivingSchool/DriveSchoolPay/api'
import { getSchemeListByCourseId } from '@/views/drivingSchool/DriveSchoolPay/api'
import SchemeForm from '@/views/drivingSchool/schoolCourse/form/schemeForm.vue'
+import { listCoach } from '@/views/drivingSchool/drivingSchoolCar/api/car'
+import { getDictDatas } from '@/utils/dict'
export default {
name: 'SchoolCourseOrderForm',
@@ -303,6 +307,7 @@ export default {
// 表单校验
formRules: {},
schemeList: [],
+ coachList: [],
}
},
methods: {
@@ -318,6 +323,14 @@ export default {
this.formData = res.data
this.title = '修改驾照报名订单'
await this.loadSchemeList(this.formData.courseId);
+ const coachRes = await listCoach()
+ this.coachList = coachRes.data
+ if (this.formData.coachUserId) {
+ const selectedCoach = this.coachList.find(c => c.userId === this.formData.coachUserId);
+ if (selectedCoach) {
+ this.formData.coachUserName = selectedCoach.name;
+ }
+ }
} finally {
this.formLoading = false
}
@@ -389,6 +402,23 @@ export default {
this.schemeList = res.data
})
},
+ /* handleCoachChange() {
+ const selected = this.coachList.find(item => item.userId === this.formData.coachId);
+ if (selected) {
+ this.formData.coachName = selected.name;
+ } else {
+ this.formData.coachName = '';
+ }
+ }, */
+ handleCoachChange(selectedCoach) {
+ if (selectedCoach) {
+ this.formData.coachUserId = selectedCoach.userId;
+ this.formData.coachUserName = selectedCoach.name;
+ } else {
+ this.formData.coachUserId = undefined;
+ this.formData.coachUserName = undefined;
+ }
+ },
/** 表单重置 */
reset() {
this.formData = {
diff --git a/src/views/drivingSchool/DriveSchoolPay/form/cashierConfirmForm.vue b/src/views/drivingSchool/DriveSchoolPay/form/cashierConfirmForm.vue
index b3bda33..4cd6011 100644
--- a/src/views/drivingSchool/DriveSchoolPay/form/cashierConfirmForm.vue
+++ b/src/views/drivingSchool/DriveSchoolPay/form/cashierConfirmForm.vue
@@ -194,12 +194,30 @@
placeholder="请选择缴费日期" />
+
+
+
+
+
+
+
+
+
+
+
+
+
+
@@ -218,6 +236,7 @@
import * as SchoolCourseOrderApi from '@/views/drivingSchool/DriveSchoolPay/api'
import { getSchemeListByCourseId } from '@/views/drivingSchool/DriveSchoolPay/api'
import SchemeForm from '@/views/drivingSchool/schoolCourse/form/schemeForm.vue'
+import { getDictDatas } from '@/utils/dict'
export default {
name: 'cashierConfirmForm',
@@ -260,6 +279,8 @@ export default {
cashierConfirmRemark: undefined,
cashierConfirm: undefined,
cashierConfirmTime: undefined,
+ paymentMethod: undefined, // 收款方式
+ paymentAccount: undefined // 收款账户
},
ifEndRadio: [
{
@@ -323,6 +344,7 @@ export default {
formRules: {},
schemeList: [],
activeNames: ['2'],
+ paymentAccountList: []
}
},
methods: {
@@ -334,6 +356,7 @@ export default {
// 修改时,设置数据
if (id) {
this.formLoading = true
+ this.paymentAccountList = getDictDatas('school_payment_account')
try {
const res = await SchoolCourseOrderApi.getSchoolCourseOrder(id)
this.formData = res.data
diff --git a/src/views/drivingSchool/DriveSchoolPay/index.vue b/src/views/drivingSchool/DriveSchoolPay/index.vue
index 63d8778..51fd7df 100644
--- a/src/views/drivingSchool/DriveSchoolPay/index.vue
+++ b/src/views/drivingSchool/DriveSchoolPay/index.vue
@@ -40,11 +40,11 @@
-
+
-
-
+
+
@@ -69,7 +69,7 @@
-
+
@@ -660,7 +660,7 @@ export default {
'2': '教练代报名',
'3': '员工代报名'
};
- return map[value] ?? '-';
+ return map[value] ?? '非代报名';
},
formatIfAgree(row, column, value) {
const map = {
diff --git a/src/views/drivingSchool/driveSchoolExamPass/api/pass.js b/src/views/drivingSchool/driveSchoolExamPass/api/pass.js
index 3c707fd..83da1ab 100644
--- a/src/views/drivingSchool/driveSchoolExamPass/api/pass.js
+++ b/src/views/drivingSchool/driveSchoolExamPass/api/pass.js
@@ -94,6 +94,15 @@ export function getSchoolCommissionPageNew(params) {
});
}
+// 获取统计数据
+export function getCommissionStatistics(params) {
+ return request({
+ url: '/drive/school-commission/getCommissionStatistics',
+ method: 'get',
+ params
+ });
+}
+
// 导出Excel
export function exportSchoolCommissionExcel(params) {
return request({
diff --git a/src/views/drivingSchool/driveSchoolExamPass/form/ExportDialog.vue b/src/views/drivingSchool/driveSchoolExamPass/form/ExportDialog.vue
index d533fa4..cc08f36 100644
--- a/src/views/drivingSchool/driveSchoolExamPass/form/ExportDialog.vue
+++ b/src/views/drivingSchool/driveSchoolExamPass/form/ExportDialog.vue
@@ -15,6 +15,7 @@
:inline="true"
label-width="80px"
class="filter-form"
+ style="margin-bottom: 3px"
>
@@ -58,6 +59,13 @@
clearable
/>
+
+
+
+
+
+
+
+ {{ stats.subject2PassCount }}
+
+
+ {{ stats.subject2Commission }}
+
+
+ {{ stats.subject3PassCount }}
+
+
+ {{ stats.subject3Commission }}
+
+
+ {{ stats.totalPassCount }}
+
+
+ {{ stats.totalCommission }}
+
+
+
+
+
+
+
@@ -166,6 +204,7 @@
import * as SchoolCommissionApi from "../api/pass";
import { listDriveSchoolCourse } from "@/views/drivingSchool/schoolCourse/api/driveSchoolCourse";
import {listCoach} from "@/views/drivingSchool/drivingSchoolCar/api/car";
+import { getDictDatas } from '@/utils/dict'
// import { getSchoolCommissionPageNew } from '../api/pass'
export default {
name: "ExportDialog",
@@ -191,14 +230,25 @@ export default {
pageNo: 1,
pageSize: 10
},
+
exportRange: {
startPage: 1,
endPage: 1,
pageSize: 10
},
+ stats: {
+ subject2PassCount: 0, // 科二合格数
+ subject2Commission: 0, // 科二提成
+ subject3PassCount: 0, // 科三合格数
+ subject3Commission: 0, // 科三提成
+ totalPassCount: 0, // 总合格数
+ totalCommission: 0 // 总提成金额
+ },
+
coachList: [],
courseList: [],
+ sourceList: [],
};
},
computed: {
@@ -217,6 +267,7 @@ export default {
// 获取教练信息
const coachRes = await listCoach()
this.coachList = coachRes.data
+ this.sourceList = getDictDatas('drive_school_channel')
},
// 关闭弹窗时重置状态
handleClose() {
@@ -230,7 +281,7 @@ export default {
this.resetQuery();
},
// 获取数据列表
- async getList() {
+ /* async getList() {
try {
this.loading = true;
const res = await SchoolCommissionApi.getSchoolCommissionPageNew({
@@ -241,9 +292,49 @@ export default {
});
this.tableData = res.data.records;
this.total = res.data.total;
+ await this.getStatistics(res)
} finally {
this.loading = false;
}
+ }, */
+ async getList() {
+ try {
+ this.loading = true;
+ // 优先获取表格数据
+ const listRes = await SchoolCommissionApi.getSchoolCommissionPageNew(this.queryParams);
+ this.tableData = listRes.data.records;
+ this.total = listRes.data.total;
+
+ // 不阻塞,同步发起统计请求
+ this.getStatistics(this.queryParams);
+ } catch (error) {
+ console.error("列表加载失败:", error);
+ } finally {
+ this.loading = false;
+ }
+ },
+ async getStatistics(queryParams) {
+ console.log('queryParams', queryParams)
+ try {
+ // 构造查询参数,与列表查询一致
+
+ // 调用统计API
+ const statsRes = await SchoolCommissionApi.getCommissionStatistics(queryParams);
+ console.log(statsRes)
+
+ // 更新统计数据,处理可能的null值
+ this.stats = {
+ subject2PassCount: statsRes.data.subject2PassCount || 0,
+ subject2Commission: statsRes.data.subject2Commission || 0,
+ subject3PassCount: statsRes.data.subject3PassCount || 0,
+ subject3Commission: statsRes.data.subject3Commission || 0,
+ totalPassCount: statsRes.data.totalPassCount || 0,
+ totalCommission: statsRes.data.totalCommission || 0
+ };
+ } catch (error) {
+ console.error('获取统计数据失败:', error);
+ this.$message.error('获取统计数据失败');
+ }
},
// 搜索
handleSearch() {
diff --git a/src/views/drivingSchool/driveSchoolExamPass/index.vue b/src/views/drivingSchool/driveSchoolExamPass/index.vue
index d91a184..5a1c7e7 100644
--- a/src/views/drivingSchool/driveSchoolExamPass/index.vue
+++ b/src/views/drivingSchool/driveSchoolExamPass/index.vue
@@ -56,8 +56,10 @@
+
+