diff --git a/src/pages/UI6/UI6.tsx b/src/pages/UI6/UI6.tsx index 339427d..1fbe30e 100644 --- a/src/pages/UI6/UI6.tsx +++ b/src/pages/UI6/UI6.tsx @@ -5,13 +5,24 @@ import { useNavigate } from "react-router-dom"; import BackButton from "../../components/BackButton"; import ConfirmButton from "../../components/ConfirmButton"; import DecorLine from "../../components/DecorLine"; -import { getPackagItemDetail } from "../../api/hisApi"; +import { getPackagItemDetail, getOptionalItemList } from "../../api/hisApi"; import upgradeImg from "../../assets/upgrade.png"; const UI6: React.FC = () => { const navigate = useNavigate(); - const handleBack = () => { + const handleBack = async () => { + const id_no = localStorage.getItem("lastIdCardNo"); + if (id_no) { + try { + const res = await getOptionalItemList(id_no as string); + if (res && res.Status === 200) { + window.electronAPI.log("info", `撤销体检选项项目列表成功`); + } + } catch (error) { + console.error("getOptionalItemList error:", error); + } + } navigate(-1); }; @@ -25,7 +36,6 @@ const UI6: React.FC = () => { getListData(); }, []); - const getListData = async () => { const id_no = localStorage.getItem("lastIdCardNo"); if (!id_no) { @@ -61,16 +71,16 @@ const UI6: React.FC = () => { // 兼容旧格式(一个字符串里用顿号分隔)和新格式(每条记录一个项目) const projectIds: string[] = item.project_id ? String(item.project_id) - .split("、") - .map((id: string) => id.trim()) - .filter((id: string) => id) + .split("、") + .map((id: string) => id.trim()) + .filter((id: string) => id) : []; const projectNames: string[] = item.project_name ? String(item.project_name) - .split("、") - .map((name: string) => name.trim()) - .filter((name: string) => name) + .split("、") + .map((name: string) => name.trim()) + .filter((name: string) => name) : []; if (!departmentMap.has(deptId)) { @@ -106,7 +116,6 @@ const UI6: React.FC = () => { } }; - return (
@@ -122,32 +131,37 @@ const UI6: React.FC = () => { {localStorage.getItem("gender") === "男" ? "先生" : "女士"}{" "} {PackageInfo.package_name} -

- 尊敬的客户,以下是您预约的 {PackageInfo.appointment_datetime} 体检套餐详情,请核对确认 + 尊敬的客户,以下是您预约的 {PackageInfo.appointment_datetime}{" "} + 体检套餐详情,请核对确认
- - + {ListData.map((item, index) => ( - + ))}
科室检查项目 + 检查项目 +
{item.department_name} + {item.department_name} + - {item.project_names.map((project: string, pIndex: number) => ( -
- {project} -
- ))} + {item.project_names.map( + (project: string, pIndex: number) => ( +
+ {project} +
+ ) + )}