fix skit2

This commit is contained in:
fifi97
2021-12-28 01:23:25 +08:00
parent 53ac187c8c
commit a36340eb10
13 changed files with 1797 additions and 956 deletions
+1177 -563
View File
File diff suppressed because it is too large Load Diff
+19 -19
View File
@@ -12,25 +12,25 @@
</div>
<div class="w-1/4 grid grid-rows-2">
<span class="text-sm ml-2 font-bold -mt-0.5">RM {{ gadaianremaining }}</span>
<span class="text-sm ml-2 font-bold -mt-0.5 xs:invisible">RM {{ gadaianremaining }}</span>
<!-- <span class="text-xs leading-none font-bold text-gray-900 mx-auto flex place-self-center -mt-3 ml-12">remaining.. </span> -->
</div>
</div>
<div class="flex pt-2 -mt-2">
<div class="grid grid-rows-2 ml-1 mt-2 w-1/3">
<div class="grid grid-rows-2 ml-1 mt-2 w-1/2">
<div class="flex">
<span class="text-sm leading-none font-bold text-gray-700 w-1/3 uppercase"> Harian</span>
<span class="text-sm leading-none font-bold text-gray-700">:</span>
<span class="text-sm leading-none font-bold text-gray-700 w-1/4 uppercase"> Harian</span>
<span class="text-sm leading-none font-bold text-gray-700 mr-2">:</span>
<span class="text-sm leading-none font-bold text-gray-700">RM {{ gadaianharian }}</span>
</div>
<div class="flex">
<span class="text-sm leading-none font-bold text-yellow-700 w-1/3 uppercase"> Bajet</span>
<span class="text-sm leading-none font-bold text-gray-700">:</span>
<span class="text-sm leading-none font-bold text-yellow-700 w-1/4 uppercase"> Bajet</span>
<span class="text-sm leading-none font-bold text-gray-700 mr-2">:</span>
<span class="text-sm leading-none font-bold text-yellow-900"> RM {{ bajetgadaian }} </span>
</div>
</div>
<div class="ml-4 text-center w-1/4">
<div class="ml-4 text-center w-1/6">
<!-- <h3 class="text-3xl font-bold -mt-1 text-gray-500">Pembiayaan</h3> -->
<!-- <span class="text-base leading-none font-bold text-gray-900 text-center">{{ this.bulan }} </span> -->
</div>
@@ -75,21 +75,21 @@
</div>
<div class="flex pt-2 -mt-2">
<div class="grid grid-rows-2 ml-1 mt-2 w-1/3">
<div class="grid grid-rows-2 ml-1 mt-2 w-1/2">
<!-- <span class="text-sm leading-none font-bold text-gray-700"><i class="fas fa-calendar-day"></i> RM {{ penebusanharian }}</span>
<span class="text-sm leading-none font-bold text-yellow-900"><i class="fas fa-chart-pie"></i> RM {{ bajetpenebusan }} </span> -->
<div class="flex">
<span class="text-sm leading-none font-bold text-gray-700 w-1/3 uppercase"> Harian</span>
<span class="text-sm leading-none font-bold text-gray-700">:</span>
<span class="text-sm leading-none font-bold text-gray-700 w-1/4 uppercase"> Harian</span>
<span class="text-sm leading-none font-bold text-gray-700 mr-2">:</span>
<span class="text-sm leading-none font-bold text-gray-700">RM {{ penebusanharian }}</span>
</div>
<div class="flex">
<span class="text-sm leading-none font-bold text-yellow-700 w-1/3 uppercase"> Bajet</span>
<span class="text-sm leading-none font-bold text-gray-700">:</span>
<span class="text-sm leading-none font-bold text-yellow-700 w-1/4 uppercase"> Bajet</span>
<span class="text-sm leading-none font-bold text-gray-700 mr-2">:</span>
<span class="text-sm leading-none font-bold text-yellow-900"> RM {{ bajetpenebusan }} </span>
</div>
</div>
<div class="ml-4 text-center w-1/3">
<div class="ml-4 text-center w-1/6">
<!-- <h3 class="text-3xl font-bold -mt-1 text-gray-500">Penebusan</h3>
<span class="text-base leading-none font-bold text-gray-900 text-center">{{ this.bulan }} </span> -->
</div>
@@ -134,21 +134,21 @@
</div>
<div class="flex pt-2 -mt-2">
<div class="grid grid-rows-2 ml-1 mt-2 w-1/3">
<div class="grid grid-rows-2 ml-1 mt-2 w-1/2">
<!-- <span class="text-sm leading-none font-bold text-gray-700"><i class="fas fa-calendar-day"></i> RM {{ keuntunganharian }}</span>
<span class="text-sm leading-none font-bold text-yellow-900"><i class="fas fa-chart-pie"></i> RM {{ bajetkeuntungan }} </span> -->
<div class="flex">
<span class="text-sm leading-none font-bold text-gray-700 w-1/3 uppercase"> Harian</span>
<span class="text-sm leading-none font-bold text-gray-700">:</span>
<span class="text-sm leading-none font-bold text-gray-700 w-1/4 uppercase"> Harian</span>
<span class="text-sm leading-none font-bold text-gray-700 mr-2">:</span>
<span class="text-sm leading-none font-bold text-gray-700">RM {{ keuntunganharian }}</span>
</div>
<div class="flex">
<span class="text-sm leading-none font-bold text-yellow-700 w-1/3 uppercase"> Bajet</span>
<span class="text-sm leading-none font-bold text-gray-700">:</span>
<span class="text-sm leading-none font-bold text-yellow-700 w-1/4 uppercase"> Bajet</span>
<span class="text-sm leading-none font-bold text-gray-700 mr-2">:</span>
<span class="text-sm leading-none font-bold text-yellow-900"> RM {{ bajetkeuntungan }} </span>
</div>
</div>
<div class="ml-4 text-center w-1/3">
<div class="ml-4 text-center w-1/6">
<!-- <h3 class="text-3xl font-bold -mt-1 text-gray-500">Keuntungan</h3>
<span class="text-base leading-none font-bold text-gray-900 text-center">{{ this.bulan }} </span> -->
</div>
+73 -311
View File
@@ -16,309 +16,21 @@
</template>
<script>
export default {
props:{
kodcaw: String
},
data: () => ({
series: [{
name: 'Gadai',
// data: [44, 55, 57, 56, 61, 58, 63, 60, 66, 80, 68]
data:[
{
x: 'Jan',
y: 44,
goals: [
{
name: 'Expected',
value: 32,
strokeHeight: 5,
strokeColor: '#775DD0'
}
]
},
{
x: 'Feb',
y: 55,
goals: [
{
name: 'Expected',
value: 56,
strokeHeight: 5,
strokeColor: '#775DD0'
}
]
},
{
x: 'Mac',
y: 57,
goals: [
{
name: 'Expected',
value: 40,
strokeHeight: 5,
strokeColor: '#775DD0'
}
]
},
{
x: 'Apr',
y: 56,
goals: [
{
name: 'Expected',
value: 77,
strokeHeight: 5,
strokeColor: '#775DD0'
}
]
},
{
x: 'Mei',
y: 61,
goals: [
{
name: 'Expected',
value: 65,
strokeHeight: 5,
strokeColor: '#775DD0'
}
]
},
{
x: 'Jun',
y: 58,
goals: [
{
name: 'Expected',
value: 60,
strokeHeight: 5,
strokeColor: '#775DD0'
}
]
},
{
x: 'Jul',
y: 63,
goals: [
{
name: 'Expected',
value: 43,
strokeHeight: 5,
strokeColor: '#775DD0'
}
]
},
{
x: 'Ogos',
y: 60,
goals: [
{
name: 'Expected',
value: 20,
strokeHeight: 5,
strokeColor: '#775DD0'
}
]
},
{
x: 'Sept',
y: 66,
goals: [
{
name: 'Expected',
value: 60,
strokeHeight: 5,
strokeColor: '#775DD0'
}
]
},
{
x: 'Okt',
y: 80,
goals: [
{
name: 'Expected',
value: 60,
strokeHeight: 5,
strokeColor: '#775DD0'
}
]
},
{
x: 'Nov',
y: 86,
goals: [
{
name: 'Expected',
value: 60,
strokeHeight: 5,
strokeColor: '#775DD0'
}
]
},
{
x: 'Dis',
y: 101,
goals: [
{
name: 'Expected',
value: 60,
strokeHeight: 5,
strokeColor: '#775DD0'
}
]
},
]
data:[]
}, {
name: 'Tebus',
// data: [76, 85, 101, 98, 87, 105, 91, 114, 94, 67, 65]
data:[
{
x: 'Jan',
y: 76,
goals: [
{
name: 'Expected',
value: 80,
strokeHeight: 5,
strokeColor: '#775DD0'
}
]
},
{
x: 'Feb',
y: 85,
goals: [
{
name: 'Expected',
value: 60,
strokeHeight: 5,
strokeColor: '#775DD0'
}
]
},
{
x: 'Mac',
y: 101,
goals: [
{
name: 'Expected',
value: 50,
strokeHeight: 5,
strokeColor: '#775DD0'
}
]
},
{
x: 'Apr',
y: 76,
goals: [
{
name: 'Expected',
value: 56,
strokeHeight: 5,
strokeColor: '#775DD0'
}
]
},
{
x: 'Mei',
y: 85,
goals: [
{
name: 'Expected',
value: 70,
strokeHeight: 5,
strokeColor: '#775DD0'
}
]
},
{
x: 'Jun',
y: 101,
goals: [
{
name: 'Expected',
value: 40,
strokeHeight: 5,
strokeColor: '#775DD0'
}
]
},
{
x: 'Jul',
y: 76,
goals: [
{
name: 'Expected',
value: 44,
strokeHeight: 5,
strokeColor: '#775DD0'
}
]
},
{
x: 'Ogos',
y: 85,
goals: [
{
name: 'Expected',
value: 45,
strokeHeight: 5,
strokeColor: '#775DD0'
}
]
},
{
x: 'Sept',
y: 101,
goals: [
{
name: 'Expected',
value: 80,
strokeHeight: 5,
strokeColor: '#775DD0'
}
]
},
{
x: 'Okt',
y: 101,
goals: [
{
name: 'Expected',
value: 70,
strokeHeight: 5,
strokeColor: '#775DD0'
}
]
},
{
x: 'Nov',
y: 101,
goals: [
{
name: 'Expected',
value: 40,
strokeHeight: 5,
strokeColor: '#775DD0'
}
]
},
{
x: 'Dis',
y: 101,
goals: [
{
name: 'Expected',
value: 80,
strokeHeight: 5,
strokeColor: '#775DD0'
}
]
},
]
data:[]
}],
chartOptions: {
chart: {
id:'bilangan-bulanan',
type: 'bar',
height: 350
},
@@ -333,24 +45,21 @@ export default {
},
},
// dataLabels: {
// enabled: false
// },
dataLabels: {
enabled: true,
style: {
colors: ['#333']
},
offsetY: -30,
style: {
colors: ['#333']
},
offsetY: -30,
formatter: function (val, opt) {
let total = ((val - opt.w.globals.seriesGoals[0][opt.dataPointIndex][0]['value']) / opt.w.globals.seriesGoals[0][opt.dataPointIndex][0]['value']) * 100
if(isNaN(total))
{
return 0.00
}else{
return total.toFixed(2)
}
if(isNaN(total))
{
return 0.00
}else{
return total.toFixed(2)
}
},
},
stroke: {
@@ -358,9 +67,14 @@ export default {
width: 2,
colors: ['transparent']
},
// xaxis: {
// categories: ['Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct','Nov','Dis'],
// },
legend: {
show: true,
showForSingleSeries: true,
customLegendItems: ['Gadai', 'Tebus','Expected'],
markers: {
fillColors: ['#3498db', '#e74c3c','#775DD0']
}
},
yaxis: {
title: {
text: '(Bilangan Orang)'
@@ -380,6 +94,54 @@ export default {
}),
created() {
this.getData();
},
methods: {
getData(){
this.axios.all([
axios.get(`http://localhost:8000/admin/bilangan/gadai`, {
params: {
kodcaw: this.kodcaw
}
}),
axios.get(`http://localhost:8000/admin/bilangan/tebus`, {
params: {
kodcaw: this.kodcaw
}
})
])
.then(this.axios.spread((datagadai, datatebus) => {
this.$apexcharts.exec('bilangan-bulanan', 'updateSeries', [
{
name: 'Gadai',
data: datagadai.data
},
{
name: 'Tebus',
data: datatebus.data
},
])
}));
}
},
mounted () {
var channel = this.$pusher.subscribe('gadai-notify');
channel.bind('trigger-gadai', ({ response }) => {
if(response.cawangan = this.kodcaw)
this.getData()
});
var channel2 = this.$pusher.subscribe('tebus-notify');
channel2.bind('trigger-tebus', ({ response }) => {
if(response.cawangan = this.kodcaw)
this.getData()
});
}
}
</script>
@@ -109,15 +109,17 @@ export default {
var channel = this.$pusher.subscribe('keuntungan-notify');
channel.bind('trigger-keuntungan', ({ response }) => {
console.log(`${response}`);
this.getDatakeuntungan()
// console.log(`${response}`);
if(response.cawangan == this.kodcaw)
this.getDatakeuntungan()
});
var channel2 = this.$pusher.subscribe('tebus-notify');
channel2.bind('trigger-tebus', ({ response }) => {
console.log(`${response}`);
this.getDatakeuntungan()
// console.log(`${response}`);
if(response.cawangan == this.kodcaw)
this.getDatakeuntungan()
});
}
@@ -110,8 +110,9 @@ export default {
var channel = this.$pusher.subscribe('gadai-notify');
channel.bind('trigger-gadai', ({ response }) => {
console.log(`${response}`);
this.getDataPembiayaan()
// console.log(`${response}`);
if(response.cawangan == this.kodcaw)
this.getDataPembiayaan()
});
}
}
@@ -107,8 +107,9 @@ export default {
var channel = this.$pusher.subscribe('tebus-notify');
channel.bind('trigger-tebus', ({ response }) => {
console.log(`${response}`);
this.getDataPenebusan()
// console.log(`${response}`);
if(response.cawangan == this.kodcaw)
this.getDataPenebusan()
});
}
}
+1 -1
View File
@@ -191,7 +191,7 @@ export default {
items: {
type: Array
},
arraytunai: {
arraytunai: {
type: Array
}
},
@@ -0,0 +1,271 @@
<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-1/3 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 Aliran Tunai
</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="text-center text-3xl font-semibold">
Daftar Senarai Hitam
</h3>
<div class="flex flex-wrap mt-4">
<div class="flex flex-row mx-auto">
<div class="flex flex-col">
<input id="frminput" type="text" ref="btnDropdownRef" class="mr-2 bg-white appearance-none border-2 border-gray-400 rounded w-full py-2 px-4 text-gray-700 leading-tight focus:outline-none focus:bg-white focus:border-blue-500 border-black" />
<div ref="popoverDropdownRef" v-bind:class="{'hidden': !dropdownShow, 'block': dropdownShow}" class="origin-top-right w-96 right-0 mt-2 w-56 rounded-md shadow-lg bg-white ring-1 ring-black ring-opacity-5 focus:outline-none" role="menu" aria-orientation="vertical" aria-labelledby="menu-button" tabindex="-1">
<div class="py-1" role="none">
<a v-for="(cust,i) in arrayCustomer" :key="i" class="text-gray-700 block px-4 py-2 text-sm hover:bg-yellow-500 cursor-pointer" role="menuitem" tabindex="-1" id="menu-item-0" v-on:click="ClickUrl({ cust: cust.id })">{{ cust.nama }}<br><b>{{ (cust.kpbaru) ? cust.kpbaru : cust.kplama }}</b></a>
</div>
</div>
</div>
<button id="buttonsearch" class="px-4 py-2 bg-blue-600 rounded ml-2" v-on:click="toggleDropdown()"><i class="fas fa-search text-white"></i></button>
</div>
</div>
<div v-show="this.specCust">
<form class="w-full mx-auto border border-gray-200 px-4 py-4 rounded mt-4">
<div class="w-full px-3 mb-6 md:mb-0">
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2" for="grid-first-name">
Nama
</label>
<input name="nama" class="appearance-none block w-full bg-gray-200 text-gray-700 border border-red-500 rounded py-3 px-4 mb-3 leading-tight focus:outline-none focus:bg-white" :value="this.specCust.nama">
<p class="text-red-500 text-xs italic">Please fill out this field.</p>
</div>
<div class="w-full px-3 mt-3">
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2" for="grid-last-name">
Nokp
</label>
<input name="nokp" class="appearance-none block w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 leading-tight focus:outline-none focus:bg-white focus:border-gray-500" type="text" :value="(this.specCust.kpbaru) ? this.specCust.kpbaru : this.specCust.kplama">
<p class="text-red-500 text-xs italic">Please fill out this field.</p>
</div>
<div class="w-full px-3 mt-3">
<label class="block uppercase tracking-wide text-gray-700 text-xs font-bold mb-2" for="grid-password">
Nota
</label>
<textarea v-model="nota" class="appearance-none block h-36 w-full bg-gray-200 text-gray-700 border border-gray-200 rounded py-3 px-4 mb-3 leading-tight focus:outline-none focus:bg-white focus:border-gray-500"></textarea>
<p class="text-red-500 text-xs italic">Please fill out this field.</p>
</div>
</form>
</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" v-on:click="toggleModal()" type="button">
Batal
</button>
<button class="bg-green-500 hover:bg-green-700 text-white font-bold py-2 px-4 border border-green-700 rounded" type="button">
Daftar
</button>
</div>
</div>
</div>
</div>
</transition>
<transition
enter-active-class="transition-all transform duration-200 ease-out"
>
<div v-if="showModal" class="opacity-25 fixed inset-0 z-40 bg-black"></div>
</transition>
</div>
</template>
<script>
import { createPopper } from "@popperjs/core";
export default {
props: {
placement: {
type: String,
default: "bottom-start"
}
},
name: "modal",
data() {
return {
showModal: false,
kodcaw: '',
dropdownShow: false,
param1: "",
arrayCustomer: [],
specCust: []
}
},
mounted() {
document.addEventListener('click', this.onClick);
},
beforeDestroy() {
document.removeEventListener('click', this.onClick);
},
created(){
console.log(this.kodcaw)
},
methods: {
toggleModal: function(){
this.showModal = !this.showModal;
},
async toggleDropdown() {
await this.getData()
if(this.arrayCustomer.length > 0)
{
this.dropdownShow = true;
createPopper(this.$refs.btnDropdownRef, this.$refs.popoverDropdownRef, {
placement: "bottom-start",
modifiers: [{
name: "preventOverflow",
}]
});
}else{
console.log('siap')
}
},
getData: function() {
let inputvalue = document.getElementById("frminput").value;
if(inputvalue)
{
if(this.hasNumber(inputvalue))
{
this.axios.get('http://localhost:8000/admin/searchByIC', {
params: {
ic: inputvalue
}
}).then(response => {
this.arrayCustomer = response.data
}).catch(error => {
console.log(error)
})
}else{
this.axios.get('http://localhost:8000/admin/searchByName', {
params: {
nama: inputvalue
}
}).then(response => {
this.arrayCustomer = response.data
}).catch(error => {
console.log(error)
})
}
}
},
hasNumber: function(inputString){
return /\d/.test(inputString);
},
onClick: function(){
let isClickInside = this.$refs.popoverDropdownRef.contains(event.target);
let searchInside = this.$refs.btnDropdownRef.contains(event.target);
let buttonSearch = document.getElementById('buttonsearch');
if (isClickInside || searchInside || buttonSearch.contains(event.target)) {
if(buttonSearch.value !== '')
{
this.dropdownShow = true
}
}
else{
if(this.$refs.btnDropdownRef.value != '')
{
this.dropdownShow = false
}else{
this.dropdownShow = false
this.arrayCustomer = []
}
}
},
ClickUrl: function(customer){
console.log(customer.cust)
let self = this
this.arrayCustomer.map(function(value, key) {
if(customer.cust == value.id)
{
self.specCust = value;
}
});
}
// kemaskinifunc: function(){
// // console.log(this.kodcaw + this.kodlaluan + this.tarikh)
// axios.put('/api/check/kemaskinialirantunai',
// {
// kodcaw: this.kodcaw,
// teller: this.kodlaluan,
// tarikh: this.tarikh,
// gadaian: this.gadaian.replace(/[^0-9.-]+/g,""),
// penebusan: this.penebusan.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!")
// // vm.$forceUpdate();
// this.$emit('clickEvent_', this.pageNumber)
// // setTimeout("window.location.reload()", 3000);
// }else{
// this.showModal = false;
// this.$toast.error("Kemaskini tidak berjaya")
// }
// });
// }
},
}
</script>
<style>
.modal-fade-enter,
.modal-fade-leave-to {
opacity: 0;
}
.modal-fade-enter-active,
.modal-fade-leave-active {
transition: opacity .5s ease;
}
</style>
@@ -0,0 +1,152 @@
<template>
<div>
<button @click="show = true">Click</button>
<!-- This example requires Tailwind CSS v2.0+ -->
<transition leave-active-class="duration-300">
<div
v-show="show"
class="fixed z-10 inset-0 overflow-y-auto"
aria-labelledby="modal-title"
role="dialog"
aria-modal="true"
>
<div
class="flex items-end justify-center min-h-screen pt-4 px-4 pb-20 text-center sm:block sm:p-0"
>
<!--
Background overlay, show/hide based on modal state.
Entering: "ease-out duration-300"
From: "opacity-0"
To: "opacity-100"
Leaving: "ease-in duration-200"
From: "opacity-100"
To: "opacity-0"
-->
<transition name="ease-out-overlay">
<div
v-show="show"
class="fixed inset-0 bg-gray-500 bg-opacity-75 transition-opacity"
></div>
</transition>
<!-- This element is to trick the browser into centering the modal contents. -->
<span
class="hidden sm:inline-block sm:align-middle sm:h-screen"
aria-hidden="true"
>&#8203;</span
>
<!--
Modal panel, show/hide based on modal state.
Entering: "ease-out duration-300"
From: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
To: "opacity-100 translate-y-0 sm:scale-100"
Leaving: "ease-in duration-200"
From: "opacity-100 translate-y-0 sm:scale-100"
To: "opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95"
-->
<transition name="ease-out-modal">
<div
v-show="show"
class="inline-block align-bottom bg-white rounded-lg text-left overflow-hidden shadow-xl transform transition-all sm:my-8 sm:align-middle sm:max-w-lg sm:w-full"
>
<div class="bg-white px-4 pt-5 pb-4 sm:p-6 sm:pb-4">
<div class="sm:flex sm:items-start">
<div
class="mx-auto flex-shrink-0 flex items-center justify-center h-12 w-12 rounded-full bg-red-100 sm:mx-0 sm:h-10 sm:w-10"
>
<!-- Heroicon name: outline/exclamation -->
<svg
class="h-6 w-6 text-red-600"
xmlns="http://www.w3.org/2000/svg"
fill="none"
viewBox="0 0 24 24"
stroke="currentColor"
>
<path
stroke-linecap="round"
stroke-linejoin="round"
stroke-width="2"
d="M12 9v2m0 4h.01m-6.938 4h13.856c1.54 0 2.502-1.667 1.732-3L13.732 4c-.77-1.333-2.694-1.333-3.464 0L3.34 16c-.77 1.333.192 3 1.732 3z"
/>
</svg>
</div>
<div class="mt-3 text-center sm:mt-0 sm:ml-4 sm:text-left">
<h3
class="text-lg leading-6 font-medium text-gray-900"
id="modal-title"
>
Deactivate account
</h3>
<div class="mt-2">
<p class="text-sm text-gray-500">
Are you sure you want to deactivate your account? All of
your data will be permanently removed. This action
cannot be undone.
</p>
</div>
</div>
</div>
</div>
<div
class="bg-gray-50 px-4 py-3 sm:px-6 sm:flex sm:flex-row-reverse"
>
<button
@click="show = false"
type="button"
class="w-full inline-flex justify-center rounded-md border border-transparent shadow-sm px-4 py-2 bg-red-600 text-base font-medium text-white hover:bg-red-700 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-red-500 sm:ml-3 sm:w-auto sm:text-sm"
>
Deactivate
</button>
<button
type="button"
class="mt-3 w-full inline-flex justify-center rounded-md border border-gray-300 shadow-sm px-4 py-2 bg-white text-base font-medium text-gray-700 hover:bg-gray-50 focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-indigo-500 sm:mt-0 sm:ml-3 sm:w-auto sm:text-sm"
>
Cancel
</button>
</div>
</div>
</transition>
</div>
</div>
</transition>
</div>
</template>
<script>
export default {
data() {
return {
show: false,
};
},
};
</script>
<style lang="postcss" scoped>
.badge {
@apply inline-block bg-gray-200 rounded-full px-3 py-1 text-sm font-semibold text-gray-700;
&:hover {
@apply bg-gray-300;
}
}
.ease-out-overlay-enter-active,
.ease-out-overlay-leave-active {
@apply opacity-100 duration-300;
}
.ease-out-overlay-enter, .ease-out-overlay-leave-to /* .fade-leave-active below version 2.1.8 */ {
@apply opacity-0 duration-200;
}
.ease-out-modal-enter-active,
.ease-out-modal-leave-active {
@apply opacity-100 translate-y-0 sm:scale-100 duration-300;
}
.ease-out-modal-enter, .ease-out-modal-leave-to /* .fade-leave-active below version 2.1.8 */ {
@apply ease-in opacity-0 translate-y-4 sm:translate-y-0 sm:scale-95 duration-200;
}
</style>
+88 -51
View File
@@ -1,6 +1,18 @@
<template>
<div class="bg-white">
<div class="">
<modal ref="modal"></modal>
<div class="flex justify-between mb-2">
<div>
<button @click.prevent="showModal" class="border border-green-600 text-green-600 font-montserrat py-2 px-3 font-medium rounded-xl hover:bg-green-600 hover:text-white transition-all duration-300"><i class="fas fa-plus mr-2"></i>Tambah</button>
</div>
<div>
<input v-model="search" class="border border-2 rounded px-4 py-2 w-80r mr-2 " type="text" />
<button @click.prevent="searchname" class="mr-2 border border-yellow-600 text-yellow-600 font-montserrat py-2 px-8 font-medium rounded-xl hover:bg-yellow-600 hover:text-white transition-all duration-300"><i class="fas fa-search mr-2"></i>Cari</button>
</div>
</div>
<table class="min-w-full leading-normal">
<thead class="text-center">
<tr>
@@ -8,40 +20,31 @@
Bil
</th>
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
Tarikh
Nama
</th>
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
B/F
IC
</th>
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
Keluar
Teller
</th>
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
Masuk
Pelulus
</th>
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
Pendahuluan
Nota
</th>
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
Serahan
</th>
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
Panjar
</th>
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
Baki Akhir
</th>
<th class="px-5 py-3 border-b-2 border-gray-200 bg-gray-100 text-left text-xs font-semibold text-gray-600 uppercase tracking-wider">
Act
Action
</th>
</tr>
</thead>
<tbody>
<tr v-for="(petibesi,i) in active.vault" :key="i">
<tr v-for="(blacklist,i) in showblacklist.data" :key="i">
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
<div class="flex items-center">
<div class="ml-3">
<p class="text-gray-900 whitespace-no-wrap" v-text="(i+1+active.mulaPage)">
<p class="text-gray-900 whitespace-no-wrap" v-text="(showblacklist.from + i)">
</p>
</div>
</div>
@@ -49,7 +52,7 @@
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
<div class="flex items-center">
<div class="ml-3">
<p class="text-gray-900 whitespace-no-wrap" v-text="petibesi.tarikh">
<p class="text-gray-900 whitespace-no-wrap" v-text="blacklist.nama">
</p>
</div>
</div>
@@ -57,7 +60,7 @@
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
<div class="flex items-center">
<div class="ml-3">
<p class="text-gray-900 whitespace-no-wrap" v-text="formatterfunction(petibesi.bakiawal)">
<p class="text-gray-900 whitespace-no-wrap" v-text="blacklist.nokp">
</p>
</div>
</div>
@@ -65,7 +68,7 @@
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
<div class="flex items-center">
<div class="ml-3">
<p class="text-gray-900 whitespace-no-wrap" v-text="formatterfunction(petibesi.keluar)">
<p class="text-gray-900 whitespace-no-wrap" v-text="blacklist.teller">
</p>
</div>
</div>
@@ -73,7 +76,7 @@
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
<div class="flex items-center">
<div class="ml-3">
<p class="text-gray-900 whitespace-no-wrap" v-text="formatterfunction(petibesi.masuk)">
<p class="text-gray-900 whitespace-no-wrap" v-text="blacklist.pelulus">
</p>
</div>
</div>
@@ -81,7 +84,7 @@
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
<div class="flex items-center">
<div class="ml-3">
<p class="text-gray-900 whitespace-no-wrap" v-text="formatterfunction(petibesi.pendahuluan)">
<p class="text-gray-900 whitespace-no-wrap" v-text="blacklist.nota">
</p>
</div>
</div>
@@ -89,33 +92,9 @@
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
<div class="flex items-center">
<div class="ml-3">
<p class="text-gray-900 whitespace-no-wrap" v-text="formatterfunction(petibesi.serahan)">
</p>
</div>
</div>
</td>
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
<div class="flex items-center">
<div class="ml-3">
<p class="text-gray-900 whitespace-no-wrap" v-text="formatterfunction(petibesi.totpanjar)">
</p>
</div>
</div>
</td>
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
<div class="flex items-center">
<div class="ml-3">
<p class="text-gray-900 whitespace-no-wrap" v-text="formatterfunction(petibesi.bakiakhir)">
</p>
</div>
</div>
</td>
<td class="px-5 py-5 border-b border-gray-200 bg-white text-sm">
<div class="flex items-center">
<div class="ml-3">
<button @click="action(petibesi.tarikh,petibesi.kodcaw)" class="border border-yellow-600 text-yellow-600 font-montserrat py-2 px-4 font-medium rounded-xl hover:bg-yellow-600 hover:text-white transition-all duration-300"><svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor" class="bi bi-card-checklist" viewBox="0 0 16 16">
<path d="M14.5 3a.5.5 0 0 1 .5.5v9a.5.5 0 0 1-.5.5h-13a.5.5 0 0 1-.5-.5v-9a.5.5 0 0 1 .5-.5h13zm-13-1A1.5 1.5 0 0 0 0 3.5v9A1.5 1.5 0 0 0 1.5 14h13a1.5 1.5 0 0 0 1.5-1.5v-9A1.5 1.5 0 0 0 14.5 2h-13z"/>
<path d="M7 5.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5zm-1.496-.854a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 1 1 .708-.708l.146.147 1.146-1.147a.5.5 0 0 1 .708 0zM7 9.5a.5.5 0 0 1 .5-.5h5a.5.5 0 0 1 0 1h-5a.5.5 0 0 1-.5-.5zm-1.496-.854a.5.5 0 0 1 0 .708l-1.5 1.5a.5.5 0 0 1-.708 0l-.5-.5a.5.5 0 0 1 .708-.708l.146.147 1.146-1.147a.5.5 0 0 1 .708 0z"/>
<button class="border border-red-600 text-red-600 font-montserrat py-2 px-4 font-medium rounded-xl hover:bg-red-600 hover:text-white transition-all duration-300">
<svg xmlns="http://www.w3.org/2000/svg" class="h-4 w-4" fill="none" viewBox="0 0 24 24" stroke="currentColor">
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M19 7l-.867 12.142A2 2 0 0116.138 21H7.862a2 2 0 01-1.995-1.858L5 7m5 4v6m4-6v6m1-10V4a1 1 0 00-1-1h-4a1 1 0 00-1 1v3M4 7h16" />
</svg>
</button>
</div>
@@ -125,10 +104,68 @@
</tbody>
</table>
<pagination :data="paginate" @clickEvent_="getBlacklist"></pagination>
</div>
</template>
<script>
import pagination from '../components/pagination.vue'
import modal from '../components/util/BlacklistModal.vue'
export default {
components: {
pagination,
modal
},
props:{
kodcaw: {
type: String
}
},
data(){
return{
currentPage: 1,
showblacklist:[],
paginate:{},
search:''
}
},
created() {
this.getBlacklist(this.currentPage)
},
methods:{
getBlacklist(pageNumber){
this.axios.get('http://localhost:8000/admin/SenaraiBlacklist/' + this.kodcaw,{
params: {
page: pageNumber
}
}).then(response => {
this.showblacklist = response.data
this.paginate = response.data
this.currentPage = pageNumber
});
},
searchname(){
this.axios.get('http://localhost:8000/admin/SenaraiBlacklist/' + this.kodcaw,{
params: {
page: 0,
search: this.search
}
}).then(response => {
console.log(response.data)
this.showblacklist = response.data
this.paginate = response.data
});
},
showModal() {
// let element = this.$refs.modal.$el
// $(element).modal('show')
this.$refs.modal.showModal = true;
}
}
}
</script>
+2 -1
View File
@@ -40,7 +40,8 @@
<option value="Gadai">Gadai</option>
<option value="Penebusan">Penebusan</option>
<option value="Keuntungan">Keuntungan</option>
<option value="Bilangan">Bilangan</option>
<option value="Bilangan-Gadai">Bilangan Gadai</option>
<option value="Bilangan-Tebus">Bilangan Tebus</option>
</select>
<div class="pointer-events-none absolute inset-y-0 right-0 flex items-center px-2 text-gray-700">
<svg class="fill-current h-4 w-4" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 20 20"><path d="M9.293 12.95l.707.707L15.657 8l-1.414-1.414L10 10.828 5.757 6.586 4.343 8z"/></svg>
+1 -1
View File
@@ -42,7 +42,7 @@
</div>
</div>
<bilangan-component></bilangan-component>
<bilangan-component kodcaw={{ Auth::user()->cawangan }}></bilangan-component>
@@ -9,7 +9,7 @@
<breadcrumb :items="[{ 'title' : 'Pelanggan', 'icon' : 'fas fa-users' },{ 'title' : 'Blacklist', 'icon' : 'fas fa-users' }]"></breadcrumb>
<blacklist-pelanggan></blacklist-pelanggan>
<blacklist-pelanggan kodcaw="{{ Auth::user()->cawangan }}"></blacklist-pelanggan>
</div>
</main>