|
|
@@ -375,7 +375,7 @@
|
|
|
<!-- </el-dialog>-->
|
|
|
|
|
|
<!-- 添加课程对话框-->
|
|
|
- <el-dialog :title="course.addMode === 'insert' ? '插入课程' : '添加课程'" :visible.sync="course.addOpen" width="500px" append-to-body>
|
|
|
+ <el-dialog :title="course.addMode === 'insert' ? '插入课程' : '添加课程'" :visible.sync="course.addOpen" width="620px" append-to-body>
|
|
|
<el-form ref="courseAddForm" :model="course.form" :rules="courseAddRules" label-width="100px">
|
|
|
<el-form-item label="课程" prop="courseId">
|
|
|
<el-select filterable v-model="course.form.courseId" placeholder="请选择课程" clearable size="small" @change="courseChange(course.form.courseId)" style="width: 100%" :value-key="'dictValue'">
|
|
|
@@ -387,6 +387,13 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
+ <el-alert
|
|
|
+ type="info"
|
|
|
+ :closable="false"
|
|
|
+ show-icon
|
|
|
+ style="margin-bottom: 12px;"
|
|
|
+ title="课型说明:默认全部为「正课」(提看课口令)。若某小节是注册课,请勾到下方「注册课小节」。"
|
|
|
+ />
|
|
|
<el-form-item label="小节" prop="videoIds">
|
|
|
<el-select filterable v-model="course.form.videoIds" placeholder="请选择小节" :multiple-limit="getDiff(course.row.periodStartingTime, course.row.periodEndTime) - course.total" multiple clearable size="small" style="width: 100%" :value-key="'dictValue'">
|
|
|
<el-option
|
|
|
@@ -397,11 +404,11 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
</el-form-item>
|
|
|
- <el-form-item label="无需注册小节" prop="noRegisterVideoIds">
|
|
|
+ <el-form-item label="注册课小节" prop="registerVideoIds">
|
|
|
<el-select
|
|
|
filterable
|
|
|
- v-model="course.form.noRegisterVideoIds"
|
|
|
- placeholder="请选择无需注册的小节"
|
|
|
+ v-model="course.form.registerVideoIds"
|
|
|
+ placeholder="勾选注册课小节(不勾=正课)"
|
|
|
multiple
|
|
|
clearable
|
|
|
size="small"
|
|
|
@@ -416,6 +423,10 @@
|
|
|
/>
|
|
|
</el-select>
|
|
|
<p v-if="!course.form.videoIds || course.form.videoIds.length === 0" style="color: #909399; font-size: 12px; margin: 5px 0 0;">请先选择小节</p>
|
|
|
+ <div v-else style="margin-top: 8px; font-size: 12px; line-height: 1.6; color: #606266;">
|
|
|
+ <div><span style="color:#E6A23C;font-weight:600;">正课</span>(提看课口令):{{ addCourseMainNames || '无' }}</div>
|
|
|
+ <div><span style="color:#67C23A;font-weight:600;">注册课</span>(提注册链接):{{ addCourseRegisterNames || '无' }}</div>
|
|
|
+ </div>
|
|
|
</el-form-item>
|
|
|
<el-form-item v-if="course.addMode === 'insert'" label="营期时间" prop="dayDate">
|
|
|
<el-date-picker
|
|
|
@@ -572,7 +583,15 @@
|
|
|
v-hasPermi="['course:period:updateCourseTime']"
|
|
|
>修改看课时间</el-button>
|
|
|
</el-col>
|
|
|
-
|
|
|
+ <el-col :span="1.5">
|
|
|
+ <el-button
|
|
|
+ type="success"
|
|
|
+ size="mini"
|
|
|
+ :disabled="updateCourse.ids.length <= 0"
|
|
|
+ @click="handleBatchToRegisterCourse"
|
|
|
+ v-hasPermi="['course:period:addCourse']"
|
|
|
+ >转注册课</el-button>
|
|
|
+ </el-col>
|
|
|
<el-col :span="1.5">
|
|
|
<el-button
|
|
|
type="warning"
|
|
|
@@ -589,7 +608,12 @@
|
|
|
<el-table-column label="课程" align="center" prop="courseName" width="180" />
|
|
|
<el-table-column label="小节" align="center" prop="videoName" />
|
|
|
<el-table-column label="开课状态" align="center" prop="status" width="100" :formatter="courseStatusFormatter" />
|
|
|
- <el-table-column label="是否开启注册链接" align="center" prop="registrationSwitch" width="180" :formatter="registrationSwitchFormatter" />
|
|
|
+ <el-table-column label="课型" align="center" prop="registrationSwitch" width="120">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag v-if="scope.row.registrationSwitch === 1" type="success">注册课</el-tag>
|
|
|
+ <el-tag v-else type="warning">正课</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="营期时间" align="center" prop="dayDate" width="100"/>
|
|
|
<el-table-column label="开始时间" align="center" prop="startDateTime" width="100">
|
|
|
<!-- <template slot-scope="scope">-->
|
|
|
@@ -675,7 +699,7 @@
|
|
|
</template>
|
|
|
|
|
|
<script>
|
|
|
-import {addPeriod, delPeriod, exportPeriod, getPeriod, pagePeriod, updatePeriod, getDays, addCourse, insertCourse, delPeriodDay, delPeriodDayAndReorder, updateCourseTime, updateCourseDate, updateListCourseData, periodCourseMove, closePeriod, copyPeriod} from "@/api/course/userCoursePeriod";
|
|
|
+import {addPeriod, delPeriod, exportPeriod, getPeriod, pagePeriod, updatePeriod, getDays, addCourse, insertCourse, delPeriodDay, delPeriodDayAndReorder, updateCourseTime, updateCourseDate, updateListCourseData, periodCourseMove, closePeriod, copyPeriod, batchToRegisterCourse} from "@/api/course/userCoursePeriod";
|
|
|
import {getCompanyList} from "@/api/company/company";
|
|
|
import { listCamp, addCamp, editCamp, delCamp, copyCamp } from "@/api/course/userCourseCamp";
|
|
|
import { courseList,videoList } from '@/api/course/courseRedPacketLog'
|
|
|
@@ -758,7 +782,7 @@ export default {
|
|
|
addMode: 'add',
|
|
|
form: {
|
|
|
videoIds: [],
|
|
|
- noRegisterVideoIds: []
|
|
|
+ registerVideoIds: []
|
|
|
},
|
|
|
},
|
|
|
//修改营期时间参数
|
|
|
@@ -935,6 +959,20 @@ export default {
|
|
|
return this.videoList.filter(video =>
|
|
|
this.course.form.videoIds.includes(parseInt(video.dictValue))
|
|
|
);
|
|
|
+ },
|
|
|
+ addCourseRegisterNames() {
|
|
|
+ const reg = this.course.form.registerVideoIds || [];
|
|
|
+ return this.filteredVideoList
|
|
|
+ .filter(v => reg.includes(parseInt(v.dictValue)))
|
|
|
+ .map(v => v.dictLabel)
|
|
|
+ .join('、');
|
|
|
+ },
|
|
|
+ addCourseMainNames() {
|
|
|
+ const reg = this.course.form.registerVideoIds || [];
|
|
|
+ return this.filteredVideoList
|
|
|
+ .filter(v => !reg.includes(parseInt(v.dictValue)))
|
|
|
+ .map(v => v.dictLabel)
|
|
|
+ .join('、');
|
|
|
}
|
|
|
},
|
|
|
created() {
|
|
|
@@ -1090,6 +1128,23 @@ export default {
|
|
|
handleSelectionCourseChange(selection) {
|
|
|
this.updateCourse.ids = selection.map(item => item.id)
|
|
|
},
|
|
|
+ handleBatchToRegisterCourse() {
|
|
|
+ const ids = this.updateCourse.ids || [];
|
|
|
+ if (!ids.length) {
|
|
|
+ this.$message.warning('请先勾选要转为注册课的小节');
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ this.$confirm('确认将勾选的 ' + ids.length + ' 个小节转为注册课?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ return batchToRegisterCourse(ids);
|
|
|
+ }).then(() => {
|
|
|
+ this.$message.success('已转为注册课');
|
|
|
+ this.getCourseList();
|
|
|
+ }).catch(() => {});
|
|
|
+ },
|
|
|
/** 新增按钮操作 */
|
|
|
handleAdd() {
|
|
|
this.reset();
|
|
|
@@ -1624,7 +1679,7 @@ export default {
|
|
|
timeRange: ['00:00:00', '23:59:59'],
|
|
|
joinTime: '23:59:59',
|
|
|
videoIds: [],
|
|
|
- noRegisterVideoIds: []
|
|
|
+ registerVideoIds: []
|
|
|
};
|
|
|
// 重置表单
|
|
|
this.$nextTick(() => {
|
|
|
@@ -1672,7 +1727,7 @@ export default {
|
|
|
timeRange: null,
|
|
|
joinTime: null,
|
|
|
videoIds: [],
|
|
|
- noRegisterVideoIds: []
|
|
|
+ registerVideoIds: []
|
|
|
};
|
|
|
// 重置表单
|
|
|
if (this.$refs.courseAddForm) {
|
|
|
@@ -1708,7 +1763,7 @@ export default {
|
|
|
},
|
|
|
courseChange(row){
|
|
|
this.course.form.videoIds = [];
|
|
|
- this.course.form.noRegisterVideoIds = [];
|
|
|
+ this.course.form.registerVideoIds = [];
|
|
|
videoList(row).then(response => {
|
|
|
this.videoList=response.list
|
|
|
});
|
|
|
@@ -1909,15 +1964,15 @@ export default {
|
|
|
2: '进行中',
|
|
|
3: '已结束'
|
|
|
};
|
|
|
- return statusMap[row.periodStatus] || '未知状态';
|
|
|
+ return statusMap[row.periodStatus] || '未知';
|
|
|
},
|
|
|
/** 注册开关状态格式化 */
|
|
|
registrationSwitchFormatter(row) {
|
|
|
const switchMap = {
|
|
|
- 0: '未开启',
|
|
|
- 1: '已开启'
|
|
|
+ 0: '正课',
|
|
|
+ 1: '注册课'
|
|
|
};
|
|
|
- return switchMap[row.registrationSwitch] || '未知状态';
|
|
|
+ return switchMap[row.registrationSwitch] || '正课';
|
|
|
},
|
|
|
/** 开课状态格式化 */
|
|
|
courseStatusFormatter(row) {
|