<script setup>  
 | 
import { toRefs, ref, defineProps } from 'vue';  
 | 
import { globalState } from '@/config.js'  
 | 
import { formatMessage } from '@/utils/localeUtils';  
 | 
  
 | 
const props = defineProps({  
 | 
    list: {  
 | 
        type: Array,  
 | 
        default: []  
 | 
    },  
 | 
    repeatNum: {  
 | 
        type: Number,  
 | 
        default: 1  
 | 
    }  
 | 
});  
 | 
const { list, repeatNum } = toRefs(props)  
 | 
</script>  
 | 
  
 | 
<template>  
 | 
    <div id="printMe">  
 | 
        <div v-for="(item, index) in list" :key="index">  
 | 
            <div v-for="count in repeatNum" style="font-size: 16px;margin-top: 20px;">  
 | 
                <div>  
 | 
                    <table class="contain" width="280" style="overflow: hidden;font-size: xx-small;table-layout: fixed;">  
 | 
                        <tr style="height: 74px">  
 | 
                            <td align="center" scope="col" colspan="1">商品</td>  
 | 
                            <td align="center" scope="col" colspan="1" style="">{{ item.maktx }}</td>  
 | 
                            <td align="center" scope="col" colspan="2" rowspan="2">  
 | 
                                <img :src="globalState.url + '/api/code/auth?type=2¶m=' + item.matnr" width="80%;" />  
 | 
                                <div style="letter-spacing: 1px;margin-top: 1px; text-align: center">  
 | 
                                    <span>{{ item.matnr }}</span>  
 | 
                                </div>  
 | 
                            </td>  
 | 
                        </tr>  
 | 
                        <tr style="height: 74px">  
 | 
                            <td align="center" colspan="1">规格</td>  
 | 
                            <td align="center" colspan="1" style="text-overflow:ellipsis;">{{ item.specs }}</td>  
 | 
                        </tr>  
 | 
                    </table>  
 | 
                </div>  
 | 
            </div>  
 | 
        </div>  
 | 
    </div>  
 | 
</template>  
 | 
  
 | 
<style>  
 | 
@media print {  
 | 
    body {  
 | 
        margin: 0;  
 | 
        padding: 0;  
 | 
    }  
 | 
  
 | 
    .print-area {  
 | 
        margin: 0;  
 | 
        padding: 0;  
 | 
        height: auto;  
 | 
    }  
 | 
  
 | 
  
 | 
}  
 | 
  
 | 
.contain td {  
 | 
    border: 1px solid #000;  
 | 
}  
 | 
</style> 
 |