zhouwx
2024-08-13 0daf7e406663eb3a99c2122773f5c3297b8c1253
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
<template>
  <div class="notice">
    <el-dialog
        v-model="dialogVisible"
        width="400px"
        :before-close="handleClose"
        :close-on-press-escape="false"
        :close-on-click-modal="false"
    >
      <el-card style="max-width: 480px">
        <div style="display: flex;flex-direction: column;align-items: center;font-size: 20px;font-weight: 600">
          <span>{{title}}</span>
          <vue-qr :size="150" :margin="0" :auto-color="true" :dot-scale="1" :text="state.form.code" style="margin: 10px 0 10px 0"></vue-qr>
          <span>{{state.form.code}}</span>
        </div>
      </el-card>
    </el-dialog>
  </div>
</template>
<script setup>
import {reactive, ref, toRefs} from 'vue'
import {ElMessage} from "element-plus";
import VueQr from "vue-qr/src/packages/vue-qr.vue";
 
const dialogVisible = ref(false);
const title = ref("");
const busRef = ref();
const length = ref()
const emit = defineEmits(["getList"]);
 
const state = reactive({
})
 
 
const openDialog = async (type,value) => {
  if(type == 'pro'){
    title.value = value.productBasic.name + ' ' + '—' + ' '+ value.productBasic.productSn
  }else {
    title.value = value.hazmatBasic.name + ' ' + '—' + ' '+ value.hazmatBasic.productSn
  }
 
  state.form = value;
  dialogVisible.value = true;
}
const handleClose = () => {
  dialogVisible.value = false;
  emit("getList")
}
defineExpose({
  openDialog
});
 
</script>
 
<style scoped lang="scss">
.notice{
  :deep(.el-form .el-form-item__label) {
    font-size: 15px;
  }
  .file {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
  }
}
</style>