|
@@ -359,12 +359,77 @@
|
|
/>
|
|
/>
|
|
</el-select>
|
|
</el-select>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
+ <el-form-item label="看课时间" prop="timeRange">
|
|
|
|
+ <el-time-picker
|
|
|
|
+ is-range
|
|
|
|
+ v-model="course.form.timeRange"
|
|
|
|
+ range-separator="至"
|
|
|
|
+ start-placeholder="开始时间"
|
|
|
|
+ value-format="HH:mm:ss"
|
|
|
|
+ end-placeholder="结束时间"
|
|
|
|
+ placeholder="选择时间范围">
|
|
|
|
+ </el-time-picker>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="领取红包时间" prop="lastJoinTime">
|
|
|
|
+ <el-time-picker
|
|
|
|
+ v-model="course.form.joinTime"
|
|
|
|
+ :selectableRange="course.form.timeRange"
|
|
|
|
+ value-format="HH:mm:ss"
|
|
|
|
+ placeholder="选择时间范围">
|
|
|
|
+ </el-time-picker>
|
|
|
|
+ <p style="color: red;margin: 0;font-size: 12px">超过领取红包时间,只允许看课,不允许领取红包</p>
|
|
|
|
+ </el-form-item>
|
|
</el-form>
|
|
</el-form>
|
|
<div slot="footer" class="dialog-footer">
|
|
<div slot="footer" class="dialog-footer">
|
|
<el-button type="primary" @click="submitCourseForm">确 定</el-button>
|
|
<el-button type="primary" @click="submitCourseForm">确 定</el-button>
|
|
<el-button @click="closeAddCourse">取 消</el-button>
|
|
<el-button @click="closeAddCourse">取 消</el-button>
|
|
</div>
|
|
</div>
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
+ <el-dialog title="修改看课时间" :visible.sync="updateCourse.open" width="500px" append-to-body>
|
|
|
|
+ <el-form ref="courseUpdateForm" :model="updateCourse.form" label-width="100px">
|
|
|
|
+ <el-form-item label="看课时间" prop="timeRange">
|
|
|
|
+ <el-time-picker
|
|
|
|
+ is-range
|
|
|
|
+ v-model="updateCourse.form.timeRange"
|
|
|
|
+ range-separator="至"
|
|
|
|
+ start-placeholder="开始时间"
|
|
|
|
+ value-format="HH:mm:ss"
|
|
|
|
+ end-placeholder="结束时间"
|
|
|
|
+ placeholder="选择时间范围">
|
|
|
|
+ </el-time-picker>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ <el-form-item label="领取红包时间" prop="lastJoinTime">
|
|
|
|
+ <el-time-picker
|
|
|
|
+ v-model="updateCourse.form.joinTime"
|
|
|
|
+ :selectableRange="updateCourse.form.timeRange"
|
|
|
|
+ value-format="HH:mm:ss"
|
|
|
|
+ placeholder="选择时间范围">
|
|
|
|
+ </el-time-picker>
|
|
|
|
+ <p style="color: red;margin: 0;font-size: 12px">超过领取红包时间,只允许看课,不允许领取红包</p>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button type="primary" @click="submitUpdateCourseForm">确 定</el-button>
|
|
|
|
+ <el-button @click="closeUpdateCourse">取 消</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
+ <el-dialog title="修改营期时间" :visible.sync="updateDateOpen" width="500px" append-to-body>
|
|
|
|
+ <el-form ref="courseUpdateForm" :model="form" label-width="100px">
|
|
|
|
+ <el-form-item label="营期时间" prop="dayDate">
|
|
|
|
+ <el-date-picker
|
|
|
|
+ v-model="form.dayDate"
|
|
|
|
+ :selectableRange="form.dayDate"
|
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
|
+ type="date"
|
|
|
|
+ placeholder="选择时间">
|
|
|
|
+ </el-date-picker>
|
|
|
|
+ </el-form-item>
|
|
|
|
+ </el-form>
|
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
|
+ <el-button type="primary" @click="updateDate">确 定</el-button>
|
|
|
|
+ <el-button @click="updateDateOpen = false">取 消</el-button>
|
|
|
|
+ </div>
|
|
|
|
+ </el-dialog>
|
|
|
|
|
|
<!-- <red-packet-->
|
|
<!-- <red-packet-->
|
|
<!-- :visible.sync="redPacketVisible"-->
|
|
<!-- :visible.sync="redPacketVisible"-->
|
|
@@ -397,12 +462,36 @@
|
|
v-hasPermi="['course:period:add']"
|
|
v-hasPermi="['course:period:add']"
|
|
>添加课程</el-button>
|
|
>添加课程</el-button>
|
|
</el-col>
|
|
</el-col>
|
|
|
|
+ <el-col :span="1.5">
|
|
|
|
+ <el-button
|
|
|
|
+ type="primary"
|
|
|
|
+ size="mini"
|
|
|
|
+ :disabled="updateCourse.ids.length <= 0"
|
|
|
|
+ @click="handleUpdateCourse"
|
|
|
|
+ v-hasPermi="['course:period:add']"
|
|
|
|
+ >修改看课时间</el-button>
|
|
|
|
+ </el-col>
|
|
</el-row>
|
|
</el-row>
|
|
- <el-table v-loading="course.loading" :data="course.list">
|
|
|
|
|
|
+ <el-table v-loading="course.loading" :data="course.list" @selection-change="handleSelectionCourseChange">
|
|
|
|
+ <el-table-column type="selection" width="55" align="center" />
|
|
<el-table-column label="课程" align="center" prop="courseName" width="180" />
|
|
<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="videoName" />
|
|
- <el-table-column label="营期时间" align="center" prop="dayDate" width="150" />
|
|
|
|
- <el-table-column label="创建时间" align="center" prop="createTime" width="150" />
|
|
|
|
|
|
+ <el-table-column label="营期时间" align="center" prop="dayDate" />
|
|
|
|
+ <el-table-column label="开始时间" align="center" prop="startDateTime" width="100">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-tag>{{parseTime(scope.row.startDateTime, '{h}:{i}:{s}')}}</el-tag>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="结束时间" align="center" prop="endDateTime" width="100">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-tag type="success">{{parseTime(scope.row.endDateTime, '{h}:{i}:{s}')}}</el-tag>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
|
|
+ <el-table-column label="领取红包时间" align="center" prop="lastJoinTime" width="100">
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
+ <el-tag type="danger">{{parseTime(scope.row.lastJoinTime, '{h}:{i}:{s}')}}</el-tag>
|
|
|
|
+ </template>
|
|
|
|
+ </el-table-column>
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
<el-button
|
|
<el-button
|
|
@@ -417,6 +506,12 @@
|
|
icon="el-icon-bottom"
|
|
icon="el-icon-bottom"
|
|
@click="handleBottom(scope.row)"
|
|
@click="handleBottom(scope.row)"
|
|
>下移</el-button>
|
|
>下移</el-button>
|
|
|
|
+ <el-button
|
|
|
|
+ size="mini"
|
|
|
|
+ type="text"
|
|
|
|
+ icon="el-icon-edit"
|
|
|
|
+ @click="handleUpdateDate(scope.row)"
|
|
|
|
+ >修改营期时间</el-button>
|
|
</template>
|
|
</template>
|
|
</el-table-column>
|
|
</el-table-column>
|
|
</el-table>
|
|
</el-table>
|
|
@@ -449,7 +544,7 @@
|
|
</template>
|
|
</template>
|
|
|
|
|
|
<script>
|
|
<script>
|
|
-import {addPeriod, delPeriod, exportPeriod, getPeriod, pagePeriod, updatePeriod, getDays, addCourse, updateListCourseData, periodCourseMove} from "@/api/course/userCoursePeriod";
|
|
|
|
|
|
+import {addPeriod, delPeriod, exportPeriod, getPeriod, pagePeriod, updatePeriod, getDays, addCourse, updateCourseTime, updateCourseDate, updateListCourseData, periodCourseMove} from "@/api/course/userCoursePeriod";
|
|
import {getCompanyList} from "@/api/company/company";
|
|
import {getCompanyList} from "@/api/company/company";
|
|
import { listCamp, addCamp, editCamp, delCamp, copyCamp } from "@/api/course/userCourseCamp";
|
|
import { listCamp, addCamp, editCamp, delCamp, copyCamp } from "@/api/course/userCourseCamp";
|
|
import { courseList,videoList } from '@/api/course/courseRedPacketLog'
|
|
import { courseList,videoList } from '@/api/course/courseRedPacketLog'
|
|
@@ -468,6 +563,7 @@ export default {
|
|
return {
|
|
return {
|
|
// 遮罩层
|
|
// 遮罩层
|
|
loading: true,
|
|
loading: true,
|
|
|
|
+ updateDateOpen: false,
|
|
// 左侧遮罩层
|
|
// 左侧遮罩层
|
|
leftLoading: true,
|
|
leftLoading: true,
|
|
// 选中数组
|
|
// 选中数组
|
|
@@ -523,6 +619,12 @@ export default {
|
|
addOpen: false,
|
|
addOpen: false,
|
|
form: {},
|
|
form: {},
|
|
},
|
|
},
|
|
|
|
+ updateCourse: {
|
|
|
|
+ open: false,
|
|
|
|
+ loading: true,
|
|
|
|
+ ids: [],
|
|
|
|
+ form: {},
|
|
|
|
+ },
|
|
// 表单校验
|
|
// 表单校验
|
|
rules: {
|
|
rules: {
|
|
},
|
|
},
|
|
@@ -657,6 +759,9 @@ export default {
|
|
this.selectedPeriods = selection;
|
|
this.selectedPeriods = selection;
|
|
this.batchSetRedPacketDisabled = selection.length === 0;
|
|
this.batchSetRedPacketDisabled = selection.length === 0;
|
|
},
|
|
},
|
|
|
|
+ handleSelectionCourseChange(selection) {
|
|
|
|
+ this.updateCourse.ids = selection.map(item => item.id)
|
|
|
|
+ },
|
|
/** 新增按钮操作 */
|
|
/** 新增按钮操作 */
|
|
handleAdd() {
|
|
handleAdd() {
|
|
this.reset();
|
|
this.reset();
|
|
@@ -1102,6 +1207,13 @@ export default {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ handleUpdateCourse() {
|
|
|
|
+ this.updateCourse.open = true;
|
|
|
|
+ this.updateCourse.form = {
|
|
|
|
+ ids: this.updateCourse.ids,
|
|
|
|
+ joinTime: [],
|
|
|
|
+ };
|
|
|
|
+ },
|
|
closeAddCourse() {
|
|
closeAddCourse() {
|
|
this.course.addOpen = false;
|
|
this.course.addOpen = false;
|
|
this.course.form = {
|
|
this.course.form = {
|
|
@@ -1114,6 +1226,18 @@ export default {
|
|
this.$refs.courseAddForm.resetFields();
|
|
this.$refs.courseAddForm.resetFields();
|
|
}
|
|
}
|
|
},
|
|
},
|
|
|
|
+ closeUpdateCourse() {
|
|
|
|
+ this.course.addOpen = false;
|
|
|
|
+ this.course.form = {
|
|
|
|
+ periodId: null,
|
|
|
|
+ courseId: null,
|
|
|
|
+ videoIds: []
|
|
|
|
+ };
|
|
|
|
+ // 重置表单
|
|
|
|
+ if (this.$refs.courseAddForm) {
|
|
|
|
+ this.$refs.courseAddForm.resetFields();
|
|
|
|
+ }
|
|
|
|
+ },
|
|
courseChange(row){
|
|
courseChange(row){
|
|
this.course.form.videoIds = [];
|
|
this.course.form.videoIds = [];
|
|
videoList(row).then(response => {
|
|
videoList(row).then(response => {
|
|
@@ -1123,6 +1247,10 @@ export default {
|
|
submitCourseForm(){
|
|
submitCourseForm(){
|
|
this.$refs.courseAddForm.validate(valid => {
|
|
this.$refs.courseAddForm.validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
|
|
+ if(this.course.form.timeRange != null && this.course.form.timeRange.length === 2){
|
|
|
|
+ this.course.form.startTime = this.course.form.timeRange[0];
|
|
|
|
+ this.course.form.endTime1 = this.course.form.timeRange[1];
|
|
|
|
+ }
|
|
// 提交数据
|
|
// 提交数据
|
|
addCourse(this.course.form).then(response => {
|
|
addCourse(this.course.form).then(response => {
|
|
this.$message.success('添加成功');
|
|
this.$message.success('添加成功');
|
|
@@ -1133,6 +1261,31 @@ export default {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
},
|
|
},
|
|
|
|
+ submitUpdateCourseForm(){
|
|
|
|
+ this.$refs.courseUpdateForm.validate(valid => {
|
|
|
|
+ if (valid) {
|
|
|
|
+ if(this.updateCourse.form.timeRange != null && this.updateCourse.form.timeRange.length === 2){
|
|
|
|
+ this.updateCourse.form.startTime = this.updateCourse.form.timeRange[0];
|
|
|
|
+ this.updateCourse.form.endTime1 = this.updateCourse.form.timeRange[1];
|
|
|
|
+ }
|
|
|
|
+ // 提交数据
|
|
|
|
+ updateCourseTime(this.updateCourse.form).then(response => {
|
|
|
|
+ this.$message.success('添加成功');
|
|
|
|
+ this.updateCourse.open = false;
|
|
|
|
+ // 重新加载训练营列表
|
|
|
|
+ this.getCourseList();
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ },
|
|
|
|
+ updateDate(){
|
|
|
|
+ updateCourseDate(this.form).then(response => {
|
|
|
|
+ this.$message.success('修改成功');
|
|
|
|
+ this.updateDateOpen = false;
|
|
|
|
+ // 重新加载训练营列表
|
|
|
|
+ this.getCourseList();
|
|
|
|
+ });
|
|
|
|
+ },
|
|
saveCourseData(){
|
|
saveCourseData(){
|
|
updateListCourseData(this.course.list).then(response => {
|
|
updateListCourseData(this.course.list).then(response => {
|
|
this.$message.success('保存成功');
|
|
this.$message.success('保存成功');
|
|
@@ -1234,6 +1387,11 @@ export default {
|
|
};
|
|
};
|
|
return statusMap[row.periodStatus] || '未知状态';
|
|
return statusMap[row.periodStatus] || '未知状态';
|
|
},
|
|
},
|
|
|
|
+ /** 营期状态格式化 */
|
|
|
|
+ handleUpdateDate(row) {
|
|
|
|
+ this.form = {id: row.id, dayDate: row.dayDate};
|
|
|
|
+ this.updateDateOpen = true;
|
|
|
|
+ },
|
|
},
|
|
},
|
|
};
|
|
};
|
|
</script>
|
|
</script>
|