|
@@ -4,9 +4,9 @@
|
|
|
<h5>课程管理</h5>
|
|
<h5>课程管理</h5>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="change">
|
|
<div class="change">
|
|
|
- <el-button type="primary">新增课程</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" @click="addLesson">新增课程</el-button>
|
|
|
<el-button @click="lessonStudenChange">增删课程会员</el-button>
|
|
<el-button @click="lessonStudenChange">增删课程会员</el-button>
|
|
|
- <el-button @click="delList">删除课程</el-button>
|
|
|
|
|
|
|
+ <el-button @click="delList">删除</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="table">
|
|
<div class="table">
|
|
|
<el-table
|
|
<el-table
|
|
@@ -15,9 +15,7 @@
|
|
|
is-horizontal-resize
|
|
is-horizontal-resize
|
|
|
:default-sort="{prop: 'date', order: 'descending'}"
|
|
:default-sort="{prop: 'date', order: 'descending'}"
|
|
|
element-loading-background="rgba(0, 0, 0, 0.8)"
|
|
element-loading-background="rgba(0, 0, 0, 0.8)"
|
|
|
- class=""
|
|
|
|
|
@selection-change="handleSelectionChange"
|
|
@selection-change="handleSelectionChange"
|
|
|
-
|
|
|
|
|
>
|
|
>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
type="selection"
|
|
type="selection"
|
|
@@ -28,19 +26,34 @@
|
|
|
label="课程名称"
|
|
label="课程名称"
|
|
|
>
|
|
>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="vipType"
|
|
|
|
|
+ label="是否通用"
|
|
|
|
|
+ width="110"
|
|
|
|
|
+ align="center"
|
|
|
|
|
+ sortable
|
|
|
|
|
+ >
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span v-if="scope.row.vipType == 1">是</span>
|
|
|
|
|
+ <span v-if="scope.row.vipType == 0">否</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
prop="Recovered"
|
|
prop="Recovered"
|
|
|
label="消耗课时"
|
|
label="消耗课时"
|
|
|
|
|
+ sortable
|
|
|
>
|
|
>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
prop="Recovered"
|
|
prop="Recovered"
|
|
|
label="建议上课人数"
|
|
label="建议上课人数"
|
|
|
|
|
+ sortable
|
|
|
>
|
|
>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
prop="Recovered"
|
|
prop="Recovered"
|
|
|
label="课程会员人数"
|
|
label="课程会员人数"
|
|
|
|
|
+ sortable
|
|
|
>
|
|
>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
@@ -62,12 +75,20 @@
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
prop="color"
|
|
prop="color"
|
|
|
label="课程颜色"
|
|
label="课程颜色"
|
|
|
|
|
+ width="110"
|
|
|
>
|
|
>
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
<el-color-picker v-model="scope.row.color"
|
|
<el-color-picker v-model="scope.row.color"
|
|
|
@change="changeColor(scope.row.color,scope.row)"></el-color-picker>
|
|
@change="changeColor(scope.row.color,scope.row)"></el-color-picker>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
+ <el-table-column
|
|
|
|
|
+ prop="create"
|
|
|
|
|
+ label="创建时间"
|
|
|
|
|
+ width="210"
|
|
|
|
|
+ sortable
|
|
|
|
|
+ >
|
|
|
|
|
+ </el-table-column>
|
|
|
<el-table-column
|
|
<el-table-column
|
|
|
prop="name"
|
|
prop="name"
|
|
|
label="备注">
|
|
label="备注">
|
|
@@ -89,8 +110,8 @@
|
|
|
label="操作"
|
|
label="操作"
|
|
|
>
|
|
>
|
|
|
<template slot-scope="scope">
|
|
<template slot-scope="scope">
|
|
|
- <el-button type="text">修改</el-button>
|
|
|
|
|
- <el-button type="text">课程会员</el-button>
|
|
|
|
|
|
|
+ <el-button type="text" @click="editLesson(scope.row)">修改</el-button>
|
|
|
|
|
+ <el-button type="text" @click="Lessonmember(scope.row)">课程会员</el-button>
|
|
|
</template>
|
|
</template>
|
|
|
</el-table-column>
|
|
</el-table-column>
|
|
|
|
|
|
|
@@ -104,16 +125,58 @@
|
|
|
></el-pagination>
|
|
></el-pagination>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <el-dialog title="新增课程" :visible.sync="dialogLesson">
|
|
|
|
|
- <div class="dialogTitle">
|
|
|
|
|
- <span>基础功能</span>
|
|
|
|
|
- </div>
|
|
|
|
|
|
|
+ <el-dialog title="新增课程" :visible.sync="dialogLesson" width="1200px">
|
|
|
<div>
|
|
<div>
|
|
|
- <el-transfer v-model="dialogValue" :data="dialogdata"></el-transfer>
|
|
|
|
|
|
|
+ <div class="pull-left">
|
|
|
|
|
+ <el-form ref="form" :model="form" label-width="160px">
|
|
|
|
|
+ <el-form-item label="课程名称">
|
|
|
|
|
+ <el-input v-model="form.currName"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="消耗课时">
|
|
|
|
|
+ <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"
|
|
|
|
|
+ label="(天)"></el-input-number>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="微信可见">
|
|
|
|
|
+ <el-switch
|
|
|
|
|
+ v-model="form.wxvisible"
|
|
|
|
|
+ active-value="1"
|
|
|
|
|
+ inactive-value="0"
|
|
|
|
|
+ active-color="#409EFF"
|
|
|
|
|
+ inactive-color="#D9D9D9">
|
|
|
|
|
+ </el-switch>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="是否通用">
|
|
|
|
|
+ <el-switch
|
|
|
|
|
+ v-model="form.wxvisible"
|
|
|
|
|
+ active-value="1"
|
|
|
|
|
+ inactive-value="0"
|
|
|
|
|
+ active-color="#409EFF"
|
|
|
|
|
+ inactive-color="#D9D9D9">
|
|
|
|
|
+ </el-switch>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="课程颜色">
|
|
|
|
|
+ <el-color-picker v-model="form.currColor"></el-color-picker>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ <el-form-item label="备注">
|
|
|
|
|
+ <el-input v-model="form.memo"></el-input>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="pull-right">
|
|
|
|
|
+ <el-form ref="form" :model="form" label-width="160px">
|
|
|
|
|
+ <el-form-item label="课程会员人数">
|
|
|
|
|
+ <el-transfer filterable v-model="form.dialogValue" :data="form.dialogdata"></el-transfer>
|
|
|
|
|
+ </el-form-item>
|
|
|
|
|
+ </el-form>
|
|
|
|
|
+ </div>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="dialogFooter">
|
|
<div class="dialogFooter">
|
|
|
- <el-button type="primary" size="small">确定</el-button>
|
|
|
|
|
- <el-button @click="dialogVisible = false" size="small">取消</el-button>
|
|
|
|
|
|
|
+ <el-button type="primary" size="small" @click="confirmAddLesson">确定</el-button>
|
|
|
|
|
+ <el-button size="small" @click="dialogLesson = false">取消</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
|
|
@@ -122,13 +185,26 @@
|
|
|
<span>基础功能</span>
|
|
<span>基础功能</span>
|
|
|
</div>
|
|
</div>
|
|
|
<div>
|
|
<div>
|
|
|
- <el-transfer v-model="dialogValue" :data="dialogdata"></el-transfer>
|
|
|
|
|
|
|
+ <el-transfer filterable v-model="dialogValue" :data="form.dialogdata"></el-transfer>
|
|
|
</div>
|
|
</div>
|
|
|
<div class="dialogFooter">
|
|
<div class="dialogFooter">
|
|
|
<el-button type="primary" size="small">确定</el-button>
|
|
<el-button type="primary" size="small">确定</el-button>
|
|
|
- <el-button @click="dialogVisible = false" size="small">取消</el-button>
|
|
|
|
|
|
|
+ <el-button @click=" dialogVisible = false" size="small">取消</el-button>
|
|
|
</div>
|
|
</div>
|
|
|
</el-dialog>
|
|
</el-dialog>
|
|
|
|
|
+
|
|
|
|
|
+ <el-dialog title="课程会员" :visible.sync="dialogTableVisible">
|
|
|
|
|
+ <el-table :data="gridData">
|
|
|
|
|
+ <el-table-column property="name" label="姓名" width="200"></el-table-column>
|
|
|
|
|
+ <el-table-column property="userCode" label="手机"></el-table-column>
|
|
|
|
|
+ <el-table-column property="vipType" label="会员类型">
|
|
|
|
|
+ <template slot-scope="scope">
|
|
|
|
|
+ <span v-if="scope.row.vipType == 1">年费会员</span>
|
|
|
|
|
+ <span v-if="scope.row.vipType == 2">充值会员</span>
|
|
|
|
|
+ </template>
|
|
|
|
|
+ </el-table-column>
|
|
|
|
|
+ </el-table>
|
|
|
|
|
+ </el-dialog>
|
|
|
</div>
|
|
</div>
|
|
|
</template>
|
|
</template>
|
|
|
|
|
|
|
@@ -145,8 +221,10 @@
|
|
|
return {
|
|
return {
|
|
|
dialogLesson: false,//新增课程
|
|
dialogLesson: false,//新增课程
|
|
|
dialogVisible: false,
|
|
dialogVisible: false,
|
|
|
|
|
+ dialogTableVisible: false,
|
|
|
dialogdata: [],
|
|
dialogdata: [],
|
|
|
- dialogValue: [1, 4],
|
|
|
|
|
|
|
+ gridData: [],
|
|
|
|
|
+ dialogValue: [],
|
|
|
// panel 配置项目
|
|
// panel 配置项目
|
|
|
panel: {
|
|
panel: {
|
|
|
usercode: '',
|
|
usercode: '',
|
|
@@ -174,6 +252,16 @@
|
|
|
],
|
|
],
|
|
|
time1: globalBt(),
|
|
time1: globalBt(),
|
|
|
},
|
|
},
|
|
|
|
|
+ form: {
|
|
|
|
|
+ currName: "",
|
|
|
|
|
+ consumeHour: 0,
|
|
|
|
|
+ topLimit: 0,
|
|
|
|
|
+ wxvisible: 1,
|
|
|
|
|
+ currColor: "",
|
|
|
|
|
+ memo: "",
|
|
|
|
|
+ dialogdata: [],//穿梭待选
|
|
|
|
|
+ dialogValue: [],//穿梭已选
|
|
|
|
|
+ },
|
|
|
multipleSelection: [],
|
|
multipleSelection: [],
|
|
|
pageination: {
|
|
pageination: {
|
|
|
pageItem: 100,
|
|
pageItem: 100,
|
|
@@ -185,9 +273,70 @@
|
|
|
}
|
|
}
|
|
|
},
|
|
},
|
|
|
mounted() {
|
|
mounted() {
|
|
|
|
|
+ this.panelSelect();
|
|
|
this.getTableQuery();
|
|
this.getTableQuery();
|
|
|
},
|
|
},
|
|
|
methods: {
|
|
methods: {
|
|
|
|
|
+ // 确认添加课程
|
|
|
|
|
+ confirmAddLesson() {
|
|
|
|
|
+ let that = this;
|
|
|
|
|
+
|
|
|
|
|
+ // checkNum
|
|
|
|
|
+ if (!that.form.currName) {
|
|
|
|
|
+ this.$message.error('错了哦,课程名称不能为空');
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ if (that.form.currName.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 param = {
|
|
|
|
|
+ token: localStorage.token,
|
|
|
|
|
+ currName: that.form.currName,
|
|
|
|
|
+ consumeHour: that.form.consumeHour,
|
|
|
|
|
+ topLimit: that.form.topLimit,
|
|
|
|
|
+ wxvisible: that.form.wxvisible,
|
|
|
|
|
+ currColor: that.form.currColor,
|
|
|
|
|
+ memo: that.form.memo,
|
|
|
|
|
+ };
|
|
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
|
|
+ testSelect(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() {
|
|
|
|
|
+ // clear
|
|
|
|
|
+ this.form.currName = '';
|
|
|
|
|
+ this.form.consumeHour = '';
|
|
|
|
|
+ this.form.topLimit = '';
|
|
|
|
|
+ this.form.wxvisible = 1;
|
|
|
|
|
+ this.form.currColor = "";
|
|
|
|
|
+ this.form.memo = "";
|
|
|
|
|
+ this.form.dialogValue = "";
|
|
|
|
|
+
|
|
|
|
|
+ this.dialogLesson = true;
|
|
|
|
|
+ },
|
|
|
// 改色
|
|
// 改色
|
|
|
changeColor(c, row) {
|
|
changeColor(c, row) {
|
|
|
let that = this;
|
|
let that = this;
|
|
@@ -268,6 +417,23 @@
|
|
|
});
|
|
});
|
|
|
});
|
|
});
|
|
|
},
|
|
},
|
|
|
|
|
+ // 加载选项
|
|
|
|
|
+ panelSelect() {
|
|
|
|
|
+ let that = this;
|
|
|
|
|
+ let param = {
|
|
|
|
|
+ token: localStorage.token,
|
|
|
|
|
+ };
|
|
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
|
|
+ testSelect(postdata).then(res => {
|
|
|
|
|
+ let json = res;
|
|
|
|
|
+ if (json.Code == 0) {
|
|
|
|
|
+ that.dialogdata = json.Rs;
|
|
|
|
|
+ that.form.dialogdata = json.Rs;
|
|
|
|
|
+ } else {
|
|
|
|
|
+ that.$message.error(json.Memo);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ },
|
|
|
// 微信可见与否
|
|
// 微信可见与否
|
|
|
changeWechat(e, row) {
|
|
changeWechat(e, row) {
|
|
|
let that = this;
|
|
let that = this;
|
|
@@ -294,11 +460,61 @@
|
|
|
},
|
|
},
|
|
|
// 增删会员课程
|
|
// 增删会员课程
|
|
|
lessonStudenChange() {
|
|
lessonStudenChange() {
|
|
|
|
|
+ if (!this.multipleSelection.length) {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ showClose: true,
|
|
|
|
|
+ message: '错了哦,需要先选中至少一条记录',
|
|
|
|
|
+ type: 'error'
|
|
|
|
|
+ });
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ if (this.multipleSelection.length != 1) {
|
|
|
|
|
+ this.$message({
|
|
|
|
|
+ showClose: true,
|
|
|
|
|
+ message: '错了哦,只能选中一条记录',
|
|
|
|
|
+ type: 'error'
|
|
|
|
|
+ });
|
|
|
|
|
+ return false
|
|
|
|
|
+ }
|
|
|
|
|
+ console.log(123);
|
|
|
|
|
+ let row = this.multipleSelection[0];
|
|
|
|
|
+ this.dialogValue = row.dialogValue;
|
|
|
this.dialogVisible = true
|
|
this.dialogVisible = true
|
|
|
},
|
|
},
|
|
|
handleSelectionChange(val) {
|
|
handleSelectionChange(val) {
|
|
|
this.multipleSelection = val;
|
|
this.multipleSelection = val;
|
|
|
},
|
|
},
|
|
|
|
|
+ clearForm(){
|
|
|
|
|
+ // clear
|
|
|
|
|
+ this.form.currName = '';
|
|
|
|
|
+ this.form.consumeHour = 0;
|
|
|
|
|
+ this.form.topLimit = 0;
|
|
|
|
|
+ this.form.wxvisible = 1;
|
|
|
|
|
+ this.form.currColor = '';
|
|
|
|
|
+ this.form.memo = '';
|
|
|
|
|
+ },
|
|
|
|
|
+ // 修改
|
|
|
|
|
+ editLesson(row){
|
|
|
|
|
+ let that = this;
|
|
|
|
|
+ this.clearForm();
|
|
|
|
|
+
|
|
|
|
|
+ this.form.currName = row.name;
|
|
|
|
|
+ this.form.consumeHour = row.Recovered;
|
|
|
|
|
+ this.form.topLimit = row.Recovered;
|
|
|
|
|
+ this.form.wxvisible = row.wxVisible;
|
|
|
|
|
+ this.form.currColor = row.color;
|
|
|
|
|
+ this.form.memo = row.memo;
|
|
|
|
|
+ this.form.dialogValue = row.dialogValue;
|
|
|
|
|
+ this.form.btnType = 1; //修改
|
|
|
|
|
+
|
|
|
|
|
+ this.dialogLesson = true
|
|
|
|
|
+ this.dialogTitle = '修改课程'
|
|
|
|
|
+ },
|
|
|
|
|
+ Lessonmember(row){
|
|
|
|
|
+ this.dialogTableVisible = true;
|
|
|
|
|
+ this.gridData = row.members;
|
|
|
|
|
+
|
|
|
|
|
+ },
|
|
|
// 查询按钮
|
|
// 查询按钮
|
|
|
query() {
|
|
query() {
|
|
|
// this.getTableQuery();
|
|
// this.getTableQuery();
|
|
@@ -484,4 +700,14 @@
|
|
|
float: right;
|
|
float: right;
|
|
|
margin-left: 10px;
|
|
margin-left: 10px;
|
|
|
}
|
|
}
|
|
|
|
|
+
|
|
|
|
|
+ .pull-left {
|
|
|
|
|
+ width: 30%;
|
|
|
|
|
+ float: left;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ .pull-right {
|
|
|
|
|
+ width: 70%;
|
|
|
|
|
+ float: right;
|
|
|
|
|
+ }
|
|
|
</style>
|
|
</style>
|