master
lion 2 weeks ago
parent 90cb580d24
commit a5c6d99839

@ -1,10 +1,12 @@
<template> <template>
<div class="admin-calendar"> <div class="admin-calendar">
<!-- 顶部操作区 --> <!-- 顶部操作区 -->
<div class="admin-header"> <div class="admin-header" style="display: flex; align-items: center; gap: 20px;">
<el-button type="success" icon="el-icon-plus" @click="openCreateModal('add')"></el-button> <el-button type="success" icon="el-icon-plus" @click="openCreateModal('add')"></el-button>
<el-button type="primary" icon="el-icon-plus" @click="exportCalendar"></el-button> <el-button type="primary" icon="el-icon-plus" @click="exportCalendar"></el-button>
<div style="color: #333; font-size: 16px; font-weight: 500;">
本月开课天数{{ monthDayCalendar }} {{ calendarDate.getFullYear() }}年累计开课天数{{ yearDayCalendar }}
</div>
</div> </div>
<!-- 日历预览区 --> <!-- 日历预览区 -->
<div class="admin-main"> <div class="admin-main">
@ -63,7 +65,9 @@ import { getToken } from '@/utils/auth';
list: [], list: [],
calendarDate: new Date(), calendarDate: new Date(),
// top // top
weekRowTops: [] weekRowTops: [],
monthDayCalendar: 0,
yearDayCalendar: 0
} }
}, },
computed: { computed: {
@ -146,7 +150,9 @@ import { getToken } from '@/utils/auth';
month: this.selectMonth month: this.selectMonth
}) })
// id _id id // id _id id
this.list = (res || []).map(e => ({ ...e, id: e.id || e._id })) this.list = (res.list || res || []).map(e => ({ ...e, id: e.id || e._id }))
this.monthDayCalendar = res.monthDayCalendar || 0
this.yearDayCalendar = res.yearDayCalendar || 0
// //
this.generateDynamicStyles() this.generateDynamicStyles()
// //

@ -185,7 +185,7 @@
<template v-slot:is_history> <template v-slot:is_history>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold"> <div class="xy-table-item-label" style="font-weight: bold">
<span style="color: red;font-weight: bold;padding-right: 4px;"></span>是否历史课程体系 <span style="color: red;font-weight: bold;padding-right: 4px;"></span>是否额外添加课程体系
</div> </div>
<div class="xy-table-item-content"> <div class="xy-table-item-content">
<el-radio-group style="width:100%" v-model="form.is_history"> <el-radio-group style="width:100%" v-model="form.is_history">

