浏览代码

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

Changpeng Duan 5 年之前
父节点
当前提交
8e0d255cad

+ 24 - 8
app/src/api/getApiRes.js

@@ -16,14 +16,7 @@ export function worldDetail(postdata) {
         return getApiBasic(url,postdata);
 }
 
-export function SignIn(postdata) {
-        let url = headapi + 'SignIn';
-        return getApiBasic(url,postdata);
-}
-export function GenVerifyPic(postdata) {
-        let url = headapi + '/Auth/GenVerifyPic';
-        return getApiBasic(url,postdata);
-}
+
 
 export function editbasicinfo(postdata) {
     let url = headapi + 'editbasicinfo';
@@ -54,6 +47,29 @@ export function testPic(postdata) {
 }
 
 
+// 正式接口
+
+// 获取验证图片
+export function GenVerifyPic(postdata) {
+    let url = headapi + '/v1/Auth/GenVerifyPic';
+    return getApiBasic(url, postdata);
+}
+
+// 手机获取验证码
+export function GetPhoneVFCode(postdata) {
+    let url = headapi + '/v1/Auth/GetPhoneVFCode';
+    return getApiBasic(url, postdata);
+}
+
+export function SignIn(postdata) {
+    let url = headapi + '/v1/Auth/SignIn';
+    return getApiBasic(url,postdata);
+}
+// 手机登录
+export function PhoneSignIn(postdata) {
+    let url = headapi + '/v1/Auth/PhoneSignIn';
+    return getApiBasic(url,postdata);
+}
 
 
 

+ 85 - 39
app/src/page/login.vue

@@ -39,8 +39,11 @@
 
 <script>
     import {
-        testSelect,
-        testPic,
+        SignIn,
+        GenVerifyPic,
+        GetPhoneVFCode,
+        PhoneSignIn,
+        testSelect
     } from '../api/getApiRes.js'
 
     let qs = require('qs');
@@ -118,8 +121,36 @@
             // alert(document.body.clientWidth);
             this.getValImgSrc();
             this.overtime = new Date();
+            // this.checkcode();
         },
         methods: {
+            // 获取CODE
+            checkcode() {
+                // 0213tIFa1fBjAz0OVDIa1LfXwc03tIFK
+                console.log(this.getUrlKey('state'));
+                if (this.getUrlKey('state') == 123) {
+                    // 取到值了
+                    localStorage.code = this.getUrlKey('code');
+                    console.log(localStorage.code);
+                } else {
+                    // 第一次加载
+                    this.GetOpenId();
+                }
+            },
+            // 获取公众号ID
+            GetOpenId() {
+                let origin = location.href;
+                let urlNow = encodeURIComponent(origin);
+                let scope = 'snsapi_userinfo';    //snsapi_userinfo   //静默授权 用户无感知
+                // let appid = 'wx36cb8b6661d71811';//正式
+                let appid = 'wx685402342cfa5650';//测试
+                let state = '123';
+                let url = 'https://open.weixin.qq.com/connect/oauth2/authorize?appid=' + appid + '&redirect_uri=' + urlNow + '&response_type=code&scope=' + scope + '&state=' + state + '#wechat_redirect';
+                self.location = url
+            },
+            getUrlKey(name) {
+                return decodeURIComponent((new RegExp('[?|&]' + name + '=' + '([^&;]+?)(&|#|;|$)').exec(location.href) || [, ""])[1].replace(/\+/g, '%20')) || null;
+            },
             // 获取验证码
             getValidSmsBtn() {
                 let that = this;
@@ -133,7 +164,7 @@
                     that.Toast('手机号只能是11位');
                     return false
                 }
-                if(!globalCheckPhone(phone)){
+                if (!globalCheckPhone(phone)) {
                     that.Toast('手机号格式不正确');
                     return false
                 }
@@ -147,16 +178,19 @@
                 }
                 let param = {
                     token: localStorage.token,
-                    uservalid: uservalid,
+                    phone: phone,
+                    codeType: 1,
+                    picId: this.valImgId,
+                    picCode: uservalid,
                 };
                 let postdata = qs.stringify(param);
-                testSelect(postdata).then(res => {
+                GetPhoneVFCode(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         that.Toast('短信验证码已发送', 'success');
                         that.calcTime();
                     } else {
-                        that.$message.error(json.Memo);
+                        that.Toast(json.Memo);
                     }
                 })
             },
