| | |
| | | <template> |
| | | <div> |
| | | <el-dialog :visible.sync="isShow" title="标签打印" top="5vh" width="600px" @close="$emit('closePrintDialog')"> |
| | | <el-dialog :visible.sync="isShow" title="标签打印" top="5vh" width="800px" @close="$emit('closePrintDialog')"> |
| | | <div style="width:100%;height: 400px;overflow-y: auto;text-align: left"> |
| | | <div class="dia_body"> |
| | | <el-checkbox |
| | |
| | | <div> |
| | | <div class="titleH1" style="text-align: center;margin-bottom: 1px">检测中心样品标识卡</div> |
| | | <div style="text-align: center;"> |
| | | <barcode :displayValue="false" :height="22" :value="item.barcode" :width="1.6"></barcode> |
| | | <barcode :displayValue="false" :height="30" :value="item.barcode" :width="1.5"></barcode> |
| | | </div> |
| | | <div style="margin-left: 12px;text-align: left"> |
| | | <div class="item"> |
| | |
| | | <script> |
| | | import PrintJS from "print-js"; |
| | | import {labelOrderPrinting} from "@/api/business/productOrder"; |
| | | import {stringToBase64} from '@/utils/base64Util' |
| | | |
| | | export default { |
| | | name: "printDialog", |
| | |
| | | res.data.forEach(item => { |
| | | item.sendTime = item.sendTime && item.sendTime.substring(0, 10) |
| | | item.sampleNumber = item.qtyArrived + item.buyUnitMeas |
| | | this.$set(item, 'barcode', item.entrustCode) |
| | | this.$set(item, 'barcode', item.entrustCode+","+stringToBase64(item.partColor)) |
| | | this.$set(item, 'isLeave', item.insState === '2') |
| | | }) |
| | | this.barcodeData = res.data |
| | |
| | | targetStyles: ["*"], // 使用dom的所有样式,很重要 |
| | | printable: 'printOrder',//页面 |
| | | type: "html",//文档类型 |
| | | maxWidth: 360, |
| | | maxWidth: 440, |
| | | header: '', |
| | | style: |
| | | `@page { |
| | |
| | | margin-top: 0.4cm; |
| | | margin-bottom: 0.4cm; |
| | | padding-bottom: 0px; |
| | | size: 400px 75px collapse; |
| | | size: 440px 75px collapse; |
| | | } |
| | | html{ |
| | | zoom:100%; |
| | | |
| | | } |
| | | @media print{ |
| | | width: 400px; |
| | | width: 440px; |
| | | height: 75px; |
| | | margin:0; |
| | | }`, |