添加获取可选体检项目列表的功能,并优化代码格式

This commit is contained in:
yuchenglong
2026-01-14 09:42:24 +08:00
parent 5195902a1b
commit 481a948d8f

View File

@@ -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) {
@@ -106,7 +116,6 @@ const UI6: React.FC = () => {
}
};
return (
<div className="basic-root">
<div className="basic-white-block">
@@ -122,32 +131,37 @@ const UI6: React.FC = () => {
{localStorage.getItem("gender") === "男" ? "先生" : "女士"}{" "}
<strong className="ui6-package-name">
{PackageInfo.package_name}
</strong>
<br />
<br />
{PackageInfo.appointment_datetime}
{PackageInfo.appointment_datetime}{" "}
</span>
<div className="ui6-table-container">
<table className="ui6-table">
<thead>
<tr>
<th className="ui6-table-header ui6-table-dept"></th>
<th className="ui6-table-header ui6-table-project"></th>
<th className="ui6-table-header ui6-table-project">
</th>
</tr>
</thead>
<tbody>
{ListData.map((item, index) => (
<tr key={index} className="ui6-table-row">
<td className="ui6-table-dept-cell">{item.department_name}</td>
<td className="ui6-table-dept-cell">
{item.department_name}
</td>
<td className="ui6-table-project-cell">
{item.project_names.map((project: string, pIndex: number) => (
{item.project_names.map(
(project: string, pIndex: number) => (
<div key={pIndex} className="ui6-project-item">
<span style={{ paddingLeft: 20 }}>{project}</span>
</div>
))}
)
)}
</td>
</tr>
))}