浏览代码

盘点打印预览

lilei 2 年之前
父节点
当前提交
fe35957032

+ 9 - 5
src/libs/JGPrint.js

@@ -136,7 +136,7 @@ export const jGPrint = function (data, type, callback, printLogParams,printPageS
     }
 }
 // 浏览器打印pdf功能
-export const winPrintPdf = function(data,taskName,callback){
+export const winPrintPdf = function(data,type,callback){
   if (!data) {
     return
   }
@@ -145,8 +145,12 @@ export const winPrintPdf = function(data,taskName,callback){
   window.frames['printfbod'].onload = function(){
     callback()
   }
-  window.frames['printfbod'].focus()
-  window.frames['printfbod'].print()
+  if(type == 'orginPrint'){
+    window.frames['printfbod'].focus()
+    window.frames['printfbod'].print()
+  }else{
+    window.open(url)
+  }
 }
 // 打印
 export const printFun = function(url,params,type,taskName,callback,printLogParams,hidePrint){
@@ -164,8 +168,8 @@ export const printFun = function(url,params,type,taskName,callback,printLogParam
     } else {
        console.log(res,'printFun')
        // 使用浏览器自带打印功能
-       if(type == 'orginPrint'){
-         winPrintPdf(res,taskName,callback)
+       if(type == 'orginPrint'||type=='orginPreview'){
+         winPrintPdf(res,type,callback)
        }else{
          jGPrintPdf(res,type,taskName,printLogParams,callback,hidePrint)
        }

+ 1 - 0
src/views/inventoryManagement/makeInventory/check.vue

@@ -15,6 +15,7 @@
             class="button-info"
             id="makeInventoryCheck-print-btn"
             :disabled="list.length==0"
+            :loading="spinningPrint"
             v-if="$hasPermissions('B_inventoryMakeInventoryPrint')"
             @click="handlePdPrint">盘点打印</a-button>
         </template></a-page-header>

+ 1 - 0
src/views/inventoryManagement/makeInventory/printModal.vue

@@ -29,6 +29,7 @@
       </a-form-model>
       <div class="btn-cont">
         <a-button id="sales-print-back" @click="handleCancel">取消</a-button>
+        <a-button type="primary" class="button-info" id="sales-print-orginPreview" @click="handleSave('orginPreview')" style="margin-left: 10px;">打印预览</a-button>
         <a-button type="primary" id="sales-print-save" @click="handleSave('orginPrint')" style="margin-left: 10px;">立即打印</a-button>
       </div>
     </a-spin>

+ 1 - 0
src/views/inventoryManagement/supervisionDisk/check.vue

@@ -15,6 +15,7 @@
             class="button-info"
             id="supervisionDiskCheck-print-btn"
             :disabled="list.length==0"
+            :loading="spinningPrint"
             v-if="$hasPermissions('B_supervisionDiskPrint')"
             @click="handlePdPrint">监盘打印</a-button>
         </template></a-page-header>