This commit is contained in:
hafifierahman
2022-07-18 16:56:14 +08:00
parent ea8aadb0be
commit 061d99c166
5 changed files with 8917 additions and 9610 deletions
+1829 -2218
View File
File diff suppressed because it is too large Load Diff
-5777
View File
File diff suppressed because it is too large Load Diff
+6395 -934
View File
File diff suppressed because one or more lines are too long
+27 -13
View File
@@ -421,6 +421,13 @@ const formatter = new Intl.NumberFormat('en-US', {
minimumFractionDigits: 2
});
const toBase64 = file => new Promise((resolve, reject) => {
const reader = new FileReader();
reader.readAsDataURL(file);
reader.onload = () => resolve(reader.result);
reader.onerror = error => reject(error);
});
export default {
components: {
pagination,
@@ -613,12 +620,6 @@ export default {
if (response.data === 1) {
let config = {
header: {
'Content-Type': 'multipart/form-data'
}
}
this.$swal({
title: 'Muat Naik Fail Permohonan',
showCancelButton: true,
@@ -631,17 +632,27 @@ export default {
reader.readAsDataURL(this.files[0]);
});
}
}).then((file) => {
}).then(async (file) => {
if (file.value) {
const d = new Date();
let time = d.getTime();
var imagename,data,imagetype;
var formData = new FormData();
var file = $('.swal2-file')[0].files[0];
formData.append("mohonid", mohonid);
formData.append("image", file);
formData.append("kelulusan", 'Lulus');
data = await toBase64(file);
imagetype = file.name.split('.').pop();
if (this.userroles === "operasi") {
formData.append("namaoperasi", this.username);
this.axios.put(this.$hostname + '/admin/permohonan/updateoperasi', formData, config).then(response => {
imagename = 'TagOperasi_' + time + file.name.split('.').pop();
this.axios.put(this.$hostname + '/admin/permohonan/updateoperasi', {
kelulusan: 'Lulus',
mohonid: mohonid,
dataimage: data,
imagename: imagename,
imagetype: imagetype,
namaoperasi: this.username
}).then(response => {
if (response.data === 1) {
this.$swal({
icon: 'success',
@@ -665,10 +676,13 @@ export default {
}
});
} else if (this.userroles === 'akaun') {
formData.append("namaakaun", this.username);
imagename = 'TagAkaun_' + time + file.name.split('.').pop();
this.axios.put(this.$hostname + '/admin/permohonan/updateakaun', {
kelulusan: 'Lulus',
mohonid: mohonid,
dataimage: data,
imagename: imagename,
imagetype: imagetype,
namaakaun: this.username
}).then(response => {
if (response.data === 1) {
+2 -4
View File
@@ -214,10 +214,8 @@ export default {
// focusConfirm: false,
confirmButtonText: 'Ya',
cancelButtonText: 'Tidak',
denyButtonText: `Cetak`,
confirmButtonColor: '#f39c12',
denyButtonColor: '#f39c12',
cancelButtonColor: '#f39c12',
confirmButtonColor: '#2ecc71',
cancelButtonColor: '#e74c3c',
allowOutsideClick: false,
}).then((result) => {
if (result.isConfirmed) {