Explorar el Código

Merge branch 'dev-1.1.0' of https://172.16.32.165/hurugang/thmz_system into dev-1.1.0

hurugang hace 4 años
padre
commit
3fcacd5b7a

+ 5 - 3
src/main/java/cn/hnthyy/thmz/mapper/his/mz/MzPharmacyMapper.java

@@ -80,7 +80,8 @@ public interface MzPharmacyMapper {
                     "rtrim(doctor_id) doctor_id," ,
                     "rtrim(doctor_name) doctor_name," ,
                     "real_no," ,
-                    "warn_dept " ,
+                    "warn_dept, " ,
+                    "confirm_flag " ,
                     "from yp_mz_fytj where serial_no <![CDATA[<]]> 0 ",
             "<when test='name!=null'>",
             " and name like #{name}",
@@ -105,7 +106,7 @@ public interface MzPharmacyMapper {
             "</when>",
             "<when test='endDate!=null'>",
             " and charge_date <![CDATA[<=]]> #{endDate}",
-            "</when> group by patient_id,times,receipt_no,order_no,name,charge_date,group_no,confirm_time,doctor_id,doctor_name,real_no,warn_dept",
+            "</when> group by patient_id,times,receipt_no,order_no,name,charge_date,group_no,confirm_time,doctor_id,doctor_name,real_no,warn_dept,confirm_flag",
             ") as A WHERE RowNumber >#{pageSize}*#{pageIndex} order by RowNumber ASC",
             "</script>"})
     List<YpMzFytjVo> selectYpMzRefundFytjPage(ChargeFeeParamsVo chargeFeeParamsVo);
@@ -163,6 +164,7 @@ public interface MzPharmacyMapper {
                     "         yp_mz_fytj.group_no ," ,
                     "         charge_date," ,
                     "         confirm_time," ,
+                    "         confirm_flag," ,
                     "doctor_id," ,
                     "doctor_name," ,
                     "warn_dept from yp_mz_fytj where serial_no <![CDATA[<]]> 0 ",
@@ -186,7 +188,7 @@ public interface MzPharmacyMapper {
             "</when>",
             "<when test='endDate!=null'>",
             " and confirm_time <![CDATA[<=]]> #{endDate}",
-            "</when> group by name,real_no,order_no,patient_id,times,receipt_no ,group_no ,charge_date,confirm_time,doctor_id,doctor_name,warn_dept",
+            "</when> group by name,real_no,order_no,patient_id,times,receipt_no ,group_no ,charge_date,confirm_time,doctor_id,doctor_name,warn_dept,confirm_flag",
             ") as A WHERE RowNumber >#{pageSize}*#{pageIndex} order by RowNumber ASC",
             "</script>"})
     List<YpMzFytjVo> selectYpMzRefundSucceedFytjPage(ChargeFeeParamsVo chargeFeeParamsVo);

+ 6 - 12
src/main/java/cn/hnthyy/thmz/service/impl/thmz/DispensingSocketServiceImpl.java

