|
|
@@ -22,14 +22,16 @@
|
|
|
<el-input v-model="panel.phone" placeholder="请输入手机号" type="number"></el-input>
|
|
|
</el-col>
|
|
|
<el-col :span="4">
|
|
|
- <el-button size="" type="primary" @click="query" plain :disabled="serachBtnStatus" :loading="serachBtnStatus">查询
|
|
|
+ <el-button size="" type="primary" @click="query" plain :disabled="serachBtnStatus"
|
|
|
+ :loading="serachBtnStatus">查询
|
|
|
</el-button>
|
|
|
</el-col>
|
|
|
</el-row>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="change">
|
|
|
- <el-button @click="confirmBegin" type="primary" :disabled="BeginState" :loading="BeginState" v-if="FinishClass == 3">确认上课
|
|
|
+ <el-button @click="confirmBegin" type="primary" :disabled="BeginState" :loading="BeginState"
|
|
|
+ v-if="FinishClass == 3">确认上课
|
|
|
</el-button>
|
|
|
<el-button @click="addFinish" type="primary" v-if="FinishClass == 2">确认下课</el-button>
|
|
|
<el-button @click="addFinishMember">添加上课会员</el-button>
|
|
|
@@ -122,6 +124,8 @@
|
|
|
sortable
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
+
|
|
|
+ <!--正式会员-->
|
|
|
<el-select v-model="scope.row.group_no"
|
|
|
filterable
|
|
|
:disabled="FinishClass == 2 && scope.row.DpId != 0"
|
|
|
@@ -141,24 +145,47 @@
|
|
|
sortable
|
|
|
>
|
|
|
<template slot-scope="scope">
|
|
|
- <el-select v-model="scope.row.BindId"
|
|
|
- @change="bindSensorToUser(scope.row)"
|
|
|
- @focus="getSelectHrSensors(scope.row)"
|
|
|
- filterable
|
|
|
- v-if="!scope.row.BindId" placeholder="请选心率带">
|
|
|
- <el-option
|
|
|
- v-for="item in panel.bindList"
|
|
|
- :key="item.index"
|
|
|
- :label="item.label"
|
|
|
- :value="item.HrId">
|
|
|
- </el-option>
|
|
|
- </el-select>
|
|
|
+ <div v-if="scope.row.IsTmpUser != 1">
|
|
|
+ <el-select v-model="scope.row.BindId"
|
|
|
+ @change="bindSensorToUser(scope.row)"
|
|
|
+ @focus="getSelectHrSensors(scope.row)"
|
|
|
+ filterable
|
|
|
+ v-if="!scope.row.BindId" placeholder="请选心率带">
|
|
|
+ <el-option
|
|
|
+ v-for="item in panel.bindList"
|
|
|
+ :key="item.index"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.HrId">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
|
|
|
- <el-button @click="takeBack(scope.row)" type="danger" v-if="scope.row.BindId"
|
|
|
- icon="el-icon-cpu">
|
|
|
- {{ scope.row.Sn }}
|
|
|
- 设备收回
|
|
|
- </el-button>
|
|
|
+ <el-button @click="takeBack(scope.row)" type="danger" v-if="scope.row.BindId"
|
|
|
+ icon="el-icon-cpu">
|
|
|
+ {{ scope.row.Sn }}
|
|
|
+ 设备收回
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <div v-if="scope.row.IsTmpUser == 1">
|
|
|
+ <!--临时会员-->
|
|
|
+ <el-select v-model="scope.row.BindId"
|
|
|
+ @change="bindSensorToTmepUser(scope.row)"
|
|
|
+ @focus="getSelectHrSensors(scope.row)"
|
|
|
+ filterable
|
|
|
+ v-if="!scope.row.Sn" placeholder="请选心率带">
|
|
|
+ <el-option
|
|
|
+ v-for="item in panel.bindList"
|
|
|
+ :key="item.index"
|
|
|
+ :label="item.label"
|
|
|
+ :value="item.HrId">
|
|
|
+ </el-option>
|
|
|
+ </el-select>
|
|
|
+
|
|
|
+ <el-button @click="takeTempBack(scope.row)" type="danger" v-if="scope.row.Sn"
|
|
|
+ icon="el-icon-cpu">
|
|
|
+ {{ scope.row.Sn }}
|
|
|
+ 临时设备收回
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
<el-table-column
|
|
|
@@ -201,6 +228,22 @@
|
|
|
</el-button>
|
|
|
</em>
|
|
|
</div>
|
|
|
+ <div v-if="FinishClass != 2 && scope.row.IsTmpUser == 1">
|
|
|
+ <el-button type="danger" round v-if="scope.row.Status == 3 "
|
|
|
+ size="mini"
|
|
|
+ @click="getClassOverTempDel(scope.row)">
|
|
|
+ 删除
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
+ <div v-if="FinishClass != 3 && scope.row.IsTmpUser == 1">
|
|
|
+ <el-button type="warning" round
|
|
|
+ v-if="scope.row.Status == 1 || scope.row.Status == 3 && FinishClass == 2 "
|
|
|
+ size="mini"
|
|
|
+ :disabled="scope.row.HrSubmitFlag == 1"
|
|
|
+ @click="getClassDetailAndSnAdd(scope.row)">
|
|
|
+ 提交
|
|
|
+ </el-button>
|
|
|
+ </div>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -221,7 +264,9 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="dialogFooter">
|
|
|
- <el-button type="primary" size="small" :disabled="BtnConfirmMember" :loading="BtnConfirmMember" @click="confirmMember">确定</el-button>
|
|
|
+ <el-button type="primary" size="small" :disabled="BtnConfirmMember" :loading="BtnConfirmMember"
|
|
|
+ @click="confirmMember">确定
|
|
|
+ </el-button>
|
|
|
<el-button size="small" @click="dialogVisible = false">取消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
@@ -229,12 +274,14 @@
|
|
|
<div class="dialogContent viplist">
|
|
|
<span class="blueTitle">{{ ClassName }} {{ BeginTime }}</span>
|
|
|
<div>
|
|
|
- <el-transfer filterable v-model="dialogValue" :data="form.dialogdata"
|
|
|
+ <el-transfer filterable v-model="dialogTempValue" :data="form.dialogTempdata"
|
|
|
:titles="['临时会员', '已添加会员']"></el-transfer>
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="dialogFooter">
|
|
|
-
|
|
|
+ <el-button type="primary" size="small" :disabled="BtnTempConfirmMember" :loading="BtnTempConfirmMember"
|
|
|
+ @click="TempconfirmMember">确定
|
|
|
+ </el-button>
|
|
|
<el-button size="small" @click="dialogTempVisible = false">取消</el-button>
|
|
|
</div>
|
|
|
</el-dialog>
|
|
|
@@ -254,7 +301,8 @@
|
|
|
</div>
|
|
|
</div>
|
|
|
<div class="dialogFooter">
|
|
|
- <el-button type="primary" size="small" :disabled="BtnConfirmClassFinish" :loading="BtnConfirmClassFinish" @click="confirmClassFinish">确定
|
|
|
+ <el-button type="primary" size="small" :disabled="BtnConfirmClassFinish"
|
|
|
+ :loading="BtnConfirmClassFinish" @click="confirmClassFinish">确定
|
|
|
</el-button>
|
|
|
<el-button size="small" @click="dialogFinishVisible = false">取消</el-button>
|
|
|
</div>
|
|
|
@@ -279,6 +327,10 @@
|
|
|
ClassStartConfirm,
|
|
|
ShopManagerListQuery,
|
|
|
ClassOverConfirm,
|
|
|
+ TmpUserQuery,
|
|
|
+ ClassOverTmpDetailAdd,
|
|
|
+ ClassTmpUserOverDetailDel,
|
|
|
+ BindHrSensorsToTempUser,
|
|
|
} from "../api/getApiRes";
|
|
|
|
|
|
let qs = require('qs');
|
|
|
@@ -288,6 +340,7 @@
|
|
|
serachBtnStatus: false,
|
|
|
BtnConfirmClassFinish: false,
|
|
|
BtnConfirmMember: false,
|
|
|
+ BtnTempConfirmMember: false,
|
|
|
BeginState: true,//确认上课
|
|
|
tableData: [],
|
|
|
title: '',
|
|
|
@@ -305,6 +358,7 @@
|
|
|
dialogTitle: '新增会员',
|
|
|
current: getNowDate(),
|
|
|
dialogValue: [],
|
|
|
+ dialogTempValue: [],
|
|
|
dialogCoachValue: [],
|
|
|
BeginTime: '',
|
|
|
ClassName: '',
|
|
|
@@ -372,6 +426,7 @@
|
|
|
memo: '',
|
|
|
expTime: '',
|
|
|
dialogdata: [],//穿梭待选
|
|
|
+ dialogTempdata: [],//穿梭待选
|
|
|
dialogValue: [],//穿梭已选
|
|
|
dialogCoachdata: [],//穿梭已选
|
|
|
},
|
|
|
@@ -437,6 +492,40 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 临时会员绑定心率带
|
|
|
+ bindSensorToTmepUser(row) {
|
|
|
+ let that = this;
|
|
|
+ let obj = {};
|
|
|
+ obj = this.panel.bindList.find((item) => {
|
|
|
+ return item.HrId === row.BindId;
|
|
|
+ });
|
|
|
+ // let oldSn = row.BindId == 0 ? row.Sn : '';
|
|
|
+ let param = {
|
|
|
+ token: localStorage.token,
|
|
|
+ sn: obj.Sn,
|
|
|
+ cfId: row.CfId,
|
|
|
+ userId: row.UserId,
|
|
|
+ shopId: localStorage.shopId,
|
|
|
+ hrId: row.BindId,
|
|
|
+ };
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+ BindHrSensorsToTempUser(postdata).then(res => {
|
|
|
+ let json = res;
|
|
|
+ if (json.Code == 0) {
|
|
|
+ that.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '临时会员心率带绑定成功!',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ // table 重载
|
|
|
+ that.getTableQuery();
|
|
|
+ // 重置心率带可选列表
|
|
|
+ // that.getSelectHrSensors();
|
|
|
+ } else {
|
|
|
+ that.$message.error(json.Memo + '错误码:' + json.Code);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 设备回收
|
|
|
takeBack(row) {
|
|
|
let that = this;
|
|
|
@@ -482,6 +571,9 @@
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+ takeTempBack(){
|
|
|
+ this.$message.error('临时会员无法替换心率带,请删除临时会员后重新添加');
|
|
|
+ },
|
|
|
// 确认下课
|
|
|
addFinish() {
|
|
|
this.clearForm();
|
|
|
@@ -552,7 +644,7 @@
|
|
|
let that = this;
|
|
|
// 没绑心率带不能开课,预约未到的不管他
|
|
|
for (var i = 0; i < this.tableData.length; i++) {
|
|
|
- if (this.tableData[i].BindId == 0 && this.tableData[i].Status != 2) {
|
|
|
+ if (this.tableData[i].Sn == 0 && this.tableData[i].Status != 2) {
|
|
|
that.$message.error("会员" + this.tableData[i].Name + '没绑心率带,不能开课');
|
|
|
return false
|
|
|
}
|
|
|
@@ -597,6 +689,7 @@
|
|
|
weight: row.Weight,
|
|
|
user_md5: row.UserMd5,
|
|
|
birthday: row.Birthday,
|
|
|
+ is_tmp_user: row.IsTmpUser,
|
|
|
}
|
|
|
}
|
|
|
// 确认上课
|
|
|
@@ -640,28 +733,53 @@
|
|
|
this.clearForm();
|
|
|
this.getClassVipuserQuery();
|
|
|
this.dialogValue = [];
|
|
|
+
|
|
|
+ // 遍历已添加的上课会员,回填穿梭框
|
|
|
let std = [];
|
|
|
if (this.tableData) {
|
|
|
this.tableData.map(function (item) {
|
|
|
- std.push(item.UserId)
|
|
|
+ if(item.IsTmpUser != 1){
|
|
|
+ std.push(item.UserId)
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
that.dialogValue = std;
|
|
|
this.dialogVisible = true
|
|
|
},
|
|
|
+ // 获取临时会员列表
|
|
|
+ getTmpUserQuery() {
|
|
|
+ let that = this;
|
|
|
+ let param = {
|
|
|
+ token: localStorage.token,
|
|
|
+ start: 1,
|
|
|
+ tableMax: 999,
|
|
|
+ };
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+ TmpUserQuery(postdata).then(res => {
|
|
|
+ let json = res;
|
|
|
+ if (json.Code == 0) {
|
|
|
+ that.form.dialogTempdata = turnResToOptionByTempUser(json.Rs);
|
|
|
+ } else {
|
|
|
+ that.$message.error(json.Memo);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
// 添加临时会员
|
|
|
addTempMember() {
|
|
|
let that = this;
|
|
|
this.clearForm();
|
|
|
- this.getClassVipuserQuery();
|
|
|
- this.dialogValue = [];
|
|
|
+ // this.getClassVipuserQuery();
|
|
|
+ this.getTmpUserQuery();
|
|
|
+ this.dialogTempValue = [];
|
|
|
let std = [];
|
|
|
if (this.tableData) {
|
|
|
this.tableData.map(function (item) {
|
|
|
- std.push(item.UserId)
|
|
|
+ if(item.IsTmpUser == 1){
|
|
|
+ std.push(item.UserId)
|
|
|
+ }
|
|
|
})
|
|
|
}
|
|
|
- that.dialogValue = std;
|
|
|
+ that.dialogTempValue = std;
|
|
|
this.dialogTempVisible = true
|
|
|
},
|
|
|
clearForm() {
|
|
|
@@ -685,17 +803,15 @@
|
|
|
if (json.Code == 0) {
|
|
|
// that.form.dialogdata = turnResToOptionByViper(json.Rs);
|
|
|
that.form.dialogdata = turnResToOptionBySimViper(json.Rs);
|
|
|
- console.log(that.form.dialogdata);
|
|
|
} else {
|
|
|
that.$message.error(json.Memo + '错误码:' + json.Code);
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
- // 确认提交下课会员
|
|
|
+ // 确认提交上课会员
|
|
|
confirmMember() {
|
|
|
let that = this;
|
|
|
- console.log(that.BtnConfirmMember);
|
|
|
- if( that.BtnConfirmMember == true) return false
|
|
|
+ if (that.BtnConfirmMember == true) return false;
|
|
|
that.BtnConfirmMember = true;
|
|
|
// checkNum
|
|
|
let userlist = that.dialogValue.toString();
|
|
|
@@ -724,6 +840,39 @@
|
|
|
that.BtnConfirmMember = false;
|
|
|
}
|
|
|
|
|
|
+ })
|
|
|
+ }, // 确认提交临时会员
|
|
|
+ TempconfirmMember() {
|
|
|
+ let that = this;
|
|
|
+ if (that.BtnTempConfirmMember == true) return false;
|
|
|
+ that.BtnTempConfirmMember = true;
|
|
|
+ // checkNum
|
|
|
+ let userlist = that.dialogTempValue.toString();
|
|
|
+ let param = {
|
|
|
+ token: localStorage.token,
|
|
|
+ stdId: this.$route.query.StdId,
|
|
|
+ tmpuserlist: userlist
|
|
|
+ };
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+ // 下课记录详情添加
|
|
|
+ ClassOverTmpDetailAdd(postdata).then(res => {
|
|
|
+ let json = res;
|
|
|
+ if (json.Code == 0) {
|
|
|
+ // 关闭弹窗
|
|
|
+ that.dialogTempVisible = false;
|
|
|
+ // 重载列表
|
|
|
+ that.getTableQuery();
|
|
|
+ that.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '会员添加成功!',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ that.BtnTempConfirmMember = false;
|
|
|
+ } else {
|
|
|
+ that.$message.error(json.Memo + '错误码:' + json.Code);
|
|
|
+ that.BtnTempConfirmMember = false;
|
|
|
+ }
|
|
|
+
|
|
|
})
|
|
|
},
|
|
|
pauseRow(row, status) {
|
|
|
@@ -750,6 +899,7 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+
|
|
|
// 下课记录详情删除
|
|
|
getClassOverDetailDel(row) {
|
|
|
let that = this;
|
|
|
@@ -784,6 +934,40 @@
|
|
|
});
|
|
|
});
|
|
|
},
|
|
|
+ // 下课记录临时会员删除
|
|
|
+ getClassOverTempDel(row) {
|
|
|
+ let that = this;
|
|
|
+ let param = {
|
|
|
+ token: localStorage.token,
|
|
|
+ stdId: row.StdId,
|
|
|
+ tcfId: row.CfId,
|
|
|
+ };
|
|
|
+ this.$confirm('是否删除临时会员 ' + row.Name + '?', '提示', {
|
|
|
+ confirmButtonText: '确定',
|
|
|
+ cancelButtonText: '取消',
|
|
|
+ type: 'warning'
|
|
|
+ }).then(() => {
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+ ClassTmpUserOverDetailDel(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: '已取消删除'
|
|
|
+ });
|
|
|
+ });
|
|
|
+ },
|
|
|
// 查询按钮
|
|
|
query() {
|
|
|
let that = this;
|
|
|
@@ -992,6 +1176,7 @@
|
|
|
weight: row.Weight,
|
|
|
user_md5: row.UserMd5,
|
|
|
birthday: row.Birthday,
|
|
|
+ is_tmp_user: row.IsTmpUser,
|
|
|
};
|
|
|
duRs = '{"Rs":' + JSON.stringify(duRs).toString() + '}';
|
|
|
let that = this;
|