diff --git a/src/api/his.ts b/src/api/his.ts index 5eb79f0..e0d294c 100644 --- a/src/api/his.ts +++ b/src/api/his.ts @@ -16,6 +16,8 @@ import type { PhysicalExamSignInResponse, InputTongyishuInfo, TongyishuGetResponse, + InputTongyishuSignSubmit, + TongyishuSignSubmitResponse, } from './types'; /** @@ -126,3 +128,23 @@ export const getTongyishuPdf = ( ).then(res => res.data); }; +/** + * 提交体检知情同意书签名(上传签名图片) + */ +export const submitTongyishuSign = ( + data: InputTongyishuSignSubmit +): Promise => { + const formData = new FormData(); + formData.append('sign_file', data.sign_file); + + return request.post( + `${MEDICAL_EXAM_BASE_PATH}/tongyishu-sign-submit?exam_id=${data.exam_id}&combination_code=${data.combination_code}`, + formData, + { + headers: { + 'Content-Type': 'multipart/form-data', + }, + } + ).then(res => res.data); +}; + diff --git a/src/api/types.ts b/src/api/types.ts index 2b30bc4..cf54970 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -307,3 +307,32 @@ export interface OutputTongyishuInfo { */ export type TongyishuGetResponse = CommonActionResult; +/** + * 提交体检知情同意书签名入参 + */ +export interface InputTongyishuSignSubmit { + /** 体检ID */ + exam_id: number; + /** PDF文件组合代码 */ + combination_code: number; + /** 签名图片文件 */ + sign_file: File | Blob; +} + +/** + * 提交体检知情同意书签名出参 + */ +export interface OutputTongyishuSignInfo { + /** 体检知情同意书文件组合代码 */ + combination_code?: string | null; + /** 体检知情同意书PDF地址 */ + pdf_url?: string | null; + /** 消息内容 */ + message?: string | null; +} + +/** + * 提交体检知情同意书签名响应 + */ +export type TongyishuSignSubmitResponse = CommonActionResult; +