Browse Source

住院虚库设置和药品停用提示优化

WANGJIALIANG 2 years ago
parent
commit
34405baada

+ 2 - 1
src/main/java/cn/hnthyy/thmz/entity/his/yp/YpBaseYf.java

@@ -39,11 +39,12 @@ public class YpBaseYf {
     private BigDecimal packRetprice;
     //拆零价
     private BigDecimal retprice;
-    //虚拟库存
+    //虚拟库存(门诊用)
     private Double stockAmountVirtual;
     private String jzyfFlag;
     //拆零比例
     private Double splitPercent;
+    //虚拟库存(住院用)
     private Double stockAmountVirtual2;
     private String openVirtual2;
     private String yppc;

+ 2 - 1
src/main/java/cn/hnthyy/thmz/mapper/his/yf/YfInventoryListMapper.java

@@ -37,6 +37,7 @@ public interface YfInventoryListMapper {
                     "  stock_value =isnull( b.pack_retprice,a.pack_retprice) * b.stock_amount  ," +
                     "  b.location," +
                     "  b.stock_amount_virtual," +
+                    "  b.stock_amount_virtual2," +
                     "  b.visible_flag_mz," +
                     "  b.visible_flag_zy" +
                     " FROM yp_zd_dict a WITH(NOLOCK),yp_base_yf b WITH(NOLOCK),yp_print_name y WITH(NOLOCK)" +
@@ -51,7 +52,7 @@ public interface YfInventoryListMapper {
                     "  and ((isnull(a.del_flag,'0') <![CDATA[<>]]> '1' and (isnull(visible_flag_zy,'0') <![CDATA[<>]]> '1' or" +
                     "  isnull(visible_flag_mz,'0') <![CDATA[<>]]> '1')) or ( b.stock_amount <![CDATA[<>]]> 0)) group by a.code, a.name, a.serial," +
                     "            a.class_code, a.specification,a.drug_flag, a.py_code, a.d_code,y.charge_code,a.pack_retprice,a.national_code,b.pack_retprice, " +
-                    "           a.visible_flag, a.manu_code, b.stock_amount, b.location, b.stock_amount_virtual, b.visible_flag_mz, b.visible_flag_zy" +
+                    "           a.visible_flag, a.manu_code, b.stock_amount, b.location, b.stock_amount_virtual, b.stock_amount_virtual2, b.visible_flag_mz, b.visible_flag_zy" +
                     ") as A WHERE RowNumber >#{pageBean.pageSize}*#{pageBean.pageIndex} order by RowNumber asc" ,
             " </script>"})
     List<YpZdBaseVo> selectYpZdBaseYfPage(@Param("groupNo")String groupNo,@Param("classCode") String classCode,@Param("searchText") String searchText,@Param("pageBean")PageBean pageBean);

+ 1 - 1
src/main/java/cn/hnthyy/thmz/mapper/his/yp/YpBaseYfMapper.java

@@ -115,7 +115,7 @@ public interface YpBaseYfMapper {
      */
     @Select({"<script>",
             "select charge_code,serial,stock_amount,stock_value,group_no,location,visible_flag_mz,visible_flag_zy," +
-                    "       visible_flag_stop,stock_amount_virtual,stock_amount_virtual2,open_virtual2 " +
+                    "       visible_flag_stop,stock_amount_virtual,stock_amount_virtual2,(case when open_virtual2='' then 0 else isnull(open_virtual2,0) end) as open_virtual2 " +
                     "from yp_base_yf WITH(NOLOCK) where charge_code=#{chargeCode} and serial=#{serial} and group_no=#{groupNo} ",
             "<when test='visibleFlagMz!=null'>",
             " and visible_flag_mz =#{visibleFlagMz}",

+ 3 - 1
src/main/java/cn/hnthyy/thmz/vo/YpZdBaseVo.java

@@ -63,8 +63,10 @@ public class YpZdBaseVo {
     private String location;
     //药房编码
     private String groupNo;
-    //当前虚存
+    //门诊虚存
     private Double stockAmountVirtual;
+    //住院虚存
+    private Double stockAmountVirtual2;
     //门诊是否停用 0:未停用 1:已停用
     private String visibleFlagMz;
     //住院是否停用 0:未停用 1:已停用

+ 20 - 43
src/main/resources/static/js/yf/yf_inventory_list.js

@@ -365,12 +365,6 @@ function initTable(classCode) {
                 visible: isMultiple==0?false:true,
                 formatter: function (value, row, index) {
                     return Math.floor(value * 100) / 100;
-                },
-                cellStyle:function (value, row, index) {
-                    if(row.visibleFlagMz == 0){
-                        return {css:{background:'red'}};
-                    }
-                    return {css:{}};
                 }
             },
             {
@@ -382,12 +376,6 @@ function initTable(classCode) {
                 visible: isMultiple==0?false:true,
                 formatter: function (value, row, index) {
                     return Math.floor(value * 100) / 100;
-                },
-                cellStyle:function (value, row, index) {
-                    if(row.visibleFlagMz == 0){
-                        return {css:{background:'red'}};
-                    }
-                    return {css:{}};
                 }
             },
             {
@@ -410,13 +398,7 @@ function initTable(classCode) {
                 visible: isMultiple==0?false:true,
                 formatter: function (value, row, index) {
                     return Math.floor(value * 100) / 100;
-                },
-                cellStyle:function (value, row, index) {
-                    if(row.visibleFlagYk == 0){
-                        return {css:{background:'red'}};
-                    }
-                    return {css:{}};
-                },
+                }
             },
             {
                 field: 'specificationMin',
@@ -435,13 +417,7 @@ function initTable(classCode) {
                 visible: isMultiple==0?false:true,
                 formatter: function (value, row, index) {
                     return Math.floor(value * 100) / 100;
-                },
-                cellStyle:function (value, row, index) {
-                    if(row.visibleFlagMz == 0){
-                        return {css:{background:'red'}};
-                    }
-                    return {css:{}};
-                },
+                }
             },
             {
                 field: 'stockAmountLargeZy',
@@ -452,13 +428,7 @@ function initTable(classCode) {
                 visible: isMultiple==0?false:true,
                 formatter: function (value, row, index) {
                     return Math.floor(value * 100) / 100;
-                },
-                cellStyle:function (value, row, index) {
-                    if(row.visibleFlagMz == 0){
-                        return {css:{background:'red'}};
-                    }
-                    return {css:{}};
-                },
+                }
             },
             {
                 field: 'stockAmountLargeDz',
@@ -480,13 +450,7 @@ function initTable(classCode) {
                 visible: isMultiple==0?false:true,
                 formatter: function (value, row, index) {
                     return Math.floor(value * 100) / 100;
-                },
-                cellStyle:function (value, row, index) {
-                    if(row.visibleFlagYk == 0){
-                        return {css:{background:'red'}};
-                    }
-                    return {css:{}};
-                },
+                }
             },
             {
                 field: 'specificationMax',
@@ -536,7 +500,14 @@ function initTable(classCode) {
                 }
             }, {
                 field: 'stockAmountVirtual',
-                title: '当前虚存',
+                title: '门诊虚存',
+                align: "center",
+                valign: 'middle',
+                width: 50,
+                visible: isMultiple==1?false:true
+            }, {
+                field: 'stockAmountVirtual2',
+                title: '住院虚存',
                 align: "center",
                 valign: 'middle',
                 width: 50,
@@ -559,8 +530,14 @@ function initTable(classCode) {
             }
         ],
         rowStyle: function (row, index) {
-            if (isMultiple == 0 && row.visibleFlagMz == 1 && row.visibleFlagZy == 1) {
-                return { css: { 'background-color': 'red' } };
+            if (isMultiple == 0) {
+                if(row.visibleFlagMz == 1 && row.visibleFlagZy == 1){
+                    return { css: { 'background-color': 'red' } };
+                }else if(row.visibleFlagMz == 1){
+                    return { css: { 'background-color': '#00aeef' } };
+                }else if(row.visibleFlagZy == 1){
+                    return { css: { 'background-color': 'cadetblue' } };
+                }
             }
             return {css:{}}
         },

+ 1 - 1
src/main/resources/static/js/yf/yf_special_mark.js

@@ -81,7 +81,7 @@ function initTable() {
         cellEdit: true,
         cellsubmit: "remote",
         cellurl: '/thmz/modifYpSpecialMark',
-        colNames: ['门诊停用','住院停用','库存为零','处方限制天数','月限购量','编码','序号', '药品名','厂家', '库存量', '大规格(汇总)', '规格', '虚存2','启用虚存2', '3天用量', '7天用量', '14天用量','30天用量','货位号','药性分类'],
+        colNames: ['门诊停用','住院停用','库存为零','处方限制天数','月限购量','编码','序号', '药品名','厂家', '库存量', '大规格(汇总)', '规格', '住院虚存','启用住院虚存', '3天用量', '7天用量', '14天用量','30天用量','货位号','药性分类'],
         colModel: [
             {name: 'visibleFlagMz', index: 'visibleFlagMz',align:'center',width:100,formatter : "checkbox",editable : true,edittype:'checkbox', editoptions:{value:"1:0"}},
             {name: 'visibleFlagZy', index: 'visibleFlagZy',align:'center',width:100,formatter : "checkbox",editable : true,edittype:'checkbox', editoptions:{value:"1:0"}},

+ 1 - 0
src/main/resources/templates/yf/yf_inventory_list.html

@@ -66,6 +66,7 @@
                 </div>
             </div>
             <div class="col-md-10 col-sm-10 col-xs-12">
+                <div id="toolbar"><span style="color: #00aeef"> ▉ </span>门诊停用<span style="color: cadetblue"> ▉ </span>住院停用<span style="color: red"> ▉ </span>门诊住院停用</div>
                 <table id="tb_table" class="table text-nowrap"></table>
             </div>
         </div>