|
@@ -276,11 +276,6 @@
|
|
|
<li><a href="#" onclick="loadContent('wardManagement')">病区管理</a></li>
|
|
<li><a href="#" onclick="loadContent('wardManagement')">病区管理</a></li>
|
|
|
<li><a href="#" onclick="loadContent('roomManagement')">病房管理</a></li>
|
|
<li><a href="#" onclick="loadContent('roomManagement')">病房管理</a></li>
|
|
|
<li><a href="#" onclick="loadContent('bedManagement')">床位管理</a></li>
|
|
<li><a href="#" onclick="loadContent('bedManagement')">床位管理</a></li>
|
|
|
- </ul>
|
|
|
|
|
- </li>
|
|
|
|
|
- <li class="menu-item">
|
|
|
|
|
- <a href="#" onclick="toggleSubmenu('medicalSubmenu')">👨⚕️ 医护管理</a>
|
|
|
|
|
- <ul class="submenu" id="medicalSubmenu">
|
|
|
|
|
<li><a href="#" onclick="loadContent('patientManagement')">患者管理</a></li>
|
|
<li><a href="#" onclick="loadContent('patientManagement')">患者管理</a></li>
|
|
|
</ul>
|
|
</ul>
|
|
|
</li>
|
|
</li>
|
|
@@ -322,12 +317,6 @@
|
|
|
<p>查看和管理院区相关信息</p>
|
|
<p>查看和管理院区相关信息</p>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <div class="card" onclick="loadContent('medicalStaff')">
|
|
|
|
|
- <div class="card-icon">👨⚕️</div>
|
|
|
|
|
- <h3>医护人员</h3>
|
|
|
|
|
- <p>管理医生和护士信息</p>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
<div class="card" onclick="loadContent('patientManagement')">
|
|
<div class="card" onclick="loadContent('patientManagement')">
|
|
|
<div class="card-icon">👤</div>
|
|
<div class="card-icon">👤</div>
|
|
|
<h3>患者信息</h3>
|
|
<h3>患者信息</h3>
|
|
@@ -786,6 +775,170 @@
|
|
|
}, 0);
|
|
}, 0);
|
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
|
|
+ case 'patientManagement':
|
|
|
|
|
+ pageTitle.textContent = '患者管理';
|
|
|
|
|
+ breadcrumb.textContent = '首页 > 院区信息管理 > 患者管理';
|
|
|
|
|
+ mainContent.innerHTML = `
|
|
|
|
|
+ <div style="background: white; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.1);">
|
|
|
|
|
+ <div style="margin-bottom: 15px;">
|
|
|
|
|
+ <!-- 第一行查询条件 -->
|
|
|
|
|
+ <div style="display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 15px; align-items: center;">
|
|
|
|
|
+ <div style="display: flex; align-items: center;">
|
|
|
|
|
+ <label style="white-space: nowrap; margin-right: 10px;">患者姓名:</label>
|
|
|
|
|
+ <input type="text" id="patientName" placeholder="请输入患者姓名(模糊查询)" style="padding: 6px; border: 1px solid #ddd; border-radius: 4px; width: 100px;">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div style="display: flex; align-items: center;">
|
|
|
|
|
+ <label style="white-space: nowrap; margin-right: 10px;">所属科室:</label>
|
|
|
|
|
+ <select id="patientDepartment" style="padding: 6px; border: 1px solid #ddd; border-radius: 4px; width: 100px;">
|
|
|
|
|
+ <option value="">全部科室</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div style="display: flex; align-items: center;">
|
|
|
|
|
+ <label style="white-space: nowrap; margin-right: 10px;">所属病区:</label>
|
|
|
|
|
+ <select id="patientWard" style="padding: 6px; border: 1px solid #ddd; border-radius: 4px; width: 100px;">
|
|
|
|
|
+ <option value="">全部病区</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div style="display: flex; align-items: center;">
|
|
|
|
|
+ <label style="white-space: nowrap; margin-right: 10px;">住院号:</label>
|
|
|
|
|
+ <select id="patientInpatientNo" style="padding: 6px; border: 1px solid #ddd; border-radius: 4px; width: 100px;">
|
|
|
|
|
+ <option value="">全部</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div style="display: flex; align-items: center;">
|
|
|
|
|
+ <label style="white-space: nowrap; margin-right: 10px;">房间号:</label>
|
|
|
|
|
+ <select id="patientRoomNo" style="padding: 6px; border: 1px solid #ddd; border-radius: 4px; width: 80px;">
|
|
|
|
|
+ <option value="">全部</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 第二行查询条件 -->
|
|
|
|
|
+ <div style="display: flex; flex-wrap: wrap; gap: 20px; margin-bottom: 15px; align-items: center;">
|
|
|
|
|
+ <div style="display: flex; align-items: center;">
|
|
|
|
|
+ <label style="white-space: nowrap; margin-right: 10px;">床位号:</label>
|
|
|
|
|
+ <select id="patientBedNo" style="padding: 6px; border: 1px solid #ddd; border-radius: 4px; width: 80px;">
|
|
|
|
|
+ <option value="">全部</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div style="display: flex; align-items: center;">
|
|
|
|
|
+ <label style="white-space: nowrap; margin-right: 10px;">护理级别:</label>
|
|
|
|
|
+ <select id="patientNurseLevel" style="padding: 6px; border: 1px solid #ddd; border-radius: 4px; width: 100px;">
|
|
|
|
|
+ <option value="">全部级别</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div style="display: flex; align-items: center;">
|
|
|
|
|
+ <label style="white-space: nowrap; margin-right: 10px;">在院状态:</label>
|
|
|
|
|
+ <select id="patientStatus" style="padding: 6px; border: 1px solid #ddd; border-radius: 4px; width: 100px;">
|
|
|
|
|
+ <option value="">全部状态</option>
|
|
|
|
|
+ </select>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div style="display: flex; align-items: center;">
|
|
|
|
|
+ <label style="white-space: nowrap; margin-right: 10px;">入院时间:</label>
|
|
|
|
|
+ <input type="date" id="patientAdmissionDate" style="padding: 6px; border: 1px solid #ddd; border-radius: 4px; width: 140px;">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div style="display: flex;">
|
|
|
|
|
+ <button class="btn btn-primary" onclick="searchPatients()" style="padding: 6px 12px; margin-right: 5px;">查询</button>
|
|
|
|
|
+ <button class="btn btn-secondary" onclick="clearPatientSearch()" style="padding: 6px 12px;">重置</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <table class="data-table" id="patientTable">
|
|
|
|
|
+ <thead>
|
|
|
|
|
+ <tr>
|
|
|
|
|
+ <th>入院时间</th>
|
|
|
|
|
+ <th>住院号</th>
|
|
|
|
|
+ <th>患者姓名</th>
|
|
|
|
|
+ <th>性别</th>
|
|
|
|
|
+ <th>年龄</th>
|
|
|
|
|
+ <th>所属科室</th>
|
|
|
|
|
+ <th>所属病区</th>
|
|
|
|
|
+ <th>房间号</th>
|
|
|
|
|
+ <th>床位号</th>
|
|
|
|
|
+ <th>护理级别</th>
|
|
|
|
|
+ <th>在院状态</th>
|
|
|
|
|
+ <th>操作</th>
|
|
|
|
|
+ </tr>
|
|
|
|
|
+ </thead>
|
|
|
|
|
+ <tbody id="patientTableBody">
|
|
|
|
|
+ <!-- 数据将通过JS动态加载 -->
|
|
|
|
|
+ </tbody>
|
|
|
|
|
+ </table>
|
|
|
|
|
+ </div>
|
|
|
|
|
+
|
|
|
|
|
+ <!-- 患者详情模态框 -->
|
|
|
|
|
+ <div id="patientModal" style="display:none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.4); overflow: auto; padding: 50px 0;">
|
|
|
|
|
+ <div style="background-color: #fff; margin: 0 auto; padding: 0; border: 1px solid #888; width: 80%; max-width: 600px; border-radius: 5px; max-height: 80%; display: flex; flex-direction: column;">
|
|
|
|
|
+ <div style="padding: 20px; border-bottom: 1px solid #eee;">
|
|
|
|
|
+ <h2 style="margin-top: 0;">患者详情</h2>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div style="overflow-y: auto; flex: 1; padding: 15px;">
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label>入院时间:</label>
|
|
|
|
|
+ <input type="text" id="modalAdmissionTime" readonly style="width: 100%; padding: 6px;">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label>住院号:</label>
|
|
|
|
|
+ <input type="text" id="modalInpatientNo" readonly style="width: 100%; padding: 6px;">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label>患者姓名:</label>
|
|
|
|
|
+ <input type="text" id="modalName" readonly style="width: 100%; padding: 6px;">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label>性别:</label>
|
|
|
|
|
+ <input type="text" id="modalSex" readonly style="width: 100%; padding: 6px;">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label>年龄:</label>
|
|
|
|
|
+ <input type="text" id="modalAge" readonly style="width: 100%; padding: 6px;">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label>所属科室:</label>
|
|
|
|
|
+ <input type="text" id="modalDept" readonly style="width: 100%; padding: 6px;">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label>所属病区:</label>
|
|
|
|
|
+ <input type="text" id="modalWard" readonly style="width: 100%; padding: 6px;">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label>房间号:</label>
|
|
|
|
|
+ <input type="text" id="modalRoomNo" readonly style="width: 100%; padding: 6px;">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label>床位号:</label>
|
|
|
|
|
+ <input type="text" id="modalBedNo" readonly style="width: 100%; padding: 6px;">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label>护理级别:</label>
|
|
|
|
|
+ <input type="text" id="modalNurseLevel" readonly style="width: 100%; padding: 6px;">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div class="form-group">
|
|
|
|
|
+ <label>在院状态:</label>
|
|
|
|
|
+ <input type="text" id="modalInpatientStatus" readonly style="width: 100%; padding: 6px;">
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ <div style="padding: 20px; border-top: 1px solid #eee; text-align: right;">
|
|
|
|
|
+ <button class="btn btn-secondary" onclick="closePatientModal()">关闭</button>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ </div>
|
|
|
|
|
+ `;
|
|
|
|
|
+ // 使用setTimeout确保DOM元素完全加载后再加载数据
|
|
|
|
|
+ setTimeout(function() {
|
|
|
|
|
+ // 加载科室下拉框数据
|
|
|
|
|
+ loadPatientDepartmentOptions();
|
|
|
|
|
+ // 加载病区下拉框数据
|
|
|
|
|
+ loadPatientWardOptions();
|
|
|
|
|
+ // 加载患者数据
|
|
|
|
|
+ loadPatientData();
|
|
|
|
|
+ // 确保页面首次加载时也能显示所有患者数据
|
|
|
|
|
+ if (document.getElementById('patientTableBody').children.length === 0) {
|
|
|
|
|
+ searchPatients();
|
|
|
|
|
+ }
|
|
|
|
|
+ }, 100);
|
|
|
|
|
+ break;
|
|
|
|
|
+
|
|
|
case 'bedManagement':
|
|
case 'bedManagement':
|
|
|
pageTitle.textContent = '床位管理';
|
|
pageTitle.textContent = '床位管理';
|
|
|
breadcrumb.textContent = '首页 > 院区信息管理 > 床位管理';
|
|
breadcrumb.textContent = '首页 > 院区信息管理 > 床位管理';
|
|
@@ -950,76 +1103,6 @@
|
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
case 'applicationManagement':
|
|
case 'applicationManagement':
|
|
|
- pageTitle.textContent = '应用管理';
|
|
|
|
|
- breadcrumb.textContent = '首页 > 院区信息管理 > 应用管理';
|
|
|
|
|
- mainContent.innerHTML = `
|
|
|
|
|
- <div style="background: white; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.1);">
|
|
|
|
|
- <table class="data-table">
|
|
|
|
|
- <thead>
|
|
|
|
|
- <tr>
|
|
|
|
|
- <th>应用代码</th>
|
|
|
|
|
- <th>应用名称</th>
|
|
|
|
|
- <th>应用类型</th>
|
|
|
|
|
- <th>应用版本</th>
|
|
|
|
|
- <th>应用描述</th>
|
|
|
|
|
- <th>是否启用</th>
|
|
|
|
|
- <th>备注</th>
|
|
|
|
|
- <th>详情</th>
|
|
|
|
|
- </tr>
|
|
|
|
|
- </thead>
|
|
|
|
|
- <tbody id="appTableBody">
|
|
|
|
|
- <!-- 数据将通过JS动态加载 -->
|
|
|
|
|
- </tbody>
|
|
|
|
|
- </table>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
- <!-- 应用详情模态框 -->
|
|
|
|
|
- <div id="appModal" style="display:none; position: fixed; z-index: 1000; left: 0; top: 0; width: 100%; height: 100%; background-color: rgba(0,0,0,0.4); overflow: auto; padding: 50px 0;">
|
|
|
|
|
- <div style="background-color: #fff; margin: 0 auto; padding: 0; border: 1px solid #888; width: 80%; max-width: 600px; border-radius: 5px; max-height: 80%; display: flex; flex-direction: column;">
|
|
|
|
|
- <div style="padding: 20px; border-bottom: 1px solid #eee;">
|
|
|
|
|
- <h2 style="margin-top: 0;">应用详情</h2>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div style="overflow-y: auto; flex: 1; padding: 10px;">
|
|
|
|
|
- <div class="form-group" style="margin-bottom: 8px;">
|
|
|
|
|
- <label style="margin-bottom: 2px;">应用代码:</label>
|
|
|
|
|
- <input type="text" id="modalCode" readonly style="width: 100%; padding: 5px; border: 1px solid #ddd; border-radius: 4px;">
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="form-group" style="margin-bottom: 8px;">
|
|
|
|
|
- <label style="margin-bottom: 2px;">应用名称:</label>
|
|
|
|
|
- <input type="text" id="modalName" readonly style="width: 100%; padding: 5px; border: 1px solid #ddd; border-radius: 4px;">
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="form-group" style="margin-bottom: 8px;">
|
|
|
|
|
- <label style="margin-bottom: 2px;">应用类型:</label>
|
|
|
|
|
- <input type="text" id="modalType" readonly style="width: 100%; padding: 5px; border: 1px solid #ddd; border-radius: 4px;">
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="form-group" style="margin-bottom: 8px;">
|
|
|
|
|
- <label style="margin-bottom: 2px;">应用版本:</label>
|
|
|
|
|
- <input type="text" id="modalVersion" readonly style="width: 100%; padding: 5px; border: 1px solid #ddd; border-radius: 4px;">
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="form-group" style="margin-bottom: 8px;">
|
|
|
|
|
- <label style="margin-bottom: 2px;">应用描述:</label>
|
|
|
|
|
- <textarea id="modalDescription" readonly style="width: 100%; padding: 5px; border: 1px solid #ddd; border-radius: 4px; height: 40px;"></textarea>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="form-group" style="margin-bottom: 8px;">
|
|
|
|
|
- <label style="margin-bottom: 2px;">是否启用:</label>
|
|
|
|
|
- <input type="text" id="modalEnabled" readonly style="width: 100%; padding: 5px; border: 1px solid #ddd; border-radius: 4px;">
|
|
|
|
|
- </div>
|
|
|
|
|
- <div class="form-group" style="margin-bottom: 8px;">
|
|
|
|
|
- <label style="margin-bottom: 2px;">备注:</label>
|
|
|
|
|
- <textarea id="modalRemark" readonly style="width: 100%; padding: 5px; border: 1px solid #ddd; border-radius: 4px; height: 40px;"></textarea>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- <div style="padding: 20px; border-top: 1px solid #eee; text-align: right;">
|
|
|
|
|
- <button class="btn btn-secondary" onclick="closeAppModal()">关闭</button>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- </div>
|
|
|
|
|
- `;
|
|
|
|
|
- loadAppData();
|
|
|
|
|
- break;
|
|
|
|
|
-
|
|
|
|
|
- case 'userManagement':
|
|
|
|
|
- pageTitle.textContent = '用户管理';
|
|
|
|
|
breadcrumb.textContent = '首页 > 院区信息管理 > 用户管理';
|
|
breadcrumb.textContent = '首页 > 院区信息管理 > 用户管理';
|
|
|
mainContent.innerHTML = `
|
|
mainContent.innerHTML = `
|
|
|
<div style="background: white; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.1);">
|
|
<div style="background: white; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.1);">
|
|
@@ -1251,42 +1334,33 @@
|
|
|
|
|
|
|
|
case 'patientManagement':
|
|
case 'patientManagement':
|
|
|
pageTitle.textContent = '患者管理';
|
|
pageTitle.textContent = '患者管理';
|
|
|
- breadcrumb.textContent = '首页 > 医护管理 > 患者管理';
|
|
|
|
|
|
|
+ breadcrumb.textContent = '首页 > 院区信息管理 > 患者管理';
|
|
|
mainContent.innerHTML = `
|
|
mainContent.innerHTML = `
|
|
|
<div style="background: white; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.1);">
|
|
<div style="background: white; padding: 20px; box-shadow: 0 2px 10px rgba(0,0,0,0.1);">
|
|
|
- <div style="margin-bottom: 20px;">
|
|
|
|
|
- <button class="btn btn-success" onclick="showAddPatientForm()">新增患者</button>
|
|
|
|
|
- </div>
|
|
|
|
|
<table class="data-table">
|
|
<table class="data-table">
|
|
|
<thead>
|
|
<thead>
|
|
|
<tr>
|
|
<tr>
|
|
|
- <th>患者编号</th>
|
|
|
|
|
- <th>姓名</th>
|
|
|
|
|
|
|
+ <th>入院时间</th>
|
|
|
|
|
+ <th>住院号</th>
|
|
|
|
|
+ <th>患者姓名</th>
|
|
|
<th>性别</th>
|
|
<th>性别</th>
|
|
|
<th>年龄</th>
|
|
<th>年龄</th>
|
|
|
- <th>主治医生</th>
|
|
|
|
|
- <th>所在病房</th>
|
|
|
|
|
|
|
+ <th>所属科室</th>
|
|
|
|
|
+ <th>所属病区</th>
|
|
|
|
|
+ <th>房间号</th>
|
|
|
|
|
+ <th>床位号</th>
|
|
|
|
|
+ <th>护理级别</th>
|
|
|
|
|
+ <th>在院状态</th>
|
|
|
<th>操作</th>
|
|
<th>操作</th>
|
|
|
</tr>
|
|
</tr>
|
|
|
</thead>
|
|
</thead>
|
|
|
<tbody>
|
|
<tbody>
|
|
|
- <tr>
|
|
|
|
|
- <td>P001</td>
|
|
|
|
|
- <td>张三</td>
|
|
|
|
|
- <td>男</td>
|
|
|
|
|
- <td>45</td>
|
|
|
|
|
- <td>李医生</td>
|
|
|
|
|
- <td>101病房</td>
|
|
|
|
|
- <td>
|
|
|
|
|
- <button class="btn btn-primary">详情</button>
|
|
|
|
|
- <button class="btn btn-warning">编辑</button>
|
|
|
|
|
- <button class="btn btn-danger"> discharge</button>
|
|
|
|
|
- </td>
|
|
|
|
|
- </tr>
|
|
|
|
|
|
|
+ <!-- 数据将通过JS动态加载 -->
|
|
|
</tbody>
|
|
</tbody>
|
|
|
</table>
|
|
</table>
|
|
|
</div>
|
|
</div>
|
|
|
`;
|
|
`;
|
|
|
|
|
+ setTimeout(loadPatientData, 0);
|
|
|
break;
|
|
break;
|
|
|
|
|
|
|
|
case 'equipmentInfo':
|
|
case 'equipmentInfo':
|
|
@@ -1512,12 +1586,6 @@
|
|
|
<p>查看和管理院区相关信息</p>
|
|
<p>查看和管理院区相关信息</p>
|
|
|
</div>
|
|
</div>
|
|
|
|
|
|
|
|
- <div class="card" onclick="loadContent('medicalStaff')">
|
|
|
|
|
- <div class="card-icon">👨⚕️</div>
|
|
|
|
|
- <h3>医护人员</h3>
|
|
|
|
|
- <p>管理医生和护士信息</p>
|
|
|
|
|
- </div>
|
|
|
|
|
-
|
|
|
|
|
<div class="card" onclick="loadContent('patientManagement')">
|
|
<div class="card" onclick="loadContent('patientManagement')">
|
|
|
<div class="card-icon">👤</div>
|
|
<div class="card-icon">👤</div>
|
|
|
<h3>患者信息</h3>
|
|
<h3>患者信息</h3>
|
|
@@ -1553,10 +1621,6 @@
|
|
|
// 展开院区信息管理子菜单
|
|
// 展开院区信息管理子菜单
|
|
|
document.getElementById('hospitalSubmenu').classList.add('open');
|
|
document.getElementById('hospitalSubmenu').classList.add('open');
|
|
|
break;
|
|
break;
|
|
|
- case 'patientManagement':
|
|
|
|
|
- menuItem = document.querySelector('#medicalSubmenu a[href="#"][onclick*="' + contentType + '"]');
|
|
|
|
|
- // 展开医护管理子菜单
|
|
|
|
|
- document.getElementById('medicalSubmenu').classList.add('open');
|
|
|
|
|
break;
|
|
break;
|
|
|
case 'equipmentInfo':
|
|
case 'equipmentInfo':
|
|
|
case 'equipmentQuery':
|
|
case 'equipmentQuery':
|
|
@@ -1635,6 +1699,11 @@
|
|
|
loadBedData();
|
|
loadBedData();
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 页面加载完成后初始化患者管理数据
|
|
|
|
|
+ if (document.getElementById('patientTableBody')) {
|
|
|
|
|
+ loadPatientData();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 退出登录
|
|
// 退出登录
|
|
|
document.getElementById('logoutBtn').addEventListener('click', function() {
|
|
document.getElementById('logoutBtn').addEventListener('click', function() {
|
|
|
fetch('/shixian/api/logout', {
|
|
fetch('/shixian/api/logout', {
|
|
@@ -2228,6 +2297,7 @@
|
|
|
const roomModal = document.getElementById('roomModal');
|
|
const roomModal = document.getElementById('roomModal');
|
|
|
const roomCodeSettingModal = document.getElementById('roomCodeSettingModal');
|
|
const roomCodeSettingModal = document.getElementById('roomCodeSettingModal');
|
|
|
const bedModal = document.getElementById('bedModal');
|
|
const bedModal = document.getElementById('bedModal');
|
|
|
|
|
+ const patientModal = document.getElementById('patientModal');
|
|
|
|
|
|
|
|
if (wardModal && wardModal.style.display === 'block') {
|
|
if (wardModal && wardModal.style.display === 'block') {
|
|
|
wardModal.style.display = 'none';
|
|
wardModal.style.display = 'none';
|
|
@@ -2241,10 +2311,33 @@
|
|
|
roomCodeSettingModal.style.display = 'none';
|
|
roomCodeSettingModal.style.display = 'none';
|
|
|
} else if (bedModal && bedModal.style.display === 'block') {
|
|
} else if (bedModal && bedModal.style.display === 'block') {
|
|
|
bedModal.style.display = 'none';
|
|
bedModal.style.display = 'none';
|
|
|
|
|
+ } else if (patientModal && patientModal.style.display === 'block') {
|
|
|
|
|
+ patientModal.style.display = 'none';
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|
|
|
});
|
|
});
|
|
|
|
|
|
|
|
|
|
+ // 点击弹窗外部关闭弹窗
|
|
|
|
|
+ window.onclick = function(event) {
|
|
|
|
|
+ const departmentModal = document.getElementById('departmentModal');
|
|
|
|
|
+ const wardModal = document.getElementById('wardModal');
|
|
|
|
|
+ const roomModal = document.getElementById('roomModal');
|
|
|
|
|
+ const bedModal = document.getElementById('bedModal');
|
|
|
|
|
+ const patientModal = document.getElementById('patientModal');
|
|
|
|
|
+
|
|
|
|
|
+ if (event.target === departmentModal) {
|
|
|
|
|
+ departmentModal.style.display = 'none';
|
|
|
|
|
+ } else if (event.target === wardModal) {
|
|
|
|
|
+ wardModal.style.display = 'none';
|
|
|
|
|
+ } else if (event.target === roomModal) {
|
|
|
|
|
+ roomModal.style.display = 'none';
|
|
|
|
|
+ } else if (event.target === bedModal) {
|
|
|
|
|
+ bedModal.style.display = 'none';
|
|
|
|
|
+ } else if (event.target === patientModal) {
|
|
|
|
|
+ patientModal.style.display = 'none';
|
|
|
|
|
+ }
|
|
|
|
|
+ };
|
|
|
|
|
+
|
|
|
// 编辑床位
|
|
// 编辑床位
|
|
|
function editBed(code) {
|
|
function editBed(code) {
|
|
|
alert('编辑床位: ' + code);
|
|
alert('编辑床位: ' + code);
|
|
@@ -2308,6 +2401,363 @@
|
|
|
});
|
|
});
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 加载患者数据
|
|
|
|
|
+ function loadPatientData() {
|
|
|
|
|
+ // 并行加载患者数据、护理级别选项和在院状态选项
|
|
|
|
|
+ Promise.all([
|
|
|
|
|
+ fetch('/shixian/api/patients').then(response => response.json()),
|
|
|
|
|
+ fetch('/shixian/api/patients/nurse-levels').then(response => response.json()),
|
|
|
|
|
+ fetch('/shixian/api/patients/inpatient-statuses').then(response => response.json()),
|
|
|
|
|
+ fetch('/shixian/api/beds').then(response => response.json())
|
|
|
|
|
+ ])
|
|
|
|
|
+ .then(([patientData, nurseLevels, inpatientStatuses, bedData]) => {
|
|
|
|
|
+ // 填充患者表格
|
|
|
|
|
+ const tbody = document.getElementById('patientTableBody');
|
|
|
|
|
+ // 确保tbody元素存在再操作
|
|
|
|
|
+ if (!tbody) {
|
|
|
|
|
+ console.error('找不到患者表格tbody元素');
|
|
|
|
|
+ return;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ tbody.innerHTML = '';
|
|
|
|
|
+
|
|
|
|
|
+ // 安全地更新下拉框
|
|
|
|
|
+ try {
|
|
|
|
|
+ // 获取唯一的科室列表并更新下拉框
|
|
|
|
|
+ const departments = [...new Set(patientData.map(patient => patient.deptCode).filter(dept => dept))];
|
|
|
|
|
+ const departmentSelect = document.getElementById('patientDepartment');
|
|
|
|
|
+ if (departmentSelect) {
|
|
|
|
|
+ const currentDepartmentValue = departmentSelect.value;
|
|
|
|
|
+
|
|
|
|
|
+ // 保留当前选项,只更新选项列表
|
|
|
|
|
+ const defaultOption = departmentSelect.options[0];
|
|
|
|
|
+ departmentSelect.innerHTML = '';
|
|
|
|
|
+ departmentSelect.appendChild(defaultOption);
|
|
|
|
|
+
|
|
|
|
|
+ departments.forEach(dept => {
|
|
|
|
|
+ const option = document.createElement('option');
|
|
|
|
|
+ option.value = dept;
|
|
|
|
|
+ option.textContent = dept;
|
|
|
|
|
+ departmentSelect.appendChild(option);
|
|
|
|
|
+ });
|
|
|
|
|
+ departmentSelect.value = currentDepartmentValue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 获取唯一的病区列表并更新下拉框
|
|
|
|
|
+ const wards = [...new Set(patientData.map(patient => patient.wardCode).filter(ward => ward))];
|
|
|
|
|
+ const wardSelect = document.getElementById('patientWard');
|
|
|
|
|
+ if (wardSelect) {
|
|
|
|
|
+ const currentWardValue = wardSelect.value;
|
|
|
|
|
+
|
|
|
|
|
+ // 保留当前选项,只更新选项列表
|
|
|
|
|
+ const defaultWardOption = wardSelect.options[0];
|
|
|
|
|
+ wardSelect.innerHTML = '';
|
|
|
|
|
+ wardSelect.appendChild(defaultWardOption);
|
|
|
|
|
+
|
|
|
|
|
+ wards.forEach(ward => {
|
|
|
|
|
+ const option = document.createElement('option');
|
|
|
|
|
+ option.value = ward;
|
|
|
|
|
+ option.textContent = ward;
|
|
|
|
|
+ wardSelect.appendChild(option);
|
|
|
|
|
+ });
|
|
|
|
|
+ wardSelect.value = currentWardValue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 获取唯一的房间号列表并更新下拉框
|
|
|
|
|
+ const roomNos = [...new Set(patientData.map(patient => patient.roomNo).filter(roomNo => roomNo))];
|
|
|
|
|
+ const roomNoSelect = document.getElementById('patientRoomNo');
|
|
|
|
|
+ if (roomNoSelect) {
|
|
|
|
|
+ const currentRoomNoValue = roomNoSelect.value;
|
|
|
|
|
+
|
|
|
|
|
+ // 保留当前选项,只更新选项列表
|
|
|
|
|
+ const defaultRoomNoOption = roomNoSelect.options[0];
|
|
|
|
|
+ roomNoSelect.innerHTML = '';
|
|
|
|
|
+ roomNoSelect.appendChild(defaultRoomNoOption);
|
|
|
|
|
+
|
|
|
|
|
+ roomNos.forEach(roomNo => {
|
|
|
|
|
+ const option = document.createElement('option');
|
|
|
|
|
+ option.value = roomNo;
|
|
|
|
|
+ option.textContent = roomNo;
|
|
|
|
|
+ roomNoSelect.appendChild(option);
|
|
|
|
|
+ });
|
|
|
|
|
+ roomNoSelect.value = currentRoomNoValue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 获取唯一的床位号列表并更新下拉框
|
|
|
|
|
+ const bedNos = [...new Set(bedData.map(bed => bed.name).filter(bedNo => bedNo))];
|
|
|
|
|
+ const bedNoSelect = document.getElementById('patientBedNo');
|
|
|
|
|
+ if (bedNoSelect) {
|
|
|
|
|
+ const currentBedNoValue = bedNoSelect.value;
|
|
|
|
|
+
|
|
|
|
|
+ // 保留当前选项,只更新选项列表
|
|
|
|
|
+ const defaultBedNoOption = bedNoSelect.options[0];
|
|
|
|
|
+ bedNoSelect.innerHTML = '';
|
|
|
|
|
+ bedNoSelect.appendChild(defaultBedNoOption);
|
|
|
|
|
+
|
|
|
|
|
+ bedNos.forEach(bedNo => {
|
|
|
|
|
+ const option = document.createElement('option');
|
|
|
|
|
+ option.value = bedNo;
|
|
|
|
|
+ option.textContent = bedNo;
|
|
|
|
|
+ bedNoSelect.appendChild(option);
|
|
|
|
|
+ });
|
|
|
|
|
+ bedNoSelect.value = currentBedNoValue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 获取唯一的住院号列表并更新下拉框
|
|
|
|
|
+ const inpatientNos = [...new Set(patientData.map(patient => patient.inpatientNo).filter(inpatientNo => inpatientNo))];
|
|
|
|
|
+ const inpatientNoSelect = document.getElementById('patientInpatientNo');
|
|
|
|
|
+ if (inpatientNoSelect) {
|
|
|
|
|
+ const currentInpatientNoValue = inpatientNoSelect.value;
|
|
|
|
|
+
|
|
|
|
|
+ // 保留当前选项,只更新选项列表
|
|
|
|
|
+ const defaultInpatientNoOption = inpatientNoSelect.options[0];
|
|
|
|
|
+ inpatientNoSelect.innerHTML = '';
|
|
|
|
|
+ inpatientNoSelect.appendChild(defaultInpatientNoOption);
|
|
|
|
|
+
|
|
|
|
|
+ inpatientNos.forEach(inpatientNo => {
|
|
|
|
|
+ const option = document.createElement('option');
|
|
|
|
|
+ option.value = inpatientNo;
|
|
|
|
|
+ option.textContent = inpatientNo;
|
|
|
|
|
+ inpatientNoSelect.appendChild(option);
|
|
|
|
|
+ });
|
|
|
|
|
+ inpatientNoSelect.value = currentInpatientNoValue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 更新护理级别下拉框
|
|
|
|
|
+ const nurseLevelSelect = document.getElementById('patientNurseLevel');
|
|
|
|
|
+ if (nurseLevelSelect) {
|
|
|
|
|
+ const currentNurseLevelValue = nurseLevelSelect.value;
|
|
|
|
|
+
|
|
|
|
|
+ // 保留默认选项
|
|
|
|
|
+ const defaultNurseLevelOption = nurseLevelSelect.options[0];
|
|
|
|
|
+ nurseLevelSelect.innerHTML = '';
|
|
|
|
|
+ nurseLevelSelect.appendChild(defaultNurseLevelOption);
|
|
|
|
|
+
|
|
|
|
|
+ // 添加从数据库获取的真实护理级别选项
|
|
|
|
|
+ nurseLevels.forEach(level => {
|
|
|
|
|
+ const option = document.createElement('option');
|
|
|
|
|
+ option.value = level;
|
|
|
|
|
+ option.textContent = level;
|
|
|
|
|
+ nurseLevelSelect.appendChild(option);
|
|
|
|
|
+ });
|
|
|
|
|
+ nurseLevelSelect.value = currentNurseLevelValue;
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 更新在院状态下拉框
|
|
|
|
|
+ const inpatientStatusSelect = document.getElementById('patientStatus');
|
|
|
|
|
+ if (inpatientStatusSelect) {
|
|
|
|
|
+ const currentInpatientStatusValue = inpatientStatusSelect.value;
|
|
|
|
|
+
|
|
|
|
|
+ // 保留默认选项
|
|
|
|
|
+ const defaultInpatientStatusOption = inpatientStatusSelect.options[0];
|
|
|
|
|
+ inpatientStatusSelect.innerHTML = '';
|
|
|
|
|
+ inpatientStatusSelect.appendChild(defaultInpatientStatusOption);
|
|
|
|
|
+
|
|
|
|
|
+ // 添加从数据库获取的真实在院状态选项
|
|
|
|
|
+ inpatientStatuses.forEach(status => {
|
|
|
|
|
+ const option = document.createElement('option');
|
|
|
|
|
+ option.value = status;
|
|
|
|
|
+ option.textContent = status;
|
|
|
|
|
+ inpatientStatusSelect.appendChild(option);
|
|
|
|
|
+ });
|
|
|
|
|
+ inpatientStatusSelect.value = currentInpatientStatusValue;
|
|
|
|
|
+ }
|
|
|
|
|
+ } catch (error) {
|
|
|
|
|
+ console.error('更新下拉框时出错:', error);
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 填充患者数据到表格
|
|
|
|
|
+ patientData.forEach(patient => {
|
|
|
|
|
+ const row = document.createElement('tr');
|
|
|
|
|
+ row.innerHTML = `
|
|
|
|
|
+ <td>${patient.admissionDateTime || ''}</td>
|
|
|
|
|
+ <td>${patient.inpatientNo || ''}</td>
|
|
|
|
|
+ <td>${patient.name || ''}</td>
|
|
|
|
|
+ <td>${patient.sex || ''}</td>
|
|
|
|
|
+ <td>${patient.age || ''}</td>
|
|
|
|
|
+ <td>${patient.deptCode || ''}</td>
|
|
|
|
|
+ <td>${patient.wardCode || ''}</td>
|
|
|
|
|
+ <td>${patient.roomNo || ''}</td>
|
|
|
|
|
+ <td>${patient.bedNo || ''}</td>
|
|
|
|
|
+ <td>${patient.nurseLevel || ''}</td>
|
|
|
|
|
+ <td>${patient.inpatientStatus || ''}</td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <button class="btn btn-primary" onclick="viewPatient('${patient.inpatientNo}')">详情</button>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ `;
|
|
|
|
|
+ tbody.appendChild(row);
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(error => {
|
|
|
|
|
+ console.error('加载患者数据失败:', error);
|
|
|
|
|
+ // 即使出错也要尝试加载基本数据
|
|
|
|
|
+ fetch('/shixian/api/patients')
|
|
|
|
|
+ .then(response => response.json())
|
|
|
|
|
+ .then(data => {
|
|
|
|
|
+ const tbody = document.getElementById('patientTableBody');
|
|
|
|
|
+ if (tbody) {
|
|
|
|
|
+ tbody.innerHTML = '';
|
|
|
|
|
+ data.forEach(patient => {
|
|
|
|
|
+ const row = document.createElement('tr');
|
|
|
|
|
+ row.innerHTML = `
|
|
|
|
|
+ <td>${patient.admissionDateTime || ''}</td>
|
|
|
|
|
+ <td>${patient.inpatientNo || ''}</td>
|
|
|
|
|
+ <td>${patient.name || ''}</td>
|
|
|
|
|
+ <td>${patient.sex || ''}</td>
|
|
|
|
|
+ <td>${patient.age || ''}</td>
|
|
|
|
|
+ <td>${patient.deptCode || ''}</td>
|
|
|
|
|
+ <td>${patient.wardCode || ''}</td>
|
|
|
|
|
+ <td>${patient.roomNo || ''}</td>
|
|
|
|
|
+ <td>${patient.bedNo || ''}</td>
|
|
|
|
|
+ <td>${patient.nurseLevel || ''}</td>
|
|
|
|
|
+ <td>${patient.inpatientStatus || ''}</td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <button class="btn btn-primary" onclick="viewPatient('${patient.inpatientNo}')">详情</button>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ `;
|
|
|
|
|
+ tbody.appendChild(row);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(err => {
|
|
|
|
|
+ console.error('加载基础患者数据也失败了:', err);
|
|
|
|
|
+ });
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 查询患者
|
|
|
|
|
+ function searchPatients() {
|
|
|
|
|
+ const name = document.getElementById('patientName').value;
|
|
|
|
|
+ const department = document.getElementById('patientDepartment').value;
|
|
|
|
|
+ const ward = document.getElementById('patientWard').value;
|
|
|
|
|
+ const roomNo = document.getElementById('patientRoomNo').value;
|
|
|
|
|
+ const bedNo = document.getElementById('patientBedNo').value;
|
|
|
|
|
+ const inpatientNo = document.getElementById('patientInpatientNo').value;
|
|
|
|
|
+ const nurseLevel = document.getElementById('patientNurseLevel').value;
|
|
|
|
|
+ const status = document.getElementById('patientStatus').value;
|
|
|
|
|
+ const admissionDate = document.getElementById('patientAdmissionDate').value;
|
|
|
|
|
+
|
|
|
|
|
+ let url = '/shixian/api/patients?';
|
|
|
|
|
+ const params = [];
|
|
|
|
|
+
|
|
|
|
|
+ if (name) params.push(`name=${encodeURIComponent(name)}`);
|
|
|
|
|
+ if (department) params.push(`department=${encodeURIComponent(department)}`);
|
|
|
|
|
+ if (ward) params.push(`ward=${encodeURIComponent(ward)}`);
|
|
|
|
|
+ if (roomNo) params.push(`roomNo=${encodeURIComponent(roomNo)}`);
|
|
|
|
|
+ if (bedNo) params.push(`bedNo=${encodeURIComponent(bedNo)}`);
|
|
|
|
|
+ if (inpatientNo) params.push(`inpatientNo=${encodeURIComponent(inpatientNo)}`);
|
|
|
|
|
+ if (nurseLevel) params.push(`nurseLevel=${encodeURIComponent(nurseLevel)}`);
|
|
|
|
|
+ if (status) params.push(`status=${encodeURIComponent(status)}`);
|
|
|
|
|
+ if (admissionDate) params.push(`admissionDateTime=${encodeURIComponent(admissionDate)}`);
|
|
|
|
|
+
|
|
|
|
|
+ url += params.join('&');
|
|
|
|
|
+
|
|
|
|
|
+ // 并行获取患者数据和护理级别选项
|
|
|
|
|
+ Promise.all([
|
|
|
|
|
+ fetch(url).then(response => response.json()),
|
|
|
|
|
+ fetch('/shixian/api/patients/nurse-levels').then(response => response.json()),
|
|
|
|
|
+ fetch('/shixian/api/beds').then(response => response.json())
|
|
|
|
|
+ ])
|
|
|
|
|
+ .then(([data, nurseLevels, bedData]) => {
|
|
|
|
|
+ const tbody = document.getElementById('patientTableBody');
|
|
|
|
|
+ tbody.innerHTML = '';
|
|
|
|
|
+
|
|
|
|
|
+ // 更新护理级别下拉框
|
|
|
|
|
+ const nurseLevelSelect = document.getElementById('patientNurseLevel');
|
|
|
|
|
+ const currentNurseLevelValue = nurseLevelSelect.value;
|
|
|
|
|
+
|
|
|
|
|
+ // 保留默认选项
|
|
|
|
|
+ const defaultNurseLevelOption = nurseLevelSelect.options[0];
|
|
|
|
|
+ nurseLevelSelect.innerHTML = '';
|
|
|
|
|
+ nurseLevelSelect.appendChild(defaultNurseLevelOption);
|
|
|
|
|
+
|
|
|
|
|
+ // 添加从数据库获取的真实护理级别选项
|
|
|
|
|
+ nurseLevels.forEach(level => {
|
|
|
|
|
+ const option = document.createElement('option');
|
|
|
|
|
+ option.value = level;
|
|
|
|
|
+ option.textContent = level;
|
|
|
|
|
+ nurseLevelSelect.appendChild(option);
|
|
|
|
|
+ });
|
|
|
|
|
+ nurseLevelSelect.value = currentNurseLevelValue;
|
|
|
|
|
+
|
|
|
|
|
+ // 获取唯一的床位号列表并更新下拉框
|
|
|
|
|
+ const bedNos = [...new Set(bedData.map(bed => bed.name).filter(bedNo => bedNo))];
|
|
|
|
|
+ const bedNoSelect = document.getElementById('patientBedNo');
|
|
|
|
|
+ const currentBedNoValue = bedNoSelect.value;
|
|
|
|
|
+
|
|
|
|
|
+ // 保留当前选项,只更新选项列表
|
|
|
|
|
+ const defaultBedNoOption = bedNoSelect.options[0];
|
|
|
|
|
+ bedNoSelect.innerHTML = '';
|
|
|
|
|
+ bedNoSelect.appendChild(defaultBedNoOption);
|
|
|
|
|
+
|
|
|
|
|
+ bedNos.forEach(bedNo => {
|
|
|
|
|
+ const option = document.createElement('option');
|
|
|
|
|
+ option.value = bedNo;
|
|
|
|
|
+ option.textContent = bedNo;
|
|
|
|
|
+ bedNoSelect.appendChild(option);
|
|
|
|
|
+ });
|
|
|
|
|
+ bedNoSelect.value = currentBedNoValue;
|
|
|
|
|
+
|
|
|
|
|
+ // 获取唯一的住院号列表并更新下拉框
|
|
|
|
|
+ const inpatientNos = [...new Set(data.map(patient => patient.inpatientNo).filter(inpatientNo => inpatientNo))];
|
|
|
|
|
+ const inpatientNoSelect = document.getElementById('patientInpatientNo');
|
|
|
|
|
+ const currentInpatientNoValue = inpatientNoSelect.value;
|
|
|
|
|
+
|
|
|
|
|
+ // 保留当前选项,只更新选项列表
|
|
|
|
|
+ const defaultInpatientNoOption = inpatientNoSelect.options[0];
|
|
|
|
|
+ inpatientNoSelect.innerHTML = '';
|
|
|
|
|
+ inpatientNoSelect.appendChild(defaultInpatientNoOption);
|
|
|
|
|
+
|
|
|
|
|
+ inpatientNos.forEach(inpatientNo => {
|
|
|
|
|
+ const option = document.createElement('option');
|
|
|
|
|
+ option.value = inpatientNo;
|
|
|
|
|
+ option.textContent = inpatientNo;
|
|
|
|
|
+ inpatientNoSelect.appendChild(option);
|
|
|
|
|
+ });
|
|
|
|
|
+ inpatientNoSelect.value = currentInpatientNoValue;
|
|
|
|
|
+
|
|
|
|
|
+ // 处理患者数据
|
|
|
|
|
+ data.forEach(patient => {
|
|
|
|
|
+ const row = document.createElement('tr');
|
|
|
|
|
+ row.innerHTML = `
|
|
|
|
|
+ <td>${patient.admissionDateTime || ''}</td>
|
|
|
|
|
+ <td>${patient.inpatientNo || ''}</td>
|
|
|
|
|
+ <td>${patient.name || ''}</td>
|
|
|
|
|
+ <td>${patient.sex || ''}</td>
|
|
|
|
|
+ <td>${patient.age || ''}</td>
|
|
|
|
|
+ <td>${patient.deptCode || ''}</td>
|
|
|
|
|
+ <td>${patient.wardCode || ''}</td>
|
|
|
|
|
+ <td>${patient.roomNo || ''}</td>
|
|
|
|
|
+ <td>${patient.bedNo || ''}</td>
|
|
|
|
|
+ <td>${patient.nurseLevel || ''}</td>
|
|
|
|
|
+ <td>${patient.inpatientStatus || ''}</td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <button class="btn btn-primary" onclick="viewPatient('${patient.inpatientNo}')">详情</button>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ `;
|
|
|
|
|
+ tbody.appendChild(row);
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(error => {
|
|
|
|
|
+ console.error('查询患者数据失败:', error);
|
|
|
|
|
+ alert('查询失败,请稍后重试');
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 清空患者查询条件
|
|
|
|
|
+ function clearPatientSearch() {
|
|
|
|
|
+ document.getElementById('patientName').value = '';
|
|
|
|
|
+ document.getElementById('patientDepartment').value = '';
|
|
|
|
|
+ document.getElementById('patientWard').value = '';
|
|
|
|
|
+ document.getElementById('patientRoomNo').value = '';
|
|
|
|
|
+ document.getElementById('patientBedNo').value = '';
|
|
|
|
|
+ document.getElementById('patientInpatientNo').value = '';
|
|
|
|
|
+ document.getElementById('patientNurseLevel').value = '';
|
|
|
|
|
+ document.getElementById('patientStatus').value = '';
|
|
|
|
|
+ document.getElementById('patientAdmissionDate').value = '';
|
|
|
|
|
+ loadPatientData();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 查询病房
|
|
// 查询病房
|
|
|
function searchRooms() {
|
|
function searchRooms() {
|
|
|
const code = document.getElementById('roomCode').value;
|
|
const code = document.getElementById('roomCode').value;
|
|
@@ -2576,6 +3026,189 @@
|
|
|
document.getElementById('roomCodeSettingModal').style.display = 'none';
|
|
document.getElementById('roomCodeSettingModal').style.display = 'none';
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
+ // 查询患者
|
|
|
|
|
+ function searchPatients() {
|
|
|
|
|
+ const name = document.getElementById('patientName').value;
|
|
|
|
|
+ const department = document.getElementById('patientDepartment').value;
|
|
|
|
|
+ const ward = document.getElementById('patientWard').value;
|
|
|
|
|
+ const roomNo = document.getElementById('patientRoomNo').value;
|
|
|
|
|
+ const bedNo = document.getElementById('patientBedNo').value;
|
|
|
|
|
+ const inpatientNo = document.getElementById('patientInpatientNo').value;
|
|
|
|
|
+ const nurseLevel = document.getElementById('patientNurseLevel').value;
|
|
|
|
|
+ const status = document.getElementById('patientStatus').value;
|
|
|
|
|
+ const admissionDate = document.getElementById('patientAdmissionDate').value;
|
|
|
|
|
+
|
|
|
|
|
+ let url = '/shixian/api/patients?';
|
|
|
|
|
+ const params = [];
|
|
|
|
|
+
|
|
|
|
|
+ if (name) params.push(`name=${encodeURIComponent(name)}`);
|
|
|
|
|
+ if (department) params.push(`department=${encodeURIComponent(department)}`);
|
|
|
|
|
+ if (ward) params.push(`ward=${encodeURIComponent(ward)}`);
|
|
|
|
|
+ if (roomNo) params.push(`roomNo=${encodeURIComponent(roomNo)}`);
|
|
|
|
|
+ if (bedNo) params.push(`bedNo=${encodeURIComponent(bedNo)}`);
|
|
|
|
|
+ if (inpatientNo) params.push(`inpatientNo=${encodeURIComponent(inpatientNo)}`);
|
|
|
|
|
+ if (nurseLevel) params.push(`nurseLevel=${encodeURIComponent(nurseLevel)}`);
|
|
|
|
|
+ if (status) params.push(`status=${encodeURIComponent(status)}`);
|
|
|
|
|
+ if (admissionDate) params.push(`admissionDateTime=${encodeURIComponent(admissionDate)}`);
|
|
|
|
|
+
|
|
|
|
|
+ url += params.join('&');
|
|
|
|
|
+
|
|
|
|
|
+ // 并行获取患者数据和护理级别选项
|
|
|
|
|
+ Promise.all([
|
|
|
|
|
+ fetch(url).then(response => response.json()),
|
|
|
|
|
+ fetch('/shixian/api/patients/nurse-levels').then(response => response.json())
|
|
|
|
|
+ ])
|
|
|
|
|
+ .then(([data, nurseLevels]) => {
|
|
|
|
|
+ const tbody = document.getElementById('patientTableBody');
|
|
|
|
|
+ tbody.innerHTML = '';
|
|
|
|
|
+
|
|
|
|
|
+ // 更新护理级别下拉框
|
|
|
|
|
+ const nurseLevelSelect = document.getElementById('patientNurseLevel');
|
|
|
|
|
+ const currentNurseLevelValue = nurseLevelSelect.value;
|
|
|
|
|
+
|
|
|
|
|
+ // 保留默认选项
|
|
|
|
|
+ const defaultNurseLevelOption = nurseLevelSelect.options[0];
|
|
|
|
|
+ nurseLevelSelect.innerHTML = '';
|
|
|
|
|
+ nurseLevelSelect.appendChild(defaultNurseLevelOption);
|
|
|
|
|
+
|
|
|
|
|
+ // 添加从数据库获取的真实护理级别选项
|
|
|
|
|
+ nurseLevels.forEach(level => {
|
|
|
|
|
+ const option = document.createElement('option');
|
|
|
|
|
+ option.value = level;
|
|
|
|
|
+ option.textContent = level;
|
|
|
|
|
+ nurseLevelSelect.appendChild(option);
|
|
|
|
|
+ });
|
|
|
|
|
+ nurseLevelSelect.value = currentNurseLevelValue;
|
|
|
|
|
+
|
|
|
|
|
+ // 处理患者数据
|
|
|
|
|
+ data.forEach(patient => {
|
|
|
|
|
+ const row = document.createElement('tr');
|
|
|
|
|
+ row.innerHTML = `
|
|
|
|
|
+ <td>${patient.admissionDateTime || ''}</td>
|
|
|
|
|
+ <td>${patient.inpatientNo || ''}</td>
|
|
|
|
|
+ <td>${patient.name || ''}</td>
|
|
|
|
|
+ <td>${patient.sex || ''}</td>
|
|
|
|
|
+ <td>${patient.age || ''}</td>
|
|
|
|
|
+ <td>${patient.deptCode || ''}</td>
|
|
|
|
|
+ <td>${patient.wardCode || ''}</td>
|
|
|
|
|
+ <td>${patient.roomNo || ''}</td>
|
|
|
|
|
+ <td>${patient.bedNo || ''}</td>
|
|
|
|
|
+ <td>${patient.nurseLevel || ''}</td>
|
|
|
|
|
+ <td>${patient.inpatientStatus || ''}</td>
|
|
|
|
|
+ <td>
|
|
|
|
|
+ <button class="btn btn-primary" onclick="viewPatient('${patient.inpatientNo}')">详情</button>
|
|
|
|
|
+ </td>
|
|
|
|
|
+ `;
|
|
|
|
|
+ tbody.appendChild(row);
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(error => {
|
|
|
|
|
+ console.error('查询患者数据失败:', error);
|
|
|
|
|
+ alert('查询失败,请稍后重试');
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 清空患者查询条件
|
|
|
|
|
+ function clearPatientSearch() {
|
|
|
|
|
+ document.getElementById('patientName').value = '';
|
|
|
|
|
+ document.getElementById('patientDepartment').value = '';
|
|
|
|
|
+ document.getElementById('patientWard').value = '';
|
|
|
|
|
+ document.getElementById('patientRoomNo').value = '';
|
|
|
|
|
+ document.getElementById('patientBedNo').value = '';
|
|
|
|
|
+ document.getElementById('patientInpatientNo').value = '';
|
|
|
|
|
+ document.getElementById('patientNurseLevel').value = '';
|
|
|
|
|
+ document.getElementById('patientStatus').value = '';
|
|
|
|
|
+ document.getElementById('patientAdmissionDate').value = '';
|
|
|
|
|
+ loadPatientData();
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 查看患者详情
|
|
|
|
|
+ function viewPatient(inpatientNo) {
|
|
|
|
|
+ fetch(`/shixian/api/patients/${inpatientNo}`)
|
|
|
|
|
+ .then(response => response.json())
|
|
|
|
|
+ .then(data => {
|
|
|
|
|
+ if (data.success) {
|
|
|
|
|
+ const patient = data.data;
|
|
|
|
|
+
|
|
|
|
|
+ // 填充弹窗内容
|
|
|
|
|
+ document.getElementById('modalAdmissionTime').value = patient.admissionDateTime || '';
|
|
|
|
|
+ document.getElementById('modalInpatientNo').value = patient.inpatientNo || '';
|
|
|
|
|
+ document.getElementById('modalName').value = patient.name || '';
|
|
|
|
|
+ document.getElementById('modalSex').value = patient.sex || '';
|
|
|
|
|
+ document.getElementById('modalAge').value = patient.age || '';
|
|
|
|
|
+ document.getElementById('modalDept').value = patient.deptCode || '';
|
|
|
|
|
+ document.getElementById('modalWard').value = patient.wardCode || '';
|
|
|
|
|
+ document.getElementById('modalRoomNo').value = patient.roomNo || '';
|
|
|
|
|
+ document.getElementById('modalBedNo').value = patient.bedNo || '';
|
|
|
|
|
+ document.getElementById('modalNurseLevel').value = patient.nurseLevel || '';
|
|
|
|
|
+ document.getElementById('modalInpatientStatus').value = patient.inpatientStatus || '';
|
|
|
|
|
+
|
|
|
|
|
+ // 显示弹窗
|
|
|
|
|
+ document.getElementById('patientModal').style.display = 'block';
|
|
|
|
|
+ } else {
|
|
|
|
|
+ alert('获取患者信息失败: ' + data.message);
|
|
|
|
|
+ }
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(error => {
|
|
|
|
|
+ console.error('获取患者信息失败:', error);
|
|
|
|
|
+ alert('获取患者信息失败,请稍后重试');
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 关闭患者详情弹窗
|
|
|
|
|
+ function closePatientModal() {
|
|
|
|
|
+ document.getElementById('patientModal').style.display = 'none';
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 加载患者管理科室下拉框数据
|
|
|
|
|
+ function loadPatientDepartmentOptions() {
|
|
|
|
|
+ fetch('/shixian/api/departments')
|
|
|
|
|
+ .then(response => response.json())
|
|
|
|
|
+ .then(data => {
|
|
|
|
|
+ const departmentSelect = document.getElementById('patientDepartment');
|
|
|
|
|
+
|
|
|
|
|
+ // 清空现有选项
|
|
|
|
|
+ departmentSelect.innerHTML = '<option value="">全部科室</option>';
|
|
|
|
|
+
|
|
|
|
|
+ // 添加新的选项
|
|
|
|
|
+ data.forEach(dept => {
|
|
|
|
|
+ const option = document.createElement('option');
|
|
|
|
|
+ option.value = dept.name;
|
|
|
|
|
+ option.textContent = dept.name;
|
|
|
|
|
+ departmentSelect.appendChild(option);
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(error => {
|
|
|
|
|
+ console.error('加载科室下拉框数据失败:', error);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
|
|
+ // 加载患者管理病区下拉框数据
|
|
|
|
|
+ function loadPatientWardOptions() {
|
|
|
|
|
+ fetch('/shixian/api/patients')
|
|
|
|
|
+ .then(response => response.json())
|
|
|
|
|
+ .then(data => {
|
|
|
|
|
+ const wardSelect = document.getElementById('patientWard');
|
|
|
|
|
+
|
|
|
|
|
+ // 清空现有选项
|
|
|
|
|
+ wardSelect.innerHTML = '<option value="">全部病区</option>';
|
|
|
|
|
+
|
|
|
|
|
+ // 获取唯一的病区列表
|
|
|
|
|
+ const wards = [...new Set(data.map(patient => patient.wardCode).filter(ward => ward))];
|
|
|
|
|
+
|
|
|
|
|
+ // 添加新的选项
|
|
|
|
|
+ wards.forEach(ward => {
|
|
|
|
|
+ const option = document.createElement('option');
|
|
|
|
|
+ option.value = ward;
|
|
|
|
|
+ option.textContent = ward;
|
|
|
|
|
+ wardSelect.appendChild(option);
|
|
|
|
|
+ });
|
|
|
|
|
+ })
|
|
|
|
|
+ .catch(error => {
|
|
|
|
|
+ console.error('加载病区下拉框数据失败:', error);
|
|
|
|
|
+ });
|
|
|
|
|
+ }
|
|
|
|
|
+
|
|
|
// 关闭床位代码设置
|
|
// 关闭床位代码设置
|
|
|
function closeBedCodeSetting() {
|
|
function closeBedCodeSetting() {
|
|
|
document.getElementById('bedCodeSettingModal').style.display = 'none';
|
|
document.getElementById('bedCodeSettingModal').style.display = 'none';
|
|
@@ -2996,4 +3629,5 @@
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
</script>
|
|
</script>
|
|
|
-</body>
|
|
|
|
|
|
|
+</body>
|
|
|
|
|
+</html>
|