diff --git a/src/modules/04_registryPerson/components/requestEdit/01_TabInformation.vue b/src/modules/04_registryPerson/components/requestEdit/01_TabInformation.vue index 553aa4f3b..27a7164e3 100644 --- a/src/modules/04_registryPerson/components/requestEdit/01_TabInformation.vue +++ b/src/modules/04_registryPerson/components/requestEdit/01_TabInformation.vue @@ -73,15 +73,15 @@ const columns = ref([ headerStyle: "font-size: 14px", style: "font-size: 14px", }, - { - name: "document", - align: "center", - label: "หลักฐานอ้างอิง", - sortable: false, - field: "document", - headerStyle: "font-size: 14px", - style: "font-size: 14px", - }, + // { + // name: "document", + // align: "center", + // label: "หลักฐานอ้างอิง", + // sortable: false, + // field: "document", + // headerStyle: "font-size: 14px", + // style: "font-size: 14px", + // }, { name: "status", align: "left", @@ -108,7 +108,7 @@ const visibleColumns = ref([ "fullname", "topic", "detail", - "document", + // "document", "status", "remark", ]); @@ -354,7 +354,7 @@ onMounted(() => { -
+ + + {{ col.value ? col.value : "-" }} + @@ -395,8 +395,6 @@ onMounted(() => { :fetch-data="fetchListRequset" :request-id="requestId" /> - - diff --git a/src/modules/04_registryPerson/components/requestEdit/Page01_Detail.vue b/src/modules/04_registryPerson/components/requestEdit/Page01_Detail.vue index 1945f21e8..bad7d8e25 100644 --- a/src/modules/04_registryPerson/components/requestEdit/Page01_Detail.vue +++ b/src/modules/04_registryPerson/components/requestEdit/Page01_Detail.vue @@ -30,7 +30,6 @@ const { success, } = useCounterMixin(); -const urlImg = ref(""); const modalUpdate = ref(false); const modalFather = ref(false); const modalMother = ref(false); @@ -85,9 +84,8 @@ async function fetchDataRequest() { } else { isReadOnly.value = false; } - if (dataRequest.value.topic == "ขอแก้ไขรูปภาพประจำตัว") { - onDownloadFile(requestId.value); - } + + onDownloadFile(requestId.value); }) .catch((err) => { messageError($q, err); @@ -143,12 +141,13 @@ function classInput(val: boolean) { }; } +const checkFile = ref(null); // เช็คไฟล์อัปโหลด null ค่าเริ่มต้น, false ไม่มีไฟล์, "img" รูปภาพ, "doc" เอกสาร +const urlDownload = ref(""); // url ไฟล์อัปโหลด /** * function หาชื่อไฟล์ * @param id รายการยื่นคำร้องขอแก้ไขข้อมูล */ function onDownloadFile(id: string) { - showLoader(); http .get( config.API.file( @@ -161,12 +160,11 @@ function onDownloadFile(id: string) { if (res.data.length !== 0) { await downloadUrl(id, res.data[0].fileName); } else { - hideLoader(); + checkFile.value = false; } }) .catch((e) => { messageError($q, e); - hideLoader(); }); } @@ -186,10 +184,11 @@ async function downloadUrl(id: string, fileName: string) { ) ) .then((res) => { + urlDownload.value = res.data.downloadUrl; if (dataRequest.value.topic == "ขอแก้ไขรูปภาพประจำตัว") { - urlImg.value = res.data.downloadUrl; + checkFile.value = "img"; } else { - window.open(res.data.downloadUrl, "_blank"); + checkFile.value = "doc"; } }) .catch((e) => { @@ -341,56 +340,37 @@ onMounted(async () => { type="textarea" />
-
- {{ - dataRequest.topic == "ขอแก้ไขรูปภาพประจำตัว" - ? "รูปภาพประจำตัว" - : "เอกสารหลักฐาน" - }} -
-
- - - หลักฐานอ้างอิง - -
-
- -
-
- +
+ {{ + checkFile == "img" ? "รูปภาพประจำตัว" : "เอกสารหลักฐาน" + }} +
+
+ + +
- + + + +