Sfoglia il codice sorgente

入库增加打印,科室出库调整

WANGJIALIANG 2 anni fa
parent
commit
6e45975a5e

+ 6 - 2
src/main/resources/static/js/yf/drug_delivery_dept.js

@@ -352,6 +352,9 @@ function initDetailed() {
         jsonReader: {
             root: "data", repeatitems: false
         },
+        onCellSelect: function (rowid, iCol, cellcontent, e) {
+            selectRowId = rowid;
+        },
         loadComplete: function (res) { //加载完成(初始加载),回调函数
             if (res == '401' || res == 401) {
                 window.location.href = '/thmz/login/view';
@@ -362,13 +365,14 @@ function initDetailed() {
             }
         }
     });
+    $("#t_tb_table_detailed").append("<button class='registration-no-color-foot-button' title='删除药品' id='remove'  style='color: red;margin-left: 10px;'><i class='fa fa-trash-o'></i></button>");
     $("#t_tb_table_detailed").append("<input id='drugName' name='drugName' type='text' style='margin-left: 10px;' placeholder='添加药品...'>");
-    //$("#t_tb_table_detailed").append("<button class='registration-no-color-foot-button' title='删除药品' id='remove'  style='color: red;margin-left: 10px;'><i class='fa fa-trash-o'></i></button>");
     $("#remove").on('click', function () {
         if (selectRowId == null) {
-            return errorMesageSimaple('请选择一行进行删除!');
+            return warningMesageSimaple('请选择一行进行删除!');
         }
         $("#tb_table_detailed").jqGrid("delRowData", selectRowId);
+        selectRowId = null;
     });
 }
 

+ 82 - 0
src/main/resources/static/js/yk/drug_storage.js

@@ -187,6 +187,9 @@ $(function () {
             successMesage(res);
         });
     });
