Forráskód Böngészése

精麻药查询统计开发

WANGJIALIANG 4 éve
szülő
commit
a9c54273c5

+ 13 - 0
src/main/java/cn/hnthyy/thmz/controller/NavigationController.java

@@ -854,4 +854,17 @@ public class NavigationController {
         }
         return "yf/yf_yp_zd_dept";
     }
+
+    /**
+     * 精麻药查询统计
+     * @return
+     */
+    @RequestMapping("/spirit-anesthetic-print")
+    public String spiritAnestheticPrint(HttpServletRequest httpServletRequest) throws Exception {
+        List<String> urls = getRoleUrls(httpServletRequest);
+        if (!urls.contains("/thmz/spirit-anesthetic-print")) {
+            throw new Exception("您没有此模块的权限,请联系管理员开通!");
+        }
+        return "yf/spirit_anesthetic_print";
+    }
 }

+ 79 - 0
src/main/java/cn/hnthyy/thmz/controller/yf/YfSpiritAnestheticPrintController.java

@@ -0,0 +1,79 @@
+package cn.hnthyy.thmz.controller.yf;
+
+
+import cn.hnthyy.thmz.comment.UserLoginToken;
+import cn.hnthyy.thmz.entity.his.mz.Employee;
+import cn.hnthyy.thmz.service.his.mz.EmployeeService;
+import cn.hnthyy.thmz.service.his.yf.YfSpiritAnestheticPrintService;
+import cn.hnthyy.thmz.service.his.zd.ZdUnitCodeService;
+import cn.hnthyy.thmz.vo.MzSendMedicineVo;
+import lombok.extern.slf4j.Slf4j;
+import org.apache.commons.lang3.StringUtils;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.web.bind.annotation.RequestMapping;
+import org.springframework.web.bind.annotation.RequestMethod;
+import org.springframework.web.bind.annotation.RequestParam;
+import org.springframework.web.bind.annotation.RestController;
+
+import java.util.ArrayList;
+import java.util.HashMap;
+import java.util.List;
+import java.util.Map;
+
+/**
+ * @description:精麻药品查询统计
+ * @author: WANGJIALIANG
+ * @time: 2021/10/7 11:13
+ */
+@Slf4j
+@RestController
+public class YfSpiritAnestheticPrintController {
+    @Autowired
+    YfSpiritAnestheticPrintService yfSpiritAnestheticPrintService;
+    @Autowired
+    ZdUnitCodeService zdUnitCodeService;
+    @Autowired
+    EmployeeService employeeService;
+    /**
+     * 获取精麻药品统计信息
+     * @return
+     */
+    @UserLoginToken
+    @RequestMapping(value = "/getSpiritAnestheticPrint",method = {RequestMethod.GET,RequestMethod.POST})
+    public Map<String,Object> getSpiritAnestheticPrint(@RequestParam("beginDate") String beginDate, @RequestParam("endDate") String endDate,
+                                                       @RequestParam("chargeItemCode") String chargeItemCode, @RequestParam("unitCode") String unitCode,
+                                                       @RequestParam("drugFlags[]") String[] drugFlags, @RequestParam("queryScope") Integer queryScope){
+        Map<String, Object> resultMap = new HashMap<>();
+        try {
+            if(StringUtils.isBlank(chargeItemCode)){
+                chargeItemCode = null;
+            }
+            if(StringUtils.isBlank(unitCode)){
+                unitCode = null;
+            }
+            List<MzSendMedicineVo> sendMedicineVos = new ArrayList<>();
+            if(queryScope == 1 || queryScope == 0){
+                List<MzSendMedicineVo> mzSendMedicineVos = yfSpiritAnestheticPrintService.queryMzSpiritAnestheticPrint(beginDate, endDate, chargeItemCode, unitCode, drugFlags);
+                sendMedicineVos.addAll(mzSendMedicineVos);
+            }
+            if(queryScope == 2 || queryScope == 0){
+                List<MzSendMedicineVo> zySendMedicineVos = yfSpiritAnestheticPrintService.queryZySpiritAnestheticPrint(beginDate, endDate, chargeItemCode, unitCode, drugFlags);
+                sendMedicineVos.addAll(zySendMedicineVos);
+            }
+            sendMedicineVos.forEach(mzSendMedicineVo -> {
+                String warnDeptName = zdUnitCodeService.queryDeptNameByIdInCache(mzSendMedicineVo.getWarnDept());
+                mzSendMedicineVo.setWarnDeptName(warnDeptName);
+                Employee employee = employeeService.queryByUserCode(mzSendMedicineVo.getDoctorCode());
+                mzSendMedicineVo.setEmployeeName(employee.getEmployeeName());
+            });
+            resultMap.put("code", 0);
+            resultMap.put("message", "查询精麻药品统计信息成功");
+            resultMap.put("data", sendMedicineVos);
+            return resultMap;
+        } catch (Exception e) {
+            resultMap.put("code", -1);
+            resultMap.put("message", "查询精麻药品统计信息失败");
+            return resultMap;
+        }
+    }
+}

