|
|
@@ -67,14 +67,14 @@
|
|
|
sortable
|
|
|
>
|
|
|
</el-table-column>
|
|
|
-<!-- <el-table-column-->
|
|
|
-<!-- prop="Recovered"-->
|
|
|
-<!-- label="课程会员人数"-->
|
|
|
-<!-- sortable-->
|
|
|
-<!-- >-->
|
|
|
-<!-- </el-table-column>-->
|
|
|
+ <!-- <el-table-column-->
|
|
|
+ <!-- prop="Recovered"-->
|
|
|
+ <!-- label="课程会员人数"-->
|
|
|
+ <!-- sortable-->
|
|
|
+ <!-- >-->
|
|
|
+ <!-- </el-table-column>-->
|
|
|
<el-table-column
|
|
|
- prop="WxVisible"
|
|
|
+ prop="wxVisible"
|
|
|
label="微信可见"
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
@@ -147,19 +147,19 @@
|
|
|
<div class="pull-left">
|
|
|
<el-form ref="form" :model="form" label-width="160px">
|
|
|
<el-form-item label="课程名称">
|
|
|
- <el-input v-model="form.className"></el-input>
|
|
|
+ <el-input v-model="form.ClassName"></el-input>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="消耗课时">
|
|
|
- <el-input-number v-model="form.consumeHour" :min="0" :max="99999"
|
|
|
+ <el-input-number v-model="form.ConsumeHour" :min="0" :max="99999"
|
|
|
label="(天)"></el-input-number>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="建议上课人数">
|
|
|
- <el-input-number v-model="form.topLimit" :min="0" :max="99999"
|
|
|
+ <el-input-number v-model="form.TopLimit" :min="0" :max="99999"
|
|
|
label="(天)"></el-input-number>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="微信可见">
|
|
|
<el-switch
|
|
|
- v-model="form.wxvisible"
|
|
|
+ v-model="form.wxVisible"
|
|
|
active-value="1"
|
|
|
inactive-value="0"
|
|
|
active-color="#409EFF"
|
|
|
@@ -185,10 +185,10 @@
|
|
|
</el-switch>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="课程颜色">
|
|
|
- <el-color-picker v-model="form.classColor"></el-color-picker>
|
|
|
+ <el-color-picker v-model="form.ClassColor"></el-color-picker>
|
|
|
</el-form-item>
|
|
|
<el-form-item label="备注">
|
|
|
- <el-input v-model="form.memo"></el-input>
|
|
|
+ <el-input v-model="form.Memo"></el-input>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
</div>
|
|
|
@@ -201,7 +201,9 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="dialogFooter">
|
|
|
- <el-button type="primary" size="small" @click="confirmAddLesson">确定</el-button>
|
|
|
+ <el-button type="primary" size="small" v-if="form.btnType == 0" @click="confirmAddLesson">确定</el-button>
|
|
|
+ <el-button type="primary" size="small" v-if="form.btnType == 1" @click="confirmEditLesson">确定
|
|
|
+ </el-button>
|
|
|
<el-button size="small" @click="dialogLesson = false">取消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
@@ -282,15 +284,16 @@
|
|
|
time1: globalBt(),
|
|
|
},
|
|
|
form: {
|
|
|
- className: "",
|
|
|
- consumeHour: 0,
|
|
|
- topLimit: 0,
|
|
|
- wxvisible: 1,
|
|
|
+ ClassName: "",
|
|
|
+ ConsumeHour: 0,
|
|
|
+ TopLimit: 0,
|
|
|
+ wxVisible: 1,
|
|
|
classType: 1,
|
|
|
- classColor: "#ffffff",
|
|
|
+ ClassColor: "#ffffff",
|
|
|
teacherId: "",
|
|
|
+ classId: "",
|
|
|
allUse: "",
|
|
|
- memo: "",
|
|
|
+ Memo: "",
|
|
|
dialogdata: [],//穿梭待选
|
|
|
dialogValue: [],//穿梭已选
|
|
|
},
|
|
|
@@ -314,33 +317,33 @@
|
|
|
let that = this;
|
|
|
|
|
|
// checkNum
|
|
|
- if (!that.form.className) {
|
|
|
+ if (!that.form.ClassName) {
|
|
|
this.$message.error('错了哦,课程名称不能为空');
|
|
|
return false
|
|
|
}
|
|
|
- if (that.form.className.length > 20) {
|
|
|
+ if (that.form.ClassName.length > 20) {
|
|
|
this.$message.error('错了哦,课程名称字数超过20个字');
|
|
|
return false
|
|
|
}
|
|
|
- if (that.form.memo) {
|
|
|
- if (that.form.memo.length > 200) {
|
|
|
+ if (that.form.Memo) {
|
|
|
+ if (that.form.Memo.length > 200) {
|
|
|
this.$message.error('错了哦,备注字数超过200个字');
|
|
|
return false
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- let teacherId = that.form.dialogValue.toString();
|
|
|
+ let teacherId = that.form.dialogValue.toString();
|
|
|
let param = {
|
|
|
token: localStorage.token,
|
|
|
shopId: localStorage.shopId,
|
|
|
- className: that.form.className,
|
|
|
- consumeHour: that.form.consumeHour,
|
|
|
- topLimit: that.form.topLimit,
|
|
|
+ ClassName: that.form.ClassName,
|
|
|
+ ConsumeHour: that.form.ConsumeHour,
|
|
|
+ TopLimit: that.form.TopLimit,
|
|
|
classType: that.form.classType,
|
|
|
- wxVisible: that.form.wxvisible,
|
|
|
- classColor: that.form.classColor,
|
|
|
- teacherId:teacherId,
|
|
|
- memo: that.form.memo,
|
|
|
+ wxVisible: that.form.wxVisible,
|
|
|
+ ClassColor: that.form.ClassColor,
|
|
|
+ teacherId: teacherId,
|
|
|
+ Memo: that.form.Memo,
|
|
|
};
|
|
|
let postdata = qs.stringify(param);
|
|
|
ClassAdd(postdata).then(res => {
|
|
|
@@ -360,17 +363,71 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ confirmEditLesson() {
|
|
|
+ let that = this;
|
|
|
+
|
|
|
+ // checkNum
|
|
|
+ if (!that.form.ClassName) {
|
|
|
+ this.$message.error('错了哦,课程名称不能为空');
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (that.form.ClassName.length > 20) {
|
|
|
+ this.$message.error('错了哦,课程名称字数超过20个字');
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ if (that.form.Memo) {
|
|
|
+ if (that.form.Memo.length > 200) {
|
|
|
+ this.$message.error('错了哦,备注字数超过200个字');
|
|
|
+ return false
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ let teacherId = that.form.dialogValue ? that.form.dialogValue.toString() :'';
|
|
|
+ let param = {
|
|
|
+ token: localStorage.token,
|
|
|
+ shopId: localStorage.shopId,
|
|
|
+ classId: that.form.classId,
|
|
|
+ className: that.form.ClassName,
|
|
|
+ consumeHour: that.form.ConsumeHour,
|
|
|
+ topLimit: that.form.TopLimit,
|
|
|
+ classType: that.form.classType,
|
|
|
+ wxVisible: that.form.wxVisible,
|
|
|
+ classColor: that.form.ClassColor,
|
|
|
+ teacherId: teacherId,
|
|
|
+ memo: that.form.Memo,
|
|
|
+ };
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+ ClassEdit(postdata).then(res => {
|
|
|
+ let json = res;
|
|
|
+ if (json.Code == 0) {
|
|
|
+ // 关闭弹窗
|
|
|
+ that.dialogLesson = false;
|
|
|
+ // 重载列表
|
|
|
+ that.getTableQuery();
|
|
|
+ that.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '会员课程调整成功!',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ that.$message.error(json.Memo);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 新增课程
|
|
|
addLesson() {
|
|
|
+ this.form.btnType = 0; //新增
|
|
|
// clear
|
|
|
- this.form.className = '';
|
|
|
- this.form.consumeHour = 0;
|
|
|
- this.form.topLimit = 0;
|
|
|
- this.form.wxvisible = 1;
|
|
|
- this.form.classColor = "#ffffff";
|
|
|
- this.form.memo = "";
|
|
|
+ this.form.ClassName = '';
|
|
|
+ this.form.ConsumeHour = 0;
|
|
|
+ this.form.TopLimit = 0;
|
|
|
+ this.form.wxVisible = 1;
|
|
|
+ this.form.ClassColor = "#ffffff";
|
|
|
+ this.form.Memo = "";
|
|
|
this.form.dialogValue = [];
|
|
|
this.dialogLesson = true;
|
|
|
+
|
|
|
+
|
|
|
},
|
|
|
// 改色
|
|
|
changeColor(c, row) {
|
|
|
@@ -521,27 +578,28 @@
|
|
|
},
|
|
|
clearForm() {
|
|
|
// clear
|
|
|
- this.form.className = '';
|
|
|
- this.form.consumeHour = 0;
|
|
|
- this.form.topLimit = 0;
|
|
|
- this.form.wxvisible = 1;
|
|
|
- this.form.classColor = '';
|
|
|
- this.form.memo = '';
|
|
|
+ this.form.ClassName = '';
|
|
|
+ this.form.ConsumeHour = 0;
|
|
|
+ this.form.TopLimit = 0;
|
|
|
+ this.form.wxVisible = 1;
|
|
|
+ this.form.ClassColor = '';
|
|
|
+ this.form.Memo = '';
|
|
|
},
|
|
|
// 编辑
|
|
|
editLesson(row) {
|
|
|
let that = this;
|
|
|
this.clearForm();
|
|
|
-
|
|
|
- this.form.className = row.name;
|
|
|
- this.form.consumeHour = row.Recovered;
|
|
|
- this.form.topLimit = row.Recovered;
|
|
|
- this.form.wxvisible = row.wxVisible;
|
|
|
- this.form.classColor = row.color;
|
|
|
- this.form.memo = row.memo;
|
|
|
- this.form.dialogValue = row.dialogValue;
|
|
|
this.form.btnType = 1; //编辑
|
|
|
|
|
|
+ this.form.ClassName = row.ClassName;
|
|
|
+ this.form.ConsumeHour = row.ConsumeHour;
|
|
|
+ this.form.TopLimit = row.TopLimit;
|
|
|
+ this.form.wxVisible = row.wxVisible;
|
|
|
+ this.form.ClassColor = row.ClassColor;
|
|
|
+ this.form.Memo = row.Memo;
|
|
|
+ this.form.dialogValue = row.teacherId;
|
|
|
+ this.form.classId = row.ClassId
|
|
|
+ this.form.ShopId = row.ShopId;
|
|
|
this.dialogLesson = true
|
|
|
this.dialogTitle = '编辑课程'
|
|
|
},
|