Explorar el Código

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

Changpeng Duan hace 5 años
padre
commit
6822b573c4

+ 20 - 1
pc/README.md

@@ -122,4 +122,23 @@ e.运行
 order
 今日预约统计(未完成)
 今日课程预约总览(未完成)
-今日会员预约列表查询(未完成)
+今日会员预约列表查询(未完成)
+
+
+20200910
+ 店铺微信预约状态修改(Shop/ShopWxStatusEdit) √
+ 店铺单条查询(Shop/ShopDetailOne) √
+ 
+ 1./Order/OrderCancelByManager √
+    管理员预约取消(未完成)
+ 
+ 2./Order/OrderStatistics
+    今日预约统计(未完成)
+ 
+ 3.(Class/ClassStatistics)
+    课程统计(未完成)
+    
+ 4.课程表模板详情预览(SttPlan/SttPlanPreview)
+ 
+ 5.课程表预览(SchoolTimetable/SchoolTimetablePreview)
+   

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

@@ -170,11 +170,21 @@ export function TodayClassOrderQuery(postdata) {
     let url = headapi + '/v1/Order/TodayClassOrderQuery';
     return getApiBasic(url, postdata);
 }
+// 课程预约列表
+export function ClassOrderQuery(postdata) {
+    let url = headapi + '/v1/Order/ClassOrderQuery';
+    return getApiBasic(url, postdata);
+}
 // 今日会员预约列表查询
 export function TodayVipOrderQuery(postdata) {
     let url = headapi + '/v1/Order/TodayVipOrderQuery';
     return getApiBasic(url, postdata);
 }
+// 会员预约列表查询
+export function VipUserOrderQuery(postdata) {
+    let url = headapi + '/v1/Order/VipUserOrderQuery';
+    return getApiBasic(url, postdata);
+}
 
 // SchoolTimeTable
 
@@ -183,6 +193,16 @@ export function ClassOngoingList(postdata) {
     let url = headapi + '/v1/SchoolTimeTable/ClassOngoingList';
     return getApiBasic(url, postdata);
 }
+// 课程表详情微信可预约状态修改
+export function STTDetailWxOrderEdit(postdata) {
+    let url = headapi + '/v1/SchoolTimeTable/STTDetailWxOrderEdit';
+    return getApiBasic(url, postdata);
+}
+// 某日课程表查询
+export function ClassListByOrderDate(postdata) {
+    let url = headapi + '/v1/SchoolTimeTable/ClassListByOrderDate';
+    return getApiBasic(url, postdata);
+}
 
 
 // 确认下课
@@ -270,6 +290,16 @@ export function ShopAdd(postdata) {
     let url = headapi + '/v1/Shop/ShopAdd';
     return getApiBasic(url, postdata);
 }
+// 店铺微信预约状态修改
+export function ShopWxStatusEdit(postdata) {
+    let url = headapi + '/v1/Shop/ShopWxStatusEdit';
+    return getApiBasic(url, postdata);
+}
+// 店铺单条查询
+export function ShopDetailOne(postdata) {
+    let url = headapi + '/v1/Shop/ShopDetailOne';
+    return getApiBasic(url, postdata);
+}
 
 // √ 店铺详情查询
 export function ShopDetailQuery(postdata) {

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

@@ -73,7 +73,7 @@
                 >
                 </el-table-column>
                 <el-table-column
-                        prop="ShopId"
+                        prop="ShopName"
                         label="所属门店"
                         sortable
                 >

+ 19 - 13
pc/src/views/EditLessonManage.vue

@@ -143,11 +143,14 @@
                 </el-table-column>
             </el-table>
             <div class="rowBottom">
-                <el-button type="primary" @click="addRow">新增课表</el-button>
+                <el-button type="default" @click="$router.push('/lessonManage')">返回课程表</el-button>
                 <!--                ID为0是新建,不为0是修改-->
-                <el-button type="primary" @click="confirmLessonTable" v-if="this.$route.query.id == 0">提交</el-button>
-                <el-button type="primary" @click="confirmEditLessonTable" v-if="this.$route.query.id != 0">提交
-                </el-button>
+                <el-button type="primary" class="pull-right" @click="confirmLessonTable" v-if="this.$route.query.id == 0">提交</el-button>
+                <el-button type="primary" class="pull-right" @click="confirmEditLessonTable" v-if="this.$route.query.id != 0">提交</el-button>
+                <el-button type="primary" class="pull-right" @click="addRow">新增课表</el-button>
+            </div>
+            <div>
+                <br>
                 <em class="red wrning">
                     *所有操作提交后生效
                 </em>
@@ -302,15 +305,15 @@
             confirmEditLessonTable() {
                 let that = this;
                 if (!this.panel.name) {
-                    this.$message.error('模板名称不能为空');
+                    this.$message.error('名称不能为空');
                     return false
                 }
                 if (this.panel.name.length < 3) {
-                    this.$message.error('模板名称不能小于3个字符');
+                    this.$message.error('名称不能小于3个字符');
                     return false
                 }
                 if (this.panel.name.length > 20) {
-                    this.$message.error('模板名称不能大于20个字符');
+                    this.$message.error('名称不能大于20个字符');
                     return false
                 }
                 let param = {
@@ -337,18 +340,18 @@
                 let curIndex = parseInt(this.activeName) - 1;
                 this.tabs[curIndex].tableData.splice(delIndex, 1)
             },
-            // 提交课程模板
+            // 提交课程
             confirmLessonTable() {
                 if (!this.panel.name) {
-                    this.$message.error('模板名称不能为空');
+                    this.$message.error('名称不能为空');
                     return false
                 }
                 if (this.panel.name.length < 3) {
-                    this.$message.error('模板名称不能小于3个字符');
+                    this.$message.error('名称不能小于3个字符');
                     return false
                 }
                 if (this.panel.name.length > 20) {
-                    this.$message.error('模板名称不能大于20个字符');
+                    this.$message.error('名称不能大于20个字符');
                     return false
                 }
                 let that = this;
@@ -369,7 +372,7 @@
                     }
                 })
             },
