|
|
@@ -43,6 +43,12 @@
|
|
|
:formatter="periodStatusFormatter"/>
|
|
|
<el-table-column label="开营开始时间" align="center" prop="periodStartingTime" width="180"/>
|
|
|
<el-table-column label="开营结束时间" align="center" prop="periodEndTime" width="180"/>
|
|
|
+ <el-table-column label="看课休息开关" align="center" prop="isOpenRestReminder">
|
|
|
+ <template slot-scope="scope">
|
|
|
+ <el-tag v-if="scope.row.isOpenRestReminder==1" type="success">开启</el-tag>
|
|
|
+ <el-tag v-if="scope.row.isOpenRestReminder==0" type="success">关闭</el-tag>
|
|
|
+ </template>
|
|
|
+ </el-table-column>
|
|
|
<el-table-column label="创建时间" align="center" prop="createTime" width="180"/>
|
|
|
<el-table-column label="操作" align="center" class-name="small-padding fixed-width">
|
|
|
<template slot-scope="scope">
|
|
|
@@ -78,6 +84,22 @@
|
|
|
@click="handlePeriodUser(scope.row, '0')"
|
|
|
>关闭单独注册会员
|
|
|
</el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="scope.row.isOpenRestReminder === undefined || scope.row.isOpenRestReminder===1 "
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-open"
|
|
|
+ @click="handlePeriodUserOpenReminder(scope.row, '0')"
|
|
|
+ >关闭看课休息
|
|
|
+ </el-button>
|
|
|
+ <el-button
|
|
|
+ v-if="scope.row.isOpenRestReminder === 0"
|
|
|
+ size="mini"
|
|
|
+ type="text"
|
|
|
+ icon="el-icon-open"
|
|
|
+ @click="handlePeriodUserOpenReminder(scope.row, '1')"
|
|
|
+ >打开看课休息
|
|
|
+ </el-button>
|
|
|
<!-- <el-button-->
|
|
|
<!-- v-else-->
|
|
|
<!-- size="mini"-->
|
|
|
@@ -301,6 +323,7 @@ import {
|
|
|
pagePeriod,
|
|
|
updatePeriod,
|
|
|
updatePeriodIsNeedRegisterMember,
|
|
|
+ updatePeriodIsOpenRestReminder,
|
|
|
getDays,
|
|
|
addCourse,
|
|
|
updateCourseTime,
|
|
|
@@ -580,6 +603,33 @@ export default {
|
|
|
this.$message.info('已取消操作');
|
|
|
});
|
|
|
},
|
|
|
+ /** 处理单独注册会员开关 */
|
|
|
+ handlePeriodUserOpenReminder(data, open) {
|
|
|
+ const actionText = open === '0' ? '开启' : '关闭';
|
|
|
+ this.$confirm(`确定要${actionText}【${data.periodName}】的看课休息暂停功能吗?`, '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ var data1 = {
|
|
|
+ periodId:data.periodId,
|
|
|
+ isOpenRestReminder:open,
|
|
|
+ }
|
|
|
+ updatePeriodIsOpenRestReminder(data1).then(response => {
|
|
|
+ if (response.code === 200) {
|
|
|
+ this.msgSuccess(`${actionText}成功`);
|
|
|
+ this.getList();
|
|
|
+ } else {
|
|
|
+ this.msgError(response.msg || `${actionText}失败`);
|
|
|
+ }
|
|
|
+ }).catch(error => {
|
|
|
+ console.error(`${actionText}单独注册会员失败:`, error);
|
|
|
+ this.msgError(`${actionText}失败`);
|
|
|
+ });
|
|
|
+ }).catch(() => {
|
|
|
+ this.$message.info('已取消操作');
|
|
|
+ });
|
|
|
+ },
|
|
|
/** 提交按钮 */
|
|
|
submitForm() {
|
|
|
this.$refs["form"].validate(valid => {
|