525 lines
13 KiB
TypeScript
525 lines
13 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,
|
|
InputDaojiandanInfo,
|
|
DaojiandanGetResponse,
|
|
InputDaojiandanSignSubmit,
|
|
DaojiandanSignSubmitResponse,
|
|
InputAddItemBillInfo,
|
|
AddItemBillGetResponse,
|
|
InputAddItemBillSignSubmit,
|
|
AddItemBillSignSubmitResponse,
|
|
InputDaojiandanPrintStatus,
|
|
DaojiandanPrintStatusResponse,
|
|
InputCustomerDetailEdit,
|
|
CustomerDetailEditResponse,
|
|
InputPhysicalExamAddItem,
|
|
PhysicalExamAddItemListResponse,
|
|
InputAddItemCustomerInfo,
|
|
AddItemCustomerInfoResponse,
|
|
InputChannelCompanyInfo,
|
|
ChannelCompanyInfoListResponse,
|
|
InputPhysicalExamAddOrder,
|
|
PhysicalExamQrcodeCreateResponse,
|
|
InputOrderPaymentInfo,
|
|
PhysicalExamIsPaymentResponse,
|
|
InputPhysicalExamDiningLog,
|
|
PhysicalExamDiningLogResponse,
|
|
InputTijianDiningLog,
|
|
TijianDiningLogResponse,
|
|
InputOperatorRemarkInfo,
|
|
OperatorRemarkInfoResponse,
|
|
InputOperatorRemarkInfoAdd,
|
|
OperatorRemarkInfoAddResponse,
|
|
InputVerificationCodeImage,
|
|
VerificationCodeImageResponse,
|
|
InputLoginByPassword,
|
|
LoginByPasswordResponse,
|
|
InputVerificationCodePhone,
|
|
VerificationCodePhoneResponse,
|
|
InputUserOwnedMenus,
|
|
UserOwnedMenusResponse,
|
|
InputB1ServiceBoard,
|
|
B1ServiceBoardResponse,
|
|
InputNorth3ServiceBoard,
|
|
North3ServiceBoardResponse,
|
|
InputReportSendQRcode,
|
|
ReportSendQRcodeResponse,
|
|
InputReportSendInfo,
|
|
ReportSendInfoResponse,
|
|
InputExpressContact,
|
|
ReportSendAddressSaveResponse,
|
|
} 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);
|
|
};
|
|
|
|
/**
|
|
* 获取体检加项客户信息
|
|
*/
|
|
export const getAddItemCustomerInfo = (
|
|
data: InputAddItemCustomerInfo
|
|
): Promise<AddItemCustomerInfoResponse> => {
|
|
return request.post<AddItemCustomerInfoResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/add-item-customer-info`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* 获取挂账公司信息列表
|
|
*/
|
|
export const getChannelCompanyList = (
|
|
data: InputChannelCompanyInfo = {}
|
|
): Promise<ChannelCompanyInfoListResponse> => {
|
|
return request.post<ChannelCompanyInfoListResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/channel-company-list`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* Native-生成扫码支付二维码
|
|
*/
|
|
export const createNativePaymentQrcode = (
|
|
data: InputPhysicalExamAddOrder
|
|
): Promise<PhysicalExamQrcodeCreateResponse> => {
|
|
return request.post<PhysicalExamQrcodeCreateResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/qrcode-create`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* Native-查询支付是否成功
|
|
*/
|
|
export const checkNativePaymentStatus = (
|
|
data: InputOrderPaymentInfo
|
|
): Promise<PhysicalExamIsPaymentResponse> => {
|
|
return request.post<PhysicalExamIsPaymentResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/is-payment`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* 获取体检导检单PDF
|
|
*/
|
|
export const getDaojiandanPdf = (
|
|
data: InputDaojiandanInfo
|
|
): Promise<DaojiandanGetResponse> => {
|
|
return request.post<DaojiandanGetResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/daojiandan-get`,
|
|
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);
|
|
};
|
|
|
|
/**
|
|
* 获取体检加项单PDF
|
|
*/
|
|
export const getAddItemBillPdf = (
|
|
data: InputAddItemBillInfo
|
|
): Promise<AddItemBillGetResponse> => {
|
|
return request.post<AddItemBillGetResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/add-item-bill-get`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* 提交体检加项单签名生成PDF
|
|
*/
|
|
export const submitAddItemBillSign = (
|
|
data: InputAddItemBillSignSubmit
|
|
): Promise<AddItemBillSignSubmitResponse> => {
|
|
const formData = new FormData();
|
|
formData.append('sign_file', data.sign_file);
|
|
|
|
return request.post<AddItemBillSignSubmitResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/add-item-bill-sign-submit?exam_id=${data.exam_id}`,
|
|
formData,
|
|
{
|
|
headers: {
|
|
'Content-Type': 'multipart/form-data',
|
|
},
|
|
}
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* 体检导检单打印状态修改
|
|
*/
|
|
export const editDaojiandanPrintStatus = (
|
|
data: InputDaojiandanPrintStatus
|
|
): Promise<DaojiandanPrintStatusResponse> => {
|
|
return request.post<DaojiandanPrintStatusResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/print-status-edit`,
|
|
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> => {
|
|
// 从 localStorage 获取 accessToken
|
|
const accessToken = typeof window !== 'undefined'
|
|
? localStorage.getItem('accessToken')
|
|
: null;
|
|
|
|
const headers: Record<string, string> = {};
|
|
if (accessToken) {
|
|
headers.Authorization = `Bearer ${accessToken}`;
|
|
}
|
|
|
|
return request.post<UserOwnedMenusResponse>(
|
|
`/api/auth/user/owned/menus`,
|
|
data,
|
|
{
|
|
headers,
|
|
}
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* B1服务看板
|
|
*/
|
|
export const getB1ServiceBoard = (
|
|
data: InputB1ServiceBoard = {}
|
|
): Promise<B1ServiceBoardResponse> => {
|
|
return request.post<B1ServiceBoardResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/b1-service-board`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* 北3服务看板
|
|
*/
|
|
export const getNorth3ServiceBoard = (
|
|
data: InputNorth3ServiceBoard = {}
|
|
): Promise<North3ServiceBoardResponse> => {
|
|
return request.post<North3ServiceBoardResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/north3-service-board`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* 报告寄送登记二维码
|
|
*/
|
|
export const getReportSendQRcode = (
|
|
data: InputReportSendQRcode
|
|
): Promise<ReportSendQRcodeResponse> => {
|
|
return request.post<ReportSendQRcodeResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/report-send-qrcode`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* 查看报告寄送地址
|
|
*/
|
|
export const getReportSendInfo = (
|
|
data: InputReportSendInfo
|
|
): Promise<ReportSendInfoResponse> => {
|
|
return request.post<ReportSendInfoResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/report-send-info`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|
|
/**
|
|
* 保存体检客户报告邮寄地址
|
|
*/
|
|
export const saveReportSendAddress = (
|
|
data: InputExpressContact
|
|
): Promise<ReportSendAddressSaveResponse> => {
|
|
return request.post<ReportSendAddressSaveResponse>(
|
|
`${MEDICAL_EXAM_BASE_PATH}/report-send-address-save`,
|
|
data
|
|
).then(res => res.data);
|
|
};
|
|
|