@@ -189,27 +223,28 @@
                 let that = this;
                 let param = {
                     token: localStorage.token,
+                    width: 100,
+                    height: 30,
+                    noiseCount: 10,
+                    length: 4,
+                    source: 123456789,
                 };
                 let postdata = qs.stringify(param);
-                testPic(postdata).then(res => {
+                GenVerifyPic(postdata).then(res => {
                     let json = res;
-                    if (json.Code == 0) {
-                        that.valImgSrc = json.pic;
-                        that.valImgId = json.id;
-                    } else {
-                        that.$message.error(json.Memo);
-                    }
+                    that.valImgSrc = json.Pic;
+                    that.valImgId = json.Id;
                 })
             },
             // pwd登录
             pwdLoginBtn() {
                 let that = this;
                 let phone = this.login.phone;
-                let uservalid = this.login.uservalid;
+                let userpwd = this.login.userpwd;
                 // 重置验证码超时
                 that.overtime = new Date();
                 if (!that.globalValid(phone, 10, 12, '手机号', that)) return;
-                if (!that.globalValid(uservalid, 3, 5, '短信验证码', that)) return;
+                if (!that.globalValid(userpwd, 5, 7, '短信验证码', that)) return;
                 this.loginInfo();
             },
             // 校验内容长度
@@ -232,39 +267,37 @@
                     return true
                 }
             },
-            //            pwd登陆
+            // pwd登陆
             loginInfo: function () {
                 const that = this;
-                let url = headapi + 'v1/Auth/SignIn';
-                let username = this.login.username;
-                let userpwd = this.login.userpwd;
-                let uservalid = this.login.uservalid;
-                let picId = this.picId;
                 let current = new Date();
                 let betweenTime = current - that.overtime;
                 let s = 120;
                 if (betweenTime > s * 1000) {
                     that.changeValImg();
-                    that.$message.error('The verification code has timed out. Please re-enter');
+                    that.$message.error('验证码已超时,请重新输入');
                     return false
                 }
                 let param = {
-                    'verifyName': username,
-                    'verifyCode': userpwd,
-                    'picId': picId,
-                    'picCode': uservalid,
-                    'src': 'pc'
+                    phone: that.login.phone,
+                    code: that.login.userpwd,
+                    channel: 3
                 };
                 let postdata = qs.stringify(param);
-                testSelect(postdata).then(res => {
-                    let json = res;
-                    if (json.Code == 0) {
-                        localStorage.token = json.Rs.token;
-                        that.getUserInfo(json.Rs.token);
+                PhoneSignIn(postdata).then(res => {
+                    if (res.Code == 0) {
+                        that.res = res.Rs;
+                        localStorage.userName = username;
+                        localStorage.token = res.Rs.token;
+                        that.$router.push({path: '/'});
                     } else {
-                        that.Toast(json.Memo + ',错误码:' + json.Code);
-                        that.getValImgSrc();//重置验证码
-                        that.clearLogin();
+                        if (res.Code == 10005) {
+                            that.$refs.userpwd.value = '';
+                            that.Toast( '密码错误,请重新输入');
+                        } else {
+                            that.Toast( res.Memo + ',错误代码:' + res.Code);
+                            that.form.valid = '';
+                        }
                     }
                 })
             },
@@ -388,7 +421,7 @@
         position: relative;
         float: right;
         /*bottom: 54px;*/
-        width: 121px;
+        width: 100px;
         height: 50px;
         background: #eee;
     }
@@ -464,7 +497,7 @@
     }
 
     #getValidSms {
-        width: 121px;
+        width: 100px;
         height: 50px;
         background: #fff;
         border: 1px solid #fff;
@@ -474,8 +507,8 @@
         float: right;
         text-align: center;
         color: #E75296;
-        line-height: 50px;
-        font-size: 16px;
+        line-height: 20px;
+        font-size: 12px;
     }
 
     #login .login_valid {
@@ -487,51 +520,64 @@
         width: 173px;
         float: left;
     }
+
     @media only screen and (max-width: 640px) {
 
     }
+
     @media only screen and (max-width: 480px) {
         #login .login_valid {
             width: 195px;
         }
