gjy 2 years ago
parent
commit
16c1779ee4

+ 15 - 2
public/static/aduitprint.html

@@ -89,14 +89,27 @@
     .sfcard-content .image {
         background-repeat: no-repeat;
         background-size:contain;
-        width:100vw;
-        height:100vh;
+        /* width:100vw;
+        height:100vh; */
         /* transform-origin: center center;
         transform: rotate(180deg); */
     }
+    .image { page : rotated }
     @media print {
+      @page rotated{
+        size: landscape;
+        orientation:landscape;
+      }
     .image{ page-break-inside:avoid;}
+    .sfcard-content .image {
+        background-repeat: no-repeat;
+        background-size:contain;
+        width:160vw;
+        height:100vh;
+        /* transform-origin: center center;
+        transform: rotate(90deg); */
     }
+   }
 </style>
 <body>
     <div id="app">

+ 18 - 1
src/views/universalityAudit/auditprint.vue

@@ -185,7 +185,7 @@ export default {
                   this.deptBudgetList[m].num=num.toFixed(2)
                 }
                 var workflow=await printworkflow({businessCode:this.multipleSelection[m].businessCode,tmpCompId:localStorage.getItem('ws-pf_compId')}).toPromise()
-                this.deptBudgetList[0].aduitInfo=await printgethis({workflowId:workflow[0].id,businessKey:this.multipleSelection[m].id,branch:this.deptBudgetList[m].jointVentureParties?this.deptBudgetList[m].jointVentureParties:'zt'}).toPromise()
+                this.deptBudgetList[m].aduitInfo=await printgethis({workflowId:workflow[0].id,businessKey:this.multipleSelection[m].id,branch:this.deptBudgetList[m].jointVentureParties?this.deptBudgetList[m].jointVentureParties:'zt'}).toPromise()
                 for (let i = 0; i < this.deptBudgetList[m].aduitInfo.length; i++) {
                     var arr=this.deptBudgetList[m].aduitInfo[i]
                     if(arr.workflowHistoricTasks&&arr.workflowHistoricTasks.length>0){
@@ -324,6 +324,20 @@ export default {
       localStorage.setItem('aduitprintdata',JSON.stringify(this.deptBudgetList))
         window.open('../../../static/aduitprint.html')
     },
+    getImageSize(url) {
+    return new Promise((resolve) => {
+      const img = new Image()
+      img.src = url
+      if (img.complete) {
+        // 如果图片被缓存,则直接返回缓存数据
+        resolve({ width: img.width, height: img.height })
+      } else {
+        img.onload = () => {
+          resolve({ width: img.width, height: img.height })
+        }
+      }
+    })
+  },
     async printItem(row){
         if(row.type=='费用审核'||row.type=='运费结算'){
             this.deptBudgetList=[await lookexenseinfo({id:row.id}).toPromise()]
@@ -498,6 +512,9 @@ export default {
     imagefilter(arr){
         var arr1=[]
         for (let i = 0; i < arr.length; i++) {
+          // var value=await this.getImageSize(arr[i].appendixPath)
+          // arr[i].width=value.width
+          // arr[i].height=value.height
             if(arr[i].appendixName.indexOf('jpg')!=-1||arr[i].appendixName.indexOf('jpeg')!=-1||arr[i].appendixName.indexOf('png')!=-1){
                     arr1.push(arr[i])
             }

+ 15 - 15
src/views/universalityAudit/component/routers/route.js

@@ -28,21 +28,21 @@ const profitableRouter = {
           // module: 'procurement.sparepart.applDetail'
         }
       }, 
-      // {
-      //   path: 'auditprint',
-      //   component: () =>
-      //     import(/* webpackChunkName: "applDetail" */ '@/views/universalityAudit/auditprint'),
-      //   name: 'auditprint',
-      //   meta: {
-      //     title: 'auditprint',
-      //     shortcutEntrance: 'profitable',
-      //     module: 'generalAudit',
-      //     permissicon: [],
-      //     keepAlive: true,
-      //     _title:'审核流打印'
-      //     // module: 'procurement.sparepart.applDetail'
-      //   }
-      // }, 
+      {
+        path: 'auditprint',
+        component: () =>
+          import(/* webpackChunkName: "applDetail" */ '@/views/universalityAudit/auditprint'),
+        name: 'auditprint',
+        meta: {
+          title: 'auditprint',
+          shortcutEntrance: 'profitable',
+          module: 'generalAudit',
+          permissicon: [],
+          keepAlive: true,
+          _title:'审核流打印'
+          // module: 'procurement.sparepart.applDetail'
+        }
+      }, 
     
   ],