Prechádzať zdrojové kódy

add:物料库存标签

liujiayin 3 rokov pred
rodič
commit
29ba59c3bb

+ 207 - 0
src/views/system/jbdScan/goods/kucuntag.vue

@@ -0,0 +1,207 @@
+<template>
+  <div class="bg">
+    <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" style="display: inline-block">
+              <div class="All">
+                <div class="tagBox">
+                  <p class="title">
+                    <img src="../../../../assets/images/login/logo.jpg" class="logoImg" />
+                    深圳市罗湖医院集团
+                  </p>
+                  <div class="lh">
+                    <div>物料名称:</div>
+                    <div>{{ item1.wu_liao_ming_chen ? item1.wu_liao_ming_chen : '-' }}</div>
+                  </div>
+                  <div class="lh">
+                    <div>物料编码:</div>
+                    <div>{{ item1.wu_liao_bian_ma_ ? item1.wu_liao_bian_ma_ : '-' }}</div>
+                  </div>
+                  <div class="la">
+                    <div class="lh">
+                      <div>货&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;号:</div>
+                      <div>{{ item1.huo_hao_ ? item1.huo_hao_ : '-' }}</div>
+                    </div>
+                    <div class="lh" style="margin-left: 10px">
+                      <div>批号:</div>
+                      <div>{{ item1.pi_hao_ ? item1.pi_hao_ : '-' }}</div>
+                    </div>
+                  </div>
+                  <div class="la">
+                    <div class="lh">
+                      <div>到库日期:</div>
+                      <div>{{ item1.create_time_ ? getData(item1.create_time_) : '-' }}</div>
+                    </div>
+                    <div class="lh" style="margin-left: 10px">
+                      <div>有效期:</div>
+                      <div>{{ item1.you_xiao_qi_ ? item1.you_xiao_qi_ : '-' }}</div>
+                    </div>
+                  </div>
+                  <div class="lh">
+                    <div>生产厂家:</div>
+                    <div>{{ item1.sheng_chan_chang_ ? item1.sheng_chan_chang_ : '-' }}</div>
+                  </div>
+                  <div class="lh">
+                    <div>储存条件:</div>
+                    <div>{{ item1.cun_chu_yao_qiu_ ? item1.cun_chu_yao_qiu_ : '-' }}</div>
+                  </div>
+                  <div class="ewm">
+                    <vue-barcode :value='item1.wu_liao_bian_ma_' :width="1" :height="15"></vue-barcode>
+                  </div>
+                </div>
+              </div>
+            </div>
+          </vue-easy-print>
+        </div>
+      </div>
+      <span slot="footer" class="dialog-footer">
+        <!-- <el-button @click="dialogVisible = false">取 消</el-button> -->
+        <el-button type="primary" @click="printDemo">打印标签</el-button>
+      </span>
+    </el-dialog>
+
+
+  </div>
+</template>
+
+<script>
+import VueBarcode from 'vue-barcode';
+import vueEasyPrint from "vue-easy-print";
+import repostCurd from '@/business/platform/form/utils/custom/joinCURD.js';
+
+export default {
+  components: {
+    VueBarcode,
+    vueEasyPrint,
+  },
+  props: {
+    obj: {
+      default: [],
+      type: Array
+    },
+    onePageRow: {
+      type: Number,
+      default: 3
+    },
+    blankLines: {
+      type: Boolean,
+      default: true
+    },
+    scanVisible: {
+      type: Boolean,
+      default: false
+    }
+  },
+  data() {
+    return {
+      value: '',
+      id: '',
+      list: [{
+        wu_liao_ming_chen: '-',
+        wu_liao_bian_ma_: '-',
+        huo_hao_: '-',
+        pi_hao_: '-',
+        create_time_: '-',
+        you_xiao_qi_: '-',
+        sheng_chan_chang_: '-',
+        cun_chu_yao_qiu_: '-',
+        barcode: '-'
+      }],
+      visible: true
+    }
+  },
+  watch: {
+    obj() {
+      this.getInit()
+    }
+  },
+  created() {
+    this.getInit()
+  },
+  methods: {
+    printDemo() {
+      this.$refs.easyPrint.print()
+    },
+    getInit() {
+      var idStr = '';
+      this.obj.forEach(item => {
+        idStr += item + ','
+      })
+      idStr = idStr.substring(0, idStr.length - 1);
+      this.getLook(idStr)
+    },
+    getLook(id) {
+      let sql = `select * from t_cgysjlb where wai_jian_ in (${id})`
+      repostCurd("sql", sql).then(res => {
+        if (res.state === 200) {
+          this.list = res.variables.data
+        }
+      })
+    },
+    getData(n) {
+      let now = new Date(n),
+        y = now.getFullYear(),
+        m = now.getMonth() + 1,
+        d = now.getDate();
+      return y + "-" + (m < 10 ? "0" + m : m) + "-" + (d < 10 ? "0" + d : d)
+    }
+  }
+}
+</script>
+
+<style lang="less" scoped>
+.bg {
+  // height: auto;
+}
+
+.title {
+  font-size: 16px;
+  color: #01a39e;
+  margin: 0;
+  margin-bottom: 10px;
+}
+
+/deep/ .logoImg {
+  width: 25px;
+  height: 25px;
+  position: relative;
+  top: 6px;
+}
+
+.tagBox {
+  width: 240px; // 300  240
+  height: 140px; // 180  150
+  position: relative;
+  border: 1px solid #000000;
+  padding: 2px;
+  display: inline-block;
+  margin: 10px 5px;
+  border-radius: 4px;
+  background-color: #fff;
+}
+
+.ewm {
+  display: flex;
+  justify-content: center;
+}
+
+.la {
+  display: flex;
+  align-items: center;
+}
+
+.lh {
+  font-size: 4px; //16
+  display: flex;
+  align-items: center;
+}
+
+/deep/ .tagBox {
+  width: auto;
+  height: auto;
+  padding: 0px 10px 1px 10px;
+}
+</style>

