hurugang пре 3 година
родитељ
комит
d9acf864e8

+ 10 - 7
src/main/java/cn/hnthyy/thmz/controller/mz/ZdChargeItemController.java

@@ -512,7 +512,7 @@ public class ZdChargeItemController {
     /**
      *  判断是否加收,根据项目编码或者检查检验项目编码查询对应的收费项目.医剂项目返回第一个加收的
      * @param code
-     * @param jcJyZltype 项目类型 1 检验 2 检查
+     * @param jcJyZltype 项目类型 1 检验 2 检查  3 诊疗
      * @return
      */
     @UserLoginToken
@@ -530,12 +530,15 @@ public class ZdChargeItemController {
             return resultMap;
         }
         try {
-            ZdChargeItem zdChargeItem=zdChargeItemService.queryZdChargeItemByCode(code);
-            if(zdChargeItem!=null){
-                resultMap.put("code", 0);
-                resultMap.put("message", "查询收费项目成功");
-                resultMap.put("data", zdChargeItem);
-                return resultMap;
+            if(jcJyZltype==3){
+                //当前项目是诊疗,直接查询诊疗字典
+                ZdChargeItem zdChargeItem=zdChargeItemService.queryZdChargeItemByCode(code);
+                if(zdChargeItem!=null){
+                    resultMap.put("code", 0);
+                    resultMap.put("message", "查询收费项目成功");
+                    resultMap.put("data", zdChargeItem);
+                    return resultMap;
+                }
             }
             List<ZdChargeItem> zdChargeItemList = jcJyItemChargeService.queryJcJyItemChargeByCode(code,jcJyZltype);
             if (zdChargeItemList == null || zdChargeItemList.size() == 0) {

+ 497 - 145
src/main/resources/static/js/mz/clinic.js

@@ -240,7 +240,7 @@ $(function () {
     });
 
     /**
-     * 项目点击事件
+     * 辅助检查、检验点击事件
      */
     $("#jcJyItem").on("click", function (t) {
         if ($("#jcJyItemPopoverContent").parent().parent().parent().hasClass("in")) {
@@ -251,6 +251,20 @@ $(function () {
         $('#jcJyItem').webuiPopover('show');
         loadjcJyItemList(null);
     });
+
+    /**
+     * 诊疗点击事件
+     */
+    $("#zlItem").on("click", function (t) {
+        if ($("#zlItemPopoverContent").parent().parent().parent().hasClass("in")) {
+            $('#zlItem').webuiPopover('hide');
+            $("#treeButton").webuiPopover('hide');
+            return;
+        }
+        $('#zlItem').webuiPopover('show');
+        loadZlItemList(null);
+    });
+
     initYshPart();
     initJyZdSample();
     setTimeout(function () {
@@ -398,10 +412,7 @@ $(function () {
             } else if (id == 'saveWesternMedicine') {
                 $("#western_medicine_name").focus();
                 $("#western_medicine_name").click();
-            }
-            else if (id == 'chargeUnit') {
-                $("#itemQuantity").focus();
-            } else if (id == 'itemQuantity' || id == 'jyZdSample' || id == 'yshPart') {
+            }else if (id == 'jyZdSample' || id == 'yshPart') {
                 $("#execUnit").next().click();
             } else if (id == 'execUnit') {
                 var ariaExpanded = $("#execUnit").next().attr("aria-expanded");
@@ -412,9 +423,19 @@ $(function () {
             } else if (id == 'remark') {
                 saveJyJcItem(true);
                 $("#jcJyItem").focus();
-            } else if (id == 'saveJyJcItem') {
-                $("#jcJyItem").focus();
-                $("#jcJyItem").click();
+            }else if (id == 'chargeUnit') {
+                $("#zlExecUnit").next().click();
+            } else if (id == 'zlExecUnit') {
+                var ariaExpanded = $("#zlExecUnit").next().attr("aria-expanded");
+                if (ariaExpanded == true || ariaExpanded == "true") {
+                    $("#zlExecUnit").next().click();
+                }
+                $("#itemQuantity").focus();
+            }else if(id == 'itemQuantity' ){
+                $("#zlRemark").focus();
+            }else if (id == 'zlRemark') {
+                saveZlItem(true);
+                $("#zlItem").focus();
             } else if (id == 'inpatientWardBeHospitalized') {
                 $("#smallWardBeHospitalized").next().click();
             } else if (id == 'smallWardBeHospitalized') {
@@ -497,31 +518,10 @@ $(function () {
                         var tableData = $("#tb_table_jc_jy_item").bootstrapTable('getData');
                         if (tableData != null && tableData.length > 0 && dataIndex != null) {
                             var trData = tableData[dataIndex];
-
                             $('#jcJyItem').webuiPopover('hide');
                             $("#jcJyZltype").val(trData.type);
                             $("#execUnit").selectpicker('val', trData.execUnit);//默认不选中
                             $("#execUnit").selectpicker('refresh');
-                            if (trData.type == 3) {
-                                //诊疗
-                                if ($("#zlTab").find("li") == null || $("#zlTab").find("li").length == 0) {
-                                    initNavTabs(2);
-                                }
-                                $("#jcJyItem").val(trData.name);
-                                $("#jcJyItem").blur();
-                                $("#jcjyItemPrice").val(trData.chargeAmount);
-                                $("#chargeUnit").val(trData.specification);
-                                $("#current_code").val(trData.code);
-                                $("#jcJyItemChargeDetail").removeClass("in").addClass("hide");
-                                $("#chargeUnitDiv").removeClass("hide").addClass("in");
-                                $("#jyZdSampleDiv").removeClass("in").addClass("hide");
-                                $("#yshPartDiv").removeClass("in").addClass("hide");
-                                $("#itemQuantityDiv").removeClass("hide").addClass("in");
-                                $("#itemQuantity").val(1);
-                                $("#chargeUnit").focus();
-                                //  currentEleId = 'chargeUnit';
-                                return;
-                            }
                             if (trData.type == 1) {
                                 //检验
                                 $("#jyZdSampleDiv").removeClass("hide").addClass("in");
@@ -541,7 +541,6 @@ $(function () {
                                     $('#yshPart').selectpicker('refresh');
                                 }
                             }
-                            $("#itemQuantityDiv").removeClass("in").addClass("hide");
                             $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
                             checkJcJyItemInfo(trData.code, trData.name, trData.type, true);
                         }
@@ -558,16 +557,54 @@ $(function () {
                         } else if ($("#yshPartDiv").hasClass('in')) {
                             //说明现在是检查
                             $("#yshPart").next().click();
-                        } else if ($("#chargeUnitDiv").hasClass('in')) {
-                            //说明现在是检查
-                            $("#yshPart").next().click();
                         }
                     } else {
                         //药品查询框是空白的,打开查询框
                         $("#jcJyItem").click();
                     }
                 }
-            } else if (id == 'zy_req_button') {
+            } else if (id == 'zlItem') {
+                var webuiID = $("#zlItem").attr("data-target");
+                if (webuiID == null || webuiID == "null" || webuiID == "") {
+                    $("#zlItem").click();
+                    return;
+                }
+                //选择框打开
+                if ($("#" + webuiID).hasClass("in")) {
+                    var arr = $("#tb_table_zl_item").find("tbody").find("tr.trhover");
+                    if (arr != undefined && arr != null && arr.length > 0) {
+                        var dataIndex = $(arr).attr("data-index");
+                        var tableData = $("#tb_table_zl_item").bootstrapTable('getData');
+                        if (tableData != null && tableData.length > 0 && dataIndex != null) {
+                            var trData = tableData[dataIndex];
+                            $('#zlItem').webuiPopover('hide');
+                            $("#zlExecUnit").selectpicker('val', trData.execUnit);//默认不选中
+                            $("#zlExecUnit").selectpicker('refresh');
+                            //诊疗
+                            if ($("#zlTab").find("li") == null || $("#zlTab").find("li").length == 0) {
+                                initNavTabs(3);
+                            }
+                            $("#zlItem").val(trData.name);
+                            $("#zlItem").blur();
+                            $("#zlItemPrice").val(trData.chargeAmount);
+                            $("#chargeUnit").val(trData.specification);
+                            $("#current_code").val(trData.code);
+                            $("#itemQuantity").val(1);
+                            $("#chargeUnit").focus();
+                        }
+                    } else {
+                        //药品查询框是空白的,打开查询框
+                        $("#zlItem").click();
+                    }
+                } else {
+                    if (current_code != null && current_code != "") {
+                        $("#chargeUnit").click();
+                    } else {
+                        //药品查询框是空白的,打开查询框
+                        $("#zlItem").click();
+                    }
+                }
+            }else if (id == 'zy_req_button') {
                 //当前页面是住院保存页面,此时光标在入院按钮上
                 console.log("入院按钮")
                 $("#inpatientWardBeHospitalized").next().click();
@@ -589,6 +626,10 @@ $(function () {
                 tableId = "tb_table_jc_jy_item";
                 inputId = "jcJyItem";
                 contentId = "jcJyItemPopoverContent";
+            } else if (index == 3) {
+                tableId = "tb_table_zl_item";
+                inputId = "zlItem";
+                contentId = "zlItemPopoverContent";
             }
             if (inputId == null) {
                 return;
@@ -632,6 +673,10 @@ $(function () {
                 tableId = "tb_table_jc_jy_item";
                 inputId = "jcJyItem";
                 contentId = "jcJyItemPopoverContent";
+            } else if (index == 3) {
+                tableId = "tb_table_zl_item";
+                inputId = "zlItem";
+                contentId = "zlItemPopoverContent";
             }
             if (inputId == null) {
                 return;
@@ -1788,7 +1833,7 @@ function medicalModelModal(id) {
                             xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5, emrProcess.indexOf("中药治疗:"));
                         } else if (emrProcess.indexOf("辅助检查、检验:") >= 0) {
                             xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5, emrProcess.indexOf("辅助检查、检验:"));
-                        }else if (emrProcess.indexOf("诊疗:") >= 0) {
+                        } else if (emrProcess.indexOf("诊疗:") >= 0) {
                             xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5, emrProcess.indexOf("诊疗:"));
                         } else {
                             xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5);
@@ -1813,9 +1858,9 @@ function medicalModelModal(id) {
                     if (emrProcess.indexOf("中药治疗:") >= 0) {
                         if (emrProcess.indexOf("辅助检查、检验:") >= 0) {
                             zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5, emrProcess.indexOf("辅助检查、检验:"));
-                        }else  if (emrProcess.indexOf("诊疗:") >= 0) {
+                        } else if (emrProcess.indexOf("诊疗:") >= 0) {
                             zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5, emrProcess.indexOf("诊疗:"));
-                        }else {
+                        } else {
                             zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5);
                         }
                         var zyArr = zy.split("_");
@@ -1847,7 +1892,7 @@ function medicalModelModal(id) {
                     if (emrProcess.indexOf("辅助检查、检验:") >= 0) {
                         if (emrProcess.indexOf("诊疗:") >= 0) {
                             jcjy = emrProcess.substring(emrProcess.indexOf("辅助检查、检验:") + 8, emrProcess.indexOf("诊疗:"));
-                        }else {
+                        } else {
                             jcjy = emrProcess.substring(emrProcess.indexOf("辅助检查、检验:") + 8);
                         }
                         var jcjyArr = jcjy.split("_");
@@ -3138,7 +3183,7 @@ function editChineseMedicine(obj) {
 
 
 /**
- * 修改项目
+ * 修改辅助检查、检验项目
  * @param obj
  */
 function editJyJcItem(obj) {
@@ -3156,8 +3201,6 @@ function editJyJcItem(obj) {
 
     var chargeUnit = $(parentObject).find("input.temporary_items_desc_value").val();
     var jcJyZltype = $(parentObject).find("input.temporary_items_type").val();
-    //数量
-    var itemQuantity = $(parentObject).find("input.temporary_items_itemQuantity").val();
     //执行科室
     var execUnit = $(parentObject).find("input.temporary_items_execUnit").val();
     $("#execUnit").selectpicker('val', execUnit);
@@ -3166,33 +3209,50 @@ function editJyJcItem(obj) {
         $("#jyZdSample").selectpicker('val', chargeUnit);
         $('#jyZdSample').selectpicker('refresh');
         $("#jyZdSampleDiv").removeClass("hide").addClass("in");
-        $("#chargeUnitDiv").removeClass("in").addClass("hide");
         $("#yshPartDiv").removeClass("in").addClass("hide");
         $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
-        $("#itemQuantityDiv").removeClass("in").addClass("hide");
     } else if (jcJyZltype == 2 || jcJyZltype == "2") {
         $("#yshPart").selectpicker('val', chargeUnit);
         $('#yshPart').selectpicker('refresh');
         $("#yshPartDiv").removeClass("hide").addClass("in");
         $("#jyZdSampleDiv").removeClass("in").addClass("hide");
-        $("#chargeUnitDiv").removeClass("in").addClass("hide");
         $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
-        $("#itemQuantityDiv").removeClass("in").addClass("hide");
-    } else if (jcJyZltype == 3 || jcJyZltype == "3") {
-        //描述
-        $("#chargeUnit").val(chargeUnit);
-        $("#itemQuantity").val(itemQuantity);
-        $("#chargeUnitDiv").removeClass("hide").addClass("in");
-        $("#jyZdSampleDiv").removeClass("in").addClass("hide");
-        $("#yshPartDiv").removeClass("in").addClass("hide");
-        $("#jcJyItemChargeDetail").removeClass("in").addClass("hide");
-        $("#itemQuantityDiv").removeClass("hide").addClass("in");
     }
     $("#jcJyZltype").val(jcJyZltype);
 }
 
+
+/**
+ * 修改诊疗项目
+ * @param obj
+ */
+function editZlItem(obj) {
+    //是新增药品还是编辑 true 修改 默认false
+    $("#update_flag").val(true);
+    var parentObject = $(obj).parent();
+    //当前项目编码
+    $("#current_code").val($(parentObject).find("input.temporary_items_code").val());
+    //项目名称
+    $("#zlItem").val($(parentObject).find("input.temporary_items_zlItemName").val());
+    //单价
+    $("#zlItemPrice").val($(parentObject).find("input.temporary_items_amount").val());
+    //备注
+    $("#zlRemark").val($(parentObject).find("input.temporary_items_remark").val());
+
+    var chargeUnit = $(parentObject).find("input.temporary_items_desc_value").val();
+    //数量
+    var itemQuantity = $(parentObject).find("input.temporary_items_itemQuantity").val();
+    //执行科室
+    var execUnit = $(parentObject).find("input.temporary_items_execUnit").val();
+    $("#zlExecUnit").selectpicker('val', execUnit);
+    $('#zlExecUnit').selectpicker('refresh');
+    //描述
+    $("#chargeUnit").val(chargeUnit);
+    $("#itemQuantity").val(itemQuantity);
+}
+
 /**
- * 保存当前项目到右边处方区域   需要提示加价
+ * 保存当前辅助检查、检验项目到右边处方区域   需要提示加价
  * @param calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
  */
 function saveJyJcItem(calculateTotalAmountFlag) {
@@ -3241,7 +3301,7 @@ function saveJyJcItem(calculateTotalAmountFlag) {
  * @param calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
  */
 function saveJyJcItemReal(calculateTotalAmountFlag) {
-    var tableId = $("#zlTab li.active").find("a").attr("href");
+    var tableId = $("#jcjyTab li.active").find("a").attr("href");
     //组号
     var groupId = $(tableId).find("div:eq(0)").children().length + 1;
     //项目名称
@@ -3250,18 +3310,17 @@ function saveJyJcItemReal(calculateTotalAmountFlag) {
     var currentCode = $("#current_code").val();
     //当前项目价格
     var jcjyItemPrice = $("#jcjyItemPrice").val();
-    //描述
-    var chargeUnit = $("#chargeUnit").val();
+
     //执行科室
     var execUnit = $("#execUnit").val();
     //执行科室
     var execUnitName = $('#execUnit option:selected').text();
     execUnitName = execUnitName.substring(0, execUnitName.indexOf("("));
-    //次数
-    var itemQuantity = $("#itemQuantity").val();
     //描述编码
-    var chargeUnitCode = chargeUnit;
-    var chargeUnitName = " 描述:";
+    var chargeUnitCode = null;
+    var chargeUnitName = "";
+    //检验物或者检查部位
+    var chargeUnit = null;
     //备注
     var remark = $("#remark").val();
     //项目类型
@@ -3355,7 +3414,6 @@ function saveJyJcItemReal(calculateTotalAmountFlag) {
     html += '<input type="hidden" class="temporary_items_remark" value="' + remark + '"/>';
     html += '<input type="hidden" class="temporary_items_type" value="' + jcJyZltype + '"/>';
     html += '<input type="hidden" class="temporary_items_desc_value" value="' + chargeUnitCode + '"/>';
-    html += '<input type="hidden" class="temporary_items_itemQuantity" value="' + itemQuantity + '"/>';
     html += '<input type="hidden" class="temporary_items_execUnit" value="' + execUnit + '"/>';
     html += '</div>';
     //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
@@ -3374,6 +3432,168 @@ function saveJyJcItemReal(calculateTotalAmountFlag) {
 }
 
 
+/**
+ * 保存当前诊疗项目到右边处方区域   需要提示加价
+ * @param calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
+ */
+function saveZlItem(calculateTotalAmountFlag) {
+    //6岁内提示加价
+    var patientAge = $("#patientAge").text();
+    if (patientAge != null && patientAge != "" && patientAge < 6) {
+        $.ajax({
+            type: "GET",
+            url: '/thmz/checkAdditionally?code=' + $("#current_code").val() + "&jcJyZltype=3",
+            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) {
+                    if (res.data != undefined && res.data != null && res.data.co != null && res.data.co == 1 && res.data.xlCode != null && res.data.xlCode != "") {
+                        var xlCode = res.data.xlCode;
+                        xlCode = Multiply(100, xlCode);
+                        $("#messageModal").modal();
+                        $("#messageContent").html("根据【湘医保发〔2020〕51 号】价格通知,6岁以内的小朋友诊疗费上调" + xlCode + "%,是否需要继续添加该项目?");
+                        $("#messageButton").off("click").on("click", function (t) {
+                            $("#messageModal").modal("hide");
+                            saveZlItemReal(true);
+                        });
+                        $("#cancelButton").off("click");
+                    } else {
+                        //虽然是不满6岁,但是也没有需要加收的项目,直接保存
+                        saveZlItemReal(calculateTotalAmountFlag);
+                    }
+                } else {
+                    errorMesage(res);
+                }
+            }
+        });
+    } else {
+        saveZlItemReal(calculateTotalAmountFlag);
+    }
+}
+
+
+/**
+ * 保存当前项目到右边处方区域
+ * @param calculateTotalAmountFlag 是否计算总金额 回写的时候一次计算
+ */
+function saveZlItemReal(calculateTotalAmountFlag) {
+    var tableId = $("#zlTab li.active").find("a").attr("href");
+    //组号
+    var groupId = $(tableId).find("div:eq(0)").children().length + 1;
+    //项目名称
+    var zlItem = $("#zlItem").val();
+    //当前项目编码
+    var currentCode = $("#current_code").val();
+    //当前项目价格
+    var zlItemPrice = $("#zlItemPrice").val();
+    //描述
+    var chargeUnit = $("#chargeUnit").val();
+    //执行科室
+    var zlExecUnit = $("#zlExecUnit").val();
+    //执行科室
+    var zlExecUnitName = $('#zlExecUnit option:selected').text();
+    zlExecUnitName = zlExecUnitName.substring(0, zlExecUnitName.indexOf("("));
+    //次数
+    var itemQuantity = $("#itemQuantity").val();
+    //描述编码
+    var chargeUnitCode = chargeUnit;
+    var chargeUnitName = " 描述:";
+    //备注
+    var remark = $("#zlRemark").val();
+
+    if (currentCode == null || currentCode == '') {
+        if (calculateTotalAmountFlag == true) {
+            errorMesageSimaple("未选择任何项目!");
+        }
+        return;
+    }
+    //判断是否有重复的项目  返回true 说明有重复的
+    if (verifyRepeat(currentCode, null, null, 3)) {
+        return;
+    }
+
+
+    //原药品金额 如果是修改则需要设置
+    var temporaryItemsAmount = 0;
+    //当前需要被移除元素的下个兄弟节点
+    var nextObj = null;
+    //当前修改的药品是不是最后一个
+    var isLast = false;
+    //是新增药品还是编辑 true 修改 默认false
+    var updateFlag = $("#update_flag").val();
+    if (updateFlag == undefined || updateFlag == null) {
+        updateFlag = false;
+    }
+    //如果是修改,需要减去原来的费用
+    //原组号
+    var oriGroupId = null;
+    if (updateFlag == "true" || updateFlag == true) {
+        var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
+        if (formGroups != null && formGroups.length > 0) {
+            for (var i = 0; i < formGroups.length; i++) {
+                var temporaryItemsCode = $(formGroups[i]).find("input.temporary_items_code").val();
+                if (temporaryItemsCode === currentCode) {
+                    temporaryItemsAmount = $(formGroups[i]).find("input.temporary_items_amount").val();
+                    if (formGroups.length > 1) {
+                        nextObj = $(formGroups[i]).next();
+                    }
+                    isLast = (i + 1) === formGroups.length;
+                    oriGroupId = $(formGroups[i]).find("span.zlItemGroupId").text();
+                    $(formGroups[i]).remove();
+                    break;
+                }
+            }
+        }
+    }
+    if (oriGroupId != null) {
+        groupId = oriGroupId;
+    }
+    var html = '<div class="form-group">';
+    html += '<span class="zlItemGroupId">' + groupId + '</span>.<span style="margin-left: 5px"></span>'
+    html += zlItem + ' ';
+    html += " 数量:" + itemQuantity;
+    if (zlExecUnit != null && zlExecUnit != "") {
+        html += " 执行科室:" + zlExecUnitName;
+    }
+    if (chargeUnit != null && chargeUnit != '') {
+        html += chargeUnitName + chargeUnit;
+    }
+    if (remark != null && remark != '') {
+        html += ' 备注:' + remark;
+    }
+    html += ' <i class="fa fa-long-arrow-up" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="arrowUp(this)"></i>';
+    html += '<i class="fa fa-long-arrow-down" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="arrowDown(this)"></i>';
+    html += ' <i class="fa fa-long-arrow-left" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;" onclick="editZlItem(this)"></i>';
+    html += '<i class="fa fa-remove" style="cursor: pointer;height: 20px;line-height: 20px;width: 20px;font-size: 20px;margin-left: 10px;" onclick="removeYpOrProject(3,this)"></i>';
+    html += '<input type="hidden" class="temporary_items_code" value="' + currentCode + '"/>';
+    html += '<input type="hidden" class="temporary_items_zlItemName" value="' + zlItem + '"/>';
+    html += '<input type="hidden" class="temporary_items_amount" value="' + zlItemPrice + '"/>';
+    html += '<input type="hidden" class="temporary_items_remark" value="' + remark + '"/>';
+    html += '<input type="hidden" class="temporary_items_desc_value" value="' + chargeUnitCode + '"/>';
+    html += '<input type="hidden" class="temporary_items_itemQuantity" value="' + itemQuantity + '"/>';
+    html += '<input type="hidden" class="temporary_items_execUnit" value="' + zlExecUnit + '"/>';
+    html += '</div>';
+    //当没有下一个兄弟节点或者当前编辑的药品是最后一个时,直接添加
+    if (nextObj == null || isLast) {
+        $(tableId).find("div:eq(0)").append(html);
+    } else {
+        $(nextObj).before(html);
+    }
+    //设置当前处方金额
+    //calculateCfAmount(tableId, jcjyItemPrice, temporaryItemsAmount, 2, 0);
+    if (calculateTotalAmountFlag) {
+        //设置总金额
+        calculateTotalAmount();
+    }
+    clearZlItem();
+}
+
+
 /**
  *  临时保存住院证
  * @param messageFlag 是否需要提醒已经存在的入院申请 true 提示
@@ -3475,7 +3695,7 @@ function removeYpOrProject(index, obj) {
         }
     }
     $(obj).parent().remove();
-    if (index != 3) {
+    if (index != 4) {
         calculateTotalAmount();
     }
     var formGroups = $(tableId).find("div.cf_content").find("div.form-group");
@@ -3679,7 +3899,7 @@ function clearChineseMedicine() {
 
 
 /**
- * 清空项目
+ * 清空辅助检查、检验项目
  */
 function clearJyJcItem() {
     $("#update_flag").val(false);
@@ -3691,10 +3911,7 @@ function clearJyJcItem() {
     $("#jcjyItemPrice").val(null);
     //备注
     $("#remark").val(null);
-    //描述
-    $("#chargeUnit").val(null);
     $("#jcJyZltype").val(null);
-    $("#itemQuantity").val(1);
     $("#jyZdSample").selectpicker('val', null);
     $('#jyZdSample').selectpicker('refresh');
     $("#yshPart").selectpicker('val', null);
@@ -3702,10 +3919,28 @@ function clearJyJcItem() {
     $("#execUnit").selectpicker('val', null);
     $('#execUnit').selectpicker('refresh');
     $("#jcJyItemChargeDetail").removeClass("in").addClass("hide");
-    $("#chargeUnitDiv").removeClass("in").addClass("hide");
     $("#jyZdSampleDiv").removeClass("in").addClass("hide");
     $("#yshPartDiv").removeClass("in").addClass("hide");
-    $("#itemQuantityDiv").removeClass("in").addClass("hide");
+}
+
+/**
+ * 清空诊疗项目
+ */
+function clearZlItem() {
+    $("#update_flag").val(false);
+    //项目名称
+    $("#zlItem").val(null);
+    //当前项目编码
+    $("#current_code").val(null);
+    //单价
+    $("#zlItemPrice").val(null);
+    //备注
+    $("#zlRemark").val(null);
+    //描述
+    $("#chargeUnit").val(null);
+    $("#itemQuantity").val(1);
+    $("#zlExecUnit").selectpicker('val', null);
+    $('#zlExecUnit').selectpicker('refresh');
 }
 
 /**
@@ -3850,7 +4085,6 @@ function billItemButtonChange(object, objectIndex) {
     $(".tab-content").removeClass("in").addClass("hide");
     $(".nav-tabs:eq(" + objectIndex + ")").removeClass("hide").addClass("in");
     $(".tab-content:eq(" + objectIndex + ")").removeClass("hide").addClass("in");
-    // initNavTabs(objectIndex);
     $("#bill_item_group").find("button").each(function (index, element) {
         if ($(element).hasClass("btn-primary")) {
             $(element).removeClass("btn-primary").addClass("btn-default");
@@ -3862,20 +4096,15 @@ function billItemButtonChange(object, objectIndex) {
     $("#western_medicine_name").webuiPopover('hide');
     $("#chinese_medicine_name").webuiPopover('hide');
     $("#jcJyItem").webuiPopover('hide');
+    $("#zlItem").webuiPopover('hide');
     if (objectIndex == 0) {
         $("#western_medicine_name").focus();
-        // $("#western_medicine_name").click();
-        // currentEleId = 'western_medicine_name';
     } else if (objectIndex == 1) {
         $("#chinese_medicine_name").focus();
-        // $("#chinese_medicine_name").click();
-        //  currentEleId = 'chinese_medicine_name';
     } else if (objectIndex == 2) {
         $("#jcJyItem").focus();
-        //   $("#jcJyItem").click();
-        //   currentEleId = 'jcJyItem';
     } else if (objectIndex == 3) {
-        //   currentEleId = 'freeBedNum';
+        $("#zlItem").focus();
     }
 
 }
@@ -4159,10 +4388,14 @@ function initRecommendList() {
     //手动触发
     settings.trigger = 'manual';
     var chineseMedicineWebuiPopover = $('#chinese_medicine_name').webuiPopover('destroy').webuiPopover(settings);
-    //诊疗与医技弹窗
+    //辅助检查、检验弹窗
     settings.trigger = 'manual';
     settings.content = '<div id="jcJyItemPopoverContent"><table id="tb_table_jc_jy_item"></table></div>';
     var jcJyItemWebuiPopover = $('#jcJyItem').webuiPopover('destroy').webuiPopover(settings);
+    //诊疗弹窗
+    settings.trigger = 'manual';
+    settings.content = '<div id="zlItemPopoverContent"><table id="tb_table_zl_item"></table></div>';
+    var zlItemWebuiPopover = $('#zlItem').webuiPopover('destroy').webuiPopover(settings);
     //主诉选中事件
     $("#symptom").on("click", function (t) {
         if ($(symptomWebuiPopover).css("display") == "block") {
@@ -5090,30 +5323,9 @@ function loadjcJyItemList(event) {
             $("#jcJyZltype").val(row.type);
             $("#execUnit").selectpicker('val', row.execUnit);//默认不选中
             $("#execUnit").selectpicker('refresh');
-            if (row.type == 3) {
-                //诊疗
-                if ($("#zlTab").find("li") == null || $("#zlTab").find("li").length == 0) {
-                    initNavTabs(2);
-                }
-                $("#jcJyItem").val(row.name);
-                $("#jcJyItem").blur();
-                $("#jcjyItemPrice").val(row.chargeAmount);
-                $("#chargeUnit").val(row.specification);
-                $("#current_code").val(row.code);
-                $("#jcJyItemChargeDetail").removeClass("in").addClass("hide");
-                $("#chargeUnitDiv").removeClass("hide").addClass("in");
-                $("#jyZdSampleDiv").removeClass("in").addClass("hide");
-                $("#yshPartDiv").removeClass("in").addClass("hide");
-                $("#itemQuantityDiv").removeClass("hide").addClass("in");
-                $("#itemQuantity").val(1);
-                $("#chargeUnit").focus();
-                //  currentEleId = 'chargeUnit';
-                return;
-            }
             if (row.type == 1) {
                 //检验
                 $("#jyZdSampleDiv").removeClass("hide").addClass("in");
-                $("#chargeUnitDiv").removeClass("in").addClass("hide");
                 $("#yshPartDiv").removeClass("in").addClass("hide");
                 if (row.sampleCode != null && row.sampleCode != "") {
                     $("#jyZdSample").selectpicker('val', row.sampleCode);
@@ -5123,13 +5335,11 @@ function loadjcJyItemList(event) {
                 //检查
                 $("#yshPartDiv").removeClass("hide").addClass("in");
                 $("#jyZdSampleDiv").removeClass("in").addClass("hide");
-                $("#chargeUnitDiv").removeClass("in").addClass("hide");
                 if (row.bwCode != null && row.bwCode != "") {
                     $("#yshPart").selectpicker('val', row.bwCode);
                     $('#yshPart').selectpicker('refresh');
                 }
             }
-            $("#itemQuantityDiv").removeClass("in").addClass("hide");
             $("#jcJyItemChargeDetail").removeClass("hide").addClass("in");
             checkJcJyItemInfo(row.code, row.name, row.type, true);
         }
@@ -5137,6 +5347,125 @@ function loadjcJyItemList(event) {
 }
 
 
+/**
+ * 加载诊疗列表
+ * @param index
+ */
+function loadZlItemList(event) {
+    if (event != null) {
+        if (event.keyCode == 38 || event.keyCode == 40 || event.keyCode == 13) {
+            //上下键不刷新表格
+            return;
+        }
+    }
+    $('#tb_table_zl_item').bootstrapTable('refresh');
+    $('#tb_table_zl_item').bootstrapTable({
+        url: '/thmz/getZlItemByCommonParams',         //请求后台的URL(*)
+        method: 'GET',                      //请求方式(*)
+        toolbar: '#toolbar',                //工具按钮用哪个容器
+        striped: true,                      //是否显示行间隔色
+        cache: true,                       //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
+        pagination: false,                   //是否显示分页(*)
+        sortable: true,                     //是否启用排序
+        sortOrder: "asc",                   //排序方式
+        queryParams: function (params) {
+            var temp = {
+                commonParams: $("#zlItem").val()
+            };
+            return temp;
+        },           //传递参数(*)
+        sidePagination: "server",           //分页方式:client客户端分页,server服务端分页(*)
+        pageNumber: 1,                       //初始化加载第一页,默认第一页
+        pageSize: 5,                       //每页的记录行数(*)
+        pageList: [5, 10, 25, 50, 100],        //可供选择的每页的行数(*)
+        search: false,                       //是否显示表格搜索,此搜索是客户端搜索,不会进服务端,所以,个人感觉意义不大
+        strictSearch: true,
+        showColumns: false,                  //是否显示所有的列
+        showRefresh: false,                  //是否显示刷新按钮
+        minimumCountColumns: 2,             //最少允许的列数
+        clickToSelect: true,                //是否启用点击选中行
+        uniqueId: "ID",                     //每一行的唯一标识,一般为主键列
+        showToggle: false,                    //是否显示详细视图和列表视图的切换按钮
+        cardView: false,                    //是否显示详细视图
+        detailView: false,
+        //rowStyle:rowStyle,//通过自定义函数设置行样式
+        ajaxOptions: {
+            headers: {
+                'Accept': 'application/json',
+                'Authorization': 'Bearer ' + localStorage.getItem("token")
+            }
+        },
+        columns: [
+            {
+                field: 'code',
+                title: '编码',
+                align: "center",
+                valign: 'middle',
+                // sortable: true
+            }, {
+                field: 'name',
+                title: '名称',
+                align: "center",
+                valign: 'middle',
+                //  sortable: true
+            }
+            , {
+                field: 'execUnitName',
+                title: '执行科室',
+                align: "center",
+                valign: 'middle',
+                // sortable: true
+            }, {
+                field: 'type',
+                title: '项目类型',
+                align: "center",
+                valign: 'middle',
+                // sortable: true
+                formatter: function (value, row, index) {
+                    return "诊疗";
+                }
+            },
+        ],
+        responseHandler: function (res) {
+            if (res == '401' || res == 401) {
+                window.location.href = '/thmz/login/view'
+                return;
+            }
+            var ress = eval(res);
+            if (ress.code == -1) {
+                errorMesage(res);
+                return {
+                    "total": 0,//总页数
+                    "rows": {}   //数据
+                };
+            }
+            $("#zlItemPopoverContent").parent().css("background", "#EBEBE4");
+            return {
+                "total": ress.data.length,//总页数
+                "rows": ress.data   //数据
+            };
+        },
+        onClickRow: function (row, $element) {
+            $('#zlItem').webuiPopover('hide');
+            $("#zlExecUnit").selectpicker('val', row.execUnit);//默认不选中
+            $("#zlExecUnit").selectpicker('refresh');
+            //诊疗
+            if ($("#zlTab").find("li") == null || $("#zlTab").find("li").length == 0) {
+                initNavTabs(3);
+            }
+            $("#zlItem").val(row.name);
+            $("#zlItem").blur();
+            $("#zlItemPrice").val(row.chargeAmount);
+            $("#chargeUnit").val(row.specification);
+            $("#current_code").val(row.code);
+            $("#itemQuantity").val(1);
+            $("#chargeUnit").focus();
+            return;
+        }
+    });
+}
+
+
 /**
  * 诊疗与医技选中
  * @param code
@@ -5167,7 +5496,7 @@ function checkJcJyItemInfo(code, name, type, async) {
             if (res.code == 0) {
                 if (res.data != null) {
                     //如果
-                    if ($("#zlTab").find("li") == null || $("#zlTab").find("li").length == 0) {
+                    if ($("#jcjyTab").find("li") == null || $("#jcjyTab").find("li").length == 0) {
                         initNavTabs(2);
                     }
                     if (name == null) {
@@ -5336,7 +5665,7 @@ function getJcJyItemChargeByCode(code, jcJyZltype) {
  * 判断是否有重复的项目  返回true 说明有重复的
  * @param code 编码
  * @param serial 药品规格 null 时是非药品
- * @param chargeUnitCode 检查部位或者检验物 null 时是检查检验
+ * @param chargeUnitCode 检查部位或者检验物 null 时是 诊疗
  * @param index
  */
 function verifyRepeat(code, serial, chargeUnitCode, index) {
@@ -5357,8 +5686,11 @@ function verifyRepeat(code, serial, chargeUnitCode, index) {
         tabId = "zyTab";
     } else if (index == 2) {
         //辅助检查、检验
-        tabId = "zlTab";
+        tabId = "jcjyTab";
     } else if (index == 3) {
+        //诊疗
+        tabId = "zlTab";
+    } else if (index == 4) {
         //入院
         tabId = "zyReqTab";
     }
@@ -5373,6 +5705,10 @@ function verifyRepeat(code, serial, chargeUnitCode, index) {
             if (serial == null) {
                 var temporary_items_code = $(items[i]).find("input.temporary_items_code").val();
                 var temporary_items_desc_value = $(items[i]).find("input.temporary_items_desc_value").val();
+                if(chargeUnitCode==null && code === temporary_items_code){
+                    errorMesageSimaple("项目与第" + numToChineseNum(i + 1) + "条重复");
+                    return true;
+                }
                 if (code === temporary_items_code && chargeUnitCode === temporary_items_desc_value) {
                     errorMesageSimaple("项目与第" + numToChineseNum(i + 1) + "条重复");
                     return true;
@@ -5425,12 +5761,18 @@ function initNavTabs(index) {
         cfdesc = '中草药';
     } else if (index == 2) {
         //医技
+        tabId = "jcjyTab";
+        tabContentId = "jcjyTabContent";
+        paneId = "jcjycf_" + getUID();
+        cfdesc = '辅助检查、检验';
+    } else if (index == 3) {
+        //诊疗
         tabId = "zlTab";
         tabContentId = "zlTabContent";
         paneId = "zlcf_" + getUID();
-        cfdesc = '辅助检查、检验';
-    } else if (index == 3) {
-        //医技
+        cfdesc = '诊疗';
+    } else if (index == 4) {
+        //住院
         tabId = "zyReqTab";
         tabContentId = "zyReqTabContent";
         paneId = "zyReqcf_" + getUID();
@@ -6336,45 +6678,52 @@ function getParamsForpPrescription() {
             jsonData.mzChargeDetailList[jsonData.mzChargeDetailList.length] = tempJson;
         }
     }
-    //设置诊疗与医技
-    var zlTabContents = $("#zlTabContent").find("div.form-group");
-    if (zlTabContents != null && zlTabContents.length > 0) {
+    //辅助检查、检验
+    var jcjyTabContents = $("#jcjyTabContent").find("div.form-group");
+    if (jcjyTabContents != null && jcjyTabContents.length > 0) {
         orderNo++;
-        for (var i = 0; i < zlTabContents.length; i++) {
+        for (var i = 0; i < jcjyTabContents.length; i++) {
             if (emrFzjc == null) {
-                emrFzjc = $(zlTabContents[i]).text();
+                emrFzjc = $(jcjyTabContents[i]).text();
             } else {
-                emrFzjc += "," + $(zlTabContents[i]).text();
+                emrFzjc += "," + $(jcjyTabContents[i]).text();
             }
             var tempJson = null;
             //项目类型
-            var itemsType = $(zlTabContents[i]).find("input.temporary_items_type").val();
+            var itemsType = $(jcjyTabContents[i]).find("input.temporary_items_type").val();
             //执行科室
-            var execUnit = $(zlTabContents[i]).find("input.temporary_items_execUnit").val();
-            if (itemsType == "3" || itemsType == 3) {
-                //诊疗,放入药品类型中入库,因为诊疗是与药品一样直接入明细库,但是是与医技在同一处方开立页面开立
-                tempJson = JSON.parse('{"chargeItemCode": "","serial": "","quantity": "1","drugQuan": "1","drugUnit": "","frequency": "","orderDays": "1","paySelf": "0","drugWin": "1","instructionCode":"","instructionText":"","orderNo":"","groupOrder":"","supplyCode":"","cyJssm":"","cyDj":"","cyFysm":"","tryFlag":"0","groupNo":"00","execDept":""}');
-                tempJson.chargeItemCode = $(zlTabContents[i]).find("input.temporary_items_code").val();
-                tempJson.instructionText = $(zlTabContents[i]).find("input.temporary_items_remark").val();
-                tempJson.quantity = $(zlTabContents[i]).find("input.temporary_items_itemQuantity").val();
-                tempJson.orderNo = orderNo;
-                tempJson.execDept = execUnit;
-                jsonData.mzChargeDetailList[jsonData.mzChargeDetailList.length] = tempJson;
-            } else {
-                tempJson = JSON.parse('{"orderCode":"","inspectPart":"","inspectStuff":"","jyRemark":"","orderNo":"1","execDept":""}');
-                tempJson.orderCode = $(zlTabContents[i]).find("input.temporary_items_code").val();
-                if (itemsType == "1" || itemsType == 1) {
-                    //检验
-                    tempJson.inspectStuff = $(zlTabContents[i]).find("input.temporary_items_desc_value").val();
-                } else if (itemsType == "2" || itemsType == 2) {
-                    //检查
-                    tempJson.inspectPart = $(zlTabContents[i]).find("input.temporary_items_desc_value").val();
-                }
-                tempJson.jyRemark = $(zlTabContents[i]).find("input.temporary_items_remark").val();
-                tempJson.orderNo = orderNo;
-                tempJson.execDept = execUnit;
-                jsonData.mzYjReqList[jsonData.mzYjReqList.length] = tempJson;
+            var execUnit = $(jcjyTabContents[i]).find("input.temporary_items_execUnit").val();
+            tempJson = JSON.parse('{"orderCode":"","inspectPart":"","inspectStuff":"","jyRemark":"","orderNo":"1","execDept":""}');
+            tempJson.orderCode = $(jcjyTabContents[i]).find("input.temporary_items_code").val();
+            if (itemsType == "1" || itemsType == 1) {
+                //检验
+                tempJson.inspectStuff = $(jcjyTabContents[i]).find("input.temporary_items_desc_value").val();
+            } else if (itemsType == "2" || itemsType == 2) {
+                //检查
+                tempJson.inspectPart = $(jcjyTabContents[i]).find("input.temporary_items_desc_value").val();
             }
+            tempJson.jyRemark = $(jcjyTabContents[i]).find("input.temporary_items_remark").val();
+            tempJson.orderNo = orderNo;
+            tempJson.execDept = execUnit;
+            jsonData.mzYjReqList[jsonData.mzYjReqList.length] = tempJson;
+        }
+    }
+    //诊疗
+    var zlTabContents = $("#zlTabContent").find("div.form-group");
+    if (zlTabContents != null && zlTabContents.length > 0) {
+        orderNo++;
+        for (var i = 0; i < zlTabContents.length; i++) {
+            var tempJson = null;
+            //执行科室
+            var execUnit = $(zlTabContents[i]).find("input.temporary_items_execUnit").val();
+            //诊疗,放入药品类型中入库,因为诊疗是与药品一样直接入明细库,但是是与医技在同一处方开立页面开立
+            tempJson = JSON.parse('{"chargeItemCode": "","serial": "","quantity": "1","drugQuan": "1","drugUnit": "","frequency": "","orderDays": "1","paySelf": "0","drugWin": "1","instructionCode":"","instructionText":"","orderNo":"","groupOrder":"","supplyCode":"","cyJssm":"","cyDj":"","cyFysm":"","tryFlag":"0","groupNo":"00","execDept":""}');
+            tempJson.chargeItemCode = $(zlTabContents[i]).find("input.temporary_items_code").val();
+            tempJson.instructionText = $(zlTabContents[i]).find("input.temporary_items_remark").val();
+            tempJson.quantity = $(zlTabContents[i]).find("input.temporary_items_itemQuantity").val();
+            tempJson.orderNo = orderNo;
+            tempJson.execDept = execUnit;
+            jsonData.mzChargeDetailList[jsonData.mzChargeDetailList.length] = tempJson;
         }
     }
     //入院
@@ -6935,7 +7284,7 @@ function prescriptionDetailCommon(patientId, times, clnicId, payMark, type) {
                             xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5, emrProcess.indexOf("辅助检查、检验:"));
                         } else if (emrProcess.indexOf("诊疗:") >= 0) {
                             xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5, emrProcess.indexOf("诊疗:"));
-                        }else if (emrProcess.indexOf("入院处理:") >= 0) {
+                        } else if (emrProcess.indexOf("入院处理:") >= 0) {
                             xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5, emrProcess.indexOf("入院处理:"));
                         } else {
                             xy = emrProcess.substring(emrProcess.indexOf("西药治疗:") + 5);
@@ -6962,7 +7311,7 @@ function prescriptionDetailCommon(patientId, times, clnicId, payMark, type) {
                             zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5, emrProcess.indexOf("辅助检查、检验:"));
                         } else if (emrProcess.indexOf("诊疗:") >= 0) {
                             zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5, emrProcess.indexOf("诊疗:"));
-                        }else if (emrProcess.indexOf("入院处理:") >= 0) {
+                        } else if (emrProcess.indexOf("入院处理:") >= 0) {
                             zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5, emrProcess.indexOf("入院处理:"));
                         } else {
                             zy = emrProcess.substring(emrProcess.indexOf("中药治疗:") + 5);
@@ -7006,7 +7355,7 @@ function prescriptionDetailCommon(patientId, times, clnicId, payMark, type) {
                         var zlyj = null;
                         if (emrProcess.indexOf("诊疗:") >= 0) {
                             zlyj = emrProcess.substring(emrProcess.indexOf("辅助检查、检验:") + 8, emrProcess.indexOf("诊疗:"));
-                        }else if (emrProcess.indexOf("入院处理:") >= 0) {
+                        } else if (emrProcess.indexOf("入院处理:") >= 0) {
                             zlyj = emrProcess.substring(emrProcess.indexOf("辅助检查、检验:") + 8, emrProcess.indexOf("入院处理:"));
                         } else {
                             zlyj = emrProcess.substring(emrProcess.indexOf("辅助检查、检验:") + 8);
@@ -7029,10 +7378,10 @@ function prescriptionDetailCommon(patientId, times, clnicId, payMark, type) {
                     }
                     if (emrProcess.indexOf("诊疗:") >= 0) {
                         var zl = null;
-                         if (emrProcess.indexOf("入院处理:") >= 0) {
-                             zl = emrProcess.substring(emrProcess.indexOf("诊疗:") + 3, emrProcess.indexOf("入院处理:"));
+                        if (emrProcess.indexOf("入院处理:") >= 0) {
+                            zl = emrProcess.substring(emrProcess.indexOf("诊疗:") + 3, emrProcess.indexOf("入院处理:"));
                         } else {
-                             zl = emrProcess.substring(emrProcess.indexOf("诊疗:") + 3);
+                            zl = emrProcess.substring(emrProcess.indexOf("诊疗:") + 3);
                         }
                         var zlArr = zl.split("_");
                         if (zlArr != null && zlArr.length > 0) {
@@ -8676,12 +9025,15 @@ function initExecUnit() {
                 return;
             }
             $('#execUnit').empty();   //清空resText里面的所有内容
+            $('#zlExecUnit').empty();   //清空resText里面的所有内容
             var html = '';
             $.each(data.data, function (commentIndex, comment) {
                 html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + '-' + comment.code + ')</option>';
             });
             $('#execUnit').html(html);
             $('#execUnit').selectpicker('refresh');
+            $('#zlExecUnit').html(html);
+            $('#zlExecUnit').selectpicker('refresh');
         }
     });
 }

+ 12 - 9
src/main/resources/templates/mz/clinic.html

@@ -761,7 +761,7 @@
                                                                                        style="cursor: pointer;font-size: 14px;color: #2e69eb!important;"><i
                                             class="fa fa-trash">&nbsp;&nbsp;清空</i></a>
                                         <a style="cursor: pointer;font-size: 14px;color: #2e69eb!important;margin-left: 20px;"
-                                           onclick="getJcJyItemChargeByCode(null)" id="jcJyItemChargeDetail"
+                                           onclick="getJcJyItemChargeByCode(null,null)" id="jcJyItemChargeDetail"
                                            class="hide"><i
                                                 class="fa fa-eye">&nbsp;&nbsp;查看明细</i></a>
                                     </div>
@@ -786,7 +786,7 @@
                                         <div class="form-group has-feedback" style="float: right;width: 340px;">
                                             <input type="text" class="form-control has-feedback-left" id="zlItem"
                                                    placeholder="请输入" style="padding-left: 10px;width: 99%"
-                                                   onKeyUp="loadjcJyItemList(event)"
+                                                   onKeyUp="loadZlItemList(event)"
                                                    required="required">
                                             <span class="fa fa-search form-control-feedback right"
                                                   aria-hidden="true"></span>
@@ -799,7 +799,7 @@
                                         <input type="text" class="form-control my_label_input_2" id="zlItemPrice"
                                                style="padding-left: 10px;" readonly>
                                     </div>
-                                    <div style="width: 256px;float: left;" class="hide" id="chargeUnitDiv">
+                                    <div style="width: 256px;float: left;">
                                         <label class="my_label">描述<span
                                                 class="required">*</span>:</label>
                                         <input type="text" class="form-control my_label_input_2" id="chargeUnit"
@@ -817,7 +817,7 @@
                                         </div>
                                     </div>
 
-                                    <div style="width: 130px;float: left;" class="hide"  id="itemQuantityDiv">
+                                    <div style="width: 130px;float: left;">
                                         <label class="my_label" style="width: 40px;">数量:</label>
                                         <input type="number" class="form-control my_label_input_2" id="itemQuantity"
                                                style="padding-left: 10px;" >
@@ -831,13 +831,9 @@
                                     </div>
                                 </div>
                                 <div style="width: 100%;height: 22px;line-height: 22px;">
-                                    <div style="float: left;display: inline-block;"><a onclick="clearJyJcItem()"
+                                    <div style="float: left;display: inline-block;"><a onclick="clearZlItem()"
                                                                                        style="cursor: pointer;font-size: 14px;color: #2e69eb!important;"><i
                                             class="fa fa-trash">&nbsp;&nbsp;清空</i></a>
-                                        <a style="cursor: pointer;font-size: 14px;color: #2e69eb!important;margin-left: 20px;"
-                                           onclick="getZlItemChargeByCode(null)" id="zlItemChargeDetail"
-                                           class="hide"><i
-                                                class="fa fa-eye">&nbsp;&nbsp;查看明细</i></a>
                                     </div>
 
                                     <div style="float: right;display: inline-block;">
@@ -937,6 +933,13 @@
                                  style="height: calc(100% - 75px);min-height: 285px;">
                             </div>
                             <!-- 选项卡菜单-->
+                            <ul id="jcjyTab" class="nav nav-tabs hide" role="tablist">
+                            </ul>
+                            <!-- 选项卡面板 -->
+                            <div id="jcjyTabContent" class="tab-content hide"
+                                 style="height: calc(100% - 75px);min-height: 285px;">
+                            </div>
+                            <!-- 选项卡菜单-->
                             <ul id="zlTab" class="nav nav-tabs hide" role="tablist">
                             </ul>
                             <!-- 选项卡面板 -->