This commit is contained in:
hafifierahman
2022-07-06 02:51:07 +08:00
parent 3ac5a0935e
commit ee282b65ea
8 changed files with 512 additions and 31 deletions
+48
View File
@@ -0,0 +1,48 @@
<template>
<div>
<div class="mx-auto mt-10 mb-10 flex justify-center grid grid-cols-4">
<div v-for="(sb,i) in serahbakiarray" :key="i">
<router-link :to="{ name: '/selectwtd', params: { batchno: sb.batchno }, query:{ aktif: sb.aktif,totalbaki: sb.baki },}">
<a href="#" class="block p-6 max-w-sm bg-white rounded-lg border border-gray-200 shadow-md hover:bg-gray-100 dark:bg-gray-800 dark:border-gray-700 dark:hover:bg-gray-700">
<h5 class="mb-2 text-2xl font-bold tracking-tight text-gray-900 dark:text-white">BATCH NO : {{ sb.batchno }}</h5>
<p class="font-normal text-gray-700 dark:text-gray-400">Jumlah Wang Tak Dituntut : RM {{ formattext(sb.baki) }}</p>
<p class="font-normal text-gray-700 dark:text-gray-400">Diprocess : {{ sb.aktif ? 'Sudah Diproses' : 'Belum Diproses' }}</p>
</a>
</router-link>
</div>
</div>
</div>
</template>
<script>
const formatter = new Intl.NumberFormat('en-US', {
minimumFractionDigits: 2
});
export default {
data() {
return {
cawangan: 'KB2',
serahbakiarray: {},
}
},
methods: {
formattext: function (value) {
return formatter.format(value);
}
},
mounted() {
this.axios.get(this.$hostname + '/admin/wtd/rekod/', {
params: {
kodcaw: this.cawangan,
}
}).then(response => {
// console.log(response.data);
this.serahbakiarray = response.data;
})
}
}
</script>
+115
View File
@@ -0,0 +1,115 @@
<template>
<div>
<div v-if="arraybakilelong.length > 0" class="relative bg-white overflow-x-auto shadow-md sm:rounded-lg px-8 py-6">
<div class="flex justify-between">
<div class="p-4">
<h1 class="text-xl font-bold bg-clip-text text-transparent bg-gradient-to-br from-gray-500 to-gray-700">JUMLAH = RM {{ this.totalbaki }}</h1>
</div>
<div class="p-4">
<button @click.prevent="proseswtd" :disabled="aktif == 1" :class="{'hover:bg-yellow-600 bg-yellow-600 border-yellow-600': aktif == 0}" class="border border-yellow-300 text-white bg-yellow-300 font-montserrat py-2 px-8 font-medium rounded-xl transition-all duration-300">Proses WTD</button>
<span v-if="batchno != 0" class="text-lg font-bold ml-3">Batchno: {{ this.batchno }}</span>
</div>
</div>
<table class="w-full text-sm text-left text-gray-500 dark:text-gray-400 rounded-lg border w-full sm:h-96 p-6 overflow-x-auto overflow-y-scroll scrollbar">
<thead class="text-xs text-gray-700 uppercase bg-yellow-200 dark:bg-gray-700 dark:text-gray-400">
<tr>
<th scope="col" class="p-4">
<div class="flex items-center">
<span>Bil</span>
</div>
</th>
<th scope="col" class="px-6 py-3">
Norujukan
</th>
<th scope="col" class="px-6 py-3">
Tarikh Lelong
</th>
<th scope="col" class="px-6 py-3">
Pembiayaan
</th>
<th scope="col" class="px-6 py-3">
Baki
</th>
</tr>
</thead>
<tbody>
<tr v-for="(bl,i) in arraybakilelong" :key="i" class="bg-white border-b dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600">
<td class="w-4 p-4">
<div class="flex items-center">
<span>{{ i+1 }}</span>
</div>
</td>
<th scope="row" class="px-6 py-4 font-medium text-gray-900 dark:text-white whitespace-nowrap">
{{ bl.norujukan }}
</th>
<td class="px-6 py-4">
{{ bl.t_lelong }}
</td>
<td class="px-6 py-4">
{{ bl.pinjaman }}
</td>
<td class="px-6 py-4">
{{ bl.baki }}
</td>
</tr>
</tbody>
</table>
</div>
</div>
</template>
<script>
export default {
data() {
return {
mula: null,
hingga: null,
totalbaki: 0.00,
arraybakilelong: [],
allSelected: false,
boolblocksag: false,
cawangan: 'KB2',
batchno: 0,
aktif: 0
}
},
mounted() {
this.batchno = this.$route.params.batchno;
this.aktif = this.$route.query.aktif;
this.totalbaki = this.$route.query.totalbaki;
this.axios.get(this.$hostname + '/admin/wtd/rekod/' + this.batchno, {
params: {
kodcaw: this.cawangan,
}
}).then(response => {
this.arraybakilelong = response.data;
})
},
methods: {
proseswtd: function () {
this.axios.post(this.$hostname + '/admin/wtd/process', {
kodcaw: this.cawangan,
batch: this.batchno
}).then(response => {
if (response.data == 'success') {
this.$swal(
'Berjaya!',
'Berjaya Simpan Wang Tak Dituntut!',
'success'
)
this.aktif = 1;
}
});
},
}
}
</script>
+67 -30
View File
@@ -7,11 +7,12 @@
<h1 class="text-xl font-bold bg-clip-text text-transparent bg-gradient-to-br from-gray-500 to-gray-700">JUMLAH = RM {{ this.totalbaki }}</h1>
</div>
<div class="p-4">
<button @click.prevent="proseswtd" class="border border-yellow-300 text-white bg-yellow-300 font-montserrat py-2 px-8 font-medium rounded-xl transition-all duration-300">Proses WTD</button>
<button @click.prevent="proseswtd" :disabled="boolblocksag == false" :class="{'hover:bg-yellow-600 bg-yellow-600 border-yellow-600': boolblocksag == true}" class="border border-yellow-300 text-white bg-yellow-300 font-montserrat py-2 px-8 font-medium rounded-xl transition-all duration-300">Proses WTD</button>
<span v-if="batchno != 0" class="text-lg font-bold ml-3">Batchno: {{ this.batchno }}</span>
</div>
<div class="p-4">
<button @click.prevent="callparentload" class="border border-yellow-600 text-white bg-yellow-600 font-montserrat py-2 px-8 font-medium rounded-xl hover:bg-yellow-600 hover:text-white transition-all duration-300">Kembali</button>
<button @click.prevent="printwtd" class="border border-yellow-600 text-white bg-yellow-600 font-montserrat py-2 px-8 font-medium rounded-xl hover:bg-yellow-600 hover:text-white transition-all duration-300">Seterusnya</button>
<button @click.prevent="printwtd" :disabled="blockseterusnya == true" :class="{'hover:bg-yellow-600 bg-yellow-600 border-yellow-600': blockseterusnya == false}" class="border text-white bg-yellow-300 border-yellow-300 font-montserrat py-2 px-8 font-medium rounded-xl transition-all duration-300">Seterusnya</button>
</div>
</div>
@@ -20,8 +21,8 @@
<tr>
<th scope="col" class="p-4">
<div class="flex items-center">
<input id="checkbox-all-search" :readonly="boolblocksag == true" @click="selectAll" v-model="allSelected" type="checkbox" class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600">
<label for="checkbox-all-search" class="sr-only">checkbox</label>
<span v-if="batchno != 0">Bil</span>
<input v-if="batchno == 0" id="checkbox-all-search" :readonly="boolblocksag == true" @click="selectAll" v-model="allSelected" type="checkbox" class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600">
</div>
</th>
<th scope="col" class="px-6 py-3">
@@ -42,7 +43,8 @@
<tr v-for="(bl,i) in arraybakilelong" :key="i" class="bg-white border-b dark:bg-gray-800 dark:border-gray-700 hover:bg-gray-50 dark:hover:bg-gray-600">
<td class="w-4 p-4">
<div class="flex items-center">
<input :id="bl.norujukan" :readonly="boolblocksag == true" :value="bl.norujukan" type="checkbox" v-model="selectedNorujukan" @change="select($event)" class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600">
<span v-if="batchno != 0">{{ i+1 }}</span>
<input v-if="batchno == 0" :id="bl.norujukan" :readonly="boolblocksag == true" :value="bl.norujukan" type="checkbox" v-model="selectedNorujukan" @change="select($event)" class="w-4 h-4 text-blue-600 bg-gray-100 border-gray-300 rounded focus:ring-blue-500 dark:focus:ring-blue-600 dark:ring-offset-gray-800 focus:ring-2 dark:bg-gray-700 dark:border-gray-600">
</div>
</td>
<th scope="row" class="px-6 py-4 font-medium text-gray-900 dark:text-white whitespace-nowrap">
@@ -77,7 +79,10 @@ export default {
arraybakilelong: [],
selectedNorujukan: [],
allSelected: false,
boolblocksag: false
boolblocksag: false,
cawangan: 'KB2',
batchno: 0,
blockseterusnya:false,
}
},
props: ['bakilelong'],
@@ -135,7 +140,8 @@ export default {
showCancelButton: true,
confirmButtonColor: '#3085d6',
cancelButtonColor: '#d33',
confirmButtonText: 'Yes'
confirmButtonText: 'Yes',
allowOutsideClick: false,
}).then((result) => {
if (result.isConfirmed) {
@@ -144,7 +150,9 @@ export default {
norujukan: ref.selectedNorujukan
}).then(response => {
if (response.data === 'success') {
if (response.data.status === 'success') {
this.batchno = response.data.batchno;
this.$swal(
'Berjaya!',
'Berjaya block senarai SAG!',
@@ -163,36 +171,65 @@ export default {
let cawangan = 'KB2';
let ref = this;
await this.$swal({
title: '<strong>Cetak WTD</strong>',
html:
'<button type="button" class="focus:outline-none text-white bg-yellow-400 hover:bg-yellow-500 focus:ring-4 focus:ring-yellow-300 font-medium rounded-lg text-sm px-5 py-2.5 mr-2 mb-2 dark:focus:ring-yellow-900">'
+ "<i class='fas fa-print'></i>" +'</button>',
text: "cetak wtd ini?",
showCloseButton: true,
showCancelButton: true,
focusConfirm: false,
confirmButtonText:
'Ya',
cancelButtonText:
'Tidak',
}).then((result) => {
if (result.isConfirmed) {
if (this.selectedNorujukan.length > 0) {
await this.$swal({
icon: 'info',
title: '<strong>Cetak WTD</strong>',
html: "Sila tekan <b>Cetak</b> untuk mencetak senarai SAG yang ingin dituntut,Sila tekan <b>Ya</b> untuk block SAG!",
showCloseButton: true,
showCancelButton: true,
showDenyButton: true,
// focusConfirm: false,
confirmButtonText: 'Ya',
cancelButtonText: 'Tidak',
denyButtonText: `Cetak`,
confirmButtonColor: '#2ecc71',
denyButtonColor: '#f39c12',
cancelButtonColor: '#e74c3c',
allowOutsideClick: false,
}).then((result) => {
if (result.isConfirmed) {
this.blockwtd();
this.blockwtd();
}
})
} else if (result.isDenied) {
// Swal.fire('Changes are not saved', '', 'info')
this.cetaksenarai();
}
})
}else{
this.$swal(
'Amaran!',
'Sila pilih norujukan terlebih dahulu!',
'warning'
)
}
},
proseswtd: function () {
this.axios.post(ref.$hostname + '/admin/wtd/process', {
kodcaw: cawangan,
norujukan: ref.selectedNorujukan
this.axios.post(this.$hostname + '/admin/wtd/process', {
kodcaw: this.cawangan,
batch: this.batchno
}).then(response => {
if (response.data == 'success') {
this.$swal(
'Berjaya!',
'Berjaya Simpan Wang Tak Dituntut!',
'success'
)
this.blockseterusnya = true;
this.boolblocksag = false;
}
});
},
cetaksenarai: function () {
let urldirect = window.route('wtd.cetak');
let noruj = JSON.stringify(this.selectedNorujukan);
window.open(urldirect + '?cawangan=' + this.cawangan + '&&norujukan=' + noruj, '_blank');
}
}
}
+13
View File
@@ -0,0 +1,13 @@
<template>
<div>
<div class="mx-auto mt-10 mb-10 flex justify-center">
<router-link to="/wtd/rekod">
<button class="bg-yellow-500 p-4 rounded text-white mr-4">Rekod WTD</button>
</router-link>
<router-link to="/wtd/tambah">
<button class="bg-yellow-500 p-4 rounded text-white">Tambah WTD</button>
</router-link>
</div>
</div>
</template>
+11 -1
View File
@@ -31,6 +31,11 @@ import RekodMohon from './Permohonan/RekodMohon'
import WtdPage from './WTD/wtd'
import Wtdselect from './WTD/selection'
import WtdRekod from './WTD/Rekod'
import WtdSpecific from './WTD/SelectWTD'
@@ -67,7 +72,12 @@ export default new VueRouter({
{ name: 'permohonanstatus',path: '/permohonan/status/:mohonid', component: StatusMohon },
{ path: '/permohonan/rekod', component: RekodMohon },
{ path: '/wtd', component: WtdPage },
{ path: '/wtd', component: Wtdselect },
{ path: '/wtd/tambah', component: WtdPage },
{ path: '/wtd/rekod', component: WtdRekod },
{ name: '/selectwtd',path: '/wtd/select/:batchno', component: WtdSpecific },
],
mode: 'history'