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 (
| 科室 | -检查项目 | ++ 检查项目 + |
|---|---|---|
| {item.department_name} | ++ {item.department_name} + |
- {item.project_names.map((project: string, pIndex: number) => (
-
- {project}
-
- ))}
+ {item.project_names.map(
+ (project: string, pIndex: number) => (
+
+ {project}
+
+ )
+ )}
|