瀏覽代碼

模板功能优化,支持调用老模板来新增模板

hurugang 2 年之前
父節點
當前提交
3d35778275

+ 13 - 30
src/main/resources/static/js/common/message.js

@@ -6,17 +6,15 @@ function errorMesage(result) {
     if (result.code == -2) {
         return;
     }
-    var length = $("div.ui-pnotify").length;
-    if (length > 0) {
-        $("div.ui-pnotify").remove();
-    }
     new PNotify({
         title: '错误提示',
         text: result.message,
         type: 'error',
         hide: true,
-        styling: 'bootstrap3'
+        styling: 'bootstrap3',
+        pnotify_delay: 4000,            //显示时间(毫秒)
     });
+
 }
 
 /**
@@ -24,16 +22,13 @@ function errorMesage(result) {
  * @param result
  */
 function successMesage(result) {
-    var length = $("div.ui-pnotify").length;
-    if (length > 0) {
-        $("div.ui-pnotify").remove();
-    }
     new PNotify({
         title: '操作成功',
         text: result.message,
         type: 'success',
         hide: true,
-        styling: 'bootstrap3'
+        styling: 'bootstrap3',
+        pnotify_delay: 4000,            //显示时间(毫秒)
     });
 }
 
@@ -42,16 +37,13 @@ function successMesage(result) {
  * @param result
  */
 function successMesageSimaple(message) {
-    var length = $("div.ui-pnotify").length;
-    if (length > 0) {
-        $("div.ui-pnotify").remove();
-    }
     new PNotify({
         title: '操作成功',
         type: 'success',
         text: message,
         hide: true,
-        styling: 'bootstrap3'
+        styling: 'bootstrap3',
+        pnotify_delay: 4000,            //显示时间(毫秒)
     });
 }
 
@@ -61,16 +53,13 @@ function successMesageSimaple(message) {
  * @param result
  */
 function errorMesageSimaple(message) {
-    var length = $("div.ui-pnotify").length;
-    if (length > 0) {
-        $("div.ui-pnotify").remove();
-    }
     new PNotify({
         title: '错误提示',
         text: message,
         type: 'error',
         hide: true,
-        styling: 'bootstrap3'
+        styling: 'bootstrap3',
+        pnotify_delay: 4000,            //显示时间(毫秒)
     });
 }
 
@@ -79,14 +68,11 @@ function errorMesageSimaple(message) {
  * @param result
  */
 function warningMesageSimaple(message) {
-    var length = $("div.ui-pnotify").length;
-    if (length > 0) {
-        $("div.ui-pnotify").remove();
-    }
     new PNotify({
         title: '警告提示',
         text: message,
-        styling: 'bootstrap3'
+        styling: 'bootstrap3',
+        pnotify_delay: 4000,            //显示时间(毫秒)
     });
 }
 
@@ -96,14 +82,11 @@ function warningMesageSimaple(message) {
  * @param message
  */
 function infoMessage(message) {
-    var length = $("div.ui-pnotify").length;
-    if (length > 0) {
-        $("div.ui-pnotify").remove();
-    }
     new PNotify({
         title: '信息提示',
         text: message,
         type: 'info',
-        styling: 'bootstrap3'
+        styling: 'bootstrap3',
+        pnotify_delay: 4000,            //显示时间(毫秒)
     });
 }

+ 17 - 122
src/main/resources/static/js/mz/clinic.js

@@ -174,26 +174,6 @@ $(function () {
      * 存为范本
      */
     $("#saveapidAccepts").on("click", function (t) {
-        // var symptom = $("#symptom").val();
-        // if (symptom == null || symptom == "") {
-        //     errorMesageSimaple("主诉不能为空!");
-        //     return;
-        // }
-        //var emrHpi = $("#emrHpi").val();
-        // if (emrHpi == null || emrHpi == "") {
-        //     errorMesageSimaple("现病史不能为空!");
-        //     return;
-        // }
-        // var diagnoseValue = $("#diagnoseValue").val();
-        // var tentativeDiagnosis = $("#tentativeDiagnosis").val();
-        // if (diagnoseValue != null) {
-        //     var reg = new RegExp(',', "g")
-        //     diagnoseValue = diagnoseValue.replace(reg, '');
-        // }
-        // if ((diagnoseValue == null || diagnoseValue == "") && (tentativeDiagnosis == null || tentativeDiagnosis == "")) {
-        //     errorMesageSimaple("诊断和初步诊断不能同时为空!");
-        //     return;
-        // }
         //关闭帮助框
         $("#treeButton").webuiPopover('hide');
         $("#western_medicine_name").webuiPopover('hide');
@@ -1920,51 +1900,6 @@ function realClinicalReception(patientId, serialNo, reqType) {
 
                     //查询患者的门诊统筹信息
                     queryInsuinfo(patientId);
-
-
-                    // $.ajax({
-                    //     type: "GET",
-                    //     url: '/thmz/queryInsuinfo?patientId=' + patientId,
-                    //     contentType: "application/json;charset=UTF-8",
-                    //     dataType: "json",
-                    //     headers: {
-                    //         'Accept': 'application/json',
-                    //         'Authorization': 'Bearer ' + localStorage.getItem("token")
-                    //     },
-                    //     success: function (res) {
-                    //         if (res == '401' || res == 401) {
-                    //             window.location.href = '/thmz/login/view'
-                    //             return;
-                    //         }
-                    //         if (res.code == 0) {
-                    //             $("#messageModal").modal();
-                    //             $("#messageContent").html("请与患者沟通是否使用职工门诊统筹支付门诊费用!");
-                    //             $("#messageButton").off("click").on("click", function (t) {
-                    //                 $("#messageModal").modal("hide");
-                    //                 //TODO读卡
-                    //                 mztczfSiReadCard();
-                    //                 $("#zgmztczf").val(1);
-                    //                 if (res.balc != null) {
-                    //                     var balc = Number(res.balc);
-                    //                     if (balc > 0) {
-                    //                         $("#messageModal").modal();
-                    //                         $("#messageContent").html("患者个人医保账户(医保卡)有余额,请与患者沟通是否使用个人账户余额支付个人自付部分费用(免刷卡)!");
-                    //                         $("#messageButton").off("click").on("click", function (t) {
-                    //                             $("#messageModal").modal("hide");
-                    //                             $("#grzhzf").val(1);
-                    //                         });
-                    //                         $("#cancelButton").off("click");
-                    //                     }
-                    //                 }
-                    //             });
-                    //             $("#cancelButton").off("click");
-                    //         } else if (res.code == -1) {
-                    //             errorMesageSimaple(res.message);
-                    //         } else if (res.code == -2) {
-                    //             warningMesageSimaple(res.message);
-                    //         }
-                    //     }
-                    // });
                 }
             } else {
                 errorMesage(res);
@@ -2961,6 +2896,9 @@ function callTemplate() {
                 $("#templateKindType").selectpicker('refresh');
                 $("#templateType").selectpicker('val', res.data.templateType);
                 $("#templateType").selectpicker('refresh');
+                $('#operationType').selectpicker('val', 1);
+                $('#operationType').selectpicker('refresh');
+                $("#operationTypeDiv").removeClass("hide").addClass("in");
                 $("#medicalModelModal").modal("hide");
                 closePopover();
             } else {
@@ -3123,6 +3061,11 @@ function initGenderSelect() {
     var templateStatus = '<option value="0">启用</option><option value="1">停用</option>';
     $('#templateStatus').html(templateStatus);
     $('#templateStatus').selectpicker('refresh');
+    //医疗范文操作类型
+    var operationType = '<option value="0">新增</option><option value="1">修改</option>';
+    $('#operationType').html(operationType);
+    $('#operationType').selectpicker('refresh');
+
 }
 
 /**
@@ -3307,62 +3250,6 @@ function initMztcSelect() {
 }
 
 
-//
-// /**
-//  * 初始化诊断下拉选
-//  */
-// function initIcdSelect() {
-//     var icdCodeInputBeHospitalized = $("#icdCodeInputBeHospitalized").val()
-//     $.ajax({
-//         type: "GET",
-//         url: '/thmz/getTCommonParamsByParamsType?paramsType=4&commonParams=' + icdCodeInputBeHospitalized + '&pageSize=100',
-//         contentType: "application/json;charset=UTF-8",
-//         dataType: "json",
-//         headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
-//         success: function (res) {
-//             if (res == '401' || res == 401) {
-//                 window.location.href = '/thmz/login/view'
-//                 return;
-//             }
-//             var html = '';
-//             if (res.code == 0) {
-//                 if (res.data != null && res.data.length > 0) {
-//                     var html = '';
-//                     for (var i = 0; i < res.data.length; i++) {
-//                         html += '<option value="' + res.data[i].paramsCode + '">' + res.data[i].paramsName + '(' + res.data[i].paramsCode + ')</option>';
-//                     }
-//                     $('#icdCodeBeHospitalized').empty();
-//                     $('#icdCodeBeHospitalized').html(html);
-//                     $('#icdCodeBeHospitalized').selectpicker('destroy').selectpicker('refresh');
-//                     $('#icdCodeBeHospitalized').parent().addClass("open");
-//                     $('#icdCodeBeHospitalized').next().addClass("hide");
-//                     $('#icdCodeBeHospitalized').next().next().css("margin-top", "-34px");
-//                 }
-//             } else {
-//                 errorMesage(res);
-//             }
-//         }
-//     });
-// }
-//
-// /**
-//  * 设置诊断内容
-//  */
-// function setIcdText() {
-//     var icdCodeBeHospitalized = $('#icdCodeBeHospitalized option:selected').text();
-//     if (icdCodeBeHospitalized != null) {
-//         var icdText = icdCodeBeHospitalized.substring(0, icdCodeBeHospitalized.indexOf("("));
-//         $("#icdTextBeHospitalized").val(icdText);
-//         $("#icdCodeInputBeHospitalized").val($('#icdCodeBeHospitalized').val());
-//         $("#icdTextBeHospitalized").attr("title", icdText);
-//     } else {
-//         $("#icdTextBeHospitalized").val("");
-//         $("#icdCodeInputBeHospitalized").val("");
-//         $("#icdTextBeHospitalized").attr("title", "");
-//     }
-//     $('#icdCodeBeHospitalized').parent().addClass("hide");
-// }
-
 /**
  * 初始化医疗范文范围下拉选
  * @param templateTypeId
@@ -8090,13 +7977,18 @@ function saveapidAccepts() {
     $("#messageButton").off("click").on("click", function (t) {
         $("#messageModal").modal("hide");
         var jsonData = getParamsForpPrescription(2);
+        var operationType=$("#operationType").val();
+        var templateId=$("#templateId").val();
+        if(operationType==0 || operationType=='0'){
+            templateId=null;
+        }
         $.ajax({
             type: "POST",
             url: '/thmz/saveTemplate',
             contentType: "application/json;charset=UTF-8",
             dataType: "json",
             data: JSON.stringify({
-                "id": $("#templateId").val(),
+                "id": templateId,
                 "name": templateName,
                 "icdText": jsonData.icdText != null ? jsonData.icdText : jsonData.mzBlRecord.tentativeDiagnosis,
                 "templateKindType": templateKindType,
@@ -8176,6 +8068,9 @@ function clearApidAcceptsModal() {
     $("#templateType").selectpicker('refresh');
     $("#templateStatus").selectpicker('val', 0);
     $("#templateStatus").selectpicker('refresh');
+    $('#operationType').selectpicker('val', 0);
+    $('#operationType').selectpicker('refresh');
+    $("#operationTypeDiv").removeClass("in").addClass("hide");
 }
 
 

+ 11 - 0
src/main/resources/templates/mz/clinic.html

@@ -2039,6 +2039,17 @@
                             </div>
                         </div>
                     </div>
+                    <div class="item form-group hide" id="operationTypeDiv">
+                        <div class="col-md-12 col-sm-12 col-xs-12 item">
+                            <label class="control-label col-md-4 col-sm-4 col-xs-12" for="operationType">操作类型
+                            </label>
+                            <div class="col-md-8 col-sm-8 col-xs-12">
+                                <select class="form-control selectpicker show-tick" title="请选择"
+                                        id="operationType">
+                                </select>
+                            </div>
+                        </div>
+                    </div>
                     <div class="item form-group">
                         <div class="col-md-12 col-sm-12 col-xs-12 item">
                             <label class="control-label col-md-4 col-sm-4 col-xs-12" for="templateKindType">范文类型