8/31 dev 权限,sse,账单,bug

This commit is contained in:
Zy
2026-08-31 08:09:28 +08:00
parent bfdfa05cd7
commit e4417f35b1
82 changed files with 2327 additions and 1644 deletions

View File

@@ -13,16 +13,16 @@
>楼栋结构:{{ houseStore.currentBuildingInfo?.buildStructure ? `${houseStore.currentBuildingInfo?.buildStructure}` : ' --' }}
</span>
</div>
<div style="text-wrap: nowrap" class="rightActions flex flex-items-center">
<span class="mr-20px" @click="handleAddUnit" v-has-permi="['unitNo:unitNo:add']">+添加单元</span>
<span class="mr-20px" @click="handleAddHouse" v-has-permi="['system:house:add']">+增加房屋</span>
<div class="rightActions flex flex-items-center" style="text-wrap: nowrap">
<span v-has-permi="['unitNo:unitNo:add']" class="mr-20px" @click="handleAddUnit">+添加单元</span>
<span v-has-permi="['system:house:add']" class="mr-20px" @click="handleAddHouse">+增加房屋</span>
<!-- <span class="mr-20px">收费标准设置</span> -->
<span @click="deleteAllhouse" v-has-permi="['system:house:remove']">批量删除房屋</span>
<el-select clearable @clear="handleClearUse" @change="handleChangeUse" v-model="houseUse" placeholder="筛选房屋类型" class="selectbox">
<span v-has-permi="['system:house:remove']" @click="deleteAllhouse">批量删除房屋</span>
<el-select v-model="houseUse" class="selectbox" clearable placeholder="筛选房屋类型" @change="handleChangeUse" @clear="handleClearUse">
<el-option v-for="item in houseUseTypeList" :key="item.id" :label="item.name" :value="item.id" />
</el-select>
<div class="searchbox flex flex-items-center">
<el-input v-model="housename" maxlength="15" class="searchinput" placeholder="请输入房屋号"></el-input>
<el-input v-model="housename" class="searchinput" maxlength="15" placeholder="请输入房屋号"></el-input>
<el-button style="margin-left: 10px" type="primary" @click="handleSearchHouse">搜索</el-button>
<el-button @click="reset">重置</el-button>
</div>
@@ -32,10 +32,10 @@
<TableUnit @edit-unit="handleEditUnit" @delete-unit="handleDelete"></TableUnit>
<!-- </div> -->
<!-- 添加或修改单元对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-dialog v-model="dialog.visible" :title="dialog.title" append-to-body width="500px">
<el-form ref="unitNoFormRef" :model="form" :rules="rules" label-width="80px">
<el-form-item label="单元名称" prop="name">
<el-input maxlength="6" show-word-limit v-model.trim="form.name" placeholder="请输入单元名称" />
<el-input v-model.trim="form.name" maxlength="6" placeholder="请输入单元名称" show-word-limit />
</el-form-item>
<el-form-item label="楼栋" prop="buildingId">
<el-select v-model="form.buildingId" placeholder="请选择">
@@ -53,12 +53,12 @@
</div>
</template>
<script setup lang="ts">
<script lang="ts" setup>
import { deleteHouseApi } from '@/api/system/house';
import TableUnit from './components/table.vue';
import { useHouseStore } from '@/store/modules/house';
import { listHouseUseType_add_house } from '@/api/system/houseUse';
import { addUnitNo, delUnitNo, getUnitNo, updateUnitNo } from '@/api/system/houseUnit';
import { addUnitNo, delUnitNo, updateUnitNo } from '@/api/system/houseUnit';
import { validator } from '@/utils/Reg';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@@ -118,25 +118,30 @@ const rules = {
};
/** 新增按钮操作 */
const handleAddUnit = () => {
resetForm();
dialog.visible = true;
dialog.title = '添加单元';
router.push({
path: '/house/addUnit'
});
};
/** 修改按钮操作 */
const handleEditUnit = async (id: string) => {
resetForm();
const res = await getUnitNo(id);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = '修改单元';
const handleEditUnit = (id: string) => {
router.push({
path: '/house/editUnit',
query: {
id
}
});
};
/** 删除按钮操作 */
const handleDelete = async (id: string) => {
await proxy?.$modal.confirm('是否确认删除该单元?');
await delUnitNo(id);
proxy?.$modal.msgSuccess('删除成功');
// await getList();
houseStore.updateCureentBuilding();
const handleDelete = (id: string) => {
proxy?.$modal
.confirm('是否确认删除该单元?')
.then(() => {
delUnitNo(id).then(() => {
proxy?.$modal.msgSuccess('删除成功');
houseStore.updateCureentBuilding();
});
})
.catch(() => {});
};
/** 提交按钮 */
@@ -209,7 +214,7 @@ async function deleteAllhouse() {
}
</script>
<style scoped lang="scss">
<style lang="scss" scoped>
$primary_color: #1978fe;
.UnitBox {
flex: 1;