Pārlūkot izejas kodu

Signed-off-by: Changpeng Duan <838560574@qq.com>

Changpeng Duan 5 gadi atpakaļ
vecāks
revīzija
5f4606d3d7
3 mainītis faili ar 1014 papildinājumiem un 17 dzēšanām
  1. 7 0
      pc/src/router/index.js
  2. 935 0
      pc/src/views/coach.vue
  3. 72 17
      pc/src/views/lessonManage.vue

+ 7 - 0
pc/src/router/index.js

@@ -90,6 +90,13 @@ const routes = [
                 meta: {
                     title: "课程表管理",
                 }
+            },{
+                path: '/coach',
+                name: 'coach',
+                component: () => import('@/views/coach.vue'),
+                meta: {
+                    title: "教练管理",
+                }
             },{
                 path: '/yhgl',
                 name: 'Yhgl',

+ 935 - 0
pc/src/views/coach.vue

@@ -0,0 +1,935 @@
+<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.USERCODE" placeholder="请输入姓名"></el-input>
+                        </el-col>
+                        <el-col :span="4">
+                            <em>手机号:</em>
+                            <el-input v-model="panel.keyword" placeholder="请输入手机号"></el-input>
+                        </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="change">
+            <el-button @click="addMember" type="primary">新增教练</el-button>
+            <el-button @click="delList">删除教练</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
+                        prop="name"
+                        label="教练"
+                >
+                </el-table-column>
+                <el-table-column
+                        prop="tel"
+                        label="手机号"
+                        sortable
+                >
+                </el-table-column>
+                <el-table-column
+                        prop="Recovered"
+                        label="上课总时长(h)"
+                        width="180"
+                        sortable
+                >
+                </el-table-column>
+                <el-table-column
+                        prop="Status"
+                        label="操作"
+                >
+                    <template slot-scope="scope">
+                        <el-button type="text" @click="editMember(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="dialogTitle" :visible.sync="dialogMemberVisible" width="640">
+            <div class="dialogContent">
+                <div class="">
+                    <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-input-number v-model="form.lesson" :min="0" :max="99999" label="(天)"></el-input-number>-->
+<!--                        </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 {
+        testTable,
+        testSelect
+    } 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: {
+                    usercode: '',
+                    username: '',
+                    compname: '',
+                    keyword: '',
+                    USERCODE: '',
+                    endType: '',
+                    taskstatus: 99,
+                    draw: 1,
+                    start: 0,
+                    recordsTotal: 0,
+                    tableData: [],
+                    allTableData: [],
+                    limit: '10',
+                    multipleSort: false,
+                    loading: false,
+                    fileList: [],
+                    multipleSelection: [],
+                    detectedmac: '',
+                    options: [
+                        {value: 99, label: '全部'},
+                        {value: 1, label: '进行中'},
+                        {value: 2, label: '已完成'},
+                    ],
+                    endTypeOptions: [
+                        {value: 99, label: '全部'},
+                        {value: 30, label: '近一个月'},
+                        {value: 7, label: '近一周'},
+                        {value: 1, label: '当日'},
+                    ],
+                    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: '已取消启用'
+                    });
+                });
+            },
+            // 关闭所有
+            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);
+                testSelect(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.form.dialogdata = json.Rs;
+                    } 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,
+                    supregionid: 0,//
+                    regionid: this.panel.regionid,//
+                    comid: 1,//
+                    tagname: that.panel.tagname,//标签名
+                    start: 1,//
+                    tableMax: 9999,//
+                };
+                let postdata = qs.stringify(param);
+                testTable(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 globalfmtDate(column, 11);
+            },
+            // 过滤金额
+            filterMoney(value, row, column) {
+                let that = this;
+                return parseFloat(column).toFixed(2);
+            },
+        },
+    }
+</script>
+
+<style scoped>
+    @import "../assets/css/panel.css";
+
+    .context {
+        overflow: hidden;
+        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;
+    }
+</style>

+ 72 - 17
pc/src/views/lessonManage.vue

@@ -32,16 +32,18 @@
                         label="日期"
                 >
                     <template slot-scope="scope">
+                        <div class="rowHeight">
                         <span class="readyTime" v-if="scope.row.Status == 0">
                                {{scope.row.name}}
                         </span>
