190 lines
7.2 KiB
Vue
190 lines
7.2 KiB
Vue
<template>
|
||
<div>
|
||
|
||
<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>
|
||
|
||
|
||
<div class="flex flex-no-wrap">
|
||
<div class="bg-blue-300 text-white h-26 flex-auto rounded-2xl ml-2">
|
||
<div class="flex flex-row">
|
||
<div class="bg-blue-500 px-3 py-6 rounded-l-2xl">
|
||
<h2 class="font-bold text-lg">AW</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">
|
||
<div class="flex flex-row">
|
||
<div class="bg-red-500 px-3 py-6 rounded-l-2xl">
|
||
<h2 class="font-bold text-lg">PT</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 mt-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">ST</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">
|
||
<div class="flex flex-row">
|
||
<div class="bg-red-500 px-4 py-6 rounded-l-2xl">
|
||
<h2 class="font-bold text-lg">SE</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 mt-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">PE</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">
|
||
<div class="flex flex-row">
|
||
<div class="bg-red-500 px-4 py-6 rounded-l-2xl">
|
||
<h2 class="font-bold text-lg">PJ</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 mt-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">AK</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>
|
||
<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',
|
||
{
|
||
|
||
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 => {
|
||
|
||
console.log(response.data);
|
||
if(response.data == 'berjaya')
|
||
{
|
||
this.showModal = false;
|
||
this.$toast.success("Kemaskini Sudah Berjaya!")
|
||
// vm.$forceUpdate();
|
||
|
||
setTimeout("window.location.reload()", 3000);
|
||
}else{
|
||
|
||
this.showModal = false;
|
||
this.$toast.error("Kemaskini tidak berjaya")
|
||
}
|
||
});
|
||
|
||
}
|
||
}
|
||
}
|
||
</script> |