From 72c80c2c8db8d1e5db2bee1cc84f9a2e96f1edf8 Mon Sep 17 00:00:00 2001
From: lion <120344285@qq.com>
Date: Thu, 28 Aug 2025 18:46:26 +0800
Subject: [PATCH] =?UTF-8?q?=E5=AE=9A=E4=BD=8D=E6=8F=90=E7=A4=BA?=
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
---
src/mixin/formMixin.js | 11 +-
src/views/config/classFiles.vue | 2 +-
src/views/course/components/editClass.vue | 1 +
src/views/statistics/index.vue | 194 ++++++++++++++++++--
src/views/student/components/addCompany.vue | 35 ++--
src/views/student/components/editDetail.vue | 87 +++++----
src/views/student/index.vue | 77 +++++++-
src/views/student/schoolmateCompany.vue | 45 ++++-
8 files changed, 370 insertions(+), 82 deletions(-)
diff --git a/src/mixin/formMixin.js b/src/mixin/formMixin.js
index be347ea..f4d68b7 100644
--- a/src/mixin/formMixin.js
+++ b/src/mixin/formMixin.js
@@ -676,15 +676,16 @@ export default {
}],
formSelect: {
// company_position: [],
- company_type: [],
- company_tag:[],
+ company_type: [],
+ company_tag:[],
company_scale:[],
company_area: [],
company_industry: [],
company_industry_detail: [],
type: [],
education: [],
- sign_from: []
+ sign_from: [],
+ from_tag:[]
},
}
@@ -697,7 +698,7 @@ export default {
methods: {
getAllPara() {
let number = ['company_type', 'company_area','company_tag','company_scale', 'company_industry', 'company_industry_detail', 'type', 'education',
- 'sign_from'
+ 'sign_from','from_tag'
]
getparameter({
number: number
@@ -727,4 +728,4 @@ export default {
})
}
},
-};
+};
diff --git a/src/views/config/classFiles.vue b/src/views/config/classFiles.vue
index cec6975..b9d2ebc 100644
--- a/src/views/config/classFiles.vue
+++ b/src/views/config/classFiles.vue
@@ -191,7 +191,7 @@
value: this.select.teacher_id?this.select.teacher_id:''
},{
key: 'direction',
- op: 'eq',
+ op: 'like',
value: this.select.direction?this.select.direction:''
}]
})
diff --git a/src/views/course/components/editClass.vue b/src/views/course/components/editClass.vue
index 26a4acb..57d3eac 100644
--- a/src/views/course/components/editClass.vue
+++ b/src/views/course/components/editClass.vue
@@ -382,6 +382,7 @@
this.form.files = res.files ? res.files : []
// 获取授课老师简介
this.form.teacher_introduce = res.teacher ? res.teacher.introduce || '' : ''
+ this.form.direction = res.direction ? parseInt(res.direction) : ''
// this.form.timeRange = [this.form.start_time ? this.form.start_time : '', this.form.end_time ? this.form
// .end_time : ''
// ]
diff --git a/src/views/statistics/index.vue b/src/views/statistics/index.vue
index 1d5b611..2e51934 100644
--- a/src/views/statistics/index.vue
+++ b/src/views/statistics/index.vue
@@ -84,9 +84,17 @@
课程分类明细统计
-
- 导出数据
-
+
@@ -128,9 +136,12 @@
import { index as courseTypeIndex } from '@/api/course/courseType.js'
import { courseChart } from '@/api/homeChart.js'
import * as XLSX from "xlsx";
+import { download } from "@/utils/downloadRequest";
+import formMixin from "@/mixin/formMixin.js";
export default {
name: 'Statistics',
+ mixins: [formMixin],
components: {},
data() {
return {
@@ -146,43 +157,37 @@ export default {
studentStats: [
{
icon: 'el-icon-user-solid',
- value: '1,247',
+ value: '0',
label: '报名人数(未去重)',
cardClass: 'student-card-1'
},
{
icon: 'el-icon-s-check',
- value: '1,156',
+ value: '0',
label: '培养人数(未去重)',
cardClass: 'student-card-2'
},
{
icon: 'el-icon-s-custom',
- value: '892',
+ value: '0',
label: '培养人数(已去重)',
cardClass: 'student-card-3'
},
{
icon: 'el-icon-date',
- value: '56',
+ value: '0',
label: '开课场次',
cardClass: 'student-card-4'
},
{
icon: 'el-icon-c-scale-to-original',
- value: '89',
+ value: '0',
label: '开课天数',
cardClass: 'student-card-5'
}
],
courseDetailData: [],
- regionData: [
- { region: '吴中区', totalPeople: 125, uniquePeople: 98 },
- { region: '相城区', totalPeople: 82, uniquePeople: 65 },
- { region: '昆山市', totalPeople: 74, uniquePeople: 58 },
- { region: '太仓市', totalPeople: 74, uniquePeople: 62 },
- { region: '姑苏区', totalPeople: 65, uniquePeople: 52 }
- ]
+ regionData: []
}
},
mounted() {
@@ -367,6 +372,136 @@ export default {
}
},
+ // 导出人员明细数据
+ exportCoursePersonData() {
+ try {
+ // 获取选中的课程体系ID,以逗号分隔
+ const courseTypeIds = this.filterForm.selectedCourses.length > 0
+ ? this.filterForm.selectedCourses.join(',')
+ : ''
+
+ // 格式化日期参数
+ const startDate = this.formatDate(this.filterForm.startDate)
+ const endDate = this.formatDate(this.filterForm.endDate)
+
+ // 构建导出字段映射
+ const exportFields = {
+ 'course.type_detail.name': '课程体系',
+ 'course.name': '课程名称',
+ 'status_text': '审核状态',
+ 'created_at': '报名时间'
+ // 'user.name': '姓名',
+ // 'user.sex': '性别',
+ // 'user.no': '学号',
+ // 'user.idcard': '身份证号',
+ // 'user.mobile': '联系方式',
+ // 'user.birthday': '出生年月',
+ // 'user.email': '邮箱',
+ // 'user.company_name': '公司名称',
+ // 'user.company_position': '职务',
+
+ }
+ this.selectFormList.map(item => {
+ if (item.prop === 'index') {
+
+ } else {
+ exportFields['user.'+item.field] = item.name
+ }
+ })
+
+ // 调用下载API
+ download(
+ '/api/admin/course-signs/index',
+ 'get',
+ {
+ export_fields: exportFields,
+ is_export: 1,
+ page: 1,
+ page_size: 9999,
+ start_date: startDate,
+ end_date: endDate,
+ course_type_id: courseTypeIds,
+ clear: 1
+ },
+ this.generateFileName('人员明细')
+ )
+
+ this.$message.success('人员明细导出任务已开始,请稍后查看下载文件')
+ } catch (error) {
+ console.error('导出失败:', error)
+ this.$message.error('导出失败,请重试')
+ }
+ },
+ // 导出开课明细数据
+ exportCourseOpenData() {
+ try {
+ // 获取选中的课程体系ID,以逗号分隔
+ const courseTypeIds = this.filterForm.selectedCourses.length > 0
+ ? this.filterForm.selectedCourses.join(',')
+ : ''
+
+ // 格式化日期参数
+ const startDate = this.formatDate(this.filterForm.startDate)
+ const endDate = this.formatDate(this.filterForm.endDate)
+
+ // 构建导出字段映射
+ const exportFields = {
+ 'type_detail.name': '课程体系',
+ 'name': '课程名称',
+ 'status_text': '发布状态',
+ 'date_status': '课程状态',
+ 'sign_date_status': '报名状态',
+
+ 'is_virtual_text': '是否为虚拟课程',
+ 'url_title': '资讯链接',
+ 'year': '所属年份',
+ 'start_date': '课程开始日期',
+ 'end_date': '课程结束日期',
+ 'total': '开课人数',
+ 'sign_start_date': '报名开始日期',
+ 'sign_end_date': '报名截止日期',
+ 'address_detail': '签到地点',
+
+ 'is_fee_text': '课程类型',
+ 'is_arrange_text': '是否排课',
+ 'show_txl_text': '是否显示通讯录',
+ 'show_mobile_text': '是否显示联系方式',
+ 'auto_schoolmate_text': '已审核学员是否自动进入校友库',
+
+ 'course_signs_count':'目前报名人数',
+ 'sign_wait_total':'待审核人数',
+ 'sign_pass_total':'审核通过人数',
+ 'sign_fault_total':'审核不通过人数',
+ 'sign_prepare_total':'备选人数',
+ 'sign_cancel_total':'已取消人数',
+ 'sign_give_up_total':'主动放弃人数',
+ 'sign_black_total':'黑名单人数',
+
+ }
+
+ // 调用下载API
+ download(
+ '/api/admin/courses/index',
+ 'get',
+ {
+ export_fields: exportFields,
+ 'show_relation[0]':'typeDetail',
+ is_export: 1,
+ page: 1,
+ page_size: 9999,
+ start_date: startDate,
+ end_date: endDate,
+ course_type_id: courseTypeIds
+ },
+ this.generateFileName('开课明细')
+ )
+
+ this.$message.success('开课明细导出任务已开始,请稍后查看下载文件')
+ } catch (error) {
+ console.error('导出失败:', error)
+ this.$message.error('导出失败,请重试')
+ }
+ },
// 导出区域明细数据
exportRegionData() {
if (!this.regionData || this.regionData.length === 0) {
@@ -420,6 +555,35 @@ export default {
}
},
+ // 生成导出文件名
+ generateFileName(type) {
+ // 获取选中的课程体系标签,以逗号分隔
+ let courseTypeLabels = ''
+ if (this.filterForm.selectedCourses.length > 0) {
+ const selectedCourseTypes = this.courseOptions.filter(option =>
+ this.filterForm.selectedCourses.includes(option.value)
+ )
+ courseTypeLabels = selectedCourseTypes.map(course => course.label).join('、')
+ } else {
+ courseTypeLabels = '全部课程体系'
+ }
+
+ // 获取时间周期文本
+ let timeText = ''
+ if (this.filterForm.timeRange === 'all') {
+ timeText = '全周期'
+ } else {
+ // 非全周期显示具体日期范围
+ const startDate = this.formatDate(this.filterForm.startDate)
+ const endDate = this.formatDate(this.filterForm.endDate)
+ timeText = `${startDate}_${endDate}`
+ }
+
+ // 生成文件名:课程体系名称 + 类型 + 时间周期 + 日期
+ const fileName = `${courseTypeLabels}${type}_${timeText}.xlsx`
+ return fileName
+ },
+
// 更新统计数据
updateStatisticsData(data) {
// 根据API返回的数据更新统计卡片
diff --git a/src/views/student/components/addCompany.vue b/src/views/student/components/addCompany.vue
index 14b83f6..663143a 100644
--- a/src/views/student/components/addCompany.vue
+++ b/src/views/student/components/addCompany.vue
@@ -13,7 +13,6 @@
filterable
remote
reserve-keyword
- allow-create
default-first-option
placeholder="请输入企业名称搜索"
:remote-method="searchCompany"
@@ -25,34 +24,34 @@
+ :label="item.name"
+ :value="item.name">
-
+
-
+
集团标签:
-
+
@@ -207,8 +206,8 @@
id: '',
form: {
company_name: '',
- company_attribute: '',
- tag: '',
+ company_industry: '',
+ company_tag: '',
is_yh_invested: '',
company_scale: '',
company_date: '',
@@ -229,14 +228,14 @@
required: true,
message: '请输入企业名称'
}],
- company_attribute: [{
+ company_industry: [{
required: true,
message: '请选择企业资质'
}],
- tag: [{
- required: true,
- message: '请选择集团标签'
- }]
+ // company_tag: [{
+ // required: true,
+ // message: '请选择集团标签'
+ // }]
}
}
},
@@ -297,7 +296,7 @@
const selectedCompany = this.companySearchResults.find(item => item.enterpriseName === value)
if (selectedCompany) {
// 如果选中的企业有额外信息,可以自动填充到表单中
- // 例如:this.form.company_attribute = selectedCompany.attribute
+ // 例如:this.form.company_industry = selectedCompany.attribute
}
}
},
@@ -326,8 +325,8 @@
this.type = "add"
this.form = {
company_name: '',
- company_attribute: '',
- tag: '',
+ company_industry: '',
+ company_tag: '',
is_yh_invested: '',
company_scale: '',
company_date: '',
diff --git a/src/views/student/components/editDetail.vue b/src/views/student/components/editDetail.vue
index a4d6ee2..73a5c0c 100644
--- a/src/views/student/components/editDetail.vue
+++ b/src/views/student/components/editDetail.vue
@@ -1,8 +1,8 @@
-
-
-
-
+
+
+
+
+
+ 学员标签:
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
diff --git a/src/views/student/index.vue b/src/views/student/index.vue
index 55a6429..4a7a393 100644
--- a/src/views/student/index.vue
+++ b/src/views/student/index.vue
@@ -154,6 +154,7 @@
查询
重置
导入
+ 导出
批量设置校友库
批量取消校友库
@@ -253,7 +254,23 @@
否
-
+
+
+
+
+
+
+
+
+ {{ tag }}
+
+
+
@@ -291,6 +308,9 @@
import {
index as indexTypes
} from "@/api/course/courseType.js"
+ import {
+ download
+ } from "@/utils/downloadRequest";
export default {
mixins: [myMixins, formMixin],
components: {
@@ -412,6 +432,11 @@
align: 'center',
width: 120,
}, {
+ prop: 'from',
+ label: '学员标签',
+ align: 'center',
+ width: 120,
+ },{
prop: 'is_schoolmate',
label: '是否校友库学员',
align: 'center',
@@ -460,7 +485,53 @@
this.select.end_birthday = ''
}
},
+ exportExcel() {
+ let _export = {
+ 'all_course': '课程名称'
+ }
+ this.selectFormList.map(item => {
+ if (item.prop === 'index') {
+ } else {
+ _export[item.field] = item.name
+ }
+ })
+ download(
+ '/api/admin/users/study',
+ 'get', {
+ export_fields: _export,
+ keyword: this.select.keyword,
+ name: this.select.name,
+ year:this.select.year?this.select.year:'',
+ mobile: this.select.mobile,
+ company_name: this.select.company_name,
+ school: this.select.school,
+ start_birthday: this.select.start_birthday,
+ end_birthday: this.select.end_birthday,
+ start_company_date: this.select.start_company_date,
+ end_company_date: this.select.end_company_date,
+ course_name: this.select.course_name,
+ company_has_share: this.select.company_has_share,
+ company_need_fund: this.select.company_need_fund,
+ company_position: this.select.company_position,
+ company_area: this.select.company_area,
+ company_type: this.select.company_type,
+ company_industry: this.select.company_industry,
+ is_vip: this.select.is_vip,
+ courses_end_date: this.select.courses_end_date,
+ is_schoolmate: this.select.is_schoolmate,
+ is_black: this.select.is_black,
+ education: this.select.education,
+ type: this.select.type,
+ status: this.select.status,
+ course_type: this.select.course_type,
+ has_openid: this.select.has_openid,
+ is_export: 1,
+ page: 1,
+ page_size: 99999
+ },
+ `学员信息.xlsx`)
+ },
importTable(row) {
// this.$refs.imports.tableData = {
// 'data[course_id]': row.course_id,
@@ -688,6 +759,10 @@
page_size: 999
})
this.courseTypeList = res.data
+ },
+ getStudentTags(tags) {
+ if (!tags) return [];
+ return tags.split(',').map(tag => tag.trim());
}
},
watch: {
diff --git a/src/views/student/schoolmateCompany.vue b/src/views/student/schoolmateCompany.vue
index 7a10663..a7c2c37 100644
--- a/src/views/student/schoolmateCompany.vue
+++ b/src/views/student/schoolmateCompany.vue
@@ -9,6 +9,20 @@
+
+
+
+
+
+
+
+
+
+
+
+
+
+
查询
重置
@@ -54,12 +68,13 @@
-
-
+
+
-
-
{{scope.row.company_attribute}}
+
+
+ {{scope.row.company_industry}}
+
@@ -71,8 +86,8 @@
被投企业
- {{scope.row.tag}}
+ {{scope.row.company_tag}}
@@ -147,6 +162,8 @@
return {
select: {
company_name: '',
+ company_industry: '',
+ company_tag: '',
page: 1,
page_size: 10
},
@@ -164,10 +181,10 @@
width: 240,
fixed: 'left'
}, {
- prop: 'company_attribute',
+ prop: 'company_industry',
label: '企业资质',
align: 'center',
- width: 180
+ width: 260
}, {
prop: 'tag',
label: '集团标签',
@@ -243,6 +260,8 @@
resetSelect() {
this.select.company_name = ''
+ this.select.company_industry = ''
+ this.select.company_tag = ''
this.select.page = 1
this.getList()
},
@@ -254,6 +273,14 @@
key: 'company_name',
op: 'like',
value: this.select.company_name
+ },{
+ key: 'company_industry',
+ op: 'like',
+ value: this.select.company_industry
+ },{
+ key: 'company_tag',
+ op: 'like',
+ value: this.select.company_tag
}]
})