+    $("#btn_daily").click(function (t) {
+        setPrintHtml();
+    });
 });
 
 /**
@@ -566,6 +569,14 @@ function initDetailed() {
         $("#div_bar_code").hide();
         $("#manuNo").attr("disabled",false);
         $("#confirmFlag").val()==1?$("#addDetailed").attr("disabled",true):$("#addDetailed").attr("disabled",false);
+        let rowData = $("#tb_table_detailed").jqGrid("getRowData")[0];
+        if(rowData){
+            $("#reptNo").val(rowData['reptNo']);
+            $("#reptDate").val(rowData['reptDate']);
+        }else{
+            $("#reptNo").val(null);
+            $("#reptDate").val(null);
+        }
     });
     $("#removeDetailed").on('click', function () {
         if($("#confirmFlag").val() == 1){
@@ -722,3 +733,74 @@ function initBar() {
         autoBar(e.delegateTarget.value)
     },500));
 }
+
+
+/**
+ * 生产报表数据
+ */
+function setPrintHtml() {
+    let date = {inDocuNo: $("#inDocuNoLabel").val()};
+    request({
+        url: '/getYpInDetlDetailed',
+        method: 'GET',
+        data: date
+    }).then((res) => {
+        console.log(res);
+        let html = '';
+        let packRetpriceSum = 0;
+        let buyPriceSum = 0;
+        $('.sjh').remove();
+        for (let i = 0; i < res['data'].length; i++) {
+            let data = res['data'][i];
+            let packRetprice = keepTwoDecimal(parseFloat(data['stockAmount']) * parseFloat(data['packRetprice']));
+            let buyPrice = keepTwoDecimal(parseFloat(data['stockAmount']) * parseFloat(data['buyPrice']));
+            packRetpriceSum += packRetprice;
+            buyPriceSum += buyPrice;
+            if (i === 0) {
+                $(".printDate").html(format(new Date(), "yyyy-MM-dd HH:mm"));
+                $(".supplyName").html(data['supplyName']);
+                $(".inDocuNo").html(data['inDocuNo']);
+                $(".confirmDate").html(format(data['confirmDate'], "yyyy-MM-dd HH:mm"));
+                $(".lister").html($(".current_user")[0].innerText);
+                $(".listerAudit").html(data['confirmName']);
+            }
+            html += '<tr class="sjh">';
+            html += '<td class="xtd" style="text-align: center;">' + data['chargeCode'] + '</td>';
+            html += '<td class="xtd" style="text-align: left;">' + data['drugName'] + '</td>';
+            html += '<td class="xtd" style="text-align: left;">' + data['specification'] + '</td>';
+            html += '<td class="xtd" style="text-align: center;">' + data['stockAmount'] + '</td>';
+            html += '<td class="xtd" style="text-align: center;">' + data['buyPrice'] + '</td>';
+            html += '<td class="xtd" style="text-align: center;">' + data['packRetprice'] + '</td>';
+            html += '<td class="xtd" style="text-align: center;">' + buyPrice + '</td>';
+            html += '<td class="xtd" style="text-align: center;">' + packRetprice + '</td>';
+            html += '<td class="xtd" style="text-align: center;">' + data['manuNo'] + '</td>';
+            html += '<td class="xtd" style="text-align: left;">' + data['manufactoryName'] + '</td>';
+            html += '<td class="xtd" style="text-align: center;">' + format(data['effDate'], "yyyy-MM-dd") + '</td>';
+            html += '</tr>';
+        }
+        $("#base_tr").after(html);
+        $(".packRetpriceSum").html(keepTwoDecimal(packRetpriceSum));
+        $(".buyPriceSum").html(keepTwoDecimal(buyPriceSum));
+        $(".balance").html(keepTwoDecimal(Math.abs(packRetpriceSum-buyPriceSum)));
+        print();
+    });
+}
+
+/**
+ * 打印报表
+ */
+function print() {
+    setDefaultPrint();
+    LODOP = getLodop();
+    LODOP.PRINT_INITA(6, 0, "221mm", "93mm", "入库单打印");
+    LODOP.SET_PRINT_PAGESIZE(1, "221mm", "93mm", "");
+    //设置默认打印机
+    LODOP.SET_PRINTER_INDEX(defaultPrintIndex);
+    LODOP.SET_PRINT_STYLE("FontSize", 11); //字体大小
+    LODOP.SET_PRINT_STYLEA(0, "ItemType", 2);
+    var strStyle = "<style>table,td,th {border-width: 1px;padding-bottom:0px;" +
+        "border-style: solid;border-collapse: collapse;table-layout:fixed;word-wrap:break-word;font-size: 13}.xtd{border: 1px solid black;}</style>";
+    LODOP.ADD_PRINT_HTM("0mm", "0mm", "RightMargin:0mm", "BottomMargin:0mm", strStyle + document.getElementById("report_table_1").innerHTML);
+    LODOP.PRINT();
+    //LODOP.PREVIEW();
+}

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

@@ -52,6 +52,7 @@
                                 id="outType1Search">
                             <option value="0" selected>出库</option>
                             <option value="1">报损</option>
+                            <option value="2">退库</option>
                         </select>
                     </div>
                     <div class="col-md-3 col-sm-3 col-xs-12">

+ 80 - 1
src/main/resources/templates/yk/drug_storage.html

@@ -11,6 +11,7 @@
 <script src="/thmz/js/dependent/jquery.webui-popover.min.js"></script>
 <script src="/thmz/js/common/pharmacy-com.js"></script>
 <script src="/thmz/js/yk/drug_storage.js"></script>
+<script src="/thmz/js/dependent/LodopFuncs.js"></script>
 <title>药品入库</title>
 <div class="row" style="height: calc(100% - 60px);overflow-y: auto;">
     <div class="col-md-12 col-sm-12 col-xs-12">
@@ -47,6 +48,9 @@
                         <button type="button" style="margin-left:3px" id="btn_audit" class="btn btn-primary"
                                 title="审核"><i class="fa fa-check-square-o"></i>
                         </button>
+                        <button type="button" id="btn_daily" class="btn btn-primary"
+                                title="打印"><i class="fa fa-print"></i>
+                        </button>
                         <button type="button"  id="btn_clean" class="btn btn-primary"
                                 title="重置"><i class="fa fa-rotate-left"></i>
                         </button>
@@ -56,6 +60,78 @@
                     </div>
                 </div>
             </form>