-            // 修改课程模板
+            // 修改课程
             EditLessonTable(planId) {
                 let that = this;
                 // if (this.checkData()) {
@@ -414,7 +417,7 @@
                     if (json.Code == 0) {
                         that.$message({
                             showClose: true,
-                            message: '课程模板已上传成功!',
+                            message: '课程已上传成功!',
                             type: 'success'
                         });
                         this.$router.push({
@@ -677,4 +680,7 @@
         float: right;
         font-size: 12px;
     }
+    .rowBottom button.pull-right {
+        float: right;
+    }
 </style>

+ 11 - 3
pc/src/views/EditLessonTable.vue

@@ -101,11 +101,16 @@
                 </el-table-column>
             </el-table>
             <div class="rowBottom">
-                <el-button type="primary" @click="addRow">新增课表</el-button>
+                <el-button type="default" @click="$router.push('/lessonTable')">返回课程表模板</el-button>
+
                 <!--                ID为0是新建,不为0是修改-->
-                <el-button type="primary" @click="confirmLessonTable" v-if="this.$route.query.id == 0">提交</el-button>
-                <el-button type="primary" @click="confirmEditLessonTable" v-if="this.$route.query.id != 0">提交
+                <el-button type="primary" class="pull-right" @click="confirmLessonTable" v-if="this.$route.query.id == 0">提交</el-button>
+                <el-button type="primary" class="pull-right" @click="confirmEditLessonTable" v-if="this.$route.query.id != 0">提交
                 </el-button>
+                <el-button type="primary" class="pull-right" @click="addRow">新增课表</el-button>
+            </div>
+            <div>
+                <br>
                 <em class="red wrning">
                     *所有操作提交后生效
                 </em>
@@ -622,4 +627,7 @@
         float: right;
         font-size: 12px;
     }
+    .rowBottom button.pull-right {
+        float: right;
+    }
 </style>

+ 56 - 16
pc/src/views/Main.vue

@@ -60,17 +60,17 @@
                 </div>
                 <ul>
                     <li v-for="c in PreFinishList">
-                        <div class="finListTitle" :style="{ background:c.color }">
+                        <div class="finListTitle" :style="{ background:c.ClassColor }">
                             {{c.ClassName}}
                         </div>
                         <div class="context">
                             <div class="ctl">
                                 <span>上课时间:     {{c.BeginStr}}</span>
-                                <span>预约人数: {{c.LessonIndex}} 人</span>
+                                <span>预约人数: {{c.OrderNum}} 人</span>
                             </div>
                             <br>
                             <br>
-<!--                            <el-button type="primary" plain @click="goPage('finish')">下课</el-button>-->
+                            <!--                            <el-button type="primary" plain @click="goPage('finish')">下课</el-button>-->
                             <el-button type="primary" plain @click="checkClassOverPrepare(c)">下课</el-button>
                         </div>
                     </li>
@@ -112,14 +112,21 @@
                         <div class="asTitle">
                             <img src="../assets/img/main/Oval.png" alt="">
                             <span>
-                                {{as.tel}}
+                                {{as.UserName}}
+                                {{as.Phone}}
                           </span>
                         </div>
                         <div class="asContent">
-                            <span>预约时间:<em>{{as.create.substr(11,9)}}</em></span>
-                            <span>预约状态:<em>{{as.Status == 1 ?'预约成功':'预约失败'}}</em></span>
-                            <span>预约课程:<s class="blue" :style="{ background:as.color }"> {{as.name}}</s></span>
-                            <span>剩余课时:<em>{{as.kick}}课时</em></span>
+                            <span>预约时间:<em>{{as.BeginStr}}</em></span>
+                            <span>预约状态:
+                                <em v-if="as.Status == 1" class="green">已预约</em>
+                                <em v-if="as.Status == 2" class="red">已取消</em>
+                                <em v-if="as.Status == 3" class="yellow">预约未到</em>
+                                <em v-if="as.Status == 4">已完成</em>
+                            </span>
+                            <span>预约课程:<s class="blue"
+                                          :style="{ background:as.ClassColor }"> {{as.ClassName}}</s></span>
+                            <span>剩余课时:<em :class="[{'red':as.RemainHour == 0}]">{{as.RemainHour}}课时</em></span>
                         </div>
                     </li>
                 </ul>
@@ -138,7 +145,9 @@
         ClassOngoingList,
         OrderStatistics,
         VipUserStatistics,
-        ClassStatistics, ClassOverPrepare,
+        ClassStatistics,
+        ClassOverPrepare,
+        VipUserOrderQuery,
     } from "../api/getApiRes";
 
     let qs = require('qs');
@@ -167,11 +176,11 @@
             this.getVipUserStatistics();
             this.getClassStatistics();
             this.ClassQuery();
-            this.appointQuery();
+            this.getVipUserOrderQuery();
             // this.getOrderStatistics();
             this.getWaitingBeginClassList();
             this.timer = setInterval(() => {
-                that.appointQuery();
+                that.getVipUserOrderQuery();
             }, 10000);
         },
         destroyed() {
@@ -241,7 +250,7 @@
                     }
                 })
             },
-            checkClassOverPrepare(row){
+            checkClassOverPrepare(row) {
                 let that = this;
                 let param = {
                     token: localStorage.token,
@@ -262,8 +271,8 @@
                     path: '/finishDetail', query: {
                         id: row.StdId,
                         classId: row.ClassId,
-                        ClassName:row.ClassName,
-                        BeginTime:row.BeginTime,
+                        ClassName: row.ClassName,
+                        BeginTime: row.BeginTime,
                     }
                 });
             },
@@ -343,14 +352,17 @@
                 })
             },
             // 最新预约
-            appointQuery() {
+            getVipUserOrderQuery() {
                 let that = this;
                 that.loading = true;
                 let param = {
                     token: localStorage.token,
+                    classId: 0,
+                    orderDate: globalcurrent(),
+                    stdId: 0,
                 };
                 let postdata = qs.stringify(param);
-                testTable(postdata).then(res => {
+                VipUserOrderQuery(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         that.loading = false;
@@ -363,6 +375,22 @@
                 })
             }
         },
+        watch: {
+            $route(to) {
+                if (to.name == 'Main') {
+                    // this.getTodayClassOrderQuery();
+                    // this.getTodayVipOrderQuery();
+                    this.getVipUserStatistics();
+                    this.getClassStatistics();
+                    this.ClassQuery();
+                    this.getVipUserOrderQuery();
+                    // this.getOrderStatistics();
+                    this.getWaitingBeginClassList();
+                }else{
+                    clearInterval(this.timer);//页面销毁时清除定时器
+                }
+            },
+        },
         components: {}
     }
 </script>
@@ -820,4 +848,16 @@
     i {
         font-style: normal;
     }
+
+    .asContent .green {
+        color: #25CC42;
+    }
+
+    .asContent .red {
+        color: red;
+    }
+
+    .asContent .yellow {
+        color: #FFDD00;
+    }
 </style>

+ 6 - 4
pc/src/views/Member.vue

@@ -49,7 +49,7 @@
             <el-button @click="giftChange">赠送课时调整</el-button>
             <el-button @click="ExpTimeChange">有效期调整</el-button>
             <el-button @click="lessonStudenChange">增删课程</el-button>
-            <el-button class="pull-right" icon="el-icon-position">导出</el-button>
+<!--            <el-button class="pull-right" icon="el-icon-position">导出</el-button>-->
         </div>
         <div class="table">
             <el-table
@@ -60,7 +60,6 @@
                     element-loading-background="rgba(0, 0, 0, 0.8)"
                     class=""
                     @selection-change="handleSelectionChange"
-
             >
                 <el-table-column
                         type="selection"
@@ -74,7 +73,7 @@
                 <el-table-column
                         prop="UserInfo.Name"
                         label="会员名"
-                        width="90"
+                        width="140"
                 >
                 </el-table-column>
                 <el-table-column
@@ -105,25 +104,28 @@
                 <el-table-column
                         prop="UserInfo.RemainNormalhour"
                         label="剩余课时"
+                        width="110"
                         sortable
                 >
                 </el-table-column>
                 <el-table-column
                         prop="UserInfo.ConsumeNormalhour"
                         label="累计课时"
+                        width="110"
                         sortable
                 >
                 </el-table-column>
                 <el-table-column
                         prop="UserInfo.RemainGifthour"
                         label="赠送"
+                        width="110"
                         sortable
                 >
                 </el-table-column>
                 <el-table-column
                         prop="UserInfo.ConsumeGifthour"
                         label="累计赠送"
-                        width="110px"
+                        width="110"
                         sortable
                 >
                 </el-table-column>

+ 277 - 91
pc/src/views/appoint.vue

@@ -34,15 +34,19 @@
                                     width="50">
                             </el-table-column>
                             <el-table-column
-                                    prop="name"
+                                    prop="BeginTime"
                                     label="时间"
+                                    :formatter="filterFmtDate"
                             >
                             </el-table-column>
                             <el-table-column
-                                    prop="name"
+                                    prop="ClassName"
                                     label="课程"
                                     sortable
                             >
+                                <template slot-scope="scope">
+                                    <span class="lessons" :style="{ background:scope.row.ClassColor }">{{scope.row.ClassName}}</span>
+                                </template>
                             </el-table-column>
                             <el-table-column
                                     prop="Recovered"
@@ -51,32 +55,32 @@
                                     sortable
                             >
                                 <template slot-scope="scope">
-                                    <el-progress :percentage="100" :format="format"></el-progress>
+                                    <el-progress
+                                            :percentage="parseFloat((scope.row.OrderCount/scope.row.OrderToplimit * 100).toFixed(2))"
+                                            :format="format"></el-progress>
                                 </template>
                             </el-table-column>
                             <el-table-column
