laiguoran преди 4 години
родител
ревизия
23dd8954a0
променени са 2 файла, в които са добавени 10 реда и са изтрити 3 реда
  1. 9 2
      app/public/report/js/rpt_archive.js
  2. 1 1
      app/view/report/index_archive.ejs

+ 9 - 2
app/public/report/js/rpt_archive.js

@@ -389,11 +389,18 @@ function download(url, filename) {
 
 $(function () {
     $('#download_file').click(function () {
-        console.log(rptArchiveObj.currentArchiveUuid);
         if (rptArchiveObj.currentArchiveUuid) {
             download(`https://measure-sign-pdf.oss-cn-shenzhen.aliyuncs.com/archive/${rptArchiveObj.currentArchiveUuid}.PDF`, `${rptArchiveObj.currentNode.name} ${rptArchiveObj.currentArchiveDateStr}.pdf`);
         } else {
             alert('请选择打开一个报表!');
         }
-    })
+    });
+
+    $('#print_file').click(function () {
+        if (rptArchiveObj.currentArchiveUuid) {
+            $('#iframe_made iframe')[0].contentWindow.print();
+        } else {
+            alert('请选择打开一个报表!');
+        }
+    });
 })

+ 1 - 1
app/view/report/index_archive.ejs

@@ -40,7 +40,7 @@
                             <div class="panel">
                                 <div class="panel-body" id="print_div">
                                     <div class="btn-group" role="group">
-                                        <button class="btn btn-outline-primary btn-sm" type="button">
+                                        <button class="btn btn-outline-primary btn-sm" type="button" id="print_file">
                                             <i class="fa fa-print"></i><br>
                                             打印
                                             <!--<span class="badge badge-primary">0</span>-->