+ 106 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/yf/YfSpiritAnestheticPrintMapper.java

@@ -0,0 +1,106 @@
+package cn.hnthyy.thmz.mapper.his.yf;
+
+import cn.hnthyy.thmz.vo.MzSendMedicineVo;
+import org.apache.ibatis.annotations.Param;
+import org.apache.ibatis.annotations.Select;
+
+import java.util.List;
+
+/**
+ *精麻药品查询统计
+ */
+public interface YfSpiritAnestheticPrintMapper {
+
+    /**
+     * 统计门诊药品
+     * @param beginDate
+     * @param endDate
+     * @param chargeItemCode
+     * @param unitCode
+     * @param drugFlags
+     * @return
+     */
+    @Select({"<script>" +
+            "select charge_date=a.confirm_time," +
+            " patient_id=rtrim(a.patient_id)," +
+            " name=rtrim(c.name)," +
+            " sex=c.sex," +
+            " age=c.age," +
+            " social_no=c.social_no," +
+            " drugname=b.name," +
+            " quantity=case when a.receipt_no<![CDATA[<]]>'0' then -abs(a.quantity*cy_fy) else a.quantity*cy_fy end ," +
+            " doctor_code=a.doctor_id," +
+            " a.warn_dept," +
+            " b.specification," +
+            " d.icd_text," +
+            " a.charge_item_code" +
+            " from yp_mz_fytj a,yp_zd_dict b,mz_patient_mi c,mz_visit_table d" +
+            " where a.charge_item_code=b.code and" +
+            "       a.serial=b.serial and" +
+            "       b.drug_flag in " +
+            "       <foreach item='item' collection='drugFlags' separator=',' open='(' close=')'>  " +
+            "           #{item}  " +
+            "       </foreach> and" +
+            "       a.patient_id=c.patient_id and" +
+            "       a.patient_id=d.patient_id and" +
+            "       a.times*=d.times and" +
+            "       <when test='chargeItemCode!=null'>"+
+            "       a.charge_item_code=#{chargeItemCode} and" +
+            "       </when>"+
+            "       <when test='unitCode!=null'>"+
+            "       a.warn_dept=#{unitCode} and" +
+            "       </when>"+
+            "       a.confirm_time<![CDATA[>=]]>#{beginDate} and" +
+            "       a.confirm_time<![CDATA[<=]]>#{endDate}" +
+            "       order by charge_item_code asc",
+    "</script>"})
+    List<MzSendMedicineVo> selectMzSpiritAnestheticPrint(@Param("beginDate") String beginDate,@Param("endDate") String endDate,
+                                                         @Param("chargeItemCode") String chargeItemCode,@Param("unitCode") String unitCode,@Param("drugFlags") String[] drugFlags);
+
+    /**
+     * 统计门诊药品
+     * @param beginDate
+     * @param endDate
+     * @param chargeItemCode
+     * @param unitCode
+     * @param drugFlags
+     * @return
+     */
+    @Select({"<script>" +
+            "select  charge_date=a.confirm_time," +
+            " patient_id=rtrim(a.inpatient_no)," +
+            " name=rtrim(c.name)," +
+            " sex=c.sex," +
+            " age=datediff(year,birth_date,getdate())," +
+            " social_no=c.social_no," +
+            " drugname=b.name," +
+            " quantity=amount," +
+            " doctor_code=isnull(p.physician,a.drawer)," +
+            " warn_dept=a.dept_code," +
+            " b.specification," +
+            " icd_text=e.admiss_diag_str," +
+            " charge_item_code=charge_code" +
+            " from yp_zy_patient a,yp_zd_dict b,a_patient_mi c,zy_patient e,view_yz_all_order p" +
+            " where a.charge_code=b.code and" +
+            "       a.serial=b.serial and" +
+            "       b.drug_flag in " +
+            "       <foreach item='item' collection='drugFlags' separator=',' open='(' close=')'>  " +
+            "       #{item}  " +
+            "       </foreach> and" +
+            "       a.inpatient_no=c.inpatient_no and" +
+            "       a.inpatient_no=e.inpatient_no and" +
+            "       a.admiss_times*=e.admiss_times  and" +
+            "       <when test='chargeItemCode!=null'>"+
+            "       a.charge_code=#{chargeItemCode} and" +
+            "       </when>"+
+            "       <when test='unitCode!=null'>"+
+            "       a.dept_code=#{unitCode} and" +
+            "       </when>"+
+            "       a.confirm_time <![CDATA[>=]]>#{beginDate} and" +
+            "       a.confirm_time <![CDATA[<=]]>#{endDate} and" +
+            "       a.act_order_no*=p.act_order_no" +
+            "       order by charge_code asc",
+    "</script>"})
+    List<MzSendMedicineVo> selectZySpiritAnestheticPrint(@Param("beginDate") String beginDate,@Param("endDate") String endDate,
+                                                        @Param("chargeItemCode") String chargeItemCode,@Param("unitCode") String unitCode,@Param("drugFlags") String[] drugFlags);
+}