@ -13,7 +13,7 @@
</el-select> </el-select>
</div> </div>
<div> <div>
<el-select v-model="select.is_history" placeholder="请选择是否历史课程体系" clearable style="width: 100%;"> <el-select v-model="select.is_history" placeholder="请选择是否额外添加课程体系" clearable style="width: 100%;">
<el-option label="是" :value="1"> <el-option label="是" :value="1">
</el-option> </el-option>
<el-option label="否" :value="0"> <el-option label="否" :value="0">
@ -47,7 +47,7 @@
</el-table-column> </el-table-column>
</template> </template>
<template v-slot:is_history> <template v-slot:is_history>
<el-table-column align='center' label="是否历史课程体系" width="180" header-align="center"> <el-table-column align='center' label="是否额外添加课程体系" width="180" header-align="center">
<template slot-scope="scope"> <template slot-scope="scope">
<el-tag :type="scope.row.is_history === 1 ? 'success' : 'info'" v-if="scope.row.is_history === 1"></el-tag> <el-tag :type="scope.row.is_history === 1 ? 'success' : 'info'" v-if="scope.row.is_history === 1"></el-tag>
<el-tag :type="scope.row.is_history === 0 ? 'info' : 'success'" v-else></el-tag> <el-tag :type="scope.row.is_history === 0 ? 'info' : 'success'" v-else></el-tag>
@ -108,7 +108,7 @@
width: 120, width: 120,
}, { }, {
prop: 'is_history', prop: 'is_history',
label: '是否历史课程体系', label: '是否额外添加课程体系',
align: 'center', align: 'center',
width: 180, width: 180,
formatter: (row) => { formatter: (row) => {

@ -1,7 +1,7 @@
<template> <template>
<div> <div>
<xy-dialog ref="dialog" :width="70" :is-show.sync="isShow" :type="'form'" <xy-dialog ref="dialog" :width="70" :is-show.sync="isShow" :type="'form'"
:title="type === 'add' ? '新增历史课程体系' : '编辑历史课程体系'" :form="form" :rules="rules" @submit="submit"> :title="type === 'add' ? '新增额外添加课程体系' : '编辑额外添加课程体系'" :form="form" :rules="rules" @submit="submit">
<template v-slot:type> <template v-slot:type>
<div class="xy-table-item"> <div class="xy-table-item">
<div class="xy-table-item-label" style="font-weight: bold"> <div class="xy-table-item-label" style="font-weight: bold">
@ -164,7 +164,7 @@ export default {
if (res && res.data) { if (res && res.data) {
this.courseTypeOptions = res.data this.courseTypeOptions = res.data
if (this.courseTypeOptions.length === 0) { if (this.courseTypeOptions.length === 0) {
this.$message.warning('请先创建历史课程体系') this.$message.warning('请先创建额外添加课程体系')
} }
} }
} catch (error) { } catch (error) {
@ -174,7 +174,7 @@ export default {
}, },
submit() { submit() {
if (this.courseTypeOptions.length === 0) { if (this.courseTypeOptions.length === 0) {
this.$message.warning('请先创建历史课程体系') this.$message.warning('请先创建额外添加课程体系')
return return
} }
if (this.id) { if (this.id) {

@ -146,12 +146,15 @@
:header-cell-style="headerCellStyle" :header-cell-style="headerCellStyle"
show-summary show-summary
:summary-method="getCourseDetailSummary"> :summary-method="getCourseDetailSummary">
<el-table-column prop="courseSystem" label="课程体系" width="200" align="center"></el-table-column> <el-table-column prop="courseSystem" label="课程体系" width="200" align="center" fixed="left"></el-table-column>
<el-table-column prop="totalPeople" label="培养人数(未去重)" width="200" align="center"></el-table-column> <el-table-column prop="totalPeople" label="培养人数(未去重)" width="200" align="center"></el-table-column>
<el-table-column prop="uniquePeople" label="培养人数(课程体系内已去重)" width="280" align="center"></el-table-column> <el-table-column prop="uniquePeople" label="培养人数(课程体系内已去重)" width="280" align="center"></el-table-column>
<el-table-column prop="courseIndex" label="期数" width="120" align="center"></el-table-column> <el-table-column prop="courseIndex" label="期数" width="120" align="center"></el-table-column>
<el-table-column prop="courseName" label="开课" min-width="200"></el-table-column> <el-table-column prop="courseName" label="开课" min-width="200"></el-table-column>
<el-table-column prop="coursePeople" label="课程培养人数" width="150" align="center"></el-table-column> <el-table-column prop="coursePeople" label="课程培养人数" width="150" align="center"></el-table-column>
<el-table-column prop="genban_total" label="跟班学员数" width="150" align="center"></el-table-column>
<el-table-column prop="yh_invested_total" label="被投企业数" width="150" align="center"></el-table-column>
<el-table-column prop="company_join_total" label="元禾同事数" width="150" align="center"></el-table-column>
</el-table> </el-table>
</div> </div>
</el-col> </el-col>
@ -368,7 +371,10 @@ export default {
courseDetailSummary: { courseDetailSummary: {
totalPeople: 0, totalPeople: 0,
uniquePeople: 0, uniquePeople: 0,
coursePeople: 0 coursePeople: 0,
genban_total: 0,
yh_invested_total: 0,
company_join_total: 0
}, },
regionData: [], regionData: [],
regionSummary: { regionSummary: {
@ -526,7 +532,7 @@ export default {
try { try {
// Excel // Excel
const excelData = [ const excelData = [
['课程体系', '培养人数(未去重)', '培养人数(课程体系内已去重)', '开课', '课程培养人数'] ['课程体系', '培养人数(未去重)', '培养人数(课程体系内已去重)', '开课', '课程培养人数', '跟班学员数', '被投企业数', '元禾同事数']
] ]
// //
@ -536,7 +542,10 @@ export default {
row.totalPeople, row.totalPeople,
row.uniquePeople, row.uniquePeople,
row.courseName, row.courseName,
row.coursePeople row.coursePeople,
row.genban_total,
row.yh_invested_total,
row.company_join_total
]) ])
}) })
@ -550,7 +559,10 @@ export default {
{ wch: 18 }, // { wch: 18 }, //
{ wch: 22 }, // { wch: 22 }, //
{ wch: 30 }, // { wch: 30 }, //
{ wch: 15 } // { wch: 15 }, //
{ wch: 15 }, //
{ wch: 15 }, //
{ wch: 15 } //
] ]
ws['!cols'] = colWidths ws['!cols'] = colWidths
@ -843,7 +855,10 @@ export default {
// //
groupedData[courseType].courses.push({ groupedData[courseType].courses.push({
courseName: item.course_name || '', courseName: item.course_name || '',
coursePeople: item.course_signs_pass || 0 coursePeople: item.course_signs_pass || 0,
genban_total: item.genban_total || 0,
yh_invested_total: item.yh_invested_total || 0,
company_join_total: item.company_join_total || 0
}) })
}) })
@ -860,6 +875,9 @@ export default {
courseIndex: index + 1, courseIndex: index + 1,
courseName: course.courseName, courseName: course.courseName,
coursePeople: course.coursePeople, coursePeople: course.coursePeople,
genban_total: course.genban_total,
yh_invested_total: course.yh_invested_total,
company_join_total: course.company_join_total,
isFirstRow: index === 0 // isFirstRow: index === 0 //
}) })
}) })
@ -870,11 +888,14 @@ export default {
acc.totalPeople += Number(group.totalPeople) || 0 acc.totalPeople += Number(group.totalPeople) || 0
acc.uniquePeople += Number(group.uniquePeople) || 0 acc.uniquePeople += Number(group.uniquePeople) || 0
acc.coursePeople += group.courses.reduce((sum, course) => sum + (Number(course.coursePeople) || 0), 0) acc.coursePeople += group.courses.reduce((sum, course) => sum + (Number(course.coursePeople) || 0), 0)
acc.genban_total += group.courses.reduce((sum, course) => sum + (Number(course.genban_total) || 0), 0)
acc.yh_invested_total += group.courses.reduce((sum, course) => sum + (Number(course.yh_invested_total) || 0), 0)
acc.company_join_total += group.courses.reduce((sum, course) => sum + (Number(course.company_join_total) || 0), 0)
return acc return acc
}, { totalPeople: 0, uniquePeople: 0, coursePeople: 0 }) }, { totalPeople: 0, uniquePeople: 0, coursePeople: 0, genban_total: 0, yh_invested_total: 0, company_join_total: 0 })
this.courseDetailSummary = summary this.courseDetailSummary = summary
} else { } else {
this.courseDetailSummary = { totalPeople: 0, uniquePeople: 0, coursePeople: 0 } this.courseDetailSummary = { totalPeople: 0, uniquePeople: 0, coursePeople: 0, genban_total: 0, yh_invested_total: 0, company_join_total: 0 }
} }
// //
@ -994,6 +1015,15 @@ export default {
} else if (index === 5) { } else if (index === 5) {
// //
sums[index] = this.courseDetailSummary.coursePeople sums[index] = this.courseDetailSummary.coursePeople
} else if (index === 6) {
//
sums[index] = this.courseDetailSummary.genban_total || 0
} else if (index === 7) {
//
sums[index] = this.courseDetailSummary.yh_invested_total || 0
} else if (index === 8) {
//
sums[index] = this.courseDetailSummary.company_join_total || 0
} else { } else {
sums[index] = '' sums[index] = ''
} }

@ -28,9 +28,9 @@ module.exports = {
*/ */
publicPath: process.env.ENV === 'staging' ? '/admin' : '/admin', publicPath: process.env.ENV === 'staging' ? '/admin' : '/admin',
// 测试 // 测试
// outputDir: '/Users/mac/Documents/朗业/2025/s-苏州科技商学院/wx.sstbc.com/public/admin', outputDir: '/Users/mac/Documents/朗业/2025/s-苏州科技商学院/wx.sstbc.com/public/admin',
// 正式 // 正式
outputDir: '/Users/mac/Documents/朗业/2024/s-苏州科技商学院/wx.sstbc.com/public/admin', // outputDir: '/Users/mac/Documents/朗业/2024/s-苏州科技商学院/wx.sstbc.com/public/admin',
assetsDir: 'static', assetsDir: 'static',
css: { css: {
loaderOptions: { // 向 CSS 相关的 loader 传递选项 loaderOptions: { // 向 CSS 相关的 loader 传递选项

Loading…
Cancel
Save