Files
admin-erahn/resources/js/components/util/PetiBesiModal.vue
T
2022-01-11 22:53:32 +08:00

209 lines
8.7 KiB
Vue
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
<template>
<div>
<transition name="modal-fade">
<div v-if="showModal" class="overflow-x-hidden overflow-y-auto fixed inset-0 z-50 outline-none focus:outline-none justify-center items-center flex">
<div class="relative w-screen my-6 mx-auto max-w-6xl">
<!--content-->
<div class="border-0 rounded-lg shadow-lg relative flex flex-col w-full bg-white outline-none focus:outline-none">
<!--header-->
<div class="flex items-start bg-gray-200 justify-between p-5 border-b border-solid border-blueGray-200 rounded-t">
<h3 class="text-3xl font-semibold">
Pemeriksaan Peti Besi
</h3>
<button class="p-1 ml-auto border-0 text-black opacity-5 float-right text-3xl leading-none font-semibold outline-none focus:outline-none" v-on:click="toggleModal()">
<span class=" text-black opacity-5 h-6 w-6 text-2xl block outline-none focus:outline-none">
×
</span>
</button>
</div>
<!--body-->
<div class="relative p-6 flex-auto">
<!-- <p class="my-4 text-blueGray-500 text-lg leading-relaxed">
</p> -->
<!-- <h3 class="font-bold mb-3 text-center text-2xl border-4 border-red-500 mx-auto w-2/4 py-2 rounded-lg"><b class="text-red-500">Formula </b> <span class="mx-2"><i class="fas fa-angle-double-right"></i></span> AW + ST + PE - PT - SE - PJ = AK</h3> -->
<fieldset class="border-4 border-solid border-gray-600 p-3 mb-2">
<legend class="text-xl">Legends Tunai</legend>
<div class="flex flex-wrap">
<div class="w-1/4">
<p><b>BWL</b> <span class="mx-2"><i class="fas fa-angle-double-right"></i></span> Baki Awal</p>
<p><b>PHQ</b> <span class="mx-2"><i class="fas fa-angle-double-right"></i></span> Pendahuluan HQ</p>
<p><b>STL</b> <span class="mx-2"><i class="fas fa-angle-double-right"></i></span> Serahan Teller</p>
<p><b>BAK</b> <span class="mx-2"><i class="fas fa-angle-double-right"></i></span> Baki Akhir</p>
</div>
<div class="w-1/4">
<p><b>PTL</b> <span class="mx-2"><i class="fas fa-angle-double-right"></i></span> Pendahuluan Teller</p>
<p><b>SHQ</b> <span class="mx-2"><i class="fas fa-angle-double-right"></i></span> Serahan HQ</p>
<p><b>PJR</b> <span class="mx-2"><i class="fas fa-angle-double-right"></i></span> Panjar</p>
</div>
<div class="w-2/4 my-auto">
<h3 class="font-bold mb-3 text-center text-xl border-2 border-red-500 py-2 rounded-lg"><b class="text-red-500">Formula </b> <span class="mx-2"><i class="fas fa-angle-double-right"></i></span> AW + ST + PE - PT - SE - PJ = AK</h3>
</div>
</div>
</fieldset>
<div class="flex flex-wrap -mx-3 mb-3">
<div class="bg-blue-300 text-white h-26 flex-auto rounded-2xl ml-2 w-1/3">
<div class="flex flex-row">
<div class="bg-blue-500 px-3 py-6 rounded-l-2xl">
<h2 class="font-bold text-lg">BWL</h2>
</div>
<div class="my-auto mx-auto">
<p class="font-bold uppercase text-black text-2xl">{{ this.bakiawal }}</p>
</div>
</div>
</div>
<div class="bg-red-300 text-white h-26 flex-auto rounded-2xl ml-2 w-1/3">
<div class="flex flex-row">
<div class="bg-red-500 px-3 py-6 rounded-l-2xl">
<h2 class="font-bold text-lg">PTL</h2>
</div>
<div class="my-auto mx-auto">
<p class="font-bold uppercase text-black text-2xl">{{ this.pendteller }}</p>
</div>
</div>
</div>
</div>
<div class="flex flex-wrap -mx-3 mb-3">
<div class="bg-green-300 text-white h-26 flex-auto rounded-2xl ml-2 w-1/3">
<div class="flex flex-row">
<div class="bg-green-500 px-4 py-6 rounded-l-2xl">
<h2 class="font-bold text-lg">STL</h2>
</div>
<div class="my-auto mx-auto">
<p class="font-bold uppercase text-black text-2xl">{{ this.serteller }}</p>
</div>
</div>
</div>
<div class="bg-red-300 text-white h-26 flex-auto rounded-2xl ml-2 w-1/3">
<div class="flex flex-row">
<div class="bg-red-500 px-4 py-6 rounded-l-2xl">
<h2 class="font-bold text-lg">SHQ</h2>
</div>
<div class="my-auto mx-auto">
<p class="font-bold uppercase text-black text-2xl">{{ this.serahan }}</p>
</div>
</div>
</div>
</div>
<div class="flex flex-wrap -mx-3 mb-3">
<div class="bg-green-300 text-white h-26 flex-auto rounded-2xl ml-2 w-1/3">
<div class="flex flex-row">
<div class="bg-green-500 px-4 py-6 rounded-l-2xl">
<h2 class="font-bold text-lg">PHQ</h2>
</div>
<div class="my-auto mx-auto">
<p class="font-bold uppercase text-black text-2xl">{{ this.pendahuluan }}</p>
</div>
</div>
</div>
<div class="bg-red-300 text-white h-26 flex-auto rounded-2xl ml-2 w-1/3">
<div class="flex flex-row">
<div class="bg-red-500 px-4 py-6 rounded-l-2xl">
<h2 class="font-bold text-lg">PJR</h2>
</div>
<div class="my-auto mx-auto">
<p class="font-bold uppercase text-black text-2xl">{{ this.panjar }}</p>
</div>
</div>
</div>
</div>
<div class="flex flex-wrap -mx-3 mb-3">
<div class="bg-green-300 text-white h-26 flex-auto rounded-2xl ml-2">
<div class="flex flex-row">
<div class="bg-green-500 px-4 py-6 rounded-l-2xl">
<h2 class="font-bold text-lg">BAK</h2>
</div>
<div class="my-auto mx-auto">
<p class="font-bold uppercase text-black text-2xl">{{ this.bakiakhir }}</p>
</div>
</div>
</div>
</div>
</div>
<!--footer-->
<div class="flex items-center justify-end p-6 border-t border-solid border-blueGray-200 rounded-b">
<button class="bg-gray-500 hover:bg-gray-700 text-white font-bold py-2 px-4 border border-gray-700 rounded mr-1" type="button" v-on:click="toggleModal()">
Batal
</button>
<button class="bg-blue-500 hover:bg-blue-700 text-white font-bold py-2 px-4 border border-blue-700 rounded" type="button" v-on:click="kemaskinifunc()">
Kemaskini
</button>
</div>
</div>
</div>
</div>
</transition>
<div v-if="showModal" class="opacity-25 fixed inset-0 z-40 bg-black"></div>
</div>
</template>
<script>
export default {
name: "modal",
data() {
return {
showModal: false,
tarikh: Date,
kodcaw: String,
bakiawal: 0,
bakiakhir: 0,
pendahuluan: 0,
serahan: 0,
pendteller: 0,
serteller: 0,
panjar: 0
}
},
methods: {
toggleModal: function(){
this.showModal = !this.showModal;
},
kemaskinifunc: function(){
axios.put('/api/check/kemaskinipetibesi',
{
hostname:this.$hostname,
tarikh: this.tarikh,
kodcaw: this.kodcaw,
bakiawal: this.bakiawal.replace(/[^0-9.-]+/g,""),
keluar: this.pendteller.replace(/[^0-9.-]+/g,""),
masuk: this.serteller.replace(/[^0-9.-]+/g,""),
pendahuluan: this.pendahuluan.replace(/[^0-9.-]+/g,""),
serahan: this.serahan.replace(/[^0-9.-]+/g,""),
panjar: this.panjar.replace(/[^0-9.-]+/g,""),
bakiakhir: this.bakiakhir.replace(/[^0-9.-]+/g,"")
}).then(response => {
if(response.data == 'berjaya')
{
this.showModal = false;
this.$toast.success("Kemaskini Sudah Berjaya!")
setTimeout("window.location.reload()", 3000);
}else{
this.showModal = false;
this.$toast.error("Kemaskini tidak berjaya")
}
});
}
}
}
</script>