diff --git a/src/components/result/ResultDetail.vue b/src/components/result/ResultDetail.vue index 3d75105..9cdb53b 100644 --- a/src/components/result/ResultDetail.vue +++ b/src/components/result/ResultDetail.vue @@ -121,7 +121,12 @@ v-on:click="downloadPdf(list.kodcaw)" v-if="list.status_payment_cawangan.status == 1" /> -
+
Cara Bayaran
CDM
+
+
- - - - - - - - - - - - - -
BilGambarMasa Muat Naik
{{ index + 1 }} - - {{receipt.created_at}}
+ + + + + + + + + + + + + +
BilGambarMasa Muat Naik
{{ index + 1 }} + + {{ receipt.masa_upload }}
@@ -465,7 +509,7 @@ import html2canvas from "html2canvas"; import VueHtml2pdf from "vue-html2pdf"; import axios from "axios"; import ItemMasterImageModal from "../list/ItemMasterImageModal.vue"; -import ReceiptImage from "../pay/ReceiptImage.vue" +import ReceiptImage from "../pay/ReceiptImage.vue"; export default { components: { @@ -486,6 +530,13 @@ export default { isDisplay: false, suratHak: "", isSuccessHak: false, + isDisplayFileUpload: false, + formResit: { + user_id: localStorage.getItem("id"), + lelong_id: this.$route.params.lelongId, + gambarResit: "", + kodcaw: "", + }, }; }, created() { @@ -541,6 +592,63 @@ export default { this.theData = value; this.reloadImageComponent += 1; }, + selectPhoto(e) { + console.log(e); + this.formResit.gambarResit = e.target.files[0]; + }, + addPhotoResit() { + var resitFormData = new FormData(); + resitFormData.append("gambarResit", this.formResit.gambarResit); + resitFormData.append("lelong_id", this.formResit.lelong_id); + resitFormData.append("user_id", this.formResit.user_id); + resitFormData.append("kodcaw", this.formResit.kodcaw); + console.log(this.formResit); + axios + .post("/addPhotoResit", resitFormData, { + headers: { + Authorization: "Bearer " + localStorage.getItem("token"), + }, + }) + .then((response) => { + this.liveData(); + this.isDisplayFileUpload = false; + if (response.data.success == true) { + this.$swal.fire({ + icon: "success", + title: "Gambar Resit Berjaya Di Muat Naik", + confirmButtonColor: "#344871", + confirmButtonText: "OK", + allowOutsideClick: false, + allowEscapeKey: false, + }); + this.componentKey += 1; + } else if (response.data.success == false) { + console.log(response); + this.$swal.fire({ + toast: true, + icon: "error", + title: "Gagal! Sila refresh page semula.", + animation: false, + position: "bottom", + showConfirmButton: false, + timer: 5000, + timerProgressBar: true, + }); + this.componentKey += 1; + } + }) + .catch((error) => { + alert(error); + }); + }, + openModalFileUpload(e) { + this.isDisplayFileUpload = true; + this.formResit.kodcaw = e; + }, + closeModalFileUpload() { + this.isDisplayFileUpload = false; + this.formResit.kodcaw = ""; + }, downloadPdf(value) { axios .get("/resultInCawangan", {