页面路径完善

This commit is contained in:
Zy
2026-04-28 19:18:57 +08:00
parent bde3ca8ff1
commit 7b89144dd4
70 changed files with 573 additions and 221 deletions

View File

@@ -0,0 +1,63 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { ChargeTypeVO, ChargeTypeForm, ChargeTypeQuery } from './type';
/**
* 查询收费类型列表
* @param query
* @returns {*}
*/
export const listChargeType = (query?: ChargeTypeQuery): AxiosPromise<ChargeTypeVO[]> => {
return request({
url: '/chargeType/list',
method: 'get',
params: query
});
};
/**
* 查询收费类型详细
* @param id
*/
export const getChargeType = (id: string | number): AxiosPromise<ChargeTypeVO> => {
return request({
url: '/chargeType/' + id,
method: 'get'
});
};
/**
* 新增收费类型
* @param data
*/
export const addChargeType = (data: ChargeTypeForm) => {
return request({
url: '/chargeType',
method: 'post',
data: data
});
};
/**
* 修改收费类型
* @param data
*/
export const updateChargeType = (data: ChargeTypeForm) => {
return request({
url: '/chargeType',
method: 'put',
data: data
});
};
/**
* 删除收费类型
* @param id
*/
export const delChargeType = (id: string | number | Array<string | number>) => {
return request({
url: '/chargeType/' + id,
method: 'delete'
});
};

View File

