1 Commits
dev ... main

Author SHA1 Message Date
Zy
ae1f9f6ee2 同步 2026-06-01 18:12:58 +08:00
123 changed files with 2729 additions and 1563 deletions

View File

@@ -28,7 +28,10 @@ VITE_APP_SNAILJOB_ADMIN = 'http://192.168.1.215/snail-job'
VITE_APP_PORT = 5173 VITE_APP_PORT = 5173
# 登录成功跳转地址 # 登录成功跳转地址
VITE_LOGIN_BACK_URL = '/equipment/WaterDevice' # VITE_LOGIN_BACK_URL = '/equipment/WaterDevice'
VITE_LOGIN_BACK_URL = '/index'
# 工作台正式内容:false 假内容true
VITE_LOGIN_BACK_URL_WORKBENCH_TRUE= true
# 是否展示工作台 # 是否展示工作台
VITE_APP_SHOW_WORK_PLATFORM = true VITE_APP_SHOW_WORK_PLATFORM = true
@@ -61,5 +64,5 @@ VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e'
VITE_APP_WEBSOCKET = false VITE_APP_WEBSOCKET = false
# sse 开关 # sse 开关
VITE_APP_SSE = false VITE_APP_SSE = true

View File

@@ -19,9 +19,12 @@ VITE_APP_BASE_API = 'https://wuyeapi.bugtc.com'
# VITE_APP_BASE_API = 'http://192.168.0.222:8080' # VITE_APP_BASE_API = 'http://192.168.0.222:8080'
# 登录成功跳转地址 # 登录成功跳转地址
VITE_LOGIN_BACK_URL = '/equipment/WaterDevice' # VITE_LOGIN_BACK_URL = '/equipment/WaterDevice'
VITE_LOGIN_BACK_URL = '/index'
# 工作台正式内容:false 假内容true
VITE_LOGIN_BACK_URL_WORKBENCH_TRUE= true
# 是否展示工作台 # 是否展示工作台
VITE_APP_SHOW_WORK_PLATFORM = false VITE_APP_SHOW_WORK_PLATFORM = true
# 地图类型 天地图 or 高德地图 天地图 WGS84 高德地图 GCJ02, 高德地图 需要在高德地图官网申请key # 地图类型 天地图 or 高德地图 天地图 WGS84 高德地图 GCJ02, 高德地图 需要在高德地图官网申请key
@@ -54,4 +57,4 @@ VITE_APP_CLIENT_ID = 'e5cd7e4891bf95d1d19206ce24a7b32e'
VITE_APP_WEBSOCKET = false VITE_APP_WEBSOCKET = false
# sse 开关 # sse 开关
VITE_APP_SSE = false VITE_APP_SSE = true

View File

