|
|
@@ -35,6 +35,7 @@
|
|
|
<div class="change">
|
|
|
<el-button @click="addMember" type="primary">新增心率设备</el-button>
|
|
|
<el-button @click="editList">编辑心率设备</el-button>
|
|
|
+ <el-button type="success" @click="getAllPower" :loading="BtnGetAllPower">全部设备电量</el-button>
|
|
|
<!--<el-button @click="delList" type="danger">删除心率设备</el-button>-->
|
|
|
</div>
|
|
|
<div class="table">
|
|
|
@@ -87,6 +88,19 @@
|
|
|
<!--<el-button @click="takeBack(scope.row)" type="danger" v-if="!scope.row.BindUserId">{{scope.row.UserName}} 设备收回</el-button>-->
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="PowerPercent"
|
|
|
+ label="电量"
|
|
|
+ align="center"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
+ <el-table-column
|
|
|
+ prop="PowerUpdateAt"
|
|
|
+ label="电量更新时间"
|
|
|
+ align="center"
|
|
|
+ :formatter="filterFmtDate"
|
|
|
+ >
|
|
|
+ </el-table-column>
|
|
|
<!--<el-table-column-->
|
|
|
<!--prop="Status"-->
|
|
|
<!--label="状态"-->
|
|
|
@@ -117,7 +131,8 @@
|
|
|
@click="pauseRowDel(scope.row)">
|
|
|
删除
|
|
|
</el-button>
|
|
|
- <el-button type="text" @click="goPage(scope.row)">记录</el-button>
|
|
|
+ <el-button type="primary" size="mini" @click="goPage(scope.row)">记录</el-button>
|
|
|
+ <el-button type="success" size="mini" @click="getPower(scope.row)">获取电量</el-button>
|
|
|
</template>
|
|
|
</el-table-column>
|
|
|
</el-table>
|
|
|
@@ -173,6 +188,7 @@
|
|
|
EditHrSensors,
|
|
|
UnBindHrSensorsToUser,
|
|
|
VipUserSimpleQuery,
|
|
|
+ GetHrSensorsPowerPercent
|
|
|
} from "../api/getApiRes";
|
|
|
|
|
|
let qs = require('qs');
|
|
|
@@ -181,6 +197,7 @@
|
|
|
return {
|
|
|
activeName: 'comm',
|
|
|
dialogVisible: false,//其他dialog
|
|
|
+ BtnGetAllPower: false,//
|
|
|
dialogMemberVisible: false,//新增心率设备dialog
|
|
|
dialogLesson: false,//课时调整
|
|
|
dialogGift: false,//赠送课时调整
|
|
|
@@ -380,6 +397,53 @@
|
|
|
}
|
|
|
})
|
|
|
},
|
|
|
+ // 获取电量
|
|
|
+ getPower(row) {
|
|
|
+ let that = this;
|
|
|
+ let param = {
|
|
|
+ token: localStorage.token,
|
|
|
+ shopId: row.ShopId,
|
|
|
+ hrId: row.HrId,
|
|
|
+ };
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+ GetHrSensorsPowerPercent(postdata).then(res => {
|
|
|
+ let json = res;
|
|
|
+ if (json.Code == 0) {
|
|
|
+ console.log(json);
|
|
|
+ that.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '电量获取成功!',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ that.$message.error(json.Memo);
|
|
|
+ }
|
|
|
+ })
|
|
|
+ },
|
|
|
+ getAllPower() {
|
|
|
+ let that = this;
|
|
|
+ that.BtnGetAllPower = true;
|
|
|
+ let param = {
|
|
|
+ token: localStorage.token,
|
|
|
+ shopId: localStorage.ShopId,
|
|
|
+ };
|
|
|
+ let postdata = qs.stringify(param);
|
|
|
+ GetHrSensorsPowerPercent(postdata).then(res => {
|
|
|
+ let json = res;
|
|
|
+ if (json.Code == 0) {
|
|
|
+ // table 重载
|
|
|
+ that.getTableQuery();
|
|
|
+ that.$message({
|
|
|
+ showClose: true,
|
|
|
+ message: '电量获取成功!',
|
|
|
+ type: 'success'
|
|
|
+ });
|
|
|
+ } else {
|
|
|
+ that.$message.error(json.Memo);
|
|
|
+ }
|
|
|
+ that.BtnGetAllPower = false;
|
|
|
+ })
|
|
|
+ },
|
|
|
// 编辑
|
|
|
editMember(row) {
|
|
|
this.clearForm();
|
|
|
@@ -770,6 +834,15 @@
|
|
|
sortChange(params) {
|
|
|
console.log(params)
|
|
|
},
|
|
|
+ // 过滤时间
|
|
|
+ filterFmtDate(value, row, column) {
|
|
|
+ let that = this;
|
|
|
+ if(column == 0){
|
|
|
+ return '未获得'
|
|
|
+ }else{
|
|
|
+ return nonTfmtDatetoLength(new Date(column*1000), 16);
|
|
|
+ }
|
|
|
+ },
|
|
|
}
|
|
|
,
|
|
|
watch: {
|