+ 37 - 0
src/main/java/cn/hnthyy/thmz/service/his/yf/YfSpiritAnestheticPrintService.java

@@ -0,0 +1,37 @@
+package cn.hnthyy.thmz.service.his.yf;
+
+import cn.hnthyy.thmz.vo.MzSendMedicineVo;
+
+import java.util.List;
+
+/**
+ * @description:精麻药品查询统计
+ * @author: WANGJIALIANG
+ * @time: 2021/10/12 16:21
+ */
+public interface YfSpiritAnestheticPrintService {
+
+    /**
+     * 统计门诊药品
+     * @param beginDate
+     * @param endDate
+     * @param chargeItemCode
+     * @param unitCode
+     * @param drugFlags
+     * @return
+     */
+    List<MzSendMedicineVo> queryMzSpiritAnestheticPrint(String beginDate, String endDate,
+                                                         String chargeItemCode, String unitCode, String[] drugFlags);
+
+    /**
+     * 统计门诊药品
+     * @param beginDate
+     * @param endDate
+     * @param chargeItemCode
+     * @param unitCode
+     * @param drugFlags
+     * @return
+     */
+    List<MzSendMedicineVo> queryZySpiritAnestheticPrint(String beginDate, String endDate,
+                                                         String chargeItemCode, String unitCode, String[] drugFlags);
+}

+ 26 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/yf/YfSpiritAnestheticPrintServiceImpl.java

@@ -0,0 +1,26 @@
+package cn.hnthyy.thmz.service.impl.his.yf;
+
+import cn.hnthyy.thmz.mapper.his.yf.YfSpiritAnestheticPrintMapper;
+import cn.hnthyy.thmz.service.his.yf.YfSpiritAnestheticPrintService;
+import cn.hnthyy.thmz.vo.MzSendMedicineVo;
+import org.springframework.beans.factory.annotation.Autowired;
+import org.springframework.stereotype.Service;
+
+import java.util.List;
+
+@Service
+public class YfSpiritAnestheticPrintServiceImpl implements YfSpiritAnestheticPrintService {
+    @SuppressWarnings("all")
+    @Autowired
+    private YfSpiritAnestheticPrintMapper yfSpiritAnestheticPrintMapper;
+
+    @Override
+    public List<MzSendMedicineVo> queryMzSpiritAnestheticPrint(String beginDate, String endDate, String chargeItemCode, String unitCode, String[] drugFlags) {
+        return yfSpiritAnestheticPrintMapper.selectMzSpiritAnestheticPrint(beginDate, endDate, chargeItemCode, unitCode, drugFlags);
+    }
+
+    @Override
+    public List<MzSendMedicineVo> queryZySpiritAnestheticPrint(String beginDate, String endDate, String chargeItemCode, String unitCode, String[] drugFlags) {
+        return yfSpiritAnestheticPrintMapper.selectZySpiritAnestheticPrint(beginDate, endDate, chargeItemCode, unitCode, drugFlags);
+    }
+}

