瀏覽代碼

特殊标志维护增加月限购量维护,药品检索优化

WANGJIALIANG 2 年之前
父節點
當前提交
c6469910c1

+ 8 - 4
src/main/java/cn/hnthyy/thmz/controller/yf/YfSpecialMarkController.java

@@ -44,12 +44,12 @@ public class YfSpecialMarkController {
     /**
      * 药房特殊标志维护信息
      * @param groupNo
-     * @param searchText
+     * @param chargeCode
      * @return
      */
     @UserLoginToken
     @RequestMapping(value = "/getYpSpecialMark",method = {RequestMethod.GET,RequestMethod.POST})
-    public Map<String,Object> getYpSpecialMark(@RequestParam(value = "groupNo") String groupNo,@RequestParam(value = "searchText") String searchText){
+    public Map<String,Object> getYpSpecialMark(@RequestParam(value = "groupNo") String groupNo,@RequestParam(value = "chargeCode") String chargeCode){
         Map<String, Object> resultMap = new HashMap<>();
         try {
             if (StringUtils.isBlank(groupNo)) {
@@ -57,11 +57,11 @@ public class YfSpecialMarkController {
                 resultMap.put("message", "查询药房特殊标志维护信息失败,药房编码为空");
                 return resultMap;
             }
-            if (StringUtils.isBlank(searchText)) {
+            if (StringUtils.isBlank(chargeCode)) {
                 resultMap.put("code", 0);
                 return resultMap;
             }
-            List<YpZdBaseYfSpecialVo> ypZdBaseYfSpecialVos = yfSpecialMarkService.queryYpSpecialMark(groupNo, searchText.toUpperCase());
+            List<YpZdBaseYfSpecialVo> ypZdBaseYfSpecialVos = yfSpecialMarkService.queryYpSpecialMark(groupNo, chargeCode);
             ypZdBaseYfSpecialVos.forEach(ypZdBaseYfSpecialVo ->{
                 if(StringUtils.isNotBlank(ypZdBaseYfSpecialVo.getClassCode())){
                     List<YpZdClass> ypZdClasses = ypZdClassService.queryYpZdClassesByCode(ypZdBaseYfSpecialVo.getClassCode());
@@ -115,7 +115,11 @@ public class YfSpecialMarkController {
             if(null == ypBaseYfVo.getPrescriptionLimitDays() || ypBaseYfVo.getPrescriptionLimitDays() == 0){
                 ypBaseYfVo.setPrescriptionLimitDays(null);
             }
+            if(null == ypBaseYfVo.getMzRestrict() || ypBaseYfVo.getMzRestrict() == 0){
+                ypBaseYfVo.setMzRestrict(null);
+            }
             ypZdDictService.modifyYpZdDictPrescriptionLimitDays(ypBaseYfVo.getPrescriptionLimitDays(),ypBaseYfVo.getChargeCode());
+            ypZdDictService.modifyYpZdDictMzRestrict(ypBaseYfVo.getMzRestrict(),ypBaseYfVo.getChargeCode());
             YpBaseYf ypBaseYf = new YpBaseYf();
             BeanUtils.copyProperties(ypBaseYfVo,ypBaseYf);
             int i = ypBaseYfService.modifyYpBaseYf(ypBaseYf);

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

@@ -104,7 +104,8 @@ public interface YpZdDictMapper {
             "                a.manu_code," +
             "                a.del_flag," +
             "                a.class_code," +
-            "                a.prescription_limit_days" +
+            "                a.prescription_limit_days," +
+            "                a.mz_restrict" +
             " FROM yp_zd_dict a WITH(NOLOCK) ,yp_print_name b WITH(NOLOCK) , yp_base c WITH(NOLOCK) " +
             " where" +
             "  (b.py_code like '%${searchTextDrug}%' or a.py_code like '%${searchTextDrug}%' or" +
@@ -156,6 +157,16 @@ public interface YpZdDictMapper {
     @Update("update yp_zd_dict set prescription_limit_days=#{prescriptionLimitDays} where code = #{code}")
     int updateYpZdDictPrescriptionLimitDays(@Param("prescriptionLimitDays") Integer prescriptionLimitDays, @Param("code") String code);
 
+    /**
+     * 更新药品门诊月限购量
+     *
+     * @param mzRestrict
+     * @param code
+     * @return
+     */
+    @Update("update yp_zd_dict set mz_restrict=#{mzRestrict} where code = #{code}")
+    int updateYpZdDictMzRestrict(@Param("mzRestrict") Integer mzRestrict, @Param("code") String code);
+
     /**
      * 更新药品信息
      *

+ 9 - 0
src/main/java/cn/hnthyy/thmz/service/his/yp/YpZdDictService.java

@@ -48,6 +48,15 @@ public interface YpZdDictService {
      */
     int modifyYpZdDictPrescriptionLimitDays(Integer prescriptionLimitDays,String code);
 
+    /**
+     * 更新门诊药品月限购量
+     *
+     * @param mzRestrict
+     * @param code
+     * @return
+     */
+    int modifyYpZdDictMzRestrict(Integer mzRestrict,String code);
+
     /**
      * 查询大规格药品信息
      * @param searchText

+ 3 - 2
src/main/java/cn/hnthyy/thmz/service/impl/his/yf/YfSpecialMarkServiceImpl.java

@@ -47,9 +47,9 @@ public class YfSpecialMarkServiceImpl implements YfSpecialMarkService {
     YpMzFytjMapper ypMzFytjMapper;
 
     @Override
-    public List<YpZdBaseYfSpecialVo> queryYpSpecialMark(String groupNo, String searchText) {
+    public List<YpZdBaseYfSpecialVo> queryYpSpecialMark(String groupNo, String chargeCode) {
         List<YpZdBaseYfSpecialVo> ypZdBaseYfSpecialVos = new ArrayList<>();
-        List<YpZdDict> ypZdDicts = ypZdDictMapper.selectYpBySearchText(searchText);
+        List<YpZdDict> ypZdDicts = ypZdDictMapper.selectYpZdDictByCode(chargeCode);
         for (int j = 0; j < ypZdDicts.size(); j++) {
             YpZdDict ypZdDict = ypZdDicts.get(j);
             YpZdBaseYfSpecialVo ypZdBaseYfSpecialVo = new YpZdBaseYfSpecialVo();
@@ -61,6 +61,7 @@ public class YfSpecialMarkServiceImpl implements YfSpecialMarkService {
                 ypZdBaseYfSpecialVo.setName(ypZdDict.getName());
                 ypZdBaseYfSpecialVo.setClassCode(ypZdDict.getClassCode());
                 ypZdBaseYfSpecialVo.setSpecification(ypZdDict.getSpecification());
+                ypZdBaseYfSpecialVo.setMzRestrict(ypZdDict.getMzRestrict());
                 ypZdBaseYfSpecialVo.setVisibleFlagMz(ypBaseYf.getVisibleFlagMz());
                 ypZdBaseYfSpecialVo.setVisibleFlagZy(ypBaseYf.getVisibleFlagZy());
                 ypZdBaseYfSpecialVo.setStockAmount(ypBaseYf.getStockAmount());

+ 5 - 0
src/main/java/cn/hnthyy/thmz/service/impl/his/yp/YpZdDictServiceImpl.java

@@ -88,6 +88,11 @@ public class YpZdDictServiceImpl implements YpZdDictService {
         return ypZdDictMapper.updateYpZdDictPrescriptionLimitDays(prescriptionLimitDays, code);
     }
 
+    @Override
+    public int modifyYpZdDictMzRestrict(Integer mzRestrict, String code) {
+        return ypZdDictMapper.updateYpZdDictMzRestrict(mzRestrict, code);
+    }
+
     @Override
     public List<YpZdDictVo> queryYpZdDictByLike(String searchText, String groupNo) {
         List<YpZdDict> ypZdDicts = ypZdDictMapper.selectYpZdDictByLike(searchText);

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

@@ -84,4 +84,6 @@ public class YpBaseYfVo {
     private String confirmId;
     //处方限制天数
     private Integer prescriptionLimitDays;
+    //门诊月限购量
+    private Integer mzRestrict;
 }

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

@@ -55,4 +55,6 @@ public class YpZdBaseYfSpecialVo {
     private Integer thirtyDayDosage;
     //处方限制天数
     private Integer prescriptionLimitDays;
+    //门诊月限购量
+    private Integer mzRestrict;
 }

+ 50 - 3
src/main/resources/static/js/yf/yf_special_mark.js

@@ -16,6 +16,39 @@ $(function () {
     $('#searchText').on('blur',function(e){
         loadTbTable();
     });
+
+    //初始化药品查询弹出框
+    initSearchList('<div id="medicinePopoverContent"><table id="tb_table_medicine"></table></div>',
+        'drugSearchText', 600, 200);
+    $('#drugSearchText').on('input focus',function(e){
+        showDrugPopover({
+            url: '/thmz/getYpBaseYfLike',
+            data:{
+                groupNo: pharmacyGroupNo,
+                searchText: $("#drugSearchText").val() == "" ? null : $("#drugSearchText").val(),
+            },
+            columns: [{
+                field: 'stockAmount',
+                title: '药房库存',
+                align: "center",
+                valign: 'middle',
+                formatter: function (value, row, index) {
+                    return value<=0?'<span style="color: red">'+value+'</span>':value;
+                }
+            }],
+            onClickRow: function (row, $element) {
+                $('#drugSearchText').webuiPopover('hide');
+                $('#drugSearchText').val(row.name);
+                $('#chargeCode').val(row.code);
+                loadTbTable();
+            }
+        });
+    });
+    $('#drugSearchText').on('change', function (e) {
+        if (isEmpty($('#drugSearchText').val())) {
+            $('#chargeCode').val('');
+        }
+    });
 });
 
 
@@ -48,7 +81,7 @@ function initTable() {
         cellEdit: true,
         cellsubmit: "remote",
         cellurl: '/thmz/modifYpSpecialMark',
-        colNames: ['门诊停用','住院停用','库存为零','处方限制天数','编码','序号', '药品名','厂家', '库存量', '大规格(汇总)', '规格', '虚存2','启用虚存2', '3天用量', '7天用量', '14天用量','30天用量','货位号','药性分类'],
+        colNames: ['门诊停用','住院停用','库存为零','处方限制天数','月限购量','编码','序号', '药品名','厂家', '库存量', '大规格(汇总)', '规格', '虚存2','启用虚存2', '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"}},
@@ -56,12 +89,18 @@ function initTable() {
             {name: 'prescriptionLimitDays', index: 'prescriptionLimitDays',width:100,align:'center',editable : true,edittype:'text'
                 ,editrules: {edithidden:false,number:true,minValue:0}
             },
+            {name: 'mzRestrict', index: 'mzRestrict',width:100,align:'center',editable : true,edittype:'text'
+                ,editrules: {edithidden:false,number:true,minValue:0}
+            },
             {name: 'chargeCode', index: 'chargeCode',align:'center',width:100},
             {name: 'serial', index: 'serial',align:'center',width:100,hidden:true},
             {name: 'name', index: 'name',width:180},
             {name: 'manufactoryName', index: 'manufactoryName',width:180},
             {name: 'stockAmount', index: 'stockAmount',align:'center',width:100},
-            {name: 'stockAmountLarge', index: 'stockAmountLarge',align:'center',width:100},
+            {name: 'stockAmountLarge', index: 'stockAmountLarge',align:'center',width:100,
+                formatter: function (cellvalue, options, rowObject) {
+                    return keepTwoDecimal(cellvalue)
+                }},
             {name: 'specification', index: 'specification',align:'center',width:100},
             {name: 'stockAmountVirtual2', index: 'stockAmountVirtual2',width:100,align:'center',editable : true,edittype:'text'
                 ,editrules: {edithidden:true,number:true,minValue:0}
@@ -89,6 +128,14 @@ function initTable() {
             if(cellname !== 'prescriptionLimitDays'){
                 temp.prescriptionLimitDays = record.prescriptionLimitDays;
             }
+            if(cellname === 'mzRestrict' && value == 0){
+                if (!confirm("确定放开当前药品的月限购量吗?")) {
+                    return;
+                }
+            }
+            if(cellname !== 'mzRestrict'){
+                temp.mzRestrict = record.mzRestrict;
+            }
             temp.chargeCode = record.chargeCode;
             temp.serial = record.serial;
             temp.groupNo = pharmacyGroupNo;
@@ -117,7 +164,7 @@ function initTable() {
 function loadTbTable() {
     $("#tb_table").jqGrid('setGridParam', {
         datatype:'json',
-        postData: { searchText: $("#searchText").val(), groupNo: pharmacyGroupNo }
+        postData: { chargeCode: $("#chargeCode").val(), groupNo: pharmacyGroupNo }
     }).trigger('reloadGrid');
 }
 

+ 6 - 2
src/main/resources/templates/yf/yf_special_mark.html

@@ -2,12 +2,15 @@
 <link rel="stylesheet" href="/thmz/css/bootstrap/css/bootstrap-select.css"/>
 <link rel="stylesheet" href="/thmz/css/jqGrid/ui.jqgrid-bootstrap.css">
 <link rel="stylesheet" href="/thmz/css/toll_administration.css">
+<link rel="stylesheet" href="/thmz/css/jquery.webui-popover.min.css">
 <link rel="stylesheet" href="/thmz/css/bootstrap/css/bootstrap-datetimepicker.min.css">
 <script src="/thmz/js/dependent/bootstrap-datetimepicker.min.js"></script>
 <script src="/thmz/js/dependent/bootstrap-datetimepicker.zh-CN.js"></script>
 <script src="/thmz/js/dependent/bootstrap-select.js"></script>
 <script src="/thmz/js/jqGrid/grid.locale-cn.js"></script>
 <script src="/thmz/js/jqGrid/jquery.jqGrid.min.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/yf_special_mark.js"></script>
 <title>药房特殊标志维护</title>
 <div class="row" style="height: calc(100% - 60px);overflow-y: auto;">
@@ -15,10 +18,11 @@
         <div class="x_panel" style="background: #EBEBE4;">
             <div class="panel-body">
                 <form id="formSearch" class="form-horizontal" autocomplete="off" onsubmit="return false;">
-                    <label class="control-label col-md-1 col-sm-1 col-xs-12" for="searchText">药品
+                    <input id="chargeCode" class="form-control optional" type="hidden">
+                    <label class="control-label col-md-1 col-sm-1 col-xs-12" for="drugSearchText">药品
                     </label>
                     <div class="col-md-2 col-sm-2 col-xs-12">
-                        <input id="searchText" class="form-control optional" type="text">
+                        <input id="drugSearchText" class="form-control optional" type="text">
                     </div>
                     <div class="form-group">
                         <button type="button" id="btn_search" class="btn btn-primary"