Forráskód Böngészése

获取设备的uuid

Changpeng Duan 5 éve
szülő
commit
ad725ed710

+ 2 - 2
pc/src/api/Navs.js

@@ -20,7 +20,7 @@ let navs = [
     }, {
         "clmid": "3",
         "clmcode": "lesson",
-        "clmname": "课管理",
+        "clmname": "课管理",
         "clmurl": "/lesson",
         "prname": "",
         "show": 3,
@@ -168,7 +168,7 @@ let navs = [
     }, {
         "clmid": "3",
         "clmcode": "lesson",
-        "clmname": "课管理",
+        "clmname": "课管理",
         "clmurl": "/lesson",
         "prname": "",
         "show": 4,

+ 6 - 0
pc/src/api/getApiRes.js

@@ -680,4 +680,10 @@ export function UnBindHrSensorsToUser(postdata) {
     return getApiBasic(url, postdata);
 }
 
+// 上课未预约会员绑定心率带后再确认
+export function ClassDetailAndSnAdd(postdata) {
+    let url = headapi + 'v1/SchoolTimeTable/ClassDetailAndSnAdd ';
+    return getApiBasic(url, postdata);
+}
+
 

+ 18 - 2
pc/src/router/index.js

@@ -172,7 +172,7 @@ const routes = [
                     title: "课程管理",
                     clmid: "10",
                 }
-            },{
+            }, {
                 path: '/classPrepare',
                 name: 'classPrepare',
                 component: () => import('@/views/classPrepare.vue'),
@@ -180,7 +180,7 @@ const routes = [
                     title: "准备上课",
                     clmid: "10",
                 }
-            },{
+            }, {
                 path: '/classInfoDetail',
                 name: 'classInfoDetail',
                 component: () => import('@/views/classInfoDetail.vue'),
@@ -188,6 +188,14 @@ const routes = [
                     title: "课程成绩",
                     clmid: "10",
                 }
+            }, {
+                path: '/courseEdit',
+                name: 'courseEdit',
+                component: () => import('@/views/courseEdit.vue'),
+                meta: {
+                    title: "课程管理",
+                    clmid: "10",
+                }
             }, {
                 path: '/heartEquip',
                 name: 'heartEquip',
@@ -204,6 +212,14 @@ const routes = [
                     title: "设备记录",
                     clmid: "10",
                 }
+            }, {
+                path: '/bindRecord',
+                name: 'bindRecord',
+                component: () => import('@/views/bindRecord.vue'),
+                meta: {
+                    title: "绑定记录",
+                    clmid: "10",
+                }
             }, {
                 path: '/region',
                 name: 'region',

+ 1 - 1
pc/src/views/Lesson.vue

@@ -1,7 +1,7 @@
 <template>
   <div class="context">
     <div class="panel">
-      <h5>课管理</h5>
+      <h5>课管理</h5>
     </div>
     <div class="change">
       <el-button type="primary" @click="addLesson" v-if="userLevel != 4">新增课程</el-button>

+ 978 - 0
pc/src/views/bindRecord.vue

@@ -0,0 +1,978 @@
+<template>
+    <div class="context">
+        <div class="panel">
+            <h5>绑定记录</h5>
+            <div class="panel-body" v-if="false">
+                <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="请输入手机号" type="number"></el-input>
+                        </el-col>
+                        <el-col :span="7">
+                            <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 :disabled="serachBtnStatus">查询
+                            </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=""
+                    @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="sn"
+                        label="序列号"
+                >
+                </el-table-column>
+                <el-table-column
+                        prop="ClassName"
+                        label="课程"
+                        width="110"
+                        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="CreatedAt"
+                        label="绑定时间"
+                        width="180"
+                        :formatter="filterFmtDate"
+                        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>
+    </div>
+</template>
+
+<script>
+    import Global from '../Global.js'
+    import {
+        VipUserConsumeListQuery,
+        testTable,
+        testSelect,
+        ClassListQuery,
+    } from "../api/getApiRes";
+
+    let qs = require('qs');
+    export default {
+        data() {
+            return {
+                serachBtnStatus: false,
+                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.tableRadio;
+                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.tableRadio;
+                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.tableRadio;
+                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.tableRadio;
+                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,
+                    classType: 1//去掉午休
+                };
+                let postdata = qs.stringify(param);
+                ClassListQuery(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        if (json.Rs == null) return false
+                        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.tableRadio.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() {
+                // 按钮倒计时
+                let that = this;
+                that.serachBtnStatus = true;
+                let totalTime = 2
+                let clock = window.setInterval(() => {
+                    totalTime--
+                    if (totalTime < 0) {
+                        totalTime = 2;
+                        that.serachBtnStatus = false;
+                    }
+                }, 1000)
+                this.getTableQuery();
+                this.$message.success('查询完毕');
+            },
+            clearForm() {
+                // clear
+                this.form.name = '';
+                this.form.userCode = '';
+                this.form.shopId = '';
+            },
+            // 页面数据查询
+            getTableQuery() {
+                let that = this;
+                that.loading = true;
+                let param = {
+                    token: localStorage.token,
+                    classId: that.router.query.classId,
+                    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;
+        color: #000;
+    }
+</style>

+ 198 - 3
pc/src/views/courseEdit.vue

@@ -28,7 +28,8 @@
                 </div>
             </div>
             <div class="change">
-                <el-button @click="addFinish">确认下课</el-button>
+                <el-button @click="addFinish">确认上课</el-button>
+                <!--<el-button @click="addFinish">确认下课</el-button>-->
                 <el-button @click="addFinishMember">添加上课会员</el-button>
             </div>
         </div>
@@ -51,6 +52,7 @@
                 <el-table-column
                         prop="head"
                         label="头像"
+                        width="140"
                         align="center"
                         sortable
                 >
@@ -62,12 +64,21 @@
                 <el-table-column
                         prop="Name"
                         label="会员名"
+                        width="90"
+                        sortable
+                >
+                </el-table-column>
+                <el-table-column
+                        prop="Phone"
+                        label="手机号"
+                        width="140"
                         sortable
                 >
                 </el-table-column>
                 <el-table-column
                         prop="ClassName"
                         label="课程"
+                        width="140"
                         sortable
                 >
                     <template slot-scope="scope">
@@ -88,6 +99,29 @@
                         sortable
                 >
                 </el-table-column>
+                <el-table-column
+                        prop="BindId"
+                        label="心率带"
+                        sortable
+                >
+                    <template slot-scope="scope">
+                        <el-select v-model="scope.row.BindId" @change="bindSensorToUser(scope.row)" filterable
+                                   v-if="!scope.row.BindId" placeholder="请选心率带">
+                            <el-option
+                                    v-for="item in panel.bindList"
+                                    :key="item.HrId"
+                                    :label="item.InVenueNo"
+                                    :value="item.HrId">
+                            </el-option>
+                        </el-select>
+
+                        <el-button @click="takeBack(scope.row)" type="danger" v-if="scope.row.BindId"
+                                   icon="el-icon-cpu">
+                            {{scope.row.Name}}
+                            设备收回
+                        </el-button>
+                    </template>
+                </el-table-column>
                 <el-table-column
                         prop="Status"
                         label="状态"
@@ -151,6 +185,12 @@
         ClassOverDetailListQuery,
         VipUserSimpleQuery,
         ClassOverDetailAdd,
+        ClassDetailAndSnAdd,
+        ClassOverDetailStatusEdit,
+        ClassOverDetailDel,
+        SelectHrSensors,
+        BindHrSensorsToUser,
+        UnBindHrSensorsToUser,
     } from "../api/getApiRes";
 
     let qs = require('qs');
@@ -192,6 +232,7 @@
                     multipleSort: false,
                     loading: false,
                     fileList: [],
+                    bindList: [],
                     multipleSelection: [],
                     detectedmac: '',
                     BeginTime: '',
@@ -239,9 +280,82 @@
         },
         mounted() {
             this.getTableQuery();
+            this.getSelectHrSensors();
             this.title = this.$route.query.ClassName + ' ' + this.$route.query.BeginStr + '-' + this.$route.query.EndStr;
         },
         methods: {
+            // 获取心率带列表
+            bindSensorToUser(row) {
+                let that = this;
+                let Sn = '';
+                let obj = {};
+                obj = this.panel.bindList.find((item) => {
+                    return item.HrId === row.BindId;
+                });
+                let param = {
+                    token: localStorage.token,
+                    cfId: row.CfId,
+                    userId: row.UserId,
+                    sn: obj.Sn,
+                    hrId: row.BindId,
+                };
+                let postdata = qs.stringify(param);
+                BindHrSensorsToUser(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.$message({
+                            showClose: true,
+                            message: '心率带绑定成功!',
+                            type: 'success'
+                        });
+                        // table 重载
+                        that.getTableQuery();
+                        // 重置心率带可选列表
+                        that.getSelectHrSensors();
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
+            // 设备回收
+            takeBack(row) {
+                let that = this;
+                this.$confirm('是否回收用户' + row.Name + '的心率设备?', '回收操作', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    let param = {
+                        token: localStorage.token,
+                        cfId: row.CfId,
+                        bindId: row.BindId,
+                        userId: row.UserId,
+                        sn: row.Sn,
+                    };
+                    let postdata = qs.stringify(param);
+                    UnBindHrSensorsToUser(postdata).then(res => {
+                        let json = res;
+                        if (json.Code == 0) {
+                            that.$message({
+                                showClose: true,
+                                message: '心率带' + row.Sn + '回收成功!',
+                                type: 'success'
+                            });
+                            // table 重载
+                            that.getTableQuery();
+                            // 重置心率带可选列表
+                            that.getSelectHrSensors();
+                        } else {
+                            that.$message.error(json.Memo);
+                        }
+                    })
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消回收'
+                    });
+                });
+            },
             // 确认下课
             addFinish() {
                 // this.clearForm();
@@ -322,9 +436,63 @@
                     }
                 })
             },
-            pauseRow() {
+            pauseRow(row, status) {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    stdId: this.$route.query.StdId,
+                    cfId: row.CfId,
+                    status: status,
+                };
+                let postdata = qs.stringify(param);
+                ClassOverDetailStatusEdit(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.$message({
+                            showClose: true,
+                            message: '执行成功!',
+                            type: 'success'
+                        });
+                        // table 重载
+                        that.getTableQuery();
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
             },
-            getClassOverDetailDel() {
+            // 下课记录详情删除
+            getClassOverDetailDel(row) {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    stdId: row.StdId,
+                    cfId: row.CfId,
+                };
+                this.$confirm('是否删除用户  ' + row.Name + '  的下课记录?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    let postdata = qs.stringify(param);
+                    ClassOverDetailDel(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: '已取消删除'
+                    });
+                });
             },
             // 查询按钮
             query() {
@@ -375,6 +543,33 @@
                     }
                 })
             },