@@ -8,7 +8,7 @@ import { PointVO, PointForm, PointQuery } from '@/api/system/InspectionPoint/typ
* @returns {*} * @returns {*}
*/ */
export const listPoint = (query?: PointQuery): AxiosPromise<PointVO[]> => { export const listPoint = (query?: PointQuery | {}): AxiosPromise<PointVO[]> => {
return request({ return request({
url: '/inspection/point/list', url: '/inspection/point/list',
method: 'get', method: 'get',

View File

@@ -61,3 +61,11 @@ export const delRoute = (id: string | number | Array<string | number>) => {
method: 'delete' method: 'delete'
}); });
}; };
export const changeStatusRoute = (id: string, status: string) => {
return request({
url: '/inspection/route/changeStatus',
method: 'put',
params: { id, status }
});
};

View File

@@ -1,17 +1,40 @@
import request from '@/utils/request'; import request from '@/utils/request';
import { AxiosPromise } from 'axios'; import { AxiosPromise } from 'axios';
import { NoticeVO, NoticeForm, NoticeQuery } from '@/api/system/NoticePc/type';
export interface NotificationVo {
'id': 'string';
'title': 'string';
'item': 'string';
'content': 'string';
'manageIsCheck': 'string';
'repairIsCheck': 'string';
}
/** /**
* 查询消息通知列表 * 查询消息通知列表
* @param query * @param query
* @returns {*} * @returns {*}
*/ */
export const getNotificationList = (query?: NoticeQuery): AxiosPromise<NoticeVO[]> => { export const getNotificationList = (query): AxiosPromise<NoticeVO[]> => {
return request({ return request({
url: '/notification/list', url: '/notification/list',
method: 'get', method: 'get',
params: query params: query
}); });
}; };
/**
* 消息通知 已读
* @param query
* @returns {*}
*/
export const ReadNotificationByID = (id: string) => {
return request({
url: '/notification/read',
method: 'POST',
data: {
id
}
});
};

View File

@@ -0,0 +1,27 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
/**
* 获取缴费方式,种类占比
* @param query
* @returns {*}
*/
export const income_statsApi = (
datetime?: string
): Promise<{
'totalResident': number;
'totalHouse': number;
'totalParking': number;
'totalDevice': number;
'totalMaterial': number;
'totalComplaint': number;
}> => {
return request({
url: '/api/analysis/income/stats',
method: 'get',
params: {
datetime: datetime
}
});
};

View File

@@ -0,0 +1,93 @@
import request from '@/utils/request';
import { AxiosPromise } from 'axios';
/**
* 查询入住情况
* @param query
* @returns {*}
*/
export const user_movein_list = (query?: {
datetime: string;
}): Promise<{
'totalResident': number;
'totalHouse': number;
'totalParking': number;
'totalDevice': number;
'totalMaterial': number;
'totalComplaint': number;
}> => {
return request({
url: '/workSpace/totalList',
method: 'get',
params: query
});
};
/**
* 查询居住人类型列表
* @param query
* @returns {*}
*/
export const get_movein_user_type = (query?: {
datetime: string;
}): Promise<{
'owner': string;
'ownerRate': string;
'tenant': string;
'tenantRate': string;
'relatives': string;
'relativeRate': string;
'other': string;
'otherRate': string;
'totalResident': string;
}> => {
return request({
url: '/residentType/selectTotal',
method: 'get',
params: query
});
};
/**
* 查询住户性别比例
* @param query
* @returns {*}
*/
export const get_movein_user_sex = (query?: {
datetime: string;
}): Promise<{
'man': number;
'woman': number;
'total': number;
'manRate': string;
'womanRate': string;
}> => {
return request({
url: '/gender/overview',
method: 'get',
params: query
});
};
/**
* 获取迁入迁出趋势图
* @param query
* @returns {*}
*/
export const get_movein_moveout_list = (query?: {
datetime: string;
}): Promise<
{
'date': string;
'inCount': number;
'outCount': number;
}[]
> => {
return request({
url: '/residentDailyStat/selectTotal',
method: 'get',
params: query
});
};

View File

@@ -22,7 +22,7 @@ export interface RepairVO {
/** /**
* 报修人id(住户表id) * 报修人id(住户表id)
*/ */
residentId: string | number; residentId: string;
/** /**
* 手机号码 * 手机号码
@@ -86,7 +86,7 @@ export interface RepairForm extends BaseEntity {
/** /**
* 报修人id(住户表id) * 报修人id(住户表id)
*/ */
residentId?: string | number; residentId?: string;
/** /**
* 手机号码 * 手机号码
@@ -163,7 +163,7 @@ export interface RepairQuery extends PageQuery {
/** /**
* 报修人id(住户表id) * 报修人id(住户表id)
*/ */
residentId?: string | number; residentId?: string;
/** /**
* 手机号码 * 手机号码

View File

@@ -106,3 +106,16 @@ export const queryResidentList_holder = (query: { pageNum: number; pageSize: num
params: query params: query
}); });
}; };
/**
* 查询车位业主列表
* @param data
* @returns {*}
*/
export const queryResidentList_Cars = (query: { pageNum: number; pageSize: number }): AxiosPromise<BillUserlist[]> => {
return request({
url: '/bill/getParkingList',
method: 'GET',
params: query
});
};

View File

@@ -13,6 +13,7 @@ export interface BillVO {
* 收费项目id * 收费项目id
*/ */
chargeItemId: string; chargeItemId: string;
residentIds: string[];
/** /**
* 收费范围 0全体业主 1部分业主 * 收费范围 0全体业主 1部分业主

View File

@@ -13,7 +13,7 @@ export type cashlist = {
* @param post * @param post
* @returns {*} * @returns {*}
*/ */
export const cashQuery = (data: { residentName?: string }): AxiosPromise<cashlist[]> => { export const cashQuery = (data: { residentName?: string; queryType: number }): AxiosPromise<cashlist[]> => {
return request({ return request({
url: '/cash/residentList', url: '/cash/residentList',
method: 'post', method: 'post',
@@ -38,6 +38,7 @@ export type billlistType = {
'endDate': string; 'endDate': string;
'money': string; 'money': string;
'payStatus': string; 'payStatus': string;
amount: string;
}; };
/** /**
* 查询账单列表 * 查询账单列表
@@ -51,3 +52,10 @@ export const billQuery = (data: { residentId?: string; payStatus: '0' | '1' }):
data: data data: data
}); });
}; };
export const billEdit = (data: { 'detailsId': string[]; 'payType': string; 'payStatus': string }): AxiosPromise<billlistType[]> => {
return request({
url: '/cash/billEdit',
method: 'post',
data: data
});
};

View File

@@ -8,7 +8,7 @@ import { ChargeItemVO, ChargeItemForm, ChargeItemQuery } from './type';
* @returns {*} * @returns {*}
*/ */
export const listChargeItem = (query?: ChargeItemQuery): AxiosPromise<ChargeItemVO[]> => { export const listChargeItem = (query?: ChargeItemQuery | {}): AxiosPromise<ChargeItemVO[]> => {
return request({ return request({
url: '/chargeItem/list', url: '/chargeItem/list',
method: 'get', method: 'get',

View File

@@ -61,3 +61,39 @@ export const delTopupRecord = (id: string | number | Array<string | number>) =>
method: 'delete' method: 'delete'
}); });
}; };
export type TopupRecordList = {
'id': string;
'rechargeTime': string;
'villageName': string;
'residentName': string;
'houseName': string;
'fixedPriceUnit': string;
'fixedPrice': string;
'unit': string;
'deviceCode': string;
'orderId': string;
'rechargeAmount': string;
'topUpType': string;
};
/** 查询所有设备充值记录 */
export const getTopupRecordByDate = (query: {
startTime?: string;
endTime?: string;
pageSize: number;
pageNum: number;
}): AxiosPromise<TopupRecordList[]> => {
return request({
url: '/topupRecord/water/list',
method: 'get',
params: query
});
};
/** 导出 所有设备的 充值记录 */
export const exportTopupRecordByDate = (query: { startTime?: string; endTime?: string }): AxiosPromise<TopupRecordList[]> => {
return request({
url: '/topupRecord/water/export',
method: 'get',
params: query
});
};

View File

@@ -8,7 +8,7 @@ import { AreaVO, AreaForm, AreaQuery } from '@/api/system/carArea/type';
* @returns {*} * @returns {*}
*/ */
export const listArea = (query?: AreaQuery): AxiosPromise<AreaVO[]> => { export const listArea = (query: AreaQuery | {} = {}): AxiosPromise<AreaVO[]> => {
return request({ return request({
url: '/area/list', url: '/area/list',
method: 'get', method: 'get',

View File

@@ -2,17 +2,17 @@ export interface CarVO {
/** /**
* 车辆管理表id * 车辆管理表id
*/ */
id: string | number; id: string;
/** /**
* 区域id * 区域id
*/ */
areaId: string | number; areaId: string;
/** /**
* 车位id * 车位id
*/ */
parkingId: string | number; parkingId: string;
/** /**
* 持有人id(住户表id) * 持有人id(住户表id)

View File

@@ -13,10 +13,11 @@ export function getBuildinglistAPI(): AxiosPromise<BuildingVo[]> {
}); });
} }
/** 获取所有楼栋 */ /** 获取所有楼栋 */
export function getBuildinglists(): AxiosPromise<BuildingVo[]> { export function getBuildinglists(query = {}): AxiosPromise<BuildingVo[]> {
return request({ return request({
url: '/building/list', url: '/building/list',
method: 'get' method: 'get',
params: query
}); });
} }
/** 获取单一楼栋 */ /** 获取单一楼栋 */
@@ -162,6 +163,8 @@ export interface Storeroom {
shareArea: string; shareArea: string;
storeroomId: number; storeroomId: number;
storeroomNo: string; storeroomNo: string;
remark: string;
unitNoId: string;
unitNo: number; unitNo: number;
} }

View File

@@ -81,3 +81,9 @@ export const uploadHouseImage = (formdata: FormData): AxiosPromise<uploadHouseIm
data: formdata data: formdata
}); });
}; };
export const getHouseOwnUser = (houseId: string): AxiosPromise<uploadHouseImagetype> => {
return request({
url: `/houseRental/ownerName/${houseId}`,
method: 'GET'
});
};

View File

@@ -15,6 +15,13 @@ export const listHouseUseType = (query?: HouseUseTypeQuery): AxiosPromise<HouseU
params: query params: query
}); });
}; };
export const listHouseUseType_add_house = (query?: HouseUseTypeQuery): AxiosPromise<HouseUseTypeVO[]> => {
return request({
url: '/houseUseType/getList',
method: 'get',
params: query
});
};
/** /**
* 查询房屋类型详细 * 查询房屋类型详细

View File

@@ -90,9 +90,12 @@ export interface ResidentForm extends BaseEntity {
name?: string; name?: string;
/** /**
* 0业主 1租户 * 0业主
* 1亲属
* 2租户
* 3朋友
*/ */
type?: string; ownerRelationship?: string;
/** /**
* 0 男性 1女性 * 0 男性 1女性
@@ -152,10 +155,12 @@ export interface ResidentQuery extends PageQuery {
date?: any; date?: any;
/** /**
* 住户类型 * 0业主
* 0业主 1租户 * 1亲属
* 2租户
* 3朋友
*/ */
type?: string; ownerRelationship?: string;
/** /**
* 住户状态 * 住户状态
* 0审核中 1 已认证 * 0审核中 1 已认证
@@ -165,5 +170,5 @@ export interface ResidentQuery extends PageQuery {
houseId?: number; houseId?: number;
villageId?: string; villageId?: string;
buildingId?: number; buildingId?: number;
unitNo?: number; unitNoId?: number;
} }

View File

@@ -68,11 +68,11 @@ export const delStoreroom = (id: string | number | Array<string | number>) => {
*/ */
export const GetVillagelistStoreroom = ( export const GetVillagelistStoreroom = (
data: { villageid: string; unitNo: string; houseId?: string; buildingId: string } = { data: { villageid: string; unitNoId: string; houseId?: string; buildingId: string } = {
villageid: null, villageid: null,
buildingId: null, buildingId: null,
houseId: null, houseId: null,
unitNo: null unitNoId: null
} }
): AxiosPromise<StoreroomVO[]> => { ): AxiosPromise<StoreroomVO[]> => {
return request({ return request({
@@ -81,7 +81,7 @@ export const GetVillagelistStoreroom = (
data: { data: {
villageId: data.villageid, villageId: data.villageid,
buildingId: data.buildingId, buildingId: data.buildingId,
unitNo: data.unitNo, unitNoId: data.unitNoId,
houseId: data.houseId houseId: data.houseId
} }
}); });

View File

@@ -12,7 +12,8 @@ export interface StoreroomVO {
/** /**
* 单元号 * 单元号
*/ */
unitNo: string | number; unitNoId: string | number;
unitName: string;
/** /**
* 储藏室号 * 储藏室号

View File

@@ -259,3 +259,31 @@ aside {
.el-button { .el-button {
border-radius: 5px; border-radius: 5px;
} }
.bgColor {
width: 850px;
height: 850px;
background: #fdf1ee;
filter: blur(200px);
display: block;
position: absolute;
top: 0;
right: 0;
transform: translateY(-50%) translateX(0%);
pointer-events: none;
z-index: 1;
border-radius: 50%;
@media (max-width: 1540px) {
width: 800px;
height: 400px;
}
@media (max-width: 1280px) {
width: 600px;
height: 300px;
}
@media (max-width: 1030px) {
width: 400px;
height: 200px;
}
}

View File

@@ -11,6 +11,7 @@
position: relative; position: relative;
overflow-x: hidden; overflow-x: hidden;
background: var(--el-bg-color-page); background: var(--el-bg-color-page);
background: #dfedff;
} }
.sidebarHide { .sidebarHide {

View File

@@ -0,0 +1,294 @@
<template>
<slot name="default" />
<el-dialog append-to-body v-model="dialog.dialogVisible" :title="dialog.dialogTitle" width="1050">
<el-table ref="multipleTableRef" :data="tableData" border @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" width="55" type="index" />
<el-table-column label="业主" align="center">
<template #default="scope">
<span>{{ scope.row.residentName ? scope.row.residentName : '---' }}</span>
</template>
</el-table-column>
<el-table-column label="性别" align="center">
<template #default="scope">
<dict-tag :options="sys_user_sex" :value="scope.row.gender"></dict-tag>
</template>
</el-table-column>
<el-table-column label="手机号" align="center" prop="phone" />
<el-table-column label="车位" align="center" prop="parkingName" />
</el-table>
<template #footer>
<div class="dialog-footer flex flex-items-center flex-justify-between">
<pagination
style="margin-top: 0"
layout="total, prev, pager, next, jumper"
v-show="total > 0"
:total="total"
v-model:page="queryParams.pageNum"
v-model:limit="queryParams.pageSize"
@pagination="getlist"
/>
<div>
<el-button @click="conback">退出</el-button>
<el-button type="primary" @click="confirm"> 确定 </el-button>
</div>
</div>
</template>
</el-dialog>
</template>
<script setup lang="ts">
import { getBuildinglistAPI, getHouselistAPI } from '@/api/system/house';
import { BillUserlist, queryResidentList_Cars, queryResidentList_holder } from '@/api/system/SdbBill';
import { ref, nextTick, getCurrentInstance, ComponentInternalInstance, toRefs } from 'vue';
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { sys_user_sex } = toRefs<any>(proxy?.useDict('sys_user_sex'));
const props = defineProps({
returnvalue: {
type: String,
default: 'parkingId'
},
titleName: {
type: String,
default: '选择业主'
},
/** 是否多选 false 单选 */
isMultiple: {
type: Boolean,
default: false
}
});
const { titleName, returnvalue } = toRefs(props);
const userid = ref([]);
// ✅ 手动设置默认值(替代 withDefaults
const emit = defineEmits<{
change: [value: string | number | (string | number)[] | BillUserlist | BillUserlist[]]; // 支持返回数组
}>();
const dialog = ref({
dialogVisible: false,
dialogTitle: titleName.value
});
const queryParams = ref({
pageNum: 1,
pageSize: 10
});
const multipleTableRef = ref();
const tableData = ref<BillUserlist[]>([]);
const total = ref(0);
const loading = ref(false);
const isFetching = ref(false);
// 存储选中项
const multipleSelection = ref<BillUserlist[]>([]);
const isMultiple = computed(() => props.isMultiple ?? false);
// 优化 handleUserSelection避免重复查找
const handleUserSelection = () => {
isFetching.value = true;
if (!multipleTableRef.value || !tableData.value.length) {
isFetching.value = false;
return;
}
const rowsToSelect = tableData.value.filter((row) => {
return multipleSelection.value.some((selected) => selected.parkingId === row.parkingId);
});
multipleTableRef.value.clearSelection();
if (rowsToSelect.length > 0) {
nextTick(() => {
rowsToSelect.forEach((row) => {
multipleTableRef.value?.toggleRowSelection(row, true);
});
isFetching.value = false;
});
} else {
isFetching.value = false;
}
};
// ====================== 方法 ======================
// 获取列表
function getlist() {
isFetching.value = true; // 加锁
loading.value = true;
queryResidentList_Cars(queryParams.value)
.then((res) => {
tableData.value = res.rows;
total.value = res.total;
handleUserSelection();
})
.catch((error) => {
console.error('获取用户列表失败:', error);
})
.finally(() => {
loading.value = false;
isFetching.value = false; // 加锁
});
}
/** 楼栋列表 */
const buildinglist = ref([]);
/** 房屋列表 */
const unitlist = ref([]);
/** 筛选房屋类型 */
function handleChangeHouse(val: string) {
getBuildinglistAPI().then((res) => {
buildinglist.value = res.data;
});
}
/** 单元列表 */
function handleChangebuilding(val: string) {
getHouselistAPI(val).then((res) => {
unitlist.value = res.data.units;
});
}
// ==============================================
// ✅ 新增:处理 selection-change多选专用
// ==============================================
function handleSelectionChange(selection: BillUserlist[]) {
if (isFetching.value) return;
if (isMultiple.value) {
const currentSelectedIds = new Set(selection.map((item) => item.parkingId));
const otherPageSelections = multipleSelection.value.filter((item) => {
const isCurrentPageItem = tableData.value.some((row) => row.parkingId === item.parkingId);
if (isCurrentPageItem) {
return currentSelectedIds.has(item.parkingId);
} else {
return true;
}
});
// 3. 合并:其他页保留的 + 当前页新选中的
const finalSelection = [...otherPageSelections, ...selection];
// 4. 去重(以防万一)
const uniqueMap = new Map();
finalSelection.forEach((item) => uniqueMap.set(item.parkingId, item));
multipleSelection.value = Array.from(uniqueMap.values());
console.log(multipleSelection.value.map((item) => item.parkingId));
} else {
// --- 单选逻辑 ---
if (selection.length > 0) {
multipleSelection.value = [selection[selection.length - 1]];
} else {
multipleSelection.value = [];
}
}
}
// ==============================================
// 最佳单选方案:点击行选中,无报错、无循环、最稳定
// ==============================================
// 优化 handleRowClick避免重复
function handleRowClick(row: BillUserlist) {
if (!multipleTableRef.value) return;
if (isMultiple.value) {
const index = multipleSelection.value.findIndex((item) => item.parkingId === row.parkingId);
if (index > -1) {
// 取消选中
multipleSelection.value.splice(index, 1);
multipleTableRef.value?.toggleRowSelection(row, false);
} else {
// 选中
multipleSelection.value.push(row);
multipleTableRef.value?.toggleRowSelection(row, true);
}
} else {
// 【单选模式】先清空,再选中当前行
multipleSelection.value = [];
multipleTableRef.value.clearSelection();
multipleSelection.value = [row];
multipleTableRef.value.toggleRowSelection(row, true);
}
}
// 重置查询
function resetQuery() {
queryParams.value = {
pageNum: 1,
pageSize: 10
};
getlist();
}
// 退出
function conback() {
dialog.value.dialogVisible = false;
resetQuery();
}
// ==============================================
// ✅ 核心修改:根据 returnvalue 返回对应的值
// ==============================================
function confirm() {
dialog.value.dialogVisible = false;
if (isMultiple.value) {
// 多选
if (returnvalue.value === '*') {
// ✅ 返回整个对象数组
emit('change', multipleSelection.value);
} else {
// 返回指定字段数组
emit(
'change',
multipleSelection.value.map((item) => item[returnvalue.value as keyof BillUserlist])
);
}
} else {
// 单选
if (returnvalue.value === '*') {
// ✅ 返回整个对象
emit('change', multipleSelection.value[0]);
} else {
// 返回指定字段
emit('change', multipleSelection.value[0][returnvalue.value as keyof BillUserlist]);
}
}
multipleSelection.value = [];
multipleTableRef.value.clearSelection();
}
defineExpose({
open: (arr: string[] = []) => {
userid.value = arr;
if (arr && arr.length > 0) {
multipleSelection.value = arr.map((id) => ({
parkingId: id
}));
console.log(multipleSelection.value);
} else {
multipleSelection.value = [];
}
getlist();
dialog.value.dialogVisible = true;
}
});
</script>
<style scoped lang="scss">
.residentBox {
width: 385px;
height: 35px;
line-height: 35px;
border: 1px solid #ccc;
border-radius: 5px;
padding: 0 10px;
.defaultbox {
display: flex;
align-items: center;
justify-content: space-between;
}
cursor: pointer;
&:hover {
background-color: #f4f8ff;
}
}
</style>

View File

@@ -1,8 +1,8 @@
<template> <template>
<slot name="default" /> <slot name="default" />
<el-dialog append-to-body v-model="dialog.dialogVisible" :title="dialog.dialogTitle" width="1250"> <el-dialog append-to-body v-model="dialog.dialogVisible" :title="dialog.dialogTitle" width="1400">
<nav class="flex flex-items-center mb-8"> <nav class="flex flex-items-center mb-8 justify-between">
<!-- <div class="flex flex-items-center"> <!-- <div class="flex flex-items-center">
<div style="width: 70px; text-align: right; padding-right: 10px">房屋类型</div> <div style="width: 70px; text-align: right; padding-right: 10px">房屋类型</div>
<div class="flex-1"> <div class="flex-1">
@@ -11,17 +11,18 @@
</el-select> </el-select>
</div> </div>
</div> --> </div> -->
<div class="flex flex-items-center">
<div class="flex flex-items-center"> <div class="flex flex-items-center">
<div style="width: 50px; text-align: right; padding-right: 10px">楼栋</div> <div style="width: 50px; text-align: right; padding-right: 10px">楼栋</div>
<div class="flex-1"></div> <div class="flex-1"></div>
<el-select @change="handleChangebuilding" clearable style="width: 140px" v-model="queryParams.buildingId"> <el-select @change="handleChangebuilding" clearable style="width: 120px" v-model="queryParams.buildingId">
<el-option v-for="(item, index) in buildinglist" :key="index" :label="item.buildingName" :value="item.id"></el-option> <el-option v-for="(item, index) in buildinglist" :key="index" :label="item.buildingName" :value="item.id"></el-option>
</el-select> </el-select>
</div> </div>
<div class="flex flex-items-center mr-20px"> <div class="flex flex-items-center mr-20px">
<div style="width: 50px; text-align: right; padding-right: 10px">单元</div> <div style="width: 50px; text-align: right; padding-right: 10px">单元</div>
<div class="flex-1"> <div class="flex-1">
<el-select @change="handleChangeUnit" clearable style="width: 140px" v-model="queryParams.unitNoId"> <el-select @change="handleChangeUnit" clearable style="width: 120px" v-model="queryParams.unitNoId">
<el-option v-for="(item, index) in unitlist" :key="index" :label="item.unitNoName" :value="item.unitNoId"></el-option> <el-option v-for="(item, index) in unitlist" :key="index" :label="item.unitNoName" :value="item.unitNoId"></el-option>
</el-select> </el-select>
</div> </div>
@@ -29,15 +30,22 @@
<div class="flex flex-items-center mr-20px"> <div class="flex flex-items-center mr-20px">
<div style="width: 80px; text-align: right; padding-right: 10px">房屋类型</div> <div style="width: 80px; text-align: right; padding-right: 10px">房屋类型</div>
<div class="flex-1"> <div class="flex-1">
<el-select clearable @change="handleHouseUseChange" style="width: 140px" v-model="queryParams.houseUseTypeId"> <el-select clearable @change="handleHouseUseChange" style="width: 120px" v-model="queryParams.houseUseTypeId">
<el-option v-for="(item, index) in houseUseTypeList" :key="index" :label="item.name" :value="item.id"></el-option> <el-option v-for="(item, index) in houseUseTypeList" :key="index" :label="item.name" :value="item.id"></el-option>
</el-select> </el-select>
</div> </div>
</div> </div>
<div class="flex flex-items-center mr-20px">
<div style="width: 60px; text-align: right; padding-right: 10px">房屋号</div>
<div class="flex-1">
<el-input clearable @clear="handleClear" style="width: 120px" v-model="queryParams.houseNo" placeholder="请输入房屋号"></el-input>
</div>
</div>
<div class="flex flex-items-center mr-20px"> <div class="flex flex-items-center mr-20px">
<div style="width: 80px; text-align: right; padding-right: 10px">业主名称</div> <div style="width: 80px; text-align: right; padding-right: 10px">业主名称</div>
<div class="flex-1"> <div class="flex-1">
<el-input clearable @clear="handleClear" v-model="queryParams.residentName" placeholder="查找业主"></el-input> <el-input clearable @clear="handleClear" style="width: 120px" v-model="queryParams.residentName" placeholder="请输入业主名称"></el-input>
</div>
</div> </div>
</div> </div>
<div> <div>
@@ -45,14 +53,7 @@
<el-button @click="resetQuery">重置</el-button> <el-button @click="resetQuery">重置</el-button>
</div> </div>
</nav> </nav>
<el-table <el-table row-key="houseId" v-loading="loading" ref="multipleTableRef" :data="tableData" border @selection-change="handleSelectionChange">
v-loading="loading"
@row-click="handleRowClick"
ref="multipleTableRef"
:data="tableData"
border
@selection-change="handleSelectionChange"
>
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" width="55" type="index" /> <el-table-column label="序号" align="center" width="55" type="index" />
<el-table-column label="小区" align="center" prop="villageName" /> <el-table-column label="小区" align="center" prop="villageName" />
@@ -87,7 +88,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { getBuildinglistAPI, getBuildingOnly, getHouselistAPI } from '@/api/system/house'; import { getBuildinglistAPI, getBuildingOnly, getHouselistAPI } from '@/api/system/house';
import { listHouseUseType } from '@/api/system/houseUse'; import { listHouseUseType, listHouseUseType_add_house } from '@/api/system/houseUse';
import { BillHouse, listBillHouse } from '@/api/system/SdbBill'; import { BillHouse, listBillHouse } from '@/api/system/SdbBill';
import { ref, watch, nextTick, getCurrentInstance, ComponentInternalInstance, toRefs } from 'vue'; import { ref, watch, nextTick, getCurrentInstance, ComponentInternalInstance, toRefs } from 'vue';
@@ -128,7 +129,7 @@ const dialog = ref({
const queryParams = ref({ const queryParams = ref({
pageNum: 1, pageNum: 1,
pageSize: 10, pageSize: 10,
// houseUseTypeId: null, houseNo: '',
buildingId: null, buildingId: null,
unitNoId: null, unitNoId: null,
houseUseTypeId: null, houseUseTypeId: null,
@@ -147,29 +148,35 @@ const isMultiple = computed(() => props.isMultiple ?? false);
// 优化 handleUserSelection避免重复查找 // 优化 handleUserSelection避免重复查找
const handleUserSelection = () => { const handleUserSelection = () => {
if (!tableData.value.length) return; isFetching.value = true;
multipleSelection.value = []; if (!multipleTableRef.value || !tableData.value.length) {
if (showids.value.length > 0) { isFetching.value = false;
const arr = showids.value; return;
arr.forEach((item) => {
const target = tableData.value.find((row) => row.houseId == item);
target && multipleSelection.value.push(target);
});
nextTick(() => {
if (multipleTableRef.value) {
multipleTableRef.value.clearSelection();
multipleSelection.value.forEach((item) => {
multipleTableRef.value.toggleRowSelection(item, true);
});
} }
// 1. 获取当前页所有行的 houseId 集合,用于快速判断
// const currentPageIds = new Set(tableData.value.map((item) => item.houseId));
const rowsToSelect = tableData.value.filter((row) => {
return multipleSelection.value.some((selected) => selected.houseId === row.houseId);
}); });
multipleTableRef.value.clearSelection();
if (rowsToSelect.length > 0) {
nextTick(() => {
rowsToSelect.forEach((row) => {
multipleTableRef.value?.toggleRowSelection(row, true);
});
isFetching.value = false;
});
} else {
isFetching.value = false;
} }
}; };
// ====================== 方法 ====================== // ====================== 方法 ======================
const houseUseTypeList = ref([]); const houseUseTypeList = ref([]);
const isFetching = ref(false);
// 获取列表 // 获取列表
function getlist() { function getlist() {
isFetching.value = true; // 🔒 加锁:禁止 selection-change 更新数据
loading.value = true; loading.value = true;
listBillHouse(queryParams.value) listBillHouse(queryParams.value)
.then((res) => { .then((res) => {
@@ -182,6 +189,7 @@ function getlist() {
}) })
.finally(() => { .finally(() => {
loading.value = false; loading.value = false;
isFetching.value = false;
}); });
} }
@@ -225,34 +233,37 @@ function handleChangeUnit() {
// ✅ 新增:处理 selection-change多选专用 // ✅ 新增:处理 selection-change多选专用
// ============================================== // ==============================================
function handleSelectionChange(selection: BillHouse[]) { function handleSelectionChange(selection: BillHouse[]) {
// 🛑 如果正在获取数据/恢复状态,直接返回,不要更新 multipleSelection
if (isFetching.value) return;
if (isMultiple.value) { if (isMultiple.value) {
multipleSelection.value = selection; // 1. 获取当前表格中所有选中行的 ID
} const currentSelectedIds = new Set(selection.map((item) => item.houseId));
} const otherPageSelections = multipleSelection.value.filter((item) => {
// ============================================== // 判断 item 是否属于当前页
// 最佳单选方案:点击行选中,无报错、无循环、最稳定 const isCurrentPageItem = tableData.value.some((row) => row.houseId === item.houseId);
// ============================================== if (isCurrentPageItem) {
// 优化 handleRowClick避免重复 // 如果是当前页的数据,检查是否在当前 selection 中
function handleRowClick(row: BillHouse) { return currentSelectedIds.has(item.houseId);
if (!multipleTableRef.value) return;
if (isMultiple.value) {
const index = multipleSelection.value.findIndex((item) => item.houseId === row.houseId);
if (index > -1) {
// 取消选中
multipleSelection.value.splice(index, 1);
multipleTableRef.value?.toggleRowSelection(row, false);
} else { } else {
// 选中 // 如果不是当前页的数据,保留(假设是之前页选的)
multipleSelection.value.push(row); return true;
multipleTableRef.value?.toggleRowSelection(row, true);
} }
});
// 去重合并
const finalSelection = [...otherPageSelections, ...selection];
// 再次去重以防万一
const uniqueMap = new Map();
finalSelection.forEach((item) => uniqueMap.set(item.houseId, item));
multipleSelection.value = Array.from(uniqueMap.values());
console.log(multipleSelection.value.map((item) => item.houseId));
} else {
// ✅ 补充单选模式下selection-change 触发时,直接取最新的一项
// 这样配合 handleRowClick 的 clearSelection + toggle 就能实现完美单选
if (selection.length > 0) {
multipleSelection.value = [selection[selection.length - 1]];
} else { } else {
// 【单选模式】先清空,再选中当前行
multipleSelection.value = []; multipleSelection.value = [];
multipleTableRef.value.clearSelection(); }
multipleSelection.value = [row];
multipleTableRef.value.toggleRowSelection(row, true);
} }
} }
// 重置查询 // 重置查询
@@ -263,6 +274,7 @@ function resetQuery() {
houseUseTypeId: null, houseUseTypeId: null,
buildingId: null, buildingId: null,
unitNoId: null, unitNoId: null,
houseNo: '',
residentName: '' residentName: ''
}; };
getlist(); getlist();
@@ -308,15 +320,20 @@ function confirm() {
defineExpose({ defineExpose({
open: (showidArray: string[] = []) => { open: (showidArray: string[] = []) => {
multipleSelection.value = [];
showids.value = showidArray; showids.value = showidArray;
if (showidArray && showidArray.length > 0) {
multipleSelection.value = showidArray.map(
(id) =>
({
houseId: id
}) as BillHouse
);
}
getlist(); getlist();
dialog.value.dialogVisible = true; dialog.value.dialogVisible = true;
listHouseUseType_add_house().then((res) => {
listHouseUseType({ houseUseTypeList.value = res.data;
pageNum: 1,
pageSize: 99999
}).then((res) => {
houseUseTypeList.value = res.rows;
}); });
handleChangeHouse(); handleChangeHouse();
} }

View File

@@ -28,8 +28,7 @@
</div> </div>
</nav> </nav>
<!-- 关键去掉 @selection-change改用 row-click 实现单选永不报错 --> <el-table ref="multipleTableRef" row-key="id" :data="tableData" border @selection-change="handleSelectionChange">
<el-table ref="multipleTableRef" :data="tableData" border @row-click="handleRowClick" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" width="55" type="index" /> <el-table-column label="序号" align="center" width="55" type="index" />
<el-table-column label="姓名" align="center" prop="name" /> <el-table-column label="姓名" align="center" prop="name" />
@@ -38,6 +37,11 @@
<dict-tag :options="com_resident_type" :value="row.type" /> <dict-tag :options="com_resident_type" :value="row.type" />
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="与业主关系" align="center" width="95" prop="ownerRelationship">
<template #default="{ row }">
<dict-tag :options="com_resident_relationship" :value="row.ownerRelationship" />
</template>
</el-table-column>
<el-table-column label="状态" align="center" width="85" prop="status"> <el-table-column label="状态" align="center" width="85" prop="status">
<template #default="{ row }"> <template #default="{ row }">
<dict-tag :options="com_certification_status" :value="row.status" /> <dict-tag :options="com_certification_status" :value="row.status" />
@@ -111,7 +115,7 @@ const props = defineProps<{
// ✅ 手动设置默认值(替代 withDefaults // ✅ 手动设置默认值(替代 withDefaults
const isMultiple = computed(() => props.isMultiple ?? false); const isMultiple = computed(() => props.isMultiple ?? false);
const returnvalue = computed(() => props.returnvalue ?? 'id'); // 👈 默认 userId const returnvalue = computed(() => props.returnvalue ?? '*'); // 👈 默认 userId
const { userid } = toRefs(props); const { userid } = toRefs(props);
@@ -140,50 +144,68 @@ const total = ref(0);
const loading = ref(false); const loading = ref(false);
// ============================================== // ==============================================
// ✅ 新增:处理 selection-change(多选专用) // ✅ 优化:处理 selection-change
// ============================================== // ==============================================
function handleSelectionChange(selection: tableType[]) { function handleSelectionChange(selection: tableType[]) {
if (isMultiple.value) { if (isMultiple.value) {
multipleSelection.value = selection; // 多选逻辑:合并当前页选中项和之前页选中项
} const currentSelectedIds = new Set(selection.map((item) => item.id));
}
// ============================================== // 过滤掉当前页未选中的旧数据
// 最佳单选方案:点击行选中,无报错、无循环、最稳定 const otherPageSelections = multipleSelection.value.filter((item) => {
// ============================================== const isCurrentPageItem = tableData.value.some((row) => row.id === item.id);
function handleRowClick(row) { if (isCurrentPageItem) {
if (isMultiple.value) { return currentSelectedIds.has(item.id);
// 多选:点击行切换选中状态
const isSelected = multipleSelection.value.some((item) => item.id === row.id);
if (isSelected) {
multipleSelection.value = multipleSelection.value.filter((item) => item.id !== row.id);
multipleTableRef.value?.toggleRowSelection(row, false);
} else {
multipleSelection.value.push(row);
multipleTableRef.value?.toggleRowSelection(row, true);
} }
return true; // 保留其他页的数据
});
// 合并当前页新选中的数据
const finalSelection = [...otherPageSelections, ...selection];
// 去重
const uniqueMap = new Map();
finalSelection.forEach((item) => uniqueMap.set(item.id, item));
multipleSelection.value = Array.from(uniqueMap.values());
} else { } else {
// 单选:原有逻辑保持不变 // 单选逻辑:始终只保留最后一个选中的项
if (selection.length > 0) {
// 获取最后选中的那一项
const lastSelected = selection[selection.length - 1];
multipleSelection.value = [lastSelected];
// 关键:如果 selection 长度大于1比如之前选了一个现在又选一个el-table可能暂时上报两个
// 我们需要手动清除表格中其他的勾选状态,只保留最后一个
nextTick(() => {
if (selection.length > 1) {
multipleTableRef.value?.clearSelection(); multipleTableRef.value?.clearSelection();
multipleTableRef.value?.toggleRowSelection(row, true); multipleTableRef.value?.toggleRowSelection(lastSelected, true);
multipleSelection.value = [row]; }
});
} else {
multipleSelection.value = [];
}
} }
} }
// ============================================== // ==============================================
// ✅ 修改:支持多选回显 // ✅ 优化:回显逻辑
// ============================================== // ==============================================
const handleUserSelection = () => { const handleUserSelection = () => {
if (!userid.value || !tableData.value.length) return; if (!multipleTableRef.value) return;
// 先清空所有选择
multipleTableRef.value.clearSelection();
multipleSelection.value = [];
if (!props.userid && props.userid !== 0) return;
nextTick(() => { nextTick(() => {
multipleTableRef.value?.clearSelection(); if (isMultiple.value && Array.isArray(props.userid)) {
if (isMultiple.value && Array.isArray(userid.value)) {
// 多选回显 // 多选回显
const selectedItems: tableType[] = []; const selectedItems: tableType[] = [];
userid.value.forEach((id) => { props.userid.forEach((id) => {
const findItem = tableData.value.find((item) => item.userId == id); const findItem = tableData.value.find((item) => item.id == id || item.userId == id);
if (findItem) { if (findItem) {
selectedItems.push(findItem); selectedItems.push(findItem);
multipleTableRef.value?.toggleRowSelection(findItem, true); multipleTableRef.value?.toggleRowSelection(findItem, true);
@@ -191,28 +213,32 @@ const handleUserSelection = () => {
}); });
multipleSelection.value = selectedItems; multipleSelection.value = selectedItems;
} else { } else {
// 单选回显(原有逻辑) // 单选回显
const findItem = tableData.value.find((item) => item.id == userid.value); // 注意props.userid 可能是单个 ID
const targetId = Array.isArray(props.userid) ? props.userid[0] : props.userid;
const findItem = tableData.value.find((item) => item.id == targetId || item.userId == targetId);
if (findItem) { if (findItem) {
multipleSelection.value = [findItem];
multipleTableRef.value?.toggleRowSelection(findItem, true); multipleTableRef.value?.toggleRowSelection(findItem, true);
multipleSelection.value = [findItem];
} }
} }
}); });
}; };
watch(userid, handleUserSelection, { immediate: true });
watch(tableData, handleUserSelection);
// 打开选择框 // 打开选择框
function choiceResidentFun() { function choiceResidentFun() {
// 初始化
getlist();
dialog.value.dialogVisible = true; dialog.value.dialogVisible = true;
} }
// 获取列表 // 获取列表
function getlist() { function getlist() {
console.log('getlist');
console.log(props.isMultiple);
loading.value = true; loading.value = true;
listResident(queryParams.value).then((res) => { listResident(queryParams.value)
.then((res) => {
tableData.value = res.rows; tableData.value = res.rows;
tableData.value.forEach((item) => { tableData.value.forEach((item) => {
if (item.houseId !== null) { if (item.houseId !== null) {
@@ -220,7 +246,10 @@ function getlist() {
item.housePath = houselist?.join('-') || ''; item.housePath = houselist?.join('-') || '';
} }
}); });
handleUserSelection();
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
}); });
} }
@@ -268,6 +297,7 @@ function confirm() {
} }
} else { } else {
// 单选 // 单选
console.log(multipleSelection.value[0], multipleSelection.value);
if (returnvalue.value === '*') { if (returnvalue.value === '*') {
// ✅ 返回整个对象 // ✅ 返回整个对象
emit('change', multipleSelection.value[0]); emit('change', multipleSelection.value[0]);
@@ -276,13 +306,22 @@ function confirm() {
emit('change', multipleSelection.value[0][returnvalue.value as keyof tableType]); emit('change', multipleSelection.value[0][returnvalue.value as keyof tableType]);
} }
} }
} else {
emit('change', null);
} }
} }
// 初始化
getlist();
defineExpose({ defineExpose({
open: () => { open: (arr) => {
if (arr && arr.length > 0) {
multipleSelection.value = arr.map((id) => ({
id: id
}));
console.log(multipleSelection.value);
} else {
multipleSelection.value = [];
}
getlist();
dialog.value.dialogVisible = true; dialog.value.dialogVisible = true;
} }
}); });

View File

@@ -2,12 +2,12 @@
<slot v-if="$slots.default" /> <slot v-if="$slots.default" />
<div v-else class="residentBox" @click="choiceResidentFun"> <div v-else class="residentBox" @click="choiceResidentFun">
<div class="defaultbox" v-if="multipleSelection.length === 0"> <div class="defaultbox" v-if="multipleSelection.length === 0 || props.username === ''">
<span>请选择</span> <span>请选择</span>
<el-icon><Search /></el-icon> <el-icon><Search /></el-icon>
</div> </div>
<div v-else class="overflow-auto overflow-hidden w-full text-ellipsis text-nowrap"> <div v-else class="overflow-auto overflow-hidden w-full text-ellipsis text-nowrap">
<span>姓名{{ multipleSelection[0]?.name }}</span> <span>姓名{{ multipleSelection[0]?.name ?? props.username }}</span>
</div> </div>
</div> </div>
@@ -80,6 +80,10 @@ const props = defineProps({
type: String, type: String,
default: '' default: ''
}, },
username: {
type: String,
default: ''
},
returnvalue: { returnvalue: {
type: String, type: String,
default: 'id' default: 'id'
@@ -160,6 +164,7 @@ const handleUserSelection = () => {
// 打开选择框 // 打开选择框
function choiceResidentFun() { function choiceResidentFun() {
dialog.value.dialogVisible = true; dialog.value.dialogVisible = true;
handleUserSelection();
} }
// 获取列表 // 获取列表

View File

@@ -1,7 +1,7 @@
<template> <template>
<slot name="default" /> <slot name="default" />
<el-dialog append-to-body v-model="dialog.dialogVisible" :title="dialog.dialogTitle" width="1050"> <el-dialog append-to-body v-model="dialog.dialogVisible" :title="dialog.dialogTitle" width="1050">
<el-table @row-click="handleRowClick" ref="multipleTableRef" :data="tableData" border @selection-change="handleSelectionChange"> <el-table ref="multipleTableRef" :data="tableData" border @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="序号" align="center" width="55" type="index" /> <el-table-column label="序号" align="center" width="55" type="index" />
<el-table-column label="业主" align="center"> <el-table-column label="业主" align="center">
@@ -49,7 +49,7 @@ const { sys_user_sex } = toRefs<any>(proxy?.useDict('sys_user_sex'));
const props = defineProps({ const props = defineProps({
returnvalue: { returnvalue: {
type: String, type: String,
default: 'houseId' default: 'residentId'
}, },
titleName: { titleName: {
type: String, type: String,
@@ -84,7 +84,7 @@ const multipleTableRef = ref();
const tableData = ref<BillUserlist[]>([]); const tableData = ref<BillUserlist[]>([]);
const total = ref(0); const total = ref(0);
const loading = ref(false); const loading = ref(false);
const isFetching = ref(false);
// 存储选中项 // 存储选中项
const multipleSelection = ref<BillUserlist[]>([]); const multipleSelection = ref<BillUserlist[]>([]);
@@ -92,29 +92,32 @@ const isMultiple = computed(() => props.isMultiple ?? false);
// 优化 handleUserSelection避免重复查找 // 优化 handleUserSelection避免重复查找
const handleUserSelection = () => { const handleUserSelection = () => {
if (!tableData.value.length) return; isFetching.value = true;
if (!multipleTableRef.value || !tableData.value.length) {
multipleSelection.value = []; isFetching.value = false;
const arr = userid.value; return;
if (!arr.length) return;
arr.forEach((item) => {
const target = tableData.value.find((row) => row.residentId == item);
target && multipleSelection.value.push(target);
});
nextTick(() => {
if (multipleTableRef.value) {
multipleTableRef.value.clearSelection();
multipleSelection.value.forEach((item) => {
multipleTableRef.value.toggleRowSelection(item, true);
});
} }
const rowsToSelect = tableData.value.filter((row) => {
return multipleSelection.value.some((selected) => selected.residentId === row.residentId);
}); });
multipleTableRef.value.clearSelection();
if (rowsToSelect.length > 0) {
nextTick(() => {
rowsToSelect.forEach((row) => {
multipleTableRef.value?.toggleRowSelection(row, true);
});
isFetching.value = false;
});
} else {
isFetching.value = false;
}
}; };
// ====================== 方法 ====================== // ====================== 方法 ======================
// 获取列表 // 获取列表
function getlist() { function getlist() {
isFetching.value = true; // 加锁
loading.value = true; loading.value = true;
queryResidentList_holder(queryParams.value) queryResidentList_holder(queryParams.value)
.then((res) => { .then((res) => {
@@ -127,6 +130,7 @@ function getlist() {
}) })
.finally(() => { .finally(() => {
loading.value = false; loading.value = false;
isFetching.value = false; // 加锁
}); });
} }
@@ -152,8 +156,31 @@ function handleChangebuilding(val: string) {
// ✅ 新增:处理 selection-change多选专用 // ✅ 新增:处理 selection-change多选专用
// ============================================== // ==============================================
function handleSelectionChange(selection: BillUserlist[]) { function handleSelectionChange(selection: BillUserlist[]) {
if (isFetching.value) return;
if (isMultiple.value) { if (isMultiple.value) {
multipleSelection.value = selection; const currentSelectedIds = new Set(selection.map((item) => item.residentId));
const otherPageSelections = multipleSelection.value.filter((item) => {
const isCurrentPageItem = tableData.value.some((row) => row.residentId === item.residentId);
if (isCurrentPageItem) {
return currentSelectedIds.has(item.residentId);
} else {
return true;
}
});
// 3. 合并:其他页保留的 + 当前页新选中的
const finalSelection = [...otherPageSelections, ...selection];
// 4. 去重(以防万一)
const uniqueMap = new Map();
finalSelection.forEach((item) => uniqueMap.set(item.residentId, item));
multipleSelection.value = Array.from(uniqueMap.values());
console.log(multipleSelection.value.map((item) => item.residentId));
} else {
// --- 单选逻辑 ---
if (selection.length > 0) {
multipleSelection.value = [selection[selection.length - 1]];
} else {
multipleSelection.value = [];
}
} }
} }
// ============================================== // ==============================================
@@ -232,6 +259,17 @@ function confirm() {
defineExpose({ defineExpose({
open: (arr: string[] = []) => { open: (arr: string[] = []) => {
userid.value = arr; userid.value = arr;
if (arr && arr.length > 0) {
multipleSelection.value = arr.map(
(id) =>
({
residentId: id
}) as BillUserlist
);
} else {
multipleSelection.value = [];
}
getlist(); getlist();
dialog.value.dialogVisible = true; dialog.value.dialogVisible = true;
} }

View File

@@ -1,5 +1,6 @@
<template> <template>
<section class="app-main"> <section class="app-main">
<div style="background-color: #f2f1f6; height: 100%">
<router-view v-slot="{ Component, route }" :key="$route.fullPath"> <router-view v-slot="{ Component, route }" :key="$route.fullPath">
<transition :enter-active-class="animate" mode="out-in"> <transition :enter-active-class="animate" mode="out-in">
<keep-alive :include="tagsViewStore.cachedViews"> <keep-alive :include="tagsViewStore.cachedViews">
@@ -8,6 +9,7 @@
</transition> </transition>
</router-view> </router-view>
<iframe-toggle /> <iframe-toggle />
</div>
</section> </section>
</template> </template>
@@ -54,13 +56,14 @@ function addIframe() {
<style lang="scss" scoped> <style lang="scss" scoped>
.app-main { .app-main {
/* 50= navbar 50 */ /* 50= navbar 50 */
min-height: calc(100vh - 50px); // min-height: calc(100vh - 50px);
flex: 1; flex: 1;
width: 100%; width: 100%;
position: relative; position: relative;
overflow: hidden; overflow: hidden;
overflow-y: auto; overflow-y: auto;
background-color: #f2f1f6; background-color: #f2f1f6;
background-color: #dfedff;
} }
.fixed-header + .app-main { .fixed-header + .app-main {

View File

@@ -13,7 +13,7 @@
<template v-if="appStore.device !== 'mobile'"> <template v-if="appStore.device !== 'mobile'">
<el-tooltip :content="proxy.$t('navbar.message')" effect="dark" placement="bottom"> <el-tooltip :content="proxy.$t('navbar.message')" effect="dark" placement="bottom">
<div> <div>
<el-popover placement="bottom" trigger="click" transition="el-zoom-in-top" :width="300" :persistent="false"> <el-popover placement="bottom-end" trigger="click" transition="el-zoom-in-top" :width="400" :persistent="false">
<template #reference> <template #reference>
<el-badge :value="newNotice > 0 ? newNotice : ''" :max="99"> <el-badge :value="newNotice > 0 ? newNotice : ''" :max="99">
<div class="right-menu-item hover-effect" style="display: block"><svg-icon icon-class="message" /></div> <div class="right-menu-item hover-effect" style="display: block"><svg-icon icon-class="message" /></div>
@@ -37,7 +37,7 @@
<el-dropdown-item divided command="changecommunity"> <el-dropdown-item divided command="changecommunity">
<span>{{ proxy.$t('navbar.community') }}</span> <span>{{ proxy.$t('navbar.community') }}</span>
</el-dropdown-item> </el-dropdown-item>
<router-link to="/user/profile"> <router-link to="/system/user/profile">
<el-dropdown-item>{{ proxy.$t('navbar.personalCenter') }}</el-dropdown-item> <el-dropdown-item>{{ proxy.$t('navbar.personalCenter') }}</el-dropdown-item>
</router-link> </router-link>
<el-dropdown-item divided command="logout"> <el-dropdown-item divided command="logout">
@@ -67,7 +67,6 @@ const props = defineProps({
default: true default: true
} }
}); });
console.log(props.Showhamburger);
const appStore = useAppStore(); const appStore = useAppStore();
const userStore = useUserStore(); const userStore = useUserStore();
@@ -160,6 +159,7 @@ watch(
overflow: hidden; overflow: hidden;
position: relative; position: relative;
background: #dfedff; background: #dfedff;
background: transparent;
border-bottom: 1px solid #dfedff; border-bottom: 1px solid #dfedff;
color: #c0c4cc; color: #c0c4cc;
@@ -233,6 +233,7 @@ watch(
.avatar-wrapper { .avatar-wrapper {
margin-top: 5px; margin-top: 5px;
// margin-left: 20px;
position: relative; position: relative;
.user-avatar { .user-avatar {

View File

@@ -50,7 +50,8 @@ const activeMenu = computed(() => {
} }
return path; return path;
}); });
const bgColor = '#eaf2ff'; // const bgColor = '#eaf2ff';
const bgColor = '#dfedff';
// const bgColor = computed(() => (sideTheme.value === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground)); // const bgColor = computed(() => (sideTheme.value === 'theme-dark' ? variables.menuBackground : variables.menuLightBackground));
const textColor = computed(() => (sideTheme.value === 'theme-dark' ? variables.menuColor : variables.menuLightColor)); const textColor = computed(() => (sideTheme.value === 'theme-dark' ? variables.menuColor : variables.menuLightColor));
</script> </script>

View File

@@ -19,13 +19,14 @@
</template> </template>
<el-empty v-else :description="'消息为空'"></el-empty> <el-empty v-else :description="'消息为空'"></el-empty>
</div> </div>
<div v-if="newsList.length > 0" class="foot-box" @click="onGoToGiteeClick">前往gitee</div>
</div> </div>
</template> </template>
<script setup lang="ts" name="layoutBreadcrumbUserNews"> <script setup lang="ts" name="layoutBreadcrumbUserNews">
import { useNoticeStore } from '@/store/modules/notice'; import { useNoticeStore } from '@/store/modules/notice';
const router = useRouter();
const noticeStore = useNoticeStore(); const noticeStore = useNoticeStore();
const { readAll } = useNoticeStore(); const { readAll } = useNoticeStore();
@@ -48,13 +49,10 @@ const getTableData = async () => {
//点击消息,写入已读 //点击消息,写入已读
const onNewsClick = (item: any) => { const onNewsClick = (item: any) => {
newsList.value[item].read = true; newsList.value[item].read = true;
//并且写入pinia
noticeStore.state.notices = newsList.value; noticeStore.state.notices = newsList.value;
}; router.push({
path: '/system/notice'
// 前往通知中心点击 });
const onGoToGiteeClick = () => {
window.open('https://gitee.com/dromara/RuoYi-Vue-Plus/tree/5.X/');
}; };
onMounted(() => { onMounted(() => {
@@ -85,7 +83,8 @@ onMounted(() => {
} }
} }
.content-box { .content-box {
height: 300px; height: 400px;
overflow: auto; overflow: auto;
font-size: 13px; font-size: 13px;
.content-box-item { .content-box-item {

View File

@@ -2,7 +2,7 @@
<!-- 👇 加这一层全局缩放容器 --> <!-- 👇 加这一层全局缩放容器 -->
<div :class="classObj" class="app-wrapper" :style="{ '--current-color': theme }"> <div :class="classObj" class="app-wrapper" :style="{ '--current-color': theme }">
<side-bar class="sidebar-container" /> <side-bar class="sidebar-container" />
<div :class="{ hasTagsView: needTagsView, sidebarHide: sidebar.hide }" class="main-container"> <div :class="{ hasTagsView: needTagsView, sidebarHide: sidebar.hide }" class="main-container" id="main-container">
<div> <div>
<navbar ref="navbarRef" @set-layout="setLayout" /> <navbar ref="navbarRef" @set-layout="setLayout" />
</div> </div>

View File

@@ -22,7 +22,18 @@ let isDynamicRoutesAdded = false;
const isWhiteList = (path: string) => { const isWhiteList = (path: string) => {
return whiteList.some((pattern) => isPathMatch(pattern, path)); return whiteList.some((pattern) => isPathMatch(pattern, path));
}; };
// ✅ 关键修改:记录当前已添加的动态路由名称列表
let currentDynamicRouteNames: string[] = [];
// ✅ 关键修改:清除所有已记录的动态路由
const removeDynamicRoutes = () => {
currentDynamicRouteNames.forEach((name) => {
if (name && router.hasRoute(name)) {
router.removeRoute(name);
}
});
// 清空记录数组
currentDynamicRouteNames = [];
};
router.beforeEach(async (to, from) => { router.beforeEach(async (to, from) => {
NProgress.start(); NProgress.start();
@@ -46,6 +57,7 @@ router.beforeEach(async (to, from) => {
} }
if (userStore.roles.length === 0) { if (userStore.roles.length === 0) {
isRelogin.show = true; isRelogin.show = true;
removeDynamicRoutes();
// 获取用户信息 // 获取用户信息
const [err, res] = await tos(userStore.getInfo()); const [err, res] = await tos(userStore.getInfo());
@@ -60,14 +72,19 @@ router.beforeEach(async (to, from) => {
permissionStore.resetRoutes(); permissionStore.resetRoutes();
// 生成动态路由 // 生成动态路由
const accessRoutes = await permissionStore.generateRoutes(); const accessRoutes = await permissionStore.generateRoutes();
// 添加路由(避免重复添加) // 添加路由(避免重复添加)
accessRoutes.forEach((route) => { accessRoutes.forEach((route) => {
if (route.name && router.hasRoute(route.name)) {
router.removeRoute(route.name);
}
if (!isHttp(route.path) && !router.hasRoute(route.name)) { if (!isHttp(route.path) && !router.hasRoute(route.name)) {
router.addRoute(route); router.addRoute(route);
// 记录顶层路由名称
if (route.name) {
currentDynamicRouteNames.push(route.name as string);
}
} }
}); });
// ✅ 标记:路由已添加 // ✅ 标记:路由已添加
isDynamicRoutesAdded = true; isDynamicRoutesAdded = true;

View File

@@ -54,6 +54,7 @@ export const constantRoutes: RouteRecordRaw[] = [
{ {
path: 'communitylist', path: 'communitylist',
name: 'communitylist', name: 'communitylist',
// system:village:list
hidden: true, hidden: true,
meta: { meta: {
title: '小区列表' title: '小区列表'
@@ -102,27 +103,19 @@ export const constantRoutes: RouteRecordRaw[] = [
// } // }
] ]
} }
// {
// path: '/user',
// component: Layout,
// hidden: true,
// redirect: 'noredirect',
// children: [
// {
// path: 'profile',
// component: () => import('@/views/system/user/profile/index.vue'),
// name: 'Profile',
// meta: { title: '个人中心', icon: 'user' }
// }
// ]
// }
]; ];
if (import.meta.env.VITE_APP_SHOW_WORK_PLATFORM === 'true') { if (import.meta.env.VITE_APP_SHOW_WORK_PLATFORM === 'true') {
const find = constantRoutes.find((item) => item.path === ''); const find = constantRoutes.find((item) => item.path === '');
if (find) { if (find) {
find.children?.push({ find.children?.push({
path: '/index', path: '/index',
component: () => import('@/views/workbench/index2.vue'), component: () => {
if (import.meta.env.VITE_LOGIN_BACK_URL_WORKBENCH_TRUE === 'true') {
return import('@/views/workbench/index.vue');
} else {
return import('@/views/workbench/index2.vue');
}
},
name: 'Index', name: 'Index',
meta: { title: '工作台', icon: 'dashboard', affix: true } meta: { title: '工作台', icon: 'dashboard', affix: true }
}); });

View File

@@ -73,40 +73,15 @@ export const useHouseStore = defineStore(
// 初始化 // 初始化
const initHouse = async () => { const initHouse = async () => {
currentBuildingInfoList.value = []; console.log('initHouse');
resertInit();
// 获取当前小区 所有楼栋信息 // 获取当前小区 所有楼栋信息
const res2 = await getBuildinglistAPI(); const res2 = await getBuildinglistAPI();
currentBuildingInfoList.value = res2.data; currentBuildingInfoList.value = res2.data;
// 得到小区 内 楼栋列表 -> 切换到第一个小区 // 得到小区 内 楼栋列表 -> 切换到第一个
if (res2.data.length > 0) { if (res2.data.length > 0) {
switchBuilding(res2.data[0].id); switchBuilding(res2.data[0].id);
} }
// 获取当前小区 第一个楼栋信息
// // ! 不同住宅类型
// if ((currentBuildingInfo.value && currentBuildingInfo.value.id === null) || buildingtype.value !== currentbuildingtype) {
// currentBuildingInfo.value = res2.data[0];
// // ! 相同住宅类型
// } else if (buildingtype.value === currentbuildingtype) {
// // 更新当前楼栋的 信息
// currentBuildingInfo.value = res2.data.find((item) => item.id === currentBuildingInfo.value.id);
// }
// if (currentBuildingInfo.value && currentBuildingInfo.value.id) {
// // 获取当前 第一个楼栋的所有信息
// const res3 = await getHouselistAPI(currentBuildingInfo.value.id);
// currentHouseInfoList.value = res3.data;
// floorslist.value = new Set();
// // 得到所有的有房屋的 楼层 数组
// currentHouseInfoList.value.units.forEach((item) => {
// item.floors.forEach((floor) => {
// floorslist.value.add(floor.floorNo);
// });
// });
// if (buildingtype.value !== currentbuildingtype) {
// buildingtype.value = currentbuildingtype;
// }
// }
}; };
// 选中的房屋 // 选中的房屋
@@ -216,6 +191,25 @@ export const useHouseStore = defineStore(
}); });
}; };
function resertInit() {
console.log('resertInit');
currentBuildingInfo.value = {
'id': null,
'villageId': null,
'villageName': '',
'buildingName': '',
'buildingUse': null,
'buildToward': '',
'buildTall': '',
'buildStructure': '',
'floorCount': null,
'remark': ''
};
currentBuildingInfoList.value = [];
currentHouseInfoList.value = null;
floorslist.value.clear();
}
// 更新数据 // 更新数据
const updateHouse = () => { const updateHouse = () => {
initHouse(); initHouse();

View File

@@ -8,13 +8,15 @@ interface NoticeItem {
time: string; time: string;
} }
export const useNoticeStore = defineStore('notice', () => { export const useNoticeStore = defineStore(
'notice',
() => {
const state = reactive({ const state = reactive({
notices: [] as NoticeItem[] notices: [] as NoticeItem[]
}); });
const addNotice = (notice: NoticeItem) => { const addNotice = (notice: NoticeItem) => {
state.notices.push(notice); state.notices.unshift(notice);
}; };
const removeNotice = (notice: NoticeItem) => { const removeNotice = (notice: NoticeItem) => {
@@ -38,4 +40,10 @@ export const useNoticeStore = defineStore('notice', () => {
readAll, readAll,
clearNotice clearNotice
}; };
}); },
{
persist: {
storage: sessionStorage
}
}
);

View File

@@ -70,16 +70,20 @@ export const usePermissionStore = defineStore('permission', () => {
}; };
const setRoutes = (newRoutes: RouteRecordRaw[]): void => { const setRoutes = (newRoutes: RouteRecordRaw[]): void => {
addRoutes.value = [];
addRoutes.value = newRoutes; addRoutes.value = newRoutes;
routes.value = constantRoutes.concat(newRoutes); routes.value = constantRoutes.concat(newRoutes);
}; };
const setDefaultRoutes = (routes: RouteRecordRaw[]): void => { const setDefaultRoutes = (routes: RouteRecordRaw[]): void => {
defaultRoutes.value = [];
defaultRoutes.value = constantRoutes.concat(routes); defaultRoutes.value = constantRoutes.concat(routes);
}; };
const setTopbarRoutes = (routes: RouteRecordRaw[]): void => { const setTopbarRoutes = (routes: RouteRecordRaw[]): void => {
topbarRouters.value = [];
topbarRouters.value = routes; topbarRouters.value = routes;
}; };
const setSidebarRouters = (routes: RouteRecordRaw[]): void => { const setSidebarRouters = (routes: RouteRecordRaw[]): void => {
sidebarRouters.value = [];
sidebarRouters.value = routes; sidebarRouters.value = routes;
}; };
@@ -104,10 +108,6 @@ export const usePermissionStore = defineStore('permission', () => {
const defaultRoutes = filterAsyncRouter(defaultData); const defaultRoutes = filterAsyncRouter(defaultData);
const asyncRoutes = filterDynamicRoutes(dynamicRoutes); const asyncRoutes = filterDynamicRoutes(dynamicRoutes);
asyncRoutes.forEach((route) => {
router.addRoute(route);
});
setRoutes(rewriteRoutes); setRoutes(rewriteRoutes);
setSidebarRouters(constantRoutes.concat(sidebarRoutes)); setSidebarRouters(constantRoutes.concat(sidebarRoutes));
setDefaultRoutes(sidebarRoutes); setDefaultRoutes(sidebarRoutes);

View File

@@ -28,7 +28,7 @@ export function convertBuildingToTree(buildings: any[]): Tree[] {
const unitTree: Tree = { const unitTree: Tree = {
label: unit.unitNoName, label: unit.unitNoName,
value: unit.unitNoId, value: unit.unitNoId,
type: 'unitNo', type: 'unitNoId',
children: [] children: []
}; };

View File

@@ -80,3 +80,71 @@ export function convertToChineseCapital(num: number | string): string {
return result; return result;
} }
// 金额加法
export function add(a, b) {
let r1, r2;
try {
r1 = a.toString().split('.')[1].length;
} catch (e) {
r1 = 0;
}
try {
r2 = b.toString().split('.')[1].length;
} catch (e) {
r2 = 0;
}
const m = Math.pow(10, Math.max(r1, r2));
return (a * m + b * m) / m;
}
// 金额减法
export function sub(a, b) {
let r1, r2;
try {
r1 = a.toString().split('.')[1].length;
} catch (e) {
r1 = 0;
}
try {
r2 = b.toString().split('.')[1].length;
} catch (e) {
r2 = 0;
}
const m = Math.pow(10, Math.max(r1, r2));
return (a * m - b * m) / m;
}
// 金额乘法
export function mul(a, b) {
let m = 0;
const s1 = a.toString(),
s2 = b.toString();
try {
m += s1.split('.')[1].length;
} catch (e) {}
try {
m += s2.split('.')[1].length;
} catch (e) {}
return (Number(s1.replace('.', '')) * Number(s2.replace('.', ''))) / Math.pow(10, m);
}
// 金额除法
export function div(a, b) {
let t1 = 0,
t2 = 0;
try {
t1 = a.toString().split('.')[1].length;
} catch (e) {}
try {
t2 = b.toString().split('.')[1].length;
} catch (e) {}
const x = Number(a.toString().replace('.', ''));
const y = Number(b.toString().replace('.', ''));
return (x / y) * Math.pow(10, t2 - t1);
}
// 保留2位小数金额专用
export function toFixed2(val) {
return Number(val).toFixed(2);
}

View File

@@ -148,10 +148,14 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询测试单列表 */ /** 查询测试单列表 */
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
const res = await listDemo(queryParams.value); listDemo(queryParams.value)
.then((res) => {
demoList.value = res.rows; demoList.value = res.rows;
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
}; };
/** 取消按钮 */ /** 取消按钮 */

View File

@@ -145,10 +145,14 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询活动管理列表 */ /** 查询活动管理列表 */
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
const res = await listActivity(queryParams.value); listActivity(queryParams.value)
.then((res) => {
activityList.value = res.rows; activityList.value = res.rows;
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
}; };
/** 发布按钮 */ /** 发布按钮 */
const handleSend = (row: ActivityVO) => { const handleSend = (row: ActivityVO) => {

View File

@@ -67,14 +67,14 @@
<!-- 0启用 1停用 --> <!-- 0启用 1停用 -->
<el-switch <el-switch
@change="(val: string) => handleSwitch(scope.row.id, val)" @change="(val: string) => handleSwitch(scope.row.id, val)"
inactive-value="0" inactive-value="1"
active-value="1" active-value="0"
v-model="scope.row.status" v-model="scope.row.status"
></el-switch> ></el-switch>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="排序" align="center" prop="byOrder" /> <el-table-column label="排序" align="center" prop="byOrder" />
<el-table-column label="添加时间" align="center" /> <el-table-column label="添加时间" align="center" prop="createTime" />
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
<template #default="scope"> <template #default="scope">
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['banner:banner:edit']">修改</el-button> <el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['banner:banner:edit']">修改</el-button>
@@ -158,10 +158,14 @@ const { queryParams, form } = toRefs(data);
/** 查询Banner图管理列表 */ /** 查询Banner图管理列表 */
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
const res = await listBanner(queryParams.value); listBanner(queryParams.value)
.then((res) => {
bannerList.value = res.rows; bannerList.value = res.rows;
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
}; };
/** 取消按钮 */ /** 取消按钮 */

View File

@@ -113,10 +113,14 @@ const getList = async () => {
loading.value = true; loading.value = true;
const res2 = await listComplaintType(); const res2 = await listComplaintType();
complaintyTyplist.value = res2.rows; complaintyTyplist.value = res2.rows;
const res = await listComplaint(queryParams.value); listComplaint(queryParams.value)
.then((res) => {
complaintList.value = res.rows; complaintList.value = res.rows;
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
}; };
/** 搜索按钮操作 */ /** 搜索按钮操作 */

View File

@@ -1,5 +1,5 @@
<template> <template>
<div class="p-2"> <div class="p-2 h-full flex flex-col">
<Pageheader title="投诉类型管理"></Pageheader> <Pageheader title="投诉类型管理"></Pageheader>
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave"> <transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
<div v-show="showSearch" class="mb-[10px]"> <div v-show="showSearch" class="mb-[10px]">
@@ -17,7 +17,7 @@
</div> </div>
</transition> </transition>
<el-card shadow="never"> <el-card shadow="never" class="flex-1">
<template #header> <template #header>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<!-- <el-col :span="1.5"> <!-- <el-col :span="1.5">
@@ -131,10 +131,14 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询投诉类型管理列表 */ /** 查询投诉类型管理列表 */
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
const res = await listComplaintType(queryParams.value); listComplaintType(queryParams.value)
.then((res) => {
complaintTypeList.value = res.rows; complaintTypeList.value = res.rows;
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
}; };
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@@ -196,3 +200,9 @@ onMounted(() => {
getList(); getList();
}); });
</script> </script>
<style lang="scss" scoped>
.el-table {
height: calc(100% - 80px);
}
</style>

View File

@@ -123,10 +123,14 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询办事记录列表 */ /** 查询办事记录列表 */
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
const res = await listHandleLog(queryParams.value); listHandleLog(queryParams.value)
.then((res) => {
handleLogList.value = res.rows; handleLogList.value = res.rows;
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
}; };
/** 搜索按钮操作 */ /** 搜索按钮操作 */

View File

@@ -133,10 +133,14 @@ const { queryParams, form } = toRefs(data);
/** 查询房屋设施管理列表 */ /** 查询房屋设施管理列表 */
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
const res = await listHouseFacilities(queryParams.value); listHouseFacilities(queryParams.value)
.then((res) => {
houseFacilitiesList.value = res.rows; houseFacilitiesList.value = res.rows;
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
}; };
/** 取消按钮 */ /** 取消按钮 */

View File

@@ -54,19 +54,19 @@
<el-table v-loading="loading" border :data="monthCardList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" border :data="monthCardList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="月卡编号" align="center" prop="cardCode" v-if="true" /> <el-table-column label="月卡编号" align="center" prop="cardCode" v-if="true" />
<el-table-column label="办理时间" align="center" prop="handleTime" width="180"> <el-table-column label="办理时间" align="center" prop="handleTime" width="150">
<template #default="scope"> <template #default="scope">
<span>{{ parseTime(scope.row.handleTime, '{y}-{m}-{d}') }}</span> <span>{{ parseTime(scope.row.handleTime, '{y}-{m}-{d}') }}</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="业主" align="center" prop="cardName" /> <el-table-column label="业主" align="center" prop="cardName" width="150" />
<el-table-column label="绑定车牌号" align="center" prop="carNum" /> <el-table-column label="绑定车牌号" align="center" prop="carNum" width="150" />
<el-table-column label="剩余有效天数" align="center" prop="handleName"> <el-table-column label="剩余有效天数" align="center" prop="handleName" width="120">
<template #default="scope"> <template #default="scope">
{{ diffDays(scope.row.startTime, scope.row.endTime) }} {{ diffDays(scope.row.startTime, scope.row.endTime) }}
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="支付方式" align="center" prop="payMethod"> <el-table-column label="支付方式" align="center" prop="payMethod" width="150">
<template #default="scope"> <template #default="scope">
<dict-tag :options="com_pay_method" :value="scope.row.payMethod" /> <dict-tag :options="com_pay_method" :value="scope.row.payMethod" />
</template> </template>
@@ -76,7 +76,7 @@
<dict-tag :options="com_pay_method" :value="scope.row.payMethod" /> <dict-tag :options="com_pay_method" :value="scope.row.payMethod" />
</template> </template>
</el-table-column> --> </el-table-column> -->
<el-table-column label="备注" align="center" prop="remark"></el-table-column> <el-table-column label="备注" show-overflow-tooltip align="center" prop="remark"></el-table-column>
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
<template #default="scope"> <template #default="scope">
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['monthCard:monthCard:edit']">修改</el-button> <el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['monthCard:monthCard:edit']">修改</el-button>
@@ -206,10 +206,14 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询月卡管理列表 */ /** 查询月卡管理列表 */
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
const res = await listMonthCard(queryParams.value); listMonthCard(queryParams.value)
.then((res) => {
monthCardList.value = res.rows; monthCardList.value = res.rows;
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
}; };
/** 取消按钮 */ /** 取消按钮 */

View File

@@ -143,10 +143,14 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询公告信息列表 */ /** 查询公告信息列表 */
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
const res = await listNotice(queryParams.value); listNotice(queryParams.value)
.then((res) => {
noticeList.value = res.rows; noticeList.value = res.rows;
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
}; };
/** 搜索按钮操作 */ /** 搜索按钮操作 */

View File

@@ -36,6 +36,7 @@
</h3> </h3>
<el-button link type="primary">清除未读</el-button> <el-button link type="primary">清除未读</el-button>
</div> </div>
<ul v-if="activeTabs === 1"> <ul v-if="activeTabs === 1">
<li <li
v-for="(item, index) in awaittoList" v-for="(item, index) in awaittoList"
@@ -49,57 +50,71 @@
<div class="info">{{ item.content }}保修标题{{ item.item }}</div> <div class="info">{{ item.content }}保修标题{{ item.item }}</div>
</li> </li>
</ul> </ul>
<ul v-else-if="activeTabs === 2"> <ul v-else-if="activeTabs === 2">
<li <li
v-for="(item, index) in noticelist" v-for="(item, index) in noticelist"
:key="index" :key="index"
@click="handleDisable(item)" @click="handleRead(item)"
:class="{ :class="{
disable: item.disabled disable: !isdisable(item)
}" }"
> >
<div class="subtitle">报修工单通知</div> <div class="subtitle">报修工单通知</div>
<div class="info">您有一条新的报修工单需要处理保修标题下水道堵塞</div> <div class="info">您有一条新的报修工单需要处理保修标题下水道堵塞</div>
</li> </li>
</ul> </ul>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="init" />
</div> </div>
</div> </div>
</div> </div>
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
import { getNotificationList } from '@/api/system/Notification/index'; import pagination from '@/components/Pagination/index.vue';
import { getNotificationList, NotificationVo, ReadNotificationByID } from '@/api/system/Notification/index';
import { ref } from 'vue'; import { ref } from 'vue';
// 1 代办 2通知
const activeTabs = ref(1); const activeTabs = ref(1);
function handleClick(tab: number) {
activeTabs.value = tab;
}
const todonum = computed(() => { const todonum = computed(() => {
return awaittoList.value.filter((item) => isdisable(item)).length; return awaittoList.value.filter((item) => isdisable(item)).length;
}); });
const noticnum = computed(() => { const noticnum = computed(() => {
return noticelist.value.filter((item) => isdisable(item)).length; return noticelist.value.filter((item) => isdisable(item)).length;
}); });
const total = ref(0);
const queryParams = ref({
pageNum: 1,
pageSize: 10
});
function handleClick(tab: number) {
activeTabs.value = tab;
}
function isdisable(item) { function isdisable(item) {
return item.repairIsCheck ? item.repairIsCheck === '1' : item.manageIsCheck === '1'; return item.repairIsCheck ? item.repairIsCheck === '1' : item.manageIsCheck === '1';
} }
const noticelist = ref([]); const noticelist = ref([]);
const awaittoList = ref([]); const awaittoList = ref<NotificationVo[]>([]);
function init() { function init() {
getNotificationList({ getNotificationList({
pageNum: 1, pageNum: 1,
pageSize: 10 pageSize: 10
}).then((res) => { }).then((res) => {
awaittoList.value = res.data; awaittoList.value = res.data;
total.value = res.total;
total.value = 100;
}); });
} }
init(); init();
function handleRead(row) {} function handleRead(row: NotificationVo) {
ReadNotificationByID(row.id).then(() => {
init();
});
}
function handleDisable(row) { function handleDisable(row) {
row.disabled = true; row.disabled = true;
} }
@@ -112,6 +127,7 @@ function handleDisable(row) {
display: flex; display: flex;
font-size: 0.8rem; font-size: 0.8rem;
flex: 1; flex: 1;
overflow: hidden;
.lefttabs { .lefttabs {
width: 275px; width: 275px;
height: 100%; height: 100%;

View File

@@ -166,10 +166,14 @@ const { queryParams, form, rules } = toRefs(data);
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
// 停车缴费 // 停车缴费
const res = await listParkingCost(queryParams.value); listParkingCost(queryParams.value)
.then((res) => {
parkingCostList.value = res.rows; parkingCostList.value = res.rows;
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
}; };
/** 搜索按钮操作 */ /** 搜索按钮操作 */

View File

@@ -141,10 +141,14 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询问卷调查列表 */ /** 查询问卷调查列表 */
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
const res = await listQuestionnaire(queryParams.value); listQuestionnaire(queryParams.value)
.then((res) => {
questionnaireList.value = res.rows; questionnaireList.value = res.rows;
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
}; };
/** 取消按钮 */ /** 取消按钮 */

View File

@@ -115,7 +115,7 @@ const form = ref({
houseId: null, // 关联房屋id houseId: null, // 关联房屋id
maintenanceItemId: null, // 维修项目id maintenanceItemId: null, // 维修项目id
problem: '', // 问题描述 problem: '', // 问题描述
residentId: null, // 报修人id(住户表id) residentId: '', // 报修人id(住户表id)
phone: null, // 报手机号码 phone: null, // 报手机号码
problemImageUrl: '', // 问题图片地址 problemImageUrl: '', // 问题图片地址
problemStatus: '0', // 0 已提交 1已分配 2维修中 3维修完成 problemStatus: '0', // 0 已提交 1已分配 2维修中 3维修完成
@@ -143,7 +143,7 @@ const currentviliage = ref();
const maintenanceItemTreeData = ref(); const maintenanceItemTreeData = ref();
function init() { function init() {
gettreelistRepairProject().then((res) => { gettreelistRepairProject().then((res) => {
maintenanceItemTreeData.value = res.data; maintenanceItemTreeData.value = handleTreeDisable(res.data);
if (route.query.id) { if (route.query.id) {
userid.value = route.query.id; userid.value = route.query.id;
form.value.id = userid.value; form.value.id = userid.value;
@@ -168,6 +168,21 @@ function init() {
} }
init(); init();
function handleTreeDisable(TreeData) {
const arr = TreeData.map((item) => {
if (item.status === '1') {
item.disabled = true;
} else {
item.disabled = false;
}
if (item && item.children && item.children.length > 0) {
item.children = handleTreeDisable(item.children);
}
return item;
});
return arr;
}
// ! 上传图片 =--================================================================== // ! 上传图片 =--==================================================================
const fileList = ref<UploadUserFile[]>([]); const fileList = ref<UploadUserFile[]>([]);

View File

@@ -1,6 +1,6 @@
<template> <template>
<div class="AddBuildingBox"> <div class="AddBuildingBox">
<PageHeader :title="userid ? '编辑车辆信息' : '添加车辆信息'"></PageHeader> <PageHeader></PageHeader>
<div class="AddBuildingBody"> <div class="AddBuildingBody">
<div class="title">基本信息</div> <div class="title">基本信息</div>
<div class="addBuildingFormBody"> <div class="addBuildingFormBody">
@@ -59,7 +59,7 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue'; import { ref } from 'vue';
import PageHeader from '@/components/Pageheader/index.vue'; import PageHeader from '@/components/Pageheader/index.vue';
import { addRepairProject, listRepairProject, updateRepairProject } from '@/api/system/RepairProject'; import { addRepairProject, getRepairProject, listRepairProject, updateRepairProject } from '@/api/system/RepairProject';
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { com_repair_project_types } = toRefs<any>(proxy?.useDict('com_repair_project_types')); const { com_repair_project_types } = toRefs<any>(proxy?.useDict('com_repair_project_types'));
const { com_repair_project_status } = toRefs<any>(proxy?.useDict('com_repair_project_status')); const { com_repair_project_status } = toRefs<any>(proxy?.useDict('com_repair_project_status'));
@@ -88,6 +88,7 @@ const userid = ref(null);
const options = ref([]); const options = ref([]);
function handleChange(val) { function handleChange(val) {
if (!val) return;
const find = options.value.find((item) => item.id === val); const find = options.value.find((item) => item.id === val);
if (find) { if (find) {
form.value.projectType = find.projectType; form.value.projectType = find.projectType;
@@ -107,19 +108,15 @@ function init() {
listRepairProject().then((res) => { listRepairProject().then((res) => {
const arr = res.rows.filter((ite) => ite.projectLevel === 0); const arr = res.rows.filter((ite) => ite.projectLevel === 0);
options.value = arr; options.value = arr;
});
if (route.query.id) { if (route.query.id) {
userid.value = route.query.id; userid.value = route.query.id;
const find = res.rows.find((item) => item.id === userid.value); getRepairProject(userid.value).then((res) => {
if (find) { form.value = res.data;
form.value = { form.value.status = res.data.status ?? '0' + '';
...form.value, handleChange(res.data.parentId);
...find,
projectLevel: find.projectLevel
};
handleChange(find.parentId);
}
}
}); });
}
} }
init(); init();
// !== 提交 ============================================================================= // !== 提交 =============================================================================

View File

@@ -164,10 +164,14 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询报修管理列表 */ /** 查询报修管理列表 */
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
const res = await listRepair(queryParams.value); listRepair(queryParams.value)
.then((res) => {
repairList.value = res.rows; repairList.value = res.rows;
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
}; };
/** 搜索按钮操作 */ /** 搜索按钮操作 */

View File

@@ -93,7 +93,7 @@
<div class="preivewBody w-full h-full flex flex-items-start mt-2"> <div class="preivewBody w-full h-full flex flex-items-start mt-2">
<div class="title">维修师傅</div> <div class="title">维修师傅</div>
<div class="preivewBodybox flex-1 ml-5"> <div class="preivewBodybox flex-1 ml-5">
<repairUser :userid="form.repairId" @change="handleChange"></repairUser> <repairUser :username="form.repairName" :userid="form.repairId" @change="handleChange"></repairUser>
<div class="actions mt-5"> <div class="actions mt-5">
<el-button @click="handleSend" type="primary">确定派单</el-button> <el-button @click="handleSend" type="primary">确定派单</el-button>
<el-button @click="backRouter">返回</el-button> <el-button @click="backRouter">返回</el-button>

View File

@@ -29,7 +29,7 @@
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="费用单价" prop="fixedPrice"> <el-form-item label="费用单价" prop="fixedPrice">
<el-input v-model.trim="form.fixedPrice" placeholder="请输入费用单价" /> <el-input v-model.trim="form.fixedPrice" :placeholder="placeHolderFun(form.typeId)" />
</el-form-item> </el-form-item>
<el-form-item label="计算精度" prop="accuracy"> <el-form-item label="计算精度" prop="accuracy">
<el-select v-model="form.accuracy"> <el-select v-model="form.accuracy">
@@ -50,7 +50,6 @@
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input type="textarea" :rows="5" v-model.trim="form.remark" placeholder="请输入" /> <el-input type="textarea" :rows="5" v-model.trim="form.remark" placeholder="请输入" />
</el-form-item> </el-form-item>
<el-form-item style="margin-top: 30px"> <el-form-item style="margin-top: 30px">
<el-button type="primary" @click="submitForm">提交</el-button> <el-button type="primary" @click="submitForm">提交</el-button>
<el-button @click="cancelForm">返回</el-button> <el-button @click="cancelForm">返回</el-button>
@@ -139,6 +138,13 @@ const submitForm = () => {
const cancelForm = () => { const cancelForm = () => {
router.back(); router.back();
}; };
// 车位费 物业费
const typeNamelist = ref(['2049026574236418050', '2049026520314445826']);
function placeHolderFun(typeId: string) {
return typeNamelist.value.includes(typeId) ? '请输入每日费用单价' : '请输入费用单价';
}
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">

View File

@@ -138,10 +138,14 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询收费项目管理列表 */ /** 查询收费项目管理列表 */
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
const res = await listChargeItem(queryParams.value); listChargeItem(queryParams.value)
.then((res) => {
chargeItemList.value = res.rows; chargeItemList.value = res.rows;
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
}; };
/** 取消按钮 */ /** 取消按钮 */

View File

@@ -9,7 +9,7 @@
<el-input v-model.trim="form.billName" placeholder="请输入账单名称" /> <el-input v-model.trim="form.billName" placeholder="请输入账单名称" />
</el-form-item> </el-form-item>
<el-form-item label="收费项目" prop="chargeItemId"> <el-form-item label="收费项目" prop="chargeItemId">
<el-select v-model="form.chargeItemId" @change="handleChange"> <el-select v-model="form.chargeItemId" @change="(val: string) => handleChange(val, true)">
<el-option <el-option
:disabled="item.status === '1'" :disabled="item.status === '1'"
v-for="(item, index) in chargeitemlist" v-for="(item, index) in chargeitemlist"
@@ -21,10 +21,12 @@
</el-form-item> </el-form-item>
<!-- 水费电费 收费范围为 房屋 --> <!-- 水费电费 收费范围为 房屋 -->
<el-form-item label="收费范围" prop="chargeScope" v-if="typeNamelist.includes(typeName)"> <el-form-item label="收费范围" prop="chargeScope" v-if="typeNamelist.includes(typeName)">
<div>
<div class="flex flex-row flex-items-end"> <div class="flex flex-row flex-items-end">
<el-radio-group v-model="form.chargeScope"> <el-radio-group v-model="form.chargeScope">
<div class="flex flex-col flex-items-end"> <div class="flex flex-col flex-items-end">
<el-radio <el-radio
:disabled="!form.chargeItemId"
style="margin-right: 0" style="margin-right: 0"
v-for="(item, index) in com_bill_charge_scope_house" v-for="(item, index) in com_bill_charge_scope_house"
:key="index" :key="index"
@@ -37,6 +39,7 @@
<el-button @click="OpenUseTablesfun('house')" link type="primary" v-if="form.chargeScope === '1'" class="ml-10px">请选择</el-button> <el-button @click="OpenUseTablesfun('house')" link type="primary" v-if="form.chargeScope === '1'" class="ml-10px">请选择</el-button>
</div> </div>
</div> </div>
</div>
</el-form-item> </el-form-item>
<!-- 其他费用 收费范围为 业主 --> <!-- 其他费用 收费范围为 业主 -->
<el-form-item label="收费范围" prop="chargeScope" v-else> <el-form-item label="收费范围" prop="chargeScope" v-else>
@@ -45,6 +48,7 @@
<div class="flex flex-col flex-items-end"> <div class="flex flex-col flex-items-end">
<el-radio <el-radio
style="margin-right: 0" style="margin-right: 0"
:disabled="!form.chargeItemId"
v-for="(item, index) in com_questionnaire_scope" v-for="(item, index) in com_questionnaire_scope"
:key="index" :key="index"
:value="item.value" :value="item.value"
@@ -65,7 +69,11 @@
</el-form-item> </el-form-item>
<!-- 业主选择 --> <!-- 业主选择 -->
<el-form-item v-if="form.chargeScope === '1' && !typeNamelist.includes(typeName)"> <el-form-item v-if="form.chargeScope === '1' && !typeNamelist.includes(typeName)">
<div class="residentBox"> <!-- 业主选择 车位费用 -->
<div class="residentBox" v-if="typeName === HandleTypeId.Resident.Parking">
<CarUser returnvalue="parkingId" ref="ParkinguserRef" :isMultiple="true" @change="handleCheckPaking"></CarUser>
</div>
<div class="residentBox" v-else>
<UserHolder returnvalue="residentId" ref="userRef" :isMultiple="true" @change="handleCheckUser"></UserHolder> <UserHolder returnvalue="residentId" ref="userRef" :isMultiple="true" @change="handleCheckUser"></UserHolder>
</div> </div>
</el-form-item> </el-form-item>
@@ -74,18 +82,32 @@
<el-option v-for="(item, index) in com_bill_charge_period" :key="index" :value="item.value" :label="item.label"></el-option> <el-option v-for="(item, index) in com_bill_charge_period" :key="index" :value="item.value" :label="item.label"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="起止日期" prop="price"> <el-form-item label="起止日期" prop="startDate">
<el-date-picker <el-date-picker
v-model="StartEndDate" v-model="StartEndDate"
unlink-panels
@update:model-value="handleDate" @update:model-value="handleDate"
:value-format="datepicker[form.chargePeriod].format" @clear="handleClear"
:format="datepicker[form.chargePeriod].format" :value-format="datepicker[2].format"
:type="datepicker[form.chargePeriod].type" :format="datepicker[2].format"
:type="datepicker[2].type"
range-separator="" range-separator=""
start-placeholder="开始" start-placeholder="开始"
end-placeholder="结束" end-placeholder="结束"
/> />
</el-form-item> </el-form-item>
<!-- <el-form-item label="结束日期" prop="price">
<el-date-picker
v-model="StartEndDate"
@update:model-value="handleDate"
:value-format="datepicker[2].format"
:format="datepicker[2].format"
:type="datepicker[2].type"
range-separator=""
start-placeholder="开始"
end-placeholder="结束"
/>
</el-form-item> -->
<el-form-item label="备注" prop="remark"> <el-form-item label="备注" prop="remark">
<el-input type="textarea" :rows="5" v-model.trim="form.remark" placeholder="请输入" /> <el-input type="textarea" :rows="5" v-model.trim="form.remark" placeholder="请输入" />
</el-form-item> </el-form-item>
@@ -102,14 +124,16 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue'; import { ref } from 'vue';
import House from '@/components/Holder/house.vue'; import House from '@/components/Holder/house.vue';
import UserHolder from '@/components/Holder/user.vue'; import UserHolder from '@/components/Holder/user.vue';
import CarUser from '@/components/Holder/CarUser.vue';
import PageHeader from '@/components/Pageheader/index.vue'; import PageHeader from '@/components/Pageheader/index.vue';
import { listChargeItem } from '@/api/system/SdbChargeItem'; import { listChargeItem } from '@/api/system/SdbChargeItem';
import { getBill, updateBill, addBill, BillHouse, listBillHouse, queryResidentList_holder } from '@/api/system/SdbBill'; import { getBill, updateBill, addBill, BillHouse, listBillHouse, queryResidentList_holder } from '@/api/system/SdbBill';
import type { DatePickerType } from 'element-plus'; import type { DatePickerType } from 'element-plus';
import { formatDate2 } from '@/utils'; import { formatDate2 } from '@/utils';
import { Delete } from '@element-plus/icons-vue';
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { com_questionnaire_scope } = toRefs<any>(proxy?.useDict('com_questionnaire_scope')); const { com_questionnaire_scope } = toRefs<any>(proxy?.useDict('com_questionnaire_scope'));
@@ -137,7 +161,8 @@ const form = ref({
'chargePeriod': '2', // 费用周期 'chargePeriod': '2', // 费用周期
houseIds: [], // 部分房屋 houseIds: [], // 部分房屋
residentIds: [], // 部分业主 residentIds: [], // 部分业主
charegeTypeId: '', // typeid parkingIds: [],
chargeTypeId: '', // typeid
'startDate': '', // 开始 'startDate': '', // 开始
'endDate': '', // 结束 'endDate': '', // 结束
'remark': '' 'remark': ''
@@ -154,10 +179,18 @@ const userid = ref(null);
// 开始结束日期 // 开始结束日期
const StartEndDate = ref([]); const StartEndDate = ref([]);
function handleDate(val: string[]) { function handleDate(val: string[]) {
form.value.startDate = formatDate2(val[0]); if (val === null || val.length === 0) {
form.value.endDate = formatDate2(val[1]); form.value.startDate = '';
form.value.endDate = '';
} else {
form.value.startDate = val[0] + ' 00:00:00';
form.value.endDate = val[1] + ' 23:59:59';
}
}
function handleClear() {
form.value.startDate = '';
form.value.endDate = '';
} }
// 收费类型 // 收费类型
const chargeitemlist = ref([]); const chargeitemlist = ref([]);
@@ -166,9 +199,8 @@ const chargeitemlist = ref([]);
// // 住户列表 // // 住户列表
// const userlist = ref([]); // const userlist = ref([]);
async function init() { async function init() {
listChargeItem().then((res) => { listChargeItem({}).then((res) => {
chargeitemlist.value = res.rows; chargeitemlist.value = res.rows;
});
// const res = await listBillHouse({ pageNum: 1, pageSize: 999999 }); // const res = await listBillHouse({ pageNum: 1, pageSize: 999999 });
// houselist.value = res.rows; // houselist.value = res.rows;
@@ -186,42 +218,55 @@ async function init() {
// TODO 没有住户参数 // TODO 没有住户参数
form.value.houseIds = res.data.houseIds || []; form.value.houseIds = res.data.houseIds || [];
form.value.residentIds = res.data.residentIds || []; form.value.residentIds = res.data.residentIds || [];
form.value.parkingIds = res.data.parkingIds || [];
form.value.startDate = formatDate2(form.value.startDate); form.value.startDate = formatDate2(form.value.startDate);
form.value.endDate = formatDate2(form.value.endDate); form.value.endDate = formatDate2(form.value.endDate);
StartEndDate.value = [form.value.startDate, form.value.endDate]; StartEndDate.value = [form.value.startDate, form.value.endDate];
// TODO houseid 有默认值, 需要处理 // TODO houseid 有默认值, 需要处理
// TODO residentids 添加, // TODO residentids 添加,
checkoutHouses.value = [];
checkoutUser.value = [];
checkoutParking.value = [];
checkoutHouses.value = form.value.houseIds.filter((item) => item); checkoutHouses.value = form.value.houseIds.filter((item) => item);
checkoutUser.value = form.value.residentIds.filter((item) => item);
checkoutParking.value = form.value.parkingIds.filter((item) => item);
handleChange(form.value.chargeItemId); handleChange(form.value.chargeItemId);
}); });
} }
});
} }
init(); init();
const typeNamelist = ref(['2049026484272791553', '2049026503017136129']); const HandleTypeId = {
/** 显示房屋 */
'House': {
/** 水费 */
'Water': '2049026484272791553',
/** 电费 */
'Electricity': '2049026503017136129'
},
/** 显示业主 */
'Resident': {
/** 车位费 */
'Parking': '2049026574236418050'
}
};
// 符合类型: 显示房屋,选择房屋
const typeNamelist = ref([HandleTypeId.House.Water, HandleTypeId.House.Electricity]);
const typeName = ref(''); const typeName = ref('');
// 获取收费类型id // 获取收费类型id
function handleChange(val: string) { function handleChange(val: string, callback: boolean = false) {
const find = chargeitemlist.value.find((item) => item.id === val); const find = chargeitemlist.value.find((item) => item.id === val);
if (find) { if (find) {
form.value.charegeTypeId = find.typeId; form.value.chargeTypeId = find.typeId;
typeName.value = find.typeId; typeName.value = find.typeId;
if (callback) {
handleClearCheckout(); handleClearCheckout();
} }
}
} }
// !== 业主 ============================================================================= // !== 业主 =============================================================================
// 打开
const HolderRef = ref<InstanceType<typeof House>>();
const userRef = ref<InstanceType<typeof UserHolder>>();
function OpenUseTablesfun(val: string) {
console.log(val);
if (val === 'house') {
HolderRef.value.open(checkoutHouses.value);
} else if (val === 'user') {
userRef.value.open(checkoutUser.value);
}
}
// 多选 // 多选
const checkoutHouses = ref<string[]>([]); const checkoutHouses = ref<string[]>([]);
function handleSelect(val: string[]) { function handleSelect(val: string[]) {
@@ -233,9 +278,15 @@ const checkoutUser = ref([]);
/** 添加 业主 */ /** 添加 业主 */
function handleCheckUser(val: string[]) { function handleCheckUser(val: string[]) {
checkoutUser.value = val; checkoutUser.value = val;
console.log(val);
form.value.residentIds = val; form.value.residentIds = val;
} }
const checkoutParking = ref([]);
/** 添加 车位业主 */
function handleCheckPaking(val: string[]) {
checkoutParking.value = val;
console.log(val);
form.value.parkingIds = val;
}
/** 清空 */ /** 清空 */
function handleClearCheckout() { function handleClearCheckout() {
@@ -244,10 +295,27 @@ function handleClearCheckout() {
form.value.residentIds = []; form.value.residentIds = [];
form.value.houseIds = []; form.value.houseIds = [];
} }
// 打开
const HolderRef = ref<InstanceType<typeof House>>();
const userRef = ref<InstanceType<typeof UserHolder>>();
const ParkinguserRef = ref<InstanceType<typeof CarUser>>();
function OpenUseTablesfun(val: string) {
if (val === 'house') {
HolderRef.value.open(checkoutHouses.value);
} else if (val === 'user') {
if (typeName.value === HandleTypeId.Resident.Parking) {
ParkinguserRef.value.open(checkoutParking.value);
} else {
userRef.value.open(checkoutUser.value);
}
}
}
// !== 业主 ============================================================================= // !== 业主 =============================================================================
// !== 提交 ============================================================================= // !== 提交 =============================================================================
const submitForm = () => { const submitForm = () => {
console.log(form.value);
formRef.value?.validate(async (valid: boolean) => { formRef.value?.validate(async (valid: boolean) => {
if (valid) { if (valid) {
if (userid.value) { if (userid.value) {

View File

@@ -27,6 +27,7 @@
<el-card class="flex-1" shadow="never"> <el-card class="flex-1" shadow="never">
<template #header> <template #header>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<!-- TODO wuye_statistics -->
<!-- <el-col :span="1.5"> <!-- <el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['bill:bill:add']">新增</el-button> <el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['bill:bill:add']">新增</el-button>
</el-col> </el-col>
@@ -152,7 +153,7 @@ const { queryParams, form } = toRefs(data);
const chargeItems = ref([]); const chargeItems = ref([]);
function init() { function init() {
listChargeItem().then((res) => { listChargeItem({}).then((res) => {
chargeItems.value = res.rows; chargeItems.value = res.rows;
}); });
} }

View File

@@ -8,26 +8,24 @@
<el-form-item label="账单名称" prop="billName"> <el-form-item label="账单名称" prop="billName">
<el-input disabled v-model.trim="form.billName" placeholder="请输入账单名称" /> <el-input disabled v-model.trim="form.billName" placeholder="请输入账单名称" />
</el-form-item> </el-form-item>
<el-form-item label="收费项目" prop="chargeItemId"> <el-form-item label="收费项目" prop="chargeItemId">
<el-select disabled v-model="form.chargeItemId" @change="handleChange"> <el-select disabled v-model="form.chargeItemId" @change="handleChange">
<el-option v-for="(item, index) in chargeitemlist" :key="index" :value="item.id" :label="item.itemName"></el-option> <el-option v-for="(item, index) in chargeitemlist" :key="index" :value="item.id" :label="item.itemName"></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="收费范围" prop="chargeScope">
<el-form-item label="收费范围" prop="chargeScope" v-if="itemTypeincludes">
<el-radio-group disabled v-model="form.chargeScope"> <el-radio-group disabled v-model="form.chargeScope">
<el-radio v-for="(item, index) in com_questionnaire_scope" :key="index" :value="item.value" :label="item.label"></el-radio> <el-radio v-for="(item, index) in com_questionnaire_scope" :key="index" :value="item.value" :label="item.label"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item>
<el-form-item v-if="form.chargeScope === '1'"> <el-form-item label="收费范围" prop="chargeScope" v-else>
<div class="residentBox"> <el-radio-group disabled v-model="form.chargeScope">
<ul class="checkoutSideUsesbox"> <el-radio v-for="(item, index) in com_bill_charge_scope_house" :key="index" :value="item.value" :label="item.label"></el-radio>
<li v-for="(item, index) in checkoutUses" :key="index"> </el-radio-group>
<span>{{ item.buildingName }} </span> / <span>{{ item.unitNo }}单元 </span> / <span>{{ item.floorNo }} </span> /
<span>{{ item.houseNo }}</span>
</li>
</ul>
</div>
</el-form-item> </el-form-item>
<el-form-item label="费用周期" prop="chargePeriod"> <el-form-item label="费用周期" prop="chargePeriod">
<el-select disabled v-model="form.chargePeriod"> <el-select disabled v-model="form.chargePeriod">
<el-option v-for="(item, index) in com_bill_charge_period" :key="index" :value="item.value" :label="item.label"></el-option> <el-option v-for="(item, index) in com_bill_charge_period" :key="index" :value="item.value" :label="item.label"></el-option>
@@ -71,6 +69,7 @@ import { Delete } from '@element-plus/icons-vue';
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { com_questionnaire_scope } = toRefs<any>(proxy?.useDict('com_questionnaire_scope')); const { com_questionnaire_scope } = toRefs<any>(proxy?.useDict('com_questionnaire_scope'));
const { com_bill_charge_scope_house } = toRefs<any>(proxy?.useDict('com_bill_charge_scope_house'));
const { com_bill_charge_period } = toRefs<any>(proxy?.useDict('com_bill_charge_period')); const { com_bill_charge_period } = toRefs<any>(proxy?.useDict('com_bill_charge_period'));
type PickerConfig = { type PickerConfig = {
@@ -114,24 +113,32 @@ function handleDate(val: string[]) {
form.value.endDate = formatDate2(val[1]); form.value.endDate = formatDate2(val[1]);
} }
const chargeitemlist = ref([]); const chargeitemlist = ref([]);
// 电费 水费
const typeNamelist = ref(['2049026484272791553', '2049026503017136129']);
const itemTypeincludes = computed(() => {
return typeNamelist.value.includes(form.value.chargeItemId);
});
const houselist = ref([]); const houselist = ref([]);
const checkoutUses = ref([]); const checkoutUses = ref([]);
async function init() { async function init() {
listChargeItem().then((res) => { const res1 = await listBillHouse({ pageNum: 1, pageSize: 999999 });
houselist.value = res1.rows;
listChargeItem().then(async (res) => {
chargeitemlist.value = res.rows; chargeitemlist.value = res.rows;
});
const res = await listBillHouse({ pageNum: 1, pageSize: 999999 });
houselist.value = res.rows;
if (route.query.id) { if (route.query.id) {
userid.value = route.query.id; userid.value = route.query.id;
getBill(userid.value).then((res) => { getBill(userid.value).then((res1) => {
form.value = { form.value = {
...form.value, ...form.value,
...res.data ...res1.data
}; };
form.value.houseIds = res.data.houseIds || []; form.value.houseIds = res1.data.houseIds || [];
StartEndDate.value = [formatDate(res.data.startDate), formatDate(res.data.endDate)]; StartEndDate.value = [formatDate(res1.data.startDate), formatDate(res1.data.endDate)];
checkoutUses.value = form.value.houseIds checkoutUses.value = form.value.houseIds
.map((item) => { .map((item) => {
if (item) { if (item) {
@@ -146,6 +153,7 @@ async function init() {
.filter((item) => item !== null); .filter((item) => item !== null);
}); });
} }
});
} }
init(); init();

View File

@@ -16,10 +16,14 @@
<div class="tablebox"> <div class="tablebox">
<el-table :data="tabledata" @selection-change="handleSelectionChange"> <el-table :data="tabledata" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column align="center" label="房屋/车位"> <el-table-column align="center" label="收费名称">
<template #default="scope"> <template #default="scope">
<div v-if="scope.row.chargeTypeName === '车费'">{{ scope.row.parkingName }}</div> <!-- <div v-if="scope.row.chargeTypeName === '车费'">{{ scope.row.parkingName }}</div>
<div v-else-if="scope.row.chargeTypeName === '电费' || scope.row.chargeTypeName === '水费'">{{ scope.row.houseName }}</div> <div v-else-if="scope.row.chargeTypeName === chargeTypeName.Electricity || scope.row.chargeTypeName === chargeTypeName.Water">
{{ scope.row.houseName }}
</div>
<div v-else>--</div> -->
<div>{{ scope.row.detailsName }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="收费项目" width="250"> <el-table-column align="center" label="收费项目" width="250">
@@ -29,7 +33,7 @@
</el-table-column> </el-table-column>
<el-table-column align="center" label="收费周期" width="300"> <el-table-column align="center" label="收费周期" width="300">
<template #default="scope"> <template #default="scope">
<div>{{ scope.row.startDate }} -- {{ scope.row.endDate }}</div> <dict-tag :options="com_bill_charge_period" :value="scope.row.chargePeriod"></dict-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="单价" width="150"> <el-table-column align="center" label="单价" width="150">
@@ -37,11 +41,6 @@
<div>{{ scope.row.fixedPrice }}</div> <div>{{ scope.row.fixedPrice }}</div>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column align="center" label="数量">
<template #default="scope">
<div>{{ scope.row.formula }}</div>
</template>
</el-table-column> -->
<el-table-column align="center" label="缴费状态" width="120"> <el-table-column align="center" label="缴费状态" width="120">
<template #default="scope"> <template #default="scope">
<dict-tag v-if="!inglelist.includes(scope.row.chargeItemName)" :options="com_pay_status" :value="scope.row.payStatus"></dict-tag> <dict-tag v-if="!inglelist.includes(scope.row.chargeItemName)" :options="com_pay_status" :value="scope.row.payStatus"></dict-tag>
@@ -50,8 +49,7 @@
</el-table-column> </el-table-column>
<el-table-column align="center" label="应缴金额" width="120"> <el-table-column align="center" label="应缴金额" width="120">
<template #default="scope"> <template #default="scope">
<div v-if="!inglelist.includes(scope.row.chargeItemName)">{{ scope.row.money ?? '--' }}</div> <div>{{ scope.row.amount ?? '--' }}</div>
<div v-else>--</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -66,8 +64,8 @@
<span>缴费人{{ villageinfo.villageName ?? '---' }}-{{ props.query.houseName }}</span> <span>缴费人{{ villageinfo.villageName ?? '---' }}-{{ props.query.houseName }}</span>
</div> </div>
<div> <div>
<span>账单名称 </span> <span>收费名称 </span>
<span style="text-wrap: wrap; text-indent: 2rem">{{ from.billResidentId.map((item) => item.chargeItemName).join('、 ') }}</span> <span style="text-wrap: wrap; text-indent: 2rem">{{ from.billResidentId.map((item) => item.detailsName).join('、 ') }}</span>
</div> </div>
<div> <div>
<span>应收合计{{ from.allCost }}</span> <span>应收合计{{ from.allCost }}</span>
@@ -108,16 +106,20 @@
<script setup lang="ts"> <script setup lang="ts">
import { ref } from 'vue'; import { ref } from 'vue';
import { billlistType, billQuery } from '@/api/system/SdbCashier'; import { billlistType, billQuery, billEdit } from '@/api/system/SdbCashier';
import { add } from '@/utils/money';
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { com_pay_method, com_pay_status } = toRefs<any>(proxy?.useDict('com_pay_method', 'com_pay_status')); const { com_pay_method, com_pay_status } = toRefs<any>(proxy?.useDict('com_pay_method', 'com_pay_status'));
const { com_bill_charge_period } = toRefs<any>(proxy?.useDict('com_bill_charge_period'));
const villageinfo = JSON.parse(localStorage.getItem('villageInfo') || '{}'); const villageinfo = JSON.parse(localStorage.getItem('villageInfo') || '{}');
// 隐藏收费金额的 类型列表 // 隐藏收费金额的 类型列表
const inglelist = ['电费', '水费']; const inglelist = ['电费', '水费'];
enum chargeTypeName {
'Water' = '水费',
'Electricity' = '电费'
}
type querytype = { type querytype = {
residentId: string; residentId: string;
residentName: string; residentName: string;
@@ -197,10 +199,9 @@ const openDiage = () => {
payType: '0', payType: '0',
remark: '' remark: ''
}; };
console.log(ids.value);
ids.value.forEach((item) => { ids.value.forEach((item) => {
from.value.billResidentId.push(item); from.value.billResidentId.push(item);
from.value.allCost += Number(item.money); from.value.allCost = add(from.value.allCost, item.amount);
}); });
dialog.visible = true; dialog.visible = true;
}; };
@@ -210,13 +211,17 @@ const closepay = () => {
}; };
const submitForm = () => { const submitForm = () => {
buttonLoading.value = true; buttonLoading.value = true;
if (from.value.payStatus === '0') { const obj = {
setTimeout(() => { 'detailsId': from.value.billResidentId.map((item) => item.detailsId),
'payType': from.value.payType,
'payStatus': from.value.payStatus
};
billEdit(obj).then(() => {
ElMessage.success('缴费成功');
buttonLoading.value = false; buttonLoading.value = false;
getList();
closepay(); closepay();
}, 1000); });
} else {
}
}; };
</script> </script>

View File

@@ -4,15 +4,9 @@
<div class="tablebox"> <div class="tablebox">
<el-table :data="tabledata"> <el-table :data="tabledata">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column align="center" label="序号" width="80"> <el-table-column align="center" label="收费名称">
<template #default="scope"> <template #default="scope">
<div>{{ scope.$index }}</div> <div>{{ scope.row.detailsName }}</div>
</template>
</el-table-column>
<el-table-column align="center" label="房屋/车位/车辆">
<template #default="scope">
<div v-if="scope.row.houseName">{{ scope.row.parkingName }}</div>
<div v-else-if="scope.row.parkingName">{{ scope.row.parkingName }}</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="收费项目"> <el-table-column align="center" label="收费项目">
@@ -22,19 +16,23 @@
</el-table-column> </el-table-column>
<el-table-column align="center" label="收费周期"> <el-table-column align="center" label="收费周期">
<template #default="scope"> <template #default="scope">
<div>{{ scope.row.startDate }} -- {{ scope.row.endDate }}</div> <dict-tag :options="com_bill_charge_period" :value="scope.row.chargePeriod"></dict-tag>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="单价"> <el-table-column align="center" label="单价">
<template #default="scope"> <template #default="scope">
<div>{{ scope.row.fixedPrice }}</div> <div class="flex flex-items-center justify-center">
<div>{{ scope.row.fixedPrice ?? '--' }}</div>
<span v-show="Boolean(scope.row.fixedPrice)">/</span>
<dict-tag v-show="Boolean(scope.row.fixedPrice)" :options="com_charge_item_unit" :value="scope.row.unit"></dict-tag>
</div>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column align="center" label="数量"> <!-- <el-table-column align="center" label="数量">
<template #default="scope"> <template #default="scope">
<div>{{ scope.row.formula }}</div> <div>{{ scope.row.formula }}</div>
</template> </template>
</el-table-column> </el-table-column> -->
<el-table-column align="center" label="缴费状态"> <el-table-column align="center" label="缴费状态">
<template #default="scope"> <template #default="scope">
<dict-tag :options="com_pay_status" :value="scope.row.payStatus"></dict-tag> <dict-tag :options="com_pay_status" :value="scope.row.payStatus"></dict-tag>
@@ -43,7 +41,7 @@
<el-table-column align="center" label="应缴金额"> <el-table-column align="center" label="应缴金额">
<template #default="scope"> <template #default="scope">
<div>{{ scope.row.money }}</div> <div>{{ scope.row.amount }}</div>
</template> </template>
</el-table-column> </el-table-column>
</el-table> </el-table>
@@ -103,6 +101,8 @@ import { billlistType, billQuery } from '@/api/system/SdbCashier';
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { com_pay_method, com_pay_status } = toRefs<any>(proxy?.useDict('com_pay_method', 'com_pay_status')); const { com_pay_method, com_pay_status } = toRefs<any>(proxy?.useDict('com_pay_method', 'com_pay_status'));
const { com_bill_charge_period } = toRefs<any>(proxy?.useDict('com_bill_charge_period'));
const { com_charge_item_unit } = toRefs<any>(proxy?.useDict('com_charge_item_unit'));
type querytype = { type querytype = {
residentId: string; residentId: string;

View File

@@ -28,7 +28,11 @@
</div> </div>
<div class="list_body" v-loading="Searching" v-if="list.length > 0 || Searching"> <div class="list_body" v-loading="Searching" v-if="list.length > 0 || Searching">
<div class="list_value" @click="searchclick(item)" v-for="(item, index) in list" :key="index"> <div class="list_value" @click="searchclick(item)" v-for="(item, index) in list" :key="index">
{{ item.houseName }}-{{ item.residentName }}-{{ item.phone }} {{ item.houseName }}
<!-- <span v-show="Boolean(item.houseName && item.residentName)">-</span>
{{ item.residentName }}
<span v-show="Boolean(item.phone && item.residentName)">-</span>
{{ item.phone }} -->
</div> </div>
</div> </div>
<div v-else class="flex h-full items-center justify-center"> <div v-else class="flex h-full items-center justify-center">
@@ -67,6 +71,7 @@ import { Component, ref } from 'vue';
import cashier from './cashier.vue'; import cashier from './cashier.vue';
import history from './history.vue'; import history from './history.vue';
import versionbody from './versionbody.vue';
import { cashQuery } from '@/api/system/SdbCashier'; import { cashQuery } from '@/api/system/SdbCashier';
/** 当前状态 搜索后 搜索前 */ /** 当前状态 搜索后 搜索前 */
@@ -77,7 +82,6 @@ const onceSearch = ref(false);
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { com_cashier_type } = toRefs<any>(proxy?.useDict('com_cashier_type')); const { com_cashier_type } = toRefs<any>(proxy?.useDict('com_cashier_type'));
console.log(com_cashier_type);
/** 房屋 住户 车辆 车位 */ /** 房屋 住户 车辆 车位 */
const com_cashier_type_list = ref(['houseName', 'residentName']); const com_cashier_type_list = ref(['houseName', 'residentName']);
const searchform = ref(); const searchform = ref();
@@ -141,9 +145,26 @@ function getlist() {
const currenttime = Date.now(); const currenttime = Date.now();
Searching.value = true; Searching.value = true;
searchform.value = {}; searchform.value = {
queryType: 0
};
if (searchType.value === 'phone') {
searchform.value.queryType = 2;
} else {
if (searchType.value === 'houseName') {
searchform.value.queryType = 0;
} else if (searchType.value === 'residentName') {
searchform.value.queryType = 1;
}
}
searchform.value[searchType.value] = searchValue.value; searchform.value[searchType.value] = searchValue.value;
if (searchType.value === 'residentName') {
delete searchform.value[searchType.value];
searchform.value['houseName'] = searchValue.value;
}
let lastdata = []; let lastdata = [];
cashQuery(searchform.value) cashQuery(searchform.value)
.then((res) => { .then((res) => {

View File

@@ -0,0 +1,126 @@
<template>
<div class="app-container">
<el-form :inline="true" :model="queryParams" ref="queryRef" v-show="showSearch">
<el-form-item label="平台">
<el-input v-model="queryParams.platform" placeholder="请输入平台" clearable />
</el-form-item>
<el-form-item label="版本号">
<el-input v-model="queryParams.version" placeholder="请输版本号" clearable />
</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-row :gutter="10" class="mb8">
<el-col>
<el-button type="primary" icon="Plus" @click="handleAdd">新增版本</el-button>
</el-col>
</el-row>
<el-table v-loading="loading" :data="list">
<el-column label="ID" prop="id" />
<el-column label="平台" prop="platform" />
<el-column label="版本号" prop="version" />
<el-column label="更新类型" prop="updateType">
<template #default="scope">
<el-tag v-if="scope.row.updateType === 'apk'">整包</el-tag>
<el-tag v-if="scope.row.updateType === 'wgt'">热更新</el-tag>
<el-tag v-if="scope.row.updateType === 'ios'">苹果商店</el-tag>
</template>
</el-column>
<el-column label="强制更新" prop="isForce">
<template #default="scope">
<el-tag type="danger" v-if="scope.row.isForce === 1"></el-tag>
<el-tag v-else></el-tag>
</template>
</el-column>
<el-column label="状态" prop="status">
<template #default="scope">
<el-tag type="success" v-if="scope.row.status === 0">启用</el-tag>
<el-tag v-else>禁用</el-tag>
</template>
</el-column>
<el-column label="创建时间" prop="createTime" width="180" />
<el-column label="操作" width="150">
<template #default="scope">
<el-button link type="primary" @click="handleUpdate(scope.row)">编辑</el-button>
<el-button link type="danger" @click="handleDelete(scope.row)">删除</el-button>
</template>
</el-column>
</el-table>
<!-- 弹窗 -->
<el-dialog :title="title" v-model="open" width="600px">
<el-form ref="formRef" :model="form" label-width="120px">
<el-form-item label="平台" prop="platform">
<el-select v-model="form.platform">
<el-option label="Android" value="android" />
<el-option label="iOS" value="ios" />
<el-option label="全部" value="all" />
</el-select>
</el-form-item>
<el-form-item label="版本号" prop="version">
<el-input v-model="form.version" placeholder="例如1.0.5" />
</el-form-item>
<el-form-item label="更新类型" prop="updateType">
<el-select v-model="form.updateType">
<el-option label="整包(APK)" value="apk" />
<el-option label="热更新(WGT)" value="wgt" />
<el-option label="苹果商店" value="ios" />
</el-select>
</el-form-item>
<el-form-item label="强制更新" prop="isForce">
<el-radio-group v-model="form.isForce">
<el-radio :label="1"></el-radio>
<el-radio :label="0"></el-radio>
</el-radio-group>
</el-form-item>
<el-form-item label="下载地址" prop="downloadUrl">
<el-input v-model="form.downloadUrl" type="textarea" />
</el-form-item>
<el-form-item label="热更新包地址" prop="wgtUrl">
<el-input v-model="form.wgtUrl" type="textarea" />
</el-form-item>
<el-form-item label="更新内容" prop="updateInfo">
<el-input v-model="form.updateInfo" type="textarea" />
</el-form-item>
<el-form-item label="状态" prop="status">
<el-radio-group v-model="form.status">
<el-radio :label="0">启用</el-radio>
<el-radio :label="1">禁用</el-radio>
</el-radio-group>
</el-form-item>
</el-form>
<template #footer>
<el-button @click="open = false">取消</el-button>
<el-button type="primary" @click="submitForm">确定</el-button>
</template>
</el-dialog>
</div>
</template>
<script setup lang="ts">
const list = ref([]);
const loading = ref(false);
const open = ref(false);
const title = ref('');
const queryRef = ref();
const formRef = ref();
const showSearch = ref(true);
const queryParams = reactive({ platform: '', version: '' });
const form = reactive({
id: null,
platform: '',
version: '',
updateType: '',
isForce: 0,
downloadUrl: '',
wgtUrl: '',
updateInfo: '',
status: 0
});
</script>

View File

@@ -74,15 +74,15 @@
</el-table-column> </el-table-column>
<el-table-column label="分合状态" width="100" align="center"> <el-table-column label="分合状态" width="100" align="center">
<template #default="scope"> <template #default="scope">
<div class="readRecord" v-if="scope.row.waterRecord"> <div class="readRecord" v-if="scope.row.electricityRecord">
<DictTag :options="com_electricity_readrecord_status" :value="scope.row.waterRecord.status"></DictTag> <DictTag :options="com_electricity_readrecord_status" :value="scope.row.electricityRecord.status"></DictTag>
</div> </div>
<span v-else>---</span> <span v-else>---</span>
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="房屋号" align="center" prop="houseName" /> <el-table-column label="房屋号" align="center" prop="houseName" />
<el-table-column label="余额" width="100" align="center" prop="elePrice"> <el-table-column label="余额" width="100" align="center">
<template #defaul="scope"> <template #default="scope">
<span v-if="scope.row.electricityRecord">{{ scope.row.electricityRecord.balance }}</span> <span v-if="scope.row.electricityRecord">{{ scope.row.electricityRecord.balance }}</span>
<span v-else>---</span> <span v-else>---</span>
</template> </template>
@@ -106,7 +106,7 @@
</el-table-column> </el-table-column>
<el-table-column label="抄表时间" align="center"> <el-table-column label="抄表时间" align="center">
<template #default="scope"> <template #default="scope">
<span>{{ scope.row.waterRecord ? scope.row.waterRecord.readTime : '--' }}</span> <span>{{ scope.row.electricityRecord ? scope.row.electricityRecord.readTime : '--' }}</span>
</template> </template>
</el-table-column> </el-table-column>
<!-- <el-table-column width="150" label="启停" align="center" prop="deleted" v-hasPermi="['equipment:isUse:electricitydevice']"> <!-- <el-table-column width="150" label="启停" align="center" prop="deleted" v-hasPermi="['equipment:isUse:electricitydevice']">

View File

@@ -3,10 +3,10 @@
<pageheader></pageheader> <pageheader></pageheader>
<el-card class="flex-1 mt-10px" shadow="never"> <el-card class="flex-1 mt-10px" shadow="never">
<template #header> <template #header>
<el-row :gutter="10" style="font-size: 0.8rem; font-weight: 450"> <el-row style="font-size: 0.8rem; font-weight: 450">
<el-col :span="4"> 设备号 {{ routeid }} </el-col> <el-col :span="4"> 设备号 {{ routeid }} </el-col>
<el-col :span="4"> 房屋号 {{ housename }} </el-col> <el-col :span="8"> 房屋号 {{ housename }} </el-col>
<el-col :span="12"></el-col> <el-col :span="8"></el-col>
<el-col :span="4" class="flex"> <el-col :span="4" class="flex">
<el-button @click="confinem">返回</el-button> <el-button @click="confinem">返回</el-button>
<el-button type="warning" @click="handleExport">导出数据</el-button> <el-button type="warning" @click="handleExport">导出数据</el-button>

View File

@@ -0,0 +1,150 @@
<template>
<div class="flex flex-col h-full p-2">
<pageheader></pageheader>
<el-card class="flex-1 mt-10px" shadow="never">
<template #header>
<div class="flex justify-between items-center">
<el-form class="demo-form-inline" :inline="true">
<el-form-item label="查询日期">
<el-date-picker
clearable
v-model="SearchTime"
@change="
(val) => {
console.log(val);
if (!val) {
queryParams.startDate = '';
queryParams.endDate = '';
return;
}
SearchTime = val;
const days = val;
const [star, end] = days.map((item) => item.split(' ')[0]);
queryParams.startDate = star + ' 00:00:00';
queryParams.endDate = end + ' 23:59:59';
}
"
type="daterange"
value-format="YYYY-MM-DD HH:mm:ss"
format="YYYY-MM-DD"
range-separator=""
start-placeholder="开始日期"
end-placeholder="结束日期"
/>
</el-form-item>
<el-form-item label="" v-hasPermi="['water:topupRecord:list']">
<el-button type="primary" @click="getList">查询</el-button>
</el-form-item>
</el-form>
<el-button @click="handleExport" v-hasPermi="['water:topupRecord:export']" type="warning">导出统计</el-button>
</div>
</template>
<el-table v-loading="loading" border :data="topupRecordList">
<el-table-column label="充值时间" align="center" prop="rechargeTime">
<template #default="scope">
<span v-if="scope.row.rechargeTime">{{ scope.row.rechargeTime }}</span>
<span v-else>---</span>
</template>
</el-table-column>
<el-table-column label="小区名称" align="center" prop="villageName">
<template #default="scope">
<span v-if="scope.row.villageName">{{ scope.row.villageName }}</span>
<span v-else>---</span>
</template>
</el-table-column>
<el-table-column label="户主" align="center" prop="residentName">
<template #default="scope">
<span v-if="scope.row.residentName">{{ scope.row.residentName }}</span>
<span v-else>---</span>
</template>
</el-table-column>
<el-table-column label="房号" align="center" prop="houseName">
<template #default="scope">
<span v-if="scope.row.houseName">{{ scope.row.houseName }}</span>
<span v-else>---</span>
</template>
</el-table-column>
<el-table-column label="单价" align="center" prop="fixedPrice">
<template #default="scope">
<div v-if="scope.row.fixedPrice && scope.row.unit">
<span>{{ scope.row.fixedPrice }}</span>
<span>/</span>
<span>{{ scope.row.unit }}</span>
</div>
<div v-else>
<span>---</span>
</div>
</template>
</el-table-column>
<el-table-column label="设备编号" align="center" prop="deviceCode" />
<el-table-column label="订单号" align="center" prop="orderId" />
<el-table-column label="充值金额" align="center" prop="rechargeAmount" />
<el-table-column label="缴费方式" align="center" prop="topUpType" />
</el-table>
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
</el-card>
</div>
</template>
<script setup lang="ts">
import { getTopupRecordByDate, type TopupRecordList, exportTopupRecordByDate } from '@/api/system/SdbTopupRecord/index';
import { checkPermi } from '@/utils/permission';
const router = useRouter();
const route = useRoute();
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const topupRecordList = ref<TopupRecordList[]>([]);
const loading = ref(false);
const total = ref(0);
const data = reactive({
queryParams: {
pageNum: 1,
pageSize: 10,
startDate: '',
endDate: ''
}
});
const SearchTime = ref([]);
const { queryParams } = toRefs(data);
/** 查询充值记录列表 */
const getList = async () => {
if (!checkPermi(['water:topupRecord:list'])) return;
loading.value = true;
const res = await getTopupRecordByDate(queryParams.value);
topupRecordList.value = res.rows;
total.value = res.total;
loading.value = false;
};
onMounted(() => {
getList();
});
const confinem = () => {
router.back();
};
/** 导出按钮操作 */
const handleExport = () => {
// exportTopupRecordByDate();
proxy?.download(
'/topupRecord/water/export',
{
...queryParams.value
},
`花开物业水费统计表.xlsx`
);
};
</script>
<style lang="scss" scoped>
.el-table {
height: calc(100% - 80px);
}
.el-form-item {
margin-bottom: 0;
}
</style>

View File

@@ -87,7 +87,6 @@ import { ref } from 'vue';
import PageHeader from '@/components/Pageheader/index.vue'; import PageHeader from '@/components/Pageheader/index.vue';
import { getVisitor } from '@/api/system/Visitor'; import { getVisitor } from '@/api/system/Visitor';
import { formatTimeDiff } from '@/utils/time'; import { formatTimeDiff } from '@/utils/time';
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { sys_user_sex } = toRefs<any>(proxy?.useDict('sys_user_sex')); const { sys_user_sex } = toRefs<any>(proxy?.useDict('sys_user_sex'));

View File

@@ -53,9 +53,13 @@
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="区域名称" align="center" prop="areaName" /> <el-table-column label="区域名称" align="center" prop="areaName" />
<el-table-column label="区域编号" align="center" prop="areaCode" /> <el-table-column label="区域编号" align="center" prop="areaCode" />
<el-table-column label="面积" align="center" prop="area" /> <el-table-column label="面积" align="center" prop="area" width="90">
<el-table-column label="车位数量" align="center" prop="parkingCount" /> <template #default="scope">
<el-table-column label="备注" align="center" prop="remark" /> {{ scope.row.area + ' m²' }}
</template>
</el-table-column>
<el-table-column label="车位数量" align="center" prop="parkingCount" width="90" />
<el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
<template #default="scope"> <template #default="scope">
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['area:area:edit']">修改</el-button> <el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['area:area:edit']">修改</el-button>
@@ -122,10 +126,14 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询车位区域管理列表 */ /** 查询车位区域管理列表 */
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
const res = await listArea(queryParams.value); listArea(queryParams.value)
.then((res) => {
areaList.value = res.rows; areaList.value = res.rows;
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
}; };
/** 搜索按钮操作 */ /** 搜索按钮操作 */
@@ -156,7 +164,7 @@ const handleAdd = () => {
/** 修改按钮操作 */ /** 修改按钮操作 */
const handleUpdate = async (row?: AreaVO) => { const handleUpdate = async (row?: AreaVO) => {
const _id = row.id || ids.value[0]; const _id = row ? row.id : ids.value[0];
router.push({ router.push({
path: '/carArea/editCarArea', path: '/carArea/editCarArea',
query: { query: {

View File

@@ -15,8 +15,8 @@
</el-col> </el-col>
<el-col :span="2"></el-col> <el-col :span="2"></el-col>
<el-col :span="11"> <el-col :span="11">
<el-form-item label="车位号" prop="parkingId"> <el-form-item label="车位号" prop="parkingId">
<el-select v-model="form.parkingId" placeholder="请选择车位号"> <el-select v-model="form.parkingId" placeholder="请选择车位号">
<el-option v-for="item in parkinglist" :key="item.id" :label="item.parkingCode" :value="item.id" /> <el-option v-for="item in parkinglist" :key="item.id" :label="item.parkingCode" :value="item.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
@@ -207,6 +207,7 @@ if (route.query.id) {
...form.value, ...form.value,
...res.data ...res.data
}; };
changeArealist(res.data.areaId);
}); });
} }

View File

@@ -50,14 +50,14 @@
<el-table v-loading="loading" border :data="carList" @selection-change="handleSelectionChange"> <el-table v-loading="loading" border :data="carList" @selection-change="handleSelectionChange">
<el-table-column type="selection" width="55" align="center" /> <el-table-column type="selection" width="55" align="center" />
<el-table-column label="车牌号" align="center" prop="carNum" /> <el-table-column label="车牌号" width="155" align="center" prop="carNum" />
<el-table-column label="车辆品牌" align="center" prop="carBrand" /> <el-table-column label="车辆品牌" width="155" align="center" prop="carBrand" />
<el-table-column label="车辆型号" align="center" prop="carModel" /> <el-table-column label="车辆型号" width="155" align="center" prop="carModel" />
<el-table-column label="车身颜色" align="center" prop="carColor" /> <el-table-column label="车身颜色" width="125" align="center" prop="carColor" />
<el-table-column label="持有人" align="center" prop="residentId"> <el-table-column label="持有人" width="155" align="center" prop="residentId">
<template #default="scope"> {{ getResidentName(scope.row.residentId) }} </template> <template #default="scope"> {{ getResidentName(scope.row.residentId) }} </template>
</el-table-column> </el-table-column>
<el-table-column label="备注" align="center" prop="remark" /> <el-table-column label="备注" align="center" prop="remark" show-overflow-tooltip />
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width"> <el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
<template #default="scope"> <template #default="scope">
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['car:car:edit']">修改</el-button> <el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['car:car:edit']">修改</el-button>
@@ -143,11 +143,17 @@ const getResidentName = (id: string) => {
/** 查询车辆管理列表 */ /** 查询车辆管理列表 */
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
const res = await listCar(queryParams.value);
const res1 = await listResident(); listCar(queryParams.value)
ResidentList.value = res1.rows; .then((res) => {
carList.value = res.rows; carList.value = res.rows;
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false;
});
const res1 = await listResident();
ResidentList.value = res1.rows;
loading.value = false; loading.value = false;
}; };

View File

@@ -233,7 +233,7 @@ const submitForm = () => {
/** 删除按钮操作 */ /** 删除按钮操作 */
const handleDelete = async (row?: DeviceVO) => { const handleDelete = async (row?: DeviceVO) => {
const _ids = row?.id || ids.value; const _ids = row?.id || ids.value;
await proxy?.$modal.confirm('是否确认删除设备编号为"' + _ids + '"的数据项').finally(() => (loading.value = false)); await proxy?.$modal.confirm('是否确认删除设备?').finally(() => (loading.value = false));
await delDevice(_ids); await delDevice(_ids);
proxy?.$modal.msgSuccess('删除成功'); proxy?.$modal.msgSuccess('删除成功');
await getList(); await getList();

View File

@@ -146,7 +146,8 @@ init();
async function getlist() { async function getlist() {
loading.value = true; loading.value = true;
const rows = await listDeviceRepair(); listDeviceRepair()
.then((rows) => {
deviceRepairList.value = rows.rows; deviceRepairList.value = rows.rows;
deviceRepairList.value.forEach((item) => { deviceRepairList.value.forEach((item) => {
item.maintainUserNames = item.maintainUserList item.maintainUserNames = item.maintainUserList
@@ -155,7 +156,10 @@ async function getlist() {
.join(','); .join(',');
}); });
total.value = rows.total; total.value = rows.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
} }
/** 删除按钮操作 */ /** 删除按钮操作 */
@@ -222,6 +226,7 @@ const cancelForm = () => {
display: flex; display: flex;
align-items: center; align-items: center;
.label { .label {
font-size: 15px;
width: 100px; width: 100px;
text-align: right; text-align: right;
} }

View File

@@ -140,10 +140,14 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询设备分类列表 */ /** 查询设备分类列表 */
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
const res = await listDeviceCategory(queryParams.value); listDeviceCategory(queryParams.value)
.then((res) => {
deviceCategoryList.value = res.rows; deviceCategoryList.value = res.rows;
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
}; };
/** 取消按钮 */ /** 取消按钮 */

View File

@@ -7,7 +7,13 @@
<el-form class="formBody" label-position="right" ref="formRef" :model="form" :rules="rules" label-width="130px"> <el-form class="formBody" label-position="right" ref="formRef" :model="form" :rules="rules" label-width="130px">
<el-form-item label="维修设备" prop="deviceId"> <el-form-item label="维修设备" prop="deviceId">
<el-select v-model="form.deviceId"> <el-select v-model="form.deviceId">
<el-option v-for="(item, index) in deviceCategorylist" :key="index" :value="item.id" :label="item.categoryName"></el-option> <el-option
v-for="(item, index) in deviceCategorylist"
:key="index"
:disabled="item.status === 1"
:value="item.id"
:label="item.categoryName"
></el-option>
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="设备名称" prop="deviceName"> <el-form-item label="设备名称" prop="deviceName">
@@ -210,6 +216,7 @@ const cancelForm = () => {
border: 1px solid #ccc; border: 1px solid #ccc;
padding: 5px 10px; padding: 5px 10px;
border-radius: 5px; border-radius: 5px;
min-width: 100px;
&.add { &.add {
cursor: pointer; cursor: pointer;
border-style: dashed; border-style: dashed;

View File

@@ -147,7 +147,8 @@ const { queryParams, form } = toRefs(data);
// TODO 设备维修记录 用户id有用户信息没有 // TODO 设备维修记录 用户id有用户信息没有
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
const res = await listDeviceRepair(queryParams.value); listDeviceRepair(queryParams.value)
.then((res) => {
deviceRepairList.value = res.rows; deviceRepairList.value = res.rows;
deviceRepairList.value.forEach((item) => { deviceRepairList.value.forEach((item) => {
if (item.maintainUserList && item.maintainUserList.length > 0) { if (item.maintainUserList && item.maintainUserList.length > 0) {
@@ -158,7 +159,10 @@ const getList = async () => {
} }
}); });
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
}; };
/** 取消按钮 */ /** 取消按钮 */

View File

@@ -157,7 +157,7 @@ const cancelForm = () => {
gap: 20px; gap: 20px;
margin-bottom: 20px; margin-bottom: 20px;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(3, 1fr);
font-size: 0.98rem; font-size: 0.8rem;
.info_item { .info_item {
display: flex; display: flex;
align-items: center; align-items: center;

View File

@@ -57,16 +57,16 @@
<span></span> <span></span>
</div> </div>
</el-form-item> </el-form-item>
<!-- <el-form-item label="车位号" prop="parkingId"> <el-form-item label="车位号" prop="parkingId">
<el-select v-model="form.parkingId" class="m-2" placeholder="请选择车位号"> <el-select v-model="form.parkingId" class="m-2" placeholder="请选择车位号">
<el-option v-for="item in parkinglist" :key="item.id" :label="item.parkingName" :value="item.id" /> <el-option v-for="item in parkinglist" :key="item.id" :label="item.parkingName" :value="item.id" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="储藏室" prop="storeroomId"> <el-form-item label="储藏室" prop="storeroomId">
<el-select v-model="form.storeroomId" class="m-2" placeholder="请选择储藏室"> <el-select v-model="form.storeroomId" class="m-2" placeholder="请选择储藏室">
<el-option v-for="item in storeRoomlist" :key="item.id" :label="item.storeroomName" :value="item.id" /> <el-option v-for="(item, index) in storeRoomlist" :key="index" :label="item.storeroomName" :value="item.id" />
</el-select> </el-select>
</el-form-item> --> </el-form-item>
<el-form-item style="margin-top: 30px"> <el-form-item style="margin-top: 30px">
<el-button type="primary" @click="submitForm">确定</el-button> <el-button type="primary" @click="submitForm">确定</el-button>
<el-button @click="cancelForm">取消</el-button> <el-button @click="cancelForm">取消</el-button>
@@ -85,7 +85,7 @@ import { addHouseAPI, EditHouseApi, getBuildingOnly, getHouseApi, getHouselistAP
import { addHouseType } from '@/api/system/house/type'; import { addHouseType } from '@/api/system/house/type';
import { GetVillageListParking, listParking } from '@/api/system/parking'; import { GetVillageListParking, listParking } from '@/api/system/parking';
import { GetVillagelistStoreroom, listStoreroom } from '@/api/system/storeroom'; import { GetVillagelistStoreroom, listStoreroom } from '@/api/system/storeroom';
import { listHouseUseType } from '@/api/system/houseUse'; import { listHouseUseType, listHouseUseType_add_house } from '@/api/system/houseUse';
import { getByBUildingidtoUnitNo } from '@/api/system/houseUnit'; import { getByBUildingidtoUnitNo } from '@/api/system/houseUnit';
// const { proxy } = getCurrentInstance() as ComponentInternalInstance; // const { proxy } = getCurrentInstance() as ComponentInternalInstance;
@@ -143,23 +143,21 @@ init();
const houseUseTypeList = ref([]); const houseUseTypeList = ref([]);
async function geteditinfo() { async function geteditinfo() {
listHouseUseType({ listHouseUseType_add_house().then((res) => {
pageNum: 1, houseUseTypeList.value = res.data;
pageSize: 99999
}).then((res) => {
houseUseTypeList.value = res.rows;
}); });
if (route.query.id) { if (route.query.id) {
houseid.value = route.query.id; houseid.value = route.query.id;
// const res = await GetVillageListParking(villageid, houseid.value); const res = await GetVillageListParking(villageid, houseid.value);
// parkinglist.value = res.data; parkinglist.value = res.data;
// GetVillagelistStoreroom({
// ...queryChangestore.value, const res1 = await GetVillagelistStoreroom({
// villageid: villageid, ...queryChangestore.value,
// houseId: houseid.value villageid: villageid,
// }).then((res1) => { houseId: houseid.value
// storeRoomlist.value = res1.data; });
// }); storeRoomlist.value = res1.data.filter((item) => item);
getHouseApi(houseid.value).then((res) => { getHouseApi(houseid.value).then((res) => {
form.value = { form.value = {
...form.value, ...form.value,
@@ -176,8 +174,7 @@ async function geteditinfo() {
shareArea: res.data.shareArea // 公摊面积 shareArea: res.data.shareArea // 公摊面积
}; };
housetype.value = res.data.houseType.split(''); housetype.value = res.data.houseType.split('');
// handlechangeBuild(form.value.buildingId); queryChangestore.value.buildingId = form.value.buildingId;
console.log(housetype.value);
changeBuild(res.data.buildingId); changeBuild(res.data.buildingId);
}); });
} else { } else {
@@ -195,9 +192,8 @@ function handlechangeBuild(id: string) {
queryChangestore.value.buildingId = id; queryChangestore.value.buildingId = id;
form.value.unitNoId = ''; form.value.unitNoId = '';
form.value.floorNo = ''; form.value.floorNo = '';
changeBuild(id); changeBuild(id);
// getStoreRoomlist(); getStoreRoomlist();
} }
function changeBuild(id: string) { function changeBuild(id: string) {
@@ -220,7 +216,7 @@ function changeBuild(id: string) {
function changeUnitNo(id: string) { function changeUnitNo(id: string) {
queryChangestore.value.unitNoId = id; queryChangestore.value.unitNoId = id;
form.value.floorNo = ''; form.value.floorNo = '';
// getStoreRoomlist(); getStoreRoomlist();
} }
// 查询储藏室列表 // 查询储藏室列表

View File

@@ -54,7 +54,8 @@
<span>储藏室信息 </span> <span>储藏室信息 </span>
<el-button v-hasPermi="['storeroom:storeroom:edit']" type="primary" text v-if="HouseInfo.storeroom" @click="editStoreRoom">编辑</el-button> <el-button v-hasPermi="['storeroom:storeroom:edit']" type="primary" text v-if="HouseInfo.storeroom" @click="editStoreRoom">编辑</el-button>
</div> </div>
<div class="addBuildingFormBody" v-if="HouseInfo.storeroom"> <div class="" v-if="HouseInfo.storeroom">
<div class="addBuildingFormBody">
<div class="descriptionsbox"> <div class="descriptionsbox">
<div class="label">楼栋:</div> <div class="label">楼栋:</div>
<div class="value">{{ HouseInfo.storeroom?.buildingName ?? '--' }}</div> <div class="value">{{ HouseInfo.storeroom?.buildingName ?? '--' }}</div>
@@ -79,11 +80,14 @@
<div class="label">实用面积:</div> <div class="label">实用面积:</div>
<div class="value">{{ HouseInfo.storeroom?.internalArea ?? '--' }}</div> <div class="value">{{ HouseInfo.storeroom?.internalArea ?? '--' }}</div>
</div> </div>
<div class="descriptionsbox"> <div class="descriptionsbox" style="grid-column-start: 1; grid-column-end: 4">
<div class="label">备注:</div> <div class="label">备注:</div>
<div class="value"></div> <div class="value">{{ HouseInfo.storeroom?.remark ?? '--' }}</div>
</div> </div>
</div> </div>
<!-- <div class="addBuildingFormBody remarkbuildingformbody">
</div> -->
</div>
<div v-else class="w-full h-full flex flex-center min-h-4rem"> <div v-else class="w-full h-full flex flex-center min-h-4rem">
<span style="color: #999; font-weight: 500; font-size: 1.1rem; letter-spacing: 10px">暂无信息</span> <span style="color: #999; font-weight: 500; font-size: 1.1rem; letter-spacing: 10px">暂无信息</span>
</div> </div>
@@ -161,12 +165,22 @@
</div> </div>
<div> <div>
<el-table :data="HouseInfo.chargeItemList" style="width: 100%"> <el-table :data="HouseInfo.chargeItemList" style="width: 100%">
<el-table-column prop="date" label="收费项目" /> <el-table-column prop="itemName" label="收费项目" />
<el-table-column prop="name" label="收费标准" /> <el-table-column prop="name" label="收费标准">
<el-table-column prop="name" label="开始时间" /> <template #default="scope">
<el-table-column prop="name" label="结束时间" /> <div class="flex">
<el-table-column prop="name" label="备注" /> <span>{{ scope.row.fixedPrice }}</span> /
<el-table-column prop="address" label="操作" /> <dict-tag :options="com_charge_item_unit" :value="scope.row.unit"></dict-tag>
</div>
</template>
</el-table-column>
<el-table-column prop="createTime" label="开始时间" />
<el-table-column prop="name" label="结束时间">
<template #default>
<span>---</span>
</template>
</el-table-column>
<el-table-column prop="remark" label="备注" />
</el-table> </el-table>
</div> </div>
</div> </div>
@@ -232,6 +246,7 @@ const { sys_user_sex } = toRefs<any>(proxy?.useDict('sys_user_sex'));
const { com_pay_status } = toRefs<any>(proxy?.useDict('com_pay_status')); const { com_pay_status } = toRefs<any>(proxy?.useDict('com_pay_status'));
const { com_parking_type } = toRefs<any>(proxy?.useDict('com_parking_type')); const { com_parking_type } = toRefs<any>(proxy?.useDict('com_parking_type'));
const { com_parking_status } = toRefs<any>(proxy?.useDict('com_parking_status')); const { com_parking_status } = toRefs<any>(proxy?.useDict('com_parking_status'));
const { com_charge_item_unit } = toRefs<any>(proxy?.useDict('com_charge_item_unit'));
const route = useRoute(); const route = useRoute();
const router = useRouter(); const router = useRouter();
@@ -316,7 +331,9 @@ init();
display: grid; display: grid;
grid-template-columns: repeat(3, 1fr); grid-template-columns: repeat(3, 1fr);
grid-template-rows: repeat(3, 1fr); grid-template-rows: repeat(3, 1fr);
&.remarkbuildingformbody {
display: block;
}
.descriptionsbox { .descriptionsbox {
display: flex; display: flex;
align-items: center; align-items: center;

View File

@@ -6,7 +6,7 @@
<span class="pointer" @click="handleAddBuilding" v-hasPermi="['system:building:add']">+增加楼栋</span> <span class="pointer" @click="handleAddBuilding" v-hasPermi="['system:building:add']">+增加楼栋</span>
</div> </div>
</div> </div>
<ul> <ul class="flex-1 overflow-y-auto overflow-x-hidden">
<li <li
v-for="(item, index) in currentBuildingInfoList" v-for="(item, index) in currentBuildingInfoList"
:class="{ :class="{
@@ -67,6 +67,9 @@ $primary_color: #1978fe;
border-radius: 2px; border-radius: 2px;
color: rgba(0, 0, 0, 1); color: rgba(0, 0, 0, 1);
margin-right: 10px; margin-right: 10px;
display: flex;
flex-direction: column;
.buildingheader { .buildingheader {
height: 60px; height: 60px;
line-height: 60px; line-height: 60px;

View File

@@ -1,9 +1,14 @@
<template> <template>
<div class="house-list"> <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"> <div class="house flex align-center" @contextmenu="contextMenu.open($event, house.houseId)" v-for="house in list.houses" :key="house.houseId">
<div class="flex flex-center"> <div class="w-full flex items-center justify-between">
<el-checkbox :label="house.houseNo" :value="house.houseId" /> <el-checkbox :label="house.houseNo" :value="house.houseId" />
<div class="calp" @click="handleCalp($event, house.houseId)">···</div> <!-- <div class="calp" @click="handleCalp($event, house.houseId)">···</div> -->
<div class="circlebox" @click="handleCalp($event, house.houseId)">
<div class="circle"></div>
<div class="circle"></div>
<div class="circle"></div>
</div>
</div> </div>
</div> </div>
<!-- 右键菜单组件 --> <!-- 右键菜单组件 -->
@@ -41,6 +46,25 @@ const handleCalp = (event: MouseEvent, houseid: string) => {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.circlebox {
width: 14px;
height: 14px;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
gap: 2px;
$circleSize: 3px;
margin-left: 10px;
cursor: pointer;
.circle {
width: $circleSize;
height: $circleSize;
border-radius: 50%;
background-color: #666666;
}
}
.house-list { .house-list {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
@@ -57,7 +81,7 @@ const handleCalp = (event: MouseEvent, houseid: string) => {
border: 1px solid #ddd; border: 1px solid #ddd;
border-radius: 4px; border-radius: 4px;
margin: 5px; margin: 5px;
padding-left: 10px; padding: 0 10px;
} }
.house:hover { .house:hover {
background: #e8f3ff; background: #e8f3ff;
@@ -75,19 +99,4 @@ const handleCalp = (event: MouseEvent, houseid: string) => {
top: 0; top: 0;
left: 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> </style>

View File

@@ -1,6 +1,6 @@
<template> <template>
<div class="h-full"> <div class="tablebox1 h-full flex-1">
<div class="TableBox p-5 h-full" v-if="houseStore.currentHouseInfoList !== null"> <div class="TableBox p-5" v-if="houseStore.currentHouseInfoList !== null">
<el-checkbox-group @change="handleChangeCheckhouses" v-model="houseStore.checkoutHouses"> <el-checkbox-group @change="handleChangeCheckhouses" v-model="houseStore.checkoutHouses">
<el-table border :data="houseStore.currentFloorInfoList"> <el-table border :data="houseStore.currentFloorInfoList">
<el-table-column align="center" fixed label="楼层\单元" max-width="100"> <el-table-column align="center" fixed label="楼层\单元" max-width="100">
@@ -16,8 +16,15 @@
> >
<template #header> <template #header>
<span>{{ unit.unitNoName }}</span> <span>{{ unit.unitNoName }}</span>
<el-button link type="primary" icon="Edit" @click="HandleEditUnit(unit)"></el-button> <el-button v-hasPermi="['unitNo:unitNo:edit']" link type="primary" icon="Edit" @click="HandleEditUnit(unit)"></el-button>
<el-button link type="danger" icon="Delete" style="margin-left: 0" @click="HandleDeleteUnit(unit)"></el-button> <el-button
v-hasPermi="['unitNo:unitNo:remove']"
link
type="danger"
icon="Delete"
style="margin-left: 0"
@click="HandleDeleteUnit(unit)"
></el-button>
</template> </template>
<template #default="{ row }"> <template #default="{ row }">
<houseItem @contextmenufun="contextMenuFun" :menu-list="menutlist" :unit="unit.floors" :f-idx="row"></houseItem> <houseItem @contextmenufun="contextMenuFun" :menu-list="menutlist" :unit="unit.floors" :f-idx="row"></houseItem>
@@ -104,9 +111,22 @@ function HandleDeleteUnit(unit) {
</script> </script>
<style scoped lang="scss"> <style scoped lang="scss">
.TableBox { .tablebox1 {
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
overflow: hidden;
.TableBox {
height: 100%;
.el-checkbox-group {
height: 100%;
overflow-y: auto;
}
.el-table { .el-table {
height: calc(100% - 500px); width: 100%;
height: 100%;
}
} }
} }
.nodata { .nodata {

View File

@@ -15,31 +15,24 @@
>楼栋结构{{ houseStore.currentBuildingInfo?.buildStructure ? `${houseStore.currentBuildingInfo?.buildStructure}(m)` : '--' }} >楼栋结构{{ houseStore.currentBuildingInfo?.buildStructure ? `${houseStore.currentBuildingInfo?.buildStructure}(m)` : '--' }}
</span> </span>
</div> --> </div> -->
<div> <div style="text-wrap: nowrap">
<span class="text-size-16px text-color-black text-widget-bold mr-30px"> <span class="text-size-16px text-color-black text-widget-bold mr-30px">
<strong>{{ houseStore.currentBuildingInfo?.buildingName }}</strong> <strong>{{ houseStore.currentBuildingInfo?.buildingName }}</strong>
</span> </span>
<span class="mr-15px" <span class="mr-15px"
>楼栋朝向:{{ houseStore.currentBuildingInfo?.buildToward ? `${houseStore.currentBuildingInfo?.buildToward}` : '--' }}</span >楼栋朝向:{{ houseStore.currentBuildingInfo?.buildToward ? `${houseStore.currentBuildingInfo?.buildToward}` : ' --' }}</span
> >
<span class="mr-15px">楼高{{ houseStore.currentBuildingInfo?.buildTall ? `${houseStore.currentBuildingInfo?.buildTall}(m)` : '--' }}</span> <span class="mr-15px">楼高:{{ houseStore.currentBuildingInfo?.buildTall ? `${houseStore.currentBuildingInfo?.buildTall}(m)` : ' --' }}</span>
<span class="mr-15px" <span class="mr-15px"
>楼栋结构{{ houseStore.currentBuildingInfo?.buildStructure ? `${houseStore.currentBuildingInfo?.buildStructure}` : '--' }} >楼栋结构:{{ houseStore.currentBuildingInfo?.buildStructure ? `${houseStore.currentBuildingInfo?.buildStructure}` : ' --' }}
</span> </span>
</div> </div>
<div class="rightActions flex flex-items-center"> <div style="text-wrap: nowrap" class="rightActions flex flex-items-center">
<span class="mr-20px" @click="handleAddUnit" v-hasPermi="['system:house:add']">+添加单元</span> <span class="mr-20px" @click="handleAddUnit" v-hasPermi="['unitNo:unitNo:add']">+添加单元</span>
<span class="mr-20px" @click="handleAddHouse" v-hasPermi="['system:house:add']">+增加房屋</span> <span class="mr-20px" @click="handleAddHouse" v-hasPermi="['system:house:add']">+增加房屋</span>
<!-- <span class="mr-20px">收费标准设置</span> --> <!-- <span class="mr-20px">收费标准设置</span> -->
<span @click="deleteAllhouse" v-hasPermi="['system:house:remove']">删除</span> <span @click="deleteAllhouse" v-hasPermi="['system:house:remove']">批量删除房屋</span>
<el-select <el-select clearable @clear="handleClearUse" @change="handleChangeUse" v-model="houseUse" placeholder="筛选房屋类型" class="selectbox">
clearable
@clear="handleClearUse"
@change="handleChangeUse"
v-model="houseUse"
placeholder="筛选房屋类型"
style="width: 180px; margin: 0 10px"
>
<el-option v-for="item in houseUseTypeList" :key="item.id" :label="item.name" :value="item.id" /> <el-option v-for="item in houseUseTypeList" :key="item.id" :label="item.name" :value="item.id" />
</el-select> </el-select>
<div class="searchbox flex flex-items-center"> <div class="searchbox flex flex-items-center">
@@ -49,9 +42,9 @@
</div> </div>
</div> </div>
</div> </div>
<div class="UnitBody"> <!-- <div class="UnitBody"> -->
<TableUnit @edit-unit="handleEditUnit" @delete-unit="handleDelete"></TableUnit> <TableUnit @edit-unit="handleEditUnit" @delete-unit="handleDelete"></TableUnit>
</div> <!-- </div> -->
<!-- 添加或修改单元对话框 --> <!-- 添加或修改单元对话框 -->
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body> <el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
<el-form ref="unitNoFormRef" :model="form" :rules="rules" label-width="80px"> <el-form ref="unitNoFormRef" :model="form" :rules="rules" label-width="80px">
@@ -79,7 +72,7 @@
import { deleteHouseApi } from '@/api/system/house'; import { deleteHouseApi } from '@/api/system/house';
import TableUnit from './components/table.vue'; import TableUnit from './components/table.vue';
import { useHouseStore } from '@/store/modules/house'; import { useHouseStore } from '@/store/modules/house';
import { listHouseUseType } from '@/api/system/houseUse'; import { listHouseUseType, listHouseUseType_add_house } from '@/api/system/houseUse';
import { addUnitNo, delUnitNo, getUnitNo, updateUnitNo } from '@/api/system/houseUnit'; import { addUnitNo, delUnitNo, getUnitNo, updateUnitNo } from '@/api/system/houseUnit';
import { UnitNoVO } from '@/api/system/houseUnit/type'; import { UnitNoVO } from '@/api/system/houseUnit/type';
@@ -96,11 +89,8 @@ const houseUseTypeList = ref([]);
* 获取房屋 类型 * 获取房屋 类型
*/ */
function init() { function init() {
listHouseUseType({ listHouseUseType_add_house().then((res) => {
pageNum: 1, houseUseTypeList.value = res.data;
pageSize: 99999
}).then((res) => {
houseUseTypeList.value = res.rows;
}); });
} }
init(); init();
@@ -228,6 +218,8 @@ $primary_color: #1978fe;
display: flex; display: flex;
flex-direction: column; flex-direction: column;
overflow: hidden; overflow: hidden;
min-height: 0;
.Unit_top { .Unit_top {
padding: 20px; padding: 20px;
height: 60px; height: 60px;
@@ -238,15 +230,24 @@ $primary_color: #1978fe;
span { span {
cursor: pointer; cursor: pointer;
} }
.selectbox {
width: 150px;
margin: 0 10px;
@media (max-width: 1550px) {
width: 120px;
}
@media (max-width: 1400px) {
width: 80px;
}
}
.searchbox { .searchbox {
.searchinput { .searchinput {
width: 250px; width: 250px;
@media (max-width: 1200px) { @media (max-width: 1550px) {
width: 50px; width: 130px;
} }
@media (max-width: 1400px) { @media (max-width: 1400px) {
width: 130px; width: 50px;
} }
} }
} }
@@ -256,6 +257,7 @@ $primary_color: #1978fe;
flex: 1; flex: 1;
overflow-x: hidden; overflow-x: hidden;
overflow-y: auto; overflow-y: auto;
display: flex;
} }
} }
</style> </style>

View File

@@ -1,5 +1,5 @@
<template> <template>
<div class="p-2 houselist"> <div class="p-2 houselist flex flex-col">
<PageHeader> <PageHeader>
<template #content> <template #content>
<div class="houseAdressBox"> <div class="houseAdressBox">
@@ -32,13 +32,13 @@ init();
<style lang="scss" scoped> <style lang="scss" scoped>
.houselist { .houselist {
flex: 1;
box-sizing: border-box; box-sizing: border-box;
height: calc(100vh - 84px); height: 100%;
min-height: calc(100vh - 84px);
.houseBody { .houseBody {
height: calc(100% - 200px); flex: 1;
margin-top: 10px; margin-top: 10px;
min-height: 0;
overflow: hidden;
} }
} }
.houseAdressBox { .houseAdressBox {

View File

@@ -13,8 +13,8 @@
</el-col> </el-col>
<el-col :span="2"></el-col> <el-col :span="2"></el-col>
<el-col :span="11"> <el-col :span="11">
<el-form-item label="租户姓名" prop="rentalName"> <el-form-item label="业主姓名" prop="rentalName">
<el-input v-model="form.rentalName" placeholder="请输入住户姓名" /> <el-input disabled v-model="form.rentalName" placeholder="请输入业主姓名" />
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@@ -94,7 +94,7 @@
<el-row> <el-row>
<el-col :span="24"> <el-col :span="24">
<el-form-item label="房屋设施" prop="type"> <el-form-item label="房屋设施" prop="type">
<div class="housedevicesbox"> <div class="housedevicesbox" v-if="housefacilities.length > 0">
<div <div
v-for="item in housefacilities" v-for="item in housefacilities"
:key="item.id" :key="item.id"
@@ -108,6 +108,7 @@
<span class="ml-2">{{ item.name }}</span> <span class="ml-2">{{ item.name }}</span>
</div> </div>
</div> </div>
<span v-else style="color: gray"> </span>
</el-form-item> </el-form-item>
</el-col> </el-col>
</el-row> </el-row>
@@ -181,7 +182,7 @@ import { HouseRentalVO } from '@/api/system/houseRental/type';
import { CascaderValue, UploadInstance, UploadProps, UploadUserFile } from 'element-plus'; import { CascaderValue, UploadInstance, UploadProps, UploadUserFile } from 'element-plus';
import { getHousePathById, hasFormData, splitStringUrl } from '@/utils/house'; import { getHousePathById, hasFormData, splitStringUrl } from '@/utils/house';
import { addHouseRental, getHouseRental, updateHouseRental, uploadHouseImage } from '@/api/system/houseRental'; import { addHouseRental, getHouseOwnUser, getHouseRental, updateHouseRental, uploadHouseImage } from '@/api/system/houseRental';
import { validator } from '@/utils/Reg'; import { validator } from '@/utils/Reg';
import { useHouseStore } from '@/store/modules/house'; import { useHouseStore } from '@/store/modules/house';
import { listHouseFacilities } from '@/api/system/HouseFacilities'; import { listHouseFacilities } from '@/api/system/HouseFacilities';
@@ -265,6 +266,11 @@ gettreedata();
function handleChange(val: CascaderValue) { function handleChange(val: CascaderValue) {
userHousepath.value = val; userHousepath.value = val;
form.value.houseId = val[2]; form.value.houseId = val[2];
getHouseOwnUser(val[2]).then((res) => {
console.log(res.data);
form.value.rentalName = res.data;
});
} }
// !== 上传文件 ============================================================================= // !== 上传文件 =============================================================================
const fileList = ref<UploadUserFile[]>([]); const fileList = ref<UploadUserFile[]>([]);

View File

@@ -51,12 +51,23 @@
<span style="margin-right: 10px" v-for="item in HouseInfo.facilitieslist" :key="item">{{ handlefacilities(item) }} </span> <span style="margin-right: 10px" v-for="item in HouseInfo.facilitieslist" :key="item">{{ handlefacilities(item) }} </span>
</div> </div>
</div> </div>
<el-row> <el-row :span="24">
<el-col :span="10"> <el-col :span="24">
<div class="descriptionsbox"> <div class="descriptionsbox">
<div class="label">房屋照片:</div> <div class="label">房屋照片:</div>
<div class="value grid grid-cols-4 gap-4"> <div class="value">
<el-image v-for="(item, index) in HouseInfo.houseImageUrls" :key="index" :src="splitImages(item)" class="houseImage"></el-image> <el-image
v-for="(item, index) in HouseInfo.houseImageUrls"
:key="index"
:zoom-rate="1.2"
:max-scale="7"
:min-scale="0.2"
:src="item"
:preview-src-list="HouseInfo.houseImageUrls"
show-progress
:initial-index="0"
class="houseImage"
></el-image>
</div> </div>
</div> </div>
</el-col> </el-col>
@@ -199,6 +210,8 @@ function handlBack() {
.houseImage { .houseImage {
width: 200px; width: 200px;
height: 100px; height: 100px;
margin: 10px 5px;
object-fit: cover;
} }
.descriptionsbox { .descriptionsbox {
display: flex; display: flex;

View File

@@ -11,7 +11,7 @@
<el-option v-for="item in com_house_use" :key="item.value" :label="item.label" :value="item.value" /> <el-option v-for="item in com_house_use" :key="item.value" :label="item.label" :value="item.value" />
</el-select> </el-select>
</el-form-item> </el-form-item>
<el-form-item label="发布人" prop="houseId"> <el-form-item label="发布人" prop="rentalName">
<el-input v-model="queryParams.rentalName" placeholder="请输入" clearable @keyup.enter="handleQuery" /> <el-input v-model="queryParams.rentalName" placeholder="请输入" clearable @keyup.enter="handleQuery" />
</el-form-item> </el-form-item>
<el-form-item> <el-form-item>
@@ -163,10 +163,14 @@ const { queryParams, form } = toRefs(data);
/** 查询房屋租赁管理列表 */ /** 查询房屋租赁管理列表 */
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
const res = await listHouseRental(queryParams.value); listHouseRental(queryParams.value)
.then((res) => {
houseRentalList.value = res.rows; houseRentalList.value = res.rows;
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
}; };
/** 取消按钮 */ /** 取消按钮 */
@@ -190,6 +194,8 @@ const handleQuery = () => {
/** 重置按钮操作 */ /** 重置按钮操作 */
const resetQuery = () => { const resetQuery = () => {
queryFormRef.value?.resetFields(); queryFormRef.value?.resetFields();
queryParams.value.houseUse = '';
queryParams.value.rentalName = '';
handleQuery(); handleQuery();
}; };

View File

@@ -150,10 +150,14 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询单元列表 */ /** 查询单元列表 */
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
const res = await listUnitNo(queryParams.value); listUnitNo(queryParams.value)
.then((res) => {
unitNoList.value = res.rows; unitNoList.value = res.rows;
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
}; };
/** 取消按钮 */ /** 取消按钮 */

View File

@@ -112,10 +112,14 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询房屋类型列表 */ /** 查询房屋类型列表 */
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
const res = await listHouseUseType(queryParams.value); listHouseUseType(queryParams.value)
.then((res) => {
houseUseTypeList.value = res.rows; houseUseTypeList.value = res.rows;
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
}; };
/** 取消按钮 */ /** 取消按钮 */

View File

@@ -78,10 +78,14 @@ const { queryParams } = toRefs(data);
const getList = async () => { const getList = async () => {
queryParams.value.statDate = starDate.value.join('-'); queryParams.value.statDate = starDate.value.join('-');
loading.value = true; loading.value = true;
const res = await listItem(queryParams.value); listItem(queryParams.value)
.then((res) => {
itemList.value = res.rows; itemList.value = res.rows;
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
}; };
/** 搜索按钮操作 */ /** 搜索按钮操作 */

View File

@@ -20,17 +20,6 @@
<el-card class="flex-1" shadow="never"> <el-card class="flex-1" shadow="never">
<template #header> <template #header>
<el-row :gutter="10" class="mb8"> <el-row :gutter="10" class="mb8">
<el-col :span="1.5">
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['system:item:add']">新增</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['system:item:edit']">编辑</el-button>
</el-col>
<el-col :span="1.5">
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['system:item:remove']"
>删除</el-button
>
</el-col>
<right-toolbar <right-toolbar
:disable-delete="multiple" :disable-delete="multiple"
:disable-edit="single" :disable-edit="single"
@@ -53,8 +42,8 @@
<el-switch <el-switch
@change="(val: string) => handleChange(val, scope.row.id)" @change="(val: string) => handleChange(val, scope.row.id)"
v-model="scope.row.status" v-model="scope.row.status"
active-value="1" active-value="0"
inactive-value="0" inactive-value="1"
></el-switch> ></el-switch>
</template> </template>
</el-table-column> </el-table-column>
@@ -137,10 +126,14 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询巡检项目列表 */ /** 查询巡检项目列表 */
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
const res = await listItem(queryParams.value); listItem(queryParams.value)
.then((res) => {
itemList.value = res.rows; itemList.value = res.rows;
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
}; };
/** 取消按钮 */ /** 取消按钮 */

View File

@@ -78,10 +78,14 @@ const { queryParams } = toRefs(data);
const getList = async () => { const getList = async () => {
queryParams.value.statDate = starDate.value.join('-'); queryParams.value.statDate = starDate.value.join('-');
loading.value = true; loading.value = true;
const res = await listItem(queryParams.value); listItem(queryParams.value)
.then((res) => {
itemList.value = res.rows; itemList.value = res.rows;
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
}; };
/** 搜索按钮操作 */ /** 搜索按钮操作 */

View File

@@ -39,11 +39,19 @@
is-range is-range
range-separator="" range-separator=""
start-placeholder="开始时间" start-placeholder="开始时间"
format="HH:mm"
value-format="HH:mm:00"
end-placeholder="结束时间" end-placeholder="结束时间"
style="width: 100%" style="width: 100%"
/> />
<el-button v-if="taskTime.length > 1" icon="Minus" circle style="margin-left: 10px" @click="removeTaskTime(index)"></el-button> <!-- <el-button v-if="taskTime.length > 1" icon="Minus" circle style="margin-left: 10px" @click="removeTaskTime(index)"></el-button>
<el-button v-if="taskTime.length === index + 1" icon="Plus" circle style="margin-left: 10px" @click="addTaskTime"></el-button> <el-button
v-if="taskTime.length === index + 1 && taskTime.length <= 8"
icon="Plus"
circle
style="margin-left: 10px"
@click="addTaskTime"
></el-button> -->
</div> </div>
</el-form-item> </el-form-item>
@@ -75,6 +83,7 @@
</template> </template>
<script setup lang="ts"> <script setup lang="ts">
// TODO 巡检计划 添加
import { listRoute } from '@/api/system/InspectionRoute'; import { listRoute } from '@/api/system/InspectionRoute';
import PageHeader from '@/components/Pageheader/index.vue'; import PageHeader from '@/components/Pageheader/index.vue';
import { numToWeek } from '@/utils/time'; import { numToWeek } from '@/utils/time';

View File

@@ -63,7 +63,7 @@
active-value="0" active-value="0"
inactive-value="1" inactive-value="1"
></el-switch> ></el-switch>
<!-- 0关闭 1开启 --> <!-- 1关闭 0开启 -->
</template> </template>
</el-table-column> </el-table-column>
<el-table-column label="操作" width="110" align="center" fixed="right" class-name="small-padding fixed-width"> <el-table-column label="操作" width="110" align="center" fixed="right" class-name="small-padding fixed-width">
@@ -148,7 +148,8 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询巡检计划列表 */ /** 查询巡检计划列表 */
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
const res = await listPlan(queryParams.value); listPlan(queryParams.value)
.then((res) => {
planList.value = res.rows; planList.value = res.rows;
planList.value.forEach((item) => { planList.value.forEach((item) => {
item.routeNames = item.routeList.map((item) => item.routeName).join(','); item.routeNames = item.routeList.map((item) => item.routeName).join(',');
@@ -158,7 +159,10 @@ const getList = async () => {
.map((item) => Number(item)); .map((item) => Number(item));
}); });
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
}; };
/** 取消按钮 */ /** 取消按钮 */

View File

@@ -143,10 +143,14 @@ const { queryParams, form, rules } = toRefs(data);
/** 查询巡检点列表 */ /** 查询巡检点列表 */
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
const res = await listPoint(queryParams.value); listPoint(queryParams.value)
.then((res) => {
pointList.value = res.rows; pointList.value = res.rows;
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
}; };
/** 取消按钮 */ /** 取消按钮 */

View File

@@ -124,11 +124,14 @@ const { queryParams, form } = toRefs(data);
/** 查询巡检记录主列表 */ /** 查询巡检记录主列表 */
const getList = async () => { const getList = async () => {
loading.value = true; loading.value = true;
listRecord(queryParams.value)
const res = await listRecord(queryParams.value); .then((res) => {
recordList.value = res.rows; recordList.value = res.rows;
total.value = res.total; total.value = res.total;
})
.finally(() => {
loading.value = false; loading.value = false;
});
}; };
// 处理日期选择 // 处理日期选择

View File

@@ -8,19 +8,19 @@
<el-form-item label="巡检路线名称" prop="routeName"> <el-form-item label="巡检路线名称" prop="routeName">
<el-input v-model.trim="form.routeName" placeholder="请输入巡检路线名称" /> <el-input v-model.trim="form.routeName" placeholder="请输入巡检路线名称" />
</el-form-item> </el-form-item>
<el-form-item label="巡检路线描述" prop="description"> <!-- <el-form-item label="巡检路线描述" prop="description">
<el-input type="textarea" :rows="3" v-model.trim="form.description" placeholder="请输入巡检路线描述" /> <el-input type="textarea" :rows="3" v-model.trim="form.description" placeholder="请输入巡检路线描述" />
</el-form-item> </el-form-item> -->
<el-form-item label="预计巡检时长" prop="estimatedTime"> <!-- <el-form-item label="预计巡检时长" prop="estimatedTime">
<el-input v-model.trim.number="form.estimatedTime" placeholder="预计巡检时长"> <el-input v-model.trim.number="form.estimatedTime" placeholder="预计巡检时长">
<template #append>分钟</template> <template #append>分钟</template>
</el-input> </el-input>
</el-form-item> </el-form-item> -->
<el-form-item label="巡检路线状态" prop="routeStatus"> <!-- <el-form-item label="巡检路线状态" prop="routeStatus">
<el-radio-group v-model="form.routeStatus"> <el-radio-group v-model="form.routeStatus">
<el-radio v-for="(item, index) in com_inspection_route_status" :key="index" :value="item.value" :label="item.label"></el-radio> <el-radio v-for="(item, index) in com_inspection_route_status" :key="index" :value="item.value" :label="item.label"></el-radio>
</el-radio-group> </el-radio-group>
</el-form-item> </el-form-item> -->
<el-form-item label="巡检点"> <el-form-item label="巡检点">
<div class="itembox"> <div class="itembox">
<div <div
@@ -68,7 +68,7 @@ import { addRoute, getRoute, updateRoute } from '@/api/system/InspectionRoute';
import { getVillageByIdAPI } from '@/api/system/community'; import { getVillageByIdAPI } from '@/api/system/community';
const { proxy } = getCurrentInstance() as ComponentInternalInstance; const { proxy } = getCurrentInstance() as ComponentInternalInstance;
const { com_inspection_route_status } = toRefs<any>(proxy?.useDict('com_inspection_route_status')); // const { com_inspection_route_status } = toRefs<any>(proxy?.useDict('com_inspection_route_status'));
const router = useRouter(); const router = useRouter();
const route = useRoute(); const route = useRoute();
@@ -193,7 +193,7 @@ function init() {
}); });
} }
} }
// TODO 巡检路线开关
// ! map // ! map
const mapReady = ref(false); const mapReady = ref(false);
const AMapLib = ref(null); const AMapLib = ref(null);
@@ -206,7 +206,7 @@ const villageid = localStorage.getItem('villageid');
onMounted(async () => { onMounted(async () => {
// 获取巡检点列表 // 获取巡检点列表
if (!routeid.value) { if (!routeid.value) {
listPoint().then((res) => { listPoint({}).then((res) => {
pointslist.value = res.rows; pointslist.value = res.rows;
}); });
} }
@@ -331,8 +331,10 @@ function clearAll() {
// !!! 核心:获取绘制的路线经纬度数组 // !!! 核心:获取绘制的路线经纬度数组
function getPolylinePath() { function getPolylinePath() {
if (drawnPolylines.value.length === 0) return []; if (drawnPolylines.value.length === 0) return [];
const lastLine = drawnPolylines.value.pop(); // 获取最后一条线
const path = lastLine.getPath().map((p) => [p.lng, p.lat]); const lastPolyline = drawnPolylines.value[drawnPolylines.value.length - 1];
// const lastLine = drawnPolylines.value.pop();
const path = lastPolyline.getPath().map((p) => [p.lng, p.lat]);
return path; return path;
} }
/** /**

Some files were not shown because too many files have changed in this diff Show More