소스 검색

病人清单增加科室查询条件

hurugang 3 년 전
부모
커밋
a8e50325a9

+ 4 - 4
src/main/java/cn/hnthyy/thmz/controller/mz/MzChargeDetailController.java

@@ -821,7 +821,7 @@ public class MzChargeDetailController {
                 chargeFeeParamsVo.setSerialNo("%" + chargeFeeParamsVo.getSerialNo() + "%");
             }
             resultMap.put("code", 0);
-            resultMap.put("mzChargeDetailList", mzChargeDetailService.queryChargeListByPatient(chargeFeeParamsVo.getPatientId(), chargeFeeParamsVo.getName(), chargeFeeParamsVo.getSerialNo(), chargeFeeParamsVo.getBeginDate(), chargeFeeParamsVo.getEndDate()));
+            resultMap.put("mzChargeDetailList", mzChargeDetailService.queryChargeListByPatient(chargeFeeParamsVo.getPatientId(), chargeFeeParamsVo.getName(), chargeFeeParamsVo.getSerialNo(), chargeFeeParamsVo.getBeginDate(), chargeFeeParamsVo.getEndDate(),chargeFeeParamsVo.getWarnDept()));
             resultMap.put("message", "查询病人缴费记录成功");
             return resultMap;
         } catch (Exception e) {
@@ -922,7 +922,7 @@ public class MzChargeDetailController {
                 resultMap.put("message", "病人id不能为空");
                 return resultMap;
             }
-            List<Map<String, Object>> mzChargeDetailList = mzChargeDetailService.queryChargeListByPatient("%" + chargeFeeParamsVo.getPatientId() + "%", null, null, chargeFeeParamsVo.getBeginDate(), chargeFeeParamsVo.getEndDate());
+            List<Map<String, Object>> mzChargeDetailList = mzChargeDetailService.queryChargeListByPatient("%" + chargeFeeParamsVo.getPatientId() + "%", null, null, chargeFeeParamsVo.getBeginDate(), chargeFeeParamsVo.getEndDate(),chargeFeeParamsVo.getWarnDept());
             List<Map<String, Object>> data = new ArrayList<>();
             if (mzChargeDetailList != null) {
                 StringBuilder sbf = new StringBuilder();
@@ -967,8 +967,8 @@ public class MzChargeDetailController {
         } catch (Exception e) {
             e.printStackTrace();
             resultMap.put("code", -1);
-            resultMap.put("message", "查询病人缴费记录失败,系统出错,请联系管理员");
-            log.error("查询病人缴费记录失败,系统异常,错误信息{}", e);
+            resultMap.put("message", "查询病人的所有缴费明细失败,系统出错,请联系管理员");
+            log.error("查询病人的所有缴费明细失败,系统异常,错误信息{}", e);
             return resultMap;
         }
     }

+ 16 - 13
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzChargeDetailMapper.java

@@ -624,20 +624,24 @@ public interface MzChargeDetailMapper {
      * @param serialNo
      * @param beginDate
      * @param endDate
+     * @param warnDept  申请科室
      * @return
      */
     @Select({"<script>",
-            "SELECT distinct rtrim(a.patient_id) patient_id,name,a.times,a.receipt_no,charge_date=convert(char(10),a.charge_date,111) ,a.serial_no,real_no ,a.responce_type," +
-                    " cheque_type=case when mz_receipt_serial.cheque_type='Y' and cash_id <![CDATA[<>]]> '99999' " +
-                    " and (len(ltrim(rtrim(mz_receipt_serial.receipt_bill))) >= 10 or len(ltrim(rtrim(mz_receipt_serial.receipt_bill)))=0) then '本院记账' else '自费' end, " +
-                    " serial_no_order=ABS(a.serial_no)  " +
-                    "    FROM mz_charge_detail a WITH(NOLOCK),mz_receipt_serial WITH(NOLOCK) " +
-                    " WHERE " +
-                    " a.patient_id=mz_receipt_serial.patient_id " +
-                    " and a.times = mz_receipt_serial.times " +
-                    " and a.receipt_no = mz_receipt_serial.receipt_no " +
-                    "    and a.charge_date <![CDATA[>=]]> #{beginDate,jdbcType=TIMESTAMP} and a.charge_date <![CDATA[<=]]> #{endDate,jdbcType=TIMESTAMP}  and a.pay_mark <![CDATA[<>]]> 9 " +
-                    "<when test='patientId!=null'>",
+            "SELECT distinct rtrim(a.patient_id) patient_id,name,a.times,a.receipt_no,charge_date=convert(char(10),a.charge_date,111) ,a.serial_no,real_no ,a.responce_type,",
+            " cheque_type=case when mz_receipt_serial.cheque_type='Y' and cash_id <![CDATA[<>]]> '99999' ",
+            " and (len(ltrim(rtrim(mz_receipt_serial.receipt_bill))) >= 10 or len(ltrim(rtrim(mz_receipt_serial.receipt_bill)))=0) then '本院记账' else '自费' end, ",
+            " serial_no_order=ABS(a.serial_no)  ",
+            "    FROM mz_charge_detail a WITH(NOLOCK),mz_receipt_serial WITH(NOLOCK) ",
+            " WHERE ",
+            " a.patient_id=mz_receipt_serial.patient_id ",
+            " and a.times = mz_receipt_serial.times ",
+            " and a.receipt_no = mz_receipt_serial.receipt_no ",
+            "    and a.charge_date <![CDATA[>=]]> #{beginDate,jdbcType=TIMESTAMP} and a.charge_date <![CDATA[<=]]> #{endDate,jdbcType=TIMESTAMP}  and a.pay_mark <![CDATA[<>]]> 9 ",
+            "<when test='warnDept!=null'>",
+            " and a.warn_dept = #{warnDept}",
+            "</when>",
+            "<when test='patientId!=null'>",
             " and a.patient_id like #{patientId}",
             "</when>",
             "<when test='name!=null'>",
@@ -648,7 +652,7 @@ public interface MzChargeDetailMapper {
             "</when>",
             " and  real_no=receipt_sn and a.name is not null and a.responce_type is not null order by serial_no_order desc" +
                     "</script>"})
-    List<Map<String, Object>> selectChargeListByPatient(@Param("patientId") String patientId, @Param("name") String name, @Param("serialNo") String serialNo, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate);
+    List<Map<String, Object>> selectChargeListByPatient(@Param("patientId") String patientId, @Param("name") String name, @Param("serialNo") String serialNo, @Param("beginDate") Date beginDate, @Param("endDate") Date endDate, @Param("warnDept") String warnDept);
 
     /**
      * 查询某个病人最近一段时间购买某一药品的总数量
@@ -1122,5 +1126,4 @@ public interface MzChargeDetailMapper {
     Integer selectCountMzChargeDetailByPatientIdAndChargeItemCode(@Param("patientId") String patientId, @Param("chargeItemCode") String chargeItemCode);
 
 
-
 }

+ 3 - 1
src/main/java/cn/hnthyy/thmz/service/his/mz/MzChargeDetailService.java

@@ -217,9 +217,10 @@ public interface MzChargeDetailService {
      * @param serialNo
      * @param beginDate
      * @param endDate
+     * @param warnDept  申请科室
      * @return
      */
-    List<Map<String, Object>> queryChargeListByPatient(String patientId, String name, String serialNo, Date beginDate, Date endDate);
+    List<Map<String, Object>> queryChargeListByPatient(String patientId, String name, String serialNo, Date beginDate, Date endDate, String warnDept);
 
 
     /**
@@ -481,6 +482,7 @@ public interface MzChargeDetailService {
 
     /**
      * 设置药品集合里的麻精药物的药房编号,零时的,不会入库,因为没有这样的药房
+     *
      * @param mzChargeDetailList
      */
     void setMjGroupForTempDetail(List<MzChargeDetail> mzChargeDetailList);

+ 2 - 2
src/main/java/cn/hnthyy/thmz/service/impl/his/mz/MzChargeDetailServiceImpl.java

@@ -898,8 +898,8 @@ public class MzChargeDetailServiceImpl implements MzChargeDetailService {
     }
 
     @Override
-    public List<Map<String, Object>> queryChargeListByPatient(String patientId, String name, String serialNo, Date beginDate, Date endDate) {
-        List<Map<String, Object>> chargeListByPatient = mzChargeDetailMapper.selectChargeListByPatient(patientId, name, serialNo, beginDate, endDate);
+    public List<Map<String, Object>> queryChargeListByPatient(String patientId, String name, String serialNo, Date beginDate, Date endDate, String warnDept) {
+        List<Map<String, Object>> chargeListByPatient = mzChargeDetailMapper.selectChargeListByPatient(patientId, name, serialNo, beginDate, endDate, warnDept);
 //        if (YesNoEnum.YES.equals(hisDate)) {
 //            chargeListByPatient = mzChargeDetailMapper.selectHisChargeListByPatient(patientId, name, serialNo, beginDate, endDate);
 //        } else {

+ 38 - 6
src/main/resources/static/js/mz/charge_list.js

@@ -6,6 +6,7 @@ var canPrint = false;
 $(function () {
     init_daterangepicker();
     initChargeListByPatient();
+    initDeptSelect();
     //  initFeeTable();
     //重置查询参数
     $('#btn_clean').click(function () {
@@ -30,6 +31,33 @@ $(function () {
 });
 
 
+/**
+ * 挂号列表中的科室列表
+ */
+function initDeptSelect() {
+    //科室列表
+    $.ajax({
+        type: "GET",
+        url: '/thmz/allMzUnitCode',
+        dataType: "json",
+        headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+        success: function (data) {
+            if (data == '401' || data == 401) {
+                window.location.href = '/thmz/login/view'
+                return;
+            }
+            var html = '';
+            $.each(data.data, function (commentIndex, comment) {
+                html += '<option value="' + comment.code + '">' + comment.name + '(' + comment.pyCode + ')</option>';
+            });
+            $('#deptNoParam').empty();
+            $('#deptNoParam').html(html);
+            $('#deptNoParam').selectpicker('refresh');
+        }
+    });
+}
+
+
 /**
  * 查询病人缴费记录
  */
@@ -186,7 +214,8 @@ function queryParams(params) {
         //hisData: $('#hisData').is(':checked') ? 0 : 1,
         name: $("#name").val(),
         patientId: $("#patientId").val(),
-        serialNo: $("#serialNo").val()
+        serialNo: $("#serialNo").val(),
+        warnDept: $("#deptNoParam").val()
     };
     return temp;
 };
@@ -268,10 +297,12 @@ function setPrint() {
 function cleanParams() {
     $('#reportrange span').html(moment().format('YYYY-MM-DD') + ' - ' + moment().format('YYYY-MM-DD'));
     //$("#hisData").removeAttr("checked");
-    $("#name").val(null),
-        $("#patientId").val(null),
-        $("#serialNo").val(null),
-        $("#patientId_or_cardNo").val(null)
+    $("#name").val(null);
+    $("#patientId").val(null);
+    $("#serialNo").val(null);
+    $("#patientId_or_cardNo").val(null);
+    $("#deptNoParam").selectpicker('val', null);//默认选中
+    $("#deptNoParam").selectpicker('refresh');
 }
 
 /**
@@ -325,7 +356,8 @@ function fitAllfymx() {
         data: JSON.stringify({
             patientId: $("#patientId").val(),
             beginDate: rePortRangeArr[0],
-            endDate: rePortRangeArr[1]
+            endDate: rePortRangeArr[1],
+            warnDept: $("#deptNoParam").val()
             // ,hisData: $('#hisData').is(':checked') ? 0 : 1
         }),
         success: function (res) {

+ 4 - 4
src/main/resources/static/js/mz/clinic.js

@@ -3805,7 +3805,7 @@ function editZlItem(obj) {
 function saveJyJcItem(calculateTotalAmountFlag) {
     //6岁内提示加价
     var patientAge = $("#patientAge").text();
-    if (patientAge != null && patientAge != "" && patientAge < 6) {
+    if (calculateTotalAmountFlag && patientAge != null && patientAge != "" && patientAge < 6) {
         $.ajax({
             type: "GET",
             url: '/thmz/checkAdditionally?code=' + $("#jcjy_current_code").val() + "&jcJyZltype=" + $("#jcJyZltype").val(),
@@ -3826,7 +3826,7 @@ function saveJyJcItem(calculateTotalAmountFlag) {
                         $("#messageContent").html("根据【湘医保发〔2020〕51 号】价格通知,6岁以内的小朋友诊疗费上调" + xlCode + "%,是否需要继续添加该项目?");
                         $("#messageButton").off("click").on("click", function (t) {
                             $("#messageModal").modal("hide");
-                            saveJyJcItemReal(true);
+                            saveJyJcItemReal(calculateTotalAmountFlag);
                         });
                         $("#cancelButton").off("click");
                     } else {
@@ -3986,7 +3986,7 @@ function saveJyJcItemReal(calculateTotalAmountFlag) {
 function saveZlItem(calculateTotalAmountFlag) {
     //6岁内提示加价
     var patientAge = $("#patientAge").text();
-    if (patientAge != null && patientAge != "" && patientAge < 6) {
+    if (calculateTotalAmountFlag && patientAge != null && patientAge != "" && patientAge < 6) {
         $.ajax({
             type: "GET",
             url: '/thmz/checkAdditionally?code=' + $("#zl_current_code").val() + "&jcJyZltype=3",
@@ -4007,7 +4007,7 @@ function saveZlItem(calculateTotalAmountFlag) {
                         $("#messageContent").html("根据【湘医保发〔2020〕51 号】价格通知,6岁以内的小朋友诊疗费上调" + xlCode + "%,是否需要继续添加该项目?");
                         $("#messageButton").off("click").on("click", function (t) {
                             $("#messageModal").modal("hide");
-                            saveZlItemReal(true);
+                            saveZlItemReal(calculateTotalAmountFlag);
                         });
                         $("#cancelButton").off("click");
                     } else {

+ 10 - 8
src/main/resources/templates/mz/charge_list.html

@@ -25,14 +25,14 @@
             <div class="panel-body">
                 <form id="formSearch" class="form-horizontal" autocomplete="off">
                     <div class="form-group col-md-12 col-sm-12 col-xs-12">
-                        <div class="col-md-3 col-sm-3 col-xs-12"></div>
+                        <div class="col-md-2 col-sm-2 col-xs-12"></div>
                         <label class="control-label col-md-1 col-sm-1 col-xs-12" for="name">姓名
                         </label>
                         <div class="col-md-2 col-sm-2 col-xs-12">
                             <input id="name" class="form-control col-md-7 col-xs-12" type="text"
                                    placeholder="姓名">
                         </div>
-                        <label class="control-label col-md-2 col-sm-2 col-xs-12" for="patientId_or_cardNo">病人ID/就诊卡号
+                        <label class="control-label col-md-1 col-sm-1 col-xs-12" for="patientId_or_cardNo">病人ID/卡号
                         </label>
                         <div class="col-md-2 col-sm-2 col-xs-12">
                             <input id="patientId_or_cardNo" class="form-control col-md-7 col-xs-12" type="text"
@@ -40,14 +40,16 @@
                                    placeholder="病人ID/就诊卡号">
                             <input id="patientId" type="hidden">
                         </div>
-                        <!--<div class="col-md-2 col-sm-2 col-xs-12" style="padding-left: 50px;">-->
-                            <!--<label>-->
-                                <!--历史数据 <input id="hisData" type="checkbox"/>-->
-                            <!--</label>-->
-                        <!--</div>-->
+                        <label class="control-label col-md-1 col-sm-1 col-xs-12" for="deptNoParam">申请科室
+                        </label>
+                        <div class="col-md-2 col-sm-2 col-xs-12">
+                            <select class="form-control selectpicker show-tick" data-live-search="true" title="请选择"
+                                    id="deptNoParam" >
+                            </select>
+                        </div>
                     </div>
                     <div class="form-group col-md-12 col-sm-12 col-xs-12">
-                        <div class="col-md-3 col-sm-3 col-xs-12"></div>
+                        <div class="col-md-2 col-sm-2 col-xs-12"></div>
                         <label class="control-label col-md-1 col-sm-1 col-xs-12" for="serialNo">机制号
                         </label>
                         <div class="col-md-1 col-sm-1 col-xs-12">