Add surat hak kepemilikan

This commit is contained in:
Amir
2022-12-14 06:22:03 +08:00
parent e08c4659b5
commit 40479ccd36
5 changed files with 112 additions and 38 deletions
+2 -11
View File
@@ -16,6 +16,7 @@
"bootstrap": "^5.1.3",
"bootstrap-icons": "^1.8.1",
"core-js": "^3.8.3",
"html2canvas": "^1.4.1",
"jspdf": "^2.5.1",
"jspdf-autotable": "^3.5.28",
"libphonenumber-js": "^1.10.14",
@@ -3437,7 +3438,6 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz",
"integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==",
"optional": true,
"engines": {
"node": ">= 0.6.0"
}
@@ -4357,7 +4357,6 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-2.1.0.tgz",
"integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==",
"optional": true,
"dependencies": {
"utrie": "^1.0.2"
}
@@ -6213,7 +6212,6 @@
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/html2canvas/-/html2canvas-1.4.1.tgz",
"integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==",
"optional": true,
"dependencies": {
"css-line-break": "^2.1.0",
"text-segmentation": "^1.0.3"
@@ -9799,7 +9797,6 @@
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/text-segmentation/-/text-segmentation-1.0.3.tgz",
"integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==",
"optional": true,
"dependencies": {
"utrie": "^1.0.2"
}
@@ -10051,7 +10048,6 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/utrie/-/utrie-1.0.2.tgz",
"integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==",
"optional": true,
"dependencies": {
"base64-arraybuffer": "^1.0.2"
}
@@ -13480,8 +13476,7 @@
"base64-arraybuffer": {
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/base64-arraybuffer/-/base64-arraybuffer-1.0.2.tgz",
"integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ==",
"optional": true
"integrity": "sha512-I3yl4r9QB5ZRY3XuJVEPfc2XhZO6YweFPI+UovAzn+8/hb3oJ6lnysaFcjVpkCPfVWFUDvoZ8kmVDP7WyRtYtQ=="
},
"base64-js": {
"version": "1.5.1",
@@ -14155,7 +14150,6 @@
"version": "2.1.0",
"resolved": "https://registry.npmjs.org/css-line-break/-/css-line-break-2.1.0.tgz",
"integrity": "sha512-FHcKFCZcAha3LwfVBhCQbW2nCNbkZXn7KVUJcsT5/P8YmfsVja0FMPJr0B903j/E69HUphKiV9iQArX8SDYA4w==",
"optional": true,
"requires": {
"utrie": "^1.0.2"
}
@@ -15446,7 +15440,6 @@
"version": "1.4.1",
"resolved": "https://registry.npmjs.org/html2canvas/-/html2canvas-1.4.1.tgz",
"integrity": "sha512-fPU6BHNpsyIhr8yyMpTLLxAbkaK8ArIBcmZIRiBLiDhjeqvXolaEmDGmELFuX9I4xDcaKKcJl+TKZLqruBbmWA==",
"optional": true,
"requires": {
"css-line-break": "^2.1.0",
"text-segmentation": "^1.0.3"
@@ -18067,7 +18060,6 @@
"version": "1.0.3",
"resolved": "https://registry.npmjs.org/text-segmentation/-/text-segmentation-1.0.3.tgz",
"integrity": "sha512-iOiPUo/BGnZ6+54OsWxZidGCsdU8YbE4PSpdPinp7DeMtUJNJBoJ/ouUSTJjHkh1KntHaltHl/gDs2FC4i5+Nw==",
"optional": true,
"requires": {
"utrie": "^1.0.2"
}
@@ -18259,7 +18251,6 @@
"version": "1.0.2",
"resolved": "https://registry.npmjs.org/utrie/-/utrie-1.0.2.tgz",
"integrity": "sha512-1MLa5ouZiOmQzUbjbu9VmjLzn1QLXBhwpUa7kdLUQK+KQ5KA9I1vk5U4YHe/X2Ch7PYnJfWuWT+VbuxbGwljhw==",
"optional": true,
"requires": {
"base64-arraybuffer": "^1.0.2"
}
+1
View File
@@ -15,6 +15,7 @@
"bootstrap": "^5.1.3",
"bootstrap-icons": "^1.8.1",
"core-js": "^3.8.3",
"html2canvas": "^1.4.1",
"jspdf": "^2.5.1",
"jspdf-autotable": "^3.5.28",
"libphonenumber-js": "^1.10.14",
+2 -2
View File
@@ -26,7 +26,7 @@
</tbody>
</table>
</div>
<Button label="Lihat Senarai" v-if="response[0].masatamat_lelong == null" class="p-button-sm" v-on:click="toList()" />
<Button label="Lihat Senarai" class="p-button-sm" v-on:click="toList()" />
</div>
<div v-else>
<table class="table table-sm table-bordered table-hover">
@@ -70,7 +70,7 @@ export default {
},
})
.then((response) => {
// console.log("liveData", response);
console.log("liveData", response);
if (response.data.success == true) {
this.responseData = true;
this.response = response.data.lelong;
+13 -12
View File
@@ -261,8 +261,9 @@ export default {
var current_time = date.toLocaleString();
var limit_masa_bayaran = "15:00:00";
var limit_datetime_bayaran = this.lelongDetails.tarikh_lelong + ", " + limit_masa_bayaran;
console.log(current_time, '\n', limit_datetime_bayaran);
if (current_time < limit_datetime_bayaran === true) {
// if (current_time < limit_datetime_bayaran === true) {
this.isDisplay = true;
this.cawanganPilihan = value.cawangan;
this.hargaBidaanPilihan = value.total_hargabida;
@@ -272,17 +273,17 @@ export default {
this.form.total = parseFloat(value.total_hargabida.replace(/,/g, ""));
let convertData = JSON.parse(JSON.stringify(value.sag));
this.form.sag = convertData;
} else {
this.$swal.fire({
icon: "error",
title: "Gagal",
text: "Pembayaran mesti diselesaikan sebelum 3:00pm.",
confirmButtonColor: "#344871",
confirmButtonText: "Kembali",
allowOutsideClick: false,
allowEscapeKey: false,
});
}
// } else {
// this.$swal.fire({
// icon: "error",
// title: "Gagal",
// text: "Pembayaran mesti diselesaikan sebelum 3:00pm.",
// confirmButtonColor: "#344871",
// confirmButtonText: "Kembali",
// allowOutsideClick: false,
// allowEscapeKey: false,
// });
// }
},
closeModal() {
this.isDisplay = false;
+94 -13
View File
@@ -73,15 +73,12 @@
icon="pi pi-verified"
iconPos="right"
class="p-button-sm mb-3"
v-on:click="downloadPdf(lists, list)"
v-on:click="downloadPdf(list.kodcaw)"
v-if="list.status_payment_cawangan == 1"
v-tooltip="'Muat Turun'"
/>
<div class="overflow-x-auto">
<table
class="table text-center table-bordered"
id="hello-test"
>
<table class="table text-center table-bordered">
<tbody>
<tr class="table-light">
<td>Bil</td>
@@ -305,13 +302,58 @@
</div>
</div>
</div>
<Dialog
header="Surat Hak Kepemilikan Barang"
v-model:visible="isDisplay"
:breakpoints="{ '960px': '75vw', '640px': '90vw' }"
:style="{ width: '50vw' }"
:modal="true"
>
<div class="text-center">
<p id="hakbarang">SURAT KETERANGAN KEPEMILIKAN BARANG</p>
<p>
Bahawasanya barang tersebut adalah hak milik
{{ suratHak.user.name }} ({{ suratHak.user.nokp }})
</p>
<table class="table text-center table-bordered">
<tbody>
<tr class="table-light">
<td>Bil</td>
<td>No Rujukan</td>
<td>Jenis Barang</td>
<td>Berat</td>
<td>Harga Bidaan</td>
</tr>
<tr v-for="(data, index) in suratHak.lelongbid" v-bind:key="data">
<td>{{ index + 1 }}</td>
<td>{{ data.norujukan }}</td>
<td>
<div v-for="berat in data.lelongbidmarhun" v-bind:key="berat">
<p>{{ berat.marhun_desc }}</p>
</div>
</td>
<td>
<div v-for="berat in data.lelongbidmarhun" v-bind:key="berat">
<p>{{ berat.berat }}g</p>
</div>
</td>
<td>RM{{ data.hargabida }}</td>
</tr>
</tbody>
</table>
</div>
<template #footer>
<Button label="Muat Turun" @click="muatTurunPdf()" />
</template>
</Dialog>
</div>
</the-template>
</template>
<script>
import jsPDF from "jspdf";
import autoTable from "jspdf-autotable";
import "jspdf-autotable";
import html2canvas from "html2canvas";
import axios from "axios";
import ItemMasterImageModal from "../list/ItemMasterImageModal.vue";
@@ -330,6 +372,9 @@ export default {
isSuccess: false,
theData: "",
reloadImageComponent: "",
isDisplay: false,
suratHak: "",
isSuccessHak: false,
};
},
created() {
@@ -382,13 +427,49 @@ export default {
this.theData = value;
this.reloadImageComponent += 1;
},
downloadPdf(valueMaster, value) {
console.log(valueMaster, value);
// var pdf = new jsPDF();
// autoTable(pdf, { html: "#hello-test" });
// pdf.save("test.pdf");
downloadPdf(value) {
axios
.get("/resultInCawangan", {
headers: {
Authorization: "Bearer " + localStorage.getItem("token"),
},
params: {
lelong_id: this.lelongId,
user_id: localStorage.getItem("id"),
kodcaw: value,
},
})
.then((response) => {
this.suratHak = response.data;
this.isDisplay = true;
this.isSuccessHak = true;
})
.catch((error) => {
console.log(error);
});
},
muatTurunPdf() {
// const doc = new jsPDF();
// doc.autoTable({ html: "#hak-barang" });
// const html = this.$refs.hakbarang.innerHTML;
// doc.fromHTML(html, 15, 15, {
// width: 150,
// });
// var canvas = document.getElementById("hakbarang");
// html2canvas(canvas).then(function (canvas) {
// var imgdata = canvas.toDataURL("image/png");
// var doc = new jsPDF();
// doc.addImage(imgdata, "PNG", 500, 500);
// doc.save("test.pdf");
// });
// window.html2canvas = html2canvas;
// var doc = new jsPDF("p", "pt", "a4");
// doc.html(document.querySelector(#hakbarang), {
// callback: function(pdf) {
// pdf.save("thehehehe.pdf")
// }
// })
// doc.save("table.pdf");
},
},
};