@@ -10,10 +10,8 @@ import cn.hnthyy.thmz.socket.PrescriptionPrintSocket;
 import org.springframework.beans.factory.annotation.Autowired;
 import org.springframework.stereotype.Service;
 
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import java.util.*;
+import java.util.stream.Collectors;
 
 @Service
 public class DispensingSocketServiceImpl implements DispensingSocketService {
@@ -55,20 +53,16 @@ public class DispensingSocketServiceImpl implements DispensingSocketService {
         MzChargeDetail mzChargeDetail = new MzChargeDetail();
         mzChargeDetail.setPatientId(patientId);
         mzChargeDetail.setTimes(times);
+        mzChargeDetail.setGroupNo("71");
         List<MzChargeDetail> chargeDetail = mzChargeDetailService.getMzChargeDetailList(mzChargeDetail);
-        boolean flag = false;
-        for (MzChargeDetail detail : chargeDetail) {
-            if(detail.getGroupNo().equals("71")){
-                flag = true;
-                break;
-            }
-        }
-        if(flag){
+        if(chargeDetail.size() > 0){
+            Set<Integer> orderNos = chargeDetail.stream().map(MzChargeDetail::getOrderNo).collect(Collectors.toSet());
             Map<String,Object> msgMap = new HashMap();
             msgMap.put("patient_id",patientId);
             MzPatientMi mzPatientMi = mzPatientMiService.queryByPatientId(patientId);
             msgMap.put("name",mzPatientMi.getName());
             msgMap.put("times",times);
+            msgMap.put("orderNos",orderNos);
             msgMap.put("type",SocketSenderTypeEnum.PAY.code);
             List<String> objTypes = new ArrayList<>();
             objTypes.add(SocketSenderTypeEnum.CALL_NUMBER.code);

+ 3 - 1
src/main/resources/static/js/common/socket-com.js

@@ -71,7 +71,9 @@ function dispensingMessage(data) {
             initTable();
         }
         if ($("#aotuPrint").is(':checked')) {//自动打印
-            printPrescription(data.patient_id, data.times);
+            for (let i = 0; i < data.orderNos.length; i++) {
+                printPrescription(data.patient_id, data.times,data.orderNos[i]);
+            }
         }
     }
 }

+ 181 - 3
src/main/resources/static/js/mz/west_pharmacy_dispensing.js

@@ -126,8 +126,9 @@ function initTable() {
                 align: "center",
                 valign: 'middle',
                 formatter: function (value, row, index) {
-                    var str = '<button type="button" class="registration-no-color-foot-button" title="打印" onclick="printPrescription(\'' + row.patientId + '\',\'' + row.times + '\')"  style="color: #35D082;"><i class="fa fa-print"></i></button>';
+                    var str = '<button type="button" class="registration-no-color-foot-button" title="打印" onclick="printPrescription(\'' + row.patientId + '\',\'' + row.times+ '\',\'' + row.orderNo + '\')"  style="color: #35D082;"><i class="fa fa-print"></i></button>';
                     str += '<button type="button" class="registration-no-color-foot-button" title="配药完成" onclick="dispensingDispose(\'' + row.patientId + '\',\'' + row.orderNo + '\',\'' + row.name + '\',\'' + row.realNo + '\',\'' + row.chargeDate + '\')"><i class="fa fa-check-square-o"></i></button>';
+                    str += '<button type="button" class="registration-no-color-foot-button" title="详细" onclick="prescriptionDetail(\'' + row.realNo + '\',\'' + 71 + '\',\'' + row.orderNo + '\',\'' + row.receiptNo + '\',\'' + row.times + '\',\'' + row.patientId + '\')"><i class="fa fa-plus"></i></button>';
                     return str;
                 }
             }
@@ -158,9 +159,185 @@ function initTable() {
                 "rows": ress.data   //数据
             };
         },
+
+        onDblClickRow: function (row) {
+            printPrescription(row.patientId,row.times,row.orderNo);
+        }
     });
 }
 
