|
@@ -93,7 +93,9 @@
|
|
|
</div>
|
|
|
|
|
|
<!-- 课程类型新增弹窗 -->
|
|
|
- <el-dialog title="vip课程形式" width="500px"
|
|
|
+ <el-dialog title="vip课程形式"
|
|
|
+ class="courseMask"
|
|
|
+ width="500px"
|
|
|
:visible.sync="vipStatus">
|
|
|
<el-form :model="vipStatusFrom"
|
|
|
ref='vipStatus'>
|
|
@@ -112,8 +114,33 @@
|
|
|
<el-form-item label="课程课时"
|
|
|
prop="timer"
|
|
|
:label-width="formLabelWidth">
|
|
|
- <el-input v-model="vipStatusFrom.timer"
|
|
|
- autocomplete="off"></el-input>
|
|
|
+ <!-- <el-input v-model="vipStatusFrom.timer"
|
|
|
+ autocomplete="off"></el-input> -->
|
|
|
+ <el-tag :key="tag"
|
|
|
+ effect="dark"
|
|
|
+ type="info"
|
|
|
+ v-for="tag in dynamicTags"
|
|
|
+ closable
|
|
|
+ :disable-transitions="false"
|
|
|
+ @close="handleClose(tag)">
|
|
|
+ {{tag}}
|
|
|
+ </el-tag>
|
|
|
+ <el-input class="input-new-tag"
|
|
|
+ v-if="inputVisible"
|
|
|
+ v-model="inputValue"
|
|
|
+ ref="saveTagInput"
|
|
|
+ style="width:100px;"
|
|
|
+ size="small"
|
|
|
+ @keyup.enter.native="handleInputConfirm">
|
|
|
+ </el-input>
|
|
|
+ <el-button v-if="!inputVisible"
|
|
|
+ class="button-new-tag"
|
|
|
+ size="small"
|
|
|
+ @click="showInput">+ 添加</el-button>
|
|
|
+ <el-button v-if="inputVisible"
|
|
|
+ class="button-new-tag"
|
|
|
+ size="small"
|
|
|
+ @click="handleInputConfirm">保存</el-button>
|
|
|
</el-form-item>
|
|
|
</el-form>
|
|
|
<div slot="footer"
|
|
@@ -125,7 +152,8 @@
|
|
|
</el-dialog>
|
|
|
|
|
|
<!-- 周期循环新增弹窗 -->
|
|
|
- <el-dialog title="vip时间段" width="500px"
|
|
|
+ <el-dialog title="vip时间段"
|
|
|
+ width="500px"
|
|
|
:visible.sync="timerStatus">
|
|
|
<el-form :model="vipTimerFrom"
|
|
|
ref='timerStatus'>
|
|
@@ -163,7 +191,7 @@ export default {
|
|
|
vipStatusFrom: {
|
|
|
name: '',
|
|
|
num: '',
|
|
|
- timer: '',
|
|
|
+ timer: [],
|
|
|
isAdd: true,
|
|
|
id: ''
|
|
|
}, // 弹窗内容
|
|
@@ -174,7 +202,10 @@ export default {
|
|
|
timer: '',
|
|
|
isAdd: true,
|
|
|
id: ''
|
|
|
- }
|
|
|
+ },
|
|
|
+ dynamicTags: [],
|
|
|
+ inputVisible: false,
|
|
|
+ inputValue: ''
|
|
|
}
|
|
|
},
|
|
|
mounted () {
|
|
@@ -182,6 +213,25 @@ export default {
|
|
|
this.getDefaultClassesCycle()
|
|
|
},
|
|
|
methods: {
|
|
|
+ handleClose (tag) {
|
|
|
+ this.dynamicTags.splice(this.dynamicTags.indexOf(tag), 1);
|
|
|
+ },
|
|
|
+
|
|
|
+ showInput () {
|
|
|
+ this.inputVisible = true;
|
|
|
+ this.$nextTick(_ => {
|
|
|
+ this.$refs.saveTagInput.$refs.input.focus();
|
|
|
+ });
|
|
|
+ },
|
|
|
+
|
|
|
+ handleInputConfirm () {
|
|
|
+ let inputValue = this.inputValue;
|
|
|
+ if (inputValue) {
|
|
|
+ this.dynamicTags.push(inputValue);
|
|
|
+ }
|
|
|
+ this.inputVisible = false;
|
|
|
+ this.inputValue = '';
|
|
|
+ },
|
|
|
getVipGroupCategoryList () {
|
|
|
// 获取默认左边参数
|
|
|
vipGroupCategory().then(res => {
|
|
@@ -198,10 +248,13 @@ export default {
|
|
|
},
|
|
|
// 新增分类
|
|
|
addGroupCategory () {
|
|
|
- // this.$refs['vipStatus'].resetFields();
|
|
|
+
|
|
|
this.vipStatus = true;
|
|
|
this.vipStatusFrom.isAdd = true;
|
|
|
this.vipStatusFrom.id = '';
|
|
|
+ this.vipStatusFrom.name = ''
|
|
|
+ this.vipStatusFrom.num = ''
|
|
|
+ this.dynamicTags = [];
|
|
|
},
|
|
|
closeVipStatus () {
|
|
|
this.vipStatus = false;
|
|
@@ -213,7 +266,7 @@ export default {
|
|
|
// 添加
|
|
|
addVipGroupCategory({
|
|
|
name: this.vipStatusFrom.name,
|
|
|
- singleClassMinutes: this.vipStatusFrom.timer,
|
|
|
+ singleClassMinutes: this.dynamicTags.join(','),
|
|
|
studentNum: this.vipStatusFrom.num
|
|
|
}).then(res => {
|
|
|
if (res.code == 200) {
|
|
@@ -225,7 +278,7 @@ export default {
|
|
|
// 修改
|
|
|
resetVipGroupCategory({
|
|
|
name: this.vipStatusFrom.name,
|
|
|
- singleClassMinutes: this.vipStatusFrom.timer,
|
|
|
+ singleClassMinutes: this.dynamicTags.join(','),
|
|
|
studentNum: this.vipStatusFrom.num,
|
|
|
id: this.vipStatusFrom.id
|
|
|
}).then(res => {
|
|
@@ -239,7 +292,9 @@ export default {
|
|
|
console.log(row);
|
|
|
this.vipStatus = true;
|
|
|
this.vipStatusFrom.name = row.name;
|
|
|
- this.vipStatusFrom.timer = row.singleClassMinutes;
|
|
|
+
|
|
|
+ this.vipStatusFrom.timer = row.singleClassMinutes.split(',');
|
|
|
+ this.dynamicTags = row.singleClassMinutes.split(',');
|
|
|
this.vipStatusFrom.num = row.studentNum;
|
|
|
this.vipStatusFrom.id = row.id;
|
|
|
this.vipStatusFrom.isAdd = false;
|
|
@@ -305,7 +360,7 @@ export default {
|
|
|
this.getDefaultClassesCycle();
|
|
|
}
|
|
|
})
|
|
|
- }
|
|
|
+ },
|
|
|
},
|
|
|
watch: {
|
|
|
vipStatus (val) {
|
|
@@ -331,4 +386,11 @@ export default {
|
|
|
flex-direction: row;
|
|
|
justify-content: flex-start;
|
|
|
}
|
|
|
+</style>
|
|
|
+<style lang="scss">
|
|
|
+.courseMask {
|
|
|
+ .el-tag.el-tag--info {
|
|
|
+ margin-right: 4px;
|
|
|
+ }
|
|
|
+}
|
|
|
</style>
|