5.1日 暂定 水电表管理
This commit is contained in:
@@ -3,7 +3,7 @@
|
||||
<div class="buildingheader flex align-center justify-between">
|
||||
<div>楼栋</div>
|
||||
<div>
|
||||
<span class="pointer" @click="handleAddBuilding">+增加楼栋</span>
|
||||
<span class="pointer" @click="handleAddBuilding" v-hasPermi="['house:add:building']">+增加楼栋</span>
|
||||
</div>
|
||||
</div>
|
||||
<ul>
|
||||
@@ -14,10 +14,10 @@
|
||||
}"
|
||||
:key="index"
|
||||
>
|
||||
<div class="buildingname" @click="switchBuilding(item.id ?? null)">{{ item.buildingName ?? '测试数据' }}</div>
|
||||
<div class="buildingname" @click="switchBuilding(item.id ?? null)">{{ item.buildingName ?? '' }}</div>
|
||||
<div class="buildactions flex align-center justify-around">
|
||||
<el-icon class="pointer hover-color-blue" @click="editBuilding(item.id)"><Setting /></el-icon>
|
||||
<el-icon class="pointer hover-color-red" @click="deleteBuilding(item.id)"><Delete /></el-icon>
|
||||
<el-icon class="pointer hover-color-blue" @click="editBuilding(item.id)" v-hasPermi="['house:edit:building']"><Setting /></el-icon>
|
||||
<el-icon class="pointer hover-color-red" @click="deleteBuilding(item.id)" v-hasPermi="['house:delete:building']"><Delete /></el-icon>
|
||||
</div>
|
||||
</li>
|
||||
</ul>
|
||||
@@ -39,7 +39,7 @@ const handleAddBuilding = () => {
|
||||
path: '/house/addbuilding'
|
||||
});
|
||||
};
|
||||
const editBuilding = (id: number) => {
|
||||
const editBuilding = (id: string) => {
|
||||
router.push({
|
||||
path: '/house/editbuilding',
|
||||
query: {
|
||||
@@ -47,7 +47,7 @@ const editBuilding = (id: number) => {
|
||||
}
|
||||
});
|
||||
};
|
||||
const deleteBuilding = (id: number) => {
|
||||
const deleteBuilding = (id: string) => {
|
||||
proxy?.$modal.confirm('该信息删除后无法恢复,确定要删除吗?').then(() => {
|
||||
deleteBuildingApi(id).then(() => {
|
||||
houseStore.deleteBuildingFun(id);
|
||||
|
||||
@@ -57,7 +57,6 @@ const handleCalp = (event: MouseEvent, houseid: string) => {
|
||||
border-radius: 4px;
|
||||
margin: 5px;
|
||||
padding-left: 10px;
|
||||
padding-top: 3px;
|
||||
}
|
||||
.house:hover {
|
||||
background: #e8f3ff;
|
||||
|
||||
@@ -11,7 +11,7 @@
|
||||
min-width="260"
|
||||
align="center"
|
||||
:label="`${unit.unitNo}单元`"
|
||||
v-for="(unit, index) in houseStore.currentHouseInfoList?.units ?? []"
|
||||
v-for="(unit, index) in houseStore.currentHouseInfoList?.units.length > 0 ? houseStore.currentHouseInfoList?.units : []"
|
||||
:key="index"
|
||||
>
|
||||
<template #default="{ row }">
|
||||
@@ -27,6 +27,7 @@
|
||||
import { deleteHouseApi } from '@/api/system/house';
|
||||
import houseItem from './houseItem.vue';
|
||||
import { useHouseStore } from '@/store/modules/house';
|
||||
import { checkPermi } from '@/utils/permission';
|
||||
|
||||
const houseStore = useHouseStore();
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
@@ -35,9 +36,12 @@ const router = useRouter();
|
||||
const menutlist = [
|
||||
{ label: '编辑', value: 'edit' },
|
||||
// { label: '收费标准', value: 'money' },
|
||||
{ label: '详情', value: 'main' },
|
||||
{ label: '删除', value: 'delete' }
|
||||
{ label: '详情', value: 'main' }
|
||||
];
|
||||
|
||||
if (checkPermi(['house:delete:house'])) {
|
||||
menutlist.push({ label: '删除', value: 'delete' });
|
||||
}
|
||||
function handleChangeCheckhouses(val: string[]) {
|
||||
houseStore.checkoutHousesFun([]);
|
||||
houseStore.checkoutHousesFun(val);
|
||||
@@ -53,7 +57,6 @@ function contextMenuFun(val: { type: string; value: string }) {
|
||||
});
|
||||
break;
|
||||
case 'money':
|
||||
console.log('你选择了:', val);
|
||||
break;
|
||||
case 'main':
|
||||
router.push({
|
||||
@@ -64,6 +67,10 @@ function contextMenuFun(val: { type: string; value: string }) {
|
||||
});
|
||||
break;
|
||||
case 'delete':
|
||||
if (!checkPermi(['house:delete:house'])) {
|
||||
break;
|
||||
}
|
||||
|
||||
proxy?.$modal.confirm('该信息删除后无法恢复,确定要删除吗?').then(() => {
|
||||
deleteHouseApi(val.value).then(() => {
|
||||
houseStore.switchBuilding(houseStore.currentBuildingInfo.id);
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
<span class="mr-30px">楼栋结构:{{ houseStore.currentBuildingInfo?.buildStructure }} </span>
|
||||
</div>
|
||||
<div class="rightActions">
|
||||
<span class="mr-20px" @click="handleAddHouse">+增加房屋</span>
|
||||
<span class="mr-20px" @click="handleAddHouse" v-hasPermi="['house:add:house']">+增加房屋</span>
|
||||
<!-- <span class="mr-20px">收费标准设置</span> -->
|
||||
<span @click="deleteAllhouse">删除</span>
|
||||
<span @click="deleteAllhouse" v-hasPermi="['house:delete:house']">删除</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="UnitBody">
|
||||
|
||||
Reference in New Issue
Block a user