+/**
+ * 查询病人处方明细
+ */
+function prescriptionDetail(realNo, groupNo, orderNo, receiptNo, times, patientId) {
+    var temp = {
+        groupNo: groupNo,
+        realNo: realNo,
+        orderNo: orderNo,
+        receiptNo: receiptNo,
+        times: times,
+        patientId: patientId
+    };
+    $('#tb_table_detail').bootstrapTable("destroy");
+    $('#tb_table_detail').bootstrapTable({
+        url: '/thmz/getFyclPrescriptionDetail',         //请求后台的URL(*)
+        method: 'POST',                      //请求方式(*)
+        striped: true,                      //是否显示行间隔色
+        cache: false,                       //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
+        pagination: true,                   //是否显示分页(*)
+        sortable: true,                     //是否启用排序
+        sortOrder: "asc",                   //排序方式
+        queryParams: JSON.stringify(temp),           //传递参数(*)
+        sidePagination: "client",           //分页方式:client客户端分页,server服务端分页(*)
+        pageNumber: 1,                       //初始化加载第一页,默认第一页
+        pageSize: 10,                       //每页的记录行数(*)
+        pageList: [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: 'location',
+                title: '货位号',
+                align: "center",
+                valign: 'middle'
+            }, {
+                field: 'drugname',
+                title: '品名',
+                align: "center",
+                valign: 'middle',
+            }, {
+                field: 'specification',
+                title: '规格',
+                align: "center",
+                valign: 'middle',
+            }, {
+                field: 'quantity',
+                title: '<span style="color: green">数量</span>',
+                align: "center",
+                valign: 'middle',
+                formatter: function (value, row, index) {
+                    return '<span style="color: green">' + value + '</span>'
+                }
+            }, {
+                field: 'ypUnitName',
+                title: '单位',
+                align: "center",
+                valign: 'middle',
+            }, {
+                field: 'abbrName',
+                title: '生产厂家',
+                align: "center",
+                valign: 'middle',
+            }, {
+                field: 'drugQuan',
+                title: '一次剂量',
+                align: "center",
+                valign: 'middle',
+            }, {
+                field: 'drugUnitName',
+                title: '单位',
+                align: "center",
+                valign: 'middle',
+            }, {
+                field: 'frequency',
+                title: '频率',
+                align: "center",
+                valign: 'middle',
+            }, {
+                field: 'decAmount',
+                title: '<span style="color: red">退药量</span>',
+                align: "center",
+                valign: 'middle',
+                formatter: function (value, row, index) {
+                    return value == null ? '<span style="color: red">-</span>' : '<span style="color: red">' + value + '</span>'
+                }
+            }, {
+                field: 'printName',
+                title: '给药方式',
+                align: "center",
+                valign: 'middle',
+            }, {
+                field: 'unitPrice',
+                title: '单价',
+                align: "center",
+                valign: 'middle',
+            }
+            /* , {
+                 field: 'drug_flag',//毒麻标志:1:毒;2:麻;3:精神1;4:精神2
+                 title: '<span style="color: red">毒麻</span>',
+                 align: "center",
+                 valign: 'middle',
+                 formatter: function (value, row, index) {
+                     if(value == 1){
+                         return '<span style="color: red">毒</span>'
+                     }else if(value == 2){
+                         return '<span style="color: red">麻</span>'
+                     }else if(value == 3){
+                         return '<span style="color: red">精神1</span>'
+                     }else if(value == 3){
+                         return '<span style="color: red">精神2</span>'
+                     }else{
+                         return '<span style="color: red">-</span>'
+                     }
+                 }
+             }*/
+            , {
+                field: 'stockAmount',
+                title: '当前库存',
+                align: "center",
+                valign: 'middle',
+            }
+        ],
+        responseHandler: function (res) {
+            if (res == '401' || res == 401) {
+                window.location.href = '/thmz/login/view'
+                return;
+            }
+            var ress = eval(res);
+            if (ress.data.length > 0) {
+                $("#employeeNameLabel").val(ress.data[0].employeeName);
+                $("#warnDeptNameLabel").val(ress.data[0].warnDeptName);
+                $("#chargeDateLabel").val(format(ress.data[0].chargeDate, "yyyy-MM-dd HH:mm:ss"));
+                $("#icdTextLabel").val(ress.data[0].icdText);
+            }
+            if (ress.code == -1) {
+                if (ress.message != null && ress.message != '') {
+                    new PNotify({
+                        title: '错误提示',
+                        text: ress.message,
+                        type: 'error',
+                        hide: true,
+                        styling: 'bootstrap3'
+                    });
+                }
+                return {
+                    "total": 0,//总页数
+                    "rows": {}   //数据
+                };
+            }
+            return {
+                "total": ress.data.length,//总页数
+                "rows": ress.data   //数据
+            };
+        },
+    });
+    $("#cfxxModal").modal();
+}
 
 /**
  * 构建列表查询参数
@@ -225,10 +402,11 @@ function dispensingDispose(patientId, orderNo, name, realNo, chargeDate) {
 /**
  * 打印处方
  */
