浏览代码

药库优化

WANGJIALIANG 2 年之前
父节点
当前提交
9a62a3254d

+ 7 - 4
src/main/java/cn/hnthyy/thmz/controller/yf/YfIncomingRecordsController.java

@@ -8,10 +8,7 @@ import cn.hnthyy.thmz.entity.his.yp.YpZdDict;
 import cn.hnthyy.thmz.entity.his.yp.YpZdManufactory;
 import cn.hnthyy.thmz.enums.InTypeEnum;
 import cn.hnthyy.thmz.service.his.mz.EmployeeService;
-import cn.hnthyy.thmz.service.his.yp.YpInDetlService;
-import cn.hnthyy.thmz.service.his.yp.YpInDetlYfService;
-import cn.hnthyy.thmz.service.his.yp.YpZdDictService;
-import cn.hnthyy.thmz.service.his.yp.YpZdManufactoryService;
+import cn.hnthyy.thmz.service.his.yp.*;
 import cn.hnthyy.thmz.service.his.zd.ZdUnitCodeService;
 import cn.hnthyy.thmz.vo.YpEffDateVo;
 import cn.hnthyy.thmz.vo.YpInDetlVo;
@@ -45,6 +42,8 @@ public class YfIncomingRecordsController {
     private YpInDetlYfService ypInDetlYfService;
     @Autowired
     private YpInDetlService ypInDetlService;
+    @Autowired
+    private YpZdSupplyService ypZdSupplyService;
 
     /**
      * 查询药品信息
@@ -185,6 +184,7 @@ public class YfIncomingRecordsController {
                 yp.setName(ypZdDict.getName());
                 yp.setSpecification(ypZdDict.getSpecification());
                 yp.setManufactoryName(ypZdManufactoryService.queryYpZdManufactoryByCode(yp.getManuCode()));
+                yp.setSupplyName(ypZdSupplyService.queryNameByCode(ypZdDict.getZbSupplyer()));
                 Employee employee = employeeService.queryByUserCode(yp.getInputId());
                 yp.setInputName(employee.getEmployeeName());
                 yp.setInTypeName(InTypeEnum.getInTypeByCode(yp.getInType()).name);
@@ -230,6 +230,9 @@ public class YfIncomingRecordsController {
             if (StringUtils.isBlank(ypInDetlVo.getManuCode())) {
                 ypInDetlVo.setManuCode(null);
             }
+            if (StringUtils.isBlank(ypInDetlVo.getSupplyCode())) {
+                ypInDetlVo.setSupplyCode(null);
+            }
             if (StringUtils.isBlank(ypInDetlVo.getInputId())) {
                 ypInDetlVo.setInputId(null);
             }

+ 2 - 0
src/main/java/cn/hnthyy/thmz/entity/his/yp/YpInDetlYf.java

@@ -90,6 +90,8 @@ public class YpInDetlYf{
   private String specification;
   //厂家名称
   private String manufactoryName;
+  //供应商名称
+  private String supplyName;
   //入库类型名称
   private String inTypeName;
   //查询入库的开始时间 字符串形式

+ 6 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/yp/YpInDetlMapper.java

@@ -255,6 +255,12 @@ public interface YpInDetlMapper {
             "<when test='chargeCode != null'>" +
             "  and charge_code=#{chargeCode}" +
             "</when>" +
+            "<when test='manuCode != null'>" +
+            "  and manu_code=#{manuCode}" +
+            "</when>" +
+            "<when test='supplyCode != null'>" +
+            "  and supply_code=#{supplyCode}" +
+            "</when>" +
             "<when test='inDocuNo != null'>" +
             "  and in_docu_no=#{inDocuNo}" +
             "</when>" +

+ 3 - 0
src/main/java/cn/hnthyy/thmz/mapper/his/yp/YpInDetlYfMapper.java

@@ -60,6 +60,9 @@ public interface YpInDetlYfMapper {
             "<when test='ypInDetlYf.manuCode != null'>" +
             " and manu_code = #{ypInDetlYf.manuCode}" +
             "</when>" +
+            "<when test='ypInDetlYf.supplyCode != null'>" +
+            " and supply_code = #{ypInDetlYf.supplyCode}" +
+            "</when>" +
             "<when test='ypInDetlYf.inputId != null'>" +
             " and input_id = #{ypInDetlYf.inputId}" +
             "</when>" +

+ 49 - 8
src/main/resources/static/js/yf/incoming_records.js

@@ -55,6 +55,10 @@ $(function () {
                 $('#inputId').val(row.employeeCode);
             }
         });
+        if ($('#inputNameSearch').val().length == 0) {
+            $('#inputId').val("");
+            $('#inputNameSearch').val("");
+        }
     });
     $('#manufactoryNameSearch').on('input focus', function (e) {
         showManufactoryPopover({
@@ -67,6 +71,28 @@ $(function () {
                 $('#manufactoryNameSearch').val(row.name);
             }
         });
+        if ($('#manufactoryNameSearch').val().length == 0) {
+            $('#manuCode').val("");
+            $('#manufactoryNameSearch').val("");
+        }
+    });
+    initSearchList('<div id="supplyPopoverContent"><table id="tb_table_supply"></table></div>',
+        'supplyNameSearch', 300, 250);
+    $('#supplyNameSearch').on('input focus', function (e) {
+        showSupplyPopover({
+            data: {
+                searchText: $("#supplyNameSearch").val() == "" ? null : $("#supplyNameSearch").val(),
+            },
+            onClickRow: function (row, $element) {
+                $('#supplyNameSearch').webuiPopover('hide');
+                $('#supplyCode').val(row['code']);
+                $('#supplyNameSearch').val(row['name']);
+            }
+        });
+        if ($('#supplyNameSearch').val().length == 0) {
+            $('#supplyCode').val("");
+            $('#supplyNameSearch').val("");
+        }
     });
 });
 
@@ -77,8 +103,10 @@ function resetSearch() {
     $("#codeSearch").val(null);
     $("#serialSearch").val(null);
     $("#manuCode").val(null);
+    $("#supplyCode").val(null);
     $("#inputId").val(null);
     $("#manufactoryNameSearch").val(null);
+    $("#supplyNameSearch").val(null);
     $("#yfInNoSearch").val(null);
     $("#searchTextDrug").val(null);
     $("#inputNameSearch").val(null);
@@ -117,7 +145,8 @@ function getAll() {
         rowNum: 10,
         rowList: [10, 20, 30],
         pager: 'pager',
-        colNames: ['组', '药品编码', '药品名', '规格', '旧库存', '入库量', '零售价', '购入总价', '入库单号', '入库日期', '入库人', '效期', '生产厂家', '生产批号', '备注'],
+        colNames: ['组', '药品编码', '药品名', '规格', '旧库存', '入库量', '零售价', '购入总价', '入库单号',
+            '入库日期', '入库人','验收状态', '验收人', '效期', '生产厂家', '生产批号', '供应商'],
         colModel: [
             {name: 'inTypeName', index: 'inTypeName', width: 100, align: 'center'},
             {name: 'chargeCode', index: 'chargeCode', width: 100, align: 'center'},
@@ -128,31 +157,42 @@ function getAll() {
                     }
                     return cellvalue
                 }},
-            {name: 'specification', index: 'specification', width: 120},
-            {name: 'stockAmount', index: 'stockAmount', width: 100, align: 'center'},
-            {name: 'buyAmt', index: 'buyAmt', width: 100, align: 'center'},
-            {name: 'packRetprice', index: 'packRetprice', width: 100, align: 'center'},
+            {name: 'specification', index: 'specification', width: 100},
+            {name: 'stockAmount', index: 'stockAmount', width: 70, align: 'center'},
+            {name: 'buyAmt', index: 'buyAmt', width: 70, align: 'center'},
+            {name: 'packRetprice', index: 'packRetprice', width: 70, align: 'center'},
             {
                 name: 'buyTotalPrice',
                 index: 'buyTotalPrice',
-                width: 100,
+                width: 70,
                 align: 'center',
                 formatter: function (cellvalue, options, rowObject) {
                     return rowObject.buyPrice*rowObject.buyAmt
                 }},
             {name: 'inDocuNo', index: 'inDocuNo', width: 100, align: 'center'},
             {name: 'inDate', index: 'inDate', formatter: 'date', width: 100, align: 'center'},
-            {name: 'inputName', index: 'inputName', width: 80, align: 'center',
+            {name: 'inputName', index: 'inputName', width: 70, align: 'center',
                 formatter: function (cellvalue, options, rowObject) {
                     if (isYk) {
                         return rowObject.checkerName
                     }
                     return cellvalue
                 }},
+            {name: 'yszt', index: 'yszt', width: 70, align: 'center',
+                formatter: function (cellvalue, options, rowObject) {
+                    return '合格'
+                }},
+            {name: 'ysName', index: 'ysName', width: 70, align: 'center',
+                formatter: function (cellvalue, options, rowObject) {
+                    if (isYk) {
+                        return rowObject.checkerName
+                    }
+                    return rowObject.inputName
+                }},
             {name: 'effDate', index: 'effDate', formatter: 'date', width: 100, align: 'center'},
             {name: 'manufactoryName', index: 'manufactoryName', width: 150},
             {name: 'manuNo', index: 'manuNo', width: 100},
-            {name: 'inComment', index: 'inComment', width: 150}
+            {name: 'supplyName', index: 'supplyName', width: 150}
         ],
         jsonReader: {
             root: "data", page: "page", total: "total",
@@ -188,6 +228,7 @@ function getAll() {
             'chargeCode': $("#codeSearch").val(),
             'serial': $("#serialSearch").val(),
             'manuCode': $("#manuCode").val(),
+            'supplyCode': $("#supplyCode").val(),
             'inputId': $("#inputId").val(),
             'inDocuNo': $("#yfInNoSearch").val(),
             'inType': $("#inTypeSearch").val(),

+ 34 - 5
src/main/resources/static/js/yf/ward_prescription.js

@@ -587,7 +587,7 @@ function initSummarizingTable() {
         },
         toolbar: [true, "top"],
         styleUI: 'Bootstrap',
-        height: screen.height * 0.6,
+        height: '100%',
         viewrecords: true,
         autowidth: true,
         /*loadonce:true,//一次加载全部数据到客户端,由客户端进行排序
@@ -608,6 +608,17 @@ function initSummarizingTable() {
             groupText: ['<b>单号:' + pageNo + '</b>'],//组名的展示文字
             groupCollapse: false,//是否收起
         },
+        footerrow:true,//设置属性,显示统计行
+        gridComplete:function(){
+            var rowNum=parseInt($(this).getGridParam("records"),20);//获取行数
+            if(rowNum>0){
+                $(".ui-jqgrid-sdiv").show();
+                let estatecount=$(this).getCol("totalMoney",false,"sum");//需要统计的列
+                $(this).footerData("set",{"retprice":"合计","totalMoney":keepTwoDecimal(estatecount)}); //将合计值显示出来
+            }else{
+                $(".ui-jqgrid-sdiv").hide();
+            }
+        },
         colNames: ['发药', '拒退', '单号', '批号', '住院号', '床号', '姓名', '代煎剂数', '货位号', '药品编码', '药品名称', '规格', '数量/剂数', '处方金额', '代煎单价',
             '每天剂数', '煎药说明', '加水量', '煮取量', '复煎次数', '几次服用', '服用说明', '医生', '每剂数量', '发药量', '原发药量', '库存量', '零售价', '金额', '生产厂家', '药单类型', '确认时间', '规格编号', '医保编码','草药医嘱说明'],
         colModel: [
@@ -711,11 +722,15 @@ function initSummarizingTable() {
             {
                 name: 'totalMoney', index: 'totalMoney', align: 'center', width: 30,
                 formatter: function (cellvalue, options, rowObject) {
-                    if (groupNo === '81') {
-                        return keepTwoDecimal(rowObject.retprice * rowObject.amount * rowObject.minAmount)
+                    let money = 0;
+                    if(rowObject.retprice === '合计'){
+                        money = cellvalue;
+                    } else if (groupNo === '81') {
+                        money = keepTwoDecimal(rowObject.retprice * rowObject.amount * rowObject.minAmount);
                     } else {
-                        return keepTwoDecimal(rowObject.retprice * rowObject.amount)
+                        money = keepTwoDecimal(rowObject.retprice * rowObject.amount);
                     }
+                    return money;
                 }
             },
             {
@@ -840,7 +855,7 @@ function initDetailTable() {
         },
         toolbar: [true, "top"],
         styleUI: 'Bootstrap',
-        height: 350,
+        height: '100%',
         viewrecords: true,
         autowidth: true,
         shrinkToFit: true,
@@ -849,6 +864,17 @@ function initDetailTable() {
         rowNum: -1,//取消分页
         caption: '请领单药品明细',
         grouping: true,
+        footerrow:true,//设置属性,显示统计行
+        gridComplete:function(){
+            var rowNum=parseInt($(this).getGridParam("records"),20);//获取行数
+            if(rowNum>0){
+                $(".ui-jqgrid-sdiv").show();
+                let estatecount=$(this).getCol("totalMoney",false,"sum");//需要统计的列
+                $(this).footerData("set",{"retprice":"合计","totalMoney":keepTwoDecimal(estatecount)}); //将合计值显示出来
+            }else{
+                $(".ui-jqgrid-sdiv").hide();
+            }
+        },
         colNames: ['发药', '拒退', '批号', '单号', '住院号', '床号', '次数', '姓名', '药品名称', '规格', '数量', '原发药量', '零售价', '金额', '执行时间', '医嘱', '给药方式','确认时间'
             , '频率', '剂量', '单位', '医生', '生日', '性别', '身份', '诊断', '科室', '病室', '是否婴儿', '请领人', '长期标志', '药品类型', '给药方式编码', '医嘱号',
             '自费标志', '单列', '贵重', '毒麻', '审批标志', '药房编码', '规格', '医生编码', '药单类别', '药品编码', '口服开始时间', '口服结束时间', '帐页号', '流水号', '医保编码','执行科室(医技药单用)'],
@@ -916,6 +942,9 @@ function initDetailTable() {
             {
                 name: 'totalMoney', index: 'totalMoney', align: 'center', width: 30,
                 formatter: function (cellvalue, options, rowObject) {
+                    if(rowObject.retprice === '合计'){
+                        return cellvalue
+                    }
                     return keepTwoDecimal(rowObject.retprice * rowObject.amount)
                 }
             },

+ 1 - 1
src/main/resources/templates/yf/drug_delivery_dept.html

@@ -62,7 +62,7 @@
                                 title="审核"><i class="fa fa-check-square-o"></i>
                         </button>
                         <button type="button" style="margin-left:3px" id="btn_record" class="btn btn-primary"
-                                title="库单记录"><i class="fa fa-list-alt"></i>
+                                title="库单记录"><i class="fa fa-list-alt"></i>
                         </button>
                         <button type="button" id="btn_daily" class="btn btn-primary"
                                 title="打印"><i class="fa fa-print"></i>

+ 6 - 0
src/main/resources/templates/yf/incoming_records.html

@@ -18,6 +18,7 @@
                     <input id="codeSearch" class="form-control optional" type="hidden" >
                     <input id="serialSearch" class="form-control optional" type="hidden" >
                     <input id="manuCode" class="form-control optional" type="hidden" >
+                    <input id="supplyCode" class="form-control optional" type="hidden" >
                     <input id="inputId" class="form-control optional" type="hidden" >
                     <div class="item form-group ">
                         <label class="control-label col-md-1 col-sm-1 col-xs-12" for="manufactoryNameSearch">厂家
@@ -57,6 +58,11 @@
                         </div>
                     </div>
                     <div class="item form-group ">
+                        <label class="control-label col-md-1 col-sm-1 col-xs-12" for="supplyNameSearch">供应商
+                        </label>
+                        <div class="col-md-2 col-sm-2 col-xs-12">
+                            <input id="supplyNameSearch" class="form-control optional" type="text">
+                        </div>
                         <label class="control-label col-md-1 col-sm-1 col-xs-12" for="searchTextDrug">药品
                         </label>
                         <div class="col-md-2 col-sm-2 col-xs-12">

+ 1 - 1
src/main/resources/templates/yk/drug_delivery.html

@@ -51,7 +51,7 @@
                                 title="审核"><i class="fa fa-check-square-o"></i>
                         </button>
                         <button type="button" style="margin-left:3px" id="btn_record" class="btn btn-primary"
-                                title="库单记录"><i class="fa fa-list-alt"></i>
+                                title="库单记录"><i class="fa fa-list-alt"></i>
                         </button>
                         <button type="button" id="btn_daily" class="btn btn-primary"
                                 title="打印"><i class="fa fa-print"></i>