|
@@ -0,0 +1,247 @@
|
|
|
+<template>
|
|
|
+ <div class="m-container">
|
|
|
+ <h2>
|
|
|
+ <el-page-header @back="goBack" content="陪练课程组"></el-page-header>
|
|
|
+ </h2>
|
|
|
+ <!-- v-permission="'vipGroupManage/updateVipBaseInfo'" -->
|
|
|
+ <!-- <div
|
|
|
+ class="newBand"
|
|
|
+
|
|
|
+ @click="addrVisible = true"
|
|
|
+ >修改老师</div> -->
|
|
|
+ <div class="tableWrap">
|
|
|
+ <el-table :data="tableList" :header-cell-style="{background:'#EDEEF0',color:'#444'}">
|
|
|
+ <!-- @selection-change="handleSelectionChange" -->
|
|
|
+ <!-- <el-table-column type="selection" :selectable="isDisabled" width="55"></el-table-column> -->
|
|
|
+ <el-table-column label="课程编号" align="center" prop="id"></el-table-column>
|
|
|
+ <el-table-column label="课程名称" align="center" prop="name"></el-table-column>
|
|
|
+ <!-- <el-table-column label="班级id"
|
|
|
+ align="center"
|
|
|
+ prop="classGroupId">
|
|
|
+ </el-table-column>-->
|
|
|
+ <el-table-column label="上课日期" align="center" prop="classDate">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>{{ scope.row.classDate | formatTimer}}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <!-- <el-table-column label="课程状态" align="center" prop="status">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>{{ scope.row.status | coursesStatus }}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>-->
|
|
|
+ <el-table-column label="结算状态" align="center">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>{{scope.row.isSettlement?'已结算':'未结算'}}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column label="开始时间" align="center" prop="startClassTimeStr"></el-table-column>
|
|
|
+ <el-table-column label="结束时间" align="center" prop="endClassTimeStr"></el-table-column>
|
|
|
+ <!-- <el-table-column label="教学点" align="center" prop="schoolName">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>{{scope.row.schoolName?scope.row.schoolName:'网络教室'}}</div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>-->
|
|
|
+ <el-table-column label="操作">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <div>
|
|
|
+ <el-button
|
|
|
+ type="text"
|
|
|
+ v-permission="'courseSchedule/classStartDateAdjust'"
|
|
|
+ v-if="!scope.row.isSettlement"
|
|
|
+ @click="resetClass(scope.row)"
|
|
|
+ >调整</el-button>
|
|
|
+ </div>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
+ </el-table>
|
|
|
+ <pagination
|
|
|
+ :total="rules.total"
|
|
|
+ :page.sync="rules.page"
|
|
|
+ :limit.sync="rules.limit"
|
|
|
+ :page-sizes="rules.page_size"
|
|
|
+ @pagination="getList"
|
|
|
+ />
|
|
|
+ </div>
|
|
|
+ <el-dialog title="课程调整" width="400px" :before-close="handleClose" :visible.sync="courseVisible">
|
|
|
+ <el-form
|
|
|
+ :model="maskForm"
|
|
|
+ ref="maskForm"
|
|
|
+ :rules="maskRules"
|
|
|
+ label-position="right"
|
|
|
+ label-width="80px;"
|
|
|
+ :inline="true"
|
|
|
+ >
|
|
|
+ <el-form-item label="上课日期" prop="date">
|
|
|
+ <el-date-picker
|
|
|
+ v-model="maskForm.date"
|
|
|
+ style="width:200px!important;"
|
|
|
+ type="date"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="选择日期"
|
|
|
+ ></el-date-picker>
|
|
|
+ </el-form-item>
|
|
|
+ <el-form-item label="开始时间" prop="startTime">
|
|
|
+ <el-time-select
|
|
|
+ placeholder="起始时间"
|
|
|
+ style="width:200px!important;"
|
|
|
+ v-model="startTime"
|
|
|
+ :picker-options="{
|
|
|
+ start: '07:00',
|
|
|
+ step: '00:30',
|
|
|
+ end: '21:00'
|
|
|
+ }"
|
|
|
+ ></el-time-select>
|
|
|
+ </el-form-item>
|
|
|
+ <!-- <el-form-item label="结束时间"
|
|
|
+ prop="endTime">
|
|
|
+ <el-time-select placeholder="结束时间"
|
|
|
+ v-model="maskForm.endTime"
|
|
|
+ :picker-options="{
|
|
|
+ start: '04:30',
|
|
|
+ step: '00:05',
|
|
|
+ end: '23:30',
|
|
|
+ minTime: maskForm.startTime
|
|
|
+ }">
|
|
|
+ </el-time-select>
|
|
|
+ </el-form-item> v-if="maskForm.teachMode=='OFFLINE'"-->
|
|
|
+ <!-- <el-form-item label="课程类型" prop="courseType">
|
|
|
+ <el-select clearable v-model="maskForm.teachMode">
|
|
|
+ <el-option label="线上课" value="ONLINE"></el-option>
|
|
|
+ <el-option label="线下课" value="OFFLINE"></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>-->
|
|
|
+ <!-- <el-form-item label="教学地点" v-if="maskForm.teachMode == 'OFFLINE'">
|
|
|
+ <el-select v-model="maskForm.address" filterable clearable>
|
|
|
+ <el-option
|
|
|
+ v-for="(item,index) in schoolList"
|
|
|
+ :key="index"
|
|
|
+ :value="item.id"
|
|
|
+ :label="item.name"
|
|
|
+ ></el-option>
|
|
|
+ </el-select>
|
|
|
+ </el-form-item>-->
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="courseVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitResetClass">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
+ </div>
|
|
|
+</template>
|
|
|
+<script>
|
|
|
+import pagination from "@/components/Pagination/index";
|
|
|
+import { findPracticeGroupCourseSchedules,practiceCourseAdjus } from "@/api/buildTeam";
|
|
|
+export default {
|
|
|
+ components: {
|
|
|
+ pagination
|
|
|
+ },
|
|
|
+ data() {
|
|
|
+ return {
|
|
|
+ courseVisible: false,
|
|
|
+ Frules: null,
|
|
|
+ FsearchForm: null,
|
|
|
+ rules: {
|
|
|
+ // 分页规则
|
|
|
+ limit: 20, // 限制显示条数
|
|
|
+ page: 1, // 当前页
|
|
|
+ total: 0, // 总条数
|
|
|
+ page_size: [10, 20, 50, 100] // 选择限制显示条数
|
|
|
+ },
|
|
|
+ tableList: [],
|
|
|
+ practiceId: null,
|
|
|
+ maskForm: {
|
|
|
+ date: "",
|
|
|
+ startTime: "",
|
|
|
+ id: ""
|
|
|
+ },
|
|
|
+ startTime:null,
|
|
|
+ maskRules: {
|
|
|
+ date: [{ required: true, message: "请选择上课时间", trigger: "blur" }],
|
|
|
+ // startTime: [{ required: true, message: '请选择上课开始时间', trigger: 'blur' },],
|
|
|
+ endTime: [
|
|
|
+ { required: true, message: "请选择上课结束时间", trigger: "blur" }
|
|
|
+ ]
|
|
|
+ }
|
|
|
+ };
|
|
|
+ },
|
|
|
+ created() {
|
|
|
+ this.init();
|
|
|
+ },
|
|
|
+ activated() {
|
|
|
+ this.init();
|
|
|
+ },
|
|
|
+ methods: {
|
|
|
+ init() {
|
|
|
+ this.practiceId = this.$route.query.id;
|
|
|
+ if (this.$route.query.rules) {
|
|
|
+ this.Frules = this.$route.query.rules;
|
|
|
+ }
|
|
|
+ if (this.$route.query.searchForm) {
|
|
|
+ this.FsearchForm = this.$route.query.searchForm;
|
|
|
+ }
|
|
|
+ // console.log(this.practiceId)
|
|
|
+ this.getList()
|
|
|
+ },
|
|
|
+ getList() {
|
|
|
+ findPracticeGroupCourseSchedules({ practiceId: this.practiceId }).then(
|
|
|
+ res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.tableList = res.data.pageInfo.rows;
|
|
|
+ this.rules.total = res.data.pageInfo.total;
|
|
|
+ }
|
|
|
+ }
|
|
|
+ );
|
|
|
+ },
|
|
|
+ goBack() {
|
|
|
+ this.$router.push({
|
|
|
+ path: "/business/accompanyList",
|
|
|
+ query: { rules: this.Frules, searchForm: this.FsearchForm }
|
|
|
+ });
|
|
|
+ },
|
|
|
+ handleClose() {
|
|
|
+ this.courseVisible = false;
|
|
|
+ this.startTime = "";
|
|
|
+ this.maskForm = {
|
|
|
+ date: "",
|
|
|
+ startTime: "",
|
|
|
+ id: ""
|
|
|
+ };
|
|
|
+ this.$refs["maskForm"].resetFields();
|
|
|
+ },
|
|
|
+ submitResetClass() {
|
|
|
+ // endClassTimeStr: this.maskForm.endTime,
|
|
|
+ if (!this.startTime) {
|
|
|
+ this.$message.error("请填写修改时间");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ let obj = {
|
|
|
+ startClassTimeStr: this.startTime,
|
|
|
+ id: this.maskForm.id,
|
|
|
+ classDate: this.maskForm.date,
|
|
|
+
|
|
|
+ };
|
|
|
+ practiceCourseAdjus(obj).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message.success("修改成功");
|
|
|
+ this.courseVisible = false;
|
|
|
+ this.getList();
|
|
|
+ } //else {
|
|
|
+ // this.$message.error(res.msg)
|
|
|
+ // }
|
|
|
+ });
|
|
|
+ }, resetClass(row) {
|
|
|
+ /**
|
|
|
+ * maskForm.startTime
|
|
|
+ *
|
|
|
+ */
|
|
|
+
|
|
|
+ this.maskForm.date = row.classDate;
|
|
|
+ this.startTime = row.startClassTimeStr;
|
|
|
+ // this.maskForm.endTime = row.endClassTimeStr;
|
|
|
+ this.maskForm.id = row.id;
|
|
|
+ // 修改课时
|
|
|
+ this.courseVisible = true;
|
|
|
+ },
|
|
|
+ }
|
|
|
+};
|
|
|
+</script>
|