feat:房屋登记

This commit is contained in:
uiuJun 2025-07-10 18:01:45 +08:00
parent a7727d432b
commit 3d3e5c260c
33 changed files with 1761 additions and 470 deletions

View File

@ -13,6 +13,27 @@ export const rulesHelper = {
}),
] as Rule[],
},
phone: {
required: true,
rules: [
() => ({
validator(_, value) {
let phoneRegex = /^1[3-9]\d{9}$/;
if (!value) {
return Promise.reject(new Error('请输入手机号'));
}
if (value?.length !== 11) {
return Promise.reject(new Error('手机号至少11位'));
}
if (!phoneRegex.test(value)) {
return Promise.reject(new Error('请输入正确的手机号'));
}
return Promise.resolve();
},
}),
] as Rule[],
},
upload(props?: { max?: number; errMsg?: string }) {
return {
required: true,

View File

@ -250,6 +250,40 @@ export const Selects = {
},
};
},
//岗位
Positions(props?: PropsType): ReturnType {
const {
title = '岗位',
key = 'positions_id',
required = false,
hideInTable = true,
...rest
} = props ?? {};
return {
title: title,
key: key,
valueType: 'select',
hideInTable: hideInTable,
formItemProps: { ...(required ? rulesHelper.number : {}) },
request: async (params) =>
(
await Apis.Company.CompanyPositions.Select({
keywords: params?.KeyWords,
...params,
})
).data,
...rest,
fieldProps: {
showSearch: true,
fieldNames: {
label: 'label',
value: 'value',
},
...rest?.fieldProps,
},
};
},
//项目
AssetProjects(props?: PropsType): ReturnType {
const {

10
src/gen/ApiTypes.d.ts vendored
View File

@ -2,8 +2,8 @@ declare namespace ApiTypes {
namespace Archive {
namespace HouseOccupants {
type List = {
"asset_houses_id": number; // 资产房屋ID
"status"?: number; // 状态,[enum:HouseOccupantsStatusEnum]
"asset_houses_id"?: number; // 资产房屋ID
"status"?: string; // 状态,[enum:HouseOccupantsStatusEnum]
};
type Show = {
"id": number; // id
@ -23,6 +23,7 @@ declare namespace ApiTypes {
"usage_plan"?: string; // 使用计划,[enum:HouseRegistersUsagePlanEnum]
"customer_type"?: string; // 客户类型,[enum:HouseRegistersCustomerTypeEnum]
"customer_info"?: string[]; // 客户信息
"ownership_info"?: string[]; // 产权信息
};
type Update = {
"id": number; // id
@ -32,6 +33,7 @@ declare namespace ApiTypes {
"usage_plan"?: string; // 使用计划,[enum:HouseRegistersUsagePlanEnum]
"customer_type"?: string; // 客户类型,[enum:HouseRegistersCustomerTypeEnum]
"customer_info"?: string[]; // 客户信息
"ownership_info"?: string[]; // 产权信息
};
type Show = {
"id": number; // id
@ -193,6 +195,10 @@ declare namespace ApiTypes {
"takeover_date"?: Date; // 接管日期
"closure_date"?: Date; // 封园日期
};
type BindCompany = {
"projects_id": number; // 项目id
"companies_id": number; // 机构id
};
type Show = {
"id": number; // id
};

View File

@ -4,7 +4,7 @@ import { request } from '@umijs/max';
export const Apis = {
Archive: {
HouseOccupants: {
List(data: ApiTypes.Archive.HouseOccupants.List): Promise<MyResponseType> {
List(data?: ApiTypes.Archive.HouseOccupants.List): Promise<MyResponseType> {
return request('admin/archive/house_occupants/list', { data });
},
Show(data: ApiTypes.Archive.HouseOccupants.Show): Promise<MyResponseType> {
@ -89,6 +89,9 @@ export const Apis = {
Update(data: ApiTypes.Asset.AssetProjects.Update): Promise<MyResponseType> {
return request('admin/asset/asset_projects/update', { data });
},
BindCompany(data: ApiTypes.Asset.AssetProjects.BindCompany): Promise<MyResponseType> {
return request('admin/asset/asset_projects/bind_company', { data });
},
Show(data: ApiTypes.Asset.AssetProjects.Show): Promise<MyResponseType> {
return request('admin/asset/asset_projects/show', { data });
},

View File

@ -1,242 +1,371 @@
// AssetHousesOrientationEnum
export const AssetHousesOrientationEnum= {
'East': {"text":"东","color":"#007bff","value":"East"},
'South': {"text":"南","color":"#28a745","value":"South"},
'West': {"text":"西","color":"#ffc107","value":"West"},
'North': {"text":"北","color":"#dc3545","value":"North"},
'Southeast': {"text":"东南","color":"#20c997","value":"Southeast"},
'Northeast': {"text":"东北","color":"#6f42c1","value":"Northeast"},
'Southwest': {"text":"西南","color":"#fd7e14","value":"Southwest"},
'Northwest': {"text":"西北","color":"#17a2b8","value":"Northwest"},
'EastWest': {"text":"东西","color":"#6610f2","value":"EastWest"},
'SouthNorth': {"text":"南北","color":"#e83e8c","value":"SouthNorth"},
export const AssetHousesOrientationEnum = {
East: { text: '东', color: '#007bff', value: 'East' },
South: { text: '南', color: '#28a745', value: 'South' },
West: { text: '西', color: '#ffc107', value: 'West' },
North: { text: '北', color: '#dc3545', value: 'North' },
Southeast: { text: '东南', color: '#20c997', value: 'Southeast' },
Northeast: { text: '东北', color: '#6f42c1', value: 'Northeast' },
Southwest: { text: '西南', color: '#fd7e14', value: 'Southwest' },
Northwest: { text: '西北', color: '#17a2b8', value: 'Northwest' },
EastWest: { text: '东西', color: '#6610f2', value: 'EastWest' },
SouthNorth: { text: '南北', color: '#e83e8c', value: 'SouthNorth' },
};
// AssetHousesOwnershipTypeEnum
export const AssetHousesOwnershipTypeEnum= {
'CommodityHousing': {"text":"商品房","color":"#007bff","value":"CommodityHousing"},
'FundedHousing': {"text":"集资房","color":"#28a745","value":"FundedHousing"},
'MilitaryHousing': {"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"},
export const AssetHousesOwnershipTypeEnum = {
CommodityHousing: {
text: '商品房',
color: '#007bff',
value: 'CommodityHousing',
},
FundedHousing: { text: '集资房', color: '#28a745', value: 'FundedHousing' },
MilitaryHousing: {
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',
},
};
// AssetHousesStatusEnum
export const AssetHousesStatusEnum= {
'Unsold': {"text":"未售","color":"#6c757d","value":"Unsold"},
'SoldNotDelivered': {"text":"已售未交房","color":"#ffc107","value":"SoldNotDelivered"},
'SelfOccupied': {"text":"自住","color":"#28a745","value":"SelfOccupied"},
'Rented': {"text":"出租","color":"#007bff","value":"Rented"},
'Vacant': {"text":"空置","color":"#dc3545","value":"Vacant"},
export const AssetHousesStatusEnum = {
Unsold: { text: '未售', color: '#6c757d', value: 'Unsold' },
SoldNotDelivered: {
text: '已售未交房',
color: '#ffc107',
value: 'SoldNotDelivered',
},
SelfOccupied: { text: '自住', color: '#28a745', value: 'SelfOccupied' },
Rented: { text: '出租', color: '#007bff', value: 'Rented' },
Vacant: { text: '空置', color: '#dc3545', value: 'Vacant' },
};
// AssetHousesUsageEnum
export const AssetHousesUsageEnum= {
'Residence': {"text":"住宅","color":"#007bff","value":"Residence"},
'Apartment': {"text":"公寓","color":"#28a745","value":"Apartment"},
'Villa': {"text":"别墅","color":"#17a2b8","value":"Villa"},
'Shop': {"text":"商铺","color":"#ffc107","value":"Shop"},
'ParkingSpace': {"text":"车位","color":"#6c757d","value":"ParkingSpace"},
'Office': {"text":"写字楼","color":"#6610f2","value":"Office"},
'Clubhouse': {"text":"会所","color":"#fd7e14","value":"Clubhouse"},
'PropertyRoom': {"text":"物业用房","color":"#dc3545","value":"PropertyRoom"},
export const AssetHousesUsageEnum = {
Residence: { text: '住宅', color: '#007bff', value: 'Residence' },
Apartment: { text: '公寓', color: '#28a745', value: 'Apartment' },
Villa: { text: '别墅', color: '#17a2b8', value: 'Villa' },
Shop: { text: '商铺', color: '#ffc107', value: 'Shop' },
ParkingSpace: { text: '车位', color: '#6c757d', value: 'ParkingSpace' },
Office: { text: '写字楼', color: '#6610f2', value: 'Office' },
Clubhouse: { text: '会所', color: '#fd7e14', value: 'Clubhouse' },
PropertyRoom: { text: '物业用房', color: '#dc3545', value: 'PropertyRoom' },
};
// AssetProjectsChargeEnum
export const AssetProjectsChargeEnum= {
'Contract': {"text":"包干制","color":"#007bff","value":"Contract"},
'Commission': {"text":"酬金制","color":"#28a745","value":"Commission"},
export const AssetProjectsChargeEnum = {
Contract: { text: '包干制', color: '#007bff', value: 'Contract' },
Commission: { text: '酬金制', color: '#28a745', value: 'Commission' },
};
// AssetProjectsEntrustTypeEnum
export const AssetProjectsEntrustTypeEnum= {
'DeveloperJointEntrust': {"text":"开发商全委","color":"#007bff","value":"DeveloperJointEntrust"},
'OwnersFullEntrust': {"text":"业委会全委","color":"#28a745","value":"OwnersFullEntrust"},
'GovernmentFullEntrust': {"text":"政府类全委","color":"#ffc107","value":"GovernmentFullEntrust"},
export const AssetProjectsEntrustTypeEnum = {
DeveloperJointEntrust: {
text: '开发商全委',
color: '#007bff',
value: 'DeveloperJointEntrust',
},
OwnersFullEntrust: {
text: '业委会全委',
color: '#28a745',
value: 'OwnersFullEntrust',
},
GovernmentFullEntrust: {
text: '政府类全委',
color: '#ffc107',
value: 'GovernmentFullEntrust',
},
};
// AssetProjectsPropertyTypeEnum
export const AssetProjectsPropertyTypeEnum= {
'Residence': {"text":"住宅","color":"#ff0000","value":"Residence"},
'Commercial': {"text":"商业","color":"#ff6600","value":"Commercial"},
'Office': {"text":"办公","color":"#ffcc00","value":"Office"},
'IndustrialPark': {"text":"产业园","color":"#00cc66","value":"IndustrialPark"},
'Complex': {"text":"综合体","color":"#0099ff","value":"Complex"},
'Municipal': {"text":"市政设施","color":"#6633cc","value":"Municipal"},
'Venue': {"text":"场馆","color":"#9966ff","value":"Venue"},
'Education': {"text":"教育","color":"#339999","value":"Education"},
'Medical': {"text":"医疗","color":"#cc3366","value":"Medical"},
export const AssetProjectsPropertyTypeEnum = {
Residence: { text: '住宅', color: '#ff0000', value: 'Residence' },
Commercial: { text: '商业', color: '#ff6600', value: 'Commercial' },
Office: { text: '办公', color: '#ffcc00', value: 'Office' },
IndustrialPark: { text: '产业园', color: '#00cc66', value: 'IndustrialPark' },
Complex: { text: '综合体', color: '#0099ff', value: 'Complex' },
Municipal: { text: '市政设施', color: '#6633cc', value: 'Municipal' },
Venue: { text: '场馆', color: '#9966ff', value: 'Venue' },
Education: { text: '教育', color: '#339999', value: 'Education' },
Medical: { text: '医疗', color: '#cc3366', value: 'Medical' },
};
// AssetProjectsStatusEnum
export const AssetProjectsStatusEnum= {
'SignedNotDelivered': {"text":"签约未交付","color":"#6c757d","value":"SignedNotDelivered"},
'RollingDevelopment': {"text":"滚动开发","color":"#007bff","value":"RollingDevelopment"},
'ManagedAndClosed': {"text":"在管封园","color":"#ffc107","value":"ManagedAndClosed"},
'Exited': {"text":"退出","color":"#dc3545","value":"Exited"},
export const AssetProjectsStatusEnum = {
SignedNotDelivered: {
text: '签约未交付',
color: '#6c757d',
value: 'SignedNotDelivered',
},
RollingDevelopment: {
text: '滚动开发',
color: '#007bff',
value: 'RollingDevelopment',
},
ManagedAndClosed: {
text: '在管封园',
color: '#ffc107',
value: 'ManagedAndClosed',
},
Exited: { text: '退出', color: '#dc3545', value: 'Exited' },
};
// AssetUnitsBuildingStructureEnum
export const AssetUnitsBuildingStructureEnum= {
'SteelConcrete': {"text":"钢混","color":"#007bff","value":"SteelConcrete"},
'SteelStructure': {"text":"钢结构","color":"#28a745","value":"SteelStructure"},
'BrickConcrete': {"text":"砖混","color":"#ffc107","value":"BrickConcrete"},
'BrickWood': {"text":"砖木","color":"#dc3545","value":"BrickWood"},
export const AssetUnitsBuildingStructureEnum = {
SteelConcrete: { text: '钢混', color: '#007bff', value: 'SteelConcrete' },
SteelStructure: { text: '钢结构', color: '#28a745', value: 'SteelStructure' },
BrickConcrete: { text: '砖混', color: '#ffc107', value: 'BrickConcrete' },
BrickWood: { text: '砖木', color: '#dc3545', value: 'BrickWood' },
};
// AssetUnitsBuildingTypeEnum
export const AssetUnitsBuildingTypeEnum= {
'SlabAndTower': {"text":"板塔结合","color":"#007bff","value":"SlabAndTower"},
'Slab': {"text":"板楼","color":"#28a745","value":"Slab"},
'Tower': {"text":"塔楼","color":"#ffc107","value":"Tower"},
export const AssetUnitsBuildingTypeEnum = {
SlabAndTower: { text: '板塔结合', color: '#007bff', value: 'SlabAndTower' },
Slab: { text: '板楼', color: '#28a745', value: 'Slab' },
Tower: { text: '塔楼', color: '#ffc107', value: 'Tower' },
};
// 缓存类型
export const CacheTypeEnum = {
MobilePhoneVerificationCode: {
text: '手机验证码',
color: '#3be235',
value: 'MobilePhoneVerificationCode',
},
};
// CompaniesMerchantTypeEnum
export const CompaniesMerchantTypeEnum= {
'PropertyManagement': {"text":"物业公司","color":"#007bff","value":"PropertyManagement"},
'ServiceProvider': {"text":"服务商","color":"#28a745","value":"ServiceProvider"},
export const CompaniesMerchantTypeEnum = {
PropertyManagement: {
text: '物业公司',
color: '#007bff',
value: 'PropertyManagement',
},
ServiceProvider: {
text: '服务商',
color: '#28a745',
value: 'ServiceProvider',
},
};
// CompanyAppsAppTypeEnum
export const CompanyAppsAppTypeEnum = {
MiniProgram: { text: '微信小程序', color: '#3b82f6', value: 'MiniProgram' },
MpOfficial: { text: '微信公众号', color: '#22c55e', value: 'MpOfficial' },
WorkWechat: { text: '企业微信', color: '#6366f1', value: 'WorkWechat' },
};
// CompanyAppsModuleEnum
export const CompanyAppsModuleEnum = {
Employee: { text: '员工端', color: '#3b82f6', value: 'Employee' },
Customer: { text: '客户端', color: '#10b981', value: 'Customer' },
};
// CompanyReceiptAccountsPayChannelEnum
export const CompanyReceiptAccountsPayChannelEnum= {
'WeChat': {"text":"微信","color":"#07c160","value":"WeChat"},
'Alipay': {"text":"支付宝","color":"#1677ff","value":"Alipay"},
'BankTransfer': {"text":"银行转账","color":"#6c757d","value":"BankTransfer"},
'TongLian': {"text":"通联支付","color":"#ff9f0a","value":"TongLian"},
export const CompanyReceiptAccountsPayChannelEnum = {
WeChat: { text: '微信', color: '#07c160', value: 'WeChat' },
Alipay: { text: '支付宝', color: '#1677ff', value: 'Alipay' },
BankTransfer: { text: '银行转账', color: '#6c757d', value: 'BankTransfer' },
TongLian: { text: '通联支付', color: '#ff9f0a', value: 'TongLian' },
};
// 账单状态枚举
export const HouseBillsBillStatusEnum= {
'PendingPayment': {"text":"待支付","color":"#facc15","value":"PendingPayment"},
'PartiallyPaid': {"text":"部分支付","color":"#60a5fa","value":"PartiallyPaid"},
'Paid': {"text":"已支付","color":"#10b981","value":"Paid"},
'Overdue': {"text":"已逾期","color":"#ef4444","value":"Overdue"},
'Cancelled': {"text":"已取消","color":"#9ca3af","value":"Cancelled"},
export const HouseBillsBillStatusEnum = {
PendingPayment: { text: '待支付', color: '#facc15', value: 'PendingPayment' },
PartiallyPaid: { text: '部分支付', color: '#60a5fa', value: 'PartiallyPaid' },
Paid: { text: '已支付', color: '#10b981', value: 'Paid' },
Overdue: { text: '已逾期', color: '#ef4444', value: 'Overdue' },
Cancelled: { text: '已取消', color: '#9ca3af', value: 'Cancelled' },
};
// 房屋账单类型枚举
export const HouseBillsTypeEnum= {
'PropertyFee': {"text":"物业费","color":"#3b82f6","value":"PropertyFee"},
'MaintenanceFund': {"text":"维修基金","color":"#10b981","value":"MaintenanceFund"},
'WaterFee': {"text":"水费","color":"#06b6d4","value":"WaterFee"},
'ElectricityFee': {"text":"电费","color":"#f59e0b","value":"ElectricityFee"},
'SharedWaterFee': {"text":"公摊水费","color":"#8b5cf6","value":"SharedWaterFee"},
'SharedElectricityFee': {"text":"公摊电费","color":"#ec4899","value":"SharedElectricityFee"},
export const HouseBillsTypeEnum = {
PropertyFee: { text: '物业费', color: '#3b82f6', value: 'PropertyFee' },
MaintenanceFund: {
text: '维修基金',
color: '#10b981',
value: 'MaintenanceFund',
},
WaterFee: { text: '水费', color: '#06b6d4', value: 'WaterFee' },
ElectricityFee: { text: '电费', color: '#f59e0b', value: 'ElectricityFee' },
SharedWaterFee: {
text: '公摊水费',
color: '#8b5cf6',
value: 'SharedWaterFee',
},
SharedElectricityFee: {
text: '公摊电费',
color: '#ec4899',
value: 'SharedElectricityFee',
},
};
// HouseOccupantsCardTypeEnum
export const HouseOccupantsCardTypeEnum= {
'MainlandID': {"text":"中国大陆居民身份证","color":"#2db7f5","value":"MainlandID"},
'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"},
export const HouseOccupantsCardTypeEnum = {
MainlandID: {
text: '中国大陆居民身份证',
color: '#2db7f5',
value: 'MainlandID',
},
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
export const HouseOccupantsHouseRelationEnum= {
'Owner': {"text":"产权人","color":"#2db7f5","value":"Owner"},
'Resident': {"text":"住户","color":"#87d068","value":"Resident"},
'Tenant': {"text":"租户","color":"#fa8c16","value":"Tenant"},
export const HouseOccupantsHouseRelationEnum = {
Owner: { text: '产权人', color: '#2db7f5', value: 'Owner' },
Resident: { text: '住户', color: '#87d068', value: 'Resident' },
Tenant: { text: '租客', color: '#fa8c16', value: 'Tenant' },
};
// HouseOccupantsRelationWithOwnerEnum
export const HouseOccupantsRelationWithOwnerEnum= {
'Self': {"text":"本人","color":"#52c41a","value":"Self"},
'Spouse': {"text":"夫妻","color":"#2db7f5","value":"Spouse"},
'FatherSon': {"text":"父子","color":"#faad14","value":"FatherSon"},
'MotherSon': {"text":"母子","color":"#fa8c16","value":"MotherSon"},
'Children': {"text":"子女","color":"#87d068","value":"Children"},
'ContactPerson': {"text":"指定联系人","color":"#f5222d","value":"ContactPerson"},
export const HouseOccupantsRelationWithOwnerEnum = {
Self: { text: '本人', color: '#52c41a', value: 'Self' },
Spouse: { text: '夫妻', color: '#2db7f5', value: 'Spouse' },
FatherSon: { text: '父子', color: '#faad14', value: 'FatherSon' },
MotherSon: { text: '母子', color: '#fa8c16', value: 'MotherSon' },
Children: { text: '子女', color: '#87d068', value: 'Children' },
ContactPerson: {
text: '指定联系人',
color: '#f5222d',
value: 'ContactPerson',
},
};
// HouseOccupantsStatusEnum
export const HouseOccupantsStatusEnum= {
'Normal': {"text":"正常","color":"#52c41a","value":"Normal"},
'Unbound': {"text":"已解除","color":"#f5222d","value":"Unbound"},
export const HouseOccupantsStatusEnum = {
Normal: { text: '正常', color: '#52c41a', value: 'Normal' },
Unbound: { text: '已解除', color: '#f5222d', value: 'Unbound' },
};
// 订单状态枚举
export const HouseOrdersOrderStatusEnum= {
'Pending': {"text":"待支付","color":"#facc15","value":"Pending"},
'Paid': {"text":"已支付","color":"#10b981","value":"Paid"},
'Refunded': {"text":"已退款","color":"#60a5fa","value":"Refunded"},
'Cancelled': {"text":"已取消","color":"#9ca3af","value":"Cancelled"},
export const HouseOrdersOrderStatusEnum = {
Pending: { text: '待支付', color: '#facc15', value: 'Pending' },
Paid: { text: '已支付', color: '#10b981', value: 'Paid' },
Refunded: { text: '已退款', color: '#60a5fa', value: 'Refunded' },
Cancelled: { text: '已取消', color: '#9ca3af', value: 'Cancelled' },
};
// HouseOrdersPaymentMethodEnum
export const HouseOrdersPaymentMethodEnum= {
'WeChat': {"text":"微信","color":"#07c160","value":"WeChat"},
'Alipay': {"text":"支付宝","color":"#1677ff","value":"Alipay"},
'BankTransfer': {"text":"银行转账","color":"#6c757d","value":"BankTransfer"},
'TongLian': {"text":"通联支付","color":"#ff9f0a","value":"TongLian"},
export const HouseOrdersPaymentMethodEnum = {
WeChat: { text: '微信', color: '#07c160', value: 'WeChat' },
Alipay: { text: '支付宝', color: '#1677ff', value: 'Alipay' },
BankTransfer: { text: '银行转账', color: '#6c757d', value: 'BankTransfer' },
TongLian: { text: '通联支付', color: '#ff9f0a', value: 'TongLian' },
};
// HouseRegistersCustomerTypeEnum
export const HouseRegistersCustomerTypeEnum= {
'Individual': {"text":"个人客户","color":"#2db7f5","value":"Individual"},
'Enterprise': {"text":"普通企业","color":"#87d068","value":"Enterprise"},
'Developer': {"text":"开发企业","color":"#fa8c16","value":"Developer"},
'Government': {"text":"政府组织","color":"#f5222d","value":"Government"},
export const HouseRegistersCustomerTypeEnum = {
Individual: { text: '个人客户', color: '#2db7f5', value: 'Individual' },
Enterprise: { text: '普通企业', color: '#87d068', value: 'Enterprise' },
Developer: { text: '开发企业', color: '#fa8c16', value: 'Developer' },
Government: { text: '政府组织', color: '#f5222d', value: 'Government' },
};
// HouseRegistersHouseStatusEnum
export const HouseRegistersHouseStatusEnum= {
'SelfOccupied': {"text":"自住","color":"#28a745","value":"SelfOccupied"},
'Rented': {"text":"出租","color":"#007bff","value":"Rented"},
'Vacant': {"text":"空置","color":"#dc3545","value":"Vacant"},
export const HouseRegistersHouseStatusEnum = {
SelfOccupied: { text: '自住', color: '#28a745', value: 'SelfOccupied' },
Rented: { text: '出租', color: '#007bff', value: 'Rented' },
Vacant: { text: '空置', color: '#dc3545', value: 'Vacant' },
};
// HouseRegistersStatusEnum
export const HouseRegistersStatusEnum= {
'Pending': {"text":"待审","color":"#faad14","value":"Pending"},
'Approved': {"text":"已审","color":"#52c41a","value":"Approved"},
'Rejected': {"text":"驳回","color":"#f5222d","value":"Rejected"},
export const HouseRegistersStatusEnum = {
Pending: { text: '待审', color: '#faad14', value: 'Pending' },
Approved: { text: '已审', color: '#52c41a', value: 'Approved' },
Rejected: { text: '驳回', color: '#f5222d', value: 'Rejected' },
};
// HouseRegistersTypeEnum
export const HouseRegistersTypeEnum= {
'Delivery': {"text":"交付登记","color":"#2db7f5","value":"Delivery"},
'Transfer': {"text":"过户登记","color":"#87d068","value":"Transfer"},
'AddOccupant': {"text":"添加住户","color":"#108ee9","value":"AddOccupant"},
export const HouseRegistersTypeEnum = {
Delivery: { text: '交付登记', color: '#2db7f5', value: 'Delivery' },
Transfer: { text: '过户登记', color: '#87d068', value: 'Transfer' },
AddOccupant: { text: '添加住户', color: '#108ee9', value: 'AddOccupant' },
MoveOut: { text: '搬离登记', color: '#f50', value: 'MoveOut' },
};
// HouseRegistersUsagePlanEnum
export const HouseRegistersUsagePlanEnum= {
'Permanent': {"text":"常住","color":"#52c41a","value":"Permanent"},
'Vacation': {"text":"度假","color":"#faad14","value":"Vacation"},
'Rental': {"text":"出租","color":"#2db7f5","value":"Rental"},
'Commercial': {"text":"商用","color":"#f5222d","value":"Commercial"},
export const HouseRegistersUsagePlanEnum = {
Permanent: { text: '常住', color: '#52c41a', value: 'Permanent' },
Vacation: { text: '度假', color: '#faad14', value: 'Vacation' },
Rental: { text: '出租', color: '#2db7f5', value: 'Rental' },
Commercial: { text: '商用', color: '#f5222d', value: 'Commercial' },
};
// OrganizationsTypeEnum
export const OrganizationsTypeEnum= {
'Group': {"text":"集团","color":"#007bff","value":"Group"},
'Company': {"text":"公司","color":"#28a745","value":"Company"},
'ManagementOffice': {"text":"管理处","color":"#ffc107","value":"ManagementOffice"},
'Department': {"text":"部门","color":"#dc3545","value":"Department"},
export const OrganizationsTypeEnum = {
Group: { text: '集团', color: '#007bff', value: 'Group' },
Company: { text: '公司', color: '#28a745', value: 'Company' },
ManagementOffice: {
text: '管理处',
color: '#ffc107',
value: 'ManagementOffice',
},
Department: { text: '部门', color: '#dc3545', value: 'Department' },
};
// 性别
export const SexEnum= {
'Male': {"text":"男","color":"#0000ff","value":"Male"},
'FeMale': {"text":"女","color":"#ff0000","value":"FeMale"},
export const SexEnum = {
Male: { text: '男', color: '#0000ff', value: 'Male' },
FeMale: { text: '女', color: '#ff0000', value: 'FeMale' },
};
// SysModuleEnum
export const SysModuleEnum= {
'Admin': {"text":"管理员","color":"#cf1322","value":"Admin"},
'Customer': {"text":"客户","color":"#d4b106","value":"Customer"},
export const SysModuleEnum = {
Admin: { text: '管理员', color: '#cf1322', value: 'Admin' },
Customer: { text: '客户', color: '#d4b106', value: 'Customer' },
};
// SysPermissionsTypeEnum
export const SysPermissionsTypeEnum= {
'Directory': {"text":"目录","color":"#6d7e14","value":"Directory"},
'Page': {"text":"页面","color":"#4d9a13","value":"Page"},
'Button': {"text":"按钮","color":"#97224f","value":"Button"},
export const SysPermissionsTypeEnum = {
Directory: { text: '目录', color: '#6d7e14', value: 'Directory' },
Page: { text: '页面', color: '#4d9a13', value: 'Page' },
Button: { text: '按钮', color: '#97224f', value: 'Button' },
};
// WechatAuthsPlatformEnum
export const WechatAuthsPlatformEnum = {
MiniProgram: { text: '微信小程序', color: '#3b82f6', value: 'MiniProgram' },
MpOfficial: { text: '微信公众号', color: '#22c55e', value: 'MpOfficial' },
WorkWechat: { text: '企业微信', color: '#6366f1', value: 'WorkWechat' },
};

View File

@ -0,0 +1,46 @@
import { MyPageContainer } from '@/common';
import { Apis } from '@/gen/Apis';
import { ProCard } from '@ant-design/pro-components';
import { useParams } from '@umijs/max';
import { Tabs } from 'antd';
import { useEffect, useState } from 'react';
import HouseInfo from './components/HouseInfo';
import OccupantsNow from './table/OccupantsNow';
export default function Show({ title = '房屋详情' }) {
const { id } = useParams<{ id: string }>();
const [data, setShow] = useState<any>({});
const loadShow = () => {
let paramsId: any = { id: id ?? 0 };
Apis.Asset.AssetHouses.Show(paramsId).then((res) => {
setShow(res?.data);
});
};
useEffect(() => {
loadShow();
}, [id]);
let items = [
{
label: '当前信息',
key: '1',
closable: false,
children: <OccupantsNow item={data} reload={() => loadShow()} />,
},
{
label: '历史信息',
key: '2',
closable: false,
// children: <MyAssetBuildings item={data} />,
},
];
return (
<MyPageContainer title={title}>
<HouseInfo item={data} />
<ProCard>
<Tabs type="card" items={items} />
</ProCard>
</MyPageContainer>
);
}

View File

@ -0,0 +1,71 @@
import { MyBetaModalFormProps, renderTextHelper } from '@/common';
import {
AssetHousesOrientationEnum,
AssetHousesOwnershipTypeEnum,
AssetHousesStatusEnum,
AssetHousesUsageEnum,
} from '@/gen/Enums';
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
import { Space } from 'antd';
export default function info(props: MyBetaModalFormProps) {
return (
<Space direction="vertical" style={{ width: '100%' }}>
<ProCard>
<ProDescriptions bordered>
<ProDescriptions.Item label="房屋全名" span={2}>
{props?.item?.full_name}
</ProDescriptions.Item>
<ProDescriptions.Item label="房号">
{props?.item?.name}
</ProDescriptions.Item>
<ProDescriptions.Item label="楼层">
{props?.item?.floor}
</ProDescriptions.Item>
<ProDescriptions.Item label="房屋用途">
<renderTextHelper.Tag
Enums={AssetHousesUsageEnum}
value={props?.item?.usage}
key="usage"
/>
</ProDescriptions.Item>
<ProDescriptions.Item label="产权性质">
<renderTextHelper.Tag
Enums={AssetHousesOwnershipTypeEnum}
value={props?.item?.ownership_type}
key="ownership_type"
/>
</ProDescriptions.Item>
<ProDescriptions.Item label="建筑面积">
{props?.item?.built_area}m²
</ProDescriptions.Item>
<ProDescriptions.Item label="套内面积">
{props?.item?.inside_area}m²
</ProDescriptions.Item>
<ProDescriptions.Item label="计费面积">
{props?.item?.chargeable_area}m²
</ProDescriptions.Item>
<ProDescriptions.Item label="房屋状态">
<renderTextHelper.Tag
Enums={AssetHousesStatusEnum}
value={props?.item?.status}
key="status"
/>
</ProDescriptions.Item>
<ProDescriptions.Item label="户型">
{props?.item?.room || ''}{props?.item?.hall || ''}
{props?.item?.bathroom || ''}{props?.item?.kitchen || ''}
{props?.item?.balcony || ''}
</ProDescriptions.Item>
<ProDescriptions.Item label="朝向">
<renderTextHelper.Tag
Enums={AssetHousesOrientationEnum}
value={props?.item?.orientation}
key="orientation"
/>
</ProDescriptions.Item>
</ProDescriptions>
</ProCard>
</Space>
);
}

View File

@ -0,0 +1,119 @@
import {
MyButtons,
MyColumns,
MyPageContainer,
MyProTableProps,
} from '@/common';
import { Apis } from '@/gen/Apis';
import {
AssetHousesOwnershipTypeEnum,
AssetHousesStatusEnum,
AssetHousesUsageEnum,
} from '@/gen/Enums';
import { ProTable } from '@ant-design/pro-components';
import { useNavigate } from '@umijs/max';
import { Space } from 'antd';
import Delivery from './modals/Delivery';
export default function Index({ title = '房屋档案' }) {
const navigate = useNavigate();
return (
<MyPageContainer title={title}>
<ProTable
{...MyProTableProps.props}
// search={false}
request={async (params, sort) =>
MyProTableProps.request(params, sort, Apis.Asset.AssetHouses.List)
}
columns={[
MyColumns.ID(),
MyColumns.EnumTag({
title: '产权性质',
dataIndex: 'ownership_type',
valueEnum: AssetHousesOwnershipTypeEnum,
search: false,
}),
MyColumns.EnumTag({
title: '用途',
dataIndex: 'usage',
valueEnum: AssetHousesUsageEnum,
search: false,
width: 80,
}),
{
title: '房屋名称',
dataIndex: 'full_name',
},
{
title: '楼层',
dataIndex: 'floor',
render(_, record) {
return `${record?.floor}`;
},
search: false,
width: 60,
},
{
title: '建筑面积',
dataIndex: 'built_area',
render(_, record) {
return `${record?.built_area}`;
},
search: false,
width: 80,
},
{
title: '套内面积',
dataIndex: 'inside_area',
render(_, record) {
return `${record?.inside_area}`;
},
search: false,
width: 80,
},
{
title: '计费面积',
dataIndex: 'chargeable_area',
render(_, record) {
return `${record?.chargeable_area}`;
},
search: false,
width: 80,
},
MyColumns.EnumTag({
title: '房屋状态',
dataIndex: 'status',
valueEnum: AssetHousesStatusEnum,
search: false,
}),
MyColumns.Option({
render: (_, item: any, index, action) => (
<Space key={index}>
{/* <HousesOccupantsShow item={item} reload={action?.reload} />
*/}
<MyButtons.View
title="详情"
onClick={() => {
navigate(`/archive/asset_house/${item.id}`);
}}
/>
{!item?.house_occupants?.length && (
<Delivery item={item} reload={action?.reload} title="登记" />
)}
<MyButtons.Delete
onConfirm={() =>
Apis.Asset.AssetBuildings.Delete({ id: item.id }).then(() =>
action?.reload(),
)
}
/>
</Space>
),
}),
]}
/>
</MyPageContainer>
);
}

View File

@ -0,0 +1,220 @@
import {
MyBetaModalFormProps,
MyButtons,
MyFormItems,
MyModalFormProps,
rulesHelper,
} from '@/common';
import { Apis } from '@/gen/Apis';
import {
HouseOccupantsCardTypeEnum,
HouseOccupantsHouseRelationEnum,
HouseOccupantsRelationWithOwnerEnum,
} from '@/gen/Enums';
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
import { Form, message } from 'antd';
export default function Create(props: MyBetaModalFormProps) {
const [form] = Form.useForm();
return (
<BetaSchemaForm<ApiTypes.Archive.HouseRegisters.Store>
{...MyModalFormProps.props}
title={`${props.title}`}
wrapperCol={{ span: 24 }}
width="900px"
form={form}
trigger={
<MyButtons.Default title={props.title} size="middle" type="primary" />
}
onOpenChange={(open: any) => {
if (open) {
form.resetFields(); // 清空表单数据
}
}}
onFinish={async (values) =>
Apis.Archive.HouseRegisters.Store({
...values,
asset_houses_id: props?.item?.id,
type: 'AddOccupant',
})
.then(() => {
props.reload?.();
message.success(props.title + '成功');
return true;
})
.catch(() => false)
}
columns={[
{
valueType: 'formList',
dataIndex: 'customer_info',
colProps: { span: 24 },
fieldProps: {
copyIconProps: false,
creatorButtonProps: {
creatorButtonText: '添加住户',
style: { color: 'red' },
danger: true,
},
itemRender: (
{ listDom, action }: any,
{ index }: { index: number },
) => {
return (
<ProCard
bordered
style={{ marginBlockEnd: 8 }}
title={`住户${index + 1}`}
extra={action}
bodyStyle={{ paddingBlockEnd: 0 }}
>
{listDom}
</ProCard>
);
},
},
columns: [
{
valueType: 'group',
columns: [
MyFormItems.EnumRadio({
key: 'house_relation',
title: '住户类型',
colProps: { span: 4 },
valueEnum: () => {
let obj: any = JSON.parse(
JSON.stringify(HouseOccupantsHouseRelationEnum),
);
delete obj.Owner;
return obj;
},
required: true,
}),
{
name: ['house_relation'],
valueType: 'dependency',
columns: ({ house_relation }: any) => {
return house_relation === 'Resident'
? [
MyFormItems.EnumRadio({
key: 'relation_with_owner',
title: '住户类型',
colProps: { span: 12 },
valueEnum: () => {
let obj: any = JSON.parse(
JSON.stringify(
HouseOccupantsRelationWithOwnerEnum,
),
);
delete obj.Self;
delete obj.ContactPerson;
return obj;
},
required: true,
}),
]
: [
MyFormItems.EnumRadio({
key: 'relation_with_owner',
title: '住户类型',
colProps: { span: 12 },
// valueEnum: HouseOccupantsRelationWithOwnerEnum,
valueEnum: () => {
let obj: any = JSON.parse(
JSON.stringify(
HouseOccupantsRelationWithOwnerEnum,
),
);
delete obj.ContactPerson;
return obj;
},
required: true,
}),
];
},
},
{
title: '是否入住',
dataIndex: 'is_live_in',
colProps: { span: 4 },
valueType: 'switch',
},
{
name: ['is_live_in'],
valueType: 'dependency',
columns: ({ is_live_in }: any) => {
return is_live_in
? [
{
title: '入住日期',
dataIndex: 'move_in_date',
valueType: 'date',
colProps: { span: 4 },
fieldProps: {
style: { width: '100%' },
},
formItemProps: { ...rulesHelper.text },
},
]
: [,];
},
},
{
title: '姓名',
dataIndex: 'name',
colProps: { span: 6 },
formItemProps: { ...rulesHelper.text },
},
{
title: '手机号',
dataIndex: 'phone',
colProps: { span: 6 },
fieldProps: {
maxLength: 11,
},
formItemProps: { ...rulesHelper.text },
},
MyFormItems.EnumSelect({
key: 'card_type',
title: '证件类型',
colProps: { span: 6 },
valueEnum: HouseOccupantsCardTypeEnum,
required: true,
}),
{
title: '证件号码',
dataIndex: 'id_card',
colProps: { span: 6 },
fieldProps: {
maxLength: 18,
},
formItemProps: { ...rulesHelper.text },
},
{
valueType: 'group',
columns: [
MyFormItems.UploadImages({
key: 'card_front_image',
title: '证件正面',
max: 1,
colProps: { span: 4 },
formItemProps: { ...rulesHelper.text },
}),
MyFormItems.UploadImages({
key: 'card_back_image',
title: '证件反面',
max: 1,
colProps: { span: 4 },
formItemProps: { ...rulesHelper.text },
}),
],
},
],
},
],
},
]}
/>
);
}

View File

@ -8,11 +8,8 @@ import {
import { Apis } from '@/gen/Apis';
import {
HouseOccupantsCardTypeEnum,
HouseOccupantsHouseRelationEnum,
HouseOccupantsRelationWithOwnerEnum,
HouseRegistersCustomerTypeEnum,
HouseRegistersHouseStatusEnum,
HouseRegistersTypeEnum,
HouseRegistersUsagePlanEnum,
} from '@/gen/Enums';
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
@ -39,6 +36,7 @@ export default function Create(props: MyBetaModalFormProps) {
Apis.Archive.HouseRegisters.Store({
...values,
asset_houses_id: props?.item?.id,
type: 'Delivery',
})
.then(() => {
props.reload?.();
@ -49,11 +47,23 @@ export default function Create(props: MyBetaModalFormProps) {
}
columns={[
MyFormItems.EnumRadio({
key: 'type',
title: '类型',
colProps: { span: 24 },
valueEnum: HouseRegistersTypeEnum,
required: true,
key: 'customer_type',
title: '客户类型',
colProps: { span: 12 },
valueEnum: HouseRegistersCustomerTypeEnum,
}),
MyFormItems.EnumRadio({
key: 'house_status',
title: '房屋状态',
colProps: { span: 6 },
valueEnum: HouseRegistersHouseStatusEnum,
formItemProps: { ...rulesHelper.text },
}),
MyFormItems.EnumSelect({
key: 'usage_plan',
title: '使用计划',
colProps: { span: 6 },
valueEnum: HouseRegistersUsagePlanEnum,
}),
{
valueType: 'formList',
@ -62,7 +72,9 @@ export default function Create(props: MyBetaModalFormProps) {
fieldProps: {
copyIconProps: false,
creatorButtonProps: {
creatorButtonText: '添加客户',
creatorButtonText: '增加产权人',
style: { color: 'red' },
danger: true,
},
itemRender: (
{ listDom, action }: any,
@ -72,7 +84,7 @@ export default function Create(props: MyBetaModalFormProps) {
<ProCard
bordered
style={{ marginBlockEnd: 8 }}
title={`客户${index + 1}`}
title={`产权人${index + 1}`}
extra={action}
bodyStyle={{ paddingBlockEnd: 0 }}
>
@ -88,125 +100,78 @@ export default function Create(props: MyBetaModalFormProps) {
{
title: '姓名',
dataIndex: 'name',
colProps: { span: 8 },
colProps: { span: 12 },
formItemProps: { ...rulesHelper.text },
},
{
title: '手机号',
dataIndex: 'phone',
colProps: { span: 8 },
colProps: { span: 6 },
fieldProps: {
maxLength: 11,
},
formItemProps: { ...rulesHelper.text },
},
MyFormItems.EnumSelect({
key: 'house_relation',
title: '房客关系',
colProps: { span: 8 },
valueEnum: HouseOccupantsHouseRelationEnum,
required: true,
}),
{
title: '客户地址',
dataIndex: 'address',
colProps: { span: 8 },
formItemProps: { ...rulesHelper.text },
},
{
title: '解除时间',
dataIndex: 'unbound_time',
colProps: { span: 8 },
valueType: 'date',
title: '备用手机号',
dataIndex: 'reserve_phone',
colProps: { span: 6 },
fieldProps: {
style: { width: '100%' },
maxLength: 11,
},
formItemProps: { ...rulesHelper.text },
},
MyFormItems.EnumSelect({
key: 'relation_with_owner',
title: '与产权人关系',
colProps: { span: 8 },
valueEnum: HouseOccupantsRelationWithOwnerEnum,
required: true,
}),
MyFormItems.EnumSelect({
key: 'card_type',
title: '证件类型',
colProps: { span: 8 },
colProps: { span: 12 },
valueEnum: HouseOccupantsCardTypeEnum,
required: true,
}),
{
title: '证件号码',
dataIndex: 'id_card',
colProps: { span: 8 },
colProps: { span: 12 },
fieldProps: {
maxLength: 18,
},
formItemProps: { ...rulesHelper.text },
},
{
title: '是否在居住中',
dataIndex: 'is_live_in',
colProps: { span: 8 },
valueType: 'switch',
},
// {
// title: '是否在居住中',
// dataIndex: 'is_live_in',
// colProps: { span: 8 },
// valueType: 'switch',
// },
{
valueType: 'group',
columns: [
MyFormItems.UploadImages({
key: 'card_front_image',
title: '身份证正面',
title: '正面',
max: 1,
colProps: { span: 8 },
colProps: { span: 4 },
formItemProps: { ...rulesHelper.text },
}),
MyFormItems.UploadImages({
key: 'card_back_image',
title: '身份证反面',
title: '反面',
max: 1,
colProps: { span: 8 },
colProps: { span: 4 },
formItemProps: { ...rulesHelper.text },
}),
],
},
MyFormItems.UploadImages({
key: 'ownership_info',
title: '产权信息',
max: 100,
colProps: { span: 24 },
formItemProps: { ...rulesHelper.array },
}),
],
},
],
},
MyFormItems.EnumRadio({
key: 'customer_type',
title: '客户类型',
MyFormItems.UploadImages({
key: 'ownership_info',
title: '产权文件',
max: 100,
colProps: { span: 24 },
valueEnum: HouseRegistersCustomerTypeEnum,
}),
MyFormItems.EnumRadio({
key: 'usage_plan',
title: '使用计划',
colProps: { span: 24 },
valueEnum: HouseRegistersUsagePlanEnum,
}),
// MyFormItems.EnumRadio({
// key: 'status',
// title: '状态',
// colProps: { span: 24 },
// valueEnum: HouseRegistersStatusEnum,
// }),
MyFormItems.EnumRadio({
key: 'house_status',
title: '房屋状态',
colProps: { span: 24 },
valueEnum: HouseRegistersHouseStatusEnum,
formItemProps: { ...rulesHelper.array },
}),
]}
/>

View File

@ -0,0 +1,48 @@
import { MyBetaModalFormProps, MyButtons, MyModalFormProps } from '@/common';
import { Apis } from '@/gen/Apis';
import { BetaSchemaForm } from '@ant-design/pro-components';
import { Form, message } from 'antd';
export default function Create(props: MyBetaModalFormProps) {
const [form] = Form.useForm();
return (
<BetaSchemaForm<ApiTypes.Archive.HouseRegisters.Store>
{...MyModalFormProps.props}
title={`添加${props.title}`}
wrapperCol={{ span: 24 }}
width="500px"
form={form}
trigger={
<MyButtons.Default title={props.title} size="small" type="link" />
}
onFinish={async (values) =>
Apis.Archive.HouseRegisters.Store({
...values,
asset_houses_id: props?.item?.id,
type: 'MoveOut',
customer_info: props?.item?.id,
})
.then(() => {
props.reload?.();
message.success(props.title + '成功');
return true;
})
.catch(() => false)
}
columns={[
{
title: '搬离日期',
valueType: 'date',
dataIndex: '',
colProps: { span: 24 },
fieldProps: {
maxLength: 11,
style: {
width: '100%',
},
},
},
]}
/>
);
}

View File

@ -0,0 +1,179 @@
import {
MyBetaModalFormProps,
MyButtons,
MyFormItems,
MyModalFormProps,
rulesHelper,
} from '@/common';
import { Apis } from '@/gen/Apis';
import {
HouseOccupantsCardTypeEnum,
HouseRegistersCustomerTypeEnum,
HouseRegistersHouseStatusEnum,
HouseRegistersUsagePlanEnum,
} from '@/gen/Enums';
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
import { Form, message } from 'antd';
export default function Create(props: MyBetaModalFormProps) {
const [form] = Form.useForm();
return (
<BetaSchemaForm<ApiTypes.Archive.HouseRegisters.Store>
{...MyModalFormProps.props}
title={`${props.title}`}
wrapperCol={{ span: 24 }}
width="900px"
form={form}
trigger={
<MyButtons.Default title={props.title} size="middle" type="primary" />
}
onOpenChange={(open: any) => {
if (open) {
form.resetFields(); // 清空表单数据
}
}}
onFinish={async (values) =>
Apis.Archive.HouseRegisters.Store({
...values,
asset_houses_id: props?.item?.id,
type: 'Transfer',
})
.then(() => {
props.reload?.();
message.success(props.title + '成功');
return true;
})
.catch(() => false)
}
columns={[
MyFormItems.EnumRadio({
key: 'customer_type',
title: '客户类型',
colProps: { span: 12 },
valueEnum: HouseRegistersCustomerTypeEnum,
}),
MyFormItems.EnumRadio({
key: 'house_status',
title: '房屋状态',
colProps: { span: 6 },
valueEnum: HouseRegistersHouseStatusEnum,
formItemProps: { ...rulesHelper.text },
}),
MyFormItems.EnumSelect({
key: 'usage_plan',
title: '使用计划',
colProps: { span: 6 },
valueEnum: HouseRegistersUsagePlanEnum,
}),
{
valueType: 'formList',
dataIndex: 'customer_info',
colProps: { span: 24 },
fieldProps: {
copyIconProps: false,
creatorButtonProps: {
creatorButtonText: '增加产权人',
style: { color: 'red' },
danger: true,
},
itemRender: (
{ listDom, action }: any,
{ index }: { index: number },
) => {
return (
<ProCard
bordered
style={{ marginBlockEnd: 8 }}
title={`产权人${index + 1}`}
extra={action}
bodyStyle={{ paddingBlockEnd: 0 }}
>
{listDom}
</ProCard>
);
},
},
columns: [
{
valueType: 'group',
columns: [
{
title: '姓名',
dataIndex: 'name',
colProps: { span: 12 },
formItemProps: { ...rulesHelper.text },
},
{
title: '手机号',
dataIndex: 'phone',
colProps: { span: 6 },
fieldProps: {
maxLength: 11,
},
formItemProps: { ...rulesHelper.text },
},
{
title: '备用手机号',
dataIndex: 'reserve_phone',
colProps: { span: 6 },
fieldProps: {
maxLength: 11,
},
},
MyFormItems.EnumSelect({
key: 'card_type',
title: '证件类型',
colProps: { span: 12 },
valueEnum: HouseOccupantsCardTypeEnum,
required: true,
}),
{
title: '证件号码',
dataIndex: 'id_card',
colProps: { span: 12 },
fieldProps: {
maxLength: 18,
},
formItemProps: { ...rulesHelper.text },
},
// {
// title: '是否在居住中',
// dataIndex: 'is_live_in',
// colProps: { span: 8 },
// valueType: 'switch',
// },
{
valueType: 'group',
columns: [
MyFormItems.UploadImages({
key: 'card_front_image',
title: '证件正面',
max: 1,
colProps: { span: 4 },
formItemProps: { ...rulesHelper.text },
}),
MyFormItems.UploadImages({
key: 'card_back_image',
title: '证件反面',
max: 1,
colProps: { span: 4 },
formItemProps: { ...rulesHelper.text },
}),
],
},
],
},
],
},
MyFormItems.UploadImages({
key: 'ownership_info',
title: '产权文件',
max: 100,
colProps: { span: 24 },
formItemProps: { ...rulesHelper.array },
}),
]}
/>
);
}

View File

@ -0,0 +1,151 @@
import {
MyBetaModalFormProps,
MyButtons,
MyFormItems,
MyModalFormProps,
rulesHelper,
} from '@/common';
import { Address } from '@/components/Address';
import { Selects } from '@/components/Select';
import { Apis } from '@/gen/Apis';
import {
AssetProjectsChargeEnum,
AssetProjectsEntrustTypeEnum,
AssetProjectsPropertyTypeEnum,
AssetProjectsStatusEnum,
} from '@/gen/Enums';
import { BetaSchemaForm } from '@ant-design/pro-components';
import { message } from 'antd';
export default function Update(props: MyBetaModalFormProps) {
return (
<BetaSchemaForm<ApiTypes.Archive.HouseRegisters.Update>
{...MyModalFormProps.props}
title={`编辑${props.title}`}
trigger={<MyButtons.Default title="编辑" type="primary" size="small" />}
wrapperCol={{ span: 24 }}
width="800px"
request={() =>
Promise.resolve({
...props.item,
casacader: [
props.item?.province_id || '',
props.item?.city_id || '',
props.item?.area_id || '',
props.item?.street_id || '',
],
})
}
onFinish={async (values) =>
Apis.Archive.HouseRegisters.Update({
...values,
id: props.item?.id ?? 0,
})
.then(() => {
props.reload?.();
message.success(props.title + '成功');
return true;
})
.catch(() => false)
}
columns={[
{
key: 'name',
title: '项目名称',
colProps: { span: 12 },
formItemProps: { ...rulesHelper.text },
},
{
key: 'alias_name',
title: '项目别名',
colProps: { span: 6 },
},
Selects?.Companies({
key: 'companies_id',
title: '所属机构',
colProps: { span: 6 },
formItemProps: { ...rulesHelper.number },
}),
// {
// key: 'code',
// title: '项目编码',
// colProps: { span: 8 },
// formItemProps: { ...rulesHelper.text },
// },
Address.Cascader({
key: 'casacader',
title: '选择地址',
colProps: { span: 12 },
keys: ['province', 'city', 'area', 'street'],
required: true,
}),
{
key: 'address',
title: '详细地址',
colProps: { span: 6 },
formItemProps: { ...rulesHelper.text },
},
{
key: 'longitude',
title: '经度',
colProps: { span: 3 },
},
{
key: 'latitude',
title: '纬度',
colProps: { span: 3 },
},
MyFormItems.EnumSelect({
key: 'property_type',
title: '项目类型',
colProps: { span: 6 },
valueEnum: AssetProjectsPropertyTypeEnum,
// required: true,
}),
MyFormItems.EnumSelect({
key: 'status',
title: '项目状态',
colProps: { span: 6 },
valueEnum: AssetProjectsStatusEnum,
// required: true,
}),
MyFormItems.EnumSelect({
key: 'entrust_type',
title: '委托类型',
colProps: { span: 6 },
valueEnum: AssetProjectsEntrustTypeEnum,
// required: true,
}),
MyFormItems.EnumRadio({
key: 'charge',
title: '收费方式',
colProps: { span: 6 },
valueEnum: AssetProjectsChargeEnum,
// required: true,
}),
{
key: 'takeover_date',
title: '接管日期',
valueType: 'date',
fieldProps: {
style: {
width: '100%',
},
},
colProps: { span: 6 },
},
{
key: 'closure_date',
title: '封园日期',
valueType: 'date',
fieldProps: {
style: {
width: '100%',
},
},
colProps: { span: 6 },
},
]}
/>
);
}

View File

@ -0,0 +1,109 @@
import { MyColumns, MyProTableProps } from '@/common';
import { Apis } from '@/gen/Apis';
import {
HouseOccupantsHouseRelationEnum,
HouseOccupantsRelationWithOwnerEnum,
HouseOccupantsStatusEnum,
} from '@/gen/Enums';
import { ProTable } from '@ant-design/pro-components';
import { Space } from 'antd';
import { useEffect, useRef } from 'react';
import AddOccupant from '../modals/AddOccupant';
import MoveOut from '../modals/MoveOut';
import Transfer from '../modals/Transfer';
export default function Index({ ...rest }) {
const actionLooks = useRef<any>();
useEffect(() => {
actionLooks?.current.reloadAndRest();
}, [rest.loadmore]);
return (
<>
<ProTable<Record<any, any>>
{...MyProTableProps.props}
actionRef={actionLooks}
request={async (params, sort) =>
MyProTableProps.request(
{
...params,
asset_houses_id: rest.item?.id,
status: 'Normal',
},
sort,
Apis.Archive.HouseOccupants.List,
)
}
toolBarRender={(action) => [
<Transfer
key="Transfer"
item={rest.item}
reload={action?.reload}
title=" 过户登记"
/>,
<AddOccupant
key="AddOccupant"
item={rest.item}
reload={action?.reload}
title="添加住户"
/>,
]}
search={false}
columns={[
MyColumns.EnumTag({
title: '房客关系',
dataIndex: 'house_relation',
valueEnum: HouseOccupantsHouseRelationEnum,
search: false,
}),
MyColumns.EnumTag({
title: '与产权人关系',
dataIndex: 'relation_with_owner',
valueEnum: HouseOccupantsRelationWithOwnerEnum,
search: false,
}),
{
title: '姓名',
dataIndex: 'name',
},
{
title: '电话',
dataIndex: 'phone',
},
{
title: '是否入住',
dataIndex: 'is_live_in',
render(_, record) {
return `${record?.is_live_in ? '是' : '-'} `;
},
},
{
title: '入住日期',
dataIndex: 'is_live_in',
render(_, record) {
return `待补充`;
},
},
MyColumns.EnumTag({
title: '状态',
dataIndex: 'status',
valueEnum: HouseOccupantsStatusEnum,
search: false,
}),
// MyColumns.UpdatedAt(),
MyColumns.Option({
render: (_, item: any, index, action) => (
<Space key={index}>
{/* <GridCreateUpdate item={item} reload={action?.reload} /> */}
{item?.is_live_in && (
<MoveOut item={item} reload={action?.reload} title="搬离" />
)}
</Space>
),
}),
]}
/>
</>
);
}

View File

@ -5,20 +5,15 @@ import {
MyProTableProps,
} from '@/common';
import { Apis } from '@/gen/Apis';
import {
AssetHousesOwnershipTypeEnum,
AssetHousesStatusEnum,
AssetHousesUsageEnum,
} from '@/gen/Enums';
import { AssetHousesUsageEnum } from '@/gen/Enums';
import { ProCard, ProTable } from '@ant-design/pro-components';
import { Space } from 'antd';
import { useRef, useState } from 'react';
import BuildingsCreate from '../modals/BuildingsCreate';
import AssetBuildingsUpdate from '../modals/BuildingsUpdate';
import AssetHousesCreate from '../modals/HousesCreate';
import AssetHousesShow from '../modals/HousesShow';
import AssetHousesUpdate from '../modals/HousesUpdate';
import RegistersCreate from '../modals/RegistersCreate';
import HousesShow from '../modals/HousesShow';
import HousesUpdate from '../modals/HousesUpdate';
import AssetUnitsCreate from '../modals/UnitsCreate';
import AssetUnitsUpdate from '../modals/UnitsUpdate';
@ -91,7 +86,7 @@ export default function AssetBuildings(props: MyBetaModalFormProps) {
}
options={false}
columns={[
MyColumns.ID(),
// MyColumns.ID(),
{
title: '楼栋名称',
dataIndex: 'name',
@ -148,7 +143,7 @@ export default function AssetBuildings(props: MyBetaModalFormProps) {
}}
options={false}
columns={[
MyColumns.ID(),
// MyColumns.ID(),
{
title: '单元名称',
dataIndex: 'name',
@ -192,7 +187,6 @@ export default function AssetBuildings(props: MyBetaModalFormProps) {
options={false}
columns={[
MyColumns.ID(),
MyColumns.EnumTag({
title: '用途',
dataIndex: 'usage',
@ -209,30 +203,26 @@ export default function AssetBuildings(props: MyBetaModalFormProps) {
return `${record?.floor}`;
},
},
MyColumns.EnumTag({
title: '产权性质',
dataIndex: 'ownership_type',
valueEnum: AssetHousesOwnershipTypeEnum,
}),
MyColumns.EnumTag({
title: '房屋状态',
dataIndex: 'status',
valueEnum: AssetHousesStatusEnum,
}),
// MyColumns.EnumTag({
// title: '产权性质',
// dataIndex: 'ownership_type',
// valueEnum: AssetHousesOwnershipTypeEnum,
// }),
// MyColumns.EnumTag({
// title: '房屋状态',
// dataIndex: 'status',
// valueEnum: AssetHousesStatusEnum,
// }),
MyColumns.Option({
render: (_, item: any, index, action) => (
<Space key={index}>
<AssetHousesShow item={item} reload={action?.reload} />
<AssetHousesUpdate
<HousesShow item={item} reload={action?.reload} />
<HousesUpdate
item={item}
reload={action?.reload}
title="编辑"
/>
<RegistersCreate
item={item}
reload={action?.reload}
title="登记"
/>
<MyButtons.Delete
onConfirm={() =>
Apis.Asset.AssetBuildings.Delete({ id: item.id }).then(

View File

@ -8,6 +8,7 @@ import {
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 (
@ -16,7 +17,9 @@ export default function info(props: MyBetaModalFormProps) {
<ProDescriptions bordered>
<ProDescriptions.Item label="项目名称" span={2}>
<Space>
{props?.item?.name}
<div>
{props?.item?.id}{props?.item?.name}
</div>
<AssetUpdate
item={props?.item}
title="项目"
@ -84,8 +87,9 @@ export default function info(props: MyBetaModalFormProps) {
<Space>
<div>
{props?.item?.company?.id}{props?.item?.company?.name}
</div>
<AssetUpdate item={props?.item} title="项目" />
<BindCompany item={props?.item} title="项目" reload={props?.reload}/>
</Space>
</ProDescriptions.Item>
</ProDescriptions>

View File

@ -22,14 +22,7 @@ export default function Update(props: MyBetaModalFormProps) {
<BetaSchemaForm<ApiTypes.Asset.AssetProjects.Update>
{...MyModalFormProps.props}
title={`编辑${props.title}`}
trigger={
<MyButtons.Default
title="修改"
color="primary"
variant="filled"
size="small"
/>
}
trigger={<MyButtons.Default title="编辑" type="primary" size="small" />}
wrapperCol={{ span: 24 }}
width="800px"
request={() =>

View File

@ -0,0 +1,51 @@
import {
MyBetaModalFormProps,
MyButtons,
MyModalFormProps,
rulesHelper,
} from '@/common';
import { Selects } from '@/components/Select';
import { Apis } from '@/gen/Apis';
import { BetaSchemaForm } from '@ant-design/pro-components';
import { message } from 'antd';
export default function Update(props: MyBetaModalFormProps) {
return (
<BetaSchemaForm<ApiTypes.Asset.AssetProjects.BindCompany>
{...MyModalFormProps.props}
title={`编辑${props.title}`}
trigger={
<MyButtons.Default
title="编辑"
type="primary"
size="small"
/>
}
wrapperCol={{ span: 24 }}
width="500px"
request={() =>
Promise.resolve({
...props.item,
})
}
onFinish={async (values) =>
Apis.Asset.AssetProjects.BindCompany({ ...values, projects_id: props.item?.id ?? 0 })
.then(() => {
props.reload?.();
message.success(props.title + '关联机构修改成功');
return true;
})
.catch(() => false)
}
columns={[
Selects?.Companies({
key: 'companies_id',
title: '所属机构',
colProps: { span: 24 },
formItemProps: { ...rulesHelper.number },
}),
]}
/>
);
}

View File

@ -178,8 +178,8 @@ export default function Create(props: MyBetaModalFormProps) {
// },
MyFormItems.EnumRadio({
key: 'orientation',
title: '房屋状态',
colProps: { span: 6 },
title: '房屋朝向',
colProps: { span: 24 },
valueEnum: AssetHousesOrientationEnum,
// required: true,
}),

View File

@ -18,7 +18,6 @@ import { Form, message } from 'antd';
export default function Update(props: MyBetaModalFormProps) {
const [form] = Form.useForm();
console.log(props?.item, 'item');
return (
<BetaSchemaForm<ApiTypes.Asset.AssetHouses.Update>
{...MyModalFormProps.props}

View File

@ -9,18 +9,12 @@ export default function info(props: MyBetaModalFormProps) {
<Space direction="vertical" style={{ width: '100%' }}>
<ProCard extra={props.extra}>
<ProDescriptions bordered>
<ProDescriptions.Item label="机构名称">
<ProDescriptions.Item label="机构名称" span={3}>
<Space>
{props?.item?.name}
<Update item={props?.item} title="机构" reload={props?.reload} />
</Space>
</ProDescriptions.Item>
<ProDescriptions.Item label="机构简称">
{props?.item?.short_name}
</ProDescriptions.Item>
<ProDescriptions.Item label="营业执照号">
{props?.item?.business_license_number}
</ProDescriptions.Item>
<ProDescriptions.Item label="商户类型">
<renderTextHelper.Tag
Enums={CompaniesMerchantTypeEnum}
@ -28,6 +22,13 @@ export default function info(props: MyBetaModalFormProps) {
key="merchant_type"
/>
</ProDescriptions.Item>
<ProDescriptions.Item label="机构简称">
{props?.item?.short_name}
</ProDescriptions.Item>
<ProDescriptions.Item label="营业执照号">
{props?.item?.business_license_number}
</ProDescriptions.Item>
<ProDescriptions.Item label="联系人姓名">
{props?.item?.contact_name}
</ProDescriptions.Item>

View File

@ -33,6 +33,12 @@ export default function Index(props: MyBetaModalFormProps) {
options={false}
columns={[
MyColumns.ID(),
//to-do 按层级选择
{
title: '组织',
dataIndex: ['organization', 'name'],
search: false,
},
{
title: '姓名',
dataIndex: 'name',
@ -42,17 +48,12 @@ export default function Index(props: MyBetaModalFormProps) {
dataIndex: 'phone',
},
{
title: '机构',
dataIndex: ['company', 'name'],
search: false,
},
{
title: '组织',
dataIndex: ['organization', 'name'],
title: '岗位',
dataIndex: ['position', 'name'],
search: false,
},
MyColumns.UpdatedAt(),
MyColumns.CreatedAt(),
// MyColumns.CreatedAt(),
MyColumns.Option({
render: (_, item: any, index, action) => (
<Space key={index}>

View File

@ -44,18 +44,18 @@ export default function Organizations(props: MyBetaModalFormProps) {
dataIndex: 'code',
search: false,
},
// {
// title: '岗位排序',
// dataIndex: 'sort',
// search: false,
// },
{
title: '岗位排序',
dataIndex: 'sort',
search: false,
},
{
title: '备注',
title: '岗位备注',
dataIndex: 'remark',
search: false,
},
MyColumns.UpdatedAt(),
MyColumns.CreatedAt(),
// MyColumns.CreatedAt(),
MyColumns.Option({
render: (_, item: any, index, action) => (
<Space key={index}>

View File

@ -5,13 +5,15 @@ import {
MyProTableProps,
} from '@/common';
import { Apis } from '@/gen/Apis';
import { OrganizationsTypeEnum } from '@/gen/Enums';
import { AssetProjectsChargeEnum, AssetProjectsEntrustTypeEnum, AssetProjectsPropertyTypeEnum, AssetProjectsStatusEnum, OrganizationsTypeEnum } from '@/gen/Enums';
import { ProTable } from '@ant-design/pro-components';
import { Space } from 'antd';
import OrganizationsCreate from '../modals/OrganizationsCreate';
import OrganizationsUpdate from '../modals/OrganizationsUpdate';
import { useNavigate } from 'react-router-dom';
export default function Index(props: MyBetaModalFormProps) {
const navigate = useNavigate();
export default function Organizations(props: MyBetaModalFormProps) {
return (
<>
<ProTable
@ -21,56 +23,82 @@ export default function Organizations(props: MyBetaModalFormProps) {
MyProTableProps.request(
{ ...params, companies_id: props?.item?.id },
sort,
Apis.Company.Organizations.List,
Apis.Asset.AssetProjects.List,
)
}
toolBarRender={(action) => [
<OrganizationsCreate
key="Create"
reload={action?.reload}
item={props?.item}
title="组织"
/>,
]}
options={false}
// toolBarRender={(action) => [
// <OrganizationsCreate
// key="Create"
// reload={action?.reload}
// item={props?.item}
// title="组织"
// />,
// ]}
// options={false}
columns={[
MyColumns.ID(),
{
title: '上级组织',
dataIndex: ['organization_parent', 'name'],
},
{
title: '组织',
dataIndex: 'name',
},
MyColumns.EnumTag({
title: '类型',
dataIndex: 'type',
valueEnum: OrganizationsTypeEnum,
title: '项目类型',
dataIndex: 'property_type',
valueEnum: AssetProjectsPropertyTypeEnum,
search: false,
}),
{
title: '负责人',
dataIndex: ['manager', 'name'],
title: '项目名称',
dataIndex: 'name',
},
{
title: '联系电话',
dataIndex: 'manager_phone',
title: '项目别名',
dataIndex: 'alias_name',
},
// {
// title: '项目编码',
// dataIndex: 'code',
// search: false,
// },
{
title: '地址',
render: (_, i: any) => {
return `${i?.province || ''}${i?.city || ''}${i?.district || ''}${
i?.address || ''
}`;
},
search: false,
},
MyColumns.EnumTag({
title: '项目状态',
dataIndex: 'status',
valueEnum: AssetProjectsStatusEnum,
search: false,
}),
MyColumns.EnumTag({
title: '委托类型',
dataIndex: 'entrust_type',
valueEnum: AssetProjectsEntrustTypeEnum,
search: false,
}),
MyColumns.EnumTag({
title: '收费方式',
dataIndex: 'charge',
valueEnum: AssetProjectsChargeEnum,
search: false,
}),
MyColumns.SoftDelete({
title: '启/禁用',
onRestore: Apis.Asset.AssetProjects.Restore,
onSoftDelete: Apis.Asset.AssetProjects.SoftDelete,
search: false,
}),
// MyColumns.CreatedAt(),
MyColumns.Option({
render: (_, item: any, index, action) => (
<Space key={index}>
<OrganizationsUpdate
item={{ ...item, companies_id: props?.item?.id }}
reload={action?.reload}
title="组织"
/>
<MyButtons.Delete
onConfirm={() =>
Apis.Company.Organizations.Delete({ id: item.id }).then(
() => action?.reload(),
)
}
<MyButtons.View
title="详情"
onClick={() => {
navigate(`/asset/asset_projects/${item.id}`);
}}
/>
</Space>
),

View File

@ -9,9 +9,10 @@ import { Selects } from '@/components/Select';
import { Apis } from '@/gen/Apis';
import { SexEnum } from '@/gen/Enums';
import { BetaSchemaForm } from '@ant-design/pro-components';
import { message } from 'antd';
import { Form, message } from 'antd';
export default function Create(props: MyBetaModalFormProps) {
const [form] = Form.useForm();
return (
<BetaSchemaForm<ApiTypes.Company.CompanyEmployees.Store>
{...MyModalFormProps.props}
@ -19,6 +20,12 @@ export default function Create(props: MyBetaModalFormProps) {
wrapperCol={{ span: 24 }}
width="500px"
trigger={<MyButtons.Create title={`添加${props?.title}`} />}
form={form}
onOpenChange={(open: any) => {
if (open) {
form.resetFields(); // 清空表单数据
}
}}
onFinish={async (values) =>
Apis.Company.CompanyEmployees.Store(values)
.then(() => {
@ -30,7 +37,7 @@ export default function Create(props: MyBetaModalFormProps) {
}
columns={[
Selects?.Organizations({
title: '所属组织',
title: '设置所属组织',
params: { companies_id: props?.item?.companies_id },
key: 'organizations_id',
formItemProps: { ...rulesHelper.text },
@ -49,7 +56,7 @@ export default function Create(props: MyBetaModalFormProps) {
maxLength: 11,
},
colProps: { span: 12 },
formItemProps: { ...rulesHelper.text },
formItemProps: { ...rulesHelper.phone },
},
MyFormItems.EnumRadio({
key: 'sex',
@ -58,13 +65,18 @@ export default function Create(props: MyBetaModalFormProps) {
valueEnum: SexEnum,
required: true,
}),
{
key: 'password',
title: '密码',
colProps: { span: 24 },
valueType: 'password',
},
Selects?.Positions({
title: '岗位',
params: { companies_id: props?.item?.companies_id },
key: 'positions_id',
formItemProps: { ...rulesHelper.text },
}),
// {
// key: 'password',
// title: '密码',
// colProps: { span: 24 },
// valueType: 'password',
// },
{
key: 'remark',
title: '备注',

View File

@ -62,7 +62,7 @@ export default function Update(props: MyBetaModalFormProps) {
maxLength: 11,
},
colProps: { span: 12 },
formItemProps: { ...rulesHelper.text },
formItemProps: { ...rulesHelper.phone },
},
MyFormItems.EnumRadio({
key: 'sex',
@ -71,13 +71,18 @@ export default function Update(props: MyBetaModalFormProps) {
valueEnum: SexEnum,
required: true,
}),
{
key: 'password',
title: '密码',
colProps: { span: 24 },
valueType: 'password',
},
Selects?.Positions({
title: '岗位',
params: { companies_id: props?.item?.companies_id },
key: 'positions_id',
formItemProps: { ...rulesHelper.text },
}),
// {
// key: 'password',
// title: '密码',
// colProps: { span: 24 },
// valueType: 'password',
// },
{
key: 'remark',
title: '备注',

View File

@ -20,9 +20,8 @@ export default function Update(props: MyBetaModalFormProps) {
form={form}
trigger={
<MyButtons.Default
title="修改"
color="primary"
variant="filled"
title="编辑"
type="primary"
size="small"
/>
}
@ -90,29 +89,29 @@ export default function Update(props: MyBetaModalFormProps) {
title: '联系人邮箱',
colProps: { span: 8 },
},
{
key: 'contact_address',
title: '联系人地址',
colProps: { span: 24 },
},
MyFormItems.EnumRadio({
key: 'merchant_type',
title: '商户类型',
colProps: { span: 24 },
valueEnum: CompaniesMerchantTypeEnum,
required: true,
}),
// {
// key: 'contact_address',
// title: '联系人地址',
// colProps: { span: 16 },
// },
// MyFormItems.EnumRadio({
// key: 'merchant_type',
// title: '商户类型',
// colProps: { span: 24 },
// valueEnum: CompaniesMerchantTypeEnum,
// required: true,
// }),
Address.Cascader({
key: 'casacader',
title: '选择地址',
colProps: { span: 24 },
colProps: { span:16 },
keys: ['province', 'city', 'area', 'street'],
required: true,
}),
{
key: 'address',
title: '详细地址',
colProps: { span: 24 },
colProps: { span:8 },
},
]}
/>

View File

@ -31,26 +31,35 @@ export default function Index({ title = '员工管理' }) {
MyColumns.Companies({
title: '选择机构',
}),
{
title: '姓名',
dataIndex: 'name',
},
{
title: '手机号',
dataIndex: 'phone',
},
{
title: '机构',
dataIndex: ['company', 'name'],
search: false,
width: 220,
},
{
title: '组织',
dataIndex: ['organization', 'name'],
search: false,
width: 150,
},
{
title: '姓名',
dataIndex: 'name',
width: 150,
},
{
title: '手机号',
dataIndex: 'phone',
width: 150,
},
{
title: '岗位',
dataIndex: ['position', 'name'],
width: 150,
},
MyColumns.UpdatedAt(),
MyColumns.CreatedAt(),
// MyColumns.CreatedAt(),
MyColumns.Option({
render: (_, item: any, index, action) => (
<Space key={index}>

View File

@ -9,9 +9,10 @@ import { Selects } from '@/components/Select';
import { Apis } from '@/gen/Apis';
import { SexEnum } from '@/gen/Enums';
import { BetaSchemaForm } from '@ant-design/pro-components';
import { message } from 'antd';
import { Form, message } from 'antd';
export default function Create(props: MyBetaModalFormProps) {
const [form] = Form.useForm();
return (
<BetaSchemaForm<ApiTypes.Company.CompanyEmployees.Store>
{...MyModalFormProps.props}
@ -19,6 +20,12 @@ export default function Create(props: MyBetaModalFormProps) {
wrapperCol={{ span: 24 }}
width="500px"
trigger={<MyButtons.Create title={`添加`} />}
form={form}
onOpenChange={(open: any) => {
if (open) {
form.resetFields(); // 清空表单数据
}
}}
onFinish={async (values) =>
Apis.Company.CompanyEmployees.Store(values)
.then(() => {
@ -60,7 +67,7 @@ export default function Create(props: MyBetaModalFormProps) {
maxLength: 11,
},
colProps: { span: 12 },
formItemProps: { ...rulesHelper.text },
formItemProps: { ...rulesHelper.phone },
},
MyFormItems.EnumRadio({
key: 'sex',
@ -69,13 +76,22 @@ export default function Create(props: MyBetaModalFormProps) {
valueEnum: SexEnum,
required: true,
}),
{
key: 'password',
title: '密码',
colProps: { span: 24 },
valueType: 'password',
valueType: 'dependency',
name: ['companies_id'],
columns: ({ companies_id }) => [
Selects?.Positions({
title: '岗位',
params: { companies_id: companies_id },
key: 'positions_id',
formItemProps: { ...rulesHelper.text },
fieldProps: {
showSearch: true,
},
}),
],
},
{
key: 'remark',
title: '备注',

View File

@ -73,7 +73,7 @@ export default function Update(props: MyBetaModalFormProps) {
maxLength: 11,
},
colProps: { span: 12 },
formItemProps: { ...rulesHelper.text },
formItemProps: { ...rulesHelper.phone },
},
MyFormItems.EnumRadio({
key: 'sex',
@ -82,12 +82,17 @@ export default function Update(props: MyBetaModalFormProps) {
valueEnum: SexEnum,
required: true,
}),
{
key: 'password',
title: '密码',
colProps: { span: 24 },
valueType: 'password',
valueType: 'dependency',
name: ['companies_id'],
columns: ({ companies_id }) => [
Selects?.Positions({
title: '岗位',
params: { companies_id: companies_id },
key: 'positions_id',
formItemProps: { ...rulesHelper.text },
}),
],
},
{
key: 'remark',

View File

@ -24,51 +24,73 @@ export default function Index({ title = '账单' }) {
]}
columns={[
MyColumns.ID(),
{
title: '金额',
dataIndex: 'amount',
},
{
title: '优惠金额',
dataIndex: 'discount_amount',
search: false,
},
{
title: '滞纳金',
dataIndex: 'late_fee',
search: false,
},
MyColumns.EnumTag({
title: '类型',
dataIndex: 'type',
valueEnum: HouseBillsTypeEnum,
}),
{
title: '房屋',
dataIndex: ['asset_house', 'full_name'],
search: {
transform: (value) => {
return { full_name: value };
},
},
},
{
title: '账单月份',
dataIndex: 'month',
width: 100,
},
{
title: '金额',
dataIndex: 'amount',
search: false,
width: 100,
},
{
title: '优惠金额',
dataIndex: 'discount_amount',
search: false,
width: 100,
},
{
title: '滞纳金',
dataIndex: 'late_fee',
search: false,
width: 100,
},
{
title: '计费开始日期',
dataIndex: 'start_date',
search: false,
width: 120,
},
{
title: '计费结束日期',
dataIndex: 'end_date',
search: false,
width: 120,
},
{
title: '滞纳金起算日期',
dataIndex: 'late_start_date',
search: false,
},
{
title: '已收滞纳金天数',
dataIndex: 'collected_late_fee_days',
search: false,
},
{
title: '备注',
dataIndex: 'remark',
search: false,
},
MyColumns.CreatedAt(),
// {
// title: '滞纳金起算日期',
// dataIndex: 'late_start_date',
// search: false,
// },
// {
// title: '已收滞纳金天数',
// dataIndex: 'collected_late_fee_days',
// search: false,
// // },
// {
// title: '备注',
// dataIndex: 'remark',
// search: false,
// },
// MyColumns.CreatedAt(),
MyColumns.UpdatedAt(),
MyColumns.Option({
render: (_, item: any, index, action) => (
<Space key={index}>

View File

@ -38,28 +38,72 @@ export default function Create(props: MyBetaModalFormProps) {
Selects?.AssetProjects({
title: '选择项目',
key: 'asset_projects_id',
colProps: { span: 12 },
colProps: { span: 24 },
formItemProps: { ...rulesHelper.text },
}),
{
valueType: 'dependency',
name: ['asset_projects_id'],
columns: ({ asset_projects_id }) => [
Selects?.AssetHouses({
title: '选择房屋',
key: 'asset_houses_id',
params: { asset_projects_id: asset_projects_id },
formItemProps: { ...rulesHelper.text },
colProps: { span: 12 },
}),
],
name: ['asset_projects_id', 'asset_buildings_id', 'asset_units_id'],
columns: ({
asset_projects_id,
asset_buildings_id,
asset_units_id,
}) => {
return [
{
valueType: 'group',
columns: [
Selects?.AssetBuildings({
key: 'asset_buildings_id',
title: '选择楼栋',
params: {
asset_projects_id: asset_projects_id,
},
colProps: { span: 8 },
formItemProps: { ...rulesHelper.number },
fieldProps: {
showSearch: true,
onChange: () => {
form.setFieldsValue({
asset_units_id: undefined,
asset_floors_id: undefined,
});
},
},
}),
Selects?.AssetUnits({
key: 'asset_units_id',
title: '选择单元',
params: {
asset_projects_id: asset_projects_id,
asset_buildings_id: asset_buildings_id,
},
colProps: { span: 8 },
formItemProps: { ...rulesHelper.number },
}),
Selects?.AssetHouses({
title: '选择房屋',
key: 'asset_houses_id',
params: {
asset_projects_id: asset_projects_id,
asset_buildings_id: asset_buildings_id,
asset_units_id: asset_units_id,
},
formItemProps: { ...rulesHelper.text },
colProps: { span: 8 },
}),
],
},
];
},
},
{
key: 'amount',
title: '金额',
title: '账单金额',
valueType: 'digit',
colProps: { span: 8 },
fieldProps: {
addonAfter: '元',
style: {
width: '100%',
},
@ -71,18 +115,19 @@ export default function Create(props: MyBetaModalFormProps) {
title: '优惠金额',
valueType: 'digit',
fieldProps: {
addonAfter: '元',
style: {
width: '100%',
},
},
colProps: { span: 8 },
},
{
key: 'late_fee',
title: '滞纳金',
valueType: 'digit',
fieldProps: {
addonAfter: '元',
style: {
width: '100%',
},
@ -91,11 +136,26 @@ export default function Create(props: MyBetaModalFormProps) {
},
MyFormItems.EnumRadio({
key: 'type',
title: '类型',
title: '收费项目',
colProps: { span: 24 },
valueEnum: HouseBillsTypeEnum,
required: true,
}),
{
key: 'month',
title: '账单月份',
valueType: 'date',
colProps: { span: 8 },
fieldProps: {
picker: 'month',
format: 'YYYY-MM',
valueFormat: 'YYYY-MM',
style: {
width: '100%',
},
},
formItemProps: { ...rulesHelper.text },
},
{
key: 'start_date',
title: '计费开始日期',
@ -118,7 +178,6 @@ export default function Create(props: MyBetaModalFormProps) {
width: '100%',
},
},
formItemProps: { ...rulesHelper.text },
},
{
key: 'late_start_date',

View File

@ -5,7 +5,6 @@ import {
MyModalFormProps,
rulesHelper,
} from '@/common';
import { Selects } from '@/components/Select';
import { Apis } from '@/gen/Apis';
import { HouseBillsTypeEnum } from '@/gen/Enums';
import { BetaSchemaForm } from '@ant-design/pro-components';
@ -36,25 +35,13 @@ export default function Update(props: MyBetaModalFormProps) {
.catch(() => false)
}
columns={[
Selects?.AssetProjects({
title: '选择项目',
key: 'asset_projects_id',
colProps: { span: 12 },
formItemProps: { ...rulesHelper.text },
MyFormItems.EnumRadio({
key: 'type',
title: '类型',
colProps: { span: 24 },
valueEnum: HouseBillsTypeEnum,
required: true,
}),
{
valueType: 'dependency',
name: ['asset_projects_id'],
columns: ({ asset_projects_id }) => [
Selects?.AssetHouses({
title: '选择房屋',
key: 'asset_houses_id',
params: { asset_projects_id: asset_projects_id },
formItemProps: { ...rulesHelper.text },
colProps: { span: 12 },
}),
],
},
{
key: 'amount',
title: '金额',
@ -90,13 +77,22 @@ export default function Update(props: MyBetaModalFormProps) {
},
colProps: { span: 8 },
},
MyFormItems.EnumRadio({
key: 'type',
title: '类型',
colProps: { span: 24 },
valueEnum: HouseBillsTypeEnum,
required: true,
}),
{
key: 'month',
title: '账单月份',
valueType: 'date',
colProps: { span: 8 },
fieldProps: {
picker: 'month',
format: 'YYYY-MM',
valueFormat: 'YYYY-MM',
style: {
width: '100%',
},
},
formItemProps: { ...rulesHelper.text },
},
{
key: 'start_date',
title: '计费开始日期',