import type { PageParam, PageResult } from '@vben/request';
|
|
import { requestClient } from '#/api/request';
|
|
export namespace FinIntangibleAssetApi {
|
/** 无形资产信息 */
|
export interface IntangibleAsset {
|
id?: number; // 资产编号
|
assetCode?: string; // 资产编码
|
assetName?: string; // 资产名称
|
category?: string; // 资产类别
|
certificateNo?: string; // 证书编号
|
acquisitionDate?: string; // 取得日期 yyyy-MM-dd
|
originalValue?: number; // 资产原值
|
amortizationPeriod?: number; // 摊销年限(年)
|
residualRate?: number; // 残值率(%)
|
monthlyAmortization?: number; // 月摊销额(后端计算,只读)
|
accumulatedAmortization?: number; // 累计摊销
|
netValue?: number; // 净值
|
validityDate?: string; // 有效期至 yyyy-MM-dd
|
status?: number; // 状态:1在用 2已失效 3已摊销完
|
description?: string; // 资产描述
|
remark?: string; // 备注
|
createTime?: Date; // 创建时间
|
}
|
|
/** 计提摊销结果 */
|
export interface AmortizeResult {
|
processedCount: number; // 本次计提的资产数量
|
totalMonthlyAmortization: number; // 本次计提摊销合计
|
}
|
}
|
|
/** 查询无形资产分页 */
|
export function getIntangibleAssetPage(params: PageParam) {
|
return requestClient.get<PageResult<FinIntangibleAssetApi.IntangibleAsset>>(
|
'/finance/intangible-asset/page',
|
{ params },
|
);
|
}
|
|
/** 查询无形资产列表(不分页,用于统计) */
|
export function getIntangibleAssetList() {
|
return requestClient.get<FinIntangibleAssetApi.IntangibleAsset[]>(
|
'/finance/intangible-asset/list',
|
);
|
}
|
|
/** 查询无形资产详情 */
|
export function getIntangibleAsset(id: number) {
|
return requestClient.get<FinIntangibleAssetApi.IntangibleAsset>(
|
`/finance/intangible-asset/get?id=${id}`,
|
);
|
}
|
|
/** 新增无形资产 */
|
export function createIntangibleAsset(
|
data: FinIntangibleAssetApi.IntangibleAsset,
|
) {
|
return requestClient.post('/finance/intangible-asset/create', data);
|
}
|
|
/** 修改无形资产 */
|
export function updateIntangibleAsset(
|
data: FinIntangibleAssetApi.IntangibleAsset,
|
) {
|
return requestClient.put('/finance/intangible-asset/update', data);
|
}
|
|
/** 删除无形资产 */
|
export function deleteIntangibleAsset(id: number) {
|
return requestClient.delete(`/finance/intangible-asset/delete?id=${id}`);
|
}
|
|
/** 批量删除无形资产 */
|
export function deleteIntangibleAssetList(ids: number[]) {
|
return requestClient.delete(
|
`/finance/intangible-asset/delete-list?ids=${ids.join(',')}`,
|
);
|
}
|
|
/** 计提摊销(ids 为空表示全部计提) */
|
export function amortizeIntangibleAssetList(ids: number[]) {
|
return requestClient.post<FinIntangibleAssetApi.AmortizeResult>(
|
`/finance/intangible-asset/amortize?ids=${ids.join(',')}`,
|
);
|
}
|
|
/** 导出无形资产 Excel */
|
export function exportIntangibleAsset(params: any) {
|
return requestClient.download('/finance/intangible-asset/export-excel', {
|
params,
|
});
|
}
|