ZZJ 3 лет назад
Родитель
Сommit
7adb3ac5a0

+ 25 - 2
src/business/platform/form/formrender/index.vue

@@ -61,6 +61,14 @@
                 ref="customComponent"
                 v-bind="customComponentAtts"
             />
+             <!-- 标签打印弹窗 -->
+             <Scan
+                currentScan = "sampleTag"
+                v-if="scanVisible"
+                :scanVisible = "scanVisible"
+                :obj = "scanList"
+                @scanOff = "closeScan"
+            />
         </ibps-watermark>
     </div>
 </template>
@@ -71,6 +79,7 @@
     import DynamicForm from './dynamic-form/dynamic-form'
     import IbpsWatermark from '@/components/ibps-watermark'
     import panle from '@/components/jbd-panel'
+    import Scan from '@/views/system/jbdScan/scan.vue'
 
     const JFormId = 'JForm'
 
@@ -78,7 +87,8 @@
         components: {
             DynamicForm,
             panle,
-            IbpsWatermark
+            IbpsWatermark,
+            Scan
         },
         props: {
             isDialog: {
@@ -146,7 +156,10 @@
                 number: 0,
                 // 个性定制
                 customComponent: null,
-                customComponentAtts: {}
+                customComponentAtts: {},
+                // 标签弹窗
+                scanVisible: false,
+                scanList: []
             }
         },
         computed: {
@@ -555,6 +568,16 @@
             // 更新store
             updateStore(action, data) {
                 this.$store.dispatch(action, data)
+            },
+            scanHandlerObj(list){
+                this.scanList = list
+                this.scanVisible = true
+            },
+            closeScan(){
+              this.scanVisible = false
+              // this.$emit("update:scanVisible",this.scanVisible)
+              this.$emit("close")
+              console.log(111)
             }
         }
     }

+ 36 - 7
src/views/system/jbdScan/goods/sampleTag.vue

@@ -3,7 +3,7 @@
     <el-dialog 
       width="21cm"
       height="10cm" 
-       :modal-append-to-body='false' title="样品标签" :visible.sync="scanVisible">
+       :modal-append-to-body='true' :append-to-body="true" title="样品标签" :visible.sync="scanVisible">
       <!-- 表单是否显示 -->
       <div style="height:500px">
           <div ref="qrcode" id="box">
@@ -25,7 +25,7 @@
                       <div>样本编号:</div>
                       <div>{{ item1.serial }}</div>
                     </div>
-                    <div class="lh" style="margin-left: 18px">
+                    <div class="lh" style="margin-left: 8px">
                     <div>样品数量:</div>
                     <div>{{ index2 + 1 }}/{{ item1.num }}支</div>
                   </div>
@@ -113,7 +113,8 @@ export default {
         num: 5
         // condition: 5
       }],
-      visible: true
+      visible: true,
+      sampleShuLiangList:[]
     }
   },
   watch: {
@@ -130,14 +131,42 @@ export default {
       this.$refs.easyPrint.print()
     },
     getInit() {
-      console.log('getInit:',this.obj)
+      // console.log('getInit:',this.obj)
+      this.sampleShuLiangList = []
       var idStr = '';
       this.obj.forEach(item=>{
-        idStr += item + ','
+        idStr += item.split(" ")[0] + ','
+        this.sampleShuLiangList.push(parseInt(item.split(" ")[1]))
       })
       idStr = idStr.substring(0,idStr.length-1);
-      console.log(idStr)
-      this.getLook(idStr)
+      this.getLooks(idStr,this.sampleShuLiangList)
+
+    },
+    getLooks(id,list) {
+      console.log(id)
+      console.log(list)
+      let sql = `select * from t_mjypb where find_in_set(id_,'${id}')`
+      // console.log(sql)
+      repostCurd("sql", sql).then(res => {
+          const data = res.variables.data
+          let list = []
+          data.forEach((item,index) => {
+            // let num = parseInt(item.shou_yang_shu_lia)
+            let num = this.sampleShuLiangList[index]
+            // console.log(num)
+            if(typeof(num) == 'number'){
+                let o = {
+                  name: item.yang_pin_ming_che,
+                  serial: item.yang_pin_bian_hao,
+                  // type: item.jian_ce_xiang_mu_,
+                  num: num,
+                  // condition: item.yang_ben_yun_shu_
+                }
+                list.push(o)
+            }
+          })
+          this.list = list
+      })
     },
     getLook(id) {
       // console.log(id)

+ 3 - 1
src/views/system/jbdScan/scan.vue

@@ -5,7 +5,9 @@
     :is="currentScan"
     :scanVisible="scanVisible"
     :obj = "obj"
-    @scanOff = "scanOff"/>
+    @scanOff = "scanOff"
+    @close   = "scanVisible=false"
+    />
   </div>
 </template>