-                                    prop="Recovered"
+                                    prop="OrderToplimit"
                                     label="预约名额"
                                     width="240px"
                             >
-                                <template slot-scope="scope">
-                                    <el-input-number v-model="scope.row.Recovered" :min="1" :max="9999"
-                                                     label=""></el-input-number>
-                                </template>
+
                             </el-table-column>
                             <el-table-column
-                                    prop="Recovered"
+                                    prop="ConsumeHour"
                                     label="消耗课时"
                                     sortable
                             >
                             </el-table-column>
                             <el-table-column
-                                    prop="wxVisible"
+                                    prop="WxOrder"
                                     label="微信可预约"
                             >
                                 <template slot-scope="scope">
+                                    <!--                                    0:不可预约 1:可预约-->
                                     <el-switch
-                                            v-model="scope.row.wxVisible"
+                                            v-model="scope.row.WxOrder"
                                             :active-value="1"
                                             :inactive-value="0"
                                             active-color="#409EFF"
@@ -91,7 +95,7 @@
                                     label="操作"
                             >
                                 <template slot-scope="scope">
-                                    <el-button type="text" @click="editMember(scope.row)">编辑</el-button>
+                                    <el-button type="text" @click="seeDetail(scope.row)">详情</el-button>
                                 </template>
                             </el-table-column>
                         </el-table>
@@ -110,11 +114,11 @@
                             <el-row :gutter="20">
                                 <el-col :span="5">
                                     <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="5">
                                     <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="5">
                                     <em>预约课程:</em>
@@ -130,16 +134,16 @@
                                 <el-col :span="4">
                                     <el-button size="" type="primary" @click="query" plain>查询</el-button>
                                 </el-col>
+                                <el-col :span="4">
+                                    <el-button class="pull-right" type="warning" @click="addMember">增加预约</el-button>
+                                </el-col>
                             </el-row>
                         </div>
                     </div>
                     <br>
-                    <div class="change">
-                        <el-button type="warning" @click="addMember">增加预约</el-button>
-                    </div>
                     <div class="table">
                         <el-table
-                                :data="tableData"
+                                :data="tableData2"
                                 border
                                 is-horizontal-resize
                                 :default-sort="{prop: 'date', order: 'descending'}"
@@ -157,56 +161,65 @@
                                     width="50">
                             </el-table-column>
                             <el-table-column
-                                    prop="name"
+                                    prop="UserName"
                                     label="会员名"
                             >
                             </el-table-column>
                             <el-table-column
-                                    prop="tel"
+                                    prop="Phone"
                                     label="手机号"
                                     sortable
                             >
                             </el-table-column>
                             <el-table-column
-                                    prop="name"
+                                    prop="ClassName"
                                     label="预约课程"
                                     sortable
                             >
+                                <template slot-scope="scope">
+                                    <span class="lessons" :style="{ background:scope.row.ClassColor }">{{scope.row.ClassName}}</span>
+                                </template>
                             </el-table-column>
                             <el-table-column
-                                    prop="create"
+                                    prop="CurrentDate"
                                     label="会员预约时间"
                                     sortable
                             >
+                                <template slot-scope="scope">
+                                    {{scope.row.CurrentDate}} {{scope.row.BeginStr}}
+                                </template>
                             </el-table-column>
                             <el-table-column
-                                    prop="Recovered"
+                                    prop="ConsumeHour"
                                     label="消耗课时"
                                     sortable
                             >
                             </el-table-column>
                             <el-table-column
-                                    prop="vipType"
-                                    label="预约状态"
+                                    prop="RemainHour"
+                                    label="剩余课时"
                                     sortable
                             >
-                                <template slot-scope="scope">
-                                    <span v-if="scope.row.vipType == 1">预约成功</span>
-                                    <span v-if="scope.row.vipType == 2">预约失败</span>
-                                </template>
                             </el-table-column>
                             <el-table-column
-                                    prop="Recovered"
-                                    label="剩余课时"
+                                    prop="Status"
+                                    label="预约状态"
                                     sortable
                             >
+                                <template slot-scope="scope">
+                                    <span v-if="scope.row.Status == 1">已预约</span>
+                                    <span v-if="scope.row.Status == 2">已取消</span>
+                                    <span v-if="scope.row.Status == 3">预约未到</span>
+                                    <span v-if="scope.row.Status == 4">已完成</span>
+                                </template>
                             </el-table-column>
                             <el-table-column
                                     prop="Status"
                                     label="操作"
                             >
                                 <template slot-scope="scope">
-                                    <el-button type="danger" size="mini" round @click="editMember(scope.row)">取消预约
+                                    <el-button type="danger" size="mini" round
+                                               @click="BtnOrderCancelByManager(scope.row)">取消预约
                                     </el-button>
                                 </template>
                             </el-table-column>
@@ -229,7 +242,7 @@
                 <div class="">
                     <el-form ref="form" :model="form" label-width="160px">
                         <el-form-item label="课程">
-                            <el-select v-model="form.stdId" filterable placeholder="请选择" >
+                            <el-select v-model="form.stdId" filterable placeholder="请选择">
                                 <el-option
                                         v-for="item in form.stdList"
                                         :key="item.value"
@@ -239,7 +252,7 @@
                             </el-select>
                         </el-form-item>
                         <el-form-item label="会员">
-                            <el-select v-model="form.userId" filterable placeholder="请选择" >
+                            <el-select v-model="form.userId" filterable placeholder="请选择">
                                 <el-option
                                         v-for="item in form.userList"
                                         :key="item.value"
@@ -256,6 +269,12 @@
                 <el-button size="small" @click="dialogMemberVisible = false">取消</el-button>
             </div>
         </el-dialog>
+        <el-dialog title="课程会员" :visible.sync="dialogTableVisible">
+            <el-table :data="gridData">
+                <el-table-column property="UserName" label="姓名" width="200"></el-table-column>
+                <el-table-column property="Phone" label="手机"></el-table-column>
+            </el-table>
+        </el-dialog>
     </div>
 </template>
 
@@ -265,9 +284,14 @@
         TodayClassOrderQuery,
         VipUserListQuery,
         TodayVipOrderQuery,
+        ClassOrderQuery,
         OrderAddByManager,
+        ClassListByOrderDate,
+        VipUserOrderQuery,
+        OrderCancelByManager,
+        STTDetailWxOrderEdit,
         testTable,
-        testSelect, WaitingBeginClassList
+        testSelect, WaitingBeginClassList, ShopWxStatusEdit
     } from "../api/getApiRes";
 
     let qs = require('qs');
