322 lines
8.0 KiB
TypeScript
322 lines
8.0 KiB
TypeScript
import request from './request';
|
|
import type {
|
|
InputTodayExamStatisticsInfo,
|
|
TodayExamStatisticsResponse,
|
|
InputRevenueStatisticsInfo,
|
|
RevenueStatisticsResponse,
|
|
InputTodayExamProgress,
|
|
TodayExamProgressResponse,
|
|
InputPhysicalExamCustomerList,
|
|
PhysicalExamCustomerListResponse,
|
|
InputPhysicalExamProgressDetail,
|
|
PhysicalExamProgressDetailResponse,
|
|
InputCustomerDetail,
|
|
CustomerDetailResponse,
|
|
InputMedicalExamCenterSignIn,
|
|
PhysicalExamSignInResponse,
|
|
InputTongyishuInfo,
|
|
TongyishuGetResponse,
|
|
InputTongyishuSignSubmit,
|
|
TongyishuSignSubmitResponse,
|
|
InputDaojiandanSignSubmit,
|
|
DaojiandanSignSubmitResponse,
|
|
InputCustomerDetailEdit,
|
|
CustomerDetailEditResponse,
|
|
InputPhysicalExamAddItem,
|
|
PhysicalExamAddItemListResponse,
|
|
InputPhysicalExamDiningLog,
|
|
PhysicalExamDiningLogResponse,
|
|
InputTijianDiningLog,
|
|
TijianDiningLogResponse,
|
|
InputOperatorRemarkInfo,
|
|
OperatorRemarkInfoResponse,
|
|
InputOperatorRemarkInfoAdd,
|
|
OperatorRemarkInfoAddResponse,
|
|
InputVerificationCodeImage,
|
|
VerificationCodeImageResponse,
|
|
InputLoginByPassword,
|
|
LoginByPasswordResponse,
|
|
InputVerificationCodePhone,
|
|
VerificationCodePhoneResponse,
|
|
InputUserOwnedMenus,
|
|
UserOwnedMenusResponse,
|
|
} from './types';
|
|
|
|
/**
|
|
* 自助机HIS接口
|
|
* 基础路径: /api/his-web/medical-exam-center-app/
|
|
*/
|
|
const MEDICAL_EXAM_BASE_PATH = '/api/his-web/medical-exam-center-app';
|
|
|
|
/**
|
|
* 今日体检统计信息
|
|
* @param data 请求参数(空对象)
|
|
* @returns 今日体检统计信息
|
|
*/
|
|
export const getTodayExamStatistics = (
|
|
data: InputTodayExamStatisticsInfo = {}
|
|
): Promise<TodayExamStatisticsResponse> => {
|
|
return request.post<TodayExamStatisticsResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/today-exam-statistics`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* 营收数据统计
|
|
* @param data 请求参数(空对象)
|
|
* @returns 营收数据统计信息
|
|
*/
|
|
export const getRevenueStatistics = (
|
|
data: InputRevenueStatisticsInfo = {}
|
|
): Promise<RevenueStatisticsResponse> => {
|
|
return request.post<RevenueStatisticsResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/revenue-statistics`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* 今日体检进度信息
|
|
* @param data 请求参数(空对象)
|
|
* @returns 今日体检进度信息
|
|
*/
|
|
export const getTodayExamProgress = (
|
|
data: InputTodayExamProgress = {}
|
|
): Promise<TodayExamProgressResponse> => {
|
|
return request.post<TodayExamProgressResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/today-exam-progress`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* 体检客户列表
|
|
*/
|
|
export const getPhysicalExamCustomerList = (
|
|
data: InputPhysicalExamCustomerList
|
|
): Promise<PhysicalExamCustomerListResponse> => {
|
|
return request.post<PhysicalExamCustomerListResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/customer-list`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* 体检进度详情
|
|
*/
|
|
export const getPhysicalExamProgressDetail = (
|
|
data: InputPhysicalExamProgressDetail
|
|
): Promise<PhysicalExamProgressDetailResponse> => {
|
|
return request.post<PhysicalExamProgressDetailResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/progress`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* 客户详情
|
|
*/
|
|
export const getCustomerDetail = (
|
|
data: InputCustomerDetail
|
|
): Promise<CustomerDetailResponse> => {
|
|
return request.post<CustomerDetailResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/customer-detail`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* iPad 体检中心签到
|
|
*/
|
|
export const signInMedicalExamCenter = (
|
|
data: InputMedicalExamCenterSignIn
|
|
): Promise<PhysicalExamSignInResponse> => {
|
|
const formData = new FormData();
|
|
formData.append('id_no_pic', data.id_no_pic);
|
|
|
|
return request.post<PhysicalExamSignInResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/sign-in`,
|
|
formData,
|
|
{
|
|
headers: {
|
|
'Content-Type': 'multipart/form-data',
|
|
},
|
|
}
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* 获取体检知情同意书PDF
|
|
*/
|
|
export const getTongyishuPdf = (
|
|
data: InputTongyishuInfo
|
|
): Promise<TongyishuGetResponse> => {
|
|
return request.post<TongyishuGetResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/tongyishu-get`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* 提交体检知情同意书签名(上传签名图片)
|
|
*/
|
|
export const submitTongyishuSign = (
|
|
data: InputTongyishuSignSubmit
|
|
): Promise<TongyishuSignSubmitResponse> => {
|
|
const formData = new FormData();
|
|
formData.append('sign_file', data.sign_file);
|
|
|
|
return request.post<TongyishuSignSubmitResponse>(
|
|
`${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);
|
|
};
|
|
|
|
/**
|
|
* 客户信息编辑
|
|
*/
|
|
export const editCustomerDetail = (
|
|
data: InputCustomerDetailEdit
|
|
): Promise<CustomerDetailEditResponse> => {
|
|
return request.post<CustomerDetailEditResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/customer-detail-edit`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* 搜索体检加项
|
|
*/
|
|
export const searchPhysicalExamAddItem = (
|
|
data: InputPhysicalExamAddItem
|
|
): Promise<PhysicalExamAddItemListResponse> => {
|
|
return request.post<PhysicalExamAddItemListResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/add-item-list`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* 提交体检签名生成导检单PDF
|
|
*/
|
|
export const submitDaojiandanSign = (
|
|
data: InputDaojiandanSignSubmit
|
|
): Promise<DaojiandanSignSubmitResponse> => {
|
|
const formData = new FormData();
|
|
formData.append('sign_file', data.sign_file);
|
|
|
|
return request.post<DaojiandanSignSubmitResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/daojiandan-sign-submit?exam_id=${data.exam_id}`,
|
|
formData,
|
|
{
|
|
headers: {
|
|
'Content-Type': 'multipart/form-data',
|
|
},
|
|
}
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* 体检用餐登记列表
|
|
*/
|
|
export const getPhysicalExamDiningList = (
|
|
data: InputPhysicalExamDiningLog
|
|
): Promise<PhysicalExamDiningLogResponse> => {
|
|
return request.post<PhysicalExamDiningLogResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/dining-list`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* 体检用餐登记
|
|
*/
|
|
export const registerPhysicalExamDining = (
|
|
data: InputTijianDiningLog
|
|
): Promise<TijianDiningLogResponse> => {
|
|
return request.post<TijianDiningLogResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/dining-register`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* 获取操作员备注信息
|
|
*/
|
|
export const getOperatorRemarkInfo = (
|
|
data: InputOperatorRemarkInfo
|
|
): Promise<OperatorRemarkInfoResponse> => {
|
|
return request.post<OperatorRemarkInfoResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/remark-get`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* 保存操作员备注信息
|
|
*/
|
|
export const saveOperatorRemarkInfo = (
|
|
data: InputOperatorRemarkInfoAdd
|
|
): Promise<OperatorRemarkInfoAddResponse> => {
|
|
return request.post<OperatorRemarkInfoAddResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/remark-save`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* 获取登录验证码(图片)
|
|
*/
|
|
export const getVerificationCodeImage = (
|
|
data: InputVerificationCodeImage
|
|
): Promise<VerificationCodeImageResponse> => {
|
|
// 注意:此接口基础路径与其他 HIS 接口不同,直接使用 /api/auth
|
|
return request.post<VerificationCodeImageResponse>(
|
|
`/api/auth/verification-code/image`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* 登录(账号密码登录-图片验证码)
|
|
*/
|
|
export const loginByPassword = (
|
|
data: InputLoginByPassword
|
|
): Promise<LoginByPasswordResponse> => {
|
|
return request.post<LoginByPasswordResponse>(
|
|
`/api/auth/login-by-password`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* 获取登录验证码(手机号)
|
|
*/
|
|
export const getVerificationCodePhone = (
|
|
data: InputVerificationCodePhone
|
|
): Promise<VerificationCodePhoneResponse> => {
|
|
return request.post<VerificationCodePhoneResponse>(
|
|
`/api/auth/verification-code/phone`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* 获取用户菜单权限
|
|
*/
|
|
export const getUserOwnedMenus = (
|
|
data: InputUserOwnedMenus
|
|
): Promise<UserOwnedMenusResponse> => {
|
|
return request.post<UserOwnedMenusResponse>(
|
|
`/api/auth/user/owned/menus`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|