|
|
@@ -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>
|