|
@@ -219,7 +219,7 @@
|
|
|
|
|
|
<!-- 添加或修改会员营期对话框-->
|
|
<!-- 添加或修改会员营期对话框-->
|
|
<el-drawer :title="title" :visible.sync="open" width="700px" append-to-body>
|
|
<el-drawer :title="title" :visible.sync="open" width="700px" append-to-body>
|
|
- <el-form ref="form" :model="form" :rules="rules" label-width="80px">
|
|
|
|
|
|
+ <el-form ref="form" :model="form" :rules="rules" label-width="80px" style="padding-bottom: 55px">
|
|
<el-form-item label="营期名称" prop="periodName">
|
|
<el-form-item label="营期名称" prop="periodName">
|
|
<el-input v-model="form.periodName" placeholder="请输入营期名称" />
|
|
<el-input v-model="form.periodName" placeholder="请输入营期名称" />
|
|
</el-form-item>
|
|
</el-form-item>
|
|
@@ -272,24 +272,27 @@
|
|
</el-date-picker>
|
|
</el-date-picker>
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
|
|
|
-<!-- <div v-if="form.periodType == 1">-->
|
|
|
|
-<!-- <el-form-item label="开课时间" prop="periodType">-->
|
|
|
|
-<!-- <el-radio-group v-model="form.periodType">-->
|
|
|
|
-<!-- <el-radio :label="1" >多课程</el-radio>-->
|
|
|
|
-<!-- <el-radio :label="2" >单课程</el-radio>-->
|
|
|
|
-<!-- </el-radio-group>-->
|
|
|
|
-<!-- </el-form-item>-->
|
|
|
|
-<!-- <el-form-item :label="'第' + item.lesson + '节'" prop="periodStartingTime" v-for="item in form.days">-->
|
|
|
|
-<!-- <el-date-picker-->
|
|
|
|
-<!-- v-model="item.dateRange"-->
|
|
|
|
-<!-- type="datetimerange"-->
|
|
|
|
-<!-- range-separator="至"-->
|
|
|
|
-<!-- start-placeholder="开始日期"-->
|
|
|
|
-<!-- end-placeholder="结束日期"-->
|
|
|
|
-<!-- value-format="yyyy-MM-dd HH:mm:ss">-->
|
|
|
|
-<!-- </el-date-picker>-->
|
|
|
|
-<!-- </el-form-item>-->
|
|
|
|
-<!-- </div>-->
|
|
|
|
|
|
+ <el-form-item label="看课时间" prop="timeRange">
|
|
|
|
+ <el-time-picker
|
|
|
|
+ is-range
|
|
|
|
+ v-model="form.timeRange"
|
|
|
|
+ @input="$forceUpdate()"
|
|
|
|
+ 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="form.lastJoinTime"
|
|
|
|
+ :selectableRange="form.lastJoinTime"
|
|
|
|
+ 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 class="drawer-footer">
|
|
<div class="drawer-footer">
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
<el-button type="primary" @click="submitForm">确 定</el-button>
|
|
@@ -336,7 +339,7 @@
|
|
<!-- </div>-->
|
|
<!-- </div>-->
|
|
<!-- </el-dialog>-->
|
|
<!-- </el-dialog>-->
|
|
|
|
|
|
- <!-- 添加或修改会员营期对话框-->
|
|
|
|
|
|
+ <!-- 添加课程对话框-->
|
|
<el-dialog title="添加课程" :visible.sync="course.addOpen" width="500px" append-to-body>
|
|
<el-dialog title="添加课程" :visible.sync="course.addOpen" width="500px" append-to-body>
|
|
<el-form ref="courseAddForm" :model="course.form" label-width="100px">
|
|
<el-form ref="courseAddForm" :model="course.form" label-width="100px">
|
|
<el-form-item label="课程" prop="courseId">
|
|
<el-form-item label="课程" prop="courseId">
|
|
@@ -774,6 +777,13 @@ export default {
|
|
const periodId = row.periodId || this.ids
|
|
const periodId = row.periodId || this.ids
|
|
getPeriod(periodId).then(response => {
|
|
getPeriod(periodId).then(response => {
|
|
this.form = response.data;
|
|
this.form = response.data;
|
|
|
|
+ if (this.form.companyId) {
|
|
|
|
+ this.form.companyId = this.form.companyId.split(',').map(id => Number(id));
|
|
|
|
+ }
|
|
|
|
+ // 设置看课时间范围(回显)
|
|
|
|
+ if (this.form.viewStartTime && this.form.viewEndTime) {
|
|
|
|
+ this.form.timeRange = [this.form.viewStartTime, this.form.viewEndTime];
|
|
|
|
+ }
|
|
if(this.form.periodType == 1){
|
|
if(this.form.periodType == 1){
|
|
this.form.dateRange = [this.form.periodStartingTime, this.form.periodEndTime];
|
|
this.form.dateRange = [this.form.periodStartingTime, this.form.periodEndTime];
|
|
}
|
|
}
|
|
@@ -789,6 +799,11 @@ export default {
|
|
this.$refs["form"].validate(valid => {
|
|
this.$refs["form"].validate(valid => {
|
|
if (valid) {
|
|
if (valid) {
|
|
let data = JSON.parse(JSON.stringify(this.form));
|
|
let data = JSON.parse(JSON.stringify(this.form));
|
|
|
|
+ // 处理看课时间范围
|
|
|
|
+ if (data.timeRange && data.timeRange.length === 2) {
|
|
|
|
+ data.viewStartTime = data.timeRange[0];
|
|
|
|
+ data.viewEndTime = data.timeRange[1];
|
|
|
|
+ }
|
|
data.companyId = data.companyId.join()
|
|
data.companyId = data.companyId.join()
|
|
data.trainingCampId = this.queryParams.trainingCampId
|
|
data.trainingCampId = this.queryParams.trainingCampId
|
|
if (data.periodId != null) {
|
|
if (data.periodId != null) {
|
|
@@ -813,8 +828,14 @@ export default {
|
|
},
|
|
},
|
|
/** 删除按钮操作 */
|
|
/** 删除按钮操作 */
|
|
handleDelete(row) {
|
|
handleDelete(row) {
|
|
|
|
+ //添加删除判断,只能删除未开始的营期
|
|
|
|
+ console.log(row.periodStatus)
|
|
|
|
+ if(row.periodStatus !== 1){
|
|
|
|
+ this.$message.error('营期处于进行中或者结束,不能删除');
|
|
|
|
+ return;
|
|
|
|
+ }
|
|
const periodIds = row.periodId || this.ids;
|
|
const periodIds = row.periodId || this.ids;
|
|
- this.$confirm('是否确认删除会员营期编号为"' + periodIds + '"的数据项?', "警告", {
|
|
|
|
|
|
+ this.$confirm('是否确认删除该营期?', "警告", {
|
|
confirmButtonText: "确定",
|
|
confirmButtonText: "确定",
|
|
cancelButtonText: "取消",
|
|
cancelButtonText: "取消",
|
|
type: "warning"
|
|
type: "warning"
|
|
@@ -893,7 +914,11 @@ export default {
|
|
dateRange: [],
|
|
dateRange: [],
|
|
date: null,
|
|
date: null,
|
|
days: [],
|
|
days: [],
|
|
- periodEndTime: null
|
|
|
|
|
|
+ periodEndTime: null,
|
|
|
|
+ timeRange: [], // 看课时间范围
|
|
|
|
+ viewStartTime: null, // 看课开始时间
|
|
|
|
+ viewEndTime: null, // 看课结束时间
|
|
|
|
+ lastJoinTime: null // 领取红包时间
|
|
};
|
|
};
|
|
this.resetForm("form");
|
|
this.resetForm("form");
|
|
},
|
|
},
|
|
@@ -1387,6 +1412,15 @@ export default {
|
|
};
|
|
};
|
|
return statusMap[row.periodStatus] || '未知状态';
|
|
return statusMap[row.periodStatus] || '未知状态';
|
|
},
|
|
},
|
|
|
|
+ /** 开课状态格式化 */
|
|
|
|
+ courseStatusFormatter(row) {
|
|
|
|
+ const statusMap = {
|
|
|
|
+ 0: '未开始',
|
|
|
|
+ 1: '进行中',
|
|
|
|
+ 2: '已结束'
|
|
|
|
+ };
|
|
|
|
+ return statusMap[row.status] || '未知状态';
|
|
|
|
+ },
|
|
/** 营期状态格式化 */
|
|
/** 营期状态格式化 */
|
|
handleUpdateDate(row) {
|
|
handleUpdateDate(row) {
|
|
this.form = {id: row.id, dayDate: row.dayDate};
|
|
this.form = {id: row.id, dayDate: row.dayDate};
|