From 33d44c9728b5563ef791fdce16f00b25cf0f7b14 Mon Sep 17 00:00:00 2001 From: xianyi Date: Wed, 14 Jan 2026 10:56:00 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0=E6=8E=A5=E5=8F=A3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/api/his.ts | 27 ++++++++++ src/api/types.ts | 75 +++++++++++++++++++++++++++ src/components/exam/ExamModal.tsx | 9 +--- src/components/exam/ExamSection.tsx | 9 +--- src/components/exam/ExamSignPanel.tsx | 37 ------------- src/components/layout/TopBar.tsx | 2 +- src/utils/examActions.ts | 27 ---------- 7 files changed, 106 insertions(+), 80 deletions(-) diff --git a/src/api/his.ts b/src/api/his.ts index a3fa5c2..2c07896 100644 --- a/src/api/his.ts +++ b/src/api/his.ts @@ -70,6 +70,10 @@ import type { ReportSendInfoResponse, InputExpressContact, ReportSendAddressSaveResponse, + InputExamOptionalItemList, + OptionalItemInfoListResponse, + InputOptionalPackageRemove, + OptionalPackageRemoveResponse, } from './types'; /** @@ -550,3 +554,26 @@ export const getTijianPdfFile = ( ).then(res => res.data); }; +/** + * 通过身份证号获取体检选项项目列表 + */ +export const getExamOptionalItemList = ( + data: InputExamOptionalItemList +): Promise => { + return request.post( + `${MEDICAL_EXAM_BASE_PATH}/optional-item-list`, + data + ).then(res => res.data); +}; + +/** + * 移除弃选体检套餐选项 + */ +export const removeOptionalPackage = ( + data: InputOptionalPackageRemove +): Promise => { + return request.post( + `${MEDICAL_EXAM_BASE_PATH}/optional-item-remove`, + data + ).then(res => res.data); +}; diff --git a/src/api/types.ts b/src/api/types.ts index 3f38a5d..4bf8ae3 100644 --- a/src/api/types.ts +++ b/src/api/types.ts @@ -1254,3 +1254,78 @@ export interface OutputTijianPdfFileInfo { */ export type TijianPdfFileGetResponse = CommonActionResult; +/** + * 通过身份证号获取体检选项项目列表入参 + */ +export interface InputExamOptionalItemList { + /** 体检ID */ + physical_exam_id: number; +} + +/** + * 自助机体检套餐信息 + */ +export interface PoPhysicalExamPackageInfo { + /** 体检ID */ + physical_exam_id?: number | null; + /** 是否可选套餐(1-是 0-否) */ + is_optional_package?: number | null; + /** 是否可选套餐名称 */ + is_optional_package_name?: string | null; + /** 套餐代码 */ + package_code?: number | null; + /** 套餐名称 */ + package_name?: string | null; + /** 登记时间 */ + registration_time?: string | null; +} + +/** + * 自助机体检可选项目列表出参 + */ +export interface OutputPhysicalExamItemInfo { + /** 组合名称 */ + combination_name?: string | null; + /** 组合代码 */ + combination_code?: number | null; + /** 套餐代码 */ + package_code?: number | null; +} + +/** + * 自助机体检项目列表出参 + */ +export interface OutputOptionalItemInfoList { + /** 套餐信息 */ + packageInfo?: PoPhysicalExamPackageInfo | null; + /** 可选套餐项目列表 */ + listOptionalItem?: OutputPhysicalExamItemInfo[] | null; +} + +/** + * 通过身份证号获取体检选项项目列表响应 + */ +export type OptionalItemInfoListResponse = CommonActionResult; + +/** + * 移除弃选体检套餐选项入参 + */ +export interface InputOptionalPackageRemove { + /** 体检ID */ + physical_exam_id: number; + /** 组合代码(多个项目以逗号分割,例如:123,456) */ + combination_code_ids: string; +} + +/** + * 移除弃选体检套餐选项出参 + */ +export interface OutputOptionalPackageRemove { + /** 是否成功(1-成功 0-失败) */ + is_success?: number | null; +} + +/** + * 移除弃选体检套餐选项响应 + */ +export type OptionalPackageRemoveResponse = CommonActionResult; diff --git a/src/components/exam/ExamModal.tsx b/src/components/exam/ExamModal.tsx index 8edb41e..a2a24cd 100644 --- a/src/components/exam/ExamModal.tsx +++ b/src/components/exam/ExamModal.tsx @@ -3,7 +3,6 @@ import { useEffect, useState } from 'react'; import type { ExamClient, ExamModalTab } from '../../data/mockData'; import type { CustomerAppointmentInfo, CustomerExamAddItem, CustomerInfo, PhysicalExamProgressItem } from '../../api'; import { getCustomerDetail, getPhysicalExamProgress } from '../../api'; -import { isExamActionDone } from '../../utils/examActions'; import { ExamDetailPanel } from './ExamDetailPanel'; import { ExamAddonPanel } from './ExamAddonPanel'; import { ExamPrintPanel } from './ExamPrintPanel'; @@ -26,13 +25,9 @@ export const ExamModal = ({ client, tab, onTabChange, onClose }: ExamModalProps) { key: 'delivery', label: '报告寄送' }, ]; - // 检查操作是否已完成(与 ExamSection 中的逻辑保持一致) - const idCardSignInDone = isExamActionDone(client.id, 'idCardSignIn'); - const printSignDone = isExamActionDone(client.id, 'printSign'); - - const signDone = ((client as any).is_sign_in === 1) || idCardSignInDone || client.signStatus === '已签到' || client.checkedItems.includes('签到'); + const signDone = ((client as any).is_sign_in === 1) || client.signStatus === '已签到' || client.checkedItems.includes('签到'); const addonDone = (client.addonCount || 0) > 0; - const printDone = printSignDone || !!client.guidePrinted; + const printDone = !!client.guidePrinted; const deliveryDone = !!client.deliveryDone; const tabDone: Record = { diff --git a/src/components/exam/ExamSection.tsx b/src/components/exam/ExamSection.tsx index f40832c..6461ef2 100644 --- a/src/components/exam/ExamSection.tsx +++ b/src/components/exam/ExamSection.tsx @@ -2,7 +2,6 @@ import { useEffect, useState, useRef } from 'react'; import type { ExamClient, ExamModalTab } from '../../data/mockData'; import { EXAM_TAGS } from '../../data/mockData'; import { getTodayExamProgress } from '../../api'; -import { isExamActionDone } from '../../utils/examActions'; import { Badge, Button, Card, CardContent, CardHeader, InfoCard, Input } from '../ui'; import { cls } from '../../utils/cls'; @@ -215,13 +214,7 @@ export const ExamSection = ({ <>
{displayedClients.map((client) => { - // 检查操作记录:优先使用 localStorage 记录,如果没有则使用原有逻辑 - const idCardSignInDone = isExamActionDone(client.id, 'idCardSignIn'); - const printSignDone = isExamActionDone(client.id, 'printSign'); - - const signDone = idCardSignInDone || client.signStatus === '已签到' || client.checkedItems.includes('签到'); const addonCount = client.addonCount || 0; - const printDone = printSignDone || !!client.guidePrinted; const openModal = (tab: ExamModalTab) => onOpenModal(client.id, tab); @@ -267,7 +260,7 @@ export const ExamSection = ({ }} > 签到 - {((client as any).is_sign_in === 1) && } + {client.signStatus === '已签到' && }