From e4d8705de7d2bac1aa9a9fc050b63b1fac019679 Mon Sep 17 00:00:00 2001 From: lion <120344285@qq.com> Date: Sat, 6 Sep 2025 08:51:03 +0800 Subject: [PATCH] =?UTF-8?q?=E7=AD=BE=E5=88=B0=E8=AE=B0=E5=BD=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/views/courseQr/components/signList.vue | 43 +++++++++++++++------- src/views/courseQr/index.vue | 2 +- 2 files changed, 30 insertions(+), 15 deletions(-) diff --git a/src/views/courseQr/components/signList.vue b/src/views/courseQr/components/signList.vue index 8ef7847..299539e 100644 --- a/src/views/courseQr/components/signList.vue +++ b/src/views/courseQr/components/signList.vue @@ -138,8 +138,8 @@ export default { data() { return { isShow: false, - course_content_check_count:0, - course_content_check_count_no:0, + course_content_check_count: 0, + course_content_check_count_no: 0, searchForm: { page: 1, page_size: 10, @@ -148,11 +148,10 @@ export default { has_check: '' }, tableReqOpt: { - course_id: this.courseId, - course_content_id: this.courseContentId || '' + course_id: this.courseId }, - list:[], - total:0, + list: [], + total: 0, tableColumns: [ { prop: 'user.name', @@ -196,7 +195,11 @@ export default { this.tableReqOpt.course_id = newVal }, courseContentId(newVal) { - this.tableReqOpt.course_content_id = newVal || '' + if (newVal) { + this.tableReqOpt.course_content_id = newVal + } else { + delete this.tableReqOpt.course_content_id + } } }, methods: { @@ -227,8 +230,10 @@ export default { handleReset() { this.resetForm() this.tableReqOpt = { - course_id: this.courseId, - course_content_id: this.courseContentId || '' + course_id: this.courseId + } + if (this.courseContentId) { + this.tableReqOpt.course_content_id = this.courseContentId } this.refreshTable() }, @@ -252,7 +257,6 @@ export default { const exportParams = { ...this.searchForm, course_id: this.courseId, - course_content_id: this.courseContentId || '', export_fields: exportFields, is_export: 1, clear: 1, @@ -260,6 +264,11 @@ export default { page_size: 999 } + // 只有在有课表ID时才传入course_content_id + if (this.courseContentId) { + exportParams.course_content_id = this.courseContentId + } + // 生成文件名 let fileName = '签到记录' if (this.courseInfo && this.courseInfo.name) { @@ -295,11 +304,17 @@ export default { // 获取签到列表数据 async fetchSignList(params) { - const res = await getSignList({ + const requestParams = { ...this.searchForm, - course_id: this.courseId, - course_content_id: this.courseContentId || '', - }) + course_id: this.courseId + } + + // 只有在有课表ID时才传入course_content_id + if (this.courseContentId) { + requestParams.course_content_id = this.courseContentId + } + + const res = await getSignList(requestParams) this.list = res.list.data this.course_content_check_count = res.course_content_check_count this.course_content_check_count_no = res.total - res.course_content_check_count diff --git a/src/views/courseQr/index.vue b/src/views/courseQr/index.vue index b0babb5..db8d627 100644 --- a/src/views/courseQr/index.vue +++ b/src/views/courseQr/index.vue @@ -174,7 +174,7 @@