|
@@ -1,7 +1,7 @@
|
|
|
<!DOCTYPE html>
|
|
|
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
|
|
|
<head>
|
|
|
- <th:block th:include="include :: header('新建登记')" />
|
|
|
+ <th:block th:include="include :: header('处方登记信息修改')" />
|
|
|
<th:block th:include="include :: select2-css" />
|
|
|
<th:block th:include="include :: bootstrap-fileinput-css" />
|
|
|
<th:block th:include="include :: layout-latest-css" />
|
|
@@ -16,10 +16,10 @@
|
|
|
<label>患者姓名:</label>
|
|
|
<input name="patientName" placeholder="患者姓名" id="patientName" readonly disabled class="styled-input" type="text">
|
|
|
</div>
|
|
|
- <div class="customize-form-group">
|
|
|
+ <!--<div class="customize-form-group">
|
|
|
<label>手机号码:</label>
|
|
|
<input name="patientPhone" placeholder="手机号码" id="patientPhone" readonly disabled class="styled-input" type="text">
|
|
|
- </div>
|
|
|
+ </div>-->
|
|
|
<div class="customize-form-group">
|
|
|
<label>性别:</label>
|
|
|
<input name="gender" placeholder="性别" id="gender" readonly disabled class="styled-input" type="text">
|
|
@@ -80,7 +80,7 @@
|
|
|
</div>
|
|
|
<div class="customize-form-group">
|
|
|
<label>审核药师姓名:</label>
|
|
|
- <input name="reviewingName" id="reviewingName" placeholder="审核药师姓名" class="styled-input" type="text">
|
|
|
+ <input name="reviewingName" id="reviewingName" placeholder="审核药师姓名" readonly disabled class="styled-input" type="text">
|
|
|
</div>
|
|
|
</div>
|
|
|
</form>
|
|
@@ -88,11 +88,11 @@
|
|
|
<input type="hidden" id="prescriptionNumber" name="prescriptionNumber" th:value="${prescriptionNumber}">
|
|
|
<!-- 假设这是你的 HTML 结构class="table table-bordered" -->
|
|
|
<div class="ibox" id="data-ibox" style="overflow: auto;">
|
|
|
- <div class="ibox-title">药品登记列表</div>
|
|
|
+ <div class="ibox-title" style="width: 100%;">药品登记列表</div>
|
|
|
<table class="fixed-layout-table" id="drugInfoTable">
|
|
|
<thead>
|
|
|
<tr>
|
|
|
- <th>操作+<a type="button" onclick="selectUsersToParentCallBack2()">添加药品</a></th>
|
|
|
+ <th>操作+<a type="button" class="btn btn-primary btn-sm" onclick="selectUsersToParentCallBack2()">添加药品</a></th>
|
|
|
<th>药品编码</th>
|
|
|
<th>药品名</th>
|
|
|
<th class="hidden-column">通用名</th>
|
|
@@ -104,11 +104,11 @@
|
|
|
<th class="hidden-column">是否登记管理品</th>
|
|
|
<th class="hidden-column">是否慈善援助管理品</th>
|
|
|
<th class="hidden-column">包装</th>
|
|
|
- <th class="is-required">取药数量</th>
|
|
|
- <th class="is-required">单次剂量</th>
|
|
|
+ <th class="is-required">取药数量(购药数量)</th>
|
|
|
+ <th class="is-required">单次剂量数</th>
|
|
|
<th class="is-required">单次剂量单位</th>
|
|
|
<th class="is-required">用药频次</th>
|
|
|
- <th class="is-required">用药天数</th>
|
|
|
+ <th class="is-required">用药天数(购药包装单位)</th>
|
|
|
<th>D值品用药天数</th>
|
|
|
|
|
|
</tr>
|
|
@@ -232,8 +232,6 @@
|
|
|
// 获取选中的患者对象
|
|
|
var selectedPatient = getSelectedPatient();
|
|
|
if (selectedPatient) {
|
|
|
- console.log('Selected Patient:', selectedPatient);
|
|
|
-
|
|
|
// 调用 getLastRecipe 方法,传入患者的 ID
|
|
|
var patientId = selectedPatient.id;
|
|
|
getLastRecipe(patientId);
|
|
@@ -278,12 +276,9 @@
|
|
|
|
|
|
function getLastRecipe(patientId){
|
|
|
var datas=[];
|
|
|
- debugger
|
|
|
-
|
|
|
var data = {
|
|
|
"patientId":patientId,
|
|
|
};
|
|
|
- console.log("patientId="+patientId);
|
|
|
// 初始化表格 getDrugPurchaseList
|
|
|
$.ajax({
|
|
|
cache : true,
|
|
@@ -317,8 +312,6 @@
|
|
|
|
|
|
|
|
|
}
|
|
|
-
|
|
|
- console.log("shangciObj="+shangciObj);
|
|
|
$.operate.successCallback(data);
|
|
|
|
|
|
}
|
|
@@ -396,7 +389,16 @@
|
|
|
function submitHandler() {
|
|
|
// 创建一个 FormData 对象用于提交表单数据
|
|
|
var formData = new FormData();
|
|
|
-
|
|
|
+ var prescribingDoctor = $('#prescribingDoctor').val();
|
|
|
+ if (prescribingDoctor == ''|| prescribingDoctor == null|| prescribingDoctor == undefined){
|
|
|
+ $.modal.alertError("请输入处方医生");
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var prescriptionIssueDate = $('#prescriptionIssueDate').val();
|
|
|
+ if (prescriptionIssueDate == ''|| prescriptionIssueDate == null|| prescriptionIssueDate == undefined){
|
|
|
+ $.modal.alertError("处方开具日期");
|
|
|
+ return;
|
|
|
+ }
|
|
|
// 收集表单中的其他字段,并将其添加到 FormData 中
|
|
|
$('#dtp-form-newcfxx').find(':input').each(function() {
|
|
|
var $this = $(this);
|
|
@@ -410,11 +412,53 @@
|
|
|
});
|
|
|
|
|
|
// 将药物数据序列化为 JSON 字符串并添加到 FormData 中
|
|
|
- var drugData = getTableData(); // 假设此函数正确获取表格数据
|
|
|
- if (drugData.length > 0) {
|
|
|
- formData.append('drugData', JSON.stringify(drugData));
|
|
|
- }else{
|
|
|
- $.modal.alertError("请添加药品");
|
|
|
+ var tableRows = [];
|
|
|
+ var falg = true;
|
|
|
+ $('#drugInfoTable tbody tr').each(function(index, row) {
|
|
|
+ var rowData = {
|
|
|
+ productId: $(row).data('product-id'),
|
|
|
+ mdmCode: $(row).find('td:eq(1)').text().trim(),
|
|
|
+ productName: $(row).find('td:eq(2)').text().trim(),
|
|
|
+ genericName: $(row).find('td:eq(3)').text().trim(),
|
|
|
+ specification: $(row).find('td:eq(4)').text().trim(),
|
|
|
+ manufacturerShortName: $(row).find('td:eq(5)').text().trim(),
|
|
|
+ administrationMethod: $(row).find('td:eq(6)').text().trim(),
|
|
|
+ followUpItem: $(row).find('td:eq(7)').text().trim(),
|
|
|
+ coldChainItem: $(row).find('td:eq(8)').text().trim(),
|
|
|
+ registeredItem: $(row).find('td:eq(9)').text().trim(),
|
|
|
+ charityAidItem: $(row).find('td:eq(10)').text().trim(),
|
|
|
+ packaging: $(row).find('td:eq(11)').text().trim(),
|
|
|
+ packageQuantity: $(row).find('input[name="packageQuantity"]').val(),
|
|
|
+ singleDoseValue: $(row).find('input[name="singleDoseValue"]').val(),
|
|
|
+ singleDoseUnit: $(row).find('select[name="singleDoseUnit"]').val(),
|
|
|
+ dosageFrequency: $(row).find('select[name="dosageFrequency"]').val(),
|
|
|
+ dosageFrequencyDays: $(row).find('input[name="dosageFrequencyDays"]').val(),
|
|
|
+ dvalueDays: $(row).find('input[name="dvalueDays"]').val()
|
|
|
+ };
|
|
|
+ if (rowData.packageQuantity == ''|| rowData.packageQuantity == null|| rowData.packageQuantity == undefined){
|
|
|
+ $.modal.alertError("请输入包装数量");
|
|
|
+ falg = false;
|
|
|
+ return falg;
|
|
|
+ }
|
|
|
+ if (rowData.singleDoseValue == ''|| rowData.singleDoseValue == null|| rowData.singleDoseValue == undefined){
|
|
|
+ $.modal.alertError("请输入单次剂量数值");
|
|
|
+ falg = false;
|
|
|
+ return falg;
|
|
|
+ }
|
|
|
+ if (rowData.singleDoseUnit == ''|| rowData.singleDoseUnit == null|| rowData.singleDoseUnit == undefined){
|
|
|
+ $.modal.alertError("请选择单次剂量单位");
|
|
|
+ falg = false;
|
|
|
+ return falg;
|
|
|
+ }
|
|
|
+ if (rowData.dosageFrequency == ''|| rowData.dosageFrequency == null|| rowData.dosageFrequency == undefined){
|
|
|
+ $.modal.alertError("请选择频次");
|
|
|
+ falg = false;
|
|
|
+ return falg;
|
|
|
+ }
|
|
|
+ // 将每一行的数据对象添加到数组中
|
|
|
+ tableRows.push(rowData);
|
|
|
+ });
|
|
|
+ if (!falg){
|
|
|
return;
|
|
|
}
|
|
|
var id = $('#id').val().trim();
|
|
@@ -510,31 +554,33 @@
|
|
|
<td class="hidden-column">${columnsData.registeredItem === 1 ? '是' : '否'}</td>
|
|
|
<td class="hidden-column">${columnsData.charityAidItem === 1 ? '是' : '否'}</td>
|
|
|
<td class="hidden-column">${columnsData.packaging}</td>
|
|
|
- <td> <input name="packageQuantity" id="packageQuantity${columnsData.productId}" placeholder="取药数量(包装数)" class="styled-input" type="number"></td>
|
|
|
- <td> <input name="singleDoseValue" id="singleDoseValue${columnsData.productId}" placeholder="单次剂量数值" class="styled-input" type="number"></td>
|
|
|
+ <td> <input name="packageQuantity" id="packageQuantity${columnsData.productId}" placeholder="取药数量(包装数)" class="styled-input" style="width: 170px;" type="number"></td>
|
|
|
+ <td> <input name="singleDoseValue" id="singleDoseValue${columnsData.productId}" placeholder="单次剂量数值" class="styled-input" style="width: 170px;" type="number"></td>
|
|
|
<td>
|
|
|
- <select name="singleDoseUnit" id="singleDoseUnit${columnsData.productId}" class="styled-input" required>
|
|
|
+ <select name="singleDoseUnit" id="singleDoseUnit${columnsData.productId}" class="styled-input" style="width: 170px;" required>
|
|
|
<option value="">请选择</option>
|
|
|
- <option value="1">mg</option>
|
|
|
+ <!--<option value="1">mg</option>
|
|
|
<option value="2">g</option>
|
|
|
- <option value="3">片</option>
|
|
|
+ <option value="3">片</option>-->
|
|
|
</select>
|
|
|
</td>
|
|
|
<td>
|
|
|
- <select name="dosageFrequency" id="dosageFrequency${columnsData.productId}" class="styled-input" required>
|
|
|
+ <select name="dosageFrequency" id="dosageFrequency${columnsData.productId}" class="styled-input" style="width: 170px;" required>
|
|
|
<option value="">请选择</option>
|
|
|
- <option value="1">一日1次</option>
|
|
|
+ <!--<option value="1">一日1次</option>
|
|
|
<option value="2">一日2次</option>
|
|
|
<option value="3">每天1次</option>
|
|
|
<option value="4">每天隔天一次</option>
|
|
|
- <option value="5">每周2次</option>
|
|
|
+ <option value="5">每周2次</option>-->
|
|
|
</select>
|
|
|
</td>
|
|
|
- <td> <input name="dosageFrequencyDays" id="dosageFrequencyDays${columnsData.productId}" placeholder="用药频次换算天数" class="styled-input" type="number"></td>
|
|
|
- <td> <input name="dvalueDays" id="dvalueDays${columnsData.productId}" placeholder="系统自动计算" class="styled-input" disabled="" type="number"></td>
|
|
|
+ <td> <input name="dosageFrequencyDays" id="dosageFrequencyDays${columnsData.productId}" placeholder="用药频次换算天数" class="styled-input" style="width: 170px;" type="number"></td>
|
|
|
+ <td> <input name="dvalueDays" id="dvalueDays${columnsData.productId}" placeholder="系统自动计算" class="styled-input" disabled="" style="width: 140px;" type="number"></td>
|
|
|
</tr>
|
|
|
`;
|
|
|
tableBody.append(row);
|
|
|
+ dataInfo(columnsData.productId)
|
|
|
+ bindDosageFrequencyChangeListener(columnsData.productId);
|
|
|
} else {
|
|
|
$.modal.alertWarning(`药品 ${columnsData.productName} 已经添加了`);
|
|
|
}
|
|
@@ -542,6 +588,44 @@
|
|
|
|
|
|
$.modal.close(index);
|
|
|
}
|
|
|
+ function dataInfo(productId){
|
|
|
+ /*<![CDATA[*/
|
|
|
+ var storeTypes = /*[[${@dict.getType('sys_gxhpz_gg_unitall')}]]*/ [];
|
|
|
+ /*]]>*/
|
|
|
+ /*<![CDATA[*/
|
|
|
+ var pcTypes = /*[[${@dict.getType('sys_select_dtp_ysfw_sfpx')}]]*/ [];
|
|
|
+ /*]]>*/
|
|
|
+ // 获取<select>元素
|
|
|
+ var selectElement = document.getElementById('singleDoseUnit' + productId);
|
|
|
+ var pcselectElement = document.getElementById('dosageFrequency' + productId);
|
|
|
+ storeTypes.forEach(function(item, index){
|
|
|
+ console.log("item"+item.dictLabel);
|
|
|
+ console.log("dictValue"+item.dictValue);
|
|
|
+ var option = document.createElement("option");
|
|
|
+ option.value = item.dictValue;
|
|
|
+ option.text = item.dictLabel;
|
|
|
+ selectElement.add(option);
|
|
|
+ })
|
|
|
+ pcTypes.forEach(function(item, index){
|
|
|
+ console.log("item"+item.dictLabel);
|
|
|
+ console.log("dictValue"+item.dictValue);
|
|
|
+ var option = document.createElement("option");
|
|
|
+ option.value = item.dictValue;
|
|
|
+ option.text = item.dictLabel;
|
|
|
+ pcselectElement.add(option);
|
|
|
+ })
|
|
|
+ }
|
|
|
+ // 动态绑定用药频次选择事件
|
|
|
+ function bindDosageFrequencyChangeListener(productId) {
|
|
|
+ $(`#dosageFrequency${productId}`).on('change', function () {
|
|
|
+ var selectedValue = $(this).val();
|
|
|
+ if (selectedValue) {
|
|
|
+ $(`#dosageFrequencyDays${productId}`).val(selectedValue);
|
|
|
+ } else {
|
|
|
+ $(`#dosageFrequencyDays${productId}`).val('');
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
function deleteRow(productId) {
|
|
|
$.modal.confirm("确认删除该药品吗?", function() {
|
|
|
// 删除对应行
|
|
@@ -581,7 +665,6 @@
|
|
|
}
|
|
|
function search_hz() {
|
|
|
var query = $('#query').val().trim();
|
|
|
- console.log("query===="+query);
|
|
|
// 如果输入为空,清空 dValueId 输入框并停止进一步操作
|
|
|
if (!query) {
|
|
|
$('#query').val('');
|
|
@@ -601,7 +684,6 @@
|
|
|
|
|
|
if(data.code==0){
|
|
|
dataList=[];
|
|
|
- console.log("data111===="+data.data);
|
|
|
populatePatientTable(data.data);
|
|
|
dataList=data.data;
|
|
|
// 如果有且只有一条记录,默认选中这条记录
|
|
@@ -659,7 +741,6 @@
|
|
|
}
|
|
|
$(document).ready(function() {
|
|
|
var id = $('#id').val().trim();
|
|
|
- console.log("id----->"+id)
|
|
|
var datas=[];
|
|
|
var data = {
|
|
|
"id":id,
|
|
@@ -705,8 +786,8 @@
|
|
|
var columnsData = {
|
|
|
productId: item.id,
|
|
|
productCode: item.mdmCode,
|
|
|
- productName: item.productName,
|
|
|
- genericName: item.genericName,
|
|
|
+ productName: item.productName || "",
|
|
|
+ genericName: item.genericName || "",
|
|
|
specification: item.specification,
|
|
|
packaging: item.packaging,
|
|
|
manufacturer: item.manufacturer,
|
|
@@ -745,31 +826,33 @@
|
|
|
<td class="hidden-column">${columnsData.registeredItem === 1 ? '是' : '否'}</td>
|
|
|
<td class="hidden-column">${columnsData.charityAidItem === 1 ? '是' : '否'}</td>
|
|
|
<td class="hidden-column">${columnsData.packaging}</td>
|
|
|
- <td> <input name="packageQuantity" id="packageQuantity${columnsData.productId}" placeholder="取药数量(包装数)" class="styled-input" type="number"></td>
|
|
|
- <td> <input name="singleDoseValue" id="singleDoseValue${columnsData.productId}" placeholder="单次剂量数值" class="styled-input" type="number"></td>
|
|
|
+ <td> <input name="packageQuantity" id="packageQuantity${columnsData.productId}" placeholder="取药数量(包装数)" class="styled-input" style="width: 170px;" type="number"></td>
|
|
|
+ <td> <input name="singleDoseValue" id="singleDoseValue${columnsData.productId}" placeholder="单次剂量数值" class="styled-input" style="width: 170px;" type="number"></td>
|
|
|
<td>
|
|
|
- <select name="singleDoseUnit" id="singleDoseUnit${columnsData.productId}" class="styled-input" required>
|
|
|
+ <select name="singleDoseUnit" id="singleDoseUnit${columnsData.productId}" class="styled-input" style="width: 170px;" required>
|
|
|
<option value="">请选择</option>
|
|
|
- <option value="1">mg</option>
|
|
|
+ <!--<option value="1">mg</option>
|
|
|
<option value="2">g</option>
|
|
|
- <option value="3">片</option>
|
|
|
+ <option value="3">片</option>-->
|
|
|
</select>
|
|
|
</td>
|
|
|
<td>
|
|
|
- <select name="dosageFrequency" id="dosageFrequency${columnsData.productId}" class="styled-input" required>
|
|
|
+ <select name="dosageFrequency" id="dosageFrequency${columnsData.productId}" class="styled-input" style="width: 170px;" required>
|
|
|
<option value="">请选择</option>
|
|
|
- <option value="1">一日1次</option>
|
|
|
+ <!--<option value="1">一日1次</option>
|
|
|
<option value="2">一日2次</option>
|
|
|
<option value="3">每天1次</option>
|
|
|
<option value="4">每天隔天一次</option>
|
|
|
- <option value="5">每周2次</option>
|
|
|
+ <option value="5">每周2次</option>-->
|
|
|
</select>
|
|
|
</td>
|
|
|
- <td> <input name="dosageFrequencyDays" id="dosageFrequencyDays${columnsData.productId}" placeholder="用药频次换算天数" class="styled-input" type="number"></td>
|
|
|
- <td> <input name="dvalueDays" id="dvalueDays${columnsData.productId}" placeholder="系统自动计算" class="styled-input" disabled="" type="number"></td>
|
|
|
+ <td> <input name="dosageFrequencyDays" id="dosageFrequencyDays${columnsData.productId}" placeholder="用药频次换算天数" class="styled-input" style="width: 170px;" type="number"></td>
|
|
|
+ <td> <input name="dvalueDays" id="dvalueDays${columnsData.productId}" placeholder="系统自动计算" class="styled-input" disabled="" style="width: 140px;" type="number"></td>
|
|
|
</tr>
|
|
|
`;
|
|
|
tableBody.append(row);
|
|
|
+ dataInfo(columnsData.productId)
|
|
|
+ bindDosageFrequencyChangeListener(columnsData.productId);
|
|
|
$('#packageQuantity'+columnsData.productId ).val(columnsData.packageQuantity);
|
|
|
$('#singleDoseValue'+columnsData.productId ).val(columnsData.singleDoseValue);
|
|
|
// 设置 select 元素的值,这将会选中 value 与 columnsData.singleDoseValue 匹配的 option
|
|
@@ -845,19 +928,28 @@
|
|
|
body {
|
|
|
font-family: Arial, sans-serif;
|
|
|
}
|
|
|
- table {
|
|
|
- width: 500px;
|
|
|
+ /* 使用ID选择器来确保样式仅应用于特定表格 */
|
|
|
+ #drugInfoTable {
|
|
|
+ /*width: 500px;*/
|
|
|
border-collapse: collapse;
|
|
|
}
|
|
|
- th, td {
|
|
|
+
|
|
|
+ /* 使用后代选择器来确保样式仅应用于该表格内的th和td元素 */
|
|
|
+ #drugInfoTable th, #drugInfoTable td {
|
|
|
text-align: left;
|
|
|
padding: 5px;
|
|
|
border-bottom: 1px solid #ddd;
|
|
|
}
|
|
|
- tr:nth-child(even) {
|
|
|
- width: 13px;
|
|
|
+
|
|
|
+ /* 使用后代选择器来确保样式仅应用于该表格内的tr元素 */
|
|
|
+ #drugInfoTable tr:nth-child(even) {
|
|
|
background-color: #f2f2f2;
|
|
|
}
|
|
|
+
|
|
|
+ /* 修正了宽度设置,因为宽度通常不应该应用于行(tr),而是应用于单元格(td或th) */
|
|
|
+ #drugInfoTable tr:nth-child(even) td {
|
|
|
+ width: auto; /* 根据内容自动调整宽度 */
|
|
|
+ }
|
|
|
.hidden-column {
|
|
|
display: none;
|
|
|
}
|