房屋详情,单元变更
This commit is contained in:
@@ -18,10 +18,25 @@ VITE_APP_SNAILJOB_ADMIN = '/snail-job'
|
||||
VITE_APP_BASE_API = 'https://wuyeapi.bugtc.com'
|
||||
# VITE_APP_BASE_API = 'http://192.168.0.222:8080'
|
||||
|
||||
# 登录成功跳转地址
|
||||
VITE_LOGIN_BACK_URL = '/equipment/WaterDevice'
|
||||
# 是否展示工作台
|
||||
VITE_APP_SHOW_WORK_PLATFORM = false
|
||||
|
||||
|
||||
# 地图类型 天地图 or 高德地图 天地图 WGS84 高德地图 GCJ02, 高德地图 需要在高德地图官网申请key
|
||||
# 高德地图 GCJ02
|
||||
# 天地图 WGS84
|
||||
VITE_APP_MAP_TYPE = 'GCJ02'
|
||||
|
||||
# 高德地图key 建议放入环境变量中,避免泄露
|
||||
VITE_GCJ02_KEY_GD = '8e302fe1be5f4db62bc734db23dca149'
|
||||
VITE_GCJ02_JS_CODE_GD = '09534b3534d8da53968529a9ce164118'
|
||||
|
||||
|
||||
|
||||
# 是否在打包时开启压缩,支持 gzip 和 brotli
|
||||
VITE_BUILD_COMPRESS = gzip
|
||||
# VITE_BUILD_COMPRESS = gzip
|
||||
|
||||
VITE_APP_PORT = 80
|
||||
|
||||
|
||||
19
.gitignore
vendored
19
.gitignore
vendored
@@ -2,6 +2,23 @@
|
||||
.history
|
||||
node_modules/
|
||||
dist/
|
||||
.env
|
||||
.git
|
||||
.idea
|
||||
.vscode
|
||||
.gitignore
|
||||
.npmrc
|
||||
.yarn
|
||||
.yarnrc
|
||||
.pnp.js
|
||||
.pnp.lock.json
|
||||
.pnp
|
||||
.yarn.lock
|
||||
.bat
|
||||
dist.zip
|
||||
.zip
|
||||
|
||||
|
||||
npm-debug.log*
|
||||
yarn-debug.log*
|
||||
yarn-error.log*
|
||||
@@ -27,3 +44,5 @@ pnpm-lock.yaml
|
||||
# 编译生成的文件
|
||||
auto-imports.d.ts
|
||||
components.d.ts
|
||||
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
@echo off
|
||||
echo.
|
||||
echo [信息] 打包Web工程,生成dist文件。
|
||||
echo.
|
||||
|
||||
%~d0
|
||||
cd %~dp0
|
||||
|
||||
cd ..
|
||||
yarn build:prod
|
||||
|
||||
pause
|
||||
@@ -1,12 +0,0 @@
|
||||
@echo off
|
||||
echo.
|
||||
echo [信息] 安装Web工程,生成node_modules文件。
|
||||
echo.
|
||||
|
||||
%~d0
|
||||
cd %~dp0
|
||||
|
||||
cd ..
|
||||
yarn --registry=https://registry.npmmirror.com
|
||||
|
||||
pause
|
||||
@@ -1,12 +0,0 @@
|
||||
@echo off
|
||||
echo.
|
||||
echo [信息] 使用 Vite 命令运行 Web 工程。
|
||||
echo.
|
||||
|
||||
%~d0
|
||||
cd %~dp0
|
||||
|
||||
cd ..
|
||||
yarn dev
|
||||
|
||||
pause
|
||||
@@ -86,6 +86,7 @@
|
||||
"vite": "7.3.1",
|
||||
"vite-plugin-svg-icons-ng": "^1.5.2",
|
||||
"vite-plugin-vue-devtools": "8.0.7",
|
||||
"vite-plugin-zip-pack": "^1.2.4",
|
||||
"vitest": "4.0.18",
|
||||
"vue-tsc": "^3.2.5"
|
||||
},
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
export default {
|
||||
plugins: {
|
||||
autoprefixer: {},
|
||||
// autoprefixer: {},
|
||||
'postcss-pxtorem': {
|
||||
rootValue: 16, // 基准根节点字体大小
|
||||
propList: ['*'], // 所有属性都转换
|
||||
|
||||
@@ -60,12 +60,12 @@ export interface DecorationForm extends BaseEntity {
|
||||
* 所属小区id
|
||||
*/
|
||||
villageId?: string;
|
||||
|
||||
villageName?: string;
|
||||
/**
|
||||
* 所属房屋id
|
||||
*/
|
||||
houseId?: string | number;
|
||||
|
||||
houseName?: string;
|
||||
/**
|
||||
* 申请人姓名
|
||||
*/
|
||||
|
||||
17
src/api/system/Notification/index.ts
Normal file
17
src/api/system/Notification/index.ts
Normal file
@@ -0,0 +1,17 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { NoticeVO, NoticeForm, NoticeQuery } from '@/api/system/NoticePc/type';
|
||||
|
||||
/**
|
||||
* 查询消息通知列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const getNotificationList = (query?: NoticeQuery): AxiosPromise<NoticeVO[]> => {
|
||||
return request({
|
||||
url: '/notification/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
@@ -85,13 +85,21 @@ export const listBillHouse = (query: { pageNum: number; pageSize: number }): Axi
|
||||
};
|
||||
|
||||
// ! =---------------
|
||||
export type BillUserlist = {
|
||||
'gender': string;
|
||||
'phone': string;
|
||||
'house_name': string;
|
||||
'residentName': string;
|
||||
'houseNo': string;
|
||||
'residentId': string;
|
||||
'buildingId': string;
|
||||
};
|
||||
/**
|
||||
* 查询业主列表
|
||||
* @param data
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const queryResidentList_holder = (query: { pageNum: number; pageSize: number }) => {
|
||||
export const queryResidentList_holder = (query: { pageNum: number; pageSize: number }): AxiosPromise<BillUserlist[]> => {
|
||||
return request({
|
||||
url: '/bill/getResidentList',
|
||||
method: 'GET',
|
||||
|
||||
@@ -5,13 +5,11 @@ import { addBuildingType, addHouseType, BuildingUnit, BuildingVo } from './type'
|
||||
// 楼栋---------------------------------------------------------------------------------------
|
||||
|
||||
/** 根据 小区id 和 类型 查询楼栋信息 */
|
||||
export function getBuildinglistAPI(buildingUse: string): AxiosPromise<BuildingVo[]> {
|
||||
export function getBuildinglistAPI(): AxiosPromise<BuildingVo[]> {
|
||||
return request({
|
||||
url: '/building/byVillage',
|
||||
method: 'get',
|
||||
params: {
|
||||
buildingUse: buildingUse
|
||||
}
|
||||
params: {}
|
||||
});
|
||||
}
|
||||
/** 获取所有楼栋 */
|
||||
@@ -55,9 +53,9 @@ export function deleteBuildingApi(id: string) {
|
||||
|
||||
// 房屋----------------------------------------------------------------------------------------------
|
||||
/** 根据 楼栋id 查询房屋信息 */
|
||||
export function getHouselistAPI(buildingId: string, houseName: string = ''): AxiosPromise<BuildingUnit> {
|
||||
export function getHouselistAPI(buildingId: string, houseName: string = '', houseUseTypeId: string = ''): AxiosPromise<BuildingUnit> {
|
||||
return request({
|
||||
url: `/house/groupByUnitTree/${buildingId}?houseName=${houseName}`,
|
||||
url: `/house/groupByUnitTree/${buildingId}?houseName=${houseName}&houseUseTypeId=${houseUseTypeId}`,
|
||||
method: 'get'
|
||||
});
|
||||
}
|
||||
@@ -119,7 +117,7 @@ export interface Data {
|
||||
billResidentList: BillResidentList[];
|
||||
chargeItemList: string[];
|
||||
house: House;
|
||||
parking: null;
|
||||
parking: Parking;
|
||||
residentList: ResidentList[];
|
||||
storeroom: Storeroom;
|
||||
}
|
||||
@@ -143,7 +141,7 @@ export interface House {
|
||||
houseType: string;
|
||||
internalArea: string;
|
||||
shareArea: string;
|
||||
unitNo: number;
|
||||
unitNoName: string;
|
||||
villageName: string;
|
||||
}
|
||||
|
||||
@@ -166,3 +164,19 @@ export interface Storeroom {
|
||||
storeroomNo: string;
|
||||
unitNo: number;
|
||||
}
|
||||
|
||||
export interface Parking {
|
||||
'parkingArea': number;
|
||||
'areaName': string;
|
||||
'createTime': string;
|
||||
'parkingId': string;
|
||||
'parkingStatus': string;
|
||||
'remark': string;
|
||||
'parkingFloor': string;
|
||||
'type': string;
|
||||
'villageId': number;
|
||||
'parkingCode': string;
|
||||
'residentName': string;
|
||||
'residentId': string;
|
||||
'createName': string;
|
||||
}
|
||||
|
||||
@@ -47,14 +47,15 @@ export interface BuildingUnit {
|
||||
buildingId: number;
|
||||
buildingName: string;
|
||||
floorCount: number;
|
||||
unitCount: number;
|
||||
units: BuildingUnitlist[];
|
||||
}
|
||||
// 单元
|
||||
export interface BuildingUnitlist {
|
||||
floors: FloorsType[];
|
||||
unitNo: number;
|
||||
unitNoName: string;
|
||||
unitNoId: string;
|
||||
}
|
||||
|
||||
// 楼层
|
||||
export interface FloorsType {
|
||||
floorNo: string;
|
||||
@@ -80,7 +81,8 @@ export interface addHouseType {
|
||||
'houseId'?: string;
|
||||
'buildingId'?: string;
|
||||
'villageId'?: string;
|
||||
'unitNo': string;
|
||||
'houseUseTypeId': string;
|
||||
'unitNoId': string;
|
||||
'floorNo': string;
|
||||
'houseNo': string;
|
||||
'houseArea': string;
|
||||
|
||||
76
src/api/system/houseUnit/index.ts
Normal file
76
src/api/system/houseUnit/index.ts
Normal file
@@ -0,0 +1,76 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { UnitNoVO, UnitNoForm, UnitNoQuery } from './type';
|
||||
|
||||
/**
|
||||
* 查询单元列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listUnitNo = (query?: UnitNoQuery): AxiosPromise<UnitNoVO[]> => {
|
||||
return request({
|
||||
url: '/unitNo/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询单元详细
|
||||
* @param id
|
||||
*/
|
||||
export const getUnitNo = (id: string | number): AxiosPromise<UnitNoVO> => {
|
||||
return request({
|
||||
url: '/unitNo/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增单元
|
||||
* @param data
|
||||
*/
|
||||
export const addUnitNo = (data: UnitNoForm) => {
|
||||
return request({
|
||||
url: '/unitNo',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改单元
|
||||
* @param data
|
||||
*/
|
||||
export const updateUnitNo = (data: UnitNoForm) => {
|
||||
return request({
|
||||
url: '/unitNo',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除单元
|
||||
* @param id
|
||||
*/
|
||||
export const delUnitNo = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/unitNo/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
/**
|
||||
* 根据 楼栋id 获取单元
|
||||
* @param id
|
||||
*/
|
||||
export const getByBUildingidtoUnitNo = (id: string) => {
|
||||
return request({
|
||||
url: '/unitNo/byBuildingList',
|
||||
method: 'GET',
|
||||
params: {
|
||||
buildingId: id
|
||||
}
|
||||
});
|
||||
};
|
||||
65
src/api/system/houseUnit/type.ts
Normal file
65
src/api/system/houseUnit/type.ts
Normal file
@@ -0,0 +1,65 @@
|
||||
export interface UnitNoVO {
|
||||
/**
|
||||
* 单元表id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 单元名称
|
||||
*/
|
||||
name: string;
|
||||
|
||||
/**
|
||||
* 小区id
|
||||
*/
|
||||
villageId: string | number;
|
||||
|
||||
/**
|
||||
* 楼栋id
|
||||
*/
|
||||
buildingId: string | number;
|
||||
}
|
||||
|
||||
export interface UnitNoForm extends BaseEntity {
|
||||
/**
|
||||
* 单元表id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 单元名称
|
||||
*/
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* 小区id
|
||||
*/
|
||||
villageId?: string | number;
|
||||
|
||||
/**
|
||||
* 楼栋id
|
||||
*/
|
||||
buildingId?: string | number;
|
||||
}
|
||||
|
||||
export interface UnitNoQuery extends PageQuery {
|
||||
/**
|
||||
* 单元名称
|
||||
*/
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* 小区id
|
||||
*/
|
||||
villageId?: string | number;
|
||||
|
||||
/**
|
||||
* 楼栋id
|
||||
*/
|
||||
buildingId?: string | number;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
63
src/api/system/houseUse/index.ts
Normal file
63
src/api/system/houseUse/index.ts
Normal file
@@ -0,0 +1,63 @@
|
||||
import request from '@/utils/request';
|
||||
import { AxiosPromise } from 'axios';
|
||||
import { HouseUseTypeVO, HouseUseTypeForm, HouseUseTypeQuery } from './type';
|
||||
|
||||
/**
|
||||
* 查询房屋类型列表
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const listHouseUseType = (query?: HouseUseTypeQuery): AxiosPromise<HouseUseTypeVO[]> => {
|
||||
return request({
|
||||
url: '/houseUseType/list',
|
||||
method: 'get',
|
||||
params: query
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询房屋类型详细
|
||||
* @param id
|
||||
*/
|
||||
export const getHouseUseType = (id: string | number): AxiosPromise<HouseUseTypeVO> => {
|
||||
return request({
|
||||
url: '/houseUseType/' + id,
|
||||
method: 'get'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 新增房屋类型
|
||||
* @param data
|
||||
*/
|
||||
export const addHouseUseType = (data: HouseUseTypeForm) => {
|
||||
return request({
|
||||
url: '/houseUseType',
|
||||
method: 'post',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 修改房屋类型
|
||||
* @param data
|
||||
*/
|
||||
export const updateHouseUseType = (data: HouseUseTypeForm) => {
|
||||
return request({
|
||||
url: '/houseUseType',
|
||||
method: 'put',
|
||||
data: data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除房屋类型
|
||||
* @param id
|
||||
*/
|
||||
export const delHouseUseType = (id: string | number | Array<string | number>) => {
|
||||
return request({
|
||||
url: '/houseUseType/' + id,
|
||||
method: 'delete'
|
||||
});
|
||||
};
|
||||
35
src/api/system/houseUse/type.ts
Normal file
35
src/api/system/houseUse/type.ts
Normal file
@@ -0,0 +1,35 @@
|
||||
export interface HouseUseTypeVO {
|
||||
/**
|
||||
* 房屋类型id
|
||||
*/
|
||||
id: string | number;
|
||||
|
||||
/**
|
||||
* 用途名称
|
||||
*/
|
||||
name: string;
|
||||
}
|
||||
|
||||
export interface HouseUseTypeForm extends BaseEntity {
|
||||
/**
|
||||
* 房屋类型id
|
||||
*/
|
||||
id?: string | number;
|
||||
|
||||
/**
|
||||
* 用途名称
|
||||
*/
|
||||
name?: string;
|
||||
}
|
||||
|
||||
export interface HouseUseTypeQuery extends PageQuery {
|
||||
/**
|
||||
* 用途名称
|
||||
*/
|
||||
name?: string;
|
||||
|
||||
/**
|
||||
* 日期范围参数
|
||||
*/
|
||||
params?: any;
|
||||
}
|
||||
@@ -91,9 +91,13 @@ export const getParkingReviewInfo = (id: string) => {
|
||||
* @returns {*}
|
||||
*/
|
||||
|
||||
export const GetVillageListParking = (villageid?: string): AxiosPromise<ParkingVO[]> => {
|
||||
export const GetVillageListParking = (villageid: string, houseId: string = undefined): AxiosPromise<ParkingVO[]> => {
|
||||
return request({
|
||||
url: `/parking/getList/${villageid}`,
|
||||
method: 'GET'
|
||||
url: `/parking/getList`,
|
||||
method: 'POST',
|
||||
data: {
|
||||
villageId: villageid,
|
||||
houseId: houseId
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -68,9 +68,10 @@ export const delStoreroom = (id: string | number | Array<string | number>) => {
|
||||
*/
|
||||
|
||||
export const GetVillagelistStoreroom = (
|
||||
data: { villageid: string; unitNo: string; buildingId: string } = {
|
||||
data: { villageid: string; unitNo: string; houseId?: string; buildingId: string } = {
|
||||
villageid: null,
|
||||
buildingId: null,
|
||||
houseId: null,
|
||||
unitNo: null
|
||||
}
|
||||
): AxiosPromise<StoreroomVO[]> => {
|
||||
@@ -80,7 +81,8 @@ export const GetVillagelistStoreroom = (
|
||||
data: {
|
||||
villageId: data.villageid,
|
||||
buildingId: data.buildingId,
|
||||
unitNo: data.unitNo
|
||||
unitNo: data.unitNo,
|
||||
houseId: data.houseId
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
@@ -2,12 +2,12 @@ export interface StoreroomVO {
|
||||
/**
|
||||
* 储藏室ID
|
||||
*/
|
||||
id: string | number;
|
||||
id: string;
|
||||
|
||||
/**
|
||||
* 所属楼栋ID
|
||||
*/
|
||||
buildingId: string | number;
|
||||
buildingId: string;
|
||||
|
||||
/**
|
||||
* 单元号
|
||||
@@ -54,12 +54,12 @@ export interface StoreroomForm extends BaseEntity {
|
||||
/**
|
||||
* 储藏室ID
|
||||
*/
|
||||
id?: string | number;
|
||||
id?: string;
|
||||
|
||||
/**
|
||||
* 所属楼栋ID
|
||||
*/
|
||||
buildingId?: string | number;
|
||||
buildingId?: string;
|
||||
|
||||
/**
|
||||
* 单元号
|
||||
@@ -106,7 +106,7 @@ export interface StoreroomQuery extends PageQuery {
|
||||
/**
|
||||
* 所属楼栋ID
|
||||
*/
|
||||
buildingId?: string | number;
|
||||
buildingId?: string;
|
||||
|
||||
/**
|
||||
* 单元号
|
||||
|
||||
@@ -284,3 +284,40 @@ type LifeIndexKeys =
|
||||
type LifeIndices = {
|
||||
[K in LifeIndexKeys]: LifeIndexItem;
|
||||
};
|
||||
|
||||
/**
|
||||
* 查询 快捷入口
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export const getQuicklyshortcut = () => {
|
||||
return request({
|
||||
url: '/workSpace/shortcut/list',
|
||||
method: 'GET'
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 添加 快捷入口
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export const addQuicklyshortcut = (data) => {
|
||||
return request({
|
||||
url: '/workSpace/shortcut/add',
|
||||
method: 'POST',
|
||||
data
|
||||
});
|
||||
};
|
||||
|
||||
/**
|
||||
* 删除 快捷入口
|
||||
* @param query
|
||||
* @returns {*}
|
||||
*/
|
||||
export const delQuicklyshortcut = (id) => {
|
||||
return request({
|
||||
url: '/workSpace/shortcut/remove/' + id,
|
||||
method: 'DELETE'
|
||||
});
|
||||
};
|
||||
|
||||
@@ -1,46 +1,67 @@
|
||||
<template>
|
||||
<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="1250">
|
||||
<nav class="flex flex-items-center mb-8">
|
||||
<div class="flex flex-items-center">
|
||||
<!-- <div class="flex flex-items-center">
|
||||
<div style="width: 70px; text-align: right; padding-right: 10px">房屋类型</div>
|
||||
<div class="flex-1">
|
||||
<el-select @change="handleChangeHouse" style="width: 140px" v-model="queryParams.buildingUse">
|
||||
<el-option v-for="(item, index) in com_build_use" :key="index" :label="item.label" :value="item.value"></el-option>
|
||||
<el-select @change="handleChangeHouse" style="width: 140px" v-model="queryParams.houseUseTypeId">
|
||||
<el-option v-for="(item, index) in houseUseTypeList" :key="index" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="flex flex-items-center">
|
||||
<div style="width: 60px; text-align: right; padding-right: 10px">楼栋</div>
|
||||
<div style="width: 50px; text-align: right; padding-right: 10px">楼栋</div>
|
||||
<div class="flex-1"></div>
|
||||
<el-select @change="handleChangebuilding" style="width: 140px" v-model="queryParams.buildingId">
|
||||
<el-select @change="handleChangebuilding" clearable style="width: 140px" v-model="queryParams.buildingId">
|
||||
<el-option v-for="(item, index) in buildinglist" :key="index" :label="item.buildingName" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
<div class="flex flex-items-center mr-20px">
|
||||
<div style="width: 60px; text-align: right; padding-right: 10px">单元</div>
|
||||
<div style="width: 50px; text-align: right; padding-right: 10px">单元</div>
|
||||
<div class="flex-1">
|
||||
<el-select style="width: 140px" v-model="queryParams.unitNo">
|
||||
<el-option v-for="(item, index) in unitlist" :key="index" :label="`${item.unitNo}单元`" :value="item.unitNo"></el-option>
|
||||
<el-select @change="handleChangeUnit" clearable style="width: 140px" v-model="queryParams.unitNoId">
|
||||
<el-option v-for="(item, index) in unitlist" :key="index" :label="item.unitNoName" :value="item.unitNoId"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-items-center mr-20px">
|
||||
<div style="width: 80px; text-align: right; padding-right: 10px">房屋类型</div>
|
||||
<div class="flex-1">
|
||||
<el-select clearable @change="handleHouseUseChange" style="width: 140px" v-model="queryParams.houseUseTypeId">
|
||||
<el-option v-for="(item, index) in houseUseTypeList" :key="index" :label="item.name" :value="item.id"></el-option>
|
||||
</el-select>
|
||||
</div>
|
||||
</div>
|
||||
<div class="flex flex-items-center mr-20px">
|
||||
<div style="width: 80px; text-align: right; padding-right: 10px">业主名称</div>
|
||||
<div class="flex-1">
|
||||
<el-input clearable @clear="handleClear" v-model="queryParams.residentName" placeholder="查找业主"></el-input>
|
||||
</div>
|
||||
</div>
|
||||
<div>
|
||||
<el-button type="primary" @click="getlist">查询</el-button>
|
||||
<el-button @click="resetQuery">重置</el-button>
|
||||
</div>
|
||||
</nav>
|
||||
<el-table @row-click="handleRowClick" ref="multipleTableRef" :data="tableData" border @selection-change="handleSelectionChange">
|
||||
<el-table
|
||||
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 label="序号" align="center" width="55" type="index" />
|
||||
<el-table-column label="小区" align="center" prop="villageName" />
|
||||
<el-table-column label="楼栋" align="center" prop="buildingName" />
|
||||
<el-table-column label="单元" align="center" prop="unitNo" />
|
||||
<el-table-column label="单元" align="center" prop="unitNoName" />
|
||||
<el-table-column label="房间" align="center" prop="houseNo" />
|
||||
<el-table-column label="业主" align="center">
|
||||
<template #default="scope">
|
||||
<span>{{ scope.row.userName ? scope.row.userName : '---' }}</span>
|
||||
<span>{{ scope.row.residentName ? scope.row.residentName : '---' }}</span>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
@@ -66,18 +87,15 @@
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getBuildinglistAPI, getBuildingOnly, getHouselistAPI } from '@/api/system/house';
|
||||
import { listHouseUseType } from '@/api/system/houseUse';
|
||||
import { BillHouse, listBillHouse } from '@/api/system/SdbBill';
|
||||
import { ref, watch, nextTick, getCurrentInstance, ComponentInternalInstance, toRefs } from 'vue';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { sys_user_sex } = toRefs<any>(proxy?.useDict('sys_user_sex'));
|
||||
const { com_build_use } = toRefs<any>(proxy?.useDict('com_build_use'));
|
||||
// const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
// const { sys_user_sex } = toRefs<any>(proxy?.useDict('sys_user_sex'));
|
||||
// const { com_build_use } = toRefs<any>(proxy?.useDict('com_build_use'));
|
||||
|
||||
const props = defineProps({
|
||||
userid: {
|
||||
type: String,
|
||||
default: ''
|
||||
},
|
||||
returnvalue: {
|
||||
type: String,
|
||||
default: 'houseId'
|
||||
@@ -93,7 +111,9 @@ const props = defineProps({
|
||||
}
|
||||
});
|
||||
|
||||
const { userid, titleName, returnvalue } = toRefs(props);
|
||||
const { titleName, returnvalue } = toRefs(props);
|
||||
|
||||
const showids = ref([]);
|
||||
|
||||
// ✅ 手动设置默认值(替代 withDefaults)
|
||||
const emit = defineEmits<{
|
||||
@@ -108,9 +128,11 @@ const dialog = ref({
|
||||
const queryParams = ref({
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
buildingUse: null,
|
||||
// houseUseTypeId: null,
|
||||
buildingId: null,
|
||||
unitNo: null
|
||||
unitNoId: null,
|
||||
houseUseTypeId: null,
|
||||
residentName: ''
|
||||
});
|
||||
|
||||
const multipleTableRef = ref();
|
||||
@@ -125,13 +147,12 @@ const isMultiple = computed(() => props.isMultiple ?? false);
|
||||
|
||||
// 优化 handleUserSelection,避免重复查找
|
||||
const handleUserSelection = () => {
|
||||
if (!userid.value || !tableData.value.length) return;
|
||||
|
||||
if (!tableData.value.length) return;
|
||||
multipleSelection.value = [];
|
||||
if (userid.value.trim() !== '') {
|
||||
const arr = userid.value.split(',');
|
||||
if (showids.value.length > 0) {
|
||||
const arr = showids.value;
|
||||
arr.forEach((item) => {
|
||||
const target = tableData.value.find((row) => row.userId == item);
|
||||
const target = tableData.value.find((row) => row.houseId == item);
|
||||
target && multipleSelection.value.push(target);
|
||||
});
|
||||
nextTick(() => {
|
||||
@@ -146,7 +167,7 @@ const handleUserSelection = () => {
|
||||
};
|
||||
|
||||
// ====================== 方法 ======================
|
||||
|
||||
const houseUseTypeList = ref([]);
|
||||
// 获取列表
|
||||
function getlist() {
|
||||
loading.value = true;
|
||||
@@ -157,7 +178,7 @@ function getlist() {
|
||||
handleUserSelection();
|
||||
})
|
||||
.catch((error) => {
|
||||
console.error('获取用户列表失败:', error);
|
||||
console.error('获取列表失败:', error);
|
||||
})
|
||||
.finally(() => {
|
||||
loading.value = false;
|
||||
@@ -169,17 +190,35 @@ const buildinglist = ref([]);
|
||||
/** 房屋列表 */
|
||||
const unitlist = ref([]);
|
||||
|
||||
/** 筛选房屋类型 */
|
||||
function handleChangeHouse(val: string) {
|
||||
getBuildinglistAPI(val).then((res) => {
|
||||
/** 获取楼栋 列表 */
|
||||
function handleChangeHouse() {
|
||||
getBuildinglistAPI().then((res) => {
|
||||
buildinglist.value = res.data;
|
||||
});
|
||||
}
|
||||
|
||||
function handleClear() {
|
||||
queryParams.value.residentName = '';
|
||||
getlist();
|
||||
}
|
||||
function handleHouseUseChange() {
|
||||
getlist();
|
||||
}
|
||||
/** 单元列表 */
|
||||
function handleChangebuilding(val: string) {
|
||||
queryParams.value.unitNoId = null;
|
||||
unitlist.value = [];
|
||||
|
||||
if (queryParams.value.buildingId) {
|
||||
getHouselistAPI(val).then((res) => {
|
||||
unitlist.value = res.data.units;
|
||||
getlist();
|
||||
});
|
||||
}
|
||||
getlist();
|
||||
}
|
||||
function handleChangeUnit() {
|
||||
getlist();
|
||||
}
|
||||
|
||||
// ==============================================
|
||||
@@ -221,9 +260,10 @@ function resetQuery() {
|
||||
queryParams.value = {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
buildingUse: null,
|
||||
houseUseTypeId: null,
|
||||
buildingId: null,
|
||||
unitNo: null
|
||||
unitNoId: null,
|
||||
residentName: ''
|
||||
};
|
||||
getlist();
|
||||
}
|
||||
@@ -267,9 +307,18 @@ function confirm() {
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open: () => {
|
||||
open: (showidArray: string[] = []) => {
|
||||
showids.value = showidArray;
|
||||
getlist();
|
||||
dialog.value.dialogVisible = true;
|
||||
|
||||
listHouseUseType({
|
||||
pageNum: 1,
|
||||
pageSize: 99999
|
||||
}).then((res) => {
|
||||
houseUseTypeList.value = res.rows;
|
||||
});
|
||||
handleChangeHouse();
|
||||
}
|
||||
});
|
||||
</script>
|
||||
|
||||
@@ -39,26 +39,21 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getBuildinglistAPI, getBuildingOnly, getHouselistAPI } from '@/api/system/house';
|
||||
import { BillHouse, listBillHouse, queryResidentList_holder } from '@/api/system/SdbBill';
|
||||
import { ref, watch, nextTick, getCurrentInstance, ComponentInternalInstance, toRefs } from 'vue';
|
||||
import { getBuildinglistAPI, getHouselistAPI } from '@/api/system/house';
|
||||
import { BillUserlist, 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 { com_build_use } = toRefs<any>(proxy?.useDict('com_build_use'));
|
||||
|
||||
const props = defineProps({
|
||||
userid: {
|
||||
type: String || Array<string>,
|
||||
default: ''
|
||||
},
|
||||
returnvalue: {
|
||||
type: String,
|
||||
default: 'houseId'
|
||||
},
|
||||
titleName: {
|
||||
type: String,
|
||||
default: '选择房屋'
|
||||
default: '选择业主'
|
||||
},
|
||||
/** 是否多选 false 单选 */
|
||||
isMultiple: {
|
||||
@@ -67,11 +62,12 @@ const props = defineProps({
|
||||
}
|
||||
});
|
||||
|
||||
const { userid, titleName, returnvalue } = toRefs(props);
|
||||
const { titleName, returnvalue } = toRefs(props);
|
||||
|
||||
const userid = ref([]);
|
||||
// ✅ 手动设置默认值(替代 withDefaults)
|
||||
const emit = defineEmits<{
|
||||
change: [value: string | number | (string | number)[] | BillHouse | BillHouse[]]; // 支持返回数组
|
||||
change: [value: string | number | (string | number)[] | BillUserlist | BillUserlist[]]; // 支持返回数组
|
||||
}>();
|
||||
|
||||
const dialog = ref({
|
||||
@@ -85,29 +81,24 @@ const queryParams = ref({
|
||||
});
|
||||
|
||||
const multipleTableRef = ref();
|
||||
const tableData = ref<BillHouse[]>([]);
|
||||
const tableData = ref<BillUserlist[]>([]);
|
||||
const total = ref(0);
|
||||
const loading = ref(false);
|
||||
|
||||
// 存储选中项
|
||||
const multipleSelection = ref<BillHouse[]>([]);
|
||||
const multipleSelection = ref<BillUserlist[]>([]);
|
||||
|
||||
const isMultiple = computed(() => props.isMultiple ?? false);
|
||||
|
||||
// 优化 handleUserSelection,避免重复查找
|
||||
const handleUserSelection = () => {
|
||||
if (!userid.value || !tableData.value.length) return;
|
||||
if (!tableData.value.length) return;
|
||||
|
||||
multipleSelection.value = [];
|
||||
let arr = [];
|
||||
if (userid.value && typeof userid.value === 'string' && userid.value.trim() !== '') {
|
||||
arr = userid.value.split(',');
|
||||
} else if (Array.isArray(userid.value)) {
|
||||
arr = [...userid.value];
|
||||
}
|
||||
const arr = userid.value;
|
||||
if (!arr.length) return;
|
||||
arr.forEach((item) => {
|
||||
const target = tableData.value.find((row) => row.userId == item);
|
||||
const target = tableData.value.find((row) => row.residentId == item);
|
||||
target && multipleSelection.value.push(target);
|
||||
});
|
||||
nextTick(() => {
|
||||
@@ -146,7 +137,7 @@ const unitlist = ref([]);
|
||||
|
||||
/** 筛选房屋类型 */
|
||||
function handleChangeHouse(val: string) {
|
||||
getBuildinglistAPI(val).then((res) => {
|
||||
getBuildinglistAPI().then((res) => {
|
||||
buildinglist.value = res.data;
|
||||
});
|
||||
}
|
||||
@@ -160,7 +151,7 @@ function handleChangebuilding(val: string) {
|
||||
// ==============================================
|
||||
// ✅ 新增:处理 selection-change(多选专用)
|
||||
// ==============================================
|
||||
function handleSelectionChange(selection: BillHouse[]) {
|
||||
function handleSelectionChange(selection: BillUserlist[]) {
|
||||
if (isMultiple.value) {
|
||||
multipleSelection.value = selection;
|
||||
}
|
||||
@@ -169,11 +160,11 @@ function handleSelectionChange(selection: BillHouse[]) {
|
||||
// 最佳单选方案:点击行选中,无报错、无循环、最稳定
|
||||
// ==============================================
|
||||
// 优化 handleRowClick,避免重复
|
||||
function handleRowClick(row: BillHouse) {
|
||||
function handleRowClick(row: BillUserlist) {
|
||||
if (!multipleTableRef.value) return;
|
||||
|
||||
if (isMultiple.value) {
|
||||
const index = multipleSelection.value.findIndex((item) => item.houseId === row.houseId);
|
||||
const index = multipleSelection.value.findIndex((item) => item.residentId === row.residentId);
|
||||
if (index > -1) {
|
||||
// 取消选中
|
||||
multipleSelection.value.splice(index, 1);
|
||||
@@ -220,7 +211,7 @@ function confirm() {
|
||||
// 返回指定字段数组
|
||||
emit(
|
||||
'change',
|
||||
multipleSelection.value.map((item) => item[returnvalue.value as keyof BillHouse])
|
||||
multipleSelection.value.map((item) => item[returnvalue.value as keyof BillUserlist])
|
||||
);
|
||||
}
|
||||
} else {
|
||||
@@ -230,7 +221,7 @@ function confirm() {
|
||||
emit('change', multipleSelection.value[0]);
|
||||
} else {
|
||||
// 返回指定字段
|
||||
emit('change', multipleSelection.value[0][returnvalue.value as keyof BillHouse]);
|
||||
emit('change', multipleSelection.value[0][returnvalue.value as keyof BillUserlist]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -239,7 +230,8 @@ function confirm() {
|
||||
}
|
||||
|
||||
defineExpose({
|
||||
open: () => {
|
||||
open: (arr: string[] = []) => {
|
||||
userid.value = arr;
|
||||
getlist();
|
||||
dialog.value.dialogVisible = true;
|
||||
}
|
||||
|
||||
@@ -22,7 +22,7 @@ const props = defineProps({
|
||||
total: propTypes.number,
|
||||
page: propTypes.number.def(1),
|
||||
limit: propTypes.number.def(20),
|
||||
pageSizes: { type: Array<number>, default: () => [10, 20, 30, 50] },
|
||||
pageSizes: { type: Array<number>, default: () => [10, 20, 30, 50, 100] },
|
||||
// 移动端页码按钮的数量端默认值5
|
||||
pagerCount: propTypes.number.def(document.body.clientWidth < 992 ? 5 : 7),
|
||||
layout: propTypes.string.def('total, sizes, prev, pager, next, jumper'),
|
||||
|
||||
@@ -152,7 +152,7 @@ import {
|
||||
currentTaskAllUser,
|
||||
getNextNodeList
|
||||
} from '@/api/workflow/task';
|
||||
import UserSelect from '@/components/UserSelect.vue';
|
||||
import UserSelect from '@/components/UserSelect/index.vue';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
import { FlowCopyVo, FlowTaskVO, TaskOperationBo } from '@/api/workflow/task/types';
|
||||
|
||||
@@ -41,7 +41,6 @@ export const useHouseStore = defineStore(
|
||||
'buildToward': '',
|
||||
'buildTall': '',
|
||||
'buildStructure': '',
|
||||
'unitCount': null,
|
||||
'floorCount': null,
|
||||
'remark': ''
|
||||
});
|
||||
@@ -73,37 +72,41 @@ export const useHouseStore = defineStore(
|
||||
};
|
||||
|
||||
// 初始化
|
||||
const initHouse = async (currentbuildingtype: string) => {
|
||||
const initHouse = async () => {
|
||||
currentBuildingInfoList.value = [];
|
||||
// 获取当前小区 所有楼栋信息
|
||||
const res2 = await getBuildinglistAPI(currentbuildingtype);
|
||||
const res2 = await getBuildinglistAPI();
|
||||
currentBuildingInfoList.value = res2.data;
|
||||
|
||||
// 得到小区 内 楼栋列表 -> 切换到第一个小区
|
||||
if (res2.data.length > 0) {
|
||||
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 === 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;
|
||||
}
|
||||
}
|
||||
// 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;
|
||||
// }
|
||||
// }
|
||||
};
|
||||
|
||||
// 选中的房屋
|
||||
@@ -118,7 +121,7 @@ export const useHouseStore = defineStore(
|
||||
// 清空
|
||||
currentBuildingInfoList.value = [];
|
||||
// 获取当前小区 所有楼栋信息
|
||||
const res2 = await getBuildinglistAPI(housetype);
|
||||
const res2 = await getBuildinglistAPI();
|
||||
currentBuildingInfoList.value = res2.data;
|
||||
// 获取当前小区 第一个楼栋信息
|
||||
if ((currentBuildingInfo.value && currentBuildingInfo.value.id === null) || buildingtype.value !== housetype) {
|
||||
@@ -134,7 +137,6 @@ export const useHouseStore = defineStore(
|
||||
'buildToward': '',
|
||||
'buildTall': '',
|
||||
'buildStructure': '',
|
||||
'unitCount': null,
|
||||
'floorCount': null,
|
||||
'remark': ''
|
||||
};
|
||||
@@ -152,6 +154,7 @@ export const useHouseStore = defineStore(
|
||||
// 更新当前楼栋信息
|
||||
const updateCureentBuilding = async () => {
|
||||
currentHouseInfoList.value = null;
|
||||
if (currentBuildingInfo.value && currentBuildingInfo.value.id) {
|
||||
// 获取当前 楼栋的所有信息
|
||||
const res3 = await getHouselistAPI(currentBuildingInfo.value.id);
|
||||
currentHouseInfoList.value = res3.data;
|
||||
@@ -162,12 +165,13 @@ export const useHouseStore = defineStore(
|
||||
floorslist.value.add(floor.floorNo);
|
||||
});
|
||||
});
|
||||
}
|
||||
};
|
||||
// 根据房屋号,查询房屋
|
||||
async function getHouseBybuildingNo(houseName: string) {
|
||||
async function getHouseBybuildingNo(houseName: string, houseUseTypeId: string) {
|
||||
currentHouseInfoList.value = null;
|
||||
// 获取当前 楼栋的所有信息
|
||||
const res3 = await getHouselistAPI(currentBuildingInfo.value.id, houseName);
|
||||
const res3 = await getHouselistAPI(currentBuildingInfo.value.id, houseName, houseUseTypeId);
|
||||
currentHouseInfoList.value = res3.data;
|
||||
floorslist.value = null;
|
||||
floorslist.value = new Set();
|
||||
@@ -191,16 +195,15 @@ export const useHouseStore = defineStore(
|
||||
'buildToward': '',
|
||||
'buildTall': '',
|
||||
'buildStructure': '',
|
||||
'unitCount': null,
|
||||
'floorCount': null,
|
||||
'remark': ''
|
||||
};
|
||||
currentHouseInfoList.value = null;
|
||||
currentBuildingInfo.value = currentBuildingInfoList.value.find((item) => item.id === buildingId);
|
||||
getHouselistAPI(buildingId).then((res) => {
|
||||
if (!res.data) return;
|
||||
currentHouseInfoList.value = res.data;
|
||||
// 获取当前楼栋信息并 赋值
|
||||
currentBuildingInfo.value = currentBuildingInfoList.value.find((item) => item.id === buildingId);
|
||||
|
||||
// 清空 楼层信息
|
||||
floorslist.value.clear();
|
||||
// 重新获取楼层信息
|
||||
@@ -215,7 +218,7 @@ export const useHouseStore = defineStore(
|
||||
|
||||
// 更新数据
|
||||
const updateHouse = () => {
|
||||
initHouse(buildingtype.value);
|
||||
initHouse();
|
||||
};
|
||||
// 删除指定楼栋
|
||||
const deleteBuildingFun = (buildingId: string) => {
|
||||
|
||||
@@ -26,8 +26,8 @@ export function convertBuildingToTree(buildings: any[]): Tree[] {
|
||||
const units = building.units || [];
|
||||
const unitTrees = units.map((unit: any) => {
|
||||
const unitTree: Tree = {
|
||||
label: `${unit.unitNo} 单元`,
|
||||
value: unit.unitNo,
|
||||
label: unit.unitNoName,
|
||||
value: unit.unitNoId,
|
||||
type: 'unitNo',
|
||||
children: []
|
||||
};
|
||||
|
||||
@@ -348,9 +348,7 @@ function submitFormInfo() {
|
||||
}
|
||||
}
|
||||
const cancelForm = () => {
|
||||
router.push({
|
||||
path: '/community'
|
||||
});
|
||||
router.back();
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -59,7 +59,6 @@
|
||||
<el-table-column label="发布人" align="center" prop="createName" />
|
||||
<el-table-column label="操作" align="center" width="300px" fixed="right">
|
||||
<template #default="scope">
|
||||
<!-- TODO 发布按钮!!! -->
|
||||
<el-button v-if="scope.row.status === '0'" link type="primary" @click="handleSend(scope.row)">发布</el-button>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['activity:activity:edit']">编辑</el-button>
|
||||
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['activity:activity:remove']">删除</el-button>
|
||||
|
||||
@@ -116,7 +116,6 @@ function init() {
|
||||
}
|
||||
init();
|
||||
|
||||
// TODO Banner 提交
|
||||
// !== 提交 =============================================================================
|
||||
// 提交
|
||||
const submitForm = () => {
|
||||
|
||||
@@ -69,16 +69,17 @@
|
||||
<el-table-column label="验收人" align="center" prop="inspectionName" />
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<!-- TODO 验收 -->
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
v-if="scope.row.inspectionResult !== '1'"
|
||||
@click="handleInspection(scope.row)"
|
||||
@click="handleInspection(scope.row, 0, '验收')"
|
||||
v-hasPermi="['repair:edit:decoration']"
|
||||
>验收</el-button
|
||||
>
|
||||
<el-button link type="primary" v-else @click="handleInspection(scope.row)" v-hasPermi="['decoration:decoration:query']">详情</el-button>
|
||||
<el-button link type="primary" v-else @click="handleInspection(scope.row, 1, '详情')" v-hasPermi="['decoration:decoration:query']"
|
||||
>详情</el-button
|
||||
>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['decoration:decoration:edit']">编辑</el-button>
|
||||
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['decoration:decoration:remove']">删除</el-button>
|
||||
</template>
|
||||
@@ -90,11 +91,26 @@
|
||||
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="decorationFormRef" :model="form" :rules="rules" label-width="120px">
|
||||
<el-form-item label="验收人姓名" prop="inspectionName">
|
||||
<el-input v-model="form.inspectionName" placeholder="请输入验收人姓名" />
|
||||
<el-form-item label="小区名称" prop="villageName" v-if="isedit === 1">
|
||||
<el-input :disabled="isedit === 1" v-model="form.villageName" />
|
||||
</el-form-item>
|
||||
<el-form-item label="房屋号" prop="houseName" v-if="isedit === 1">
|
||||
<el-input :disabled="isedit === 1" v-model="form.houseName" />
|
||||
</el-form-item>
|
||||
<el-form-item label="申请人" prop="applyName" v-if="isedit === 1">
|
||||
<el-input :disabled="isedit === 1" v-model="form.applyName" />
|
||||
</el-form-item>
|
||||
<el-form-item label="装修公司" prop="decorationCompany" v-if="isedit === 1">
|
||||
<el-input :disabled="isedit === 1" v-model="form.decorationCompany" />
|
||||
</el-form-item>
|
||||
<el-form-item label="装修内容" prop="decorationContent" v-if="isedit === 1">
|
||||
<el-input :disabled="isedit === 1" v-model="form.decorationContent" />
|
||||
</el-form-item>
|
||||
<el-form-item label="装修押金" prop="decorationDeposit" v-if="isedit === 1">
|
||||
<el-input :disabled="isedit === 1" v-model="form.decorationDeposit" />
|
||||
</el-form-item>
|
||||
<el-form-item label="验收结果" prop="inspectionResult">
|
||||
<el-select v-model="form.inspectionResult" placeholder="请选择装修验收结果">
|
||||
<el-select :disabled="isedit === 1" v-model="form.inspectionResult" placeholder="请选择装修验收结果">
|
||||
<el-option
|
||||
v-for="item in com_decoration_status.filter((item) => item.value !== '0')"
|
||||
:key="item.value"
|
||||
@@ -103,11 +119,14 @@
|
||||
/>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="验收人" prop="inspectionName">
|
||||
<el-input :disabled="isedit === 1" v-model="form.inspectionName" />
|
||||
</el-form-item>
|
||||
<el-form-item label="备注" prop="remark">
|
||||
<el-input v-model="form.remark" type="textarea" placeholder="请输入" :rows="5"></el-input>
|
||||
<el-input :disabled="isedit === 1" v-model="form.remark" type="textarea" placeholder="请输入" :rows="5"></el-input>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<template #footer v-if="isedit !== 1">
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
@@ -151,6 +170,8 @@ const initFormData: DecorationForm = {
|
||||
decorationDeposit: undefined,
|
||||
inspectionResult: undefined,
|
||||
remark: undefined,
|
||||
villageName: undefined,
|
||||
houseName: undefined,
|
||||
inspectionName: undefined
|
||||
};
|
||||
const data = reactive<PageData<DecorationForm, DecorationQuery>>({
|
||||
@@ -233,14 +254,16 @@ const handleUpdate = async (row?: DecorationVO) => {
|
||||
});
|
||||
};
|
||||
|
||||
const isedit = ref(1);
|
||||
/** 验收 */
|
||||
const handleInspection = (row: DecorationVO) => {
|
||||
const handleInspection = (row: DecorationVO, edit: number, type: string) => {
|
||||
form.value = {
|
||||
...form.value,
|
||||
...row
|
||||
};
|
||||
dialog.visible = true;
|
||||
dialog.title = '验收';
|
||||
dialog.title = type;
|
||||
isedit.value = edit;
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
|
||||
@@ -76,9 +76,7 @@ const submitForm = () => {
|
||||
};
|
||||
// 推出
|
||||
const cancelForm = () => {
|
||||
router.push({
|
||||
path: '/system/HouseFacilities'
|
||||
});
|
||||
router.back();
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -204,9 +204,7 @@ const submitForm = () => {
|
||||
};
|
||||
// 推出
|
||||
const cancelForm = () => {
|
||||
router.push({
|
||||
path: '/carArea/monthCard'
|
||||
});
|
||||
router.back();
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -10,7 +10,8 @@
|
||||
}"
|
||||
@click="handleClick(1)"
|
||||
>
|
||||
待办({{ todonum }})
|
||||
待办
|
||||
<span v-if="todonum !== 0">({{ todonum }})</span>
|
||||
</li>
|
||||
<li
|
||||
:class="{
|
||||
@@ -18,29 +19,34 @@
|
||||
}"
|
||||
@click="handleClick(2)"
|
||||
>
|
||||
通知({{ noticnum }})
|
||||
通知
|
||||
<span v-if="noticnum !== 0">({{ noticnum }})</span>
|
||||
</li>
|
||||
</ul>
|
||||
<div class="rightbody">
|
||||
<div class="flex" v-if="activeTabs === 1">
|
||||
<h3 class="title">代办({{ todonum }})</h3>
|
||||
<h3 class="title">
|
||||
代办 <span v-if="todonum !== 0">({{ todonum }})</span>
|
||||
</h3>
|
||||
<el-button link type="primary">清除未读</el-button>
|
||||
</div>
|
||||
<div class="flex" v-else-if="activeTabs === 2">
|
||||
<h3 class="title">通知({{ noticnum }})</h3>
|
||||
<h3 class="title">
|
||||
通知<span v-if="noticnum !== 0">({{ noticnum }})</span>
|
||||
</h3>
|
||||
<el-button link type="primary">清除未读</el-button>
|
||||
</div>
|
||||
<ul v-if="activeTabs === 1">
|
||||
<li
|
||||
v-for="(item, index) in arr"
|
||||
v-for="(item, index) in awaittoList"
|
||||
:key="index"
|
||||
@click="() => (item.disabled = !item.disabled)"
|
||||
@click="handleRead(item)"
|
||||
:class="{
|
||||
disable: item.disabled
|
||||
disable: !isdisable(item)
|
||||
}"
|
||||
>
|
||||
<div class="subtitle">报修工单提醒</div>
|
||||
<div class="info">您有一条新的报修工单需要处理,保修标题:下水道堵塞</div>
|
||||
<div class="subtitle">{{ item.title }}</div>
|
||||
<div class="info">{{ item.content }},保修标题:{{ item.item }}</div>
|
||||
</li>
|
||||
</ul>
|
||||
<ul v-else-if="activeTabs === 2">
|
||||
@@ -62,6 +68,7 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { getNotificationList } from '@/api/system/Notification/index';
|
||||
import { ref } from 'vue';
|
||||
|
||||
const activeTabs = ref(1);
|
||||
@@ -71,33 +78,28 @@ function handleClick(tab: number) {
|
||||
}
|
||||
|
||||
const todonum = computed(() => {
|
||||
return arr.value.filter((item) => item.disabled === false).length;
|
||||
return awaittoList.value.filter((item) => isdisable(item)).length;
|
||||
});
|
||||
const noticnum = computed(() => {
|
||||
return noticelist.value.filter((item) => item.disabled === false).length;
|
||||
return noticelist.value.filter((item) => isdisable(item)).length;
|
||||
});
|
||||
const arr = ref(
|
||||
Array.from({ length: 10 }, (_, i) => {
|
||||
return {
|
||||
id: i,
|
||||
title: '报修工单提醒',
|
||||
content: '您有一条新的报修工单需要处理,保修标题:下水道堵塞',
|
||||
disabled: false
|
||||
};
|
||||
})
|
||||
);
|
||||
|
||||
const noticelist = ref(
|
||||
Array.from({ length: 10 }, (_, i) => {
|
||||
return {
|
||||
id: i,
|
||||
title: '报修工单提醒',
|
||||
content: '您有一条新的报修工单需要处理,保修标题:下水道堵塞',
|
||||
disabled: false
|
||||
};
|
||||
})
|
||||
);
|
||||
function isdisable(item) {
|
||||
return item.repairIsCheck ? item.repairIsCheck === '1' : item.manageIsCheck === '1';
|
||||
}
|
||||
const noticelist = ref([]);
|
||||
const awaittoList = ref([]);
|
||||
function init() {
|
||||
getNotificationList({
|
||||
pageNum: 1,
|
||||
pageSize: 10
|
||||
}).then((res) => {
|
||||
awaittoList.value = res.data;
|
||||
});
|
||||
}
|
||||
init();
|
||||
|
||||
function handleRead(row) {}
|
||||
function handleDisable(row) {
|
||||
row.disabled = true;
|
||||
}
|
||||
|
||||
@@ -243,9 +243,7 @@ const submitForm = () => {
|
||||
};
|
||||
// 推出
|
||||
const cancelForm = () => {
|
||||
router.push({
|
||||
path: '/carArea/parkingCost'
|
||||
});
|
||||
router.back();
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -261,9 +261,7 @@ const sendForm = (str: string) => {
|
||||
};
|
||||
// 推出
|
||||
const cancelForm = () => {
|
||||
router.push({
|
||||
path: '/repair/repairlist'
|
||||
});
|
||||
router.back();
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -143,9 +143,7 @@ const submitForm = () => {
|
||||
};
|
||||
// 推出
|
||||
const cancelForm = () => {
|
||||
router.push({
|
||||
path: '/system/repairProjectList'
|
||||
});
|
||||
router.back();
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -21,65 +21,52 @@
|
||||
</el-form-item>
|
||||
<!-- 水费,电费, 收费范围为 房屋 -->
|
||||
<el-form-item label="收费范围" prop="chargeScope" v-if="typeNamelist.includes(typeName)">
|
||||
<div class="flex flex-row flex-items-end">
|
||||
<el-radio-group v-model="form.chargeScope">
|
||||
<el-radio v-for="(item, index) in com_bill_charge_scope_house" :key="index" :value="item.value" :label="item.label"></el-radio>
|
||||
<div class="flex flex-col flex-items-end">
|
||||
<el-radio
|
||||
style="margin-right: 0"
|
||||
v-for="(item, index) in com_bill_charge_scope_house"
|
||||
:key="index"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
></el-radio>
|
||||
</div>
|
||||
</el-radio-group>
|
||||
<div @click="handleClearCheckout" v-if="form.chargeScope === '1'" class="ml-10px cursor-pointer color-red">清空</div>
|
||||
<div style="height: 32px">
|
||||
<el-button @click="OpenUseTablesfun('house')" link type="primary" v-if="form.chargeScope === '1'" class="ml-10px">请选择</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<!-- 其他费用, 收费范围为 业主 -->
|
||||
<el-form-item label="收费范围" prop="chargeScope" v-else>
|
||||
<div class="flex flex-row flex-items-end">
|
||||
<el-radio-group v-model="form.chargeScope">
|
||||
<el-radio v-for="(item, index) in com_questionnaire_scope" :key="index" :value="item.value" :label="item.label"></el-radio>
|
||||
<div class="flex flex-col flex-items-end">
|
||||
<el-radio
|
||||
style="margin-right: 0"
|
||||
v-for="(item, index) in com_questionnaire_scope"
|
||||
:key="index"
|
||||
:value="item.value"
|
||||
:label="item.label"
|
||||
></el-radio>
|
||||
</div>
|
||||
</el-radio-group>
|
||||
<div @click="handleClearCheckout" v-if="form.chargeScope === '1'" class="ml-10px cursor-pointer color-red">清空</div>
|
||||
<div style="height: 32px">
|
||||
<el-button @click="OpenUseTablesfun('user')" link type="primary" v-if="form.chargeScope === '1'" class="ml-10px">请选择</el-button>
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<!-- 房屋选择 -->
|
||||
<el-form-item v-if="form.chargeScope === '1' && typeNamelist.includes(typeName)">
|
||||
<div class="residentBox">
|
||||
<ul class="checkoutSideUsesbox">
|
||||
<li v-for="(item, index) in checkoutHouses" :key="index">
|
||||
<span>{{ item.buildingName }}/</span>
|
||||
<span>{{ item.unitNo }}单元/</span>
|
||||
<span>{{ item.floorNo }}楼/</span>
|
||||
<span>{{ item.houseNo }}室</span>
|
||||
<el-icon @click="deleteHouse(item.houseId)">
|
||||
<Delete></Delete>
|
||||
</el-icon>
|
||||
</li>
|
||||
<House returnvalue="*" ref="HolderRef" :isMultiple="true" :userid="form.houseIds.join(',')" @change="handleSelect">
|
||||
<template #default>
|
||||
<li @click="OpenUseTablesfun('house')" class="add justify-center">
|
||||
<el-icon>
|
||||
<DocumentAdd></DocumentAdd>
|
||||
</el-icon>
|
||||
<span>添加房屋</span>
|
||||
</li>
|
||||
</template>
|
||||
</House>
|
||||
</ul>
|
||||
<House returnvalue="houseId" ref="HolderRef" :isMultiple="true" @change="handleSelect"> </House>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<!-- 业主选择 -->
|
||||
<el-form-item v-if="form.chargeScope === '1' && !typeNamelist.includes(typeName)">
|
||||
<div class="residentBox">
|
||||
<ul class="checkoutSideUsesbox">
|
||||
<li v-for="(item, index) in checkoutUser" :key="index">
|
||||
<span>{{ item.house_name }} / {{ item.residentName }} / {{ item.phone }}</span>
|
||||
<el-icon @click="delteUser(item.residentId)">
|
||||
<Delete></Delete>
|
||||
</el-icon>
|
||||
</li>
|
||||
<UserHolder returnvalue="*" ref="userRef" :isMultiple="true" :userid="form.residentIds" @change="handleCheckUser">
|
||||
<template #default>
|
||||
<li @click="OpenUseTablesfun('user')" class="add justify-center">
|
||||
<el-icon>
|
||||
<DocumentAdd></DocumentAdd>
|
||||
</el-icon>
|
||||
<span>添加业主</span>
|
||||
</li>
|
||||
</template>
|
||||
</UserHolder>
|
||||
</ul>
|
||||
<UserHolder returnvalue="residentId" ref="userRef" :isMultiple="true" @change="handleCheckUser"></UserHolder>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="费用周期" prop="chargePeriod">
|
||||
@@ -174,19 +161,19 @@ function handleDate(val: string[]) {
|
||||
// 收费类型
|
||||
const chargeitemlist = ref([]);
|
||||
|
||||
// 房屋列表
|
||||
const houselist = ref([]);
|
||||
// 住户列表
|
||||
const userlist = ref([]);
|
||||
// // 房屋列表
|
||||
// const houselist = ref([]);
|
||||
// // 住户列表
|
||||
// const userlist = ref([]);
|
||||
async function init() {
|
||||
listChargeItem().then((res) => {
|
||||
chargeitemlist.value = res.rows;
|
||||
});
|
||||
|
||||
const res = await listBillHouse({ pageNum: 1, pageSize: 999999 });
|
||||
houselist.value = res.rows;
|
||||
const res2 = await queryResidentList_holder({ pageNum: 1, pageSize: 999999 });
|
||||
userlist.value = res2.rows;
|
||||
// const res = await listBillHouse({ pageNum: 1, pageSize: 999999 });
|
||||
// houselist.value = res.rows;
|
||||
// const res2 = await queryResidentList_holder({ pageNum: 1, pageSize: 999999 });
|
||||
// userlist.value = res2.rows;
|
||||
|
||||
if (route.query.id) {
|
||||
userid.value = route.query.id;
|
||||
@@ -196,31 +183,20 @@ async function init() {
|
||||
...form.value,
|
||||
...res.data
|
||||
};
|
||||
// TODO 没有住户参数
|
||||
form.value.houseIds = res.data.houseIds || [];
|
||||
form.value.residentIds = res.data.residentIds || [];
|
||||
form.value.startDate = formatDate2(form.value.startDate);
|
||||
form.value.endDate = formatDate2(form.value.endDate);
|
||||
StartEndDate.value = [form.value.startDate, form.value.endDate];
|
||||
// TODO houseid 有默认值, 需要处理
|
||||
// TODO residentids 添加,
|
||||
checkoutHouses.value = form.value.houseIds
|
||||
.map((item) => {
|
||||
if (item) {
|
||||
const find = houselist.value.find((it) => it.houseId === item);
|
||||
if (find) {
|
||||
return find;
|
||||
} else {
|
||||
return null;
|
||||
}
|
||||
}
|
||||
})
|
||||
.filter((item) => item !== null);
|
||||
checkoutHouses.value = form.value.houseIds.filter((item) => item);
|
||||
handleChange(form.value.chargeItemId);
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
onMounted(() => {
|
||||
init();
|
||||
});
|
||||
init();
|
||||
|
||||
const typeNamelist = ref(['2049026484272791553', '2049026503017136129']);
|
||||
const typeName = ref('');
|
||||
@@ -239,33 +215,26 @@ function handleChange(val: string) {
|
||||
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();
|
||||
HolderRef.value.open(checkoutHouses.value);
|
||||
} else if (val === 'user') {
|
||||
userRef.value.open();
|
||||
userRef.value.open(checkoutUser.value);
|
||||
}
|
||||
}
|
||||
// 多选
|
||||
const checkoutHouses = ref<BillHouse[]>([]);
|
||||
function handleSelect(val: BillHouse[]) {
|
||||
const checkoutHouses = ref<string[]>([]);
|
||||
function handleSelect(val: string[]) {
|
||||
checkoutHouses.value = val;
|
||||
form.value.houseIds = checkoutHouses.value.map((item) => item.houseId);
|
||||
form.value.houseIds = checkoutHouses.value.map((item) => item).filter((item) => item);
|
||||
}
|
||||
// 多选
|
||||
const checkoutUser = ref([]);
|
||||
/** 添加 业主 */
|
||||
function handleCheckUser(val) {
|
||||
function handleCheckUser(val: string[]) {
|
||||
checkoutUser.value = val;
|
||||
form.value.residentIds = checkoutUser.value.map((item) => item.residentId);
|
||||
}
|
||||
|
||||
/** 删除房屋 */
|
||||
function deleteHouse(id: string) {
|
||||
checkoutHouses.value = checkoutHouses.value.filter((item) => item.houseId !== id);
|
||||
}
|
||||
/** 删除业主 */
|
||||
function delteUser(id: string) {
|
||||
checkoutUser.value = checkoutUser.value.filter((item) => item.residentId !== id);
|
||||
console.log(val);
|
||||
form.value.residentIds = val;
|
||||
}
|
||||
|
||||
/** 清空 */
|
||||
|
||||
@@ -122,7 +122,7 @@ const dialog = reactive<DialogOption>({
|
||||
title: ''
|
||||
});
|
||||
|
||||
const ShowHouselist = ['2049026484272791553'];
|
||||
const ShowHouselist = ['2049026484272791553', '2049026503017136129'];
|
||||
|
||||
const initFormData: BillForm = {
|
||||
id: undefined,
|
||||
|
||||
@@ -61,7 +61,6 @@
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
// TODO 添加临时收费
|
||||
// TODO 预存
|
||||
import { Search } from '@element-plus/icons-vue';
|
||||
import { Component, ref } from 'vue';
|
||||
|
||||
@@ -131,13 +131,13 @@
|
||||
<el-button link type="primary" @click="handleOpenDialog('usedWater', scope.row)" v-hasPermi="['equipment:useWater:electricitydevice']"
|
||||
>用电量</el-button
|
||||
>
|
||||
<el-button
|
||||
<!-- <el-button
|
||||
link
|
||||
type="primary"
|
||||
@click="handleOpenDialog('Upload', scope.row)"
|
||||
v-hasPermi="['equipment:updatehardware:electricitydevice']"
|
||||
>更新固件</el-button
|
||||
>
|
||||
> -->
|
||||
<el-button
|
||||
link
|
||||
type="primary"
|
||||
|
||||
@@ -6,9 +6,10 @@
|
||||
<el-row :gutter="10" style="font-size: 0.8rem; font-weight: 450">
|
||||
<el-col :span="4"> 设备号: {{ routeid }} </el-col>
|
||||
<el-col :span="4"> 房屋号: {{ housename }} </el-col>
|
||||
<el-col :span="14"></el-col>
|
||||
<el-col :span="2">
|
||||
<el-col :span="12"></el-col>
|
||||
<el-col :span="4" class="flex">
|
||||
<el-button @click="confinem">返回</el-button>
|
||||
<el-button type="warning" @click="handleExport">导出数据</el-button>
|
||||
</el-col>
|
||||
</el-row>
|
||||
</template>
|
||||
@@ -35,6 +36,7 @@ import { TopupRecordVO, TopupRecordQuery, TopupRecordForm } from '@/api/system/S
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const routeid = ref(null);
|
||||
const topupRecordList = ref<TopupRecordVO[]>([]);
|
||||
@@ -46,6 +48,7 @@ const initFormData: TopupRecordForm = {
|
||||
deviceCode: undefined,
|
||||
type: undefined
|
||||
};
|
||||
|
||||
const data = reactive<PageData<TopupRecordForm, TopupRecordQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
@@ -82,6 +85,17 @@ onMounted(() => {
|
||||
const confinem = () => {
|
||||
router.back();
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'/topupRecord/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`${queryParams.value.type === '2' ? '水表' : '电表'}—${routeid.value}-充值记录.xlsx`
|
||||
);
|
||||
};
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
|
||||
@@ -44,8 +44,8 @@
|
||||
<el-dropdown-item @click="handleMarkQrcodeZip">
|
||||
<span>批量下载条形码</span>
|
||||
</el-dropdown-item>
|
||||
<!-- <el-dropdown-item v-hasPermi="['equipment:addqrcode:electricitydevice']">
|
||||
<div @click="handleMarkqrcode">批量更新固件</div>
|
||||
<!-- <el-dropdown-item v-hasPermi="['equipment:updatehardware:waterdevice']">
|
||||
<div @click="handleMarkUpload">批量更新固件</div>
|
||||
</el-dropdown-item> -->
|
||||
</template>
|
||||
</right-toolbar>
|
||||
@@ -127,7 +127,7 @@
|
||||
<el-button link type="primary" @click="handleOpenDialog('Upload', scope.row)" v-hasPermi="['equipment:updatehardware:waterdevice']"
|
||||
>更新固件</el-button
|
||||
>
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row.deviceCode)">最新抄表记录</el-button>
|
||||
<!-- <el-button link type="primary" @click="handleUpdate(scope.row.deviceCode)">最新抄表记录</el-button> -->
|
||||
|
||||
<el-button link type="primary" @click="handleOpenDialog('UpdateHouse', scope.row)" v-hasPermi="['equipment:edithouse:waterdevice']"
|
||||
>绑定房屋</el-button
|
||||
@@ -197,15 +197,23 @@
|
||||
</el-form>
|
||||
<!-- upload file -->
|
||||
<el-form v-else-if="dialogType === 'Upload'" ref="UploadFileformRef" :model="UploadFileform" :rules="UploadFileformRules" label-width="140px">
|
||||
<el-form-item label="上传 A槽更新 文件" prop="fileA">
|
||||
<el-form-item label="LEN_A" prop="lenA">
|
||||
<el-input v-model="UploadFileform.lenA"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="CRC32_HEX_A" prop="crcA">
|
||||
<el-input v-model="UploadFileform.crcA"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="上传 A槽更新 文件" prop="urlA">
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
ref="uploadARef"
|
||||
accept=".bin"
|
||||
:action="uploadAUrl"
|
||||
name="file"
|
||||
:headers="headerToken()"
|
||||
:limit="1"
|
||||
:show-file-list="true"
|
||||
class="upload-demo"
|
||||
:on-exceed="handleExceedA"
|
||||
:on-success="handleAvatarSuccessA"
|
||||
:before-upload="beforeAvatarUpload"
|
||||
>
|
||||
@@ -220,15 +228,24 @@
|
||||
</template>
|
||||
</el-upload>
|
||||
</el-form-item>
|
||||
<el-form-item label="上传 B槽更新 文件" prop="fileB">
|
||||
|
||||
<el-form-item label="LEN_B" prop="lenB">
|
||||
<el-input v-model="UploadFileform.lenB"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="CRC32_HEX_B" prop="crcB">
|
||||
<el-input v-model="UploadFileform.crcB"></el-input>
|
||||
</el-form-item>
|
||||
<el-form-item label="上传 B槽更新 文件" prop="urlB">
|
||||
<el-upload
|
||||
ref="uploadRef"
|
||||
ref="uploadBRef"
|
||||
accept=".bin"
|
||||
:action="uploadBUrl"
|
||||
name="file"
|
||||
:limit="1"
|
||||
:headers="headerToken()"
|
||||
:show-file-list="true"
|
||||
class="upload-demo"
|
||||
:on-exceed="handleExceedB"
|
||||
:on-success="handleAvatarSuccessB"
|
||||
:before-upload="beforeAvatarUpload"
|
||||
>
|
||||
@@ -301,6 +318,7 @@ import { Upload } from '@element-plus/icons-vue';
|
||||
import { CascaderValue, UploadProps, UploadRawFile } from 'element-plus';
|
||||
import { checkPermi } from '@/utils/permission';
|
||||
import { exportImagesToZip } from '@/utils/exportZip';
|
||||
import { genFileId } from 'element-plus';
|
||||
|
||||
const uploadAUrl = import.meta.env.VITE_APP_BASE_API + '/waterDevice/uploadA';
|
||||
const uploadBUrl = import.meta.env.VITE_APP_BASE_API + '/waterDevice/uploadB';
|
||||
@@ -390,14 +408,20 @@ const rules = {
|
||||
|
||||
// ? 上传固件 ==============================================================================================
|
||||
const UploadFileformRef = ref(null);
|
||||
const uploadRef = ref();
|
||||
const uploadBRef = ref();
|
||||
const uploadARef = ref();
|
||||
const UploadFileform = ref({
|
||||
deviceCodes: [],
|
||||
urlA: '',
|
||||
urlB: ''
|
||||
lenA: '',
|
||||
crcA: '',
|
||||
urlB: '',
|
||||
crcB: '',
|
||||
lenB: ''
|
||||
});
|
||||
const UploadFileformRules = {
|
||||
file: [{ required: true, message: '更新文件不能为空', trigger: 'blur' }]
|
||||
urlA: [{ required: true, message: 'A更新文件不能为空', trigger: 'blur' }],
|
||||
urlB: [{ required: true, message: 'B更新文件不能为空', trigger: 'blur' }]
|
||||
};
|
||||
function headerToken() {
|
||||
const useStore = useUserStore();
|
||||
@@ -431,16 +455,27 @@ const handleAvatarSuccessA: UploadProps['onSuccess'] = (response: any) => {
|
||||
const handleAvatarSuccessB: UploadProps['onSuccess'] = (response: any) => {
|
||||
UploadFileform.value.urlB = response.data.url;
|
||||
};
|
||||
const handleExceedB: UploadProps['onExceed'] = (files) => {
|
||||
uploadBRef.value!.clearFiles();
|
||||
const file = files[0] as UploadRawFile;
|
||||
file.uid = genFileId();
|
||||
uploadBRef.value!.handleStart(file);
|
||||
uploadBRef.value!.submit();
|
||||
};
|
||||
const handleExceedA: UploadProps['onExceed'] = (files) => {
|
||||
uploadARef.value!.clearFiles();
|
||||
const file = files[0] as UploadRawFile;
|
||||
file.uid = genFileId();
|
||||
uploadARef.value!.handleStart(file);
|
||||
uploadARef.value!.submit();
|
||||
};
|
||||
|
||||
// ? 上传固件 ==============================================================================================
|
||||
|
||||
// * 编辑房屋 ==============================================================================================
|
||||
// 编辑房屋
|
||||
const EditHouseformRef = ref(null);
|
||||
const EditHouseformRules = {
|
||||
fileA: [{ required: true, message: 'A文件不能为空', trigger: 'blur' }],
|
||||
fileB: [{ required: true, message: 'B文件不能为空', trigger: 'blur' }]
|
||||
};
|
||||
const EditHouseformRules = {};
|
||||
const EditHouseform = ref({
|
||||
id: '',
|
||||
deviceCode: '',
|
||||
@@ -483,6 +518,17 @@ function handleMarkQrcodeZip() {
|
||||
ElMessage.warning('请选择设备');
|
||||
}
|
||||
}
|
||||
function handleMarkUpload() {
|
||||
if (ids.value.length > 0) {
|
||||
reset();
|
||||
UploadFileform.value.deviceCodes = ids.value.map((item) => item.deviceCode).filter((item) => item);
|
||||
dialog.title = '固件上传';
|
||||
dialog.visible = true;
|
||||
dialogType.value = 'Upload';
|
||||
} else {
|
||||
ElMessage.warning('请选择设备');
|
||||
}
|
||||
}
|
||||
|
||||
function produceQRzip(vals: WaterDeviceVO[]) {
|
||||
const arr = vals.map((item) => {
|
||||
@@ -623,7 +669,14 @@ const submitForm = () => {
|
||||
}
|
||||
});
|
||||
} else if (dialogType.value === 'Upload') {
|
||||
WaterDeviceUpdateBin(UploadFileform.value);
|
||||
UploadFileformRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
await WaterDeviceUpdateBin(UploadFileform.value).finally(() => (buttonLoading.value = false));
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
unSubmit();
|
||||
}
|
||||
});
|
||||
}
|
||||
};
|
||||
const unSubmit = () => {
|
||||
@@ -653,6 +706,10 @@ const reset = () => {
|
||||
UploadFileform.value.deviceCodes = [];
|
||||
UploadFileform.value.urlA = '';
|
||||
UploadFileform.value.urlB = '';
|
||||
UploadFileform.value.lenA = '';
|
||||
UploadFileform.value.crcA = '';
|
||||
UploadFileform.value.lenB = '';
|
||||
UploadFileform.value.crcB = '';
|
||||
|
||||
// 上传 清空
|
||||
UploadFileformRef.value?.resetFields();
|
||||
|
||||
@@ -104,9 +104,7 @@ const submitForm = () => {
|
||||
};
|
||||
// 推出
|
||||
const cancelForm = () => {
|
||||
router.push({
|
||||
path: '/carArea/carAreaList'
|
||||
});
|
||||
router.back();
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -248,9 +248,7 @@ const submitForm = () => {
|
||||
|
||||
// 推出
|
||||
const cancelForm = () => {
|
||||
router.push({
|
||||
path: '/carArea/cars'
|
||||
});
|
||||
router.back();
|
||||
};
|
||||
|
||||
// 选择住户
|
||||
|
||||
@@ -12,11 +12,11 @@
|
||||
<el-form-item label="楼栋名称" prop="buildingName">
|
||||
<el-input v-model.trim="form.buildingName" placeholder="请输入楼栋名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="楼栋类型" prop="buildingUse">
|
||||
<!-- <el-form-item label="楼栋类型" prop="buildingUse">
|
||||
<el-select v-model="form.buildingUse" placeholder="选择楼栋类型">
|
||||
<el-option v-for="(item, index) in com_build_use" :key="index" :label="item.label" :value="item.value"></el-option>
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="楼栋朝向" prop="buildToward">
|
||||
<el-input v-model.trim="form.buildToward" placeholder="请输入楼栋朝向" />
|
||||
</el-form-item>
|
||||
@@ -26,9 +26,9 @@
|
||||
<el-form-item label="楼栋结构" prop="buildStructure">
|
||||
<el-input v-model.trim="form.buildStructure" placeholder="请输入楼栋结构" />
|
||||
</el-form-item>
|
||||
<el-form-item label="单元数" prop="unitCount">
|
||||
<!-- <el-form-item label="单元数" prop="unitCount">
|
||||
<el-input-number :min="1" v-model.trim="form.unitCount" placeholder="单元数" />
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item label="楼层" prop="floorCount">
|
||||
<el-input-number :min="1" v-model.trim="form.floorCount" placeholder="楼层数" />
|
||||
</el-form-item>
|
||||
@@ -61,14 +61,14 @@ const form = ref({
|
||||
buildingName: '',
|
||||
buildToward: '',
|
||||
buildTall: '',
|
||||
buildingUse: '0',
|
||||
// buildingUse: '0',
|
||||
buildStructure: '',
|
||||
unitCount: null,
|
||||
floorCount: null
|
||||
// unitCount: null,
|
||||
floorCount: 1
|
||||
});
|
||||
const rules = ref({
|
||||
buildingName: [{ required: true, message: '请输入楼栋名称', trigger: 'blur' }],
|
||||
buildingUse: [{ required: true, message: '请选择楼栋类型', trigger: 'blur' }],
|
||||
// buildingUse: [{ required: true, message: '请选择楼栋类型', trigger: 'blur' }],
|
||||
unitCount: [{ required: true, message: '请输入单元数', trigger: 'blur' }],
|
||||
floorCount: [{ required: true, message: '请输入楼层数', trigger: 'blur' }]
|
||||
});
|
||||
@@ -85,10 +85,10 @@ function getBuildingById() {
|
||||
if (item.id == buildingId) {
|
||||
form.value.buildingName = item.buildingName;
|
||||
form.value.buildToward = item.buildToward;
|
||||
form.value.buildingUse = item.buildingUse;
|
||||
// form.value.buildingUse = item.buildingUse;
|
||||
form.value.buildTall = item.buildTall;
|
||||
form.value.buildStructure = item.buildStructure;
|
||||
form.value.unitCount = item.unitCount;
|
||||
// form.value.unitCount = item.unitCount;
|
||||
form.value.floorCount = item.floorCount;
|
||||
}
|
||||
});
|
||||
|
||||
@@ -10,9 +10,14 @@
|
||||
<el-option v-for="item in houseStore.currentBuildingInfoList" :key="item.id" :label="item.buildingName" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单元" prop="unit">
|
||||
<el-select @change="changeUnitNo" v-model.number="form.unitNo" placeholder="请选择">
|
||||
<el-option v-for="item in units" :key="item.no" :label="item.name" :value="item.no" />
|
||||
<el-form-item label="房屋用途" prop="houseUseTypeId">
|
||||
<el-select v-model="form.houseUseTypeId" placeholder="请选择">
|
||||
<el-option v-for="item in houseUseTypeList" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="单元" prop="unitNoId">
|
||||
<el-select @change="changeUnitNo" v-model="form.unitNoId" placeholder="请选择">
|
||||
<el-option v-for="item in units" :key="item.id" :label="item.name" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
<el-form-item label="楼层" prop="floor">
|
||||
@@ -20,6 +25,7 @@
|
||||
<el-option v-for="item in floors" :key="item.no" :label="item.name" :value="item.no" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="房间号" prop="houseNo">
|
||||
<el-input v-model="form.houseNo" placeholder="请输入房间号" />
|
||||
</el-form-item>
|
||||
@@ -51,7 +57,7 @@
|
||||
<span>卫</span>
|
||||
</div>
|
||||
</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-option v-for="item in parkinglist" :key="item.id" :label="item.parkingName" :value="item.id" />
|
||||
</el-select>
|
||||
@@ -60,7 +66,7 @@
|
||||
<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-select>
|
||||
</el-form-item>
|
||||
</el-form-item> -->
|
||||
<el-form-item style="margin-top: 30px">
|
||||
<el-button type="primary" @click="submitForm">确定</el-button>
|
||||
<el-button @click="cancelForm">取消</el-button>
|
||||
@@ -79,6 +85,11 @@ import { addHouseAPI, EditHouseApi, getBuildingOnly, getHouseApi, getHouselistAP
|
||||
import { addHouseType } from '@/api/system/house/type';
|
||||
import { GetVillageListParking, listParking } from '@/api/system/parking';
|
||||
import { GetVillagelistStoreroom, listStoreroom } from '@/api/system/storeroom';
|
||||
import { listHouseUseType } from '@/api/system/houseUse';
|
||||
import { getByBUildingidtoUnitNo } from '@/api/system/houseUnit';
|
||||
|
||||
// const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
// const { com_build_use } = toRefs<any>(proxy?.useDict('com_build_use'));
|
||||
|
||||
const router = useRouter();
|
||||
const route = useRoute();
|
||||
@@ -86,7 +97,8 @@ const houseStore = useHouseStore();
|
||||
const formRef = ref();
|
||||
const form = ref<addHouseType>({
|
||||
buildingId: '',
|
||||
unitNo: '',
|
||||
houseUseTypeId: '', // 房屋用途
|
||||
unitNoId: '',
|
||||
floorNo: '',
|
||||
houseNo: '', // 房间号
|
||||
houseArea: '', //建筑面积
|
||||
@@ -98,9 +110,9 @@ const form = ref<addHouseType>({
|
||||
});
|
||||
const rules = ref({
|
||||
buildingId: [{ required: true, message: '请输入楼栋', trigger: 'blur' }],
|
||||
unitNo: [{ required: true, message: '请选择单元', trigger: 'blur' }],
|
||||
unitNoId: [{ required: true, message: '请选择单元', trigger: 'blur' }],
|
||||
floorNo: [{ required: true, message: '请选择楼层', trigger: 'blur' }],
|
||||
houseUse: [{ required: true, message: '请选择房屋类型', trigger: 'blur' }],
|
||||
houseUseTypeId: [{ required: true, message: '请选择房屋用途', trigger: 'blur' }],
|
||||
buildingName: [{ required: true, message: '请输入房间号', trigger: 'blur' }],
|
||||
buildingArea: [{ required: true, message: '请输入建筑面积', trigger: 'blur' }],
|
||||
internalFloorArea: [{ required: true, message: '请输入套内面积', trigger: 'blur' }],
|
||||
@@ -121,72 +133,94 @@ const queryChangestore = ref({
|
||||
// buildingId
|
||||
buildingId: null,
|
||||
// unitno,
|
||||
unitNo: null
|
||||
unitNoId: null
|
||||
});
|
||||
// TODO 回显 车位,储藏, 以为后端筛选完出没人的房屋
|
||||
const villageid = localStorage.getItem('villageid');
|
||||
async function init() {
|
||||
const res = await GetVillageListParking(villageid);
|
||||
parkinglist.value = res.data;
|
||||
const res1 = await GetVillagelistStoreroom({
|
||||
...queryChangestore.value,
|
||||
villageid: villageid
|
||||
});
|
||||
storeRoomlist.value = res1.data;
|
||||
nextTick(() => geteditinfo());
|
||||
}
|
||||
init();
|
||||
|
||||
function geteditinfo() {
|
||||
const houseUseTypeList = ref([]);
|
||||
async function geteditinfo() {
|
||||
listHouseUseType({
|
||||
pageNum: 1,
|
||||
pageSize: 99999
|
||||
}).then((res) => {
|
||||
houseUseTypeList.value = res.rows;
|
||||
});
|
||||
if (route.query.id) {
|
||||
houseid.value = route.query.id;
|
||||
// const res = await GetVillageListParking(villageid, houseid.value);
|
||||
// parkinglist.value = res.data;
|
||||
// GetVillagelistStoreroom({
|
||||
// ...queryChangestore.value,
|
||||
// villageid: villageid,
|
||||
// houseId: houseid.value
|
||||
// }).then((res1) => {
|
||||
// storeRoomlist.value = res1.data;
|
||||
// });
|
||||
getHouseApi(houseid.value).then((res) => {
|
||||
form.value = {
|
||||
...form.value,
|
||||
buildingId: res.data.buildingId, // 楼栋id
|
||||
houseId: res.data.houseId, // 房屋id
|
||||
unitNo: res.data.unitNo,
|
||||
unitNoId: res.data.unitNoId,
|
||||
floorNo: res.data.floorNo,
|
||||
houseNo: res.data.houseNo, // 房间号
|
||||
houseArea: res.data.houseArea, //建筑面积
|
||||
internalArea: res.data.internalArea, //套内面积
|
||||
storeroomId: res.data.storeroomId, //储藏室
|
||||
parkingId: res.data.parkingId, //车位
|
||||
houseUseTypeId: res.data.houseUseTypeId,
|
||||
shareArea: res.data.shareArea // 公摊面积
|
||||
};
|
||||
housetype.value = res.data.houseType.split('');
|
||||
// handlechangeBuild(form.value.buildingId);
|
||||
console.log(housetype.value);
|
||||
changeBuild(res.data.buildingId);
|
||||
});
|
||||
} else {
|
||||
// const res = await GetVillageListParking(villageid);
|
||||
// parkinglist.value = res.data;
|
||||
// const res1 = await GetVillagelistStoreroom({
|
||||
// ...queryChangestore.value,
|
||||
// villageid: villageid
|
||||
// });
|
||||
// storeRoomlist.value = res1.data;
|
||||
}
|
||||
}
|
||||
// 选择楼栋
|
||||
function handlechangeBuild(id: string) {
|
||||
queryChangestore.value.buildingId = id;
|
||||
form.value.unitNo = '';
|
||||
form.value.unitNoId = '';
|
||||
form.value.floorNo = '';
|
||||
getBuildingOnly(id).then((res) => {
|
||||
units.value = Array.from({ length: res.data.unitCount }).map((_, index) => {
|
||||
return {
|
||||
no: index + 1,
|
||||
name: index + 1 + '单元'
|
||||
};
|
||||
});
|
||||
floors.value = Array.from({ length: res.data.floorCount }).map((_, index) => {
|
||||
|
||||
changeBuild(id);
|
||||
// getStoreRoomlist();
|
||||
}
|
||||
|
||||
function changeBuild(id: string) {
|
||||
const arr = houseStore.currentBuildingInfoList;
|
||||
const find = arr.find((item) => item.id === id);
|
||||
if (find) {
|
||||
floors.value = Array.from({ length: find.floorCount }).map((_, index) => {
|
||||
return {
|
||||
no: index + 1,
|
||||
name: index + 1 + '楼'
|
||||
};
|
||||
});
|
||||
}
|
||||
getByBUildingidtoUnitNo(id).then((res) => {
|
||||
units.value = res.data;
|
||||
});
|
||||
getStoreRoomlist();
|
||||
}
|
||||
|
||||
// change unit
|
||||
function changeUnitNo(id: number) {
|
||||
queryChangestore.value.unitNo = id;
|
||||
// change unitNoId
|
||||
function changeUnitNo(id: string) {
|
||||
queryChangestore.value.unitNoId = id;
|
||||
form.value.floorNo = '';
|
||||
getStoreRoomlist();
|
||||
// getStoreRoomlist();
|
||||
}
|
||||
|
||||
// 查询储藏室列表
|
||||
@@ -195,7 +229,7 @@ function getStoreRoomlist() {
|
||||
...queryChangestore.value,
|
||||
villageid: villageid
|
||||
}).then((res) => {
|
||||
form.value.storeroom = '';
|
||||
form.value.storeroomId = '';
|
||||
storeRoomlist.value = [];
|
||||
storeRoomlist.value = res.data;
|
||||
});
|
||||
@@ -231,9 +265,7 @@ const submitForm = () => {
|
||||
};
|
||||
const cancelForm = () => {
|
||||
formRef?.value.resetFields();
|
||||
router.push({
|
||||
path: '/house/houselist'
|
||||
});
|
||||
router.back();
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -4,9 +4,9 @@
|
||||
<div class="AddBuildingBody">
|
||||
<div class="title">
|
||||
<span>基本信息</span>
|
||||
<el-button type="primary" text @click="editHouse">编辑</el-button>
|
||||
<el-button v-hasPermi="['system:house:edit']" type="primary" text v-if="HouseInfo.house" @click="editHouse">编辑</el-button>
|
||||
</div>
|
||||
<div class="addBuildingFormBody">
|
||||
<div class="addBuildingFormBody" v-if="HouseInfo.house">
|
||||
<div class="descriptionsbox">
|
||||
<div class="label">房号:</div>
|
||||
<div class="value">{{ HouseInfo.house?.houseNo ?? '--' }}</div>
|
||||
@@ -21,7 +21,7 @@
|
||||
</div>
|
||||
<div class="descriptionsbox">
|
||||
<div class="label">单元:</div>
|
||||
<div class="value">{{ HouseInfo.house?.unitNo ?? '--' }} 单元</div>
|
||||
<div class="value">{{ HouseInfo.house?.unitNoName ?? '--' }} 单元</div>
|
||||
</div>
|
||||
<div class="descriptionsbox">
|
||||
<div class="label">楼层:</div>
|
||||
@@ -29,11 +29,11 @@
|
||||
</div>
|
||||
<div class="descriptionsbox">
|
||||
<div class="label">建筑面积:</div>
|
||||
<div class="value">{{ HouseInfo.house?.houseArea ?? '--' }}㎡</div>
|
||||
<div class="value">{{ HouseInfo.house?.houseArea ? `${HouseInfo.house?.houseArea} ㎡` : '--' }}</div>
|
||||
</div>
|
||||
<div class="descriptionsbox">
|
||||
<div class="label">公摊面积:</div>
|
||||
<div class="value">{{ HouseInfo.house?.shareArea ?? '--' }}㎡</div>
|
||||
<div class="value">{{ HouseInfo.house?.shareArea ? `${HouseInfo.house?.shareArea} ㎡` : '--' }}</div>
|
||||
</div>
|
||||
<div class="descriptionsbox">
|
||||
<div class="label">户型:</div>
|
||||
@@ -44,14 +44,17 @@
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 储藏室信息 -->
|
||||
<div class="AddBuildingBody">
|
||||
<div class="title">
|
||||
<span>储藏室信息 </span>
|
||||
<el-button type="primary" text @click="editStoreRoom">编辑</el-button>
|
||||
<el-button v-hasPermi="['storeroom:storeroom:edit']" type="primary" text v-if="HouseInfo.storeroom" @click="editStoreRoom">编辑</el-button>
|
||||
</div>
|
||||
<div class="addBuildingFormBody">
|
||||
<div class="addBuildingFormBody" v-if="HouseInfo.storeroom">
|
||||
<div class="descriptionsbox">
|
||||
<div class="label">楼栋:</div>
|
||||
<div class="value">{{ HouseInfo.storeroom?.buildingName ?? '--' }}</div>
|
||||
@@ -81,53 +84,70 @@
|
||||
<div class="value"></div>
|
||||
</div>
|
||||
</div>
|
||||
<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>
|
||||
</div>
|
||||
</div>
|
||||
<!-- 车位信息 -->
|
||||
<div class="AddBuildingBody">
|
||||
<div class="title">
|
||||
<span>车位信息</span>
|
||||
<el-button type="primary" text @click="handleEditParking" v-if="HouseInfo.parking">编辑</el-button>
|
||||
<el-button v-hasPermi="['parking:parking:edit']" type="primary" text @click="handleEditParking" v-if="HouseInfo.parking">编辑</el-button>
|
||||
</div>
|
||||
<div class="addBuildingFormBody" v-if="HouseInfo.parking">
|
||||
<div class="descriptionsbox">
|
||||
<div class="label">区域:</div>
|
||||
<div class="value">{{ HouseInfo.storeroom?.shareArea ?? '--' }}</div>
|
||||
<div class="value">{{ HouseInfo.parking?.areaName ?? '--' }}</div>
|
||||
</div>
|
||||
<div class="descriptionsbox">
|
||||
<div class="label">车位编号:</div>
|
||||
<div class="value">18100000000</div>
|
||||
<div class="value">{{ HouseInfo.parking?.parkingCode ?? '--' }}</div>
|
||||
</div>
|
||||
<div class="descriptionsbox">
|
||||
<div class="label">车位面积:</div>
|
||||
<div class="value">2栋</div>
|
||||
<div class="value">{{ HouseInfo.parking?.parkingArea ?? '--' }} ㎡</div>
|
||||
</div>
|
||||
<div class="descriptionsbox">
|
||||
<div class="label">楼层:</div>
|
||||
<div class="value">2单元</div>
|
||||
<div class="value">{{ HouseInfo.parking?.parkingFloor ?? '--' }}</div>
|
||||
</div>
|
||||
<div class="descriptionsbox">
|
||||
<div class="label">车位类型:</div>
|
||||
<div class="value">3楼</div>
|
||||
<div class="value">
|
||||
<dict-tag :options="com_parking_type" :value="HouseInfo.parking.type" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="descriptionsbox">
|
||||
<div class="label">车位状态:</div>
|
||||
<div class="value">112㎡</div>
|
||||
<div class="value">
|
||||
<dict-tag :options="com_parking_status" :value="HouseInfo.parking.parkingStatus" />
|
||||
</div>
|
||||
</div>
|
||||
<div class="descriptionsbox">
|
||||
<div class="label">持有人:</div>
|
||||
<div class="value">12㎡</div>
|
||||
<div class="value">
|
||||
<span>{{ HouseInfo.parking?.residentName ?? '--' }}</span>
|
||||
<el-button
|
||||
v-hasPermi="['parking:parking:edit']"
|
||||
type="primary"
|
||||
text
|
||||
@click="handleEditUser(HouseInfo.parking.residentId)"
|
||||
v-if="HouseInfo.parking"
|
||||
>编辑</el-button
|
||||
>
|
||||
</div>
|
||||
</div>
|
||||
<div class="descriptionsbox">
|
||||
<div class="label">添加时间:</div>
|
||||
<div class="value">3室2厅2卫</div>
|
||||
<div class="value">{{ HouseInfo.parking?.createTime ?? '--' }}</div>
|
||||
</div>
|
||||
<div class="descriptionsbox">
|
||||
<div class="label">添加人:</div>
|
||||
<div class="value">3室2厅2卫</div>
|
||||
<div class="value">{{ HouseInfo.parking?.createName ?? '--' }}</div>
|
||||
</div>
|
||||
<div class="descriptionsbox">
|
||||
<div class="label">备注:</div>
|
||||
<div class="value"></div>
|
||||
<div class="value">{{ HouseInfo.parking?.remark ?? '--' }}</div>
|
||||
</div>
|
||||
</div>
|
||||
<div v-else class="w-full h-full flex flex-center min-h-4rem">
|
||||
@@ -210,32 +230,12 @@ const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_resident_relationship } = toRefs<any>(proxy?.useDict('com_resident_relationship'));
|
||||
const { sys_user_sex } = toRefs<any>(proxy?.useDict('sys_user_sex'));
|
||||
const { com_pay_status } = toRefs<any>(proxy?.useDict('com_pay_status'));
|
||||
const tableData = [
|
||||
{
|
||||
date: '2016-05-03',
|
||||
name: 'Tom',
|
||||
address: 'No. 189, Grove St, Los Angeles'
|
||||
},
|
||||
{
|
||||
date: '2016-05-02',
|
||||
name: 'Tom',
|
||||
address: 'No. 189, Grove St, Los Angeles'
|
||||
},
|
||||
{
|
||||
date: '2016-05-04',
|
||||
name: 'Tom',
|
||||
address: 'No. 189, Grove St, Los Angeles'
|
||||
},
|
||||
{
|
||||
date: '2016-05-01',
|
||||
name: 'Tom',
|
||||
address: 'No. 189, Grove St, Los Angeles'
|
||||
}
|
||||
];
|
||||
const { com_parking_type } = toRefs<any>(proxy?.useDict('com_parking_type'));
|
||||
const { com_parking_status } = toRefs<any>(proxy?.useDict('com_parking_status'));
|
||||
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
const routeid = ref('');
|
||||
|
||||
const HouseInfo = ref<Data>({
|
||||
billResidentList: [],
|
||||
chargeItemList: [],
|
||||
@@ -262,12 +262,20 @@ function editStoreRoom() {
|
||||
}
|
||||
function handleEditParking() {
|
||||
router.push({
|
||||
path: '/house/editParking',
|
||||
path: '/carArea/editParking',
|
||||
query: {
|
||||
id: HouseInfo.value.parking.parkingId
|
||||
}
|
||||
});
|
||||
}
|
||||
function handleEditUser(id: string) {
|
||||
router.push({
|
||||
path: '/house/editResident',
|
||||
query: {
|
||||
id: id
|
||||
}
|
||||
});
|
||||
}
|
||||
function init() {
|
||||
if (route.query.id) {
|
||||
routeid.value = route.query.id as string;
|
||||
|
||||
@@ -44,13 +44,14 @@ const handleCalp = (event: MouseEvent, houseid: string) => {
|
||||
.house-list {
|
||||
display: flex;
|
||||
flex-wrap: wrap;
|
||||
max-height: 300px;
|
||||
gap: 10px;
|
||||
max-height: 400px;
|
||||
overflow: auto;
|
||||
justify-content: space-evenly;
|
||||
overflow-x: hidden;
|
||||
}
|
||||
|
||||
.house {
|
||||
width: 100px;
|
||||
min-width: 100px;
|
||||
height: 40px;
|
||||
line-height: 40px;
|
||||
border: 1px solid #ddd;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
<template>
|
||||
<div class="h-full">
|
||||
<div class="TableBox p-5 h-full" v-if="houseStore.currentHouseInfoList !== null">
|
||||
<el-checkbox-group @change="handleChangeCheckhouses" v-model="houseStore.checkoutHouses">
|
||||
<el-table border :data="houseStore.currentFloorInfoList">
|
||||
@@ -10,10 +11,14 @@
|
||||
<el-table-column
|
||||
min-width="260"
|
||||
align="center"
|
||||
:label="`${unit.unitNo}单元`"
|
||||
v-for="(unit, index) in houseStore.currentHouseInfoList?.units.length > 0 ? houseStore.currentHouseInfoList?.units : []"
|
||||
:key="index"
|
||||
>
|
||||
<template #header>
|
||||
<span>{{ unit.unitNoName }}</span>
|
||||
<el-button 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>
|
||||
</template>
|
||||
<template #default="{ row }">
|
||||
<houseItem @contextmenufun="contextMenuFun" :menu-list="menutlist" :unit="unit.floors" :f-idx="row"></houseItem>
|
||||
</template>
|
||||
@@ -21,6 +26,8 @@
|
||||
</el-table>
|
||||
</el-checkbox-group>
|
||||
</div>
|
||||
<div v-else class="nodata">暂无房屋</div>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
@@ -32,6 +39,8 @@ import { checkPermi } from '@/utils/permission';
|
||||
const houseStore = useHouseStore();
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const emit = defineEmits(['editUnit', 'deleteUnit']);
|
||||
|
||||
const router = useRouter();
|
||||
const menutlist = [
|
||||
// { label: '编辑', value: 'edit' },
|
||||
@@ -85,6 +94,13 @@ function contextMenuFun(val: { type: string; value: string }) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
function HandleEditUnit(unit) {
|
||||
emit('editUnit', unit.unitNoId);
|
||||
}
|
||||
function HandleDeleteUnit(unit) {
|
||||
emit('deleteUnit', unit.unitNoId);
|
||||
}
|
||||
</script>
|
||||
|
||||
<style scoped lang="scss">
|
||||
@@ -93,4 +109,11 @@ function contextMenuFun(val: { type: string; value: string }) {
|
||||
height: calc(100% - 500px);
|
||||
}
|
||||
}
|
||||
.nodata {
|
||||
font-size: 1.2rem;
|
||||
color: #ccc;
|
||||
letter-spacing: 2px;
|
||||
text-align: center;
|
||||
padding-top: 200px;
|
||||
}
|
||||
</style>
|
||||
|
||||
@@ -28,9 +28,20 @@
|
||||
</span>
|
||||
</div>
|
||||
<div class="rightActions flex flex-items-center">
|
||||
<span class="mr-20px" @click="handleAddUnit" v-hasPermi="['system:house:add']">+添加单元</span>
|
||||
<span class="mr-20px" @click="handleAddHouse" v-hasPermi="['system:house:add']">+增加房屋</span>
|
||||
<!-- <span class="mr-20px">收费标准设置</span> -->
|
||||
<span @click="deleteAllhouse" v-hasPermi="['system:house:remove']">删除</span>
|
||||
<el-select
|
||||
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-select>
|
||||
<div class="searchbox flex flex-items-center">
|
||||
<el-input v-model="housename" class="searchinput" placeholder="请输入房屋号"></el-input>
|
||||
<el-button style="margin-left: 10px" type="primary" @click="handleSearchHouse">搜索</el-button>
|
||||
@@ -39,8 +50,28 @@
|
||||
</div>
|
||||
</div>
|
||||
<div class="UnitBody">
|
||||
<TableUnit></TableUnit>
|
||||
<TableUnit @edit-unit="handleEditUnit" @delete-unit="handleDelete"></TableUnit>
|
||||
</div>
|
||||
<!-- 添加或修改单元对话框 -->
|
||||
<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-item label="单元名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入单元名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="楼栋" prop="buildingId">
|
||||
<!-- <el-input v-model="form.buildingId" placeholder="请输入楼栋" /> -->
|
||||
<el-select v-model="form.buildingId" placeholder="请选择">
|
||||
<el-option v-for="item in houseStore.currentBuildingInfoList" :key="item.id" :label="item.buildingName" :value="item.id" />
|
||||
</el-select>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
@@ -48,6 +79,9 @@
|
||||
import { deleteHouseApi } from '@/api/system/house';
|
||||
import TableUnit from './components/table.vue';
|
||||
import { useHouseStore } from '@/store/modules/house';
|
||||
import { listHouseUseType } from '@/api/system/houseUse';
|
||||
import { addUnitNo, delUnitNo, getUnitNo, updateUnitNo } from '@/api/system/houseUnit';
|
||||
import { UnitNoVO } from '@/api/system/houseUnit/type';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
@@ -55,20 +89,117 @@ const houseStore = useHouseStore();
|
||||
const router = useRouter();
|
||||
|
||||
const housename = ref('');
|
||||
const houseUse = ref('');
|
||||
const houseUseTypeList = ref([]);
|
||||
|
||||
/**
|
||||
* 获取房屋 类型
|
||||
*/
|
||||
function init() {
|
||||
listHouseUseType({
|
||||
pageNum: 1,
|
||||
pageSize: 99999
|
||||
}).then((res) => {
|
||||
houseUseTypeList.value = res.rows;
|
||||
});
|
||||
}
|
||||
init();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const unitNoFormRef = ref();
|
||||
const buttonLoading = ref(false);
|
||||
const form = ref({
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
buildingId: undefined,
|
||||
villageId: undefined
|
||||
});
|
||||
|
||||
const rules = {
|
||||
name: [{ required: true, message: '单元名称不能为空', trigger: 'blur' }],
|
||||
buildingId: [{ required: true, message: '所属楼栋不能为空', trigger: 'blur' }]
|
||||
};
|
||||
/** 新增按钮操作 */
|
||||
const handleAddUnit = () => {
|
||||
resetForm();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加单元';
|
||||
};
|
||||
/** 修改按钮操作 */
|
||||
const handleEditUnit = async (id: string) => {
|
||||
resetForm();
|
||||
const res = await getUnitNo(id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改单元';
|
||||
};
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (id: string) => {
|
||||
await proxy?.$modal.confirm('是否确认删除该单元?');
|
||||
await delUnitNo(id);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
// await getList();
|
||||
houseStore.updateCureentBuilding();
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
unitNoFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateUnitNo(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addUnitNo(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
houseStore.updateCureentBuilding();
|
||||
}
|
||||
});
|
||||
};
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
resetForm();
|
||||
dialog.visible = false;
|
||||
};
|
||||
/** 表单重置 */
|
||||
const resetForm = () => {
|
||||
form.value = { id: undefined, name: undefined, buildingId: undefined, villageId: undefined };
|
||||
unitNoFormRef.value?.resetFields();
|
||||
};
|
||||
/**
|
||||
* 改变房屋类型
|
||||
* @param id
|
||||
*/
|
||||
function handleChangeUse(id?: string) {
|
||||
houseUse.value = id;
|
||||
}
|
||||
function handleClearUse() {
|
||||
houseUse.value = '';
|
||||
handleSearchHouse();
|
||||
}
|
||||
/** 添加房屋 */
|
||||
function handleAddHouse() {
|
||||
router.push({
|
||||
path: '/house/addHouse'
|
||||
});
|
||||
}
|
||||
|
||||
/**
|
||||
* 搜索 房屋
|
||||
*/
|
||||
function handleSearchHouse() {
|
||||
if (housename.value && housename.value.trim()) {
|
||||
houseStore.getHouseBybuildingNo(housename.value);
|
||||
}
|
||||
houseStore.getHouseBybuildingNo(housename.value, houseUse.value);
|
||||
}
|
||||
function reset() {
|
||||
housename.value = '';
|
||||
houseStore.getHouseBybuildingNo(housename.value);
|
||||
houseUse.value = '';
|
||||
houseStore.getHouseBybuildingNo(housename.value, houseUse.value);
|
||||
}
|
||||
|
||||
async function deleteAllhouse() {
|
||||
@@ -109,7 +240,6 @@ $primary_color: #1978fe;
|
||||
}
|
||||
|
||||
.searchbox {
|
||||
margin-left: 30px;
|
||||
.searchinput {
|
||||
width: 250px;
|
||||
@media (max-width: 1200px) {
|
||||
|
||||
@@ -6,19 +6,6 @@
|
||||
<span class="mr-50px">当前小区:{{ currentVilageInfo && currentVilageInfo.villageName }}</span>
|
||||
<span>小区地址:{{ currentVilageInfo && currentVilageInfo.city }} {{ currentVilageInfo && currentVilageInfo.address }}</span>
|
||||
</div>
|
||||
<div class="houseTypeBox flex">
|
||||
<div
|
||||
class="housetype"
|
||||
:class="{
|
||||
active: buildingtype == house.value
|
||||
}"
|
||||
@click="houseStore.switchHouseType(house.value)"
|
||||
v-for="(house, index) in com_build_use"
|
||||
:key="index"
|
||||
>
|
||||
{{ house.label }}
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
</PageHeader>
|
||||
<div class="houseBody w-full flex align-center justify-center">
|
||||
@@ -27,8 +14,7 @@
|
||||
</div>
|
||||
</div>
|
||||
</template>
|
||||
<script setup name="Houselist" lang="ts">
|
||||
// TODO 楼栋类型
|
||||
<script setup lang="ts">
|
||||
import building from './components/building.vue';
|
||||
import unit from './components/unit.vue';
|
||||
import PageHeader from '@/components/Pageheader/index.vue';
|
||||
@@ -36,10 +22,11 @@ import { useHouseStore } from '@/store/modules/house';
|
||||
|
||||
const houseStore = useHouseStore();
|
||||
const { buildingtype, currentVilageInfo } = storeToRefs(houseStore);
|
||||
function init() {
|
||||
houseStore.initHouse();
|
||||
}
|
||||
init();
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_build_use } = toRefs<any>(proxy?.useDict('com_build_use'));
|
||||
houseStore.initHouse(houseStore.buildingtype);
|
||||
// 初始化数据
|
||||
</script>
|
||||
|
||||
@@ -56,10 +43,9 @@ houseStore.initHouse(houseStore.buildingtype);
|
||||
}
|
||||
.houseAdressBox {
|
||||
margin-top: 25px;
|
||||
height: 20px;
|
||||
line-height: 20px;
|
||||
color: rgba(102, 102, 102, 1);
|
||||
font-size: 14px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
.houseTypeBox {
|
||||
margin-top: 20px;
|
||||
|
||||
@@ -373,9 +373,7 @@ const sendForm = (val: string) => {
|
||||
|
||||
// 推出
|
||||
const cancelForm = () => {
|
||||
router.push({
|
||||
path: '/house/houseRental'
|
||||
});
|
||||
router.back();
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
253
src/views/system/houseUnit/index.vue
Normal file
253
src/views/system/houseUnit/index.vue
Normal file
@@ -0,0 +1,253 @@
|
||||
<template>
|
||||
<div class="p-2 flex flex-col h-full">
|
||||
<pageheader></pageheader>
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="单元名称" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入单元名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="小区" prop="villageId">
|
||||
<el-input v-model="queryParams.villageId" placeholder="请输入小区" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item label="楼栋" prop="buildingId">
|
||||
<el-input v-model="queryParams.buildingId" placeholder="请输入楼栋" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never" class="flex-1">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<!-- <el-col :span="1.5">
|
||||
<el-button type="primary" plain icon="Plus" @click="handleAdd" v-hasPermi="['unitNo:unitNo:add']">新增</el-button>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="success" plain icon="Edit" :disabled="single" @click="handleUpdate()" v-hasPermi="['unitNo:unitNo:edit']"
|
||||
>修改</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="danger" plain icon="Delete" :disabled="multiple" @click="handleDelete()" v-hasPermi="['unitNo:unitNo:remove']"
|
||||
>删除</el-button
|
||||
>
|
||||
</el-col>
|
||||
<el-col :span="1.5">
|
||||
<el-button type="warning" plain icon="Download" @click="handleExport" v-hasPermi="['unitNo:unitNo:export']">导出</el-button>
|
||||
</el-col> -->
|
||||
<right-toolbar :show-add="checkPermi(['unitNo:unitNo:add'])" @update:add="handleAdd">
|
||||
<template #dropdown>
|
||||
<el-dropdown-item :disabled="single" v-if="checkPermi(['unitNo:unitNo:edit'])" @click="handleUpdate">
|
||||
<div>编辑</div>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :disabled="single" v-if="checkPermi(['unitNo:unitNo:delete'])" @click="handleDelete">
|
||||
<div>批量删除</div>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="checkPermi(['unitNo:unitNo:export'])" @click="handleExport">
|
||||
<div>导出</div>
|
||||
</el-dropdown-item>
|
||||
</template>
|
||||
</right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="unitNoList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="单元名称" align="center" prop="name" />
|
||||
<el-table-column label="小区" align="center" prop="villageId" />
|
||||
<el-table-column label="楼栋" align="center" prop="buildingId" />
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-tooltip content="修改" placement="top">
|
||||
<el-button link type="primary" icon="Edit" @click="handleUpdate(scope.row)" v-hasPermi="['unitNo:unitNo:edit']"></el-button>
|
||||
</el-tooltip>
|
||||
<el-tooltip content="删除" placement="top">
|
||||
<el-button link type="primary" icon="Delete" @click="handleDelete(scope.row)" v-hasPermi="['unitNo:unitNo:remove']"></el-button>
|
||||
</el-tooltip>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改单元对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="unitNoFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="单元名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入单元名称" />
|
||||
</el-form-item>
|
||||
<el-form-item label="小区" prop="villageId">
|
||||
<el-input v-model="form.villageId" placeholder="请输入小区" />
|
||||
</el-form-item>
|
||||
<el-form-item label="楼栋" prop="buildingId">
|
||||
<el-input v-model="form.buildingId" placeholder="请输入楼栋" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup name="UnitNo" lang="ts">
|
||||
import { listUnitNo, getUnitNo, delUnitNo, addUnitNo, updateUnitNo } from '@/api/system/houseUnit/index';
|
||||
import { UnitNoVO, UnitNoQuery, UnitNoForm } from '@/api/system/houseUnit/type';
|
||||
import { checkPermi } from '@/utils/permission';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const unitNoList = ref<UnitNoVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const unitNoFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: UnitNoForm = {
|
||||
id: undefined,
|
||||
name: undefined,
|
||||
villageId: undefined,
|
||||
buildingId: undefined
|
||||
};
|
||||
const data = reactive<PageData<UnitNoForm, UnitNoQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: undefined,
|
||||
villageId: undefined,
|
||||
buildingId: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '单元表id不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询单元列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listUnitNo(queryParams.value);
|
||||
unitNoList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
unitNoFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: UnitNoVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加单元';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: UnitNoVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getUnitNo(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改单元';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
unitNoFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateUnitNo(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addUnitNo(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: UnitNoVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除单元?').finally(() => (loading.value = false));
|
||||
await delUnitNo(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'unitNo/unitNo/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`unitNo_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
|
||||
<style lang="scss" scoped>
|
||||
.el-table {
|
||||
height: calc(100% - 80px);
|
||||
}
|
||||
</style>
|
||||
214
src/views/system/houseUse/index.vue
Normal file
214
src/views/system/houseUse/index.vue
Normal file
@@ -0,0 +1,214 @@
|
||||
<template>
|
||||
<div class="p-2 h-full flex flex-col">
|
||||
<pageheader></pageheader>
|
||||
<transition :enter-active-class="proxy?.animate.searchAnimate.enter" :leave-active-class="proxy?.animate.searchAnimate.leave">
|
||||
<div v-show="showSearch" class="mb-[10px]">
|
||||
<el-card shadow="hover">
|
||||
<el-form ref="queryFormRef" :model="queryParams" :inline="true">
|
||||
<el-form-item label="用途名称" prop="name">
|
||||
<el-input v-model="queryParams.name" placeholder="请输入用途名称" clearable @keyup.enter="handleQuery" />
|
||||
</el-form-item>
|
||||
<el-form-item>
|
||||
<el-button type="primary" icon="Search" @click="handleQuery">搜索</el-button>
|
||||
<el-button icon="Refresh" @click="resetQuery">重置</el-button>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
</el-card>
|
||||
</div>
|
||||
</transition>
|
||||
|
||||
<el-card shadow="never" class="flex-1">
|
||||
<template #header>
|
||||
<el-row :gutter="10" class="mb8">
|
||||
<right-toolbar :show-add="checkPermi(['houseUseType:houseUseType:add'])" @update:add="handleAdd">
|
||||
<template #dropdown>
|
||||
<el-dropdown-item :disabled="single" v-if="checkPermi(['houseUseType:houseUseType:edit'])" @click="handleUpdate">
|
||||
<div>编辑</div>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item :disabled="single" v-if="checkPermi(['houseUseType:houseUseType:delete'])" @click="handleDelete">
|
||||
<div>批量删除</div>
|
||||
</el-dropdown-item>
|
||||
<el-dropdown-item v-if="checkPermi(['houseUseType:houseUseType:export'])" @click="handleExport">
|
||||
<div>导出</div>
|
||||
</el-dropdown-item>
|
||||
</template>
|
||||
</right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
|
||||
<el-table v-loading="loading" border :data="houseUseTypeList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" width="55" align="center" />
|
||||
<el-table-column label="用途名称" align="center" prop="name" />
|
||||
<el-table-column label="操作" align="center" fixed="right" class-name="small-padding fixed-width">
|
||||
<template #default="scope">
|
||||
<el-button link type="primary" @click="handleUpdate(scope.row)" v-hasPermi="['houseUseType:houseUseType:edit']">修改</el-button>
|
||||
<el-button link type="primary" @click="handleDelete(scope.row)" v-hasPermi="['houseUseType:houseUseType:remove']">删除</el-button>
|
||||
</template>
|
||||
</el-table-column>
|
||||
</el-table>
|
||||
|
||||
<pagination v-show="total > 0" :total="total" v-model:page="queryParams.pageNum" v-model:limit="queryParams.pageSize" @pagination="getList" />
|
||||
</el-card>
|
||||
<!-- 添加或修改房屋类型对话框 -->
|
||||
<el-dialog :title="dialog.title" v-model="dialog.visible" width="500px" append-to-body>
|
||||
<el-form ref="houseUseTypeFormRef" :model="form" :rules="rules" label-width="80px">
|
||||
<el-form-item label="用途名称" prop="name">
|
||||
<el-input v-model="form.name" placeholder="请输入用途名称" />
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button :loading="buttonLoading" type="primary" @click="submitForm">确 定</el-button>
|
||||
<el-button @click="cancel">取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
</el-dialog>
|
||||
</div>
|
||||
</template>
|
||||
|
||||
<script setup lang="ts">
|
||||
import { listHouseUseType, getHouseUseType, delHouseUseType, addHouseUseType, updateHouseUseType } from '@/api/system/houseUse';
|
||||
import { HouseUseTypeVO, HouseUseTypeQuery, HouseUseTypeForm } from '@/api/system/houseUse/type';
|
||||
import { checkPermi } from '@/utils/permission';
|
||||
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
|
||||
const houseUseTypeList = ref<HouseUseTypeVO[]>([]);
|
||||
const buttonLoading = ref(false);
|
||||
const loading = ref(true);
|
||||
const showSearch = ref(true);
|
||||
const ids = ref<Array<string | number>>([]);
|
||||
const single = ref(true);
|
||||
const multiple = ref(true);
|
||||
const total = ref(0);
|
||||
|
||||
const queryFormRef = ref<ElFormInstance>();
|
||||
const houseUseTypeFormRef = ref<ElFormInstance>();
|
||||
|
||||
const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: ''
|
||||
});
|
||||
|
||||
const initFormData: HouseUseTypeForm = {
|
||||
id: undefined,
|
||||
name: undefined
|
||||
};
|
||||
const data = reactive<PageData<HouseUseTypeForm, HouseUseTypeQuery>>({
|
||||
form: { ...initFormData },
|
||||
queryParams: {
|
||||
pageNum: 1,
|
||||
pageSize: 10,
|
||||
name: undefined,
|
||||
params: {}
|
||||
},
|
||||
rules: {
|
||||
id: [{ required: true, message: '房屋类型id不能为空', trigger: 'blur' }]
|
||||
}
|
||||
});
|
||||
|
||||
const { queryParams, form, rules } = toRefs(data);
|
||||
|
||||
/** 查询房屋类型列表 */
|
||||
const getList = async () => {
|
||||
loading.value = true;
|
||||
const res = await listHouseUseType(queryParams.value);
|
||||
houseUseTypeList.value = res.rows;
|
||||
total.value = res.total;
|
||||
loading.value = false;
|
||||
};
|
||||
|
||||
/** 取消按钮 */
|
||||
const cancel = () => {
|
||||
reset();
|
||||
dialog.visible = false;
|
||||
};
|
||||
|
||||
/** 表单重置 */
|
||||
const reset = () => {
|
||||
form.value = { ...initFormData };
|
||||
houseUseTypeFormRef.value?.resetFields();
|
||||
};
|
||||
|
||||
/** 搜索按钮操作 */
|
||||
const handleQuery = () => {
|
||||
queryParams.value.pageNum = 1;
|
||||
getList();
|
||||
};
|
||||
|
||||
/** 重置按钮操作 */
|
||||
const resetQuery = () => {
|
||||
queryFormRef.value?.resetFields();
|
||||
handleQuery();
|
||||
};
|
||||
|
||||
/** 多选框选中数据 */
|
||||
const handleSelectionChange = (selection: HouseUseTypeVO[]) => {
|
||||
ids.value = selection.map((item) => item.id);
|
||||
single.value = selection.length != 1;
|
||||
multiple.value = !selection.length;
|
||||
};
|
||||
|
||||
/** 新增按钮操作 */
|
||||
const handleAdd = () => {
|
||||
reset();
|
||||
dialog.visible = true;
|
||||
dialog.title = '添加房屋类型';
|
||||
};
|
||||
|
||||
/** 修改按钮操作 */
|
||||
const handleUpdate = async (row?: HouseUseTypeVO) => {
|
||||
reset();
|
||||
const _id = row?.id || ids.value[0];
|
||||
const res = await getHouseUseType(_id);
|
||||
Object.assign(form.value, res.data);
|
||||
dialog.visible = true;
|
||||
dialog.title = '修改房屋类型';
|
||||
};
|
||||
|
||||
/** 提交按钮 */
|
||||
const submitForm = () => {
|
||||
houseUseTypeFormRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
buttonLoading.value = true;
|
||||
if (form.value.id) {
|
||||
await updateHouseUseType(form.value).finally(() => (buttonLoading.value = false));
|
||||
} else {
|
||||
await addHouseUseType(form.value).finally(() => (buttonLoading.value = false));
|
||||
}
|
||||
proxy?.$modal.msgSuccess('操作成功');
|
||||
dialog.visible = false;
|
||||
await getList();
|
||||
}
|
||||
});
|
||||
};
|
||||
|
||||
/** 删除按钮操作 */
|
||||
const handleDelete = async (row?: HouseUseTypeVO) => {
|
||||
const _ids = row?.id || ids.value;
|
||||
await proxy?.$modal.confirm('是否确认删除房屋类型编号为"' + _ids + '"的数据项?').finally(() => (loading.value = false));
|
||||
await delHouseUseType(_ids);
|
||||
proxy?.$modal.msgSuccess('删除成功');
|
||||
await getList();
|
||||
};
|
||||
|
||||
/** 导出按钮操作 */
|
||||
const handleExport = () => {
|
||||
proxy?.download(
|
||||
'houseUseType/houseUseType/export',
|
||||
{
|
||||
...queryParams.value
|
||||
},
|
||||
`houseUseType_${new Date().getTime()}.xlsx`
|
||||
);
|
||||
};
|
||||
|
||||
onMounted(() => {
|
||||
getList();
|
||||
});
|
||||
</script>
|
||||
<style lang="scss" scoped>
|
||||
.el-table {
|
||||
height: calc(100% - 80px);
|
||||
}
|
||||
</style>
|
||||
@@ -75,9 +75,7 @@ const submitForm = () => {
|
||||
};
|
||||
// 推出
|
||||
const cancelForm = () => {
|
||||
router.push({
|
||||
path: '/Inspection/item'
|
||||
});
|
||||
router.back();
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -29,10 +29,22 @@
|
||||
</div>
|
||||
</div>
|
||||
</el-form-item>
|
||||
<el-form-item label="任务时间">
|
||||
<el-select v-model="form.taskTime" placeholder="选择任务时间段" style="width: 100%">
|
||||
<el-form-item label="任务时间段">
|
||||
<!-- <el-select v-model="form.taskTime" placeholder="选择任务时间段" style="width: 100%">
|
||||
<el-option v-for="item in options" :key="item.value" :label="item.label" :value="item.value" />
|
||||
</el-select>
|
||||
</el-select> -->
|
||||
<div v-for="(item, index) in taskTime" :key="index" style="display: flex; align-items: center; margin-top: 10px">
|
||||
<el-time-picker
|
||||
v-model="taskTime[index]"
|
||||
is-range
|
||||
range-separator="到"
|
||||
start-placeholder="开始时间"
|
||||
end-placeholder="结束时间"
|
||||
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 === index + 1" icon="Plus" circle style="margin-left: 10px" @click="addTaskTime"></el-button>
|
||||
</div>
|
||||
</el-form-item>
|
||||
|
||||
<el-form-item label="提醒时间">
|
||||
@@ -75,7 +87,6 @@ import { getVillageByIdAPI } from '@/api/system/community';
|
||||
const { proxy } = getCurrentInstance() as ComponentInternalInstance;
|
||||
const { com_inspection_remind_tiime } = toRefs<any>(proxy?.useDict('com_inspection_remind_tiime'));
|
||||
|
||||
com_inspection_remind_tiime;
|
||||
const route = useRoute();
|
||||
const router = useRouter();
|
||||
|
||||
@@ -94,6 +105,18 @@ const rules = ref({
|
||||
inspectorIds: [{ required: true, message: '请选择巡检人员', trigger: 'blur' }],
|
||||
routeIds: [{ required: true, message: '请选择路线', trigger: 'blur' }]
|
||||
});
|
||||
// 初始化 taskTime,确保至少有一个时间段
|
||||
const taskTime = ref<[string, string][]>([['', '']]);
|
||||
|
||||
// 新增时间段
|
||||
function addTaskTime() {
|
||||
taskTime.value.push(['', '']);
|
||||
}
|
||||
|
||||
// 删除时间段
|
||||
function removeTaskTime(index: number) {
|
||||
taskTime.value.splice(index, 1);
|
||||
}
|
||||
|
||||
// 选择周几
|
||||
const checkoutWeek = ref([]);
|
||||
@@ -142,6 +165,23 @@ async function init() {
|
||||
.map((item) => Number(item))
|
||||
.filter((item) => item);
|
||||
|
||||
// 2. 处理任务时间段的回显
|
||||
if (res.data.taskTime) {
|
||||
// 假设后端返回格式为 "09:00-11:00; 13:00-15:00"
|
||||
// 先按分号分割,再按横杠分割开始和结束时间
|
||||
taskTime.value = res.data.taskTime.split(';').map((timeRange: string) => {
|
||||
const times = timeRange.trim().split('-');
|
||||
// 确保返回的是 [start, end] 格式,如果解析失败则返回空字符串
|
||||
return times.length === 2 ? [times[0], times[1]] : ['', ''];
|
||||
});
|
||||
// 如果解析后为空,至少保留一个空项以便用户添加
|
||||
if (taskTime.value.length === 0) {
|
||||
taskTime.value = [['', '']];
|
||||
}
|
||||
} else {
|
||||
taskTime.value = [['', '']];
|
||||
}
|
||||
|
||||
handlChangeMap(res.data.routeIds);
|
||||
});
|
||||
}
|
||||
@@ -224,6 +264,12 @@ onMounted(async () => {
|
||||
});
|
||||
const formRef = ref();
|
||||
function submit() {
|
||||
// 将二维数组转换为字符串,例如 "09:00-11:00; 13:00-15:00"
|
||||
form.value.taskTime = taskTime.value
|
||||
.filter((t) => t[0] && t[1]) // 过滤掉未填写的
|
||||
.map((t) => `${t[0]}-${t[1]}`)
|
||||
.join('; ');
|
||||
|
||||
formRef.value?.validate(async (valid: boolean) => {
|
||||
if (valid) {
|
||||
if (editid.value) {
|
||||
|
||||
@@ -149,9 +149,7 @@ const submitForm = () => {
|
||||
};
|
||||
// 返回
|
||||
const cancelForm = () => {
|
||||
router.push({
|
||||
path: '/Inspection/point'
|
||||
});
|
||||
router.back();
|
||||
};
|
||||
|
||||
// ! map
|
||||
|
||||
@@ -121,9 +121,7 @@ const tableData = [
|
||||
|
||||
// 推出
|
||||
const cancelForm = () => {
|
||||
router.push({
|
||||
path: '/Inspection/Record'
|
||||
});
|
||||
router.back();
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -396,9 +396,7 @@ const submitForm = () => {
|
||||
};
|
||||
// 返回
|
||||
const cancelForm = () => {
|
||||
router.push({
|
||||
path: '/Inspection/route'
|
||||
});
|
||||
router.back();
|
||||
};
|
||||
|
||||
onUnmounted(() => {
|
||||
|
||||
@@ -229,7 +229,6 @@ function handleActivestaus(rews) {
|
||||
}
|
||||
}
|
||||
}
|
||||
// TODO 住户审核
|
||||
const activeStop = computed(() => {
|
||||
let status = 0;
|
||||
switch (active.value) {
|
||||
|
||||
@@ -254,9 +254,7 @@ const submitForm = () => {
|
||||
};
|
||||
// 推出
|
||||
const cancelForm = () => {
|
||||
router.push({
|
||||
path: '/house/resident'
|
||||
});
|
||||
router.back();
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -101,6 +101,11 @@ function getStoreRoominfo(id: string) {
|
||||
...form.value,
|
||||
...res.data
|
||||
};
|
||||
if (form.value.buildingId) {
|
||||
handleChangeBuild(form.value.buildingId, () => {
|
||||
form.value.unitNo = res.data.unitNo;
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
// 根据小区id获取楼栋单元
|
||||
@@ -110,12 +115,14 @@ function init() {
|
||||
});
|
||||
}
|
||||
init();
|
||||
if (route.query.id) {
|
||||
onMounted(() => {
|
||||
if (route.query.id) {
|
||||
storeRoomid.value = route.query.id;
|
||||
getStoreRoominfo(storeRoomid.value);
|
||||
}
|
||||
}
|
||||
});
|
||||
// 根据楼栋id获取单元
|
||||
function handleChangeBuild(val: string) {
|
||||
function handleChangeBuild(val: string, callback?: () => void) {
|
||||
getBuildingOnly(val).then((res) => {
|
||||
units.value = Array.from({ length: res.data.unitCount }).map((_, index) => {
|
||||
return {
|
||||
@@ -123,6 +130,7 @@ function handleChangeBuild(val: string) {
|
||||
name: index + 1 + '单元'
|
||||
};
|
||||
});
|
||||
callback && callback();
|
||||
});
|
||||
}
|
||||
const submitForm = () => {
|
||||
@@ -146,9 +154,7 @@ const submitForm = () => {
|
||||
});
|
||||
};
|
||||
const cancelForm = () => {
|
||||
router.push({
|
||||
path: '/house/storeroom'
|
||||
});
|
||||
router.back();
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -39,7 +39,6 @@
|
||||
></right-toolbar>
|
||||
</el-row>
|
||||
</template>
|
||||
<!-- TODO 没有编辑 -->
|
||||
<el-table v-loading="loading" border :data="stockOutList" @selection-change="handleSelectionChange">
|
||||
<el-table-column type="selection" flexd width="55" align="center" />
|
||||
<el-table-column label="出库单号" flexd align="center" prop="outNo" />
|
||||
|
||||
@@ -118,9 +118,7 @@ const submitForm = () => {
|
||||
};
|
||||
// 推出
|
||||
const cancelForm = () => {
|
||||
router.push({
|
||||
path: '/warehouse/warehouse'
|
||||
});
|
||||
router.back();
|
||||
};
|
||||
</script>
|
||||
|
||||
|
||||
@@ -61,13 +61,19 @@
|
||||
<!-- tabs -->
|
||||
<el-col :span="6">
|
||||
<div class="flex flex-col h-full">
|
||||
<div class="villageInfoBox">
|
||||
<div class="villageInfoBox flex">
|
||||
<div class="flex-1 flex-items-center">
|
||||
<div class="iconbox">
|
||||
<div :title="`${weather_icon.title} ${weather_icon.wind_direction} ${weather_icon.wind_power} 温度${weather_icon.temperature}°C`">
|
||||
{{ getWeatherIcon(weather_icon.iconvalue) }}
|
||||
</div>
|
||||
</div>
|
||||
<div class="villageinfo">
|
||||
<div class="tips">
|
||||
{{ `${weather_icon.title} ${weather_icon.wind_direction} ${weather_icon.wind_power}风` }}
|
||||
<span>温度{{ weather_icon.temperature }}°C</span>
|
||||
</div>
|
||||
</div>
|
||||
<div class="villageinfo flex-1">
|
||||
<div class="villagename">{{ villageinfo.villageName }}</div>
|
||||
<div class="week">
|
||||
<span style="padding-right: 10px">{{ new Date().toLocaleDateString().replaceAll('/', '-') }}</span>
|
||||
@@ -109,14 +115,23 @@
|
||||
<div class="body flex-1">
|
||||
<div class="quicly_box" v-if="Sideactive === 1">
|
||||
<div class="quickly_item" v-for="(item, index) in quickBox" :key="index" @click="handleRouter(item.url)">
|
||||
<div class="quickly_item_icon" v-if="item.img">
|
||||
<el-image :src="item.img"></el-image>
|
||||
<div class="quickly_item_icon" v-if="item.menuIcon">
|
||||
<svg-icon :icon-class="item.menuIcon" />
|
||||
</div>
|
||||
<div class="quickly_item_icon" v-else-if="item.svg">
|
||||
<svg-icon :icon-class="item.svg" />
|
||||
<div class="quickly_item_content">{{ item.menuName }}</div>
|
||||
<!-- <div class="actionsbox">
|
||||
<div class="routeactions">
|
||||
<el-icon><Position /></el-icon>
|
||||
<span style="padding-left: 0.1rem">跳转</span>
|
||||
</div>
|
||||
<div class="deleteaction">
|
||||
<el-icon><Delete /></el-icon>
|
||||
<span style="padding-left: 0.1rem">删除</span>
|
||||
</div>
|
||||
</div> -->
|
||||
<div class="deleteaction" @click="delteRoute(item.id)">
|
||||
<el-icon class="icons"><Remove /></el-icon>
|
||||
</div>
|
||||
|
||||
<div class="quickly_item_content">{{ item.name }}</div>
|
||||
</div>
|
||||
<div @click="addQuieckDialog" class="quickly_item add">
|
||||
<el-icon><Plus /></el-icon>
|
||||
@@ -242,14 +257,17 @@
|
||||
@change="handleCascader"
|
||||
clearable
|
||||
:props="{ value: 'path', label: 'name', children: 'children' }"
|
||||
v-model="form.path"
|
||||
v-model="path"
|
||||
:options="quicklylist"
|
||||
/>
|
||||
</el-form-item>
|
||||
<el-form-item label="排序" prop="path">
|
||||
<el-input-number v-model="form.sortOrder"></el-input-number>
|
||||
</el-form-item>
|
||||
</el-form>
|
||||
<template #footer>
|
||||
<div class="dialog-footer">
|
||||
<el-button type="primary">确 定</el-button>
|
||||
<el-button type="primary" @click="submitQuick">确 定</el-button>
|
||||
<el-button>取 消</el-button>
|
||||
</div>
|
||||
</template>
|
||||
@@ -288,7 +306,14 @@ import { UploadUserFile } from 'element-plus';
|
||||
import { getVillageByIdAPI } from '@/api/system/community';
|
||||
import { getLast7Days, numToWeek2 } from '@/utils/time';
|
||||
import { EChartsOption } from 'echarts';
|
||||
import { workSpaceIncomeTrendListApi, workSpaceTotalListApi, workSpaceWeatherApi } from '@/api/workflow';
|
||||
import {
|
||||
addQuicklyshortcut,
|
||||
delQuicklyshortcut,
|
||||
getQuicklyshortcut,
|
||||
workSpaceIncomeTrendListApi,
|
||||
workSpaceTotalListApi,
|
||||
workSpaceWeatherApi
|
||||
} from '@/api/workflow';
|
||||
import { getWeatherIcon } from '@/utils/weather';
|
||||
import { MenuTreeOption } from '@/api/system/menu/types';
|
||||
|
||||
@@ -495,10 +520,12 @@ function handleSelect(val: number) {
|
||||
// ! 快捷入口
|
||||
const quickBox = ref<
|
||||
{
|
||||
name: string;
|
||||
url: string;
|
||||
img: string;
|
||||
svg?: string;
|
||||
'id': string;
|
||||
'menuId': null;
|
||||
'menuName': string;
|
||||
'menuPath': string;
|
||||
'menuIcon': string;
|
||||
'sortOrder': number;
|
||||
}[]
|
||||
>([
|
||||
{
|
||||
@@ -543,28 +570,35 @@ const dialog = reactive<DialogOption>({
|
||||
visible: false,
|
||||
title: '添加快捷入口'
|
||||
});
|
||||
const menuOptions = ref<MenuTreeOption[]>([]);
|
||||
const form = ref({
|
||||
name: '',
|
||||
path: '',
|
||||
icon: ''
|
||||
menuName: '',
|
||||
menuPath: '',
|
||||
menuIcon: '',
|
||||
sortOrder: 1
|
||||
});
|
||||
const path = ref([]);
|
||||
const rules = {
|
||||
name: [{ required: true, trigger: 'blur', message: '请输入快捷入口名称' }],
|
||||
path: [{ required: true, trigger: 'blur', message: '请选择快捷入口页面' }]
|
||||
menuPath: [{ required: true, trigger: 'blur', message: '请选择快捷入口页面' }]
|
||||
};
|
||||
const quicklylist = ref([]);
|
||||
function addQuieckDialog() {
|
||||
form.value = {
|
||||
name: '',
|
||||
path: '',
|
||||
icon: ''
|
||||
menuName: '',
|
||||
menuPath: '',
|
||||
menuIcon: '',
|
||||
sortOrder: 1
|
||||
};
|
||||
const permissionStore = usePermissionStore();
|
||||
const routes = permissionStore.getDefaultRoutes();
|
||||
handleroutestoshowlist(routes);
|
||||
dialog.visible = true;
|
||||
}
|
||||
function getquicklist() {
|
||||
getQuicklyshortcut().then((res) => {
|
||||
quickBox.value = res.data;
|
||||
});
|
||||
}
|
||||
getquicklist();
|
||||
function handleroutestoshowlist(rotues) {
|
||||
// 1. 输入校验:确保 routes 是数组
|
||||
if (!Array.isArray(rotues)) {
|
||||
@@ -623,15 +657,26 @@ function handleCascader(val) {
|
||||
if (find) {
|
||||
const find2 = find.children.find((item) => item.path === childrenpath);
|
||||
if (find2) {
|
||||
console.log('>>> find2 <<<', find2);
|
||||
quickBox.value.push({
|
||||
name: find2.name,
|
||||
img: null,
|
||||
svg: find2.icon,
|
||||
url: find2.path
|
||||
form.value = {
|
||||
...form.value,
|
||||
menuIcon: find2.icon,
|
||||
menuName: find2.name,
|
||||
menuPath: find2.path
|
||||
};
|
||||
}
|
||||
}
|
||||
}
|
||||
function submitQuick() {
|
||||
addQuicklyshortcut(form.value).then((res) => {
|
||||
ElMessage.success(res.msg);
|
||||
dialog.visible = false;
|
||||
getquicklist();
|
||||
});
|
||||
}
|
||||
function delteRoute(id: string) {
|
||||
delQuicklyshortcut(id).then(() => {
|
||||
getquicklist();
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
// ! 快捷入口
|
||||
|
||||
@@ -879,22 +924,35 @@ async function deleteFun(row) {
|
||||
margin-left: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0 2rem;
|
||||
justify-content: space-evenly;
|
||||
background: #036aff;
|
||||
padding: 0 2rem;
|
||||
border-radius: 16px 16px 16px 16px;
|
||||
margin-bottom: 20px;
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
||||
gap: 30px;
|
||||
.tips {
|
||||
font-size: small;
|
||||
color: #ffffff77;
|
||||
margin-top: 10px;
|
||||
font-size: 0.8rem;
|
||||
text-align: center;
|
||||
@media (max-width: 1400px) {
|
||||
font-size: 0.9rem;
|
||||
}
|
||||
}
|
||||
.iconbox {
|
||||
width: 70px;
|
||||
height: 70px;
|
||||
text-align: center;
|
||||
margin-right: 20px;
|
||||
font-size: 60px;
|
||||
line-height: 70px;
|
||||
position: relative;
|
||||
z-index: 2;
|
||||
cursor: default;
|
||||
margin: 0 auto;
|
||||
}
|
||||
.villageinfo {
|
||||
margin-left: 20px;
|
||||
@@ -909,7 +967,7 @@ async function deleteFun(row) {
|
||||
margin-top: 5px;
|
||||
height: 23px;
|
||||
font-weight: 400;
|
||||
font-size: 1.1rem;
|
||||
font-size: 1rem;
|
||||
color: #ffffff;
|
||||
line-height: 23px;
|
||||
display: flex;
|
||||
@@ -1011,8 +1069,12 @@ async function deleteFun(row) {
|
||||
padding-top: 20px;
|
||||
display: grid;
|
||||
grid-template-columns: repeat(3, 1fr);
|
||||
@media (max-width: 1750px) {
|
||||
@media (max-width: 1950px) {
|
||||
grid-template-columns: repeat(2, 1fr);
|
||||
max-height: 410px;
|
||||
}
|
||||
@media (max-width: 1750px) {
|
||||
max-height: 550px;
|
||||
}
|
||||
@media (max-width: 1600px) {
|
||||
max-height: 550px;
|
||||
@@ -1035,19 +1097,149 @@ async function deleteFun(row) {
|
||||
justify-content: center;
|
||||
cursor: pointer;
|
||||
|
||||
position: relative;
|
||||
overflow: hidden;
|
||||
|
||||
font-size: 0.685rem;
|
||||
@media (max-width: 2000px) {
|
||||
font-size: 0.65rem;
|
||||
}
|
||||
@media (max-width: 1500px) {
|
||||
height: 46px;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
@media (max-width: 1250px) {
|
||||
height: 36px;
|
||||
font-size: 0.75rem;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
background-color: #0084ff09;
|
||||
}
|
||||
.quickly_item_icon {
|
||||
width: 25px;
|
||||
height: 25px;
|
||||
margin-right: 8px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.quickly_item_content {
|
||||
font-weight: 500;
|
||||
color: #222222;
|
||||
}
|
||||
|
||||
// &:hover {
|
||||
// .actionsbox {
|
||||
// opacity: 1;
|
||||
// .routeactions {
|
||||
// transform: rotateY(0deg);
|
||||
// }
|
||||
// .deleteaction {
|
||||
// transform: rotateY(0deg);
|
||||
// }
|
||||
// }
|
||||
// }
|
||||
&:hover {
|
||||
.deleteaction {
|
||||
opacity: 1;
|
||||
}
|
||||
}
|
||||
|
||||
.deleteaction {
|
||||
position: absolute;
|
||||
transition: all 0.3s;
|
||||
opacity: 0;
|
||||
right: 0;
|
||||
top: 0;
|
||||
z-index: 1;
|
||||
background-color: #bbbbbb42;
|
||||
border: 1px solid #bbbbbb42;
|
||||
text-align: center;
|
||||
width: 1.2rem;
|
||||
height: 1.2rem;
|
||||
border-radius: 0 0 0 0.5rem;
|
||||
line-height: 1.2rem;
|
||||
font-size: 15px;
|
||||
@media (max-width: 2000px) {
|
||||
width: 1.4rem;
|
||||
height: 1.4rem;
|
||||
border-radius: 0 0 0 0.5rem;
|
||||
line-height: 1.4rem;
|
||||
font-size: 15px;
|
||||
}
|
||||
@media (max-width: 1700px) {
|
||||
width: 1.7rem;
|
||||
height: 1.7rem;
|
||||
border-radius: 0 0 0 0.5rem;
|
||||
line-height: 1.7rem;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
@media (max-width: 1500px) {
|
||||
width: 1.7rem;
|
||||
height: 1.7rem;
|
||||
border-radius: 0 0 0 0.5rem;
|
||||
line-height: 1.7rem;
|
||||
font-size: 1.2rem;
|
||||
}
|
||||
@media (max-width: 1250px) {
|
||||
width: 1.6rem;
|
||||
height: 1.6rem;
|
||||
border-radius: 0 0 0 0.8rem;
|
||||
line-height: 1.6rem;
|
||||
font-size: 1rem;
|
||||
}
|
||||
|
||||
&:hover {
|
||||
color: red;
|
||||
i.icons {
|
||||
transform: rotateZ(360deg);
|
||||
}
|
||||
}
|
||||
i.icons {
|
||||
transition: all 0.3s;
|
||||
}
|
||||
}
|
||||
|
||||
.actionsbox {
|
||||
opacity: 1;
|
||||
transition: all 0.3s;
|
||||
position: absolute;
|
||||
z-index: 1;
|
||||
left: 0;
|
||||
top: 0;
|
||||
inset: 0;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
.routeactions,
|
||||
.deleteaction {
|
||||
font-size: 15px;
|
||||
color: #fff;
|
||||
flex: 0.5;
|
||||
height: 100%;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
transition: all 0.3s;
|
||||
|
||||
@media (max-width: 1500px) {
|
||||
font-size: 13px;
|
||||
}
|
||||
@media (max-width: 1250px) {
|
||||
font-size: 11px;
|
||||
}
|
||||
}
|
||||
.routeactions {
|
||||
background-color: #0083ff;
|
||||
transform-origin: left center;
|
||||
transform: rotateY(90deg);
|
||||
}
|
||||
.deleteaction {
|
||||
display: flex;
|
||||
align-items: center;
|
||||
background-color: red;
|
||||
transform-origin: right center;
|
||||
transform: rotateY(-90deg);
|
||||
}
|
||||
}
|
||||
|
||||
&.add {
|
||||
text-align: center;
|
||||
color: #036aff;
|
||||
|
||||
@@ -10,7 +10,7 @@ export default defineConfig(({ mode, command }) => {
|
||||
// 部署生产环境和开发环境下的URL。
|
||||
// 默认情况下,vite 会假设你的应用是被部署在一个域名的根路径上
|
||||
// 例如 https://www.ruoyi.vip/。如果应用被部署在一个子路径上,你就需要用这个选项指定这个子路径。例如,如果你的应用被部署在 https://www.ruoyi.vip/admin/,则设置 baseUrl 为 /admin/。
|
||||
base: env.VITE_APP_CONTEXT_PATH,
|
||||
base: env.VITE_APP_CONTEXT_PATH || '/',
|
||||
resolve: {
|
||||
alias: {
|
||||
'@': path.resolve(__dirname, './src'),
|
||||
|
||||
@@ -8,6 +8,7 @@ import createIcons from './icons';
|
||||
import createSvgIconsPlugin from './svg-icon';
|
||||
import createCompression from './compression';
|
||||
import createSetupExtend from './setup-extend';
|
||||
import zip from './zip';
|
||||
import path from 'path';
|
||||
|
||||
export default (viteEnv: any, isBuild = false): [] => {
|
||||
@@ -21,5 +22,6 @@ export default (viteEnv: any, isBuild = false): [] => {
|
||||
vitePlugins.push(createIcons());
|
||||
vitePlugins.push(createSvgIconsPlugin(path));
|
||||
vitePlugins.push(createSetupExtend());
|
||||
vitePlugins.push(zip(path));
|
||||
return vitePlugins;
|
||||
};
|
||||
|
||||
10
vite/plugins/zip.ts
Normal file
10
vite/plugins/zip.ts
Normal file
@@ -0,0 +1,10 @@
|
||||
import zipPack from 'vite-plugin-zip-pack';
|
||||
|
||||
export default (path) => {
|
||||
return zipPack({
|
||||
inDir: path.resolve(__dirname, '../../dist'), // 要打包的文件夹
|
||||
outDir: path.resolve(__dirname, '../../'), // 压缩包输出到根目录
|
||||
outFileName: 'dist.zip', // 压缩包名字
|
||||
pathPrefix: 'dist' // 不加前缀
|
||||
});
|
||||
};
|
||||
Reference in New Issue
Block a user