@@ -0,0 +1,66 @@
export interface ChargeTypeVO {
/**
* 收费类型表id
*/
id: string | number;
/**
* 收费类型名称
*/
name: string;
/**
* 状态 0启用 1停用
*/
status: string;
}
export interface ChargeTypeForm extends BaseEntity {
/**
* 收费类型表id
*/
id?: string | number;
/**
* 收费类型名称
*/
name?: string;
/**
* 状态 0启用 1停用
*/
status?: string;
}
export interface ChargeTypeQuery {
/**
* 收费类型名称
*/
name?: string;
/**
* 状态 0启用 1停用
*/
status?: string;
/**
* 日期范围参数
*/
params?: any;
}
export interface ChargeType2Query extends PageQuery {
/**
* 收费类型名称
*/
name?: string;
/**
* 状态 0启用 1停用
*/
status?: string;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -8,6 +8,10 @@ export interface ChargeItemVO {
* 项目名称
*/
name: string;
/**
* 收费类型
*/
typeId: string;
/**
* 计费方式 0单次收费 1周期收费 2仪表收费

View File

@@ -6,7 +6,7 @@ export interface BuildingVo {
/**
* 0住宅 1办公 2商用 3公寓
*/
buildingUse: number;
buildingUse: string;
/**
* 楼栋结构
*/
@@ -68,7 +68,7 @@ export interface HouseType {
export interface addBuildingType {
buildingName: string;
villageId: number;
villageId?: number;
buildStructure?: string;
buildTall?: string;
buildToward?: string;

View File

@@ -3,7 +3,7 @@ export interface ResidentVO {
* 主键 住户管理id
*/
userId: string | number;
id: string;
/**
* 住户编号
*/

View File

@@ -19,57 +19,41 @@ const permissionStore = usePermissionStore();
const levelList = ref<RouteLocationMatched[]>([]);
const getBreadcrumb = () => {
// only show routes with meta.title
let matched = [];
const pathNum = findPathNum(route.path);
// multi-level menu
if (pathNum > 2) {
const reg = /\/\w+/gi;
const pathList = route.path.match(reg).map((item, index) => {
if (index !== 0) item = item.slice(1);
return item;
});
getMatched(pathList, permissionStore.defaultRoutes, matched);
} else {
matched = route.matched.filter((item) => item.meta && item.meta.title);
}
// 判断是否为首页
if (!isDashboard(matched[0])) {
matched = [{ path: '/index', meta: { title: '首页' } }].concat(matched);
}
levelList.value = matched.filter((item) => item.meta && item.meta.title && item.meta.breadcrumb !== false);
};
const findPathNum = (str, char = '/') => {
if (typeof str !== 'string' || str.length === 0) return 0;
return str.split(char).length - 1;
};
const getMatched = (pathList, routeList, matched) => {
const data = routeList.find((item) => item.path == pathList[0] || (item.name += '').toLowerCase() == pathList[0]);
if (data) {
matched.push(data);
if (data.children && pathList.length) {
pathList.shift();
getMatched(pathList, data.children, matched);
// 1. 先获取原生的 matched
let matched = route.matched.filter((item) => item.meta && item.meta.title);
// 🔥 关键:如果当前路由有 parentTitle手动插入虚拟父级
if (route.meta?.parentTitle) {
// 找到倒数第二个路由(通常是二级列表页)
const lastIndex = matched.length - 1;
if (lastIndex >= 0) {
// 创建虚拟父级路由对象
const virtualParent = {
path: matched[lastIndex].path,
meta: { title: route.meta.parentTitle }
};
// 插入到倒数第二个位置
matched = [...matched.slice(0, lastIndex), virtualParent, matched[lastIndex]];
}
}
// 2. 过滤掉设置了 breadcrumb: false 的路由
levelList.value = matched.filter((item) => item.meta && item.meta.title && item.meta.breadcrumb !== false);
console.log('最终面包屑:', levelList.value);
};
const isDashboard = (route: RouteLocationMatched) => {
const name = route && (route.name as string);
if (!name) {
return false;
}
return name.trim() === 'Index';
};
const handleLink = (item) => {
const { redirect, path } = item;
redirect ? router.push(redirect) : router.push(path);
};
watchEffect(() => {
// if you go to the redirect page, do not update the breadcrumbs
if (route.path.startsWith('/redirect/')) return;
getBreadcrumb();
});
onMounted(() => {
getBreadcrumb();
});

View File

@@ -26,14 +26,6 @@ const isWhiteList = (path: string) => {
router.beforeEach(async (to, from) => {
NProgress.start();
// ==============================================
// 🚥 调试日志:每次跳转都打印(方便看你跳去了哪)
// ==============================================
console.log('==========================================================');
console.log('🔀 路由跳转:', from.path, ' → ', to.path);
console.log('🔐 是否有Token', !!getToken());
console.log('🚦 动态路由是否已加载:', isDynamicRoutesAdded);
const hasToken = getToken();
const userStore = useUserStore();
const permissionStore = usePermissionStore();
@@ -44,29 +36,16 @@ router.beforeEach(async (to, from) => {
// 已登录 且 去登录页 → 跳首页
if (to.path === '/login') {
console.log('✅ 已登录,访问登录页,直接跳首页');
NProgress.done();
return '/';
}
// 白名单页面直接放行
if (isWhiteList(to.path)) {
console.log('✅ 白名单页面,直接放行');
return;
}
// ==============================================
// ✅ 【关键】只在【没有角色 + 没有加载过路由】时执行一次
// ==============================================
console.log('👤 当前用户角色:', userStore.roles);
console.log('🧪 判断条件roles.length === 0 && !isDynamicRoutesAdded');
console.log('🧪 结果:', userStore.roles.length === 0 && !isDynamicRoutesAdded);
if (userStore.roles.length === 0 && !isDynamicRoutesAdded) {
console.log('==========================================================');
console.log('🚀 【首次初始化】获取用户信息 + 生成动态路由(只执行一次)');
console.log('==========================================================');
isRelogin.show = true;
// 获取用户信息
@@ -79,12 +58,10 @@ router.beforeEach(async (to, from) => {
return '/';
}
console.log('✅ 用户信息获取成功:', res);
isRelogin.show = false;
// 生成动态路由
const accessRoutes = await permissionStore.generateRoutes();
console.log('✅ 动态路由生成成功,数量:', accessRoutes.length);
// 添加路由(避免重复添加)
accessRoutes.forEach((route) => {
@@ -95,7 +72,6 @@ router.beforeEach(async (to, from) => {
// ✅ 标记:路由已添加
isDynamicRoutesAdded = true;
console.log('✅ 动态路由添加完成,标记 isDynamicRoutesAdded = true');
// 管理员登录强制跳转
if (res.user.userId === 1 && from.path === '/login') {

View File

@@ -9,9 +9,46 @@ import ParentView from '@/components/ParentView/index.vue';
import InnerLink from '@/layout/components/InnerLink/index.vue';
import { ref } from 'vue';
import { createCustomNameComponent } from '@/utils/createCustomNameComponent';
import { ElNotification } from 'element-plus'; // 确保引入了这个
// 匹配views里面所有的.vue文件
const modules = import.meta.glob('./../../views/**/*.vue');
const transformRoutes = (backendRoutes: any[]): any[] => {
// 1. 深拷贝
const processedRoutes = JSON.parse(JSON.stringify(backendRoutes));
// 2. 创建2级路由映射表key: activeMenu, value: 标题)
const level2TitleMap = new Map();
processedRoutes.forEach((level1Route: any) => {
if (!level1Route.children) return;
level1Route.children.forEach((level2Route: any) => {
if (!level2Route.hidden) {
const fullPath = level1Route.path.endsWith('/') ? `${level1Route.path}${level2Route.path}` : `${level1Route.path}/${level2Route.path}`;
level2TitleMap.set(fullPath, level2Route.meta?.title);
}
});
});
// 3. 给三级路由的 meta 加 parentTitle不做嵌套保持扁平
processedRoutes.forEach((level1Route: any) => {
if (!level1Route.children) return;
level1Route.children.forEach((route: any) => {
if (route.hidden && route.meta?.activeMenu) {
const parentTitle = level2TitleMap.get(route.meta.activeMenu);
if (parentTitle) {
// 🔥 关键:只加 parentTitle不修改 children
route.meta.parentTitle = parentTitle;
}
}
});
});
return processedRoutes;
};
export const usePermissionStore = defineStore('permission', () => {
const routes = ref<RouteRecordRaw[]>([]);
const addRoutes = ref<RouteRecordRaw[]>([]);
@@ -45,16 +82,31 @@ export const usePermissionStore = defineStore('permission', () => {
const setSidebarRouters = (routes: RouteRecordRaw[]): void => {
sidebarRouters.value = routes;
};
// --------------------------
// 修改generateRoutes 函数,加入转换逻辑
// --------------------------
const generateRoutes = async (): Promise<RouteRecordRaw[]> => {
const res = await getRouters();
const { data } = res;
const sdata = JSON.parse(JSON.stringify(data));
const rdata = JSON.parse(JSON.stringify(data));
const defaultData = JSON.parse(JSON.stringify(data));
console.log('后端原始路由:', data);
// 🔥 关键:先把后端扁平路由转成嵌套格式
const nestedData = transformRoutes(data);
console.log('转换后的嵌套路由:', nestedData);
// 深拷贝数据(保留原有逻辑)
const sdata = JSON.parse(JSON.stringify(nestedData));
const rdata = JSON.parse(JSON.stringify(nestedData));
const defaultData = JSON.parse(JSON.stringify(nestedData));
// 后续使用转换后的 nestedData
const sidebarRoutes = filterAsyncRouter(sdata);
const rewriteRoutes = filterAsyncRouter(rdata, undefined, true);
const defaultRoutes = filterAsyncRouter(defaultData);
const asyncRoutes = filterDynamicRoutes(dynamicRoutes);
asyncRoutes.forEach((route) => {
router.addRoute(route);
});
@@ -191,7 +243,7 @@ function duplicateRouteChecker(localRoutes: Route[], routes: Route[]) {
const nameList: string[] = [];
allRoutes.forEach((route) => {
const name = route.name.toString();
const name = route.name?.toString();
if (name && nameList.includes(name)) {
const message = `路由名称: [${name}] 重复, 会造成 404`;
console.error(message);
@@ -202,6 +254,8 @@ function duplicateRouteChecker(localRoutes: Route[], routes: Route[]) {
});
return;
}
nameList.push(route.name.toString());
if (name) {
nameList.push(name);
}
});
}

View File

@@ -1,5 +1,7 @@
<template>
<div class="p-2">
<pageheader></pageheader>
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">

View File

@@ -1,5 +1,7 @@
<template>
<div class="p-2">
<pageheader></pageheader>
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">

View File

@@ -190,7 +190,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: ActivityVO) => {
router.push({
path: '/repair/addActivity',
path: '/repair/editActivity',
query: {
id: row.id
}

View File

@@ -1,6 +1,6 @@
<template>
<div class="ResidentMainBox p-2 w-full">
<PageHeader title="装修编辑"></PageHeader>
<PageHeader></PageHeader>
<div class="ResidentMainBody">
<el-card>
<template #header>

View File

@@ -214,7 +214,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: DecorationVO) => {
router.push({
path: '/repair/addDecoration',
path: '/repair/editDecoration',
query: {
id: row.id
}

View File

@@ -149,7 +149,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: HandleLogVO) => {
router.push({
path: '/repair/addHandleLog',
path: '/repair/editHandleLog',
query: {
id: row.id
}

View File

@@ -1,5 +1,6 @@
<template>
<div class="h-full flex flex-col p-2">
<pageheader></pageheader>
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">

View File

@@ -249,7 +249,7 @@ const handleUpdate = async (row?: MonthCardVO) => {
reset();
const _id = row?.id || ids.value[0];
router.push({
path: '/carArea/addMonthCard',
path: '/carArea/editMonthCard',
query: {
id: _id
}

View File

@@ -168,7 +168,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: NoticeVO) => {
router.push({
path: '/repair/addNoticePc',
path: '/repair/editNoticePc',
query: {
id: row.noticeId
}

View File

@@ -193,14 +193,14 @@ const handleSelectionChange = (selection: ParkingCostVO[]) => {
/** 新增按钮操作 */
const handleAdd = () => {
router.push({
path: '/carArea/addparkingcost'
path: '/carArea/addParkingCost'
});
};
/** 修改按钮操作 */
const handleUpdate = async (row?: ParkingCostVO) => {
router.push({
path: '/carArea/addparkingcost',
path: '/carArea/editParkingCost',
query: {
id: row.id
}

View File

@@ -186,7 +186,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: QuestionnaireVO) => {
router.push({
path: '/repair/addQuestionnaire',
path: '/repair/editQuestionnaire',
query: {
id: row.id
}

View File

@@ -187,7 +187,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: RepairVO) => {
router.push({
path: '/repair/addRepair',
path: '/repair/editRepair',
query: {
id: row.id
}

View File

@@ -298,7 +298,7 @@ function backRouter() {
function handleEdit() {
router.push({
path: '/repair/addRepair',
path: '/repair/editRepair',
query: {
id: form.value.id
}

View File

@@ -265,7 +265,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: RepairProjectVO) => {
router.push({
path: '/system/addRepairProjectList',
path: '/system/editRepairProjectList',
query: {
id: row.id
}

View File

@@ -8,6 +8,11 @@
<el-form-item label="项目名称" prop="itemName">
<el-input v-model.trim="form.itemName" placeholder="请输入项目名称" />
</el-form-item>
<el-form-item label="收费项目" prop="typeId">
<el-select v-model="form.typeId">
<el-option v-for="(item, index) in chargeitemlist" :key="index" :value="item.id" :label="item.name"></el-option>
</el-select>
</el-form-item>
<el-form-item label="计费方式" prop="billingType">
<el-radio-group v-model="form.billingType">
<el-radio v-for="(item, index) in com_charge_item_method" :key="index" :value="item.value" :label="item.label"></el-radio>
@@ -60,6 +65,7 @@
import { ref } from 'vue';
import PageHeader from '@/components/Pageheader/index.vue';
import { getChargeItem, updateChargeItem, addChargeItem } from '@/api/system/SdbChargeItem';
import { listChargeType } from '@/api/system/ChargeType';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { com_charge_item_unit } = toRefs<any>(proxy?.useDict('com_charge_item_unit'));
@@ -74,6 +80,7 @@ const route = useRoute();
const formRef = ref();
const form = ref({
'id': null,
'typeId': '',
'itemName': '',
'billingType': '0',
'fixedPrice': null,
@@ -86,6 +93,7 @@ const form = ref({
});
const rules = ref({
itemName: [{ required: true, message: '请输入 项目名称', trigger: 'blur' }],
typeId: [{ required: true, message: '请选择 收费类型', trigger: 'blur' }],
billingType: [{ required: true, message: '请输入 计费方式', trigger: 'blur' }],
fixedPrice: [{ required: true, message: '请输入 费用单价', trigger: 'blur' }],
formula: [{ required: true, message: '请选择 计费公式', trigger: 'blur' }],
@@ -94,8 +102,13 @@ const rules = ref({
carryMethod: [{ required: true, message: '请选择 进位方式', trigger: 'blur' }]
});
const userid = ref(null);
const chargeitemlist = ref([]);
listChargeType().then((res) => {
chargeitemlist.value = res.rows;
});
if (route.query.id) {
userid.value = route.query.id;
getChargeItem(userid.value).then((res) => {
form.value = {
...form.value,

View File

@@ -209,7 +209,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: ChargeItemVO) => {
router.push({
path: '/sdb/addchargeItem',
path: '/sdb/editchargeItem',
query: {
id: row.id
}

View File

@@ -0,0 +1,239 @@
<template>
<div class="p-2 h-full flex flex-col">
<pageheader></pageheader>
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
<el-form ref="queryFormRef" :model="queryParams" label-width="120" :inline="true">
<el-form-item label="收费类型名称" prop="name">
<el-input v-model="queryParams.name" placeholder="请输入收费类型名称" clearable @keyup.enter="handleQuery" />
</el-form-item>
<el-form-item>
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
</el-form-item>
</el-form>
</el-card>
</div>
</transition>
<el-card class="flex-1" shadow="never">
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['chargeType:chargeType:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['chargeType:chargeType:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['chargeType:chargeType:remove']"
>删除</el-button
>
</el-col>
<right-toolbar v-model:showSearch="showSearch" @queryTable="getList"></right-toolbar>
</el-row>
</template>
<el-table v-loading="loading" border :data="chargeTypeList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="收费类型名称" align="center" prop="name" />
<el-table-column label="状态" align="center" prop="status">
<template #default="scope">
<el-switch
@change="(val: string) => handleChange(val, scope.row)"
v-model="scope.row.status"
active-text="启用"
active-value="0"
inactive-text="停用"
inactive-value="1"
></el-switch>
</template>
</el-table-column>
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
<template #default="scope">
<el-tooltip content="修改" placement="top">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['chargeType:chargeType:edit']"></el-button>
</el-tooltip>
<el-tooltip content="删除" placement="top">
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['chargeType:chargeType:remove']"></el-button>
</el-tooltip>
</template>
</el-table-column>
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
<!-- 添加或修改收费类型对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="chargeTypeFormRef" :model="form" :rules="rules" label-width="100px">
<el-form-item label="收费类型名称" prop="name">
<el-input v-model="form.name" placeholder="请输入收费类型名称" />
</el-form-item>
</el-form>
<template #footer>
<div class="dialog-footer">
<el-button :loading="buttonLoading" type="primary" @click="submitForm"> </el-button>
<el-button @click="cancel"> </el-button>
</div>
</template>
</el-dialog>
</div>
</template>
<script setup name="ChargeType" lang="ts">
import { listChargeType, getChargeType, delChargeType, addChargeType, updateChargeType } from '@/api/system/ChargeType';
import { ChargeTypeVO, ChargeTypeQuery, ChargeTypeForm, ChargeType2Query } from '@/api/system/ChargeType/type';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const chargeTypeList = ref<ChargeTypeVO[]>([]);
const buttonLoading = ref(false);
const loading = ref(true);
const showSearch = ref(true);
const ids = ref<Array<string | number>>([]);
const single = ref(true);
const multiple = ref(true);
const total = ref(0);
const queryFormRef = ref<ElFormInstance>();
const chargeTypeFormRef = ref<ElFormInstance>();
const dialog = reactive<DialogOption>({
visible: false,
title: ''
});
const initFormData: ChargeTypeForm = {
id: undefined,
name: undefined,
status: undefined
};
const data = reactive<PageData<ChargeTypeForm, ChargeType2Query>>({
form: { ...initFormData },
queryParams: {
pageNum: 1,
pageSize: 10,
name: undefined,
status: undefined,
params: {}
}
});
const { queryParams, form, rules } = toRefs(data);
const handleChange = (val: string, row: ChargeTypeVO) => {
updateChargeType({
id: row.id,
status: val
}).then(() => {
proxy?.$modal.msgSuccess('操作成功');
getList();
});
};
/** 查询收费类型列表 */
const getList = async () => {
loading.value = true;
const res = await listChargeType(queryParams.value);
chargeTypeList.value = res.rows;
total.value = res.total;
loading.value = false;
};
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
};
/** 表单重置 */
const reset = () => {
form.value = { ...initFormData };
chargeTypeFormRef.value?.resetFields();
};
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
getList();
};
/** 重置按钮操作 */
const resetQuery = () => {
queryFormRef.value?.resetFields();
handleQuery();
};
/** 多选框选中数据 */
const handleSelectionChange = (selection: ChargeTypeVO[]) => {
ids.value = selection.map((item) => item.id);
single.value = selection.length != 1;
multiple.value = !selection.length;
};
/** 新增按钮操作 */
const handleAdd = () => {
reset();
dialog.visible = true;
dialog.title = '添加收费类型';
};
/** 修改按钮操作 */
const handleUpdate = async (row?: ChargeTypeVO) => {
reset();
const _id = row?.id || ids.value[0];
const res = await getChargeType(_id);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = '修改收费类型';
};
/** 提交按钮 */
const submitForm = () => {
chargeTypeFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.id) {
await updateChargeType(form.value).finally(() => (buttonLoading.value = false));
} else {
await addChargeType(form.value).finally(() => (buttonLoading.value = false));
}
proxy?.$modal.msgSuccess('操作成功');
dialog.visible = false;
await getList();
}
});
};
/** 删除按钮操作 */
const handleDelete = async (row?: ChargeTypeVO) => {
const _ids = row?.id || ids.value;
await proxy?.$modal.confirm('是否确认删除收费类型编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
await delChargeType(_ids);
proxy?.$modal.msgSuccess('删除成功');
await getList();
};
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download(
'chargeType/chargeType/export',
{
...queryParams.value
},
`chargeType_${new Date().getTime()}.xlsx`
);
};
onMounted(() => {
getList();
});
</script>
<style scoped lang="scss">
.el-table {
height: calc(100% - 80px);
}
</style>

View File

@@ -162,7 +162,7 @@ const handleAdd = () => {
});
};
/** 修改按钮操作 */
/** 详情按钮操作 */
const handleMain = async (row?: PayRecordVO) => {
router.push({
path: '/sdb/PayRecordMain',

View File

@@ -29,7 +29,6 @@
<template #header>
<el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleMain" v-hasPermi="['system:bill:add']">详情</el-button>
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:bill:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
@@ -53,7 +52,7 @@
<dict-tag :options="com_questionnaire_scope" :value="scope.row.chargeScope"></dict-tag>
</template>
</el-table-column>
<el-table-column label="收费项目" align="center" prop="chargeItemId" />
<el-table-column label="收费项目" align="center" prop="chargeItemName" />
<el-table-column label="收费周期" align="center" prop="chargePeriod">
<template #default="scope">
<dict-tag :options="com_bill_charge_period" :value="scope.row.chargePeriod"></dict-tag>
@@ -71,11 +70,11 @@
</el-table-column>
<el-table-column label="单价" align="center" prop="endDate" width="180">
<template #default="scope">
<span>{{ parseTime(scope.row.endDate, '{y}-{m}-{d}') }}</span>
<span>{{ scope.row.fixedPrice }}</span>
</template>
</el-table-column>
<el-table-column label="数量" align="center" prop="chargePeriod" />
<el-table-column label="费用合计" align="center" prop="chargePeriod" />
<!-- <el-table-column label="数量" align="center" prop="chargePeriod" />
<el-table-column label="费用合计" align="center" prop="chargePeriod" /> -->
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['system:bill:edit']">修改</el-button>
@@ -159,18 +158,6 @@ const getList = async () => {
loading.value = false;
};
/** 取消按钮 */
const cancel = () => {
reset();
dialog.visible = false;
};
/** 表单重置 */
const reset = () => {
form.value = { ...initFormData };
billFormRef.value?.resetFields();
};
/** 搜索按钮操作 */
const handleQuery = () => {
queryParams.value.pageNum = 1;
@@ -201,27 +188,10 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: BillVO) => {
reset();
const _id = row?.id || ids.value[0];
const res = await getBill(_id);
Object.assign(form.value, res.data);
dialog.visible = true;
dialog.title = '修改账单管理';
};
/** 提交按钮 */
const submitForm = () => {
billFormRef.value?.validate(async (valid: boolean) => {
if (valid) {
buttonLoading.value = true;
if (form.value.id) {
await updateBill(form.value).finally(() => (buttonLoading.value = false));
} else {
await addBill(form.value).finally(() => (buttonLoading.value = false));
}
proxy?.$modal.msgSuccess('操作成功');
dialog.visible = false;
await getList();
router.push({
path: '/sdb/editSdbbill',
query: {
id: row.id
}
});
};
@@ -244,17 +214,6 @@ const handleDelete = async (row?: BillVO) => {
await getList();
};
/** 导出按钮操作 */
const handleExport = () => {
proxy?.download(
'system/bill/export',
{
...queryParams.value
},
`bill_${new Date().getTime()}.xlsx`
);
};
onMounted(() => {
getList();
});

View File

@@ -64,7 +64,7 @@ import { ref } from 'vue';
import cashier from './cashier.vue';
import history from './history.vue';
const isSearch = ref(false);
const isSearch = ref(true);
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { com_cashier_type } = toRefs<any>(proxy?.useDict('com_cashier_type'));
const searchform = ref({

View File

@@ -508,7 +508,7 @@ const router = useRouter();
const handleRecode = (row: ElectricityDeviceVO) => {
// 1.电表 2.电表
router.push({
path: '/equipment/TopupRecord2',
path: '/equipment/electricityTopupRecord',
query: {
type: '2',
houseName: row.houseName,

View File

@@ -4,10 +4,10 @@
<el-card class="flex-1 mt-10px" shadow="never">
<template #header>
<el-row :gutter="10" style="font-size: 0.8rem">
<el-col :span="3"> 设备号 {{ routeid }} </el-col>
<el-col :span="3"> 房间号 {{ housename }} </el-col>
<el-col :span="17"></el-col>
<el-col :span="1">
<el-col :span="4"> 设备号 {{ routeid }} </el-col>
<el-col :span="4"> 房间号 {{ housename }} </el-col>
<el-col :span="14"></el-col>
<el-col :span="2">
<el-button @click="confinem">返回</el-button>
</el-col>
</el-row>

View File

@@ -98,7 +98,7 @@
></el-switch>
</template>
</el-table-column> -->
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
<el-table-column label="操作" align="center" width="250" fixed="right" class-name="small-padding fixed-width">
<template #default="scope">
<el-row>
<el-col :span="24" class="flex flex-items-center">
@@ -494,7 +494,7 @@ const router = useRouter();
const handleRecode = (row: WaterDeviceVO) => {
// 1.电表 2.水表
router.push({
path: '/equipment/TopupRecord',
path: '/equipment/waterTopupRecord',
query: {
type: '2',
id: row.id,

View File

@@ -149,7 +149,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: AreaVO) => {
router.push({
path: '/carArea/addCarArea',
path: '/carArea/editCarArea',
query: {
id: row.id
}

View File

@@ -175,7 +175,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: CarVO) => {
router.push({
path: '/carArea/addCars',
path: '/carArea/editCars',
query: {
id: row.id
}

View File

@@ -1,5 +1,6 @@
<template>
<div class="p-2">
<pageheader></pageheader>
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="search">
<el-form ref="queryFormRef" :model="queryParams" :inline="true" label-width="85px">

View File

@@ -1,5 +1,6 @@
<template>
<div class="p-2 dict-page">
<pageheader></pageheader>
<el-row :gutter="16" class="dict-grid">
<!-- 字典类型 -->
<el-col :xs="24" :lg="12">

View File

@@ -187,7 +187,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: DeviceVO) => {
router.push({
path: '/equipment/addArchive',
path: '/equipment/editArchive',
query: {
id: row.id
}

View File

@@ -177,7 +177,7 @@ const handleMain = (row) => {
};
const handleEdit = (row) => {
router.push({
path: '/equipment/addEquipmentRepair',
path: '/equipment/editEquipmentRepair',
query: {
id: row.id
}

View File

@@ -190,7 +190,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: DeviceRepairVO) => {
router.push({
path: '/equipment/addEquipmentRepair',
path: '/equipment/editEquipmentRepair',
query: {
id: row.id
}

View File

@@ -131,9 +131,7 @@ const cancelForm = () => {
};
function goBack() {
router.push({
path: '/house/houselist'
});
router.back();
}
</script>

View File

@@ -41,7 +41,7 @@ const handleAddBuilding = () => {
};
const editBuilding = (id: number) => {
router.push({
path: '/house/addbuilding',
path: '/house/editbuilding',
query: {
buildingId: id
}

View File

@@ -1,7 +1,10 @@
<template>
<div class="house-list">
<div class="house flex align-center" @contextmenu="contextMenu.open($event, house.houseId)" v-for="house in list.houses" :key="house.houseId">
<el-checkbox :label="house.houseNo" :value="house.houseId" />
<div class="flex flex-center">
<el-checkbox :label="house.houseNo" :value="house.houseId" />
<div class="calp" @click="handleCalp($event, house.houseId)">···</div>
</div>
</div>
<!-- 右键菜单组件 -->
<ContextMenu ref="contextMenu" :menu="menuList" @select="handleSelect" />
@@ -31,6 +34,10 @@ const handleSelect = (data: { type: string; value: string }) => {
const emit = defineEmits<{
contextmenufun: [value: { type: string; value: string }];
}>();
const handleCalp = (event: MouseEvent, houseid: string) => {
contextMenu.value.open(event, houseid);
};
</script>
<style scoped lang="scss">
@@ -48,7 +55,6 @@ const emit = defineEmits<{
line-height: 40px;
border: 1px solid #ddd;
border-radius: 4px;
cursor: pointer;
margin: 5px;
padding-left: 10px;
padding-top: 3px;
@@ -69,4 +75,19 @@ const emit = defineEmits<{
top: 0;
left: 0;
}
.calp {
margin-left: 10px;
width: 20px;
height: 20px;
line-height: 20px;
display: flex;
justify-content: center;
align-items: center;
font-size: 10px;
letter-spacing: -3px;
transform: rotateZ(90deg) scale(0.8);
cursor: pointer;
}
</style>

View File

@@ -46,7 +46,7 @@ function contextMenuFun(val: { type: string; value: string }) {
switch (val.type) {
case 'edit':
router.push({
path: '/house/addHouse',
path: '/house/editHouse',
query: {
id: val.value
}

View File

@@ -28,6 +28,7 @@
</div>
</template>
<script setup name="Houselist" lang="ts">
// TODO 楼栋类型
import building from './components/building.vue';
import unit from './components/unit.vue';
import PageHeader from '@/components/Pageheader/index.vue';

View File

@@ -1,6 +1,6 @@
<template>
<div class="AddBuildingBox">
<PageHeader :title="userid ? '编辑房屋租赁' : '添加房屋租赁'"></PageHeader>
<PageHeader></PageHeader>
<div class="AddBuildingBody">
<div class="title">基本信息</div>
<div class="addBuildingFormBody">

View File

@@ -48,8 +48,7 @@
<div class="descriptionsbox">
<div class="label">房屋设施:</div>
<div class="value">
<DictTag :options="com_house_rental_facilities" :value="HouseInfo.facilities"></DictTag>
<span v-for="item in HouseInfo.facilitieslist" :key="item">{{ handlefacilities(item.name) }}</span>
<span style="margin-right: 10px" v-for="item in HouseInfo.facilitieslist" :key="item">{{ handlefacilities(item) }} </span>
</div>
</div>
<el-row>
@@ -138,6 +137,7 @@ async function init() {
getHouseRental(houseRentalid.value).then((res) => {
HouseInfo.value = res.data;
HouseInfo.value.facilitieslist = res.data.facilities.split(',').filter((item) => item);
console.log(HouseInfo.value.facilitieslist);
HouseInfo.value.houseImageUrls = HouseInfo.value.houseImageUrl.split(',').filter((item) => item);
const arr = getHousePathById(treedata.value, HouseInfo.value.houseId, 'label');
HouseInfo.value.house = arr.join(' - ');
@@ -147,11 +147,13 @@ init();
function handlefacilities(id: string) {
const find = housefacilities.value.find((item) => item.id === id);
console.log(find, id);
return find ? find.name : '';
}
function hanlededit() {
router.push({
path: '/house/addhouseRental',
path: '/house/edithouseRental',
query: {
id: HouseInfo.value.id
}

View File

@@ -200,7 +200,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: HouseRentalVO) => {
router.push({
path: '/house/addhouseRental',
path: '/house/edithouseRental',
query: {
id: row.id
}

View File

@@ -182,7 +182,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: ItemVO) => {
router.push({
path: '/inspection/addItem',
path: '/inspection/editItem',
query: {
id: row.id
}

View File

@@ -188,7 +188,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: PlanVO) => {
router.push({
path: '/inspection/addPlan',
path: '/inspection/editPlan',
query: {
id: row.id
}

View File

@@ -179,7 +179,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: PointVO) => {
router.push({
path: '/inspection/addInspectionPoint',
path: '/inspection/editInspectionPoint',
query: {
id: row?.id
}

View File

@@ -1,12 +0,0 @@
<template>
<div class="p-2 h-full flex flex-col">
<Pageheader></Pageheader>
<div class="flex-1 color-gray flex h-full font-size-6 flex-center">系统还在维护中敬请期待...</div>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
</script>
<style scoped lang="scss"></style>

View File

@@ -223,7 +223,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: RouteVO) => {
router.push({
path: '/Inspection/addRoute',
path: '/Inspection/editRoute',
query: { id: row?.id }
});
};

View File

@@ -198,7 +198,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: TaskVO) => {
router.push({
path: '/inspection/addTask',
path: '/inspection/editTask',
query: {
id: row.id
}

View File

@@ -1,12 +0,0 @@
<template>
<div class="p-2 h-full flex flex-col">
<Pageheader></Pageheader>
<div class="flex-1 color-gray flex h-full font-size-6 flex-center">系统还在维护中敬请期待...</div>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
</script>
<style scoped lang="scss"></style>

View File

@@ -1,5 +1,6 @@
<template>
<div class="p-2">
<pageheader></pageheader>
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">
@@ -28,7 +29,9 @@
<el-button v-hasPermi="['system:menu:add']" type="primary" plain icon="Plus" @click="handleAdd()">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button v-hasPermi="['system:menu:remove']" type="danger" plain icon="Delete" @click="handleCascadeDelete" :loading="deleteLoading">级联删除</el-button>
<el-button v-hasPermi="['system:menu:remove']" type="danger" plain icon="Delete" @click="handleCascadeDelete" :loading="deleteLoading"
>级联删除</el-button
>
</el-col>
<right-toolbar v-model:show-search="showSearch" @query-table="getList"></right-toolbar>
</el-row>

View File

@@ -1,5 +1,6 @@
<template>
<div class="p-2">
<pageheader></pageheader>
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">

View File

@@ -1,5 +1,7 @@
<template>
<div class="p-2">
<pageheader></pageheader>
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">

View File

@@ -1,5 +1,7 @@
<template>
<div class="p-2">
<pageheader></pageheader>
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">

View File

@@ -157,9 +157,7 @@ const submitForm = () => {
};
// 推出
const cancelForm = () => {
router.push({
path: '/carArea/parking'
});
router.back();
};
</script>

View File

@@ -186,7 +186,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: ParkingVO) => {
router.push({
path: '/carArea/addParking',
path: '/carArea/editParking',
query: {
id: row.id
}

View File

@@ -158,9 +158,7 @@ const submitForm = () => {
};
// 推出
const cancelForm = () => {
router.push({
path: '/carArea/monthCard'
});
router.back();
};
</script>

View File

@@ -1,6 +1,6 @@
<template>
<div class="AddBuildingBox">
<PageHeader :title="userid ? '编辑用户' : '添加用户'"></PageHeader>
<PageHeader></PageHeader>
<div class="AddBuildingBody">
<div class="title">基本信息</div>
<div class="addBuildingFormBody">
@@ -101,7 +101,6 @@
</div>
</div>
</template>
<script setup lang="ts">
import { ref } from 'vue';
import PageHeader from '@/components/Pageheader/index.vue';

View File

@@ -333,7 +333,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: ResidentVO) => {
router.push({
path: '/house/addResident',
path: '/house/editResident',
query: {
id: row.id
}

View File

@@ -1,5 +1,6 @@
<template>
<div class="h-full flex flex-col p-2">
<pageheader></pageheader>
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]">
<el-card shadow="hover">

View File

@@ -181,7 +181,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: StoreroomVO) => {
router.push({
path: '/house/addStoreRoom',
path: '/house/EditStoreRoom',
query: {
id: row.id
}

View File

@@ -23,11 +23,6 @@
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:stockOut:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:stockOut:edit']"
>修改</el-button
>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:stockOut:remove']"
>删除</el-button
@@ -53,7 +48,6 @@
<el-table-column label="操作" width="180" align="center" fixed="right" class-name="small-padding fixed-width">
<template #default="scope">
<el-button link type="primary" @click="handleMain(scope.row)" v-hasPermi="['system:stockOut:edit']">查看清单</el-button>
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['system:stockOut:edit']">修改</el-button>
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['system:stockOut:remove']">删除</el-button>
</template>
</el-table-column>
@@ -170,15 +164,6 @@ const handleAdd = () => {
});
};
/** 修改按钮操作 */
const handleUpdate = async (row?: StockOutVO) => {
router.push({
path: '/warehouse/stockoutMain',
query: {
id: row.id
}
});
};
/** 修改按钮操作 */
const handleMain = async (row?: StockOutVO) => {
router.push({

View File

@@ -183,7 +183,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: MaterialVO) => {
router.push({
path: '/warehouse/addMaterial',
path: '/warehouse/editMaterial',
query: {
id: row.id
}

View File

@@ -162,7 +162,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: StockInVO) => {
router.push({
path: '/warehouse/addPurchaseIn',
path: '/warehouse/editPurchaseIn',
query: {
id: row.id
}

View File

@@ -191,7 +191,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: SupplierVO) => {
router.push({
path: '/warehouse/addSupplier',
path: '/warehouse/editSupplier',
query: {
id: row.id
}

View File

@@ -202,7 +202,7 @@ const handleAdd = () => {
/** 修改按钮操作 */
const handleUpdate = async (row?: WarehouseVO) => {
router.push({
path: '/warehouse/addWarehouse',
path: '/warehouse/editWarehouse',
query: {
id: row.id
}