|
|
|
|
@ -56,6 +56,8 @@
|
|
|
|
|
:print-max-width="220"
|
|
|
|
|
:empty-text="t('EquipmentManagement.EquipmentLedger.qrcodeLoadError')"
|
|
|
|
|
:error-text="t('EquipmentManagement.EquipmentLedger.qrcodeLoadError')"
|
|
|
|
|
:template-json="detailTemplateJson"
|
|
|
|
|
:print-data="buildDetailPrintData()"
|
|
|
|
|
:show-refresh="false"
|
|
|
|
|
/>
|
|
|
|
|
</div>
|
|
|
|
|
@ -430,6 +432,33 @@ const getDeviceTypeName = (value: any) => {
|
|
|
|
|
return value ?? ''
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const detailTemplateJson = computed(() => {
|
|
|
|
|
const templateJson = detailData.value?.templateJson
|
|
|
|
|
if (!templateJson) return undefined
|
|
|
|
|
if (typeof templateJson === 'string') {
|
|
|
|
|
try {
|
|
|
|
|
return JSON.parse(templateJson)
|
|
|
|
|
} catch {
|
|
|
|
|
return undefined
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
return templateJson
|
|
|
|
|
})
|
|
|
|
|
|
|
|
|
|
const buildDetailPrintData = () => {
|
|
|
|
|
return {
|
|
|
|
|
id: detailData.value?.id,
|
|
|
|
|
deviceCode: detailData.value?.deviceCode,
|
|
|
|
|
deviceName: detailData.value?.deviceName,
|
|
|
|
|
deviceSpec: detailData.value?.deviceSpec,
|
|
|
|
|
deviceBrand: detailData.value?.deviceBrand,
|
|
|
|
|
deviceModel: detailData.value?.deviceModel,
|
|
|
|
|
deviceLocation: detailData.value?.deviceLocation,
|
|
|
|
|
remark: detailData.value?.remark ?? detailData.value?.deviceRemark,
|
|
|
|
|
qrcodeUrl: detailData.value?.qrcodeUrl
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
const formatDetailDate = (value: any) => {
|
|
|
|
|
if (!value) return ''
|
|
|
|
|
return formatDate(new Date(value), 'YYYY-MM-DD')
|
|
|
|
|
|