+            <div id="report_table"
+                 style="width:1030px;height: calc(100% - 160px);margin:0 auto;border: 1px solid #337ab7;font-size: 14px;padding: 40px 10px 40px 10px;overflow: scroll;display: none">
+                <div id="report_table_1">
+                    <table id="qbtj_table" class="table table-striped"
+                           style="margin-top: 0px;border: transparent !important;">
+                        <tr style="font-weight: 700;background-color: #EBEBE4;height: 70px;">
+                            <td colspan="11" style="font-size: 21px;text-align: center;border: transparent !important;">
+                                <span class="title">长沙泰和医院药品入库单</span></td>
+                        </tr>
+                        <tr style="font-weight: 700;background-color: #EBEBE4">
+                            <td colspan="3" style="text-align: left;border: transparent !important;">供应商:<span
+                                    class="supplyName"></span></td>
+                            <td colspan="3" style="text-align: left;border: transparent !important;">入库单号:<span
+                                    class="inDocuNo"></span></td>
+                            <td colspan="3" style="text-align: left;border: transparent !important;">入库日期:<span
+                                    class="confirmDate"></span></td>
+                            <td colspan="2" class="xtd" style="text-align: center;border: transparent !important;">打印日期:<span
+                                    class="printDate"></span></td>
+                        </tr>
+                        <tr id="base_tr">
+                            <td class="xtd" style="text-align: center;width: 50px;">编码</td>
+                            <td class="xtd" style="text-align: center;width: 120px;">药品名称</td>
+                            <td class="xtd" style="text-align: center;width: 100px;">规格</td>
+                            <td class="xtd" style="text-align: center;width: 50px;">购入量</td>
+                            <td class="xtd" style="text-align: center;width: 50px;">购入价</td>
+                            <td class="xtd" style="text-align: center;width: 50px;">零售价</td>
+                            <td class="xtd" style="text-align: center;width: 50px;">购入金额</td>
+                            <td class="xtd" style="text-align: center;width: 50px;">零售金额</td>
+                            <td class="xtd" style="text-align: center;width: 60px;">生产批号</td>
+                            <td class="xtd" style="text-align: center;width: 120px;">生产厂家</td>
+                            <td class="xtd" style="text-align: center;width: 80px;">有效期</td>
+                        </tr>
+                        <tr style="border: transparent !important;"></tr>
+                        <tr>
+                            <td class="xtd"
+                                style="text-align: right;border: transparent !important;font-weight: bold;">合计:
+                            </td>
+                            <td colspan="1" class="xtd"
+                                style="text-align: left;border: transparent !important;font-weight: bold;">购入总额:<span
+                                    class="buyPriceSum"></span></td>
+                            <td colspan="2" class="xtd"
+                                style="text-align: left;border: transparent !important;font-weight: bold;">零售总额:<span
+                                    class="packRetpriceSum"></span></td>
+                            <td colspan="2" class="xtd"
+                                style="text-align: left;border: transparent !important;font-weight: bold;">购销差:<span
+                                    class="balance"></span></td>
+                            <td colspan="2" class="xtd" style="text-align: left;border: transparent !important;">
+                                质量情况:合格
+                            </td>
+                            <td colspan="3" class="xtd" style="text-align: right;border: transparent !important;font-weight: bold;">
+                                结算价格以医院采购合同为准
+                            </td>
+                        </tr>
+                        <tr style="border: transparent !important;"></tr>
+                        <tr>
+                            <td colspan="2" class="xtd" style="text-align: left;border: transparent !important;">药品会计:
+                            </td>
+                            <td colspan="1" class="xtd" style="text-align: left;border: transparent !important;">
+                                采购员:
+                            </td>
+                            <td colspan="2" class="xtd" style="text-align: left;border: transparent !important;">收货人:
+                            </td>
+                            <td colspan="2" class="xtd" style="text-align: left;border: transparent !important;">主管:
+                            </td>
+                            <td colspan="2" class="xtd" style="text-align: left;border: transparent !important;">
+                                制表人:<span class="lister"></span></td>
+                            <td colspan="3" class="xtd" style="text-align: left;border: transparent !important;">
+                                验收人:<span class="listerAudit"></span></td>
+                        </tr>
+                    </table>
+                </div>
+            </div>
             <table id="tb_table_detailed"></table>
         </div>
     </div>
@@ -248,4 +324,7 @@
         </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>