|
@@ -192,7 +192,7 @@
|
|
|
></el-option>
|
|
></el-option>
|
|
|
</el-select>
|
|
</el-select>
|
|
|
</el-form-item>
|
|
</el-form-item>
|
|
|
- <el-form-item label="头像" :required="true">
|
|
|
|
|
|
|
+ <el-form-item label="头像">
|
|
|
<div class="upload">
|
|
<div class="upload">
|
|
|
<el-upload
|
|
<el-upload
|
|
|
class="avatar-uploader"
|
|
class="avatar-uploader"
|
|
@@ -236,6 +236,9 @@
|
|
|
import ImgCutter from 'vue-img-cutter'
|
|
import ImgCutter from 'vue-img-cutter'
|
|
|
import {
|
|
import {
|
|
|
TmpUserQuery,
|
|
TmpUserQuery,
|
|
|
|
|
+ TmpUserAdd,
|
|
|
|
|
+ TmpUserEdit,
|
|
|
|
|
+ TmpUserDel,
|
|
|
testTable,
|
|
testTable,
|
|
|
testSelect
|
|
testSelect
|
|
|
} from "../api/getApiRes";
|
|
} from "../api/getApiRes";
|
|
@@ -339,12 +342,46 @@
|
|
|
this.btnType = 0;
|
|
this.btnType = 0;
|
|
|
this.form.btnType = 0;
|
|
this.form.btnType = 0;
|
|
|
this.dialogTitle = '新增临时会员'
|
|
this.dialogTitle = '新增临时会员'
|
|
|
- },
|
|
|
|
|
- editMember() {
|
|
|
|
|
-
|
|
|
|
|
},
|
|
},
|
|
|
delList() {
|
|
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) {
|
|
clickChange(item) {
|
|
|
this.tableRadio = item
|
|
this.tableRadio = item
|
|
@@ -353,14 +390,6 @@
|
|
|
confirmMember() {
|
|
confirmMember() {
|
|
|
let that = this;
|
|
let that = this;
|
|
|
// checkNum
|
|
// checkNum
|
|
|
- if (!that.form.phone) {
|
|
|
|
|
- this.$message.error('错了哦,手机号不能为空');
|
|
|
|
|
- return false
|
|
|
|
|
- }
|
|
|
|
|
- if (!globalCheckPhone(that.form.phone)) {
|
|
|
|
|
- this.$message.error('错了哦,手机号格式不正确');
|
|
|
|
|
- return false
|
|
|
|
|
- }
|
|
|
|
|
if (!that.form.name) {
|
|
if (!that.form.name) {
|
|
|
this.$message.error('错了哦,会员名不能为空');
|
|
this.$message.error('错了哦,会员名不能为空');
|
|
|
return false
|
|
return false
|
|
@@ -393,31 +422,21 @@
|
|
|
return false
|
|
return false
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- // 课程添加使用字符串形式
|
|
|
|
|
- let curClasslist = '';
|
|
|
|
|
- if (that.form.classlist) {
|
|
|
|
|
- curClasslist = that.form.classlist.toString();
|
|
|
|
|
- }
|
|
|
|
|
|
|
|
|
|
let param = {
|
|
let param = {
|
|
|
token: localStorage.token,
|
|
token: localStorage.token,
|
|
|
shopId: localStorage.shopId,
|
|
shopId: localStorage.shopId,
|
|
|
- phone: that.form.phone,
|
|
|
|
|
name: that.form.name,
|
|
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,
|
|
height: that.form.height,
|
|
|
weight: that.form.weight,
|
|
weight: that.form.weight,
|
|
|
staticHr: that.form.staticHr,
|
|
staticHr: that.form.staticHr,
|
|
|
- sex: that.form.sex,
|
|
|
|
|
head: that.form.head,
|
|
head: that.form.head,
|
|
|
- birthday: nonTfmtDatetoLength(that.form.birthday, 10),
|
|
|
|
|
|
|
+ memo: that.form.memo,
|
|
|
};
|
|
};
|
|
|
let postdata = qs.stringify(param);
|
|
let postdata = qs.stringify(param);
|
|
|
- VipUserAdd(postdata).then(res => {
|
|
|
|
|
|
|
+ TmpUserAdd(postdata).then(res => {
|
|
|
let json = res;
|
|
let json = res;
|
|
|
if (json.Code == 0) {
|
|
if (json.Code == 0) {
|
|
|
// 关闭弹窗
|
|
// 关闭弹窗
|
|
@@ -426,7 +445,7 @@
|
|
|
that.getTableQuery();
|
|
that.getTableQuery();
|
|
|
that.$message({
|
|
that.$message({
|
|
|
showClose: true,
|
|
showClose: true,
|
|
|
- message: '会员添加成功!',
|
|
|
|
|
|
|
+ message: '临时会员添加成功!',
|
|
|
type: 'success'
|
|
type: 'success'
|
|
|
});
|
|
});
|
|
|
} else {
|
|
} 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() {
|
|
confirmEditMember() {
|
|
|
let that = this;
|
|
let that = this;
|
|
|
// checkNum
|
|
// checkNum
|
|
|
- if (!that.form.phone) {
|
|
|
|
|
- this.$message.error('错了哦,手机号不能为空');
|
|
|
|
|
- return false
|
|
|
|
|
- }
|
|
|
|
|
- if (!globalCheckPhone(that.form.phone)) {
|
|
|
|
|
- this.$message.error('错了哦,手机号格式不正确');
|
|
|
|
|
- return false
|
|
|
|
|
- }
|
|
|
|
|
if (!that.form.name) {
|
|
if (!that.form.name) {
|
|
|
this.$message.error('错了哦,会员名不能为空');
|
|
this.$message.error('错了哦,会员名不能为空');
|
|
|
return false
|
|
return false
|
|
@@ -478,6 +509,7 @@
|
|
|
}
|
|
}
|
|
|
let param = {
|
|
let param = {
|
|
|
token: localStorage.token,
|
|
token: localStorage.token,
|
|
|
|
|
+ shopId : that.form.shopId ,
|
|
|
userId: that.form.Id,
|
|
userId: that.form.Id,
|
|
|
phone: that.form.phone,
|
|
phone: that.form.phone,
|
|
|
name: that.form.name,
|
|
name: that.form.name,
|
|
@@ -488,11 +520,10 @@
|
|
|
staticHr: that.form.staticHr,
|
|
staticHr: that.form.staticHr,
|
|
|
sex: that.form.sex,
|
|
sex: that.form.sex,
|
|
|
birthday: nonTfmtDatetoLength(that.form.birthday, 10),
|
|
birthday: nonTfmtDatetoLength(that.form.birthday, 10),
|
|
|
- ubId: that.form.ubId
|
|
|
|
|
|
|
+ tuId : that.form.tuId
|
|
|
};
|
|
};
|
|
|
let postdata = qs.stringify(param);
|
|
let postdata = qs.stringify(param);
|
|
|
- console.log(param);
|
|
|
|
|
- VipUserEdit(postdata).then(res => {
|
|
|
|
|
|
|
+ TmpUserEdit(postdata).then(res => {
|
|
|
let json = res;
|
|
let json = res;
|
|
|
if (json.Code == 0) {
|
|
if (json.Code == 0) {
|
|
|
// 关闭弹窗
|
|
// 关闭弹窗
|
|
@@ -718,12 +749,12 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
.dialogContent .pull-left {
|
|
.dialogContent .pull-left {
|
|
|
- width: 40%;
|
|
|
|
|
|
|
+ width: 100%;
|
|
|
float: left;
|
|
float: left;
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
- .dialogContent .pull-right {
|
|
|
|
|
- width: 60%;
|
|
|
|
|
- float: right;
|
|
|
|
|
|
|
+ .el-form-item {
|
|
|
|
|
+ width: 50%;
|
|
|
|
|
+ float: left;
|
|
|
}
|
|
}
|
|
|
</style>
|
|
</style>
|