gaoluyang
3 天以前 98312d84f785c09574bfd5add730ea448fb0cbd5
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
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,
  });
}