Просмотр исходного кода

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

Changpeng Duan 5 лет назад
Родитель
Сommit
2c78fad22e

+ 31 - 4
pc/src/Global.js

@@ -75,7 +75,7 @@ nonTfmtDatetoLength = function (datetime, length) {
     if ((datetime == '1900-01-01') || (datetime == '1900-01-01 00:00:00.000'))
         return '';
     length = !length ? 10 : length;//缺省参数
-    datetime = new Date(+new Date(datetime) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '').substr(0,length);
+    datetime = new Date(+new Date(datetime) + 8 * 3600 * 1000).toISOString().replace(/T/g, ' ').replace(/\.[\d]{3}Z/, '').substr(0, length);
     return datetime
 };
 
@@ -237,7 +237,8 @@ turnResToOption = function (data) {
     let ids = data.map(item => {
         return {
             label: item.UserInfo.Name + ' ' + item.UserInfo.Phone,
-            key: parseInt(item.UserInfo.Id)
+            key: parseInt(item.UserInfo.Id),
+            value: parseInt(item.UserInfo.Id),
         }
     })
     return ids
@@ -248,7 +249,8 @@ turnResToOptionByViper = function (data) {
     let ids = data.map(item => {
         return {
             label: item.Name + ' ' + item.Phone,
-            key: parseInt(item.Id)
+            key: parseInt(item.Id),
+            value: parseInt(item.Id),
         }
     })
     return ids
@@ -258,7 +260,8 @@ turnResToOptionByCoach = function (data) {
     let ids = data.map(item => {
         return {
             label: item.Name + ' ' + item.Phone,
-            key: parseInt(item.TeacherId)
+            key: parseInt(item.TeacherId),
+            value: parseInt(item.TeacherId),
         }
     })
     return ids
@@ -275,4 +278,28 @@ turnClassResToOption = function (data) {
         }
     })
     return ids
+}
+
+turnShopResToOption = function (data) {
+    if (!data) return false
+    let ids = data.map(item => {
+        return {
+            label: item.ShopName,
+            key: parseInt(item.ShopID),
+            value: parseInt(item.ShopID)
+        }
+    })
+    return ids
+}
+
+turnStdToOption = function (data) {
+    if (!data) return false
+    let ids = data.map(item => {
+        return {
+            label: item.ClassName + '(' + item.BeginStr + '-' + item.EndStr + ')',
+            key: parseInt(item.StdId),
+            value: parseInt(item.StdId),
+        }
+    })
+    return ids
 }

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

@@ -93,6 +93,11 @@ export function ClassAdd(postdata) {
     let url = headapi + '/v1/Class/ClassAdd';
     return getApiBasic(url, postdata);
 }