+ 2 - 0
src/main/java/cn/hnthyy/thmz/vo/MzSendMedicineVo.java

@@ -115,4 +115,6 @@ public class MzSendMedicineVo implements Serializable {
     private String drugFlag;
     //划价时间
     private Date priceTime;
+    //身份证号
+    private String socialNo;
 }

+ 417 - 0
src/main/resources/static/js/yf/spirit_anesthetic_print.js

@@ -0,0 +1,417 @@
+//@ sourceURL=spirit_anesthetic_print.js
+var LODOP; //声明为全局变量
+//默认打印机下标
+var printIndex = -1;
+$(function () {
+    initDeptSelect(0,"unitCodeSearch");
+    init_daterangepickertime();
+    setTimeout(function () {
+        getLodop();
+    }, 800);
+
+    $(".selectpicker").selectpicker({
+        dropuAuto: false
+    });
+
+    //初始化页面上面的按钮事件
+    $("#btn_search").click(function (t) {
+        getSpiritAnestheticPrintData();
+    });
+    $('#btn_clean').click(function () {
+        cleanParams();
+    });
+    $("#btn_daily").click(function (t) {
+        print();
+    });
+    $("#drugFlagSearch").change(function (t,d,e) {
+        let drugFlag = $("#drugFlagSearch").val();
+        let title = "";
+        if(drugFlag == 0){
+            title = "麻醉药品、精神一类药品使用登记"
+        }else if(drugFlag == 1){
+            title = "终止妊娠药统计"
+        }else if(drugFlag == 2){
+            title = "精二及麻黄碱类统计"
+        }
+        $("#title").html(title);
+        $("#dateRange").html($('#reportrange span').html());
+        $("#printDate").html(format(new Date(),"yyyy-MM-dd HH:mm"));
+    });
+
+    //初始化药品查询弹出框
+    initDrugSearchList();
+    $('#searchText').on('input focus',function(e){
+        showDrugPopover();
+        if($('#searchText').val() == ''){
+            $('#codeSearch').val("");
+        }
+    });
+});
+
+
+/**
+ * 获取统计报表
+ */
+function getSpiritAnestheticPrintData() {
+    $("#dateRange").html($('#reportrange span').html());
+    $("#printDate").html(format(new Date(),"yyyy-MM-dd HH:mm"));
+    $('#searchText').html(format(new Date(),"yyyy-MM-dd HH:mm"));
+    $.ajax({
+        type: "GET",
+        url: '/thmz/getSpiritAnestheticPrint',
+        contentType: "application/json;charset=UTF-8",
+        dataType: "json",
+        headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+        data: queryParams(),
+        success: function (res) {
+            if (res == '401' || res == 401) {
+                window.location.href = '/thmz/login/view'
+                return;
+            }
+            if (res.code == 0) {
+                let html = '';
+                let code = '';
+                let number = 0;
+                let sex;
+                $('.sjh').remove();
+                for (var i = 0; i < res.data.length; i++) {
+                    let data = res.data[i];
+                    if(code == ''){
+                        code = data.chargeItemCode;
+                        if(number > 0){
+                            html += '<tr class="sjh">';
+                            html += '<td colspan="15" style="text-align: center;font-weight: 700;">共计:' + number + '</td>';
+                            html += '</tr>';
+                            number = 0;
+                        }
+                        number += parseFloat(data.quantity);
+                    }else if(code == data.chargeItemCode){
+                        number += parseFloat(data.quantity);
+                    }else{
+                        html += '<tr class="sjh">';
+                        html += '<td colspan="15" style="text-align: center;font-weight: 700;">共计:' + number + '</td>';
+                        html += '</tr>';
+                        code = '';
+                        number = parseFloat(data.quantity);
+                    }
+                    if(data.sex == 1){
+                        sex = "男"
+                    }else if(data.sex == 2){
+                        sex = "女"
+                    }else{
+                        sex = "未知"
+                    }
+                    html += '<tr class="sjh">';
+                    html += '<td style="text-align: center;">' + data.chargeDate.substring(5,11) + '</td>';
+                    html += '<td style="text-align: center;">' + data.patientId + '</td>';
+                    html += '<td style="text-align: center;">' + data.name + '</td>';
+                    html += '<td style="text-align: center;">' + sex + '</td>';
+                    html += '<td style="text-align: center;">' + data.age + '</td>';
+                    html += '<td>' + data.socialNo + '</td>';
+                    html += '<td>' + data.icdText + '</td>';
+                    html += '<td style="text-align: center;">' + data.chargeItemCode + '</td>';
+                    html += '<td>' + data.drugname + '</td>';
+                    html += '<td>' + data.specification + '</td>';
+                    html += '<td style="text-align: center;">' + data.quantity + '</td>';
+                    html += '<td style="text-align: center;">' + data.employeeName + '</td>';
+                    html += '<td style="text-align: center;">' + data.warnDeptName + '</td>';
+                    html += '<td></td>';
+                    html += '<td></td>';
+                    html += '</tr>';
+                }
+                html += '<tr class="sjh">';
+                html += '<td colspan="15" style="text-align: center;font-weight: 700;">共计:' + number + '</td>';
+                html += '</tr>';
+                $("#tj_table").append(html);
+            } else if (res.code == -1) {
+                new PNotify({
+                    title: '错误提示',
+                    text: res.message,
+                    type: 'error',
+                    hide: true,
+                    styling: 'bootstrap3'
+                });
+            }
+        }
+    });
+}
+
+
+/**
+ * 获取按钮组选择的下标
+ * @param id
+ * @returns {number}
+ */
+function getIndex(id) {
+    var index = 0;
+    var item = $("#" + id).find("button");
+    for (var i = 0; i <= item.length; i++) {
+        if ($(item[i]).hasClass("btn-primary")) {
+            index = i;
+            break;
+        }
+    }
+    return index;
+}
+
+/**
+ * 获取时间选择器的时间数组
+ * @returns {string[]}
+ */
+function getRePortRangeArr() {
+    var rePortRange = $('#reportrange span').html();
+    var rePortRangeArr = rePortRange.split(" - ");
+    return rePortRangeArr;
+}
+
+
+/**
+ * 查询默认打印机
+ */
+function setPrint() {
+    if (printIndex >= 0) {
+        return;
+    }
+    $.ajax({
+        type: "GET",
+        url: '/thmz/getLastWindowsByCurrentUser',
+        contentType: "application/json;charset=UTF-8",
+        dataType: "json",
+        headers: {'Accept': 'application/json', 'Authorization': 'Bearer ' + localStorage.getItem("token")},
+        async: false,
+        success: function (res) {
+            if (res == '401' || res == 401) {
+                window.location.href = '/thmz/login/view'
+                return;
+            }
+            if (res.code == 0) {
+                printIndex = res.data.cgPrintIndex;
+            } else {
+                printIndex = -1;
+            }
+        }
+    });
+}
+
+
+/**
+ * 清空查询条件
+ */
+function cleanParams() {
+    $("#queryScopeSearch").val(0);
+    $('#queryScopeSearch').selectpicker('refresh');
+    $('#reportrange span').html(moment().subtract(1, 'days').format("YYYY-MM-DD 14:00:00") + ' - ' + moment().format("YYYY-MM-DD 13:59:59"));
+    $('#unitCodeSearch').empty();
+    $('#drugFlagSearch').val(0);
+    $('#drugFlagSearch').selectpicker('refresh');
+    $('#searchText').empty();
+    $('#codeSearch').empty();
+}
+
+/**
+ * 打印报表
+ */
+function print() {
+    setPrint();
+    LODOP = getLodop();
+    LODOP.PRINT_INITA(6, 0, "210mm", "297mm", "药房精麻药品发放统计表");
+    LODOP.SET_PRINT_PAGESIZE(2, 0, 0,"A4");
+    //设置默认打印机
+    LODOP.SET_PRINTER_INDEX(printIndex);
+    LODOP.SET_PRINT_STYLE("FontSize", 10); //字体大小
+    LODOP.SET_PRINT_STYLEA(0,"ItemType",2);
+    //设置默认打印机
+    LODOP.SET_PRINTER_INDEX(printIndex);
+    LODOP.ADD_PRINT_TEXT('195mm','140mm','40mm','40mm','第#页/共&页');
+    LODOP.SET_PRINT_STYLEA(0,"ItemType",2);
+    var strStyle="<style>table{width: 1050px;} table,td,th {border-width: 1px;" +
+        "border-style: solid;border-collapse: collapse;table-layout:fixed;word-wrap:break-word;font-size: 14px}</style>";
+    LODOP.ADD_PRINT_HTM("0mm", "2mm", "RightMargin:0mm", "BottomMargin:15mm",strStyle+ document.getElementById("report_table_1").innerHTML);
+    //LODOP.PRINT();
+    LODOP.PREVIEW();
+}
+
+
+//显示查询的药品悬浮窗
+function showDrugPopover() {
+    $('#tb_table_medicine').bootstrapTable('destroy');
+    $('#tb_table_medicine').bootstrapTable({
+        url: '/thmz/getYpZdDictBase',         //请求后台的URL(*)
+        method: 'GET',                      //请求方式(*)
+        toolbar: '#toolbar',                //工具按钮用哪个容器
+        striped: true,                      //是否显示行间隔色
+        cache: true,                       //是否使用缓存,默认为true,所以一般情况下需要设置一下这个属性(*)
+        pagination: false,                   //是否显示分页(*)
+        sortable: true,                     //是否启用排序
+        sortOrder: "asc",                   //排序方式
+        queryParams:queryParamsDrugTable,           //传递参数(*)
+        sidePagination: "client",           //分页方式: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'
+            },{
+                field: 'name',
+                title: '药品名',
+                align: "center",
+                valign: 'middle'
+            },
+            {
+                field: 'specification',
+                title: '规格',
+                align: "center",
+                valign: 'middle'
+            }, {
+                field: 'manufactoryName',
+                title: '厂家',
+                align: "center",
+                valign: 'middle'
+            },
+            {
+                field: 'packRetprice',
+                title: '单价',
+                align: "center",
+                visible: false,
+                valign: 'middle'
+            }, {
+                field: 'stockAmount',
+                title: '药库库存',
+                align: "center",
+                visible: false,
+                valign: 'middle'
+            }
+        ],
+        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": {}   //数据
+                };
+            }
+            return {
+                "total": ress.data.length,//总页数
+                "rows": ress.data   //数据
+            };
+        },
+        onClickRow: function (row, $element) {
+            $('#searchText').webuiPopover('hide');
+            $('#codeSearch').val(row.code);
+            $('#searchText').val(row.name);
+        }
+    });
+}
+
+/**
+ * 药品列表查询参数
+ */
+function queryParamsDrugTable() {
+    var temp = {
+        groupYk: 11,
+        searchText: $("#searchText").val() == "" ? null : $("#searchText").val(),
+    };
+    return temp;
+}
+
+/**
+ * 统计列表查询参数
+ */
+function queryParams() {
+    let drugFlags = new Array();
+    let flag = $("#drugFlagSearch").val();
+    if(flag == 0){
+        drugFlags[0] = 2;
+        drugFlags[1] = 3;
+    }else if(flag == 1){
+        drugFlags[0] = 6;
+    }else if(flag == 2){
+        drugFlags[0] = 1;
+        drugFlags[1] = 4;
+        drugFlags[2] = 5;
+    }
+    var temp = {
+        beginDate: getRePortRangeArr()[0],
+        endDate: getRePortRangeArr()[1],
+        chargeItemCode: $('#codeSearch').val(),
+        unitCode: $('#unitCodeSearch').val()!=null?$('#unitCodeSearch').val()[0]:'',
+        drugFlags: drugFlags,
+        queryScope: $("#queryScopeSearch").val()
+    };
+    return temp;
+}
+
+function init_daterangepickertime() {
+    if (typeof ($.fn.daterangepicker) === 'undefined') {
+        return;
+    }
+    var optionSet1 = {
+        startDate: moment().subtract(1, 'days').format("YYYY-MM-DD 14:00:00"),
+        endDate: moment().format("YYYY-MM-DD 13:59:59"),
+        minDate: '2012-01-01',
+        maxDate: nowString(),
+        dateLimit: {
+            days: 1200
+        },
+        showDropdowns: true,
+        showWeekNumbers: true,
+        ranges: {
+            '今天': [moment(), moment()],
+            '昨天': [moment().subtract(1, 'days'), moment().subtract(1, 'days')],
+            '最近7天': [moment().subtract(6, 'days'), moment()],
+            '最近30天': [moment().subtract(29, 'days'), moment()],
+            '当月': [moment().startOf('month'), moment().endOf('month')],
+            '上个月': [moment().subtract(1, 'month').startOf('month'), moment().subtract(1, 'month').endOf('month')]
+        },
+        opens: 'right',
+        buttonClasses: ['btn btn-default'],
+        applyClass: 'btn-small btn-primary',
+        cancelClass: 'btn-small',
+        timePicker: true, //显示时间
+        timePicker24Hour: true, //时间制
+        timePickerSeconds: true, //时间显示到秒
+        timePickerIncrement: 1,
+        format: 'YYYY-MM-DD HH:mm:ss',
+        separator: ' to ',
+        locale: {
+            applyLabel: '确定',
+            cancelLabel: '取消',
+            fromLabel: 'From',
+            toLabel: 'To',
+            customRangeLabel: '自定义',
+            daysOfWeek: ['天', '一', '二', '三', '四', '五', '六'],
+            monthNames: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月'],
+            firstDay: 1
+        }
+    };
+    $('#reportrange').daterangepicker(optionSet1, function (start, end, label) {
+        $('#reportrange span').html(start.format('YYYY-MM-DD HH:mm:ss') + ' - ' + end.format('YYYY-MM-DD HH:mm:ss'));
+    });
+    $('#reportrange span').html(moment().subtract(1, 'days').format("YYYY-MM-DD 14:00:00") + ' - ' + moment().format("YYYY-MM-DD 13:59:59"));
+}

