提交阶段性预览

This commit is contained in:
Zy
2026-04-20 16:38:04 +08:00
parent d0888c6afb
commit 9f9a88f303
39 changed files with 2987 additions and 194 deletions

View File

@@ -27,6 +27,7 @@
<script setup lang="ts">
import { deleteBuildingApi } from '@/api/system/house';
import { useHouseStore } from '@/store/modules/house';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const houseStore = useHouseStore();
const { switchBuilding } = houseStore; // 方法
@@ -47,11 +48,12 @@ const editBuilding = (id: number) => {
});
};
const deleteBuilding = (id: number) => {
deleteBuildingApi(id)
.then(() => {
proxy?.$modal.confirm('该信息删除后无法恢复,确定要删除吗?').then(() => {
deleteBuildingApi(id).then(() => {
houseStore.deleteBuildingFun(id);
})
.catch(() => {});
proxy?.$modal.msgSuccess('删除成功');
});
});
};
</script>

View File

@@ -39,10 +39,11 @@ const emit = defineEmits<{
flex-wrap: wrap;
max-height: 300px;
overflow: auto;
justify-content: space-evenly;
}
.house {
width: 110px;
width: 100px;
height: 40px;
line-height: 40px;
border: 1px solid #ddd;

View File

@@ -8,7 +8,7 @@
</template>
</el-table-column>
<el-table-column
min-width="160"
min-width="260"
align="center"
:label="`${unit.unitNo}单元`"
v-for="(unit, index) in houseStore.currentHouseInfoList?.units ?? []"
@@ -27,12 +27,14 @@
import { deleteHouseApi } from '@/api/system/house';
import houseItem from './houseItem.vue';
import { useHouseStore } from '@/store/modules/house';
const houseStore = useHouseStore();
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const router = useRouter();
const menutlist = [
{ label: '编辑', value: 'edit' },
{ label: '收费标准', value: 'money' },
// { label: '收费标准', value: 'money' },
{ label: '详情', value: 'main' },
{ label: '删除', value: 'delete' }
];
@@ -62,9 +64,11 @@ function contextMenuFun(val: { type: string; value: string }) {
});
break;
case 'delete':
deleteHouseApi(val.value).then(() => {
ElMessage.success('删除成功');
houseStore.switchBuilding(houseStore.currentBuildingInfo.id);
proxy?.$modal.confirm('该信息删除后无法恢复,确定要删除吗?').then(() => {
deleteHouseApi(val.value).then(() => {
houseStore.switchBuilding(houseStore.currentBuildingInfo.id);
proxy?.$modal.msgSuccess('删除成功');
});
});
break;
}

View File

@@ -25,6 +25,9 @@
import { deleteHouseApi } from '@/api/system/house';
import TableUnit from './components/table.vue';
import { useHouseStore } from '@/store/modules/house';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const houseStore = useHouseStore();
const router = useRouter();
function handleAddHouse() {
@@ -33,18 +36,13 @@ function handleAddHouse() {
});
}
function deleteAllhouse() {
async function deleteAllhouse() {
await proxy?.$modal.confirm('该信息删除后无法恢复,确定要删除吗?');
const checkhouse = houseStore.checkoutHouses;
if (checkhouse.length > 0) {
let deletecount = 0;
checkhouse.forEach((item) => {
deleteHouseApi(item).then(() => {
deletecount++;
if (deletecount === checkhouse.length - 1) {
ElMessage.success('批量删除成功');
houseStore.switchBuilding(houseStore.currentBuildingInfo.id);
}
});
deleteHouseApi(checkhouse).then(() => {
houseStore.switchBuilding(houseStore.currentBuildingInfo.id);
ElMessage.success('批量删除成功');
});
} else {
ElMessage.warning('请选择要删除的房屋');