发版 #1

Merged
yangting merged 10 commits from develop into main 2025-09-05 09:13:56 +08:00
28 changed files with 2065 additions and 1004 deletions
Showing only changes of commit 8f9c9fc6a1 - Show all commits

View File

@ -16,7 +16,7 @@ export default defineConfig({
'/api/': { '/api/': {
// target: 'http://yt:8003', // target: 'http://yt:8003',
target: 'http://10.39.13.80:8001', target: 'http://10.39.13.80:8001',
// target: 'https://weapp-api.linyikj.com.cn/', // target: 'https://test-admin.linyikj.com.cn/',
// target: 'http://we6f9c65.natappfree.cc', // target: 'http://we6f9c65.natappfree.cc',
// target: 'https://loanos-test.nchl.net/', // target: 'https://loanos-test.nchl.net/',
changeOrigin: true, changeOrigin: true,

View File

@ -5,6 +5,7 @@ import {
ProFormText, ProFormText,
} from '@ant-design/pro-components'; } from '@ant-design/pro-components';
import { rulesHelper } from '@/common';
import { DefaultOptionType } from 'antd/es/cascader'; import { DefaultOptionType } from 'antd/es/cascader';
import data from './city.json'; import data from './city.json';
const request = async () => Promise.resolve(data as Record<string, any>[]); const request = async () => Promise.resolve(data as Record<string, any>[]);
@ -45,9 +46,9 @@ export const Address = {
return accumulator; return accumulator;
}, {} as Record<string, string>); }, {} as Record<string, string>);
}, },
// formItemProps: { formItemProps: {
// ...(required ? rulesHelper.array : {}), ...(required ? rulesHelper.array : {}),
// }, },
fieldProps: { fieldProps: {
showSearch: true, showSearch: true,
changeOnSelect: true, changeOnSelect: true,

View File

@ -122,6 +122,7 @@ declare namespace ApiTypes {
"asset_units_id"?: number; // 所属单元id,[ref:asset_units] "asset_units_id"?: number; // 所属单元id,[ref:asset_units]
"name"?: string; // 模糊搜索:名称 "name"?: string; // 模糊搜索:名称
"full_name"?: string; // 模糊搜索:全称 "full_name"?: string; // 模糊搜索:全称
"project_name"?: string; // 模糊搜索:项目名称
}; };
type Store = { type Store = {
"asset_projects_id": number; // 所属项目id,[ref:asset_projects] "asset_projects_id": number; // 所属项目id,[ref:asset_projects]
@ -844,6 +845,9 @@ declare namespace ApiTypes {
"house_charge_standards_id": number; // 房屋收费标准id,[ref:house_charge_standards] "house_charge_standards_id": number; // 房屋收费标准id,[ref:house_charge_standards]
"houses_ids": string[]; // 房屋id,[ref:houses] "houses_ids": string[]; // 房屋id,[ref:houses]
}; };
type GetChargeStandardHouseIds = {
"house_charge_standards_id": number; // 房屋收费标准id,[ref:house_charge_standards]
};
type Show = { type Show = {
"id": number; // id "id": number; // id
}; };
@ -854,6 +858,11 @@ declare namespace ApiTypes {
namespace HouseChargeStandards { namespace HouseChargeStandards {
type List = { type List = {
"name"?: string; // 模糊搜索:名称 "name"?: string; // 模糊搜索:名称
"project_name"?: string; // 模糊搜索:项目名称
"company_name"?: string; // 模糊搜索:机构名称
"charge_type"?: string; // 收费类型,[enum:HouseBillsTypeEnum]
"asset_projects_id"?: number; // 项目id,[ref:asset_projects]
"companies_id"?: number; // 机构id,[ref:companies]
}; };
type Store = { type Store = {
"asset_projects_id": number; // 项目id,[ref:asset_projects] "asset_projects_id": number; // 项目id,[ref:asset_projects]

View File

@ -503,6 +503,9 @@ export const Apis = {
Store(data: ApiTypes.HouseCharage.HouseChargeHasHouses.Store): Promise<MyResponseType> { Store(data: ApiTypes.HouseCharage.HouseChargeHasHouses.Store): Promise<MyResponseType> {
return request('admin/house_charage/house_charge_has_houses/store', { data }); return request('admin/house_charage/house_charge_has_houses/store', { data });
}, },
GetChargeStandardHouseIds(data: ApiTypes.HouseCharage.HouseChargeHasHouses.GetChargeStandardHouseIds): Promise<MyResponseType> {
return request('admin/house_charage/house_charge_has_houses/get_charge_standard_house_ids', { data });
},
Show(data: ApiTypes.HouseCharage.HouseChargeHasHouses.Show): Promise<MyResponseType> { Show(data: ApiTypes.HouseCharage.HouseChargeHasHouses.Show): Promise<MyResponseType> {
return request('admin/house_charage/house_charge_has_houses/show', { data }); return request('admin/house_charage/house_charge_has_houses/show', { data });
}, },

View File

@ -1,460 +1,616 @@
// AssetHousesOrientationEnum // AssetHousesOrientationEnum
export const AssetHousesOrientationEnum = { export const AssetHousesOrientationEnum = {
'East': {"text":"东","color":"#007bff","value":"East"}, East: { text: '东', color: '#007bff', value: 'East' },
'South': {"text":"南","color":"#28a745","value":"South"}, South: { text: '南', color: '#28a745', value: 'South' },
'West': {"text":"西","color":"#ffc107","value":"West"}, West: { text: '西', color: '#ffc107', value: 'West' },
'North': {"text":"北","color":"#dc3545","value":"North"}, North: { text: '北', color: '#dc3545', value: 'North' },
'Southeast': {"text":"东南","color":"#20c997","value":"Southeast"}, Southeast: { text: '东南', color: '#20c997', value: 'Southeast' },
'Northeast': {"text":"东北","color":"#6f42c1","value":"Northeast"}, Northeast: { text: '东北', color: '#6f42c1', value: 'Northeast' },
'Southwest': {"text":"西南","color":"#fd7e14","value":"Southwest"}, Southwest: { text: '西南', color: '#fd7e14', value: 'Southwest' },
'Northwest': {"text":"西北","color":"#17a2b8","value":"Northwest"}, Northwest: { text: '西北', color: '#17a2b8', value: 'Northwest' },
'EastWest': {"text":"东西","color":"#6610f2","value":"EastWest"}, EastWest: { text: '东西', color: '#6610f2', value: 'EastWest' },
'SouthNorth': {"text":"南北","color":"#e83e8c","value":"SouthNorth"}, SouthNorth: { text: '南北', color: '#e83e8c', value: 'SouthNorth' },
}; };
// AssetHousesOwnershipTypeEnum // AssetHousesOwnershipTypeEnum
export const AssetHousesOwnershipTypeEnum = { export const AssetHousesOwnershipTypeEnum = {
'CommodityHousing': {"text":"商品房","color":"#007bff","value":"CommodityHousing"}, CommodityHousing: {
'FundedHousing': {"text":"集资房","color":"#28a745","value":"FundedHousing"}, text: '商品房',
'MilitaryHousing': {"text":"军产房","color":"#17a2b8","value":"MilitaryHousing"}, color: '#007bff',
'AffordableHousing': {"text":"保障房","color":"#ffc107","value":"AffordableHousing"}, value: 'CommodityHousing',
'RuralHousing': {"text":"农民房","color":"#6f42c1","value":"RuralHousing"}, },
'CommercialOffice': {"text":"商业写字楼","color":"#fd7e14","value":"CommercialOffice"}, FundedHousing: { text: '集资房', color: '#28a745', value: 'FundedHousing' },
'CommercialComplex': {"text":"商业综合体","color":"#dc3545","value":"CommercialComplex"}, MilitaryHousing: {
'ResettlementHousing': {"text":"回迁房","color":"#20c997","value":"ResettlementHousing"}, text: '军产房',
color: '#17a2b8',
value: 'MilitaryHousing',
},
AffordableHousing: {
text: '保障房',
color: '#ffc107',
value: 'AffordableHousing',
},
RuralHousing: { text: '农民房', color: '#6f42c1', value: 'RuralHousing' },
CommercialOffice: {
text: '商业写字楼',
color: '#fd7e14',
value: 'CommercialOffice',
},
CommercialComplex: {
text: '商业综合体',
color: '#dc3545',
value: 'CommercialComplex',
},
ResettlementHousing: {
text: '回迁房',
color: '#20c997',
value: 'ResettlementHousing',
},
}; };
// AssetHousesPropertyOwnershipEnum // AssetHousesPropertyOwnershipEnum
export const AssetHousesPropertyOwnershipEnum = { export const AssetHousesPropertyOwnershipEnum = {
'Individual': {"text":"个人","color":"#2db7f5","value":"Individual"}, Individual: { text: '个人', color: '#2db7f5', value: 'Individual' },
'Enterprise': {"text":"企业","color":"#87d068","value":"Enterprise"}, Enterprise: { text: '企业', color: '#87d068', value: 'Enterprise' },
'Developer': {"text":"开发商","color":"#fa8c16","value":"Developer"}, Developer: { text: '开发商', color: '#fa8c16', value: 'Developer' },
'Government': {"text":"政府","color":"#f5222d","value":"Government"}, Government: { text: '政府', color: '#f5222d', value: 'Government' },
}; };
// AssetHousesStatusEnum // AssetHousesStatusEnum
export const AssetHousesStatusEnum = { export const AssetHousesStatusEnum = {
'Unsold': {"text":"未售","color":"#6c757d","value":"Unsold"}, Unsold: { text: '未售', color: '#6c757d', value: 'Unsold' },
'SoldNotDelivered': {"text":"已售未交房","color":"#ffc107","value":"SoldNotDelivered"}, SoldNotDelivered: {
'SelfOccupied': {"text":"自住","color":"#28a745","value":"SelfOccupied"}, text: '已售未交房',
'Rented': {"text":"出租","color":"#007bff","value":"Rented"}, color: '#ffc107',
'Vacant': {"text":"空置","color":"#dc3545","value":"Vacant"}, value: 'SoldNotDelivered',
},
SelfOccupied: { text: '自住', color: '#28a745', value: 'SelfOccupied' },
Rented: { text: '出租', color: '#007bff', value: 'Rented' },
Vacant: { text: '空置', color: '#dc3545', value: 'Vacant' },
}; };
// AssetHousesUsageEnum // AssetHousesUsageEnum
export const AssetHousesUsageEnum = { export const AssetHousesUsageEnum = {
'Residence': {"text":"住宅","color":"#007bff","value":"Residence"}, Residence: { text: '住宅', color: '#007bff', value: 'Residence' },
'Apartment': {"text":"公寓","color":"#28a745","value":"Apartment"}, Apartment: { text: '公寓', color: '#28a745', value: 'Apartment' },
'Villa': {"text":"别墅","color":"#17a2b8","value":"Villa"}, Villa: { text: '别墅', color: '#17a2b8', value: 'Villa' },
'Shop': {"text":"商铺","color":"#ffc107","value":"Shop"}, Shop: { text: '商铺', color: '#ffc107', value: 'Shop' },
'ParkingSpace': {"text":"车位","color":"#6c757d","value":"ParkingSpace"}, ParkingSpace: { text: '车位', color: '#6c757d', value: 'ParkingSpace' },
'Office': {"text":"写字楼","color":"#6610f2","value":"Office"}, Office: { text: '写字楼', color: '#6610f2', value: 'Office' },
'Clubhouse': {"text":"会所","color":"#fd7e14","value":"Clubhouse"}, Clubhouse: { text: '会所', color: '#fd7e14', value: 'Clubhouse' },
'PropertyRoom': {"text":"物业用房","color":"#dc3545","value":"PropertyRoom"}, PropertyRoom: { text: '物业用房', color: '#dc3545', value: 'PropertyRoom' },
}; };
// AssetProjectsChargeEnum // AssetProjectsChargeEnum
export const AssetProjectsChargeEnum = { export const AssetProjectsChargeEnum = {
'Contract': {"text":"包干制","color":"#007bff","value":"Contract"}, Contract: { text: '包干制', color: '#007bff', value: 'Contract' },
'Commission': {"text":"酬金制","color":"#28a745","value":"Commission"}, Commission: { text: '酬金制', color: '#28a745', value: 'Commission' },
}; };
// AssetProjectsEntrustTypeEnum // AssetProjectsEntrustTypeEnum
export const AssetProjectsEntrustTypeEnum = { export const AssetProjectsEntrustTypeEnum = {
'DeveloperJointEntrust': {"text":"开发商全委","color":"#007bff","value":"DeveloperJointEntrust"}, DeveloperJointEntrust: {
'OwnersFullEntrust': {"text":"业委会全委","color":"#28a745","value":"OwnersFullEntrust"}, text: '开发商全委',
'GovernmentFullEntrust': {"text":"政府类全委","color":"#ffc107","value":"GovernmentFullEntrust"}, color: '#007bff',
value: 'DeveloperJointEntrust',
},
OwnersFullEntrust: {
text: '业委会全委',
color: '#28a745',
value: 'OwnersFullEntrust',
},
GovernmentFullEntrust: {
text: '政府类全委',
color: '#ffc107',
value: 'GovernmentFullEntrust',
},
}; };
// AssetProjectsPropertyTypeEnum // AssetProjectsPropertyTypeEnum
export const AssetProjectsPropertyTypeEnum = { export const AssetProjectsPropertyTypeEnum = {
'Residence': {"text":"住宅","color":"#ff0000","value":"Residence"}, Residence: { text: '住宅', color: '#ff0000', value: 'Residence' },
'Commercial': {"text":"商业","color":"#ff6600","value":"Commercial"}, Commercial: { text: '商业', color: '#ff6600', value: 'Commercial' },
'Office': {"text":"办公","color":"#ffcc00","value":"Office"}, Office: { text: '办公', color: '#ffcc00', value: 'Office' },
'IndustrialPark': {"text":"产业园","color":"#00cc66","value":"IndustrialPark"}, IndustrialPark: { text: '产业园', color: '#00cc66', value: 'IndustrialPark' },
'Complex': {"text":"综合体","color":"#0099ff","value":"Complex"}, Complex: { text: '综合体', color: '#0099ff', value: 'Complex' },
'Municipal': {"text":"市政设施","color":"#6633cc","value":"Municipal"}, Municipal: { text: '市政设施', color: '#6633cc', value: 'Municipal' },
'Venue': {"text":"场馆","color":"#9966ff","value":"Venue"}, Venue: { text: '场馆', color: '#9966ff', value: 'Venue' },
'Education': {"text":"教育","color":"#339999","value":"Education"}, Education: { text: '教育', color: '#339999', value: 'Education' },
'Medical': {"text":"医疗","color":"#cc3366","value":"Medical"}, Medical: { text: '医疗', color: '#cc3366', value: 'Medical' },
}; };
// AssetProjectsStatusEnum // AssetProjectsStatusEnum
export const AssetProjectsStatusEnum = { export const AssetProjectsStatusEnum = {
'SignedNotDelivered': {"text":"签约未交付","color":"#6c757d","value":"SignedNotDelivered"}, SignedNotDelivered: {
'RollingDevelopment': {"text":"滚动开发","color":"#007bff","value":"RollingDevelopment"}, text: '签约未交付',
'ManagedAndClosed': {"text":"在管封园","color":"#ffc107","value":"ManagedAndClosed"}, color: '#6c757d',
'Exited': {"text":"退出","color":"#dc3545","value":"Exited"}, value: 'SignedNotDelivered',
},
RollingDevelopment: {
text: '滚动开发',
color: '#007bff',
value: 'RollingDevelopment',
},
ManagedAndClosed: {
text: '在管封园',
color: '#ffc107',
value: 'ManagedAndClosed',
},
Exited: { text: '退出', color: '#dc3545', value: 'Exited' },
}; };
// AssetUnitsBuildingStructureEnum // AssetUnitsBuildingStructureEnum
export const AssetUnitsBuildingStructureEnum = { export const AssetUnitsBuildingStructureEnum = {
'SteelConcrete': {"text":"钢混","color":"#007bff","value":"SteelConcrete"}, SteelConcrete: { text: '钢混', color: '#007bff', value: 'SteelConcrete' },
'SteelStructure': {"text":"钢结构","color":"#28a745","value":"SteelStructure"}, SteelStructure: { text: '钢结构', color: '#28a745', value: 'SteelStructure' },
'BrickConcrete': {"text":"砖混","color":"#ffc107","value":"BrickConcrete"}, BrickConcrete: { text: '砖混', color: '#ffc107', value: 'BrickConcrete' },
'BrickWood': {"text":"砖木","color":"#dc3545","value":"BrickWood"}, BrickWood: { text: '砖木', color: '#dc3545', value: 'BrickWood' },
}; };
// AssetUnitsBuildingTypeEnum // AssetUnitsBuildingTypeEnum
export const AssetUnitsBuildingTypeEnum = { export const AssetUnitsBuildingTypeEnum = {
'SlabAndTower': {"text":"板塔结合","color":"#007bff","value":"SlabAndTower"}, SlabAndTower: { text: '板塔结合', color: '#007bff', value: 'SlabAndTower' },
'Slab': {"text":"板楼","color":"#28a745","value":"Slab"}, Slab: { text: '板楼', color: '#28a745', value: 'Slab' },
'Tower': {"text":"塔楼","color":"#ffc107","value":"Tower"}, Tower: { text: '塔楼', color: '#ffc107', value: 'Tower' },
}; };
// BannerSpacesTypeEnum // BannerSpacesTypeEnum
export const BannerSpacesTypeEnum = { export const BannerSpacesTypeEnum = {
'Popup': {"text":"弹窗","color":"#ff0000","value":"Popup"}, Popup: { text: '弹窗', color: '#ff0000', value: 'Popup' },
'Banner': {"text":"横幅广告","color":"#00ff00","value":"Banner"}, Banner: { text: '横幅广告', color: '#00ff00', value: 'Banner' },
'FloatingButton': {"text":"悬浮按钮","color":"#0000ff","value":"FloatingButton"}, FloatingButton: {
text: '悬浮按钮',
color: '#0000ff',
value: 'FloatingButton',
},
}; };
// BannersRedirectTypeEnum // BannersRedirectTypeEnum
export const BannersRedirectTypeEnum = { export const BannersRedirectTypeEnum = {
'InnerPage': {"text":"跳内页","color":"#ff0000","value":"InnerPage"}, InnerPage: { text: '跳内页', color: '#ff0000', value: 'InnerPage' },
'H5': {"text":"跳H5","color":"#00ff00","value":"H5"}, H5: { text: '跳H5', color: '#00ff00', value: 'H5' },
'MiniProgramHome': {"text":"跳小程序首屏","color":"#0000ff","value":"MiniProgramHome"}, MiniProgramHome: {
'AnotherMiniProgram': {"text":"跳另一个小程序","color":"#ffa500","value":"AnotherMiniProgram"}, text: '跳小程序首屏',
color: '#0000ff',
value: 'MiniProgramHome',
},
AnotherMiniProgram: {
text: '跳另一个小程序',
color: '#ffa500',
value: 'AnotherMiniProgram',
},
}; };
// BannersTypeEnum // BannersTypeEnum
export const BannersTypeEnum = { export const BannersTypeEnum = {
'Image': {"text":"图片","color":"#ff0000","value":"Image"}, Image: { text: '图片', color: '#ff0000', value: 'Image' },
'Video': {"text":"视频","color":"#00ff00","value":"Video"}, Video: { text: '视频', color: '#00ff00', value: 'Video' },
'Text': {"text":"文本","color":"#0000ff","value":"Text"}, Text: { text: '文本', color: '#0000ff', value: 'Text' },
}; };
// 缓存类型 // 缓存类型
export const CacheTypeEnum = { export const CacheTypeEnum = {
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#649200","value":"MobilePhoneVerificationCode"}, MobilePhoneVerificationCode: {
text: '手机验证码',
color: '#2432a3',
value: 'MobilePhoneVerificationCode',
},
}; };
// CompaniesMerchantTypeEnum // CompaniesMerchantTypeEnum
export const CompaniesMerchantTypeEnum = { export const CompaniesMerchantTypeEnum = {
'PropertyManagement': {"text":"物业公司","color":"#007bff","value":"PropertyManagement"}, PropertyManagement: {
'ServiceProvider': {"text":"服务商","color":"#28a745","value":"ServiceProvider"}, text: '物业公司',
color: '#007bff',
value: 'PropertyManagement',
},
ServiceProvider: {
text: '服务商',
color: '#28a745',
value: 'ServiceProvider',
},
}; };
// CompanyAppsAppTypeEnum // CompanyAppsAppTypeEnum
export const CompanyAppsAppTypeEnum = { export const CompanyAppsAppTypeEnum = {
'MiniProgram': {"text":"微信小程序","color":"#3b82f6","value":"MiniProgram"}, MiniProgram: { text: '微信小程序', color: '#3b82f6', value: 'MiniProgram' },
'MpOfficial': {"text":"微信公众号","color":"#22c55e","value":"MpOfficial"}, MpOfficial: { text: '微信公众号', color: '#22c55e', value: 'MpOfficial' },
'WorkWechat': {"text":"企业微信","color":"#6366f1","value":"WorkWechat"}, WorkWechat: { text: '企业微信', color: '#6366f1', value: 'WorkWechat' },
}; };
// CompanyAppsModuleEnum // CompanyAppsModuleEnum
export const CompanyAppsModuleEnum = { export const CompanyAppsModuleEnum = {
'Employee': {"text":"员工端","color":"#3b82f6","value":"Employee"}, Employee: { text: '员工端', color: '#3b82f6', value: 'Employee' },
'Customer': {"text":"客户端","color":"#10b981","value":"Customer"}, Customer: { text: '客户端', color: '#10b981', value: 'Customer' },
}; };
// CompanyEmployeeBacklogsStatusEnum // CompanyEmployeeBacklogsStatusEnum
export const CompanyEmployeeBacklogsStatusEnum = { export const CompanyEmployeeBacklogsStatusEnum = {
'Pending': {"text":"待办","color":"#FF6600","value":"Pending"}, Pending: { text: '待办', color: '#FF6600', value: 'Pending' },
'Completed': {"text":"已办","color":"#2A82E4","value":"Completed"}, Completed: { text: '已办', color: '#2A82E4', value: 'Completed' },
}; };
// CompanyEmployeeBacklogsTypeEnum // CompanyEmployeeBacklogsTypeEnum
export const CompanyEmployeeBacklogsTypeEnum = { export const CompanyEmployeeBacklogsTypeEnum = {
'WorkOrder': {"text":"工单","color":"#FF6600","value":"WorkOrder"}, WorkOrder: { text: '工单', color: '#FF6600', value: 'WorkOrder' },
'Contract': {"text":"合同","color":"#2A82E4","value":"Contract"}, Contract: { text: '合同', color: '#2A82E4', value: 'Contract' },
}; };
// CompanyReceiptAccountsPayChannelEnum // CompanyReceiptAccountsPayChannelEnum
export const CompanyReceiptAccountsPayChannelEnum = { export const CompanyReceiptAccountsPayChannelEnum = {
'WeChat': {"text":"微信","color":"#07c160","value":"WeChat"}, WeChat: { text: '微信', color: '#07c160', value: 'WeChat' },
'Alipay': {"text":"支付宝","color":"#1677ff","value":"Alipay"}, Alipay: { text: '支付宝', color: '#1677ff', value: 'Alipay' },
'BankTransfer': {"text":"银行转账","color":"#6c757d","value":"BankTransfer"}, BankTransfer: { text: '银行转账', color: '#6c757d', value: 'BankTransfer' },
'TongLian': {"text":"通联支付","color":"#ff9f0a","value":"TongLian"}, TongLian: { text: '通联支付', color: '#ff9f0a', value: 'TongLian' },
}; };
// CustomerBacklogsStatusEnum // CustomerBacklogsStatusEnum
export const CustomerBacklogsStatusEnum = { export const CustomerBacklogsStatusEnum = {
'Pending': {"text":"待办","color":"#faad14","value":"Pending"}, Pending: { text: '待办', color: '#faad14', value: 'Pending' },
'Completed': {"text":"已办","color":"#2A82E4","value":"Completed"}, Completed: { text: '已办', color: '#2A82E4', value: 'Completed' },
}; };
// CustomerBacklogsTypeEnum // CustomerBacklogsTypeEnum
export const CustomerBacklogsTypeEnum = { export const CustomerBacklogsTypeEnum = {
'RegisterApply': {"text":"登记申请","color":"#2db7f5","value":"RegisterApply"}, RegisterApply: { text: '登记申请', color: '#2db7f5', value: 'RegisterApply' },
'PaymentPending': {"text":"费用待缴","color":"#faad14","value":"PaymentPending"}, PaymentPending: {
'ContractTodo': {"text":"合同待办","color":"#722ed1","value":"ContractTodo"}, text: '费用待缴',
color: '#faad14',
value: 'PaymentPending',
},
ContractTodo: { text: '合同待办', color: '#722ed1', value: 'ContractTodo' },
}; };
// 账单状态枚举 // 账单状态枚举
export const HouseBillsBillStatusEnum = { export const HouseBillsBillStatusEnum = {
'PendingPayment': {"text":"待支付","color":"#facc15","value":"PendingPayment"}, PendingPayment: { text: '待支付', color: '#facc15', value: 'PendingPayment' },
'PartiallyPaid': {"text":"部分支付","color":"#60a5fa","value":"PartiallyPaid"}, PartiallyPaid: { text: '部分支付', color: '#60a5fa', value: 'PartiallyPaid' },
'Paid': {"text":"已支付","color":"#10b981","value":"Paid"}, Paid: { text: '已支付', color: '#10b981', value: 'Paid' },
'Overdue': {"text":"已逾期","color":"#ef4444","value":"Overdue"}, Overdue: { text: '已逾期', color: '#ef4444', value: 'Overdue' },
'Cancelled': {"text":"已取消","color":"#9ca3af","value":"Cancelled"}, Cancelled: { text: '已取消', color: '#9ca3af', value: 'Cancelled' },
}; };
// 房屋账单类型枚举 // 房屋账单类型枚举
export const HouseBillsTypeEnum = { export const HouseBillsTypeEnum = {
'PropertyFee': {"text":"物业费","color":"#3b82f6","value":"PropertyFee"}, PropertyFee: { text: '物业费', color: '#3b82f6', value: 'PropertyFee' },
'MaintenanceFund': {"text":"维修基金","color":"#10b981","value":"MaintenanceFund"}, MaintenanceFund: {
'WaterFee': {"text":"水费","color":"#06b6d4","value":"WaterFee"}, text: '维修基金',
'ElectricityFee': {"text":"电费","color":"#f59e0b","value":"ElectricityFee"}, color: '#10b981',
'SharedWaterFee': {"text":"公摊水费","color":"#8b5cf6","value":"SharedWaterFee"}, value: 'MaintenanceFund',
'SharedElectricityFee': {"text":"公摊电费","color":"#ec4899","value":"SharedElectricityFee"}, },
WaterFee: { text: '水费', color: '#06b6d4', value: 'WaterFee' },
ElectricityFee: { text: '电费', color: '#f59e0b', value: 'ElectricityFee' },
SharedWaterFee: {
text: '公摊水费',
color: '#8b5cf6',
value: 'SharedWaterFee',
},
SharedElectricityFee: {
text: '公摊电费',
color: '#ec4899',
value: 'SharedElectricityFee',
},
}; };
// HouseChargeStandardsApportionmentMethodEnum // HouseChargeStandardsApportionmentMethodEnum
export const HouseChargeStandardsApportionmentMethodEnum = { export const HouseChargeStandardsApportionmentMethodEnum = {
'HouseCount': {"text":"房屋数分摊","color":"#3b82f6","value":"HouseCount"}, HouseCount: { text: '房屋数分摊', color: '#3b82f6', value: 'HouseCount' },
'AreaProportion': {"text":"房屋计费面积分摊","color":"#10b981","value":"AreaProportion"}, AreaProportion: {
'FixedRatio': {"text":"按固定比例分摊","color":"#f59e0b","value":"FixedRatio"}, text: '房屋计费面积分摊',
color: '#10b981',
value: 'AreaProportion',
},
FixedRatio: { text: '按固定比例分摊', color: '#f59e0b', value: 'FixedRatio' },
}; };
// HouseChargeStandardsCalculationMethodEnum // HouseChargeStandardsCalculationMethodEnum
export const HouseChargeStandardsCalculationMethodEnum = { export const HouseChargeStandardsCalculationMethodEnum = {
'ChargeableArea': {"text":"计费面积","color":"#3b82f6","value":"ChargeableArea"}, ChargeableArea: {
'BuiltArea': {"text":"建筑面积","color":"#10b981","value":"BuiltArea"}, text: '计费面积',
'InsideArea': {"text":"套内面积","color":"#f59e0b","value":"InsideArea"}, color: '#3b82f6',
'PerUnit': {"text":"按套","color":"#06b6d4","value":"PerUnit"}, value: 'ChargeableArea',
'ElectricityUsage': {"text":"用电量","color":"#8b5cf6","value":"ElectricityUsage"}, },
'WaterUsage': {"text":"用水量","color":"#ec4899","value":"WaterUsage"}, BuiltArea: { text: '建筑面积', color: '#10b981', value: 'BuiltArea' },
InsideArea: { text: '套内面积', color: '#f59e0b', value: 'InsideArea' },
PerUnit: { text: '按套', color: '#06b6d4', value: 'PerUnit' },
ElectricityUsage: {
text: '用电量',
color: '#8b5cf6',
value: 'ElectricityUsage',
},
WaterUsage: { text: '用水量', color: '#ec4899', value: 'WaterUsage' },
}; };
// HouseChargeStandardsCalculationModeEnum // HouseChargeStandardsCalculationModeEnum
export const HouseChargeStandardsCalculationModeEnum = { export const HouseChargeStandardsCalculationModeEnum = {
'FixedAmount': {"text":"固定金额","color":"#3b82f6","value":"FixedAmount"}, FixedAmount: { text: '固定金额', color: '#3b82f6', value: 'FixedAmount' },
'QuantityPrice': {"text":"数量*单价","color":"#10b981","value":"QuantityPrice"}, QuantityPrice: {
text: '数量*单价',
color: '#10b981',
value: 'QuantityPrice',
},
}; };
// HouseChargeStandardsCalculationPeriodEnum // HouseChargeStandardsCalculationPeriodEnum
export const HouseChargeStandardsCalculationPeriodEnum = { export const HouseChargeStandardsCalculationPeriodEnum = {
'PerTime': {"text":"按次","color":"#3b82f6","value":"PerTime"}, PerTime: { text: '按次', color: '#3b82f6', value: 'PerTime' },
'PerDay': {"text":"按日","color":"#10b981","value":"PerDay"}, PerDay: { text: '按日', color: '#10b981', value: 'PerDay' },
'PerMonth': {"text":"按月","color":"#f59e0b","value":"PerMonth"}, PerMonth: { text: '按月', color: '#f59e0b', value: 'PerMonth' },
'PerYear': {"text":"按年","color":"#8b5cf6","value":"PerYear"}, PerYear: { text: '按年', color: '#8b5cf6', value: 'PerYear' },
}; };
// HouseChargeStandardsPriceAlgorithmEnum // HouseChargeStandardsPriceAlgorithmEnum
export const HouseChargeStandardsPriceAlgorithmEnum = { export const HouseChargeStandardsPriceAlgorithmEnum = {
'Fixed': {"text":"固定","color":"#4caf50","value":"Fixed"}, Fixed: { text: '固定', color: '#4caf50', value: 'Fixed' },
'Tiered': {"text":"分级价阶梯","color":"#2196f3","value":"Tiered"}, Tiered: { text: '分级价阶梯', color: '#2196f3', value: 'Tiered' },
'Peak': {"text":"最高价阶梯","color":"#ff9800","value":"Peak"}, Peak: { text: '最高价阶梯', color: '#ff9800', value: 'Peak' },
}; };
// HouseChargeStandardsStatusEnum // HouseChargeStandardsStatusEnum
export const HouseChargeStandardsStatusEnum = { export const HouseChargeStandardsStatusEnum = {
'Active': {"text":"启用","color":"#3b82f6","value":"Active"}, Active: { text: '启用', color: '#3b82f6', value: 'Active' },
'Inactive': {"text":"禁用","color":"#ef4444","value":"Inactive"}, Inactive: { text: '禁用', color: '#ef4444', value: 'Inactive' },
}; };
// HouseChargeStandardsTypeEnum // HouseChargeStandardsTypeEnum
export const HouseChargeStandardsTypeEnum = { export const HouseChargeStandardsTypeEnum = {
'House': {"text":"房屋","color":"#3b82f6","value":"House"}, House: { text: '房屋', color: '#3b82f6', value: 'House' },
'Meter': {"text":"仪表","color":"#10b981","value":"Meter"}, Meter: { text: '仪表', color: '#10b981', value: 'Meter' },
};
// HouseChargeTaskDetailsStatusEnum
export const HouseChargeTaskDetailsStatusEnum = {
Pending: { text: '待处理', color: '#f59e0b', value: 'Pending' },
Success: { text: '成功', color: '#22c55e', value: 'Success' },
Failed: { text: '失败', color: '#ef4444', value: 'Failed' },
}; };
// HouseChargeTasksStatusEnum // HouseChargeTasksStatusEnum
export const HouseChargeTasksStatusEnum = { export const HouseChargeTasksStatusEnum = {
'Pending': {"text":"待执行","color":"#f59e0b","value":"Pending"}, Pending: { text: '待执行', color: '#f59e0b', value: 'Pending' },
'InProgress': {"text":"执行中","color":"#3b82f6","value":"InProgress"}, InProgress: { text: '执行中', color: '#3b82f6', value: 'InProgress' },
'Completed': {"text":"已完成","color":"#10b981","value":"Completed"}, Completed: { text: '已完成', color: '#10b981', value: 'Completed' },
'Failed': {"text":"失败","color":"#ef4444","value":"Failed"}, Failed: { text: '失败', color: '#ef4444', value: 'Failed' },
};
// HouseChargeTasksTypeEnum
export const HouseChargeTasksTypeEnum = {
Scheduled: { text: '定时创建', color: '#3b82f6', value: 'Scheduled' },
Manual: { text: '手动创建', color: '#10b981', value: 'Manual' },
}; };
// HouseCollectionRecordsCollectionResultEnum // HouseCollectionRecordsCollectionResultEnum
export const HouseCollectionRecordsCollectionResultEnum = { export const HouseCollectionRecordsCollectionResultEnum = {
'PromiseToPay': {"text":"承诺缴费","color":"#4caf50","value":"PromiseToPay"}, PromiseToPay: { text: '承诺缴费', color: '#4caf50', value: 'PromiseToPay' },
'RefuseToPay': {"text":"拒绝缴费","color":"#f44336","value":"RefuseToPay"}, RefuseToPay: { text: '拒绝缴费', color: '#f44336', value: 'RefuseToPay' },
'NotReached': {"text":"未联系到","color":"#9e9e9e","value":"NotReached"}, NotReached: { text: '未联系到', color: '#9e9e9e', value: 'NotReached' },
'NeedFollowUp': {"text":"需要跟进","color":"#ff9800","value":"NeedFollowUp"}, NeedFollowUp: { text: '需要跟进', color: '#ff9800', value: 'NeedFollowUp' },
}; };
// HouseCollectionRecordsSmsStatusEnum // HouseCollectionRecordsSmsStatusEnum
export const HouseCollectionRecordsStatusEnum = { export const HouseCollectionRecordsStatusEnum = {
'NotNotified': {"text":"未通知","color":"#808080","value":"NotNotified"}, NotNotified: { text: '未通知', color: '#808080', value: 'NotNotified' },
'Notified': {"text":"已通知","color":"#00cc00","value":"Notified"}, Notified: { text: '已通知', color: '#00cc00', value: 'Notified' },
'Failed': {"text":"失败","color":"#ff0000","value":"Failed"}, Failed: { text: '失败', color: '#ff0000', value: 'Failed' },
}; };
// HouseCollectionTasksChannelEnum // HouseCollectionTasksChannelEnum
export const HouseCollectionTasksChannelEnum = { export const HouseCollectionTasksChannelEnum = {
'SMS': {"text":"短信","color":"#1E90FF","value":"SMS"}, SMS: { text: '短信', color: '#1E90FF', value: 'SMS' },
'MiniProgram': {"text":"小程序","color":"#00BFFF","value":"MiniProgram"}, MiniProgram: { text: '小程序', color: '#00BFFF', value: 'MiniProgram' },
'OfficialAccount': {"text":"公众号","color":"#32CD32","value":"OfficialAccount"}, OfficialAccount: {
'PhoneCall': {"text":"电话催缴","color":"#FF8C00","value":"PhoneCall"}, text: '公众号',
'Visit': {"text":"上门催缴","color":"#8B4513","value":"Visit"}, color: '#32CD32',
'WeChat': {"text":"微信联系","color":"#20B2AA","value":"WeChat"}, value: 'OfficialAccount',
'WrittenNotice': {"text":"书面通知","color":"#708090","value":"WrittenNotice"}, },
PhoneCall: { text: '电话催缴', color: '#FF8C00', value: 'PhoneCall' },
Visit: { text: '上门催缴', color: '#8B4513', value: 'Visit' },
WeChat: { text: '微信联系', color: '#20B2AA', value: 'WeChat' },
WrittenNotice: { text: '书面通知', color: '#708090', value: 'WrittenNotice' },
}; };
// HouseCollectionTasksStatusEnum // HouseCollectionTasksStatusEnum
export const HouseCollectionTasksStatusEnum = { export const HouseCollectionTasksStatusEnum = {
'Processing': {"text":"进行中","color":"#ffcc00","value":"Processing"}, Processing: { text: '进行中', color: '#ffcc00', value: 'Processing' },
'Completed': {"text":"已完成","color":"#00cc00","value":"Completed"}, Completed: { text: '已完成', color: '#00cc00', value: 'Completed' },
'Failed': {"text":"失败","color":"#ff0000","value":"Failed"}, Failed: { text: '失败', color: '#ff0000', value: 'Failed' },
}; };
// HouseOccupantsCardTypeEnum // HouseOccupantsCardTypeEnum
export const HouseOccupantsCardTypeEnum = { export const HouseOccupantsCardTypeEnum = {
'MainlandID': {"text":"中国大陆居民身份证","color":"#2db7f5","value":"MainlandID"}, MainlandID: {
'HKPermit': {"text":"香港来往大陆通行证(回乡证)","color":"#fa8c16","value":"HKPermit"}, text: '中国大陆居民身份证',
'MOPermit': {"text":"澳门来往大陆通行证(回乡证)","color":"#faad14","value":"MOPermit"}, color: '#2db7f5',
'TWPermit': {"text":"台湾来往大陆通行证(台胞证)","color":"#87d068","value":"TWPermit"}, value: 'MainlandID',
'Passport': {"text":"护照","color":"#108ee9","value":"Passport"}, },
'BusinessLicense': {"text":"营业执照","color":"#f5222d","value":"BusinessLicense"}, HKPermit: {
text: '香港来往大陆通行证(回乡证)',
color: '#fa8c16',
value: 'HKPermit',
},
MOPermit: {
text: '澳门来往大陆通行证(回乡证)',
color: '#faad14',
value: 'MOPermit',
},
TWPermit: {
text: '台湾来往大陆通行证(台胞证)',
color: '#87d068',
value: 'TWPermit',
},
Passport: { text: '护照', color: '#108ee9', value: 'Passport' },
BusinessLicense: {
text: '营业执照',
color: '#f5222d',
value: 'BusinessLicense',
},
}; };
// HouseOccupantsHouseRelationEnum // HouseOccupantsHouseRelationEnum
export const HouseOccupantsHouseRelationEnum = { export const HouseOccupantsHouseRelationEnum = {
'Owner': {"text":"产权人","color":"#2db7f5","value":"Owner"}, Owner: { text: '产权人', color: '#2db7f5', value: 'Owner' },
'NonOwner': {"text":"非产权人","color":"#fa8c16","value":"NonOwner"}, NonOwner: { text: '非产权人', color: '#fa8c16', value: 'NonOwner' },
}; };
// HouseOccupantsRelationWithOwnerEnum // HouseOccupantsRelationWithOwnerEnum
export const HouseOccupantsRelationWithOwnerEnum = { export const HouseOccupantsRelationWithOwnerEnum = {
'Spouse': {"text":"配偶","color":"#2db7f5","value":"Spouse"}, Spouse: { text: '配偶', color: '#2db7f5', value: 'Spouse' },
'Children': {"text":"子女","color":"#87d068","value":"Children"}, Children: { text: '子女', color: '#87d068', value: 'Children' },
'Parents': {"text":"父母","color":"#faad14","value":"Parents"}, Parents: { text: '父母', color: '#faad14', value: 'Parents' },
'Siblings': {"text":"兄弟姐妹","color":"#fa8c16","value":"Siblings"}, Siblings: { text: '兄弟姐妹', color: '#fa8c16', value: 'Siblings' },
'OtherRelatives': {"text":"其他亲属","color":"#f5222d","value":"OtherRelatives"}, OtherRelatives: {
text: '其他亲属',
color: '#f5222d',
value: 'OtherRelatives',
},
}; };
// HouseOccupantsResidentialRelationEnum // HouseOccupantsResidentialRelationEnum
export const HouseOccupantsResidentialRelationEnum = { export const HouseOccupantsResidentialRelationEnum = {
'Resident': {"text":"住户","color":"#2db7f5","value":"Resident"}, Resident: { text: '住户', color: '#2db7f5', value: 'Resident' },
'PrimaryTenant': {"text":"主租人","color":"#87d068","value":"PrimaryTenant"}, PrimaryTenant: { text: '主租人', color: '#87d068', value: 'PrimaryTenant' },
'Tenant': {"text":"租客","color":"#fa8c16","value":"Tenant"}, Tenant: { text: '租客', color: '#fa8c16', value: 'Tenant' },
}; };
// HouseOccupantsStatusEnum // HouseOccupantsStatusEnum
export const HouseOccupantsStatusEnum = { export const HouseOccupantsStatusEnum = {
'Normal': {"text":"正常","color":"#52c41a","value":"Normal"}, Normal: { text: '正常', color: '#52c41a', value: 'Normal' },
'Unbound': {"text":"已解除","color":"#f5222d","value":"Unbound"}, Unbound: { text: '已解除', color: '#f5222d', value: 'Unbound' },
}; };
// 订单状态枚举 // 订单状态枚举
export const HouseOrdersOrderStatusEnum = { export const HouseOrdersOrderStatusEnum = {
'Pending': {"text":"待支付","color":"#facc15","value":"Pending"}, Pending: { text: '待支付', color: '#facc15', value: 'Pending' },
'Paid': {"text":"已支付","color":"#10b981","value":"Paid"}, Paid: { text: '已支付', color: '#10b981', value: 'Paid' },
'Refunded': {"text":"已退款","color":"#60a5fa","value":"Refunded"}, Refunded: { text: '已退款', color: '#60a5fa', value: 'Refunded' },
'Cancelled': {"text":"已取消","color":"#9ca3af","value":"Cancelled"}, Cancelled: { text: '已取消', color: '#9ca3af', value: 'Cancelled' },
'Failed': {"text":"支付失败","color":"#ef4444","value":"Failed"}, Failed: { text: '支付失败', color: '#ef4444', value: 'Failed' },
}; };
// HouseOrdersPaymentMethodEnum // HouseOrdersPaymentMethodEnum
export const HouseOrdersPaymentMethodEnum = { export const HouseOrdersPaymentMethodEnum = {
'WeChat': {"text":"微信","color":"#07c160","value":"WeChat"}, WeChat: { text: '微信', color: '#07c160', value: 'WeChat' },
'Alipay': {"text":"支付宝","color":"#1677ff","value":"Alipay"}, Alipay: { text: '支付宝', color: '#1677ff', value: 'Alipay' },
'BankTransfer': {"text":"银行转账","color":"#6c757d","value":"BankTransfer"}, BankTransfer: { text: '银行转账', color: '#6c757d', value: 'BankTransfer' },
'TongLian': {"text":"通联支付","color":"#ff9f0a","value":"TongLian"}, TongLian: { text: '通联支付', color: '#ff9f0a', value: 'TongLian' },
}; };
// HouseRegistersCustomerTypeEnum // HouseRegistersCustomerTypeEnum
export const HouseRegistersCustomerTypeEnum = { export const HouseRegistersCustomerTypeEnum = {
'Individual': {"text":"个人客户","color":"#2db7f5","value":"Individual"}, Individual: { text: '个人客户', color: '#2db7f5', value: 'Individual' },
'Enterprise': {"text":"普通企业","color":"#87d068","value":"Enterprise"}, Enterprise: { text: '普通企业', color: '#87d068', value: 'Enterprise' },
'Developer': {"text":"开发企业","color":"#fa8c16","value":"Developer"}, Developer: { text: '开发企业', color: '#fa8c16', value: 'Developer' },
'Government': {"text":"政府组织","color":"#f5222d","value":"Government"}, Government: { text: '政府组织', color: '#f5222d', value: 'Government' },
}; };
// HouseRegistersHouseStatusEnum // HouseRegistersHouseStatusEnum
export const HouseRegistersHouseStatusEnum = { export const HouseRegistersHouseStatusEnum = {
'SelfOccupied': {"text":"自住","color":"#28a745","value":"SelfOccupied"}, SelfOccupied: { text: '自住', color: '#28a745', value: 'SelfOccupied' },
'Rented': {"text":"出租","color":"#007bff","value":"Rented"}, Rented: { text: '出租', color: '#007bff', value: 'Rented' },
'Vacant': {"text":"空置","color":"#dc3545","value":"Vacant"}, Vacant: { text: '空置', color: '#dc3545', value: 'Vacant' },
}; };
// 房屋登记身份类型 // 房屋登记身份类型
export const HouseRegistersIdentityTypeEnum = { export const HouseRegistersIdentityTypeEnum = {
'Owner': {"text":"产权人","color":"#2db7f5","value":"Owner"}, Owner: { text: '产权人', color: '#2db7f5', value: 'Owner' },
'Tenant': {"text":"租客","color":"#87d068","value":"Tenant"}, Tenant: { text: '租客', color: '#87d068', value: 'Tenant' },
'CoResident': {"text":"同住人(亲属)","color":"#108ee9","value":"CoResident"}, CoResident: { text: '同住人(亲属)', color: '#108ee9', value: 'CoResident' },
}; };
// HouseRegistersStatusEnum // HouseRegistersStatusEnum
export const HouseRegistersStatusEnum = { export const HouseRegistersStatusEnum = {
'Pending': {"text":"待审","color":"#faad14","value":"Pending"}, Pending: { text: '待审', color: '#faad14', value: 'Pending' },
'Approved': {"text":"已审","color":"#52c41a","value":"Approved"}, Approved: { text: '通过', color: '#52c41a', value: 'Approved' },
'Rejected': {"text":"驳回","color":"#f5222d","value":"Rejected"}, Rejected: { text: '驳回', color: '#f5222d', value: 'Rejected' },
}; };
// HouseRegistersTypeEnum // HouseRegistersTypeEnum
export const HouseRegistersTypeEnum = { export const HouseRegistersTypeEnum = {
'AddOwner': {"text":"添加产权人","color":"#52c41a","value":"AddOwner"}, AddOwner: { text: '添加产权人', color: '#52c41a', value: 'AddOwner' },
'RemoveOwner': {"text":"减少产权人","color":"#d9363e","value":"RemoveOwner"}, RemoveOwner: { text: '减少产权人', color: '#d9363e', value: 'RemoveOwner' },
'AddOccupant': {"text":"添加住户","color":"#108ee9","value":"AddOccupant"}, AddOccupant: { text: '添加住户', color: '#108ee9', value: 'AddOccupant' },
'RemoveOccupant': {"text":"移除住户","color":"#fa8c16","value":"RemoveOccupant"}, RemoveOccupant: {
'MoveOut': {"text":"搬离登记","color":"#f50","value":"MoveOut"}, text: '移除住户',
'MoveIn': {"text":"搬入登记","color":"#ffc53d","value":"MoveIn"}, color: '#fa8c16',
value: 'RemoveOccupant',
},
MoveOut: { text: '搬离登记', color: '#f50', value: 'MoveOut' },
MoveIn: { text: '搬入登记', color: '#ffc53d', value: 'MoveIn' },
}; };
// HouseRegistersUsagePlanEnum // HouseRegistersUsagePlanEnum
export const HouseRegistersUsagePlanEnum = { export const HouseRegistersUsagePlanEnum = {
'Permanent': {"text":"常住","color":"#52c41a","value":"Permanent"}, Permanent: { text: '常住', color: '#52c41a', value: 'Permanent' },
'Vacation': {"text":"度假","color":"#faad14","value":"Vacation"}, Vacation: { text: '度假', color: '#faad14', value: 'Vacation' },
'Rental': {"text":"出租","color":"#2db7f5","value":"Rental"}, Rental: { text: '出租', color: '#2db7f5', value: 'Rental' },
'Commercial': {"text":"商用","color":"#f5222d","value":"Commercial"}, Commercial: { text: '商用', color: '#f5222d', value: 'Commercial' },
}; };
// HouseWorkOrdersAssignStatusEnum // HouseWorkOrdersAssignStatusEnum
export const HouseWorkOrdersAssignStatusEnum = { export const HouseWorkOrdersAssignStatusEnum = {
'Unassigned': {"text":"未指派","color":"#ff0000","value":"Unassigned"}, Unassigned: { text: '未指派', color: '#ff0000', value: 'Unassigned' },
'Assigned': {"text":"已指派","color":"#00ff00","value":"Assigned"}, Assigned: { text: '已指派', color: '#00ff00', value: 'Assigned' },
}; };
// HouseWorkOrdersLevelEnum // HouseWorkOrdersLevelEnum
export const HouseWorkOrdersLevelEnum = { export const HouseWorkOrdersLevelEnum = {
'Urgent': {"text":"紧急","color":"#ff0000","value":"Urgent"}, Urgent: { text: '紧急', color: '#ff0000', value: 'Urgent' },
'High': {"text":"高","color":"#ff7f00","value":"High"}, High: { text: '高', color: '#ff7f00', value: 'High' },
'Medium': {"text":"中","color":"#00cc00","value":"Medium"}, Medium: { text: '中', color: '#00cc00', value: 'Medium' },
'Low': {"text":"低","color":"#999999","value":"Low"}, Low: { text: '低', color: '#999999', value: 'Low' },
}; };
// HouseWorkOrdersStatusEnum // HouseWorkOrdersStatusEnum
export const HouseWorkOrdersStatusEnum = { export const HouseWorkOrdersStatusEnum = {
'Pending': {"text":"待处理","color":"#FFA500","value":"Pending"}, Pending: { text: '待处理', color: '#FFA500', value: 'Pending' },
'Processing': {"text":"处理中","color":"#1E90FF","value":"Processing"}, Processing: { text: '处理中', color: '#1E90FF', value: 'Processing' },
'Completed': {"text":"已完成","color":"#28A745","value":"Completed"}, Completed: { text: '已完成', color: '#28A745', value: 'Completed' },
'Closed': {"text":"已关闭","color":"#6C757D","value":"Closed"}, Closed: { text: '已关闭', color: '#6C757D', value: 'Closed' },
}; };
// HouseWorkOrdersTypeEnum // HouseWorkOrdersTypeEnum
export const HouseWorkOrdersTypeEnum = { export const HouseWorkOrdersTypeEnum = {
'Maintenance': {"text":"维修","color":"#ff0000","value":"Maintenance"}, Maintenance: { text: '维修', color: '#ff0000', value: 'Maintenance' },
'Installation': {"text":"安装","color":"#00aaff","value":"Installation"}, Installation: { text: '安装', color: '#00aaff', value: 'Installation' },
'Consultation': {"text":"咨询","color":"#ffaa00","value":"Consultation"}, Consultation: { text: '咨询', color: '#ffaa00', value: 'Consultation' },
'Complaint': {"text":"投诉","color":"#aa00ff","value":"Complaint"}, Complaint: { text: '投诉', color: '#aa00ff', value: 'Complaint' },
'Other': {"text":"其它","color":"#00aa55","value":"Other"}, Other: { text: '其它', color: '#00aa55', value: 'Other' },
}; };
// OrganizationsTypeEnum // OrganizationsTypeEnum
export const OrganizationsTypeEnum = { export const OrganizationsTypeEnum = {
'Group': {"text":"集团","color":"#007bff","value":"Group"}, Group: { text: '集团', color: '#007bff', value: 'Group' },
'Company': {"text":"公司","color":"#28a745","value":"Company"}, Company: { text: '公司', color: '#28a745', value: 'Company' },
'ManagementOffice': {"text":"管理处","color":"#ffc107","value":"ManagementOffice"}, ManagementOffice: {
'Department': {"text":"部门","color":"#dc3545","value":"Department"}, text: '管理处',
color: '#ffc107',
value: 'ManagementOffice',
},
Department: { text: '部门', color: '#dc3545', value: 'Department' },
}; };
// 性别 // 性别
export const SexEnum = { export const SexEnum = {
'Male': {"text":"男","color":"#0000ff","value":"Male"}, Male: { text: '男', color: '#0000ff', value: 'Male' },
'FeMale': {"text":"女","color":"#ff0000","value":"FeMale"}, FeMale: { text: '女', color: '#ff0000', value: 'FeMale' },
}; };
// SysModuleEnum // SysModuleEnum
export const SysModuleEnum = { export const SysModuleEnum = {
'Admin': {"text":"管理员","color":"#cf1322","value":"Admin"}, Admin: { text: '管理员', color: '#cf1322', value: 'Admin' },
'Customer': {"text":"客户","color":"#d4b106","value":"Customer"}, Customer: { text: '客户', color: '#d4b106', value: 'Customer' },
}; };
// SysPermissionsTypeEnum // SysPermissionsTypeEnum
export const SysPermissionsTypeEnum = { export const SysPermissionsTypeEnum = {
'Directory': {"text":"目录","color":"#6d7e14","value":"Directory"}, Directory: { text: '目录', color: '#6d7e14', value: 'Directory' },
'Page': {"text":"页面","color":"#4d9a13","value":"Page"}, Page: { text: '页面', color: '#4d9a13', value: 'Page' },
'Button': {"text":"按钮","color":"#97224f","value":"Button"}, Button: { text: '按钮', color: '#97224f', value: 'Button' },
}; };
// WechatAuthsPlatformEnum // WechatAuthsPlatformEnum
export const WechatAuthsPlatformEnum = { export const WechatAuthsPlatformEnum = {
'MiniProgram': {"text":"微信小程序","color":"#3b82f6","value":"MiniProgram"}, MiniProgram: { text: '微信小程序', color: '#3b82f6', value: 'MiniProgram' },
'MpOfficial': {"text":"微信公众号","color":"#22c55e","value":"MpOfficial"}, MpOfficial: { text: '微信公众号', color: '#22c55e', value: 'MpOfficial' },
'WorkWechat': {"text":"企业微信","color":"#6366f1","value":"WorkWechat"}, WorkWechat: { text: '企业微信', color: '#6366f1', value: 'WorkWechat' },
}; };

View File

@ -8,7 +8,7 @@ import { MyModal } from '@/components/MyModal';
import { import {
HouseOccupantsCardTypeEnum, HouseOccupantsCardTypeEnum,
HouseOccupantsHouseRelationEnum, HouseOccupantsHouseRelationEnum,
HouseOccupantsRelationWithOwnerEnum, HouseOccupantsResidentialRelationEnum,
HouseRegistersStatusEnum, HouseRegistersStatusEnum,
HouseRegistersTypeEnum, HouseRegistersTypeEnum,
} from '@/gen/Enums'; } from '@/gen/Enums';
@ -63,9 +63,9 @@ export default function RegistersShow(props: MyBetaModalFormProps) {
valueEnum: HouseOccupantsHouseRelationEnum, valueEnum: HouseOccupantsHouseRelationEnum,
}), }),
MyColumns.EnumTag({ MyColumns.EnumTag({
title: '关系说明', title: '居住关系',
dataIndex: 'relation_with_owner', dataIndex: 'residential_relation',
valueEnum: HouseOccupantsRelationWithOwnerEnum, valueEnum: HouseOccupantsResidentialRelationEnum,
}), }),
{ {
title: '姓名', title: '姓名',

View File

@ -8,7 +8,6 @@ import {
import { Apis } from '@/gen/Apis'; import { Apis } from '@/gen/Apis';
import { import {
AssetHousesOwnershipTypeEnum, AssetHousesOwnershipTypeEnum,
AssetHousesStatusEnum,
AssetHousesUsageEnum, AssetHousesUsageEnum,
} from '@/gen/Enums'; } from '@/gen/Enums';
import { ProTable } from '@ant-design/pro-components'; import { ProTable } from '@ant-design/pro-components';
@ -32,17 +31,26 @@ export default function Index({ title = '房屋档案' }) {
} }
columns={[ columns={[
MyColumns.ID(), MyColumns.ID(),
{
title: '项目名称',
dataIndex: ['asset_project', 'name'],
search: {
transform: (value) => {
return { project_name: value };
},
},
},
{ {
title: '房屋名称', title: '房屋名称',
dataIndex: 'full_name', dataIndex: 'full_name',
ellipsis: true, ellipsis: true,
}, },
MyColumns.EnumTag({ // MyColumns.EnumTag({
title: '房屋状态', // title: '房屋状态',
dataIndex: 'status', // dataIndex: 'status',
valueEnum: AssetHousesStatusEnum, // valueEnum: AssetHousesStatusEnum,
search: false, // search: false,
}), // }),
MyColumns.EnumTag({ MyColumns.EnumTag({
title: '产权性质', title: '产权性质',
@ -71,7 +79,7 @@ export default function Index({ title = '房屋档案' }) {
search: false, search: false,
}, },
{ {
title: '产权人/住户', title: '客户信息',
render(_, record) { render(_, record) {
const owners = const owners =
record?.house_occupants?.filter( record?.house_occupants?.filter(

View File

@ -81,7 +81,9 @@ export default function Show({ title }: { title?: string } = {}) {
return ( return (
<MyPageContainer title={data?.name || title || '项目详情'}> <MyPageContainer title={data?.name || title || '项目详情'}>
<ProCard <ProCard
title={`${data?.name} (${data?.alias_name})`} title={`${data?.name} ${
data?.alias_name ? `${data?.alias_name}` : ''
}`}
extra={ extra={
<Space> <Space>
<AssetInfo <AssetInfo

View File

@ -1,96 +0,0 @@
import { MyBetaModalFormProps, renderTextHelper } from '@/common';
import {
AssetProjectsChargeEnum,
AssetProjectsEntrustTypeEnum,
AssetProjectsPropertyTypeEnum,
AssetProjectsStatusEnum,
} from '@/gen/Enums';
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
import { Space } from 'antd';
import AssetUpdate from '../modals/AssetUpdate';
import BindCompany from './modals/BindCompany';
export default function info(props: MyBetaModalFormProps) {
return (
<Space direction="vertical" style={{ width: '100%' }}>
<ProCard extra={props.extra}>
<ProDescriptions bordered>
<ProDescriptions.Item label="项目名称" span={2}>
<Space size="large">
<div>
{props?.item?.name}
{props?.item?.alias_name
? `${props?.item?.alias_name}`
: ''}
</div>
<AssetUpdate
item={props?.item}
title="项目"
reload={props?.reload}
/>
</Space>
</ProDescriptions.Item>
<ProDescriptions.Item label="绑定机构">
<Space size="large">
<div>{props?.item?.company?.name}</div>
<BindCompany
item={props?.item}
title="项目"
reload={props?.reload}
/>
</Space>
</ProDescriptions.Item>
<ProDescriptions.Item label="项目地址" span={2}>
{props?.item?.province || ''}
{props?.item?.city || ''}
{props?.item?.district || ''}
{props?.item?.address || ''}
</ProDescriptions.Item>
<ProDescriptions.Item label="项目类型">
<renderTextHelper.Tag
Enums={AssetProjectsPropertyTypeEnum}
value={props?.item?.property_type}
key="property_type"
/>
</ProDescriptions.Item>
<ProDescriptions.Item label="项目状态">
<renderTextHelper.Tag
Enums={AssetProjectsStatusEnum}
value={props?.item?.status}
key="status"
/>
</ProDescriptions.Item>
<ProDescriptions.Item label="委托类型">
<renderTextHelper.Tag
Enums={AssetProjectsEntrustTypeEnum}
value={props?.item?.entrust_type}
key="entrust_type"
/>
</ProDescriptions.Item>
<ProDescriptions.Item label="收费方式">
<renderTextHelper.Tag
Enums={AssetProjectsChargeEnum}
value={props?.item?.charge}
key="charge"
/>
</ProDescriptions.Item>
<ProDescriptions.Item label="接管日期">
{props?.item?.takeover_date}
</ProDescriptions.Item>
<ProDescriptions.Item label="封园日期">
{props?.item?.closure_date}
</ProDescriptions.Item>
{/* <ProDescriptions.Item label="">
{props?.item?.created_at}
</ProDescriptions.Item> */}
<ProDescriptions.Item label="最近修改">
{props?.item?.updated_at}
</ProDescriptions.Item>
</ProDescriptions>
</ProCard>
</Space>
);
}

View File

@ -15,6 +15,7 @@ import { ProTable } from '@ant-design/pro-components';
import { Space } from 'antd'; import { Space } from 'antd';
import ChargeStandardCreate from './modals/ChargeStandardCreate'; import ChargeStandardCreate from './modals/ChargeStandardCreate';
import ChargeStandardHasHouse from './modals/ChargeStandardHasHouse'; import ChargeStandardHasHouse from './modals/ChargeStandardHasHouse';
import ChargeStandardUpdate from './modals/ChargeStandardUpdate';
export default function ReceiptAccounts(props: MyBetaModalFormProps) { export default function ReceiptAccounts(props: MyBetaModalFormProps) {
return ( return (
@ -47,7 +48,7 @@ export default function ReceiptAccounts(props: MyBetaModalFormProps) {
dataIndex: 'id', dataIndex: 'id',
}, },
{ {
title: 'name', title: '收费标准名称',
dataIndex: 'name', dataIndex: 'name',
search: false, search: false,
}, },
@ -99,10 +100,16 @@ export default function ReceiptAccounts(props: MyBetaModalFormProps) {
MyColumns.Option({ MyColumns.Option({
render: (_, item: any, index, action) => ( render: (_, item: any, index, action) => (
<Space key={index}> <Space key={index}>
<ChargeStandardUpdate
item={item}
reload={action?.reload}
title="编辑"
/>
<ChargeStandardHasHouse <ChargeStandardHasHouse
item={{ item={{
...item, ...item,
asset_projects_id: props?.item?.id, // 使用项目ID asset_projects_id: props?.item?.id, // 使用项目ID
size: 'small',
}} }}
reload={action?.reload} reload={action?.reload}
title={'绑定房屋'} title={'绑定房屋'}

View File

@ -28,7 +28,7 @@ export default function Create(props: MyBetaModalFormProps) {
{...MyModalFormProps.props} {...MyModalFormProps.props}
title={`创建收费标准`} title={`创建收费标准`}
wrapperCol={{ span: 24 }} wrapperCol={{ span: 24 }}
width="580px" width="600px"
trigger={<MyButtons.Create title={`创建收费标准`} />} trigger={<MyButtons.Create title={`创建收费标准`} />}
form={form} form={form}
key={new Date().getTime()} key={new Date().getTime()}
@ -90,6 +90,25 @@ export default function Create(props: MyBetaModalFormProps) {
valueEnum: HouseBillsTypeEnum, valueEnum: HouseBillsTypeEnum,
required: true, required: true,
}), }),
{
name: ['charge_type'],
valueType: 'dependency',
columns: ({ charge_type }: any) => {
return charge_type === HouseBillsTypeEnum.SharedWaterFee.value ||
charge_type === HouseBillsTypeEnum.SharedElectricityFee.value
? [
MyFormItems.EnumRadio({
key: 'calculation_method',
title: '分摊方式',
colProps: { span: 18 },
valueEnum: HouseChargeStandardsApportionmentMethodEnum,
required: true,
}),
]
: [];
},
},
// Selects?.AssetProjects({ // Selects?.AssetProjects({
// key: 'asset_projects_id', // key: 'asset_projects_id',
// title: '项目', // title: '项目',
@ -106,7 +125,7 @@ export default function Create(props: MyBetaModalFormProps) {
MyFormItems.EnumRadio({ MyFormItems.EnumRadio({
key: 'calculation_method', key: 'calculation_method',
title: '计量单位', title: '计量单位',
colProps: { span: 24 }, colProps: { span: 16 },
valueEnum: () => { valueEnum: () => {
let obj: any = JSON.parse( let obj: any = JSON.parse(
JSON.stringify( JSON.stringify(
@ -128,7 +147,7 @@ export default function Create(props: MyBetaModalFormProps) {
MyFormItems.EnumRadio({ MyFormItems.EnumRadio({
key: 'calculation_method', key: 'calculation_method',
title: '计量单位', title: '计量单位',
colProps: { span: 24 }, colProps: { span: 16 },
valueEnum: () => { valueEnum: () => {
let obj: any = JSON.parse( let obj: any = JSON.parse(
JSON.stringify( JSON.stringify(
@ -164,7 +183,9 @@ export default function Create(props: MyBetaModalFormProps) {
formItemProps: { ...rulesHelper.number }, formItemProps: { ...rulesHelper.number },
}, },
] ]
: !calculation_method : !calculation_method &&
calculation_method !==
HouseChargeStandardsCalculationMethodEnum.PerUnit.value
? [] ? []
: [ : [
MyFormItems.EnumRadio({ MyFormItems.EnumRadio({
@ -204,13 +225,6 @@ export default function Create(props: MyBetaModalFormProps) {
colProps: { span: 14 }, colProps: { span: 14 },
valueEnum: HouseChargeStandardsPriceAlgorithmEnum, valueEnum: HouseChargeStandardsPriceAlgorithmEnum,
required: true, required: true,
// valueEnum: () => {
// let obj: any = JSON.parse(
// JSON.stringify(HouseChargeStandardsPriceAlgorithmEnum),
// );
// delete obj.Fixed;
// return obj;
// },
// fieldProps: { // fieldProps: {
// onChange: () => { // onChange: () => {
// // 切换计费算法时清空阶梯配置 // // 切换计费算法时清空阶梯配置
@ -267,8 +281,12 @@ export default function Create(props: MyBetaModalFormProps) {
valueType: 'number', valueType: 'number',
fieldProps: { fieldProps: {
min: 0, min: 0,
// addonBefore: `第${index + 1}阶梯`, addonBefore: (
addonBefore: `第1阶梯`, _: any,
{
field,
}: { field: { index: number[] } },
) => `${field.index[1] + 1}阶梯`,
}, },
width: '100%', width: '100%',
formItemProps: { ...rulesHelper.number }, formItemProps: { ...rulesHelper.number },
@ -330,8 +348,12 @@ export default function Create(props: MyBetaModalFormProps) {
valueType: 'number', valueType: 'number',
fieldProps: { fieldProps: {
min: 0, min: 0,
// addonBefore: `第${index + 1}阶梯`, addonBefore: (
addonBefore: `第1阶梯`, _: any,
{
field,
}: { field: { name: number[] } },
) => `${field.name[1] + 1}阶梯`,
}, },
width: '100%', width: '100%',
formItemProps: { ...rulesHelper.number }, formItemProps: { ...rulesHelper.number },
@ -369,24 +391,15 @@ export default function Create(props: MyBetaModalFormProps) {
}, },
}, },
{ {
name: ['charge_type'], name: ['price', 'price_algorithm'],
valueType: 'dependency', valueType: 'dependency',
columns: ({ charge_type }: any) => { columns: ({ price, price_algorithm }: any) => {
return charge_type === HouseBillsTypeEnum.SharedWaterFee.value || return price ||
charge_type === HouseBillsTypeEnum.SharedElectricityFee.value price_algorithm ===
HouseChargeStandardsPriceAlgorithmEnum.Tiered.value ||
price_algorithm ===
HouseChargeStandardsPriceAlgorithmEnum.Peak.value
? [ ? [
MyFormItems.EnumRadio({
key: 'calculation_method',
title: '分摊方式',
colProps: { span: 18 },
valueEnum: HouseChargeStandardsApportionmentMethodEnum,
required: true,
}),
]
: [];
},
},
{ {
valueType: 'group', valueType: 'group',
columns: [ columns: [
@ -404,8 +417,6 @@ export default function Create(props: MyBetaModalFormProps) {
valueType: 'date', valueType: 'date',
width: '100%', width: '100%',
}, },
],
},
{ {
key: 'remark', key: 'remark',
title: '备注', title: '备注',
@ -417,6 +428,12 @@ export default function Create(props: MyBetaModalFormProps) {
showCount: true, showCount: true,
}, },
}, },
],
},
]
: [];
},
},
]} ]}
/> />
); );

View File

@ -1,6 +1,11 @@
import { MyBetaModalFormProps, MyButtons } from '@/common'; import { MyBetaModalFormProps, MyButtons, renderTextHelper } from '@/common';
import { MyModal } from '@/components/MyModal'; import { MyModal } from '@/components/MyModal';
import { Apis } from '@/gen/Apis'; import { Apis } from '@/gen/Apis';
import {
HouseBillsTypeEnum,
HouseChargeStandardsCalculationModeEnum,
HouseChargeStandardsCalculationPeriodEnum,
} from '@/gen/Enums';
import { ProCard } from '@ant-design/pro-components'; import { ProCard } from '@ant-design/pro-components';
import { import {
Alert, Alert,
@ -174,7 +179,7 @@ export default function ChargeStandardHasHouse(
}; };
// 处理节点选中 // 处理节点选中
const onCheck = ( const onCheck = async (
checkedKeysValue: checkedKeysValue:
| React.Key[] | React.Key[]
| { checked: React.Key[]; halfChecked: React.Key[] }, | { checked: React.Key[]; halfChecked: React.Key[] },
@ -188,9 +193,39 @@ export default function ChargeStandardHasHouse(
const prevKeys = new Set(checkedKeys); const prevKeys = new Set(checkedKeys);
const newKeys = new Set(keys); const newKeys = new Set(keys);
// 找出新选中的节点
const newlyCheckedKeys = [...newKeys].filter((key) => !prevKeys.has(key));
// 找出新取消选中的节点 // 找出新取消选中的节点
const uncheckedKeys = [...prevKeys].filter((key) => !newKeys.has(key)); const uncheckedKeys = [...prevKeys].filter((key) => !newKeys.has(key));
// 处理新选中的节点
for (const key of newlyCheckedKeys) {
const keyStr = key.toString();
// 如果选中的是楼栋
if (keyStr.startsWith('building-')) {
const buildingNode = treeData.find((node) => node.key === key);
if (buildingNode) {
// 调用接口获取该楼栋下所有房屋
await loadBuildingHouses(buildingNode.id);
}
}
// 如果选中的是单元
else if (keyStr.startsWith('unit-')) {
// 查找该单元所属的楼栋和单元ID
for (const building of treeData) {
const unitNode = building.children?.find((unit) => unit.key === key);
if (unitNode) {
// 调用接口获取该单元下所有房屋
await loadUnitHouses(building.id, unitNode.id);
break;
}
}
}
}
// 如果有节点被取消选中,同步取消其所有子节点 // 如果有节点被取消选中,同步取消其所有子节点
if (uncheckedKeys.length > 0) { if (uncheckedKeys.length > 0) {
const keysToRemove = new Set<React.Key>(); const keysToRemove = new Set<React.Key>();
@ -218,23 +253,72 @@ export default function ChargeStandardHasHouse(
// 从选中keys中移除所有需要取消的节点 // 从选中keys中移除所有需要取消的节点
const finalKeys = keys.filter((key) => !keysToRemove.has(key)); const finalKeys = keys.filter((key) => !keysToRemove.has(key));
setCheckedKeys(finalKeys); setCheckedKeys(finalKeys);
// 更新selectedHouses移除被取消选中的房屋
const houseKeysToRemove = new Set<string>();
keysToRemove.forEach((key) => {
if (key.toString().startsWith('house-')) {
houseKeysToRemove.add(key.toString().replace('house-', ''));
}
});
const updatedHouses = selectedHouses.filter(
(house) => !houseKeysToRemove.has(house.id.toString()),
);
setSelectedHouses(updatedHouses);
} else { } else {
setCheckedKeys(keys); setCheckedKeys(keys);
} }
// 收集所有选中的房屋 // 收集所有选中的房屋
const selectedHousesList: { id: number; name: string }[] = []; const selectedHousesList: {
id: number;
name: string;
buildingName?: string;
unitName?: string;
}[] = [...selectedHouses];
// 遍历树形数据,收集选中节点下的所有房屋 // 遍历树形数据,收集选中节点下的所有房屋
const collectHouses = (nodes: TreeNodeType[], checkedKeys: React.Key[]) => { const collectHouses = (nodes: TreeNodeType[], checkedKeys: React.Key[]) => {
nodes.forEach((node) => { nodes.forEach((node) => {
if (checkedKeys.includes(node.key)) { if (checkedKeys.includes(node.key)) {
if (node.isLeaf) { if (node.isLeaf) {
// 如果是房屋节点,直接添加 // 如果是房屋节点,检查是否已经存在
const houseId = node.id;
const exists = selectedHousesList.some(
(house) => house.id === houseId,
);
if (!exists) {
// 查找楼栋和单元信息
let buildingName = '';
let unitName = '';
// 查找楼栋和单元
for (const building of treeData) {
if (building.id === node.asset_buildings_id) {
buildingName = building.title as string;
// 查找单元
const unit = building.children?.find(
(u) => u.id === node.asset_units_id,
);
if (unit) {
unitName = unit.title as string;
}
break;
}
}
// 添加到选中列表
selectedHousesList.push({ selectedHousesList.push({
id: node.id, id: houseId,
name: node.title as string, name: `${buildingName} ${unitName} ${node.title}(${houseId})`,
buildingName,
unitName,
}); });
}
} else { } else {
// 如果是楼栋或单元节点,递归收集其下的所有房屋 // 如果是楼栋或单元节点,递归收集其下的所有房屋
if (node.children) { if (node.children) {
@ -276,57 +360,33 @@ export default function ChargeStandardHasHouse(
// 加载楼栋下的单元 // 加载楼栋下的单元
if (node.key.toString().startsWith('building-')) { if (node.key.toString().startsWith('building-')) {
const buildingId = node.id; console.log('node.key', node.key);
// 从key中提取buildingId格式为'building-{id}'
const buildingId = parseInt(
node.key.toString().replace('building-', ''),
10,
);
await loadUnits(buildingId, node.key as string); await loadUnits(buildingId, node.key as string);
// 如果楼栋被选中,加载并选中其下所有单元和房屋 // 如果楼栋被选中,加载并选中其下所有单元和房屋
if (checkedKeys.includes(node.key)) { if (checkedKeys.includes(node.key)) {
const newTreeData = [...treeData]; // 直接调用loadBuildingHouses加载该楼栋下所有房屋
const buildingNode = newTreeData.find((n) => n.key === node.key); await loadBuildingHouses(buildingId);
if (buildingNode?.children) {
// 加载每个单元下的房屋
for (const unit of buildingNode.children) {
await loadHouses(buildingId, unit.id, unit.key as string);
}
// 更新树形数据
setTreeData(newTreeData);
// 收集所有房屋的key
const allKeys: React.Key[] = [];
const collectKeys = (nodes: TreeNodeType[]) => {
nodes.forEach((node) => {
allKeys.push(node.key);
if (node.children) {
collectKeys(node.children);
}
});
};
collectKeys([buildingNode]);
// 更新选中状态
setCheckedKeys(Array.from(new Set([...checkedKeys, ...allKeys])));
}
} }
return Promise.resolve(); return Promise.resolve();
} }
// 加载单元下的房屋 // 加载单元下的房屋
if (node.key.toString().startsWith('unit-')) { if (node.key.toString().startsWith('unit-')) {
const unitId = node.id; // 从key中提取unitId格式为'unit-{id}'
const unitId = parseInt(node.key.toString().replace('unit-', ''), 10);
const buildingId = node.asset_buildings_id as number; const buildingId = node.asset_buildings_id as number;
await loadHouses(buildingId, unitId, node.key as string); await loadHouses(buildingId, unitId, node.key as string);
// 如果单元被选中,选中其下所有房屋 // 如果单元被选中,选中其下所有房屋
if (checkedKeys.includes(node.key)) { if (checkedKeys.includes(node.key)) {
const newTreeData = [...treeData]; // 直接调用loadUnitHouses加载该单元下所有房屋
const buildingNode = newTreeData.find((n) => await loadUnitHouses(buildingId, unitId);
n.children?.some((unit) => unit.key === node.key),
);
const unitNode = buildingNode?.children?.find(
(n) => n.key === node.key,
);
if (unitNode?.children) {
const houseKeys = unitNode.children.map((house) => house.key);
setCheckedKeys(Array.from(new Set([...checkedKeys, ...houseKeys])));
}
} }
return Promise.resolve(); return Promise.resolve();
} }
@ -334,31 +394,186 @@ export default function ChargeStandardHasHouse(
return Promise.resolve(); return Promise.resolve();
}; };
// 处理全选 // 加载所有房屋数据
const handleSelectAll = (e: CheckboxChangeEvent) => { const loadAllHouses = async () => {
setSelectAll(e.target.checked); setLoading(true);
try {
const res = await Apis.Asset.AssetHouses.List({
asset_projects_id: props?.item?.asset_projects_id,
});
if (e.target.checked) { if (res?.data) {
// 收集所有房屋节点的key
const allHouseKeys: React.Key[] = []; const allHouseKeys: React.Key[] = [];
const allHouses: { id: number; name: string }[] = []; const allHouses: {
id: number;
name: string;
buildingName: string;
unitName: string;
}[] = [];
// 创建映射以快速查找楼栋和单元名称
const buildingMap = new Map();
const unitMap = new Map();
// 填充楼栋映射
treeData.forEach((building) => { treeData.forEach((building) => {
buildingMap.set(building.id, building.title);
building.children?.forEach((unit) => { building.children?.forEach((unit) => {
unit.children?.forEach((house) => { unitMap.set(unit.id, unit.title);
if (house.isLeaf) { });
allHouseKeys.push(house.key); });
res.data.forEach((house: any) => {
const houseKey = `house-${house.id}`;
allHouseKeys.push(houseKey);
const buildingName = buildingMap.get(house.asset_buildings_id) || '';
const unitName = unitMap.get(house.asset_units_id) || '';
allHouses.push({ allHouses.push({
id: house.id, id: house.id,
name: house.title as string, name: `${buildingName} ${unitName} ${house.name}(${house.id})`,
}); buildingName: buildingName as string,
} unitName: unitName as string,
});
}); });
}); });
setCheckedKeys(allHouseKeys); setCheckedKeys(allHouseKeys);
setSelectedHouses(allHouses); setSelectedHouses(allHouses);
}
} catch (error) {
console.error('加载所有房屋失败:', error);
message.error('加载所有房屋失败');
} finally {
setLoading(false);
}
};
// 加载楼栋下所有房屋
const loadBuildingHouses = async (buildingId: number) => {
setLoading(true);
try {
const res = await Apis.Asset.AssetHouses.List({
asset_projects_id: props?.item?.asset_projects_id,
asset_buildings_id: buildingId,
});
if (res?.data) {
const buildingHouseKeys: React.Key[] = [];
const buildingHouses: {
id: number;
name: string;
buildingName: string;
unitName: string;
}[] = [];
// 获取楼栋名称
const building = treeData.find((b) => b.id === buildingId);
const buildingName = building?.title || '';
// 创建单元映射
const unitMap = new Map();
building?.children?.forEach((unit) => {
unitMap.set(unit.id, unit.title);
});
res.data.forEach((house: any) => {
const houseKey = `house-${house.id}`;
buildingHouseKeys.push(houseKey);
const unitName = unitMap.get(house.asset_units_id) || '';
buildingHouses.push({
id: house.id,
name: `${buildingName} ${unitName} ${house.name}(${house.id})`,
buildingName: buildingName as string,
unitName: unitName as string,
});
});
// 合并当前选中的keys和新的keys
const newCheckedKeys = Array.from(
new Set([...checkedKeys, ...buildingHouseKeys]),
);
setCheckedKeys(newCheckedKeys);
// 合并当前选中的房屋和新的房屋
const existingIds = new Set(selectedHouses.map((h) => h.id));
const newHouses = buildingHouses.filter((h) => !existingIds.has(h.id));
setSelectedHouses([...selectedHouses, ...newHouses]);
}
} catch (error) {
console.error('加载楼栋房屋失败:', error);
message.error('加载楼栋房屋失败');
} finally {
setLoading(false);
}
};
// 加载单元下所有房屋
const loadUnitHouses = async (buildingId: number, unitId: number) => {
setLoading(true);
try {
const res = await Apis.Asset.AssetHouses.List({
asset_projects_id: props?.item?.asset_projects_id,
asset_buildings_id: buildingId,
asset_units_id: unitId,
});
if (res?.data) {
const unitHouseKeys: React.Key[] = [];
const unitHouses: {
id: number;
name: string;
buildingName: string;
unitName: string;
}[] = [];
// 获取楼栋和单元名称
const building = treeData.find((b) => b.id === buildingId);
const buildingName = building?.title || '';
const unit = building?.children?.find((u) => u.id === unitId);
const unitName = unit?.title || '';
res.data.forEach((house: any) => {
const houseKey = `house-${house.id}`;
unitHouseKeys.push(houseKey);
unitHouses.push({
id: house.id,
name: `${buildingName} ${unitName} ${house.name}(${house.id})`,
buildingName: buildingName as string,
unitName: unitName as string,
});
});
// 合并当前选中的keys和新的keys
const newCheckedKeys = Array.from(
new Set([...checkedKeys, ...unitHouseKeys]),
);
setCheckedKeys(newCheckedKeys);
// 合并当前选中的房屋和新的房屋
const existingIds = new Set(selectedHouses.map((h) => h.id));
const newHouses = unitHouses.filter((h) => !existingIds.has(h.id));
setSelectedHouses([...selectedHouses, ...newHouses]);
}
} catch (error) {
console.error('加载单元房屋失败:', error);
message.error('加载单元房屋失败');
} finally {
setLoading(false);
}
};
// 处理全选
const handleSelectAll = async (e: CheckboxChangeEvent) => {
setSelectAll(e.target.checked);
if (e.target.checked) {
// 调用接口获取所有房屋
await loadAllHouses();
} else { } else {
// 取消全选 // 取消全选
setCheckedKeys([]); setCheckedKeys([]);
@ -402,19 +617,43 @@ export default function ChargeStandardHasHouse(
trigger={ trigger={
<MyButtons.Default <MyButtons.Default
type="primary" type="primary"
size="middle" size="small"
title={`${props.title}`} title={`${props.title}`}
/> />
} }
node={ node={
<ProCard <ProCard
title={ title={
<div>
<Title level={4} style={{ marginBottom: '16px' }}>
<div>
<div>{props?.item?.name || '标准名称'}</div>
<Space>
<renderTextHelper.Tag
Enums={HouseBillsTypeEnum}
value={props?.item?.charge_type}
key="type"
/>
<renderTextHelper.Tag
Enums={HouseChargeStandardsCalculationModeEnum}
value={props?.item?.calculation_mode}
key="type"
/>
<renderTextHelper.Tag
Enums={HouseChargeStandardsCalculationPeriodEnum}
value={props?.item?.calculation_period}
key="type"
/>
</Space>
</div>
</Title>
<Alert <Alert
message="请选择需要绑定的房屋" message="请选择需要绑定的房屋"
type="info" type="info"
showIcon showIcon
style={{ margin: 0 }} style={{ margin: 0 }}
/> />
</div>
} }
> >
<div style={{ display: 'flex', height: '500px' }}> <div style={{ display: 'flex', height: '500px' }}>

View File

@ -0,0 +1,435 @@
import {
MyBetaModalFormProps,
MyButtons,
MyFormItems,
MyModalFormProps,
rulesHelper,
} from '@/common';
import { Apis } from '@/gen/Apis';
import {
HouseBillsTypeEnum,
HouseChargeStandardsApportionmentMethodEnum,
HouseChargeStandardsCalculationMethodEnum,
HouseChargeStandardsCalculationModeEnum,
HouseChargeStandardsCalculationPeriodEnum,
HouseChargeStandardsPriceAlgorithmEnum,
HouseChargeStandardsTypeEnum,
} from '@/gen/Enums';
import { BetaSchemaForm } from '@ant-design/pro-components';
import { Form, message } from 'antd';
import { useRef } from 'react';
export default function Update(props: MyBetaModalFormProps) {
const [form] = Form.useForm();
const actionRef = useRef<any>();
return (
<BetaSchemaForm<ApiTypes.HouseCharage.HouseChargeStandards.Update>
{...MyModalFormProps.props}
title={props.title}
wrapperCol={{ span: 24 }}
width="600px"
trigger={
<MyButtons.Default title={props.title} size="small" type="primary" />
}
form={form}
key={new Date().getTime()}
onOpenChange={(open: any) => {
if (open) {
form.setFieldsValue(props?.item); // 编辑赋值
}
}}
onFinish={async (values) =>
Apis.HouseCharage.HouseChargeStandards.Update({
...values,
asset_projects_id: props?.item?.asset_projects_id,
type:
values.charge_type === HouseBillsTypeEnum.SharedWaterFee.value ||
values.charge_type === HouseBillsTypeEnum.SharedElectricityFee.value
? HouseChargeStandardsTypeEnum.House.value
: HouseChargeStandardsTypeEnum.Meter.value,
is_apportionment:
values.charge_type === HouseBillsTypeEnum.SharedWaterFee.value ||
values.charge_type === HouseBillsTypeEnum.SharedElectricityFee.value
? 1
: 0,
// 按套
calculation_mode:
values?.calculation_method ===
HouseChargeStandardsCalculationMethodEnum.PerUnit.value
? HouseChargeStandardsCalculationModeEnum.FixedAmount.value
: values?.calculation_mode,
// 按固定金额
price_algorithm:
values?.calculation_mode ===
HouseChargeStandardsCalculationModeEnum.FixedAmount.value ||
values?.calculation_method ===
HouseChargeStandardsCalculationMethodEnum.PerUnit.value
? HouseChargeStandardsPriceAlgorithmEnum.Fixed.value
: values?.price_algorithm,
id: props?.item?.id,
})
.then(() => {
props.reload?.();
message.success('收费标准编辑成功');
return true;
})
.catch(() => false)
}
columns={[
{
key: 'name',
title: '收费标准名称',
colProps: { span: 24 },
formItemProps: { ...rulesHelper.text },
},
MyFormItems.EnumRadio({
key: 'charge_type',
title: '收费项目',
colProps: { span: 24 },
valueEnum: HouseBillsTypeEnum,
required: true,
}),
{
name: ['charge_type'],
valueType: 'dependency',
columns: ({ charge_type }: any) => {
return charge_type === HouseBillsTypeEnum.SharedWaterFee.value ||
charge_type === HouseBillsTypeEnum.SharedElectricityFee.value
? [
MyFormItems.EnumRadio({
key: 'calculation_method',
title: '分摊方式',
colProps: { span: 18 },
valueEnum: HouseChargeStandardsApportionmentMethodEnum,
required: true,
}),
]
: [];
},
},
{
name: ['charge_type'],
valueType: 'dependency',
columns: ({ charge_type }: any) => {
return charge_type === HouseBillsTypeEnum.PropertyFee.value ||
charge_type === HouseBillsTypeEnum.MaintenanceFund.value
? [
MyFormItems.EnumRadio({
key: 'calculation_method',
title: '计量单位',
colProps: { span: 16 },
valueEnum: () => {
let obj: any = JSON.parse(
JSON.stringify(
HouseChargeStandardsCalculationMethodEnum,
),
);
delete obj.ElectricityUsage;
delete obj.WaterUsage;
return obj;
},
required: true,
}),
]
: charge_type === HouseBillsTypeEnum.WaterFee.value ||
charge_type === HouseBillsTypeEnum.ElectricityFee.value ||
charge_type === HouseBillsTypeEnum.SharedWaterFee.value ||
charge_type === HouseBillsTypeEnum.SharedElectricityFee.value
? [
MyFormItems.EnumRadio({
key: 'calculation_method',
title: '计量单位',
colProps: { span: 16 },
valueEnum: () => {
let obj: any = JSON.parse(
JSON.stringify(
HouseChargeStandardsCalculationMethodEnum,
),
);
delete obj.ChargeableArea;
delete obj.BuiltArea;
delete obj.InsideArea;
delete obj.PerUnit;
return obj;
},
required: true,
}),
]
: [];
},
},
{
name: ['calculation_method'],
valueType: 'dependency',
columns: ({ calculation_method }: any) => {
return calculation_method ===
HouseChargeStandardsCalculationMethodEnum.PerUnit.value
? [
{
key: 'price',
title: '固定单价',
colProps: { span: 10 },
fieldProps: {
addonAfter: '元',
},
formItemProps: { ...rulesHelper.number },
},
]
: !calculation_method &&
calculation_method !==
HouseChargeStandardsCalculationMethodEnum.PerUnit.value
? []
: [
MyFormItems.EnumRadio({
key: 'calculation_mode',
title: '计费模式',
colProps: { span: 12 },
valueEnum: HouseChargeStandardsCalculationModeEnum,
required: true,
}),
];
},
},
{
name: ['calculation_mode'],
valueType: 'dependency',
columns: ({ calculation_mode }: any) => {
return calculation_mode ===
HouseChargeStandardsCalculationModeEnum.FixedAmount.value
? [
{
key: 'price',
title: '固定单价',
colProps: { span: 10 },
fieldProps: {
addonAfter: '元',
},
formItemProps: { ...rulesHelper.number },
},
]
: calculation_mode ===
HouseChargeStandardsCalculationModeEnum.QuantityPrice.value
? [
MyFormItems.EnumRadio({
key: 'price_algorithm',
title: '计费算法',
colProps: { span: 14 },
valueEnum: HouseChargeStandardsPriceAlgorithmEnum,
required: true,
// fieldProps: {
// onChange: () => {
// // 切换计费算法时清空阶梯配置
// form.setFieldValue('scheme', undefined);
// },
// },
}),
{
name: ['price_algorithm'],
valueType: 'dependency',
columns: ({ price_algorithm }: any) => {
return price_algorithm ===
HouseChargeStandardsPriceAlgorithmEnum.Fixed.value
? [
{
key: 'price',
title: '固定单价',
colProps: { span: 10 },
fieldProps: {
addonAfter: '元',
},
formItemProps: { ...rulesHelper.number },
},
]
: price_algorithm ===
HouseChargeStandardsPriceAlgorithmEnum.Tiered.value
? [
{
valueType: 'formList',
dataIndex: 'scheme',
title: '阶梯标准',
formItemProps: { ...rulesHelper.array },
initialValue: [
{
start: 0,
end: null,
price: null,
},
],
fieldProps: {
actionRef: actionRef,
copyIconProps: false,
// deleteIconProps: false,
},
columns: [
{
valueType: 'group',
colProps: { span: 24 },
columns: [
{
key: 'start',
colProps: { span: 10 },
title: '起始值',
valueType: 'number',
fieldProps: {
min: 0,
addonBefore: (
_: any,
{
field,
}: { field: { index: number[] } },
) => `${field.index[1] + 1}阶梯`,
},
width: '100%',
formItemProps: { ...rulesHelper.number },
},
{
key: 'end',
colProps: { span: 6 },
title: '结束值',
valueType: 'number',
width: '100%',
formItemProps: { ...rulesHelper.number },
fieldProps: { maxLength: 12 },
},
{
key: 'price',
colProps: { span: 8 },
title: '阶梯单价',
valueType: 'number',
fieldProps: {
addonAfter: '元',
min: 0,
},
formItemProps: { ...rulesHelper.number },
},
],
},
],
},
]
: price_algorithm ===
HouseChargeStandardsPriceAlgorithmEnum.Peak.value
? [
{
valueType: 'formList',
dataIndex: 'scheme',
title: '阶梯标准',
formItemProps: { ...rulesHelper.array },
initialValue: [
{
start: 0,
end: null,
price: null,
},
],
fieldProps: {
actionRef: actionRef,
copyIconProps: false,
// deleteIconProps: false,
},
columns: [
{
valueType: 'group',
colProps: { span: 24 },
columns: [
{
key: 'start',
colProps: { span: 10 },
title: '起始值',
valueType: 'number',
fieldProps: {
min: 0,
addonBefore: (
_: any,
{
field,
}: { field: { name: number[] } },
) => `${field.name[1] + 1}阶梯`,
},
width: '100%',
formItemProps: { ...rulesHelper.number },
},
{
key: 'end',
colProps: { span: 6 },
title: '结束值',
valueType: 'number',
width: '100%',
formItemProps: { ...rulesHelper.number },
fieldProps: { maxLength: 12 },
},
{
key: 'price',
colProps: { span: 8 },
title: '阶梯单价',
valueType: 'number',
fieldProps: {
addonAfter: '元',
min: 0,
},
formItemProps: { ...rulesHelper.number },
},
],
},
],
},
]
: [];
},
},
]
: [];
},
},
{
name: ['price', 'price_algorithm'],
valueType: 'dependency',
columns: ({ price, price_algorithm }: any) => {
return price ||
price_algorithm ===
HouseChargeStandardsPriceAlgorithmEnum.Tiered.value ||
price_algorithm ===
HouseChargeStandardsPriceAlgorithmEnum.Peak.value
? [
{
valueType: 'group',
columns: [
MyFormItems.EnumRadio({
key: 'calculation_period',
title: '账单计费周期',
colProps: { span: 14 },
valueEnum: HouseChargeStandardsCalculationPeriodEnum,
required: true,
}),
{
key: 'auto_date',
title: '账单自动生成日期',
colProps: { span: 10 },
valueType: 'date',
width: '100%',
},
{
key: 'remark',
title: '备注',
colProps: { span: 24 },
valueType: 'textarea',
fieldProps: {
rows: 4,
maxLength: 500,
showCount: true,
},
},
],
},
]
: [];
},
},
]}
/>
);
}

View File

@ -109,7 +109,7 @@ export default function Index({ title = '项目列表' }) {
<AssetInfo item={item} title="查看" reload={action?.reload} /> <AssetInfo item={item} title="查看" reload={action?.reload} />
<AssetUpdate item={item} title="项目" reload={action?.reload} /> <AssetUpdate item={item} title="项目" reload={action?.reload} />
<MyButtons.View <MyButtons.View
title="楼栋管理" title="楼栋"
onClick={() => { onClick={() => {
navigate(`/asset/${item.id}`); navigate(`/asset/${item.id}`);
}} }}

View File

@ -38,7 +38,11 @@ export default function Create(props: MyBetaModalFormProps) {
} }
}} }}
onFinish={async (values) => onFinish={async (values) =>
Apis.Asset.AssetProjects.Store(values) Apis.Asset.AssetProjects.Store({
...values,
longitude: values?.location ? values.location.split(',')[0] : '',
latitude: values?.location ? values.location.split(',')[1] : '',
})
.then(() => { .then(() => {
props.reload?.(); props.reload?.();
message.success(props.title + '成功'); message.success(props.title + '成功');
@ -128,6 +132,23 @@ export default function Create(props: MyBetaModalFormProps) {
}, },
colProps: { span: 8 }, colProps: { span: 8 },
}, },
{
title: '项目经纬度',
dataIndex: 'location',
colProps: { span: 24 },
fieldProps: {
addonAfter: (
<MyButtons.View
title="获取经纬度"
onClick={() => {
window.open(
'https://api.map.baidu.com/lbsapi/getpoint/index.html',
);
}}
/>
),
},
},
]} ]}
/> />
); );

View File

@ -28,9 +28,13 @@ export default function Update(props: MyBetaModalFormProps) {
width="600px" width="600px"
key={new Date().getTime()} key={new Date().getTime()}
form={form} form={form}
onOpenChange={(open: any) => { onOpenChange={(open: any, props: any) => {
if (open && props.item) { if (open && props.item) {
form.setFieldsValue(props.item); form.setFieldsValue(props.item);
form.setFieldValue(
'location',
`${props.item?.longitude},${props.item?.latitude}`,
);
} }
}} }}
request={() => request={() =>
@ -45,7 +49,12 @@ export default function Update(props: MyBetaModalFormProps) {
}) })
} }
onFinish={async (values) => onFinish={async (values) =>
Apis.Asset.AssetProjects.Update({ ...values, id: props.item?.id ?? 0 }) Apis.Asset.AssetProjects.Update({
...values,
id: props.item?.id ?? 0,
longitude: values?.location ? values.location.split(',')[0] : '',
latitude: values?.location ? values.location.split(',')[1] : '',
})
.then(() => { .then(() => {
props.reload?.(); props.reload?.();
message.success(props.title + '成功'); message.success(props.title + '成功');
@ -135,6 +144,23 @@ export default function Update(props: MyBetaModalFormProps) {
}, },
colProps: { span: 8 }, colProps: { span: 8 },
}, },
{
title: '项目经纬度',
dataIndex: 'location',
colProps: { span: 24 },
fieldProps: {
addonAfter: (
<MyButtons.View
title="获取经纬度"
onClick={() => {
window.open(
'https://api.map.baidu.com/lbsapi/getpoint/index.html',
);
}}
/>
),
},
},
]} ]}
/> />
); );

View File

@ -32,6 +32,15 @@ export default function Index({ title = '房屋列表' }) {
} }
columns={[ columns={[
MyColumns.ID(), MyColumns.ID(),
{
title: '项目名称',
dataIndex: ['asset_project', 'name'],
search: {
transform: (value) => {
return { project_name: value };
},
},
},
{ {
title: '房屋名称', title: '房屋名称',
dataIndex: 'full_name', dataIndex: 'full_name',

View File

@ -4,8 +4,8 @@ import { ProCard } from '@ant-design/pro-components';
import { useParams } from '@umijs/max'; import { useParams } from '@umijs/max';
import { Tabs } from 'antd'; import { Tabs } from 'antd';
import { useEffect, useState } from 'react'; import { useEffect, useState } from 'react';
import BannerList from './components/BannerList'; import ChargeInfo from './components/ChargeInfo';
import BannerSpaceInfo from './components/BannerSpaceInfo'; import HasHouse from './components/HasHouse';
export default function Show({ title }: { title?: string } = {}) { export default function Show({ title }: { title?: string } = {}) {
const { id } = useParams<{ id: string }>(); const { id } = useParams<{ id: string }>();
@ -13,13 +13,13 @@ export default function Show({ title }: { title?: string } = {}) {
// 注册当前页面为标签页 // 注册当前页面为标签页
const { addTab } = usePageTabs({ const { addTab } = usePageTabs({
tabKey: `banner-space-${id}`, tabKey: `charge-standard-${id}`,
tabLabel: data?.name || title || '广告位详情', tabLabel: '收费标准详情',
}); });
const loadShow = () => { const loadShow = () => {
let paramsId: any = { id: id ?? 0 }; let paramsId: any = { id: id ?? 0 };
Apis.Banner.BannerSpaces.Show(paramsId).then((res) => { Apis.HouseCharage.HouseChargeStandards.Show(paramsId).then((res) => {
setShow(res?.data); setShow(res?.data);
}); });
}; };
@ -34,8 +34,8 @@ export default function Show({ title }: { title?: string } = {}) {
key: '1', key: '1',
closable: false, closable: false,
children: ( children: (
<BannerList <HasHouse
item={{ ...data, banner_spaces_id: id }} item={{ ...data, charge_standards_id: id }}
reload={() => loadShow()} reload={() => loadShow()}
/> />
), ),
@ -43,7 +43,7 @@ export default function Show({ title }: { title?: string } = {}) {
]; ];
return ( return (
<MyPageContainer title={title}> <MyPageContainer title={title}>
<BannerSpaceInfo item={data} reload={loadShow} /> <ChargeInfo item={data} reload={loadShow} />
<ProCard style={{ marginTop: 16 }}> <ProCard style={{ marginTop: 16 }}>
<Tabs type="card" items={items} defaultActiveKey="1" size="small" /> <Tabs type="card" items={items} defaultActiveKey="1" size="small" />
</ProCard> </ProCard>

View File

@ -0,0 +1,52 @@
import { MyBetaModalFormProps, renderTextHelper } from '@/common';
import {
HouseBillsTypeEnum,
HouseChargeStandardsCalculationModeEnum,
HouseChargeStandardsCalculationPeriodEnum,
} from '@/gen/Enums';
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
import { Space } from 'antd';
export default function info(props: MyBetaModalFormProps) {
const { item } = props;
return (
<Space direction="vertical" style={{ width: '100%' }}>
<ProCard title="基本信息">
<ProDescriptions bordered>
<ProDescriptions.Item label="收费标准名称" span={2}>
{item?.name}
</ProDescriptions.Item>
<ProDescriptions.Item label="项目名称">
{item?.asset_project?.name}
</ProDescriptions.Item>
<ProDescriptions.Item label="收费项目">
<renderTextHelper.Tag
Enums={HouseBillsTypeEnum}
value={item?.charge_type}
key="type"
/>
</ProDescriptions.Item>
<ProDescriptions.Item label="计费模式">
<renderTextHelper.Tag
Enums={HouseChargeStandardsCalculationModeEnum}
value={item?.calculation_mode}
key="type"
/>
</ProDescriptions.Item>
<ProDescriptions.Item label="账单计费周期">
<renderTextHelper.Tag
Enums={HouseChargeStandardsCalculationPeriodEnum}
value={item?.calculation_period}
key="type"
/>
</ProDescriptions.Item>
<ProDescriptions.Item label="备注">
{item?.remark}
</ProDescriptions.Item>
</ProDescriptions>
</ProCard>
</Space>
);
}

View File

@ -1,9 +1,6 @@
import { MyColumns, MyProTableProps } from '@/common'; import { MyButtons, MyColumns, MyProTableProps } from '@/common';
import { Apis } from '@/gen/Apis'; import { Apis } from '@/gen/Apis';
import { BannersRedirectTypeEnum, BannersTypeEnum } from '@/gen/Enums';
import BannerCreate from '@/pages/banner/modals/BannerCreate'; import BannerCreate from '@/pages/banner/modals/BannerCreate';
import BannerShow from '@/pages/banner/modals/BannerShow';
import BannerUpdate from '@/pages/banner/modals/BannerUpdate';
import { ProTable } from '@ant-design/pro-components'; import { ProTable } from '@ant-design/pro-components';
import { Space } from 'antd'; import { Space } from 'antd';
import { useEffect, useRef } from 'react'; import { useEffect, useRef } from 'react';
@ -23,10 +20,10 @@ export default function Index({ ...rest }) {
MyProTableProps.request( MyProTableProps.request(
{ {
...params, ...params,
banner_spaces_id: rest.item?.banner_spaces_id, house_charge_standards_id: rest.item?.id,
}, },
sort, sort,
Apis.Banner.Banners.List, Apis.HouseCharage.HouseChargeHasHouses.List,
) )
} }
toolBarRender={(action) => [ toolBarRender={(action) => [
@ -44,38 +41,41 @@ export default function Index({ ...rest }) {
columns={[ columns={[
MyColumns.ID(), MyColumns.ID(),
{ {
title: '广告名称', title: '房屋名称',
dataIndex: 'full_name',
},
{
title: '项目名称',
dataIndex: 'project_name',
},
{
title: '楼栋名称',
dataIndex: 'building_name',
},
{
title: '单元名称',
dataIndex: 'unit_name',
},
{
title: '房号',
dataIndex: 'name', dataIndex: 'name',
}, },
MyColumns.EnumTag({
title: '类型',
dataIndex: 'type',
valueEnum: BannersTypeEnum,
search: false,
}),
MyColumns.EnumTag({
title: '跳转类型',
dataIndex: 'redirect_type',
valueEnum: BannersRedirectTypeEnum,
search: false,
}),
{ {
title: '开始时间', title: '绑定时间',
dataIndex: 'start_time', dataIndex: 'updated_at',
valueType: 'dateTime',
search: false,
},
{
title: '结束时间',
dataIndex: 'end_time',
valueType: 'dateTime',
search: false, search: false,
}, },
MyColumns.Option({ MyColumns.Option({
render: (_, item: any, index, action) => ( render: (_, item: any, index, action) => (
<Space key={index}> <Space key={index}>
<BannerShow item={item} reload={action?.reload} /> <MyButtons.Default
<BannerUpdate item={item} reload={action?.reload} /> onConfirm={() =>
Apis.HouseCharage.HouseChargeHasHouses.Delete({
id: item.id,
}).then(() => action?.reload())
}
/>
</Space> </Space>
), ),
}), }),

View File

@ -0,0 +1,145 @@
import {
MyButtons,
MyColumns,
MyPageContainer,
MyProTableProps,
usePageTabs,
} from '@/common';
import { Apis } from '@/gen/Apis';
import {
HouseBillsTypeEnum,
HouseChargeStandardsCalculationMethodEnum,
HouseChargeStandardsCalculationModeEnum,
HouseChargeStandardsCalculationPeriodEnum,
} from '@/gen/Enums';
import { ProTable } from '@ant-design/pro-components';
import { useNavigate } from '@umijs/max';
import { Space } from 'antd';
import ChargeStandardHasHouse from '../asset/components/modals/ChargeStandardHasHouse';
import ChargeStandardUpdate from '../asset/components/modals/ChargeStandardUpdate';
import ChargeCreate from './modals/ChargeCreate';
export default function Index({ title = '收费标准' }) {
const navigate = useNavigate();
// 注册当前页面为标签页
usePageTabs({
tabKey: 'house-charge',
tabLabel: title,
});
return (
<MyPageContainer
title={title}
enableTabs={true}
tabKey="banner-spaces"
tabLabel={title}
>
<ProTable
{...MyProTableProps.props}
request={async (params, sort) =>
MyProTableProps.request(
params,
sort,
Apis.HouseCharage.HouseChargeStandards.List,
)
}
toolBarRender={(action) => [
<ChargeCreate key="Create" reload={action?.reload} title={title} />,
]}
columns={[
MyColumns.ID(),
{
title: '关联项目',
dataIndex: ['asset_project', 'name'],
search: {
transform: (value) => {
return { project_name: value };
},
},
},
{
title: '收费标准名称',
dataIndex: 'name',
search: false,
},
MyColumns.EnumTag({
title: '收费项目',
dataIndex: 'charge_type',
valueEnum: HouseBillsTypeEnum,
}),
MyColumns.EnumTag({
title: '计量单位',
dataIndex: 'calculation_method',
valueEnum: HouseChargeStandardsCalculationMethodEnum,
search: false,
}),
MyColumns.EnumTag({
title: '计费模式',
dataIndex: 'calculation_mode',
valueEnum: HouseChargeStandardsCalculationModeEnum,
search: false,
}),
{
title: '单价',
dataIndex: 'price',
search: false,
},
MyColumns.EnumTag({
title: '账单计费周期',
dataIndex: 'calculation_period',
valueEnum: HouseChargeStandardsCalculationPeriodEnum,
search: false,
}),
{
title: '账单自动生成日期',
dataIndex: 'auto_date',
search: false,
},
{
title: '是否分摊',
dataIndex: 'is_apportionment',
search: false,
render(_, record) {
return `${record?.is_apportionment ? '是' : '否'} `;
},
},
// MyColumns.UpdatedAt(),
// MyColumns.CreatedAt(),
MyColumns.Option({
render: (_, item: any, index, action) => (
<Space key={index}>
<MyButtons.View
title="查看"
onClick={() => {
navigate(`/charge_standard/${item.id}`);
}}
/>
<ChargeStandardUpdate
item={item}
reload={action?.reload}
title="编辑"
/>
<ChargeStandardHasHouse
item={{
...item,
}}
reload={action?.reload}
title={'绑定房屋'}
/>
<MyButtons.Delete
onConfirm={() =>
Apis.HouseCharage.HouseChargeStandards.Delete({
id: item.id,
}).then(() => action?.reload())
}
/>
</Space>
),
}),
]}
/>
</MyPageContainer>
);
}

View File

@ -0,0 +1,447 @@
import {
MyBetaModalFormProps,
MyButtons,
MyFormItems,
MyModalFormProps,
rulesHelper,
} from '@/common';
import { Selects } from '@/components/Select';
import { Apis } from '@/gen/Apis';
import {
HouseBillsTypeEnum,
HouseChargeStandardsApportionmentMethodEnum,
HouseChargeStandardsCalculationMethodEnum,
HouseChargeStandardsCalculationModeEnum,
HouseChargeStandardsCalculationPeriodEnum,
HouseChargeStandardsPriceAlgorithmEnum,
HouseChargeStandardsTypeEnum,
} from '@/gen/Enums';
import { BetaSchemaForm } from '@ant-design/pro-components';
import { Form, message } from 'antd';
import { useRef } from 'react';
export default function Create(props: MyBetaModalFormProps) {
const [form] = Form.useForm();
const actionRef = useRef<any>();
return (
<BetaSchemaForm<ApiTypes.HouseCharage.HouseChargeStandards.Store>
{...MyModalFormProps.props}
title={`创建收费标准`}
wrapperCol={{ span: 24 }}
width="600px"
trigger={<MyButtons.Create title={`创建收费标准`} />}
form={form}
key={new Date().getTime()}
onOpenChange={(open: any) => {
if (open) {
form.resetFields(); // 清空表单数据
}
}}
onFinish={async (values: any) => {
values?.grid_ranges?.forEach((res: { asset_projects_id: string }) => {
res.asset_projects_id = props?.item?.id;
});
return Apis.HouseCharage.HouseChargeStandards.Store({
...values,
asset_projects_id: props?.item?.id,
type:
values.charge_type === HouseBillsTypeEnum.SharedWaterFee.value ||
values.charge_type === HouseBillsTypeEnum.SharedElectricityFee.value
? HouseChargeStandardsTypeEnum.House.value
: HouseChargeStandardsTypeEnum.Meter.value,
is_apportionment:
values.charge_type === HouseBillsTypeEnum.SharedWaterFee.value ||
values.charge_type === HouseBillsTypeEnum.SharedElectricityFee.value
? 1
: 0,
// 按套
calculation_mode:
values?.calculation_method ===
HouseChargeStandardsCalculationMethodEnum.PerUnit.value
? HouseChargeStandardsCalculationModeEnum.FixedAmount.value
: values?.calculation_mode,
// 按固定金额
price_algorithm:
values?.calculation_mode ===
HouseChargeStandardsCalculationModeEnum.FixedAmount.value ||
values?.calculation_method ===
HouseChargeStandardsCalculationMethodEnum.PerUnit.value
? HouseChargeStandardsPriceAlgorithmEnum.Fixed.value
: values?.price_algorithm,
})
.then(() => {
props.reload?.();
message.success('收费标准创建成功');
return true;
})
.catch(() => false);
}}
columns={[
Selects?.AssetProjects({
key: 'asset_projects_id',
title: '项目',
colProps: { span: 12 },
formItemProps: { ...rulesHelper.text },
}),
{
key: 'name',
title: '收费标准名称',
colProps: { span: 12 },
formItemProps: { ...rulesHelper.text },
},
MyFormItems.EnumRadio({
key: 'charge_type',
title: '收费项目',
colProps: { span: 24 },
valueEnum: HouseBillsTypeEnum,
required: true,
}),
{
name: ['charge_type'],
valueType: 'dependency',
columns: ({ charge_type }: any) => {
return charge_type === HouseBillsTypeEnum.SharedWaterFee.value ||
charge_type === HouseBillsTypeEnum.SharedElectricityFee.value
? [
MyFormItems.EnumRadio({
key: 'calculation_method',
title: '分摊方式',
colProps: { span: 18 },
valueEnum: HouseChargeStandardsApportionmentMethodEnum,
required: true,
}),
]
: [];
},
},
// Selects?.AssetProjects({
// key: 'asset_projects_id',
// title: '项目',
// colProps: { span: 12 },
// formItemProps: { ...rulesHelper.text },
// }),
{
name: ['charge_type'],
valueType: 'dependency',
columns: ({ charge_type }: any) => {
return charge_type === HouseBillsTypeEnum.PropertyFee.value ||
charge_type === HouseBillsTypeEnum.MaintenanceFund.value
? [
MyFormItems.EnumRadio({
key: 'calculation_method',
title: '计量单位',
colProps: { span: 16 },
valueEnum: () => {
let obj: any = JSON.parse(
JSON.stringify(
HouseChargeStandardsCalculationMethodEnum,
),
);
delete obj.ElectricityUsage;
delete obj.WaterUsage;
return obj;
},
required: true,
}),
]
: charge_type === HouseBillsTypeEnum.WaterFee.value ||
charge_type === HouseBillsTypeEnum.ElectricityFee.value ||
charge_type === HouseBillsTypeEnum.SharedWaterFee.value ||
charge_type === HouseBillsTypeEnum.SharedElectricityFee.value
? [
MyFormItems.EnumRadio({
key: 'calculation_method',
title: '计量单位',
colProps: { span: 16 },
valueEnum: () => {
let obj: any = JSON.parse(
JSON.stringify(
HouseChargeStandardsCalculationMethodEnum,
),
);
delete obj.ChargeableArea;
delete obj.BuiltArea;
delete obj.InsideArea;
delete obj.PerUnit;
return obj;
},
required: true,
}),
]
: [];
},
},
{
name: ['calculation_method'],
valueType: 'dependency',
columns: ({ calculation_method }: any) => {
return calculation_method ===
HouseChargeStandardsCalculationMethodEnum.PerUnit.value
? [
{
key: 'price',
title: '固定单价',
colProps: { span: 10 },
fieldProps: {
addonAfter: '元',
},
formItemProps: { ...rulesHelper.number },
},
]
: !calculation_method &&
calculation_method !==
HouseChargeStandardsCalculationMethodEnum.PerUnit.value
? []
: [
MyFormItems.EnumRadio({
key: 'calculation_mode',
title: '计费模式',
colProps: { span: 12 },
valueEnum: HouseChargeStandardsCalculationModeEnum,
required: true,
}),
];
},
},
{
name: ['calculation_mode'],
valueType: 'dependency',
columns: ({ calculation_mode }: any) => {
return calculation_mode ===
HouseChargeStandardsCalculationModeEnum.FixedAmount.value
? [
{
key: 'price',
title: '固定单价',
colProps: { span: 10 },
fieldProps: {
addonAfter: '元',
},
formItemProps: { ...rulesHelper.number },
},
]
: calculation_mode ===
HouseChargeStandardsCalculationModeEnum.QuantityPrice.value
? [
MyFormItems.EnumRadio({
key: 'price_algorithm',
title: '计费算法',
colProps: { span: 14 },
valueEnum: HouseChargeStandardsPriceAlgorithmEnum,
required: true,
// fieldProps: {
// onChange: () => {
// // 切换计费算法时清空阶梯配置
// form.setFieldValue('scheme', undefined);
// },
// },
}),
{
name: ['price_algorithm'],
valueType: 'dependency',
columns: ({ price_algorithm }: any) => {
return price_algorithm ===
HouseChargeStandardsPriceAlgorithmEnum.Fixed.value
? [
{
key: 'price',
title: '固定单价',
colProps: { span: 10 },
fieldProps: {
addonAfter: '元',
},
formItemProps: { ...rulesHelper.number },
},
]
: price_algorithm ===
HouseChargeStandardsPriceAlgorithmEnum.Tiered.value
? [
{
valueType: 'formList',
dataIndex: 'scheme',
title: '阶梯标准',
formItemProps: { ...rulesHelper.array },
initialValue: [
{
start: 0,
end: null,
price: null,
},
],
fieldProps: {
actionRef: actionRef,
copyIconProps: false,
// deleteIconProps: false,
},
columns: [
{
valueType: 'group',
colProps: { span: 24 },
columns: [
{
key: 'start',
colProps: { span: 10 },
title: '起始值',
valueType: 'number',
fieldProps: {
min: 0,
addonBefore: (
_: any,
{
field,
}: { field: { index: number[] } },
) => `${field.index[1] + 1}阶梯`,
},
width: '100%',
formItemProps: { ...rulesHelper.number },
},
{
key: 'end',
colProps: { span: 6 },
title: '结束值',
valueType: 'number',
width: '100%',
formItemProps: { ...rulesHelper.number },
fieldProps: { maxLength: 12 },
},
{
key: 'price',
colProps: { span: 8 },
title: '阶梯单价',
valueType: 'number',
fieldProps: {
addonAfter: '元',
min: 0,
},
formItemProps: { ...rulesHelper.number },
},
],
},
],
},
]
: price_algorithm ===
HouseChargeStandardsPriceAlgorithmEnum.Peak.value
? [
{
valueType: 'formList',
dataIndex: 'scheme',
title: '阶梯标准',
formItemProps: { ...rulesHelper.array },
initialValue: [
{
start: 0,
end: null,
price: null,
},
],
fieldProps: {
actionRef: actionRef,
copyIconProps: false,
// deleteIconProps: false,
},
columns: [
{
valueType: 'group',
colProps: { span: 24 },
columns: [
{
key: 'start',
colProps: { span: 10 },
title: '起始值',
valueType: 'number',
fieldProps: {
min: 0,
addonBefore: (
_: any,
{
field,
}: { field: { name: number[] } },
) => `${field.name[1] + 1}阶梯`,
},
width: '100%',
formItemProps: { ...rulesHelper.number },
},
{
key: 'end',
colProps: { span: 6 },
title: '结束值',
valueType: 'number',
width: '100%',
formItemProps: { ...rulesHelper.number },
fieldProps: { maxLength: 12 },
},
{
key: 'price',
colProps: { span: 8 },
title: '阶梯单价',
valueType: 'number',
fieldProps: {
addonAfter: '元',
min: 0,
},
formItemProps: { ...rulesHelper.number },
},
],
},
],
},
]
: [];
},
},
]
: [];
},
},
{
name: ['price', 'price_algorithm'],
valueType: 'dependency',
columns: ({ price, price_algorithm }: any) => {
return price ||
price_algorithm ===
HouseChargeStandardsPriceAlgorithmEnum.Tiered.value ||
price_algorithm ===
HouseChargeStandardsPriceAlgorithmEnum.Peak.value
? [
{
valueType: 'group',
columns: [
MyFormItems.EnumRadio({
key: 'calculation_period',
title: '账单计费周期',
colProps: { span: 14 },
valueEnum: HouseChargeStandardsCalculationPeriodEnum,
required: true,
}),
{
key: 'auto_date',
title: '账单自动生成日期',
colProps: { span: 10 },
valueType: 'date',
width: '100%',
},
{
key: 'remark',
title: '备注',
colProps: { span: 24 },
valueType: 'textarea',
fieldProps: {
rows: 4,
maxLength: 500,
showCount: true,
},
},
],
},
]
: [];
},
},
]}
/>
);
}

View File

@ -48,7 +48,6 @@ export default function Index({ title = '机构列表' }) {
title: '企业名称', title: '企业名称',
dataIndex: 'name', dataIndex: 'name',
}, },
// MyColumns.EnumTag({ // MyColumns.EnumTag({
// title: '类型', // title: '类型',
// dataIndex: 'merchant_type', // dataIndex: 'merchant_type',
@ -76,6 +75,7 @@ export default function Index({ title = '机构列表' }) {
/> />
<MyButtons.View <MyButtons.View
title="配置" title="配置"
data-tooltip-position="top"
onClick={() => { onClick={() => {
navigate(`/company/${item.id}`); navigate(`/company/${item.id}`);
}} }}

View File

@ -12,7 +12,7 @@ import {
import { Apis } from '@/gen/Apis'; import { Apis } from '@/gen/Apis';
import { import {
HouseOccupantsCardTypeEnum, HouseOccupantsCardTypeEnum,
HouseOccupantsRelationWithOwnerEnum, HouseOccupantsResidentialRelationEnum,
HouseRegistersStatusEnum, HouseRegistersStatusEnum,
HouseRegistersTypeEnum, HouseRegistersTypeEnum,
} from '@/gen/Enums'; } from '@/gen/Enums';
@ -91,22 +91,21 @@ export default function Update(props: MyBetaModalFormProps) {
rowKey={(record, index) => record?.id_card || index} rowKey={(record, index) => record?.id_card || index}
size="small" size="small"
columns={[ columns={[
// MyColumns.EnumTag({
// title: '房客关系',
// dataIndex: 'house_relation',
// valueEnum: HouseOccupantsHouseRelationEnum,
// width: 100,
// }),
MyColumns.EnumTag({ MyColumns.EnumTag({
title: title: '居住关系',
props?.item?.status === 'Rented' dataIndex: 'residential_relation',
? '与主租人关系' valueEnum: HouseOccupantsResidentialRelationEnum,
: '与产权人关系',
// title: '关系说明',
dataIndex: 'relation_with_owner',
valueEnum: HouseOccupantsRelationWithOwnerEnum,
search: false,
}), }),
// MyColumns.EnumTag({
// title:
// props?.item?.status === 'Rented'
// ? '与主租人关系'
// : '与产权人关系',
// // title: '关系说明',
// dataIndex: 'relation_with_owner',
// valueEnum: HouseOccupantsRelationWithOwnerEnum,
// search: false,
// }),
{ {
title: '姓名', title: '姓名',
dataIndex: 'name', dataIndex: 'name',

View File

@ -1,31 +0,0 @@
import { MyBetaModalFormProps, renderTextHelper } from '@/common';
import { BannerSpacesTypeEnum } from '@/gen/Enums';
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
import { Space } from 'antd';
export default function info(props: MyBetaModalFormProps) {
const { item } = props;
return (
<Space direction="vertical" style={{ width: '100%' }}>
<ProCard title="基本信息">
<ProDescriptions bordered>
<ProDescriptions.Item label="名称" span={2}>
{item?.name}
</ProDescriptions.Item>
<ProDescriptions.Item label="类型">
<renderTextHelper.Tag
Enums={BannerSpacesTypeEnum}
value={item?.type}
key="type"
/>
</ProDescriptions.Item>
<ProDescriptions.Item label="备注">
{item?.remark}
</ProDescriptions.Item>
</ProDescriptions>
</ProCard>
</Space>
);
}

View File

@ -1,95 +0,0 @@
import {
MyButtons,
MyColumns,
MyPageContainer,
MyProTableProps,
usePageTabs,
} from '@/common';
import { Apis } from '@/gen/Apis';
import { BannerSpacesTypeEnum } from '@/gen/Enums';
import { ProTable } from '@ant-design/pro-components';
import { useNavigate } from '@umijs/max';
import { Space } from 'antd';
import HouseChargeCreate from './modals/HouseChargeCreate';
import HouseChargeUpdate from './modals/HouseChargeUpdate';
export default function Index({ title = '收费标准' }) {
const navigate = useNavigate();
// 注册当前页面为标签页
usePageTabs({
tabKey: 'house-charge',
tabLabel: title,
});
return (
<MyPageContainer
title={title}
enableTabs={true}
tabKey="banner-spaces"
tabLabel={title}
>
<ProTable
{...MyProTableProps.props}
request={async (params, sort) =>
MyProTableProps.request(
params,
sort,
Apis.HouseCharage.HouseChargeStandards.List,
)
}
toolBarRender={(action) => [
<HouseChargeCreate
key="Create"
reload={action?.reload}
title={title}
/>,
]}
columns={[
MyColumns.ID(),
{
title: '广告位名称',
dataIndex: 'name',
},
MyColumns.EnumTag({
title: '类型',
dataIndex: 'type',
valueEnum: BannerSpacesTypeEnum,
search: false,
}),
{
title: '备注',
dataIndex: 'remark',
search: false,
ellipsis: true,
},
MyColumns.CreatedAt(),
MyColumns.Option({
render: (_, item: any, index, action) => (
<Space key={index}>
<MyButtons.View
title="查看"
onClick={() => {
navigate(`/house_charge/${item.id}`);
}}
/>
<HouseChargeUpdate
item={item}
reload={action?.reload}
title={title}
/>
<MyButtons.Delete
onConfirm={() =>
Apis.HouseCharage.HouseChargeStandards.Delete({
id: item.id,
}).then(() => action?.reload())
}
/>
</Space>
),
}),
]}
/>
</MyPageContainer>
);
}

View File

@ -1,227 +0,0 @@
import {
MyBetaModalFormProps,
MyButtons,
MyFormItems,
MyModalFormProps,
rulesHelper,
} from '@/common';
import { Selects } from '@/components/Select';
import { Apis } from '@/gen/Apis';
import {
HouseChargeStandardsApportionmentMethodEnum,
HouseChargeStandardsCalculationMethodEnum,
HouseChargeStandardsCalculationModeEnum,
HouseChargeStandardsCalculationPeriodEnum,
HouseChargeStandardsPriceAlgorithmEnum,
HouseChargeStandardsTypeEnum,
} from '@/gen/Enums';
import { BetaSchemaForm } from '@ant-design/pro-components';
import { Form, message } from 'antd';
import { useRef } from 'react';
export default function Create(props: MyBetaModalFormProps) {
const actionRef = useRef<any>();
const [form] = Form.useForm();
return (
<BetaSchemaForm<ApiTypes.HouseCharage.HouseChargeStandards.Store>
{...MyModalFormProps.props}
title={`添加收费标准`}
wrapperCol={{ span: 24 }}
width="600px"
trigger={<MyButtons.Create title={`添加收费标准`} />}
key={new Date().getTime()}
form={form}
onFinish={async (values) =>
Apis.HouseCharage.HouseChargeStandards.Store(values)
.then(() => {
props.reload?.();
message.success('添加收费标准成功');
return true;
})
.catch(() => false)
}
columns={[
{
key: 'name',
title: '收费标准名称',
colProps: { span: 12 },
formItemProps: { ...rulesHelper.text },
},
MyFormItems.EnumRadio({
key: 'type',
title: '适用对象',
colProps: { span: 12 },
valueEnum: HouseChargeStandardsTypeEnum,
required: true,
}),
Selects?.AssetProjects({
key: 'asset_projects_id',
title: '项目',
colProps: { span: 12 },
formItemProps: { ...rulesHelper.text },
}),
MyFormItems.EnumRadio({
key: 'calculation_mode',
title: '计费模式',
colProps: { span: 12 },
valueEnum: HouseChargeStandardsCalculationModeEnum,
required: true,
}),
MyFormItems.EnumRadio({
key: 'calculation_method',
title: '计量单位',
colProps: { span: 24 },
valueEnum: HouseChargeStandardsCalculationMethodEnum,
required: true,
}),
MyFormItems.EnumRadio({
key: 'price_algorithm',
title: '计费算法',
colProps: { span: 14 },
valueEnum: HouseChargeStandardsPriceAlgorithmEnum,
required: true,
fieldProps: {
onChange: () => {
// 切换计费算法时清空阶梯配置
form.setFieldValue('scheme', undefined);
},
},
}),
{
valueType: '',
},
{
name: ['price_algorithm'],
valueType: 'dependency',
columns: ({ price_algorithm }: any) => {
return price_algorithm ===
HouseChargeStandardsPriceAlgorithmEnum.Fixed.value
? [
{
key: 'price',
title: '固定单价',
colProps: { span: 10 },
fieldProps: {
addonAfter: '元',
},
},
]
: price_algorithm ===
HouseChargeStandardsPriceAlgorithmEnum.Tiered.value
? [
{
valueType: 'formList',
dataIndex: 'scheme',
title: '阶梯标准',
formItemProps: { ...rulesHelper.array },
initialValue: [
{
start: 0,
end: null,
price: null,
},
],
fieldProps: {
actionRef: actionRef,
copyIconProps: false,
// deleteIconProps: false,
},
columns: [
{
valueType: 'group',
colProps: { span: 24 },
columns: [
{
key: 'start',
colProps: { span: 7 },
title: '起始值',
valueType: 'number',
fieldProps: { min: 0 },
width: '100%',
formItemProps: { ...rulesHelper.number },
},
{
key: 'end',
colProps: { span: 7 },
title: '结束值',
valueType: 'number',
width: '100%',
formItemProps: { ...rulesHelper.number },
fieldProps: { maxLength: 12 },
},
{
key: 'price',
colProps: { span: 8 },
title: '阶梯单价',
valueType: 'number',
fieldProps: {
addonAfter: '元',
min: 0,
},
formItemProps: { ...rulesHelper.number },
},
],
},
],
},
]
: price_algorithm ===
HouseChargeStandardsPriceAlgorithmEnum.Peak.value
? []
: [];
},
},
{
valueType: 'group',
columns: [
{
title: '是否分摊',
dataIndex: 'is_apportionment',
colProps: { span: 6 },
valueType: 'switch',
formItemProps: { ...rulesHelper.text },
},
{
name: ['is_apportionment'],
valueType: 'dependency',
columns: ({ is_apportionment }: any) => {
return is_apportionment
? [
MyFormItems.EnumRadio({
key: 'calculation_method',
title: '计量单位',
colProps: { span: 18 },
valueEnum: HouseChargeStandardsApportionmentMethodEnum,
required: true,
}),
]
: [];
},
},
],
},
MyFormItems.EnumRadio({
key: 'calculation_period',
title: '计费周期',
colProps: { span: 18 },
valueEnum: HouseChargeStandardsCalculationPeriodEnum,
required: true,
}),
{
key: 'remark',
title: '备注',
valueType: 'textarea',
colProps: { span: 24 },
fieldProps: {
rows: 4,
maxLength: 500,
showCount: true,
},
},
]}
/>
);
}

View File

@ -1,66 +0,0 @@
import {
MyBetaModalFormProps,
MyButtons,
MyFormItems,
MyModalFormProps,
rulesHelper,
} from '@/common';
import { Apis } from '@/gen/Apis';
import { BannerSpacesTypeEnum } from '@/gen/Enums';
import { BetaSchemaForm } from '@ant-design/pro-components';
import { Form, message } from 'antd';
export default function Update(props: MyBetaModalFormProps) {
const [form] = Form.useForm();
return (
<BetaSchemaForm<ApiTypes.Banner.BannerSpaces.Update>
{...MyModalFormProps.props}
title={`编辑广告位`}
trigger={<MyButtons.Edit />}
wrapperCol={{ span: 24 }}
width="600px"
key={new Date().getTime()}
form={form}
onOpenChange={(open: any) => {
if (open && props.item) {
form.setFieldsValue(props.item);
}
}}
onFinish={async (values) =>
Apis.Banner.BannerSpaces.Update({ ...values, id: props.item?.id ?? 0 })
.then(() => {
props.reload?.();
message.success('编辑广告位成功');
return true;
})
.catch(() => false)
}
columns={[
{
key: 'name',
title: '广告位名称',
colProps: { span: 24 },
formItemProps: { ...rulesHelper.text },
},
MyFormItems.EnumRadio({
key: 'type',
title: '类型',
colProps: { span: 24 },
valueEnum: BannerSpacesTypeEnum,
required: true,
}),
{
key: 'remark',
title: '备注',
valueType: 'textarea',
colProps: { span: 24 },
fieldProps: {
rows: 4,
maxLength: 500,
showCount: true,
},
},
]}
/>
);
}