-function printPrescription(patientId, times) {
+function printPrescription(patientId, times, orderNo) {
     var tem = {
         patientId: patientId,
         times: times,
+        orderNo: orderNo,
         groupNo: 71
     };
     $.ajax({
@@ -244,7 +422,6 @@ function printPrescription(patientId, times) {
                 return;
             }
             if (res.code == 0) {
-                successMesage(res);
                 setPrint();//初始化默认打印机
                 $('#print_view input').attr("value", "");
                 if (null != res.data) {
@@ -320,6 +497,7 @@ function printPrescription(patientId, times) {
                 // LODOP.NewPage();//下一页
                 LODOP.PRINT();
                 //LODOP.PREVIEW();
+                successMesage(res);
             } else {
                 errorMesage(res);
             }

+ 32 - 6
src/main/resources/static/js/mz/west_pharmacy_send.js

@@ -99,6 +99,7 @@ function sendRefundButtonChange(object, realIndex) {
         $("#confirmFlagSearch").append("<option value='1'>已发药</option>");
         $("#confirmFlagSearch").selectpicker('refresh');
         $("#tb_table_right_ty").css("display", "none");
+        $("#return_total_amount").css("display", "none");
         $("#btn_ty").addClass("hidden");
     } else {
         $("#confirmFlagSearch").empty();
@@ -206,6 +207,7 @@ function initTbTable() {
                 visible: visible,
                 formatter: function (value, row, index) {
                     if (index == 0 && sendRefundGroup == 1) {
+                        $("#return_total_amount").css("display", "");
                         fitfymx(row.patientId, row.times, row.receiptNo, row.orderNo, row.groupNo);
                         return {
                             checked: true//设置选中
@@ -303,6 +305,11 @@ function initTbTable() {
                 fitfymx(row.patientId, row.times, row.receiptNo, row.orderNo, row.groupNo);
             }
         },
+        onDblClickRow: function (row) {
+            if (sendRefundGroup == 0) {
+                printInjectionOralMedicine(row.patientId, row.orderNo, row.realNo, row.times, row.receiptNo);
+            }
+        },
         responseHandler: function (res) {
             if (res == '401' || res == 401) {
                 window.location.href = '/thmz/login/view'
@@ -360,9 +367,9 @@ function printInjectionOralMedicine(patientId, orderNo, realNo, times, receiptNo
                 var injections = new Array();//注射液
                 var drugs = new Array();//普通药品
                 for (let i = 0; i < res.data.length; i++) {
-                    if (res.data[i].classCode == 2 || res.data[i].classCode == 7) {
+                    if (res.data[i].classCode == 2 || res.data[i].classCode == 7) {//给药方式 2:输液、雾化吸入、副药等等 7:注射、皮试、副药等等
                         injections[injections.length] = res.data[i];
-                    } else if (res.data[i].classCode != 6 && res.data[i].classCode != 9) {
+                    } else if (res.data[i].classCode != 6) {//给药方式 6:领药 9:外用、局麻、喷用等等
                         drugs[drugs.length] = res.data[i];
                     }
                 }
@@ -467,7 +474,7 @@ function printInjectionOralMedicine(patientId, orderNo, realNo, times, receiptNo
                     LODOP.SET_SHOW_MODE("BKIMG_WIDTH", "210mm");
                     LODOP.SET_SHOW_MODE("BKIMG_HEIGHT", "148mm");
                     LODOP.SET_PRINT_MODE("CREATE_CUSTOM_PAGE_NAME", "泰和医院门、急诊注射单");//对新建的纸张重命名
-                    LODOP.ADD_PRINT_HTM("5mm", "2mm", "210mm", "148mm", $("div[id='print_view_zsd']").html());
+                    LODOP.ADD_PRINT_HTM("5mm", "5mm", "210mm", "148mm", $("div[id='print_view_zsd']").html());
                     LODOP.PRINT();
                     //LODOP.PREVIEW();
                 }
@@ -499,6 +506,7 @@ function printInjectionOralMedicine(patientId, orderNo, realNo, times, receiptNo
                     LODOP.PRINT();
                     //LODOP.PREVIEW();
                 }
+                successMesage(res);
             } else {
                 errorMesage(res);
             }
@@ -742,6 +750,13 @@ function prescriptionDetail(realNo, groupNo, orderNo, receiptNo, times, patientI
                 "rows": ress.data   //数据
             };
         },
+        onLoadSuccess: function (res) {  //加载成功时执行
+            var sendTotalAmount = 0;
+            for (var i=0;i<res.rows.length;i++) {
+                sendTotalAmount +=parseFloat(res.rows[i].quantity*res.rows[i].unitPrice);
+            }
+            $('#sendTotalAmount').html(sendTotalAmount.toFixed(2));//toFixed(2),保留2位小数,避免js中小数相加小数点后面多出很多位
+        },
     });
     $("#cfxxModal").modal();
 }
@@ -853,6 +868,13 @@ function fitfymx(patientId, times, receiptNo, orderNo, groupNoOut) {
                 "rows": ress.data   //数据
             };
         },
+        onLoadSuccess: function (res) {  //加载成功时执行
+            var returnTotalAmount = 0;
+            for (var i=0;i<res.rows.length;i++) {
+                returnTotalAmount +=parseFloat(res.rows[i].quantity*res.rows[i].unit_price);
+            }
+            $('#returnTotalAmount').html(returnTotalAmount.toFixed(2));//toFixed(2),保留2位小数,避免js中小数相加小数点后面多出很多位
+        },
     });
 }
 
@@ -861,8 +883,12 @@ function fitfymx(patientId, times, receiptNo, orderNo, groupNoOut) {
  * 退药处理
  */
 function saveRefundMedicine() {
-    if ($table) {
-        return errorMesageSimaple('退药处方可退药药品为空');
+    var row = $("#tb_table").bootstrapTable('getSelections');
+    if(row.length < 1){
+        return errorMesageSimaple('请先选择一条处方数据');
+    }
+    if(row[0].confirmFlag == 3){
+        return errorMesageSimaple('请重复退药');
     }
     var data = $table.bootstrapTable('getData');
     var datas = [];
@@ -923,7 +949,7 @@ function saveRefundMedicine() {
 function callNumber(patientId) {
     $.ajax({
         type: "GET",
-        url: '/thmz/callNumber?patientId='+patientId,
+        url: '/thmz/callNumber?patientId=' + patientId,
         contentType: "application/json;charset=UTF-8",
         dataType: "json",
         headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},

+ 58 - 1
src/main/resources/templates/mz/west_pharmacy_dispensing.html

@@ -36,7 +36,7 @@
                                    for="dispensingStatusSearch">发药状态</label>
                             <div class="col-md-8 col-sm-8 col-xs-12">
                                 <select class="form-control selectpicker show-tick" required="required" title="请选择"
-                                        id="dispensingStatusSearch">
+                                        id="dispensingStatusSearch" onchange="initTable()">
                                     <option value="0" selected>未发药</option>
                                     <option value="1">已发药</option>
                                 </select>
@@ -175,6 +175,63 @@
         </div>
     </div>
 </div>
+
+<!--处方详细弹窗开始-->
+<div class="modal fade bs-example-modal-sm in" tabindex="-1" role="dialog" aria-hidden="true" id="cfxxModal">
+    <div class="modal-dialog modal-sm">
+        <div class="modal-content" style="width: 980px;margin-left: -300px;">
+            <div class="modal-header">
+                <button type="button" class="close" data-dismiss="modal"><span aria-hidden="true">×</span>
+                </button>
+                <h4 class="modal-title modal-title-thmz">处方详细</h4>
+            </div>
+            <div class="modal-body">
+                <div class="row">
+                    <div class="col-md-12 col-sm-12 col-xs-12">
+                        <form id="fyform" class="form-horizontal" autocomplete="off">
+                            <div class="form-group" style="padding-top: 10px;">
+                                <label class="control-label col-md-1 col-sm-1 col-xs-12" for="employeeNameLabel">医生:
+                                </label>
+                                <div class="col-md-2 col-sm-2 col-xs-12">
+                                    <input id="employeeNameLabel" class="form-control optional" type="text"
+                                           style="border-style: none;box-shadow: 0px 0px 0px 0px;">
+                                </div>
+
+                                <label class="control-label col-md-1 col-sm-1 col-xs-12" for="warnDeptNameLabel">科室:
+                                </label>
+                                <div class="col-md-2 col-sm-2 col-xs-12">
+                                    <input id="warnDeptNameLabel" class="form-control optional" type="text"
+                                           style="border-style: none;box-shadow: 0px 0px 0px 0px;">
+                                </div>
+                                <label class="control-label col-md-2 col-sm-2 col-xs-12" for="chargeDateLabel">收费时间:
+                                </label>
+                                <div class="col-md-3 col-sm-3 col-xs-12">
+                                    <input id="chargeDateLabel" class="form-control optional" type="text"
+                                           style="border-style: none;box-shadow: 0px 0px 0px 0px;">
+                                </div>
+                            </div>
+                            <div class="form-group">
+                                <label class="control-label col-md-1 col-sm-1 col-xs-12" for="icdTextLabel">诊断:
+                                </label>
+                                <div class="col-md-11 col-sm-11 col-xs-12">
+                                    <input id="icdTextLabel" class="form-control optional" type="text"
+                                           style="border-style: none;box-shadow: 0px 0px 0px 0px;">
+                                </div>
+                            </div>
+                        </form>
+                        <table id="tb_table_detail"
+                               style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;"></table>
+                    </div>
+                </div>
+            </div>
+            <div class="modal-footer">
+                <button type="button" class="btn btn-default" data-dismiss="modal">取消</button>
+            </div>
+        </div>
+    </div>
+</div>
+<!--处方详细弹窗结尾-->
+
 <object id="LODOP_OB" classid="clsid:2105C259-1E0C-4534-8141-A753534CB4CA" width=0 height=0>
     <embed id="LODOP_EM" type="application/x-print-lodop" width=0 height=0></embed>
 </object>

+ 10 - 0
src/main/resources/templates/mz/west_pharmacy_send.html

@@ -244,6 +244,11 @@
                     <table id="tb_table_right_ty"></table>
                 </div>
             </div>
+            <div class="col-md-5 col-sm-5 col-xs-12" id="return_total_amount" style="display: none;margin-top: 10px;">
+                <div class="col-md-12 col-sm-12 col-xs-12" style="display: block;text-align: right;">
+                    处方总金额:<span id="returnTotalAmount" style="color: red;">0.00</span>
+                </div>
+            </div>
         </div>
     </div>
 </div>
@@ -292,6 +297,11 @@
                                 </div>
                             </div>
                         </form>
+                        <div class="col-md-12 col-sm-12 col-xs-12" id="send_total_amount">
+                            <div class="col-md-12 col-sm-12 col-xs-12" style="display: block;text-align: right;">
+                                处方总金额:<span id="sendTotalAmount" style="color: red;">0.00</span>
+                            </div>
+                        </div>
                         <table id="tb_table_right"
                                style="overflow: hidden;text-overflow: ellipsis;white-space: nowrap;"></table>
                     </div>