管理员系统完成消耗列表及表头接口对接
This commit is contained in:
@@ -624,6 +624,25 @@ export async function uploadImage(file: File): Promise<{ url: string; filename:
|
||||
return { url: data.url, filename: data.filename };
|
||||
}
|
||||
|
||||
// 自定义表头字段
|
||||
export async function getFields(): Promise<any> {
|
||||
return api.get('/material-consumption/fields');
|
||||
}
|
||||
|
||||
// 查询素材消耗列表
|
||||
export interface MaterialConsumpParams {
|
||||
advertiser_id?: string;
|
||||
user_id?: string;
|
||||
consume_date?: [string, string];
|
||||
page?: number;
|
||||
page_size?: number;
|
||||
}
|
||||
export async function getMaterialConsumpList(params: MaterialConsumpParams): Promise<any> {
|
||||
const query = new URLSearchParams();
|
||||
if (params.advertiser_id) query.set('advertiser_id', params.advertiser_id);
|
||||
if (params.user_id) query.set('user_id', params.user_id);
|
||||
if (params.consume_date !== undefined) query.set('consume_date', params.consume_date[0] + ',' + params.consume_date[1]);
|
||||
if (params.page !== undefined) query.set('page', String(params.page));
|
||||
if (params.page_size !== undefined) query.set('page_size', String(params.page_size));
|
||||
return api.get(`/material-consumption/admin/list?${query.toString()}`);
|
||||
}
|
||||
Reference in New Issue
Block a user