Merge pull request 'develop' (#8) from develop into main
All checks were successful
Build and Push Docker Image / build (push) Successful in 3m28s
All checks were successful
Build and Push Docker Image / build (push) Successful in 3m28s
Reviewed-on: https://code.juyouwu.cn/pay/pay-admin/pulls/8
This commit is contained in:
commit
9695661896
@ -15,10 +15,9 @@ export default defineConfig({
|
|||||||
proxy: {
|
proxy: {
|
||||||
'/api/': {
|
'/api/': {
|
||||||
// target: 'http://yt:8003',
|
// target: 'http://yt:8003',
|
||||||
// target: 'http://10.39.13.78:8001/',
|
target: 'http://10.39.13.78:8001/',
|
||||||
// target: 'https://test-admin.linyikj.com.cn/',
|
// target: 'https://test-admin.linyikj.com.cn/',
|
||||||
|
// target: 'https://admin.linyikj.com.cn/',
|
||||||
target: 'https://admin.linyikj.com.cn/',
|
|
||||||
|
|
||||||
changeOrigin: true,
|
changeOrigin: true,
|
||||||
pathRewrite: { '^': '' },
|
pathRewrite: { '^': '' },
|
||||||
|
|||||||
@ -127,4 +127,28 @@ export const rulesHelper = {
|
|||||||
}),
|
}),
|
||||||
] as Rule[],
|
] as Rule[],
|
||||||
},
|
},
|
||||||
|
|
||||||
|
getMonthStartDate(date: string) {
|
||||||
|
//获取当月的开始日期
|
||||||
|
if (date) {
|
||||||
|
const targetDate = new Date(date);
|
||||||
|
// 设置为当月第一天
|
||||||
|
targetDate.setDate(1);
|
||||||
|
return targetDate.toISOString().split('T')[0];
|
||||||
|
} else {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
},
|
||||||
|
getMonthEndDate(date: string) {
|
||||||
|
//获取当月的结束日期
|
||||||
|
if (date) {
|
||||||
|
const targetDate = new Date(date);
|
||||||
|
// 设置为下个月第一天,然后减去一天得到当月最后一天
|
||||||
|
targetDate.setMonth(targetDate.getMonth() + 1, 1);
|
||||||
|
targetDate.setDate(targetDate.getDate() - 1);
|
||||||
|
return targetDate.toISOString().split('T')[0];
|
||||||
|
} else {
|
||||||
|
return undefined;
|
||||||
|
}
|
||||||
|
},
|
||||||
};
|
};
|
||||||
|
|||||||
@ -367,26 +367,30 @@ export const Selects = {
|
|||||||
hideInTable = true,
|
hideInTable = true,
|
||||||
...rest
|
...rest
|
||||||
} = props ?? {};
|
} = props ?? {};
|
||||||
|
|
||||||
return {
|
return {
|
||||||
title: title,
|
title: title,
|
||||||
key: key,
|
key: key,
|
||||||
valueType: 'select',
|
valueType: 'select',
|
||||||
hideInTable: hideInTable,
|
hideInTable: hideInTable,
|
||||||
formItemProps: { ...(required ? rulesHelper.number : {}) },
|
formItemProps: { ...(required ? rulesHelper.number : {}) },
|
||||||
request: async (params) =>
|
request: async (params) => {
|
||||||
(
|
let res = await Apis.Company.CompanyReceiptAccounts.Select({
|
||||||
await Apis.Company.CompanyReceiptAccounts.Select({
|
keywords: params?.KeyWords,
|
||||||
keywords: params?.KeyWords,
|
companies_id: params?.companies_id,
|
||||||
...params,
|
...params,
|
||||||
})
|
});
|
||||||
).data,
|
res?.data?.map((l: any) => {
|
||||||
|
l.label =
|
||||||
|
l.company_name + '_' + l.company_bank + '_' + l.company_account;
|
||||||
|
});
|
||||||
|
return res?.data;
|
||||||
|
},
|
||||||
...rest,
|
...rest,
|
||||||
fieldProps: {
|
fieldProps: {
|
||||||
showSearch: true,
|
showSearch: true,
|
||||||
fieldNames: {
|
fieldNames: {
|
||||||
label: 'label',
|
label: 'label',
|
||||||
value: 'value',
|
value: 'id',
|
||||||
},
|
},
|
||||||
...rest?.fieldProps,
|
...rest?.fieldProps,
|
||||||
},
|
},
|
||||||
|
|||||||
112
src/components/TransferUnits.tsx
Normal file
112
src/components/TransferUnits.tsx
Normal file
@ -0,0 +1,112 @@
|
|||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import { Transfer } from 'antd';
|
||||||
|
import { useEffect, useState } from 'react';
|
||||||
|
const MyTransferUnits = (props: any) => {
|
||||||
|
const [getLoading, setLoading] = useState(false);
|
||||||
|
const [dataSource, setTransferData] = useState<any[]>([]);
|
||||||
|
const [targetKeys, setTargetKeys] = useState<string[]>([]);
|
||||||
|
useEffect(() => {
|
||||||
|
if (props?.item?.asset_projects_id) {
|
||||||
|
Apis.Asset.AssetUnits.GridSelect({
|
||||||
|
asset_projects_id: props?.item?.asset_projects_id,
|
||||||
|
type: props?.item?.type,
|
||||||
|
})
|
||||||
|
.then((res) => {
|
||||||
|
setLoading(true);
|
||||||
|
const data =
|
||||||
|
res.data?.map((item: any) => ({
|
||||||
|
key: item.value?.toString(),
|
||||||
|
title: item?.asset_building?.name + item.label,
|
||||||
|
asset_buildings_id: item.asset_buildings_id,
|
||||||
|
})) || [];
|
||||||
|
setTransferData(data);
|
||||||
|
})
|
||||||
|
.catch(() => {
|
||||||
|
setTransferData([]);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}, [props?.item?.asset_projects_id]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
console.log(props.value, 'props.value');
|
||||||
|
if (props.value?.length && !props.value[0]?.asset_units_id) {
|
||||||
|
let dataIds: any = [];
|
||||||
|
props.value?.forEach((res: any) => {
|
||||||
|
dataIds?.push(res?.toString());
|
||||||
|
});
|
||||||
|
setTargetKeys(dataIds);
|
||||||
|
}
|
||||||
|
}, [props.value]);
|
||||||
|
|
||||||
|
useEffect(() => {
|
||||||
|
if (dataSource?.length && props?.value?.length) {
|
||||||
|
let dataIds: any = [];
|
||||||
|
props.value?.forEach((res: any) => {
|
||||||
|
dataSource?.forEach((k: any) => {
|
||||||
|
if (res?.toString() === k.key) {
|
||||||
|
dataIds?.push({
|
||||||
|
asset_projects_id: props?.item?.asset_projects_id,
|
||||||
|
asset_buildings_id: k?.asset_buildings_id,
|
||||||
|
asset_units_id: k?.key,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
console.log(dataIds, '22');
|
||||||
|
console.log(props.value, 'props.value');
|
||||||
|
console.log(dataSource, 'dataSource');
|
||||||
|
props?.onChange?.(dataIds);
|
||||||
|
}
|
||||||
|
}, [getLoading]);
|
||||||
|
|
||||||
|
return (
|
||||||
|
getLoading && (
|
||||||
|
<Transfer
|
||||||
|
dataSource={dataSource}
|
||||||
|
targetKeys={targetKeys}
|
||||||
|
onChange={(targetKeys) => {
|
||||||
|
let dataIds: any = [];
|
||||||
|
console.log(targetKeys, 'targetKeys', props.value);
|
||||||
|
targetKeys?.forEach((res: any) => {
|
||||||
|
dataSource?.forEach((k: any) => {
|
||||||
|
if (res === k.key) {
|
||||||
|
dataIds?.push({
|
||||||
|
asset_projects_id: props?.item?.asset_projects_id,
|
||||||
|
asset_buildings_id: k?.asset_buildings_id,
|
||||||
|
asset_units_id: k?.key,
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
setTargetKeys(targetKeys as string[]);
|
||||||
|
props?.onChange?.(dataIds);
|
||||||
|
}}
|
||||||
|
render={(item) => item.title}
|
||||||
|
titles={['可选单元', '已选单元']}
|
||||||
|
showSearch
|
||||||
|
listStyle={{
|
||||||
|
width: 250,
|
||||||
|
height: 300,
|
||||||
|
}}
|
||||||
|
operations={['选择', '移除']}
|
||||||
|
operationStyle={{ marginTop: 20 }}
|
||||||
|
locale={{
|
||||||
|
itemUnit: '项',
|
||||||
|
itemsUnit: '项',
|
||||||
|
searchPlaceholder: '请输入搜索内容',
|
||||||
|
notFoundContent: '列表为空',
|
||||||
|
}}
|
||||||
|
onSelectChange={(sourceSelectedKeys, targetSelectedKeys) => {
|
||||||
|
console.log(
|
||||||
|
sourceSelectedKeys,
|
||||||
|
targetSelectedKeys,
|
||||||
|
'sourceSelectedKeys',
|
||||||
|
);
|
||||||
|
// 处理选择变化,但不触发表单提交
|
||||||
|
}}
|
||||||
|
/>
|
||||||
|
)
|
||||||
|
);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default MyTransferUnits;
|
||||||
106
src/gen/ApiTypes.d.ts
vendored
106
src/gen/ApiTypes.d.ts
vendored
@ -292,6 +292,7 @@ declare namespace ApiTypes {
|
|||||||
};
|
};
|
||||||
type Select = {
|
type Select = {
|
||||||
"keywords"?: string; // 关键词
|
"keywords"?: string; // 关键词
|
||||||
|
"companies_id"?: number; // 机构id
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
namespace AssetUnits {
|
namespace AssetUnits {
|
||||||
@ -338,6 +339,7 @@ declare namespace ApiTypes {
|
|||||||
"asset_projects_id"?: number; // 所属项目id,[ref:asset_projects]
|
"asset_projects_id"?: number; // 所属项目id,[ref:asset_projects]
|
||||||
"asset_buildings_id"?: number; // 所属楼栋id,[ref:asset_buildings]
|
"asset_buildings_id"?: number; // 所属楼栋id,[ref:asset_buildings]
|
||||||
"keywords"?: string; // 关键词
|
"keywords"?: string; // 关键词
|
||||||
|
"type"?: number; // 类型:1, 排除已添加的
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -700,6 +702,9 @@ declare namespace ApiTypes {
|
|||||||
"organizations_id"?: number; // 所属组织id,[ref:organizations]
|
"organizations_id"?: number; // 所属组织id,[ref:organizations]
|
||||||
"keywords"?: string; // 关键词
|
"keywords"?: string; // 关键词
|
||||||
};
|
};
|
||||||
|
type Import = {
|
||||||
|
"upload_file": mimes:xlsx,xls; // 上传文件
|
||||||
|
};
|
||||||
}
|
}
|
||||||
namespace CompanyPositions {
|
namespace CompanyPositions {
|
||||||
type List = {
|
type List = {
|
||||||
@ -896,6 +901,101 @@ declare namespace ApiTypes {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
namespace Customer {
|
namespace Customer {
|
||||||
|
namespace CustomerMomentCategories {
|
||||||
|
type List = {
|
||||||
|
"name"?: string; // 模糊搜索:名称
|
||||||
|
"parent_id"?: number; // 父级ID
|
||||||
|
};
|
||||||
|
type Store = {
|
||||||
|
"name": string; // 分类名称
|
||||||
|
"is_use"?: number; // 是否启用:0=禁用,1=启用
|
||||||
|
"parent_id"?: number; // 父级id,[ref:customer_moment_categories]
|
||||||
|
};
|
||||||
|
type Update = {
|
||||||
|
"id": number; // id
|
||||||
|
"name": string; // 分类名称
|
||||||
|
"is_use"?: number; // 是否启用:0=禁用,1=启用
|
||||||
|
"parent_id"?: number; //
|
||||||
|
};
|
||||||
|
type Show = {
|
||||||
|
"id": number; // id
|
||||||
|
};
|
||||||
|
type SoftDelete = {
|
||||||
|
"id": number; // id
|
||||||
|
};
|
||||||
|
type Restore = {
|
||||||
|
"id": number; // id
|
||||||
|
};
|
||||||
|
type Delete = {
|
||||||
|
"id": number; // id
|
||||||
|
};
|
||||||
|
type SelectTree = {
|
||||||
|
"keywords"?: string; // -
|
||||||
|
"parent_id"?: number; // -
|
||||||
|
};
|
||||||
|
}
|
||||||
|
namespace CustomerMoments {
|
||||||
|
type List = {
|
||||||
|
"admin_name"?: string; // 模糊搜索:创建人名称
|
||||||
|
"channel"?: string; // 发送渠道,[enum:CustomerMomentsChannelEnum]
|
||||||
|
"push_time"?: Date; // 推送时间
|
||||||
|
"push_status"?: string; // 推送状态,[enum:CustomerMomentsPushStatusEnum]
|
||||||
|
"one_moment_categories_id"?: number; // 内容一级分类id,[ref:customer_moment_categories]
|
||||||
|
"two_moment_categories_id"?: number; // 内容二级分类id,[ref:customer_moment_categories]
|
||||||
|
"content"?: string; // 模糊搜索:内容
|
||||||
|
};
|
||||||
|
type Store = {
|
||||||
|
"channel": string; // 发送渠道,[enum:CustomerMomentsChannelEnum]
|
||||||
|
"push_type": string; // 推送类型,[enum:CustomerMomentsPushTypeEnum]
|
||||||
|
"scheduled_time"?: Date; // 定时发送时间
|
||||||
|
"task_end_type": string; // 任务结束类型,[enum:CustomerMomentsTaskEndTypeEnum]
|
||||||
|
"task_days"?: number; // 任务天数
|
||||||
|
"task_end_time"?: Date; // 任务结束时间
|
||||||
|
"range_type": string; // 范围类型,[enum:CustomerMomentsRangeTypeEnum]
|
||||||
|
"range_data": string[]; // 范围数据(项目:项目ID,员工:员工ID,部门:部门ID,客户:客户ID)
|
||||||
|
"content": string; // 内容
|
||||||
|
"content_type": string; // 内容类型,[enum:CustomerMomentsContentTypeEnum]
|
||||||
|
"skip_type"?: string; // 跳转类型,[enum:CustomerMomentsSkipTypeEnum]
|
||||||
|
"mini_program_app_id"?: string; // 小程序APPID
|
||||||
|
"skip_url"?: string; // 跳转链接
|
||||||
|
"title"?: string; // 跳转标题
|
||||||
|
"desc"?: string; // 描述
|
||||||
|
"cover_image"?: string[]; // 封面图
|
||||||
|
"attachments"?: string[]; // 附件
|
||||||
|
"one_moment_categories_id": number; // 内容一级分类id,[ref:customer_moment_categories]
|
||||||
|
"two_moment_categories_id": number; // 内容二级分类id,[ref:customer_moment_categories]
|
||||||
|
"companies_id": number; // 公司id,[ref:companies]
|
||||||
|
};
|
||||||
|
type Update = {
|
||||||
|
"id": number; // id
|
||||||
|
"channel": string; // 发送渠道,[enum:CustomerMomentsChannelEnum]
|
||||||
|
"push_type": string; // 推送类型,[enum:CustomerMomentsPushTypeEnum]
|
||||||
|
"scheduled_time"?: Date; // 定时发送时间
|
||||||
|
"task_end_type": string; // 任务结束类型,[enum:CustomerMomentsTaskEndTypeEnum]
|
||||||
|
"task_days"?: number; // 任务天数
|
||||||
|
"task_end_time"?: Date; // 任务结束时间
|
||||||
|
"range_type": string; // 范围类型,[enum:CustomerMomentsRangeTypeEnum]
|
||||||
|
"range_data": string[]; // 范围数据(项目:项目ID,员工:员工ID,部门:部门ID,客户:客户ID)
|
||||||
|
"content": string; // 内容
|
||||||
|
"content_type": string; // 内容类型,[enum:CustomerMomentsContentTypeEnum]
|
||||||
|
"skip_type"?: string; // 跳转类型,[enum:CustomerMomentsSkipTypeEnum]
|
||||||
|
"mini_program_app_id"?: string; // 小程序APPID
|
||||||
|
"skip_url"?: string; // 跳转链接
|
||||||
|
"title"?: string; // 跳转标题
|
||||||
|
"desc"?: string; // 描述
|
||||||
|
"cover_image"?: string[]; // 封面图
|
||||||
|
"attachments"?: string[]; // 附件
|
||||||
|
"one_moment_categories_id": number; // 内容一级分类id,[ref:customer_moment_categories]
|
||||||
|
"two_moment_categories_id": number; // 内容二级分类id,[ref:customer_moment_categories]
|
||||||
|
"companies_id": number; // 公司id,[ref:companies]
|
||||||
|
};
|
||||||
|
type Show = {
|
||||||
|
"id": number; // id
|
||||||
|
};
|
||||||
|
type Send = {
|
||||||
|
"id": number; // id
|
||||||
|
};
|
||||||
|
}
|
||||||
namespace CustomerOpinions {
|
namespace CustomerOpinions {
|
||||||
type List = {
|
type List = {
|
||||||
"type"?: string; // 类型,[enum:CustomerOpinionsTypeEnum]
|
"type"?: string; // 类型,[enum:CustomerOpinionsTypeEnum]
|
||||||
@ -975,6 +1075,7 @@ declare namespace ApiTypes {
|
|||||||
"charge_type": string; // 收费类型,[enum:HouseBillsTypeEnum]
|
"charge_type": string; // 收费类型,[enum:HouseBillsTypeEnum]
|
||||||
"calculation_mode": string; // 计费模式,[enum:HouseChargeStandardsCalculationModeEnum]
|
"calculation_mode": string; // 计费模式,[enum:HouseChargeStandardsCalculationModeEnum]
|
||||||
"calculation_method": string; // 计量方式,[enum:HouseChargeStandardsCalculationMethodEnum]
|
"calculation_method": string; // 计量方式,[enum:HouseChargeStandardsCalculationMethodEnum]
|
||||||
|
"company_receipt_accounts_id": number; // 收款账户id,[ref:company_receipt_accounts]
|
||||||
"price_algorithm": string; // 单价算法,[enum:HouseChargeStandardsPriceAlgorithmEnum]
|
"price_algorithm": string; // 单价算法,[enum:HouseChargeStandardsPriceAlgorithmEnum]
|
||||||
"price"?: number; // 单价
|
"price"?: number; // 单价
|
||||||
"calculation_period"?: string; // 计费周期,[enum:HouseChargeStandardsCalculationPeriodEnum]
|
"calculation_period"?: string; // 计费周期,[enum:HouseChargeStandardsCalculationPeriodEnum]
|
||||||
@ -999,6 +1100,7 @@ declare namespace ApiTypes {
|
|||||||
"charge_type": string; // 收费类型,[enum:HouseBillsTypeEnum]
|
"charge_type": string; // 收费类型,[enum:HouseBillsTypeEnum]
|
||||||
"calculation_mode": string; // 计费模式,[enum:HouseChargeStandardsCalculationModeEnum]
|
"calculation_mode": string; // 计费模式,[enum:HouseChargeStandardsCalculationModeEnum]
|
||||||
"calculation_method": string; // 计量方式,[enum:HouseChargeStandardsCalculationMethodEnum]
|
"calculation_method": string; // 计量方式,[enum:HouseChargeStandardsCalculationMethodEnum]
|
||||||
|
"company_receipt_accounts_id": number; // 收款账户id,[ref:company_receipt_accounts]
|
||||||
"price_algorithm": string; // 单价算法,[enum:HouseChargeStandardsPriceAlgorithmEnum]
|
"price_algorithm": string; // 单价算法,[enum:HouseChargeStandardsPriceAlgorithmEnum]
|
||||||
"price"?: number; // 单价
|
"price"?: number; // 单价
|
||||||
"calculation_period"?: string; // 计费周期,[enum:HouseChargeStandardsCalculationPeriodEnum]
|
"calculation_period"?: string; // 计费周期,[enum:HouseChargeStandardsCalculationPeriodEnum]
|
||||||
@ -1128,6 +1230,8 @@ declare namespace ApiTypes {
|
|||||||
"asset_projects_id": number; // 项目id,[ref:asset_projects]
|
"asset_projects_id": number; // 项目id,[ref:asset_projects]
|
||||||
"title": string; // 标题
|
"title": string; // 标题
|
||||||
"content": string; // 内容
|
"content": string; // 内容
|
||||||
|
"publish_type": string; // 发布类型,[MsgPropertyAnnouncementsPublishTypeEnum]
|
||||||
|
"schedule_publish_at"?: Date; // 计划发布时间
|
||||||
"is_publish"?: boolean; // 是否发布
|
"is_publish"?: boolean; // 是否发布
|
||||||
"publish_at"?: Date; // 发布时间
|
"publish_at"?: Date; // 发布时间
|
||||||
"sort"?: number; // 排序
|
"sort"?: number; // 排序
|
||||||
@ -1137,6 +1241,8 @@ declare namespace ApiTypes {
|
|||||||
"asset_projects_id": number; // 项目id,[ref:asset_projects]
|
"asset_projects_id": number; // 项目id,[ref:asset_projects]
|
||||||
"title": string; // 标题
|
"title": string; // 标题
|
||||||
"content": string; // 内容
|
"content": string; // 内容
|
||||||
|
"publish_type": string; // 发布类型,[MsgPropertyAnnouncementsPublishTypeEnum]
|
||||||
|
"schedule_publish_at"?: Date; // 计划发布时间
|
||||||
"is_publish"?: boolean; // 是否发布
|
"is_publish"?: boolean; // 是否发布
|
||||||
"publish_at"?: Date; // 发布时间
|
"publish_at"?: Date; // 发布时间
|
||||||
"sort"?: number; // 排序
|
"sort"?: number; // 排序
|
||||||
|
|||||||
@ -399,6 +399,12 @@ export const Apis = {
|
|||||||
Select(data?: ApiTypes.Company.CompanyEmployees.Select): Promise<MyResponseType> {
|
Select(data?: ApiTypes.Company.CompanyEmployees.Select): Promise<MyResponseType> {
|
||||||
return request('admin/company/company_employees/select', { data });
|
return request('admin/company/company_employees/select', { data });
|
||||||
},
|
},
|
||||||
|
Import(data: ApiTypes.Company.CompanyEmployees.Import): Promise<MyResponseType> {
|
||||||
|
return request('admin/company/company_employees/import', { data });
|
||||||
|
},
|
||||||
|
DownloadTemplate(): Promise<MyResponseType> {
|
||||||
|
return request('admin/company/company_employees/download_template', {responseType: 'blob',});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
CompanyPositions: {
|
CompanyPositions: {
|
||||||
List(data?: ApiTypes.Company.CompanyPositions.List): Promise<MyResponseType> {
|
List(data?: ApiTypes.Company.CompanyPositions.List): Promise<MyResponseType> {
|
||||||
@ -523,6 +529,49 @@ export const Apis = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
Customer: {
|
Customer: {
|
||||||
|
CustomerMomentCategories: {
|
||||||
|
List(data?: ApiTypes.Customer.CustomerMomentCategories.List): Promise<MyResponseType> {
|
||||||
|
return request('admin/customer/customer_moment_categories/list', { data });
|
||||||
|
},
|
||||||
|
Store(data: ApiTypes.Customer.CustomerMomentCategories.Store): Promise<MyResponseType> {
|
||||||
|
return request('admin/customer/customer_moment_categories/store', { data });
|
||||||
|
},
|
||||||
|
Update(data: ApiTypes.Customer.CustomerMomentCategories.Update): Promise<MyResponseType> {
|
||||||
|
return request('admin/customer/customer_moment_categories/update', { data });
|
||||||
|
},
|
||||||
|
Show(data: ApiTypes.Customer.CustomerMomentCategories.Show): Promise<MyResponseType> {
|
||||||
|
return request('admin/customer/customer_moment_categories/show', { data });
|
||||||
|
},
|
||||||
|
SoftDelete(data: ApiTypes.Customer.CustomerMomentCategories.SoftDelete): Promise<MyResponseType> {
|
||||||
|
return request('admin/customer/customer_moment_categories/soft_delete', { data });
|
||||||
|
},
|
||||||
|
Restore(data: ApiTypes.Customer.CustomerMomentCategories.Restore): Promise<MyResponseType> {
|
||||||
|
return request('admin/customer/customer_moment_categories/restore', { data });
|
||||||
|
},
|
||||||
|
Delete(data: ApiTypes.Customer.CustomerMomentCategories.Delete): Promise<MyResponseType> {
|
||||||
|
return request('admin/customer/customer_moment_categories/delete', { data });
|
||||||
|
},
|
||||||
|
SelectTree(data?: ApiTypes.Customer.CustomerMomentCategories.SelectTree): Promise<MyResponseType> {
|
||||||
|
return request('admin/customer/customer_moment_categories/select_tree', { data });
|
||||||
|
},
|
||||||
|
},
|
||||||
|
CustomerMoments: {
|
||||||
|
List(data?: ApiTypes.Customer.CustomerMoments.List): Promise<MyResponseType> {
|
||||||
|
return request('admin/customer/customer_moments/list', { data });
|
||||||
|
},
|
||||||
|
Store(data: ApiTypes.Customer.CustomerMoments.Store): Promise<MyResponseType> {
|
||||||
|
return request('admin/customer/customer_moments/store', { data });
|
||||||
|
},
|
||||||
|
Update(data: ApiTypes.Customer.CustomerMoments.Update): Promise<MyResponseType> {
|
||||||
|
return request('admin/customer/customer_moments/update', { data });
|
||||||
|
},
|
||||||
|
Show(data: ApiTypes.Customer.CustomerMoments.Show): Promise<MyResponseType> {
|
||||||
|
return request('admin/customer/customer_moments/show', { data });
|
||||||
|
},
|
||||||
|
Send(data: ApiTypes.Customer.CustomerMoments.Send): Promise<MyResponseType> {
|
||||||
|
return request('admin/customer/customer_moments/send', { data });
|
||||||
|
},
|
||||||
|
},
|
||||||
CustomerOpinions: {
|
CustomerOpinions: {
|
||||||
List(data?: ApiTypes.Customer.CustomerOpinions.List): Promise<MyResponseType> {
|
List(data?: ApiTypes.Customer.CustomerOpinions.List): Promise<MyResponseType> {
|
||||||
return request('admin/customer/customer_opinions/list', { data });
|
return request('admin/customer/customer_opinions/list', { data });
|
||||||
|
|||||||
@ -126,7 +126,7 @@ export const BannersTypeEnum= {
|
|||||||
|
|
||||||
// 缓存类型
|
// 缓存类型
|
||||||
export const CacheTypeEnum= {
|
export const CacheTypeEnum= {
|
||||||
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#1f86c5","value":"MobilePhoneVerificationCode"},
|
'MobilePhoneVerificationCode': {"text":"手机验证码","color":"#69355c","value":"MobilePhoneVerificationCode"},
|
||||||
};
|
};
|
||||||
|
|
||||||
// CompaniesMerchantTypeEnum
|
// CompaniesMerchantTypeEnum
|
||||||
@ -189,6 +189,56 @@ export const CustomerBacklogsTypeEnum= {
|
|||||||
'ContractTodo': {"text":"合同待办","color":"#722ed1","value":"ContractTodo"},
|
'ContractTodo': {"text":"合同待办","color":"#722ed1","value":"ContractTodo"},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// CustomerMomentTasksStatusEnum
|
||||||
|
export const CustomerMomentTasksStatusEnum= {
|
||||||
|
'NotSent': {"text":"未发","color":"#FF4500","value":"NotSent"},
|
||||||
|
'Sent': {"text":"已发","color":"#32CD32","value":"Sent"},
|
||||||
|
};
|
||||||
|
|
||||||
|
// CustomerMomentsChannelEnum
|
||||||
|
export const CustomerMomentsChannelEnum= {
|
||||||
|
'MomentCorp': {"text":"朋友圈(企业)","color":"#1E90FF","value":"MomentCorp"},
|
||||||
|
'MomentPersonal': {"text":"朋友圈(个人)","color":"#32CD32","value":"MomentPersonal"},
|
||||||
|
'CustomerDirectCorp': {"text":"客户1对1消息群发(企业)","color":"#FFA500","value":"CustomerDirectCorp"},
|
||||||
|
'CustomerGroupCorp': {"text":"客户群群发(企业)","color":"#FF69B4","value":"CustomerGroupCorp"},
|
||||||
|
};
|
||||||
|
|
||||||
|
// CustomerMomentsContentTypeEnum
|
||||||
|
export const CustomerMomentsContentTypeEnum= {
|
||||||
|
'Image': {"text":"图片消息","color":"#1E90FF","value":"Image"},
|
||||||
|
'Link': {"text":"转载链接消息","color":"#32CD32","value":"Link"},
|
||||||
|
'MiniProgram': {"text":"跳小程序","color":"#FFA500","value":"MiniProgram"},
|
||||||
|
'Video': {"text":"视频消息","color":"#FF69B4","value":"Video"},
|
||||||
|
};
|
||||||
|
|
||||||
|
// CustomerMomentsPushStatusEnum
|
||||||
|
export const CustomerMomentsPushStatusEnum= {
|
||||||
|
'NotPushed': {"text":"未推送","color":"#FF4500","value":"NotPushed"},
|
||||||
|
'Pushed': {"text":"已推送","color":"#32CD32","value":"Pushed"},
|
||||||
|
};
|
||||||
|
|
||||||
|
// CustomerMomentsPushTypeEnum
|
||||||
|
export const CustomerMomentsPushTypeEnum= {
|
||||||
|
'ManualPush': {"text":"手动推送","color":"#1E90FF","value":"ManualPush"},
|
||||||
|
'ScheduledPush': {"text":"定时推送","color":"#32CD32","value":"ScheduledPush"},
|
||||||
|
};
|
||||||
|
|
||||||
|
// CustomerMomentsRangeTypeEnum
|
||||||
|
export const CustomerMomentsRangeTypeEnum= {
|
||||||
|
'Project': {"text":"按项目推送","color":"#1E90FF","value":"Project"},
|
||||||
|
};
|
||||||
|
|
||||||
|
// CustomerMomentsSkipTypeEnum
|
||||||
|
export const CustomerMomentsSkipTypeEnum= {
|
||||||
|
'H5': {"text":"H5","color":"#1E90FF","value":"H5"},
|
||||||
|
};
|
||||||
|
|
||||||
|
// CustomerMomentsTaskEndTypeEnum
|
||||||
|
export const CustomerMomentsTaskEndTypeEnum= {
|
||||||
|
'AfterNDays': {"text":"发送后N天","color":"#1E90FF","value":"AfterNDays"},
|
||||||
|
'ScheduledEnd': {"text":"定时结束","color":"#32CD32","value":"ScheduledEnd"},
|
||||||
|
};
|
||||||
|
|
||||||
// CustomerOpinionsTypeEnum
|
// CustomerOpinionsTypeEnum
|
||||||
export const CustomerOpinionsTypeEnum= {
|
export const CustomerOpinionsTypeEnum= {
|
||||||
'FeatureException': {"text":"功能异常","color":"#ff0000","value":"FeatureException"},
|
'FeatureException': {"text":"功能异常","color":"#ff0000","value":"FeatureException"},
|
||||||
@ -468,6 +518,12 @@ export const HouseWorkOrdersTypeEnum= {
|
|||||||
'Complaint': {"text":"投诉","color":"#aa00ff","value":"Complaint"},
|
'Complaint': {"text":"投诉","color":"#aa00ff","value":"Complaint"},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// MsgPropertyAnnouncementsPublishTypeEnum
|
||||||
|
export const MsgPropertyAnnouncementsPublishTypeEnum= {
|
||||||
|
'Manual': {"text":"手动","color":"#4caf50","value":"Manual"},
|
||||||
|
'Schedule': {"text":"定时","color":"#2196f3","value":"Schedule"},
|
||||||
|
};
|
||||||
|
|
||||||
// OrganizationsTypeEnum
|
// OrganizationsTypeEnum
|
||||||
export const OrganizationsTypeEnum= {
|
export const OrganizationsTypeEnum= {
|
||||||
'Group': {"text":"集团","color":"#007bff","value":"Group"},
|
'Group': {"text":"集团","color":"#007bff","value":"Group"},
|
||||||
|
|||||||
@ -133,7 +133,7 @@ export default function Index({ title = '房屋档案' }) {
|
|||||||
<MyButtons.View
|
<MyButtons.View
|
||||||
title="查看"
|
title="查看"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
navigate(`/archive/${item.id}`);
|
navigate(`/archive/show/${item.id}`);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
{!item?.house_occupants?.length ? (
|
{!item?.house_occupants?.length ? (
|
||||||
|
|||||||
@ -4,10 +4,10 @@ import { ProCard } from '@ant-design/pro-components';
|
|||||||
import { useParams } from '@umijs/max';
|
import { useParams } from '@umijs/max';
|
||||||
import { Badge, Tabs } from 'antd';
|
import { Badge, Tabs } from 'antd';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import HouseInfo from './components/HouseInfo';
|
import HouseInfo from '../components/HouseInfo';
|
||||||
import OccupantsHistory from './components/OccupantsHistory';
|
import OccupantsHistory from '../components/OccupantsHistory';
|
||||||
import OccupantsNow from './components/OccupantsNow';
|
import OccupantsNow from '../components/OccupantsNow';
|
||||||
import RegistersList from './components/RegistersList';
|
import RegistersList from '../components/RegistersList';
|
||||||
|
|
||||||
export default function Show({ title = '房屋档案' }) {
|
export default function Show({ title = '房屋档案' }) {
|
||||||
const { id } = useParams<{ id: string }>();
|
const { id } = useParams<{ id: string }>();
|
||||||
@ -11,7 +11,7 @@ import { Form, message } from 'antd';
|
|||||||
|
|
||||||
export default function Create(props: MyBetaModalFormProps) {
|
export default function Create(props: MyBetaModalFormProps) {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
|
console.log(props.item, 'pppp');
|
||||||
return (
|
return (
|
||||||
<BetaSchemaForm<ApiTypes.Company.CompanyProjectReceiptAccounts.Store>
|
<BetaSchemaForm<ApiTypes.Company.CompanyProjectReceiptAccounts.Store>
|
||||||
{...MyModalFormProps.props}
|
{...MyModalFormProps.props}
|
||||||
@ -34,6 +34,8 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
onFinish={async (values) =>
|
onFinish={async (values) =>
|
||||||
Apis.Company.CompanyProjectReceiptAccounts.Store({
|
Apis.Company.CompanyProjectReceiptAccounts.Store({
|
||||||
...values,
|
...values,
|
||||||
|
companies_id: props?.item?.companies_id || values?.companies_id,
|
||||||
|
projects_id: props?.item?.id || values?.projects_id,
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
props.reload?.();
|
props.reload?.();
|
||||||
@ -43,24 +45,58 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
.catch(() => false)
|
.catch(() => false)
|
||||||
}
|
}
|
||||||
columns={[
|
columns={[
|
||||||
Selects?.Companies({
|
...(props?.item?.id
|
||||||
key: 'companies_id',
|
? []
|
||||||
title: '选择机构',
|
: [
|
||||||
colProps: { span: 24 },
|
Selects?.Companies({
|
||||||
formItemProps: { ...rulesHelper.number },
|
key: 'companies_id',
|
||||||
}),
|
title: '选择机构',
|
||||||
Selects?.AssetProjects({
|
colProps: { span: 24 },
|
||||||
key: 'projects_id',
|
required: true,
|
||||||
title: '选择项目',
|
fieldProps: {
|
||||||
colProps: { span: 24 },
|
onChange: (val: any) => {
|
||||||
formItemProps: { ...rulesHelper.number },
|
form.setFieldsValue({
|
||||||
}),
|
projects_id: undefined,
|
||||||
Selects?.CompanyAccounts({
|
receipt_accounts_id: undefined,
|
||||||
key: 'receipt_accounts_id',
|
});
|
||||||
title: '选择收款账户',
|
},
|
||||||
colProps: { span: 24 },
|
},
|
||||||
formItemProps: { ...rulesHelper.number },
|
}),
|
||||||
}),
|
]),
|
||||||
|
{
|
||||||
|
valueType: 'dependency',
|
||||||
|
name: ['companies_id'],
|
||||||
|
columns: ({ companies_id }) => {
|
||||||
|
return [
|
||||||
|
...(props?.item?.id
|
||||||
|
? []
|
||||||
|
: [
|
||||||
|
Selects?.AssetProjects({
|
||||||
|
key: 'projects_id',
|
||||||
|
title: '选择项目',
|
||||||
|
params: {
|
||||||
|
companies_id:
|
||||||
|
companies_id || props?.item?.companies_id || 0,
|
||||||
|
},
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.number },
|
||||||
|
fieldProps: {
|
||||||
|
showSearch: true,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
Selects?.CompanyAccounts({
|
||||||
|
key: 'receipt_accounts_id',
|
||||||
|
title: '选择收款账户',
|
||||||
|
params: {
|
||||||
|
companies_id: companies_id || props?.item?.companies_id || 0,
|
||||||
|
},
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.number },
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
},
|
||||||
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
);
|
);
|
||||||
|
|||||||
@ -1,99 +0,0 @@
|
|||||||
import {
|
|
||||||
MyBetaModalFormProps,
|
|
||||||
MyButtons,
|
|
||||||
MyColumns,
|
|
||||||
MyProTableProps,
|
|
||||||
} from '@/common';
|
|
||||||
import { MyModal } from '@/components/MyModal';
|
|
||||||
import { Apis } from '@/gen/Apis';
|
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
|
||||||
import { message } from 'antd';
|
|
||||||
import { useRef, useState } from 'react';
|
|
||||||
|
|
||||||
export default function Index(props: MyBetaModalFormProps) {
|
|
||||||
const modalRef: any = useRef(null);
|
|
||||||
const [selectedProjectsIds, setSelectedProjectsIds] = useState<any>([]);
|
|
||||||
const onShowContactPhone = () => {
|
|
||||||
console.log(selectedProjectsIds, 'selectedProjectsIds');
|
|
||||||
Apis.Company.CompanyProjectReceiptAccounts.Store({
|
|
||||||
companies_id: props?.item?.companies_id ?? 0,
|
|
||||||
projects_id: props?.item?.id,
|
|
||||||
receipt_accounts_id: selectedProjectsIds[0],
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
props.reload?.();
|
|
||||||
message.success('收款账号添加成功!');
|
|
||||||
console.log(modalRef, 'modalRef.current');
|
|
||||||
modalRef.current?.close();
|
|
||||||
// todo 关闭页面
|
|
||||||
})
|
|
||||||
.catch(() => false);
|
|
||||||
};
|
|
||||||
console.log(props?.item, '0000');
|
|
||||||
return (
|
|
||||||
<MyModal
|
|
||||||
title={props.title || '查看'}
|
|
||||||
width="800px"
|
|
||||||
myRef={modalRef}
|
|
||||||
trigger={
|
|
||||||
<MyButtons.Default
|
|
||||||
type="primary"
|
|
||||||
size="middle"
|
|
||||||
title={`${props.title}`}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
node={
|
|
||||||
<ProTable
|
|
||||||
{...MyProTableProps.props}
|
|
||||||
request={async (params, sort) =>
|
|
||||||
MyProTableProps.request(
|
|
||||||
{
|
|
||||||
...params,
|
|
||||||
companies_id: props?.item?.companies_id,
|
|
||||||
projects_id: props?.item?.id,
|
|
||||||
},
|
|
||||||
sort,
|
|
||||||
Apis.Company.CompanyReceiptAccounts.List,
|
|
||||||
)
|
|
||||||
}
|
|
||||||
rowSelection={{
|
|
||||||
type: 'radio',
|
|
||||||
onChange: (selectedRowKeys) => {
|
|
||||||
console.log(selectedRowKeys, 'selectedRowKeys');
|
|
||||||
setSelectedProjectsIds(selectedRowKeys);
|
|
||||||
},
|
|
||||||
}}
|
|
||||||
tableAlertOptionRender={() => {
|
|
||||||
return (
|
|
||||||
<MyButtons.Create
|
|
||||||
title="确定添加"
|
|
||||||
type="primary"
|
|
||||||
key="create"
|
|
||||||
onClick={() => onShowContactPhone()}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}}
|
|
||||||
search={false}
|
|
||||||
options={false}
|
|
||||||
columns={[
|
|
||||||
MyColumns.ID(),
|
|
||||||
{
|
|
||||||
title: '收款户名',
|
|
||||||
dataIndex: 'company_name',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '开户行',
|
|
||||||
dataIndex: 'company_bank',
|
|
||||||
search: false,
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '收款账号',
|
|
||||||
dataIndex: 'company_account',
|
|
||||||
search: false,
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -1,216 +0,0 @@
|
|||||||
import {
|
|
||||||
MyBetaModalFormProps,
|
|
||||||
MyButtons,
|
|
||||||
MyModalFormProps,
|
|
||||||
rulesHelper,
|
|
||||||
} from '@/common';
|
|
||||||
import { Selects } from '@/components/Select';
|
|
||||||
import { Apis } from '@/gen/Apis';
|
|
||||||
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
|
|
||||||
import { Form, message } from 'antd';
|
|
||||||
import { useState } from 'react';
|
|
||||||
|
|
||||||
export default function Create(props: MyBetaModalFormProps) {
|
|
||||||
const [form] = Form.useForm();
|
|
||||||
const [transferData, setTransferData] = useState<any[]>([]);
|
|
||||||
const [targetKeys, setTargetKeys] = useState<string[]>([]);
|
|
||||||
|
|
||||||
// 获取Transfer数据源
|
|
||||||
// useEffect(() => {
|
|
||||||
// const asset_projects_id = props?.item?.id || 0;
|
|
||||||
// if (asset_projects_id) {
|
|
||||||
// Apis.Asset.AssetUnits.GridSelect({ asset_projects_id })
|
|
||||||
// .then((res) => {
|
|
||||||
// const data =
|
|
||||||
// res.data?.map((item: any) => ({
|
|
||||||
// key: item.value?.toString(),
|
|
||||||
// title: item.label,
|
|
||||||
// description: item.label,
|
|
||||||
// })) || [];
|
|
||||||
// setTransferData(data);
|
|
||||||
// })
|
|
||||||
// .catch(() => {
|
|
||||||
// setTransferData([]);
|
|
||||||
// });
|
|
||||||
// }
|
|
||||||
// }, [props?.item?.id]);
|
|
||||||
|
|
||||||
return (
|
|
||||||
<BetaSchemaForm<ApiTypes.Grid.Grids.Store>
|
|
||||||
{...MyModalFormProps.props}
|
|
||||||
title={`范围添加`}
|
|
||||||
width="700px"
|
|
||||||
layout="horizontal"
|
|
||||||
labelCol={{ span: 4 }}
|
|
||||||
wrapperCol={{ span: 24 }}
|
|
||||||
labelAlign="right"
|
|
||||||
trigger={
|
|
||||||
<MyButtons.Create
|
|
||||||
title={`${props.title}`}
|
|
||||||
size={props?.item?.size || 'middle'}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
form={form}
|
|
||||||
key={new Date().getTime()}
|
|
||||||
onOpenChange={(open: any) => {
|
|
||||||
if (open) {
|
|
||||||
form.resetFields(); // 清空表单数据
|
|
||||||
form.setFieldsValue({
|
|
||||||
asset_projects_id: props?.item?.id,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onFinish={async (values: any) => {
|
|
||||||
(values.asset_projects_id =
|
|
||||||
values?.asset_projects_id || props?.item?.id),
|
|
||||||
values?.grid_ranges?.map((res: { asset_projects_id: string }) => {
|
|
||||||
res.asset_projects_id = props?.item?.id;
|
|
||||||
});
|
|
||||||
return Apis.Grid.Grids.Store({
|
|
||||||
...values,
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
props.reload?.();
|
|
||||||
message.success('网格添加成功');
|
|
||||||
return true;
|
|
||||||
})
|
|
||||||
.catch(() => false);
|
|
||||||
}}
|
|
||||||
columns={[
|
|
||||||
...(props?.item?.id
|
|
||||||
? []
|
|
||||||
: [
|
|
||||||
Selects?.AssetProjects({
|
|
||||||
key: 'asset_projects_id',
|
|
||||||
title: '选择项目',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
required: true,
|
|
||||||
}),
|
|
||||||
]),
|
|
||||||
|
|
||||||
{
|
|
||||||
valueType: 'dependency',
|
|
||||||
name: ['asset_projects_id'],
|
|
||||||
columns: ({ asset_projects_id }) => {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
valueType: 'group',
|
|
||||||
columns: [
|
|
||||||
Selects?.GetGridMark({
|
|
||||||
key: 'grid_mark',
|
|
||||||
title: '范围标识',
|
|
||||||
params: {
|
|
||||||
asset_projects_id:
|
|
||||||
asset_projects_id || props?.item?.id || 0,
|
|
||||||
},
|
|
||||||
colProps: { span: 24 },
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
}),
|
|
||||||
{
|
|
||||||
valueType: 'formList',
|
|
||||||
dataIndex: 'grid_ranges',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
initialValue: [''],
|
|
||||||
formItemProps: { ...rulesHelper.array },
|
|
||||||
fieldProps: {
|
|
||||||
copyIconProps: false,
|
|
||||||
creatorButtonProps: {
|
|
||||||
creatorButtonText: '添加楼栋单元',
|
|
||||||
},
|
|
||||||
itemRender: (
|
|
||||||
{ listDom, action }: any,
|
|
||||||
{ index }: { index: number },
|
|
||||||
) => {
|
|
||||||
return (
|
|
||||||
<ProCard
|
|
||||||
bordered
|
|
||||||
style={{ marginBlockEnd: 5 }}
|
|
||||||
title={`选择范围${index + 1}`}
|
|
||||||
extra={action}
|
|
||||||
bodyStyle={{ paddingBlockEnd: 0 }}
|
|
||||||
>
|
|
||||||
{listDom}
|
|
||||||
</ProCard>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
columns: [
|
|
||||||
{
|
|
||||||
valueType: 'dependency',
|
|
||||||
name: ['asset_buildings_id', 'asset_units_id'],
|
|
||||||
columns: ({ asset_buildings_id }) => {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
valueType: 'group',
|
|
||||||
columns: [
|
|
||||||
Selects?.AssetBuildings({
|
|
||||||
key: 'asset_buildings_id',
|
|
||||||
title: '选择楼栋',
|
|
||||||
params: {
|
|
||||||
asset_projects_id: props?.item?.id,
|
|
||||||
},
|
|
||||||
colProps: { span: 12 },
|
|
||||||
formItemProps: { ...rulesHelper.number },
|
|
||||||
fieldProps: {
|
|
||||||
showSearch: true,
|
|
||||||
onChange: (value: any) => {
|
|
||||||
// 获取当前表单的所有值
|
|
||||||
const formValues = form.getFieldsValue();
|
|
||||||
const gridRanges =
|
|
||||||
formValues.grid_ranges || [];
|
|
||||||
|
|
||||||
// 清空所有行的asset_units_id,因为楼栋变化会影响所有单元选择
|
|
||||||
const updatedGridRanges = gridRanges.map(
|
|
||||||
(item: any, index: number) => {
|
|
||||||
if (
|
|
||||||
item.asset_buildings_id === value
|
|
||||||
) {
|
|
||||||
return {
|
|
||||||
...item,
|
|
||||||
asset_units_id: undefined,
|
|
||||||
};
|
|
||||||
}
|
|
||||||
return item;
|
|
||||||
},
|
|
||||||
);
|
|
||||||
// 更新表单值
|
|
||||||
form.setFieldsValue({
|
|
||||||
grid_ranges: updatedGridRanges,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
...(asset_buildings_id
|
|
||||||
? [
|
|
||||||
Selects?.GridUnits({
|
|
||||||
key: 'asset_units_id',
|
|
||||||
title: '选择单元',
|
|
||||||
params: {
|
|
||||||
asset_projects_id: props?.item?.id,
|
|
||||||
asset_buildings_id:
|
|
||||||
asset_buildings_id,
|
|
||||||
},
|
|
||||||
colProps: { span: 12 },
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
fieldProps: {
|
|
||||||
showSearch: true,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]
|
|
||||||
: []),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -1,157 +0,0 @@
|
|||||||
import {
|
|
||||||
MyBetaModalFormProps,
|
|
||||||
MyButtons,
|
|
||||||
MyModalFormProps,
|
|
||||||
rulesHelper,
|
|
||||||
} from '@/common';
|
|
||||||
import { Selects } from '@/components/Select';
|
|
||||||
import { Apis } from '@/gen/Apis';
|
|
||||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
|
||||||
import { Form, message } from 'antd';
|
|
||||||
import { useEffect, useState } from 'react';
|
|
||||||
|
|
||||||
export default function Create(props: MyBetaModalFormProps) {
|
|
||||||
const [form] = Form.useForm();
|
|
||||||
const [transferData, setTransferData] = useState<any[]>([]);
|
|
||||||
const [targetKeys, setTargetKeys] = useState<string[]>([]);
|
|
||||||
|
|
||||||
// 获取Transfer数据源
|
|
||||||
useEffect(() => {
|
|
||||||
const asset_projects_id = props?.item?.id || 0;
|
|
||||||
if (asset_projects_id) {
|
|
||||||
Apis.Asset.AssetUnits.GridSelect({ asset_projects_id })
|
|
||||||
.then((res) => {
|
|
||||||
const data =
|
|
||||||
res.data?.map((item: any) => ({
|
|
||||||
key: item.value?.toString(),
|
|
||||||
title: item.label,
|
|
||||||
description: item.label,
|
|
||||||
})) || [];
|
|
||||||
setTransferData(data);
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
setTransferData([]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, [props?.item?.id]);
|
|
||||||
|
|
||||||
console.log(props.item, 'pppp');
|
|
||||||
return (
|
|
||||||
<BetaSchemaForm<ApiTypes.Grid.Grids.Store>
|
|
||||||
{...MyModalFormProps.props}
|
|
||||||
title={`范围添加`}
|
|
||||||
width="700px"
|
|
||||||
layout="horizontal"
|
|
||||||
labelCol={{ span: 4 }}
|
|
||||||
wrapperCol={{ span: 24 }}
|
|
||||||
labelAlign="right"
|
|
||||||
trigger={
|
|
||||||
<MyButtons.Create
|
|
||||||
title={`${props.title}`}
|
|
||||||
size={props?.item?.size || 'middle'}
|
|
||||||
/>
|
|
||||||
}
|
|
||||||
form={form}
|
|
||||||
key={new Date().getTime()}
|
|
||||||
onOpenChange={(open: any) => {
|
|
||||||
if (open) {
|
|
||||||
form.resetFields(); // 清空表单数据
|
|
||||||
form.setFieldsValue({
|
|
||||||
asset_projects_id: props?.item?.id,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onFinish={async (values: any) => {
|
|
||||||
values?.grid_ranges?.map((res: { asset_projects_id: string }) => {
|
|
||||||
res.asset_projects_id = props?.item?.id;
|
|
||||||
});
|
|
||||||
return Apis.Grid.Grids.Store({
|
|
||||||
...values,
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
props.reload?.();
|
|
||||||
message.success('网格添加成功');
|
|
||||||
return true;
|
|
||||||
})
|
|
||||||
.catch(() => false);
|
|
||||||
}}
|
|
||||||
columns={[
|
|
||||||
...(props?.item?.id
|
|
||||||
? []
|
|
||||||
: [
|
|
||||||
Selects?.AssetProjects({
|
|
||||||
key: 'asset_projects_id',
|
|
||||||
title: '选择项目',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
required: true,
|
|
||||||
}),
|
|
||||||
]),
|
|
||||||
|
|
||||||
{
|
|
||||||
valueType: 'dependency',
|
|
||||||
name: ['asset_projects_id'],
|
|
||||||
columns: ({ asset_projects_id }) => {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
valueType: 'group',
|
|
||||||
columns: [
|
|
||||||
Selects?.GetGridMark({
|
|
||||||
key: 'grid_mark',
|
|
||||||
title: '范围标识',
|
|
||||||
params: {
|
|
||||||
asset_projects_id:
|
|
||||||
asset_projects_id || props?.item?.id || 0,
|
|
||||||
},
|
|
||||||
colProps: { span: 24 },
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
}),
|
|
||||||
Selects?.GridUnits({
|
|
||||||
key: 'grid_units_id',
|
|
||||||
title: '选择单元',
|
|
||||||
params: {
|
|
||||||
asset_projects_id:
|
|
||||||
asset_projects_id || props?.item?.id || 0,
|
|
||||||
},
|
|
||||||
colProps: { span: 24 },
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
}),
|
|
||||||
// {
|
|
||||||
// valueType: 'formItem',
|
|
||||||
// dataIndex: 'grid_units_id',
|
|
||||||
// title: '选择单元',
|
|
||||||
// colProps: { span: 24 },
|
|
||||||
// formItemProps: { ...rulesHelper.text },
|
|
||||||
// renderFormItem: () => (
|
|
||||||
// <Transfer
|
|
||||||
// dataSource={transferData}
|
|
||||||
// targetKeys={targetKeys}
|
|
||||||
// onChange={(nextTargetKeys) => {
|
|
||||||
// setTargetKeys(nextTargetKeys as string[]);
|
|
||||||
// form.setFieldValue('grid_units_id', nextTargetKeys);
|
|
||||||
// }}
|
|
||||||
// render={(item) => item.title}
|
|
||||||
// titles={['可选单元', '已选单元']}
|
|
||||||
// showSearch
|
|
||||||
// listStyle={{
|
|
||||||
// width: 250,
|
|
||||||
// height: 300,
|
|
||||||
// }}
|
|
||||||
// operations={['选择', '移除']}
|
|
||||||
// locale={{
|
|
||||||
// itemUnit: '项',
|
|
||||||
// itemsUnit: '项',
|
|
||||||
// searchPlaceholder: '请输入搜索内容',
|
|
||||||
// notFoundContent: '列表为空',
|
|
||||||
// }}
|
|
||||||
// />
|
|
||||||
// ),
|
|
||||||
// },
|
|
||||||
],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -5,45 +5,21 @@ import {
|
|||||||
rulesHelper,
|
rulesHelper,
|
||||||
} from '@/common';
|
} from '@/common';
|
||||||
import { Selects } from '@/components/Select';
|
import { Selects } from '@/components/Select';
|
||||||
|
import MyTransferUnits from '@/components/TransferUnits';
|
||||||
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 { Form, message, Transfer } from 'antd';
|
import { Form, message } from 'antd';
|
||||||
import { useEffect, useState } from 'react';
|
|
||||||
|
|
||||||
export default function Create(props: MyBetaModalFormProps) {
|
export default function Create(props: MyBetaModalFormProps) {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
const [transferData, setTransferData] = useState<any[]>([]);
|
|
||||||
const [targetKeys, setTargetKeys] = useState<string[]>([]);
|
|
||||||
|
|
||||||
// 获取Transfer数据源
|
|
||||||
useEffect(() => {
|
|
||||||
const asset_projects_id = props?.item?.id || 0;
|
|
||||||
if (asset_projects_id) {
|
|
||||||
Apis.Asset.AssetUnits.GridSelect({ asset_projects_id })
|
|
||||||
.then((res) => {
|
|
||||||
const data =
|
|
||||||
res.data?.map((item: any) => ({
|
|
||||||
key: item.value?.toString(),
|
|
||||||
title: item?.asset_building?.name + item.label,
|
|
||||||
})) || [];
|
|
||||||
setTransferData(data);
|
|
||||||
})
|
|
||||||
.catch(() => {
|
|
||||||
setTransferData([]);
|
|
||||||
});
|
|
||||||
}
|
|
||||||
}, [props?.item?.id]);
|
|
||||||
|
|
||||||
console.log(props.item, 'pppp');
|
console.log(props.item, 'pppp');
|
||||||
return (
|
return (
|
||||||
<BetaSchemaForm<ApiTypes.Grid.Grids.Store>
|
<BetaSchemaForm<ApiTypes.Grid.Grids.Store>
|
||||||
{...MyModalFormProps.props}
|
{...MyModalFormProps.props}
|
||||||
title={`范围添加`}
|
title={`范围添加`}
|
||||||
width="700px"
|
width="800px"
|
||||||
layout="horizontal"
|
layout="horizontal"
|
||||||
labelCol={{ span: 4 }}
|
|
||||||
wrapperCol={{ span: 24 }}
|
|
||||||
labelAlign="right"
|
|
||||||
trigger={
|
trigger={
|
||||||
<MyButtons.Create
|
<MyButtons.Create
|
||||||
title={`${props.title}`}
|
title={`${props.title}`}
|
||||||
@ -61,23 +37,15 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
onFinish={async (values: any) => {
|
onFinish={async (values: any) => {
|
||||||
(values.asset_projects_id =
|
|
||||||
values?.asset_projects_id || props?.item?.id),
|
|
||||||
values?.grid_ranges?.map((res: { asset_projects_id: string }) => {
|
|
||||||
res.asset_projects_id = props?.item?.id;
|
|
||||||
});
|
|
||||||
return Apis.Grid.Grids.Store({
|
return Apis.Grid.Grids.Store({
|
||||||
|
asset_projects_id: props?.item?.id || values?.asset_projects_id,
|
||||||
...values,
|
...values,
|
||||||
})
|
}).then(() => {
|
||||||
.then(() => {
|
props.reload?.();
|
||||||
props.reload?.();
|
message.success('网格添加成功');
|
||||||
message.success('网格添加成功');
|
return true;
|
||||||
return true;
|
});
|
||||||
})
|
|
||||||
.catch(() => false);
|
|
||||||
}}
|
}}
|
||||||
submitter={false}
|
|
||||||
footer={[<MyButtons.Default key="submit" title="添加" />]}
|
|
||||||
columns={[
|
columns={[
|
||||||
...(props?.item?.id
|
...(props?.item?.id
|
||||||
? []
|
? []
|
||||||
@ -107,45 +75,19 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
colProps: { span: 24 },
|
colProps: { span: 24 },
|
||||||
formItemProps: { ...rulesHelper.text },
|
formItemProps: { ...rulesHelper.text },
|
||||||
}),
|
}),
|
||||||
|
|
||||||
{
|
{
|
||||||
valueType: 'formItem',
|
key: 'grid_ranges',
|
||||||
dataIndex: 'grid_units_id',
|
|
||||||
title: '选择单元',
|
title: '选择单元',
|
||||||
colProps: { span: 24 },
|
colProps: { span: 24 },
|
||||||
formItemProps: { ...rulesHelper.text },
|
formItemProps: { ...rulesHelper.array },
|
||||||
renderFormItem: () => (
|
renderFormItem: () => (
|
||||||
<div onClick={(e) => e.stopPropagation()}>
|
<MyTransferUnits
|
||||||
<Transfer
|
item={{
|
||||||
dataSource={transferData}
|
asset_projects_id:
|
||||||
targetKeys={targetKeys}
|
props?.item?.id || asset_projects_id,
|
||||||
onChange={(nextTargetKeys) => {
|
type: 1,
|
||||||
setTargetKeys(nextTargetKeys as string[]);
|
}}
|
||||||
form.setFieldValue('grid_units_id', nextTargetKeys);
|
/>
|
||||||
}}
|
|
||||||
render={(item) => item.title}
|
|
||||||
titles={['可选单元', '已选单元']}
|
|
||||||
showSearch
|
|
||||||
listStyle={{
|
|
||||||
width: 250,
|
|
||||||
height: 300,
|
|
||||||
}}
|
|
||||||
operations={['选择', '移除']}
|
|
||||||
operationStyle={{ marginTop: 20 }}
|
|
||||||
locale={{
|
|
||||||
itemUnit: '项',
|
|
||||||
itemsUnit: '项',
|
|
||||||
searchPlaceholder: '请输入搜索内容',
|
|
||||||
notFoundContent: '列表为空',
|
|
||||||
}}
|
|
||||||
onSelectChange={(
|
|
||||||
sourceSelectedKeys,
|
|
||||||
targetSelectedKeys,
|
|
||||||
) => {
|
|
||||||
// 处理选择变化,但不触发表单提交
|
|
||||||
}}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
),
|
),
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
|
|||||||
@ -5,13 +5,13 @@ import {
|
|||||||
rulesHelper,
|
rulesHelper,
|
||||||
} from '@/common';
|
} from '@/common';
|
||||||
import { Selects } from '@/components/Select';
|
import { Selects } from '@/components/Select';
|
||||||
|
import MyTransferUnits from '@/components/TransferUnits';
|
||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import { BetaSchemaForm, ProCard } from '@ant-design/pro-components';
|
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||||
import { Form, message } from 'antd';
|
import { Form, message } from 'antd';
|
||||||
|
|
||||||
export default function Update(props: MyBetaModalFormProps) {
|
export default function Update(props: MyBetaModalFormProps) {
|
||||||
const [form] = Form.useForm();
|
const [form] = Form.useForm();
|
||||||
console.log(props.item, 'pppp');
|
|
||||||
return (
|
return (
|
||||||
<BetaSchemaForm<ApiTypes.Grid.Grids.Update>
|
<BetaSchemaForm<ApiTypes.Grid.Grids.Update>
|
||||||
{...MyModalFormProps.props}
|
{...MyModalFormProps.props}
|
||||||
@ -26,17 +26,25 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
key={new Date().getTime()}
|
key={new Date().getTime()}
|
||||||
onOpenChange={(open: any) => {
|
onOpenChange={(open: any) => {
|
||||||
if (open) {
|
if (open) {
|
||||||
|
let arr: any = [];
|
||||||
Apis.Grid.Grids.Show({ id: props?.item?.id }).then((res) => {
|
Apis.Grid.Grids.Show({ id: props?.item?.id }).then((res) => {
|
||||||
form.setFieldsValue(res?.data);
|
if (res?.data?.grid_ranges) {
|
||||||
|
res?.data?.grid_ranges?.forEach((k: any) => {
|
||||||
|
arr.push(k.asset_units_id);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
form.setFieldsValue({ ...res?.data, grid_ranges: arr });
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
onFinish={async (values: any) => {
|
onFinish={async (values: any) => {
|
||||||
values?.grid_ranges?.map((res: { asset_projects_id: string }) => {
|
console.log(values);
|
||||||
res.asset_projects_id = props?.item?.id;
|
// values?.grid_ranges?.map((res: { asset_projects_id: string }) => {
|
||||||
});
|
// res.asset_projects_id = props?.item?.id;
|
||||||
|
// });
|
||||||
return Apis.Grid.Grids.Update({
|
return Apis.Grid.Grids.Update({
|
||||||
...values,
|
...values,
|
||||||
|
asset_projects_id: props?.item?.id || values?.asset_projects_id,
|
||||||
id: props?.item?.id,
|
id: props?.item?.id,
|
||||||
})
|
})
|
||||||
.then(() => {
|
.then(() => {
|
||||||
@ -57,96 +65,17 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
formItemProps: { ...rulesHelper.text },
|
formItemProps: { ...rulesHelper.text },
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
valueType: 'formList',
|
key: 'grid_ranges',
|
||||||
dataIndex: 'grid_ranges',
|
title: '选择单元',
|
||||||
colProps: { span: 24 },
|
colProps: { span: 24 },
|
||||||
initialValue: [''],
|
|
||||||
formItemProps: { ...rulesHelper.array },
|
formItemProps: { ...rulesHelper.array },
|
||||||
fieldProps: {
|
renderFormItem: () => (
|
||||||
copyIconProps: false,
|
<MyTransferUnits
|
||||||
creatorButtonProps: {
|
item={{
|
||||||
creatorButtonText: '添加楼栋单元',
|
asset_projects_id: props?.item?.asset_projects_id,
|
||||||
},
|
}}
|
||||||
itemRender: (
|
/>
|
||||||
{ listDom, action }: any,
|
),
|
||||||
{ index }: { index: number },
|
|
||||||
) => {
|
|
||||||
return (
|
|
||||||
<ProCard
|
|
||||||
bordered
|
|
||||||
style={{ marginBlockEnd: 5 }}
|
|
||||||
title={`选择范围${index + 1}`}
|
|
||||||
extra={action}
|
|
||||||
bodyStyle={{ paddingBlockEnd: 0 }}
|
|
||||||
>
|
|
||||||
{listDom}
|
|
||||||
</ProCard>
|
|
||||||
);
|
|
||||||
},
|
|
||||||
},
|
|
||||||
columns: [
|
|
||||||
{
|
|
||||||
valueType: 'dependency',
|
|
||||||
name: ['asset_buildings_id', 'asset_units_id'],
|
|
||||||
columns: ({ asset_buildings_id }) => {
|
|
||||||
return [
|
|
||||||
{
|
|
||||||
valueType: 'group',
|
|
||||||
columns: [
|
|
||||||
Selects?.AssetBuildings({
|
|
||||||
key: 'asset_buildings_id',
|
|
||||||
title: '选择楼栋',
|
|
||||||
params: {
|
|
||||||
asset_projects_id: props?.item?.id,
|
|
||||||
},
|
|
||||||
colProps: { span: 12 },
|
|
||||||
formItemProps: { ...rulesHelper.number },
|
|
||||||
fieldProps: {
|
|
||||||
showSearch: true,
|
|
||||||
onChange: (value: any) => {
|
|
||||||
// 获取当前表单的所有值
|
|
||||||
const formValues = form.getFieldsValue();
|
|
||||||
const gridRanges = formValues.grid_ranges || [];
|
|
||||||
|
|
||||||
// 清空所有行的asset_units_id,因为楼栋变化会影响所有单元选择
|
|
||||||
const updatedGridRanges = gridRanges.map(
|
|
||||||
(item: any, index: number) => {
|
|
||||||
if (item.asset_buildings_id === value) {
|
|
||||||
return { ...item, asset_units_id: undefined };
|
|
||||||
}
|
|
||||||
return item;
|
|
||||||
},
|
|
||||||
);
|
|
||||||
// 更新表单值
|
|
||||||
form.setFieldsValue({
|
|
||||||
grid_ranges: updatedGridRanges,
|
|
||||||
});
|
|
||||||
},
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
...(asset_buildings_id
|
|
||||||
? [
|
|
||||||
Selects?.GridUnits({
|
|
||||||
key: 'asset_units_id',
|
|
||||||
title: '选择单元',
|
|
||||||
params: {
|
|
||||||
asset_projects_id: props?.item?.id,
|
|
||||||
asset_buildings_id: asset_buildings_id,
|
|
||||||
},
|
|
||||||
colProps: { span: 12 },
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
fieldProps: {
|
|
||||||
showSearch: true,
|
|
||||||
},
|
|
||||||
}),
|
|
||||||
]
|
|
||||||
: []),
|
|
||||||
],
|
|
||||||
},
|
|
||||||
];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
/>
|
/>
|
||||||
|
|||||||
@ -10,8 +10,8 @@ import { AssetProjectsPropertyTypeEnum } from '@/gen/Enums';
|
|||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
import { useNavigate } from 'react-router-dom';
|
import { useNavigate } from 'react-router-dom';
|
||||||
import AssetInfo from './components/AssetInfo';
|
|
||||||
import AssetCreate from './modals/AssetCreate';
|
import AssetCreate from './modals/AssetCreate';
|
||||||
|
import AssetInfo from './modals/AssetInfo';
|
||||||
import AssetUpdate from './modals/AssetUpdate';
|
import AssetUpdate from './modals/AssetUpdate';
|
||||||
|
|
||||||
export default function Index({ title = '项目列表' }) {
|
export default function Index({ title = '项目列表' }) {
|
||||||
|
|||||||
@ -14,11 +14,16 @@ export default function AssetInfo(props: MyBetaModalFormProps) {
|
|||||||
<MyModal
|
<MyModal
|
||||||
title={props.title || '查看'}
|
title={props.title || '查看'}
|
||||||
type={props.item?.type || 'primary'}
|
type={props.item?.type || 'primary'}
|
||||||
width="920px"
|
width="800px"
|
||||||
node={
|
node={
|
||||||
<Space direction="vertical" style={{ width: '100%' }}>
|
<Space direction="vertical" style={{ width: '100%' }}>
|
||||||
<ProCard extra={props.extra}>
|
<ProCard extra={props.extra}>
|
||||||
<ProDescriptions bordered>
|
<ProDescriptions bordered column={2}>
|
||||||
|
<ProDescriptions.Item label="关联机构" span={2}>
|
||||||
|
<Space size="large">
|
||||||
|
<div>{props?.item?.company?.name}</div>
|
||||||
|
</Space>
|
||||||
|
</ProDescriptions.Item>
|
||||||
<ProDescriptions.Item label="项目名称" span={2}>
|
<ProDescriptions.Item label="项目名称" span={2}>
|
||||||
<Space size="large">
|
<Space size="large">
|
||||||
<div>
|
<div>
|
||||||
@ -29,12 +34,6 @@ export default function AssetInfo(props: MyBetaModalFormProps) {
|
|||||||
</div>
|
</div>
|
||||||
</Space>
|
</Space>
|
||||||
</ProDescriptions.Item>
|
</ProDescriptions.Item>
|
||||||
<ProDescriptions.Item label="关联机构">
|
|
||||||
<Space size="large">
|
|
||||||
<div>{props?.item?.company?.name}</div>
|
|
||||||
</Space>
|
|
||||||
</ProDescriptions.Item>
|
|
||||||
|
|
||||||
<ProDescriptions.Item label="项目地址" span={2}>
|
<ProDescriptions.Item label="项目地址" span={2}>
|
||||||
{props?.item?.province || ''}
|
{props?.item?.province || ''}
|
||||||
{props?.item?.city || ''}
|
{props?.item?.city || ''}
|
||||||
@ -77,9 +76,9 @@ export default function AssetInfo(props: MyBetaModalFormProps) {
|
|||||||
{props?.item?.closure_date}
|
{props?.item?.closure_date}
|
||||||
</ProDescriptions.Item>
|
</ProDescriptions.Item>
|
||||||
|
|
||||||
{/* <ProDescriptions.Item label="创建日期">
|
<ProDescriptions.Item label="创建日期">
|
||||||
{props?.item?.created_at}
|
{props?.item?.created_at}
|
||||||
</ProDescriptions.Item> */}
|
</ProDescriptions.Item>
|
||||||
<ProDescriptions.Item label="最近修改">
|
<ProDescriptions.Item label="最近修改">
|
||||||
{props?.item?.updated_at}
|
{props?.item?.updated_at}
|
||||||
</ProDescriptions.Item>
|
</ProDescriptions.Item>
|
||||||
@ -4,15 +4,15 @@ import { ProCard } from '@ant-design/pro-components';
|
|||||||
import { useParams } from '@umijs/max';
|
import { useParams } from '@umijs/max';
|
||||||
import { Space, Tabs } from 'antd';
|
import { Space, Tabs } from 'antd';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import Announcement from '../components/Announcement';
|
import AssetInfo from '../modals/AssetInfo';
|
||||||
import AssetAccounts from '../components/AssetAccounts';
|
|
||||||
import MyAssetBuildings from '../components/AssetBuildings';
|
|
||||||
import AssetGrid from '../components/AssetGrid';
|
|
||||||
import AssetInfo from '../components/AssetInfo';
|
|
||||||
import ChargeStandard from '../components/ChargeStandard';
|
|
||||||
import ConvenienceServices from '../components/ConvenienceServices';
|
|
||||||
import BindCompany from '../components/modals/BindCompany';
|
|
||||||
import AssetUpdate from '../modals/AssetUpdate';
|
import AssetUpdate from '../modals/AssetUpdate';
|
||||||
|
import BindCompany from '../modals/BindCompany';
|
||||||
|
import Announcement from '../table/Announcement';
|
||||||
|
import AssetAccounts from '../table/AssetAccounts';
|
||||||
|
import MyAssetBuildings from '../table/AssetBuildings';
|
||||||
|
import AssetGrid from '../table/AssetGrid';
|
||||||
|
import ChargeStandard from '../table/ChargeStandard';
|
||||||
|
import ConvenienceServices from '../table/ConvenienceServices';
|
||||||
|
|
||||||
export default function Show({ title }: { title?: string } = {}) {
|
export default function Show({ title }: { title?: string } = {}) {
|
||||||
const { id } = useParams<{ id: string }>();
|
const { id } = useParams<{ id: string }>();
|
||||||
|
|||||||
@ -7,7 +7,7 @@ import {
|
|||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
import AccountsSelect from '../../accounts/modals/AccountsSelect';
|
import AccountsGet from '../../accounts/modals/AccountsGet';
|
||||||
|
|
||||||
export default function ReceiptAccounts(props: MyBetaModalFormProps) {
|
export default function ReceiptAccounts(props: MyBetaModalFormProps) {
|
||||||
return (
|
return (
|
||||||
@ -27,7 +27,7 @@ export default function ReceiptAccounts(props: MyBetaModalFormProps) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
toolBarRender={(action) => [
|
toolBarRender={(action) => [
|
||||||
<AccountsSelect
|
<AccountsGet
|
||||||
key="Select"
|
key="Select"
|
||||||
reload={action?.reload}
|
reload={action?.reload}
|
||||||
item={props?.item}
|
item={props?.item}
|
||||||
@ -10,14 +10,18 @@ import {
|
|||||||
HouseChargeStandardsCalculationMethodEnum,
|
HouseChargeStandardsCalculationMethodEnum,
|
||||||
HouseChargeStandardsCalculationModeEnum,
|
HouseChargeStandardsCalculationModeEnum,
|
||||||
HouseChargeStandardsCalculationPeriodEnum,
|
HouseChargeStandardsCalculationPeriodEnum,
|
||||||
|
HouseChargeStandardsPriceAlgorithmEnum,
|
||||||
} from '@/gen/Enums';
|
} from '@/gen/Enums';
|
||||||
|
import ChargeStandardCreate from '@/pages/house_charge_standard/modals/ChargeStandardCreate';
|
||||||
|
import ChargeStandardHasHouse from '@/pages/house_charge_standard/modals/ChargeStandardHasHouse';
|
||||||
|
import ChargeStandardUpdate from '@/pages/house_charge_standard/modals/ChargeStandardUpdate';
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
|
import { useNavigate } from '@umijs/max';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
import ChargeStandardCreate from './modals/ChargeStandardCreate';
|
|
||||||
import ChargeStandardHasHouse from './modals/ChargeStandardHasHouse';
|
|
||||||
import ChargeStandardUpdate from './modals/ChargeStandardUpdate';
|
|
||||||
|
|
||||||
export default function ReceiptAccounts(props: MyBetaModalFormProps) {
|
export default function ReceiptAccounts(props: MyBetaModalFormProps) {
|
||||||
|
const navigate = useNavigate();
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
<ProTable
|
<ProTable
|
||||||
@ -43,20 +47,16 @@ export default function ReceiptAccounts(props: MyBetaModalFormProps) {
|
|||||||
]}
|
]}
|
||||||
// options={false}
|
// options={false}
|
||||||
columns={[
|
columns={[
|
||||||
|
MyColumns.ID(),
|
||||||
{
|
{
|
||||||
title: 'ID',
|
title: '收费名称',
|
||||||
dataIndex: 'id',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
title: '收费标准名称',
|
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
search: false,
|
search: false,
|
||||||
},
|
},
|
||||||
MyColumns.EnumTag({
|
MyColumns.EnumTag({
|
||||||
title: '收费项目',
|
title: '收费项',
|
||||||
dataIndex: 'charge_type',
|
dataIndex: 'charge_type',
|
||||||
valueEnum: HouseBillsTypeEnum,
|
valueEnum: HouseBillsTypeEnum,
|
||||||
search: false,
|
|
||||||
}),
|
}),
|
||||||
MyColumns.EnumTag({
|
MyColumns.EnumTag({
|
||||||
title: '计量单位',
|
title: '计量单位',
|
||||||
@ -70,10 +70,32 @@ export default function ReceiptAccounts(props: MyBetaModalFormProps) {
|
|||||||
valueEnum: HouseChargeStandardsCalculationModeEnum,
|
valueEnum: HouseChargeStandardsCalculationModeEnum,
|
||||||
search: false,
|
search: false,
|
||||||
}),
|
}),
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '计费算法',
|
||||||
|
dataIndex: 'price_algorithm',
|
||||||
|
valueEnum: HouseChargeStandardsPriceAlgorithmEnum,
|
||||||
|
search: false,
|
||||||
|
}),
|
||||||
{
|
{
|
||||||
title: '单价',
|
title: '价格',
|
||||||
dataIndex: 'price',
|
dataIndex: 'price',
|
||||||
search: false,
|
search: false,
|
||||||
|
render(_, record) {
|
||||||
|
if (record?.price_algorithm === 'Fixed') {
|
||||||
|
return record?.price;
|
||||||
|
} else {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{record?.tiered_rates?.map((rate: any, index: number) => (
|
||||||
|
<div key={index}>
|
||||||
|
{rate?.min_quantity} - {rate?.max_quantity} :
|
||||||
|
{rate?.price}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
MyColumns.EnumTag({
|
MyColumns.EnumTag({
|
||||||
title: '账单计费周期',
|
title: '账单计费周期',
|
||||||
@ -94,12 +116,17 @@ export default function ReceiptAccounts(props: MyBetaModalFormProps) {
|
|||||||
return `${record?.is_apportionment ? '是' : '否'} `;
|
return `${record?.is_apportionment ? '是' : '否'} `;
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
// MyColumns.UpdatedAt(),
|
// MyColumns.UpdatedAt(),
|
||||||
// MyColumns.CreatedAt(),
|
// MyColumns.CreatedAt(),
|
||||||
MyColumns.Option({
|
MyColumns.Option({
|
||||||
render: (_, item: any, index, action) => (
|
render: (_, item: any, index, action) => (
|
||||||
<Space key={index}>
|
<Space key={index}>
|
||||||
|
<MyButtons.View
|
||||||
|
title="查看"
|
||||||
|
onClick={() => {
|
||||||
|
navigate(`/house_charge_standard/show/${item.id}`);
|
||||||
|
}}
|
||||||
|
/>
|
||||||
<ChargeStandardUpdate
|
<ChargeStandardUpdate
|
||||||
item={item}
|
item={item}
|
||||||
reload={action?.reload}
|
reload={action?.reload}
|
||||||
@ -1,6 +1,7 @@
|
|||||||
import {
|
import {
|
||||||
MyButtons,
|
MyButtons,
|
||||||
MyColumns,
|
MyColumns,
|
||||||
|
MyImportModal,
|
||||||
MyPageContainer,
|
MyPageContainer,
|
||||||
MyProTableProps,
|
MyProTableProps,
|
||||||
usePageTabs,
|
usePageTabs,
|
||||||
@ -8,6 +9,7 @@ import {
|
|||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
|
import Change from './modals/Change';
|
||||||
import EmployeeCreate from './modals/EmployeeCreate';
|
import EmployeeCreate from './modals/EmployeeCreate';
|
||||||
import EmployeeUpdate from './modals/EmployeeUpdate';
|
import EmployeeUpdate from './modals/EmployeeUpdate';
|
||||||
|
|
||||||
@ -37,6 +39,15 @@ export default function Index({ title = '员工管理' }) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
toolBarRender={(action) => [
|
toolBarRender={(action) => [
|
||||||
|
<MyImportModal
|
||||||
|
key="ImportHouse"
|
||||||
|
title="批量导入"
|
||||||
|
type="danger"
|
||||||
|
size="middle"
|
||||||
|
templateApi={Apis.Company.CompanyEmployees.DownloadTemplate}
|
||||||
|
importApi={Apis.Company.CompanyEmployees.Import}
|
||||||
|
reload={action?.reload}
|
||||||
|
/>,
|
||||||
<EmployeeCreate key="Create" reload={action?.reload} title="员工" />,
|
<EmployeeCreate key="Create" reload={action?.reload} title="员工" />,
|
||||||
]}
|
]}
|
||||||
columns={[
|
columns={[
|
||||||
@ -78,6 +89,7 @@ export default function Index({ title = '员工管理' }) {
|
|||||||
reload={action?.reload}
|
reload={action?.reload}
|
||||||
title={title}
|
title={title}
|
||||||
/>
|
/>
|
||||||
|
<Change item={item} reload={action?.reload} title={title} />
|
||||||
<MyButtons.Delete
|
<MyButtons.Delete
|
||||||
onConfirm={() =>
|
onConfirm={() =>
|
||||||
Apis.Common.Admins.Delete({ id: item.id }).then(() =>
|
Apis.Common.Admins.Delete({ id: item.id }).then(() =>
|
||||||
|
|||||||
58
src/pages/company/employees/modals/Change.tsx
Normal file
58
src/pages/company/employees/modals/Change.tsx
Normal file
@ -0,0 +1,58 @@
|
|||||||
|
import {
|
||||||
|
MyBetaModalFormProps,
|
||||||
|
MyButtons,
|
||||||
|
MyModalFormProps,
|
||||||
|
rulesHelper,
|
||||||
|
} from '@/common';
|
||||||
|
|
||||||
|
import { Selects } from '@/components/Select';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||||
|
import { Form, message } from 'antd';
|
||||||
|
export default function Update(props: MyBetaModalFormProps) {
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
return (
|
||||||
|
<BetaSchemaForm<ApiTypes.Company.CompanyEmployees.Update>
|
||||||
|
{...MyModalFormProps.props}
|
||||||
|
title={`组织调整`}
|
||||||
|
trigger={<MyButtons.Default title="组织调整" type="link" />}
|
||||||
|
wrapperCol={{ span: 24 }}
|
||||||
|
width="500px"
|
||||||
|
key={new Date().getTime()}
|
||||||
|
form={form}
|
||||||
|
onOpenChange={(open: any) => {
|
||||||
|
if (open) {
|
||||||
|
form.resetFields(); // 清空表单数据
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onFinish={async (values: any) =>
|
||||||
|
Apis.Company.CompanyEmployees.Update({
|
||||||
|
...values,
|
||||||
|
id: props.item?.id ?? 0,
|
||||||
|
name: props.item?.name ?? '',
|
||||||
|
phone: props.item?.phone ?? '',
|
||||||
|
organizations_id:
|
||||||
|
values?.organizations_id?.[values.organizations_id.length - 1],
|
||||||
|
})
|
||||||
|
.then(() => {
|
||||||
|
props.reload?.();
|
||||||
|
message.success(props.title + '成功');
|
||||||
|
return true;
|
||||||
|
})
|
||||||
|
.catch(() => false)
|
||||||
|
}
|
||||||
|
columns={[
|
||||||
|
Selects?.OrganizationsTree({
|
||||||
|
title: '选择组织',
|
||||||
|
key: 'organizations_id',
|
||||||
|
params: { companies_id: props?.item?.companies_id },
|
||||||
|
colProps: { span: 24 },
|
||||||
|
fieldProps: {
|
||||||
|
showSearch: true,
|
||||||
|
},
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
}),
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -49,15 +49,35 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
title: '公司',
|
title: '公司',
|
||||||
colProps: { span: 24 },
|
colProps: { span: 24 },
|
||||||
required: true,
|
required: true,
|
||||||
|
fieldProps: {
|
||||||
|
onChange: (val: any) => {
|
||||||
|
form.setFieldsValue({
|
||||||
|
organizations_id: undefined,
|
||||||
|
positions_id: undefined,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
]),
|
]),
|
||||||
Selects?.OrganizationsTree({
|
|
||||||
title: '选择组织',
|
{
|
||||||
key: 'organizations_id',
|
valueType: 'dependency',
|
||||||
params: { companies_id: props?.item?.companies_id },
|
name: ['companies_id'],
|
||||||
colProps: { span: 24 },
|
columns: ({ companies_id }) => {
|
||||||
formItemProps: { ...rulesHelper.text },
|
return [
|
||||||
}),
|
Selects?.OrganizationsTree({
|
||||||
|
title: '选择组织',
|
||||||
|
key: 'organizations_id',
|
||||||
|
params: {
|
||||||
|
companies_id: companies_id || props?.item?.companies_id || 0,
|
||||||
|
},
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
key: 'name',
|
key: 'name',
|
||||||
title: '姓名',
|
title: '姓名',
|
||||||
@ -81,12 +101,23 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
valueEnum: SexEnum,
|
valueEnum: SexEnum,
|
||||||
required: true,
|
required: true,
|
||||||
}),
|
}),
|
||||||
Selects?.Positions({
|
{
|
||||||
title: '岗位',
|
valueType: 'dependency',
|
||||||
params: { companies_id: props?.item?.companies_id },
|
name: ['companies_id'],
|
||||||
key: 'positions_id',
|
columns: ({ companies_id }) => {
|
||||||
formItemProps: { ...rulesHelper.text },
|
return [
|
||||||
}),
|
Selects?.Positions({
|
||||||
|
title: '岗位',
|
||||||
|
params: {
|
||||||
|
companies_id: companies_id || props?.item?.companies_id || 0,
|
||||||
|
},
|
||||||
|
key: 'positions_id',
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
// {
|
// {
|
||||||
// key: 'password',
|
// key: 'password',
|
||||||
// title: '密码',
|
// title: '密码',
|
||||||
|
|||||||
@ -46,16 +46,6 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
.catch(() => false)
|
.catch(() => false)
|
||||||
}
|
}
|
||||||
columns={[
|
columns={[
|
||||||
Selects?.OrganizationsTree({
|
|
||||||
title: '选择组织',
|
|
||||||
key: 'organizations_id',
|
|
||||||
params: { companies_id: props?.item?.companies_id },
|
|
||||||
colProps: { span: 24 },
|
|
||||||
fieldProps: {
|
|
||||||
showSearch: true,
|
|
||||||
},
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
}),
|
|
||||||
{
|
{
|
||||||
key: 'name',
|
key: 'name',
|
||||||
title: '姓名',
|
title: '姓名',
|
||||||
|
|||||||
@ -77,7 +77,7 @@ export default function Index(props: MyBetaModalFormProps) {
|
|||||||
<MyButtons.View
|
<MyButtons.View
|
||||||
title="详情"
|
title="详情"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
navigate(`/asset/${item.id}`);
|
navigate(`/asset/list/show/${item.id}`);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
</Space>
|
</Space>
|
||||||
|
|||||||
@ -48,13 +48,13 @@ export default function Index({ title = '组织列表' }) {
|
|||||||
]}
|
]}
|
||||||
columns={[
|
columns={[
|
||||||
{
|
{
|
||||||
title: '机构',
|
title: '组织ID',
|
||||||
dataIndex: ['company', 'name'],
|
dataIndex: 'id',
|
||||||
search: false,
|
search: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '组织ID',
|
title: '机构',
|
||||||
dataIndex: 'id',
|
dataIndex: ['company', 'name'],
|
||||||
search: false,
|
search: false,
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
|
|||||||
@ -40,7 +40,7 @@ export default function Index({ title = '登记审核' }) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
render: (text, record) => (
|
render: (text, record) => (
|
||||||
<a onClick={() => navigate(`/archive/${record.model_id}`)}>
|
<a onClick={() => navigate(`/archive/show/${record.model_id}`)}>
|
||||||
{text}
|
{text}
|
||||||
</a>
|
</a>
|
||||||
),
|
),
|
||||||
|
|||||||
@ -64,7 +64,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
<ProDescriptions.Item label="房屋信息">
|
<ProDescriptions.Item label="房屋信息">
|
||||||
<a
|
<a
|
||||||
onClick={() =>
|
onClick={() =>
|
||||||
navigate(`/archive/${props?.item?.model_id}`)
|
navigate(`/archive/show/${props?.item?.model_id}`)
|
||||||
}
|
}
|
||||||
>
|
>
|
||||||
{props?.item?.asset_house?.full_name || '-'}
|
{props?.item?.asset_house?.full_name || '-'}
|
||||||
|
|||||||
@ -14,12 +14,13 @@ export default function info(props: MyBetaModalFormProps) {
|
|||||||
<Space direction="vertical" style={{ width: '100%' }}>
|
<Space direction="vertical" style={{ width: '100%' }}>
|
||||||
<ProCard title="基本信息">
|
<ProCard title="基本信息">
|
||||||
<ProDescriptions bordered>
|
<ProDescriptions bordered>
|
||||||
<ProDescriptions.Item label="收费标准名称" span={2}>
|
<ProDescriptions.Item label="项目名称" span={2}>
|
||||||
{item?.name}
|
|
||||||
</ProDescriptions.Item>
|
|
||||||
<ProDescriptions.Item label="项目名称">
|
|
||||||
{item?.asset_project?.name}
|
{item?.asset_project?.name}
|
||||||
</ProDescriptions.Item>
|
</ProDescriptions.Item>
|
||||||
|
<ProDescriptions.Item label="收费标准名称">
|
||||||
|
{item?.name}
|
||||||
|
</ProDescriptions.Item>
|
||||||
|
|
||||||
<ProDescriptions.Item label="收费项目">
|
<ProDescriptions.Item label="收费项目">
|
||||||
<renderTextHelper.Tag
|
<renderTextHelper.Tag
|
||||||
Enums={HouseBillsTypeEnum}
|
Enums={HouseBillsTypeEnum}
|
||||||
|
|||||||
@ -1,9 +1,10 @@
|
|||||||
import { MyButtons, MyColumns, MyProTableProps } from '@/common';
|
import { MyButtons, MyColumns, MyProTableProps } from '@/common';
|
||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import ChargeStandardHasHouse from '@/pages/asset/list/components/modals/ChargeStandardHasHouse';
|
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
import { useEffect, useRef } from 'react';
|
import { useEffect, useRef } from 'react';
|
||||||
|
import ChargeStandardHasHouse from '../modals/ChargeStandardHasHouse';
|
||||||
|
|
||||||
export default function Index({ ...rest }) {
|
export default function Index({ ...rest }) {
|
||||||
const actionLooks = useRef<any>();
|
const actionLooks = useRef<any>();
|
||||||
|
|||||||
@ -11,13 +11,15 @@ import {
|
|||||||
HouseChargeStandardsCalculationMethodEnum,
|
HouseChargeStandardsCalculationMethodEnum,
|
||||||
HouseChargeStandardsCalculationModeEnum,
|
HouseChargeStandardsCalculationModeEnum,
|
||||||
HouseChargeStandardsCalculationPeriodEnum,
|
HouseChargeStandardsCalculationPeriodEnum,
|
||||||
|
HouseChargeStandardsPriceAlgorithmEnum,
|
||||||
} from '@/gen/Enums';
|
} from '@/gen/Enums';
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
import { useNavigate } from '@umijs/max';
|
import { useNavigate } from '@umijs/max';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
import ChargeStandardHasHouse from '../asset/list/components/modals/ChargeStandardHasHouse';
|
|
||||||
import ChargeStandardUpdate from '../asset/list/components/modals/ChargeStandardUpdate';
|
import ChargeStandardCreate from './modals/ChargeStandardCreate';
|
||||||
import ChargeCreate from './modals/ChargeCreate';
|
import ChargeStandardHasHouse from './modals/ChargeStandardHasHouse';
|
||||||
|
import ChargeStandardUpdate from './modals/ChargeStandardUpdate';
|
||||||
|
|
||||||
export default function Index({ title = '收费标准' }) {
|
export default function Index({ title = '收费标准' }) {
|
||||||
const navigate = useNavigate();
|
const navigate = useNavigate();
|
||||||
@ -45,7 +47,11 @@ export default function Index({ title = '收费标准' }) {
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
toolBarRender={(action) => [
|
toolBarRender={(action) => [
|
||||||
<ChargeCreate key="Create" reload={action?.reload} title={title} />,
|
<ChargeStandardCreate
|
||||||
|
key="Create"
|
||||||
|
reload={action?.reload}
|
||||||
|
title={title}
|
||||||
|
/>,
|
||||||
]}
|
]}
|
||||||
columns={[
|
columns={[
|
||||||
MyColumns.ID(),
|
MyColumns.ID(),
|
||||||
@ -59,12 +65,12 @@ export default function Index({ title = '收费标准' }) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
title: '收费标准名称',
|
title: '收费名称',
|
||||||
dataIndex: 'name',
|
dataIndex: 'name',
|
||||||
search: false,
|
search: false,
|
||||||
},
|
},
|
||||||
MyColumns.EnumTag({
|
MyColumns.EnumTag({
|
||||||
title: '收费项目',
|
title: '收费项',
|
||||||
dataIndex: 'charge_type',
|
dataIndex: 'charge_type',
|
||||||
valueEnum: HouseBillsTypeEnum,
|
valueEnum: HouseBillsTypeEnum,
|
||||||
}),
|
}),
|
||||||
@ -80,10 +86,32 @@ export default function Index({ title = '收费标准' }) {
|
|||||||
valueEnum: HouseChargeStandardsCalculationModeEnum,
|
valueEnum: HouseChargeStandardsCalculationModeEnum,
|
||||||
search: false,
|
search: false,
|
||||||
}),
|
}),
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '计费算法',
|
||||||
|
dataIndex: 'price_algorithm',
|
||||||
|
valueEnum: HouseChargeStandardsPriceAlgorithmEnum,
|
||||||
|
search: false,
|
||||||
|
}),
|
||||||
{
|
{
|
||||||
title: '单价',
|
title: '价格',
|
||||||
dataIndex: 'price',
|
dataIndex: 'price',
|
||||||
search: false,
|
search: false,
|
||||||
|
render(_, record) {
|
||||||
|
if (record?.price_algorithm === 'Fixed') {
|
||||||
|
return record?.price;
|
||||||
|
} else {
|
||||||
|
return (
|
||||||
|
<div>
|
||||||
|
{record?.tiered_rates?.map((rate: any, index: number) => (
|
||||||
|
<div key={index}>
|
||||||
|
{rate?.min_quantity} - {rate?.max_quantity} :
|
||||||
|
{rate?.price}
|
||||||
|
</div>
|
||||||
|
))}
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
},
|
||||||
},
|
},
|
||||||
MyColumns.EnumTag({
|
MyColumns.EnumTag({
|
||||||
title: '账单计费周期',
|
title: '账单计费周期',
|
||||||
@ -112,7 +140,7 @@ export default function Index({ title = '收费标准' }) {
|
|||||||
<MyButtons.View
|
<MyButtons.View
|
||||||
title="查看"
|
title="查看"
|
||||||
onClick={() => {
|
onClick={() => {
|
||||||
navigate(`/house_charge_standard/${item.id}`);
|
navigate(`/house_charge_standard/show/${item.id}`);
|
||||||
}}
|
}}
|
||||||
/>
|
/>
|
||||||
<ChargeStandardUpdate
|
<ChargeStandardUpdate
|
||||||
|
|||||||
@ -1,457 +0,0 @@
|
|||||||
import {
|
|
||||||
MyBetaModalFormProps,
|
|
||||||
MyButtons,
|
|
||||||
MyFormItems,
|
|
||||||
MyModalFormProps,
|
|
||||||
rulesHelper,
|
|
||||||
} from '@/common';
|
|
||||||
import { Selects } from '@/components/Select';
|
|
||||||
import { Apis } from '@/gen/Apis';
|
|
||||||
import {
|
|
||||||
HouseBillsTypeEnum,
|
|
||||||
HouseChargeStandardsApportionmentMethodEnum,
|
|
||||||
HouseChargeStandardsCalculationMethodEnum,
|
|
||||||
HouseChargeStandardsCalculationModeEnum,
|
|
||||||
HouseChargeStandardsCalculationPeriodEnum,
|
|
||||||
HouseChargeStandardsPriceAlgorithmEnum,
|
|
||||||
HouseChargeStandardsTypeEnum,
|
|
||||||
} from '@/gen/Enums';
|
|
||||||
import { BetaSchemaForm } from '@ant-design/pro-components';
|
|
||||||
import { Form, message } from 'antd';
|
|
||||||
import { useRef } from 'react';
|
|
||||||
|
|
||||||
export default function Create(props: MyBetaModalFormProps) {
|
|
||||||
const [form] = Form.useForm();
|
|
||||||
const actionRef = useRef<any>();
|
|
||||||
|
|
||||||
return (
|
|
||||||
<BetaSchemaForm<ApiTypes.HouseCharage.HouseChargeStandards.Store>
|
|
||||||
{...MyModalFormProps.props}
|
|
||||||
title={`创建收费标准`}
|
|
||||||
wrapperCol={{ span: 24 }}
|
|
||||||
width="600px"
|
|
||||||
trigger={<MyButtons.Create title={`创建收费标准`} />}
|
|
||||||
form={form}
|
|
||||||
key={new Date().getTime()}
|
|
||||||
onOpenChange={(open: any) => {
|
|
||||||
if (open) {
|
|
||||||
form.resetFields(); // 清空表单数据
|
|
||||||
}
|
|
||||||
}}
|
|
||||||
onFinish={async (values: any) => {
|
|
||||||
values?.grid_ranges?.forEach((res: { asset_projects_id: string }) => {
|
|
||||||
res.asset_projects_id = props?.item?.id;
|
|
||||||
});
|
|
||||||
return Apis.HouseCharage.HouseChargeStandards.Store({
|
|
||||||
...values,
|
|
||||||
type:
|
|
||||||
values.charge_type === HouseBillsTypeEnum.SharedWaterFee.value ||
|
|
||||||
values.charge_type === HouseBillsTypeEnum.SharedElectricityFee.value
|
|
||||||
? HouseChargeStandardsTypeEnum.House.value
|
|
||||||
: HouseChargeStandardsTypeEnum.Meter.value,
|
|
||||||
is_apportionment:
|
|
||||||
values.charge_type === HouseBillsTypeEnum.SharedWaterFee.value ||
|
|
||||||
values.charge_type === HouseBillsTypeEnum.SharedElectricityFee.value
|
|
||||||
? 1
|
|
||||||
: 0,
|
|
||||||
// 按套
|
|
||||||
calculation_mode:
|
|
||||||
values?.calculation_method ===
|
|
||||||
HouseChargeStandardsCalculationMethodEnum.PerUnit.value
|
|
||||||
? HouseChargeStandardsCalculationModeEnum.FixedAmount.value
|
|
||||||
: values?.calculation_mode,
|
|
||||||
// 按固定金额
|
|
||||||
price_algorithm:
|
|
||||||
values?.calculation_mode ===
|
|
||||||
HouseChargeStandardsCalculationModeEnum.FixedAmount.value ||
|
|
||||||
values?.calculation_method ===
|
|
||||||
HouseChargeStandardsCalculationMethodEnum.PerUnit.value
|
|
||||||
? HouseChargeStandardsPriceAlgorithmEnum.Fixed.value
|
|
||||||
: values?.price_algorithm,
|
|
||||||
tiered_rates: values.tiered_rates?.map((res: any) => {
|
|
||||||
return {
|
|
||||||
...res,
|
|
||||||
};
|
|
||||||
}),
|
|
||||||
// 避免计费模式切换导致的价格异常
|
|
||||||
price:
|
|
||||||
values?.price_algorithm ===
|
|
||||||
HouseChargeStandardsPriceAlgorithmEnum.Fixed.value
|
|
||||||
? values.price
|
|
||||||
: 0,
|
|
||||||
})
|
|
||||||
.then(() => {
|
|
||||||
props.reload?.();
|
|
||||||
message.success('收费标准创建成功');
|
|
||||||
return true;
|
|
||||||
})
|
|
||||||
.catch(() => false);
|
|
||||||
}}
|
|
||||||
columns={[
|
|
||||||
Selects?.AssetProjects({
|
|
||||||
key: 'asset_projects_id',
|
|
||||||
title: '项目',
|
|
||||||
colProps: { span: 12 },
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
}),
|
|
||||||
{
|
|
||||||
key: 'name',
|
|
||||||
title: '收费标准名称',
|
|
||||||
colProps: { span: 12 },
|
|
||||||
formItemProps: { ...rulesHelper.text },
|
|
||||||
},
|
|
||||||
MyFormItems.EnumRadio({
|
|
||||||
key: 'charge_type',
|
|
||||||
title: '收费项目',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
valueEnum: HouseBillsTypeEnum,
|
|
||||||
required: true,
|
|
||||||
}),
|
|
||||||
{
|
|
||||||
name: ['charge_type'],
|
|
||||||
valueType: 'dependency',
|
|
||||||
columns: ({ charge_type }: any) => {
|
|
||||||
return charge_type === HouseBillsTypeEnum.SharedWaterFee.value ||
|
|
||||||
charge_type === HouseBillsTypeEnum.SharedElectricityFee.value
|
|
||||||
? [
|
|
||||||
MyFormItems.EnumRadio({
|
|
||||||
key: 'calculation_method',
|
|
||||||
title: '分摊方式',
|
|
||||||
colProps: { span: 18 },
|
|
||||||
valueEnum: HouseChargeStandardsApportionmentMethodEnum,
|
|
||||||
required: true,
|
|
||||||
}),
|
|
||||||
]
|
|
||||||
: [];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
// Selects?.AssetProjects({
|
|
||||||
// key: 'asset_projects_id',
|
|
||||||
// title: '项目',
|
|
||||||
// colProps: { span: 12 },
|
|
||||||
// formItemProps: { ...rulesHelper.text },
|
|
||||||
// }),
|
|
||||||
{
|
|
||||||
name: ['charge_type'],
|
|
||||||
valueType: 'dependency',
|
|
||||||
columns: ({ charge_type }: any) => {
|
|
||||||
return charge_type === HouseBillsTypeEnum.PropertyFee.value ||
|
|
||||||
charge_type === HouseBillsTypeEnum.MaintenanceFund.value
|
|
||||||
? [
|
|
||||||
MyFormItems.EnumRadio({
|
|
||||||
key: 'calculation_method',
|
|
||||||
title: '计量单位',
|
|
||||||
colProps: { span: 16 },
|
|
||||||
valueEnum: () => {
|
|
||||||
let obj: any = JSON.parse(
|
|
||||||
JSON.stringify(
|
|
||||||
HouseChargeStandardsCalculationMethodEnum,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
delete obj.ElectricityUsage;
|
|
||||||
delete obj.WaterUsage;
|
|
||||||
return obj;
|
|
||||||
},
|
|
||||||
required: true,
|
|
||||||
}),
|
|
||||||
]
|
|
||||||
: charge_type === HouseBillsTypeEnum.WaterFee.value ||
|
|
||||||
charge_type === HouseBillsTypeEnum.ElectricityFee.value ||
|
|
||||||
charge_type === HouseBillsTypeEnum.SharedWaterFee.value ||
|
|
||||||
charge_type === HouseBillsTypeEnum.SharedElectricityFee.value
|
|
||||||
? [
|
|
||||||
MyFormItems.EnumRadio({
|
|
||||||
key: 'calculation_method',
|
|
||||||
title: '计量单位',
|
|
||||||
colProps: { span: 16 },
|
|
||||||
valueEnum: () => {
|
|
||||||
let obj: any = JSON.parse(
|
|
||||||
JSON.stringify(
|
|
||||||
HouseChargeStandardsCalculationMethodEnum,
|
|
||||||
),
|
|
||||||
);
|
|
||||||
delete obj.ChargeableArea;
|
|
||||||
delete obj.BuiltArea;
|
|
||||||
delete obj.InsideArea;
|
|
||||||
delete obj.PerUnit;
|
|
||||||
return obj;
|
|
||||||
},
|
|
||||||
required: true,
|
|
||||||
}),
|
|
||||||
]
|
|
||||||
: [];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: ['calculation_method'],
|
|
||||||
valueType: 'dependency',
|
|
||||||
columns: ({ calculation_method }: any) => {
|
|
||||||
return calculation_method ===
|
|
||||||
HouseChargeStandardsCalculationMethodEnum.PerUnit.value
|
|
||||||
? [
|
|
||||||
{
|
|
||||||
key: 'price',
|
|
||||||
title: '固定单价',
|
|
||||||
colProps: { span: 10 },
|
|
||||||
fieldProps: {
|
|
||||||
addonAfter: '元',
|
|
||||||
},
|
|
||||||
formItemProps: { ...rulesHelper.number },
|
|
||||||
},
|
|
||||||
]
|
|
||||||
: !calculation_method &&
|
|
||||||
calculation_method !==
|
|
||||||
HouseChargeStandardsCalculationMethodEnum.PerUnit.value
|
|
||||||
? []
|
|
||||||
: [
|
|
||||||
MyFormItems.EnumRadio({
|
|
||||||
key: 'calculation_mode',
|
|
||||||
title: '计费模式',
|
|
||||||
colProps: { span: 12 },
|
|
||||||
valueEnum: HouseChargeStandardsCalculationModeEnum,
|
|
||||||
required: true,
|
|
||||||
}),
|
|
||||||
];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
|
|
||||||
{
|
|
||||||
name: ['calculation_mode'],
|
|
||||||
valueType: 'dependency',
|
|
||||||
columns: ({ calculation_mode }: any) => {
|
|
||||||
return calculation_mode ===
|
|
||||||
HouseChargeStandardsCalculationModeEnum.FixedAmount.value
|
|
||||||
? [
|
|
||||||
{
|
|
||||||
key: 'price',
|
|
||||||
title: '固定单价',
|
|
||||||
colProps: { span: 10 },
|
|
||||||
fieldProps: {
|
|
||||||
addonAfter: '元',
|
|
||||||
},
|
|
||||||
formItemProps: { ...rulesHelper.number },
|
|
||||||
},
|
|
||||||
]
|
|
||||||
: calculation_mode ===
|
|
||||||
HouseChargeStandardsCalculationModeEnum.QuantityPrice.value
|
|
||||||
? [
|
|
||||||
MyFormItems.EnumRadio({
|
|
||||||
key: 'price_algorithm',
|
|
||||||
title: '计费算法',
|
|
||||||
colProps: { span: 14 },
|
|
||||||
valueEnum: HouseChargeStandardsPriceAlgorithmEnum,
|
|
||||||
required: true,
|
|
||||||
// fieldProps: {
|
|
||||||
// onChange: () => {
|
|
||||||
// // 切换计费算法时清空阶梯配置
|
|
||||||
// form.setFieldValue('scheme', undefined);
|
|
||||||
// },
|
|
||||||
// },
|
|
||||||
}),
|
|
||||||
{
|
|
||||||
name: ['price_algorithm'],
|
|
||||||
valueType: 'dependency',
|
|
||||||
columns: ({ price_algorithm }: any) => {
|
|
||||||
return price_algorithm ===
|
|
||||||
HouseChargeStandardsPriceAlgorithmEnum.Fixed.value
|
|
||||||
? [
|
|
||||||
{
|
|
||||||
key: 'price',
|
|
||||||
title: '固定单价',
|
|
||||||
colProps: { span: 10 },
|
|
||||||
fieldProps: {
|
|
||||||
addonAfter: '元',
|
|
||||||
},
|
|
||||||
formItemProps: { ...rulesHelper.number },
|
|
||||||
},
|
|
||||||
]
|
|
||||||
: price_algorithm ===
|
|
||||||
HouseChargeStandardsPriceAlgorithmEnum.Tiered.value
|
|
||||||
? [
|
|
||||||
{
|
|
||||||
valueType: 'formList',
|
|
||||||
dataIndex: 'tiered_rates',
|
|
||||||
title: '阶梯标准',
|
|
||||||
formItemProps: { ...rulesHelper.array },
|
|
||||||
initialValue: [
|
|
||||||
{
|
|
||||||
start: 0,
|
|
||||||
end: null,
|
|
||||||
price: null,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
fieldProps: {
|
|
||||||
actionRef: actionRef,
|
|
||||||
copyIconProps: false,
|
|
||||||
// deleteIconProps: false,
|
|
||||||
},
|
|
||||||
columns: [
|
|
||||||
{
|
|
||||||
valueType: 'group',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
columns: [
|
|
||||||
{
|
|
||||||
key: 'start',
|
|
||||||
colProps: { span: 10 },
|
|
||||||
title: '起始值',
|
|
||||||
valueType: 'number',
|
|
||||||
fieldProps: {
|
|
||||||
min: 0,
|
|
||||||
addonBefore: (
|
|
||||||
_: any,
|
|
||||||
{
|
|
||||||
field,
|
|
||||||
}: { field: { index: number[] } },
|
|
||||||
) => `第${field.index[1] + 1}阶梯`,
|
|
||||||
},
|
|
||||||
width: '100%',
|
|
||||||
formItemProps: { ...rulesHelper.number },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'end',
|
|
||||||
colProps: { span: 6 },
|
|
||||||
title: '结束值',
|
|
||||||
valueType: 'number',
|
|
||||||
width: '100%',
|
|
||||||
formItemProps: { ...rulesHelper.number },
|
|
||||||
fieldProps: { maxLength: 12 },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'price',
|
|
||||||
colProps: { span: 8 },
|
|
||||||
title: '阶梯单价',
|
|
||||||
valueType: 'number',
|
|
||||||
fieldProps: {
|
|
||||||
addonAfter: '元',
|
|
||||||
min: 0,
|
|
||||||
},
|
|
||||||
formItemProps: { ...rulesHelper.number },
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
]
|
|
||||||
: price_algorithm ===
|
|
||||||
HouseChargeStandardsPriceAlgorithmEnum.Peak.value
|
|
||||||
? [
|
|
||||||
{
|
|
||||||
valueType: 'formList',
|
|
||||||
dataIndex: 'tiered_rates',
|
|
||||||
title: '阶梯标准',
|
|
||||||
formItemProps: { ...rulesHelper.array },
|
|
||||||
initialValue: [
|
|
||||||
{
|
|
||||||
start: 0,
|
|
||||||
end: null,
|
|
||||||
price: null,
|
|
||||||
},
|
|
||||||
],
|
|
||||||
fieldProps: {
|
|
||||||
actionRef: actionRef,
|
|
||||||
copyIconProps: false,
|
|
||||||
// deleteIconProps: false,
|
|
||||||
},
|
|
||||||
columns: [
|
|
||||||
{
|
|
||||||
valueType: 'group',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
columns: [
|
|
||||||
{
|
|
||||||
key: 'start',
|
|
||||||
colProps: { span: 10 },
|
|
||||||
title: '起始值',
|
|
||||||
valueType: 'number',
|
|
||||||
fieldProps: {
|
|
||||||
min: 0,
|
|
||||||
addonBefore: (
|
|
||||||
_: any,
|
|
||||||
{
|
|
||||||
field,
|
|
||||||
}: { field: { name: number[] } },
|
|
||||||
) => `第${field.name[1] + 1}阶梯`,
|
|
||||||
},
|
|
||||||
width: '100%',
|
|
||||||
formItemProps: { ...rulesHelper.number },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'end',
|
|
||||||
colProps: { span: 6 },
|
|
||||||
title: '结束值',
|
|
||||||
valueType: 'number',
|
|
||||||
width: '100%',
|
|
||||||
formItemProps: { ...rulesHelper.number },
|
|
||||||
fieldProps: { maxLength: 12 },
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'price',
|
|
||||||
colProps: { span: 8 },
|
|
||||||
title: '阶梯单价',
|
|
||||||
valueType: 'number',
|
|
||||||
fieldProps: {
|
|
||||||
addonAfter: '元',
|
|
||||||
min: 0,
|
|
||||||
},
|
|
||||||
formItemProps: { ...rulesHelper.number },
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
]
|
|
||||||
: [];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]
|
|
||||||
: [];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
{
|
|
||||||
name: ['price', 'price_algorithm'],
|
|
||||||
valueType: 'dependency',
|
|
||||||
columns: ({ price, price_algorithm }: any) => {
|
|
||||||
return price ||
|
|
||||||
price_algorithm ===
|
|
||||||
HouseChargeStandardsPriceAlgorithmEnum.Tiered.value ||
|
|
||||||
price_algorithm ===
|
|
||||||
HouseChargeStandardsPriceAlgorithmEnum.Peak.value
|
|
||||||
? [
|
|
||||||
{
|
|
||||||
valueType: 'group',
|
|
||||||
columns: [
|
|
||||||
MyFormItems.EnumRadio({
|
|
||||||
key: 'calculation_period',
|
|
||||||
title: '账单计费周期',
|
|
||||||
colProps: { span: 14 },
|
|
||||||
valueEnum: HouseChargeStandardsCalculationPeriodEnum,
|
|
||||||
required: true,
|
|
||||||
}),
|
|
||||||
{
|
|
||||||
key: 'auto_date',
|
|
||||||
title: '账单自动生成日期',
|
|
||||||
colProps: { span: 10 },
|
|
||||||
valueType: 'date',
|
|
||||||
width: '100%',
|
|
||||||
},
|
|
||||||
{
|
|
||||||
key: 'remark',
|
|
||||||
title: '备注',
|
|
||||||
colProps: { span: 24 },
|
|
||||||
valueType: 'textarea',
|
|
||||||
fieldProps: {
|
|
||||||
rows: 4,
|
|
||||||
maxLength: 500,
|
|
||||||
showCount: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
],
|
|
||||||
},
|
|
||||||
]
|
|
||||||
: [];
|
|
||||||
},
|
|
||||||
},
|
|
||||||
]}
|
|
||||||
/>
|
|
||||||
);
|
|
||||||
}
|
|
||||||
@ -5,6 +5,7 @@ import {
|
|||||||
MyModalFormProps,
|
MyModalFormProps,
|
||||||
rulesHelper,
|
rulesHelper,
|
||||||
} from '@/common';
|
} from '@/common';
|
||||||
|
import { Selects } from '@/components/Select';
|
||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import {
|
import {
|
||||||
HouseBillsTypeEnum,
|
HouseBillsTypeEnum,
|
||||||
@ -27,8 +28,13 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
<BetaSchemaForm<ApiTypes.HouseCharage.HouseChargeStandards.Store>
|
<BetaSchemaForm<ApiTypes.HouseCharage.HouseChargeStandards.Store>
|
||||||
{...MyModalFormProps.props}
|
{...MyModalFormProps.props}
|
||||||
title={`创建收费标准`}
|
title={`创建收费标准`}
|
||||||
|
// wrapperCol={{ span: 24 }}
|
||||||
|
// 基础表单
|
||||||
|
layout="horizontal"
|
||||||
|
labelCol={{ span: 4 }}
|
||||||
wrapperCol={{ span: 24 }}
|
wrapperCol={{ span: 24 }}
|
||||||
width="600px"
|
labelAlign="left"
|
||||||
|
width="680px"
|
||||||
trigger={<MyButtons.Create title={`创建收费标准`} />}
|
trigger={<MyButtons.Create title={`创建收费标准`} />}
|
||||||
form={form}
|
form={form}
|
||||||
key={new Date().getTime()}
|
key={new Date().getTime()}
|
||||||
@ -37,13 +43,10 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
form.resetFields(); // 清空表单数据
|
form.resetFields(); // 清空表单数据
|
||||||
}
|
}
|
||||||
}}
|
}}
|
||||||
onFinish={async (values: any) => {
|
onFinish={async (values: any) =>
|
||||||
values?.grid_ranges?.forEach((res: { asset_projects_id: string }) => {
|
Apis.HouseCharage.HouseChargeStandards.Store({
|
||||||
res.asset_projects_id = props?.item?.id;
|
|
||||||
});
|
|
||||||
return Apis.HouseCharage.HouseChargeStandards.Store({
|
|
||||||
...values,
|
...values,
|
||||||
asset_projects_id: props?.item?.id,
|
asset_projects_id: props?.item?.id || values?.asset_projects_id,
|
||||||
type:
|
type:
|
||||||
values.charge_type === HouseBillsTypeEnum.PropertyFee.value ||
|
values.charge_type === HouseBillsTypeEnum.PropertyFee.value ||
|
||||||
values.charge_type === HouseBillsTypeEnum.MaintenanceFund.value
|
values.charge_type === HouseBillsTypeEnum.MaintenanceFund.value
|
||||||
@ -93,15 +96,43 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
message.success('收费标准创建成功');
|
message.success('收费标准创建成功');
|
||||||
return true;
|
return true;
|
||||||
})
|
})
|
||||||
.catch(() => false);
|
.catch(() => false)
|
||||||
}}
|
}
|
||||||
columns={[
|
columns={[
|
||||||
|
...(props?.item?.id
|
||||||
|
? []
|
||||||
|
: [
|
||||||
|
Selects?.AssetProjects({
|
||||||
|
key: 'asset_projects_id',
|
||||||
|
title: '选择项目',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
required: true,
|
||||||
|
}),
|
||||||
|
]),
|
||||||
|
|
||||||
{
|
{
|
||||||
key: 'name',
|
key: 'name',
|
||||||
title: '收费标准名称',
|
title: '收费名称',
|
||||||
colProps: { span: 24 },
|
colProps: { span: 24 },
|
||||||
formItemProps: { ...rulesHelper.text },
|
formItemProps: { ...rulesHelper.text },
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
valueType: 'dependency',
|
||||||
|
name: ['asset_projects_id'],
|
||||||
|
columns: ({ asset_projects_id }) => {
|
||||||
|
return [
|
||||||
|
Selects?.ProjectAccounts({
|
||||||
|
title: '收款账户',
|
||||||
|
key: 'company_receipt_accounts_id',
|
||||||
|
params: {
|
||||||
|
asset_projects_id: asset_projects_id || props?.item?.id || 0,
|
||||||
|
},
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
},
|
||||||
|
},
|
||||||
MyFormItems.EnumRadio({
|
MyFormItems.EnumRadio({
|
||||||
key: 'charge_type',
|
key: 'charge_type',
|
||||||
title: '收费项目',
|
title: '收费项目',
|
||||||
@ -119,7 +150,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
MyFormItems.EnumRadio({
|
MyFormItems.EnumRadio({
|
||||||
key: 'calculation_method',
|
key: 'calculation_method',
|
||||||
title: '分摊方式',
|
title: '分摊方式',
|
||||||
colProps: { span: 18 },
|
colProps: { span: 24 },
|
||||||
valueEnum: HouseChargeStandardsApportionmentMethodEnum,
|
valueEnum: HouseChargeStandardsApportionmentMethodEnum,
|
||||||
required: true,
|
required: true,
|
||||||
}),
|
}),
|
||||||
@ -144,7 +175,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
MyFormItems.EnumRadio({
|
MyFormItems.EnumRadio({
|
||||||
key: 'calculation_method',
|
key: 'calculation_method',
|
||||||
title: '计量单位',
|
title: '计量单位',
|
||||||
colProps: { span: 16 },
|
colProps: { span: 24 },
|
||||||
valueEnum: () => {
|
valueEnum: () => {
|
||||||
let obj: any = JSON.parse(
|
let obj: any = JSON.parse(
|
||||||
JSON.stringify(
|
JSON.stringify(
|
||||||
@ -160,6 +191,8 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
onChange: () => {
|
onChange: () => {
|
||||||
// 切换计量单位时清空计费模式
|
// 切换计量单位时清空计费模式
|
||||||
form.setFieldValue('calculation_mode', undefined);
|
form.setFieldValue('calculation_mode', undefined);
|
||||||
|
form.setFieldValue('price', undefined);
|
||||||
|
form.setFieldValue('price_algorithm', undefined);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
@ -172,7 +205,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
MyFormItems.EnumRadio({
|
MyFormItems.EnumRadio({
|
||||||
key: 'calculation_method',
|
key: 'calculation_method',
|
||||||
title: '计量单位',
|
title: '计量单位',
|
||||||
colProps: { span: 16 },
|
colProps: { span: 24 },
|
||||||
valueEnum: () => {
|
valueEnum: () => {
|
||||||
let obj: any = JSON.parse(
|
let obj: any = JSON.parse(
|
||||||
JSON.stringify(
|
JSON.stringify(
|
||||||
@ -190,6 +223,8 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
onChange: () => {
|
onChange: () => {
|
||||||
// 切换计量单位时清空计费模式
|
// 切换计量单位时清空计费模式
|
||||||
form.setFieldValue('calculation_mode', undefined);
|
form.setFieldValue('calculation_mode', undefined);
|
||||||
|
form.setFieldValue('price', undefined);
|
||||||
|
form.setFieldValue('price_algorithm', undefined);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
@ -207,7 +242,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
{
|
{
|
||||||
key: 'price',
|
key: 'price',
|
||||||
title: '固定单价',
|
title: '固定单价',
|
||||||
colProps: { span: 10 },
|
colProps: { span: 24 },
|
||||||
fieldProps: {
|
fieldProps: {
|
||||||
addonAfter: '元',
|
addonAfter: '元',
|
||||||
},
|
},
|
||||||
@ -222,7 +257,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
MyFormItems.EnumRadio({
|
MyFormItems.EnumRadio({
|
||||||
key: 'calculation_mode',
|
key: 'calculation_mode',
|
||||||
title: '计费模式',
|
title: '计费模式',
|
||||||
colProps: { span: 12 },
|
colProps: { span: 24 },
|
||||||
// valueEnum: HouseChargeStandardsCalculationModeEnum,
|
// valueEnum: HouseChargeStandardsCalculationModeEnum,
|
||||||
valueEnum: () => {
|
valueEnum: () => {
|
||||||
let obj: any = JSON.parse(
|
let obj: any = JSON.parse(
|
||||||
@ -247,7 +282,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
{
|
{
|
||||||
key: 'price',
|
key: 'price',
|
||||||
title: '固定单价',
|
title: '固定单价',
|
||||||
colProps: { span: 10 },
|
colProps: { span: 24 },
|
||||||
fieldProps: {
|
fieldProps: {
|
||||||
addonAfter: '元',
|
addonAfter: '元',
|
||||||
},
|
},
|
||||||
@ -260,15 +295,16 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
MyFormItems.EnumRadio({
|
MyFormItems.EnumRadio({
|
||||||
key: 'price_algorithm',
|
key: 'price_algorithm',
|
||||||
title: '计费算法',
|
title: '计费算法',
|
||||||
colProps: { span: 14 },
|
colProps: { span: 24 },
|
||||||
valueEnum: HouseChargeStandardsPriceAlgorithmEnum,
|
valueEnum: HouseChargeStandardsPriceAlgorithmEnum,
|
||||||
required: true,
|
required: true,
|
||||||
// fieldProps: {
|
fieldProps: {
|
||||||
// onChange: () => {
|
onChange: () => {
|
||||||
// // 切换计费算法时清空阶梯配置
|
// 切换计费算法时清空阶梯配置
|
||||||
// form.setFieldValue('scheme', undefined);
|
form.setFieldValue('price', undefined);
|
||||||
// },
|
form.setFieldValue('tiered_rates', undefined);
|
||||||
// },
|
},
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
name: ['price_algorithm'],
|
name: ['price_algorithm'],
|
||||||
@ -280,7 +316,7 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
{
|
{
|
||||||
key: 'price',
|
key: 'price',
|
||||||
title: '固定单价',
|
title: '固定单价',
|
||||||
colProps: { span: 10 },
|
colProps: { span: 24 },
|
||||||
fieldProps: {
|
fieldProps: {
|
||||||
addonAfter: '元',
|
addonAfter: '元',
|
||||||
max: 99,
|
max: 99,
|
||||||
@ -448,17 +484,72 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
columns: [
|
columns: [
|
||||||
MyFormItems.EnumRadio({
|
MyFormItems.EnumRadio({
|
||||||
key: 'calculation_period',
|
key: 'calculation_period',
|
||||||
title: '账单计费周期',
|
title: '计费周期',
|
||||||
colProps: { span: 14 },
|
colProps: { span: 24 },
|
||||||
valueEnum: HouseChargeStandardsCalculationPeriodEnum,
|
valueEnum: HouseChargeStandardsCalculationPeriodEnum,
|
||||||
required: true,
|
required: true,
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
key: 'auto_date',
|
key: 'auto_date',
|
||||||
title: '账单自动生成日期',
|
title: '生成日期',
|
||||||
colProps: { span: 10 },
|
colProps: { span: 24 },
|
||||||
|
tooltip: '系统将按该设置日期自动生成第一期的账单',
|
||||||
valueType: 'date',
|
valueType: 'date',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'has_late_fee',
|
||||||
|
title: '启用滞纳金',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
valueType: 'switch',
|
||||||
|
width: '100%',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: ['has_late_fee'],
|
||||||
|
valueType: 'dependency',
|
||||||
|
columns: ({ has_late_fee }: any) => {
|
||||||
|
return has_late_fee
|
||||||
|
? [
|
||||||
|
{
|
||||||
|
key: 'late_fee_start_days',
|
||||||
|
title: '起算天数',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.number },
|
||||||
|
fieldProps: {
|
||||||
|
mix: 1,
|
||||||
|
addonBefore: '生成账单后',
|
||||||
|
addonAfter: '天',
|
||||||
|
placeholder:
|
||||||
|
'请输入按账单生成后多少天后开始收取',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'late_fee_rate',
|
||||||
|
title: '收取费率',
|
||||||
|
valueType: 'number',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.number },
|
||||||
|
fieldProps: {
|
||||||
|
addonBefore: '每日',
|
||||||
|
addonAfter: '%',
|
||||||
|
max: 100,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'late_fee_cap_days',
|
||||||
|
title: '封顶天数',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.number },
|
||||||
|
fieldProps: {
|
||||||
|
mix: 1,
|
||||||
|
placeholder: '请输入封顶天数',
|
||||||
|
addonAfter: '天',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
: [];
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'remark',
|
key: 'remark',
|
||||||
@ -466,8 +557,8 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
colProps: { span: 24 },
|
colProps: { span: 24 },
|
||||||
valueType: 'textarea',
|
valueType: 'textarea',
|
||||||
fieldProps: {
|
fieldProps: {
|
||||||
rows: 4,
|
// rows: 2,
|
||||||
maxLength: 500,
|
maxLength: 100,
|
||||||
showCount: true,
|
showCount: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -5,6 +5,7 @@ import {
|
|||||||
MyModalFormProps,
|
MyModalFormProps,
|
||||||
rulesHelper,
|
rulesHelper,
|
||||||
} from '@/common';
|
} from '@/common';
|
||||||
|
import { Selects } from '@/components/Select';
|
||||||
import { Apis } from '@/gen/Apis';
|
import { Apis } from '@/gen/Apis';
|
||||||
import {
|
import {
|
||||||
HouseBillsTypeEnum,
|
HouseBillsTypeEnum,
|
||||||
@ -27,8 +28,13 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
<BetaSchemaForm<ApiTypes.HouseCharage.HouseChargeStandards.Update>
|
<BetaSchemaForm<ApiTypes.HouseCharage.HouseChargeStandards.Update>
|
||||||
{...MyModalFormProps.props}
|
{...MyModalFormProps.props}
|
||||||
title={props.title}
|
title={props.title}
|
||||||
|
// wrapperCol={{ span: 24 }}
|
||||||
|
// 基础表单
|
||||||
|
layout="horizontal"
|
||||||
|
labelCol={{ span: 4 }}
|
||||||
wrapperCol={{ span: 24 }}
|
wrapperCol={{ span: 24 }}
|
||||||
width="600px"
|
labelAlign="left"
|
||||||
|
width="650px"
|
||||||
trigger={
|
trigger={
|
||||||
<MyButtons.Default title={props.title} size="small" type="primary" />
|
<MyButtons.Default title={props.title} size="small" type="primary" />
|
||||||
}
|
}
|
||||||
@ -97,10 +103,27 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
columns={[
|
columns={[
|
||||||
{
|
{
|
||||||
key: 'name',
|
key: 'name',
|
||||||
title: '收费标准名称',
|
title: '收费名称',
|
||||||
colProps: { span: 24 },
|
colProps: { span: 24 },
|
||||||
formItemProps: { ...rulesHelper.text },
|
formItemProps: { ...rulesHelper.text },
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
valueType: 'dependency',
|
||||||
|
name: ['asset_projects_id'],
|
||||||
|
columns: ({ asset_projects_id }) => {
|
||||||
|
return [
|
||||||
|
Selects?.ProjectAccounts({
|
||||||
|
title: '收款账户',
|
||||||
|
key: 'company_receipt_accounts_id',
|
||||||
|
params: {
|
||||||
|
asset_projects_id: asset_projects_id || props?.item?.id || 0,
|
||||||
|
},
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
},
|
||||||
|
},
|
||||||
MyFormItems.EnumRadio({
|
MyFormItems.EnumRadio({
|
||||||
key: 'charge_type',
|
key: 'charge_type',
|
||||||
title: '收费项目',
|
title: '收费项目',
|
||||||
@ -118,7 +141,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
MyFormItems.EnumRadio({
|
MyFormItems.EnumRadio({
|
||||||
key: 'calculation_method',
|
key: 'calculation_method',
|
||||||
title: '分摊方式',
|
title: '分摊方式',
|
||||||
colProps: { span: 18 },
|
colProps: { span: 24 },
|
||||||
valueEnum: HouseChargeStandardsApportionmentMethodEnum,
|
valueEnum: HouseChargeStandardsApportionmentMethodEnum,
|
||||||
required: true,
|
required: true,
|
||||||
}),
|
}),
|
||||||
@ -127,6 +150,12 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
// Selects?.AssetProjects({
|
||||||
|
// key: 'asset_projects_id',
|
||||||
|
// title: '项目',
|
||||||
|
// colProps: { span: 12 },
|
||||||
|
// formItemProps: { ...rulesHelper.text },
|
||||||
|
// }),
|
||||||
{
|
{
|
||||||
name: ['charge_type'],
|
name: ['charge_type'],
|
||||||
valueType: 'dependency',
|
valueType: 'dependency',
|
||||||
@ -137,7 +166,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
MyFormItems.EnumRadio({
|
MyFormItems.EnumRadio({
|
||||||
key: 'calculation_method',
|
key: 'calculation_method',
|
||||||
title: '计量单位',
|
title: '计量单位',
|
||||||
colProps: { span: 16 },
|
colProps: { span: 24 },
|
||||||
valueEnum: () => {
|
valueEnum: () => {
|
||||||
let obj: any = JSON.parse(
|
let obj: any = JSON.parse(
|
||||||
JSON.stringify(
|
JSON.stringify(
|
||||||
@ -153,6 +182,8 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
onChange: () => {
|
onChange: () => {
|
||||||
// 切换计量单位时清空计费模式
|
// 切换计量单位时清空计费模式
|
||||||
form.setFieldValue('calculation_mode', undefined);
|
form.setFieldValue('calculation_mode', undefined);
|
||||||
|
// form.setFieldValue('price', undefined);
|
||||||
|
form.setFieldValue('price_algorithm', undefined);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
@ -165,7 +196,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
MyFormItems.EnumRadio({
|
MyFormItems.EnumRadio({
|
||||||
key: 'calculation_method',
|
key: 'calculation_method',
|
||||||
title: '计量单位',
|
title: '计量单位',
|
||||||
colProps: { span: 16 },
|
colProps: { span: 24 },
|
||||||
valueEnum: () => {
|
valueEnum: () => {
|
||||||
let obj: any = JSON.parse(
|
let obj: any = JSON.parse(
|
||||||
JSON.stringify(
|
JSON.stringify(
|
||||||
@ -183,6 +214,8 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
onChange: () => {
|
onChange: () => {
|
||||||
// 切换计量单位时清空计费模式
|
// 切换计量单位时清空计费模式
|
||||||
form.setFieldValue('calculation_mode', undefined);
|
form.setFieldValue('calculation_mode', undefined);
|
||||||
|
// form.setFieldValue('price', undefined);
|
||||||
|
form.setFieldValue('price_algorithm', undefined);
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
@ -200,7 +233,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
{
|
{
|
||||||
key: 'price',
|
key: 'price',
|
||||||
title: '固定单价',
|
title: '固定单价',
|
||||||
colProps: { span: 10 },
|
colProps: { span: 24 },
|
||||||
fieldProps: {
|
fieldProps: {
|
||||||
addonAfter: '元',
|
addonAfter: '元',
|
||||||
},
|
},
|
||||||
@ -215,7 +248,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
MyFormItems.EnumRadio({
|
MyFormItems.EnumRadio({
|
||||||
key: 'calculation_mode',
|
key: 'calculation_mode',
|
||||||
title: '计费模式',
|
title: '计费模式',
|
||||||
colProps: { span: 12 },
|
colProps: { span: 24 },
|
||||||
// valueEnum: HouseChargeStandardsCalculationModeEnum,
|
// valueEnum: HouseChargeStandardsCalculationModeEnum,
|
||||||
valueEnum: () => {
|
valueEnum: () => {
|
||||||
let obj: any = JSON.parse(
|
let obj: any = JSON.parse(
|
||||||
@ -240,7 +273,7 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
{
|
{
|
||||||
key: 'price',
|
key: 'price',
|
||||||
title: '固定单价',
|
title: '固定单价',
|
||||||
colProps: { span: 10 },
|
colProps: { span: 24 },
|
||||||
fieldProps: {
|
fieldProps: {
|
||||||
addonAfter: '元',
|
addonAfter: '元',
|
||||||
},
|
},
|
||||||
@ -253,15 +286,16 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
MyFormItems.EnumRadio({
|
MyFormItems.EnumRadio({
|
||||||
key: 'price_algorithm',
|
key: 'price_algorithm',
|
||||||
title: '计费算法',
|
title: '计费算法',
|
||||||
colProps: { span: 14 },
|
colProps: { span: 24 },
|
||||||
valueEnum: HouseChargeStandardsPriceAlgorithmEnum,
|
valueEnum: HouseChargeStandardsPriceAlgorithmEnum,
|
||||||
required: true,
|
required: true,
|
||||||
// fieldProps: {
|
fieldProps: {
|
||||||
// onChange: () => {
|
onChange: () => {
|
||||||
// // 切换计费算法时清空阶梯配置
|
// 切换计费算法时清空阶梯配置
|
||||||
// form.setFieldValue('scheme', undefined);
|
// form.setFieldValue('price', undefined);
|
||||||
// },
|
// form.setFieldValue('tiered_rates', undefined);
|
||||||
// },
|
},
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
name: ['price_algorithm'],
|
name: ['price_algorithm'],
|
||||||
@ -273,9 +307,10 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
{
|
{
|
||||||
key: 'price',
|
key: 'price',
|
||||||
title: '固定单价',
|
title: '固定单价',
|
||||||
colProps: { span: 10 },
|
colProps: { span: 24 },
|
||||||
fieldProps: {
|
fieldProps: {
|
||||||
addonAfter: '元',
|
addonAfter: '元',
|
||||||
|
max: 99,
|
||||||
},
|
},
|
||||||
formItemProps: { ...rulesHelper.number },
|
formItemProps: { ...rulesHelper.number },
|
||||||
},
|
},
|
||||||
@ -288,13 +323,13 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
dataIndex: 'tiered_rates',
|
dataIndex: 'tiered_rates',
|
||||||
title: '阶梯标准',
|
title: '阶梯标准',
|
||||||
formItemProps: { ...rulesHelper.array },
|
formItemProps: { ...rulesHelper.array },
|
||||||
// initialValue: [
|
initialValue: [
|
||||||
// {
|
{
|
||||||
// start: 0,
|
min_quantity: 0,
|
||||||
// end: null,
|
max_quantity: null,
|
||||||
// price: null,
|
price: null,
|
||||||
// },
|
},
|
||||||
// ],
|
],
|
||||||
fieldProps: {
|
fieldProps: {
|
||||||
actionRef: actionRef,
|
actionRef: actionRef,
|
||||||
copyIconProps: false,
|
copyIconProps: false,
|
||||||
@ -357,13 +392,13 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
dataIndex: 'tiered_rates',
|
dataIndex: 'tiered_rates',
|
||||||
title: '阶梯标准',
|
title: '阶梯标准',
|
||||||
formItemProps: { ...rulesHelper.array },
|
formItemProps: { ...rulesHelper.array },
|
||||||
// initialValue: [
|
initialValue: [
|
||||||
// {
|
{
|
||||||
// start: 0,
|
min_quantity: 0,
|
||||||
// end: null,
|
max_quantity: null,
|
||||||
// price: null,
|
price: null,
|
||||||
// },
|
},
|
||||||
// ],
|
],
|
||||||
fieldProps: {
|
fieldProps: {
|
||||||
actionRef: actionRef,
|
actionRef: actionRef,
|
||||||
copyIconProps: false,
|
copyIconProps: false,
|
||||||
@ -440,17 +475,72 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
columns: [
|
columns: [
|
||||||
MyFormItems.EnumRadio({
|
MyFormItems.EnumRadio({
|
||||||
key: 'calculation_period',
|
key: 'calculation_period',
|
||||||
title: '账单计费周期',
|
title: '计费周期',
|
||||||
colProps: { span: 14 },
|
colProps: { span: 24 },
|
||||||
valueEnum: HouseChargeStandardsCalculationPeriodEnum,
|
valueEnum: HouseChargeStandardsCalculationPeriodEnum,
|
||||||
required: true,
|
required: true,
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
key: 'auto_date',
|
key: 'auto_date',
|
||||||
title: '账单自动生成日期',
|
title: '生成日期',
|
||||||
colProps: { span: 10 },
|
colProps: { span: 24 },
|
||||||
|
tooltip: '系统将按该设置日期自动生成第一期的账单',
|
||||||
valueType: 'date',
|
valueType: 'date',
|
||||||
width: '100%',
|
width: '100%',
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'has_late_fee',
|
||||||
|
title: '启用滞纳金',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
valueType: 'switch',
|
||||||
|
width: '100%',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
name: ['has_late_fee'],
|
||||||
|
valueType: 'dependency',
|
||||||
|
columns: ({ has_late_fee }: any) => {
|
||||||
|
return has_late_fee
|
||||||
|
? [
|
||||||
|
{
|
||||||
|
key: 'late_fee_start_days',
|
||||||
|
title: '起算天数',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.number },
|
||||||
|
fieldProps: {
|
||||||
|
mix: 1,
|
||||||
|
addonBefore: '生成账单后',
|
||||||
|
addonAfter: '天',
|
||||||
|
placeholder:
|
||||||
|
'请输入按账单生成后多少天后开始收取',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'late_fee_rate',
|
||||||
|
title: '收取费率',
|
||||||
|
valueType: 'number',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.number },
|
||||||
|
fieldProps: {
|
||||||
|
addonBefore: '每日',
|
||||||
|
addonAfter: '%',
|
||||||
|
max: 100,
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'late_fee_cap_days',
|
||||||
|
title: '封顶天数',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.number },
|
||||||
|
fieldProps: {
|
||||||
|
mix: 1,
|
||||||
|
placeholder: '请输入封顶天数',
|
||||||
|
addonAfter: '天',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
]
|
||||||
|
: [];
|
||||||
|
},
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'remark',
|
key: 'remark',
|
||||||
@ -458,8 +548,8 @@ export default function Update(props: MyBetaModalFormProps) {
|
|||||||
colProps: { span: 24 },
|
colProps: { span: 24 },
|
||||||
valueType: 'textarea',
|
valueType: 'textarea',
|
||||||
fieldProps: {
|
fieldProps: {
|
||||||
rows: 4,
|
// rows: 2,
|
||||||
maxLength: 500,
|
maxLength: 100,
|
||||||
showCount: true,
|
showCount: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
@ -4,8 +4,8 @@ import { ProCard } from '@ant-design/pro-components';
|
|||||||
import { useParams } from '@umijs/max';
|
import { useParams } from '@umijs/max';
|
||||||
import { Tabs } from 'antd';
|
import { Tabs } from 'antd';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
import ChargeInfo from './components/ChargeInfo';
|
import ChargeInfo from '../components/ChargeInfo';
|
||||||
import HasHouse from './components/HasHouse';
|
import HasHouse from '../components/HasHouse';
|
||||||
|
|
||||||
export default function Show({ title }: { title?: string } = {}) {
|
export default function Show({ title }: { title?: string } = {}) {
|
||||||
const { id } = useParams<{ id: string }>();
|
const { id } = useParams<{ id: string }>();
|
||||||
100
src/pages/house_charge_tasks copy/index.tsx
Normal file
100
src/pages/house_charge_tasks copy/index.tsx
Normal file
@ -0,0 +1,100 @@
|
|||||||
|
import {
|
||||||
|
MyButtons,
|
||||||
|
MyColumns,
|
||||||
|
MyPageContainer,
|
||||||
|
MyProTableProps,
|
||||||
|
usePageTabs,
|
||||||
|
} from '@/common';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import { HouseChargeTaskDetailsStatusEnum } from '@/gen/Enums';
|
||||||
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
|
import { Space } from 'antd';
|
||||||
|
import ChargeTasksCreate from './modals/ChargeTasksCreate';
|
||||||
|
|
||||||
|
export default function Index({ title = '账单任务' }) {
|
||||||
|
// 注册当前页面为标签页
|
||||||
|
usePageTabs({
|
||||||
|
tabKey: 'house_charge_tasks',
|
||||||
|
tabLabel: title,
|
||||||
|
});
|
||||||
|
|
||||||
|
return (
|
||||||
|
<MyPageContainer
|
||||||
|
title={title}
|
||||||
|
enableTabs={true}
|
||||||
|
tabKey="bills"
|
||||||
|
tabLabel={title}
|
||||||
|
>
|
||||||
|
<ProTable
|
||||||
|
{...MyProTableProps.props}
|
||||||
|
request={async (params, sort) =>
|
||||||
|
MyProTableProps.request(
|
||||||
|
params,
|
||||||
|
sort,
|
||||||
|
Apis.HouseCharage.HouseChargeTasks.List,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
toolBarRender={(action) => [
|
||||||
|
<ChargeTasksCreate
|
||||||
|
key="Create"
|
||||||
|
reload={action?.reload}
|
||||||
|
title="账单任务"
|
||||||
|
/>,
|
||||||
|
]}
|
||||||
|
columns={[
|
||||||
|
{
|
||||||
|
title: '任务ID',
|
||||||
|
dataIndex: 'house_charge_tasks_id',
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
|
MyColumns.EnumTag({
|
||||||
|
title: '任务状态',
|
||||||
|
dataIndex: 'status',
|
||||||
|
valueEnum: HouseChargeTaskDetailsStatusEnum,
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
title: '账单ID',
|
||||||
|
dataIndex: 'id',
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '关联对象',
|
||||||
|
dataIndex: 'full_name',
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '账单月份',
|
||||||
|
render: (_, record) => {
|
||||||
|
return `${record.year}-${String(record.month).padStart(2, '0')}`;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '计费开始日期',
|
||||||
|
dataIndex: ['house_charge_task', 'start_date'],
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
title: '计费结束日期',
|
||||||
|
dataIndex: ['house_charge_task', 'end_date'],
|
||||||
|
search: false,
|
||||||
|
},
|
||||||
|
// MyColumns.UpdatedAt(),
|
||||||
|
MyColumns.CreatedAt(),
|
||||||
|
MyColumns.Option({
|
||||||
|
render: (_, item: any, index, action) => (
|
||||||
|
<Space key={index}>
|
||||||
|
<MyButtons.Delete
|
||||||
|
onConfirm={() =>
|
||||||
|
Apis.HouseCharage.HouseChargeTaskDetails.Delete({
|
||||||
|
id: item.id,
|
||||||
|
}).then(() => action?.reload())
|
||||||
|
}
|
||||||
|
/>
|
||||||
|
</Space>
|
||||||
|
),
|
||||||
|
}),
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
</MyPageContainer>
|
||||||
|
);
|
||||||
|
}
|
||||||
116
src/pages/house_charge_tasks copy/modals/ChargeTasksCreate.tsx
Normal file
116
src/pages/house_charge_tasks copy/modals/ChargeTasksCreate.tsx
Normal file
@ -0,0 +1,116 @@
|
|||||||
|
import {
|
||||||
|
MyBetaModalFormProps,
|
||||||
|
MyButtons,
|
||||||
|
MyModalFormProps,
|
||||||
|
rulesHelper,
|
||||||
|
} from '@/common';
|
||||||
|
import { Selects } from '@/components/Select';
|
||||||
|
import { Apis } from '@/gen/Apis';
|
||||||
|
import { BetaSchemaForm } from '@ant-design/pro-components';
|
||||||
|
import { Form, message } from 'antd';
|
||||||
|
|
||||||
|
export default function Create(props: MyBetaModalFormProps) {
|
||||||
|
const [form] = Form.useForm();
|
||||||
|
return (
|
||||||
|
<BetaSchemaForm<ApiTypes.HouseCharage.HouseChargeTasks.Store>
|
||||||
|
{...MyModalFormProps.props}
|
||||||
|
title={`创建${props.title}`}
|
||||||
|
width="480px"
|
||||||
|
layout="horizontal"
|
||||||
|
labelCol={{ span: 8 }}
|
||||||
|
wrapperCol={{ span: 16 }}
|
||||||
|
labelAlign="left"
|
||||||
|
trigger={<MyButtons.Create title={`创建${props.title}`} />}
|
||||||
|
key={new Date().getTime()}
|
||||||
|
form={form}
|
||||||
|
onOpenChange={(open: any) => {
|
||||||
|
if (open) {
|
||||||
|
form.resetFields(); // 清空表单数据
|
||||||
|
}
|
||||||
|
}}
|
||||||
|
onFinish={async (values) =>
|
||||||
|
Apis.HouseCharage.HouseChargeTasks.Store(values)
|
||||||
|
.then(() => {
|
||||||
|
props.reload?.();
|
||||||
|
message.success(props.title + '账单任务创建成功');
|
||||||
|
return true;
|
||||||
|
})
|
||||||
|
.catch(() => false)
|
||||||
|
}
|
||||||
|
columns={[
|
||||||
|
Selects?.AssetProjects({
|
||||||
|
title: '选择项目',
|
||||||
|
key: 'asset_projects_id',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
fieldProps: {
|
||||||
|
onChange: (val: any) => {
|
||||||
|
form.setFieldsValue({
|
||||||
|
house_charge_standards_id: undefined,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
{
|
||||||
|
valueType: 'dependency',
|
||||||
|
name: ['asset_projects_id'],
|
||||||
|
columns: ({ asset_projects_id }) => {
|
||||||
|
return [
|
||||||
|
Selects?.ChargeStandard({
|
||||||
|
title: '选择收费标准',
|
||||||
|
key: 'house_charge_standards_id',
|
||||||
|
params: {
|
||||||
|
asset_projects_id: asset_projects_id,
|
||||||
|
},
|
||||||
|
colProps: { span: 24 },
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
fieldProps: {
|
||||||
|
showSearch: true,
|
||||||
|
},
|
||||||
|
}),
|
||||||
|
];
|
||||||
|
},
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'month',
|
||||||
|
title: '选择生成月份',
|
||||||
|
valueType: 'date',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
fieldProps: {
|
||||||
|
picker: 'month',
|
||||||
|
format: 'YYYY-MM',
|
||||||
|
valueFormat: 'YYYY-MM',
|
||||||
|
style: {
|
||||||
|
width: '100%',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'start_date',
|
||||||
|
title: '计费开始日期',
|
||||||
|
valueType: 'date',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
fieldProps: {
|
||||||
|
style: {
|
||||||
|
width: '100%',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
{
|
||||||
|
key: 'end_date',
|
||||||
|
title: '计费结束日期',
|
||||||
|
valueType: 'date',
|
||||||
|
colProps: { span: 24 },
|
||||||
|
fieldProps: {
|
||||||
|
style: {
|
||||||
|
width: '100%',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
},
|
||||||
|
]}
|
||||||
|
/>
|
||||||
|
);
|
||||||
|
}
|
||||||
@ -9,11 +9,12 @@ import { Apis } from '@/gen/Apis';
|
|||||||
import { HouseChargeTaskDetailsStatusEnum } from '@/gen/Enums';
|
import { HouseChargeTaskDetailsStatusEnum } from '@/gen/Enums';
|
||||||
import { ProTable } from '@ant-design/pro-components';
|
import { ProTable } from '@ant-design/pro-components';
|
||||||
import { Space } from 'antd';
|
import { Space } from 'antd';
|
||||||
|
import ChargeTasksCreate from './modals/ChargeTasksCreate';
|
||||||
|
|
||||||
export default function Index({ title = '任务结果' }) {
|
export default function Index({ title = '账单任务' }) {
|
||||||
// 注册当前页面为标签页
|
// 注册当前页面为标签页
|
||||||
usePageTabs({
|
usePageTabs({
|
||||||
tabKey: 'charge_task_details',
|
tabKey: 'house_charge_tasks',
|
||||||
tabLabel: title,
|
tabLabel: title,
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -21,7 +22,7 @@ export default function Index({ title = '任务结果' }) {
|
|||||||
<MyPageContainer
|
<MyPageContainer
|
||||||
title={title}
|
title={title}
|
||||||
enableTabs={true}
|
enableTabs={true}
|
||||||
tabKey="bills"
|
tabKey="house_charge_tasks"
|
||||||
tabLabel={title}
|
tabLabel={title}
|
||||||
>
|
>
|
||||||
<ProTable
|
<ProTable
|
||||||
@ -30,16 +31,16 @@ export default function Index({ title = '任务结果' }) {
|
|||||||
MyProTableProps.request(
|
MyProTableProps.request(
|
||||||
params,
|
params,
|
||||||
sort,
|
sort,
|
||||||
Apis.HouseCharage.HouseChargeTaskDetails.List,
|
Apis.HouseCharage.HouseChargeTasks.List,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
// toolBarRender={(action) => [
|
toolBarRender={(action) => [
|
||||||
// <ChargeTasksCreate
|
<ChargeTasksCreate
|
||||||
// key="Create"
|
key="Create"
|
||||||
// reload={action?.reload}
|
reload={action?.reload}
|
||||||
// title={title}
|
title="账单任务"
|
||||||
// />,
|
/>,
|
||||||
// ]}
|
]}
|
||||||
columns={[
|
columns={[
|
||||||
{
|
{
|
||||||
title: '任务ID',
|
title: '任务ID',
|
||||||
|
|||||||
@ -43,6 +43,13 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
key: 'asset_projects_id',
|
key: 'asset_projects_id',
|
||||||
colProps: { span: 24 },
|
colProps: { span: 24 },
|
||||||
formItemProps: { ...rulesHelper.text },
|
formItemProps: { ...rulesHelper.text },
|
||||||
|
fieldProps: {
|
||||||
|
onChange: (val: any) => {
|
||||||
|
form.setFieldsValue({
|
||||||
|
house_charge_standards_id: undefined,
|
||||||
|
});
|
||||||
|
},
|
||||||
|
},
|
||||||
}),
|
}),
|
||||||
{
|
{
|
||||||
valueType: 'dependency',
|
valueType: 'dependency',
|
||||||
@ -76,6 +83,12 @@ export default function Create(props: MyBetaModalFormProps) {
|
|||||||
style: {
|
style: {
|
||||||
width: '100%',
|
width: '100%',
|
||||||
},
|
},
|
||||||
|
onChange: (e: any, dateString: string) => {
|
||||||
|
form.setFieldsValue({
|
||||||
|
start_date: rulesHelper.getMonthStartDate(dateString),
|
||||||
|
end_date: rulesHelper.getMonthEndDate(dateString),
|
||||||
|
});
|
||||||
|
},
|
||||||
},
|
},
|
||||||
formItemProps: { ...rulesHelper.text },
|
formItemProps: { ...rulesHelper.text },
|
||||||
},
|
},
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user