@@ -275,11 +299,12 @@
         data() {
             return {
                 // activeName: 'first',
-                activeName: 'second',
-                choiceDate: 0,
+                activeName: 'first',
+                choiceDate: 0,//默认为今天
                 // activeName: 'second',
                 tableView: true,//其他dialog
                 dialogVisible: false,//其他dialog
+                dialogTableVisible: false,//其他dialog
                 dialogMemberVisible: false,//新增教练dialog
                 dialogLesson: false,//课时调整
                 dialogGift: false,//赠送课时调整
@@ -289,8 +314,11 @@
                 current: getNowDate(),
                 dialogValue: [],
                 weeks: [],
+                gridData: [],
                 // panel 配置项目
                 panel: {
+                    name: '',
+                    phone: '',
                     usercode: '',
                     username: '',
                     compname: '',
@@ -357,12 +385,49 @@
         mounted() {
             this.vipSelect();
             this.ClassSelect();
-            // this.getTableQuery();
-            // this.getTableQuery2();
-            this.getCurrWeekDays();
+            // this.getCurrWeekDays();
+            this.getFurtherDays();
         },
         methods: {
-            vipSelect(){
+            // .课程表详情微信可预约状态修改
+            changeWechat(e, appoint) {
+                let that = this;
+                let statusText = appoint.WxOrder == 0 ? "关闭" : "开启";
+                this.$confirm('是否' + statusText + '课程预约?', '微信预约操作', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    let param = {
+                        token: localStorage.token,
+                        stdId: appoint.StdId,
+                        wxOrder: e,
+                    };
+                    let postdata = qs.stringify(param);
+                    STTDetailWxOrderEdit(postdata).then(res => {
+                        let json = res;
+                        if (json.Code == 0) {
+                            that.$message({
+                                showClose: true,
+                                message: '预约已' + statusText + '!',
+                                type: 'success'
+                            });
+                            // table 重载
+                            that.getTableQuery();
+                        } else {
+                            appoint.wxVisible = 0;
+                            that.$message.error(json.Memo);
+                        }
+                    })
+                }).catch(() => {
+                    this.appoint = "0"
+                    this.$message({
+                        type: 'info',
+                        message: '已取消当前操作'
+                    });
+                });
+            },
+            vipSelect() {
                 let that = this;
                 let param = {
                     token: localStorage.token,
@@ -379,7 +444,7 @@
                     }
                 })
             },
-            ClassSelect(){
+            ClassSelect() {
                 let that = this;
                 let param = {
                     token: localStorage.token,
@@ -397,12 +462,12 @@
                 })
 
             },
-            ConfirmOrderAddByManager(){
+            ConfirmOrderAddByManager() {
                 let that = this;
                 let param = {
-                token: localStorage.token,
-                    stdId : this.form.stdId ,
-                    userId  : this.form.userId  ,
+                    token: localStorage.token,
+                    stdId: this.form.stdId,
+                    userId: this.form.userId,
                 };
                 let postdata = qs.stringify(param);
                 OrderAddByManager(postdata).then(res => {
@@ -413,7 +478,7 @@
                             message: '预约添加成功!',
                             type: 'success'
                         });
-                        this.getTableQuery();
+                        this.getTableQuery2();
                         that.dialogMemberVisible = false;
                     } else {
                         that.$message.error(json.Memo);
@@ -422,29 +487,73 @@
             },
             // 选择日期
             choiceTime(i) {
-                console.log(123);
                 this.choiceDate = parseInt(i);
+                // 读取当前页
+                if (this.activeName == 'first') {
+                    this.getTableQuery();
+                } else {
+                    // second
+                    this.getTableQuery2();
+                }
+            },
+            seeDetail(row) {
+                let that = this;
+                let dayIndex = parseInt(this.choiceDate);
+                let param = {
+                    token: localStorage.token,
+                    classId: row.ClassId,
+                    orderDate: this.weeks[dayIndex].orderDate,
+                    stdId: row.StdId,
+                };
+                let postdata = qs.stringify(param);
+                VipUserOrderQuery(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        this.dialogTableVisible = true;
+                        this.gridData = json.Rs;
+                        console.log(123);
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
             },
             format(percentage) {
                 return percentage === 100 ? '已满' : `${percentage}%`;
             },
             // 编辑
-            editMember(row) {
+            BtnOrderCancelByManager(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 = '编辑教练'
-
+                this.$confirm('是否取消用户' + row.UserName + '的预约?', '取消预约', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    let param = {
+                        token: localStorage.token,
+                        Id: row.Id,
+                        status: 0,
+                    };
+                    let postdata = qs.stringify(param);
+                    OrderCancelByManager(postdata).then(res => {
+                        let json = res;
+                        if (json.Code == 0) {
+                            that.$message({
+                                showClose: true,
+                                message: row.UserName + '取消预约成功!',
+                                type: 'success'
+                            });
+                            // table 重载
+                            that.getTableQuery2();
+                        } else {
+                            that.$message.error(json.Memo);
+                        }
+                    })
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消操作'
+                    });
+                });
             },
             // 禁用
             pauseRow(row) {
@@ -878,9 +987,29 @@
             // 新增教练
             addMember() {
                 this.clearForm();
+                // 加载当前可选课程
+                this.getClassListByOrderDate();
                 this.dialogMemberVisible = true
                 this.btnType = 0;
-                this.dialogTitle = '新增教练'
+                this.dialogTitle = '新增预约';
+            },
+            // 加载当前可选课程
+            getClassListByOrderDate() {
+                let that = this;
+                let dayIndex = parseInt(this.choiceDate);
+                let param = {
+                    token: localStorage.token,
+                    orderDate: this.weeks[dayIndex].orderDate,
+                };
+                let postdata = qs.stringify(param);
+                ClassListByOrderDate(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.form.stdList = turnStdToOption(json.Rs);
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
             },
             // 删除
             delList() {
@@ -955,18 +1084,19 @@
             // 页面数据查询
             getTableQuery() {
                 let that = this;
-                // this.getGetChildRegionSelect(0, 1);
                 that.loading = true;
-                // 查询检测设备。上级区域id,区域id必传。regionid传0,查询supregionid对应所有子区域的检测设备。 如果supregionid,regionid都传0,默认查询企业ID下所有检测设备
+                let dayIndex = parseInt(this.choiceDate);
                 let param = {
                     token: localStorage.token,
+                    orderDate: this.weeks[dayIndex].orderDate,
                 };
                 let postdata = qs.stringify(param);
-                TodayClassOrderQuery(postdata).then(res => {
+                ClassOrderQuery(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         that.loading = false;
                         if (json.Rs) {
+                            that.allTableData = [];
                             that.allTableData = json.Rs;
                             that.recordsTotal = json.Rs.length;
                         } else {
@@ -983,24 +1113,23 @@
             },
             getTableQuery2() {
                 let that = this;
-                // this.getGetChildRegionSelect(0, 1);
                 that.loading = true;
-                // 查询检测设备。上级区域id,区域id必传。regionid传0,查询supregionid对应所有子区域的检测设备。 如果supregionid,regionid都传0,默认查询企业ID下所有检测设备
+                let dayIndex = parseInt(this.choiceDate);
                 let param = {
                     token: localStorage.token,
-                    supregionid: 0,//
-                    regionid: this.panel.regionid,//
-                    comid: 1,//
-                    tagname: that.panel.tagname,//标签名
-                    start: 1,//
-                    tableMax: 9999,//
+                    classId: 0,//
+                    stdId: 0,//
+                    name: this.panel.name,//
+                    phone: this.panel.phone,//
+                    orderDate: this.weeks[dayIndex].orderDate,
                 };
                 let postdata = qs.stringify(param);
-                testTable(postdata).then(res => {
+                VipUserOrderQuery(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         that.loading = false;
                         if (json.Rs) {
+                            console.log(json.Rs);
                             that.allTableData2 = json.Rs;
                             that.recordsTotal2 = json.Rs.length;
                         } else {
@@ -1039,10 +1168,10 @@
             setPaginations2() {
                 // 分页属性
                 let that = this;
-                that.pageination.total = that.recordsTotal;
+                that.pageination.total = that.recordsTotal2;
 
                 // 默认分页
-                that.tableData = that.allTableData.filter((item, index) => {
+                that.tableData2 = that.allTableData2.filter((item, index) => {
                     return index < that.pageination.pageItem;
                 });
             },
@@ -1093,46 +1222,82 @@
                 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 = [];
+                let month = 0;
                 for (let i = 0; i < 7; i++) {
                     days = new Date(nowTime + (i - day) * oneDayTime);//显示周日
+                    month = days.getMonth() + 1;
                     item = {
-                            name: this.numberToWeek(days.getDay()),
-                            data: days.getMonth() + 1 + '月' + days.getDate() + '日'
-                        }
+                        name: this.numberToWeek(days.getDay()),
+                        data: month + '月' + days.getDate() + '日',
+                        orderDate: new Date().getFullYear() + '-' + month + '-' + days.getDate()
+
+                    }
+                    this.weeks.push(item)
+                }
+            },
+            // 获取未来7天的
+            getFurtherDays() {
+                let now = new Date();
+                let nowTime = now.getTime();
+                let oneDayTime = 24 * 60 * 60 * 1000;
+                let days = '';
+                let item = [];
+                let month = 0;
+                let day = 0;
+                for (let i = 0; i < 7; i++) {
+                    days = new Date(nowTime + (i) * oneDayTime);//显示周日
+                    month = days.getMonth() + 1;
+                    day = days.getDate();
+                    month = month < 10 ? '0' + month : month;
+                    day = day < 10 ? '0' + day : day;
+                    item = {
+                        name: this.numberToWeek(days.getDay()),
+                        data: days.getMonth() + 1 + '月' + days.getDate() + '日',
+                        orderDate: new Date().getFullYear() + '-' + month + '-' + day
+                    }
                     this.weeks.push(item)
                 }
+                this.getTableQuery();
+                this.getTableQuery2();
             },
             numberToWeek(val) {
                 switch (parseInt(val)) {
-                    case 0:
+                    case 1:
                         return '星期一'
                         break;
-                    case 1:
+                    case 2:
                         return '星期二'
                         break;
-                    case 2:
+                    case 3:
                         return '星期三'
                         break;
-                    case 3:
+                    case 4:
                         return '星期四'
                         break;
-                    case 4:
+                    case 5:
                         return '星期五'
                         break;
-                    case 5:
+                    case 6:
                         return '星期六'
                         break;
-                    case 6:
+                    case 0:
                         return '星期天'
                         break;
                 }
             }
         },
+        watch: {
+            activeName(val) {
+                if (val == 'first') {
+                    this.getTableQuery();
+                } else {
+                    // second
+                    this.getTableQuery2();
+                }
+            },
+        }
     }
 </script>
 
@@ -1257,8 +1422,11 @@
         float: left;
         margin-right: 6px;
         border: 1px solid #ccc;
+        border-bottom: 0;
         text-align: center;
         height: 40px;
+        background: #fff;
+        z-index: 222;
     }
 
     em {
@@ -1285,6 +1453,7 @@
 
     .timeList li.active {
         border: 1px solid #3799FF;
+        border-bottom: 0;
     }
 
     .timeList li.active em {
@@ -1294,13 +1463,30 @@
     .timeList li.active span {
         color: #3799FF;
     }
+
     .panel_control /deep/ .el-input {
         max-width: 140px;
         float: left;
     }
+
     .panel-body em {
         float: left;
         line-height: 40px;
         margin-right: 10px;
     }
+
+    .gary {
+        border: 1px solid #ccc;
+        border-bottom: 0;
+        color: #ccc;
+    }
+
+    .pull-right {
+        float: right;
+    }
+    .lessons {
+        padding: 1px 7px;
+        border-radius: 250px;
+        float: left;
+    }
 </style>

+ 50 - 613
pc/src/views/record.vue

@@ -7,11 +7,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="6">
                             <em>日期:</em>
@@ -25,9 +25,9 @@
                         </el-col>
                         <el-col :span="4">
                             <em>预约课程:</em>
-                            <el-select v-model="panel.taskstatus">
+                            <el-select v-model="panel.classId">
                                 <el-option
-                                        v-for="item in panel.options"
+                                        v-for="item in panel.classOptions"
                                         :key="item.value"
                                         :label="item.label"
                                         :value="item.value">
@@ -36,7 +36,7 @@
                         </el-col>
                         <el-col :span="4">
                             <em>状态:</em>
-                            <el-select v-model="panel.taskstatus">
+                            <el-select v-model="panel.status">
                                 <el-option
                                         v-for="item in panel.options"
                                         :key="item.value"
@@ -69,7 +69,7 @@
                         width="50">
                 </el-table-column>
                 <el-table-column
-                        prop="Name"
+                        prop="UserName"
                         label="会员名"
                 >
                 </el-table-column>
@@ -80,39 +80,48 @@
                 >
                 </el-table-column>
                 <el-table-column
-                        prop="name"
+                        prop="ClassName"
                         label="预约课程"
                         sortable
                 >
+                    <template slot-scope="scope">
+                        <span class="lessons" :style="{ background:scope.row.ClassColor }">{{scope.row.ClassName}}</span>
+                    </template>
                 </el-table-column>
                 <el-table-column
-                        prop="ConsumeNormalhour"
-                        label="消耗课时"
+                        prop="ConsumeHour"
+                        label="课时"
                         sortable
                 >
                 </el-table-column>
                 <el-table-column
-                        prop="ConsumeGifthour"
-                        label="消耗赠送"
+                        prop="CurrentDate"
+                        label="预约日期"
+                        width="180"
+                        :formatter="filterFmtDate"
                         sortable
                 >
                 </el-table-column>
                 <el-table-column
-                        prop="ExpTime"
-                        label="预约时间"
+                        prop="BeginStr"
+                        label="上课时间"
                         width="180"
-                        :formatter="filterFmtDate"
                         sortable
                 >
+                    <template slot-scope="scope">
+                        {{scope.row.BeginStr}} - {{scope.row.EndStr}}
+                    </template>
                 </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>
+                        <span v-if="scope.row.Status == 3">预约未到</span>
+                        <span v-if="scope.row.Status == 4">已完成</span>
                     </template>
                 </el-table-column>
             </el-table>
@@ -124,93 +133,6 @@
                     @current-change="pageChange"
             ></el-pagination>
         </div>
-
-        <el-dialog :title="dialogTitle" :visible.sync="dialogMemberVisible" width="1200px">
-            <div class="dialogContent">
-                <div class="pull-left">
-                    <el-form ref="form" :model="form" label-width="160px">
-                        <el-form-item label="手机号">
-                            <el-input v-model="form.userCode"></el-input>
-                        </el-form-item>
-                        <el-form-item label="会员名">
-                            <el-input v-model="form.name"></el-input>
-                        </el-form-item>
-                        <el-form-item label="会员类型">
-                            <el-select v-model="form.memberType" placeholder="请选择所属门店">
-                                <el-option
-                                        v-for="item in memberTypes"
-                                        :key="item.value"
-                                        :label="item.label"
-                                        :value="item.value"
-                                ></el-option>
-                            </el-select>
-                        </el-form-item>
-                        <el-form-item label="课时">
-                            <el-input-number v-model="form.lesson" :min="0" :max="99999" label="(天)"></el-input-number>
-                        </el-form-item>
-                        <el-form-item label="赠送课时">
-                            <el-input-number v-model="form.gift" :min="0" :max="99999" label="(天)"></el-input-number>
-                        </el-form-item>
-                        <el-form-item label="备注">
-                            <el-input v-model="form.memo"></el-input>
-                        </el-form-item>
-                    </el-form>
-                </div>
-                <div class="pull-right">
-                    <el-form ref="form" :model="form" label-width="160px">
-                        <el-form-item label="会员课程">
-                            <el-transfer filterable v-model="form.dialogValue" :data="form.dialogdata"></el-transfer>
-                        </el-form-item>
-                    </el-form>
-                </div>
-            </div>
-            <div class="dialogFooter">
-                <el-button type="primary" size="small" v-if="form.btnType == 0" @click="confirmMember">确定</el-button>
-                <el-button type="primary" size="small" v-if="form.btnType == 1" @click="confirmEditMember">确定
-                </el-button>
-                <el-button size="small" @click="dialogMemberVisible = false">取消</el-button>
-            </div>
-        </el-dialog>
-
-        <el-dialog :visible.sync="dialogVisible">
-            <div class="dialogTitle">
-                <h5>
-                    用户:
-                    <em class="blue">【 {{form.rowName}}】</em>
-                    <span v-if="dialogLesson">当前课时</span>
-                    <span v-if="dialogGift">当前赠送课时</span>
-                    <span v-if="dialogExpTime">当前到期时间</span>
-                    <span v-if="dialogLessonTable">当前会员课程</span>
-                </h5>
-            </div>
-            <div v-if="dialogLesson">
-                <el-input-number v-model="form.lesson" :min="0" :max="9999" label="课时调整"></el-input-number>
-            </div>
-            <div v-if="dialogGift">
-                <el-input-number v-model="form.gift" :min="0" :max="9999" label="赠送课时调整"></el-input-number>
-            </div>
-
-            <div v-if="dialogExpTime">
-                <el-date-picker
-                        v-model="form.expTime"
-                        type="date"
-                        placeholder="选择日期">
-                </el-date-picker>
-            </div>
-            <div v-if="dialogLessonTable">
-                <el-transfer filterable v-model="form.dialogValue" :data="form.dialogdata"></el-transfer>
-            </div>
-
-            <div class="dialogFooter">
-                <!--                当前课时-->
-                <el-button type="primary" size="small" @click="confirmLesson" v-if="dialogLesson">确定</el-button>
-                <el-button type="primary" size="small" @click="confirmGift" v-if="dialogGift">确定</el-button>
-                <el-button type="primary" size="small" @click="confirmExpTime" v-if="dialogExpTime">确定</el-button>
-                <el-button type="primary" size="small" @click="confirmLessonTable" v-if="dialogLessonTable">确定
-                </el-button>
-                <el-button size="small" @click="dialogVisible = false">取消</el-button>
-            </div>
-        </el-dialog>
     </div>
 </template>
 
@@ -218,8 +140,7 @@
     import Global from '../Global.js'
     import {
         OrderListQuery,
-        testTable,
-        testSelect
+        ClassListQuery,
     } from "../api/getApiRes";
 
     let qs = require('qs');
@@ -236,6 +157,8 @@
                 dialogValue: [],
                 // panel 配置项目
                 panel: {
+                    status: '',
+                    classId: '',
                     usercode: '',
                     username: '',
                     timeScope: globalBt2(30),
@@ -255,10 +178,13 @@
                     fileList: [],
                     multipleSelection: [],
                     detectedmac: '',
+                    classOptions:[],
                     options: [
-                        {value: 99, label: '全部'},
-                        {value: 1, label: '进行中'},
-                        {value: 2, label: '已完成'},
+                        {value: '', label: '全部'},
+                        {value: 1, label: '已预约'},
+                        {value: 2, label: '已取消'},
+                        {value: 3, label: '预约未到'},
+                        {value: 4, label: '已完成'},
                     ],
                     endTypeOptions: [
                         {value: 99, label: '全部'},
@@ -300,437 +226,6 @@
             this.getTableQuery();
         },
         methods: {
-            // 编辑
-            editMember(row) {
-                let that = this;
-                this.clearForm();
-
-                this.form.userCode = row.userCode;
-                this.form.name = row.name;
-                this.form.memberType = row.vipType;
-                this.form.lesson = row.Recovered;
-                this.form.gift = row.Recovered;
-                this.form.memo = row.memo;
-                this.form.btnType = 1;
-
-                this.form.shopId = row.Id;
-                this.dialogMemberVisible = true
-                this.dialogTitle = '编辑会员'
-
-            },
-            // 禁用
-            pauseRow(row) {
-                let that = this;
-                this.$confirm('是否禁用用户' + row.name + '?', '禁用操作', {
-                    confirmButtonText: '确定',
-                    cancelButtonText: '取消',
-                    type: 'warning'
-                }).then(() => {
-                    let param = {
-                        token: localStorage.token,
-                        Id: row.Id,
-                        status: 0,
-                    };
-                    let postdata = qs.stringify(param);
-                    testTable(postdata).then(res => {
-                        let json = res;
-                        if (json.Code == 0) {
-                            that.$message({
-                                showClose: true,
-                                message: row.name + '禁用成功!',
-                                type: 'success'
-                            });
-                            // table 重载
-                            that.getTableQuery();
-                        } else {
-                            that.$message.error(json.Memo);
-                        }
-                    })
-                }).catch(() => {
-                    this.$message({
-                        type: 'info',
-                        message: '已取消禁用'
-                    });
-                });
-            },
-            // 启用
-            runRow(row) {
-                let that = this;
-                this.$confirm('是否启用用户' + row.name + '?', '启用操作', {
-                    confirmButtonText: '确定',
-                    cancelButtonText: '取消',
-                    type: 'warning'
-                }).then(() => {
-                    let param = {
-                        token: localStorage.token,
-                        Id: row.Id,
-                        status: 1,
-                    };
-                    let postdata = qs.stringify(param);
-                    testTable(postdata).then(res => {
-                        let json = res;
-                        if (json.Code == 0) {
-                            that.$message({
-                                showClose: true,
-                                message: row.name + '启用成功!',
-                                type: 'success'
-                            });
-                            // table 重载
-                            that.getTableQuery();
-                        } else {
-                            that.$message.error(json.Memo);
-                        }
-                    })
-                }).catch(() => {
-                    this.$message({
-                        type: 'info',
-                        message: '已取消启用'
-                    });
-                });
-            },
-            // 关闭所有
-            allDialogClose() {
-                this.dialogVisible = false;
-                this.dialogGift = false;
-                this.dialogLesson = false;
-                this.dialogExpTime = false;
-                this.dialogLessonTable = false;
-            },
-            // 用户禁用 todo
-            // 用户启用 todo
-            // 有效期调整
-            ExpTimeChange() {
-                // 仅针对年费用户,使用日期格式
-                this.allDialogClose();
-                if (!this.multipleSelection.length) {
-                    this.$message({
-                        showClose: true,
-                        message: '错了哦,需要先选中至少一条记录',
-                        type: 'error'
-                    });
-                    return false
-                }
-                if (this.multipleSelection.length != 1) {
-                    this.$message({
-                        showClose: true,
-                        message: '错了哦,只能选中一条记录',
-                        type: 'error'
-                    });
-                    return false
-                }
-                let row = this.multipleSelection[0];
-                if (parseInt(row.vipType) == 2) {
-                    this.$message({
-                        showClose: true,
-                        message: '错了哦,充值会员不能调整有效期',
-                        type: 'error'
-                    });
-                    return false
-                }
-                this.form.expTime = row.expTime;
-                this.form.rowName = row.name;
-                this.dialogVisible = true;
-                this.dialogExpTime = true;
-            },
-            // 课时调整
-            lessonChange() {
-                this.allDialogClose();
-                if (!this.multipleSelection.length) {
-                    this.$message({
-                        showClose: true,
-                        message: '错了哦,需要先选中至少一条记录',
-                        type: 'error'
-                    });
-                    return false
-                }
-                if (this.multipleSelection.length != 1) {
-                    this.$message({
-                        showClose: true,
-                        message: '错了哦,只能选中一条记录',
-                        type: 'error'
-                    });
-                    return false
-                }
-                let row = this.multipleSelection[0];
-                this.form.lesson = row.Recovered;
-                this.form.rowName = row.name;
-                this.dialogVisible = true;
-                this.dialogLesson = true;
-
-            },
-            // 赠送调整
-            giftChange() {
-                this.allDialogClose();
-                if (!this.multipleSelection.length) {
-                    this.$message({
-                        showClose: true,
-                        message: '错了哦,需要先选中至少一条记录',
-                        type: 'error'
-                    });
-                    return false
-                }
-                if (this.multipleSelection.length != 1) {
-                    this.$message({
-                        showClose: true,
-                        message: '错了哦,只能选中一条记录',
-                        type: 'error'
-                    });
-                    return false
-                }
-                let row = this.multipleSelection[0];
-                this.form.gift = row.Recovered;
-                this.form.rowName = row.name;
-                this.dialogVisible = true;
-                this.dialogGift = true;
-
-            },
-            // 增删会员课程
-            lessonStudenChange() {
-                this.allDialogClose();
-                if (!this.multipleSelection.length) {
-                    this.$message({
-                        showClose: true,
-                        message: '错了哦,需要先选中至少一条记录',
-                        type: 'error'
-                    });
-                    return false
-                }
-                if (this.multipleSelection.length != 1) {
-                    this.$message({
-                        showClose: true,
-                        message: '错了哦,只能选中一条记录',
-                        type: 'error'
-                    });
-                    return false
-                }
-                let row = this.multipleSelection[0];
-                this.form.gift = row.Recovered;
-                this.form.rowName = row.name;
-                this.dialogVisible = true;
-                this.dialogLessonTable = true;
-            },
-            // 确认提交新增会员
-            confirmMember() {
-                let that = this;
-                // checkNum
-                if (!that.form.userCode) {
-                    this.$message.error('错了哦,手机号不能为空');
-                    return false
-                }
-                if (!globalCheckPhone(that.form.userCode)) {
-                    this.$message.error('错了哦,手机号格式不正确');
-                    return false
-                }
-                if (!that.form.name) {
-                    this.$message.error('错了哦,会员名不能为空');
-                    return false
-                }
-                if (that.form.name.length > 8) {
-                    this.$message.error('错了哦,会员名字数超过8个字');
-                    return false
-                }
-                if (that.form.memo) {
-                    if (that.form.memo.length > 200) {
-                        this.$message.error('错了哦,备注字数超过200个字');
-                        return false
-                    }
-                }
-
-                let param = {
-                    token: localStorage.token,
-                    userCode: that.form.userCode,
-                    name: that.form.name,
-                    memberType: that.form.memberType,
-                    lesson: that.form.lesson,
-                    gift: that.form.gift,
-                    memo: that.form.memo,
-                    dialogValue: that.form.dialogValue,
-                };
-                let postdata = qs.stringify(param);
-                testSelect(postdata).then(res => {
-                    let json = res;
-                    if (json.Code == 0) {
-                        // 关闭弹窗
-                        that.dialogMemberVisible = false;
-                        // 重载列表
-                        that.getTableQuery();
-                        that.$message({
-                            showClose: true,
-                            message: '会员添加成功!',
-                            type: 'success'
-                        });
-                    } else {
-                        that.$message.error(json.Memo);
-                    }
-                })
-            },
-            confirmEditMember() {
-                console.log(123);
-                let that = this;
-                // checkNum
-                if (!that.form.userCode) {
-                    this.$message.error('错了哦,手机号不能为空');
-                    return false
-                }
-                console.log(that.form.userCode);
-                if (!globalCheckPhone(that.form.userCode)) {
-                    this.$message.error('错了哦,手机号格式不正确');
-                    return false
-                }
-                if (!that.form.name) {
-                    this.$message.error('错了哦,会员名不能为空');
-                    return false
-                }
-                if (that.form.name.length > 8) {
-                    this.$message.error('错了哦,会员名字数超过8个字');
-                    return false
-                }
-                if (that.form.memo) {
-                    if (that.form.memo.length > 200) {
-                        this.$message.error('错了哦,备注字数超过200个字');
-                        return false
-                    }
-                }
-                let param = {
-                    token: localStorage.token,
-                    userCode: that.form.userCode,
-                    name: that.form.name,
-                    memberType: that.form.memberType,
-                    lesson: that.form.lesson,
-                    gift: that.form.gift,
-                    memo: that.form.memo,
-                    dialogValue: that.form.dialogValue,
-                };
-                let postdata = qs.stringify(param);
-                testSelect(postdata).then(res => {
-                    let json = res;
-                    if (json.Code == 0) {
-                        // 关闭弹窗
-                        that.dialogMemberVisible = false;
-                        // 重载列表
-                        that.getTableQuery();
-                        that.$message({
-                            showClose: true,
-                            message: '会员信息编辑成功!',
-                            type: 'success'
-                        });
-                    } else {
-                        that.$message.error(json.Memo);
-                    }
-                })
-            },
-            // 确认提交课时
-            confirmLesson() {
-                let that = this;
-                // checkNum
-
-                let param = {
-                    token: localStorage.token,
-                    userCode: that.form.userCode,
-                    lesson: that.form.lesson,
-                };
-                let postdata = qs.stringify(param);
-                testSelect(postdata).then(res => {
-                    let json = res;
-                    if (json.Code == 0) {
-                        // 关闭弹窗
-                        that.dialogVisible = false;
-                        // 重载列表
-                        that.getTableQuery();
-                        that.$message({
-                            showClose: true,
-                            message: '课时调整成功!',
-                            type: 'success'
-                        });
-                    } else {
-                        that.$message.error(json.Memo);
-                    }
-                })
-            },
-            // 确认提交赠送
-            confirmGift() {
-                let that = this;
-                // checkNum
-
-                let param = {
-                    token: localStorage.token,
-                    userCode: that.form.userCode,
-                    gift: that.form.gift,
-                };
-                let postdata = qs.stringify(param);
-                testSelect(postdata).then(res => {
-                    let json = res;
-                    if (json.Code == 0) {
-                        // 关闭弹窗
-                        that.dialogVisible = false;
-                        // 重载列表
-                        that.getTableQuery();
-                        that.$message({
-                            showClose: true,
-                            message: '赠送课时调整成功!',
-                            type: 'success'
-                        });
-                    } else {
-                        that.$message.error(json.Memo);
-                    }
-                })
-            },
-            // 确认提交有效期
-            confirmExpTime() {
-                let that = this;
-                // checkNum
-
-                let param = {
-                    token: localStorage.token,
-                    userCode: that.form.userCode,
-                    expTime: that.form.expTime,
-                };
-                let postdata = qs.stringify(param);
-                testSelect(postdata).then(res => {
-                    let json = res;
-                    if (json.Code == 0) {
-                        // 关闭弹窗
-                        that.dialogVisible = false;
-                        // 重载列表
-                        that.getTableQuery();
-                        that.$message({
-                            showClose: true,
-                            message: '赠送课时调整成功!',
-                            type: 'success'
-                        });
-                    } else {
-                        that.$message.error(json.Memo);
-                    }
-                })
-            },
-            // 确认提交会员课程
-            confirmLessonTable() {
-                let that = this;
-                // checkNum
-
-                let param = {
-                    token: localStorage.token,
-                    userCode: that.form.userCode,
-                    dialogValue: that.form.dialogValue,
-                };
-                let postdata = qs.stringify(param);
-                testSelect(postdata).then(res => {
-                    let json = res;
-                    if (json.Code == 0) {
-                        // 关闭弹窗
-                        that.dialogVisible = false;
-                        // 重载列表
-                        that.getTableQuery();
-                        that.$message({
-                            showClose: true,
-                            message: '会员课程调整成功!',
-                            type: 'success'
-                        });
-                    } else {
-                        that.$message.error(json.Memo);
-                    }
-                })
-            },
             // 加载选项
             panelSelect() {
                 let that = this;
@@ -738,85 +233,22 @@
                     token: localStorage.token,
                 };
                 let postdata = qs.stringify(param);
-                testSelect(postdata).then(res => {
+                ClassListQuery(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
-                        that.form.dialogdata = json.Rs;
+                        that.panel.classOptions = turnClassResToOption(json.Rs);
+                        that.panel.classOptions.unshift({value:'',label:'全部'})
                     } else {
                         that.$message.error(json.Memo);
                     }
                 })
             },
-            // 新增会员
-            addMember() {
-                this.clearForm();
-                this.dialogMemberVisible = true
-                this.btnType = 0;
-                this.dialogTitle = '新增会员'
-            },
-            // 删除
-            delList() {
-                let that = this;
-                // checkNum
-                if (!this.multipleSelection.length) {
-                    that.$message({
-                        showClose: true,
-                        message: '错了哦,需要先选中至少一条记录',
-                        type: 'error'
-                    });
-                    return false
-                }
-                if (this.multipleSelection.length != 1) {
-                    that.$message({
-                        showClose: true,
-                        message: '错了哦,只能选中一条记录',
-                        type: 'error'
-                    });
-                    return false
-                }
-
-                let detectorid = that.multipleSelection[0].Id;
-
-                let param = {
-                    token: localStorage.token,
-                    detectorid: detectorid,
-                    status: 9,//0禁用1启用9删除
-                };
-                let postdata = qs.stringify(param);
-
-                this.$confirm('此操作将永久删除该会员, 是否继续?', '提示', {
-                    confirmButtonText: '确定',
-                    cancelButtonText: '取消',
-                    type: 'warning'
-                }).then(() => {
-                    testSelect(postdata).then(res => {
-                        let json = res;
-                        if (json.Code == 0) {
-                            that.$message({
-                                showClose: true,
-                                message: '选中的会员已删除!',
-                                type: 'success'
-                            });
-                            // 重载列表
-                            that.getTableQuery();
-                        } else {
-                            that.$message.error(json.Memo);
-                        }
-                    });
-                }).catch(() => {
-                    this.$message({
-                        type: 'info',
-                        message: '已取消删除'
-                    });
-                });
-            },
-
             handleSelectionChange(val) {
                 this.multipleSelection = val;
             },
             // 查询按钮
             query() {
-                // this.getTableQuery();
+                this.getTableQuery();
                 this.$message.success('查询完毕');
             },
             clearForm() {
@@ -833,12 +265,12 @@
                 // 查询检测设备。上级区域id,区域id必传。regionid传0,查询supregionid对应所有子区域的检测设备。 如果supregionid,regionid都传0,默认查询企业ID下所有检测设备
                 let param = {
                     token: localStorage.token,
-                    supregionid: 0,//
-                    regionid: this.panel.regionid,//
-                    comid: 1,//
-                    tagname: that.panel.tagname,//标签名
-                    start: 1,//
-                    tableMax: 9999,//
+                    classId: that.panel.classId,//
+                    name: that.panel.name,//
+                    phone: that.panel.phone,//
+                    beginOrdertime: that.panel.beginOrdertime,//
+                    endOrdertime: that.panel.endOrdertime,//
+                    status: that.panel.status,//标签名
                 };
                 let postdata = qs.stringify(param);
                 OrderListQuery(postdata).then(res => {
@@ -1032,4 +464,9 @@
     /deep/ .el-date-editor .el-range-separator {
         line-height: 22px;
     }
+    .lessons {
+        padding: 1px 7px;
+        border-radius: 250px;
+        float: left;
+    }
 </style>

+ 72 - 30
pc/src/views/setting.vue

@@ -10,23 +10,23 @@
                        <span>
                            是否关闭本店预约
                        </span>
-                                <el-switch
-                                        v-model="appoint"
-                                        :active-value="1"
-                                        :inactive-value="0"
-                                        active-color="#409EFF"
-                                        inactive-color="#D9D9D9"
-                                        @change=changeWechat($event,appoint)
-                                >
-                                </el-switch>
-                                <em>
-                                    温馨提示:默认关闭,开启后将会关闭本店的所有课程预约,请谨慎操作!
-                                </em>
+                            <el-switch
+                                    v-model="appoint"
+                                    :active-value="0"
+                                    :inactive-value="1"
+                                    active-color="#409EFF"
+                                    inactive-color="#D9D9D9"
+                                    @change=changeWechat($event,appoint)
+                            >
+                            </el-switch>
+                            <em>
+                                温馨提示:默认关闭,开启后将会关闭本店的所有课程预约,请谨慎操作!
+                            </em>
                             </div>
                         </div>
                     </el-tab-pane>
                     <el-tab-pane label="密码修改" name="second">
-                        <div class="form_container" >
+                        <div class="form_container">
                             <el-form ref="form" :model="form" label-width="110px" :rules="rules">
                                 <el-form-item label="请输入原密码" prop="old">
                                     <el-input v-model="form.old" type="password"></el-input>
@@ -48,15 +48,15 @@
         </div>
     </div>
 </template>
-
 <script>
     let qs = require('qs');
     import Global from '../Global.js'
     import {
         PassEdit,
+        ShopDetailOne,
+        ShopWxStatusEdit,
         testTable,
     } from '../api/getApiRes.js'
-
     export default {
         data() {
             let samepass = (rule, value, callback) => {
@@ -76,7 +76,7 @@
             };
             return {
                 activeName: 'first',
-                pageApppoint:true,
+                pageApppoint: true,
                 valImgSrc: '',
                 overtime: '',
                 appoint: '0',
@@ -112,33 +112,63 @@
         mounted() {
             // 读取验证码
             this.overtime = new Date();
-
+            this.GetShopDetailOne();
             // 读取当前店铺预约状态 todo
         },
         methods: {
-            // 微信可见与否
-            changeWechat(e,appoint) {
+            GetShopDetailOne() {
                 let that = this;
                 let param = {
                     token: localStorage.token,
-                    wxVisible: e,//
+                    shopId: localStorage.shopId,
                 };
                 let postdata = qs.stringify(param);
-                testTable(postdata).then(res => {
+                ShopDetailOne(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
-                        that.$message({
-                            showClose: true,
-                            message: '本店预约已关闭' ,
-                            type: 'success'
-                        });
-                        // 重载列表
-                        that.getTableQuery();
+                        this.appoint = json.Rs.WxStatus;
                     } else {
                         that.$message.error(json.Memo);
                     }
                 })
             },
+            // 微信可见与否
+            changeWechat(e, appoint) {
+                let that = this;
+                let statusText = appoint == 0 ? "关闭":"开启";
+                this.$confirm('是否'+statusText+'本店的所有课程预约?', '禁用操作', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    let param = {
+                        token: localStorage.token,
+                        shopId: localStorage.shopId,
+                        wxStatus: e,
+                    };
+                    let postdata = qs.stringify(param);
+                    ShopWxStatusEdit(postdata).then(res => {
+                        let json = res;
+                        if (json.Code == 0) {
+                            that.$message({
+                                showClose: true,
+                                message: '本店预约已'+statusText+'!',
+                                type: 'success'
+                            });
+                            // table 重载
+                            that.getTableQuery();
+                        } else {
+                            that.$message.error(json.Memo);
+                        }
+                    })
+                }).catch(() => {
+                    this.appoint = "0"
+                    this.$message({
+                        type: 'info',
+                        message: '已取消当前操作'
+                    });
+                });
+            },
             // 跳转tab页面
             goTab(url) {
                 this.$router.push({path: url});
@@ -224,6 +254,7 @@
 </script>
 <style scoped>
     @import "../assets/css/panel.css";
+
     ul {
         margin: 0;
         padding: 0;
@@ -350,6 +381,7 @@
         float: right;
         bottom: 35px;
     }
+
     .context {
         overflow: hidden;
         display: block;
@@ -362,17 +394,20 @@
         padding: 20px;
         background: #F0F2F5;
     }
+
     .change button {
         float: left;
         margin-right: 10px;
     }
+
     .change button.el-button--primary {
         height: 38px;
-        color:#fff;
+        color: #fff;
         background: #409EFF;
         padding: 3px 5px;
         width: 120px;
     }
+
     .form_container {
         width: 100%;
         overflow: hidden;
@@ -381,6 +416,7 @@
         padding-left: 0;
         padding-right: 0;
     }
+
     .form_container .gary {
         width: 100%;
         height: 64px;
@@ -392,13 +428,16 @@
         background: #F0F2F5;
         border-radius: 2px;
     }
+
     .gary span {
         float: left;
         margin-right: 30px;
     }
+
     /deep/ .el-switch {
         float: left;
     }
+
     .gary em {
         position: relative;
         top: -10px;
@@ -411,14 +450,17 @@
         font-size: 14px;
         font-style: normal;
     }
+
     /deep/ .el-form {
         width: 600px;
         float: left;
     }
-    /deep/  .el-form-item__content {
+
+    /deep/ .el-form-item__content {
         width: 437px;
         float: left;
     }
+
     .panel /deep/ .el-input__inner {
         width: 437px;
         float: left;