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 @@ - +