Browse Source

面损表打印

jbb 2 years ago
parent
commit
b08ae56862
1 changed files with 20 additions and 14 deletions
  1. 20 14
      src/views/reportForms/fabric-loss-table.vue

+ 20 - 14
src/views/reportForms/fabric-loss-table.vue

@@ -1,11 +1,12 @@
 <template>
   <!-- 面料损耗表 -->
   <div id="fabricLossTable" >
+    <div id="mmmm">
     <!-- 主要信息 点击搜索后 全部回显-->
     <a-card title="主要信息" >
       <a-row :gutter="24" >
         <div class="table-page-search-wrapper">
-          <a-form-model layout="inline" ref="form" :model="fabricLoss" :rules="validatorRules">
+          <a-form-model layout="inline" ref="form" :model="fabricLoss" :rules="validatorRules" class="kk">
             <a-col :md="6" :sm="8">
               <a-form-model-item label="计划单号">
                 <a-input-search
@@ -89,7 +90,8 @@
         </div>
       </a-row>
     </a-card>
-
+    </div>
+    <div id="cbn">
     <!-- 子表 -->
     <a-card style="margin:10px 0;">
       <div id="cbn">
@@ -333,7 +335,7 @@
       </div> -->
 
       <!-- 页面底部保存 -->
-      <a-row :gutter="24" style="marginTop:40px;float:right">
+      <a-row :gutter="24" style="marginTop:40px;float:right" class="noprint">
         <a-col :md="12" :sm="12" style="display:flex">
           <a-button type="primary" @click="daYin" style="margin-right:6px">
             打印
@@ -378,6 +380,7 @@
       </div>
     </a-card>
   </div>
+  </div>
 </template>
 
 <script>
@@ -719,19 +722,22 @@ export default {
 	        //  gridStyle:'border:2px solid #3971A5;text-align: center',
 	        //  gridHeaderStyle:'color:red; border:2px solid #3971A5;'
 	    //  })
-       const html = window.document.getElementById('cbn').innerHTML
+       const html = window.document.getElementById('fabricLossTable').innerHTML
          const win = window.open();
          const style = '<style>\n'
-       + 'table{width: 100%;border-collapse: collapse;border-spacing: 0;overflow-x:hidden;}\n'
-        + 'th,td{width: 5%;height: 18px;padding:11px;border: 1px solid #999;font-size: 12px;color: #666;max-width:2000px}\n'
-    + 'th{color: #333}\n'
-    + 'a{color: #666; text-decoration:none;}\n'
-    + 'tr[empty-template] td{text-align: center}\n'
-+ '</style>';
-  win.document.write(style+html);
-  win.focus();
-  win.print();
-  win.close();
+         +'.noprint{display:none}'
+         +'.ant-table-body{overflow-x: hidden !important }' //去除滚动条
+         +'.kk{display:flex}' //主要信息并排
+         + 'table{width: 100%;border-collapse: collapse;border-spacing: 0;overflow-x:hidden;}\n'
+         + 'th,td{width: 5%;height: 18px;padding:11px;border: 1px solid #999;font-size: 12px;color: #666;max-width:2000px}\n'
+         + 'th{color: #333}\n'
+         + 'a{color: #666; text-decoration:none;}\n'
+         + 'tr[empty-template] td{text-align: center}\n'
+         + '</style>';
+         win.document.write(style+html);
+         win.focus();
+         win.print();
+         win.close();
     },
     // 【计划单号】 搜索
     onSearch(value,update) {