<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>
|