+
         #login .login_pwd {
             width: 195px;
         }
     }
+
     @media only screen and (max-width: 415px) {
         #login .login_valid {
             width: 205px;
         }
+
         #login .login_pwd {
             width: 205px;
         }
     }
+
     @media only screen and (max-width: 400px) {
 
         #login .login_valid {
             width: 195px;
         }
+
         #login .login_pwd {
             width: 195px;
         }
     }
+
     @media only screen and (max-width: 375px) {
 
     }
+
     @media only screen and (max-width: 360px) {
         #login .login_valid {
             width: 160px;
         }
+
         #login .login_pwd {
             width: 160px;
         }
+
         #getValidSms {
             font-size: 14px;
         }
     }
+
     @media only screen and (max-width: 320px) {
 
     }
+
     @media only screen and (min-width: 641px) {
 
     }

+ 1 - 1
app/vue.config.js

@@ -3,7 +3,7 @@ module.exports = {
     devServer: {
         proxy: {
             '/api': {
-                target: 'http://192.168.0.162:19080/',
+                target: 'http://192.168.0.3:19095/',
                 changeOrigin: true,
                 pathRewrite: {
                     '^/api': '',

+ 7 - 1
pc/README.md

@@ -92,6 +92,12 @@ e.运行
    (如打开后出现loading情况,均为后端数据源配置错误,搭建相应服务后即可,其他问题如没有配置本地host等)
    
    === todo ===   
-        
+  
+  20200907  页面接口实现功能完成情况  
+  
+  1.首页
+    全部todo
+    
+  2.    
         
       

+ 1 - 0
pc/package.json

@@ -11,6 +11,7 @@
     "echarts": "^4.8.0",
     "element-ui": "^2.13.2",
     "mockjs": "^1.1.0",
+    "moment": "^2.27.0",
     "nprogress": "^0.2.0",
     "qs": "^6.9.4",
     "v-charts": "^1.19.0",

+ 35 - 1
pc/src/api/getApiRes.js

@@ -157,7 +157,7 @@ export function OrderListQuery(postdata) {
 }
 // 今日预约统计
 export function OrderStatistics(postdata) {
-    let url = headapi + '/v1/Order/OrderStatistics';
+    let url = headapi + 'v1/Order/OrderStatistics';
     return getApiBasic(url, postdata);
 }
 // 今日课程预约总览
@@ -172,6 +172,30 @@ export function TodayVipOrderQuery(postdata) {
 }
 
 // SchoolTimeTable
+
+// 正在进行课程列表
+export function ClassOngoingList(postdata) {
+    let url = headapi + '/v1/SchoolTimeTable/ClassOngoingList';
+    return getApiBasic(url, postdata);
+}
+
+
+// 下课记录详情列表
+export function ClassOverDetailListQuery(postdata) {
+    let url = headapi + '/v1/SchoolTimeTable/ClassOverDetailListQuery';
+    return getApiBasic(url, postdata);
+}
+// 待下课课程列表
+export function ClassOverPrepare(postdata) {
+    let url = headapi + '/v1/SchoolTimeTable/ClassOverPrepare';
+    return getApiBasic(url, postdata);
+}
+// 下课准备
+export function ClassPreFinishListQuery(postdata) {
+    let url = headapi + '/v1/SchoolTimeTable/ClassPreFinishListQuery';
+    return getApiBasic(url, postdata);
+}
+
 // 课程表基本信息添加
 export function STTBasicAdd(postdata) {
     let url = headapi + '/v1/SchoolTimeTable/STTBasicAdd';
@@ -209,6 +233,16 @@ export function STTDetailListQuery(postdata) {
     let url = headapi + '/v1/SchoolTimeTable/STTDetailListQuery';
     return getApiBasic(url, postdata);
 }
+// 复制课程表
+export function SchoolTimeTableCopy(postdata) {
+    let url = headapi + '/v1/SchoolTimeTable/SchoolTimeTableCopy';
+    return getApiBasic(url, postdata);
+}
+// 今日未上课课程列表查询
+export function WaitingBeginClassList(postdata) {
+    let url = headapi + '/v1/SchoolTimeTable/WaitingBeginClassList';
+    return getApiBasic(url, postdata);
+}
 
 // shop
 // √ 店铺添加

+ 1 - 0
pc/src/components/Headside.vue

@@ -83,6 +83,7 @@
                     if (json.Code == 0) {
                         that.user.name = json.Rs.Name;
                         localStorage.shopId = json.Rs.ShopId;
+                        localStorage.userLevel = json.Rs.Role.State;
                     } else {
                         that.$message.error(json.Memo);
                     }

+ 2 - 1
pc/src/components/Navside.vue

@@ -43,11 +43,12 @@
                 shopName: 'xx店',
                 userLevelText: '',
                 userLevel: 0,
-                userLevelDeafult: "11",
+                userLevelDeafult: "",
             }
         },
         props: ['isCollapse'],
         mounted() {
+            this.userLevelDeafult = this.$route.meta.clmid;
             this.getTableQuery();
             this.getManagerSelfQuery();
         },

+ 43 - 17
pc/src/views/Main.vue

@@ -59,14 +59,14 @@
                     <span>{{getNowDate}}</span>
                 </div>
                 <ul>
-                    <li v-for="c in classList">
+                    <li v-for="c in PreFinishList">
                         <div class="finListTitle" :style="{ background:c.color }">
-                            {{c.name}}
+                            {{c.ClassName}}
                         </div>
                         <div class="context">
                             <div class="ctl">
-                                <span>上课时间:  {{c.timeLong}}</span>
-                                <span>上课人数: {{c.kick}} 人</span>
+                                <span>上课时间:     {{c.BeginStr}}</span>
+                                <span>预约人数: {{c.LessonIndex}} 人</span>
                             </div>
                             <br>
                             <br>
@@ -82,17 +82,20 @@
                     <span>{{getNowDate}}</span>
                 </div>
                 <div class="appointCard">
-<!--                    TodayClassOrder-->
+                    <!--                    TodayClassOrder-->
                     <el-card class="box-card" v-for="c in classList">
                         <div class="cardTitle blue" :style="{ color:c.color }">
-                            {{c.name}}
+                            {{c.ClassName}}
                         </div>
                         <span>
-                           {{c.timeLong}}
+                           {{c.BeginStr}}
                         </span>
-                        <em>最大预约人数 <i>{{c.kick}}</i></em>
+                        <em>最大预约人数 <i>{{c.OrderToplimit}}</i></em>
                         <em>已预约人数 <i>{{c.kick}}</i></em>
-                        <em>预约状态 <s class="blue">可预约</s></em>
+                        <em>预约状态
+                            <s class="blue" v-if="c.WxOrder > 0">可预约</s>
+                            <s class="red" v-if="c.WxOrder == 0">不可预约</s>
+                        </em>
                     </el-card>
                 </div>
             </div>
@@ -104,7 +107,7 @@
                     <span @click="goPage('appoint')">查看全部</span>
                 </div>
                 <ul>
-<!--                    TodayVipOrder-->
+                    <!--                    TodayVipOrder-->
                     <li v-for="as in appointList">
                         <div class="asTitle">
                             <img src="../assets/img/main/Oval.png" alt="">
@@ -130,6 +133,9 @@
         testTable,
         TodayClassOrderQuery,
         TodayVipOrderQuery,
+        ClassPreFinishListQuery,
+        ClassOngoingList,
+        OrderStatistics,
     } from "../api/getApiRes";
 
     let qs = require('qs');
@@ -139,6 +145,7 @@
                 editableTabsValue: '1',
                 getNowDate: getNowDate(),
                 classList: [],
+                PreFinishList: [],
                 appointList: [],
                 TodayClassOrder: [],
                 TodayVipOrder: [],
@@ -148,10 +155,11 @@
             let that = this;
 
             // 下课管理
-            this.getTodayClassOrderQuery();
-            this.getTodayVipOrderQuery();
+            // this.getTodayClassOrderQuery();
+            // this.getTodayVipOrderQuery();
             this.ClassQuery();
             this.appointQuery();
+            this.getOrderStatistics();
             this.timer = setInterval(() => {
                 that.appointQuery();
             }, 10000);
@@ -166,7 +174,26 @@
                     query: {}
                 })
             },
