7/13 水电表解绑房屋

This commit is contained in:
Zy
2026-07-13 08:06:08 +08:00
parent 298f93380c
commit 4efb535730
10 changed files with 128 additions and 73 deletions

View File

@@ -133,11 +133,15 @@
> -->
<el-button
link
v-if="!scope.row.houseName"
type="primary"
@click="handleOpenDialog('UpdateHouse', scope.row)"
v-has-permi="['equipment:edithouse:electricitydevice']"
>绑定房屋</el-button
>
<el-button v-else link type="primary" @click="handleUnbind(scope.row)" v-has-permi="['equipment:edithouse:electricitydevice']"
>解绑房屋</el-button
>
<!-- <el-dropdown style="vertical-align: text-top">
<el-button link type="primary">
<div>
@@ -248,6 +252,7 @@
<script setup name="WaterDevice" lang="ts">
import {
ElectricityDeviceMakerQrcode,
ElectricityDeviceUnbind,
getElectricityDeviceTimeRangeUsedWater,
listElectricityDevice,
updateElectricityDevice
@@ -259,6 +264,8 @@ import { checkPermi } from '@/utils/permission';
import { Upload } from '@element-plus/icons-vue';
import { CascaderValue, UploadProps, UploadRawFile } from 'element-plus';
import { exportImagesToZip } from '@/utils/exportZip';
import { WaterDeviceVO } from '@/api/system/SdbWaterDevice/type';
import { waterDeviceUnbind } from '@/api/system/SdbWaterDevice';
const uploadUrl = import.meta.env.VITE_APP_BASE_API + '/electricityDevice/upload';
@@ -490,6 +497,17 @@ const handleOpenDialog = (type: 'usedWater' | 'Upload' | 'UpdateHouse', row: Ele
}
};
// 解绑房屋
function handleUnbind(data: ElectricityDeviceVO) {
ElectricityDeviceUnbind(data.deviceCode)
.then(() => {
ElMessage.success('解绑成功');
})
.finally(() => {
getList();
});
}
function getTree() {
treedata.value = [];
houseStore.getCurrentVilageTreeHouse().then((res) => {