Ver código fonte

1.临时会员管理-添加/删除√

Changpeng Duan 5 anos atrás
pai
commit
590518d8b3
2 arquivos alterados com 76 adições e 44 exclusões
  1. 73 42
      pc/src/views/tempUser.vue
  2. 3 2
      tv/需求修改和debug.md

+ 73 - 42
pc/src/views/tempUser.vue

@@ -192,7 +192,7 @@
                                 ></el-option>
                             </el-select>
                         </el-form-item>
-                        <el-form-item label="头像" :required="true">
+                        <el-form-item label="头像">
                             <div class="upload">
                                 <el-upload
                                         class="avatar-uploader"
@@ -236,6 +236,9 @@
     import ImgCutter from 'vue-img-cutter'
     import {
         TmpUserQuery,
+        TmpUserAdd,
+        TmpUserEdit,
+        TmpUserDel,
         testTable,
         testSelect
     } from "../api/getApiRes";
@@ -339,12 +342,46 @@
                 this.btnType = 0;
                 this.form.btnType = 0;
                 this.dialogTitle = '新增临时会员'
-            },
-            editMember() {
-
             },
             delList() {
+                let that = this;
+                if (this.tableRadio.length == 0) {
+                    that.$message.error("请先选中一条记录");
+                    return false
+                }
+                let detectorid = this.tableRadio.TuId;
+
+                let param = {
+                    token: localStorage.token,
+                    tuId : detectorid,
+                };
+                let postdata = qs.stringify(param);
 
+                this.$confirm('此操作将永久删除该临时会员, 是否继续?', '提示', {
+                    confirmButtonText: '确定',
+                    cancelButtonText: '取消',
+                    type: 'warning'
+                }).then(() => {
+                    TmpUserDel(postdata).then(res => {
+                        let json = res;
+                        if (json.Code == 0) {
+                            that.$message({
+                                showClose: true,
+                                message: '选中的临时会员已删除!',
+                                type: 'success'
+                            });
+                            // 重载列表
+                            that.getTableQuery();
+                        } else {
+                            that.$message.error(json.Memo + '错误码:' + json.Code);
+                        }
+                    });
+                }).catch(() => {
+                    this.$message({
+                        type: 'info',
+                        message: '已取消删除'
+                    });
+                });
             },
             clickChange(item) {
                 this.tableRadio = item
@@ -353,14 +390,6 @@
             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
@@ -393,31 +422,21 @@
                     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,
+                    sex: that.form.sex,
+                    birthday: nonTfmtDatetoLength(that.form.birthday, 10),
                     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),
+                    memo: that.form.memo,
                 };
                 let postdata = qs.stringify(param);
-                VipUserAdd(postdata).then(res => {
+                TmpUserAdd(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         // 关闭弹窗
@@ -426,7 +445,7 @@
                         that.getTableQuery();
                         that.$message({
                             showClose: true,
-                            message: '会员添加成功!',
+                            message: '临时会员添加成功!',
                             type: 'success'
                         });
                     } else {
@@ -434,17 +453,29 @@
                     }
                 })
             },
+            // 编辑
+            editMember(row) {
+                let that = this;
+                this.clearForm();
+                this.form.name = row.UserName;
+                this.form.memo = row.Memo;
+                this.imageUrl = row.Head;
+                this.form.height = row.Height;
+                this.form.weight = parseInt(row.Weight) / 10;
+                this.form.staticHr = row.StaticHr;
+                this.form.sex = row.Sex;
+                this.form.birthday = row.Birthday;
+                this.form.tuId  = row.TuId;
+                this.form.btnType = 1;
+                this.form.shopId = localStorage.shopId;
+                this.form.Id = row.Id;
+                this.dialogMemberVisible = true;
+                this.dialogTitle = '编辑会员'
+
+            },
             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
@@ -478,6 +509,7 @@
                 }
                 let param = {
                     token: localStorage.token,
+                    shopId : that.form.shopId ,
                     userId: that.form.Id,
                     phone: that.form.phone,
                     name: that.form.name,
@@ -488,11 +520,10 @@
                     staticHr: that.form.staticHr,
                     sex: that.form.sex,
                     birthday: nonTfmtDatetoLength(that.form.birthday, 10),
-                    ubId: that.form.ubId
+                    tuId : that.form.tuId
                 };
                 let postdata = qs.stringify(param);
-                console.log(param);
-                VipUserEdit(postdata).then(res => {
+                TmpUserEdit(postdata).then(res => {
                     let json = res;
                     if (json.Code == 0) {
                         // 关闭弹窗
@@ -718,12 +749,12 @@
     }
 
     .dialogContent .pull-left {
-        width: 40%;
+        width: 100%;
         float: left;
     }
 
-    .dialogContent .pull-right {
-        width: 60%;
-        float: right;
+    .el-form-item {
+        width: 50%;
+        float: left;
     }
 </style>

+ 3 - 2
tv/需求修改和debug.md

@@ -115,8 +115,9 @@ let url = '';
 6.TV PK的间距调整回以前那种√ 
   8. app 预约界面的上边距问题√ 
    9.心率带电量显示√ 
-  
- 1.临时会员管理-添加/删除
+ 1.临时会员管理-添加/删除√  
+ 
+ 
  2.课程管理 单独添加,绑定,删除访客
  *downloadwgt下的还是旧的包是为什么?
  7.上课学生分组,改由后台进行第一次分组,每次改队上传后台处理