Просмотр исходного кода

Merge branch 'master' of http://git.dayaedu.com/molingzhide/dy-admin-manager

lex-xin 5 лет назад
Родитель
Сommit
f1cdd1bc84

+ 21 - 8
src/views/buildVip/index.vue

@@ -1,9 +1,10 @@
 <template>
   <div class="m-container">
     <h2>
-      <el-page-header @back="onCancel" content="VIP课申请"></el-page-header>
+      <el-page-header @back="onCancel"
+                      content="VIP课申请"></el-page-header>
       <!-- <div class="squrt" /> -->
-      
+
     </h2>
     <div class="m-core">
       <div class="vipLeft">
@@ -81,11 +82,19 @@
                       disabled />
           </el-form-item>
           <el-form-item label="每课时长">
-            <el-input type="number"
+            <!-- <el-input type="number"
                       v-model="leftForm.classTime"
-                      disabled />
+                      disabled /> -->
+            <el-select v-model="leftForm.classTime"
+                       :disabled="timeTable.length>0">
+              <el-option v-for='(item,index) in this.classTimeList'
+                         :key="index"
+                         :value="item"
+                         :label="item"></el-option>
+            </el-select>
           </el-form-item>
-          <el-form-item label="报名开始时间"
+          <el-form-item label="
+                       报名开始时间"
                         prop="signUpStart">
             <el-date-picker v-model="leftForm.signUpStart"
                             type="date"
@@ -376,6 +385,7 @@ export default {
         courseEnd: '',
         section: ''
       },
