|
@@ -30,7 +30,10 @@
|
|
|
</div>
|
|
|
<div class="customize-form-group">
|
|
|
<label>医院:</label>
|
|
|
- <input name="hospital" placeholder="医院" id="hospital" class="styled-input" type="text">
|
|
|
+<!-- <input name="hospital" placeholder="医院" id="hospital" class="styled-input" type="text">-->
|
|
|
+ <select id="hospital-select" name="hospital" class="styled-input form-control select2-multiple" placeholder="请选择或输入搜索">
|
|
|
+ <option value="">请选择医院</option>
|
|
|
+ </select>
|
|
|
</div>
|
|
|
<div class="customize-form-group">
|
|
|
<label>处方医生:</label>
|
|
@@ -201,6 +204,7 @@
|
|
|
var removeFlag = [[${@permission.hasPermi('dtp:RecipeRegister:remove')}]];
|
|
|
var prefix_recipe = ctx + "dtp/recipe";
|
|
|
var prefix_yppz= ctx + "yppz/drugConfig";
|
|
|
+ var prefix_configInfo= ctx + "dtp/configInfo";
|
|
|
var prefix_pmService = ctx + "dtp/pmService";
|
|
|
var hzparam =[];
|
|
|
var openId='';
|
|
@@ -215,6 +219,11 @@
|
|
|
/*<![CDATA[*/
|
|
|
var xl = /*[[${xl}]]*/ '';
|
|
|
/*]]>*/
|
|
|
+
|
|
|
+ /*<![CDATA[*/
|
|
|
+ var hospitals = /*[[${hospital}]]*/ '';
|
|
|
+ /*]]>*/
|
|
|
+
|
|
|
$(document).ready(function() {
|
|
|
// 获取所有的输入元素(input, textarea, select)
|
|
|
var $inputs = $('form').find('input, textarea, select').filter(':visible');
|
|
@@ -255,6 +264,56 @@
|
|
|
getLastRecipe(patientId);
|
|
|
}
|
|
|
});
|
|
|
+
|
|
|
+ // 初始化 Select2 插件
|
|
|
+ $('#hospital-select').select2({
|
|
|
+ placeholder: "请选择或直接输入搜索",
|
|
|
+ //allowClear: true //在输入框最后 有一个 删除所有的X 但是会出现 第一个删除出现问题有空格
|
|
|
+ });
|
|
|
+
|
|
|
+ $('#hospital-select').on('select2:select', function(e) {
|
|
|
+ var clearSpan = $('.select2-selection-clear');
|
|
|
+ if (clearSpan.length > 0) {
|
|
|
+ clearSpan.remove();
|
|
|
+ }
|
|
|
+ });
|
|
|
+ // 发送 AJAX 请求获取疾病大类数据
|
|
|
+ $.ajax({
|
|
|
+ url: prefix_configInfo+'/dtpHospitalList',
|
|
|
+ method: 'POST',
|
|
|
+ dataType: 'json',
|
|
|
+ success: function(data) {
|
|
|
+ var options = $('#hospital-select');
|
|
|
+ // 清空已有选项(除了第一个默认选项)
|
|
|
+ options.find('option').not(':first').remove();
|
|
|
+ $('<option>', {
|
|
|
+ value: '',
|
|
|
+ text : '请选择疾病类型'
|
|
|
+ }).appendTo(options);
|
|
|
+ // 遍历返回的数据并添加选项
|
|
|
+ $.each(data.value, function(index, item) {
|
|
|
+ $('<option>', {
|
|
|
+ value: item.id,
|
|
|
+ text : item.standardName
|
|
|
+ }).appendTo(options);
|
|
|
+
|
|
|
+ });
|
|
|
+ console.log("hospitals====="+hospitals);
|
|
|
+ // 设置默认选中的 dl 选项
|
|
|
+ options.val(hospitals).trigger('change');
|
|
|
+ /*$('#category-select').select2({
|
|
|
+ placeholder: "请选择或直接输入搜索",
|
|
|
+ //allowClear: true //在输入框最后 有一个 删除所有的X 但是会出现 第一个删除出现问题有空格
|
|
|
+ });*/
|
|
|
+ // 加载对应的 xl 数据
|
|
|
+
|
|
|
+ // 重新初始化 Select2 以反映新的选项
|
|
|
+ options.trigger('change');
|
|
|
+ },
|
|
|
+ error: function(xhr, status, error) {
|
|
|
+ console.error("Failed to load disease categories:", error);
|
|
|
+ }
|
|
|
+ });
|
|
|
// 初始化 Select2 插件
|
|
|
$('#category-select').select2({
|
|
|
placeholder: "请选择或直接输入搜索",
|
|
@@ -554,6 +613,7 @@
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
+ var selectedhospital = $('#hospital-select option:selected');
|
|
|
var selectedOptionsDL = $('#category-select option:selected');
|
|
|
var selectedOptionsXL = $('#subcategory-select option:selected');
|
|
|
var selectedDataDL = selectedOptionsDL.map(function() {
|
|
@@ -568,8 +628,16 @@
|
|
|
name: $(this).text()
|
|
|
};
|
|
|
}).get(); // 获取的数据格式 [{ id: "2", name: "肿瘤治疗并发症与合并症名称" }, { id: "3", name: "风湿免疫疾病名称库" }]
|
|
|
+ var selectedhospitals = selectedhospital.map(function() {
|
|
|
+ return {
|
|
|
+ id: $(this).val(),
|
|
|
+ name: $(this).text()
|
|
|
+ };
|
|
|
+ }).get();
|
|
|
+ const hospitals = JSON.stringify(selectedhospitals);
|
|
|
const DL = JSON.stringify(selectedDataDL);
|
|
|
const XL = JSON.stringify(selectedDataXL);
|
|
|
+ //formData.append('hospital', hospitals);
|
|
|
formData.append('dl', DL);
|
|
|
formData.append('xl', XL);
|
|
|
formData.append('dlanme', DL);
|