重置实名认证、设备读数等
This commit is contained in:
parent
7d05499ae5
commit
3de827f579
|
@ -195,3 +195,11 @@ export function deviceSetWifi(data) {
|
|||
data
|
||||
})
|
||||
}
|
||||
|
||||
// 初始化总用电量
|
||||
export function deviceInitTotalEle(deviceId) {
|
||||
return request({
|
||||
url: `/system/device/${deviceId}/initTotalEle`,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -59,3 +59,11 @@ export function resetSmUserService(userId) {
|
|||
method: 'put'
|
||||
})
|
||||
}
|
||||
|
||||
// 重置用户实名认证
|
||||
export function resetSmUserRealName(userId) {
|
||||
return request({
|
||||
url: `/system/smUser/${userId}/resetRealName`,
|
||||
method: 'put'
|
||||
})
|
||||
}
|
||||
|
|
|
@ -98,7 +98,7 @@
|
|||
<dict-tag :options="dict.type.sm_device_online_status" :value="deviceData.onlineStatus" size="mini"/>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="最后在线时间">
|
||||
{{deviceData.lastOnlineStatus | defaultValue}}
|
||||
{{deviceData.lastOnlineTime | defaultValue}}
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="版本号">
|
||||
{{deviceData.version | defaultValue}}
|
||||
|
@ -110,17 +110,28 @@
|
|||
<el-descriptions-item label="开关状态">
|
||||
<el-tag :type="isOpen ? 'success' : 'danger'" size="mini">{{isOpen ? '已开启' : '已关闭'}}</el-tag>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="电压">{{deviceData.voltage | money | defaultValue }} V</el-descriptions-item>
|
||||
<el-descriptions-item label="电流">{{deviceData.electricity | money | defaultValue }} A</el-descriptions-item>
|
||||
<el-descriptions-item label="功率">{{deviceData.realTimePower | money | defaultValue }} W</el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="电压">{{deviceData.voltage | money | defaultValue }} V</el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="电流">{{deviceData.electricity | money | defaultValue }} A</el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="功率">{{deviceData.realTimePower | money | defaultValue }} W</el-descriptions-item>-->
|
||||
<el-descriptions-item label="总用电量">
|
||||
{{deviceData.totalElectriQuantity | money | defaultValue}} 度
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="剩余时长">{{surplusTimeDesc(surplusTime).text}}</el-descriptions-item>
|
||||
<el-descriptions-item label="剩余时长/电量" :span="2">
|
||||
{{surplusTimeDesc(deviceData.remainTime).text}} / {{deviceData.surplusEle | defaultValue}} 度
|
||||
<span class="remark-text">最近更新时间:{{deviceData.lastPullTime}}</span>
|
||||
<el-descriptions-item label="电量读数">
|
||||
{{deviceData.totalElectriQuantity - deviceData.initReading | money | defaultValue}} 度
|
||||
<el-link @click="handleInitReading" type="primary" icon="el-icon-refresh" style="margin-left: 0.5em">重置</el-link>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="最近重置读数时间">
|
||||
{{deviceData.lastInitReading | defaultValue}}
|
||||
</el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="剩余时长">-->
|
||||
<!-- 数据库:{{surplusTimeDesc(surplusTime).text}} / 设备:{{surplusTimeDesc(deviceData.remainTime).text}}-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="剩余电量">-->
|
||||
<!-- {{deviceData.surplusEle | defaultValue}} 度-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="最近更新时间">-->
|
||||
<!-- {{deviceData.lastPullTime | defaultValue }}-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
</el-descriptions>
|
||||
</el-card>
|
||||
</el-col>
|
||||
|
@ -136,6 +147,39 @@
|
|||
<template>{{bonus.point | money | defaultValue }} %</template>
|
||||
</line-field>
|
||||
</el-card>
|
||||
|
||||
<el-card class="box-card">
|
||||
<template #header>
|
||||
<el-row type="flex" style="justify-content: space-between;align-items: center">
|
||||
<div>实时信息</div>
|
||||
<div>{{deviceData.lastPullTime | defaultValue}}</div>
|
||||
</el-row>
|
||||
</template>
|
||||
<el-row>
|
||||
<el-col :span="8">
|
||||
<el-statistic style="margin-bottom: 8px" title="时长(数据库)">
|
||||
<template #formatter>{{surplusTimeDesc(surplusTime).text}}</template>
|
||||
</el-statistic>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-statistic style="margin-bottom: 8px" title="时长(设备)">
|
||||
<template #formatter>{{surplusTimeDesc(deviceData.remainTime).text}}</template>
|
||||
</el-statistic>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-statistic style="margin-bottom: 8px" title="电量" :value="deviceData.surplusEle" :precision="2" suffix="度"/>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-statistic style="margin-bottom: 8px" title="电压" :value="deviceData.voltage" :precision="2" suffix="V"/>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-statistic style="margin-bottom: 8px" title="电流" :value="deviceData.electricity" :precision="2" suffix="A"/>
|
||||
</el-col>
|
||||
<el-col :span="8">
|
||||
<el-statistic style="margin-bottom: 8px" title="功率" :value="deviceData.realTimePower" :precision="2" suffix="W"/>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</el-card>
|
||||
</el-col>
|
||||
</el-row>
|
||||
|
||||
|
@ -198,7 +242,7 @@
|
|||
|
||||
import {
|
||||
addEle,
|
||||
addTime,
|
||||
addTime, deviceInitTotalEle,
|
||||
getDevice,
|
||||
refreshIot,
|
||||
resetDevice,
|
||||
|
@ -323,6 +367,20 @@ export default {
|
|||
clearInterval(this.timer);
|
||||
},
|
||||
methods: {
|
||||
handleInitReading() {
|
||||
this.$confirm(`是否初始化电量读数?`, {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
deviceInitTotalEle(this.deviceData.deviceId).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message.success("操作成功");
|
||||
this.getDevice();
|
||||
}
|
||||
})
|
||||
})
|
||||
},
|
||||
onSetWifiSuccess(data) {
|
||||
this.deviceData.wifi = data.wifiName;
|
||||
},
|
||||
|
|
|
@ -48,20 +48,16 @@
|
|||
{{detail.withdrawServiceRate}} {{serviceUnit(detail.withdrawServiceType)}}
|
||||
</template>
|
||||
</el-descriptions-item>
|
||||
<!-- <el-descriptions-item label="限制提现">-->
|
||||
<!-- <boolean-tag :value="detail.limitWithdraw" size="small" true-type="danger" false-type="success"/>-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="限制提现原因" :span="2">-->
|
||||
<!-- {{detail.limitWithdrawReason | defaultValue}}-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="限制退款">-->
|
||||
<!-- <boolean-tag :value="detail.limitRefund" size="small" true-type="danger" false-type="success"/>-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
<!-- <el-descriptions-item label="限制退款原因" :span="2">-->
|
||||
<!-- {{detail.limitRefundReason | defaultValue}}-->
|
||||
<!-- </el-descriptions-item>-->
|
||||
<el-descriptions-item label="实名认证">
|
||||
<boolean-tag :value="detail.isReal" size="small"/>
|
||||
<el-link
|
||||
v-if="detail.isReal"
|
||||
style="margin-left: 4px;"
|
||||
type="primary"
|
||||
size="small"
|
||||
icon="el-icon-link"
|
||||
@click="handleResetRealName"
|
||||
>解除实名</el-link>
|
||||
</el-descriptions-item>
|
||||
<el-descriptions-item label="姓名">
|
||||
{{detail.realName | defaultValue}}
|
||||
|
@ -157,7 +153,7 @@
|
|||
|
||||
<script>
|
||||
import LineChart from "@/views/dashboard/LineChart.vue";
|
||||
import {getSmUser} from "@/api/system/smUser";
|
||||
import { getSmUser, resetSmUserRealName } from '@/api/system/smUser'
|
||||
import UserDevice from "@/views/system/smUser/components/userDevice.vue";
|
||||
import UserAccount from "@/views/system/smUser/components/userAccount.vue";
|
||||
import UserRechargeReport from "@/views/system/smUser/components/userRechargeReport.vue";
|
||||
|
@ -184,32 +180,45 @@ import BindRecord from '@/views/system/bindRecord/index.vue'
|
|||
export default {
|
||||
name: 'User/:userId',
|
||||
mixins: [$view, $serviceType],
|
||||
components: { BindRecord, RiskInfo, Bonus, UserDailyRechargeReport, Risk, ReceiveBill, UserConfigDialog, RealName, Withdraw, BooleanTag, Recharge, Device, Suit, Account, RecordBalance, Store, Access, UserRechargeReport, UserAccount, UserDevice, LineChart},
|
||||
dicts: ['sm_user_type', 'service_type', 'withdraw_service_type'],
|
||||
components: { BindRecord, RiskInfo, Bonus, UserDailyRechargeReport, Risk, ReceiveBill, UserConfigDialog, RealName, Withdraw, BooleanTag, Recharge, Device, Suit, Account, RecordBalance, Store, Access, UserRechargeReport, UserAccount, UserDevice, LineChart},
|
||||
data() {
|
||||
return {
|
||||
BonusArrivalType,
|
||||
SmUserType,
|
||||
detail: {},
|
||||
loading: false,
|
||||
showConfigDialog: false,
|
||||
}
|
||||
},
|
||||
computed: {
|
||||
BonusArrivalType() {
|
||||
return BonusArrivalType
|
||||
},
|
||||
SmUserType() {
|
||||
return SmUserType
|
||||
},
|
||||
serviceUnit() {
|
||||
return (type) => {
|
||||
return type === '2' ? '元' : '%';
|
||||
}
|
||||
}
|
||||
},
|
||||
data() {
|
||||
return {
|
||||
detail: {},
|
||||
loading: false,
|
||||
showConfigDialog: false,
|
||||
}
|
||||
},
|
||||
created() {
|
||||
this.getDetail();
|
||||
},
|
||||
methods: {
|
||||
handleResetRealName() {
|
||||
this.$confirm(`确认重置用户的实名认证信息?`, {
|
||||
confirmButtonText: '确定',
|
||||
cancelButtonText: '取消',
|
||||
type: 'warning'
|
||||
}).then(() => {
|
||||
this.loading = true;
|
||||
resetSmUserRealName(this.detail.userId).then(res => {
|
||||
if (res.code === 200) {
|
||||
this.$message.success("解除成功")
|
||||
this.getDetail();
|
||||
}
|
||||
}).catch((e) => {
|
||||
this.loading = false;
|
||||
})
|
||||
})
|
||||
},
|
||||
getDetail() {
|
||||
this.loading = true;
|
||||
getSmUser(this.$route.params.userId).then(response => {
|
||||
|
|
Loading…
Reference in New Issue
Block a user