-            getTodayClassOrderQuery(){
+            getOrderStatistics() {
+                let that = this;
+                that.loading = true;
+                let param = {
+                    token: localStorage.token,
+                };
+                let postdata = qs.stringify(param);
+                OrderStatistics(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.loading = false;
+                        if (json.Rs) {
+                            console.log(json);
+                        }
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
+            getTodayClassOrderQuery() {
                 let that = this;
                 that.loading = true;
                 let param = {
@@ -185,7 +212,7 @@
                     }
                 })
             },
-            getTodayVipOrderQuery(){
+            getTodayVipOrderQuery() {
                 let that = this;
                 that.loading = true;
                 let param = {
@@ -212,13 +239,12 @@
                     token: localStorage.token,
                 };
                 let postdata = qs.stringify(param);
-                testTable(postdata).then(res => {
+                ClassOngoingList(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         that.loading = false;
                         if (json.Rs) {
-                            that.classList = json.Rs;
-                            console.log(that.classList);
+                            that.PreFinishList = json.Rs;
                         }
                     } else {
                         that.$message.error(json.Memo);

+ 136 - 12
pc/src/views/appoint.vue

@@ -1,11 +1,17 @@
 <template>
     <div class="context">
-<!--        panel-->
+        <!--        panel-->
         <div class="">
             <div class="panel">
                 <h5>预约管理 <span class="current">{{current}}</span></h5>
             </div>
 
+            <div class="timeList">
+                <ul>
+                    <li :class="[{'active': i == choiceDate}]" v-for="(day,i) in weeks" @click="choiceTime(i)"><em>{{day.name}}</em><span>{{day.data}}</span>
+                    </li>
+                </ul>
+            </div>
             <el-tabs v-model="activeName" type="card">
                 <el-tab-pane label="课程预览总览" name="first">
                     <div class="table">
@@ -54,7 +60,8 @@
                                     width="240px"
                             >
                                 <template slot-scope="scope">
-                                    <el-input-number v-model="scope.row.Recovered"  :min="1" :max="9999" label=""></el-input-number>
+                                    <el-input-number v-model="scope.row.Recovered" :min="1" :max="9999"
+                                                     label=""></el-input-number>
                                 </template>
                             </el-table-column>
                             <el-table-column
@@ -98,7 +105,7 @@
                     </div>
                 </el-tab-pane>
                 <el-tab-pane label="会员预约列表" name="second">
-                    <div class="panel-body" >
+                    <div class="panel-body">
                         <div class="panel_control">
                             <el-row :gutter="20">
                                 <el-col :span="4">
@@ -199,7 +206,8 @@
                                     label="操作"
                             >
                                 <template slot-scope="scope">
-                                    <el-button type="danger" size="mini" round @click="editMember(scope.row)">取消预约</el-button>
+                                    <el-button type="danger" size="mini" round @click="editMember(scope.row)">取消预约
+                                    </el-button>
                                 </template>
                             </el-table-column>
                         </el-table>
@@ -226,15 +234,16 @@
                         <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-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 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>
@@ -255,6 +264,7 @@
         data() {
             return {
                 activeName: 'first',
+                choiceDate: 0,
                 // activeName: 'second',
                 tableView: true,//其他dialog
                 dialogVisible: false,//其他dialog
@@ -266,6 +276,7 @@
                 dialogTitle: '新增教练',
                 current: getNowDate(),
                 dialogValue: [],
+                weeks: [],
                 // panel 配置项目
                 panel: {
                     usercode: '',
@@ -330,11 +341,17 @@
             }
         },
         mounted() {
-            this.panelSelect();
-            this.getTableQuery();
-            this.getTableQuery2();
+            // this.panelSelect();
+            // this.getTableQuery();
+            // this.getTableQuery2();
+            this.getCurrWeekDays();
         },
         methods: {
+            // 选择日期
+            choiceTime(i) {
+                console.log(123);
+                this.choiceDate = parseInt(i);
+            },
             format(percentage) {
                 return percentage === 100 ? '已满' : `${percentage}%`;
             },
@@ -848,7 +865,6 @@
                     });
                 });
             },
-
             handleSelectionChange(val) {
                 this.multipleSelection = val;
             },
@@ -998,6 +1014,51 @@
                 let that = this;
                 return parseFloat(column).toFixed(2);
             },
+            // 本周
+            getCurrWeekDays() {
+                let now = new Date();
+                let nowTime = now.getTime();
+                let day = now.getDay();
+                let oneDayTime = 24 * 60 * 60 * 1000;
+                // let MondayTime = nowTime - (day - 1) * oneDayTime;//显示周一
+                let SundayTime = nowTime + (7 - day) * oneDayTime;//显示周日
+
+                let days = '';
+                let item = [];
+                for (let i = 0; i < 7; i++) {
+                    days = new Date(nowTime + (i - day) * oneDayTime);//显示周日
+                    item = {
+                            name: this.numberToWeek(days.getDay()),
+                            data: days.getMonth() + 1 + '月' + days.getDate() + '日'
+                        }
+                    this.weeks.push(item)
+                }
+            },
+            numberToWeek(val) {
+                switch (parseInt(val)) {
+                    case 0:
+                        return '星期一'
+                        break;
+                    case 1:
+                        return '星期二'
+                        break;
+                    case 2:
+                        return '星期三'
+                        break;
+                    case 3:
+                        return '星期四'
+                        break;
+                    case 4:
+                        return '星期五'
+                        break;
+                    case 5:
+                        return '星期六'
+                        break;
+                    case 6:
+                        return '星期天'
+                        break;
+                }
+            }
         },
     }
 </script>
