<script setup>
|
import {ref, toRaw} from 'vue';
|
import { formatMessage } from '@/utils/localeUtils';
|
import locTemplate from './locTemplate.vue';
|
|
const template = {
|
locTemplate
|
}
|
|
const printChild = ref(null);
|
const selectTemplate = ref('locTemplate');
|
let open = ref(false);
|
let printData = ref([]);
|
let repeatNum = ref(1);
|
let orderNo = ref('');
|
const handleOk = () => {
|
|
}
|
|
const printObj = ref({
|
id: "printOrder",
|
beforeOpenCallback(vue) {
|
// console.log(toRaw(printData.value))
|
},
|
openCallback(vue) {
|
console.log('执行了打印')
|
},
|
closeCallback(vue) {
|
console.log('关闭了打印工具')
|
},
|
|
});
|
|
defineExpose({
|
open,
|
orderNo,
|
printData
|
})
|
</script>
|
|
<template>
|
<a-modal v-model:open="open" :title="formatMessage('', '库位打印')" @ok="handleOk" :width="'60%'" v-if="open">
|
<div style="height: 500px;overflow-x: hidden;overflow-y: scroll;">
|
<div style="margin-top: 20px;">
|
<Component :is="template[selectTemplate]" ref="printChild" :list="printData" :repeatNum="repeatNum" />
|
</div>
|
</div>
|
<template #footer>
|
<a-button key="submit" type="primary" v-print="printObj" @click="handleOk">
|
{{ formatMessage('common.print', '打印') }}
|
</a-button>
|
</template>
|
</a-modal>
|
</template>
|
|
<style></style>
|