Explorar o código

修改 readme

Changpeng Duan %!s(int64=5) %!d(string=hai) anos
pai
achega
51a347b82c
Modificáronse 6 ficheiros con 2483 adicións e 264 borrados
  1. 103 48
      src/components/Headside.vue
  2. 159 165
      src/components/Navside.vue
  3. 187 0
      src/components/preview.vue
  4. 153 51
      src/views/Login.vue
  5. 1087 0
      src/views/cost.vue
  6. 794 0
      src/views/lessonManage.vue

+ 103 - 48
src/components/Headside.vue

@@ -1,8 +1,9 @@
 <template>
     <div id="headside">
         <nav class="navbar user-info-navbar" role="navigation">
-            <i :class="[{'el-icon-arrow-left left_hide_icon':left_panel_state},{'el-icon-arrow-right left_show_icon':!left_panel_state}] "
-               @click="left_hide"></i>
+<!--            <i :class="[{'el-icon-s-unfold left_hide_icon':left_panel_state},{'el-icon-s-fold left_show_icon':!left_panel_state}] "-->
+<!--               @click="left_hide"></i>-->
+            <span class="title">场馆管理系统    <em>   {{current}}</em></span>
             <div @click="checkNews">
                 <el-badge :value="newnum"
                           class="item"
@@ -13,51 +14,46 @@
                     </el-button>
                 </el-badge>
             </div>
+
             <ul class="user-info-menu right-links list-inline list-unstyled">
                 <li class="dropdown user-profile">
-                    <el-dropdown>
-                          <span class="el-dropdown-link customer_serve">
-                            {{user.name}}<i class="el-icon-arrow-down el-icon--right"></i>
+<!--                        <img class="lteHead" src="../assets/img/header/lteHead.png" height="26" width="26"/>-->
+                        <span class="el-dropdown-link customer_serve">
+                            {{user.name}}
                           </span>
-                        <el-dropdown-menu slot="dropdown">
-                            <el-dropdown-item icon="el-icon-plus" @click.native="logoutClick">退出登录</el-dropdown-item>
-                        </el-dropdown-menu>
-                    </el-dropdown>
-                </li>
-                <li class="pull-right" style="min-height: 40px;">
-						<span class="customer_serve">工作日 {{time}} &nbsp;客服电话: &nbsp;{{tel}}&nbsp;
-                            <a href="http://wpa.b.qq.com/cgi/wpa.php?ln=1&amp;key=XzkzODA2Mzg3OV80ODQ0MTlfNDAwMDA3OTM2MF8yXw"
-                               id="qq_customer" target="_blank">
-                                 客服QQ: {{qq}}
-                                1234
-                            </a>
+                        <span  @click="logoutClick">
+                            退出
                         </span>
                 </li>
-
             </ul>
         </nav>
     </div>
 </template>
 <script>
-    import axios from 'axios';
 
+    import axios from 'axios';
+    import Global from '../Global.js'
+    import {SignOut,ManagerSelfQuery} from '../api/getApiRes.js'
     let qs = require('qs');
     export default {
         data() {
             return {
                 user: {
-                    name: localStorage.userName,
+                    // name: localStorage.userName,
+                    name: 'admin',
                 },
                 time: '8:30-17:30',
                 tel: '0000-0079-000',
                 qq: '0000079000',
                 newnum: '',
                 newnumState: false,
-                left_panel_state: false
+                left_panel_state: false,
+                current:globalcurrentWeek()
             }
         },
         mounted() {
             this.readNewNum();
+            this.getManagerSelfQuery();
 //            定时轮询news
             //设置10s刷新一次数据
             // if (this.timer) {
@@ -73,7 +69,6 @@
             left_hide: function () {
                 let that = this;
                 that.left_panel_state = !that.left_panel_state;
-                console.log(223);
                 this.$emit('lefthide');
                 // if (!that.left_panel_state) {
                 //     this.$emit('left_hide_func');
@@ -81,6 +76,29 @@
                 //     this.$emit('right_hide_func');
                 // }
             },
+            getManagerSelfQuery(){
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                };
+                let postdata = qs.stringify(param);
+                ManagerSelfQuery(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.user.name = json.Rs.Name;
+                        localStorage.shopId = json.Rs.ShopId;
+                        localStorage.userLevel = json.Rs.Role.State;
+                    } else {
+                        if(json.Code == 1010){
+                            that.$message.error(json.Memo);
+                            that.$router.push({path: '/login', query: {status: 1}});
+                            return false
+                        }else{
+                            that.$message.error(json.Memo);
+                        }
+                    }
+                })
+            },
 //            打开消息提示
             checkNews: function () {
                 let that = this;
@@ -114,13 +132,24 @@
                     cancelButtonText: '取消',
                     type: 'warning'
                 }).then(() => {
-                    let url = headapi + '?ctl=ajax&mod=index&act=logout';
-                    let param = {};
+                    let that = this;
+                    let param = {
+                    token: localStorage.token,
+                    };
                     let postdata = qs.stringify(param);
-                    axios.post(url, postdata).then(function (data) {
-                        that.$router.push({path: '/login', query: {status: 1}});
-                    }, function (response) {
-                        console.info(response);
+                    SignOut(postdata).then(res => {
+                        let json = res;
+                        if (json.Code == 0) {
+                            localStorage.clear();
+                            that.$router.push({path: '/login', query: {status: 1}});
+                            that.$message({
+                                showClose: true,
+                                message: '当前用户已退出登陆!',
+                                type: 'success'
+                            });
+                        } else {
+                            that.$message.error(json.Memo);
+                        }
                     })
                 }).catch(() => {
 
@@ -141,11 +170,11 @@
 
     #headside {
         width: 100%;
-        height: 41px;
+        height: 72px;
         overflow: hidden;
         float: right;
         z-index: 1111;
-        border-bottom: 1px solid #efefef;
+        background-color: #0063C9;
     }
 
     .user-info-navbar {
@@ -153,9 +182,8 @@
         overflow: hidden;
         display: block;
         margin: 0 auto;
-        background-color: #ffffff;
-        min-height: 0;
-        height: 41px;
+        min-height: 72px;
+        height: 72px;
         border: 0;
         padding: 0;
         margin-bottom: 0px;
@@ -372,7 +400,7 @@
         margin-right: 20px;
         font-size: 12px;
         color: #585858;
-        line-height: 45px;
+        line-height: 72px;
         text-align: right;
     }
 
@@ -434,32 +462,34 @@
     }
 
     .left_hide_icon {
-        margin-top: 7px;
-        border: 1px solid #ccc;
-        padding: 5px;
+        width: 20px;
+        height: 20px;
+        margin-top: 25px;
         float: left;
         margin-left: 15px;
         cursor: pointer;
+        color: #BADCFF;
+        font-size: 22px;
+        /*background: url("../assets/img/header/right.png")top center no-repeat;*/
     }
 
-    .left_hide_icon:hover {
-        background: #ccc;
-        color: #fff;
-    }
+    /*.left_hide_icon:hover {*/
+    /*    background: #ccc;*/
+    /*    color: #fff;*/
+    /*}*/
 
     .left_show_icon {
-        margin-top: 7px;
-        border: 1px solid #ccc;
-        padding: 5px;
+        width: 20px;
+        height: 20px;
+        margin-top: 25px;
         float: left;
         margin-left: 15px;
         cursor: pointer;
+        color: #BADCFF;
+        font-size: 22px;
+        /*background: url("../assets/img/header/left.png")top center no-repeat;*/
     }
 
-    .left_show_icon:hover {
-        background: #ccc;
-        color: #fff;
-    }
 
     .item {
         float: left;
@@ -474,9 +504,34 @@
     .user-profile {
         float: right;
         cursor: pointer;
+        margin-right: 29px;
     }
 
     .el-dropdown-menu__item {
         padding: 5px;
     }
+    .title {
+        float: left;
+        color: #BADCFF;
+        font-size: 19px;
+        line-height: 72px;
+        margin-left: 23px;
+    }
+    .title em {
+        font-style: normal;
+        font-size: 14px;
+        margin-left: 10px;
+        font-size: 14px;
+    }
+    .lteHead {
+        margin-top: 25px;
+        margin-right: 10px;
+        float: left;
+    }
+     .user-profile span {
+        float: left;
+        color: #fff;
+        font-size: 14px;
+        line-height: 72px;
+    }
 </style>

+ 159 - 165
src/components/Navside.vue

@@ -1,43 +1,31 @@
 <template>
     <div class="Navside">
+        <div class="logoContainer">
+            <img src="../assets/img/nav/logo.png" height="40" width="180"/>
+        </div>
+        <div class="userContainer">
+            <img src="../assets/img/nav/head.png" height="51" width="51"/>
+            <span>{{ShopName}}</span>
+            <em>{{userLevelText}}</em>
+        </div>
         <el-row :class="[{'shortnav':isCollapse},{'longNav':!isCollapse}]">
             <el-col :span="24">
                 <el-menu
-                        default-active="2"
+                        :default-active="userLevelDeafult"
                         class="el-menu-vertical-demo"
                         @open="handleOpen"
                         @close="handleClose"
                         @select="handleSelect"
-                        background-color="#545c64"
-                        text-color="#fff"
-                        active-text-color="#ffd04b"
+                        background-color="#ffffff"
+                        text-color="#777777"
+                        active-text-color="#fff"
                         router
-                        :collapse="isCollapse"
                 >
-                    <!--<el-menu-item class="el-submenu" index="1" route="/" title="系统首页">-->
-                    <!--<i class="icon-home"></i>-->
-                    <!--<span slot="title">系统首页</span>-->
-                    <!--</el-menu-item>-->
-                    <el-submenu :index="nav.clmid" :route="nav.clmurl" v-for="nav in navs">
-                        <template slot="title">
-                            <i :class="nav.icon"></i>
-                            <span>{{nav.clmname}}</span>
-                        </template>
-                        <el-menu-item-group v-for="(child,j) in nav.childs">
-                            <el-menu-item :index="child.clmid" :route="child.clmurl">{{child.clmname}}
-                            </el-menu-item>
-                        </el-menu-item-group>
-                    </el-submenu>
-                    <el-submenu index="99">
-                        <template slot="title">
-                            <i class="icon-logout"></i>
-                            <span>退出登陆</span>
-                        </template>
-                        <el-menu-item-group>
-                            <el-menu-item @click="clickLogout">退出登陆
-                            </el-menu-item>
-                        </el-menu-item-group>
-                    </el-submenu>
+                    <el-menu-item :index="nav.clmid" :route="nav.clmurl" v-for="nav in navs"
+                                  v-if="nav.show == userLevel">
+                        <i :class="nav.icon"></i>
+                        <span slot="title">{{nav.clmname}}</span>
+                    </el-menu-item>
                 </el-menu>
             </el-col>
         </el-row>
@@ -45,7 +33,10 @@
 </template>
 <script>
     import Navs from '../api/Navs';
-    import {SignOut} from '../api/getApiRes.js'
+    import {
+        ManagerSelfQuery,
+        ShopListQuery
+    } from '../api/getApiRes.js'
 
     let qs = require('qs');
     export default {
@@ -53,203 +44,206 @@
             return {
                 wildState: 0,
                 navs: [],
+                ShopName: '',
+                userLevelText: '',
+                userLevel: 0,
+                userLevelDeafult: "",
             }
         },
         props: ['isCollapse'],
         mounted() {
+            this.userLevelDeafult = this.$route.meta.clmid;
             this.getTableQuery();
+            this.getManagerSelfQuery();
+
         },
         methods: {
             handleSelect(i, s, t) {
-                this.$emit('TabsAdd', i);//触发事件
+                // this.$emit('TabsAdd', i);//触发事件
             },
             getTableQuery() {
                 // 菜单
                 this.navs = Navs;
             },
-            handleOpen(key, keyPath) {
-                // console.log(key, keyPath);
-            },
-            handleClose(key, keyPath) {
-                // console.log(key, keyPath);
+            getManagerSelfQuery() {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                };
+                let postdata = qs.stringify(param);
+                ManagerSelfQuery(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.userLevelText = json.Rs.Role.Name;
+                        // 1 会员 2 系统 3 店铺 4 教练
+                        switch (parseInt(json.Rs.Role.Id)) {
+                            case 1:
+                                that.userLevel = 1;
+                                break;
+                            case 2:
+                                that.userLevel = 2;
+                                break;
+                            case 3:
+                                that.userLevel = 3;
+                                break;
+                            case 4:
+                                that.userLevel = 3;
+                                break;
+                        }
+                        localStorage.shopId = json.Rs.ShopId;
+                        this.panelSelect(json.Rs.ShopId);
+                    } else {
+                        if(json.Code == 1010){
+                            that.$message.error(json.Memo);
+                            that.$router.push({path: '/login', query: {status: 1}});
+                            return false
+                        }else{
+                            that.$message.error(json.Memo);
+                        }
+                    }
+                })
             },
-            clickLogout() {
+            // 获取所属店铺
+            panelSelect(ShopId) {
                 let that = this;
                 let param = {
-                    token: localStorage.token
+                    token: localStorage.token,
                 };
                 let postdata = qs.stringify(param);
-
-                this.$confirm('此操作将退出当前账号, 是否继续?', '提示', {
-                    confirmButtonText: '确定',
-                    cancelButtonText: '取消',
-                    type: 'warning'
-                }).then(() => {
-                    SignOut(postdata).then(res => {
-                        that.$message({
-                            showClose: true,
-                            message: '用户已退出!',
-                            type: 'success'
-                        });
-                        localStorage.usercode = '';
-                        localStorage.token = '';
-                        that.$router.push({path: '/login', query: {status: 1}});
-                    })
-                }).catch(() => {
-                    this.$message({
-                        type: 'info',
-                        message: '已取消删除'
-                    });
+                ShopListQuery(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        json.Rs.map(function (item) {
+                            if (item.ShopID == ShopId) {
+                                that.ShopName = item.ShopName;
+                            }
+                        })
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
                 })
-            }
-        }
+            },
+            handleOpen(key, keyPath) {
+                // console.log(key, keyPath);
+            },
+            handleClose(key, keyPath) {
+                // console.log(key, keyPath);
+            },
+        },
+        watch: {
+            $route(to, from) {
+                this.userLevelDeafult = to.meta.clmid
+            },
+        },
     }
 </script>
 <style scoped>
     /*注释*/
     .Navside {
         width: 100%;
-        height: 100%;
+        height: 910px;
         overflow: hidden;
         display: block;
         margin: 0 auto;
-
+        /*overflow-y: scroll;*/
+        overflow-y: hidden;
+        background-color: #fff;
+        z-index: 4444;
     }
