Explorar o código

fix: 打印模版报错

zh %!s(int64=2) %!d(string=hai) anos
pai
achega
47ad59aac9

+ 13 - 10
src/mixin/print.js

@@ -102,16 +102,19 @@ export default {
         panelData = panel2
         this.dataLength = 4
       }
-      // eslint-disable-next-line no-undef
-      hiprint.PrintElementTypeManager.buildByHtml($('.ep-draggable-item'))
-      this.hiprintTemplate = new hiprint.PrintTemplate({
-        template: panelData,
-        settingContainer: '#PrintElementOptionSetting',
-        paginationContainer: '.hiprint-printPagination'
-      })
-      this.hiprintTemplate.design('#hiprint-printTemplate')
-      // 获取当前放大比例, 当zoom时传true 才会有
-      // this.scaleValue = hiprintTemplate.editingPanel.scale || 1;
+  
+        // eslint-disable-next-line no-undef
+        hiprint.PrintElementTypeManager.buildByHtml($('.ep-draggable-item'))
+        this.hiprintTemplate = new hiprint.PrintTemplate({
+          template: panelData,
+          settingContainer: '#PrintElementOptionSetting',
+          paginationContainer: '.hiprint-printPagination'
+        })
+        // this.hiprintTemplate.design('#hiprint-printTemplate')
+        // 获取当前放大比例, 当zoom时传true 才会有
+        // this.scaleValue = hiprintTemplate.editingPanel.scale || 1;
+  
+     
     },
     /**
      * 获取需要打印数据详情

+ 2 - 0
src/views/finance/components/design/preview.vue

@@ -68,7 +68,9 @@ export default {
       this.hiprintTemplate.print()
       setTimeout(() => {
         this.hideModal()
+        this.$emit('refreshList')
       }, 2000)
+
     }
     // toPdf() {
     //   downloadPDF(this.$refs.printDom);

+ 2 - 2
src/views/finance/receipt_list.vue

@@ -18,7 +18,7 @@
     <div class="app-container" v-else>
       <ReceiptListDetail :detailId="detailId" />
     </div>
-         <print-preview ref="preView" @initPrint="handleInitPrint" @refreshList="handleRefreshList" :addPrint="addPrint"/>
+         <print-preview ref="preView" @initPrint="handleInitPrint" @refreshList="handleRefreshList" />
 
   </div>
 </template>
@@ -408,7 +408,7 @@ export default {
             </table>
           </div>
           <div style="margin:100px 0 0 0">
-            <div>打印</div>
+            <div></div>
           </div>
        </div>
       `

+ 1 - 1
src/views/finance/receivable_list.vue

@@ -15,7 +15,7 @@
       <ReceivableListApproval :approvalId="approvalId" v-if="showPage == 3" @close="handleClose" />
       <ReceivableListDetail :approvalId="approvalId" :czType="czType" v-if="showPage == 4" @close="handleClose" />
     </Popu>
-    <print-preview ref="preView" @initPrint="handleInitPrint" @refreshList="handleRefreshList" :addPrint="addPrint" />
+    <print-preview ref="preView" @initPrint="handleInitPrint" @refreshList="handleRefreshList"  />
   </template-page>
 </template>
 

+ 6 - 9
src/views/supply/deliver/components/deliver_detail.vue

@@ -269,9 +269,7 @@
         </div>
       </div>
     </div>
-         <print-preview ref="preView" @initPrint="handleInitPrint" @refreshList="handleRefreshList" :addPrint="addPrint"/>
-
-
+    <print-preview ref="preView" @initPrint="handleInitPrint" @refreshList="handleRefreshList" :addPrint="addPrint" />
     <!-- <CommonPrint :printId="printId" :printType="printType" v-if="isShowPrint" @backDetail="backDetail" /> -->
   </div>
 </template>
@@ -365,16 +363,15 @@ export default {
     backDetail() {
       this.printId = ''
       this.isShowPrint = false
-    } ,
-    handleRefreshList(){
+    },
+    handleRefreshList() {
       // this.recordSelected = []
       // this.$refs.pageRef.refreshList()
-
     },
-    handleInitPrint(){
+    handleInitPrint() {
       this.$nextTick(() => {
-      this.initPrint()
-    })
+        this.initPrint()
+      })
     }
   }
 }