+// 课程统计
+export function ClassStatistics(postdata) {
+    let url = headapi + '/v1/Class/ClassStatistics';
+    return getApiBasic(url, postdata);
+}
 
 // √ 课程颜色修改
 export function ClassColorEdit(postdata) {
@@ -271,6 +276,11 @@ export function ShopDetailQuery(postdata) {
     let url = headapi + '/v1/User/ShopDetailQuery';
     return getApiBasic(url, postdata);
 }
+//  操作日志列表查询
+export function OptLogListQuery(postdata) {
+    let url = headapi + '/v1/User/OptLogListQuery';
+    return getApiBasic(url, postdata);
+}
 
 
 // 店铺修改
@@ -396,6 +406,26 @@ export function ShopManagerStatusEdit(postdata) {
     let url = headapi + '/v1/User/ShopManagerStatusEdit';
     return getApiBasic(url, postdata);
 }
+// 会员用户课时调整
+export function VipUserHourEdit(postdata) {
+    let url = headapi + '/v1/User/VipUserHourEdit';
+    return getApiBasic(url, postdata);
+}
+// 会员统计
+export function VipUserStatistics(postdata) {
+    let url = headapi + '/v1/User/VipUserStatistics';
+    return getApiBasic(url, postdata);
+}
+// 会员课程增删
+export function VipUserClassEdit(postdata) {
+    let url = headapi + '/v1/User/VipUserClassEdit';
+    return getApiBasic(url, postdata);
+}
+// 会员有效期调整
+export function VipUserExpEdit(postdata) {
+    let url = headapi + '/v1/User/VipUserExpEdit';
+    return getApiBasic(url, postdata);
+}
 
 // 会员用户添加
 export function VipUserAdd(postdata) {

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

@@ -5,7 +5,7 @@
         </div>
         <div class="userContainer">
             <img src="../assets/img/nav/head.png" height="51" width="51"/>
-            <span>{{shopName}}</span>
+            <span>{{ShopName}}</span>
             <em>{{userLevelText}}</em>
         </div>
         <el-row :class="[{'shortnav':isCollapse},{'longNav':!isCollapse}]">
@@ -33,6 +33,7 @@
 <script>
     import Navs from '../api/Navs';
     import {ManagerSelfQuery} from '../api/getApiRes.js'
+    import {ShopListQuery} from "../api/getApiRes";
 
     let qs = require('qs');
     export default {
@@ -40,7 +41,7 @@
             return {
                 wildState: 0,
                 navs: [],
-                shopName: 'xx店',
+                ShopName: '',
                 userLevelText: '',
                 userLevel: 0,
                 userLevelDeafult: "",
@@ -51,6 +52,7 @@
             this.userLevelDeafult = this.$route.meta.clmid;
             this.getTableQuery();
             this.getManagerSelfQuery();
+
         },
         methods: {
             handleSelect(i, s, t) {
@@ -72,6 +74,28 @@
                         that.userLevelText = json.Rs.Role.Name;
                         that.userLevel = json.Rs.Role.State;
                         localStorage.shopId = json.Rs.ShopId;
+                        this.panelSelect(json.Rs.ShopId);
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
+            // 获取所属店铺
+            panelSelect(ShopId){
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                };
+                let postdata = qs.stringify(param);
+                ShopListQuery(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                       json.Rs.map(function (item) {
+                            if(item.ShopID ==  ShopId){
+                                that.ShopName = item.ShopName;
+                                console.log(item.ShopName);
+                            }
+                       })
                     } else {
                         that.$message.error(json.Memo);
                     }

+ 94 - 16
pc/src/views/AdminManage.vue

@@ -90,9 +90,11 @@
                         label="操作"
                 >
                     <template slot-scope="scope">
-                        <el-button type="danger" size="mini"   v-if="scope.row.Status == 1" @click="runAndPause(scope.row,0)">禁用
+                        <el-button type="danger" size="mini" v-if="scope.row.Status == 1"
+                                   @click="runAndPause(scope.row,8)">禁用
                         </el-button>
-                        <el-button type="success" size="mini" v-if="scope.row.Status == 0" @click="runAndPause(scope.row,1)">启用
+                        <el-button type="success" size="mini" v-if="scope.row.Status == 8"
+                                   @click="runAndPause(scope.row,1)">启用
                         </el-button>
                     </template>
                 </el-table-column>
@@ -149,8 +151,10 @@
     import Global from '../Global.js'
     import {
         ShopManagerListQuery,
+        ShopListQuery,
         ShopManagerAdd,
         ShopManagerEdit,
+        ShopManagerStatusEdit,
         testTable,
         testSelect
     } from "../api/getApiRes";
@@ -189,6 +193,7 @@
                 },
                 form: {
                     shopId: '',
+                    userId: '',
                     userCode: '',
                     password: '',
                     name: '',
@@ -254,15 +259,15 @@
 
                 let param = {
                     token: localStorage.token,
-                    shopid: that.form.shopid,
-                    userCode: that.form.userCode,
+                    shopId: that.form.shopId,
+                    usercode: that.form.userCode,
                     password: that.form.password,
                     name: that.form.name,
                     phone: that.form.phone,
                     memo: that.form.memo,
                 };
                 let postdata = qs.stringify(param);
-                testSelect(postdata).then(res => {
+                ShopManagerAdd(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         // 关闭弹窗
@@ -282,7 +287,79 @@
             },
             confirmEdit() {
                 // ShopManagerEdit
+                let that = this;
+                // checkNum
+                if (!that.form.userCode) {
+                    this.$message.error('错了哦,登陆账号不能为空');
+                    return false
+                }
+                if (that.form.name.length > 20) {
+                    this.$message.error('错了哦,登陆账号字数超过20个字');
+                    return false
+                }
+                if (!that.form.password) {
+                    this.$message.error('错了哦,密码不能为空');
+                    return false
+                }
+                if (that.form.password.length < 6) {
+                    this.$message.error('错了哦,密码字数小于6个字');
+                    return false
+                }
+                if (that.form.password.length > 8) {
+                    this.$message.error('错了哦,密码字数超过8个字');
+                    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.phone) {
+                    this.$message.error('错了哦,手机号码不能为空');
+                    return false
+                }
+                if (!globalCheckPhone(that.form.phone)) {
+                    this.$message.error('错了哦,手机号格式不正确');
+                    return false
+                }
+                if (that.form.memo) {
+                    if (that.form.name.memo > 200) {
+                        this.$message.error('错了哦,备注字数超过200个字');
+                        return false
+                    }
+                }
+
+                let param = {
+                    token: localStorage.token,
+                    userId: that.form.userId,
+                    shopId: that.form.shopId,
+                    usercode: that.form.userCode,
+                    password: that.form.password,
+                    name: that.form.name,
+                    phone: that.form.phone,
+                    memo: that.form.memo,
+                };
+                let postdata = qs.stringify(param);
+                ShopManagerEdit(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        // 关闭弹窗
+                        that.dialogVisible = false;
+                        that.$message({
+                            showClose: true,
+                            message: '管理员添加成功!',
+                            type: 'success'
+                        });
 
+                        // 重载列表
+                        that.getTableQuery();
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
             },
             // 加载选项
             panelSelect() {
@@ -291,12 +368,12 @@
                     token: localStorage.token,
                 };
                 let postdata = qs.stringify(param);
-                testSelect(postdata).then(res => {
+                ShopListQuery(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
-                        that.shops = json.Rs;
-                        that.form.shopId = json.Rs[0].value;
-                        that.panel.options = json.Rs;
+                        that.panel.options = turnShopResToOption(json.Rs);
+                        that.shops = turnShopResToOption(json.Rs);
+                        that.form.shopId = json.Rs[0].ShopID;
                         that.panel.options.unshift({value: 0, label: "全部"});
                     } else {
                         that.$message.error(json.Memo);
@@ -324,11 +401,11 @@
                     return false
                 }
 
-                let detectorid = that.multipleSelection[0].Id;
+                let userId  = that.multipleSelection[0].Id;
 
                 let param = {
                     token: localStorage.token,
-                    detectorid: detectorid,
+                    userId : userId ,
                     status: 9,//0禁用1启用9删除
                 };
                 let postdata = qs.stringify(param);
@@ -338,7 +415,7 @@
                     cancelButtonText: '取消',
                     type: 'warning'
                 }).then(() => {
-                    testSelect(postdata).then(res => {
+                    ShopManagerStatusEdit(postdata).then(res => {
                         let json = res;
                         if (json.Code == 0) {
                             that.$message({
@@ -363,11 +440,11 @@
                 let that = this;
                 let param = {
                     token: localStorage.token,
-                    userId: row.userId,
+                    userId: row.Id,
                     status: status,
                 };
                 let postdata = qs.stringify(param);
-                editbasicinfo(postdata).then(res => {
+                ShopManagerStatusEdit(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         that.$message({
@@ -384,7 +461,7 @@
             },
             clearForm() {
                 // clear
-                this.form.shopId = '0';
+                this.form.shopId = this.shops[0].value;
                 this.form.name = '';
                 this.form.userCode = '';
                 this.form.password = '';
@@ -421,7 +498,8 @@
                     return false
                 }
                 let row = that.multipleSelection[0];
-                this.form.shopid = row.ShopId;
+                this.form.shopidshopid = row.ShopId;
+                this.form.userId = row.Id;
                 this.form.name = row.Name;
                 this.form.userCode = row.Usercode;
                 this.form.password = '';

+ 6 - 3
pc/src/views/EditLessonManage.vue

@@ -315,8 +315,9 @@
                 }
                 let param = {
                     token: localStorage.token,
-                    planId: this.$route.query.id,
-                    planName: this.panel.name
+                    incomingDate: nonTfmtDatetoLength(this.panel.week, 10),
+                    stbId: this.$route.query.id,
+                    name: this.panel.name,
                 };
                 let postdata = qs.stringify(param);
                 STTBasicEdit(postdata).then(res => {
@@ -383,7 +384,7 @@
                 for (let i = 0; i < this.tabs.length; i++) {
                     for (let j = 0; j < this.tabs[i].tableData.length; j++) {
                         thisRow = this.tabs[i].tableData[j];
-                        thisRow.LessonIndex = parseInt(j+1);
+                        thisRow.LessonIndex = parseInt(j + 1);
                         if (planId) {
                             thisRow.StbId = parseInt(planId);
                         } else {
@@ -554,7 +555,9 @@
         display: block;
         margin: 0 auto;
         background-color: #fff !important;
+        min-height: 100%;
         padding: 30px;
+        padding-bottom: 60px;
     }
 
     .panel-body {

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

@@ -187,7 +187,7 @@
                     BeginStr: '08:30',
                     EndStr: '09:30',
                     ClassId: 1,
-                    TopLimit: 0,
+                    TopLimit: 1,
                     ConsumeHour: 0,
                 },
                 tabs: [

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

@@ -150,6 +150,6 @@
         font-size: 12px;
         color: #BDBDBD;
         background: #F0F2F5;
-        z-index: 2222;
+        z-index: 222;
     }
 </style>

+ 61 - 31
pc/src/views/Log.vue

@@ -7,7 +7,7 @@
                     <el-row :gutter="20">
                         <el-col :span="5">
                             <el-date-picker
-                                    v-model="times"
+                                    v-model="panel.timeScope"
                                     type="daterange"
                                     range-separator="至"
                                     start-placeholder="开始日期"
@@ -15,8 +15,8 @@
                             </el-date-picker>
                         </el-col>
                         <el-col :span="4">
-                            <em>管理员:</em>
-                            <el-select v-model="panel.shopList">
+                            <em>操作者:</em>
+                            <el-select v-model="panel.userId">
                                 <el-option
                                         v-for="item in panel.options"
                                         :key="item.value"
@@ -25,6 +25,10 @@
                                 </el-option>
                             </el-select>
                         </el-col>
+                        <el-col :span="4">
+                            <em>手机号:</em>
+                            <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>
                         </el-col>
@@ -49,31 +53,44 @@
                         width="50">
                 </el-table-column>
                 <el-table-column
-                        prop="userCode"
+                        prop="CreatedAt"
                         label="日期"
+                        :formatter="filterFmtDate"
                         sortable
                 >
                 </el-table-column>
                 <el-table-column
-                        prop="name"
-                        label="姓名"
+                        prop="OptName"
+                        label="操作者"
                         sortable
                 >
                 </el-table-column>
                 <el-table-column
-                        prop="tel"
+                        prop="OptPhone"
                         label="手机号"
                 >
                 </el-table-column>
                 <el-table-column
-                        prop="shop"
-                        label="所属门店"
+                        prop="Parameter"
+                        label="执行语句"
                         sortable
                 >
+                    <template slot-scope="scope">
+                        <el-popover
+                                placement="top"
+                                title="具体语句"
+                                width="200"
+                                trigger="hover"
+                                :content="scope.row.Parameter">
+                            <span slot="reference"
+                                  v-if="scope.row.Parameter.length > 20">{{scope.row.Parameter.substr(0,20)}} ....</span>
+                        </el-popover>
+                        <span v-if="scope.row.Parameter.length <= 20">{{scope.row.Parameter}}</span>
+                    </template>
                 </el-table-column>
                 <el-table-column
-                        prop="name"
-                        label="操作内容"
+                        prop="Result"
+                        label="操作结果"
                         sortable
                 >
                 </el-table-column>
@@ -119,8 +136,9 @@
 <script>
     import Global from '../Global.js'
     import {
+        OptLogListQuery,
         testTable,
-        testSelect
+        testSelect, ShopManagerListQuery
     } from "../api/getApiRes";
 
     let qs = require('qs');
@@ -134,6 +152,7 @@
                 panel: {
                     userCode: '',
                     tel: '',
+                    userId: '',
                     shopList: 0,
                     options: [],
                     draw: 1,
@@ -148,6 +167,7 @@
                     multipleSelection: [],
                     detectedmac: '',
                     time1: globalBt(),
+                    timeScope: globalBt2(30),
                 },
                 multipleSelection: [],
                 pageination: {
@@ -219,21 +239,32 @@
                 let that = this;
                 let param = {
                     token: localStorage.token,
+                    start: 1,
+                    tableMax: 999,
                 };
                 let postdata = qs.stringify(param);
-                testSelect(postdata).then(res => {
+                ShopManagerListQuery(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
-                        that.shops = json.Rs;
-                        that.form.shopId = json.Rs[0].value;
-                        console.log(that.form.shopId);
-                        that.panel.options = json.Rs;
-                        that.panel.options.unshift({value: 0, label: "全部"});
+                        that.panel.options = this.turnResToOptionByUsers(json.Rs);
+                        that.panel.options.unshift({value: '', label: "全部"});
+                        console.log( that.panel.options);
                     } else {
                         that.$message.error(json.Memo);
                     }
                 })
             },
+            turnResToOptionByUsers(data) {
+                if (!data) return false
+                let ids = data.map(item => {
+                    return {
+                        label: item.Name + ' ' + item.Phone,
+                        key: parseInt(item.Id),
+                        value: parseInt(item.Id),
+                    }
+                })
+                return ids
+            },
             // 删除
             delList() {
                 let that = this;
@@ -302,9 +333,9 @@
                 this.dialogTitle = '新增管理员'
             },
             // 编辑管理员
-            editList(row){
+            editList(row) {
                 this.clearForm();
-                this.form.name =row.name;
+                this.form.name = row.name;
                 this.form.userCode = row.userCode;
                 this.form.shopId = row.Id;
                 this.dialogVisible = true
@@ -320,21 +351,23 @@
             },
             // 页面数据查询
             getTableQuery() {
+                console.log( this.panel.userId);
                 let that = this;
                 // this.getGetChildRegionSelect(0, 1);
                 that.loading = true;
                 // 查询检测设备。上级区域id,区域id必传。regionid传0,查询supregionid对应所有子区域的检测设备。 如果supregionid,regionid都传0,默认查询企业ID下所有检测设备
                 let param = {
                     token: localStorage.token,
-                    supregionid: 0,//
-                    regionid: this.panel.regionid,//
-                    comid: 1,//
-                    tagname: that.panel.tagname,//标签名
+                    name: this.panel.name,
+                    phone: this.panel.phone,
+                    userId: this.panel.userId,
+                    bt: nonTfmtDate(that.panel.timeScope[0], 10),
+                    et: nonTfmtDate(that.panel.timeScope[1], 10),
                     start: 1,//
                     tableMax: 9999,//
                 };
                 let postdata = qs.stringify(param);
-                testTable(postdata).then(res => {
+                OptLogListQuery(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         that.loading = false;
@@ -398,11 +431,6 @@
                 let that = this;
                 return nonTfmtDate(column, 11);
             },
-            // 过滤金额
-            filterMoney(value, row, column) {
-                let that = this;
-                return parseFloat(column).toFixed(2);
-            },
         },
     }
 </script>
@@ -474,10 +502,12 @@
         float: right;
         margin-left: 10px;
     }
+
     /deep/ .el-date-editor .el-range__icon {
         line-height: 22px;
     }
-     .panel /deep/ .el-date-editor .el-range-separator {
+
+    .panel /deep/ .el-date-editor .el-range-separator {
         line-height: 22px;
     }
 </style>

+ 79 - 6
pc/src/views/Main.vue

@@ -7,16 +7,16 @@
                         <img src="../assets/img/main/member.png" height="54" width="54"/>
                         <div class="liRight">
                             <h5>会员人数</h5>
-                            <span>2239</span>
+                            <span>{{AllCount}}</span>
                         </div>
                         <div class="btLine">
                             <em class="emlt">
                                 <i class="el-icon-caret-top"></i>
-                                今日新增 36
+                                今日新增 {{NowCount}}
                             </em>
                             <em class="emrt">
                                 <i class="el-icon-caret-top"></i>
-                                较昨日新增 +6
+                                较昨日新增 {{CountAdd}}
                             </em>
                         </div>
                     </li>
@@ -70,7 +70,8 @@
                             </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>
                 </ul>
@@ -136,6 +137,8 @@
         WaitingBeginClassList,
         ClassOngoingList,
         OrderStatistics,
+        VipUserStatistics,
+        ClassStatistics, ClassOverPrepare,
     } from "../api/getApiRes";
 
     let qs = require('qs');
@@ -149,6 +152,10 @@
                 appointList: [],
                 TodayClassOrder: [],
                 TodayVipOrder: [],
+                AllCount: 0,
+                YesterdayCount: 0,
+                NowCount: 0,
+                CountAdd: 0,
             }
         },
         mounted() {
@@ -157,6 +164,8 @@
             // 下课管理
             // this.getTodayClassOrderQuery();
             // this.getTodayVipOrderQuery();
+            this.getVipUserStatistics();
+            this.getClassStatistics();
             this.ClassQuery();
             this.appointQuery();
             // this.getOrderStatistics();
@@ -175,6 +184,44 @@
                     query: {}
                 })
             },
+            // 会员统计
+            getVipUserStatistics() {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                };
+                let postdata = qs.stringify(param);
+                VipUserStatistics(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.AllCount = json.Rs.AllCount;
+                        that.YesterdayCount = json.Rs.YesterdayCount;
+                        that.NowCount = json.Rs.NowCount;
+                        that.CountAdd = json.Rs.CountAdd;
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
+            // 课程统计
+            getClassStatistics() {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                };
+                let postdata = qs.stringify(param);
+                VipUserStatistics(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.AllCount = json.Rs.AllCount;
+                        that.YesterdayCount = json.Rs.YesterdayCount;
+                        that.NowCount = json.Rs.NowCount;
+                        that.CountAdd = json.Rs.CountAdd;
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
             getOrderStatistics() {
                 let that = this;
                 that.loading = true;
@@ -194,6 +241,32 @@
                     }
                 })
             },
+            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.StdId,
+                        classId: row.ClassId,
+                        ClassName:row.ClassName,
+                        BeginTime:row.BeginTime,
+                    }
+                });
+            },
             getWaitingBeginClassList() {
                 let that = this;
                 that.loading = true;
@@ -205,8 +278,7 @@
                     let json = res;
                     if (json.Code == 0) {
                         that.loading = false;
-                            console.log(json);
-                            that.classList = json.Rs;
+                        that.classList = json.Rs;
                     } else {
                         that.$message.error(json.Memo);
                     }
@@ -744,6 +816,7 @@
     .box-card em {
         font-style: normal;
     }
+
     i {
         font-style: normal;
     }

+ 48 - 30
pc/src/views/Member.vue

@@ -133,7 +133,8 @@
                         width="220px"
                 >
                     <template slot-scope="scope">
-                        <span class="lessonSpan" :style="{background:lesson.ClassColor}" v-for="lesson in scope.row.ClassInfo">{{lesson.ClassName}}</span>
+                        <span class="lessonSpan" :style="{background:lesson.ClassColor}"
+                              v-for="lesson in scope.row.ClassInfo">{{lesson.ClassName}}</span>
                     </template>
                 </el-table-column>
                 <el-table-column
@@ -162,7 +163,7 @@
                                    @click="pauseRow(scope.row)">
                             禁用
                         </el-button>
-                        <el-button type="success" v-if="scope.row.UserInfo.Status == 0" size="mini"
+                        <el-button type="success" v-if="scope.row.UserInfo.Status == 8" size="mini"
                                    @click="runRow(scope.row)">
                             启用
                         </el-button>
@@ -247,7 +248,6 @@
             <div v-if="dialogGift">
                 <el-input-number v-model="form.gifthour" :min="0" :max="9999" label="赠送课时调整"></el-input-number>
             </div>
-
             <div v-if="dialogExpTime">
                 <el-date-picker
                         v-model="form.expTime"
@@ -259,12 +259,14 @@
                 <el-transfer filterable v-model="form.dialogValue" :data="form.dialogdata"
                              :titles="['全部课程','已选课程']"></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>
@@ -281,6 +283,9 @@
         VipUserAdd,
         VipUserStatusEdit,
         VipUserEdit,
+        VipUserHourEdit,
+        VipUserExpEdit,
+        VipUserClassEdit,
         testTable,
         testSelect
     } from "../api/getApiRes";
@@ -336,6 +341,7 @@
                     userCode: '',
                     shopId: '',
                     Id: '',
+                    userId: '',
                     vipType: 1,
                     normalhour: 0,
                     gifthour: 0,
@@ -384,7 +390,7 @@
                     let param = {
                         token: localStorage.token,
                         userId: row.UserInfo.Id,
-                        status: 0,//状态 0:禁用 1:启用 9:删除
+                        status: 8,//状态 8:禁用 1:启用 9:删除
                     };
                     let postdata = qs.stringify(param);
                     VipUserStatusEdit(postdata).then(res => {
@@ -411,7 +417,7 @@
             // 启用
             runRow(row) {
                 let that = this;
-                this.$confirm('是否启用用户' +  row.UserInfo.Name + '?', '启用操作', {
+                this.$confirm('是否启用用户' + row.UserInfo.Name + '?', '启用操作', {
                     confirmButtonText: '确定',
                     cancelButtonText: '取消',
                     type: 'warning'
@@ -419,7 +425,7 @@
                     let param = {
                         token: localStorage.token,
                         userId: row.UserInfo.Id,
-                        status: 1,//状态 0:禁用 1:启用 9:删除
+                        status: 1,//状态 8:禁用 1:启用 9:删除
                     };
                     let postdata = qs.stringify(param);
                     VipUserStatusEdit(postdata).then(res => {
@@ -483,7 +489,9 @@
                     return false
                 }
                 this.form.expTime = row.expTime;
-                this.form.rowName = row.name;
+                this.form.rowName = row.UserInfo.Name;
+                this.form.userId = row.UserInfo.Id;
+                this.form.expTime = row.UserInfo.ExpTime
                 this.dialogVisible = true;
                 this.dialogExpTime = true;
             },
@@ -507,8 +515,9 @@
                     return false
                 }
                 let row = this.multipleSelection[0];
-                this.form.normalhour = row.Recovered;
-                this.form.rowName = row.name;
+                this.form.normalhour = row.UserInfo.RemainNormalhour;
+                this.form.rowName = row.UserInfo.Name;
+                this.form.userId = row.UserInfo.Id;
                 this.dialogVisible = true;
                 this.dialogLesson = true;
 
@@ -533,14 +542,16 @@
                     return false
                 }
                 let row = this.multipleSelection[0];
-                this.form.gifthour = row.Recovered;
-                this.form.rowName = row.name;
+                this.form.gifthour = row.UserInfo.RemainGifthour;
+                this.form.rowName = row.UserInfo.Name;
+                this.form.userId = row.UserInfo.Id;
                 this.dialogVisible = true;
                 this.dialogGift = true;
 
             },
             // 增删会员课程
             lessonStudenChange() {
+                let that = this;
                 this.allDialogClose();
                 if (!this.multipleSelection.length) {
                     this.$message({
@@ -559,8 +570,14 @@
                     return false
                 }
                 let row = this.multipleSelection[0];
-                this.form.gifthour = row.Recovered;
-                this.form.rowName = row.name;
+                this.form.rowName = row.UserInfo.Name;
+                this.form.userId = row.UserInfo.Id;
+                if (row.ClassInfo) {
+                    row.ClassInfo.map(function (item) {
+                        that.form.dialogValue.push(item.ClassId)
+                    })
+                }
+                console.log(that.form.classlist);
                 this.dialogVisible = true;
                 this.dialogLessonTable = true;
             },
@@ -679,14 +696,14 @@
             confirmLesson() {
                 let that = this;
                 // checkNum
-
                 let param = {
                     token: localStorage.token,
-                    userCode: that.form.userCode,
-                    lesson: that.form.lesson,
+                    userId: that.form.userId,
+                    chgHour: that.form.normalhour,
+                    chgType: 1,//课时类型 1:普通课时 2:赠送课时
                 };
                 let postdata = qs.stringify(param);
-                testSelect(postdata).then(res => {
+                VipUserHourEdit(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         // 关闭弹窗
@@ -706,15 +723,14 @@
             // 确认提交赠送
             confirmGift() {
                 let that = this;
-                // checkNum
-
                 let param = {
                     token: localStorage.token,
-                    userCode: that.form.userCode,
-                    gift: that.form.gifthour,
+                    userId: that.form.userId,
+                    chgHour: that.form.gifthour,
+                    chgType: 2,//课时类型 1:普通课时 2:赠送课时
                 };
                 let postdata = qs.stringify(param);
-                testSelect(postdata).then(res => {
+                VipUserHourEdit(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         // 关闭弹窗
@@ -738,11 +754,11 @@
 
                 let param = {
                     token: localStorage.token,
-                    userCode: that.form.userCode,
-                    expTime: that.form.expTime,
+                    userId: that.form.userId,
+                    expTime: nonTfmtDate(that.form.expTime, 16),
                 };
                 let postdata = qs.stringify(param);
-                testSelect(postdata).then(res => {
+                VipUserExpEdit(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         // 关闭弹窗
@@ -763,14 +779,15 @@
             confirmLessonTable() {
                 let that = this;
                 // checkNum
+                let classList = that.form.dialogValue ? that.form.dialogValue.toString() : '';
 
                 let param = {
                     token: localStorage.token,
-                    userCode: that.form.userCode,
-                    dialogValue: that.form.dialogValue,
+                    userId: that.form.userId,
+                    classList: classList,
                 };
                 let postdata = qs.stringify(param);
-                testSelect(postdata).then(res => {
+                VipUserClassEdit(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         // 关闭弹窗
@@ -1078,6 +1095,7 @@
         display: block;
         margin: 0 auto;
     }
+
     .lessonSpan {
         width: 78px;
         height: 22px;

+ 97 - 15
pc/src/views/appoint.vue

@@ -228,22 +228,31 @@
             <div class="dialogContent">
                 <div class="">
                     <el-form ref="form" :model="form" label-width="160px">
-                        <el-form-item label="手机号">
-                            <el-input v-model="form.userCode"></el-input>
+                        <el-form-item label="课程">
+                            <el-select v-model="form.stdId" filterable placeholder="请选择" >
+                                <el-option
+                                        v-for="item in form.stdList"
+                                        :key="item.value"
+                                        :label="item.label"
+                                        :value="item.value">
+                                </el-option>
+                            </el-select>
                         </el-form-item>
-                        <el-form-item label="姓名">
-                            <el-input v-model="form.name"></el-input>
+                        <el-form-item label="会员">
+                            <el-select v-model="form.userId" filterable placeholder="请选择" >
+                                <el-option
+                                        v-for="item in form.userList"
+                                        :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>
                 </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" @click="ConfirmOrderAddByManager">确定</el-button>
                 <el-button size="small" @click="dialogMemberVisible = false">取消</el-button>
             </div>
         </el-dialog>
@@ -254,16 +263,19 @@
     import Global from '../Global.js'
     import {
         TodayClassOrderQuery,
+        VipUserListQuery,
         TodayVipOrderQuery,
+        OrderAddByManager,
         testTable,
-        testSelect
+        testSelect, WaitingBeginClassList
     } from "../api/getApiRes";
 
     let qs = require('qs');
     export default {
         data() {
             return {
-                activeName: 'first',
+                // activeName: 'first',
+                activeName: 'second',
                 choiceDate: 0,
                 // activeName: 'second',
                 tableView: true,//其他dialog
@@ -273,7 +285,7 @@
                 dialogGift: false,//赠送课时调整
                 dialogExpTime: false,//有效期调整
                 dialogLessonTable: false,//教练课程
-                dialogTitle: '新增教练',
+                dialogTitle: '增加预约',
                 current: getNowDate(),
                 dialogValue: [],
                 weeks: [],
@@ -331,6 +343,8 @@
                     expTime: '',
                     dialogdata: [],//穿梭待选
                     dialogValue: [],//穿梭已选
+                    userList: [],//穿梭已选
+                    stdList: [],//穿梭已选
                 },
                 memberTypes: [
                     {value: 1, label: '年教练'},
@@ -341,12 +355,71 @@
             }
         },
         mounted() {
-            // this.panelSelect();
+            this.vipSelect();
+            this.ClassSelect();
             // this.getTableQuery();
             // this.getTableQuery2();
             this.getCurrWeekDays();
         },
         methods: {
+            vipSelect(){
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    start: 1,//
+                    tableMax: 9999,//
+                };
+                let postdata = qs.stringify(param);
+                VipUserListQuery(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.form.userList = turnResToOption(json.Rs);
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
+            ClassSelect(){
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                    start: 1,//
+                    tableMax: 9999,//
+                };
+                let postdata = qs.stringify(param);
+                WaitingBeginClassList(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.form.stdList = turnStdToOption(json.Rs);
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+
+            },
+            ConfirmOrderAddByManager(){
+                let that = this;
+                let param = {
+                token: localStorage.token,
+                    stdId : this.form.stdId ,
+                    userId  : this.form.userId  ,
+                };
+                let postdata = qs.stringify(param);
+                OrderAddByManager(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.$message({
+                            showClose: true,
+                            message: '预约添加成功!',
+                            type: 'success'
+                        });
+                        this.getTableQuery();
+                        that.dialogMemberVisible = false;
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
             // 选择日期
             choiceTime(i) {
                 console.log(123);
@@ -1165,7 +1238,7 @@
         overflow: hidden;
         float: right;
         position: relative;
-        z-index: 9999;
+        z-index: 100;
         cursor: pointer;
     }
 
@@ -1221,4 +1294,13 @@
     .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;
+    }
 </style>

+ 2 - 1
pc/src/views/coach.vue

@@ -683,12 +683,13 @@
             },
             // 查询按钮
             query() {
-                // this.getTableQuery();
+                this.getTableQuery();
                 this.$message.success('查询完毕');
             },
             clearForm() {
                 // clear
                 this.form.name = '';
+                this.form.phone = '';
                 this.form.userCode = '';
                 this.form.shopId = '';
             },

+ 2 - 2
pc/src/views/lessonManage.vue

@@ -70,8 +70,8 @@
                     <template slot-scope="scope">
                         <el-switch
                                 v-model="scope.row.Online"
-                                :active-value="0"
-                                :inactive-value="1"
+                                :active-value="1"
+                                :inactive-value="0"
                                 active-color="#409EFF"
                                 inactive-color="#D9D9D9"
                                 @change=changeWechat($event,scope.row)

+ 7 - 6
pc/src/views/record.vue

@@ -69,12 +69,12 @@
                         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
                 >
@@ -86,21 +86,22 @@
                 >
                 </el-table-column>
                 <el-table-column
-                        prop="Recovered"
+                        prop="ConsumeNormalhour"
                         label="消耗课时"
                         sortable
                 >
                 </el-table-column>
                 <el-table-column
-                        prop="name"
-                        label="课程时间"
+                        prop="ConsumeGifthour"
+                        label="消耗赠送"
                         sortable
                 >
                 </el-table-column>
                 <el-table-column
-                        prop="create"
+                        prop="ExpTime"
                         label="预约时间"
                         width="180"
+                        :formatter="filterFmtDate"
                         sortable
                 >
                 </el-table-column>