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, 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 => { return request.post( `${MEDICAL_EXAM_BASE_PATH}/today-exam-statistics`, data ).then(res => res.data); }; /** * 营收数据统计 * @param data 请求参数(空对象) * @returns 营收数据统计信息 */ export const getRevenueStatistics = ( data: InputRevenueStatisticsInfo = {} ): Promise => { return request.post( `${MEDICAL_EXAM_BASE_PATH}/revenue-statistics`, data ).then(res => res.data); }; /** * 今日体检进度信息 * @param data 请求参数(空对象) * @returns 今日体检进度信息 */ export const getTodayExamProgress = ( data: InputTodayExamProgress = {} ): Promise => { return request.post( `${MEDICAL_EXAM_BASE_PATH}/today-exam-progress`, data ).then(res => res.data); }; /** * 体检客户列表 */ export const getPhysicalExamCustomerList = ( data: InputPhysicalExamCustomerList ): Promise => { return request.post( `${MEDICAL_EXAM_BASE_PATH}/customer-list`, data ).then(res => res.data); }; /** * 体检进度详情 */ export const getPhysicalExamProgressDetail = ( data: InputPhysicalExamProgressDetail ): Promise => { return request.post( `${MEDICAL_EXAM_BASE_PATH}/progress`, data ).then(res => res.data); }; /** * 客户详情 */ export const getCustomerDetail = ( data: InputCustomerDetail ): Promise => { return request.post( `${MEDICAL_EXAM_BASE_PATH}/customer-detail`, data ).then(res => res.data); }; /** * iPad 体检中心签到 */ export const signInMedicalExamCenter = ( data: InputMedicalExamCenterSignIn ): Promise => { const formData = new FormData(); formData.append('id_no_pic', data.id_no_pic); return request.post( `${MEDICAL_EXAM_BASE_PATH}/sign-in`, formData, { headers: { 'Content-Type': 'multipart/form-data', }, } ).then(res => res.data); }; /** * 获取体检知情同意书PDF */ export const getTongyishuPdf = ( data: InputTongyishuInfo ): Promise => { return request.post( `${MEDICAL_EXAM_BASE_PATH}/tongyishu-get`, data ).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); }; /** * 客户信息编辑 */ export const editCustomerDetail = ( data: InputCustomerDetailEdit ): Promise => { return request.post( `${MEDICAL_EXAM_BASE_PATH}/customer-detail-edit`, data ).then(res => res.data); }; /** * 搜索体检加项 */ export const searchPhysicalExamAddItem = ( data: InputPhysicalExamAddItem ): Promise => { return request.post( `${MEDICAL_EXAM_BASE_PATH}/add-item-list`, data ).then(res => res.data); }; /** * Native-生成扫码支付二维码 */ export const createNativePaymentQrcode = ( data: InputPhysicalExamAddOrder ): Promise => { return request.post( `${MEDICAL_EXAM_BASE_PATH}/qrcode-create`, data ).then(res => res.data); }; /** * Native-查询支付是否成功 */ export const checkNativePaymentStatus = ( data: InputOrderPaymentInfo ): Promise => { return request.post( `${MEDICAL_EXAM_BASE_PATH}/is-payment`, data ).then(res => res.data); }; /** * 提交体检签名生成导检单PDF */ export const submitDaojiandanSign = ( data: InputDaojiandanSignSubmit ): Promise => { const formData = new FormData(); formData.append('sign_file', data.sign_file); return request.post( `${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 => { return request.post( `${MEDICAL_EXAM_BASE_PATH}/dining-list`, data ).then(res => res.data); }; /** * 体检用餐登记 */ export const registerPhysicalExamDining = ( data: InputTijianDiningLog ): Promise => { return request.post( `${MEDICAL_EXAM_BASE_PATH}/dining-register`, data ).then(res => res.data); }; /** * 获取操作员备注信息 */ export const getOperatorRemarkInfo = ( data: InputOperatorRemarkInfo ): Promise => { return request.post( `${MEDICAL_EXAM_BASE_PATH}/remark-get`, data ).then(res => res.data); }; /** * 保存操作员备注信息 */ export const saveOperatorRemarkInfo = ( data: InputOperatorRemarkInfoAdd ): Promise => { return request.post( `${MEDICAL_EXAM_BASE_PATH}/remark-save`, data ).then(res => res.data); }; /** * 获取登录验证码(图片) */ export const getVerificationCodeImage = ( data: InputVerificationCodeImage ): Promise => { // 注意:此接口基础路径与其他 HIS 接口不同,直接使用 /api/auth return request.post( `/api/auth/verification-code/image`, data ).then(res => res.data); }; /** * 登录(账号密码登录-图片验证码) */ export const loginByPassword = ( data: InputLoginByPassword ): Promise => { return request.post( `/api/auth/login-by-password`, data ).then(res => res.data); }; /** * 获取登录验证码(手机号) */ export const getVerificationCodePhone = ( data: InputVerificationCodePhone ): Promise => { return request.post( `/api/auth/verification-code/phone`, data ).then(res => res.data); }; /** * 获取用户菜单权限 */ export const getUserOwnedMenus = ( data: InputUserOwnedMenus ): Promise => { // 从 localStorage 获取 accessToken const accessToken = typeof window !== 'undefined' ? localStorage.getItem('accessToken') : null; const headers: Record = {}; if (accessToken) { headers.Authorization = `Bearer ${accessToken}`; } return request.post( `/api/auth/user/owned/menus`, data, { headers, } ).then(res => res.data); }; /** * B1服务看板 */ export const getB1ServiceBoard = ( data: InputB1ServiceBoard = {} ): Promise => { return request.post( `${MEDICAL_EXAM_BASE_PATH}/b1-service-board`, data ).then(res => res.data); }; /** * 北3服务看板 */ export const getNorth3ServiceBoard = ( data: InputNorth3ServiceBoard = {} ): Promise => { return request.post( `${MEDICAL_EXAM_BASE_PATH}/north3-service-board`, data ).then(res => res.data); }; /** * 报告寄送登记二维码 */ export const getReportSendQRcode = ( data: InputReportSendQRcode ): Promise => { return request.post( `${MEDICAL_EXAM_BASE_PATH}/report-send-qrcode`, data ).then(res => res.data); }; /** * 查看报告寄送地址 */ export const getReportSendInfo = ( data: InputReportSendInfo ): Promise => { return request.post( `${MEDICAL_EXAM_BASE_PATH}/report-send-info`, data ).then(res => res.data); }; /** * 保存体检客户报告邮寄地址 */ export const saveReportSendAddress = ( data: InputExpressContact ): Promise => { return request.post( `${MEDICAL_EXAM_BASE_PATH}/report-send-address-save`, data ).then(res => res.data); };