import request, { downloadExcelRequest } from '../../utils/request'; import { Result, ResultList, _Pager_Params } from '../../services/types'; // 床位 export interface BedFields { searchValue: string; createBy: string; createTime: string; updateBy: string; updateTime: string; remark: string; params: Record; orgCode: string; orgName: string; deptCode: string; deptName: string; bedCode: string; bedNo: string; bedClass: string; bedStatus: string; version: string; createrUuid: string; updaterUuid: string; createDate: string; updateDate: string; } // 列表 interface GetList_Params extends _Pager_Params, BedFields {} type ListResult = ResultList; /** @name 床位列表 */ export async function getListApi(params: Partial) { return request>({ url: '/bed/list', method: 'get', params, }); } // 新增 type _Add_Params = Partial; export async function addApi(data: _Add_Params) { return request({ url: '/bed', method: 'post', data, }); } // 编辑 type _Update_Params = Partial; export async function updateApi(data: _Update_Params) { return request({ url: '/bed/edit', method: 'post', data, }); } export async function importApi(data: FormData): Promise { return request({ url: '/bed/import', method: 'post', data, }); } /**@name 批量操作 */ interface BedProps { orgCode: string; deptCode: string; bedCode: string; } interface BatchProps { beds: BedProps[]; bedStatus: string; } export async function batchApi(data: BatchProps) { return request({ url: '/bed/batch', method: 'post', data, }); } /** * @name 批量删除 */ export async function delApi(data: BedProps[]) { return request({ url: `/bed/delete`, method: 'post', data, }); } export async function exportApi() { return downloadExcelRequest( { url: '/bed/export', params: { tempOnly: 1 }, method: 'post', }, '床位模板', ); }