Merge branch 'master' of http://47.109.37.87:3000/by2025/admin-vben5
All checks were successful
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 7m3s

# Conflicts:
#	packages/@core/base/shared/src/constants/dict-enum.ts
This commit is contained in:
lxj
2025-06-26 22:03:17 +08:00
62 changed files with 4940 additions and 453 deletions

View File

@@ -16,7 +16,8 @@ jobs:
- name: Build
run: pnpm build:antd
- name: cp
run: robocopy ./apps/web-antd/dist C:\devtool\nginx-1.28.0\html\propety /E
# run: robocopy ./apps/web-antd/dist C:\devtool\nginx-1.28.0\html\propety /E
run: Copy-Item -Path "./apps/web-antd/dist" -Destination "C:\devtool\nginx-1.28.0\html\property" -Recurse -Force -ErrorAction SilentlyContinue

View File

@@ -1,4 +1,4 @@
VITE_BASE=/
VITE_BASE=/property
# 是否开启压缩,可以设置为 none, brotli, gzip
VITE_COMPRESS=gzip

View File

@@ -0,0 +1,65 @@
import type { AssetTypeVO, AssetTypeForm, AssetTypeQuery } from './model';
import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';
/**
* 查询资产类型列表
* @param params
* @returns 资产类型列表
*/
export function assetTypeList(params?: AssetTypeQuery) {
return requestClient.get<PageResult<AssetTypeVO>>('/property/assetType/list', { params });
}
export function assetTypeselect() {
return requestClient.get<AssetTypeVO[]>('/property/assetType/list');
}
/**
* 导出资产类型列表
* @param params
* @returns 资产类型列表
*/
export function assetTypeExport(params?: AssetTypeQuery) {
return commonExport('/property/assetType/export', params ?? {});
}
/**
* 查询资产类型详情
* @param id id
* @returns 资产类型详情
*/
export function assetTypeInfo(id: ID) {
return requestClient.get<AssetTypeVO>(`/property/assetType/${id}`);
}
/**
* 新增资产类型
* @param data
* @returns void
*/
export function assetTypeAdd(data: AssetTypeForm) {
return requestClient.postWithMsg<void>('/property/assetType', data);
}
/**
* 更新资产类型
* @param data
* @returns void
*/
export function assetTypeUpdate(data: AssetTypeForm) {
return requestClient.putWithMsg<void>('/property/assetType', data);
}
/**
* 删除资产类型
* @param id id
* @returns void
*/
export function assetTypeRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/property/assetType/${id}`);
}

View File

@@ -0,0 +1,64 @@
import type { PageQuery, BaseEntity } from '#/api/common';
export interface AssetTypeVO {
/**
* 主键
*/
id: string | number;
/**
* 分类名称
*/
assetTypeName: string;
/**
* 排序
*/
sort: number;
/**
* 创建时间
*/
createTime: string;
/**
* 创建人
*/
createBy: string;
}
export interface AssetTypeForm extends BaseEntity {
/**
* 主键
*/
id?: string | number;
/**
* 分类名称
*/
assetTypeName?: string;
/**
* 排序
*/
sort?: number;
}
export interface AssetTypeQuery extends PageQuery {
/**
* 分类名称
*/
assetTypeName?: string;
/**
* 排序
*/
sort?: number;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -2,7 +2,7 @@ import type { PageQuery, BaseEntity } from '#/api/common';
export interface BuildingVO {
/**
*
*
*/
id: string | number;
@@ -135,7 +135,7 @@ export interface BuildingVO {
export interface BuildingForm extends BaseEntity {
/**
*
*
*/
id?: string | number;
@@ -397,3 +397,136 @@ export interface BuildingQuery extends PageQuery {
*/
params?: any;
}
export interface Building extends BaseEntity {
/**
* 园区编码
*/
communityCode?: string;
/**
* 建筑编码
*/
buildingCode?: string;
/**
* 建筑名称
*/
buildingName?: string;
/**
* 省
*/
province?: string;
/**
* 市
*/
city?: string;
/**
* 区
*/
district?: string;
/**
* 地址
*/
addr?: string;
/**
* 经度
*/
lon?: string;
/**
* 维度
*/
lat?: string;
/**
* 产权性质(1:自持2承租3自持+承租,4政府免费使用)
*/
cqxz?: number;
/**
* 不动产编号
*/
bdcbh?: string;
/**
* 产权编号
*/
cqbh?: string;
/**
* 图地编号
*/
tdbh?: string;
/**
* 建筑面积
*/
jzmj?: number;
/**
* 产权面积
*/
cqmj?: number;
/**
* 可租面积
*/
kzmj?: number;
/**
* 自用面积
*/
zymj?: number;
/**
* 配套面积
*/
ptmj?: number;
/**
* 车位面积
*/
cwmj?: number;
/**
* 标准层高
*/
bzcg?: number;
/**
* 排序字段
*/
sort?: number;
/**
* 组织编码
*/
orgCode?: string;
/**
* 数据状态1有效0无效
*/
dataState?: number;
/**
* 修改时间
*/
modifyTime?: string;
/**
* 搜索值
*/
searchValue?: string;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -217,3 +217,74 @@ export interface CommunityQuery extends PageQuery {
*/
params?: any;
}
export interface Community extends BaseEntity {
/**
* 社区名称
*/
communityName?: string;
/**
* 社区编码
*/
communityCode?: string;
/**
* 社区类型 1园区2小区
*/
communityType?: number;
/**
* 省
*/
province?: string;
/**
* 市
*/
city?: string;
/**
* 区
*/
district?: string;
/**
* 地址
*/
addr?: string;
/**
* 经度
*/
lon?: string;
/**
* 维度
*/
lat?: string;
/**
* 小图图片
*/
img?: string;
/**
* 组织编码
*/
orgCode?: string;
/**
* 数据状态1有效0无效
*/
dataState?: number;
/**
* 修改时间
*/
modifyTime?: string;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -0,0 +1,61 @@
import type { PropertyVO, PropertyForm, PropertyQuery } from './model';
import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';
/**
* 查询绿植租赁-绿植产品列表
* @param params
* @returns 绿植租赁-绿植产品列表
*/
export function plantsProductList(params?: PropertyQuery) {
return requestClient.get<PageResult<PropertyVO>>('/property/plantsProduct/list', { params });
}
/**
* 导出绿植租赁-绿植产品列表
* @param params
* @returns 绿植租赁-绿植产品列表
*/
export function plantsProductExport(params?: PropertyQuery) {
return commonExport('/property/plantsProduct/export', params ?? {});
}
/**
* 查询绿植租赁-绿植产品详情
* @param id id
* @returns 绿植租赁-绿植产品详情
*/
export function plantsProductInfo(id: ID) {
return requestClient.get<PropertyVO>(`/property/plantsProduct/${id}`);
}
/**
* 新增绿植租赁-绿植产品
* @param data
* @returns void
*/
export function plantsProductAdd(data: PropertyForm) {
return requestClient.postWithMsg<void>('/property/plantsProduct', data);
}
/**
* 更新绿植租赁-绿植产品
* @param data
* @returns void
*/
export function plantsProductUpdate(data: PropertyForm) {
return requestClient.putWithMsg<void>('/property/plantsProduct', data);
}
/**
* 删除绿植租赁-绿植产品
* @param id id
* @returns void
*/
export function plantsProductRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/property/plantsProduct/${id}`);
}

View File

@@ -0,0 +1,211 @@
import type { PageQuery, BaseEntity } from '#/api/common';
export interface PropertyVO {
/**
* 主键
*/
id: string | number;
/**
* 产品编号
*/
plantCode: string;
/**
* 产品名称
*/
plantName: string;
/**
* 产品分类
*/
plantType: number;
/**
* 产品图片
*/
imgPath: string;
/**
* 规格
*/
specification: string;
/**
* 租金
*/
rent: number;
/**
* 库存数量
*/
inventory: number;
/**
* 状态0下架 1上架
*/
state: number;
/**
* 备注
*/
remark: string;
}
export interface PropertyForm extends BaseEntity {
/**
* 主键
*/
id?: string | number;
/**
* 产品编号
*/
plantCode?: string;
/**
* 产品名称
*/
plantName?: string;
/**
* 产品分类
*/
plantType?: number;
/**
* 产品图片
*/
imgPath?: string;
/**
* 规格
*/
specification?: string;
/**
* 租金
*/
rent?: number;
/**
* 库存数量
*/
inventory?: number;
/**
* 状态0下架 1上架
*/
state?: number;
/**
* 备注
*/
remark?: string;
}
export interface PropertyQuery extends PageQuery {
/**
* 产品编号
*/
plantCode?: string;
/**
* 产品名称
*/
plantName?: string;
/**
* 产品分类
*/
plantType?: number;
/**
* 产品图片
*/
imgPath?: string;
/**
* 规格
*/
specification?: string;
/**
* 租金
*/
rent?: number;
/**
* 库存数量
*/
inventory?: number;
/**
* 状态0下架 1上架
*/
state?: number;
/**
* 日期范围参数
*/
params?: any;
}
export interface plantsProduct extends BaseEntity {
/**
* 主键
*/
id?: string | number;
/**
* 产品编号
*/
plantCode?: string;
/**
* 产品名称
*/
plantName?: string;
/**
* 产品分类
*/
plantType?: number;
/**
* 产品图片
*/
imgPath?: string;
/**
* 规格
*/
specification?: string;
/**
* 租金
*/
rent?: number;
/**
* 库存数量
*/
inventory?: number;
/**
* 状态0下架 1上架
*/
state?: number;
/**
* 备注
*/
remark?: string;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -0,0 +1,61 @@
import type { RentalOrderVO, RentalOrderForm, RentalOrderQuery } from './model';
import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';
/**
* 查询绿植租赁-订单管理列表
* @param params
* @returns 绿植租赁-订单管理列表
*/
export function rentalOrderList(params?: RentalOrderQuery) {
return requestClient.get<PageResult<RentalOrderVO>>('/property/rentalOrder/list', { params });
}
/**
* 导出绿植租赁-订单管理列表
* @param params
* @returns 绿植租赁-订单管理列表
*/
export function rentalOrderExport(params?: RentalOrderQuery) {
return commonExport('/property/rentalOrder/export', params ?? {});
}
/**
* 查询绿植租赁-订单管理详情
* @param id id
* @returns 绿植租赁-订单管理详情
*/
export function rentalOrderInfo(id: ID) {
return requestClient.get<RentalOrderVO>(`/property/rentalOrder/${id}`);
}
/**
* 新增绿植租赁-订单管理
* @param data
* @returns void
*/
export function rentalOrderAdd(data: RentalOrderForm) {
return requestClient.postWithMsg<void>('/property/rentalOrder', data);
}
/**
* 更新绿植租赁-订单管理
* @param data
* @returns void
*/
export function rentalOrderUpdate(data: RentalOrderForm) {
return requestClient.putWithMsg<void>('/property/rentalOrder', data);
}
/**
* 删除绿植租赁-订单管理
* @param id id
* @returns void
*/
export function rentalOrderRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/property/rentalOrder/${id}`);
}

View File

@@ -0,0 +1,249 @@
import type { PageQuery, BaseEntity } from '#/api/common';
export interface RentalOrderVO {
/**
* 主键
*/
id: string | number;
/**
* 订单号
*/
orderNo: string;
/**
* 客户名称
*/
customerName: string;
/**
* 客户类型
*/
customerType: number;
/**
* 租赁周期
*/
rentalPeriod: number;
/**
* 租赁开始时间
*/
startTime: string;
/**
* 租赁结束时间
*/
endTime: string;
/**
* 应付总额
*/
totalAmount: number;
/**
* 租赁方式
*/
rentalType: number;
/**
* 租赁方案id
*/
planId: string | number;
/**
* 绿植产品id
*/
productId: string | number;
/**
* 租赁产品数量
*/
productNum: number;
/**
* 支付状态
*/
paymentStatus: number;
/**
* 是否续租
*/
isRelet: number;
/**
* 合同状态
*/
contractStatus: number;
/**
* 签署时间
*/
signTime: string;
}
export interface RentalOrderForm extends BaseEntity {
/**
* 主键
*/
id?: string | number;
/**
* 订单号
*/
orderNo?: string;
/**
* 客户名称
*/
customerName?: string;
/**
* 客户类型
*/
customerType?: number;
/**
* 租赁周期
*/
rentalPeriod?: number;
/**
* 租赁开始时间
*/
startTime?: string;
/**
* 租赁结束时间
*/
endTime?: string;
/**
* 应付总额
*/
totalAmount?: number;
/**
* 租赁方式
*/
rentalType?: number;
/**
* 租赁方案id
*/
planId?: string | number;
/**
* 绿植产品id
*/
productId?: string | number;
/**
* 租赁产品数量
*/
productNum?: number;
/**
* 支付状态
*/
paymentStatus?: number;
/**
* 是否续租
*/
isRelet?: number;
/**
* 合同状态
*/
contractStatus?: number;
/**
* 签署时间
*/
signTime?: string;
}
export interface RentalOrderQuery extends PageQuery {
/**
* 订单号
*/
orderNo?: string;
/**
* 客户名称
*/
customerName?: string;
/**
* 客户类型
*/
customerType?: number;
/**
* 租赁周期
*/
rentalPeriod?: number;
/**
* 租赁开始时间
*/
startTime?: string;
/**
* 租赁结束时间
*/
endTime?: string;
/**
* 应付总额
*/
totalAmount?: number;
/**
* 租赁方式
*/
rentalType?: number;
/**
* 租赁方案id
*/
planId?: string | number;
/**
* 绿植产品id
*/
productId?: string | number;
/**
* 租赁产品数量
*/
productNum?: number;
/**
* 支付状态
*/
paymentStatus?: number;
/**
* 是否续租
*/
isRelet?: number;
/**
* 合同状态
*/
contractStatus?: number;
/**
* 签署时间
*/
signTime?: string;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -0,0 +1,61 @@
import type { RentalPlanVO, RentalPlanForm, RentalPlanQuery } from './model';
import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';
/**
* 查询绿植租赁-租赁方案列表
* @param params
* @returns 绿植租赁-租赁方案列表
*/
export function rentalPlanList(params?: RentalPlanQuery) {
return requestClient.get<PageResult<RentalPlanVO>>('/property/rentalPlan/list', { params });
}
/**
* 导出绿植租赁-租赁方案列表
* @param params
* @returns 绿植租赁-租赁方案列表
*/
export function rentalPlanExport(params?: RentalPlanQuery) {
return commonExport('/property/rentalPlan/export', params ?? {});
}
/**
* 查询绿植租赁-租赁方案详情
* @param id id
* @returns 绿植租赁-租赁方案详情
*/
export function rentalPlanInfo(id: ID) {
return requestClient.get<RentalPlanVO>(`/property/rentalPlan/${id}`);
}
/**
* 新增绿植租赁-租赁方案
* @param data
* @returns void
*/
export function rentalPlanAdd(data: RentalPlanForm) {
return requestClient.postWithMsg<void>('/property/rentalPlan', data);
}
/**
* 更新绿植租赁-租赁方案
* @param data
* @returns void
*/
export function rentalPlanUpdate(data: RentalPlanForm) {
return requestClient.putWithMsg<void>('/property/rentalPlan', data);
}
/**
* 删除绿植租赁-租赁方案
* @param id id
* @returns void
*/
export function rentalPlanRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/property/rentalPlan/${id}`);
}

