hsh 3 місяців тому
батько
коміт
d89349d280

+ 19 - 24
src/main/java/cn/hnthyy/thmz/mapper/his/yp/YpOutDetlYfMapper.java

@@ -123,37 +123,32 @@ public interface YpOutDetlYfMapper {
             "  a.draw_no," +
             "  a.group_no," +
             "  a.out_date," +
-            "  location=isnull(c.location,'')," +
-            "  rtrim(a.charge_code)charge_code," +
+            "  c.location," +
+            "  rtrim(a.charge_code) as charge_code," +
             "  a.serial," +
             "  b.name," +
-            "  specification=b.specification," +
-            "  pack_retprice=a.pack_retprice," +
+            "  b.specification as specification," +
+            "  a.pack_retprice as pack_retprice," +
             "  a.stock_amount," +
             "  a.confirm_id," +
             "  a.input_id," +
             "  a.confirm_date," +
-            "  buy_price = case when isnull(a.buy_price,0)=0 then b.buy_price else a.buy_price end," +
-            "  curr_stock_amount=a.stock_amount-a.out_amt," +
-            "  profit_lossprofit_loss=-a.out_amt," +
-            "  profit_lossprofit_money=-a.out_amt*a.pack_retprice," +
-            "  py_code=b.py_code," +
+            "  case when isnull(a.buy_price,0)=0 then b.buy_price else a.buy_price end as buy_price," +
+            "  a.stock_amount-a.out_amt as curr_stock_amount," +
+            "  -a.out_amt as profit_lossprofit_loss," +
+            "  -a.out_amt*a.pack_retprice as profit_lossprofit_money," +
+            "  b.py_code," +
             "  b.drug_kind," +
-            "  kind_name=k.name," +
-            "  manufactory_name=m.name" +
-            " from yp_out_detl_yf a WITH(NOLOCK)," +
-            "yp_zd_dict b WITH(NOLOCK) left join yp_zd_manufactory m WITH(NOLOCK) on b.manu_code = m.code" +
-            ",yp_base_yf c WITH(NOLOCK) ,yp_zd_drug_kind k WITH(NOLOCK) " +
-            " where" +
-            "    a.draw_no= #{drawNo} and" +
-            "    a.charge_code = b.code and" +
-            "    a.serial= b.serial and" +
-            "    a.charge_code = c.charge_code and" +
-            "    a.serial= c.serial and" +
-            "    a.group_no = c.group_no and" +
-            "    b.drug_kind = k.code and" +
-            "    out_type>=6 and" +
-            "    out_type<=8 order by b.drug_kind asc,c.location asc" )
+            "  k.name as kind_name," +
+            "  m.name as manufactory_name" +
+            " from yp_out_detl_yf a WITH(NOLOCK) " +
+            " inner join yp_zd_dict b WITH(NOLOCK) on a.charge_code = b.code and a.serial= b.serial " +
+            " left join yp_zd_manufactory m WITH(NOLOCK) on b.manu_code = m.code" +
+            " inner join yp_base_yf c WITH(NOLOCK) on a.charge_code = c.charge_code and a.serial= c.serial and a.group_no = c.group_no " +
+            " inner join yp_zd_drug_kind k WITH(NOLOCK) on b.drug_kind = k.code " +
+            " where a.draw_no= #{drawNo} " +
+            " and a.out_type between 6 and 8 " +
+            " order by b.drug_kind, c.location " )
     List<YpBaseYfVo> selectYpInventoryPrintData(@Param("drawNo") String drawNo);
 
     /**

+ 4 - 3
src/main/resources/static/js/yf/yf_inventory.js

@@ -402,8 +402,9 @@ function getTbAddRecordPrintData(drawNo) {
                         xj_ykzje = ykje;
                         kindName = data.kindName;
                     }
+                    let ln = (data && data.location === null) ? '' : data.location
                     html += '<tr class="sjh">';
-                    html += '<td class="xtd" style="text-align: center;">' + data.location + '</td>';
+                    html += '<td class="xtd" style="text-align: center;">' + ln + '</td>';
                     html += '<td class="xtd" style="text-align: center;">&nbsp;' + data.chargeCode + '</td>';
                     html += '<td style="text-align: left;">' + data.name + '</td>';
                     html += '<td style="text-align: left;">' + data.specification + '</td>';
@@ -472,8 +473,8 @@ function getRePortRangeArr() {
 function print() {
     setDefaultPrint();
     LODOP = getLodop();
-    LODOP.PRINT_INITA(6, 0, "210mm", "297mm", "药房精麻药品发放统计表");
-    LODOP.SET_PRINT_PAGESIZE(2, 0, 0,"A4");
+    LODOP.PRINT_INITA(6, 0, "210mm", "297mm", "长沙泰和医院药品盘点表");
+    LODOP.SET_PRINT_PAGESIZE(2, "210mm", "297mm","A4");
     //设置默认打印机
     LODOP.SET_PRINTER_INDEX(defaultPrintIndex);
     LODOP.SET_PRINT_STYLE("FontSize", 10); //字体大小

+ 2 - 2
src/main/resources/templates/yf/yf_inventory.html

@@ -54,10 +54,10 @@
                                 title="审核"><i class="fa fa-check-square-o">审核</i>
                         </button>
                         <button type="button" id="btn_print" class="btn btn-primary"
-                                title="打印"><i class="fa fa-print"></i>
+                                title="打印"><i class="fa fa-print">打印</i>
                         </button>
                         <a id="btn_search_excel" class="btn btn-primary"
-                                title="导出Excel"><i class="fa fa-file-excel-o"></i>
+                                title="导出Excel"><i class="fa fa-file-excel-o">导出Excel</i>
                         </a>
                     </div>
                     <div class="form-group" ID="addDiv">