@@ -1085,6 +1146,7 @@
         width: 70%;
         float: right;
     }
+
     .current {
         width: 158px;
         height: 23px;
@@ -1097,4 +1159,66 @@
         padding: 3px 10px;
         margin-left: 20px;
     }
+
+    .timeList {
+        width: 800px;
+        overflow: hidden;
+        float: right;
+        position: relative;
+        z-index: 9999;
+        cursor: pointer;
+    }
+
+    .timeList ul {
+        width: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        list-style: none;
+    }
+
+    .timeList li {
+        width: 100px;
+        overflow: hidden;
+        list-style: none;
+        float: left;
+        margin-right: 6px;
+        border: 1px solid #ccc;
+        text-align: center;
+        height: 40px;
+    }
+
+    em {
+        font-style: normal;
+    }
+
+    .timeList em {
+        width: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        font-size: 14px;
+        text-align: center;
+    }
+
+    .timeList span {
+        width: 100%;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+        font-size: 12px;
+        text-align: center;
+    }
+
+    .timeList li.active {
+        border: 1px solid #3799FF;
+    }
+
+    .timeList li.active em {
+        color: #3799FF;
+    }
+
+    .timeList li.active span {
+        color: #3799FF;
+    }
 </style>

+ 46 - 8
pc/src/views/finish.vue

