From 9969561611d9261c90728643d8a35287f79b57b9 Mon Sep 17 00:00:00 2001 From: licp <lichunping@guanfang.com.cn> Date: 星期四, 05 十二月 2024 14:47:01 +0800 Subject: [PATCH] 调整标签打印为二维码 --- src/components/view/b1-inspection-order.vue | 96 +++++++++++++++++++++++++++--------------------- 1 files changed, 54 insertions(+), 42 deletions(-) diff --git a/src/components/view/b1-inspection-order.vue b/src/components/view/b1-inspection-order.vue index 79b0741..3c82c0d 100644 --- a/src/components/view/b1-inspection-order.vue +++ b/src/components/view/b1-inspection-order.vue @@ -397,10 +397,27 @@ <el-card class="box-card" v-for="(item, i) in qrData" :key="i+'wwwww'" style="margin-bottom: 15px; font-size: 16px !important;"> <el-checkbox :label="i" :key="i" style="position: relative;top:-10px;left:5px"><br></el-checkbox> <div> - <p style="text-align: center;font-size: 18px;font-weight: 700;">{{ item.sample }}</p> - <barcode :value="item.sampleCode" :height="34" :width="2" :displayValue="false" style="display: flex;justify-content: center;width: 100%;"></barcode> - <div> - <div style="width: 100%;line-height: 30px;"> + <p style="text-align: center;font-size: 26px;font-weight: 700;">{{ item.sample }}锛坽{item.model}}锛�</p> + <p style="text-align: center;font-size: 16px;">{{ item.sampleCode }}</p> + <el-divider></el-divider> + <el-row style="font-size: 16px;"> + <el-col :span="16" style="text-align: left;line-height: 28px;"> + <p><span> 濮旀墭鍗曞彿: </span>{{ item.code }}</p> + <p><span> 鐢垫満缂栧彿: </span>{{ item.motorNumber }}</p> + <p><span> 鏍锋満瀹屾垚鏃堕棿: </span>{{ item.issueTime }}</p> + <p><span> 鏍锋満鍛�: </span>{{ item.issueName }}</p> + <p class="ellipsis-multiline"><span> 妫�娴嬮」鐩�: </span>{{ item.item }}</p> + </el-col> + <el-col :span="8" style="text-align: left;"> + <vueQr + :text="item.str" + :size="140" + :margin="2" + ></vueQr> + </el-col> + </el-row> + <!-- <div> + <div> <el-row style="font-size: 16px;"> <el-col :span="16" style="text-align: left;"><span> 鏍峰搧缂栧彿: </span>{{ item.sampleCode }}</el-col> <el-col :span="8" style="text-align: left;"><span> 瑙勬牸鍨嬪彿: </span>{{ item.model }}</el-col> @@ -417,7 +434,7 @@ <el-col style="text-align: left;"><span> 妫�娴嬮」鐩�: </span>{{ item.item }}</el-col> </el-row> </div> - </div> + </div> --> </div> </el-card> </el-checkbox-group> @@ -434,28 +451,27 @@ <div id="printMOrder" class="printMOrder" ref="printMOrder"> <el-card class="box-card" v-for="(item, i) in checkDataList" :key="i+'uuuuu'" style="font-size: 16px !important;page-break-after: always;color: #000;box-shadow: none;margin: 0 !important;padding: 0 !important;"> <div> - <p style="text-align: center;font-size: 18px;font-weight: 500;margin-top: 10px;">{{ item.sample }}</p> - <barcode :value="item.sampleCode" :height="34" :width="2" :displayValue="false" style="display: flex;justify-content: center;width: 100%;"></barcode> - <div> - <div style="width: 100%;line-height: 30px;"> - <el-row style="font-size: 16px;"> - <el-col :span="16" style="text-align: left;"><span>鏍峰搧缂栧彿: </span>{{ item.sampleCode }}</el-col> - <el-col :span="7" style="text-align: left;"><span>瑙勬牸鍨嬪彿: </span>{{ item.model }}</el-col> - </el-row> - <el-row style="margin-top: 1px;font-size: 16px;"> - <el-col :span="16" style="text-align: left;"><span>濮旀墭鍗曞彿: </span>{{ item.code }}</el-col> - <el-col :span="7" style="text-align: left;"><span>鐢垫満缂栧彿: </span>{{ item.motorNumber }}</el-col> - </el-row> - <el-row style="margin-top: 1px;font-size: 16px;"> - <el-col :span="16" style="text-align: left;"><span>鏍锋満瀹屾垚鏃堕棿: </span>{{ item.issueTime }}</el-col> - <el-col :span="7" style="text-align: left;"><span>鏍锋満鍛�: </span>{{ item.issueName }}</el-col> - </el-row> - <el-row style="margin-top: 1px;font-size: 16px;" class="ellipsis-multiline"> - <el-col style="text-align: left;"><span>妫�娴嬮」鐩�: </span>{{ item.item }}</el-col> - </el-row> - </div> + <p style="text-align: center;font-size: 26px;font-weight: 700;margin-top: 20px;">{{ item.sample }}锛坽{item.model}}锛�</p> + <p style="text-align: center;font-size: 16px;">{{ item.sampleCode }}</p> + <!-- <el-divider></el-divider> --> + <p style="width: 100%;height:1px;background-color: #333333;margin: 6px 0;"></p> + <el-row style="font-size: 16px;"> + <el-col :span="16" style="text-align: left;line-height: 28px;"> + <p><span> 濮旀墭鍗曞彿: </span>{{ item.code }}</p> + <p><span> 鐢垫満缂栧彿: </span>{{ item.motorNumber }}</p> + <p><span> 鏍锋満瀹屾垚鏃堕棿: </span>{{ item.issueTime }}</p> + <p><span> 鏍锋満鍛�: </span>{{ item.issueName }}</p> + <p class="ellipsis-multiline"><span> 妫�娴嬮」鐩�: </span>{{ item.item }}</p> + </el-col> + <el-col :span="8" style="text-align: left;"> + <vueQr + :text="item.str" + :size="140" + :margin="2" + ></vueQr> + </el-col> + </el-row> </div> - </div> </el-card> </div> </div> @@ -937,7 +953,13 @@ }) a.item = [...new Set(arr1)].join(',') }) - this.qrData = arr + this.qrData = arr.map(m=>{ + m.str = JSON.stringify({ + sampleCode:m.sampleCode, + entrustCode:m.code + }) + return m + }) // console.log(this.qrData) }) }, @@ -972,27 +994,17 @@ targetStyles: ["*"], // 浣跨敤dom鐨勬墍鏈夋牱寮忥紝寰堥噸瑕� printable: 'printMOrder',//椤甸潰 type: "html",//鏂囨。绫诲瀷 - maxWidth:720, - header: '', + documentTitle: "浜岀淮鐮�", style: `@page { - margin: 0.4cm; - margin-right: 0.4cm; - margin-top: 0.4cm; - margin-bottom: 0.4cm; - padding-bottom: 0px; - size: 800px 600px collapse; + margin: 0; + size: landscape; } - html{ + body{ zoom:100%; - - } - @media print{ - width: 800px; - height: 600px; + padding:30px 0; margin:0; }`, - font_size: '16px', }); }, async print(){ -- Gitblit v1.9.3