+ 134 - 0
src/main/resources/templates/yf/spirit_anesthetic_print.html

@@ -0,0 +1,134 @@
+<link rel="stylesheet" href="/thmz/css/bootstrap/css/bootstrap-select.css"/>
+<link rel="stylesheet" href="/thmz/css/bootstrap/css/daterangepicker.css"/>
+<link rel="stylesheet" href="/thmz/css/custom.min.css">
+<link rel="stylesheet" href="/thmz/css/toll_administration.css">
+<link rel="stylesheet" href="/thmz/css/jquery.webui-popover.min.css">
+<script src="/thmz/js/dependent/bootstrap-select.js"></script>
+<script src="/thmz/js/dependent/daterangepicker.js"></script>
+<script src="/thmz/js/common/date-util.js"></script>
+<script src="/thmz/js/dependent/jquery.webui-popover.min.js"></script>
+<script src="/thmz/js/common/pharmacy-com.js"></script>
+<script src="/thmz/js/yf/spirit_anesthetic_print.js"></script>
+<script src="/thmz/js/dependent/LodopFuncs.js"></script>
+<title>精麻药查询统计</title>
+<!-- 打印的样式-->
+<style media="print">
+    @page {
+        size: auto;
+        margin: 0mm;
+    }
+</style>
+<style>
+    .receipt {
+        padding-left: 40px;
+    }
+</style>
+<div class="row" style="height: calc(100% - 00px);">
+    <div class="col-md-12 col-sm-12 col-xs-12" style="height: 100%">
+        <div class="x_panel" style="height: 100%">
+            <div class="panel-body">
+                <form id="formSearch" class="form-horizontal" autocomplete="off">
+                    <input type="hidden" id="codeSearch">
+                    <div class="form-group col-md-12 col-sm-12 col-xs-12">
+                        <div class="col-md-3 col-sm-3 col-xs-12">
+                            <label class="control-label col-md-4 col-sm-4 col-xs-12"
+                                   for="queryScopeSearch">查询范围</label>
+                            <div class="col-md-8 col-sm-8 col-xs-12">
+                                <select class="form-control selectpicker show-tick" required="required" title="请选择"
+                                        id="queryScopeSearch">
+                                    <option value="0" selected>全部</option>
+                                    <option value="1">门诊</option>
+                                    <option value="2">住院</option>
+                                </select>
+                            </div>
+                        </div>
+                        <label class="control-label col-md-1 col-sm-1 col-xs-12" for="reportrange"
+                               style="width: 105px;">
+                            出库时间
+                        </label>
+                        <div class="col-md-4 col-sm-4 col-xs-12 " style="width: 325px;">
+                            <div id="reportrange" class="pull-right"
+                                 style="background: #fff; cursor: pointer; padding: 6.5px 10px; border: 1px solid #ccc">
+                                <i class="glyphicon glyphicon-calendar fa fa-calendar"></i>
+                                <span>December 30, 2014 - January 28, 2015</span> <b class="caret"></b>
+                            </div>
+                        </div>
+                        <label class="control-label col-md-1 col-sm-1 col-xs-12" for="unitCodeSearch">领药科室
+                        </label>
+                        <div class="col-md-2 col-sm-2 col-xs-12">
+                            <select class="form-control selectpicker show-tick" data-live-search="true" title="请选择" multiple data-max-options="1"
+                                    id="unitCodeSearch">
+                            </select>
+                        </div>
+                    </div>
+                    <div class="form-group">
+                        <div class="col-md-3 col-sm-3 col-xs-12">
+                            <label class="control-label col-md-4 col-sm-4 col-xs-12"
+                                   for="drugFlagSearch">药品类型</label>
+                            <div class="col-md-8 col-sm-8 col-xs-12">
+                                <select class="form-control selectpicker show-tick" required="required" title="请选择"
+                                        id="drugFlagSearch">
+                                    <option value="0" selected>麻、精一</option>
+                                    <option value="1">终止妊娠药</option>
+                                    <option value="2">精二及麻黄碱类</option>
+                                </select>
+                            </div>
+                        </div>
+                        <label class="control-label col-md-1 col-sm-1 col-xs-12" for="searchText">药品
+                        </label>
+                        <div class="col-md-2 col-sm-2 col-xs-12">
+                            <input id="searchText" class="form-control optional" type="text">
+                        </div>
+                        <button type="button" id="btn_search" class="btn btn-primary"
+                                title="查询"><i class="glyphicon glyphicon-search"></i>
+                        </button>
+                        <button type="button"  id="btn_clean" class="btn btn-primary"
+                                title="重置"><i class="fa fa-rotate-left"></i>
+                        </button>
+                        <button type="button" id="btn_daily" class="btn btn-primary"
+                                title="打印"><i class="fa fa-print"></i>
+                        </button>
+                    </div>
+                </form>
+            </div>
+            <div id="report_table"
+                 style="width:1300px;height: calc(100% - 160px);margin:0 auto;border: 1px solid #337ab7;font-size: 14px;padding: 40px 10px 40px 10px;overflow: scroll">
+                <div id="report_table_1">
+                    <h3 style="text-align:center;font-weight: 700;" id="title">麻醉药品、精神一类药品使用登记</h3>
+                    <div style="text-align:center;margin-top: 20px;">
+                        <span>日期范围:</span><span id="dateRange">2021-10-12 14:00:00 - 2021-10-13 13:59:59</span>
+                        <span style="margin-left: 120px;">打印日期:</span><span id="printDate"></span>
+                    </div>
+                    <table id="tj_table" class="table table-striped table-bordered" style="margin-top: 0px;">
+                        <tr>
+                            <td style="text-align: center;width: 45px;">日期</td>
+                            <td style="text-align: center;width: 55px;">病人ID</td>
+                            <td style="text-align: center;width: 45px;">姓名</td>
+                            <td style="text-align: center;width: 30px;">性别</td>
+                            <td style="text-align: center;width: 30px;">年龄</td>
+                            <td style="text-align: center;width: 115px;">身份证号</td>
+                            <td style="text-align: center;width: 120px;">诊断</td>
+                            <td style="text-align: center;width: 45px;">编码</td>
+                            <td style="text-align: center;width: 80px;">药名</td>
+                            <td style="text-align: center;width: 70px;">规格</td>
+                            <td style="text-align: center;width: 30px;">数量</td>
+                            <td style="text-align: center;width: 45px;">医师</td>
+                            <td style="text-align: center;width: 70px;">科室</td>
+                            <td style="text-align: center;width: 45px;">复核人</td>
+                            <td style="text-align: center;width: 45px;">发药人</td>
+                        </tr>
+                    </table>
+                </div>
+            </div>
+            <table id="tb_table"></table>
+            <div id="previewImage">
+            </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>
+