@@ -21,24 +21,29 @@
                         width="50">
                 </el-table-column>
                 <el-table-column
-                        prop="name"
+                        prop="EndTime"
                         label="时间"
+                        :formatter="filterFmtDate"
                 >
                 </el-table-column>
                 <el-table-column
-                        prop="name"
+                        prop="ClassName"
                         label="课程"
                         sortable
                 >
+                    <template slot-scope="scope">
+                        <span class="lessonSpan"
+                              :style="{background:scope.row.ClassColor}">{{scope.row.ClassName}}</span>
+                    </template>
                 </el-table-column>
                 <el-table-column
-                        prop="Recovered"
+                        prop="ConsumeHour"
                         label="消耗课时"
                         sortable
                 >
                 </el-table-column>
                 <el-table-column
-                        prop="Recovered"
+                        prop="OrderNum"
                         label="实际预约人数"
                         sortable
                 >
@@ -48,7 +53,7 @@
                         label="操作"
                 >
                     <template slot-scope="scope">
-                        <el-button type="primary" round size="mini" @click="goFinish(scope.row)">
+                        <el-button type="primary" round size="mini" @click="checkClassOverPrepare(scope.row)">
                             下课
                         </el-button>
                     </template>
@@ -68,6 +73,8 @@
 <script>
     import Global from '../Global.js'
     import {
+        ClassPreFinishListQuery,
+        ClassOverPrepare,
         testTable,
         testSelect
     } from "../api/getApiRes";
