|
@@ -27,10 +27,11 @@
|
|
|
v-permission="'courseSchedule/batchUpdateCourseSchedule'"
|
|
|
@click="adjustment"
|
|
|
>批量调整</div>
|
|
|
- <!-- <div class="newBand"
|
|
|
+
|
|
|
+ <div class="newBand"
|
|
|
v-permission="'courseSchedule/updateCoursesExpireDate'"
|
|
|
- @click="onCourseExpireDate"
|
|
|
- >有效期调整</div> -->
|
|
|
+ @click="expireVisible = true"
|
|
|
+ >有效期调整</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="tableWrap">
|
|
@@ -92,28 +93,24 @@
|
|
|
<div>
|
|
|
<el-button
|
|
|
type="text"
|
|
|
- v-permission="'courseSchedule/classStartDateAdjust'"
|
|
|
- v-show="!scope.row.isSettlement"
|
|
|
+ v-if="!scope.row.isSettlement && permission('courseSchedule/classStartDateAdjust')"
|
|
|
@click="resetClass(scope.row)"
|
|
|
>调整</el-button>
|
|
|
<el-button
|
|
|
type="text"
|
|
|
- v-permission="'accompanys/remove'"
|
|
|
- v-show="!scope.row.isSettlement && scope.row.status == 'NOT_START'"
|
|
|
+ v-if="!scope.row.isSettlement && scope.row.status == 'NOT_START' && permission('accompanys/remove')"
|
|
|
@click="removeClass(scope.row)"
|
|
|
>删除</el-button>
|
|
|
<el-button
|
|
|
- v-permission="'courseSchedule/practiceCourseTeacherAdjust'"
|
|
|
type="text"
|
|
|
- v-show="scope.row.status == 'NOT_START'&&courseType!='TRIAL'"
|
|
|
+ v-if="scope.row.status == 'NOT_START'&&courseType!='TRIAL'&& permission('courseSchedule/practiceCourseTeacherAdjust')"
|
|
|
@click="resetTeacher(scope.row)"
|
|
|
>更换老师</el-button>
|
|
|
- <!-- <el-button v-if="scope.row.status == 'OVER' && !scope.row.settlementTime && permission('teacherAttendance/updateTeacherAttendance', '/teamCourseList')" type="text" @click="onMarkAttendance(scope.row)"
|
|
|
- >补考勤</el-button> -->
|
|
|
+ <el-button v-if="scope.row.status == 'OVER' && scope.row.isSettlement == 0 && permission('teacherAttendance/updateTeacherAttendance', '/accompanys')" type="text" @click="onMarkAttendance(scope.row)"
|
|
|
+ >补考勤</el-button>
|
|
|
<el-button
|
|
|
type="text"
|
|
|
- v-permission="'accompanys/cleanAttendance'"
|
|
|
- v-show="!scope.row.isSettlement"
|
|
|
+ v-if="!scope.row.isSettlement && permission('accompanys/cleanAttendance')"
|
|
|
@click="clearAttend(scope.row)"
|
|
|
>清除考勤</el-button>
|
|
|
</div>
|
|
@@ -128,6 +125,31 @@
|
|
|
@pagination="getList"
|
|
|
/>
|
|
|
</div>
|
|
|
+ <el-dialog title="有效期调整" width="400px" :before-close="expireClose" :visible.sync="expireVisible">
|
|
|
+ <el-form
|
|
|
+ :model="expireForm"
|
|
|
+ ref="expireForm"
|
|
|
+ :rules="expireRules"
|
|
|
+ label-position="right"
|
|
|
+ label-width="80px;"
|
|
|
+ :inline="true">
|
|
|
+ <el-form-item label="课程结束时间" prop="coursesExpireDate">
|
|
|
+ <el-date-picker
|
|
|
+ v-model.trim="expireForm.coursesExpireDate"
|
|
|
+ style="width:200px!important;"
|
|
|
+ type="date"
|
|
|
+ :picker-options="bigin"
|
|
|
+ value-format="yyyy-MM-dd"
|
|
|
+ placeholder="选择日期"
|
|
|
+ ></el-date-picker>
|
|
|
+ </el-form-item >
|
|
|
+ <div style="padding-left: 15px; color: red;">课程结束时间不得早于,{{ expireForm.tempCoursesExpireDate }}</div>
|
|
|
+ </el-form>
|
|
|
+ <div slot="footer" class="dialog-footer">
|
|
|
+ <el-button @click="expireVisible = false">取 消</el-button>
|
|
|
+ <el-button type="primary" @click="submitExpireDate">确 定</el-button>
|
|
|
+ </div>
|
|
|
+ </el-dialog>
|
|
|
<el-dialog title="补考勤" width="400px" :visible.sync="markAttendance.status">
|
|
|
<el-form>
|
|
|
<el-form-item label="签到状态">{{ markAttendance.dataInfo.isSignIn | attendanceType }}</el-form-item>
|
|
@@ -364,6 +386,7 @@
|
|
|
<script>
|
|
|
import pagination from "@/components/Pagination/index";
|
|
|
import { permission } from "@/utils/directivePage";
|
|
|
+import { nextMonthLastDay } from "@/utils/validate";
|
|
|
import {
|
|
|
findPracticeGroupCourseSchedules,
|
|
|
practiceCourseAdjus,
|
|
@@ -377,13 +400,15 @@ import {
|
|
|
batchUpdateCourseSchedule,
|
|
|
findEducationUsers,
|
|
|
updateTeacherAttendance,
|
|
|
- superFindCourseSchedules
|
|
|
+ superFindCourseSchedules,
|
|
|
+ updateCoursesExpireDate
|
|
|
} from "@/api/buildTeam";
|
|
|
import {
|
|
|
vipCourseAdjust,
|
|
|
batchAppendVipGroupCourses,
|
|
|
bathDelete
|
|
|
} from "@/api/vipSeting";
|
|
|
+// import { start } from 'repl';
|
|
|
export default {
|
|
|
components: {
|
|
|
pagination
|
|
@@ -393,6 +418,7 @@ export default {
|
|
|
adjustmentName: "",
|
|
|
isaddCourse: false,
|
|
|
adjustmentVisible: false,
|
|
|
+ expireVisible: false,
|
|
|
isMultiple: true,
|
|
|
name: "网管课程组",
|
|
|
courseVisible: false,
|
|
@@ -428,6 +454,13 @@ export default {
|
|
|
fee: ""
|
|
|
},
|
|
|
startTime: null,
|
|
|
+ expireForm: {
|
|
|
+ coursesExpireDate: null,
|
|
|
+ tempCoursesExpireDate: null
|
|
|
+ },
|
|
|
+ expireRules: {
|
|
|
+ coursesExpireDate: [{ required: true, message: "请选择课程结束时间", trigger: "blur" }]
|
|
|
+ },
|
|
|
maskRules: {
|
|
|
date: [{ required: true, message: "请选择上课时间", trigger: "blur" }],
|
|
|
// startTime: [{ required: true, message: '请选择上课开始时间', trigger: 'blur' },],
|
|
@@ -479,12 +512,12 @@ export default {
|
|
|
activeList: [],
|
|
|
educationList: [],
|
|
|
timers: null,
|
|
|
- courseExpireDate: null, // 结束时间
|
|
|
markAttendance: {
|
|
|
// 考勤状态
|
|
|
status: false,
|
|
|
dataInfo: {}
|
|
|
},
|
|
|
+ bigin: this.beginDate()
|
|
|
};
|
|
|
},
|
|
|
mounted() {
|
|
@@ -540,7 +573,18 @@ export default {
|
|
|
this.courseData[0].coursesStartDate.substring(0, 10) +
|
|
|
"至" +
|
|
|
this.courseData[0].coursesExpireDate.substring(0, 10);
|
|
|
- this.courseExpireDate = this.courseData[0].coursesExpireDate.substring(0, 10);
|
|
|
+ this.expireForm.coursesExpireDate = this.courseData[0].coursesExpireDate.substring(0, 10);
|
|
|
+ let originalStartDate = this.courseData[0].coursesStartDate ? new Date(this.courseData[0].coursesStartDate) : new Date()
|
|
|
+ let buyMonths = this.courseData[0].buyMonths
|
|
|
+ let lastDayNum = nextMonthLastDay(originalStartDate.getFullYear(), (originalStartDate.getMonth() + buyMonths + 1))
|
|
|
+ if(lastDayNum[2] >= originalStartDate.getDate()) {
|
|
|
+ originalStartDate.setMonth(originalStartDate.getMonth() + buyMonths)
|
|
|
+ } else {
|
|
|
+ originalStartDate = new Date(lastDayNum.join('-'))
|
|
|
+ }
|
|
|
+ // originalStartDate.setDate(originalStartDate.getDate() - 1)
|
|
|
+ let overTime = originalStartDate.getFullYear() + '-' + (originalStartDate.getMonth() + 1) + '-' + originalStartDate.getDate()
|
|
|
+ this.expireForm.tempCoursesExpireDate = overTime
|
|
|
}
|
|
|
}
|
|
|
});
|
|
@@ -548,6 +592,40 @@ export default {
|
|
|
permission(str, parent) {
|
|
|
return permission(str, parent);
|
|
|
},
|
|
|
+ beginDate () {
|
|
|
+ let self = this
|
|
|
+ return {
|
|
|
+ disabledDate (time) {
|
|
|
+ if (self.expireForm.tempCoursesExpireDate) {
|
|
|
+ return new Date(self.expireForm.tempCoursesExpireDate).getTime() > time.getTime()
|
|
|
+ } else {
|
|
|
+ return time.getTime() >= Date.now()
|
|
|
+ //开始时间不选时,结束时间最大值小于等于当天
|
|
|
+ }
|
|
|
+ }
|
|
|
+ }
|
|
|
+ },
|
|
|
+ submitExpireDate() {
|
|
|
+ this.$refs.expireForm.validate(some => {
|
|
|
+ if (some) {
|
|
|
+ updateCoursesExpireDate({
|
|
|
+ practiceGroupId: this.practiceId,
|
|
|
+ coursesExpireDate: this.expireForm.coursesExpireDate
|
|
|
+ }).then(res => {
|
|
|
+ if (res.code == 200) {
|
|
|
+ this.$message.success("有效期修改成功")
|
|
|
+ this.expireVisible = false
|
|
|
+ this.getCourseGroup()
|
|
|
+ } else {
|
|
|
+ this.$message.error(res.msg)
|
|
|
+ }
|
|
|
+ })
|
|
|
+ } else {
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ },
|
|
|
onMarkAttendance(item) {
|
|
|
// 补考勤
|
|
|
this.markAttendance = {
|
|
@@ -604,6 +682,13 @@ export default {
|
|
|
};
|
|
|
this.$refs["maskForm"].resetFields();
|
|
|
},
|
|
|
+ expireClose() {
|
|
|
+ this.expireVisible = false;
|
|
|
+ this.expireForm = {
|
|
|
+ coursesExpireDate: null
|
|
|
+ };
|
|
|
+ this.$refs["expireForm"].resetFields();
|
|
|
+ },
|
|
|
submitResetClass() {
|
|
|
// endClassTimeStr: this.maskForm.endTime,
|
|
|
if (!this.startTime) {
|