ZZJ 3 anni fa
parent
commit
69b430a444
1 ha cambiato i file con 48 aggiunte e 13 eliminazioni
  1. 48 13
      src/views/system/jbdScan/goods/tag.vue

+ 48 - 13
src/views/system/jbdScan/goods/tag.vue

@@ -1,14 +1,20 @@
 <template>
   <div class="bg">
-    <el-dialog width="30%"  :modal-append-to-body='false' title="样品标签" :visible.sync="scanVisible">
+    <el-dialog 
+      width="21cm"
+      height="10cm" 
+       :modal-append-to-body='false' title="样品标签" :visible.sync="scanVisible">
       <!-- 表单是否显示 -->
       <div style="height:500px">
           <div ref="qrcode" id="box">
           <vue-easy-print tableShow ref="easyPrint"
             :onePageRow="onePageRow"
           >
-            <div v-for="(item1, index1) in list" :key="index1"  >
-              <div v-for="(item2, index2) in parseInt(item1.num)" :key="index2" style="page-break-after:always">
+            <div v-for="(item1, index1) in list" :key="index1"  style="display: inline-block" >
+              <div v-for="(item2, index2) in parseInt(item1.num)" :key="index2" 
+              style="display: inline-block"
+              ><!-- style="page-break-after:always" -->
+               <div class="All">
                 <div class="tagBox">
                   <div class="lh">
                     <div>样品名称:</div>
@@ -19,8 +25,8 @@
                       <div>样品编号:</div>
                       <div>{{ item1.serial }}</div>
                     </div>
-                    <div class="lh" style="margin-left: 15px">
-                      <div>收样时间</div>
+                    <div class="lh" style="margin-left: 5px">
+                      <div>收样时间:</div>
                       <div></div>
                     </div>
                   </div>
@@ -41,10 +47,17 @@
                     <div>样品数量:</div>
                     <div>{{ index2 + 1 }}/{{ item1.num }}支</div>
                   </div>
-                  <div>
-                    <vue-barcode :value="item1.serial" :width="2" :height="40"></vue-barcode>
+                  <div class="ewm">
+                    <vue-barcode :value="item1.serial" :width="1" :height="15" ></vue-barcode>
                   </div>
+
+                  <!-- <div
+                    style="page-break-after: always; display: block !important;height: 40px"
+                  ></div> -->
+
+
                 </div>
+               </div>
               </div>
             </div>
           </vue-easy-print>
@@ -90,7 +103,6 @@ export default {
   },
   data() {
     return {
-      onePageRow: 1,
       value: '',
       id: '',
       list: [{
@@ -103,6 +115,12 @@ export default {
       visible: true
     }
   },
+  watch: {
+    obj() {
+      this.getInit()
+      // console.log(this.obj)
+    }
+  },
   created() {
     this.getInit()
   },
@@ -111,7 +129,6 @@ export default {
       this.$refs.easyPrint.print()
     },
     getInit() {
-      // console.log(this.obj)
       var idStr = '';
       this.obj.forEach(item=>{
         idStr += item + ','
@@ -182,13 +199,30 @@ export default {
 
 <style lang="scss" scoped>
 .bg {
-
   // height: auto;
 }
 
 .tagBox {
-  width: 300px;
-  height: 180px;
+  width: 240px;   // 300  240
+  height: 140px;  // 180  150
+  position: relative;
+  border: 1px solid #000000;
+  padding: 2px;
+  display: inline-block;
+  // justify-content: space-around;
+  // flex-direction: column;
+  margin: 10px 5px;
+  border-radius: 4px;
+  background-color: #fff;
+}
+.ewm{
+
+}
+/*
+.tagBox {
+  width: 177.5px;   // 300  240
+  height: 106.5px;  // 180  150
+  position: relative;
   border: 1px solid #000000;
   padding: 20px;
   display: flex;
@@ -198,6 +232,7 @@ export default {
   border-radius: 15px;
   background-color: #fff;
 }
+*/
 
 .la {
   display: flex;
@@ -206,7 +241,7 @@ export default {
 
 .lh {
   // line-height: auto;
-  font-size: 16px;
+  font-size: 4px;  //16
   display: flex;
   align-items: center;