Browse Source

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

Changpeng Duan 5 năm trước cách đây
mục cha
commit
fe36983ea3

+ 23 - 2
pc/src/Global.js

@@ -170,7 +170,7 @@ pageOptions = function () {
 endTypeOptions = function () {
     let option = [
         {
-            value: 0,
+            value: '',
             label: '全部'
         }, {
             value: 1,
@@ -197,7 +197,7 @@ vipOptions = function (i) {
     if (i == 0) {
         option = [
             {
-                value: 0,
+                value: '',
                 label: '全部'
             }, {
                 value: 1,
@@ -220,3 +220,24 @@ vipOptions = function (i) {
     }
     return option
 }
+
+turnResToOption = function (data) {
+    if (!data) return false
+    let ids = data.map(item => {
+        return {
+            label: item.UserInfo.Name + ' ' + item.UserInfo.Phone,
+            key: parseInt(item.UserInfo.Id)
+        }
+    })
+    return ids
+}
+turnClassResToOption = function (data) {
+    if (!data) return false
+    let ids = data.map(item => {
+        return {
+            label: item.ClassSelf.ClassName,
+            key: parseInt(item.ClassSelf.ClassId)
+        }
+    })
+    return ids
+}

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

@@ -18,7 +18,6 @@ export function worldDetail(postdata) {
 }
 
 
-
 export function editbasicinfo(postdata) {
     let url = headapi + 'editbasicinfo';
     return getApiBasic(url, postdata);
@@ -39,6 +38,7 @@ export function testTable(postdata) {
     let url = headapi + 'testTable';
     return getApiBasic(url, postdata);
 }
+
 export function testTableLong(postdata) {
     let url = headapi + 'testTableLong';
     return getApiBasic(url, postdata);
@@ -56,11 +56,13 @@ export function GenVerifyPic(postdata) {
     let url = headapi + '/v1/Auth/GenVerifyPic';
     return getApiBasic(url, postdata);
 }
+
 // 修改密码 √
 export function PassEdit(postdata) {
     let url = headapi + '/v1/Auth/PassEdit';
     return getApiBasic(url, postdata);
 }
+
 // 用户登录 √
 export function SignIn(postdata) {
     let url = headapi + '/v1/Auth/SignIn';
@@ -91,11 +93,13 @@ export function ClassAdd(postdata) {
     let url = headapi + '/v1/Class/ClassAdd';
     return getApiBasic(url, postdata);
 }
+
 // √ 课程颜色修改
 export function ClassColorEdit(postdata) {
     let url = headapi + '/v1/Class/ClassColorEdit';
     return getApiBasic(url, postdata);
 }
+
 // 课程单条查询
 export function ClassDetailOne(postdata) {
     let url = headapi + '/v1/Class/ClassDetailOne';
@@ -105,6 +109,7 @@ export function ClassEdit(postdata) {
     let url = headapi + '/v1/Class/ClassEdit';
     return getApiBasic(url, postdata);
 }
+
 // √ 课程列表查询
 export function ClassListQuery(postdata) {
     let url = headapi + '/v1/Class/ClassListQuery';
@@ -116,16 +121,19 @@ export function ClassStatusEdit(postdata) {
     let url = headapi + '/v1/Class/ClassStatusEdit';
     return getApiBasic(url, postdata);
 }
+
 // 课程会员增删
 export function ClassVipuserEdit(postdata) {
     let url = headapi + '/v1/Class/ClassVipuserEdit';
     return getApiBasic(url, postdata);
 }
+
 // 课程会员查询
 export function ClassVipuserQuery(postdata) {
     let url = headapi + '/v1/Class/ClassVipuserQuery';
     return getApiBasic(url, postdata);
 }
+
 // 课程微信可见状态修改
 export function ClassVisibleStatusEdit(postdata) {
     let url = headapi + '/v1/Class/ClassVisibleStatusEdit';
@@ -152,6 +160,7 @@ export function ShopEdit(postdata) {
     let url = headapi + '/v1/Shop/ShopEdit';
     return getApiBasic(url, postdata);
 }
+
 // 店铺列表查询
 export function ShopListQuery(postdata) {
     let url = headapi + '/v1/Shop/ShopListQuery';
@@ -170,6 +179,7 @@ export function SttPlanBasicAdd(postdata) {
     let url = headapi + '/v1/SttPlan/SttPlanBasicAdd';
     return getApiBasic(url, postdata);
 }
+
 // 课程表模板基本信息修改
 export function SttPlanBasicEdit(postdata) {
     let url = headapi + '/v1/SttPlan/SttPlanBasicEdit';
@@ -187,11 +197,13 @@ export function SttPlanBasicStatusEdit(postdata) {
     let url = headapi + '/v1/SttPlan/SttPlanBasicStatusEdit';
     return getApiBasic(url, postdata);
 }
+
 // 课程表模板详情列表查询
 export function SttPlanDetailListQuery(postdata) {
     let url = headapi + '/v1/SttPlan/SttPlanDetailListQuery';
     return getApiBasic(url, postdata);
 }
+
 // 课程表模板详情批量保存
 export function SttPlanDetailBatchSave(postdata) {
     let url = headapi + '/v1/SttPlan/SttPlanDetailBatchSave';
@@ -216,16 +228,31 @@ export function ShopManagerEdit(postdata) {
     let url = headapi + '/v1/User/ShopManagerEdit';
     return getApiBasic(url, postdata);
 }
+
 // 店铺管理员列表查询
 export function ShopManagerListQuery(postdata) {
     let url = headapi + '/v1/User/ShopManagerListQuery';
     return getApiBasic(url, postdata);
 }
+
 // 店铺管理员状态修改
 export function ShopManagerStatusEdit(postdata) {
     let url = headapi + '/v1/User/ShopManagerStatusEdit';
     return getApiBasic(url, postdata);
 }
+
+// 会员用户添加
+export function VipUserAdd(postdata) {
+    let url = headapi + '/v1/User/VipUserAdd ';
+    return getApiBasic(url, postdata);
+}
+
+// 会员用户基本信息修改
+export function VipUserEdit(postdata) {
+    let url = headapi + '/v1/User/VipUserEdit ';
+    return getApiBasic(url, postdata);
+}
+
 // 会员用户列表
 export function VipUserListQuery(postdata) {
     let url = headapi + '/v1/User/VipUserListQuery';
@@ -233,6 +260,19 @@ export function VipUserListQuery(postdata) {
 }
 
 
+// 会员用户基本信息查询
+export function VipUserSimpleQuery(postdata) {
+    let url = headapi + '/v1/User/VipUserSimpleQuery ';
+    return getApiBasic(url, postdata);
+}
+
+// 会员用户状态修改
+export function VipUserStatusEdit(postdata) {
+    let url = headapi + '/v1/User/VipUserStatusEdit ';
+    return getApiBasic(url, postdata);
+}
+
+
 
 
 

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

@@ -81,7 +81,9 @@
                 ManagerSelfQuery(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
+                        console.log(res);
                         that.user.name = json.Rs.Name;
+                        localStorage.shopId = json.Rs.ShopId;
                     } else {
                         that.$message.error(json.Memo);
                     }

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

@@ -104,7 +104,8 @@
                 <el-button type="primary" @click="addRow">新增课表</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="EditLessonTable" v-if="this.$route.query.id != 0">提交</el-button>
+                <el-button type="primary" @click="confirmEditLessonTable" v-if="this.$route.query.id != 0">提交
+                </el-button>
                 <em class="red wrning">
                     *所有操作提交后生效
                 </em>
@@ -153,6 +154,7 @@
                 tableData: [],
                 // panel 配置项目
                 panel: {
+                    name: '',
                     usercode: '',
                     username: '',
                     compname: '',
@@ -185,7 +187,7 @@
                     pageIndex: 1,
                 },
                 testRow: {
-                    timeLong:[new Date(2016, 9, 10, 8, 40), new Date(2016, 9, 10, 9, 40)],
+                    timeLong: [new Date(2016, 9, 10, 8, 40), new Date(2016, 9, 10, 9, 40)],
                     BeginStr: '08:30',
                     EndStr: '09:30',
                     ClassId: 1,
@@ -223,16 +225,48 @@
             if (this.$route.query.id == 0) {
                 //  深拷贝赋初始值
                 this.deepValue();
+                this.panel.name = '';
             } else {
                 // 读取赋值
                 this.getTableQuery();
             }
         },
         methods: {
+            confirmEditLessonTable() {
+                let that = this;
+                if (!this.panel.name) {
+                    this.$message.error('模板名称不能为空');
+                    return false
+                }
+                if (this.panel.name.length < 3) {
+                    this.$message.error('模板名称不能小于3个字符');
+                    return false
+                }
+                if (this.panel.name.length > 20) {
+                    this.$message.error('模板名称不能大于20个字符');
+                    return false
+                }
+                let param = {
+                    token: localStorage.token,
+                    planId: this.$route.query.id,
+                    planName: this.panel.name
+                };
+                let postdata = qs.stringify(param);
+                SttPlanBasicEdit(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        let id = that.$route.query.id
+                        // 提交课程内容
+                        that.EditLessonTable(id);
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
             // 删除
-            delRow(scope){
+            delRow(scope) {
                 let delIndex = parseInt(scope.$index)
-                let curIndex = parseInt(this.activeName) -1;
+                let curIndex = parseInt(this.activeName) - 1;
                 this.tabs[curIndex].tableData.splice(delIndex, 1)
             },
             // 提交课程模板
@@ -259,14 +293,15 @@
                     let json = res;
                     if (json.Code == 0) {
                         that.panel.tabId = json.Id;
-                        console.log(json.Id);
+                        // 提交课程内容
+                        that.EditLessonTable(json.Id);
                     } else {
                         that.$message.error(json.Memo);
                     }
                 })
             },
             // 修改课程模板
-            EditLessonTable() {
+            EditLessonTable(planId) {
                 let that = this;
                 // if (this.checkData()) {
                 //     this.$message.error('数据内容不完整,请检查后重新输入');
@@ -291,9 +326,12 @@
                     }
                 }
                 let res = JSON.stringify(planRs);
+                // 如果传入0就用url里的,如果非0就用传入的
+                // let uploadPlanId = planId == 0 ? this.$route.query.id : planId;
                 let param = {
                     token: localStorage.token,
-                    planId: this.$route.query.id,
+                    // planId: this.$route.query.id,
+                    planId: planId,
                     planRs: res,
                 };
                 let postdata = qs.stringify(param);
@@ -302,10 +340,13 @@
                     if (json.Code == 0) {
                         that.$message({
                             showClose: true,
-                            message: '课程模板上传成功!',
+                            message: '课程模板上传成功!',
                             type: 'success'
                         });
-                        this.getTableQuery();
+                        this.$router.push({
+                            path: '/lessonTable'
+                        });
+                        // this.getTableQuery();
                     } else {
                         that.$message.error(json.Memo);
                     }
@@ -331,7 +372,8 @@
             deepValue() {
                 let that = this;
                 let valus = [
-                    {BeginStr: '08:30', EndStr: '09:30', ClassId: 0, TopLimit: 0, ConsumeHour: 0},
+                    this.testRow
+                    // {BeginStr: '08:30', EndStr: '09:30', ClassId: 0, TopLimit: 0, ConsumeHour: 0},
                 ];
                 this.tabs.map(function (item) {
                     let res = that.deepClone(valus);
@@ -374,7 +416,7 @@
                     if (json.Code == 0) {
                         that.loading = false;
                         // 清掉上次的记录
-                        for (let i = 0; i <  that.tabs.length; i++) {
+                        for (let i = 0; i < that.tabs.length; i++) {
                             that.tabs[i].tableData = []
                         }
                         if (Rs) {
@@ -541,6 +583,7 @@
         float: left;
         margin-right: 10px;
     }
+
     .wrning {
         float: right;
         font-size: 12px;

+ 26 - 19
pc/src/views/Lesson.vue

@@ -130,7 +130,7 @@
                 >
                     <template slot-scope="scope">
                         <el-button type="text" @click="editLesson(scope.row.ClassSelf)">编辑</el-button>
-                        <el-button type="text" @click="Lessonmember(scope.row.ClassSelf)">课程会员</el-button>
+                        <el-button type="text" @click="Lessonmember(scope.row.Userlist)">课程会员</el-button>
                     </template>
                 </el-table-column>
 
@@ -215,7 +215,8 @@
                 <span>基础功能</span>
             </div>
             <div>
-                <el-transfer filterable v-model="dialogValue" :data="form.dialogdata"></el-transfer>
+                <el-transfer filterable v-model="dialogValue" :data="form.dialogdata"
+                             :titles="['会员列表', '已添加会员']"></el-transfer>
             </div>
             <div class="dialogFooter">
                 <el-button type="primary" size="small">确定</el-button>
@@ -225,14 +226,15 @@
 
         <el-dialog title="课程会员" :visible.sync="dialogTableVisible">
             <el-table :data="gridData">
-                <el-table-column property="name" label="姓名" width="200"></el-table-column>
-                <el-table-column property="userCode" label="手机"></el-table-column>
-                <el-table-column property="vipType" label="会员类型">
+                <el-table-column property="Name" label="姓名" width="200"></el-table-column>
+                <el-table-column property="Phone" label="手机"></el-table-column>
+                <el-table-column property="VipType" label="会员类型">
                     <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.VipType == 1">年费会员</span>
+                        <span v-if="scope.row.VipType == 2">充值会员</span>
                     </template>
                 </el-table-column>
+                <el-table-column property="ExpTime" label="有效期" :formatter="filterFmtDate"></el-table-column>
             </el-table>
         </el-dialog>
     </div>
@@ -248,6 +250,7 @@
         ClassStatusEdit,
         VipUserListQuery,
         ClassVisibleStatusEdit,
+        ClassVipuserQuery,
         testTable,
         testSelect
     } from "../api/getApiRes";
@@ -315,7 +318,7 @@
             }
         },
         mounted() {
-            // this.panelSelect();
+            this.panelSelect();
             this.getTableQuery();
         },
         methods: {
@@ -485,7 +488,7 @@
                 console.log(row);
                 let param = {
                     token: localStorage.token,
-                    classId : row.ClassSelf.ClassId,
+                    classId: row.ClassSelf.ClassId,
                     status: 9,//0禁用1启用9删除
                 };
                 let postdata = qs.stringify(param);
@@ -521,17 +524,17 @@
                 let that = this;
                 let param = {
                     token: localStorage.token,
-                    vipType : 0,
-                    phone : '',
-                    name : '',
-                    expDay : '365',
+                    vipType: '',
+                    start: 1,
+                    expDay: 0,
+                    tableMax: 9999,
                 };
                 let postdata = qs.stringify(param);
                 VipUserListQuery(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
-                        that.dialogdata = json.Rs;
-                        that.form.dialogdata = json.Rs;
+                        // that.dialogdata = json.Rs;
+                        that.form.dialogdata =  turnResToOption(json.Rs)
                     } else {
                         that.$message.error(json.Memo);
                     }
@@ -543,7 +546,7 @@
                 let that = this;
                 let param = {
                     token: localStorage.token,
-                    classId : row.ClassId,//
+                    classId: row.ClassId,//
                     wxVisible: e,//
                 };
                 let postdata = qs.stringify(param);
@@ -580,10 +583,11 @@
                     });
                     return false
                 }
-                console.log(123);
                 let row = this.multipleSelection[0];
                 this.dialogValue = row.dialogValue;
                 this.dialogVisible = true
+                // 读取左侧会员列表
+
             },
             handleSelectionChange(val) {
                 this.multipleSelection = val;
@@ -614,9 +618,9 @@
                 this.dialogLesson = true
                 this.dialogTitle = '编辑课程'
             },
-            Lessonmember(row) {
+            Lessonmember(Userlist) {
                 this.dialogTableVisible = true;
-                this.gridData = row.Userlist;
+                this.gridData = Userlist;
             },
             // 查询按钮
             query() {
@@ -813,4 +817,7 @@
         width: 70%;
         float: right;
     }
+    /deep/ .el-transfer-panel__item .el-checkbox__input {
+        left: 15px;
+    }
 </style>

+ 5 - 0
pc/src/views/LessonTable.vue

@@ -459,6 +459,11 @@
                 return parseFloat(column).toFixed(2);
             },
         },
+        watch: {
+            $route(){
+                this.getTableQuery()
+            },
+        },
     }
 </script>
 

+ 138 - 86
pc/src/views/Member.vue

@@ -72,64 +72,72 @@
                         width="50">
                 </el-table-column>
                 <el-table-column
-                        prop="name"
+                        prop="UserInfo.Name"
                         label="会员名"
                         width="90"
                 >
                 </el-table-column>
                 <el-table-column
-                        prop="tel"
+                        prop="UserInfo.Phone"
                         label="手机号"
                         sortable
                 >
                 </el-table-column>
                 <el-table-column
-                        prop="vipType"
-                        label="会员类型"
+                        prop="UserInfo.VipType"
+                        label="类型"
+                        width="80px"
                         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.UserInfo.VipType == 1">年费</span>
+                        <span v-if="scope.row.UserInfo.VipType == 2">充值</span>
                     </template>
                 </el-table-column>
                 <el-table-column
-                        prop="create"
+                        prop="UserInfo.ExpTime"
                         label="会员有效期"
                         width="180"
+                        :formatter="filterFmtDate"
                         sortable
                 >
                 </el-table-column>
                 <el-table-column
-                        prop="Recovered"
+                        prop="UserInfo.RemainNormalhour"
                         label="剩余课时"
                         sortable
                 >
                 </el-table-column>
                 <el-table-column
-                        prop="Recovered"
+                        prop="UserInfo.ConsumeNormalhour"
                         label="累计课时"
                         sortable
                 >
                 </el-table-column>
                 <el-table-column
-                        prop="Recovered"
-                        label="赠送课时"
+                        prop="UserInfo.RemainGifthour"
+                        label="赠送"
                         sortable
                 >
                 </el-table-column>
                 <el-table-column
-                        prop="Recovered"
-                        label="累计赠送课时"
+                        prop="UserInfo.ConsumeGifthour"
+                        label="累计赠送"
+                        width="110px"
                         sortable
                 >
                 </el-table-column>
                 <el-table-column
-                        prop="name"
-                        label="会员课程">
+                        prop="ClassInfo"
+                        label="会员课程"
+                        width="220px"
+                >
+                    <template slot-scope="scope">
+                        <span class="lessonSpan" :style="{background:lesson.ClassColor}" v-for="lesson in scope.row.ClassInfo">{{lesson.ClassName}}</span>
+                    </template>
                 </el-table-column>
                 <el-table-column
-                        prop="memo"
+                        prop="UserInfo.Memo"
                         label="备注">
                     <template slot-scope="scope">
                         <el-popover
@@ -137,23 +145,25 @@
                                 title=""
                                 width="200"
                                 trigger="hover"
-                                :content="scope.row.memo">
+                                :content="scope.row.UserInfo.Memo">
                             <span slot="reference"
-                                  v-if="scope.row.memo.length > 6">{{scope.row.memo.substr(0,6)}} ....</span>
+                                  v-if="scope.row.UserInfo.Memo.length > 6">{{scope.row.UserInfo.Memo.substr(0,6)}} ....</span>
                         </el-popover>
-                        <span v-if="scope.row.memo.length <= 6">{{scope.row.memo}}</span>
+                        <span v-if="scope.row.UserInfo.Memo.length <= 6">{{scope.row.UserInfo.Memo}}</span>
                     </template>
                 </el-table-column>
                 <el-table-column
-                        prop="Status"
+                        prop="UserInfo.Status"
                         label="操作"
                 >
                     <template slot-scope="scope">
                         <el-button type="text" @click="editMember(scope.row)">编辑</el-button>
-                        <el-button type="danger" v-if="scope.row.Status == 1" size="mini" @click="pauseRow(scope.row)">
+                        <el-button type="danger" v-if="scope.row.UserInfo.Status == 1" size="mini"
+                                   @click="pauseRow(scope.row)">
                             禁用
                         </el-button>
-                        <el-button type="success" v-if="scope.row.Status == 2" size="mini" @click="runRow(scope.row)">
+                        <el-button type="success" v-if="scope.row.UserInfo.Status == 0" size="mini"
+                                   @click="runRow(scope.row)">
                             启用
                         </el-button>
                     </template>
@@ -168,18 +178,20 @@
             ></el-pagination>
         </div>
 
+        <!--        新增和编辑-->
+        <!--        :width="[{'1200px':form.btnType == 0},{'600px':form.btnType == 1}]"-->
         <el-dialog :title="dialogTitle" :visible.sync="dialogMemberVisible" width="1200px">
             <div class="dialogContent">
-                <div class="pull-left">
+                <div :class="['pull-left',{'tabwild':form.btnType == 1},]">
                     <el-form ref="form" :model="form" label-width="160px">
                         <el-form-item label="手机号">
-                            <el-input v-model="form.userCode"></el-input>
+                            <el-input v-model="form.phone"></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-form-item label="会员类型" v-if="form.btnType == 0">
+                            <el-select v-model="form.vipType" placeholder="请选择所属门店">
                                 <el-option
                                         v-for="item in memberTypes"
                                         :key="item.value"
@@ -188,28 +200,32 @@
                                 ></el-option>
                             </el-select>
                         </el-form-item>
-                        <el-form-item label="课时">
-                            <el-input-number v-model="form.normalhour" :min="0" :max="99999" label="(天)"></el-input-number>
+                        <el-form-item label="课时" v-if="form.btnType == 0">
+                            <el-input-number v-model="form.normalhour " :min="0" :max="99999"
+                                             label="(天)"></el-input-number>
                         </el-form-item>
-                        <el-form-item label="赠送课时">
-                            <el-input-number v-model="form.gifthour" :min="0" :max="99999" label="(天)"></el-input-number>
+                        <el-form-item label="赠送课时" v-if="form.btnType == 0">
+                            <el-input-number v-model="form.gifthour " :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">
+                <div class="pull-right" v-if="form.btnType == 0">
                     <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-transfer filterable v-model="form.classlist" :data="form.dialogdata"
+                                         :titles="['全部课程','已选课程']"></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 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>
@@ -240,7 +256,8 @@
                 </el-date-picker>
             </div>
             <div v-if="dialogLessonTable">
-                <el-transfer  filterable v-model="form.dialogValue" :data="form.dialogdata"></el-transfer>
+                <el-transfer filterable v-model="form.dialogValue" :data="form.dialogdata"
+                             :titles="['全部课程','已选课程']"></el-transfer>
             </div>
 
             <div class="dialogFooter">
@@ -260,6 +277,10 @@
     import Global from '../Global.js'
     import {
         VipUserListQuery,
+        ClassListQuery,
+        VipUserAdd,
+        VipUserStatusEdit,
+        VipUserEdit,
         testTable,
         testSelect
     } from "../api/getApiRes";
@@ -296,10 +317,10 @@
                     fileList: [],
                     multipleSelection: [],
                     detectedmac: '',
-                    vipType: 0,
-                    expDay: 0,
-                    vipOptions:vipOptions(0),
-                    endTypeOptions:endTypeOptions(),
+                    vipType: '',
+                    expDay: '',
+                    vipOptions: vipOptions(0),
+                    endTypeOptions: endTypeOptions(),
                     time1: globalBt(),
                 },
                 multipleSelection: [],
@@ -310,24 +331,29 @@
                     pageIndex: 1,
                 },
                 form: {
+                    phone: '',
                     name: '',
                     userCode: '',
                     shopId: '',
-                    memberType: 1,
-                    normalhour: 1,
-                    gifthour: 1,
+                    Id: '',
+                    vipType: 1,
+                    normalhour: 0,
+                    gifthour: 0,
                     btnType: 0,//0新建,1编辑编辑
                     memo: '',
                     expTime: '',
+                    classlist: [],
                     dialogdata: [],//穿梭待选
                     dialogValue: [],//穿梭已选
                 },
-                memberTypes:vipOptions(1),
+                memberTypes: vipOptions(1),
                 tableData: []
             }
         },
         mounted() {
+            // 加载课程选项
             this.panelSelect();
+            // 读取列表
             this.getTableQuery();
         },
         methods: {
@@ -336,15 +362,13 @@
                 let that = this;
                 this.clearForm();
 
-                this.form.userCode = row.userCode;
-                this.form.name = row.name;
-                this.form.memberType = row.vipType;
-                this.form.normalhour = row.Recovered;
-                this.form.gifthour = row.Recovered;
-                this.form.memo = row.memo;
+                this.form.phone = row.UserInfo.Phone;
+                this.form.name = row.UserInfo.Name;
+                this.form.memo = row.UserInfo.Memo;
                 this.form.btnType = 1;
 
-                this.form.shopId = row.Id;
+                this.form.shopId = row.UserInfo.ShopId;
+                this.form.Id = row.UserInfo.Id;
                 this.dialogMemberVisible = true
                 this.dialogTitle = '编辑会员'
 
@@ -352,23 +376,23 @@
             // 禁用
             pauseRow(row) {
                 let that = this;
-                this.$confirm('是否禁用用户' + row.name + '?', '禁用操作', {
+                this.$confirm('是否禁用用户' + row.UserInfo.Name + '?', '禁用操作', {
                     confirmButtonText: '确定',
                     cancelButtonText: '取消',
                     type: 'warning'
                 }).then(() => {
                     let param = {
                         token: localStorage.token,
-                        Id: row.Id,
-                        status: 0,
+                        userId: row.UserInfo.Id,
+                        status: 0,//状态 0:禁用 1:启用 9:删除
                     };
                     let postdata = qs.stringify(param);
-                    testTable(postdata).then(res => {
+                    VipUserStatusEdit(postdata).then(res => {
                         let json = res;
                         if (json.Code == 0) {
                             that.$message({
                                 showClose: true,
-                                message: row.name + '禁用成功!',
+                                message: row.UserInfo.Name + '禁用成功!',
                                 type: 'success'
                             });
                             // table 重载
@@ -387,23 +411,23 @@
             // 启用
             runRow(row) {
                 let that = this;
-                this.$confirm('是否启用用户' + row.name + '?', '启用操作', {
+                this.$confirm('是否启用用户' +  row.UserInfo.Name + '?', '启用操作', {
                     confirmButtonText: '确定',
                     cancelButtonText: '取消',
                     type: 'warning'
                 }).then(() => {
                     let param = {
                         token: localStorage.token,
-                        Id: row.Id,
-                        status: 1,
+                        userId: row.UserInfo.Id,
+                        status: 1,//状态 0:禁用 1:启用 9:删除
                     };
                     let postdata = qs.stringify(param);
-                    testTable(postdata).then(res => {
+                    VipUserStatusEdit(postdata).then(res => {
                         let json = res;
                         if (json.Code == 0) {
                             that.$message({
                                 showClose: true,
-                                message: row.name + '启用成功!',
+                                message: row.UserInfo.Name + '启用成功!',
                                 type: 'success'
                             });
                             // table 重载
@@ -544,11 +568,11 @@
             confirmMember() {
                 let that = this;
                 // checkNum
-                if (!that.form.userCode) {
+                if (!that.form.phone) {
                     this.$message.error('错了哦,手机号不能为空');
                     return false
                 }
-                if (!globalCheckPhone(that.form.userCode)) {
+                if (!globalCheckPhone(that.form.phone)) {
                     this.$message.error('错了哦,手机号格式不正确');
                     return false
                 }
@@ -566,19 +590,25 @@
                         return false
                     }
                 }
+                // 课程添加使用字符串形式
+                let curClasslist = '';
+                if (that.form.classlist) {
+                    curClasslist = that.form.classlist.toString();
+                }
 
                 let param = {
                     token: localStorage.token,
-                    userCode: that.form.userCode,
+                    shopId: localStorage.shopId,
+                    phone: that.form.phone,
                     name: that.form.name,
-                    memberType: that.form.memberType,
+                    vipType: that.form.vipType,
                     normalhour: that.form.normalhour,
-                    gift: that.form.gifthour,
+                    gifthour: that.form.gifthour,
+                    classlist: curClasslist,
                     memo: that.form.memo,
-                    dialogValue: that.form.dialogValue,
                 };
                 let postdata = qs.stringify(param);
-                testSelect(postdata).then(res => {
+                VipUserAdd(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         // 关闭弹窗
@@ -596,15 +626,13 @@
                 })
             },
             confirmEditMember() {
-                console.log(123);
                 let that = this;
                 // checkNum
-                if (!that.form.userCode) {
+                if (!that.form.phone) {
                     this.$message.error('错了哦,手机号不能为空');
                     return false
                 }
-                console.log(that.form.userCode);
-                if (!globalCheckPhone(that.form.userCode)) {
+                if (!globalCheckPhone(that.form.phone)) {
                     this.$message.error('错了哦,手机号格式不正确');
                     return false
                 }
@@ -624,16 +652,13 @@
                 }
                 let param = {
                     token: localStorage.token,
-                    userCode: that.form.userCode,
+                    userId: that.form.Id,
+                    phone: that.form.phone,
                     name: that.form.name,
-                    memberType: that.form.memberType,
-                    lesson: that.form.lesson,
-                    gift: that.form.gifthour,
                     memo: that.form.memo,
-                    dialogValue: that.form.dialogValue,
                 };
                 let postdata = qs.stringify(param);
-                testSelect(postdata).then(res => {
+                VipUserEdit(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         // 关闭弹窗
@@ -767,12 +792,17 @@
                 let that = this;
                 let param = {
                     token: localStorage.token,
+                    vipType: '',
+                    start: 1,
+                    expDay: 0,
+                    tableMax: 9999,
                 };
                 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.dialogdata = json.Rs;
+                        that.form.dialogdata = turnClassResToOption(json.Rs)
                     } else {
                         that.$message.error(json.Memo);
                     }
@@ -783,6 +813,7 @@
                 this.clearForm();
                 this.dialogMemberVisible = true
                 this.btnType = 0;
+                this.form.btnType = 0;
                 this.dialogTitle = '新增会员'
             },
             // 删除
@@ -806,11 +837,11 @@
                     return false
                 }
 
-                let detectorid = that.multipleSelection[0].Id;
+                let detectorid = that.multipleSelection[0].UserInfo.Id;
 
                 let param = {
                     token: localStorage.token,
-                    detectorid: detectorid,
+                    userId: detectorid,
                     status: 9,//0禁用1启用9删除
                 };
                 let postdata = qs.stringify(param);
@@ -820,7 +851,7 @@
                     cancelButtonText: '取消',
                     type: 'warning'
                 }).then(() => {
-                    testSelect(postdata).then(res => {
+                    VipUserStatusEdit(postdata).then(res => {
                         let json = res;
                         if (json.Code == 0) {
                             that.$message({
@@ -847,7 +878,7 @@
             },
             // 查询按钮
             query() {
-                // this.getTableQuery();
+                this.getTableQuery();
                 this.$message.success('查询完毕');
             },
             clearForm() {
@@ -864,10 +895,12 @@
                 // 查询检测设备。上级区域id,区域id必传。regionid传0,查询supregionid对应所有子区域的检测设备。 如果supregionid,regionid都传0,默认查询企业ID下所有检测设备
                 let param = {
                     token: localStorage.token,
-                    vipType : that.panel.vipType ,//
-                    phone : that.panel.phone ,//
-                    name : that.panel.name ,//
-                    expDay : that.panel.expDay ,//
+                    vipType: that.panel.vipType,//
+                    phone: that.panel.phone,//
+                    name: that.panel.name,//
+                    expDay: that.panel.expDay,//
+                    start: 1,//
+                    tableMax: 9999,//
                 };
                 let postdata = qs.stringify(param);
                 VipUserListQuery(postdata).then(res => {
@@ -963,6 +996,7 @@
         margin: 0 auto;
         background-color: #fff !important;
         padding: 30px;
+        padding-bottom: 60px;
     }
 
     .panel-body {
@@ -1037,4 +1071,22 @@
         width: 70%;
         float: right;
     }
+
+    .tabwild {
+        width: 100% !important;
+        overflow: hidden;
+        display: block;
+        margin: 0 auto;
+    }
+    .lessonSpan {
+        width: 78px;
+        height: 22px;
+        border-radius: 11px;
+        margin-right: 5px;
+        float: left;
+        margin-bottom: 3px;
+        text-align: center;
+        color: #545454;
+        font-size: 12px;
+    }
 </style>