+ 16 - 18
src/views/system/jbdScan/scan.vue

@@ -1,16 +1,12 @@
 <template>
   <div>
-    {{currentScan}}
-    <component
-    :is="currentScan"
-    :scanVisible="scanVisible"
-    :obj = "obj"
-    @scanOff = "scanOff"/>
+    {{ currentScan }}
+    <component :is="currentScan" :scanVisible="scanVisible" :obj="obj" @scanOff="scanOff" />
   </div>
 </template>
 
 <script>
-  /* 共同调用类, 与脚本统一调用。*/
+/* 共同调用类, 与脚本统一调用。*/
 import facility from './goods/facility'
 import material from './goods/material'
 import sample from './goods/sample'
@@ -23,21 +19,23 @@ import deviceFailureTag from './goods/deviceFailureTag.vue'
 import neishenzhuangtai from './goods/neishenzhuangtai'
 import bwTag from './goods/bwTag.vue'
 import fzrkTag from './goods/fzrkTag.vue'
+import kucuntag from './goods/kucuntag.vue'
+
 export default {
-  components: { 
-    facility,material,sample,sampleConfirmation,manualConfirmation,tag,
-    deviceTag,deviceVerificationTag,deviceFailureTag,
-    neishenzhuangtai,bwTag,fzrkTag
+  components: {
+    facility, material, sample, sampleConfirmation, manualConfirmation, tag,
+    deviceTag, deviceVerificationTag, deviceFailureTag,
+    neishenzhuangtai, bwTag, fzrkTag, kucuntag
   },
-  props:{
-    currentScan:String,
-    scanVisible:Boolean,
-    obj:Array,
+  props: {
+    currentScan: String,
+    scanVisible: Boolean,
+    obj: Array,
   },
 
-  methods:{
-    scanOff(val){
-       this.$emit('scanOff',val)
+  methods: {
+    scanOff(val) {
+      this.$emit('scanOff', val)
     }
   },
 }