+            // 获取心率带下拉菜单
+            getSelectHrSensors() {
+                let that = this;
+                that.loading = true;
+                let param = {
+                    token: localStorage.token,
+                };
+                let postdata = qs.stringify(param);
+                SelectHrSensors(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.loading = false;
+                        if (json.Rs) {
+                            that.panel.bindList = json.Rs;
+                            that.panel.bindList.push({
+                                HrId: 0,
+                                InVenueNo: '请选择心率带'
+                            });
+                            console.log(that.panel.bindList);
+                        } else {
+                            that.panel.bindList = [];
+                        }
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
             // 设置分页数据
             setPaginations() {
                 // 分页属性

+ 9 - 4
pc/src/views/courses.vue

@@ -297,7 +297,8 @@
                 this.className = row.ClassName + ' ' + row.BeginStr + ' - ' + row.EndStr;
                 this.form.StdId = row.StdId;
                 this.getQueryShopVenue();
-                this.form.svList = row.SvId;
+                console.log( row.SvId);
+                this.form.svId = row.SvId;
                 this.form.classType = row.ClassType;
                 this.form.pkNum = row.PkNum;
             },
@@ -320,8 +321,6 @@
                     pkNum: uppkNum,
                 };
                 let postdata = qs.stringify(param);
-                console.log(that.form.BeginStr);
-                return false
                 ClassStartPrepare(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
@@ -329,7 +328,8 @@
                         that.dialogMemberVisible = false;
                         this.getTableQuery();
                         this.$router.push({
-                            path: '/courseEdit', query: {
+                            path: '/courseEdit',
+                            query: {
                                 StdId:  that.form.StdId,
                                 ClassName:  that.form.ClassName,
                                 BeginStr:  that.form.BeginStr,
@@ -448,6 +448,11 @@
                 this.form.classType = 1;
                 this.form.pkNum = "";
 
+                this.form.StdId = row.StdId;
+                this.form.ClassName= row.ClassName;
+                this.form.BeginStr= row.BeginStr;
+                this.form.EndStr= row.EndStr;
+
                 this.className = row.ClassName + ' ' + row.BeginStr + ' - ' + row.EndStr;
                 this.form.StdId = row.StdId;
                 this.getQueryShopVenue();

+ 14 - 4
tv/src/views/Index.vue

@@ -39,31 +39,40 @@
             }
         },
         mounted() {
-
             this.getCurVersion();
         },
         methods: {
             // 获取当前版本号
             getCurVersion() {
                 let that = this;
-
+                localStorage.eqSn = '30:9C:23:0C:8B:1E';
                 function plusReady() {
+                    // if(typeof plus == 'undefined') return false;
                     // 获取本地应用资源版本号
                     plus.runtime.getProperty(plus.runtime.appid, function (inf) {
                         localStorage.version = inf.version;
                         that.curVersion = inf.version;
                     });
 
-                    if (this.autoUpdate) {
+                    if (false) {
                         that.checkUpdate();
                     }
 
                     //   获取手机UUID
                     plus.device.getInfo({
                         success: function (e) {
+                            let uuid = JSON.stringify(e.uuid).toString().substr(1);
+                            uuid = uuid.substring(0,uuid.length-1)
+                            localStorage.eqSn = uuid;
+                            console.log('===== uuid =====:'+uuid);
+                            // const h = this.$createElement;
+                            // that.$notify({
+                            //     title: '获取UUID',
+                            //     message: h('i', {style: 'color: teal'}, 'uuid:'+JSON.stringify(e).uuid)
+                            // });
                             // 8e501b0bde9ce600
                             // 打印uuid
-                            // console.log('getDeviceInfo success: ' + JSON.stringify(e));
+                            console.log('getDeviceInfo success: ' + JSON.stringify(e.uuid));
                         },
                         fail: function (e) {
                             console.log('getDeviceInfo failed: ' + JSON.stringify(e));
@@ -76,6 +85,7 @@
                     plusReady();
                 } else {
                     console.log('mui is not ready');
+                    plusReady();
                     document.addEventListener('plusready', plusReady, false);
                 }
             },

+ 45 - 3
tv/src/views/Main.vue

@@ -124,7 +124,12 @@
 
 <script>
     import Headside from '@/components/Headside'
-    import {getHello, getRecordBreak} from '@/api/getApiRes'
+    import
+    {
+        getHello,
+        getRecordBreak,
+        // getClassStat
+    } from '@/api/getApiRes'
     import newRecord from '@/components/newRecord'
     import '../libs/rem';
     import '../Global'
@@ -213,6 +218,7 @@
             if (this.trueDate) {
                 this.timer = setInterval(() => {
                     this.GetgetUserList();
+                    // this.curgetClassStat();
                 }, 1000);
 
                 this.timer2 = setInterval(() => {
@@ -285,7 +291,7 @@
                 let that = this;
                 let param = {
                     token: localStorage.token,
-                    eqSn: this.eqSn
+                    eqSn: localStorage.eqSn
                 };
                 let postdata = qs.stringify(param);
                 getRecordBreak(postdata).then(res => {
@@ -317,7 +323,7 @@
                 let that = this;
                 let param = {
                     token: localStorage.token,
-                    eqSn: this.eqSn
+                    eqSn:localStorage.eqSn
                 };
                 let postdata = qs.stringify(param);
 
@@ -349,6 +355,7 @@
                         // this.createEgg(that.students[4]);
                     } else {
                         // 已下课
+                        console.log(json.Code);
                         if (json.Code == '999') {
                             that.$router.push({path: '/rank'});
                         } else {
@@ -358,6 +365,39 @@
                     }
                 })
             },
+            // curgetClassStat() {
+            //     let that = this;
+            //     let param = {
+            //         token: localStorage.token,
+            //         eqSn: localStorage.eqSn
+            //     };
+            //     let postdata = qs.stringify(param);
+            //     getClassStat(postdata).then(res => {
+            //         let json = res;
+            //         if (json.Code == 0) {
+            //             // 没开课
+            //             if (!json.ClassOn) return false
+            //             // 上课了
+            //             // 1:团课
+            //             // 2:竞技课PK
+            //             // 3:私教课
+            //             switch (parseInt(json.Rs.ClassType)) {
+            //                 case 1:
+            //                     that.$router.push({path: '/'});
+            //                     break;
+            //                 case 2:
+            //                     that.$router.push({path: '/pk'});
+            //                     break;
+            //                 case 3:
+            //                     that.$router.push({path: '/'});
+            //                     break;
+            //             }
+            //
+            //         } else {
+            //             // that.$message.error(json.Memo);
+            //         }
+            //     })
+            // },
             // 给每一个数据加类名,一次遍历全部赋值
             giveClassName(res) {
                 let that = this;
@@ -451,6 +491,7 @@
                     // return parseFloat(val).toFixed(3);
                 }
             },
+
         },
         watch: {
             '$route': function (val) {
@@ -458,6 +499,7 @@
                     if (this.trueDate) {
                         this.timer = setInterval(() => {
                             this.GetgetUserList();
+                            // this.curgetClassStat();
                         }, 1000);
                         this.GetgetUserList();
                     } else {

+ 7 - 2
tv/src/views/Rank.vue

@@ -133,7 +133,7 @@
             getClassUserRank() {
                 let that = this;
                 let param = {
-                    eqSn: this.eqSn
+                    eqSn: localStorage.eqSn
                 };
                 let postdata = qs.stringify(param);
                 ClassUserRank(postdata).then(res => {
@@ -141,7 +141,12 @@
                     if (json.Code == 0) {
 
                     } else {
-                        that.$message.error(json.Memo);
+                        if (json.Code == '999') {
+                            that.$router.push({path: '/wait'});
+                        } else {
+                            // 已出错
+                            that.$message.error(json.Memo);
+                        }
                     }
                 })
             }

+ 6 - 6
tv/src/views/Wait.vue

@@ -251,7 +251,7 @@
             GetgetUserList() {
                 let that = this;
                 let param = {
-                    eqSn: this.eqSn,
+                    eqSn: localStorage.eqSn,
                     token: localStorage.token,
                 };
                 let postdata = qs.stringify(param);
@@ -268,7 +268,7 @@
             GetHerosRankingQuery() {
                 let that = this;
                 let param = {
-                    eqSn: this.eqSn,
+                    eqSn: localStorage.eqSn,
                     dispNum: 3
                 };
                 let postdata = qs.stringify(param);
@@ -284,7 +284,7 @@
             GetUserRankingQuery() {
                 let that = this;
                 let param = {
-                    eqSn: '30:9C:23:0C:8B:1E',
+                    eqSn: localStorage.eqSn,
                     dispNum: 7
                 };
                 let postdata = qs.stringify(param);
@@ -300,7 +300,7 @@
             GetCalorieStatsQuery() {
                 let that = this;
                 let param = {
-                    eqSn: '30:9C:23:0C:8B:1E',
+                    eqSn: localStorage.eqSn,
                 };
                 let postdata = qs.stringify(param);
                 CalorieStatsQuery(postdata).then(res => {
@@ -316,14 +316,14 @@
                 let that = this;
                 let param = {
                     token: localStorage.token,
-                    eqSn: this.eqSn
+                    eqSn: localStorage.eqSn
                 };
                 let postdata = qs.stringify(param);
                 getClassStat(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         // 没开课
-                        if(!json.ClassOn)return false
+                        if (!json.ClassOn) return false
                         // 上课了
                         // 1:团课
                         // 2:竞技课PK

+ 1 - 0
tv/vue.config.js

@@ -16,6 +16,7 @@ module.exports = {
     },
     lintOnSave: false,
     devServer: {
+        port: 8083, // 端口
         proxy: {
             '/api': {
                 // target: 'http://192.168.0.105:8080/',//小飞龙的