View File

@@ -0,0 +1,114 @@
import type { PageQuery, BaseEntity } from '#/api/common';
export interface RentalPlanVO {
/**
* 主键
*/
id: string | number;
/**
* 方案名称
*/
planName: string;
/**
* 租赁周期
*/
rentalPeriod: number;
/**
* 适用场景
*/
scene: string;
/**
* 价格
*/
price: number;
/**
* 状态
*/
state: number;
/**
* 备注
*/
remarks: string;
}
export interface RentalPlanForm extends BaseEntity {
/**
* 主键
*/
id?: string | number;
/**
* 方案名称
*/
planName?: string;
/**
* 租赁周期
*/
rentalPeriod?: number;
/**
* 适用场景
*/
scene?: string;
/**
* 价格
*/
price?: number;
/**
* 状态
*/
state?: number;
/**
* 备注
*/
remarks?: string;
}
export interface RentalPlanQuery extends PageQuery {
/**
* 方案名称
*/
planName?: string;
/**
* 租赁周期
*/
rentalPeriod?: number;
/**
* 适用场景
*/
scene?: string;
/**
* 价格
*/
price?: number;
/**
* 状态
*/
state?: number;
/**
* 备注
*/
remarks?: string;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -0,0 +1,61 @@
import type { RoomVO, RoomForm, RoomQuery } from './model';
import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';
/**
* 查询房间信息列表
* @param params
* @returns 房间信息列表
*/
export function roomList(params?: RoomQuery) {
return requestClient.get<PageResult<RoomVO>>('/property/room/list', { params });
}
/**
* 导出房间信息列表
* @param params
* @returns 房间信息列表
*/
export function roomExport(params?: RoomQuery) {
return commonExport('/property/room/export', params ?? {});
}
/**
* 查询房间信息详情
* @param id id
* @returns 房间信息详情
*/
export function roomInfo(id: ID) {
return requestClient.get<RoomVO>(`/property/room/${id}`);
}
/**
* 新增房间信息
* @param data
* @returns void
*/
export function roomAdd(data: RoomForm) {
return requestClient.postWithMsg<void>('/property/room', data);
}
/**
* 更新房间信息
* @param data
* @returns void
*/
export function roomUpdate(data: RoomForm) {
return requestClient.putWithMsg<void>('/property/room', data);
}
/**
* 删除房间信息
* @param id id
* @returns void
*/
export function roomRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/property/room/${id}`);
}

View File

@@ -0,0 +1,159 @@
import type { PageQuery, BaseEntity } from '#/api/common';
export interface RoomVO {
/**
* 主键
*/
id: string | number;
/**
* 所属楼层ID
*/
floorCode: string;
/**
* 房间编码
*/
roomCode: string;
/**
* 房间号(如101,202)
*/
roomNumber: string;
/**
* 房间类型('住宅','商铺','办公室','设备间','公共区域')
*/
roomType: number;
/**
* 面积(平方米)
*/
area: number;
/**
* 户型(如2室1厅1卫)
*/
layout: string;
/**
* 朝向('东','南','西','北','东南','东北','西南','西北')
*/
orientation: number;
/**
* 是否可售
*/
isForSale: number;
/**
* 状态('空置','已售','已租','自用'
*/
status: number;
}
export interface RoomForm extends BaseEntity {
/**
* 主键
*/
id?: string | number;
/**
* 所属楼层ID
*/
floorCode?: string;
/**
* 房间编码
*/
roomCode?: string;
/**
* 房间号(如101,202)
*/
roomNumber?: string;
/**
* 房间类型('住宅','商铺','办公室','设备间','公共区域')
*/
roomType?: number;
/**
* 面积(平方米)
*/
area?: number;
/**
* 户型(如2室1厅1卫)
*/
layout?: string;
/**
* 朝向('东','南','西','北','东南','东北','西南','西北')
*/
orientation?: number;
/**
* 是否可售
*/
isForSale?: number;
/**
* 状态('空置','已售','已租','自用'
*/
status?: number;
}
export interface RoomQuery extends PageQuery {
/**
* 所属楼层ID
*/
floorCode?: string;
/**
* 房间编码
*/
roomCode?: string;
/**
* 房间号(如101,202)
*/
roomNumber?: string;
/**
* 房间类型('住宅','商铺','办公室','设备间','公共区域')
*/
roomType?: number;
/**
* 面积(平方米)
*/
area?: number;
/**
* 户型(如2室1厅1卫)
*/
layout?: string;
/**
* 朝向('东','南','西','北','东南','东北','西南','西北')
*/
orientation?: number;
/**
* 是否可售
*/
isForSale?: number;
/**
* 状态('空置','已售','已租','自用'
*/
status?: number;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -0,0 +1,61 @@
import type { UnitVO, UnitForm, UnitQuery } from './model';
import type { ID, IDS } from '#/api/common';
import type { PageResult } from '#/api/common';
import { commonExport } from '#/api/helper';
import { requestClient } from '#/api/request';
/**
* 查询单元列表
* @param params
* @returns 单元列表
*/
export function unitList(params?: UnitQuery) {
return requestClient.get<PageResult<UnitVO>>('/property/unit/list', { params });
}
/**
* 导出单元列表
* @param params
* @returns 单元列表
*/
export function unitExport(params?: UnitQuery) {
return commonExport('/property/unit/export', params ?? {});
}
/**
* 查询单元详情
* @param id id
* @returns 单元详情
*/
export function unitInfo(id: ID) {
return requestClient.get<UnitVO>(`/property/unit/${id}`);
}
/**
* 新增单元
* @param data
* @returns void
*/
export function unitAdd(data: UnitForm) {
return requestClient.postWithMsg<void>('/property/unit', data);
}
/**
* 更新单元
* @param data
* @returns void
*/
export function unitUpdate(data: UnitForm) {
return requestClient.putWithMsg<void>('/property/unit', data);
}
/**
* 删除单元
* @param id id
* @returns void
*/
export function unitRemove(id: ID | IDS) {
return requestClient.deleteWithMsg<void>(`/property/unit/${id}`);
}

View File

@@ -0,0 +1,114 @@
import type { PageQuery, BaseEntity } from '#/api/common';
export interface UnitVO {
/**
* 主键id
*/
id: string | number;
/**
* 建筑名称
*/
buildingCode: string;
/**
* 单元编码
*/
unitCode: string;
/**
* 单元名称
*/
unitName: string;
/**
* 单元层数
*/
floorCount: number;
/**
* 单元户数
*/
householdCount: number;
/**
* 楼梯数量
*/
stairCount: number;
}
export interface UnitForm extends BaseEntity {
/**
* 主键id
*/
id?: string | number;
/**
* 建筑名称
*/
buildingCode?: string;
/**
* 单元编码
*/
unitCode?: string;
/**
* 单元名称
*/
unitName?: string;
/**
* 单元层数
*/
floorCount?: number;
/**
* 单元户数
*/
householdCount?: number;
/**
* 楼梯数量
*/
stairCount?: number;
}
export interface UnitQuery extends PageQuery {
/**
* 建筑名称
*/
buildingCode?: string;
/**
* 单元编码
*/
unitCode?: string;
/**
* 单元名称
*/
unitName?: string;
/**
* 单元层数
*/
floorCount?: number;
/**
* 单元户数
*/
householdCount?: number;
/**
* 楼梯数量
*/
stairCount?: number;
/**
* 日期范围参数
*/
params?: any;
}

View File

@@ -1,5 +1,8 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { renderDict } from "#/utils/render";
import { DictEnum } from '@vben/constants';
export const querySchema: FormSchemaGetter = () => [
@@ -59,12 +62,12 @@ export const columns: VxeGridProps['columns'] = [
field: 'id',
},
{
title: '资产id',
field: 'assetId',
title: '资产',
field: 'assetName',
},
{
title: '领用人id',
field: 'userId',
title: '领用人',
field: 'userName',
},
{
title: '数量',
@@ -73,10 +76,15 @@ export const columns: VxeGridProps['columns'] = [
{
title: '状态',
field: 'state',
slots: {
default: ({ row }) => {
return renderDict(row.state, DictEnum.WY_ZCSHZT);
},
},
},
{
title: '审批人id',
field: 'acceptanceUserId',
title: '审批人',
field: 'acceptanceUserName',
},
{
title: '审批时间',

View File

@@ -10,7 +10,8 @@ import { assetAdd, assetInfo, assetUpdate } from '#/api/property/assetManage/ass
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
import { assetTypeselect } from "#/api/property/assetManage/assetType";
import { packageSelectList } from "#/api/system/tenant-package";
import { assetTypeselect } from "#/api/property/assetType";
import { depotList } from "#/api/property/assetManage/depot";
import { suppliersList } from "#/api/property/assetManage/suppliers";

View File

@@ -1,8 +1,9 @@
import type {FormSchemaGetter} from '#/adapter/form';
import type {VxeGridProps} from '#/adapter/vxe-table';
import {getDictOptions} from "#/utils/dict";
import {assetTypeList} from "#/api/property/assetManage/assetType";
import type {AssetTypeVO} from "#/api/property/assetManage/assetType/model";
import { renderDict } from "#/utils/render";
import { DictEnum } from '@vben/constants';
export const querySchema: FormSchemaGetter = () => [
@@ -15,13 +16,6 @@ export const querySchema: FormSchemaGetter = () => [
component: 'Select',
fieldName: 'model',
label: '资产类型',
componentProps: {
showSearch:true,
placeholder:'根据类型名称搜索...',
onSearch:handleSearch,
onChange:handleChange,
options:typeData
},
},
{
component: 'Select',
@@ -34,6 +28,8 @@ export const querySchema: FormSchemaGetter = () => [
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{type: 'checkbox', width: 60},
{
@@ -51,7 +47,7 @@ export const columns: VxeGridProps['columns'] = [
},
{
title: '资产类型',
field: 'model',
field: 'modelName',
},
{
title: '规格',
@@ -70,16 +66,16 @@ export const columns: VxeGridProps['columns'] = [
field: 'unit',
},
{
title: '仓库id',
field: 'depotId',
title: '仓库',
field: 'depotName',
},
{
title: '描述信息',
field: 'msg',
},
{
title: '供应商id',
field: 'suppliersId',
title: '供应商',
field: 'suppliersName',
},
{
title: '入库时间',
@@ -88,6 +84,11 @@ export const columns: VxeGridProps['columns'] = [
{
title: '固定资产',
field: 'type',
slots: {
default: ({ row }) => {
return renderDict(row.type, DictEnum.WY_SF);
},
},
},
{
title: '创建时间',
@@ -120,7 +121,7 @@ export const modalSchema: FormSchemaGetter = () => [
{
label: '类型',
fieldName: 'model',
component: 'Textarea',
component: 'Select',
},
{
label: '规格',
@@ -143,9 +144,9 @@ export const modalSchema: FormSchemaGetter = () => [
component: 'Input',
},
{
label: '仓库id',
label: '仓库',
fieldName: 'depotId',
component: 'Input',
component: 'Select',
},
{
label: '描述信息',
@@ -155,7 +156,7 @@ export const modalSchema: FormSchemaGetter = () => [
{
label: '供应商id',
fieldName: 'suppliersId',
component: 'Input',
component: 'Select',
},
{
label: '入库时间',
@@ -171,34 +172,8 @@ export const modalSchema: FormSchemaGetter = () => [
label: '固定资产类型',
fieldName: 'type',
component: 'Select',
componentProps: {},
componentProps: {
options: getDictOptions('wy_sf'),
},
},
];
let typeData:AssetTypeVO[]=[]
const handleSearch = (val: string) => {
queryAssetsType(val, (d: any[]) => (typeData = d));
};
const handleChange = (val: string) => {
queryAssetsType(val, (d: any[]) => (typeData = d));
};
function queryAssetsType(value: string, callback: any) {
let queryParam={
pageNum:100,
pageSize:1,
assetTypeName:value
}
assetTypeList(queryParam).then(res=>{
const data: any[] = [];
res.rows.forEach((r: any) => {
data.push({
value: r.assetTypeName,
label: r.id,
});
});
callback(data);
})
}

View File

@@ -110,7 +110,6 @@ function handleDownloadExcel() {
<template>
<Page :auto-content-height="true">
<BasicTable table-title="资产列表">
<template #toolbar-tools>
<Space>

View File

@@ -0,0 +1,101 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import { assetTypeAdd, assetTypeInfo, assetTypeUpdate } from '#/api/property/assetType';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
});
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
// 默认占满两列
formItemClass: 'col-span-2',
// 默认label宽度 px
labelWidth: 80,
// 通用配置项 会影响到所有表单项
componentProps: {
class: 'w-full',
}
},
schema: modalSchema(),
showDefaultActions: false,
wrapperClass: 'grid-cols-2',
});
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
},
);
const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度
class: 'w-[550px]',
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
onConfirm: handleConfirm,
onOpenChange: async (isOpen) => {
if (!isOpen) {
return null;
}
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await assetTypeInfo(id);
await formApi.setValues(record);
}
await markInitialized();
modalApi.modalLoading(false);
},
});
async function handleConfirm() {
try {
modalApi.lock(true);
const { valid } = await formApi.validate();
if (!valid) {
return;
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues());
await (isUpdate.value ? assetTypeUpdate(data) : assetTypeAdd(data));
resetInitialized();
emit('reload');
modalApi.close();
} catch (error) {
console.error(error);
} finally {
modalApi.lock(false);
}
}
async function handleClosed() {
await formApi.resetForm();
resetInitialized();
}
</script>
<template>
<BasicModal :title="title">
<BasicForm />
</BasicModal>
</template>

View File

@@ -0,0 +1,71 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'assetTypeName',
label: '分类名称',
},
{
component: 'Input',
fieldName: 'sort',
label: '排序',
},
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '主键',
field: 'id',
},
{
title: '分类名称',
field: 'assetTypeName',
},
{
title: '排序',
field: 'sort',
},
{
title: '创建时间',
field: 'createTime',
},
{
title: '创建人',
field: 'createBy',
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '主键',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
label: '分类名称',
fieldName: 'assetTypeName',
component: 'Input',
},
{
label: '排序',
fieldName: 'sort',
component: 'Input',
},
];

View File

@@ -0,0 +1,182 @@
<script setup lang="ts">
import type { Recordable } from '@vben/types';
import { ref } from 'vue';
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import dayjs from 'dayjs';
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
} from '#/adapter/vxe-table';
import {
assetTypeExport,
assetTypeList,
assetTypeRemove,
} from '#/api/property/assetType';
import type { AssetTypeForm } from '#/api/property/assetType/model';
import { commonDownloadExcel } from '#/utils/file/download';
import assetTypeModal from './assetType-modal.vue';
import { columns, querySchema } from './data';
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
componentProps: {
allowClear: true,
},
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
// 不需要直接删除
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
};
const gridOptions: VxeGridProps = {
checkboxConfig: {
// 高亮
highlight: true,
// 翻页时保留选中状态
reserve: true,
// 点击行选中
// trigger: 'row',
},
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// columns: columns(),
columns,
height: 'auto',
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues = {}) => {
return await assetTypeList({
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
},
// 表格全局唯一表示 保存列配置需要用到
id: 'property-assetType-index'
};
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
});
const [AssetTypeModal, modalApi] = useVbenModal({
connectedComponent: assetTypeModal,
});
function handleAdd() {
modalApi.setData({});
modalApi.open();
}
async function handleEdit(row: Required<AssetTypeForm>) {
modalApi.setData({ id: row.id });
modalApi.open();
}
async function handleDelete(row: Required<AssetTypeForm>) {
await assetTypeRemove(row.id);
await tableApi.query();
}
function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords();
const ids = rows.map((row: Required<AssetTypeForm>) => row.id);
Modal.confirm({
title: '提示',
okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await assetTypeRemove(ids);
await tableApi.query();
},
});
}
function handleDownloadExcel() {
commonDownloadExcel(assetTypeExport, '资产类型数据', tableApi.formApi.form.values, {
fieldMappingTime: formOptions.fieldMappingTime,
});
}
</script>
<template>
<Page :auto-content-height="true">
<BasicTable table-title="资产类型列表">
<template #toolbar-tools>
<Space>
<a-button
v-access:code="['property:assetType:export']"
@click="handleDownloadExcel"
>
{{ $t('pages.common.export') }}
</a-button>
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['property:assetType:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }}
</a-button>
<a-button
type="primary"
v-access:code="['property:assetType:add']"
@click="handleAdd"
>
{{ $t('pages.common.add') }}
</a-button>
</Space>
</template>
<template #action="{ row }">
<Space>
<ghost-button
v-access:code="['property:assetType:edit']"
@click.stop="handleEdit(row)"
>
{{ $t('pages.common.edit') }}
</ghost-button>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认删除?"
@confirm="handleDelete(row)"
>
<ghost-button
danger
v-access:code="['property:assetType:remove']"
@click.stop=""
>
{{ $t('pages.common.delete') }}
</ghost-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<AssetTypeModal @reload="tableApi.query()" />
</Page>
</template>

View File

@@ -0,0 +1,109 @@
<script setup lang="ts">
import type {Building} from '#/api/property/building/model';
import {shallowRef} from 'vue';
import {useVbenModal} from '@vben/common-ui';
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
import {buildingInfo} from '#/api/property/building';
import {renderDict} from "#/utils/render";
const [BasicModal, modalApi] = useVbenModal({
onOpenChange: handleOpenChange,
onClosed() {
buildingDetail.value = null;
},
});
const buildingDetail = shallowRef<null | Building>(null);
async function handleOpenChange(open: boolean) {
if (!open) {
return null;
}
modalApi.modalLoading(true);
const {id} = modalApi.getData() as { id: number | string };
const response = await buildingInfo(id);
// 赋值
buildingDetail.value = response;
modalApi.modalLoading(false);
}
</script>
<template>
<BasicModal :footer="false" :fullscreen-button="false" title="建筑管理信息" class="w-[70%]">
<Descriptions v-if="buildingDetail" size="small" :column="2" bordered :labelStyle="{width:'100px'}">
<DescriptionsItem label="园区编码">
{{ buildingDetail.communityCode }}
</DescriptionsItem>
<DescriptionsItem label="建筑编码">
{{ buildingDetail.buildingCode }}
</DescriptionsItem>
<DescriptionsItem label="建筑名称">
{{ buildingDetail.buildingName }}
</DescriptionsItem>
<DescriptionsItem label="省">
{{ buildingDetail.province }}
</DescriptionsItem>
<DescriptionsItem label="市">
{{ buildingDetail.city }}
</DescriptionsItem>
<DescriptionsItem label="区">
{{ buildingDetail.district }}
</DescriptionsItem>
<DescriptionsItem label="地址">
{{ buildingDetail.addr }}
</DescriptionsItem>
<DescriptionsItem label="经度">
{{ buildingDetail.lon }}
</DescriptionsItem>
<DescriptionsItem label="维度">
{{ buildingDetail.lat }}
</DescriptionsItem>
<DescriptionsItem label="产权性质" v-if="buildingDetail.cqxz!=null">
<component
:is="renderDict(buildingDetail.cqxz,'wy_cqxz')"
/>
</DescriptionsItem>
<DescriptionsItem label="不动产编号">
{{ buildingDetail.bdcbh }}
</DescriptionsItem>
<DescriptionsItem label="产权编号">
{{ buildingDetail.cqbh }}
</DescriptionsItem>
<DescriptionsItem label="土地编号">
{{ buildingDetail.tdbh }}
</DescriptionsItem>
<DescriptionsItem label="建筑面积">
{{ buildingDetail.jzmj }}
</DescriptionsItem>
<DescriptionsItem label="产权面积">
{{ buildingDetail.cqmj }}
</DescriptionsItem>
<DescriptionsItem label="可租面积">
{{ buildingDetail.kzmj }}
</DescriptionsItem>
<DescriptionsItem label="自用面积">
{{ buildingDetail.zymj }}
</DescriptionsItem>
<DescriptionsItem label="配套面积">
{{ buildingDetail.ptmj }}
</DescriptionsItem>
<DescriptionsItem label="车位面积">
{{ buildingDetail.cwmj }}
</DescriptionsItem>
<DescriptionsItem label="标准层高">
{{ buildingDetail.bzcg }}
</DescriptionsItem>
<DescriptionsItem label="组织编码">
{{ buildingDetail.orgCode }}
</DescriptionsItem>
<DescriptionsItem label="数据状态" v-if="buildingDetail.dataState!=null">
<component
:is="renderDict(buildingDetail.dataState,'wy_qylx')"
/>
</DescriptionsItem>
<DescriptionsItem label="修改时间">
{{ buildingDetail.modifyTime }}
</DescriptionsItem>
</Descriptions>
</BasicModal>
</template>

View File

@@ -20,36 +20,6 @@ export const querySchema: FormSchemaGetter = () => [
fieldName: 'buildingName',
label: '建筑名称',
},
{
component: 'Input',
fieldName: 'province',
label: '省',
},
{
component: 'Input',
fieldName: 'city',
label: '市',
},
{
component: 'Input',
fieldName: 'district',
label: '区',
},
{
component: 'Input',
fieldName: 'addr',
label: '地址',
},
{
component: 'Input',
fieldName: 'lon',
label: '经度',
},
{
component: 'Input',
fieldName: 'lat',
label: '维度',
},
{
component: 'Select',
componentProps: {
@@ -57,137 +27,43 @@ export const querySchema: FormSchemaGetter = () => [
options: getDictOptions('wy_cqxz'),
},
fieldName: 'cqxz',
label: '产权性质(1:自持2承租3自持+承租,4政府免费使用)',
},
{
component: 'Input',
fieldName: 'bdcbh',
label: '不动产编号',
},
{
component: 'Input',
fieldName: 'cqbh',
label: '产权编号',
},
{
component: 'Input',
fieldName: 'tdbh',
label: '图地编号',
},
{
component: 'Input',
fieldName: 'jzmj',
label: '建筑面积',
},
{
component: 'Input',
fieldName: 'cqmj',
label: '产权面积',
},
{
component: 'Input',
fieldName: 'kzmj',
label: '可租面积',
},
{
component: 'Input',
fieldName: 'zymj',
label: '自用面积',
},
{
component: 'Input',
fieldName: 'ptmj',
label: '配套面积',
},
{
component: 'Input',
fieldName: 'cwmj',
label: '车位面积',
},
{
component: 'Input',
fieldName: 'bzcg',
label: '标准层高',
},
{
component: 'Input',
fieldName: 'sort',
label: '排序字段',
},
{
component: 'Input',
fieldName: 'orgCode',
label: '组织编码',
label: '产权性质',
},
{
component: 'Input',
fieldName: 'dataState',
label: '数据状态1有效0无效',
},
{
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
fieldName: 'modifyTime',
label: '修改时间',
},
{
component: 'Input',
fieldName: 'searchValue',
label: '搜索值',
},
label: '数据状态',
}
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '',
field: 'id',
},
{
title: '园区编码',
field: 'communityCode',
width: 'auto'
},
{
title: '建筑编码',
field: 'buildingCode',
width: 'auto'
},
{
title: '建筑名称',
field: 'buildingName',
},
{
title: '省',
field: 'province',
},
{
title: '市',
field: 'city',
},
{
title: '区',
field: 'district',
width: 'auto'
},
{
title: '地址',
field: 'addr',
width: 'auto'
},
{
title: '经度',
field: 'lon',
},
{
title: '维度',
field: 'lat',
},
{
title: '产权性质(1:自持2承租3自持+承租,4政府免费使用)',
title: '产权性质',
field: 'cqxz',
width: 'auto',
slots: {
default: ({ row }) => {
// 可选从DictEnum中获取 DictEnum.WY_CQXZ 便于维护
@@ -198,62 +74,62 @@ export const columns: VxeGridProps['columns'] = [
{
title: '不动产编号',
field: 'bdcbh',
width: 'auto'
},
{
title: '产权编号',
field: 'cqbh',
width: 'auto'
},
{
title: '地编号',
title: '地编号',
field: 'tdbh',
width: 'auto'
},
{
title: '建筑面积',
field: 'jzmj',
width: 'auto'
},
{
title: '产权面积',
field: 'cqmj',
width: 'auto'
},
{
title: '可租面积',
field: 'kzmj',
width: 'auto'
},
{
title: '自用面积',
field: 'zymj',
width: 'auto'
},
{
title: '配套面积',
field: 'ptmj',
width: 'auto'
},
{
title: '车位面积',
field: 'cwmj',
width: 'auto'
},
{
title: '标准层高',
field: 'bzcg',
width: 'auto'
},
{
title: '排序字段',
field: 'sort',
},
{
title: '组织编码',
field: 'orgCode',
},
{
title: '数据状态1有效0无效',
title: '数据状态',
field: 'dataState',
width: 'auto'
},
{
title: '修改时间',
field: 'modifyTime',
},
{
title: '搜索值',
field: 'searchValue',
width: 'auto'
},
{
field: 'action',
@@ -292,6 +168,12 @@ export const modalSchema: FormSchemaGetter = () => [
component: 'Input',
rules: 'required',
},
{
label: '组织编码',
fieldName: 'orgCode',
component: 'Input',
rules: 'required',
},
{
label: '省',
fieldName: 'province',
@@ -329,7 +211,7 @@ export const modalSchema: FormSchemaGetter = () => [
rules: 'required',
},
{
label: '产权性质(1:自持2承租3自持+承租,4政府免费使用)',
label: '产权性质',
fieldName: 'cqxz',
component: 'Select',
componentProps: {
@@ -404,13 +286,7 @@ export const modalSchema: FormSchemaGetter = () => [
component: 'Input',
},
{
label: '组织编码',
fieldName: 'orgCode',
component: 'Input',
rules: 'required',
},
{
label: '数据状态1有效0无效',
label: '数据状态',
fieldName: 'dataState',
component: 'Input',
},
@@ -423,10 +299,5 @@ export const modalSchema: FormSchemaGetter = () => [
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
},
{
label: '搜索值',
fieldName: 'searchValue',
component: 'Input',
},
}
];

View File

@@ -1,18 +1,12 @@
<script setup lang="ts">
import type { Recordable } from '@vben/types';
import { ref } from 'vue';
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import dayjs from 'dayjs';
import {
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
type VxeGridProps
} from '#/adapter/vxe-table';
import {
@@ -24,7 +18,10 @@ import type { BuildingForm } from '#/api/property/building/model';
import { commonDownloadExcel } from '#/utils/file/download';
import buildingModal from './building-modal.vue';
import buildingDetail from './building-detail.vue';
import { columns, querySchema } from './data';
import unitInfoModal from "#/views/property/resident/unit/unit-detail.vue";
import type {Resident_unitForm} from "#/api/property/resident/unit/model";
const formOptions: VbenFormProps = {
commonConfig: {
@@ -87,7 +84,13 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
const [BuildingModal, modalApi] = useVbenModal({
connectedComponent: buildingModal,
});
const [buildingDetailModal, buildingDetailApi] = useVbenModal({
connectedComponent: buildingDetail,
});
async function handleInfo(row: Required<BuildingForm>) {
// buildingDetailApi.setData({ id: row.id });
buildingDetailApi.open();
}
function handleAdd() {
modalApi.setData({});
modalApi.open();
@@ -138,8 +141,8 @@ function handleDownloadExcel() {
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['property:building:remove']"
type="primary"
v-access:code="['property:building:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }}
</a-button>
@@ -150,10 +153,21 @@ function handleDownloadExcel() {
>
{{ $t('pages.common.add') }}
</a-button>
<a-button
type="primary"
@click="handleInfo"
>
{{ $t('pages.common.info') }}
</a-button>
</Space>
</template>
<template #action="{ row }">
<Space>
<ghost-button
@click.stop="handleInfo(row)"
>
{{ $t('pages.common.info') }}
</ghost-button>
<ghost-button
v-access:code="['property:building:edit']"
@click.stop="handleEdit(row)"
@@ -178,5 +192,6 @@ function handleDownloadExcel() {
</template>
</BasicTable>
<BuildingModal @reload="tableApi.query()" />
<buildingDetailModal/>
</Page>
</template>

View File

@@ -49,6 +49,22 @@ const detailSchema = [
},
},
rules: 'required',
},
{
label: '保洁面积',
fieldName: 'area',
component: 'InputNumber',
rules: 'required',
componentProps: {
onChange: async (value: number) => {
const formValues = await formApi.getValues();
if (formValues.peices && value) {
await formApi.setValues({
sumPeices: Number((formValues.peices * value).toFixed(2)),
});
}
},
},
},
{
label: '计量单位',
@@ -116,22 +132,7 @@ const detailSchema = [
},
rules: 'required',
},
{
label: '保洁面积',
fieldName: 'area',
component: 'InputNumber',
rules: 'required',
componentProps: {
onChange: async (value: number) => {
const formValues = await formApi.getValues();
if (formValues.peices && value) {
await formApi.setValues({
sumPeices: Number((formValues.peices * value).toFixed(2)),
});
}
},
},
},
{
label: '合计费用',
fieldName: 'sumPeices',
@@ -180,7 +181,6 @@ const [BasicModal, modalApi] = useVbenModal({
});
async function handleConfirm() {
console.log('handleConfirm');
try {
modalApi.lock(true);
const { valid } = await formApi.validate();
@@ -193,7 +193,10 @@ async function handleConfirm() {
const selectedService = cleanListData.find(item => item.id === data.name);
if (selectedService) {
data.name = selectedService.name;
data.id = selectedService.id
}
console.log(data);
handleClosed()
await markInitialized();
emit('reload', data);
@@ -206,7 +209,6 @@ async function handleConfirm() {
}
async function handleClosed() {
console.log('handleClosed');
await formApi.resetForm();
resetInitialized();
}

View File

@@ -125,10 +125,11 @@ const [BasicModal, modalApi] = useVbenModal({
const detailGridOptions: VxeGridProps = {
height: '300px',
columns: [
{ type: 'checkbox', width: 60 },
{
title: '序号',
field: 'index',
width: 'auto',
slots: {
default: ({ rowIndex }) => {
return (rowIndex + 1).toString();
@@ -138,34 +139,42 @@ const detailGridOptions: VxeGridProps = {
{
title: '劳务名称',
field: 'name',
width: 'auto',
},
{
title: '计量单位',
field: 'measure',
width: 'auto',
},
{
title: '计算方式',
field: 'method',
width: 'auto',
},
{
title: '申报单价含税(元)',
field: 'peices',
width: 'auto',
},
{
title: '保洁频率',
field: 'frequency',
width: 'auto',
},
{
title: '保洁标准',
field: 'standard',
width: 'auto',
},
{
title: '备注',
field: 'remark',
width: 'auto',
},
{
title: '状态',
field: 'stater',
width: 'auto',
slots: {
default: ({ row }) => row.stater === 1 ? '启用' : '禁用',
},
@@ -173,43 +182,47 @@ const detailGridOptions: VxeGridProps = {
{
title: '保洁面积',
field: 'area',
width: 'auto',
},
{
title: '合计费用',
field: 'sumPeices',
width: 'auto',
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 120,
width: 'auto',
},
],
data: [],
};
const detailColumns = [
{ title: '序号', key: 'index'},
{ title: '劳务名称', dataIndex: 'name', key: 'name' },
{ title: '计量单位', dataIndex: 'measure', key: 'measure' },
{ title: '计算方式', dataIndex: 'method', key: 'method' },
{ title: '申报单价含税(元)', dataIndex: 'peices', key: 'peices' },
{ title: '保洁频率', dataIndex: 'frequency', key: 'frequency' },
{ title: '保洁标准', dataIndex: 'standard', key: 'standard' },
{ title: '备注', dataIndex: 'remark', key: 'remark' },
{ title: '序号', key: 'index', width: 'auto'},
{ title: '劳务名称', dataIndex: 'name', key: 'name', width: 'auto' },
{ title: '计量单位', dataIndex: 'measure', key: 'measure', width: 'auto' },
{ title: '计算方式', dataIndex: 'method', key: 'method', width: 'auto' },
{ title: '申报单价含税(元)', dataIndex: 'peices', key: 'peices' , width: 'auto'},
{ title: '保洁频率', dataIndex: 'frequency', key: 'frequency' , width: 'auto'},
{ title: '保洁标准', dataIndex: 'standard', key: 'standard' , width: 'auto'},
{ title: '备注', dataIndex: 'remark', key: 'remark' , width: 'auto'},
{
title: '状态',
dataIndex: 'stater',
key: 'stater',
width: 'auto',
customRender: ({ value }: { value: number }) => (value === 1 ? '启用' : '禁用')
},
{ title: '保洁面积', dataIndex: 'area', key: 'area' },
{ title: '合计费用', dataIndex: 'sumPeices', key: 'sumPeices' },
{ title: '保洁面积', dataIndex: 'area', key: 'area', width: 'auto' },
{ title: '合计费用', dataIndex: 'sumPeices', key: 'sumPeices', width: 'auto' },
{
title: '操作',
key: 'action',
fixed: 'right',
width: 120,
fixed: 'right' as const,
width: 'auto',
},
]
@@ -260,9 +273,9 @@ async function handleConfirm() {
data.unitId = unitObj ? unitObj.id : (isUpdate.value ? editUnitId.value : '');
data.cleanId = cleanObj ? cleanObj.id : (isUpdate.value ? editCleanId.value : '');
// 如不需要原字段可删除
// delete data.unit;
// delete data.name;
// 组装 cleanIds
data.cleanIds = detailTable.value.map((item: any) => item.id);
data.details = detailTable.value;
await (isUpdate.value ? clean_orderUpdate(data) : clean_orderAdd(data));
resetInitialized();

View File

@@ -39,10 +39,10 @@ export const querySchema: FormSchemaGetter = () => [
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '序号',
field: 'id',
width:'60',
slots: {
default: ({ rowIndex }) => {
return (rowIndex + 1).toString();
@@ -52,26 +52,32 @@ export const columns: VxeGridProps['columns'] = [
{
title: '服务地址',
field: 'location',
width: 'auto',
},
{
title: '服务面积(㎡)',
field: 'area',
width: 'auto',
},
{
title: '劳务名称',
field: 'name',
width: 'auto',
},
{
title: '申报单价含税(元)',
field: 'prices',
width: 'auto',
},
{
title: '合计费用',
field: 'sumPeices',
width: 'auto',
},
{
title: '支付状态',
field: 'payState',
width: 'auto',
slots: {
default: ({ row }) => row.stater === 1 ? '已支付' : '待支付',
},
@@ -79,22 +85,30 @@ export const columns: VxeGridProps['columns'] = [
{
title: '服务开始时间',
field: 'starTime',
width: 'auto',
},
{
title: '服务结束时间',
field: 'endTime',
width: 'auto',
},
{
title: '申请单位',
field: 'unit',
width: 'auto',
},
{
title: '申请人',
field: 'persion',
width: 'auto',
},
{
title: '联系电话',
field: 'phone',
width: 'auto',
},
// {
// title: '提交时间',
@@ -105,7 +119,6 @@ export const columns: VxeGridProps['columns'] = [
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];

View File

@@ -31,11 +31,9 @@ export const querySchema: FormSchemaGetter = () => [
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '序号',
field: 'id',
width: 60,
slots: {
default: ({ rowIndex }) => {
return (rowIndex + 1).toString();
@@ -45,22 +43,27 @@ export const columns: VxeGridProps['columns'] = [
{
title: '劳务名称',
field: 'name',
width:'120'
},
{
title: '计量单位',
field: 'measure',
width:'120'
},
{
title: '计算方式',
field: 'method',
width:'120'
},
{
title: '申报单价含税(元)',
field: 'peices',
width: 'auto',
},
{
title: '保洁频率',
field: 'frequency',
width:'120'
},
// {
// title: '保洁内容',
@@ -69,14 +72,17 @@ export const columns: VxeGridProps['columns'] = [
{
title: '保洁标准',
field: 'standard',
width:'200'
},
{
title: '备注',
field: 'remark',
width:'200'
},
{
title: '状态',
field: 'stater',
width:'120',
slots: {
default: ({ row }) => row.stater === 1 ? '上架' : '下架',
},
@@ -90,7 +96,7 @@ export const columns: VxeGridProps['columns'] = [
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
width: 'auto',
},
];
@@ -127,6 +133,7 @@ export const modalSchema: FormSchemaGetter = () => [
fieldName: 'peices',
component: 'Input',
rules: 'required',
width: 300,
},
{
label: '保洁频率',

View File

@@ -0,0 +1,79 @@
<script setup lang="ts">
import type {Community} from '#/api/property/community/model';
import {shallowRef} from 'vue';
import {useVbenModal} from '@vben/common-ui';
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
import {communityInfo} from '#/api/property/community';
import {renderDict} from "#/utils/render";
const [BasicModal, modalApi] = useVbenModal({
onOpenChange: handleOpenChange,
onClosed() {
communityDetail.value = null;
},
});
const communityDetail = shallowRef<null | Community>(null);
async function handleOpenChange(open: boolean) {
if (!open) {
return null;
}
modalApi.modalLoading(true);
const {id} = modalApi.getData() as { id: number | string };
const response = await communityInfo(id);
// 赋值
communityDetail.value = response;
modalApi.modalLoading(false);
}
</script>
<template>
<BasicModal :footer="false" :fullscreen-button="false" title="小区管理信息" class="w-[70%]">
<Descriptions v-if="communityDetail" size="small" :column="2" bordered :labelStyle="{width:'100px'}">
<DescriptionsItem label="社区名称">
{{ communityDetail.communityName }}
</DescriptionsItem>
<DescriptionsItem label="社区编码">
{{ communityDetail.communityCode }}
</DescriptionsItem>
<DescriptionsItem label="社区类型" v-if="communityDetail.communityType!=null">
<component
:is="renderDict(communityDetail.communityType,'wy_sqlx')"
/>
</DescriptionsItem>
<DescriptionsItem label="省">
{{ communityDetail.province }}
</DescriptionsItem>
<DescriptionsItem label="市">
{{ communityDetail.city }}
</DescriptionsItem>
<DescriptionsItem label="区">
{{ communityDetail.district }}
</DescriptionsItem>
<DescriptionsItem label="地址">
{{ communityDetail.addr }}
</DescriptionsItem>
<DescriptionsItem label="经度">
{{ communityDetail.lon }}
</DescriptionsItem>
<DescriptionsItem label="维度">
{{ communityDetail.lat }}
</DescriptionsItem>
<DescriptionsItem label="小图图片">
{{ communityDetail.img }}
</DescriptionsItem>
<DescriptionsItem label="组织编码">
{{ communityDetail.orgCode }}
</DescriptionsItem>
<DescriptionsItem label="数据状态" v-if="communityDetail.dataState!=null">
<component
:is="renderDict(communityDetail.dataState,'wy_cqxz')"
/>
</DescriptionsItem>
<DescriptionsItem label="修改时间">
{{ communityDetail.modifyTime }}
</DescriptionsItem>
</Descriptions>
</BasicModal>
</template>

View File

@@ -22,63 +22,13 @@ export const querySchema: FormSchemaGetter = () => [
options: getDictOptions('wy_sqlx'),
},
fieldName: 'communityType',
label: '社区类型 1园区2小区',
},
{
component: 'Input',
fieldName: 'province',
label: '省',
},
{
component: 'Input',
fieldName: 'city',
label: '市',
},
{
component: 'Input',
fieldName: 'district',
label: '区',
},
{
component: 'Input',
fieldName: 'addr',
label: '地址',
},
{
component: 'Input',
fieldName: 'lon',
label: '经度',
},
{
component: 'Input',
fieldName: 'lat',
label: '维度',
},
{
component: 'Input',
fieldName: 'img',
label: '小图图片',
},
{
component: 'Input',
fieldName: 'orgCode',
label: '组织编码',
label: '社区类型',
},
{
component: 'Input',
fieldName: 'dataState',
label: '数据状态1有效0无效',
},
{
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
fieldName: 'modifyTime',
label: '修改时间',
},
label: '数据状态',
}
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
@@ -98,7 +48,7 @@ export const columns: VxeGridProps['columns'] = [
field: 'communityCode',
},
{
title: '社区类型 1园区2小区',
title: '社区类型',
field: 'communityType',
slots: {
default: ({ row }) => {
@@ -136,11 +86,7 @@ export const columns: VxeGridProps['columns'] = [
field: 'img',
},
{
title: '组织编码',
field: 'orgCode',
},
{
title: '数据状态1有效0无效',
title: '数据状态',
field: 'dataState',
},
{
@@ -179,7 +125,7 @@ export const modalSchema: FormSchemaGetter = () => [
rules: 'required',
},
{
label: '社区类型 1园区2小区',
label: '社区类型',
fieldName: 'communityType',
component: 'Select',
componentProps: {
@@ -234,13 +180,7 @@ export const modalSchema: FormSchemaGetter = () => [
},
},
{
label: '组织编码',
fieldName: 'orgCode',
component: 'Input',
rules: 'required',
},
{
label: '数据状态1有效0无效',
label: '数据状态',
fieldName: 'dataState',
component: 'Input',
rules: 'required',

View File

@@ -1,18 +1,12 @@
<script setup lang="ts">
import type { Recordable } from '@vben/types';
import { ref } from 'vue';
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import dayjs from 'dayjs';
import {
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
type VxeGridProps
} from '#/adapter/vxe-table';
import {
@@ -25,6 +19,8 @@ import { commonDownloadExcel } from '#/utils/file/download';
import communityModal from './community-modal.vue';
import { columns, querySchema } from './data';
import communityDetail from "#/views/property/community/community-detail.vue";
import type {BuildingForm} from "#/api/property/building/model";
const formOptions: VbenFormProps = {
commonConfig: {
@@ -87,6 +83,13 @@ const [BasicTable, tableApi] = useVbenVxeGrid({
const [CommunityModal, modalApi] = useVbenModal({
connectedComponent: communityModal,
});
const [communityDetailModal, communityDetailApi] = useVbenModal({
connectedComponent: communityDetail,
});
async function handleInfo(row: Required<BuildingForm>) {
// communityDetailApi.setData({ id: row.id });
communityDetailApi.open();
}
function handleAdd() {
modalApi.setData({});
@@ -138,8 +141,8 @@ function handleDownloadExcel() {
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['property:community:remove']"
type="primary"
v-access:code="['property:community:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }}
</a-button>
@@ -150,10 +153,21 @@ function handleDownloadExcel() {
>
{{ $t('pages.common.add') }}
</a-button>
<a-button
type="primary"
@click="handleInfo"
>
{{ $t('pages.common.info') }}
</a-button>
</Space>
</template>
<template #action="{ row }">
<Space>
<ghost-button
@click.stop="handleInfo(row)"
>
{{ $t('pages.common.info') }}
</ghost-button>
<ghost-button
v-access:code="['property:community:edit']"
@click.stop="handleEdit(row)"
@@ -178,5 +192,6 @@ function handleDownloadExcel() {
</template>
</BasicTable>
<CommunityModal @reload="tableApi.query()" />
<communityDetailModal/>
</Page>
</template>

View File

@@ -31,7 +31,7 @@ export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'dataState',
label: '数据状态1有效0无效',
label: '数据状态',
},
];

View File

@@ -0,0 +1,5 @@
<template>
<div>
收费管理
</div>
</template>

View File

@@ -0,0 +1,5 @@
<template>
<div>
养护管理
</div>
</template>

View File

@@ -0,0 +1,146 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { getDictOptions } from '#/utils/dict';
import { renderDict } from '#/utils/render';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'planName',
label: '方案名称',
},
{
component: 'Select',
fieldName: 'rentalPeriod',
label: '租赁周期',
componentProps: {
options:[
{ label: '月', value: 0 },
{ label: '季度', value: 1 },
{ label: '年', value: 2 },
]
},
},
{
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.WY_KG 便于维护
options: getDictOptions('wy_kg'),
},
fieldName: 'state',
label: '状态',
},
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{
title: '序号',
field: 'id',
},
{
title: '方案名称',
field: 'planName',
},
{
title: '租赁周期',
field: 'rentalPeriod',
},
{
title: '适用场景',
field: 'scene',
},
{
title: '植物组合包',
field: 'scene',
},
{
title: '基础服务项',
field: 'scene',
},
{
title: '价格',
field: 'price',
},
{
title: '状态',
field: 'state',
slots: {
default: ({ row }) => {
// 可选从DictEnum中获取 DictEnum.WY_KG 便于维护
return renderDict(row.state, 'wy_kg');
},
},
},
{
title: '备注',
field: 'remarks',
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '方案名称',
fieldName: 'planName',
component: 'Input',
rules: 'required',
},
{
label: '租赁周期',
fieldName: 'rentalPeriod',
component: 'Select',
rules: 'required',
componentProps: {
options:[
{ label: '月', value: 0 },
{ label: '季度', value: 1 },
{ label: '年', value: 2 },
]
},
},
{
label: '适用场景',
fieldName: 'scene',
component: 'Input',
rules: 'required',
},
{
label: '价格体系',
fieldName: 'price',
component: 'Input',
},
{
label: '基础服务项',
fieldName: 'price',
component: 'Select',
},
{
label: '优惠活动',
fieldName: 'price',
component: 'Input',
},
{
label: '状态',
fieldName: 'state',
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.WY_KG 便于维护
options: getDictOptions('wy_kg'),
},
rules: 'selectRequired',
},
{
label: '备注',
fieldName: 'remarks',
component: 'Input',
},
];

View File

@@ -0,0 +1,182 @@
<script setup lang="ts">
import type { Recordable } from '@vben/types';
import { ref } from 'vue';
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import dayjs from 'dayjs';
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
} from '#/adapter/vxe-table';
import {
rentalPlanExport,
rentalPlanList,
rentalPlanRemove,
} from '#/api/property/rentalPlan';
import type { RentalPlanForm } from '#/api/property/rentalPlan/model';
import { commonDownloadExcel } from '#/utils/file/download';
import rentalPlanModal from './rentalPlan-modal.vue';
import { columns, querySchema } from './data';
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
componentProps: {
allowClear: true,
},
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
// 不需要直接删除
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
};
const gridOptions: VxeGridProps = {
checkboxConfig: {
// 高亮
highlight: true,
// 翻页时保留选中状态
reserve: true,
// 点击行选中
// trigger: 'row',
},
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// columns: columns(),
columns,
height: 'auto',
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues = {}) => {
return await rentalPlanList({
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
},
// 表格全局唯一表示 保存列配置需要用到
id: 'property-rentalPlan-index'
};
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
});
const [RentalPlanModal, modalApi] = useVbenModal({
connectedComponent: rentalPlanModal,
});
function handleAdd() {
modalApi.setData({});
modalApi.open();
}
async function handleEdit(row: Required<RentalPlanForm>) {
modalApi.setData({ id: row.id });
modalApi.open();
}
async function handleDelete(row: Required<RentalPlanForm>) {
await rentalPlanRemove(row.id);
await tableApi.query();
}
function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords();
const ids = rows.map((row: Required<RentalPlanForm>) => row.id);
Modal.confirm({
title: '提示',
okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await rentalPlanRemove(ids);
await tableApi.query();
},
});
}
function handleDownloadExcel() {
commonDownloadExcel(rentalPlanExport, '绿植租赁-租赁方案数据', tableApi.formApi.form.values, {
fieldMappingTime: formOptions.fieldMappingTime,
});
}
</script>
<template>
<Page :auto-content-height="true">
<BasicTable table-title="绿植租赁-租赁方案列表">
<template #toolbar-tools>
<Space>
<a-button
v-access:code="['property:rentalPlan:export']"
@click="handleDownloadExcel"
>
{{ $t('pages.common.export') }}
</a-button>
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['property:rentalPlan:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }}
</a-button>
<a-button
type="primary"
v-access:code="['property:rentalPlan:add']"
@click="handleAdd"
>
{{ $t('pages.common.add') }}
</a-button>
</Space>
</template>
<template #action="{ row }">
<Space>
<ghost-button
v-access:code="['property:rentalPlan:edit']"
@click.stop="handleEdit(row)"
>
{{ $t('pages.common.edit') }}
</ghost-button>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认删除?"
@confirm="handleDelete(row)"
>
<ghost-button
danger
v-access:code="['property:rentalPlan:remove']"
@click.stop=""
>
{{ $t('pages.common.delete') }}
</ghost-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<RentalPlanModal @reload="tableApi.query()" />
</Page>
</template>

View File

@@ -0,0 +1,101 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import { rentalPlanAdd, rentalPlanInfo, rentalPlanUpdate } from '#/api/property/rentalPlan';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
});
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
// 默认占满两列
formItemClass: 'col-span-2',
// 默认label宽度 px
labelWidth: 80,
// 通用配置项 会影响到所有表单项
componentProps: {
class: 'w-full',
}
},
schema: modalSchema(),
showDefaultActions: false,
wrapperClass: 'grid-cols-2',
});
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
},
);
const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度
class: 'w-[550px]',
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
onConfirm: handleConfirm,
onOpenChange: async (isOpen) => {
if (!isOpen) {
return null;
}
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await rentalPlanInfo(id);
await formApi.setValues(record);
}
await markInitialized();
modalApi.modalLoading(false);
},
});
async function handleConfirm() {
try {
modalApi.lock(true);
const { valid } = await formApi.validate();
if (!valid) {
return;
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues());
await (isUpdate.value ? rentalPlanUpdate(data) : rentalPlanAdd(data));
resetInitialized();
emit('reload');
modalApi.close();
} catch (error) {
console.error(error);
} finally {
modalApi.lock(false);
}
}
async function handleClosed() {
await formApi.resetForm();
resetInitialized();
}
</script>
<template>
<BasicModal :title="title">
<BasicForm />
</BasicModal>
</template>

View File

@@ -0,0 +1,241 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import {getDictOptions} from "#/utils/dict";
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'orderNo',
label: '订单编号',
},
{
component: 'Input',
fieldName: 'customerName',
label: '客户名称',
},
{
component: 'Select',
componentProps: {
},
fieldName: 'customerType',
label: '客户类型',
},
{
component: 'Select',
componentProps: {
options:getDictOptions('wy_zlfs')
},
fieldName: 'rentalType',
label: '租赁方式',
},
{
component: 'Select',
componentProps: {
options:getDictOptions('pro_charging_status')
},
fieldName: 'paymentStatus',
label: '支付状态',
},
];
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '订单号',
field: 'id',
},
{
title: '订单号',
field: 'orderNo',
},
{
title: '客户名称',
field: 'customerName',
},
{
title: '客户类型',
field: 'customerType',
},
{
title: '租赁周期',
field: 'rentalPeriod',
},
{
title: '租赁开始时间',
field: 'startTime',
},
{
title: '租赁结束时间',
field: 'endTime',
},
{
title: '应付总额',
field: 'totalAmount',
},
{
title: '租赁方式',
field: 'rentalType',
},
{
title: '租赁方案id',
field: 'planId',
},
{
title: '绿植产品id',
field: 'productId',
},
{
title: '租赁产品数量',
field: 'productNum',
},
{
title: '支付状态',
field: 'paymentStatus',
},
{
title: '是否续租',
field: 'isRelet',
},
{
title: '合同状态',
field: 'contractStatus',
},
{
title: '签署时间',
field: 'signTime',
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '主键',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
label: '订单号',
fieldName: 'orderNo',
component: 'Input',
rules: 'required',
},
{
label: '客户名称',
fieldName: 'customerName',
component: 'Input',
rules: 'required',
},
{
label: '客户类型',
fieldName: 'customerType',
component: 'Select',
componentProps: {
},
rules: 'selectRequired',
},
{
label: '租赁周期',
fieldName: 'rentalPeriod',
component: 'Select',
componentProps: {
},
rules: 'selectRequired',
},
{
label: '租赁开始时间',
fieldName: 'startTime',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
rules: 'required',
},
{
label: '租赁结束时间',
fieldName: 'endTime',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
rules: 'required',
},
{
label: '应付总额',
fieldName: 'totalAmount',
component: 'Input',
rules: 'required',
},
{
label: '租赁方式',
fieldName: 'rentalType',
component: 'Select',
componentProps: {
},
rules: 'selectRequired',
},
{
label: '租赁方案id',
fieldName: 'planId',
component: 'Input',
},
{
label: '绿植产品id',
fieldName: 'productId',
component: 'Input',
},
{
label: '租赁产品数量',
fieldName: 'productNum',
component: 'Input',
},
{
label: '支付状态',
fieldName: 'paymentStatus',
component: 'Select',
componentProps: {
},
rules: 'selectRequired',
},
{
label: '是否续租',
fieldName: 'isRelet',
component: 'RadioGroup',
componentProps: {
buttonStyle: 'solid',
optionType: 'button',
},
},
{
label: '合同状态',
fieldName: 'contractStatus',
component: 'Select',
componentProps: {
},
},
{
label: '签署时间',
fieldName: 'signTime',
component: 'DatePicker',
componentProps: {
showTime: true,
format: 'YYYY-MM-DD HH:mm:ss',
valueFormat: 'YYYY-MM-DD HH:mm:ss',
},
},
];

View File

@@ -0,0 +1,178 @@
<script setup lang="ts">
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
} from '#/adapter/vxe-table';
import {
rentalOrderExport,
rentalOrderList,
rentalOrderRemove,
} from '#/api/property/rentalOrder';
import type { RentalOrderForm } from '#/api/property/rentalOrder/model';
import { commonDownloadExcel } from '#/utils/file/download';
import rentalOrderModal from './rentalOrder-modal.vue';
import { columns, querySchema } from './data';
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
componentProps: {
allowClear: true,
},
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
// 不需要直接删除
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
};
const gridOptions: VxeGridProps = {
checkboxConfig: {
// 高亮
highlight: true,
// 翻页时保留选中状态
reserve: true,
// 点击行选中
// trigger: 'row',
},
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// columns: columns(),
columns,
height: 'auto',
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues = {}) => {
return await rentalOrderList({
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
},
// 表格全局唯一表示 保存列配置需要用到
id: 'property-rentalOrder-index'
};
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
});
const [RentalOrderModal, modalApi] = useVbenModal({
connectedComponent: rentalOrderModal,
});
function handleAdd() {
modalApi.setData({});
modalApi.open();
}
async function handleEdit(row: Required<RentalOrderForm>) {
modalApi.setData({ id: row.id });
modalApi.open();
}
async function handleDelete(row: Required<RentalOrderForm>) {
await rentalOrderRemove(row.id);
await tableApi.query();
}
function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords();
const ids = rows.map((row: Required<RentalOrderForm>) => row.id);
Modal.confirm({
title: '提示',
okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await rentalOrderRemove(ids);
await tableApi.query();
},
});
}
function handleDownloadExcel() {
commonDownloadExcel(rentalOrderExport, '绿植租赁-订单管理数据', tableApi.formApi.form.values, {
fieldMappingTime: formOptions.fieldMappingTime,
});
}
</script>
<template>
<Page :auto-content-height="true">
<BasicTable table-title="绿植租赁-订单管理列表">
<template #toolbar-tools>
<Space>
<a-button
v-access:code="['property:rentalOrder:export']"
@click="handleDownloadExcel"
>
{{ $t('pages.common.export') }}
</a-button>
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['property:rentalOrder:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }}
</a-button>
<a-button
type="primary"
v-access:code="['property:rentalOrder:add']"
@click="handleAdd"
>
{{ $t('pages.common.add') }}
</a-button>
</Space>
</template>
<template #action="{ row }">
<Space>
<ghost-button
v-access:code="['property:rentalOrder:edit']"
@click.stop="handleEdit(row)"
>
{{ $t('pages.common.edit') }}
</ghost-button>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认删除?"
@confirm="handleDelete(row)"
>
<ghost-button
danger
v-access:code="['property:rentalOrder:remove']"
@click.stop=""
>
{{ $t('pages.common.delete') }}
</ghost-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<RentalOrderModal @reload="tableApi.query()" />
</Page>
</template>

View File

@@ -0,0 +1,101 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import { rentalOrderAdd, rentalOrderInfo, rentalOrderUpdate } from '#/api/property/rentalOrder';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
});
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
// 默认占满两列
formItemClass: 'col-span-2',
// 默认label宽度 px
labelWidth: 80,
// 通用配置项 会影响到所有表单项
componentProps: {
class: 'w-full',
}
},
schema: modalSchema(),
showDefaultActions: false,
wrapperClass: 'grid-cols-2',
});
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
},
);
const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度
class: 'w-[550px]',
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
onConfirm: handleConfirm,
onOpenChange: async (isOpen) => {
if (!isOpen) {
return null;
}
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await rentalOrderInfo(id);
await formApi.setValues(record);
}
await markInitialized();
modalApi.modalLoading(false);
},
});
async function handleConfirm() {
try {
modalApi.lock(true);
const { valid } = await formApi.validate();
if (!valid) {
return;
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues());
await (isUpdate.value ? rentalOrderUpdate(data) : rentalOrderAdd(data));
resetInitialized();
emit('reload');
modalApi.close();
} catch (error) {
console.error(error);
} finally {
modalApi.lock(false);
}
}
async function handleClosed() {
await formApi.resetForm();
resetInitialized();
}
</script>
<template>
<BasicModal :title="title">
<BasicForm />
</BasicModal>
</template>

View File

@@ -0,0 +1,171 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import { getDictOptions } from '#/utils/dict';
import { renderDict } from '#/utils/render';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'plantName',
label: '产品名称:',
},
{
component: 'Input',
fieldName: 'specification',
label: '规格:',
},
{
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.PRODUCT_MANAGEMENT_STATUS 便于维护
options: getDictOptions('product_management_status'),
},
fieldName: 'state',
label: '状态:',
},
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '序号',
field: 'id',
slots: {
default: ({ rowIndex }) => {
return (rowIndex + 1).toString();
},
},
},
{
title: '产品编号',
field: 'plantCode',
},
{
title: '产品名称',
field: 'plantName',
},
{
title: '产品分类',
field: 'plantType',
},
{
title: '图片',
field: 'imgPath',
},
{
title: '规格',
field: 'specification',
},
{
title: '租金',
field: 'rent',
},
{
title: '库存数量',
field: 'inventory',
},
{
title: '状态',
field: 'state',
slots: {
default: ({ row }) => {
// 可选从DictEnum中获取 DictEnum.PRODUCT_MANAGEMENT_STATUS 便于维护
return renderDict(row.state, 'product_management_status');
},
},
},
{
title: '备注',
field: 'remark',
},
{
title: '创建时间',
field: 'createTime',
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '主键',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
label: '产品编号',
fieldName: 'plantCode',
component: 'Input',
rules: 'required',
},
{
label: '产品名称',
fieldName: 'plantName',
component: 'Input',
rules: 'required',
},
{
label: '产品分类',
fieldName: 'plantType',
component: 'Select',
componentProps: {
options: getDictOptions('pro_product_classification'),
},
rules: 'required',
},
{
label: '图片',
fieldName: 'imgPath',
component: 'Input',
},
{
label: '规格',
fieldName: 'specification',
component: 'Input',
rules: 'required',
},
{
label: '租金',
fieldName: 'rent',
component: 'Input',
rules: 'required',
},
{
label: '库存数量',
fieldName: 'inventory',
component: 'Input',
rules: 'required',
},
{
label: '状态',
fieldName: 'state',
component: 'Select',
componentProps: {
// 可选从DictEnum中获取 DictEnum.PRODUCT_MANAGEMENT_STATUS 便于维护
options: getDictOptions('product_management_status'),
},
rules: 'selectRequired',
},
{
label: '备注',
fieldName: 'remark',
component: 'Input',
},
// {
// label: '创建时间',
// fieldName: 'creatTime',
// component: 'Input',
// },
];

View File

@@ -0,0 +1,193 @@
<script setup lang="ts">
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
} from '#/adapter/vxe-table';
import {
plantsProductExport,
plantsProductList,
plantsProductRemove,
} from '#/api/property/productManagement';
import type { PropertyForm } from '#/api/property/productManagement/model';
import { commonDownloadExcel } from '#/utils/file/download';
import PlantsProductModal from './plantsProduct-modal.vue';
import PlantsProductDetail from './plantsProduct-detail.vue';
import { columns, querySchema } from './data';
import unitInfoModal from "#/views/property/resident/unit/unit-detail.vue";
import type {Resident_unitForm} from "#/api/property/resident/unit/model";
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
componentProps: {
allowClear: true,
},
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
// 不需要直接删除
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
};
const gridOptions: VxeGridProps = {
checkboxConfig: {
// 高亮
highlight: true,
// 翻页时保留选中状态
reserve: true,
// 点击行选中
// trigger: 'row',
},
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// columns: columns(),
columns,
height: 'auto',
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues = {}) => {
return await plantsProductList({
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
},
// 表格全局唯一表示 保存列配置需要用到
id: 'property-property-index'
};
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
});
const [PlantsProduct, modalApi] = useVbenModal({
connectedComponent: PlantsProductModal,
});
const [PlantsProductDetailModal, PlantsProductDetailApi] = useVbenModal({
connectedComponent: PlantsProductDetail,
});
async function handleInfo(row: Required<PropertyForm>) {
PlantsProductDetailApi.setData({ id: row.id });
PlantsProductDetailApi.open();
}
function handleAdd() {
modalApi.setData({});
modalApi.open();
}
async function handleEdit(row: Required<PropertyForm>) {
modalApi.setData({ id: row.id });
modalApi.open();
}
async function handleDelete(row: Required<PropertyForm>) {
await plantsProductRemove(row.id);
await tableApi.query();
}
function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords();
const ids = rows.map((row: Required<PropertyForm>) => row.id);
Modal.confirm({
title: '提示',
okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await plantsProductRemove(ids);
await tableApi.query();
},
});
}
function handleDownloadExcel() {
commonDownloadExcel(plantsProductExport, '绿植租赁-绿植产品数据', tableApi.formApi.form.values, {
fieldMappingTime: formOptions.fieldMappingTime,
});
}
</script>
<template>
<Page :auto-content-height="true">
<BasicTable table-title="绿植租赁-绿植产品列表">
<template #toolbar-tools>
<Space>
<a-button
v-access:code="['property:property:export']"
@click="handleDownloadExcel"
>
{{ $t('pages.common.export') }}
</a-button>
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['property:property:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }}
</a-button>
<a-button
type="primary"
v-access:code="['property:property:add']"
@click="handleAdd"
>
{{ $t('pages.common.add') }}
</a-button>
</Space>
</template>
<template #action="{ row }">
<Space>
<ghost-button
@click.stop="handleInfo(row)"
>
{{ $t('pages.common.info') }}
</ghost-button>
<ghost-button
v-access:code="['property:property:edit']"
@click.stop="handleEdit(row)"
>
{{ $t('pages.common.edit') }}
</ghost-button>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认删除?"
@confirm="handleDelete(row)"
>
<ghost-button
danger
v-access:code="['property:property:remove']"
@click.stop=""
>
{{ $t('pages.common.delete') }}
</ghost-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<PlantsProduct @reload="tableApi.query()" />
<PlantsProductDetailModal/>
</Page>
</template>

View File

@@ -0,0 +1,70 @@
<script setup lang="ts">
import type {plantsProduct} from '#/api/property/productManagement/model';
import {shallowRef} from 'vue';
import {useVbenModal} from '@vben/common-ui';
import {Descriptions, DescriptionsItem} from 'ant-design-vue';
import {visitorManagementInfo} from '#/api/property/visitorManagement';
import {renderDict} from "#/utils/render";
const [BasicModal, modalApi] = useVbenModal({
onOpenChange: handleOpenChange,
onClosed() {
plantsProductDetail.value = null;
},
});
const plantsProductDetail = shallowRef<null | plantsProduct>(null);
async function handleOpenChange(open: boolean) {
if (!open) {
return null;
}
modalApi.modalLoading(true);
const {id} = modalApi.getData() as { id: number | string };
const response = await visitorManagementInfo(id);
// 赋值
plantsProductDetail.value = response;
modalApi.modalLoading(false);
}
</script>
<template>
<BasicModal :footer="false" :fullscreen-button="false" title="产品管理信息" class="w-[70%]">
<Descriptions v-if="plantsProductDetail" size="small" :column="2" bordered :labelStyle="{width:'100px'}">
<DescriptionsItem label="产品编号">
{{ plantsProductDetail.plantCode }}
</DescriptionsItem>
<DescriptionsItem label="产品名称">
{{ plantsProductDetail.plantName }}
</DescriptionsItem>
<DescriptionsItem label="产品分类" v-if="plantsProductDetail.plantType!=null">
<component
:is="renderDict(plantsProductDetail.plantType,'pro_product_classification')"
/>
</DescriptionsItem>
<DescriptionsItem label="图片">
{{ plantsProductDetail.imgPath }}
</DescriptionsItem>
<DescriptionsItem label="规格">
{{ plantsProductDetail.specification }}
</DescriptionsItem>
<DescriptionsItem label="租金">
{{ plantsProductDetail.rent }}
</DescriptionsItem>
<DescriptionsItem label="库存数量">
{{ plantsProductDetail.inventory }}
</DescriptionsItem>
<DescriptionsItem label="状态" v-if="plantsProductDetail.state!=null">
<component
:is="renderDict(plantsProductDetail.state,'product_management_status')"
/>
</DescriptionsItem>
<DescriptionsItem label="备注">
{{ plantsProductDetail.remark }}
</DescriptionsItem>
<DescriptionsItem label="创建时间">
{{ plantsProductDetail.createTime }}
</DescriptionsItem>
</Descriptions>
</BasicModal>
</template>

View File

@@ -0,0 +1,101 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import { plantsProductAdd, plantsProductInfo, plantsProductUpdate } from '#/api/property/productManagement';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
});
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
// 默认占满两列
formItemClass: 'col-span-2',
// 默认label宽度 px
labelWidth: 80,
// 通用配置项 会影响到所有表单项
componentProps: {
class: 'w-full',
}
},
schema: modalSchema(),
showDefaultActions: false,
wrapperClass: 'grid-cols-2',
});
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
},
);
const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度
class: 'w-[550px]',
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
onConfirm: handleConfirm,
onOpenChange: async (isOpen) => {
if (!isOpen) {
return null;
}
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await plantsProductInfo(id);
await formApi.setValues(record);
}
await markInitialized();
modalApi.modalLoading(false);
},
});
async function handleConfirm() {
try {
modalApi.lock(true);
const { valid } = await formApi.validate();
if (!valid) {
return;
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues());
await (isUpdate.value ? plantsProductUpdate(data) : plantsProductAdd(data));
resetInitialized();
emit('reload');
modalApi.close();
} catch (error) {
console.error(error);
} finally {
modalApi.lock(false);
}
}
async function handleClosed() {
await formApi.resetForm();
resetInitialized();
}
</script>
<template>
<BasicModal :title="title">
<BasicForm />
</BasicModal>
</template>

View File

@@ -0,0 +1,293 @@
<script setup lang="ts">
import { Button } from 'ant-design-vue';
import { ref, onMounted } from 'vue';
import { EchartsUI, useEcharts, type EchartsUIType } from '@vben/plugins/echarts';
const orderLineRef = ref<EchartsUIType>();
const leasePieRef = ref<EchartsUIType>();
const customerTypesBarRef = ref<EchartsUIType>();
const customerRenewalLineRef = ref<EchartsUIType>();
const conservationTasksBarRef = ref<EchartsUIType>();
const maintenanceQualityScoresPeiRef = ref<EchartsUIType>();
const { renderEcharts } = useEcharts(orderLineRef);
const { renderEcharts: renderLeasePie } = useEcharts(leasePieRef);
const {renderEcharts: renderCustomerTypesBar} = useEcharts(customerTypesBarRef);
const {renderEcharts: renderCustomerRenewalLine} = useEcharts(customerRenewalLineRef);
const {renderEcharts: renderConservationTasksBar} = useEcharts(conservationTasksBarRef);
const {renderEcharts: renderMaintenanceQualityScoresPei} = useEcharts(maintenanceQualityScoresPeiRef);
onMounted(() => {
renderEcharts({
title: { text: '订单数量趋势' },
tooltip: { trigger: 'axis' },
xAxis: {
type: 'category',
data: ['1月', '2月', '3月', '4月', '5月', '6月'],
boundaryGap: false,
},
yAxis: { type: 'value' },
series: [
{
name: '订单数',
type: 'line',
data: [120, 132, 101, 134, 90, 230],
smooth: true,
},
],
});
renderLeasePie({
title: { text: '租赁金额分布', left: 'center' },
tooltip: { trigger: 'item' },
legend: { orient: 'vertical', left: 'left' },
series: [
{
name: '金额',
type: 'pie',
radius: '60%',
center: ['50%', '50%'],
data: [
{ value: 1048, name: '办公楼' },
{ value: 735, name: '商场' },
{ value: 580, name: '酒店' },
{ value: 484, name: '医院' },
{ value: 300, name: '其他' },
],
emphasis: {
itemStyle: {
shadowBlur: 10,
shadowOffsetX: 0,
shadowColor: 'rgba(0, 0, 0, 0.5)',
},
},
label: {
formatter: '{b}: {c} ({d}%)',
show: true,
},
},
],
});
renderCustomerTypesBar({
title: { text: '客户类型分配' },
tooltip: { trigger: 'axis' },
xAxis: {
type: 'category',
data: ['1月', '2月', '3月', '4月', '5月', '6月'],
boundaryGap: false,
},
yAxis: { type: 'value' },
series: [
{
name: '订单数',
type: 'bar',
data: [120, 132, 101, 134, 90, 230],
},
],
});
renderCustomerRenewalLine({
title: { text: '客户续租率趋势' },
tooltip: { trigger: 'axis' },
xAxis: {
type: 'category',
data: ['1月', '2月', '3月', '4月', '5月', '6月'],
boundaryGap: false,
},
yAxis: { type: 'value' },
series: [
{
name: '订单数',
type: 'line',
data: [120, 132, 101, 134, 90, 230],
smooth: true,
},
],
});
renderConservationTasksBar({
title: { text: '养护任务完成情况' },
tooltip: {
trigger: 'axis',
axisPointer: { type: 'shadow' }
},
legend: {
data: ['计划任务数', '已完成数', '完成率']
},
xAxis: [
{
type: 'category',
data: ['朝阳区', '海淀区', '西城区', '东城区']
}
],
yAxis: [
{
type: 'value',
name: '任务数',
min: 0,
max: 200,
position: 'left'
},
{
type: 'value',
name: '完成率',
min: 0,
max: 100,
position: 'right',
axisLabel: {
formatter: '{value}%'
}
}
],
series: [
{
name: '计划任务数',
type: 'bar',
data: [156, 140, 130, 120]
},
{
name: '已完成数',
type: 'bar',
data: [152, 135, 125, 110]
},
{
name: '完成率',
type: 'line',
yAxisIndex: 1,
data: [97.4, 96.4, 96.2, 91.7]
}
]
});
renderMaintenanceQualityScoresPei({
title: { text: '养护质量评分分布', left: 'center' },
tooltip: {
trigger: 'item',
formatter: '{b} : {d}%'
},
legend: {
orient: 'horizontal',
left: 'center',
bottom: 10,
data: ['一星', '两星', '三星', '四星', '五星']
},
series: [
{
name: '评分',
type: 'pie',
radius: '60%',
center: ['50%', '50%'],
data: [
{ value: 12.43, name: '一星' },
{ value: 12.26, name: '两星' },
{ value: 16.87, name: '三星' },
{ value: 25.75, name: '四星' },
{ value: 32.68, name: '五星' }
],
label: {
formatter: '{b} {d}%',
show: true
}
}
]
});
});
</script>
<template>
<div class="main">
<div class="box">
<div class="title">
<div class="title-text">绿植租赁业务统计报表</div>
<div class="title-operate">
<div class="export">
<Button size="large" style="background-color: #22C55E; color: #fff;">导出数据</Button>
</div>
</div>
</div>
<div class="content">
<div class="row">
</div>
<div class="row-first">
<div class="item1">
<EchartsUI ref="orderLineRef" height="350px" width="100%" style="background:#fff;border-radius:8px;" />
</div>
<div class="item2">
<EchartsUI ref="leasePieRef" height="350px" width="100%" style="background:#fff;border-radius:8px;" />
</div>
</div>
<div class="row-second">
<div class="item1">
<EchartsUI ref="customerTypesBarRef" height="350px" width="100%" style="background:#fff;border-radius:8px;" />
</div>
<div class="item2">
<EchartsUI ref="customerRenewalLineRef" height="350px" width="100%" style="background:#fff;border-radius:8px;" />
</div>
</div>
<div class="row-third">
<EchartsUI ref="conservationTasksBarRef" height="100%" width="100%" style="background:#fff;border-radius:8px;" />
</div>
<div class="row-fouth">
<EchartsUI ref="maintenanceQualityScoresPeiRef" height="100%" width="100%" style="background:#fff;border-radius:8px;" />
</div>
</div>
</div>
</div>
</template>
<style lang="scss" scoped>
.main {
width: 100%;
.box{
margin: 40px;
height: 100%;
.title{
display: flex;
justify-content: space-between;
.title-text{
font-size: 25px;
font-weight: bold;
}
.title-operate{
display: flex;
.calendar{
}
.export{
margin-left: 20px;
}
}
}
.content{
flex:1;
padding: 10px;
background-color: #962020;
height: 100%;
.row{
display: flex;
justify-content: space-between;
}
.row-first{
display: flex;
justify-content: space-between;
height: 400px;
}
.row-second{
display: flex;
justify-content: space-between;
height: 400px;
}
.row-third{
height: 400px;
margin-bottom: 50px;
}
.row-fouth{
height: 400px;
}
.item1{
width: 45%;
height: 100%;
}
.item2{
width: 50%;
height: 100%;
}
}
}
}
</style>

View File

@@ -1,7 +1,6 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import {getDictOptions} from "#/utils/dict";
import {renderDict} from "#/utils/render";
export const querySchema: FormSchemaGetter = () => [
{
@@ -50,11 +49,6 @@ export const columns: VxeGridProps['columns'] = [
{
title: '性别',
field: 'gender',
slots:{
default: ({row})=>{
return renderDict(row.gender,'sys_user_sex')
}
}
},
{
field: 'img',
@@ -81,9 +75,7 @@ export const columns: VxeGridProps['columns'] = [
{
title: '状态',
field: 'state',
slots:{
default: 'state'
}
// slots: { default: 'state' },
},
{
title: '备注',

View File

@@ -14,7 +14,7 @@ import {
import {
personExport,
personList,
personRemove, personUpdate,
personRemove,
} from '#/api/property/resident/person';
import type { PersonForm } from '#/api/property/resident/person/model';
import { commonDownloadExcel } from '#/utils/file/download';
@@ -22,8 +22,7 @@ import { commonDownloadExcel } from '#/utils/file/download';
import personModal from './person-modal.vue';
import personDetail from './person-detail.vue';
import { columns, querySchema } from './data';
import {useAccess} from "@vben/access";
import {TableSwitch} from "#/components/table";
// import {TableSwitch} from "#/components/table";
const formOptions: VbenFormProps = {
commonConfig: {
@@ -45,6 +44,8 @@ const gridOptions: VxeGridProps = {
// 点击行选中
// trigger: 'row',
},
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// columns: columns(),
columns,
height: 'auto',
keepSource: true,
@@ -79,7 +80,6 @@ const [PersonDetail, personDetailApi] = useVbenModal({
connectedComponent: personDetail,
});
const { hasAccessByCodes } = useAccess();
function handleAdd() {
modalApi.setData({});
@@ -120,6 +120,7 @@ function handleInfo(row: Required<PersonForm>) {
personDetailApi.setData({ id: row.id });
personDetailApi.open();
}
</script>
<template>
@@ -153,16 +154,16 @@ function handleInfo(row: Required<PersonForm>) {
<template #img="{ row }">
<Avatar :src="row.img" />
</template>
<template #state="{ row }">
<TableSwitch
:checkedValue="1"
:unCheckedValue="0"
v-model:value="row.state"
:api="() => personUpdate(row)"
:disabled="!hasAccessByCodes(['property:person:edit'])"
@reload="() => tableApi.query()"
/>
</template>
<!-- <template #state="{ row }">-->
<!-- <TableSwitch-->
<!-- v-model:value="row.status"-->
<!-- :api="() => personStatusChange(row)"-->
<!-- :disabled="-->
<!-- row.userId === 1 || !hasAccessByCodes(['system:user:edit'])-->
<!-- "-->
<!-- @reload="() => tableApi.query()"-->
<!-- />-->
<!-- </template>-->
<template #action="{ row }">
<Space>
<ghost-button

View File

@@ -8,10 +8,11 @@ import dayjs from 'dayjs';
import duration from 'dayjs/plugin/duration';
import relativeTime from 'dayjs/plugin/relativeTime';
import {personInfo} from '#/api/property/resident/person';
// import {personInfo} from '#/api/property/resident/person';
import type {Person} from "#/api/property/resident/person/model";
import {accessControlColumns,carColumns} from "#/views/property/resident/person/data";
import { renderDictValue} from "#/utils/render";
// import {personList} from "#/api/property/resident/person";
// import {renderDict} from "#/utils/render";
dayjs.extend(duration);
@@ -35,9 +36,11 @@ async function handleOpenChange(open: boolean) {
}
modalApi.modalLoading(true);
const {id} = modalApi.getData() as { id: number | string };
// const {id} = modalApi.getData() as { id: number | string };
// const response = await personInfo(id);
const response = {id:1};
// 赋值
personDetail.value = await personInfo(id);
personDetail.value = response;
modalApi.modalLoading(false);
}
@@ -49,25 +52,25 @@ async function handleOpenChange(open: boolean) {
<BasicModal :footer="false" :fullscreen-button="false" title="入驻人员信息" class="w-[70%]">
<Descriptions v-if="personDetail" size="small" :column="1" bordered :labelStyle="{width:'100px'}">
<DescriptionsItem label="入驻人员">
{{ personDetail.userName+'-'+renderDictValue(personDetail.gender,'sys_user_sex')+'-'+personDetail.phone}}
{{ '入驻人员' }}
</DescriptionsItem>
<DescriptionsItem label="所属单位">
{{personDetail.unitName+'-'+personDetail.unitId }}
{{ '单位名称' }}
</DescriptionsItem>
<DescriptionsItem label="入驻位置">
{{ personDetail.locathon }}
{{ '单位名称' }}
</DescriptionsItem>
<DescriptionsItem label="人脸图片">
{{ personDetail.img }}
{{ '单位名称' }}
</DescriptionsItem>
<DescriptionsItem label="入驻时间">
{{ personDetail.time}}
{{ '单位名称' }}
</DescriptionsItem>
<DescriptionsItem label="车牌号码">
{{personDetail.carNumber}}
{{ '单位名称' }}
</DescriptionsItem>
<DescriptionsItem label="备注">
{{ personDetail.remark }}
{{ '单位名称' }}
</DescriptionsItem>
</Descriptions>
@@ -82,7 +85,7 @@ async function handleOpenChange(open: boolean) {
</template>
</Table>
</TabPane>
<TabPane key="2" tab="车辆记录" v-if="personDetail?.carNumber">
<TabPane key="2" tab="车辆记录">
<Table :dataSource="[]" :columns="carColumns" :pagination="false" >
<template #bodyCell="{ column, index }">
<template v-if="column.field === 'id'">

View File

@@ -27,7 +27,6 @@ let userInfo = reactive({
});
let unitName = ref('');
const userId = ref<number | string>(0);
const unitId = ref<number | string>(0);
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
// 默认占满两列
@@ -70,7 +69,7 @@ const [BasicModal, modalApi] = useVbenModal({
if (isUpdate.value && id) {
const record = await personInfo(id);
userId.value = record.userId;
unitId.value = record.unitId;
console.log(userId.value,'====================1111')
await formApi.setValues(record);
}
await markInitialized();
@@ -88,12 +87,10 @@ async function handleConfirm() {
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
let data = cloneDeep(await formApi.getValues());
if (userInfo) {
if (!isUpdate.value) {
data.userName = userInfo.userName
data.phone = userInfo.phone
data.gender = userInfo.gender
}
if(unitName.value){
data.unitName = unitName.value
}
await (isUpdate.value ? personUpdate(data) : personAdd(data));
@@ -128,7 +125,7 @@ function getUnitInfo(unit: { name: string }) {
<QueryUserList @update:userInfo="getUserInfo" v-bind="slotProps" :isUpdate="isUpdate" :userId="userId"/>
</template>
<template #unitId="slotProps">
<QueryUnitList @update:unitInfo="getUnitInfo" v-bind="slotProps" :isUpdate="isUpdate" :unitId="unitId"/>
<QueryUnitList @update:unitInfo="getUnitInfo" v-bind="slotProps" :disabled="isUpdate"/>
</template>
</BasicForm>
</BasicModal>

View File

@@ -1,20 +1,13 @@
<script lang="ts" setup>
import {ref, watch} from 'vue';
import {ref} from 'vue';
import {Select} from 'ant-design-vue';
import {resident_unitList,resident_unitInfo} from "#/api/property/resident/unit";
import {resident_unitList} from "#/api/property/resident/unit";
defineOptions({name: 'QueryUnitList'});
const props= withDefaults(defineProps<{
disabled?: boolean;
placeholder?: string;
isUpdate?:boolean;
unitId?:string;
}>(), {
withDefaults(defineProps<{ disabled?: boolean; placeholder?: string }>(), {
disabled: false,
placeholder: '可根据单位名称进行搜索...',
isUpdate:false,
unitId:'',
});
async function queryUnit(value: string, callback: any) {
@@ -22,14 +15,11 @@ async function queryUnit(value: string, callback: any) {
name: value,
pageSize: 100,
pageNum: 1,
state:1,
}
const res = await resident_unitList(queryData);
const options = res.rows.map((unit) => ({
label: unit.name+'-'+unit.id,
value: unit.id,
name:unit.name,
unitNumber:unit.unitNumber,
}));
callback(options);
}
@@ -42,33 +32,19 @@ const handleSearch = (val: string) => {
const emit = defineEmits(['update:unitInfo']);
const handleChange = (val: string) => {
value.value = val;
const unitInfo = data.value.find(option => option.value === val);
const unitInfoStr = data.value.find(option => option.value === val)?.label;
let arr = unitInfoStr.split('-')
let unitInfo = {
name: arr[0],
unitNumber: arr[1],
}
emit('update:unitInfo', unitInfo);
};
async function getUnitInfo(val) {
const unit = await resident_unitInfo(val)
if (unit) {
data.value = [{
label: unit.name+'-'+unit.id,
value: unit.id,
name:unit.name,
unitNumber:unit.id,
}]
}
}
watch(() => props.unitId,
(newX) => {
if (props.isUpdate) {
getUnitInfo(newX)
}
}, {immediate: true})
</script>
<template>
<!-- v-model:value="value"-->
<Select
v-model="value"
show-search
:placeholder="placeholder"
style="width: 100%"

View File

@@ -17,10 +17,10 @@ const props = withDefaults(defineProps<{
isUpdate: false,
userId: 0
});
watch(() => props.userId,
watch(() => props.isUpdate,
(newX) => {
if (props.isUpdate) {
getUserInfo(newX)
if (newX) {
getUserInfo()
}
}, {immediate: true})
@@ -50,33 +50,30 @@ const handleSearch = (val: string) => {
};
const emit = defineEmits(['update:userInfo']);
const handleChange = (val: string) => {
value.value = val;
// value.value = val;
const userInfo = data.value.find(option => option.value === val);
queryUser(val, (d: any[]) => (data.value = d));
emit('update:userInfo', userInfo);
};
async function getUserInfo(val) {
if (!val) return;
const res = await findUserInfo(val)
const user = res.user
if (user) {
data.value = [{
// label: user.nickName + '-' + renderDictValue(user.sex, 'sys_user_sex') + '-' + user.phonenumber,
label: user.nickName + '-' + user.phonenumber,
async function getUserInfo() {
console.log(value.value, '=============value')
const user = await (await findUserInfo(value.value)).user
console.log(user, '=================ss')
if(user){
data.value=[{
label: user.nickName + '-' + renderDictValue(user.sex, 'sys_user_sex') + '-' + user.phonenumber,
value: user.userId,
userName: user.userName,
gender: user.sex,
phone: user.phonenumber,
}]
emit('update:userInfo', data.value[0]);
}
}
</script>
<template>
<Select
:disabled="isUpdate"
v-model="value"
show-search
:placeholder="placeholder"

View File

@@ -0,0 +1,171 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
import {getDictOptions} from "#/utils/dict";
export const querySchema: FormSchemaGetter = () => [
{
component: 'Select',
fieldName: 'floorCode',
label: '所属小区',
},
{
component: 'Select',
fieldName: 'floorCode1',
label: '所属建筑',
},
{
component: 'Select',
fieldName: 'floorCode2',
label: '所属单元',
},
{
component: 'Select',
fieldName: 'floorCode3',
label: '所属楼层',
},
{
component: 'Input',
fieldName: 'roomCode',
label: '房间编码',
},
{
component: 'Input',
fieldName: 'roomNumber',
label: '房间号',
},
{
component: 'Select',
componentProps: {
options: getDictOptions('room_type'),
},
fieldName: 'roomType',
label: '房间类型',
},
{
component: 'Select',
componentProps: {
options: getDictOptions('wy_fjzt'),
},
fieldName: 'status',
label: '房间状态',
},
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '所属楼层ID',
field: 'floorCode',
},
{
title: '房间编码',
field: 'roomCode',
},
{
title: '房间号',
field: 'roomNumber',
},
{
title: '房间类型',
field: 'roomType',
},
{
title: '面积(㎡)',
field: 'area',
},
{
title: '户型',
field: 'layout',
},
{
title: '朝向',
field: 'orientation',
},
{
title: '是否可售',
field: 'isForSale',
},
{
title: '状态',
field: 'status',
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '主键',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
label: '所属楼层ID',
fieldName: 'floorCode',
component: 'Input',
rules: 'required',
},
{
label: '房间编码',
fieldName: 'roomCode',
component: 'Input',
rules: 'required',
},
{
label: '房间号(如101,202)',
fieldName: 'roomNumber',
component: 'Input',
rules: 'required',
},
{
label: '房间类型',
fieldName: 'roomType',
component: 'Select',
componentProps: {
options: getDictOptions('room_type'),
},
},
{
label: '面积(平方米)',
fieldName: 'area',
component: 'Input',
},
{
label: '户型(如2室1厅1卫)',
fieldName: 'layout',
component: 'Input',
},
{
label: '朝向',
fieldName: 'orientation',
component: 'Select',
componentProps: {
options: getDictOptions('direction_towards'),
},
},
{
label: '是否可售',
fieldName: 'isForSale',
component: 'Input',
},
{
label: '房间状态',
fieldName: 'status',
component: 'Select',
componentProps: {
options: getDictOptions('wy_fjzt'),
},
},
];

View File

@@ -0,0 +1,182 @@
<script setup lang="ts">
import type { Recordable } from '@vben/types';
import { ref } from 'vue';
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import dayjs from 'dayjs';
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
} from '#/adapter/vxe-table';
import {
roomExport,
roomList,
roomRemove,
} from '#/api/property/room';
import type { RoomForm } from '#/api/property/room/model';
import { commonDownloadExcel } from '#/utils/file/download';
import roomModal from './room-modal.vue';
import { columns, querySchema } from './data';
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
componentProps: {
allowClear: true,
},
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
// 不需要直接删除
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
};
const gridOptions: VxeGridProps = {
checkboxConfig: {
// 高亮
highlight: true,
// 翻页时保留选中状态
reserve: true,
// 点击行选中
// trigger: 'row',
},
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// columns: columns(),
columns,
height: 'auto',
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues = {}) => {
return await roomList({
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
},
// 表格全局唯一表示 保存列配置需要用到
id: 'property-room-index'
};
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
});
const [RoomModal, modalApi] = useVbenModal({
connectedComponent: roomModal,
});
function handleAdd() {
modalApi.setData({});
modalApi.open();
}
async function handleEdit(row: Required<RoomForm>) {
modalApi.setData({ id: row.id });
modalApi.open();
}
async function handleDelete(row: Required<RoomForm>) {
await roomRemove(row.id);
await tableApi.query();
}
function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords();
const ids = rows.map((row: Required<RoomForm>) => row.id);
Modal.confirm({
title: '提示',
okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await roomRemove(ids);
await tableApi.query();
},
});
}
function handleDownloadExcel() {
commonDownloadExcel(roomExport, '房间信息数据', tableApi.formApi.form.values, {
fieldMappingTime: formOptions.fieldMappingTime,
});
}
</script>
<template>
<Page :auto-content-height="true">
<BasicTable table-title="房间信息列表">
<template #toolbar-tools>
<Space>
<a-button
v-access:code="['property:room:export']"
@click="handleDownloadExcel"
>
{{ $t('pages.common.export') }}
</a-button>
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['property:room:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }}
</a-button>
<a-button
type="primary"
v-access:code="['property:room:add']"
@click="handleAdd"
>
{{ $t('pages.common.add') }}
</a-button>
</Space>
</template>
<template #action="{ row }">
<Space>
<ghost-button
v-access:code="['property:room:edit']"
@click.stop="handleEdit(row)"
>
{{ $t('pages.common.edit') }}
</ghost-button>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认删除?"
@confirm="handleDelete(row)"
>
<ghost-button
danger
v-access:code="['property:room:remove']"
@click.stop=""
>
{{ $t('pages.common.delete') }}
</ghost-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<RoomModal @reload="tableApi.query()" />
</Page>
</template>

View File

@@ -0,0 +1,101 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import { roomAdd, roomInfo, roomUpdate } from '#/api/property/room';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
});
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
// 默认占满两列
formItemClass: 'col-span-2',
// 默认label宽度 px
labelWidth: 80,
// 通用配置项 会影响到所有表单项
componentProps: {
class: 'w-full',
}
},
schema: modalSchema(),
showDefaultActions: false,
wrapperClass: 'grid-cols-2',
});
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
},
);
const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度
class: 'w-[550px]',
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
onConfirm: handleConfirm,
onOpenChange: async (isOpen) => {
if (!isOpen) {
return null;
}
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await roomInfo(id);
await formApi.setValues(record);
}
await markInitialized();
modalApi.modalLoading(false);
},
});
async function handleConfirm() {
try {
modalApi.lock(true);
const { valid } = await formApi.validate();
if (!valid) {
return;
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues());
await (isUpdate.value ? roomUpdate(data) : roomAdd(data));
resetInitialized();
emit('reload');
modalApi.close();
} catch (error) {
console.error(error);
} finally {
modalApi.lock(false);
}
}
async function handleClosed() {
await formApi.resetForm();
resetInitialized();
}
</script>
<template>
<BasicModal :title="title">
<BasicForm />
</BasicModal>
</template>

View File

@@ -0,0 +1,118 @@
import type { FormSchemaGetter } from '#/adapter/form';
import type { VxeGridProps } from '#/adapter/vxe-table';
export const querySchema: FormSchemaGetter = () => [
{
component: 'Input',
fieldName: 'buildingCode',
label: '建筑名称',
},
{
component: 'Input',
fieldName: 'unitCode',
label: '单元编码',
},
{
component: 'Input',
fieldName: 'unitName',
label: '单元名称',
},
{
component: 'Input',
fieldName: 'floorCount',
label: '单元层数',
},
{
component: 'Input',
fieldName: 'householdCount',
label: '单元户数',
},
{
component: 'Input',
fieldName: 'stairCount',
label: '楼梯数量',
},
];
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// export const columns: () => VxeGridProps['columns'] = () => [
export const columns: VxeGridProps['columns'] = [
{ type: 'checkbox', width: 60 },
{
title: '建筑名称',
field: 'buildingCode',
},
{
title: '单元编码',
field: 'unitCode',
},
{
title: '单元名称',
field: 'unitName',
},
{
title: '单元层数',
field: 'floorCount',
},
{
title: '单元户数',
field: 'householdCount',
},
{
title: '楼梯数量',
field: 'stairCount',
},
{
field: 'action',
fixed: 'right',
slots: { default: 'action' },
title: '操作',
width: 180,
},
];
export const modalSchema: FormSchemaGetter = () => [
{
label: '主键id',
fieldName: 'id',
component: 'Input',
dependencies: {
show: () => false,
triggerFields: [''],
},
},
{
label: '建筑名称',
fieldName: 'buildingCode',
component: 'Input',
rules: 'required',
},
{
label: '单元编码',
fieldName: 'unitCode',
component: 'Input',
rules: 'required',
},
{
label: '单元名称',
fieldName: 'unitName',
component: 'Input',
rules: 'required',
},
{
label: '单元层数',
fieldName: 'floorCount',
component: 'Input',
},
{
label: '单元户数',
fieldName: 'householdCount',
component: 'Input',
},
{
label: '楼梯数量',
fieldName: 'stairCount',
component: 'Input',
},
];

View File

@@ -0,0 +1,182 @@
<script setup lang="ts">
import type { Recordable } from '@vben/types';
import { ref } from 'vue';
import { Page, useVbenModal, type VbenFormProps } from '@vben/common-ui';
import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import dayjs from 'dayjs';
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
} from '#/adapter/vxe-table';
import {
unitExport,
unitList,
unitRemove,
} from '#/api/property/unit';
import type { UnitForm } from '#/api/property/unit/model';
import { commonDownloadExcel } from '#/utils/file/download';
import unitModal from './unit-modal.vue';
import { columns, querySchema } from './data';
const formOptions: VbenFormProps = {
commonConfig: {
labelWidth: 80,
componentProps: {
allowClear: true,
},
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
// 不需要直接删除
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
};
const gridOptions: VxeGridProps = {
checkboxConfig: {
// 高亮
highlight: true,
// 翻页时保留选中状态
reserve: true,
// 点击行选中
// trigger: 'row',
},
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// columns: columns(),
columns,
height: 'auto',
keepSource: true,
pagerConfig: {},
proxyConfig: {
ajax: {
query: async ({ page }, formValues = {}) => {
return await unitList({
pageNum: page.currentPage,
pageSize: page.pageSize,
...formValues,
});
},
},
},
rowConfig: {
keyField: 'id',
},
// 表格全局唯一表示 保存列配置需要用到
id: 'property-unit-index'
};
const [BasicTable, tableApi] = useVbenVxeGrid({
formOptions,
gridOptions,
});
const [UnitModal, modalApi] = useVbenModal({
connectedComponent: unitModal,
});
function handleAdd() {
modalApi.setData({});
modalApi.open();
}
async function handleEdit(row: Required<UnitForm>) {
modalApi.setData({ id: row.id });
modalApi.open();
}
async function handleDelete(row: Required<UnitForm>) {
await unitRemove(row.id);
await tableApi.query();
}
function handleMultiDelete() {
const rows = tableApi.grid.getCheckboxRecords();
const ids = rows.map((row: Required<UnitForm>) => row.id);
Modal.confirm({
title: '提示',
okType: 'danger',
content: `确认删除选中的${ids.length}条记录吗?`,
onOk: async () => {
await unitRemove(ids);
await tableApi.query();
},
});
}
function handleDownloadExcel() {
commonDownloadExcel(unitExport, '单元数据', tableApi.formApi.form.values, {
fieldMappingTime: formOptions.fieldMappingTime,
});
}
</script>
<template>
<Page :auto-content-height="true">
<BasicTable table-title="单元列表">
<template #toolbar-tools>
<Space>
<a-button
v-access:code="['property:unit:export']"
@click="handleDownloadExcel"
>
{{ $t('pages.common.export') }}
</a-button>
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['property:unit:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }}
</a-button>
<a-button
type="primary"
v-access:code="['property:unit:add']"
@click="handleAdd"
>
{{ $t('pages.common.add') }}
</a-button>
</Space>
</template>
<template #action="{ row }">
<Space>
<ghost-button
v-access:code="['property:unit:edit']"
@click.stop="handleEdit(row)"
>
{{ $t('pages.common.edit') }}
</ghost-button>
<Popconfirm
:get-popup-container="getVxePopupContainer"
placement="left"
title="确认删除?"
@confirm="handleDelete(row)"
>
<ghost-button
danger
v-access:code="['property:unit:remove']"
@click.stop=""
>
{{ $t('pages.common.delete') }}
</ghost-button>
</Popconfirm>
</Space>
</template>
</BasicTable>
<UnitModal @reload="tableApi.query()" />
</Page>
</template>

View File

@@ -0,0 +1,101 @@
<script setup lang="ts">
import { computed, ref } from 'vue';
import { useVbenModal } from '@vben/common-ui';
import { $t } from '@vben/locales';
import { cloneDeep } from '@vben/utils';
import { useVbenForm } from '#/adapter/form';
import { unitAdd, unitInfo, unitUpdate } from '#/api/property/unit';
import { defaultFormValueGetter, useBeforeCloseDiff } from '#/utils/popup';
import { modalSchema } from './data';
const emit = defineEmits<{ reload: [] }>();
const isUpdate = ref(false);
const title = computed(() => {
return isUpdate.value ? $t('pages.common.edit') : $t('pages.common.add');
});
const [BasicForm, formApi] = useVbenForm({
commonConfig: {
// 默认占满两列
formItemClass: 'col-span-2',
// 默认label宽度 px
labelWidth: 80,
// 通用配置项 会影响到所有表单项
componentProps: {
class: 'w-full',
}
},
schema: modalSchema(),
showDefaultActions: false,
wrapperClass: 'grid-cols-2',
});
const { onBeforeClose, markInitialized, resetInitialized } = useBeforeCloseDiff(
{
initializedGetter: defaultFormValueGetter(formApi),
currentGetter: defaultFormValueGetter(formApi),
},
);
const [BasicModal, modalApi] = useVbenModal({
// 在这里更改宽度
class: 'w-[550px]',
fullscreenButton: false,
onBeforeClose,
onClosed: handleClosed,
onConfirm: handleConfirm,
onOpenChange: async (isOpen) => {
if (!isOpen) {
return null;
}
modalApi.modalLoading(true);
const { id } = modalApi.getData() as { id?: number | string };
isUpdate.value = !!id;
if (isUpdate.value && id) {
const record = await unitInfo(id);
await formApi.setValues(record);
}
await markInitialized();
modalApi.modalLoading(false);
},
});
async function handleConfirm() {
try {
modalApi.lock(true);
const { valid } = await formApi.validate();
if (!valid) {
return;
}
// getValues获取为一个readonly的对象 需要修改必须先深拷贝一次
const data = cloneDeep(await formApi.getValues());
await (isUpdate.value ? unitUpdate(data) : unitAdd(data));
resetInitialized();
emit('reload');
modalApi.close();
} catch (error) {
console.error(error);
} finally {
modalApi.lock(false);
}
}
async function handleClosed() {
await formApi.resetForm();
resetInitialized();
}
</script>
<template>
<BasicModal :title="title">
<BasicForm />
</BasicModal>
</template>

View File

@@ -9,10 +9,10 @@ import { getVxePopupContainer } from '@vben/utils';
import { Modal, Popconfirm, Space } from 'ant-design-vue';
import dayjs from 'dayjs';
import {
import {
useVbenVxeGrid,
vxeCheckboxChecked,
type VxeGridProps
type VxeGridProps
} from '#/adapter/vxe-table';
import {
@@ -35,15 +35,6 @@ const formOptions: VbenFormProps = {
},
schema: querySchema(),
wrapperClass: 'grid-cols-1 md:grid-cols-2 lg:grid-cols-3 xl:grid-cols-4',
// 处理区间选择器RangePicker时间格式 将一个字段映射为两个字段 搜索/导出会用到
// 不需要直接删除
// fieldMappingTime: [
// [
// 'createTime',
// ['params[beginTime]', 'params[endTime]'],
// ['YYYY-MM-DD 00:00:00', 'YYYY-MM-DD 23:59:59'],
// ],
// ],
};
const gridOptions: VxeGridProps = {
@@ -55,7 +46,6 @@ const gridOptions: VxeGridProps = {
// 点击行选中
// trigger: 'row',
},
// 需要使用i18n注意这里要改成getter形式 否则切换语言不会刷新
// columns: columns(),
columns,
height: 'auto',
@@ -138,8 +128,8 @@ function handleDownloadExcel() {
<a-button
:disabled="!vxeCheckboxChecked(tableApi)"
danger
type="primary"
v-access:code="['property:visitorManagement:remove']"
type="primary"
v-access:code="['property:visitorManagement:remove']"
@click="handleMultiDelete">
{{ $t('pages.common.delete') }}
</a-button>

View File

@@ -28,7 +28,8 @@ export default defineConfig(async () => {
rewrite: (path) => path.replace(/^\/api/, ''),
// mock代理目标地址
// target: 'http://by.missmoc.top:3010/',
target: 'http://127.0.0.1:8080/',
// target: 'http://127.0.0.1:8080/',
target: 'http://47.109.37.87:3010',
ws: true,
},
},

View File

@@ -18,6 +18,7 @@ export const DictEnum = {
SIS_ACCESS_CONTROL_DEVICE_TYPE: 'sis_access_control_device_type',
SIS_LIB_TYPE: 'sis_lib_type',
WY_ZCSHZT: 'wy_zcshzt',
} as const;
export type DictEnumKey = keyof typeof DictEnum;