-    .shortnav {
-        position: absolute;
-        width: 65px;
-        top: 48px;
-        bottom: 0;
+
+    .logoContainer {
+        width: 256px;
+        height: 72px;
         overflow: hidden;
         display: block;
         margin: 0 auto;
-        height: 100%;
-        background: #333;
+        background: #3799FF;
     }
 
-    .longNav {
-        position: absolute;
-        width: 320px;
-        top: 48px;
-        bottom: 0;
+    .logoContainer img {
+        width: 100%;
+        height: 100%;
         overflow: hidden;
         display: block;
         margin: 0 auto;
-        height: 100%;
-    }
-
-    .el-col, .el-menu {
-        height: 100%;
-        border-right: 0;
-    }
-
-    /deep/ .el-menu-item {
-        background-color: rgba(255, 255, 255, 0) !important;
+        margin-top: 1px;
     }
 
-    /deep/ .el-menu {
-        background-color: rgba(255, 255, 255, 0.1) !important;
-    }
-
-    /deep/ .el-submenu__title {
-        background: rgba(255, 255, 255, 0) !important;
+    .userContainer {
+        width: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        margin-bottom: 16px;
+        padding-top: 19px;
+        padding-bottom: 19px;
+        border-bottom: 1px solid #F0F2F5;
+        background: #fff;
     }
 
-    .el-menu li:hover {
-        background: #00599A;
+    .userContainer img {
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        margin-bottom: 16px;
     }
 
-    /deep/ .el-menu-item:hover {
-        background: #00599A !important;
+    .userContainer span {
+        width: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        color: #565656;
+        font-size: 16px;
     }
 
-    .logout {
+    .userContainer em {
+        width: 125px;
+        height: 26px;
+        line-height: 26px;
+        text-align: center;
         color: #fff;
-        font-size: 14px;
-        cursor: pointer;
-        height: 56px;
-        /*line-height: 56px;*/
-    }
-
-    .logout:hover {
-        background: rgb(67, 74, 80);
-    }
-
-    .littleLogo {
-        float: left;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        background: #E75296;
+        border-radius: 250px;
+        font-style: normal;
+        margin-top: 8px;
     }
 
-    .icon-home {
-        width: 18px;
-        height: 18px;
-        float: left;
-        margin-top: 20px;
-        background: url("../assets/img/icon/home.png") top center no-repeat;
-        background-size: 100%;
+    /deep/ .el-menu {
+        border: none;
     }
 
-    .icon-location {
-        width: 18px;
-        height: 18px;
-        float: left;
-        margin-top: 20px;
-        background: url("../assets/img/icon/location.png") top center no-repeat;
-        background-size: 100%;
+    /deep/ .el-menu-item {
     }
 
-    .icon-list {
-        width: 18px;
-        height: 22px;
+    /deep/ .el-menu-item span {
+        text-align: left;
         float: left;
-        margin-top: 20px;
-        background: url("../assets/img/icon/list.png") top center no-repeat;
-        background-size: 100% 100%;
+        margin-left: 70px;
     }
 
-    .icon-equip {
-        width: 18px;
-        height: 22px;
-        float: left;
-        margin-top: 20px;
-        background: url("../assets/img/icon/equip.png") top center no-repeat;
-        background-size: 100%;
+    /deep/ .el-menu-item.is-active {
+        background-color: #3799FF !important;
+        color: #fff !important;
     }
 
-    .icon-qrcode {
-        width: 18px;
-        height: 18px;
-        float: left;
-        margin-top: 20px;
-        background: url("../assets/img/icon/qrcode.png") top center no-repeat;
-        background-size: 100%;
+    /deep/ .el-menu-item:hover {
+        background-color: #3799FF !important;
+        color: #fff !important;
     }
 
-    .icon-setting {
-        width: 18px;
-        height: 18px;
-        float: left;
-        margin-top: 20px;
-        background: url("../assets/img/icon/setting.png") top center no-repeat;
-        background-size: 100%;
+    /deep/ .el-menu-item:hover i {
+        color: #fff !important;
     }
 
-    .icon-logout {
-        width: 18px;
-        height: 18px;
+    /deep/ .el-menu-item i {
+        position: relative;
         float: left;
-        margin-top: 20px;
-        background: url("../assets/img/icon/logout.png") top center no-repeat;
-        background-size: 100%;
-    }
-
-    /deep/ .el-menu-item-group .el-menu-item {
-        height: 25px !important;
-        line-height: 25px !important;
-    }
-
-    /deep/ .el-menu-item {
-        height: 30px;
-        line-height: 20px;
+        line-height: 55px;
+        left: 60px;
     }
 
 </style>

+ 187 - 0
src/components/preview.vue

@@ -0,0 +1,187 @@
+<template>
+    <div class="previewContainer">
+        <div class="mainTitle">
+            <h5>
+                {{BigTitle}}
+            </h5>
+            <span>{{smallTitle}}</span>
+        </div>
+        <div class="table">
+            <div class="tableTitle">
+                <span>时间</span>
+                <span>星期一</span>
+                <span>星期二</span>
+                <span>星期三</span>
+                <span>星期四</span>
+                <span>星期五</span>
+                <span>星期六</span>
+                <span>星期日</span>
+            </div>
+            <div class="tableContext">
+                <div class="times">
+                    <span v-for="time in previewDate.SttPlanPreviewTimeList">{{time.BeginStr}}-{{time.EndStr}}</span>
+                    <span v-for="time in previewDate.SttPreviewTimeList">{{time.BeginStr}}-{{time.EndStr}}</span>
+                </div>
+                <!--                1-->
+                <div class="rows" v-for="i in 7">
+                    <em :style="{background:tab.ClassColor}" v-for="tab in previewDate.SttPlanPreviewClassList"
+                        v-if="tab.WeekDay == i">
+                        {{tab.ClassName}}
+                    </em>
+                    <em :style="{background:tab.ClassColor}" v-for="tab in previewDate.SttPreviewClassList"
+                        v-if="tab.WeekDay == i">
+                        {{tab.ClassName}}
+                    </em>
+                </div><!--                2-->
+            </div>
+        </div>
+    </div>
+</template>
+
+<script>
+    import {
+        ClassListQuery,
+        VipUserListQuery,
+    } from "../api/getApiRes";
+    import Global from '../Global.js'
+
+    let qs = require('qs');
+    export default {
+        data() {
+            return {}
+        },
+        props: ['previewDate','BigTitle','smallTitle'],
+        mounted() {
+        },
+        watch: {
+            // previewDate(val){
+            //     val.SttPlanPreviewClassList.sort((a,b)=>a.ClassIndex-b.ClassIndex);//升序
+            // }
+        },
+    }
+</script>
+
+<style scoped>
+    .mainTitle h5 {
+        font-family: "Source Han Sans CN";
+        font-weight: normal;
+        font-size: 26px;
+        text-align: center;
+        color: #373737;
+        margin: 0;
+    }
+
+    .context {
+        margin: 0;
+        padding: 0;
+    }
+
+    /deep/ .el-dialog__header,
+    /deep/ .el-dialog__body {
+        margin: 0;
+        padding: 0;
+    }
+
+    .table {
+        width: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+    }
+
+    .mainTitle span {
+        width: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        font-family: "Source Han Sans CN";
+        font-weight: normal;
+        font-size: 16px;
+        text-align: center;
+        color: #bdbdbd;
+        padding: 3px 0;
+        padding-bottom: 9px;
+    }
+
+    .tableContext {
+        width: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+    }
+
+    .tableContext .times {
+        width: 113px;
+        text-align: center;
+        font-family: "Source Han Sans CN";
+        font-weight: normal;
+        font-size: 14px;
+        line-height: 40px;
+        color: #545454;
+        float: left;
+        border-right: 1px solid #fff;
+    }
+
+    .times span {
+        width: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        height:39px;
+        line-height: 39px;
+        background: #82BFFF;
+        border-bottom: 2px solid #fff;
+    }
+
+    .tableTitle {
+        width: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+    }
+
+    .tableTitle span {
+        width: 113px;
+        height: 45px;
+        line-height: 45px;
+        font-family: "Source Han Sans CN";
+        font-weight: normal;
+        font-size: 12px;
+        text-align: center;
+        color: #222;
+        float: left;
+        background: #F0F2F5;
+        border-right: 1px solid #fff;
+    }
+
+    .rows {
+        width: 113px;
+        height: 100%;
+        overflow: hidden;
+        float: left;
+        border-right: 1px solid #fff;
+    }
+
+    .rows em {
+        width: 113px;
+        height:39px;
+        line-height:39px;
+        font-family: "Source Han Sans CN";
+        font-weight: normal;
+        font-size: 12px;
+        text-align: center;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        border-bottom: 2px solid #fff;
+        background-color: #ccc;
+        font-style: normal;
+    }
+
+    .previewContainer {
+        width: 913px;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+    }
+</style>

+ 153 - 51
src/views/Login.vue

@@ -3,27 +3,34 @@
         <el-container>
             <el-header></el-header>
             <el-main>
-                <h5 class="title">XXXX系统管理</h5>
-                <span class="subtitle">XXXXXX、XXXXXX等管理系统</span>
-                <el-card class="box-card">
-                    <div class="boxTitle">登陆</div>
-                    <el-form ref="form" :model="form" label-width="0px">
-                        <el-form-item label="">
-                            <el-input v-model="form.name" placeholder="用户名"></el-input>
-                        </el-form-item>
-                        <el-form-item label="">
-                            <el-input v-model="form.pwd" placeholder="密码"></el-input>
-                        </el-form-item>
-                        <el-form-item label="">
-                            <el-input v-model="form.valid" placeholder="验证码"></el-input>
-                            <img id="validImg" :src="valImgSrc" alt="" width="100px" height="30px" title="看不清?刷一下试试!">
-                        </el-form-item>
-                        <el-form-item>
-                            <el-button type="primary" @click="onSubmit">登陆</el-button>
-                            <el-button @click="clearForm">清除</el-button>
-                        </el-form-item>
-                    </el-form>
-                </el-card>
+                <div class="bg">
+
+                    <el-card class="box-card">
+                        <h5 class="title">
+                            <img src="../assets/img/login/logo.png" alt="">
+                        </h5>
+                        <span class="subtitle">小飞龙场馆管理系统</span>
+                        <el-form ref="form" :model="form" label-width="0px">
+                            <el-form-item label="">
+                                <el-input v-model="form.name" placeholder="用户名"></el-input>
+                            </el-form-item>
+                            <el-form-item label="">
+                                <el-input v-model="form.pwd" placeholder="密码" type="password"></el-input>
+                            </el-form-item>
+                            <el-form-item label="">
+                                <el-input v-model="form.valid" placeholder="验证码"
+                                          @keyup.enter.native="onSubmit"></el-input>
+                                <img id="validImg" :src="valImgSrc" alt="" width="100px" height="42px"
+                                     title="看不清?刷一下试试!" @click="getGenVerifyPic">
+                            </el-form-item>
+                            <br>
+                            <br>
+                            <el-form-item>
+                                <el-button type="primary" @click="onSubmit">登陆</el-button>
+                            </el-form-item>
+                        </el-form>
+                    </el-card>
+                </div>
             </el-main>
             <el-footer></el-footer>
         </el-container>
@@ -31,10 +38,16 @@
 </template>
 
 <script>
-    import { SignIn } from '../api/getApiRes.js'
+    import {
+        SignIn,
+        GenVerifyPic,
+        ManagerSelfQuery
+    } from "../api/getApiRes";
+
     let qs = require('qs');
     import Global from '../Global.js'
 
+
     export default {
         data() {
             return {
@@ -42,13 +55,18 @@
                     name: '',
                     pwd: '',
                     valid: '',
+                    picId: '',
                 },
-                valImgSrc: 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAPAAAABQCAMAAAAQlwhOAAAAP1BMVEUAAACcvA7J6TuszB6gwBKcvA6z0yXC4jSryx2+3jCy0iTG5ji72y3G5jievhCryx2dvQ+buw3N7T+21iioyBqdrAOEAAAAAXRSTlMAQObYZgAAA9BJREFUeJzsW2mP4yAMxT341FTVzP//r6tuJmAbm6sh0CRvpF0pTYDHM76amhMnWsBa23sJm8LagzE+Ce8eR+PbGVOPSa/Xa49p35gmhfGz4aTXa0/G8uXnsyHjroQ17FbhLtg9X2B/uwdQ7J0yhFDv/fn52XRtTVDG9/sZ/xkx+mtN+PXxCJ9BoPir3LoK4derL2PBhn9/I4zVgR65M36BwjmO+/EIGY/o7qNOar5DvifQ6cGfinmDfkgSliIzQOIkzps0YkSPhyEUtIKrL+rd0WeObNp6OiChAhiJ8EJVit2I7IiJKlwuF9Cz6HnVEmMAWWFgCo+m8eXyn7GaY8lCqQqTszukwozw4lndMpW9mC8ECvPdGV9hYDZsvVHjp1T/y0PRcArDfIaJdRr/r7X2/5IDpRTlpNtGY+y9MFf4fcnCYuK5CgfDN1x8DQJrNlhhCN2Sfyx39Cbrvt1uVc9ROpQZOF4B4cwcqp2Xvt0qGHuO6JKQRXIPbjIVrsm0cjeojrBgrLINBnadE2GhIpcOz46CcsJKKRPxvkt0IsavE68yZuRKEigWWHBEJuplmF3r/szQ+qFqVesXWmq1qk4EJHRxwjzbwKl0FecV3TsoFZ+fTn9uvkOMXHQMg89A8UE25Ph8hncdG+tFJBRmxix/X+EUNuQUlKwyJkrJOHOnIjJQTGEcoUnCzdaGtfljjYjMEnpa6gabqE/MwnwIX/oY0cgJvMpfaAb97OV/6+3bzS6lcDBNkx4y5imq6Ca9X8KM6Ek1gvvytAGWd0WwmyNxx9n8NCmM3aJrCEO6a5owofAwUsqBdJZthnJbjLC3jELjBjCKW+bLjxuAOCwqocGg4GUCL+eOv0F2miBMzk9BxSLeCqj6S7sIeTvAN4I4WNxarD0YYpqmBBXI7oL6syOPo3cfsxmjJXnlgLSJPg6ofNO024zPAeID5QicKpK0D9fpTy8BMOa107IFCicmje2I+vy6iTGgxqjUT9LPLxkiT+AMiZX8fM1KYPF9AFIdkzNVwWr4gE82kOTU1jBoYUTA5TPgy1nIfO+LLZ68Hyfvb4Nv1JCuBR6XIv1m31L50wyS8BX6Q62/UXM8i6dIKgxBKGTaAS6oDHaGTVu17UZHqQS6Qj52qRVpeYzWis8FyaAM9+60XKLHq++66wGUst6qH/r74SIIrSy55dH85G4GJqzRIv4uyDognrmF1vejeYTtCf0Npd3y7fx25MY4Ce8eR+N74sSJEydObI37/d57CZvifj8Y48EIt/8971iEt/jF9kh8j/cT9cMQ/hcAAP//l64Pg1y7/TYAAAAASUVORK5CYII=',
+                valImgSrc: '',
+                valImgId: '',
                 overtime: '',
+                userLevel: '',
+                userLevelText: '',
             }
         },
         mounted() {
             this.overtime = new Date();
+            this.getGenVerifyPic();
             // 如果是手动退出用户
             if (this.$route.query.status == 1) {
                 // 刷新验证图
@@ -58,22 +76,33 @@
             }
         },
         methods: {
+            getGenVerifyPic() {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    width: 100,
+                    height: 42,
+                    noiseCount: 10,
+                    length: 4,
+                    source: 123456789,
+                };
+                let postdata = qs.stringify(param);
+                GenVerifyPic(postdata).then(res => {
+                    let json = res;
+                    that.valImgSrc = json.Pic;
+                    that.valImgId = json.Id;
+                    that.form.picId = json.Id;
+                })
+            },
             //            点击验证码切换
             changeValImg: function () {
-                let that = this;
-                that.valImgSrc = that.valImgSrc + '?' + Math.random();
+                // 刷新验证图
+                this.getGenVerifyPic();
             },
             // 登陆
             onSubmit() {
                 this.pwdLoginBtn()
             },
-            // 清除登陆
-            clearForm() {
-                this.form.name = '';
-                this.form.pwd = '';
-                this.form.valid = '';
-                this.changeValImg();
-            },
             // 密码登陆
             pwdLoginBtn() {
                 let that = this;
@@ -87,6 +116,46 @@
                 if (!globalValid(uservalid, 3, 5, '验证码', that)) return;
                 this.loginInfo();
             },
+            getManagerSelfQuery() {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                };
+                let postdata = qs.stringify(param);
+                ManagerSelfQuery(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.userLevelText = json.Rs.Role.Name;
+                        // 1 会员 2 系统 3 店铺 4 教练
+                        that.userLevel = json.Rs.Role.Id;
+                        localStorage.shopId = json.Rs.ShopId;
+                        localStorage.ShopId = json.Rs.ShopId;
+
+                        switch (parseInt(that.userLevel)) {
+                            case 1:
+                                that.$router.push({path: '/'});
+                                break;
+                            case 2:
+                                that.$router.push({path: '/adminManage'});
+                                break;
+                            case 3:
+                                that.$router.push({path: '/'});
+                                break;
+                            case 4:
+                                that.$router.push({path: '/'});
+                                break;
+
+                        }
+                    } else {
+                        if (json.Code == 1010) {
+                            that.$message.error(json.Memo);
+                            that.$router.push({path: '/login', query: {status: 1}});
+                            return false
+                        }
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
             // pwd登陆
             loginInfo: function () {
                 const that = this;
@@ -103,23 +172,21 @@
                     return false
                 }
                 let param = {
-                    'usercode': username,
-                    'passwd': userpwd,
-                    'vcode': uservalid,
-                    'logintype': 1,
-                    'accounttype': 3,
-                    'src': 'pc'
+                    verifyName: username,
+                    verifyCode: userpwd,
+                    picCode: uservalid,
+                    picId: this.form.picId,
+                    channel: 2
                 };
                 let postdata = qs.stringify(param);
                 SignIn(postdata).then(res => {
                     if (res.Code == 0) {
                         that.res = res.Rs;
-                        that.userName = res.Rs.userName;
-                        localStorage.userName = res.Rs.username;
+                        localStorage.userName = username;
                         localStorage.token = res.Rs.token;
-                        that.$router.push({path: '/'});
+                        this.getManagerSelfQuery();
                     } else {
-                        if (json.code == 10005) {
+                        if (res.Code == 10005) {
                             that.$refs.userpwd.value = '';
                             that.$notify({
                                 title: '警告',
@@ -129,7 +196,7 @@
                         } else {
                             that.$notify({
                                 title: '警告',
-                                message: json.memo,
+                                message: res.Memo + ',错误代码:' + res.Code,
                                 type: 'warning'
                             });
                             that.form.valid = '';
@@ -149,7 +216,9 @@
         overflow: hidden;
         display: block;
         margin: 0 auto;
-        background: #333;
+        background-color: #F0F2F5;
+        background: url("../assets/img/login/bg.png") top center no-repeat;
+        background-size: 100% 100%;
     }
 
     .title {
@@ -160,22 +229,31 @@
         margin-bottom: 5px;
     }
 
+    .title img {
+        width: 362px;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+    }
+
     .subtitle {
         width: 100%;
         overflow: hidden;
         display: block;
         margin: 0 auto;
         text-align: center;
-        color: #fff;
-        margin-bottom: 40px;
-        font-size: 14px;
+        color: #414141;
+        margin-bottom: 79px;
+        font-size: 41px;
     }
 
     .box-card {
-        width: 400px;
+        width: 577px;
+        height: 733px;
         overflow: hidden;
-        display: block;
-        margin: 0 auto;
+        float: right;
+        margin-top: 40px;
+        margin-right: 10%;
     }
 
     .box-card .boxTitle {
@@ -186,6 +264,30 @@
     #validImg {
         position: relative;
         float: right;
-        bottom: 35px;
+        bottom: 52px;
+    }
+
+    /deep/ .el-form {
+        width: 422px;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+    }
+
+    /deep/ .el-input__inner {
+        height: 44px;
+        background: #F0F2F5;
+        border-radius: 0;
+        margin-bottom: 10px;
+    }
+
+    /deep/ .el-button--primary {
+        width: 100%;
+        height: 52px;
+        /*line-height: 32px;*/
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        font-size: 18px;
     }
 </style>

+ 1087 - 0
src/views/cost.vue

@@ -0,0 +1,1087 @@
+<template>
+    <div class="context">
+        <div class="panel">
+            <h5>消费记录</h5>
+            <div class="panel-body">
+                <div class="panel_control">
+                    <el-row :gutter="20">
+                        <el-col :span="4">
+                            <em>姓名:</em>
+                            <el-input v-model="panel.name" placeholder="请输入姓名"></el-input>
+                        </el-col>
+                        <el-col :span="4">
+                            <em>手机号:</em>
+                            <el-input v-model="panel.phone" placeholder="请输入手机号"></el-input>
+                        </el-col>
+                        <el-col :span="6">
+                            <em>日期:</em>
+                            <el-date-picker
+                                    v-model="panel.timeScope"
+                                    type="daterange"
+                                    range-separator="至"
+                                    start-placeholder="开始日期"
+                                    end-placeholder="结束日期">
+                            </el-date-picker>
+                        </el-col>
+                        <el-col :span="4">
+                            <em>预约课程:</em>
+                            <el-select v-model="panel.classId">
+                                <el-option
+                                        v-for="item in panel.options"
+                                        :key="item.value"
+                                        :label="item.label"
+                                        :value="item.value">
+                                </el-option>
+                            </el-select>
+                        </el-col>
+                        <el-col :span="4">
+                            <el-button size="" type="primary" @click="query" plain>查询</el-button>
+                        </el-col>
+                    </el-row>
+                </div>
+            </div>
+        </div>
+        <div class="table">
+            <el-table
+                    :data="tableData"
+                    border
+                    is-horizontal-resize
+                    :default-sort="{prop: 'date', order: 'descending'}"
+                    element-loading-background="rgba(0, 0, 0, 0.8)"
+                    class=""
+                    show-summary
+                    :summary-method="getSummaries"
+                    @selection-change="handleSelectionChange"
+
+            >
+                <el-table-column
+                        type="index"
+                        label="序号"
+                        align="center"
+
+                        width="50">
+                </el-table-column>
+                <el-table-column
+                        prop="Name"
+                        label="会员名"
+                >
+                </el-table-column>
+                <el-table-column
+                        prop="Phone"
+                        label="手机号"
+                >
+                </el-table-column>
+                <el-table-column
+                        prop="ClassName"
+                        label="课程"
+                        sortable
+                >
+                    <template slot-scope="scope">
+                        <span class="lessons" :style="{ background:scope.row.ClassColor }">{{scope.row.ClassName}}</span>
+                    </template>
+                </el-table-column>
+                <el-table-column
+                        prop="NormalHour"
+                        label="消费课时"
+                        sortable
+                >
+                </el-table-column>
+                <el-table-column
+                        prop="PreNormalhour"
+                        label="消费前课时"
+                        sortable
+                >
+                </el-table-column>
+                <el-table-column
+                        prop="AfterNormalhour"
+                        label="消费后课时"
+                        sortable
+                >
+                </el-table-column>
+                <el-table-column
+                        prop="GiftHour"
+                        label="消费赠送"
+                        sortable
+                >
+                </el-table-column>
+                <el-table-column
+                        prop="PreGifthour"
+                        label="消费前赠送"
+                        sortable
+                >
+                </el-table-column>
+                <el-table-column
+                        prop="AfterGifthour"
+                        label="消费后赠送"
+                        sortable
+                >
+                </el-table-column>
+                <el-table-column
+                        prop="ShopName"
+                        label="所处门店"
+                        sortable
+                >
+                </el-table-column>
+                <el-table-column
+                        prop="CreatedAt"
+                        label="时间"
+                        width="180"
+                        :formatter="filterFmtDate"
+                        sortable
+                >
+                </el-table-column>
+            </el-table>
+            <br>
+            <el-pagination
+                    background
+                    :total="pageination.total"
+                    :page-size="pageination.pageItem"
+                    @current-change="pageChange"
+            ></el-pagination>
+        </div>
+
+        <el-dialog :title="dialogTitle" :visible.sync="dialogMemberVisible" width="1200px">
+            <div class="dialogContent">
+                <div class="pull-left">
+                    <el-form ref="form" :model="form" label-width="160px">
+                        <el-form-item label="手机号">
+                            <el-input v-model="form.userCode"></el-input>
+                        </el-form-item>
+                        <el-form-item label="会员名">
+                            <el-input v-model="form.name"></el-input>
+                        </el-form-item>
+                        <el-form-item label="会员类型">
+                            <el-select v-model="form.memberType" placeholder="请选择所属门店">
+                                <el-option
+                                        v-for="item in memberTypes"
+                                        :key="item.value"
+                                        :label="item.label"
+                                        :value="item.value"
+                                ></el-option>
+                            </el-select>
+                        </el-form-item>
+                        <el-form-item label="课时">
+                            <el-input-number v-model="form.lesson" :min="0" :max="99999" label="(天)"></el-input-number>
+                        </el-form-item>
+                        <el-form-item label="赠送课时">
+                            <el-input-number v-model="form.gift" :min="0" :max="99999" label="(天)"></el-input-number>
+                        </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 class="dialogFooter">
+                <el-button type="primary" size="small" v-if="form.btnType == 0" @click="confirmMember">确定</el-button>
+                <el-button type="primary" size="small" v-if="form.btnType == 1" @click="confirmEditMember">确定
+                </el-button>
+                <el-button size="small" @click="dialogMemberVisible = false">取消</el-button>
+            </div>
+        </el-dialog>
+
+        <el-dialog :visible.sync="dialogVisible">
+            <div class="dialogTitle">
+                <h5>
+                    用户:
+                    <em class="blue">【 {{form.rowName}}】</em>
+                    <span v-if="dialogLesson">当前课时</span>
+                    <span v-if="dialogGift">当前赠送课时</span>
+                    <span v-if="dialogExpTime">当前到期时间</span>
+                    <span v-if="dialogLessonTable">当前会员课程</span>
+                </h5>
+            </div>
+            <div v-if="dialogLesson">
+                <el-input-number v-model="form.lesson" :min="0" :max="9999" label="课时调整"></el-input-number>
+            </div>
+            <div v-if="dialogGift">
+                <el-input-number v-model="form.gift" :min="0" :max="9999" label="赠送课时调整"></el-input-number>
+            </div>
+
+            <div v-if="dialogExpTime">
+                <el-date-picker
+                        v-model="form.expTime"
+                        type="date"
+                        placeholder="选择日期">
+                </el-date-picker>
+            </div>
+            <div v-if="dialogLessonTable">
+                <el-transfer filterable v-model="form.dialogValue" :data="form.dialogdata"></el-transfer>
+            </div>
+
+            <div class="dialogFooter">
+                <!--                当前课时-->
+                <el-button type="primary" size="small" @click="confirmLesson" v-if="dialogLesson">确定</el-button>
+                <el-button type="primary" size="small" @click="confirmGift" v-if="dialogGift">确定</el-button>
+                <el-button type="primary" size="small" @click="confirmExpTime" v-if="dialogExpTime">确定</el-button>
+                <el-button type="primary" size="small" @click="confirmLessonTable" v-if="dialogLessonTable">确定
+                </el-button>
+                <el-button size="small" @click="dialogVisible = false">取消</el-button>
+            </div>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+    import Global from '../Global.js'
+    import {
+        VipUserConsumeListQuery,
+        testTable,
+        testSelect,
+        ClassListQuery,
+    } from "../api/getApiRes";
+
+    let qs = require('qs');
+    export default {
+        data() {
+            return {
+                dialogVisible: false,//其他dialog
+                dialogMemberVisible: false,//新增会员dialog
+                dialogLesson: false,//课时调整
+                dialogGift: false,//赠送课时调整
+                dialogExpTime: false,//有效期调整
+                dialogLessonTable: false,//会员课程
+                dialogTitle: '新增会员',
+                dialogValue: [],
+                // panel 配置项目
+                panel: {
+                    name: '',
+                    phone: '',
+                    classId: '',
+                    usercode: '',
+                    username: '',
+                    timeScope: globalBt2(30),
+                    compname: '',
+                    keyword: '',
+                    USERCODE: '',
+                    endType: '',
+                    taskstatus: 99,
+                    draw: 1,
+                    start: 0,
+                    recordsTotal: 0,
+                    tableData: [],
+                    allTableData: [],
+                    limit: '10',
+                    multipleSort: false,
+                    loading: false,
+                    fileList: [],
+                    multipleSelection: [],
+                    detectedmac: '',
+                    options: [],
+                    time1: globalBt(),
+                },
+                multipleSelection: [],
+                pageination: {
+                    pageItem: 100,
+                    pageoptions: pageOptions(),
+                    total: 100,
+                    pageIndex: 1,
+                },
+                form: {
+                    name: '',
+                    userCode: '',
+                    shopId: '',
+                    memberType: 1,
+                    lesson: 1,
+                    gift: 1,
+                    btnType: 0,//0新建,1编辑编辑
+                    memo: '',
+                    expTime: '',
+                    dialogdata: [],//穿梭待选
+                    dialogValue: [],//穿梭已选
+                },
+                memberTypes: [
+                    {value: 1, label: '年会员'},
+                    {value: 2, label: '充值会员'},
+                ],
+                tableData: []
+            }
+        },
+        mounted() {
+            this.panelSelect();
+            this.getTableQuery();
+        },
+        methods: {
+            // 编辑
+            editMember(row) {
+                let that = this;
+                this.clearForm();
+
+                this.form.userCode = row.userCode;
+                this.form.name = row.name;
+                this.form.memberType = row.vipType;
+                this.form.lesson = row.Recovered;
+                this.form.gift = row.Recovered;
+                this.form.memo = row.memo;
+                this.form.btnType = 1;
+
+                this.form.shopId = row.Id;
+                this.dialogMemberVisible = true
+                this.dialogTitle = '编辑会员'
+            },
+            // 禁用
+            pauseRow(row) {
+                let that = this;
+                this.$confirm('是否禁用用户' + row.name + '?', '禁用操作', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    let param = {
+                        token: localStorage.token,
+                        Id: row.Id,
+                        status: 0,
+                    };
+                    let postdata = qs.stringify(param);
+                    testTable(postdata).then(res => {
+                        let json = res;
+                        if (json.Code == 0) {
+                            that.$message({
+                                showClose: true,
+                                message: row.name + '禁用成功!',
+                                type: 'success'
+                            });
+                            // table 重载
+                            that.getTableQuery();
+                        } else {
+                            that.$message.error(json.Memo);
+                        }
+                    })
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消禁用'
+                    });
+                });
+            },
+            // 启用
+            runRow(row) {
+                let that = this;
+                this.$confirm('是否启用用户' + row.name + '?', '启用操作', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    let param = {
+                        token: localStorage.token,
+                        Id: row.Id,
+                        status: 1,
+                    };
+                    let postdata = qs.stringify(param);
+                    testTable(postdata).then(res => {
+                        let json = res;
+                        if (json.Code == 0) {
+                            that.$message({
+                                showClose: true,
+                                message: row.name + '启用成功!',
+                                type: 'success'
+                            });
+                            // table 重载
+                            that.getTableQuery();
+                        } else {
+                            that.$message.error(json.Memo);
+                        }
+                    })
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消启用'
+                    });
+                });
+            },
+            // 表格合计
+            getSummaries(param) {
+                const {columns, data} = param;
+                const sums = [];
+                columns.forEach((column, index) => {
+                    if (index === 0) {
+                        sums[index] = '合计';
+                        return;
+                    }
+                    const values = data.map(item => Number(item[column.property]));
+                    if (!values.every(value => isNaN(value)) && index != 0 && index != 1 && index != 2) {
+                        sums[index] = values.reduce((prev, curr) => {
+                            const value = Number(curr);
+                            if (!isNaN(value)) {
+                                return prev + curr;
+                            } else {
+                                return prev;
+                            }
+                        }, 0);
+                        sums[index] += '';
+                        sums[index] = parseInt(sums[index]);
+                    } else {
+                        sums[index] = '';
+                    }
+                });
+                return sums;
+            },
+            // 关闭所有
+            allDialogClose() {
+                this.dialogVisible = false;
+                this.dialogGift = false;
+                this.dialogLesson = false;
+                this.dialogExpTime = false;
+                this.dialogLessonTable = false;
+            },
+            // 用户禁用 todo
+            // 用户启用 todo
+            // 有效期调整
+            ExpTimeChange() {
+                // 仅针对年费用户,使用日期格式
+                this.allDialogClose();
+                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
+                }
+                let row = this.multipleSelection[0];
+                if (parseInt(row.vipType) == 2) {
+                    this.$message({
+                        showClose: true,
+                        message: '错了哦,充值会员不能调整有效期',
+                        type: 'error'
+                    });
+                    return false
+                }
+                this.form.expTime = row.expTime;
+                this.form.rowName = row.name;
+                this.dialogVisible = true;
+                this.dialogExpTime = true;
+            },
+            // 课时调整
+            lessonChange() {
+                this.allDialogClose();
+                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
+                }
+                let row = this.multipleSelection[0];
+                this.form.lesson = row.Recovered;
+                this.form.rowName = row.name;
+                this.dialogVisible = true;
+                this.dialogLesson = true;
+
+            },
+            // 赠送调整
+            giftChange() {
+                this.allDialogClose();
+                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
+                }
+                let row = this.multipleSelection[0];
+                this.form.gift = row.Recovered;
+                this.form.rowName = row.name;
+                this.dialogVisible = true;
+                this.dialogGift = true;
+
+            },
+            // 增删会员课程
+            lessonStudenChange() {
+                this.allDialogClose();
+                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
+                }
+                let row = this.multipleSelection[0];
+                this.form.gift = row.Recovered;
+                this.form.rowName = row.name;
+                this.dialogVisible = true;
+                this.dialogLessonTable = true;
+            },
+            // 确认提交新增会员
+            confirmMember() {
+                let that = this;
+                // checkNum
+                if (!that.form.userCode) {
+                    this.$message.error('错了哦,手机号不能为空');
+                    return false
+                }
+                if (!globalCheckPhone(that.form.userCode)) {
+                    this.$message.error('错了哦,手机号格式不正确');
+                    return false
+                }
+                if (!that.form.name) {
+                    this.$message.error('错了哦,会员名不能为空');
+                    return false
+                }
+                if (that.form.name.length > 8) {
+                    this.$message.error('错了哦,会员名字数超过8个字');
+                    return false
+                }
+                if (that.form.memo) {
+                    if (that.form.memo.length > 200) {
+                        this.$message.error('错了哦,备注字数超过200个字');
+                        return false
+                    }
+                }
+
+                let param = {
+                    token: localStorage.token,
+                    userCode: that.form.userCode,
+                    name: that.form.name,
+                    memberType: that.form.memberType,
+                    lesson: that.form.lesson,
+                    gift: that.form.gift,
+                    memo: that.form.memo,
+                    dialogValue: that.form.dialogValue,
+                };
+                let postdata = qs.stringify(param);
+                testSelect(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        // 关闭弹窗
+                        that.dialogMemberVisible = false;
+                        // 重载列表
+                        that.getTableQuery();
+                        that.$message({
+                            showClose: true,
+                            message: '会员添加成功!',
+                            type: 'success'
+                        });
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
+            confirmEditMember() {
+                console.log(123);
+                let that = this;
+                // checkNum
+                if (!that.form.userCode) {
+                    this.$message.error('错了哦,手机号不能为空');
+                    return false
+                }
+                console.log(that.form.userCode);
+                if (!globalCheckPhone(that.form.userCode)) {
+                    this.$message.error('错了哦,手机号格式不正确');
+                    return false
+                }
+                if (!that.form.name) {
+                    this.$message.error('错了哦,会员名不能为空');
+                    return false
+                }
+                if (that.form.name.length > 8) {
+                    this.$message.error('错了哦,会员名字数超过8个字');
+                    return false
+                }
+                if (that.form.memo) {
+                    if (that.form.memo.length > 200) {
+                        this.$message.error('错了哦,备注字数超过200个字');
+                        return false
+                    }
+                }
+                let param = {
+                    token: localStorage.token,
+                    userCode: that.form.userCode,
+                    name: that.form.name,
+                    memberType: that.form.memberType,
+                    lesson: that.form.lesson,
+                    gift: that.form.gift,
+                    memo: that.form.memo,
+                    dialogValue: that.form.dialogValue,
+                };
+                let postdata = qs.stringify(param);
+                testSelect(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        // 关闭弹窗
+                        that.dialogMemberVisible = false;
+                        // 重载列表
+                        that.getTableQuery();
+                        that.$message({
+                            showClose: true,
+                            message: '会员信息编辑成功!',
+                            type: 'success'
+                        });
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
+            // 确认提交课时
+            confirmLesson() {
+                let that = this;
+                // checkNum
+
+                let param = {
+                    token: localStorage.token,
+                    userCode: that.form.userCode,
+                    lesson: that.form.lesson,
+                };
+                let postdata = qs.stringify(param);
+                testSelect(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        // 关闭弹窗
+                        that.dialogVisible = false;
+                        // 重载列表
+                        that.getTableQuery();
+                        that.$message({
+                            showClose: true,
+                            message: '课时调整成功!',
+                            type: 'success'
+                        });
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
+            // 确认提交赠送
+            confirmGift() {
+                let that = this;
+                // checkNum
+
+                let param = {
+                    token: localStorage.token,
+                    userCode: that.form.userCode,
+                    gift: that.form.gift,
+                };
+                let postdata = qs.stringify(param);
+                testSelect(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        // 关闭弹窗
+                        that.dialogVisible = false;
+                        // 重载列表
+                        that.getTableQuery();
+                        that.$message({
+                            showClose: true,
+                            message: '赠送课时调整成功!',
+                            type: 'success'
+                        });
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
+            // 确认提交有效期
+            confirmExpTime() {
+                let that = this;
+                // checkNum
+
+                let param = {
+                    token: localStorage.token,
+                    userCode: that.form.userCode,
+                    expTime: that.form.expTime,
+                };
+                let postdata = qs.stringify(param);
+                testSelect(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        // 关闭弹窗
+                        that.dialogVisible = false;
+                        // 重载列表
+                        that.getTableQuery();
+                        that.$message({
+                            showClose: true,
+                            message: '赠送课时调整成功!',
+                            type: 'success'
+                        });
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
+            // 确认提交会员课程
+            confirmLessonTable() {
+                let that = this;
+                // checkNum
+
+                let param = {
+                    token: localStorage.token,
+                    userCode: that.form.userCode,
+                    dialogValue: that.form.dialogValue,
+                };
+                let postdata = qs.stringify(param);
+                testSelect(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        // 关闭弹窗
+                        that.dialogVisible = false;
+                        // 重载列表
+                        that.getTableQuery();
+                        that.$message({
+                            showClose: true,
+                            message: '会员课程调整成功!',
+                            type: 'success'
+                        });
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
+            // 加载选项
+            panelSelect() {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                };
+                let postdata = qs.stringify(param);
+                ClassListQuery(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.panel.options = turnClassResToOption(json.Rs);
+                        that.panel.options.unshift({label: "全部", value: ''})
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
+            // 新增会员
+            addMember() {
+                this.clearForm();
+                this.dialogMemberVisible = true
+                this.btnType = 0;
+                this.dialogTitle = '新增会员'
+            },
+            // 删除
+            delList() {
+                let that = this;
+                // checkNum
+                if (!this.multipleSelection.length) {
+                    that.$message({
+                        showClose: true,
+                        message: '错了哦,需要先选中至少一条记录',
+                        type: 'error'
+                    });
+                    return false
+                }
+                if (this.multipleSelection.length != 1) {
+                    that.$message({
+                        showClose: true,
+                        message: '错了哦,只能选中一条记录',
+                        type: 'error'
+                    });
+                    return false
+                }
+
+                let detectorid = that.multipleSelection[0].Id;
+
+                let param = {
+                    token: localStorage.token,
+                    detectorid: detectorid,
+                    status: 9,//0禁用1启用9删除
+                };
+                let postdata = qs.stringify(param);
+
+                this.$confirm('此操作将永久删除该会员, 是否继续?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    testSelect(postdata).then(res => {
+                        let json = res;
+                        if (json.Code == 0) {
+                            that.$message({
+                                showClose: true,
+                                message: '选中的会员已删除!',
+                                type: 'success'
+                            });
+                            // 重载列表
+                            that.getTableQuery();
+                        } else {
+                            that.$message.error(json.Memo);
+                        }
+                    });
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消删除'
+                    });
+                });
+            },
+
+            handleSelectionChange(val) {
+                this.multipleSelection = val;
+            },
+            // 查询按钮
+            query() {
+                this.getTableQuery();
+                this.$message.success('查询完毕');
+            },
+            clearForm() {
+                // clear
+                this.form.name = '';
+                this.form.userCode = '';
+                this.form.shopId = '';
+            },
+            // 页面数据查询
+            getTableQuery() {
+                let that = this;
+                // this.getGetChildRegionSelect(0, 1);
+                that.loading = true;
+                // 查询检测设备。上级区域id,区域id必传。regionid传0,查询supregionid对应所有子区域的检测设备。 如果supregionid,regionid都传0,默认查询企业ID下所有检测设备
+                let param = {
+                    token: localStorage.token,
+                    classId: that.panel.classId,
+                    name: that.panel.name,
+                    phone: that.panel.phone,
+                    bt: nonTfmtDatetoLength(that.panel.timeScope[0], 10) + ' 00:00:01',
+                    et: nonTfmtDatetoLength(that.panel.timeScope[1], 10) + ' 23:59:59',
+                    start: 1,//
+                    tableMax: 9999,//
+                };
+                let postdata = qs.stringify(param);
+                VipUserConsumeListQuery(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.loading = false;
+                        if (json.Rs) {
+                            that.allTableData = json.Rs;
+                            that.recordsTotal = json.Rs.length;
+                        } else {
+                            that.allTableData = [];
+                            that.recordsTotal = 0;
+                        }
+
+                        // 设置分页数据
+                        that.setPaginations();
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
+            // 导出excel
+            btnExpAll() {
+                let that = this;
+                let url = headapi + '?ctl=ajax&mod=czgl&act=czcx_excel';//获取
+                let bt = globaltime2String(that.panel.time1[0]);
+                let et = globaltime2String(that.panel.time1[1]);
+                let usercode = that.panel.usercode;
+                window.location = url + '&bt=' + bt + '&et=' + et + '&usercode=' + usercode;
+            },
+            // 设置分页数据
+            setPaginations() {
+                // 分页属性
+                let that = this;
+                that.pageination.total = that.recordsTotal;
+
+                // 默认分页
+                that.tableData = that.allTableData.filter((item, index) => {
+                    return index < that.pageination.pageItem;
+                });
+            },
+            // 每页显示数量
+            handleSizeChange() {
+                let that = this;
+                that.tableData = that.allTableData.filter((item, index) => {
+                    return index < that.pageination.pageItem;
+                });
+                that.draw = that.pageination.pageItem;
+                that.getTableQuery();
+            },
+            // 翻页
+            pageChange(pageIndex) {
+                let that = this;
+                // 获取当前页
+                let index = that.pageination.pageItem * (pageIndex - 1);
+                // 数据总数
+                let nums = that.pageination.pageItem * pageIndex;
+                // 容器
+                let tables = [];
+                for (var i = index; i < nums; i++) {
+                    if (that.allTableData[i]) {
+                        tables.push(that.allTableData[i])
+                    }
+                    this.tableData = tables;
+                }
+                that.start = index * that.draw;
+                that.getTableQuery();
+            },
+            // 自动排序
+            sortChange(params) {
+                console.log(params)
+            },
+            // 过滤时间
+            filterFmtDate(value, row, column) {
+                let that = this;
+                return nonTfmtDate(column, 11);
+            },
+            // 过滤金额
+            filterMoney(value, row, column) {
+                let that = this;
+                return parseFloat(column).toFixed(2);
+            },
+        },
+        watch: {
+            $route(to) {
+                if (to.name == 'cost') {
+                    this.panelSelect();
+                    this.getTableQuery();
+                }
+            },
+        },
+    }
+</script>
+
+<style scoped>
+    @import "../assets/css/panel.css";
+
+    .context {
+        height: 770px;
+
+        overflow-y: scroll;
+        display: block;
+        margin: 0 auto;
+        background-color: #fff !important;
+        padding: 30px;
+    }
+
+    .panel-body {
+        padding: 20px;
+        background: #F0F2F5;
+    }
+
+    .change {
+        width: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        padding-top: 10px;
+        padding-bottom: 10px;
+    }
+
+    .change button {
+        float: left;
+    }
+
+    .change button.pull-right {
+        float: right;
+    }
+
+    .dialogTitle {
+        width: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        color: #000000;
+        font-size: 18px;
+        text-align: center;
+    }
+
+    .dialogTitle em {
+        float: none;
+        font-style: normal;
+        color: #3799FF;
+        margin: 0;
+    }
+
+    /deep/ .el-transfer-panel__item .el-checkbox__input {
+        left: 40px;
+    }
+
+    .dialogFooter {
+        width: 90%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        margin-top: 10px;
+    }
+
+    .dialogFooter button {
+        float: right;
+        margin-left: 10px;
+    }
+
+    .dialogContent {
+        width: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+    }
+
+    .dialogContent .pull-left {
+        width: 30%;
+        float: left;
+    }
+
+    .dialogContent .pull-right {
+        width: 70%;
+        float: right;
+    }
+
+    .panel /deep/ .el-date-editor--daterange {
+        /*width: 260px;*/
+    }
+
+    /deep/ .el-col-4 {
+        width: 15% !important;
+    }
+
+    .panel /deep/ .el-input__inner {
+        /*width: 130px;*/
+    }
+
+    .panel /deep/ .el-input {
+        /*width: 130px;*/
+    }
+
+    .panel /deep/ .el-select {
+        width: 130px;
+    }
+
+    /deep/ .el-date-editor .el-range-separator {
+        line-height: 22px;
+    }
+    .lessons {
+        padding: 1px 7px;
+        border-radius: 250px;
+        float: left;
+    }
+</style>

+ 794 - 0
src/views/lessonManage.vue

@@ -0,0 +1,794 @@
+<template>
+    <div class="context">
+        <div class="panel">
+            <h5>课程表管理</h5>
+        </div>
+        <div class="change">
+            <el-button type="primary" @click="addLessonTable">新增课程表</el-button>
+            <el-button type="" @click="copy">复制</el-button>
+            <el-button type="" @click="delList">删除</el-button>
+            <el-button type="" @click="query">查询</el-button>
+        </div>
+        <div class="table">
+            <el-table
+                    :data="tableData"
+                    border
+                    is-horizontal-resize
+                    :default-sort="{prop: 'date', order: 'descending'}"
+                    element-loading-background="rgba(0, 0, 0, 0.8)"
+                    class=""
+                    @selection-change="handleSelectionChange"
+            >
+                <el-table-column
+                        type="selection"
+                        width="55">
+                </el-table-column>
+                <el-table-column
+                        type="index"
+                        label="序号"
+                        align="center"
+
+                        width="50">
+                </el-table-column>
+                <el-table-column
+                        prop="Name"
+                        label="日期"
+                >
+                    <template slot-scope="scope">
+                        <div class="rowHeight">
+                            <!--                            已过期-->
+                            <span class="readyTime" v-if="scope.row.Diffweek < 0">
+                               {{scope.row.BeginDate}} - {{scope.row.EndDate}}
+                        </span>
+                            <!--                            已上线-->
+                            <span class="CurTime" v-if="scope.row.Diffweek >= 0">
+                             {{scope.row.BeginDate}} - {{scope.row.EndDate}}
+                        </span>
+                            <!--                            当前进行-->
+                            <i class="curIcon" v-if="scope.row.Status == 1 && scope.row.Diffweek == 0"></i>
+                            <span class="runTime" v-if="scope.row.Status == 2 ">
+                              {{scope.row.BeginDate}} - {{scope.row.EndDate}}
+                        </span>
+                        </div>
+                    </template>
+                </el-table-column>
+                <el-table-column
+                        prop="Name"
+                        label="课程表名称"
+                        sortable
+                >
+                </el-table-column>
+                <el-table-column
+                        prop="CreateColumn.CreatedAt"
+                        label="最后编辑时间"
+                        :formatter="filterFmtDate"
+                        sortable
+                >
+                </el-table-column>
+                <el-table-column
+                        prop="Online"
+                        label="是否上线"
+                >
+                    <!--                    上线状态	0:不上线 1:下线-->
+                    <template slot-scope="scope">
+                        <el-switch
+                                v-model="scope.row.Online"
+                                :active-value="1"
+                                :inactive-value="0"
+                                active-color="#409EFF"
+                                inactive-color="#D9D9D9"
+                                @change=changeWechat($event,scope.row)
+                        >
+                        </el-switch>
+                    </template>
+                </el-table-column>
+                <el-table-column
+                        prop="Status"
+                        label="操作"
+                >
+                    <template slot-scope="scope">
+                        <el-button type="text" v-if="scope.row.Diffweek >= 0" @click="editName(scope.row)">编辑名称
+                        </el-button>
+                        <el-button type="text" v-if="scope.row.Diffweek >= 0" @click="goEdit(scope.row)">修改课程
+                        </el-button>
+                        <el-button type="text" @click="seeWeek(scope.row)">预览本周</el-button>
+                    </template>
+                </el-table-column>
+
+            </el-table>
+            <br>
+            <el-pagination
+                    background
+                    :total="pageination.total"
+                    :page-size="pageination.pageItem"
+                    @current-change="pageChange"
+            ></el-pagination>
+        </div>
+
+        <el-dialog title="发布课程表" :visible.sync="dialogVisible" width="650px">
+            <div class="dialogTitle">
+                <span>{{form.name}}</span>
+            </div>
+            <div>
+                <span class="demonstration">选择发布日期(按周选取)</span>
+                <br>
+                <br>
+                <el-date-picker
+                        v-model="form.week"
+                        type="week"
+                        :picker-options="{'firstDayOfWeek': 1}"
+                        format="yyyy 第 WW 周"
+                        placeholder="选择周">
+                </el-date-picker>
+                <br>
+                <br>
+                <span>
+                    微信可见
+                </span>
+                <el-switch
+                        v-model="form.wechat"
+                        :active-value="1"
+                        :inactive-value="0"
+                        active-color="#409EFF"
+                        inactive-color="#D9D9D9">
+                </el-switch>
+                <span>
+                    微信可预约
+                </span>
+                <el-switch
+                        v-model="form.appoint"
+                        :active-value="1"
+                        :inactive-value="0"
+                        active-color="#409EFF"
+                        inactive-color="#D9D9D9">
+                </el-switch>
+            </div>
+            <div class="dialogFooter">
+                <el-button type="primary" size="small" @click="public">确定</el-button>
+                <el-button @click="dialogVisible = false" size="small">取消</el-button>
+            </div>
+        </el-dialog>
+        <el-dialog title="复制课程表" :visible.sync="dialogCopyVisible" width="650px">
+            <div>
+                <span class="demonstration">选择发布日期(按周选取)</span>
+                <br>
+                <br>
+<!--                todo 禁用当前周以前的选项  disabledDate(date) {
+   return date.getTime() <= Date.now()-86400000;
+ }
+-->
+                <el-date-picker
+                        v-model="copyForm.week"
+                        type="week"
+                        :picker-options="{'firstDayOfWeek': 1}"
+                        format="yyyy 第 WW 周"
+                        placeholder="选择周">
+                </el-date-picker>
+            </div>
+            <div class="dialogFooter">
+                <el-button type="primary" size="small" @click="confirmCopy">确定</el-button>
+                <el-button @click="dialogCopyVisible = false" size="small">取消</el-button>
+            </div>
+        </el-dialog>
+        <el-dialog title="编辑名称" :visible.sync="dialogNameVisible" width="650px">
+            <el-form ref="form" :model="form" label-width="160px">
+                <el-form-item label="课程表名称">
+                    <el-input v-model="form.name"></el-input>
+                </el-form-item>
+            </el-form>
+            <div class="dialogFooter">
+                <el-button type="primary" size="small" @click="confirmName">确定</el-button>
+                <el-button @click="dialogNameVisible = false" size="small">取消</el-button>
+            </div>
+        </el-dialog>
+        <el-dialog title="" :visible.sync="previewShow" width="1200px">
+            <preview  :preview-date="previewDate" :big-title="BigTitle" :small-title="smallTitle" ></preview>
+            <div class="dialogFooter">
+                <el-button @click="previewShow = false" size="small">关闭</el-button>
+            </div>
+        </el-dialog>
+    </div>
+</template>
+
+<script>
+    import Global from '../Global.js'
+    import preview from '../components/preview'
+    import {
+        STTBasicListQuery,
+        STTBasicOfflineEdit,
+        STTBasicStatusEdit,
+        SchoolTimeTableCopy,
+        STTBasicEdit,
+        testSelect,
+        SttPlanPreview,
+        SchoolTimetablePreview,
+    } from "../api/getApiRes";
+
+    let qs = require('qs');
+    export default {
+        data() {
+            return {
+                previewShow: false,
+                previewDate: {},
+                BigTitle: '',
+                smallTitle: '',
+                dialogVisible: false,
+                dialogCopyVisible: false,
+                dialogNameVisible: false,
+                dialogdata: [],
+                dialogValue: [],
+                // panel 配置项目
+                multipleSelection: [],
+                pageination: {
+                    pageItem: 100,
+                    pageoptions: pageOptions(),
+                    total: 100,
+                    pageIndex: 1,
+                },
+                form: {
+                    Id: '',
+                    name: '',
+                    week: '',
+                    wechat: 1,
+                    appoint: 1,
+                },
+                copyForm: {
+                    stbId: '',
+                    Id: '',
+                    name: '',
+                    week: '',
+                    wechat: 1,
+                    appoint: 1,
+                },
+                tableData: []
+            }
+        },
+        mounted() {
+            this.getTableQuery();
+        },
+        methods: {
+            // 编辑名称
+            editName(row) {
+                this.form.name = row.Name;
+                this.form.stbId = row.StbId;
+                this.dialogNameVisible = true;
+            },
+            // 预览本周
+            seeWeek(row) {
+                let that = this;
+                console.log(row);
+                let param = {
+                    token: localStorage.token,
+                    stbId : row.StbId,
+                };
+                let postdata = qs.stringify(param);
+                SchoolTimetablePreview(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.BigTitle = row.Name;
+                        that.smallTitle = row.BeginDate + '至' + row.EndDate;
+                        that.previewDate = json.Rs;
+                        // 前台排序
+                        that.previewDate.SttPreviewClassList.sort((a,b)=>a.ClassIndex-b.ClassIndex);//升序
+                        that.previewShow = true;
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
+            addLessonTable() {
+                this.$router.push({
+                    path: '/editLessonManage', query: {
+                        id: 0
+                    }
+                });
+            },
+            // 删除
+            delList() {
+                let that = this;
+                // checkNum
+                if (!this.multipleSelection.length) {
+                    that.$message({
+                        showClose: true,
+                        message: '错了哦,需要先选中至少一条记录',
+                        type: 'error'
+                    });
+                    return false
+                }
+                if (this.multipleSelection.length != 1) {
+                    that.$message({
+                        showClose: true,
+                        message: '错了哦,只能选中一条记录',
+                        type: 'error'
+                    });
+                    return false
+                }
+
+                let row = that.multipleSelection[0];
+
+                if (row.Diffweek < 0) {
+                    that.$message({
+                        showClose: true,
+                        message: '已过期的课程表不可删除',
+                        type: 'error'
+                    });
+                    return false
+                }
+
+                let param = {
+                    token: localStorage.token,
+                    stbId: row.StbId,
+                    status: 9,//0禁用1启用9删除
+                };
+                let postdata = qs.stringify(param);
+
+                this.$confirm('此操作将永久删除该课程表, 是否继续?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    STTBasicStatusEdit(postdata).then(res => {
+                        let json = res;
+                        if (json.Code == 0) {
+                            that.$message({
+                                showClose: true,
+                                message: '选中的课程表已删除!',
+                                type: 'success'
+                            });
+                            // 重载列表
+                            that.getTableQuery();
+                        } else {
+                            that.$message.error(json.Memo);
+                        }
+                    });
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消删除'
+                    });
+                });
+            },
+            // 提交名称修改
+            confirmName() {
+                let that = this;
+                if (!this.form.name) {
+                    this.$message.error('名称不能为空');
+                    return false
+                }
+                if (this.form.name.length < 3) {
+                    this.$message.error('名称不能小于3个字符');
+                    return false
+                }
+                if (this.form.name.length > 20) {
+                    this.$message.error('名称不能大于20个字符');
+                    return false
+                }
+                let param = {
+                    token: localStorage.token,
+                    stbId: this.form.stbId,
+                    name: this.form.name,
+                };
+                let postdata = qs.stringify(param);
+                STTBasicEdit(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.$message({
+                            showClose: true,
+                            message: '名称修改成功!',
+                            type: 'success'
+                        });
+                        this.getTableQuery();
+                        this.dialogNameVisible = false;
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
+            confirmCopy() {
+                let that = this;
+                let row = this.copyForm;
+
+                if (!row.week) {
+                    that.$message.error('没有选择发布周期');
+                    return false
+                }
+                let param = {
+                    token: localStorage.token,
+                    stbId: row.StbId,
+                    incomingDate: nonTfmtDatetoLength(row.week, 10),//对应日期 字符串 年-月-日 格式,
+                };
+                let postdata = qs.stringify(param);
+                SchoolTimeTableCopy(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.$message({
+                            showClose: true,
+                            message: '课程复制成功!',
+                            type: 'success'
+                        });
+                        this.dialogCopyVisible = false;
+                        this.getTableQuery();
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
+            copy() {
+                let that = this;
+                // checkNum
+                if (!this.multipleSelection.length) {
+                    that.$message({
+                        showClose: true,
+                        message: '错了哦,需要先选中至少一条记录',
+                        type: 'error'
+                    });
+                    return false
+                }
+                if (this.multipleSelection.length != 1) {
+                    that.$message({
+                        showClose: true,
+                        message: '错了哦,只能选中一条记录',
+                        type: 'error'
+                    });
+                    return false
+                }
+                this.dialogCopyVisible = true;
+                this.copyForm = that.multipleSelection[0];
+            },
+            // 发布课程表
+            openLessonTable(row) {
+                this.dialogVisible = true;
+                this.form.name = row.name;
+                this.form.Id = row.Id;
+                this.form.week = '';
+            },
+            // 发布
+            public() {
+                let that = this;
+                if (!this.form.week) {
+                    this.$message({
+                        showClose: true,
+                        message: '错了哦,发布周期不能空',
+                        type: 'error'
+                    });
+                    return false
+                }
+
+                let param = {
+                    token: localStorage.token,
+                    detectorid: this.form.Id,
+                    week: this.form.week,
+                    wechat: this.form.wechat,
+                    appoint: this.form.appoint,
+                };
+                let postdata = qs.stringify(param);
+                testSelect(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.$message({
+                            showClose: true,
+                            message: this.form.name + '已发布!',
+                            type: 'success'
+                        });
+                        // 重载列表
+                        that.getTableQuery();
+                        this.dialogVisible = false;
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                });
+            },
+            // 取消发布
+            unpubilc(row) {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    detectorid: row.Id,
+                    status: 4,//0禁用1启用9删除
+                };
+                let postdata = qs.stringify(param);
+                testSelect(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.$message({
+                            showClose: true,
+                            message: '选中的课程表已复制!',
+                            type: 'success'
+                        });
+                        // 重载列表
+                        that.getTableQuery();
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                });
+            },
+            // 编辑课程表
+            goEdit(row) {
+                // 参数???
+                this.$router.push({
+                    path: '/editLessonManage', query: {
+                        id: row.StbId,
+                        name: row.Name
+                    }
+                });
+            },
+            handleSelectionChange(val) {
+                this.multipleSelection = val;
+            },
+            // 查询按钮
+            query() {
+                this.getTableQuery();
+                this.$message.success('查询完毕');
+            },
+            // 页面数据查询
+            getTableQuery() {
+                let that = this;
+                that.loading = true;
+                let param = {
+                    token: localStorage.token,
+                    start: 1,//
+                    tableMax: 9999,//
+                };
+                let postdata = qs.stringify(param);
+                STTBasicListQuery(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.loading = false;
+                        if (json.Rs) {
+                            that.allTableData = json.Rs;
+                            that.recordsTotal = json.Rs.length;
+                        } else {
+                            that.allTableData = [];
+                            that.recordsTotal = 0;
+                        }
+
+                        // 设置分页数据
+                        that.setPaginations();
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
+            // 设置分页数据
+            setPaginations() {
+                // 分页属性
+                let that = this;
+                that.pageination.total = that.recordsTotal;
+                // 默认分页
+                that.tableData = that.allTableData.filter((item, index) => {
+                    return index < that.pageination.pageItem;
+                });
+            },
+            // 每页显示数量
+            handleSizeChange() {
+                let that = this;
+                that.tableData = that.allTableData.filter((item, index) => {
+                    return index < that.pageination.pageItem;
+                });
+                that.draw = that.pageination.pageItem;
+                that.getTableQuery();
+            },
+            // 翻页
+            pageChange(pageIndex) {
+                let that = this;
+                // 获取当前页
+                let index = that.pageination.pageItem * (pageIndex - 1);
+                // 数据总数
+                let nums = that.pageination.pageItem * pageIndex;
+                // 容器
+                let tables = [];
+                for (var i = index; i < nums; i++) {
+                    if (that.allTableData[i]) {
+                        tables.push(that.allTableData[i])
+                    }
+                    this.tableData = tables;
+                }
+                that.start = index * that.draw;
+                that.getTableQuery();
+            },
+            // 自动排序
+            sortChange(params) {
+                console.log(params)
+            },
+            // 过滤时间
+            filterFmtDate(value, row, column) {
+                let that = this;
+                return nonTfmtDate(column, 11);
+            },
+            // 过滤金额
+            filterMoney(value, row, column) {
+                let that = this;
+                return parseFloat(column).toFixed(2);
+            },
+            // 课程表上下线状态修改
+            changeWechat(e, row) {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    stbId: row.StbId,//
+                    online: e,//
+                };
+                let postdata = qs.stringify(param);
+                STTBasicOfflineEdit(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        let text = parseInt(e) == 1 ? '上线' : '下线';
+                        that.$message({
+                            showClose: true,
+                            message: '当前课程表已' + text,
+                            type: 'success'
+                        });
+                        // 重载列表
+                        that.getTableQuery();
+                    } else {
+                        that.$message.error(json.Memo);
+                        row.Online = 0;
+                    }
+                })
+            },
+        },
+        watch: {
+            $route(to) {
+                if (to.name == 'lessonManage') {
+                    this.getTableQuery();
+                }
+            },
+        },
+        components: {
+            preview
+        }
+    }
+</script>
+
+<style scoped>
+    @import "../assets/css/panel.css";
+
+    .context {
+        height: 770px;
+        overflow-y: scroll;
+
+        display: block;
+        margin: 0 auto;
+        background-color: #fff !important;
+        padding: 30px;
+        padding-bottom: 60px;
+    }
+
+    .panel-body {
+        padding: 20px;
+        background: #F0F2F5;
+    }
+
+    .change {
+        width: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        padding-top: 10px;
+        padding-bottom: 10px;
+    }
+
+    .change button {
+        float: left;
+    }
+
+    .change button.pull-right {
+        float: right;
+    }
+
+    .dialogTitle {
+        width: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        color: #000000;
+        font-size: 18px;
+        text-align: center;
+    }
+
+    .dialogTitle span {
+        width: 169px;
+        height: 40px;
+        line-height: 40px;
+        text-align: center;
+        color: #fff;
+        background: #3799FF;
+        border-radius: 250px;
+        font-size: 18px;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        margin-bottom: 30px;
+    }
+
+    .dialogTitle em {
+        float: none;
+        font-style: normal;
+        color: #3799FF;
+        margin: 0;
+    }
+
+    /deep/ .el-transfer-panel__item .el-checkbox__input {
+        left: 40px;
+    }
+
+    .dialogFooter {
+        width: 90%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        margin-top: 10px;
+    }
+
+    .dialogFooter button {
+        float: right;
+        margin-left: 10px;
+    }
+
+    .link {
+        color: #03B1FF;
+        text-decoration: underline;
+    }
+
+    .readyTime {
+        width: 90%;
+        height: 30px;
+        line-height: 30px;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        border: 1px solid #FFC769;
+        border-radius: 4px;
+        background: #FFF0D6;
+        text-indent: 14px;
+    }
+
+    .CurTime {
+        width: 90%;
+        height: 27px;
+        line-height: 30px;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        border: 1px solid #3799FF;
+        border-radius: 4px;
+        background: #D9ECFF;
+        padding: 3px 6px;
+        text-indent: 14px;
+    }
+
+    .runTime {
+        width: 90%;
+        height: 30px;
+        line-height: 30px;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        border: 1px solid #3799FF;
+        border-radius: 4px;
+        background: #D9ECFF;
+        padding: 3px 6px;
+        text-indent: 14px;
+    }
+
+    .curIcon {
+        position: relative;
+        left: 4px;
+        top: -34px;
+        width: 24px;
+        height: 24px;
+        float: left;
+        background: url("../assets/img/lessonTable/star.png") top center no-repeat;
+        background-size: 100% 100%;
+    }
+
+    .rowHeight {
+        width: 220px;
+        overflow: hidden;
+        display: block;
+        height: 35px;
+        float: left;
+        margin: 0;
+
+    }
+</style>