+      classTimeList: [],
       centerForm: {
         allCourseNum: '',
         onlineCourseNum: 0,
@@ -520,7 +530,9 @@ export default {
           // 学生人数
           this.leftForm.classNum = this.courseTypeList[i].studentNum;
           // 每课时长
-          this.leftForm.classTime = this.courseTypeList[i].singleClassMinutes;
+          this.classTimeList = this.courseTypeList[i].singleClassMinutes.split(',')
+          // this.leftForm.classTime = this.courseTypeList[i].singleClassMinutes;
+          this.leftForm.classTime = this.classTimeList[0];
           // 线上课单节价格
           this.rightForm.onlinePrice = this.courseTypeList[i].onlineClassesUnitPrice;
           // 线下课单节价格
@@ -854,6 +866,7 @@ export default {
       let offlineClassesUnitPrice = this.rightForm.offlinePrice || null;
       let onlineClassesNum = this.centerForm.onlineCourseNum || 0;
       let offlineClassesNum = this.centerForm.offlineCourseNum || 0;
+      let singleClassMinutes = this.leftForm.classTime
       if (this.hotType == 'GIVE_CLASS') {
         if (this.centerForm.radio == 'ONLINE') {
           onlineClassesNum = parseInt(onlineClassesNum) + parseInt(this.giveNum)
@@ -863,7 +876,7 @@ export default {
       }
       let onlineTeacherSalary = this.rightForm.onlineCourse || null;
       let offlineTeacherSalary = this.rightForm.offlineCourse || null;
-      getVipGroupCostCount({ vipGroupActivityId, onlineClassesUnitPrice, onlineTeacherSalary, offlineTeacherSalary, vipGroupCategoryId, offlineClassesUnitPrice, onlineClassesNum, offlineClassesNum, userId, giveTeachMode }).then(res => {
+      getVipGroupCostCount({ vipGroupActivityId, onlineClassesUnitPrice, onlineTeacherSalary, offlineTeacherSalary, vipGroupCategoryId, offlineClassesUnitPrice, onlineClassesNum, offlineClassesNum, userId, giveTeachMode, singleClassMinutes }).then(res => {
         if (res.code == 200) {
           this.rightForm.onlineCourse = res.data.onlineTeacherSalary;
           this.rightForm.offlineCourse = res.data.offlineTeacherSalary;
@@ -945,7 +958,7 @@ export default {
         }
       })
     },
-    onCancel() {
+    onCancel () {
       this.$router.push('/business/vipList')
     },
     setCourse () {

+ 73 - 11
src/views/categroyManager/generalSettings/vipParameterManager.vue

@@ -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>

+ 2 - 33
src/views/vipClass/vipDetail/components/vipBaseInfo.vue

@@ -75,38 +75,7 @@
                     disabled></el-input>
         </el-form-item>
       </el-form>
-      <div class="tableWrap">
-        <h4>vip课学员名单</h4>
-        <el-table :data='tableList'
-                  :header-cell-style="{background:'#EDEEF0',color:'#444'}">
-          <el-table-column label="学员名单"
-                           prop="userName"
-                           width="180">
-          </el-table-column>
-          <el-table-column label="操作"
-                           width="180">
-            <template slot-scope="scope">
-              <div>
-                <el-popover placement="top"
-                            width="160"
-                            :ref="scope.$index">
-                  <p>确定退学吗?</p>
-                  <div style="text-align: right; margin-top: 20px">
-                    <el-button size="mini"
-                               type="text"
-                               @click="scope._self.$refs[scope.$index].doClose()">取消</el-button>
-                    <el-button type="primary"
-                               size="mini"
-                               @click="leaveSchool(scope)">确定</el-button>
-                  </div>
-                  <el-button type="text"
-                             slot="reference">退学</el-button>
-                </el-popover>
-              </div>
-            </template>
-          </el-table-column>
-        </el-table>
-      </div>
+
     </div>
 
   </div>
@@ -139,7 +108,7 @@ export default {
       tableList: []
     }
   }, mounted () {
-    let id = this.$route.query.id || 1;
+    let id = this.$route.query.id;
     this.id = id;
     // 根据id 获取vip详情
     getVipGroupDetail({ vipGroupId: id }).then(res => {

+ 65 - 0
src/views/vipClass/vipDetail/components/vipStudentList.vue

@@ -0,0 +1,65 @@
+<template>
+  <div>
+    <div class="tableWrap">
+      <el-table :data='tableList'
+                :header-cell-style="{background:'#EDEEF0',color:'#444'}">
+        <el-table-column label="学员姓名"
+                         prop="userName"
+                         width="180">
+        </el-table-column>
+        <el-table-column label="手机号"
+                         prop="userName"
+                         width="180">
+        </el-table-column>
+        <el-table-column label="操作">
+          <template slot-scope="scope">
+            <div>
+              <el-popover placement="top"
+                          width="160"
+                          :ref="scope.$index">
+                <p>确定退学吗?</p>
+                <div style="text-align: right; margin-top: 20px">
+                  <el-button size="mini"
+                             type="text"
+                             @click="scope._self.$refs[scope.$index].doClose()">取消</el-button>
+                  <el-button type="primary"
+                             size="mini"
+                             @click="leaveSchool(scope)">确定</el-button>
+                </div>
+                <el-button type="text"
+                           slot="reference">退学</el-button>
+              </el-popover>
+            </div>
+          </template>
+        </el-table-column>
+      </el-table>
+    </div>
+  </div>
+</template>
+<script>
+import { findVipGroupStudents, leaveSchool } from '@/api/vipSeting'
+export default {
+  data () {
+    return {
+      tableList: [],
+      id: ''
+    }
+  },
+  mounted () {
+    let id = this.$route.query.id;
+    this.id = id;
+    this.getStudents()
+  },
+  methods: {
+    getStudents () {
+      findVipGroupStudents({ vipGroupId: this.id }).then(res => {
+        if (res.code == 200) {
+          this.tableList = res.data.rows;
+        }
+      })
+    },
+  },
+}
+</script>
+<style lang="scss" scoped>
+</style>

+ 6 - 1
src/views/vipClass/vipDetail/index.vue

@@ -18,6 +18,10 @@
                      name="3">
           <fnanceInfo />
         </el-tab-pane>
+        <el-tab-pane label="VIP学生列表"
+                     name="4">
+          <vipStudentList />
+        </el-tab-pane>
       </el-tabs>
     </div>
   </div>
@@ -26,8 +30,9 @@
 import teacherRecord from '@/views/vipClass/vipDetail/components/teacherRecord'
 import vipBase from '@/views/vipClass/vipDetail/components/vipBaseInfo'
 import fnanceInfo from '@/views/vipClass/vipDetail/components/fnanceInfo'
+import vipStudentList from '@/views/vipClass/vipDetail/components/vipStudentList'
 export default {
-  components: { teacherRecord, vipBase, fnanceInfo },
+  components: { teacherRecord, vipBase, fnanceInfo, vipStudentList },
   name: 'vipDetail',
   data () {
     return {