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://10.39.13.80:8003/api/docs/openapi",
|
||||||
// "url": "http://we6f9c65.natappfree.cc/api/docs/openapi",
|
|
||||||
"module": "Admin"
|
"module": "Admin"
|
||||||
}
|
}
|
||||||
|
|||||||
@ -77,7 +77,7 @@ export const MyButtons = {
|
|||||||
return (
|
return (
|
||||||
<Popconfirm
|
<Popconfirm
|
||||||
title="删除提示"
|
title="删除提示"
|
||||||
description="确定要删除,将不可恢复?"
|
description="是否确定要删除,将不可恢复?"
|
||||||
okText="是"
|
okText="是"
|
||||||
cancelText="否"
|
cancelText="否"
|
||||||
onConfirm={onConfirm}
|
onConfirm={onConfirm}
|
||||||
|
|||||||
@ -59,8 +59,8 @@ export const MyColumns = {
|
|||||||
onConfirm={() => {
|
onConfirm={() => {
|
||||||
onRestore?.({ id: item.id }).then(() => action?.reload());
|
onRestore?.({ id: item.id }).then(() => action?.reload());
|
||||||
}}
|
}}
|
||||||
okText="Yes"
|
okText="是"
|
||||||
cancelText="No"
|
cancelText="否"
|
||||||
>
|
>
|
||||||
<Tag color="gray" style={{ cursor: 'pointer' }}>
|
<Tag color="gray" style={{ cursor: 'pointer' }}>
|
||||||
已禁用
|
已禁用
|
||||||
@ -73,8 +73,8 @@ export const MyColumns = {
|
|||||||
onConfirm={() => {
|
onConfirm={() => {
|
||||||
onSoftDelete?.({ id: item.id }).then(() => action?.reload());
|
onSoftDelete?.({ id: item.id }).then(() => action?.reload());
|
||||||
}}
|
}}
|
||||||
okText="Yes"
|
okText="是"
|
||||||
cancelText="No"
|
cancelText="否"
|
||||||
>
|
>
|
||||||
<Tag color="green" style={{ cursor: 'pointer' }}>
|
<Tag color="green" style={{ cursor: 'pointer' }}>
|
||||||
已启用
|
已启用
|
||||||
|
|||||||
@ -38,4 +38,73 @@ export const SysSelects = {
|
|||||||
...rest,
|
...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 = {
|
type Delete = {
|
||||||
"id": number; // id
|
"id": number; // id
|
||||||
};
|
};
|
||||||
|
type Select = {
|
||||||
|
"asset_projects_id"?: number; // 所属项目id,[ref:asset_projects]
|
||||||
|
"keywords"?: string; // 关键词
|
||||||
|
};
|
||||||
}
|
}
|
||||||
namespace AssetHouses {
|
namespace AssetHouses {
|
||||||
type List = {
|
type List = {
|
||||||
@ -81,13 +85,14 @@ declare namespace ApiTypes {
|
|||||||
}
|
}
|
||||||
namespace AssetProjects {
|
namespace AssetProjects {
|
||||||
type List = {
|
type List = {
|
||||||
|
"companies_id"?: number; // 所属机构id,[ref:companies]
|
||||||
"name"?: string; // 模糊搜索:名称
|
"name"?: string; // 模糊搜索:名称
|
||||||
};
|
};
|
||||||
type Store = {
|
type Store = {
|
||||||
"name": string; // 项目名称
|
"name": string; // 项目名称
|
||||||
"alias_name"?: string; // 项目别名
|
"alias_name"?: string; // 项目别名
|
||||||
"code"?: string; // 项目编码
|
"code"?: string; // 项目编码
|
||||||
"companies_id": number; // 所属机构id,[ref:companies]
|
"companies_id"?: number; // 所属机构id,[ref:companies]
|
||||||
"province"?: string; // 省
|
"province"?: string; // 省
|
||||||
"city"?: string; // 市
|
"city"?: string; // 市
|
||||||
"area"?: string; // 区
|
"area"?: string; // 区
|
||||||
@ -111,7 +116,7 @@ declare namespace ApiTypes {
|
|||||||
"name": string; // 项目名称
|
"name": string; // 项目名称
|
||||||
"alias_name"?: string; // 项目别名
|
"alias_name"?: string; // 项目别名
|
||||||
"code"?: string; // 项目编码
|
"code"?: string; // 项目编码
|
||||||
"companies_id": number; // 所属机构id,[ref:companies]
|
"companies_id"?: number; // 所属机构id,[ref:companies]
|
||||||
"province"?: string; // 省
|
"province"?: string; // 省
|
||||||
"city"?: string; // 市
|
"city"?: string; // 市
|
||||||
"area"?: string; // 区
|
"area"?: string; // 区
|
||||||
@ -142,6 +147,9 @@ declare namespace ApiTypes {
|
|||||||
type Delete = {
|
type Delete = {
|
||||||
"id": number; // id
|
"id": number; // id
|
||||||
};
|
};
|
||||||
|
type Select = {
|
||||||
|
"keywords"?: string; // 关键词
|
||||||
|
};
|
||||||
}
|
}
|
||||||
namespace AssetUnits {
|
namespace AssetUnits {
|
||||||
type List = {
|
type List = {
|
||||||
@ -178,6 +186,11 @@ declare namespace ApiTypes {
|
|||||||
type Delete = {
|
type Delete = {
|
||||||
"id": number; // id
|
"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 {
|
namespace Common {
|
||||||
@ -249,7 +262,7 @@ declare namespace ApiTypes {
|
|||||||
"business_license_image"?: string[]; // 营业执照图片
|
"business_license_image"?: string[]; // 营业执照图片
|
||||||
"_lft"?: number; //
|
"_lft"?: number; //
|
||||||
"_rgt"?: number; //
|
"_rgt"?: number; //
|
||||||
"parent_id"?: number; //
|
"parent_id"?: number; // 上级 ID
|
||||||
};
|
};
|
||||||
type Update = {
|
type Update = {
|
||||||
"id": number; // id
|
"id": number; // id
|
||||||
@ -273,11 +286,7 @@ declare namespace ApiTypes {
|
|||||||
"business_license_image"?: string[]; // 营业执照图片
|
"business_license_image"?: string[]; // 营业执照图片
|
||||||
"_lft"?: number; //
|
"_lft"?: number; //
|
||||||
"_rgt"?: number; //
|
"_rgt"?: number; //
|
||||||
"parent_id"?: number; //
|
"parent_id"?: number; // 上级 ID
|
||||||
};
|
|
||||||
type Move = {
|
|
||||||
"id": number; // ID
|
|
||||||
"type": string; // 类型:up 升级,down 降级
|
|
||||||
};
|
};
|
||||||
type Show = {
|
type Show = {
|
||||||
"id": number; // id
|
"id": number; // id
|
||||||
@ -294,9 +303,54 @@ declare namespace ApiTypes {
|
|||||||
type Select = {
|
type Select = {
|
||||||
"keywords"?: string; // 关键词
|
"keywords"?: string; // 关键词
|
||||||
};
|
};
|
||||||
type SelectTree = {
|
}
|
||||||
"keywords"?: string; // -
|
namespace Organizations {
|
||||||
"parent_id"?: number; // -
|
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> {
|
Delete(data: ApiTypes.Asset.AssetBuildings.Delete): Promise<MyResponseType> {
|
||||||
return request('admin/asset/asset_buildings/delete', { data });
|
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: {
|
AssetHouses: {
|
||||||
List(data?: ApiTypes.Asset.AssetHouses.List): Promise<MyResponseType> {
|
List(data?: ApiTypes.Asset.AssetHouses.List): Promise<MyResponseType> {
|
||||||
@ -59,6 +62,9 @@ export const Apis = {
|
|||||||
Delete(data: ApiTypes.Asset.AssetProjects.Delete): Promise<MyResponseType> {
|
Delete(data: ApiTypes.Asset.AssetProjects.Delete): Promise<MyResponseType> {
|
||||||
return request('admin/asset/asset_projects/delete', { data });
|
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: {
|
AssetUnits: {
|
||||||
List(data?: ApiTypes.Asset.AssetUnits.List): Promise<MyResponseType> {
|
List(data?: ApiTypes.Asset.AssetUnits.List): Promise<MyResponseType> {
|
||||||
@ -76,6 +82,9 @@ export const Apis = {
|
|||||||
Delete(data: ApiTypes.Asset.AssetUnits.Delete): Promise<MyResponseType> {
|
Delete(data: ApiTypes.Asset.AssetUnits.Delete): Promise<MyResponseType> {
|
||||||
return request('admin/asset/asset_units/delete', { data });
|
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: {
|
Common: {
|
||||||
@ -131,9 +140,6 @@ export const Apis = {
|
|||||||
Update(data: ApiTypes.Company.Companies.Update): Promise<MyResponseType> {
|
Update(data: ApiTypes.Company.Companies.Update): Promise<MyResponseType> {
|
||||||
return request('admin/company/companies/update', { data });
|
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> {
|
Show(data: ApiTypes.Company.Companies.Show): Promise<MyResponseType> {
|
||||||
return request('admin/company/companies/show', { data });
|
return request('admin/company/companies/show', { data });
|
||||||
},
|
},
|
||||||
@ -149,8 +155,31 @@ export const Apis = {
|
|||||||
Select(data?: ApiTypes.Company.Companies.Select): Promise<MyResponseType> {
|
Select(data?: ApiTypes.Company.Companies.Select): Promise<MyResponseType> {
|
||||||
return request('admin/company/companies/select', { data });
|
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 });
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|||||||
230
src/gen/Enums.ts
230
src/gen/Enums.ts
@ -1,115 +1,191 @@
|
|||||||
// AssetHousesOrientationEnum
|
// AssetHousesOrientationEnum
|
||||||
export const AssetHousesOrientationEnum= {
|
export const AssetHousesOrientationEnum = {
|
||||||
'East': {"text":"东","color":"#007bff","value":"East"},
|
East: { text: '东', color: '#007bff', value: 'East' },
|
||||||
'South': {"text":"南","color":"#28a745","value":"South"},
|
South: { text: '南', color: '#28a745', value: 'South' },
|
||||||
'West': {"text":"西","color":"#ffc107","value":"West"},
|
West: { text: '西', color: '#ffc107', value: 'West' },
|
||||||
'North': {"text":"北","color":"#dc3545","value":"North"},
|
North: { text: '北', color: '#dc3545', value: 'North' },
|
||||||
'Southeast': {"text":"东南","color":"#20c997","value":"Southeast"},
|
Southeast: { text: '东南', color: '#20c997', value: 'Southeast' },
|
||||||
'Northeast': {"text":"东北","color":"#6f42c1","value":"Northeast"},
|
Northeast: { text: '东北', color: '#6f42c1', value: 'Northeast' },
|
||||||
'Southwest': {"text":"西南","color":"#fd7e14","value":"Southwest"},
|
Southwest: { text: '西南', color: '#fd7e14', value: 'Southwest' },
|
||||||
'Northwest': {"text":"西北","color":"#17a2b8","value":"Northwest"},
|
Northwest: { text: '西北', color: '#17a2b8', value: 'Northwest' },
|
||||||
'EastWest': {"text":"东西","color":"#6610f2","value":"EastWest"},
|
EastWest: { text: '东西', color: '#6610f2', value: 'EastWest' },
|
||||||
'SouthNorth': {"text":"南北","color":"#e83e8c","value":"SouthNorth"},
|
SouthNorth: { text: '南北', color: '#e83e8c', value: 'SouthNorth' },
|
||||||
};
|
};
|
||||||
|
|
||||||
// AssetHousesOwnershipTypeEnum
|
// AssetHousesOwnershipTypeEnum
|
||||||
export const AssetHousesOwnershipTypeEnum= {
|
export const AssetHousesOwnershipTypeEnum = {
|
||||||
'CommodityHousing': {"text":"商品房","color":"#007bff","value":"CommodityHousing"},
|
CommodityHousing: {
|
||||||
'FundedHousing': {"text":"集资房","color":"#28a745","value":"FundedHousing"},
|
text: '商品房',
|
||||||
'MilitaryHousing': {"text":"军产房","color":"#17a2b8","value":"MilitaryHousing"},
|
color: '#007bff',
|
||||||
'AffordableHousing': {"text":"保障房","color":"#ffc107","value":"AffordableHousing"},
|
value: 'CommodityHousing',
|
||||||
'RuralHousing': {"text":"农民房","color":"#6f42c1","value":"RuralHousing"},
|
},
|
||||||
'CommercialOffice': {"text":"商业写字楼","color":"#fd7e14","value":"CommercialOffice"},
|
FundedHousing: { text: '集资房', color: '#28a745', value: 'FundedHousing' },
|
||||||
'CommercialComplex': {"text":"商业综合体","color":"#dc3545","value":"CommercialComplex"},
|
MilitaryHousing: {
|
||||||
'ResettlementHousing': {"text":"回迁房","color":"#20c997","value":"ResettlementHousing"},
|
text: '军产房',
|
||||||
|
color: '#17a2b8',
|
||||||
|
value: 'MilitaryHousing',
|
||||||
|
},
|
||||||
|
AffordableHousing: {
|
||||||
|
text: '保障房',
|
||||||
|
color: '#ffc107',
|
||||||
|
value: 'AffordableHousing',
|
||||||
|
},
|
||||||
|
RuralHousing: { text: '农民房', color: '#6f42c1', value: 'RuralHousing' },
|
||||||
|
CommercialOffice: {
|
||||||
|
text: '商业写字楼',
|
||||||
|
color: '#fd7e14',
|
||||||
|
value: 'CommercialOffice',
|
||||||
|
},
|
||||||
|
CommercialComplex: {
|
||||||
|
text: '商业综合体',
|
||||||
|
color: '#dc3545',
|
||||||
|
value: 'CommercialComplex',
|
||||||
|
},
|
||||||
|
ResettlementHousing: {
|
||||||
|
text: '回迁房',
|
||||||
|
color: '#20c997',
|
||||||
|
value: 'ResettlementHousing',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// AssetHousesStatusEnum
|
// AssetHousesStatusEnum
|
||||||
export const AssetHousesStatusEnum= {
|
export const AssetHousesStatusEnum = {
|
||||||
'Unsold': {"text":"未售","color":"#6c757d","value":"Unsold"},
|
Unsold: { text: '未售', color: '#6c757d', value: 'Unsold' },
|
||||||
'SoldNotDelivered': {"text":"已售未交房","color":"#ffc107","value":"SoldNotDelivered"},
|
SoldNotDelivered: {
|
||||||
'SelfOccupied': {"text":"自住","color":"#28a745","value":"SelfOccupied"},
|
text: '已售未交房',
|
||||||
'Rented': {"text":"出租","color":"#007bff","value":"Rented"},
|
color: '#ffc107',
|
||||||
'Vacant': {"text":"空置","color":"#dc3545","value":"Vacant"},
|
value: 'SoldNotDelivered',
|
||||||
|
},
|
||||||
|
SelfOccupied: { text: '自住', color: '#28a745', value: 'SelfOccupied' },
|
||||||
|
Rented: { text: '出租', color: '#007bff', value: 'Rented' },
|
||||||
|
Vacant: { text: '空置', color: '#dc3545', value: 'Vacant' },
|
||||||
};
|
};
|
||||||
|
|
||||||
// AssetHousesUsageEnum
|
// AssetHousesUsageEnum
|
||||||
export const AssetHousesUsageEnum= {
|
export const AssetHousesUsageEnum = {
|
||||||
'Residence': {"text":"住宅","color":"#007bff","value":"Residence"},
|
Residence: { text: '住宅', color: '#007bff', value: 'Residence' },
|
||||||
'Apartment': {"text":"公寓","color":"#28a745","value":"Apartment"},
|
Apartment: { text: '公寓', color: '#28a745', value: 'Apartment' },
|
||||||
'Villa': {"text":"别墅","color":"#17a2b8","value":"Villa"},
|
Villa: { text: '别墅', color: '#17a2b8', value: 'Villa' },
|
||||||
'Shop': {"text":"商铺","color":"#ffc107","value":"Shop"},
|
Shop: { text: '商铺', color: '#ffc107', value: 'Shop' },
|
||||||
'ParkingSpace': {"text":"车位","color":"#6c757d","value":"ParkingSpace"},
|
ParkingSpace: { text: '车位', color: '#6c757d', value: 'ParkingSpace' },
|
||||||
'Office': {"text":"写字楼","color":"#6610f2","value":"Office"},
|
Office: { text: '写字楼', color: '#6610f2', value: 'Office' },
|
||||||
'Clubhouse': {"text":"会所","color":"#fd7e14","value":"Clubhouse"},
|
Clubhouse: { text: '会所', color: '#fd7e14', value: 'Clubhouse' },
|
||||||
'PropertyRoom': {"text":"物业用房","color":"#dc3545","value":"PropertyRoom"},
|
PropertyRoom: { text: '物业用房', color: '#dc3545', value: 'PropertyRoom' },
|
||||||
};
|
};
|
||||||
|
|
||||||
// AssetProjectsChargeEnum
|
// AssetProjectsChargeEnum
|
||||||
export const AssetProjectsChargeEnum= {
|
export const AssetProjectsChargeEnum = {
|
||||||
'Contract': {"text":"包干制","color":"#007bff","value":"Contract"},
|
Contract: { text: '包干制', color: '#007bff', value: 'Contract' },
|
||||||
'Commission': {"text":"酬金制","color":"#28a745","value":"Commission"},
|
Commission: { text: '酬金制', color: '#28a745', value: 'Commission' },
|
||||||
};
|
};
|
||||||
|
|
||||||
// AssetProjectsEntrustTypeEnum
|
// AssetProjectsEntrustTypeEnum
|
||||||
export const AssetProjectsEntrustTypeEnum= {
|
export const AssetProjectsEntrustTypeEnum = {
|
||||||
'DeveloperJointEntrust': {"text":"开发商合委","color":"#007bff","value":"DeveloperJointEntrust"},
|
DeveloperJointEntrust: {
|
||||||
'OwnersFullEntrust': {"text":"业委会全委","color":"#28a745","value":"OwnersFullEntrust"},
|
text: '开发商全委',
|
||||||
'GovernmentFullEntrust': {"text":"政府类全委","color":"#ffc107","value":"GovernmentFullEntrust"},
|
color: '#007bff',
|
||||||
|
value: 'DeveloperJointEntrust',
|
||||||
|
},
|
||||||
|
OwnersFullEntrust: {
|
||||||
|
text: '业委会全委',
|
||||||
|
color: '#28a745',
|
||||||
|
value: 'OwnersFullEntrust',
|
||||||
|
},
|
||||||
|
GovernmentFullEntrust: {
|
||||||
|
text: '政府类全委',
|
||||||
|
color: '#ffc107',
|
||||||
|
value: 'GovernmentFullEntrust',
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
// AssetProjectsPropertyTypeEnum
|
// AssetProjectsPropertyTypeEnum
|
||||||
export const AssetProjectsPropertyTypeEnum= {
|
export const AssetProjectsPropertyTypeEnum = {
|
||||||
'Residence': {"text":"住宅","color":"#ff0000","value":"Residence"},
|
Residence: { text: '住宅', color: '#ff0000', value: 'Residence' },
|
||||||
'Commercial': {"text":"商业","color":"#ff6600","value":"Commercial"},
|
Commercial: { text: '商业', color: '#ff6600', value: 'Commercial' },
|
||||||
'Office': {"text":"办公","color":"#ffcc00","value":"Office"},
|
Office: { text: '办公', color: '#ffcc00', value: 'Office' },
|
||||||
'IndustrialPark': {"text":"产业园","color":"#00cc66","value":"IndustrialPark"},
|
IndustrialPark: { text: '产业园', color: '#00cc66', value: 'IndustrialPark' },
|
||||||
'Complex': {"text":"综合体","color":"#0099ff","value":"Complex"},
|
Complex: { text: '综合体', color: '#0099ff', value: 'Complex' },
|
||||||
'Municipal': {"text":"市政设施","color":"#6633cc","value":"Municipal"},
|
Municipal: { text: '市政设施', color: '#6633cc', value: 'Municipal' },
|
||||||
'Venue': {"text":"场馆","color":"#9966ff","value":"Venue"},
|
Venue: { text: '场馆', color: '#9966ff', value: 'Venue' },
|
||||||
'Education': {"text":"教育","color":"#339999","value":"Education"},
|
Education: { text: '教育', color: '#339999', value: 'Education' },
|
||||||
'Medical': {"text":"医疗","color":"#cc3366","value":"Medical"},
|
Medical: { text: '医疗', color: '#cc3366', value: 'Medical' },
|
||||||
};
|
};
|
||||||
|
|
||||||
// AssetProjectsStatusEnum
|
// AssetProjectsStatusEnum
|
||||||
export const AssetProjectsStatusEnum= {
|
export const AssetProjectsStatusEnum = {
|
||||||
'SignedNotDelivered': {"text":"签约未交付","color":"#6c757d","value":"SignedNotDelivered"},
|
SignedNotDelivered: {
|
||||||
'RollingDevelopment': {"text":"滚动开发","color":"#007bff","value":"RollingDevelopment"},
|
text: '签约未交付',
|
||||||
'ManagedAndClosed': {"text":"在管封园","color":"#ffc107","value":"ManagedAndClosed"},
|
color: '#6c757d',
|
||||||
'Exited': {"text":"退出","color":"#dc3545","value":"Exited"},
|
value: 'SignedNotDelivered',
|
||||||
|
},
|
||||||
|
RollingDevelopment: {
|
||||||
|
text: '滚动开发',
|
||||||
|
color: '#007bff',
|
||||||
|
value: 'RollingDevelopment',
|
||||||
|
},
|
||||||
|
ManagedAndClosed: {
|
||||||
|
text: '在管封园',
|
||||||
|
color: '#ffc107',
|
||||||
|
value: 'ManagedAndClosed',
|
||||||
|
},
|
||||||
|
Exited: { text: '退出', color: '#dc3545', value: 'Exited' },
|
||||||
};
|
};
|
||||||
|
|
||||||
// AssetUnitsBuildingStructureEnum
|
// AssetUnitsBuildingStructureEnum
|
||||||
export const AssetUnitsBuildingStructureEnum= {
|
export const AssetUnitsBuildingStructureEnum = {
|
||||||
'SteelConcrete': {"text":"钢混","color":"#007bff","value":"SteelConcrete"},
|
SteelConcrete: { text: '钢混', color: '#007bff', value: 'SteelConcrete' },
|
||||||
'SteelStructure': {"text":"钢结构","color":"#28a745","value":"SteelStructure"},
|
SteelStructure: { text: '钢结构', color: '#28a745', value: 'SteelStructure' },
|
||||||
'BrickConcrete': {"text":"砖混","color":"#ffc107","value":"BrickConcrete"},
|
BrickConcrete: { text: '砖混', color: '#ffc107', value: 'BrickConcrete' },
|
||||||
'BrickWood': {"text":"砖木","color":"#dc3545","value":"BrickWood"},
|
BrickWood: { text: '砖木', color: '#dc3545', value: 'BrickWood' },
|
||||||
};
|
};
|
||||||
|
|
||||||
// AssetUnitsBuildingTypeEnum
|
// AssetUnitsBuildingTypeEnum
|
||||||
export const AssetUnitsBuildingTypeEnum= {
|
export const AssetUnitsBuildingTypeEnum = {
|
||||||
'SlabAndTower': {"text":"板塔结合","color":"#007bff","value":"SlabAndTower"},
|
SlabAndTower: { text: '板塔结合', color: '#007bff', value: 'SlabAndTower' },
|
||||||
'Slab': {"text":"板楼","color":"#28a745","value":"Slab"},
|
Slab: { text: '板楼', color: '#28a745', value: 'Slab' },
|
||||||
'Tower': {"text":"塔楼","color":"#ffc107","value":"Tower"},
|
Tower: { text: '塔楼', color: '#ffc107', value: 'Tower' },
|
||||||
};
|
};
|
||||||
|
|
||||||
// CompaniesMerchantTypeEnum
|
// CompaniesMerchantTypeEnum
|
||||||
export const CompaniesMerchantTypeEnum= {
|
export const CompaniesMerchantTypeEnum = {
|
||||||
'PropertyManagement': {"text":"物业公司","color":"#007bff","value":"PropertyManagement"},
|
PropertyManagement: {
|
||||||
'ServiceProvider': {"text":"服务商","color":"#28a745","value":"ServiceProvider"},
|
text: '物业公司',
|
||||||
|
color: '#007bff',
|
||||||
|
value: 'PropertyManagement',
|
||||||
|
},
|
||||||
|
ServiceProvider: {
|
||||||
|
text: '服务商',
|
||||||
|
color: '#28a745',
|
||||||
|
value: 'ServiceProvider',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
|
// 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
|
// SysModuleEnum
|
||||||
export const SysModuleEnum= {
|
export const SysModuleEnum = {
|
||||||
'Admin': {"text":"管理员","color":"#cf1322","value":"Admin"},
|
Admin: { text: '管理员', color: '#cf1322', value: 'Admin' },
|
||||||
'Customer': {"text":"客户","color":"#d4b106","value":"Customer"},
|
Customer: { text: '客户', color: '#d4b106', value: 'Customer' },
|
||||||
};
|
};
|
||||||
|
|
||||||
// SysPermissionsTypeEnum
|
// SysPermissionsTypeEnum
|
||||||
export const SysPermissionsTypeEnum= {
|
export const SysPermissionsTypeEnum = {
|
||||||
'Directory': {"text":"目录","color":"#6d7e14","value":"Directory"},
|
Directory: { text: '目录', color: '#6d7e14', value: 'Directory' },
|
||||||
'Page': {"text":"页面","color":"#4d9a13","value":"Page"},
|
Page: { text: '页面', color: '#4d9a13', value: 'Page' },
|
||||||
'Button': {"text":"按钮","color":"#97224f","value":"Button"},
|
Button: { text: '按钮', color: '#97224f', value: 'Button' },
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -5,8 +5,7 @@ import { useParams } from '@umijs/max';
|
|||||||
import { Tabs } from 'antd';
|
import { Tabs } from 'antd';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import MyAssetBuildings from './components/AssetBuildings';
|
import MyAssetBuildings from './components/AssetBuildings';
|
||||||
import MyInfo from './components/info';
|
import AssetInfo from './components/AssetInfo';
|
||||||
import Update from './modals/Update';
|
|
||||||
export default function Show({ title = '项目详情' }) {
|
export default function Show({ title = '项目详情' }) {
|
||||||
const { id } = useParams<{ id: string }>();
|
const { id } = useParams<{ id: string }>();
|
||||||
const [data, setShow] = useState<any>({});
|
const [data, setShow] = useState<any>({});
|
||||||
@ -22,19 +21,37 @@ export default function Show({ title = '项目详情' }) {
|
|||||||
}, [id]);
|
}, [id]);
|
||||||
|
|
||||||
let items = [
|
let items = [
|
||||||
|
{
|
||||||
|
label: '基本信息',
|
||||||
|
key: 'info',
|
||||||
|
closable: false,
|
||||||
|
children: <AssetInfo item={data} reload={() => loadShow()} />,
|
||||||
|
},
|
||||||
{
|
{
|
||||||
label: '楼栋管理',
|
label: '楼栋管理',
|
||||||
key: 'asset_buildings',
|
key: 'asset_buildings',
|
||||||
closable: false,
|
closable: false,
|
||||||
children: <MyAssetBuildings item={data} />,
|
children: <MyAssetBuildings item={data} />,
|
||||||
},
|
},
|
||||||
|
// {
|
||||||
|
// label: '车场管理',
|
||||||
|
// key: 'car',
|
||||||
|
// closable: false,
|
||||||
|
// children: <MyAssetBuildings item={data} />,
|
||||||
|
// },
|
||||||
|
// {
|
||||||
|
// label: '车位管理',
|
||||||
|
// key: 'carport',
|
||||||
|
// closable: false,
|
||||||
|
// children: <MyAssetBuildings item={data} />,
|
||||||
|
// },
|
||||||
];
|
];
|
||||||
return (
|
return (
|
||||||
<MyPageContainer title={title}>
|
<MyPageContainer title={title}>
|
||||||
<MyInfo
|
{/* <Info
|
||||||
item={data}
|
item={data}
|
||||||
extra={<Update item={data} reload={() => loadShow()} title="项目" />}
|
extra={<Update item={data} reload={() => loadShow()} title="项目" />}
|
||||||
/>
|
/> */}
|
||||||
<ProCard>
|
<ProCard>
|
||||||
<Tabs type="card" items={data?.id ? items : []} />
|
<Tabs type="card" items={data?.id ? items : []} />
|
||||||
</ProCard>
|
</ProCard>
|
||||||
|
|||||||
@ -1,7 +1,11 @@
|
|||||||
import { MyBetaModalFormProps, MyColumns, MyProTableProps } from '@/common';
|
import {
|
||||||
|
MyBetaModalFormProps,
|
||||||
|
MyButtons,
|
||||||
|
MyColumns,
|
||||||
|
MyProTableProps,
|
||||||
|
} from '@/common';
|
||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import {
|
import {
|
||||||
AssetHousesOrientationEnum,
|
|
||||||
AssetHousesOwnershipTypeEnum,
|
AssetHousesOwnershipTypeEnum,
|
||||||
AssetHousesStatusEnum,
|
AssetHousesStatusEnum,
|
||||||
AssetHousesUsageEnum,
|
AssetHousesUsageEnum,
|
||||||
@ -10,8 +14,12 @@ import { ProCard, ProTable } from '@ant-design/pro-components';
|
|||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
import { useRef, useState } from 'react';
|
import { useRef, useState } from 'react';
|
||||||
import BuildingsCreate from '../modals/AssetBuildingsCreate';
|
import BuildingsCreate from '../modals/AssetBuildingsCreate';
|
||||||
|
import AssetBuildingsUpdate from '../modals/AssetBuildingsUpdate';
|
||||||
import AssetHousesCreate from '../modals/AssetHousesCreate';
|
import AssetHousesCreate from '../modals/AssetHousesCreate';
|
||||||
|
import AssetHousesShow from '../modals/AssetHousesShow';
|
||||||
|
import AssetHousesUpdate from '../modals/AssetHousesUpdate';
|
||||||
import AssetUnitsCreate from '../modals/AssetUnitsCreate';
|
import AssetUnitsCreate from '../modals/AssetUnitsCreate';
|
||||||
|
import AssetUnitsUpdate from '../modals/AssetUnitsUpdate';
|
||||||
|
|
||||||
export default function AssetBuildings(props: MyBetaModalFormProps) {
|
export default function AssetBuildings(props: MyBetaModalFormProps) {
|
||||||
const actionBuildingsRef: any = useRef();
|
const actionBuildingsRef: any = useRef();
|
||||||
@ -21,7 +29,7 @@ export default function AssetBuildings(props: MyBetaModalFormProps) {
|
|||||||
const [selectKeyUnits, setSelectKeyUnits] = useState<any>({});
|
const [selectKeyUnits, setSelectKeyUnits] = useState<any>({});
|
||||||
return (
|
return (
|
||||||
<ProCard
|
<ProCard
|
||||||
extra={
|
title={
|
||||||
<Space>
|
<Space>
|
||||||
<BuildingsCreate
|
<BuildingsCreate
|
||||||
key="BuildingsCreate"
|
key="BuildingsCreate"
|
||||||
@ -33,7 +41,7 @@ export default function AssetBuildings(props: MyBetaModalFormProps) {
|
|||||||
key="UnitsCreate"
|
key="UnitsCreate"
|
||||||
item={{
|
item={{
|
||||||
...props?.item,
|
...props?.item,
|
||||||
asset_buildings_id: selectKey?.id || undefined,
|
// asset_buildings_id: selectKey?.id || undefined,
|
||||||
}}
|
}}
|
||||||
reload={() => actionUnitsRef?.current?.reload()}
|
reload={() => actionUnitsRef?.current?.reload()}
|
||||||
title="单元"
|
title="单元"
|
||||||
@ -42,11 +50,11 @@ export default function AssetBuildings(props: MyBetaModalFormProps) {
|
|||||||
key="HousesCreate"
|
key="HousesCreate"
|
||||||
item={{
|
item={{
|
||||||
...props?.item,
|
...props?.item,
|
||||||
asset_buildings_id: selectKey?.id || undefined,
|
// asset_buildings_id: selectKey?.id || undefined,
|
||||||
asset_units_id: selectKeyUnits?.id || undefined,
|
// asset_units_id: selectKeyUnits?.id || undefined,
|
||||||
}}
|
}}
|
||||||
reload={() => actionHousesRef?.current?.reload()}
|
reload={() => actionHousesRef?.current?.reload()}
|
||||||
title="房源"
|
title="房屋"
|
||||||
/>
|
/>
|
||||||
</Space>
|
</Space>
|
||||||
}
|
}
|
||||||
@ -84,136 +92,150 @@ export default function AssetBuildings(props: MyBetaModalFormProps) {
|
|||||||
columns={[
|
columns={[
|
||||||
MyColumns.ID(),
|
MyColumns.ID(),
|
||||||
{
|
{
|
||||||
title: '楼栋',
|
title: '楼栋名称',
|
||||||
width: '250px',
|
|
||||||
dataIndex: 'name',
|
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>
|
||||||
|
),
|
||||||
|
}),
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
|
||||||
<ProTable
|
{selectKey?.id && (
|
||||||
{...MyProTableProps.props}
|
<ProTable
|
||||||
search={false}
|
{...MyProTableProps.props}
|
||||||
actionRef={actionUnitsRef}
|
search={false}
|
||||||
request={async (params, sort) =>
|
actionRef={actionUnitsRef}
|
||||||
MyProTableProps.request(
|
request={async (params, sort) =>
|
||||||
|
MyProTableProps.request(
|
||||||
|
{
|
||||||
|
...params,
|
||||||
|
asset_projects_id: props?.item?.id,
|
||||||
|
asset_buildings_id: selectKey?.id,
|
||||||
|
},
|
||||||
|
sort,
|
||||||
|
Apis.Asset.AssetUnits.List,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
rowClassName={(record: any) => {
|
||||||
|
return selectKeyUnits?.id === record?.id
|
||||||
|
? 'ant-table-row-selected'
|
||||||
|
: '';
|
||||||
|
}}
|
||||||
|
onRow={(record: any) => {
|
||||||
|
return {
|
||||||
|
onClick: () => {
|
||||||
|
setSelectKeyUnits(record);
|
||||||
|
actionHousesRef?.current?.reload();
|
||||||
|
},
|
||||||
|
style: {
|
||||||
|
cursor: 'pointer',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
}}
|
||||||
|
options={false}
|
||||||
|
columns={[
|
||||||
|
MyColumns.ID(),
|
||||||
{
|
{
|
||||||
...params,
|
title: '单元名称',
|
||||||
asset_projects_id: props?.item?.id,
|
dataIndex: 'name',
|
||||||
asset_buildings_id: selectKey?.id,
|
|
||||||
},
|
},
|
||||||
sort,
|
MyColumns.Option({
|
||||||
Apis.Asset.AssetUnits.List,
|
render: (_, item: any, index, action) => (
|
||||||
)
|
<Space key={index}>
|
||||||
}
|
<AssetUnitsUpdate item={item} reload={action?.reload} />
|
||||||
rowClassName={(record: any) => {
|
<MyButtons.Delete
|
||||||
return selectKeyUnits?.id === record?.id
|
size="small"
|
||||||
? 'ant-table-row-selected'
|
onConfirm={() =>
|
||||||
: '';
|
Apis.Asset.AssetUnits.Delete({ id: item.id }).then(() =>
|
||||||
}}
|
action?.reload(),
|
||||||
onRow={(record: any) => {
|
)
|
||||||
return {
|
}
|
||||||
onClick: () => {
|
/>
|
||||||
setSelectKeyUnits(record);
|
</Space>
|
||||||
actionHousesRef?.current?.reload();
|
),
|
||||||
},
|
}),
|
||||||
style: {
|
]}
|
||||||
cursor: 'pointer',
|
/>
|
||||||
},
|
)}
|
||||||
};
|
|
||||||
}}
|
|
||||||
options={false}
|
|
||||||
columns={[
|
|
||||||
MyColumns.ID(),
|
|
||||||
{
|
|
||||||
title: '单元',
|
|
||||||
width: '250px',
|
|
||||||
dataIndex: 'name',
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
|
|
||||||
<ProTable
|
{selectKeyUnits?.id && (
|
||||||
{...MyProTableProps.props}
|
<ProTable
|
||||||
search={false}
|
{...MyProTableProps.props}
|
||||||
actionRef={actionHousesRef}
|
search={false}
|
||||||
request={async (params, sort) =>
|
actionRef={actionHousesRef}
|
||||||
MyProTableProps.request(
|
request={async (params, sort) =>
|
||||||
|
MyProTableProps.request(
|
||||||
|
{
|
||||||
|
...params,
|
||||||
|
asset_projects_id: props?.item?.id,
|
||||||
|
asset_buildings_id: selectKey?.id,
|
||||||
|
asset_units_id: selectKeyUnits?.id,
|
||||||
|
},
|
||||||
|
sort,
|
||||||
|
Apis.Asset.AssetHouses.List,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
options={false}
|
||||||
|
columns={[
|
||||||
|
MyColumns.ID(),
|
||||||
|
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '用途',
|
||||||
|
dataIndex: 'usage',
|
||||||
|
valueEnum: AssetHousesUsageEnum,
|
||||||
|
}),
|
||||||
{
|
{
|
||||||
...params,
|
title: '房号',
|
||||||
asset_projects_id: props?.item?.id,
|
dataIndex: 'name',
|
||||||
asset_buildings_id: selectKey?.id,
|
|
||||||
asset_units_id: selectKeyUnits?.id,
|
|
||||||
},
|
},
|
||||||
sort,
|
{
|
||||||
Apis.Asset.AssetHouses.List,
|
title: '楼层',
|
||||||
)
|
dataIndex: 'floor',
|
||||||
}
|
render(_, record) {
|
||||||
options={false}
|
return `${record?.floor}层`;
|
||||||
columns={[
|
},
|
||||||
MyColumns.ID(),
|
},
|
||||||
MyColumns.EnumTag({
|
MyColumns.EnumTag({
|
||||||
title: '用途',
|
title: '产权性质',
|
||||||
dataIndex: 'usage',
|
dataIndex: 'ownership_type',
|
||||||
valueEnum: AssetHousesUsageEnum,
|
valueEnum: AssetHousesOwnershipTypeEnum,
|
||||||
}),
|
}),
|
||||||
{
|
MyColumns.EnumTag({
|
||||||
title: '房号',
|
title: '房屋状态',
|
||||||
dataIndex: 'name',
|
dataIndex: 'status',
|
||||||
},
|
valueEnum: AssetHousesStatusEnum,
|
||||||
MyColumns.EnumTag({
|
}),
|
||||||
title: '产权性质',
|
MyColumns.Option({
|
||||||
dataIndex: 'ownership_type',
|
render: (_, item: any, index, action) => (
|
||||||
valueEnum: AssetHousesOwnershipTypeEnum,
|
<Space key={index}>
|
||||||
}),
|
<AssetHousesShow item={item} reload={action?.reload} />
|
||||||
MyColumns.EnumTag({
|
<AssetHousesUpdate item={item} reload={action?.reload} />
|
||||||
title: '朝向',
|
<MyButtons.Delete
|
||||||
dataIndex: 'orientation',
|
onConfirm={() =>
|
||||||
valueEnum: AssetHousesOrientationEnum,
|
Apis.Asset.AssetBuildings.Delete({ id: item.id }).then(
|
||||||
}),
|
() => action?.reload(),
|
||||||
MyColumns.EnumTag({
|
)
|
||||||
title: '房屋状态',
|
}
|
||||||
dataIndex: 'status',
|
/>
|
||||||
valueEnum: AssetHousesStatusEnum,
|
</Space>
|
||||||
}),
|
),
|
||||||
{
|
}),
|
||||||
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',
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
</Space>
|
</Space>
|
||||||
</ProCard>
|
</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}>
|
<MyPageContainer title={title}>
|
||||||
<ProTable
|
<ProTable
|
||||||
{...MyProTableProps.props}
|
{...MyProTableProps.props}
|
||||||
search={false}
|
// search={false}
|
||||||
request={async (params, sort) =>
|
request={async (params, sort) =>
|
||||||
MyProTableProps.request(params, sort, Apis.Asset.AssetProjects.List)
|
MyProTableProps.request(params, sort, Apis.Asset.AssetProjects.List)
|
||||||
}
|
}
|
||||||
toolBarRender={(action) => [
|
toolBarRender={(action) => [
|
||||||
<Create key="Create" reload={action?.reload} title={title} />,
|
<Create key="Create" reload={action?.reload} title={'项目'} />,
|
||||||
]}
|
]}
|
||||||
columns={[
|
columns={[
|
||||||
MyColumns.ID(),
|
MyColumns.ID(),
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '项目类型',
|
||||||
|
dataIndex: 'property_type',
|
||||||
|
valueEnum: AssetProjectsPropertyTypeEnum,
|
||||||
|
search: false,
|
||||||
|
}),
|
||||||
{
|
{
|
||||||
title: '项目名称',
|
title: '项目名称',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
@ -39,30 +45,11 @@ export default function Index({ title = '项目管理' }) {
|
|||||||
title: '项目别名',
|
title: '项目别名',
|
||||||
dataIndex: 'alias_name',
|
dataIndex: 'alias_name',
|
||||||
},
|
},
|
||||||
{
|
// {
|
||||||
title: '项目编码',
|
// title: '项目编码',
|
||||||
dataIndex: 'code',
|
// dataIndex: 'code',
|
||||||
},
|
// search: false,
|
||||||
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: '地址',
|
title: '地址',
|
||||||
render: (_, i: any) => {
|
render: (_, i: any) => {
|
||||||
@ -70,15 +57,43 @@ export default function Index({ title = '项目管理' }) {
|
|||||||
i?.address || ''
|
i?.address || ''
|
||||||
}`;
|
}`;
|
||||||
},
|
},
|
||||||
|
search:false,
|
||||||
},
|
},
|
||||||
{
|
MyColumns.EnumTag({
|
||||||
title: '接管日期',
|
title: '项目状态',
|
||||||
dataIndex: 'takeover_date',
|
dataIndex: 'status',
|
||||||
},
|
valueEnum: AssetProjectsStatusEnum,
|
||||||
{
|
search: false,
|
||||||
title: '封园日期',
|
}),
|
||||||
dataIndex: 'closure_date',
|
|
||||||
},
|
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.CreatedAt(),
|
||||||
MyColumns.Option({
|
MyColumns.Option({
|
||||||
render: (_, item: any, index, action) => (
|
render: (_, item: any, index, action) => (
|
||||||
|
|||||||
@ -6,17 +6,25 @@ import {
|
|||||||
} from '@/common';
|
} from '@/common';
|
||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||||
import { message } from 'antd';
|
import { Form, message } from 'antd';
|
||||||
|
|
||||||
|
|
||||||
export default function Create(props: MyBetaModalFormProps) {
|
export default function Create(props: MyBetaModalFormProps) {
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<BetaSchemaForm<ApiTypes.Asset.AssetBuildings.Store>
|
<BetaSchemaForm<ApiTypes.Asset.AssetBuildings.Store>
|
||||||
{...MyModalFormProps.props}
|
{...MyModalFormProps.props}
|
||||||
|
form={form}
|
||||||
title={`添加${props.title}`}
|
title={`添加${props.title}`}
|
||||||
wrapperCol={{ span: 24 }}
|
wrapperCol={{ span: 24 }}
|
||||||
width="500px"
|
width="500px"
|
||||||
trigger={<MyButtons.Create title={`添加${props.title}`} />}
|
trigger={<MyButtons.Create title={`添加${props.title}`} />}
|
||||||
|
onOpenChange={(open: any) => {
|
||||||
|
if (open) {
|
||||||
|
form.resetFields(); // 清空表单数据
|
||||||
|
}
|
||||||
|
}}
|
||||||
onFinish={async (values) =>
|
onFinish={async (values) =>
|
||||||
Apis.Asset.AssetBuildings.Store({
|
Apis.Asset.AssetBuildings.Store({
|
||||||
...values,
|
...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,
|
MyModalFormProps,
|
||||||
rulesHelper,
|
rulesHelper,
|
||||||
} from '@/common';
|
} from '@/common';
|
||||||
|
import { SysSelects } from '@/components/Select';
|
||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import {
|
import {
|
||||||
AssetHousesOrientationEnum,
|
AssetHousesOrientationEnum,
|
||||||
@ -13,9 +14,10 @@ import {
|
|||||||
AssetHousesUsageEnum,
|
AssetHousesUsageEnum,
|
||||||
} from '@/gen/Enums';
|
} from '@/gen/Enums';
|
||||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||||
import { message } from 'antd';
|
import { Form, message } from 'antd';
|
||||||
|
|
||||||
export default function Create(props: MyBetaModalFormProps) {
|
export default function Create(props: MyBetaModalFormProps) {
|
||||||
|
const [form] = Form.useForm();
|
||||||
console.log(props?.item, 'item');
|
console.log(props?.item, 'item');
|
||||||
return (
|
return (
|
||||||
<BetaSchemaForm<ApiTypes.Asset.AssetHouses.Store>
|
<BetaSchemaForm<ApiTypes.Asset.AssetHouses.Store>
|
||||||
@ -23,20 +25,17 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
title={`添加${props.title}`}
|
title={`添加${props.title}`}
|
||||||
wrapperCol={{ span: 24 }}
|
wrapperCol={{ span: 24 }}
|
||||||
width="800px"
|
width="800px"
|
||||||
trigger={
|
trigger={<MyButtons.Create title={`添加${props.title}`} />}
|
||||||
<MyButtons.Create
|
form={form}
|
||||||
title={`添加${props.title}`}
|
onOpenChange={(open: any) => {
|
||||||
disabled={
|
if (open) {
|
||||||
!(props?.item?.asset_units_id && props?.item?.asset_buildings_id)
|
form.resetFields(); // 清空表单数据
|
||||||
}
|
}
|
||||||
/>
|
}}
|
||||||
}
|
|
||||||
onFinish={async (values) =>
|
onFinish={async (values) =>
|
||||||
Apis.Asset.AssetHouses.Store({
|
Apis.Asset.AssetHouses.Store({
|
||||||
...values,
|
...values,
|
||||||
asset_projects_id: props?.item?.id,
|
asset_projects_id: props?.item?.id,
|
||||||
asset_buildings_id: props?.item?.asset_buildings_id,
|
|
||||||
asset_units_id: props?.item?.asset_units_id,
|
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
props.reload?.();
|
props.reload?.();
|
||||||
@ -47,44 +46,86 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
}
|
}
|
||||||
columns={[
|
columns={[
|
||||||
{
|
{
|
||||||
key: 'name',
|
valueType: 'dependency',
|
||||||
title: '房号',
|
name: ['asset_buildings_id', 'asset_units_id'],
|
||||||
colProps: { span: 12 },
|
columns: ({ asset_buildings_id }) => {
|
||||||
formItemProps: { ...rulesHelper.text },
|
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 },
|
||||||
|
},
|
||||||
|
],
|
||||||
|
},
|
||||||
|
];
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
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({
|
MyFormItems.EnumRadio({
|
||||||
key: 'usage',
|
key: 'usage',
|
||||||
title: '用途',
|
title: '用途',
|
||||||
colProps: { span: 24 },
|
colProps: { span: 18 },
|
||||||
valueEnum: AssetHousesUsageEnum,
|
valueEnum: AssetHousesUsageEnum,
|
||||||
required: true,
|
required: true,
|
||||||
}),
|
}),
|
||||||
MyFormItems.EnumRadio({
|
MyFormItems.EnumSelect({
|
||||||
key: 'status',
|
key: 'ownership_type',
|
||||||
title: '房屋状态',
|
title: '产权性质',
|
||||||
colProps: { span: 24 },
|
colProps: { span: 6 },
|
||||||
valueEnum: AssetHousesStatusEnum,
|
valueEnum: AssetHousesOwnershipTypeEnum,
|
||||||
required: true,
|
// required: true,
|
||||||
}),
|
}),
|
||||||
|
// {
|
||||||
|
// key: 'ownership_term',
|
||||||
|
// title: '产权年限',
|
||||||
|
// fieldProps: {
|
||||||
|
// addonAfter: '年',
|
||||||
|
// },
|
||||||
|
// colProps: { span: 8 },
|
||||||
|
// },
|
||||||
|
|
||||||
{
|
{
|
||||||
key: 'built_area',
|
key: 'built_area',
|
||||||
@ -92,8 +133,9 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
valueType: 'digit',
|
valueType: 'digit',
|
||||||
fieldProps: {
|
fieldProps: {
|
||||||
addonAfter: '㎡',
|
addonAfter: '㎡',
|
||||||
|
max: 99999,
|
||||||
},
|
},
|
||||||
colProps: { span: 8 },
|
colProps: { span: 6 },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'inside_area',
|
key: 'inside_area',
|
||||||
@ -101,8 +143,9 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
valueType: 'digit',
|
valueType: 'digit',
|
||||||
fieldProps: {
|
fieldProps: {
|
||||||
addonAfter: '㎡',
|
addonAfter: '㎡',
|
||||||
|
max: 99999,
|
||||||
},
|
},
|
||||||
colProps: { span: 8 },
|
colProps: { span: 6 },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'chargeable_area',
|
key: 'chargeable_area',
|
||||||
@ -110,26 +153,36 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
valueType: 'digit',
|
valueType: 'digit',
|
||||||
fieldProps: {
|
fieldProps: {
|
||||||
addonAfter: '㎡',
|
addonAfter: '㎡',
|
||||||
|
max: 99999,
|
||||||
},
|
},
|
||||||
colProps: { span: 8 },
|
colProps: { span: 6 },
|
||||||
},
|
},
|
||||||
{
|
MyFormItems.EnumRadio({
|
||||||
key: 'floor',
|
key: 'status',
|
||||||
title: '楼层',
|
title: '房屋状态',
|
||||||
valueType: 'digit',
|
colProps: { span: 6 },
|
||||||
fieldProps: {
|
// valueEnum: AssetHousesStatusEnum,
|
||||||
addonAfter: '楼',
|
// required: true,
|
||||||
|
valueEnum: () => {
|
||||||
|
let obj: any = JSON.parse(JSON.stringify(AssetHousesStatusEnum));
|
||||||
|
delete obj.SelfOccupied;
|
||||||
|
delete obj.Rented;
|
||||||
|
delete obj.Vacant;
|
||||||
|
return obj;
|
||||||
},
|
},
|
||||||
colProps: { span: 8 },
|
}),
|
||||||
},
|
// {
|
||||||
{
|
// key: 'full_name',
|
||||||
key: 'ownership_term',
|
// title: '房屋全称',
|
||||||
title: '产权年限',
|
// colProps: { span: 12 },
|
||||||
fieldProps: {
|
// },
|
||||||
addonAfter: '年',
|
MyFormItems.EnumRadio({
|
||||||
},
|
key: 'orientation',
|
||||||
colProps: { span: 8 },
|
title: '房屋状态',
|
||||||
},
|
colProps: { span: 6 },
|
||||||
|
valueEnum: AssetHousesOrientationEnum,
|
||||||
|
// required: true,
|
||||||
|
}),
|
||||||
{
|
{
|
||||||
valueType: 'group',
|
valueType: 'group',
|
||||||
columns: [
|
columns: [
|
||||||
@ -151,15 +204,6 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
},
|
},
|
||||||
colProps: { span: 4 },
|
colProps: { span: 4 },
|
||||||
},
|
},
|
||||||
{
|
|
||||||
key: 'kitchen',
|
|
||||||
title: '厨',
|
|
||||||
valueType: 'digit',
|
|
||||||
fieldProps: {
|
|
||||||
addonAfter: '厨',
|
|
||||||
},
|
|
||||||
colProps: { span: 4 },
|
|
||||||
},
|
|
||||||
{
|
{
|
||||||
key: 'bathroom',
|
key: 'bathroom',
|
||||||
title: '卫',
|
title: '卫',
|
||||||
@ -169,6 +213,15 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
},
|
},
|
||||||
colProps: { span: 4 },
|
colProps: { span: 4 },
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
key: 'kitchen',
|
||||||
|
title: '厨',
|
||||||
|
valueType: 'digit',
|
||||||
|
fieldProps: {
|
||||||
|
addonAfter: '厨',
|
||||||
|
},
|
||||||
|
colProps: { span: 4 },
|
||||||
|
},
|
||||||
{
|
{
|
||||||
key: 'balcony',
|
key: 'balcony',
|
||||||
title: '阳台',
|
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,
|
MyModalFormProps,
|
||||||
rulesHelper,
|
rulesHelper,
|
||||||
} from '@/common';
|
} from '@/common';
|
||||||
|
import { SysSelects } from '@/components/Select';
|
||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import {
|
import {
|
||||||
AssetUnitsBuildingStructureEnum,
|
AssetUnitsBuildingStructureEnum,
|
||||||
AssetUnitsBuildingTypeEnum,
|
AssetUnitsBuildingTypeEnum,
|
||||||
} from '@/gen/Enums';
|
} from '@/gen/Enums';
|
||||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||||
import { message } from 'antd';
|
import { Form, message } from 'antd';
|
||||||
|
|
||||||
export default function Create(props: MyBetaModalFormProps) {
|
export default function Create(props: MyBetaModalFormProps) {
|
||||||
|
const [form] = Form.useForm();
|
||||||
return (
|
return (
|
||||||
<BetaSchemaForm<ApiTypes.Asset.AssetUnits.Store>
|
<BetaSchemaForm<ApiTypes.Asset.AssetUnits.Store>
|
||||||
{...MyModalFormProps.props}
|
{...MyModalFormProps.props}
|
||||||
@ -23,14 +25,19 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
trigger={
|
trigger={
|
||||||
<MyButtons.Create
|
<MyButtons.Create
|
||||||
title={`添加${props.title}`}
|
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) =>
|
onFinish={async (values) =>
|
||||||
Apis.Asset.AssetUnits.Store({
|
Apis.Asset.AssetUnits.Store({
|
||||||
...values,
|
...values,
|
||||||
asset_projects_id: props?.item?.id,
|
asset_projects_id: props?.item?.id,
|
||||||
asset_buildings_id: props?.item?.asset_buildings_id,
|
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
props.reload?.();
|
props.reload?.();
|
||||||
@ -40,6 +47,15 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
.catch(() => false)
|
.catch(() => false)
|
||||||
}
|
}
|
||||||
columns={[
|
columns={[
|
||||||
|
SysSelects?.AssetBuildings({
|
||||||
|
key: 'asset_buildings_id',
|
||||||
|
title: '选择楼栋',
|
||||||
|
params:{
|
||||||
|
asset_projects_id: props?.item?.id,
|
||||||
|
},
|
||||||
|
colProps: { span:24 },
|
||||||
|
formItemProps: { ...rulesHelper.number },
|
||||||
|
}),
|
||||||
{
|
{
|
||||||
key: 'name',
|
key: 'name',
|
||||||
title: '单元名称',
|
title: '单元名称',
|
||||||
@ -68,17 +84,17 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
{
|
{
|
||||||
key: 'elevator_count',
|
key: 'elevator_count',
|
||||||
title: '电梯数量',
|
title: '电梯数量',
|
||||||
colProps: { span: 12 },
|
colProps: { span: 6 },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'units_per_building',
|
key: 'units_per_building',
|
||||||
title: '单元户数',
|
title: '单元户数',
|
||||||
colProps: { span: 12 },
|
colProps: { span: 6 },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'highest_floor',
|
key: 'highest_floor',
|
||||||
title: '最高楼层',
|
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>
|
<BetaSchemaForm<ApiTypes.Asset.AssetProjects.Update>
|
||||||
{...MyModalFormProps.props}
|
{...MyModalFormProps.props}
|
||||||
title={`编辑${props.title}`}
|
title={`编辑${props.title}`}
|
||||||
trigger={<MyButtons.Default title="编辑" type="primary" size="middle" />}
|
trigger={
|
||||||
|
<MyButtons.Default
|
||||||
|
title="修改"
|
||||||
|
color="primary"
|
||||||
|
variant="filled"
|
||||||
|
size="small"
|
||||||
|
/>
|
||||||
|
}
|
||||||
wrapperCol={{ span: 24 }}
|
wrapperCol={{ span: 24 }}
|
||||||
width="800px"
|
width="800px"
|
||||||
request={() =>
|
request={() =>
|
||||||
@ -46,91 +53,100 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
.catch(() => false)
|
.catch(() => false)
|
||||||
}
|
}
|
||||||
columns={[
|
columns={[
|
||||||
SysSelects?.Companies({
|
|
||||||
key: 'companies_id',
|
|
||||||
title: '所属机构',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
formItemProps: { ...rulesHelper.number },
|
|
||||||
}),
|
|
||||||
{
|
{
|
||||||
key: 'name',
|
key: 'name',
|
||||||
title: '项目名称',
|
title: '项目名称',
|
||||||
colProps: { span: 8 },
|
colProps: { span: 12 },
|
||||||
formItemProps: { ...rulesHelper.text },
|
formItemProps: { ...rulesHelper.text },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'alias_name',
|
key: 'alias_name',
|
||||||
title: '项目别名',
|
title: '项目别名',
|
||||||
colProps: { span: 8 },
|
colProps: { span: 6 },
|
||||||
},
|
},
|
||||||
{
|
SysSelects?.Companies({
|
||||||
key: 'code',
|
key: 'companies_id',
|
||||||
title: '项目编码',
|
title: '所属机构',
|
||||||
colProps: { span: 8 },
|
colProps: { span: 6 },
|
||||||
formItemProps: { ...rulesHelper.text },
|
formItemProps: { ...rulesHelper.number },
|
||||||
},
|
|
||||||
MyFormItems.EnumRadio({
|
|
||||||
key: 'property_type',
|
|
||||||
title: '物业类型',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
valueEnum: AssetProjectsPropertyTypeEnum,
|
|
||||||
required: true,
|
|
||||||
}),
|
}),
|
||||||
MyFormItems.EnumRadio({
|
// {
|
||||||
key: 'status',
|
// key: 'code',
|
||||||
title: '状态',
|
// title: '项目编码',
|
||||||
colProps: { span: 12 },
|
// colProps: { span: 8 },
|
||||||
valueEnum: AssetProjectsStatusEnum,
|
// formItemProps: { ...rulesHelper.text },
|
||||||
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,
|
|
||||||
}),
|
|
||||||
|
|
||||||
Address.Cascader({
|
Address.Cascader({
|
||||||
key: 'casacader',
|
key: 'casacader',
|
||||||
title: '选择地址',
|
title: '选择地址',
|
||||||
colProps: { span: 24 },
|
colProps: { span: 12 },
|
||||||
keys: ['province', 'city', 'area', 'street'],
|
keys: ['province', 'city', 'area', 'street'],
|
||||||
required: true,
|
required: true,
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
key: 'address',
|
key: 'address',
|
||||||
title: '详细地址',
|
title: '详细地址',
|
||||||
colProps: { span: 24 },
|
colProps: { span: 6 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'longitude',
|
key: 'longitude',
|
||||||
title: '经度',
|
title: '经度',
|
||||||
colProps: { span: 6 },
|
colProps: { span: 3 },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'latitude',
|
key: 'latitude',
|
||||||
title: '纬度',
|
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',
|
key: 'takeover_date',
|
||||||
title: '接管日期',
|
title: '接管日期',
|
||||||
valueType: 'date',
|
valueType: 'date',
|
||||||
|
fieldProps: {
|
||||||
|
style: {
|
||||||
|
width: '100%',
|
||||||
|
},
|
||||||
|
},
|
||||||
colProps: { span: 6 },
|
colProps: { span: 6 },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'closure_date',
|
key: 'closure_date',
|
||||||
title: '封园日期',
|
title: '封园日期',
|
||||||
valueType: 'date',
|
valueType: 'date',
|
||||||
|
fieldProps: {
|
||||||
|
style: {
|
||||||
|
width: '100%',
|
||||||
|
},
|
||||||
|
},
|
||||||
colProps: { span: 6 },
|
colProps: { span: 6 },
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
@ -35,81 +35,81 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
.catch(() => false)
|
.catch(() => false)
|
||||||
}
|
}
|
||||||
columns={[
|
columns={[
|
||||||
SysSelects?.Companies({
|
|
||||||
key: 'companies_id',
|
|
||||||
title: '所属机构',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
formItemProps: { ...rulesHelper.number },
|
|
||||||
}),
|
|
||||||
{
|
{
|
||||||
key: 'name',
|
key: 'name',
|
||||||
title: '项目名称',
|
title: '项目名称',
|
||||||
colProps: { span: 8 },
|
colProps: { span: 12 },
|
||||||
formItemProps: { ...rulesHelper.text },
|
formItemProps: { ...rulesHelper.text },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'alias_name',
|
key: 'alias_name',
|
||||||
title: '项目别名',
|
title: '项目别名',
|
||||||
colProps: { span: 8 },
|
colProps: { span: 6 },
|
||||||
},
|
},
|
||||||
{
|
SysSelects?.Companies({
|
||||||
key: 'code',
|
key: 'companies_id',
|
||||||
title: '项目编码',
|
title: '所属机构',
|
||||||
colProps: { span: 8 },
|
colProps: { span: 6 },
|
||||||
formItemProps: { ...rulesHelper.text },
|
// formItemProps: { ...rulesHelper.number },
|
||||||
},
|
|
||||||
MyFormItems.EnumRadio({
|
|
||||||
key: 'property_type',
|
|
||||||
title: '物业类型',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
valueEnum: AssetProjectsPropertyTypeEnum,
|
|
||||||
required: true,
|
|
||||||
}),
|
}),
|
||||||
MyFormItems.EnumRadio({
|
// {
|
||||||
key: 'status',
|
// key: 'code',
|
||||||
title: '状态',
|
// title: '项目编码',
|
||||||
colProps: { span: 12 },
|
// colProps: { span: 8 },
|
||||||
valueEnum: AssetProjectsStatusEnum,
|
// // formItemProps: { ...rulesHelper.text },
|
||||||
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,
|
|
||||||
}),
|
|
||||||
|
|
||||||
Address.Cascader({
|
Address.Cascader({
|
||||||
key: 'casacader',
|
key: 'casacader',
|
||||||
title: '选择地址',
|
title: '选择地址',
|
||||||
colProps: { span: 24 },
|
colProps: { span: 12 },
|
||||||
keys: ['province', 'city', 'area', 'street'],
|
keys: ['province', 'city', 'area', 'street'],
|
||||||
required: true,
|
required: true,
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
key: 'address',
|
key: 'address',
|
||||||
title: '详细地址',
|
title: '详细地址',
|
||||||
colProps: { span: 24 },
|
colProps: { span: 6 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'longitude',
|
key: 'longitude',
|
||||||
title: '经度',
|
title: '经度',
|
||||||
colProps: { span: 6 },
|
colProps: { span: 3 },
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'latitude',
|
key: 'latitude',
|
||||||
title: '纬度',
|
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',
|
key: 'takeover_date',
|
||||||
title: '接管日期',
|
title: '接管日期',
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user