fix:项目调整
This commit is contained in:
parent
5c244d1a72
commit
aafef7be31
4
.vscode/settings.json
vendored
Normal file
4
.vscode/settings.json
vendored
Normal file
@ -0,0 +1,4 @@
|
||||
{
|
||||
"editor.formatOnSave": true,
|
||||
"editor.defaultFormatter": "esbenp.prettier-vscode"
|
||||
}
|
||||
@ -1,5 +1,4 @@
|
||||
{
|
||||
"url": "http://10.39.13.80:8003/api/docs/openapi",
|
||||
// "url": "http://we6f9c65.natappfree.cc/api/docs/openapi",
|
||||
"module": "Admin"
|
||||
}
|
||||
|
||||
@ -77,7 +77,7 @@ export const MyButtons = {
|
||||
return (
|
||||
<Popconfirm
|
||||
title="删除提示"
|
||||
description="确定要删除,将不可恢复?"
|
||||
description="是否确定要删除,将不可恢复?"
|
||||
okText="是"
|
||||
cancelText="否"
|
||||
onConfirm={onConfirm}
|
||||
|
||||
@ -59,8 +59,8 @@ export const MyColumns = {
|
||||
onConfirm={() => {
|
||||
onRestore?.({ id: item.id }).then(() => action?.reload());
|
||||
}}
|
||||
okText="Yes"
|
||||
cancelText="No"
|
||||
okText="是"
|
||||
cancelText="否"
|
||||
>
|
||||
<Tag color="gray" style={{ cursor: 'pointer' }}>
|
||||
已禁用
|
||||
@ -73,8 +73,8 @@ export const MyColumns = {
|
||||
onConfirm={() => {
|
||||
onSoftDelete?.({ id: item.id }).then(() => action?.reload());
|
||||
}}
|
||||
okText="Yes"
|
||||
cancelText="No"
|
||||
okText="是"
|
||||
cancelText="否"
|
||||
>
|
||||
<Tag color="green" style={{ cursor: 'pointer' }}>
|
||||
已启用
|
||||
|
||||
@ -38,4 +38,73 @@ export const SysSelects = {
|
||||
...rest,
|
||||
};
|
||||
},
|
||||
// 楼栋下拉框
|
||||
AssetBuildings(props?: PropsType): ReturnType {
|
||||
const {
|
||||
title = '楼栋',
|
||||
key = 'asset_buildings_id',
|
||||
required = false,
|
||||
hideInTable = true,
|
||||
...rest
|
||||
} = props ?? {};
|
||||
|
||||
return {
|
||||
title: title,
|
||||
key: key,
|
||||
valueType: 'select',
|
||||
hideInTable: hideInTable,
|
||||
formItemProps: { ...(required ? rulesHelper.number : {}) },
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
fieldNames: {
|
||||
label: 'label',
|
||||
value: 'value',
|
||||
},
|
||||
},
|
||||
request: async (params) =>
|
||||
(
|
||||
await Apis.Asset.AssetBuildings.Select({
|
||||
keywords: params?.KeyWords,
|
||||
asset_projects_id: params?.asset_projects_id,
|
||||
...params,
|
||||
})
|
||||
).data,
|
||||
...rest,
|
||||
};
|
||||
},
|
||||
// 单元下拉框
|
||||
AssetUnits(props?: PropsType): ReturnType {
|
||||
const {
|
||||
title = '单元',
|
||||
key = 'asset_buildings_id',
|
||||
required = false,
|
||||
hideInTable = true,
|
||||
...rest
|
||||
} = props ?? {};
|
||||
|
||||
return {
|
||||
title: title,
|
||||
key: key,
|
||||
valueType: 'select',
|
||||
hideInTable: hideInTable,
|
||||
formItemProps: { ...(required ? rulesHelper.number : {}) },
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
fieldNames: {
|
||||
label: 'label',
|
||||
value: 'value',
|
||||
},
|
||||
},
|
||||
request: async (params) =>
|
||||
(
|
||||
await Apis.Asset.AssetUnits.Select({
|
||||
keywords: params?.KeyWords,
|
||||
asset_projects_id: params?.asset_projects_id,
|
||||
asset_buildings_id: params?.asset_buildings_id,
|
||||
...params,
|
||||
})
|
||||
).data,
|
||||
...rest,
|
||||
};
|
||||
},
|
||||
};
|
||||
|
||||
76
src/gen/ApiTypes.d.ts
vendored
76
src/gen/ApiTypes.d.ts
vendored
@ -22,6 +22,10 @@ declare namespace ApiTypes {
|
||||
type Delete = {
|
||||
"id": number; // id
|
||||
};
|
||||
type Select = {
|
||||
"asset_projects_id"?: number; // 所属项目id,[ref:asset_projects]
|
||||
"keywords"?: string; // 关键词
|
||||
};
|
||||
}
|
||||
namespace AssetHouses {
|
||||
type List = {
|
||||
@ -81,13 +85,14 @@ declare namespace ApiTypes {
|
||||
}
|
||||
namespace AssetProjects {
|
||||
type List = {
|
||||
"companies_id"?: number; // 所属机构id,[ref:companies]
|
||||
"name"?: string; // 模糊搜索:名称
|
||||
};
|
||||
type Store = {
|
||||
"name": string; // 项目名称
|
||||
"alias_name"?: string; // 项目别名
|
||||
"code"?: string; // 项目编码
|
||||
"companies_id": number; // 所属机构id,[ref:companies]
|
||||
"companies_id"?: number; // 所属机构id,[ref:companies]
|
||||
"province"?: string; // 省
|
||||
"city"?: string; // 市
|
||||
"area"?: string; // 区
|
||||
@ -111,7 +116,7 @@ declare namespace ApiTypes {
|
||||
"name": string; // 项目名称
|
||||
"alias_name"?: string; // 项目别名
|
||||
"code"?: string; // 项目编码
|
||||
"companies_id": number; // 所属机构id,[ref:companies]
|
||||
"companies_id"?: number; // 所属机构id,[ref:companies]
|
||||
"province"?: string; // 省
|
||||
"city"?: string; // 市
|
||||
"area"?: string; // 区
|
||||
@ -142,6 +147,9 @@ declare namespace ApiTypes {
|
||||
type Delete = {
|
||||
"id": number; // id
|
||||
};
|
||||
type Select = {
|
||||
"keywords"?: string; // 关键词
|
||||
};
|
||||
}
|
||||
namespace AssetUnits {
|
||||
type List = {
|
||||
@ -178,6 +186,11 @@ declare namespace ApiTypes {
|
||||
type Delete = {
|
||||
"id": number; // id
|
||||
};
|
||||
type Select = {
|
||||
"asset_projects_id"?: number; // 所属项目id,[ref:asset_projects]
|
||||
"asset_buildings_id"?: number; // 所属楼栋id,[ref:asset_buildings]
|
||||
"keywords"?: string; // 关键词
|
||||
};
|
||||
}
|
||||
}
|
||||
namespace Common {
|
||||
@ -249,7 +262,7 @@ declare namespace ApiTypes {
|
||||
"business_license_image"?: string[]; // 营业执照图片
|
||||
"_lft"?: number; //
|
||||
"_rgt"?: number; //
|
||||
"parent_id"?: number; //
|
||||
"parent_id"?: number; // 上级 ID
|
||||
};
|
||||
type Update = {
|
||||
"id": number; // id
|
||||
@ -273,11 +286,7 @@ declare namespace ApiTypes {
|
||||
"business_license_image"?: string[]; // 营业执照图片
|
||||
"_lft"?: number; //
|
||||
"_rgt"?: number; //
|
||||
"parent_id"?: number; //
|
||||
};
|
||||
type Move = {
|
||||
"id": number; // ID
|
||||
"type": string; // 类型:up 升级,down 降级
|
||||
"parent_id"?: number; // 上级 ID
|
||||
};
|
||||
type Show = {
|
||||
"id": number; // id
|
||||
@ -294,9 +303,54 @@ declare namespace ApiTypes {
|
||||
type Select = {
|
||||
"keywords"?: string; // 关键词
|
||||
};
|
||||
type SelectTree = {
|
||||
"keywords"?: string; // -
|
||||
"parent_id"?: number; // -
|
||||
}
|
||||
namespace Organizations {
|
||||
type List = {
|
||||
"name"?: string; // 模糊搜索:名称
|
||||
"companies_id"?: number; // 机构ID[ref:companies]
|
||||
};
|
||||
type Store = {
|
||||
"companies_id": number; // 所属机构id,[ref:companies]
|
||||
"type": string; // 类型,[enum:OrganizationsTypeEnum]
|
||||
"name": string; // 名称
|
||||
"managers_id": number; // 负责人IDid,[ref:company_employees]
|
||||
"manager_phone"?: string; // 负责人电话
|
||||
"manager_email"?: string; // 负责人邮箱
|
||||
"status"?: number; // 状态
|
||||
"sort"?: number; // 排序
|
||||
"_lft"?: number; //
|
||||
"_rgt"?: number; //
|
||||
"parent_id"?: number; //
|
||||
};
|
||||
type Update = {
|
||||
"id": number; // id
|
||||
"companies_id": number; // 所属机构id,[ref:companies]
|
||||
"type": string; // 类型,[enum:OrganizationsTypeEnum]
|
||||
"name": string; // 名称
|
||||
"managers_id": number; // 负责人IDid,[ref:company_employees]
|
||||
"manager_phone"?: string; // 负责人电话
|
||||
"manager_email"?: string; // 负责人邮箱
|
||||
"status"?: number; // 状态
|
||||
"sort"?: number; // 排序
|
||||
"_lft"?: number; //
|
||||
"_rgt"?: number; //
|
||||
"parent_id"?: number; // 上级 ID
|
||||
};
|
||||
type Move = {
|
||||
"id": number; // ID
|
||||
"type": string; // 类型:up 升级,down 降级
|
||||
};
|
||||
type Show = {
|
||||
"id": number; // id
|
||||
};
|
||||
type SoftDelete = {
|
||||
"id": number; // id
|
||||
};
|
||||
type Restore = {
|
||||
"id": number; // id
|
||||
};
|
||||
type Delete = {
|
||||
"id": number; // id
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
@ -19,6 +19,9 @@ export const Apis = {
|
||||
Delete(data: ApiTypes.Asset.AssetBuildings.Delete): Promise<MyResponseType> {
|
||||
return request('admin/asset/asset_buildings/delete', { data });
|
||||
},
|
||||
Select(data?: ApiTypes.Asset.AssetBuildings.Select): Promise<MyResponseType> {
|
||||
return request('admin/asset/asset_buildings/select', { data });
|
||||
},
|
||||
},
|
||||
AssetHouses: {
|
||||
List(data?: ApiTypes.Asset.AssetHouses.List): Promise<MyResponseType> {
|
||||
@ -59,6 +62,9 @@ export const Apis = {
|
||||
Delete(data: ApiTypes.Asset.AssetProjects.Delete): Promise<MyResponseType> {
|
||||
return request('admin/asset/asset_projects/delete', { data });
|
||||
},
|
||||
Select(data?: ApiTypes.Asset.AssetProjects.Select): Promise<MyResponseType> {
|
||||
return request('admin/asset/asset_projects/select', { data });
|
||||
},
|
||||
},
|
||||
AssetUnits: {
|
||||
List(data?: ApiTypes.Asset.AssetUnits.List): Promise<MyResponseType> {
|
||||
@ -76,6 +82,9 @@ export const Apis = {
|
||||
Delete(data: ApiTypes.Asset.AssetUnits.Delete): Promise<MyResponseType> {
|
||||
return request('admin/asset/asset_units/delete', { data });
|
||||
},
|
||||
Select(data?: ApiTypes.Asset.AssetUnits.Select): Promise<MyResponseType> {
|
||||
return request('admin/asset/asset_units/select', { data });
|
||||
},
|
||||
},
|
||||
},
|
||||
Common: {
|
||||
@ -131,9 +140,6 @@ export const Apis = {
|
||||
Update(data: ApiTypes.Company.Companies.Update): Promise<MyResponseType> {
|
||||
return request('admin/company/companies/update', { data });
|
||||
},
|
||||
Move(data: ApiTypes.Company.Companies.Move): Promise<MyResponseType> {
|
||||
return request('admin/company/companies/move', { data });
|
||||
},
|
||||
Show(data: ApiTypes.Company.Companies.Show): Promise<MyResponseType> {
|
||||
return request('admin/company/companies/show', { data });
|
||||
},
|
||||
@ -149,8 +155,31 @@ export const Apis = {
|
||||
Select(data?: ApiTypes.Company.Companies.Select): Promise<MyResponseType> {
|
||||
return request('admin/company/companies/select', { data });
|
||||
},
|
||||
SelectTree(data?: ApiTypes.Company.Companies.SelectTree): Promise<MyResponseType> {
|
||||
return request('admin/company/companies/select_tree', { data });
|
||||
},
|
||||
Organizations: {
|
||||
List(data?: ApiTypes.Company.Organizations.List): Promise<MyResponseType> {
|
||||
return request('admin/company/organizations/list', { data });
|
||||
},
|
||||
Store(data: ApiTypes.Company.Organizations.Store): Promise<MyResponseType> {
|
||||
return request('admin/company/organizations/store', { data });
|
||||
},
|
||||
Update(data: ApiTypes.Company.Organizations.Update): Promise<MyResponseType> {
|
||||
return request('admin/company/organizations/update', { data });
|
||||
},
|
||||
Move(data: ApiTypes.Company.Organizations.Move): Promise<MyResponseType> {
|
||||
return request('admin/company/organizations/move', { data });
|
||||
},
|
||||
Show(data: ApiTypes.Company.Organizations.Show): Promise<MyResponseType> {
|
||||
return request('admin/company/organizations/show', { data });
|
||||
},
|
||||
SoftDelete(data: ApiTypes.Company.Organizations.SoftDelete): Promise<MyResponseType> {
|
||||
return request('admin/company/organizations/soft_delete', { data });
|
||||
},
|
||||
Restore(data: ApiTypes.Company.Organizations.Restore): Promise<MyResponseType> {
|
||||
return request('admin/company/organizations/restore', { data });
|
||||
},
|
||||
Delete(data: ApiTypes.Company.Organizations.Delete): Promise<MyResponseType> {
|
||||
return request('admin/company/organizations/delete', { data });
|
||||
},
|
||||
},
|
||||
},
|
||||
|
||||
204
src/gen/Enums.ts
204
src/gen/Enums.ts
@ -1,115 +1,191 @@
|
||||
// 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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
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"},
|
||||
SlabAndTower: { text: '板塔结合', color: '#007bff', value: 'SlabAndTower' },
|
||||
Slab: { text: '板楼', color: '#28a745', value: 'Slab' },
|
||||
Tower: { text: '塔楼', color: '#ffc107', value: 'Tower' },
|
||||
};
|
||||
|
||||
// CompaniesMerchantTypeEnum
|
||||
export const CompaniesMerchantTypeEnum = {
|
||||
'PropertyManagement': {"text":"物业公司","color":"#007bff","value":"PropertyManagement"},
|
||||
'ServiceProvider': {"text":"服务商","color":"#28a745","value":"ServiceProvider"},
|
||||
PropertyManagement: {
|
||||
text: '物业公司',
|
||||
color: '#007bff',
|
||||
value: 'PropertyManagement',
|
||||
},
|
||||
ServiceProvider: {
|
||||
text: '服务商',
|
||||
color: '#28a745',
|
||||
value: 'ServiceProvider',
|
||||
},
|
||||
};
|
||||
|
||||
// CompanyReceiptAccountsPayChannelEnum
|
||||
export const CompanyReceiptAccountsPayChannelEnum = {
|
||||
Value: { text: 'Label', color: '#ff0000', value: 'Value' },
|
||||
};
|
||||
|
||||
// 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' },
|
||||
};
|
||||
|
||||
// SysModuleEnum
|
||||
export const SysModuleEnum = {
|
||||
'Admin': {"text":"管理员","color":"#cf1322","value":"Admin"},
|
||||
'Customer': {"text":"客户","color":"#d4b106","value":"Customer"},
|
||||
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"},
|
||||
Directory: { text: '目录', color: '#6d7e14', value: 'Directory' },
|
||||
Page: { text: '页面', color: '#4d9a13', value: 'Page' },
|
||||
Button: { text: '按钮', color: '#97224f', value: 'Button' },
|
||||
};
|
||||
|
||||
|
||||
@ -5,8 +5,7 @@ import { useParams } from '@umijs/max';
|
||||
import { Tabs } from 'antd';
|
||||
import { useEffect, useState } from 'react';
|
||||
import MyAssetBuildings from './components/AssetBuildings';
|
||||
import MyInfo from './components/info';
|
||||
import Update from './modals/Update';
|
||||
import AssetInfo from './components/AssetInfo';
|
||||
export default function Show({ title = '项目详情' }) {
|
||||
const { id } = useParams<{ id: string }>();
|
||||
const [data, setShow] = useState<any>({});
|
||||
@ -22,19 +21,37 @@ export default function Show({ title = '项目详情' }) {
|
||||
}, [id]);
|
||||
|
||||
let items = [
|
||||
{
|
||||
label: '基本信息',
|
||||
key: 'info',
|
||||
closable: false,
|
||||
children: <AssetInfo item={data} reload={() => loadShow()} />,
|
||||
},
|
||||
{
|
||||
label: '楼栋管理',
|
||||
key: 'asset_buildings',
|
||||
closable: false,
|
||||
children: <MyAssetBuildings item={data} />,
|
||||
},
|
||||
// {
|
||||
// label: '车场管理',
|
||||
// key: 'car',
|
||||
// closable: false,
|
||||
// children: <MyAssetBuildings item={data} />,
|
||||
// },
|
||||
// {
|
||||
// label: '车位管理',
|
||||
// key: 'carport',
|
||||
// closable: false,
|
||||
// children: <MyAssetBuildings item={data} />,
|
||||
// },
|
||||
];
|
||||
return (
|
||||
<MyPageContainer title={title}>
|
||||
<MyInfo
|
||||
{/* <Info
|
||||
item={data}
|
||||
extra={<Update item={data} reload={() => loadShow()} title="项目" />}
|
||||
/>
|
||||
/> */}
|
||||
<ProCard>
|
||||
<Tabs type="card" items={data?.id ? items : []} />
|
||||
</ProCard>
|
||||
|
||||
@ -1,7 +1,11 @@
|
||||
import { MyBetaModalFormProps, MyColumns, MyProTableProps } from '@/common';
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyColumns,
|
||||
MyProTableProps,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
AssetHousesOrientationEnum,
|
||||
AssetHousesOwnershipTypeEnum,
|
||||
AssetHousesStatusEnum,
|
||||
AssetHousesUsageEnum,
|
||||
@ -10,8 +14,12 @@ import { ProCard, ProTable } from '@ant-design/pro-components';
|
||||
import { Space } from 'antd';
|
||||
import { useRef, useState } from 'react';
|
||||
import BuildingsCreate from '../modals/AssetBuildingsCreate';
|
||||
import AssetBuildingsUpdate from '../modals/AssetBuildingsUpdate';
|
||||
import AssetHousesCreate from '../modals/AssetHousesCreate';
|
||||
import AssetHousesShow from '../modals/AssetHousesShow';
|
||||
import AssetHousesUpdate from '../modals/AssetHousesUpdate';
|
||||
import AssetUnitsCreate from '../modals/AssetUnitsCreate';
|
||||
import AssetUnitsUpdate from '../modals/AssetUnitsUpdate';
|
||||
|
||||
export default function AssetBuildings(props: MyBetaModalFormProps) {
|
||||
const actionBuildingsRef: any = useRef();
|
||||
@ -21,7 +29,7 @@ export default function AssetBuildings(props: MyBetaModalFormProps) {
|
||||
const [selectKeyUnits, setSelectKeyUnits] = useState<any>({});
|
||||
return (
|
||||
<ProCard
|
||||
extra={
|
||||
title={
|
||||
<Space>
|
||||
<BuildingsCreate
|
||||
key="BuildingsCreate"
|
||||
@ -33,7 +41,7 @@ export default function AssetBuildings(props: MyBetaModalFormProps) {
|
||||
key="UnitsCreate"
|
||||
item={{
|
||||
...props?.item,
|
||||
asset_buildings_id: selectKey?.id || undefined,
|
||||
// asset_buildings_id: selectKey?.id || undefined,
|
||||
}}
|
||||
reload={() => actionUnitsRef?.current?.reload()}
|
||||
title="单元"
|
||||
@ -42,11 +50,11 @@ export default function AssetBuildings(props: MyBetaModalFormProps) {
|
||||
key="HousesCreate"
|
||||
item={{
|
||||
...props?.item,
|
||||
asset_buildings_id: selectKey?.id || undefined,
|
||||
asset_units_id: selectKeyUnits?.id || undefined,
|
||||
// asset_buildings_id: selectKey?.id || undefined,
|
||||
// asset_units_id: selectKeyUnits?.id || undefined,
|
||||
}}
|
||||
reload={() => actionHousesRef?.current?.reload()}
|
||||
title="房源"
|
||||
title="房屋"
|
||||
/>
|
||||
</Space>
|
||||
}
|
||||
@ -84,13 +92,28 @@ export default function AssetBuildings(props: MyBetaModalFormProps) {
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
{
|
||||
title: '楼栋',
|
||||
width: '250px',
|
||||
title: '楼栋名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<AssetBuildingsUpdate item={item} reload={action?.reload} />
|
||||
<MyButtons.Delete
|
||||
size="small"
|
||||
onConfirm={() =>
|
||||
Apis.Asset.AssetBuildings.Delete({ id: item.id }).then(
|
||||
() => action?.reload(),
|
||||
)
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
|
||||
{selectKey?.id && (
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
search={false}
|
||||
@ -126,13 +149,29 @@ export default function AssetBuildings(props: MyBetaModalFormProps) {
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
{
|
||||
title: '单元',
|
||||
width: '250px',
|
||||
title: '单元名称',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<AssetUnitsUpdate item={item} reload={action?.reload} />
|
||||
<MyButtons.Delete
|
||||
size="small"
|
||||
onConfirm={() =>
|
||||
Apis.Asset.AssetUnits.Delete({ id: item.id }).then(() =>
|
||||
action?.reload(),
|
||||
)
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
)}
|
||||
|
||||
{selectKeyUnits?.id && (
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
search={false}
|
||||
@ -152,6 +191,7 @@ export default function AssetBuildings(props: MyBetaModalFormProps) {
|
||||
options={false}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
|
||||
MyColumns.EnumTag({
|
||||
title: '用途',
|
||||
dataIndex: 'usage',
|
||||
@ -161,59 +201,41 @@ export default function AssetBuildings(props: MyBetaModalFormProps) {
|
||||
title: '房号',
|
||||
dataIndex: 'name',
|
||||
},
|
||||
{
|
||||
title: '楼层',
|
||||
dataIndex: 'floor',
|
||||
render(_, record) {
|
||||
return `${record?.floor}层`;
|
||||
},
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '产权性质',
|
||||
dataIndex: 'ownership_type',
|
||||
valueEnum: AssetHousesOwnershipTypeEnum,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '朝向',
|
||||
dataIndex: 'orientation',
|
||||
valueEnum: AssetHousesOrientationEnum,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '房屋状态',
|
||||
dataIndex: 'status',
|
||||
valueEnum: AssetHousesStatusEnum,
|
||||
}),
|
||||
{
|
||||
title: '房',
|
||||
dataIndex: 'room',
|
||||
},
|
||||
{
|
||||
title: '厅',
|
||||
dataIndex: 'hall',
|
||||
},
|
||||
{
|
||||
title: '厨',
|
||||
dataIndex: 'kitchen',
|
||||
},
|
||||
{
|
||||
title: '卫',
|
||||
dataIndex: 'bathroom',
|
||||
},
|
||||
{
|
||||
title: '阳台',
|
||||
dataIndex: 'balcony',
|
||||
},
|
||||
{
|
||||
title: '产权年限',
|
||||
dataIndex: 'ownership_term',
|
||||
},
|
||||
{
|
||||
title: '建筑面积',
|
||||
dataIndex: 'built_area',
|
||||
},
|
||||
{
|
||||
title: '套内面积',
|
||||
dataIndex: 'inside_area',
|
||||
},
|
||||
{
|
||||
title: '计费面积',
|
||||
dataIndex: 'chargeable_area',
|
||||
},
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
<Space key={index}>
|
||||
<AssetHousesShow item={item} reload={action?.reload} />
|
||||
<AssetHousesUpdate item={item} reload={action?.reload} />
|
||||
<MyButtons.Delete
|
||||
onConfirm={() =>
|
||||
Apis.Asset.AssetBuildings.Delete({ id: item.id }).then(
|
||||
() => action?.reload(),
|
||||
)
|
||||
}
|
||||
/>
|
||||
</Space>
|
||||
),
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
)}
|
||||
</Space>
|
||||
</ProCard>
|
||||
);
|
||||
|
||||
95
src/pages/asset/asset_projects/components/AssetInfo.tsx
Normal file
95
src/pages/asset/asset_projects/components/AssetInfo.tsx
Normal file
@ -0,0 +1,95 @@
|
||||
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';
|
||||
|
||||
export default function info(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<Space direction="vertical" style={{ width: '100%' }}>
|
||||
<ProCard extra={props.extra}>
|
||||
<ProDescriptions bordered>
|
||||
<ProDescriptions.Item label="项目名称">
|
||||
<Space>
|
||||
{props?.item?.name}
|
||||
<AssetUpdate
|
||||
item={props?.item}
|
||||
title="项目"
|
||||
reload={props?.reload}
|
||||
/>
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="项目别名">
|
||||
{props?.item?.alias_name}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="项目编码">
|
||||
{props?.item?.code}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="项目状态">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetProjectsStatusEnum}
|
||||
value={props?.item?.status}
|
||||
key="status"
|
||||
/>
|
||||
</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={AssetProjectsChargeEnum}
|
||||
value={props?.item?.charge}
|
||||
key="charge"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="委托类型">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetProjectsEntrustTypeEnum}
|
||||
value={props?.item?.entrust_type}
|
||||
key="entrust_type"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="接管日期">
|
||||
{props?.item?.takeover_date}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="封园日期">
|
||||
{props?.item?.closure_date}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="项目地址" span={3}>
|
||||
{props?.item?.province || ''}
|
||||
{props?.item?.city || ''}
|
||||
{props?.item?.district || ''}
|
||||
{props?.item?.address || ''}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="创建日期" span={3}>
|
||||
{props?.item?.created_at}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="最近修改" span={3}>
|
||||
{props?.item?.updated_at}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
<ProCard extra={props.extra}>
|
||||
<ProDescriptions bordered>
|
||||
<ProDescriptions.Item label="关联机构" span={3}>
|
||||
<Space>
|
||||
<div>
|
||||
【{props?.item?.company?.id}】{props?.item?.company?.name}
|
||||
</div>
|
||||
<AssetUpdate item={props?.item} title="项目" />
|
||||
</Space>
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
</Space>
|
||||
);
|
||||
}
|
||||
@ -1,67 +0,0 @@
|
||||
import { MyBetaModalFormProps, renderTextHelper } from '@/common';
|
||||
import {
|
||||
AssetProjectsChargeEnum,
|
||||
AssetProjectsEntrustTypeEnum,
|
||||
AssetProjectsPropertyTypeEnum,
|
||||
AssetProjectsStatusEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||
|
||||
export default function info(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<ProCard extra={props.extra}>
|
||||
<ProDescriptions bordered>
|
||||
<ProDescriptions.Item label="项目名称">
|
||||
{props?.item?.name}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="项目别名">
|
||||
{props?.item?.alias_name}
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="项目编码">
|
||||
{props?.item?.code}
|
||||
</ProDescriptions.Item>
|
||||
|
||||
<ProDescriptions.Item label="状态">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetProjectsStatusEnum}
|
||||
value={props?.item?.status}
|
||||
key="status"
|
||||
/>
|
||||
</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={AssetProjectsChargeEnum}
|
||||
value={props?.item?.charge}
|
||||
key="charge"
|
||||
/>
|
||||
</ProDescriptions.Item>
|
||||
<ProDescriptions.Item label="委托类型">
|
||||
<renderTextHelper.Tag
|
||||
Enums={AssetProjectsEntrustTypeEnum}
|
||||
value={props?.item?.entrust_type}
|
||||
key="entrust_type"
|
||||
/>
|
||||
</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?.province || ''}
|
||||
{props?.item?.city || ''}
|
||||
{props?.item?.district || ''}
|
||||
{props?.item?.address || ''}
|
||||
</ProDescriptions.Item>
|
||||
</ProDescriptions>
|
||||
</ProCard>
|
||||
);
|
||||
}
|
||||
@ -22,15 +22,21 @@ export default function Index({ title = '项目管理' }) {
|
||||
<MyPageContainer title={title}>
|
||||
<ProTable
|
||||
{...MyProTableProps.props}
|
||||
search={false}
|
||||
// search={false}
|
||||
request={async (params, sort) =>
|
||||
MyProTableProps.request(params, sort, Apis.Asset.AssetProjects.List)
|
||||
}
|
||||
toolBarRender={(action) => [
|
||||
<Create key="Create" reload={action?.reload} title={title} />,
|
||||
<Create key="Create" reload={action?.reload} title={'项目'} />,
|
||||
]}
|
||||
columns={[
|
||||
MyColumns.ID(),
|
||||
MyColumns.EnumTag({
|
||||
title: '项目类型',
|
||||
dataIndex: 'property_type',
|
||||
valueEnum: AssetProjectsPropertyTypeEnum,
|
||||
search: false,
|
||||
}),
|
||||
{
|
||||
title: '项目名称',
|
||||
dataIndex: 'name',
|
||||
@ -39,30 +45,11 @@ export default function Index({ title = '项目管理' }) {
|
||||
title: '项目别名',
|
||||
dataIndex: 'alias_name',
|
||||
},
|
||||
{
|
||||
title: '项目编码',
|
||||
dataIndex: 'code',
|
||||
},
|
||||
MyColumns.EnumTag({
|
||||
title: '类型',
|
||||
dataIndex: 'property_type',
|
||||
valueEnum: AssetProjectsPropertyTypeEnum,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '状态',
|
||||
dataIndex: 'status',
|
||||
valueEnum: AssetProjectsStatusEnum,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '收费方式',
|
||||
dataIndex: 'charge',
|
||||
valueEnum: AssetProjectsChargeEnum,
|
||||
}),
|
||||
MyColumns.EnumTag({
|
||||
title: '委托类型',
|
||||
dataIndex: 'entrust_type',
|
||||
valueEnum: AssetProjectsEntrustTypeEnum,
|
||||
}),
|
||||
// {
|
||||
// title: '项目编码',
|
||||
// dataIndex: 'code',
|
||||
// search: false,
|
||||
// },
|
||||
{
|
||||
title: '地址',
|
||||
render: (_, i: any) => {
|
||||
@ -70,15 +57,43 @@ export default function Index({ title = '项目管理' }) {
|
||||
i?.address || ''
|
||||
}`;
|
||||
},
|
||||
search:false,
|
||||
},
|
||||
{
|
||||
title: '接管日期',
|
||||
dataIndex: 'takeover_date',
|
||||
},
|
||||
{
|
||||
title: '封园日期',
|
||||
dataIndex: 'closure_date',
|
||||
},
|
||||
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,
|
||||
}),
|
||||
// {
|
||||
// title: '接管日期',
|
||||
// dataIndex: 'takeover_date',
|
||||
// search:false,
|
||||
// },
|
||||
// {
|
||||
// title: '封园日期',
|
||||
// dataIndex: 'closure_date',
|
||||
// search:false,
|
||||
// },
|
||||
MyColumns.CreatedAt(),
|
||||
MyColumns.Option({
|
||||
render: (_, item: any, index, action) => (
|
||||
|
||||
@ -6,17 +6,25 @@ import {
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
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.Asset.AssetBuildings.Store>
|
||||
{...MyModalFormProps.props}
|
||||
form={form}
|
||||
title={`添加${props.title}`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="500px"
|
||||
trigger={<MyButtons.Create title={`添加${props.title}`} />}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
Apis.Asset.AssetBuildings.Store({
|
||||
...values,
|
||||
|
||||
@ -0,0 +1,60 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
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.Asset.AssetBuildings.Update>
|
||||
{...MyModalFormProps.props}
|
||||
form={form}
|
||||
title={`编辑`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="500px"
|
||||
trigger={
|
||||
<MyButtons.Default
|
||||
title={`编辑` } size='small' type='link'
|
||||
/>
|
||||
}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.setFieldsValue(props?.item); // 编辑赋值
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
Apis.Asset.AssetBuildings.Update({
|
||||
...values,
|
||||
asset_projects_id: props?.item?.asset_projects_id,
|
||||
id: props?.item?.id,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('楼栋编辑成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
{
|
||||
key: 'name',
|
||||
title: '楼栋名称',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'alias_name',
|
||||
title: '楼栋别名',
|
||||
colProps: { span: 24 },
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -5,6 +5,7 @@ import {
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { SysSelects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
AssetHousesOrientationEnum,
|
||||
@ -13,9 +14,10 @@ import {
|
||||
AssetHousesUsageEnum,
|
||||
} 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();
|
||||
console.log(props?.item, 'item');
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Asset.AssetHouses.Store>
|
||||
@ -23,20 +25,17 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
title={`添加${props.title}`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="800px"
|
||||
trigger={
|
||||
<MyButtons.Create
|
||||
title={`添加${props.title}`}
|
||||
disabled={
|
||||
!(props?.item?.asset_units_id && props?.item?.asset_buildings_id)
|
||||
}
|
||||
/>
|
||||
trigger={<MyButtons.Create title={`添加${props.title}`} />}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
Apis.Asset.AssetHouses.Store({
|
||||
...values,
|
||||
asset_projects_id: props?.item?.id,
|
||||
asset_buildings_id: props?.item?.asset_buildings_id,
|
||||
asset_units_id: props?.item?.asset_units_id,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
@ -46,90 +45,144 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
{
|
||||
valueType: 'dependency',
|
||||
name: ['asset_buildings_id', 'asset_units_id'],
|
||||
columns: ({ asset_buildings_id }) => {
|
||||
return [
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
SysSelects?.AssetBuildings({
|
||||
key: 'asset_buildings_id',
|
||||
title: '选择楼栋',
|
||||
params: {
|
||||
asset_projects_id: props?.item?.id,
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
onChange: () => {
|
||||
form.setFieldsValue({
|
||||
asset_units_id: undefined,
|
||||
asset_floors_id: undefined,
|
||||
});
|
||||
},
|
||||
},
|
||||
}),
|
||||
SysSelects?.AssetUnits({
|
||||
key: 'asset_units_id',
|
||||
title: '选择单元',
|
||||
params: {
|
||||
asset_projects_id: props?.item?.id,
|
||||
asset_buildings_id: asset_buildings_id,
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
}),
|
||||
{
|
||||
key: 'name',
|
||||
title: '房号',
|
||||
colProps: { span: 12 },
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'full_name',
|
||||
title: '房屋全称',
|
||||
colProps: { span: 12 },
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'ownership_type',
|
||||
title: '产权性质',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: AssetHousesOwnershipTypeEnum,
|
||||
required: true,
|
||||
}),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'orientation',
|
||||
title: '朝向',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: AssetHousesOrientationEnum,
|
||||
required: true,
|
||||
}),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'usage',
|
||||
title: '用途',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: AssetHousesUsageEnum,
|
||||
required: true,
|
||||
}),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'status',
|
||||
title: '房屋状态',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: AssetHousesStatusEnum,
|
||||
required: true,
|
||||
}),
|
||||
|
||||
{
|
||||
key: 'built_area',
|
||||
title: '建筑面积',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonAfter: '㎡',
|
||||
},
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
{
|
||||
key: 'inside_area',
|
||||
title: '套内面积',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonAfter: '㎡',
|
||||
},
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
{
|
||||
key: 'chargeable_area',
|
||||
title: '计费面积',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonAfter: '㎡',
|
||||
},
|
||||
colProps: { span: 8 },
|
||||
},
|
||||
{
|
||||
key: 'floor',
|
||||
title: '楼层',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonAfter: '楼',
|
||||
max: 99,
|
||||
},
|
||||
colProps: { span: 8 },
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
},
|
||||
},
|
||||
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'usage',
|
||||
title: '用途',
|
||||
colProps: { span: 18 },
|
||||
valueEnum: AssetHousesUsageEnum,
|
||||
required: true,
|
||||
}),
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'ownership_type',
|
||||
title: '产权性质',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: AssetHousesOwnershipTypeEnum,
|
||||
// required: true,
|
||||
}),
|
||||
// {
|
||||
// key: 'ownership_term',
|
||||
// title: '产权年限',
|
||||
// fieldProps: {
|
||||
// addonAfter: '年',
|
||||
// },
|
||||
// colProps: { span: 8 },
|
||||
// },
|
||||
|
||||
{
|
||||
key: 'built_area',
|
||||
title: '建筑面积',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonAfter: '㎡',
|
||||
max: 99999,
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{
|
||||
key: 'ownership_term',
|
||||
title: '产权年限',
|
||||
key: 'inside_area',
|
||||
title: '套内面积',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonAfter: '年',
|
||||
addonAfter: '㎡',
|
||||
max: 99999,
|
||||
},
|
||||
colProps: { span: 8 },
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{
|
||||
key: 'chargeable_area',
|
||||
title: '计费面积',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonAfter: '㎡',
|
||||
max: 99999,
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'status',
|
||||
title: '房屋状态',
|
||||
colProps: { span: 6 },
|
||||
// valueEnum: AssetHousesStatusEnum,
|
||||
// required: true,
|
||||
valueEnum: () => {
|
||||
let obj: any = JSON.parse(JSON.stringify(AssetHousesStatusEnum));
|
||||
delete obj.SelfOccupied;
|
||||
delete obj.Rented;
|
||||
delete obj.Vacant;
|
||||
return obj;
|
||||
},
|
||||
}),
|
||||
// {
|
||||
// key: 'full_name',
|
||||
// title: '房屋全称',
|
||||
// colProps: { span: 12 },
|
||||
// },
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'orientation',
|
||||
title: '房屋状态',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: AssetHousesOrientationEnum,
|
||||
// required: true,
|
||||
}),
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
@ -151,15 +204,6 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
},
|
||||
colProps: { span: 4 },
|
||||
},
|
||||
{
|
||||
key: 'kitchen',
|
||||
title: '厨',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonAfter: '厨',
|
||||
},
|
||||
colProps: { span: 4 },
|
||||
},
|
||||
{
|
||||
key: 'bathroom',
|
||||
title: '卫',
|
||||
@ -169,6 +213,15 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
},
|
||||
colProps: { span: 4 },
|
||||
},
|
||||
{
|
||||
key: 'kitchen',
|
||||
title: '厨',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonAfter: '厨',
|
||||
},
|
||||
colProps: { span: 4 },
|
||||
},
|
||||
{
|
||||
key: 'balcony',
|
||||
title: '阳台',
|
||||
|
||||
75
src/pages/asset/asset_projects/modals/AssetHousesShow.tsx
Normal file
75
src/pages/asset/asset_projects/modals/AssetHousesShow.tsx
Normal file
@ -0,0 +1,75 @@
|
||||
import { MyBetaModalFormProps, renderTextHelper } from '@/common';
|
||||
import { MyModal } from '@/components/MyModal';
|
||||
import {
|
||||
AssetHousesOrientationEnum,
|
||||
AssetHousesOwnershipTypeEnum,
|
||||
AssetHousesStatusEnum,
|
||||
AssetHousesUsageEnum,
|
||||
} from '@/gen/Enums';
|
||||
import { ProCard, ProDescriptions } from '@ant-design/pro-components';
|
||||
|
||||
export default function info(props: MyBetaModalFormProps) {
|
||||
return (
|
||||
<MyModal
|
||||
title={props.title || '查看'}
|
||||
width="1000px"
|
||||
node={
|
||||
<ProCard extra={props.extra}>
|
||||
<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>
|
||||
}
|
||||
/>
|
||||
);
|
||||
}
|
||||
244
src/pages/asset/asset_projects/modals/AssetHousesUpdate.tsx
Normal file
244
src/pages/asset/asset_projects/modals/AssetHousesUpdate.tsx
Normal file
@ -0,0 +1,244 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyFormItems,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { SysSelects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
AssetHousesOrientationEnum,
|
||||
AssetHousesOwnershipTypeEnum,
|
||||
AssetHousesStatusEnum,
|
||||
AssetHousesUsageEnum,
|
||||
} 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();
|
||||
console.log(props?.item, 'item');
|
||||
return (
|
||||
<BetaSchemaForm<ApiTypes.Asset.AssetHouses.Update>
|
||||
{...MyModalFormProps.props}
|
||||
title={`编辑`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="800px"
|
||||
trigger={<MyButtons.Default title={`编辑`} size="small" type="link" />}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.setFieldsValue(props?.item); // 编辑赋值
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
Apis.Asset.AssetHouses.Update({
|
||||
...values,
|
||||
asset_projects_id: props?.item?.asset_projects_id,
|
||||
asset_buildings_id:
|
||||
values.asset_buildings_id || props?.item?.asset_buildings_id,
|
||||
asset_units_id: values.asset_units_id || props?.item?.asset_units_id,
|
||||
id: props?.item?.id,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('房屋编辑成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
{
|
||||
valueType: 'dependency',
|
||||
name: ['asset_buildings_id', 'asset_units_id'],
|
||||
columns: ({ asset_buildings_id }) => {
|
||||
return [
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
SysSelects?.AssetBuildings({
|
||||
key: 'asset_buildings_id',
|
||||
title: '选择楼栋',
|
||||
params: {
|
||||
asset_projects_id: props?.item?.id,
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
fieldProps: {
|
||||
showSearch: true,
|
||||
onChange: () => {
|
||||
form.setFieldsValue({
|
||||
asset_units_id: undefined,
|
||||
asset_floors_id: undefined,
|
||||
});
|
||||
},
|
||||
},
|
||||
}),
|
||||
SysSelects?.AssetUnits({
|
||||
key: 'asset_units_id',
|
||||
title: '选择单元',
|
||||
params: {
|
||||
asset_projects_id: props?.item?.id,
|
||||
asset_buildings_id: asset_buildings_id,
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
}),
|
||||
{
|
||||
key: 'name',
|
||||
title: '房号',
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'floor',
|
||||
title: '楼层',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonAfter: '楼',
|
||||
max: 99,
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
},
|
||||
},
|
||||
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'usage',
|
||||
title: '房屋用途',
|
||||
colProps: { span: 18 },
|
||||
valueEnum: AssetHousesUsageEnum,
|
||||
required: true,
|
||||
}),
|
||||
MyFormItems.EnumSelect({
|
||||
key: 'ownership_type',
|
||||
title: '产权性质',
|
||||
colProps: { span: 6 },
|
||||
valueEnum: AssetHousesOwnershipTypeEnum,
|
||||
// required: true,
|
||||
}),
|
||||
// {
|
||||
// key: 'ownership_term',
|
||||
// title: '产权年限',
|
||||
// fieldProps: {
|
||||
// addonAfter: '年',
|
||||
// },
|
||||
// colProps: { span: 8 },
|
||||
// },
|
||||
|
||||
{
|
||||
key: 'built_area',
|
||||
title: '建筑面积',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonAfter: '㎡',
|
||||
max: 99999,
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{
|
||||
key: 'inside_area',
|
||||
title: '套内面积',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonAfter: '㎡',
|
||||
max: 99999,
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{
|
||||
key: 'chargeable_area',
|
||||
title: '计费面积',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonAfter: '㎡',
|
||||
max: 99999,
|
||||
},
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'status',
|
||||
title: '房屋状态',
|
||||
colProps: { span: 6 },
|
||||
// valueEnum: AssetHousesStatusEnum,
|
||||
// required: true,
|
||||
valueEnum: () => {
|
||||
let obj: any = JSON.parse(JSON.stringify(AssetHousesStatusEnum));
|
||||
delete obj.SelfOccupied;
|
||||
delete obj.Rented;
|
||||
delete obj.Vacant;
|
||||
return obj;
|
||||
},
|
||||
}),
|
||||
// {
|
||||
// key: 'full_name',
|
||||
// title: '房屋全称',
|
||||
// colProps: { span: 12 },
|
||||
// },
|
||||
|
||||
{
|
||||
valueType: 'group',
|
||||
columns: [
|
||||
{
|
||||
key: 'room',
|
||||
title: '房',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonAfter: '房',
|
||||
},
|
||||
colProps: { span: 4 },
|
||||
},
|
||||
{
|
||||
key: 'hall',
|
||||
title: '厅',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonAfter: '厅',
|
||||
},
|
||||
colProps: { span: 4 },
|
||||
},
|
||||
{
|
||||
key: 'bathroom',
|
||||
title: '卫',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonAfter: '卫',
|
||||
},
|
||||
colProps: { span: 4 },
|
||||
},
|
||||
{
|
||||
key: 'kitchen',
|
||||
title: '厨',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonAfter: '厨',
|
||||
},
|
||||
colProps: { span: 4 },
|
||||
},
|
||||
{
|
||||
key: 'balcony',
|
||||
title: '阳台',
|
||||
valueType: 'digit',
|
||||
fieldProps: {
|
||||
addonAfter: '阳台',
|
||||
},
|
||||
colProps: { span: 4 },
|
||||
},
|
||||
],
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'orientation',
|
||||
title: '朝向',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: AssetHousesOrientationEnum,
|
||||
// required: true,
|
||||
}),
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -5,15 +5,17 @@ import {
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { SysSelects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
AssetUnitsBuildingStructureEnum,
|
||||
AssetUnitsBuildingTypeEnum,
|
||||
} 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.Asset.AssetUnits.Store>
|
||||
{...MyModalFormProps.props}
|
||||
@ -23,14 +25,19 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
trigger={
|
||||
<MyButtons.Create
|
||||
title={`添加${props.title}`}
|
||||
disabled={!props?.item?.asset_buildings_id}
|
||||
// disabled={!props?.item?.asset_buildings_id}
|
||||
/>
|
||||
}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.resetFields(); // 清空表单数据
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
Apis.Asset.AssetUnits.Store({
|
||||
...values,
|
||||
asset_projects_id: props?.item?.id,
|
||||
asset_buildings_id: props?.item?.asset_buildings_id,
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
@ -40,6 +47,15 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
SysSelects?.AssetBuildings({
|
||||
key: 'asset_buildings_id',
|
||||
title: '选择楼栋',
|
||||
params:{
|
||||
asset_projects_id: props?.item?.id,
|
||||
},
|
||||
colProps: { span:24 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
}),
|
||||
{
|
||||
key: 'name',
|
||||
title: '单元名称',
|
||||
@ -68,17 +84,17 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
{
|
||||
key: 'elevator_count',
|
||||
title: '电梯数量',
|
||||
colProps: { span: 12 },
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{
|
||||
key: 'units_per_building',
|
||||
title: '单元户数',
|
||||
colProps: { span: 12 },
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{
|
||||
key: 'highest_floor',
|
||||
title: '最高楼层',
|
||||
colProps: { span: 12 },
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
]}
|
||||
/>
|
||||
|
||||
103
src/pages/asset/asset_projects/modals/AssetUnitsUpdate.tsx
Normal file
103
src/pages/asset/asset_projects/modals/AssetUnitsUpdate.tsx
Normal file
@ -0,0 +1,103 @@
|
||||
import {
|
||||
MyBetaModalFormProps,
|
||||
MyButtons,
|
||||
MyFormItems,
|
||||
MyModalFormProps,
|
||||
rulesHelper,
|
||||
} from '@/common';
|
||||
import { SysSelects } from '@/components/Select';
|
||||
import { Apis } from '@/gen/Apis';
|
||||
import {
|
||||
AssetUnitsBuildingStructureEnum,
|
||||
AssetUnitsBuildingTypeEnum,
|
||||
} 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.Asset.AssetUnits.Update>
|
||||
{...MyModalFormProps.props}
|
||||
title={`编辑`}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="700px"
|
||||
trigger={
|
||||
<MyButtons.Default
|
||||
title={`编辑` } size='small' type='link'
|
||||
/>
|
||||
}
|
||||
form={form}
|
||||
onOpenChange={(open: any) => {
|
||||
if (open) {
|
||||
form.setFieldsValue(props?.item); // 编辑赋值
|
||||
}
|
||||
}}
|
||||
onFinish={async (values) =>
|
||||
Apis.Asset.AssetUnits.Update({
|
||||
...values,
|
||||
asset_projects_id: props?.item?.asset_projects_id,
|
||||
id: props?.item?.id,
|
||||
|
||||
})
|
||||
.then(() => {
|
||||
props.reload?.();
|
||||
message.success('单元编辑成功');
|
||||
return true;
|
||||
})
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
SysSelects?.AssetBuildings({
|
||||
key: 'asset_buildings_id',
|
||||
title: '选择楼栋',
|
||||
params:{
|
||||
asset_projects_id: props?.item?.id,
|
||||
},
|
||||
colProps: { span:24 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
}),
|
||||
{
|
||||
key: 'name',
|
||||
title: '单元名称',
|
||||
colProps: { span: 12 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'alias_name',
|
||||
title: '单元别名',
|
||||
colProps: { span: 12 },
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'building_structure',
|
||||
title: '建筑结构',
|
||||
colProps: { span: 12 },
|
||||
valueEnum: AssetUnitsBuildingStructureEnum,
|
||||
required: true,
|
||||
}),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'building_type',
|
||||
title: '建筑类型',
|
||||
colProps: { span: 12 },
|
||||
valueEnum: AssetUnitsBuildingTypeEnum,
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
key: 'elevator_count',
|
||||
title: '电梯数量',
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{
|
||||
key: 'units_per_building',
|
||||
title: '单元户数',
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{
|
||||
key: 'highest_floor',
|
||||
title: '最高楼层',
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
]}
|
||||
/>
|
||||
);
|
||||
}
|
||||
@ -22,7 +22,14 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
<BetaSchemaForm<ApiTypes.Asset.AssetProjects.Update>
|
||||
{...MyModalFormProps.props}
|
||||
title={`编辑${props.title}`}
|
||||
trigger={<MyButtons.Default title="编辑" type="primary" size="middle" />}
|
||||
trigger={
|
||||
<MyButtons.Default
|
||||
title="修改"
|
||||
color="primary"
|
||||
variant="filled"
|
||||
size="small"
|
||||
/>
|
||||
}
|
||||
wrapperCol={{ span: 24 }}
|
||||
width="800px"
|
||||
request={() =>
|
||||
@ -46,91 +53,100 @@ export default function Update(props: MyBetaModalFormProps) {
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
SysSelects?.Companies({
|
||||
key: 'companies_id',
|
||||
title: '所属机构',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
}),
|
||||
{
|
||||
key: 'name',
|
||||
title: '项目名称',
|
||||
colProps: { span: 8 },
|
||||
colProps: { span: 12 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'alias_name',
|
||||
title: '项目别名',
|
||||
colProps: { span: 8 },
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{
|
||||
key: 'code',
|
||||
title: '项目编码',
|
||||
colProps: { span: 8 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'property_type',
|
||||
title: '物业类型',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: AssetProjectsPropertyTypeEnum,
|
||||
required: true,
|
||||
SysSelects?.Companies({
|
||||
key: 'companies_id',
|
||||
title: '所属机构',
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
}),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'status',
|
||||
title: '状态',
|
||||
colProps: { span: 12 },
|
||||
valueEnum: AssetProjectsStatusEnum,
|
||||
required: true,
|
||||
}),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'charge',
|
||||
title: '收费方式',
|
||||
colProps: { span: 12 },
|
||||
valueEnum: AssetProjectsChargeEnum,
|
||||
required: true,
|
||||
}),
|
||||
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'entrust_type',
|
||||
title: '委托类型',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: AssetProjectsEntrustTypeEnum,
|
||||
required: true,
|
||||
}),
|
||||
|
||||
// {
|
||||
// key: 'code',
|
||||
// title: '项目编码',
|
||||
// colProps: { span: 8 },
|
||||
// formItemProps: { ...rulesHelper.text },
|
||||
// },
|
||||
Address.Cascader({
|
||||
key: 'casacader',
|
||||
title: '选择地址',
|
||||
colProps: { span: 24 },
|
||||
colProps: { span: 12 },
|
||||
keys: ['province', 'city', 'area', 'street'],
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
key: 'address',
|
||||
title: '详细地址',
|
||||
colProps: { span: 24 },
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'longitude',
|
||||
title: '经度',
|
||||
colProps: { span: 6 },
|
||||
colProps: { span: 3 },
|
||||
},
|
||||
{
|
||||
key: 'latitude',
|
||||
title: '纬度',
|
||||
colProps: { span: 6 },
|
||||
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 },
|
||||
},
|
||||
]}
|
||||
@ -35,81 +35,81 @@ export default function Create(props: MyBetaModalFormProps) {
|
||||
.catch(() => false)
|
||||
}
|
||||
columns={[
|
||||
SysSelects?.Companies({
|
||||
key: 'companies_id',
|
||||
title: '所属机构',
|
||||
colProps: { span: 24 },
|
||||
formItemProps: { ...rulesHelper.number },
|
||||
}),
|
||||
|
||||
{
|
||||
key: 'name',
|
||||
title: '项目名称',
|
||||
colProps: { span: 8 },
|
||||
colProps: { span: 12 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'alias_name',
|
||||
title: '项目别名',
|
||||
colProps: { span: 8 },
|
||||
colProps: { span: 6 },
|
||||
},
|
||||
{
|
||||
key: 'code',
|
||||
title: '项目编码',
|
||||
colProps: { span: 8 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'property_type',
|
||||
title: '物业类型',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: AssetProjectsPropertyTypeEnum,
|
||||
required: true,
|
||||
SysSelects?.Companies({
|
||||
key: 'companies_id',
|
||||
title: '所属机构',
|
||||
colProps: { span: 6 },
|
||||
// formItemProps: { ...rulesHelper.number },
|
||||
}),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'status',
|
||||
title: '状态',
|
||||
colProps: { span: 12 },
|
||||
valueEnum: AssetProjectsStatusEnum,
|
||||
required: true,
|
||||
}),
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'charge',
|
||||
title: '收费方式',
|
||||
colProps: { span: 12 },
|
||||
valueEnum: AssetProjectsChargeEnum,
|
||||
required: true,
|
||||
}),
|
||||
|
||||
MyFormItems.EnumRadio({
|
||||
key: 'entrust_type',
|
||||
title: '委托类型',
|
||||
colProps: { span: 24 },
|
||||
valueEnum: AssetProjectsEntrustTypeEnum,
|
||||
required: true,
|
||||
}),
|
||||
|
||||
// {
|
||||
// key: 'code',
|
||||
// title: '项目编码',
|
||||
// colProps: { span: 8 },
|
||||
// // formItemProps: { ...rulesHelper.text },
|
||||
// },
|
||||
Address.Cascader({
|
||||
key: 'casacader',
|
||||
title: '选择地址',
|
||||
colProps: { span: 24 },
|
||||
colProps: { span: 12 },
|
||||
keys: ['province', 'city', 'area', 'street'],
|
||||
required: true,
|
||||
}),
|
||||
{
|
||||
key: 'address',
|
||||
title: '详细地址',
|
||||
colProps: { span: 24 },
|
||||
colProps: { span: 6 },
|
||||
formItemProps: { ...rulesHelper.text },
|
||||
},
|
||||
{
|
||||
key: 'longitude',
|
||||
title: '经度',
|
||||
colProps: { span: 6 },
|
||||
colProps: { span: 3 },
|
||||
},
|
||||
{
|
||||
key: 'latitude',
|
||||
title: '纬度',
|
||||
colProps: { span: 6 },
|
||||
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: '接管日期',
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user