添加获取可选体检项目列表的功能,并优化代码格式
This commit is contained in:
@@ -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>
|
||||
))}
|
||||
|
||||
Reference in New Issue
Block a user