Changpeng Duan 5 år sedan
förälder
incheckning
6998d3c3f4
5 ändrade filer med 72 tillägg och 169 borttagningar
  1. 0 6
      .idea/inspectionProfiles/Project_Default.xml
  2. 14 1
      pc/src/Global.js
  3. 6 0
      pc/src/api/getApiRes.js
  4. 37 147
      pc/src/views/AcrossVip.vue
  5. 15 15
      tv/src/Global.js

+ 0 - 6
.idea/inspectionProfiles/Project_Default.xml

@@ -1,6 +0,0 @@
-<component name="InspectionProjectProfileManager">
-  <profile version="1.0">
-    <option name="myName" value="Project Default" />
-    <inspection_tool class="Eslint" enabled="true" level="WARNING" enabled_by_default="true" />
-  </profile>
-</component>

+ 14 - 1
pc/src/Global.js

@@ -351,7 +351,20 @@ turnStdToOption = function (data) {
         }
     })
     return ids
-}
+};
+
+
+turnResToOptionByGroup = function (data) {
+    if (!data) return false;
+    let ids = data.map(item => {
+        return {
+            label: item.GroupName,
+            key: parseInt(item.GroupId),
+            value: parseInt(item.GroupId),
+        }
+    });
+    return ids
+};
 
 numberToWeekdays = function (val) {
     switch (parseInt(val)) {

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

@@ -776,3 +776,9 @@ export function VipUserSimpleQueryByAdmin(postdata) {
     let url = headapi + 'v1/User/VipUserSimpleQueryByAdmin ';
     return getApiBasic(url, postdata);
 }
+
+// 商家分组添加
+export function ShopGroupQuery(postdata) {
+    let url = headapi + 'v1/Shop/ShopGroupQuery ';
+    return getApiBasic(url, postdata);
+}

+ 37 - 147
pc/src/views/AcrossVip.vue

@@ -125,9 +125,9 @@
                             </el-select>
                         </el-form-item>
                         <el-form-item label="商家分组" v-if="form.btnType == 0">
-                            <el-select v-model="form.vipType" filterable  placeholder="请选择商家分组">
+                            <el-select v-model="form.groupId " filterable placeholder="请选择商家分组">
                                 <el-option
-                                        v-for="item in memberTypes"
+                                        v-for="item in form.groupList"
                                         :key="item.value"
                                         :label="item.label"
                                         :value="item.value"
@@ -139,8 +139,6 @@
             </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>
@@ -152,17 +150,15 @@
     import {
         AcrossVipUserQuery,
         VipUserSimpleQueryByAdmin,
-        ClassListQuery,
-        VipUserAdd,
+        ShopGroupQuery,
+        AcrossVipUserAdd,
+        AcrossVipUserDel,
         VipUserStatusEdit,
-        VipUserEdit,
         VipUserHourEdit,
         VipUserExpEdit,
         VipUserClassEdit,
         QueryTakeCustomerByName,
         BindTakeCustomer,
-        testTable,
-        testSelect
     } from "../api/getApiRes";
 
     let qs = require('qs');
@@ -245,6 +241,7 @@
                     memo: '',
                     expTime: '',
                     vipList: [],
+                    groupList: [],
                     classlist: [],
                     dialogdata: [],//穿梭待选
                     dialogValue: [],//穿梭已选
@@ -259,6 +256,7 @@
         mounted() {
             // 加载课程选项
             this.getClassVipuserQueryByAdmin();
+            this.getShopGroupQuery();
             // 读取列表
             this.getTableQuery();
         },
@@ -273,9 +271,22 @@
                 VipUserSimpleQueryByAdmin(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
-                        console.log(json.Rs);
                         that.form.vipList = turnResToOptionBySimViper(json.Rs);
-                        console.log(that.form.vipList);
+                    } else {
+                        that.$message.error(json.Memo);
+                    }
+                })
+            },
+            getShopGroupQuery() {
+                let that = this;
+                let param = {
+                    token: localStorage.token,
+                };
+                let postdata = qs.stringify(param);
+                ShopGroupQuery(postdata).then(res => {
+                    let json = res;
+                    if (json.Code == 0) {
+                        that.form.groupList = turnResToOptionByGroup(json.Rs);
                     } else {
                         that.$message.error(json.Memo);
                     }
@@ -563,146 +574,24 @@
             confirmMember() {
                 let that = this;
                 // checkNum
-                if (!that.form.phone) {
-                    this.$message.error('错了哦,手机号不能为空');
-                    return false
-                }
-                if (!globalCheckPhone(that.form.phone)) {
-                    this.$message.error('错了哦,手机号格式不正确');
-                    return false
-                }
-                if (!that.form.name) {
-                    this.$message.error('错了哦,会员名不能为空');
-                    return false
-                }
-                if (that.form.name.length > 8) {
-                    this.$message.error('错了哦,会员名字数超过8个字');
+                if (!that.form.userId) {
+                    this.$message.error('错了哦,会员不能为空');
                     return false
                 }
-                if (that.form.memo) {
-                    if (that.form.memo.length > 200) {
-                        this.$message.error('错了哦,备注字数超过200个字');
-                        return false
-                    }
-                }
 
-                if (!that.form.height) {
-                    this.$message.error('错了哦,身高不能为空');
-                    return false
-                }
-                if (!that.form.weight) {
-                    this.$message.error('错了哦,体重不能为空');
+                if (!that.form.groupId) {
+                    this.$message.error('错了哦,商家分组不能为空');
                     return false
                 }
-                // if (!that.form.staticHr) {
-                //     this.$message.error('错了哦,静态心率不能为空');
-                //     return false
-                // }
-                if (!that.form.birthday) {
-                    this.$message.error('错了哦,出生年份不能为空');
-                    return false
-                }
-
-                // 课程添加使用字符串形式
-                let curClasslist = '';
-                if (that.form.classlist) {
-                    curClasslist = that.form.classlist.toString();
-                }
 
                 let param = {
                     token: localStorage.token,
                     shopId: localStorage.shopId,
-                    phone: that.form.phone,
-                    name: that.form.name,
-                    vipType: that.form.vipType,
-                    normalhour: that.form.normalhour,
-                    gifthour: that.form.gifthour,
-                    classlist: curClasslist,
-                    memo: that.form.memo,
-                    height: that.form.height,
-                    weight: that.form.weight,
-                    // staticHr: that.form.staticHr,
-                    sex: that.form.sex,
-                    head: that.form.head,
-                    birthday: nonTfmtDatetoLength(that.form.birthday, 10),
-                };
-                let postdata = qs.stringify(param);
-                VipUserAdd(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() {
-                let that = this;
-                // checkNum
-                if (!that.form.phone) {
-                    this.$message.error('错了哦,手机号不能为空');
-                    return false
-                }
-                if (!globalCheckPhone(that.form.phone)) {
-                    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
-                    }
-                }
-
-                if (!that.form.height) {
-                    this.$message.error('错了哦,身高不能为空');
-                    return false
-                }
-                if (!that.form.weight) {
-                    this.$message.error('错了哦,体重不能为空');
-                    return false
-                }
-                // if (!that.form.staticHr) {
-                //     this.$message.error('错了哦,静态心率不能为空');
-                //     return false
-                // }
-                if (!that.form.birthday) {
-                    this.$message.error('错了哦,出生年份不能为空');
-                    return false
-                }
-                let param = {
-                    token: localStorage.token,
-                    userId: that.form.Id,
-                    phone: that.form.phone,
-                    name: that.form.name,
-                    memo: that.form.memo,
-                    head: that.form.head,
-                    height: that.form.height,
-                    weight: that.form.weight,
-                    // staticHr: that.form.staticHr,
-                    sex: that.form.sex,
-                    birthday: nonTfmtDatetoLength(that.form.birthday, 10),
-                    ubId: that.form.ubId
+                    userId: that.form.userId,
+                    groupId: that.form.groupId,
                 };
                 let postdata = qs.stringify(param);
-                console.log(param);
-                VipUserEdit(postdata).then(res => {
+                AcrossVipUserAdd(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         // 关闭弹窗
@@ -711,7 +600,7 @@
                         that.getTableQuery();
                         that.$message({
                             showClose: true,
-                            message: '会员信息编辑成功!',
+                            message: '跨店会员添加成功!',
                             type: 'success'
                         });
                     } else {
@@ -846,26 +735,26 @@
                     that.$message.error("请先选中一条记录");
                     return false
                 }
-                let detectorid = this.tableRadio.UserInfo.Id;
+                let row = this.tableRadio;
 
                 let param = {
                     token: localStorage.token,
-                    userId: detectorid,
-                    status: 9,//0禁用1启用9删除
+                    userId: row.UserId,
+                    auId: row.AuId,
                 };
                 let postdata = qs.stringify(param);
 
-                this.$confirm('此操作将永久删除该会员, 是否继续?', '提示', {
+                this.$confirm('此操作将永久删除该跨店会员, 是否继续?', '提示', {
                     confirmButtonText: '确定',
                     cancelButtonText: '取消',
                     type: 'warning'
                 }).then(() => {
-                    VipUserStatusEdit(postdata).then(res => {
+                    AcrossVipUserDel(postdata).then(res => {
                         let json = res;
                         if (json.Code == 0) {
                             that.$message({
                                 showClose: true,
-                                message: '选中的会员已删除!',
+                                message: '选中的跨店会员已删除!',
                                 type: 'success'
                             });
                             // 重载列表
@@ -1004,6 +893,7 @@
                 if (to.name == 'AcrossVip') {
                     // 加载课程选项
                     this.getClassVipuserQueryByAdmin();
+                    this.getShopGroupQuery();
                     // 读取列表
                     this.getTableQuery();
                 }

+ 15 - 15
tv/src/Global.js

@@ -312,20 +312,20 @@ turnResToOptionByCoach = function (data) {
     return ids
 };
 turnResToOptionByUsers = function (data) {
-    if (!data) return false
+    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
-}
+};
 
 turnClassResToOption = function (data) {
-    if (data == null) return false
-    if (!data) return false
+    if (data == null) return false;
+    if (!data) return false;
     let ids = data.map(item => {
         return {
             label: item.ClassSelf.ClassName,
@@ -333,9 +333,9 @@ turnClassResToOption = function (data) {
             value: parseInt(item.ClassSelf.ClassId),
             ClassColor: item.ClassSelf.ClassColor,
         }
-    })
+    });
     return ids
-}
+};
 
 turnShopResToOption = function (data) {
     if (!data) return false
@@ -345,12 +345,12 @@ turnShopResToOption = function (data) {
             key: parseInt(item.ShopID),
             value: parseInt(item.ShopID)
         }
-    })
+    });
     return ids
-}
+};
 
 turnStdToOption = function (data) {
-    if (!data) return false
+    if (!data) return false;
     let ids = data.map(item => {
         return {
             label: item.ClassName + '(' + item.BeginStr + '-' + item.EndStr + ')',
@@ -358,9 +358,9 @@ turnStdToOption = function (data) {
             value: parseInt(item.StdId),
             classId: parseInt(item.ClassId),
         }
-    })
+    });
     return ids
-}
+};
 
 numberToWeekdays = function (val) {
     switch (parseInt(val)) {
@@ -386,11 +386,11 @@ numberToWeekdays = function (val) {
             return '星期天';
             break;
     }
-}
+};
 
 // 随机背景
 RandomBg = function () {
     let bgClassNum = parseInt(Math.random() * 3)+1;
-    let bgClass = 'bgStyle' + bgClassNum + '  pages' ;
-    return bgClass;
+    return 'bgStyle' + bgClassNum + '  pages' ;
 };
+