This commit is contained in:
zjf committed 2025-09-30 17:20:40 +08:00
1 parent 81136dacd0
commit 3962ea78b4
11 files changed
+47 -38

No files matched your search

@@ -88,3 +88,4 @@ export function exportProfitMarginReport(params?: object) {
responseType: 'blob' responseType: 'blob'
}) })
} }
@@ -32,27 +32,27 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" class="mb20"> <!-- <el-col :span="12" class="mb20">-->
<el-form-item label="默认管理员" prop="adminId"> <!-- <el-form-item label="默认管理员" prop="adminId">-->
<el-select <!-- <el-select -->
v-model="form.adminId" <!-- v-model="form.adminId" -->
placeholder="请选择默认管理员" <!-- placeholder="请选择默认管理员" -->
clearable <!-- clearable-->
filterable <!-- filterable-->
remote <!-- remote-->
:remote-method="handleAdminUserSearch" <!-- :remote-method="handleAdminUserSearch"-->
:loading="adminUserLoading" <!-- :loading="adminUserLoading"-->
@visible-change="handleAdminUserVisibleChange" <!-- @visible-change="handleAdminUserVisibleChange"-->
> <!-- >-->
<el-option <!-- <el-option-->
v-for="item in adminUserOptions" <!-- v-for="item in adminUserOptions"-->
:key="item.id" <!-- :key="item.id"-->
:label="item.nameWithMobile" <!-- :label="item.nameWithMobile"-->
:value="item.id" <!-- :value="item.id"-->
/> <!-- />-->
</el-select> <!-- </el-select>-->
</el-form-item> <!-- </el-form-item>-->
</el-col> <!-- </el-col>-->
<el-col :span="12" class="mb20"> <el-col :span="12" class="mb20">
<el-form-item label="容纳人数" prop="capacity"> <el-form-item label="容纳人数" prop="capacity">
@@ -86,11 +86,11 @@
</el-form-item> </el-form-item>
</el-col> </el-col>
<el-col :span="12" class="mb20"> <!-- <el-col :span="12" class="mb20">-->
<el-form-item label="可用时间段" prop="availableTime"> <!-- <el-form-item label="可用时间段" prop="availableTime">-->
<el-input v-model="form.availableTime" placeholder="请输入可用时间段"/> <!-- <el-input v-model="form.availableTime" placeholder="请输入可用时间段"/>-->
</el-form-item> <!-- </el-form-item>-->
</el-col> <!-- </el-col>-->
<el-col :span="24" class="mb20"> <el-col :span="24" class="mb20">
<el-form-item label="位置" prop="location"> <el-form-item label="位置" prop="location">
@@ -340,9 +340,9 @@ const openDialog = (id: string) => {
// 获取用户下拉数据(保洁和会务人员) // 获取用户下拉数据(保洁和会务人员)
getUserOptions() getUserOptions()
// 获取管理员用户数据 // 获取管理员用户数据
getAdminUserOptions() // getAdminUserOptions()
// 获取meetingRoom信息 // 获取meetingRoom信息
if (id) { if (id) {
@@ -356,7 +356,7 @@ const getUserOptions = async () => {
try { try {
const res = await dropdown() const res = await dropdown()
const allUsers = Array.isArray(res.data) ? res.data : [] const allUsers = Array.isArray(res.data) ? res.data : []
// 根据type字段分别赋值(type为字符串类型) // 根据type字段分别赋值(type为字符串类型)
cleanUserOptions.value = allUsers.filter(user => user.type === '1') // type: '1' 为保洁 cleanUserOptions.value = allUsers.filter(user => user.type === '1') // type: '1' 为保洁
serviceUserOptions.value = allUsers.filter(user => user.type === '2') // type: '2' 为会务人员 serviceUserOptions.value = allUsers.filter(user => user.type === '2') // type: '2' 为会务人员
@@ -370,23 +370,23 @@ const getAdminUserOptions = async (searchKeyword?: string) => {
try { try {
adminUserLoading.value = true adminUserLoading.value = true
const params: any = {} const params: any = {}
// 如果有搜索关键词,添加到参数中 // 如果有搜索关键词,添加到参数中
if (searchKeyword) { if (searchKeyword) {
params.name = searchKeyword params.name = searchKeyword
params.mobile = searchKeyword params.mobile = searchKeyword
} }
const res = await getSimpleUserAll(params) const res = await getSimpleUserAll(params)
let allUsers = Array.isArray(res.data) ? res.data : [] let allUsers = Array.isArray(res.data) ? res.data : []
// 如果接口不支持搜索参数,在前端进行过滤 // 如果接口不支持搜索参数,在前端进行过滤
if (searchKeyword && allUsers.length > 0) { if (searchKeyword && allUsers.length > 0) {
allUsers = allUsers.filter(user => allUsers = allUsers.filter(user =>
user.nameWithMobile.toLowerCase().includes(searchKeyword.toLowerCase()) user.nameWithMobile.toLowerCase().includes(searchKeyword.toLowerCase())
) )
} }
adminUserOptions.value = allUsers adminUserOptions.value = allUsers
} catch (err: any) { } catch (err: any) {
console.error('获取管理员用户列表失败:', err) console.error('获取管理员用户列表失败:', err)
@@ -31,12 +31,12 @@
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column prop="deptId" label="部门id" show-overflow-tooltip/>--> <!-- <el-table-column prop="deptId" label="部门id" show-overflow-tooltip/>-->
<el-table-column prop="adminId" label="默认管理员" show-overflow-tooltip/> <!-- <el-table-column prop="adminId" label="默认管理员" show-overflow-tooltip/>-->
<el-table-column prop="location" label="位置" show-overflow-tooltip/> <el-table-column prop="location" label="位置" show-overflow-tooltip/>
<el-table-column prop="capacity" label="容纳人数" show-overflow-tooltip/> <el-table-column prop="capacity" label="容纳人数" show-overflow-tooltip/>
<el-table-column prop="availableTime" label="可用时间段" show-overflow-tooltip/> <!-- <el-table-column prop="availableTime" label="可用时间段" show-overflow-tooltip/>-->
<el-table-column prop="cleanUserId" label="保洁人员" show-overflow-tooltip/> <!-- <el-table-column prop="cleanUserId" label="保洁人员" show-overflow-tooltip/>-->
<el-table-column prop="serviceUserId" label="会务人员" show-overflow-tooltip/> <!-- <el-table-column prop="serviceUserId" label="会务人员" show-overflow-tooltip/>-->
<el-table-column label="操作" width="150"> <el-table-column label="操作" width="150">
<template #default="scope"> <template #default="scope">
<el-button icon="edit-pen" text type="primary" v-auth="'integrated_meetingRoom_edit'" <el-button icon="edit-pen" text type="primary" v-auth="'integrated_meetingRoom_edit'"
@@ -338,3 +338,4 @@ const handleCurrentChange = (page: number) => {
} }
</style> </style>
@@ -190,3 +190,4 @@ defineExpose({
} }
</style> </style>
@@ -202,3 +202,4 @@ const trendClass = computed(() => {
} }
</style> </style>
@@ -6,3 +6,4 @@ export { default as SalesChart } from './SalesChart.vue';
export { default as SummaryCard } from './SummaryCard.vue'; export { default as SummaryCard } from './SummaryCard.vue';
export { default as ProductRankingTable } from './ProductRankingTable.vue'; export { default as ProductRankingTable } from './ProductRankingTable.vue';
@@ -206,3 +206,4 @@ export const SUCCESS_MESSAGES = {
CACHE_REFRESHED: '缓存刷新成功', CACHE_REFRESHED: '缓存刷新成功',
}; };
@@ -135,3 +135,4 @@ export function formatTimePeriodDataForExport(data: any[]) {
增长率: `${item.growthRate || 0}%` 增长率: `${item.growthRate || 0}%`
})); }));
} }
@@ -195,3 +195,4 @@ export const TABLE_CONFIG = {
showOverflowTooltip: true, showOverflowTooltip: true,
}; };
@@ -365,3 +365,4 @@ class ProfitMarginReportServiceTest {
7. **测试覆盖**: 完善单元测试和集成测试 7. **测试覆盖**: 完善单元测试和集成测试
这样重构后的代码将更加清晰、可维护,并且性能更好。 这样重构后的代码将更加清晰、可维护,并且性能更好。