-                        <span class="CurTime" v-if="scope.row.Status == 1">
+                            <span class="CurTime" v-if="scope.row.Status == 1">
                                {{scope.row.name}}
                         </span>
-                        <i class="curIcon" v-if="scope.row.Status == 1"></i>
-                        <span class="runTime" v-if="scope.row.Status == 2">
+                            <i class="curIcon" v-if="scope.row.Status == 1"></i>
+                            <span class="runTime" v-if="scope.row.Status == 2">
                             {{scope.row.name}}
                         </span>
+                        </div>
                     </template>
                 </el-table-column>
                 <el-table-column
@@ -56,7 +58,23 @@
                         sortable
                 >
                 </el-table-column>
-
+                <el-table-column
+                        prop="wxVisible"
+                        label="微信可见"
+                        width="140px"
+                >
+                    <template slot-scope="scope">
+                        <el-switch
+                                v-model="scope.row.wxVisible"
+                                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="操作"
@@ -145,12 +163,12 @@
                     total: 100,
                     pageIndex: 1,
                 },
-                form:{
-                    Id:'',
-                    name:'',
-                    week:'',
-                    wechat:1,
-                    appoint:1,
+                form: {
+                    Id: '',
+                    name: '',
+                    week: '',
+                    wechat: 1,
+                    appoint: 1,
                 },
                 tableData: []
             }
@@ -196,7 +214,7 @@
                 };
                 let postdata = qs.stringify(param);
 
-                this.$confirm('此操作将永久删除该课程表模板, 是否继续?', '提示', {
+                this.$confirm('此操作将永久删除该课程表, 是否继续?', '提示', {
                     confirmButtonText: '确定',
                     cancelButtonText: '取消',
                     type: 'warning'
@@ -279,7 +297,7 @@
                 });
             },
             // 发布课程表
-            openLessonTable(row){
+            openLessonTable(row) {
                 this.dialogVisible = true;
                 this.form.name = row.name;
                 this.form.Id = row.Id;
@@ -335,7 +353,7 @@
                     if (json.Code == 0) {
                         that.$message({
                             showClose: true,
-                            message: '选中的课程表模板已复制!',
+                            message: '选中的课程表已复制!',
                             type: 'success'
                         });
                         // 重载列表
@@ -345,7 +363,7 @@
                     }
                 });
             },
-            // 编辑课程表模板
+            // 编辑课程表
             goEdit(row) {
                 this.$router.push({
                     path: '/editLessonTable', query: {
@@ -443,6 +461,30 @@
                 let that = this;
                 return parseFloat(column).toFixed(2);
             },
+            // 微信可见与否
+            changeWechat(e, row) {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    id: row.id,//
+                    wxVisible: e,//
+                };
+                let postdata = qs.stringify(param);
+                testTable(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.$message({
+                            showClose: true,
+                            message: '当前用户微信已' + json.Memo,
+                            type: 'success'
+                        });
+                        // 重载列表
+                        that.getTableQuery();
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
         },
     }
 </script>
@@ -533,6 +575,7 @@
         color: #03B1FF;
         text-decoration: underline;
     }
+
     .readyTime {
         width: 90%;
         overflow: hidden;
@@ -541,7 +584,9 @@
         border: 1px solid #FFC769;
         border-radius: 4px;
         background: #FFF0D6;
+        text-indent: 14px;
     }
+
     .CurTime {
         width: 90%;
         overflow: hidden;
@@ -551,7 +596,9 @@
         border-radius: 4px;
         background: #D9ECFF;
         padding: 3px 6px;
+        text-indent: 14px;
     }
+
     .runTime {
         width: 90%;
         overflow: hidden;
@@ -561,16 +608,24 @@
         border-radius: 4px;
         background: #D9ECFF;
         padding: 3px 6px;
+        text-indent: 14px;
     }
+
     .curIcon {
         position: relative;
-        left: 13px;
+        left: 5px;
         top: -30px;
         width: 24px;
         height: 24px;
         float: left;
-        background: url("../assets/img/lessonTable/star.png")top center no-repeat;
+        background: url("../assets/img/lessonTable/star.png") top center no-repeat;
         background-size: 100% 100%;
-
+    }
+    .rowHeight {
+        width: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        height: 35px;
     }
 </style>