This commit is contained in:
hafifierahman
2022-04-05 00:56:27 +08:00
parent 0fc699b7f5
commit f8e5baeeb5
11 changed files with 25 additions and 250 deletions
+16 -248
View File
@@ -238,8 +238,8 @@
</td>
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
<button @click="DownloadBukti" class="border border-blue-600 text-blue-600 font-montserrat py-2 px-4 font-medium rounded-xl hover:bg-blue-600 hover:text-white transition-all duration-300">
CETAK
<button @click="DownloadBukti(mohon.kelulusanpbimage)" class="border border-blue-600 text-blue-600 font-montserrat py-2 px-4 font-medium rounded-xl hover:bg-blue-600 hover:text-white transition-all duration-300">
MUAT TURUN
</button>
</td>
@@ -320,254 +320,22 @@ export default {
return 'Bayaran Balik'
}
},
async funcbatal(mohonid) {
let refer = this;
const {
value: katalaluan
} = await this.$swal({
title: 'Masukkan Katalaluan Semula',
input: 'password',
inputPlaceholder: 'Katalaluan',
confirmButtonText: 'Hantar',
showCancelButton: true,
cancelButtonText: 'Batal',
allowOutsideClick: false
})
if (katalaluan !== undefined)
await this.axios.get('/mintasemulakelulusan', {
params: {
passsemula: katalaluan
}
}).then(response => {
if (response.data === 1) {
if (this.userroles === "operasi") {
this.axios.put(this.$hostname + '/admin/permohonan/updateoperasi', {
kelulusan: "Batal",
mohonid: mohonid,
namaoperasi: this.username
}).then(response => {
if (response.data === 1) {
this.$swal({
icon: 'success',
title: 'Berjaya',
text: 'Berjaya mengemaskini maklumat pelanggan',
allowOutsideClick: false
}).then(function () {
refer.getSenaraiMohon(refer.currentPage);
});
} else {
this.$swal({
icon: 'warning',
title: 'Tidak Berjaya',
text: 'Data pelanggan tidak berjaya dikemaskini',
allowOutsideClick: false
}).then(function () {
refer.getSenaraiMohon(refer.currentPage);
});
}
});
} else if (this.userroles === "akaun") {
this.axios.put(this.$hostname + '/admin/permohonan/updateakaun', {
kelulusan: "Batal",
mohonid: mohonid,
namaakaun: this.username
}).then(response => {
if (response.data === 1) {
this.$swal({
icon: 'success',
title: 'Berjaya',
text: 'Berjaya mengemaskini maklumat pelanggan',
allowOutsideClick: false
}).then(function () {
refer.getSenaraiMohon(refer.currentPage);
});
} else {
this.$swal({
icon: 'warning',
title: 'Tidak Berjaya',
text: 'Data pelanggan tidak berjaya dikemaskini',
allowOutsideClick: false
}).then(function () {
refer.getSenaraiMohon(refer.currentPage);
});
}
});
} else {
}
} else {
this.$swal({
icon: 'warning',
title: 'Tidak Berjaya',
text: 'Kata Laluan Yang Dimasukkan Salah!!',
allowOutsideClick: false
}).then(function () {
refer.getSenaraiMohon(refer.currentPage);
});
}
DownloadBukti: function (image) {
axios.get("/api/check/muatturun?image=" + image, {
responseType: 'blob'
})
.then(response => {
const url = window.URL.createObjectURL(new Blob([response.data]));
const link = document.createElement('a');
link.href = url;
link.setAttribute('download', image);
document.body.appendChild(link);
link.click();
})
.catch(e => {
console.log(e);
});
},
async funcsetuju(mohonid) {
let refer = this;
const {
value: katalaluan
} = await this.$swal({
title: 'Masukkan Katalaluan Semula',
input: 'password',
inputPlaceholder: 'Katalaluan',
confirmButtonText: 'Hantar',
showCancelButton: true,
cancelButtonText: 'Batal',
allowOutsideClick: false
})
if (katalaluan !== undefined)
await this.axios.get('/mintasemulakelulusan', {
params: {
passsemula: katalaluan
}
}).then(response => {
if (response.data === 1) {
if (this.userroles === "operasi") {
this.axios.put(this.$hostname + '/admin/permohonan/updateoperasi', {
kelulusan: 'Lulus',
mohonid: mohonid,
namaoperasi: this.username
}).then(response => {
if (response.data === 1) {
this.$swal({
icon: 'success',
title: 'Berjaya',
text: 'Berjaya mengemaskini maklumat pelanggan',
allowOutsideClick: false
}).then(function () {
refer.getSenaraiMohon(refer.currentPage);
});
} else {
this.$swal({
icon: 'warning',
title: 'Tidak Berjaya',
text: 'Data pelanggan tidak berjaya dikemaskini',
allowOutsideClick: false
}).then(function () {
refer.getSenaraiMohon(refer.currentPage);
});
}
});
} else if (this.userroles === 'akaun') {
this.axios.put(this.$hostname + '/admin/permohonan/updateakaun', {
kelulusan: 'Lulus',
mohonid: mohonid,
namaakaun: this.username
}).then(response => {
if (response.data === 1) {
this.$swal({
icon: 'success',
title: 'Berjaya',
text: 'Berjaya mengemaskini maklumat pelanggan',
allowOutsideClick: false
}).then(function () {
refer.getSenaraiMohon(refer.currentPage);
});
} else {
this.$swal({
icon: 'warning',
title: 'Tidak Berjaya',
text: 'Data pelanggan tidak berjaya dikemaskini',
allowOutsideClick: false
}).then(function () {
refer.getSenaraiMohon(refer.currentPage);
});
}
});
} else {
}
} else {
this.$swal({
icon: 'warning',
title: 'Tidak Berjaya',
text: 'Kata Laluan Yang Dimasukkan Salah!!',
allowOutsideClick: false
}).then(function () {
getSenaraiMohon(this.currentPage);
});
}
});
},
CetakanPB: function (caw, mid) {
let refer = this;
this.axios.put(this.$hostname + '/admin/permohonan/updatecetak', {
mohonid: mid,
namaprint: this.username
}).then(response => {
if (response.data === 1) {
this.$swal({
icon: 'success',
title: 'Berjaya',
text: 'Cetakan Berjaya Dijana!',
allowOutsideClick: false
}).then(function () {
refer.getSenaraiMohon(refer.currentPage);
});
} else {
this.$swal({
icon: 'warning',
title: 'Tidak Berjaya',
text: 'Cetakan Tidak Berjaya!',
allowOutsideClick: false
}).then(function () {
refer.getSenaraiMohon(refer.currentPage);
});
}
});
let route = window.route('permohonan.cetakanpb', {
_query: {
cawangan: caw,
mohonid: mid
},
});
window.open(route, '_blank')
},
KelulusanPB: function (mid, mohon) {
this.$refs.modal.mohonid = mid;
this.$refs.modal.amaun_dimohon = mohon;
this.$refs.modal.showModal = true;
},
DepositBank: function (mid) {
this.$refs.bankmodal.mohonid = mid;
this.$refs.bankmodal.showModal = true;
},
DownloadBukti: function(){
console.log('dassa');
}
// CetakanPenuh: function (caw, mid) {
// let route = window.route('permohonan.cetakanpenuh', {
// _query: {
// cawangan: caw,
// mohonid: mid
// },
// });
// window.open(route, '_blank')
// }
}
}
</script>