@@ -151,10 +158,27 @@
             this.getTableQuery();
         },
         methods: {
-            goFinish(row){
+            // 检测当前课是否处于可改变状态
+            checkClassOverPrepare(row) {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    stdId: row.StdId,
+                };
+                let postdata = qs.stringify(param);
+                ClassOverPrepare(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.goFinish(row);
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
+            goFinish(row) {
                 this.$router.push({
                     path: '/finishDetail', query: {
-                        id: row.id
+                        id: row.StdId
                     }
                 });
             },
@@ -177,7 +201,7 @@
                     tableMax: 9999,//
                 };
                 let postdata = qs.stringify(param);
-                testTable(postdata).then(res => {
+                ClassPreFinishListQuery(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         that.loading = false;
@@ -335,6 +359,7 @@
         width: 70%;
         float: right;
     }
+
     .blueTitle {
         width: 200px;
         overflow: hidden;
@@ -349,6 +374,7 @@
         font-size: 16px;
         padding: 5px 24px;
     }
+
     .current {
         width: 158px;
         height: 23px;
@@ -361,4 +387,16 @@
         padding: 3px 10px;
         margin-left: 20px;
     }
+
+    .lessonSpan {
+        width: 78px;
+        height: 22px;
+        border-radius: 11px;
+        margin-right: 5px;
+        float: left;
+        margin-bottom: 3px;
+        text-align: center;
+        color: #545454;
+        font-size: 12px;
+    }
 </style>

+ 16 - 14
pc/src/views/finishDetail.vue

@@ -9,11 +9,11 @@
                     <el-row :gutter="20">
                         <el-col :span="4">
                             <em>会员名:</em>
-                            <el-input v-model="panel.USERCODE" placeholder="请输入会员名"></el-input>
+                            <el-input v-model="panel.name" placeholder="请输入会员名"></el-input>
                         </el-col>
                         <el-col :span="4">
                             <em>手机号:</em>
-                            <el-input v-model="panel.keyword" placeholder="请输入手机号"></el-input>
+                            <el-input v-model="panel.phone" placeholder="请输入手机号"></el-input>
                         </el-col>
                         <el-col :span="4">
                             <el-button size="" type="primary" @click="query" plain>查询</el-button>
@@ -43,24 +43,24 @@
                         width="50">
                 </el-table-column>
                 <el-table-column
-                        prop="name"
+                        prop="Name"
                         label="会员名"
                 >
                 </el-table-column>
                 <el-table-column
-                        prop="tel"
+                        prop="Phone"
                         label="手机号"
                         sortable
                 >
                 </el-table-column>
                 <el-table-column
-                        prop="vipType"
+                        prop="Status"
                         label="状态"
                         sortable
                 >
                     <template slot-scope="scope">
-                        <span v-if="scope.row.vipType == 1">预约未到 </span>
-                        <span v-if="scope.row.vipType == 2">上课未预约</span>
+                        <span v-if="scope.row.Status == 1">预约未到 </span>
+                        <span v-if="scope.row.Status == 2">上课未预约</span>
                     </template>
                 </el-table-column>
                 <el-table-column
@@ -145,6 +145,7 @@
 <script>
     import Global from '../Global.js'
     import {
+        ClassOverDetailListQuery,
         testTable,
         testSelect
     } from "../api/getApiRes";
@@ -160,10 +161,12 @@
                 dialogExpTime: false,//有效期调整
                 dialogLessonTable: false,//会员课程
                 dialogTitle: '新增会员',
-                current: '星期日 2020/08/16',
+                current: getNowDate(),
                 dialogValue: [],
                 // panel 配置项目
                 panel: {
+                    name: '',
+                    phone: '',
                     usercode: '',
                     username: '',
                     compname: '',
@@ -746,7 +749,7 @@
             },
             // 查询按钮
             query() {
-                // this.getTableQuery();
+                this.getTableQuery();
                 this.$message.success('查询完毕');
             },
             clearForm() {
@@ -763,15 +766,14 @@
                 // 查询检测设备。上级区域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,//标签名
+                    stdId : this.$route.query.id,//标签名
+                    name : this.panel.name,//姓名
+                    phone : this.panel.phone,//手机号
                     start: 1,//
                     tableMax: 9999,//
                 };
                 let postdata = qs.stringify(param);
-                testTable(postdata).then(res => {
+                ClassOverDetailListQuery(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         that.loading = false;