53 lines
2.0 KiB
TypeScript
53 lines
2.0 KiB
TypeScript
/**
|
|
* Copyright (c) 2013-Now https://jeesite.com All rights reserved.
|
|
* No deletion without permission, or be held responsible to law.
|
|
* @author gaoxq
|
|
*/
|
|
import { defHttp } from '@jeesite/core/utils/http/axios';
|
|
import { useGlobSetting } from '@jeesite/core/hooks/setting';
|
|
import { BasicModel, Page } from '@jeesite/core/api/model/baseModel';
|
|
import { UploadApiResult } from '@jeesite/core/api/sys/upload';
|
|
import { UploadFileParams } from '@jeesite/types/axios';
|
|
import { AxiosProgressEvent } from 'axios';
|
|
|
|
const { ctxPath, adminPath } = useGlobSetting();
|
|
|
|
export interface ErpBudgets extends BasicModel<ErpBudgets> {
|
|
createTime?: string; // 记录时间
|
|
budgetId?: string; // 唯一主键
|
|
categoryId: string; // 分类标识
|
|
budgetMonth: string; // 预算年月
|
|
budgetAmount: number; // 预算金额
|
|
usedAmount: number; // 使用金额
|
|
usedRatio: number; // 预算占比
|
|
overAmount: number; // 超支金额
|
|
updateTime?: string; // 更新时间
|
|
}
|
|
|
|
export const erpBudgetsList = (params?: ErpBudgets | any) =>
|
|
defHttp.get<ErpBudgets>({ url: adminPath + '/erp/budgets/list', params });
|
|
|
|
export const erpBudgetsListData = (params?: ErpBudgets | any) =>
|
|
defHttp.post<Page<ErpBudgets>>({ url: adminPath + '/erp/budgets/listData', params });
|
|
|
|
export const erpBudgetsForm = (params?: ErpBudgets | any) =>
|
|
defHttp.get<ErpBudgets>({ url: adminPath + '/erp/budgets/form', params });
|
|
|
|
export const erpBudgetsSave = (params?: any, data?: ErpBudgets | any) =>
|
|
defHttp.postJson<ErpBudgets>({ url: adminPath + '/erp/budgets/save', params, data });
|
|
|
|
export const erpBudgetsImportData = (
|
|
params: UploadFileParams,
|
|
onUploadProgress: (progressEvent: AxiosProgressEvent) => void,
|
|
) =>
|
|
defHttp.uploadFile<UploadApiResult>(
|
|
{
|
|
url: ctxPath + adminPath + '/erp/budgets/importData',
|
|
onUploadProgress,
|
|
},
|
|
params,
|
|
);
|
|
|
|
export const erpBudgetsDelete = (params?: ErpBudgets | any) =>
|
|
defHttp.get<ErpBudgets>({ url: adminPath + '/erp/budgets/delete', params });
|