diff --git a/src/modules/18_command/components/DialogPreviewCommand.vue b/src/modules/18_command/components/DialogPreviewCommand.vue index d0072270c..64e10f9bb 100644 --- a/src/modules/18_command/components/DialogPreviewCommand.vue +++ b/src/modules/18_command/components/DialogPreviewCommand.vue @@ -135,8 +135,24 @@ async function fetchDataCommand(type: string) { dataAttachment.value = data; } }) - .catch((e) => { - messageError($q, e); + .catch(async (e) => { + if (type !== "cover") { + try { + const res = await http.get( + config.API.fileByFile( + "ระบบออกคำสั่ง", + newType, + commandId.value, + newType + ) + ); + dataAttachment.value = res.data; + } catch (error) { + messageError($q, e); + } + } else { + messageError($q, e); + } }) .finally(() => { hideLoader();