parent
							
								
									33a0db5dbd
								
							
						
					
					
						commit
						9d0f2c35a9
					
				| @ -0,0 +1,139 @@ | |||||||
|  | <template> | ||||||
|  |   <div ref="_printRef" class="print" style="width:756px;"> | ||||||
|  |     <div v-for="(map,index) in data" :key="index" :style="{width:'100%',marginTop:(index+1)%2===0?'40px':'0px'}"> | ||||||
|  |       <div style="width: 100%;position: relative"> | ||||||
|  |         <div style="width: 100%;text-align: center;line-height: 40px;font-size: 20px;font-weight: bold">大连船舶重工集团钢加有限公司</div> | ||||||
|  |         <div style="width: 100%;text-align: center;line-height: 30px;font-size: 16px;font-weight: bold">配送交接单</div> | ||||||
|  |         <div style="line-height: 20px">编号: {{ map.bh }}</div> | ||||||
|  |         <div class="table-head"> | ||||||
|  |           <span style="width:4%;">序号</span> | ||||||
|  |           <span style="width:11%;">船号</span> | ||||||
|  |           <span style="width:9%;">批号</span> | ||||||
|  |           <span style="width:13%;">托盘表号</span> | ||||||
|  |           <span style="width:16%;">附件名称</span> | ||||||
|  |           <span style="width:23.5%;">图号/规格</span> | ||||||
|  |           <span style="width:7%;">材质</span> | ||||||
|  |           <span style="width:4%;">数量</span> | ||||||
|  |           <span style="width:10.1%;">入库地点</span> | ||||||
|  |         </div> | ||||||
|  |         <div class="table-content" v-for="(item,index) in map.list"> | ||||||
|  |           <span style="width:4%;text-align: center;">{{ item.jhxh }}</span> | ||||||
|  |           <span style="width:11%;text-align: center;">{{ item.czbh }}</span> | ||||||
|  |           <span style="width:9%;text-align: center;">{{ item.ph }}</span> | ||||||
|  |           <span style="width:13%;text-align: center;">{{ item.tpbh }}</span> | ||||||
|  |           <span style="width:16%;text-align: center;">{{ item.wpmc }}</span> | ||||||
|  |           <span style="width:23.5%;text-align: center;">{{ item.wpgg }}</span> | ||||||
|  |           <span style="width:7%;text-align: center;">{{ item.wpxh }}</span> | ||||||
|  |           <span style="width:4%;text-align: center;">{{ item.pssl }}</span> | ||||||
|  |           <span style="width:10.1%;text-align: center;">{{ item.ckh }}</span> | ||||||
|  |         </div> | ||||||
|  |         <div class="table-foot" style="border:1px solid"> | ||||||
|  |           <span colspan="3" style="text-align: left;padding-left: 15px;border-right: 0">交货人: {{ map.psry }}</span> | ||||||
|  |           <span colspan="3" style="text-align: right;margin-left: 100px"> | ||||||
|  |             <span style="margin-left: 25px">日 </span> | ||||||
|  |           </span> | ||||||
|  |           <span style="text-align: center"> 合计: </span> | ||||||
|  |           <span style="text-align: center"> {{ map.count }}</span> | ||||||
|  |         </div> | ||||||
|  |         <div style="font-size: 18px;margin-top: 2px"> | ||||||
|  |           <span style="margin-left: 5px">质检员:</span> | ||||||
|  |           <span style="margin-left: 30%">收货单位:</span> | ||||||
|  |           <span style="margin-left: 30%">收货人:</span> | ||||||
|  |         </div> | ||||||
|  |       </div> | ||||||
|  |       <div v-if="index>0&&((index+1)%2===0)" class="pageEnd"></div> | ||||||
|  |     </div> | ||||||
|  |   </div> | ||||||
|  | </template> | ||||||
|  | 
 | ||||||
|  | <script> | ||||||
|  | export default { | ||||||
|  |   name:'QfxqzxPrint', | ||||||
|  |   data(){ | ||||||
|  |     return { | ||||||
|  |       data:[], | ||||||
|  | 
 | ||||||
|  |     } | ||||||
|  |   }, | ||||||
|  |   methods:{ | ||||||
|  |     show(_data){ | ||||||
|  |       //手动按行换页计算 | ||||||
|  |       //每页行数 | ||||||
|  |       const pageSize=7; | ||||||
|  |       const tmpData=[] | ||||||
|  | 
 | ||||||
|  |       // for (const item of _data) { | ||||||
|  |       //   if (item.list.length>pageSize){ | ||||||
|  |       //     const _arr=this.sliceToPage(item.list,pageSize); | ||||||
|  |       //     for (const _item of _arr) { | ||||||
|  |       //       const tmpItem=JSON.parse(JSON.stringify(item)) | ||||||
|  |       //       tmpItem.list=_item | ||||||
|  |       //       const o=pageSize-_item.length | ||||||
|  |       //       for(let i=0;i<o;i++){ | ||||||
|  |       //         _item.push({}) | ||||||
|  |       //       } | ||||||
|  |       //       tmpData.push(tmpItem) | ||||||
|  |       //     } | ||||||
|  |       //   }else{ | ||||||
|  |       //     const o=pageSize-item.list.length | ||||||
|  |       //     for(let i=0;i<o;i++){ | ||||||
|  |       //       item.list.push({}) | ||||||
|  |       //     } | ||||||
|  |       //     tmpData.push(item) | ||||||
|  |       //   } | ||||||
|  |       // } | ||||||
|  |       tmpData.push({}) | ||||||
|  |       this.data=tmpData | ||||||
|  |       this.$emit('showPrintComp') | ||||||
|  |     }, | ||||||
|  |     sliceToPage(data,len){ | ||||||
|  |       let index=0,_newArr=[] | ||||||
|  |       while (index<data.length){ | ||||||
|  |         let size=len; | ||||||
|  |         if ((index+len)>=data.length){ | ||||||
|  |           size=data.length-index; | ||||||
|  |         } | ||||||
|  |         _newArr.push(data.slice(index, index += size)); | ||||||
|  |       } | ||||||
|  |       return _newArr; | ||||||
|  |     } | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | </script> | ||||||
|  | 
 | ||||||
|  | <style> | ||||||
|  | .table-head span{ | ||||||
|  |   font-size: 14px; | ||||||
|  |   text-align: center; | ||||||
|  |   display: inline-block; | ||||||
|  |   border: 1px solid; | ||||||
|  | } | ||||||
|  | .table-content span{ | ||||||
|  |   display: inline-block; | ||||||
|  |   font-size: 14px; | ||||||
|  |   text-align: center; | ||||||
|  |   border: 1px solid; | ||||||
|  |   height: 40px; | ||||||
|  |   vertical-align:middle; | ||||||
|  |   word-break: normal; | ||||||
|  |   white-space: pre-wrap; | ||||||
|  |   word-wrap: break-word; | ||||||
|  |   overflow-y: hidden; | ||||||
|  | } | ||||||
|  | .QRCode{ | ||||||
|  |   width:110px; | ||||||
|  |   position: absolute; | ||||||
|  |   left:610px; | ||||||
|  |   /*top:10px;*/ | ||||||
|  | } | ||||||
|  | 
 | ||||||
|  | @media print { | ||||||
|  |   .noPrint { | ||||||
|  |     display: none; | ||||||
|  |   } | ||||||
|  |   .pageEnd { | ||||||
|  |     page-break-after: always; | ||||||
|  |   } | ||||||
|  | } | ||||||
|  | </style> | ||||||
					Loading…
					
					
				
		Reference in new issue