function barang kes di admin v2
This commit is contained in:
@@ -0,0 +1,56 @@
|
|||||||
|
<?php
|
||||||
|
|
||||||
|
namespace App\Http\Controllers;
|
||||||
|
|
||||||
|
use Illuminate\Http\Request;
|
||||||
|
use Illuminate\Support\Facades\Auth;
|
||||||
|
use Illuminate\Support\Facades\Session;
|
||||||
|
use Illuminate\Support\Facades\Http;
|
||||||
|
use Carbon\Carbon;
|
||||||
|
|
||||||
|
class BarangKesController extends Controller
|
||||||
|
{
|
||||||
|
// lebih kurg mcm index
|
||||||
|
public function AdminBarangKes(Request $request)
|
||||||
|
{
|
||||||
|
$api_url = config('api.url');
|
||||||
|
$auth_user = Auth::user();
|
||||||
|
// dd($api_url);
|
||||||
|
return view('barangkes.barangkes',compact('api_url','auth_user'));
|
||||||
|
// return view('barangkes.index', compact('data'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function Detailssag(Request $request, $id)
|
||||||
|
{
|
||||||
|
$api_url = config('api.url');
|
||||||
|
$auth_user = Auth::user();
|
||||||
|
|
||||||
|
// ambil customer info
|
||||||
|
$customer_info = Http::get($api_url . '/admin/Customers/' . $id)->json();
|
||||||
|
// dd($customer_info);
|
||||||
|
// ambil gadai info (by kodcaw + norujukan dari route)
|
||||||
|
// $gadai = null;
|
||||||
|
if (!empty($customer_info['kodcaw']) && !empty($norujukan)) {
|
||||||
|
$gadai = Http::get($api_url . '/api/gadai/norujukan/'
|
||||||
|
. $customer_info['kodcaw'] . '/' . $norujukan)->json();
|
||||||
|
}
|
||||||
|
|
||||||
|
$gadai = Http::get($api_url . '/api/gadai/norujukan/' . $request->kodcaw . '/' . $request->norujukan)->json();
|
||||||
|
$gadai = $gadai[0];
|
||||||
|
|
||||||
|
return view('pelanggan.detailssag', compact('api_url', 'auth_user', 'customer_info', 'gadai'));
|
||||||
|
}
|
||||||
|
|
||||||
|
public function store(Request $request, $id){
|
||||||
|
|
||||||
|
$api_url = config('api.url');
|
||||||
|
$customer_info = Http::get($api_url . '/admin/Customers/' . $id)->json();
|
||||||
|
// $auth_user = Auth::user();
|
||||||
|
// dd($customer_info);
|
||||||
|
|
||||||
|
return view('pelanggan.detailssag', ['customer' => $customer_info,'kodcaw' => $request->query('kodcaw'),'norujukan' => $request->query('norujukan'),
|
||||||
|
]);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
Vendored
+8
-2
@@ -215,14 +215,20 @@ Vue.component('tunai-component', require('./components/Tunai.vue').default)
|
|||||||
Vue.component('petibesi-component', require('./components/Petibesi.vue').default)
|
Vue.component('petibesi-component', require('./components/Petibesi.vue').default)
|
||||||
Vue.component('cawangan-component', require('./components/Cawangan.vue').default)
|
Vue.component('cawangan-component', require('./components/Cawangan.vue').default)
|
||||||
Vue.component('modal-component', require('./components/util/Modal.vue').default)
|
Vue.component('modal-component', require('./components/util/Modal.vue').default)
|
||||||
Vue.component('searchpelanggan-component', require('./components/Searchpelanggan.vue').default)
|
Vue.component('searchpelanggan-component', require('./components/Searchpelanggan.vue').default) //refer sini nnti
|
||||||
|
|
||||||
|
Vue.component('searchbarangkes-component', require('./components/Searchbarangkes.vue').default) //refer sini nnti copy nnti buat utk sag
|
||||||
|
|
||||||
Vue.component('laporanakaun-component', require('./Akaun/Laporan.vue').default)
|
Vue.component('laporanakaun-component', require('./Akaun/Laporan.vue').default)
|
||||||
Vue.component('online-component', require('./Online/Online.vue').default)
|
Vue.component('online-component', require('./Online/Online.vue').default)
|
||||||
Vue.component('noticelelong-component', require('./pages/NotisLelong.vue').default)
|
Vue.component('noticelelong-component', require('./pages/NotisLelong.vue').default)
|
||||||
Vue.component('noticelelong2-component', require('./pages/NotisLelongFasa2.vue').default)
|
Vue.component('noticelelong2-component', require('./pages/NotisLelongFasa2.vue').default)
|
||||||
Vue.component('kelulusan-component', require('./Kelulusan/TableKelulusan.vue').default)
|
Vue.component('kelulusan-component', require('./Kelulusan/TableKelulusan.vue').default)
|
||||||
|
|
||||||
Vue.component('details-pelanggan', require('./pages/Detailspelanggan.vue').default)
|
Vue.component('details-pelanggan', require('./pages/Detailspelanggan.vue').default) // refer sini jugak nnti utk sag searching
|
||||||
|
|
||||||
|
Vue.component('details-sag', require('./pages/Detailssag.vue').default) // refer sini jugak nnnti utk sag searching
|
||||||
|
|
||||||
Vue.component('blacklist-pelanggan', require('./pages/Blacklist.vue').default)
|
Vue.component('blacklist-pelanggan', require('./pages/Blacklist.vue').default)
|
||||||
|
|
||||||
Vue.component('harian-component', require('./components/Analisa/Harian.vue').default)
|
Vue.component('harian-component', require('./components/Analisa/Harian.vue').default)
|
||||||
|
|||||||
@@ -0,0 +1,197 @@
|
|||||||
|
<template>
|
||||||
|
<div class="container w-full max-w-xl mx-auto mt-10 px-4 font-sans">
|
||||||
|
<form class="bg-white w-full shadow-md rounded-lg px-8 pt-6 pb-4 mb-4" onclick="return false">
|
||||||
|
<div class="mb-4 w-96 mx-auto">
|
||||||
|
<label class="block text-gray-500 font-medium text-sm mb-2">SAG</label>
|
||||||
|
<div class="flex flex-wrap">
|
||||||
|
<div class="flex flex-row w-96 mx-auto">
|
||||||
|
|
||||||
|
<div class="flex flex-col w-96">
|
||||||
|
<input id="frminput" type="text" ref="btnDropdownRef" placeholder="Masukkan No Rujukan SAG" class="mr-2 bg-gray-200 appearance-none border-2 border-gray-200 rounded w-full py-2 px-4 text-gray-700 leading-tight focus:outline-none focus:bg-white focus:border-blue-500" />
|
||||||
|
|
||||||
|
<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" role="menuitem" tabindex="-1" id="menu-item-0" :href="Urlredirect({ cust: cust.id })" v-on:click="ClickUrl($event)">{{ 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>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import { createPopper } from "@popperjs/core";
|
||||||
|
|
||||||
|
export default{
|
||||||
|
props: {
|
||||||
|
placement: {
|
||||||
|
type: String,
|
||||||
|
default: "bottom-start"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
dropdownShow: false,
|
||||||
|
param1: "",
|
||||||
|
arrayCustomer: [],
|
||||||
|
tempcaw: '',
|
||||||
|
tempnorujukan: '',
|
||||||
|
}
|
||||||
|
},
|
||||||
|
mounted() {
|
||||||
|
document.addEventListener('click', this.onClick);
|
||||||
|
},
|
||||||
|
beforeDestroy() {
|
||||||
|
document.removeEventListener('click', this.onClick);
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
// async toggleDropdown(){
|
||||||
|
|
||||||
|
// await this.getData()
|
||||||
|
// await this.$nextTick()
|
||||||
|
|
||||||
|
// if(this.arrayCustomer.length > 0)
|
||||||
|
// {
|
||||||
|
// console.log('masuk');
|
||||||
|
// this.dropdownShow = true;
|
||||||
|
// createPopper(this.$refs.btnDropdownRef, this.$refs.popoverDropdownRef, {
|
||||||
|
// placement: "bottom-start",
|
||||||
|
// modifiers: [{
|
||||||
|
// name: "preventOverflow",
|
||||||
|
// }]
|
||||||
|
// });
|
||||||
|
|
||||||
|
// }
|
||||||
|
// else{
|
||||||
|
// console.log('siap')
|
||||||
|
// }
|
||||||
|
|
||||||
|
// },
|
||||||
|
async toggleDropdown() {
|
||||||
|
await this.getData();
|
||||||
|
await this.$nextTick();
|
||||||
|
|
||||||
|
if (this.arrayCustomer.length > 0) {
|
||||||
|
console.log('masuk');
|
||||||
|
this.dropdownShow = true;
|
||||||
|
createPopper(this.$refs.btnDropdownRef, this.$refs.popoverDropdownRef, {
|
||||||
|
placement: "bottom-start",
|
||||||
|
modifiers: [{ name: "preventOverflow" }]
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
console.log('siap');
|
||||||
|
}
|
||||||
|
},
|
||||||
|
async getPrefix(value){
|
||||||
|
let tempcaw = '';
|
||||||
|
let kodcaw = '';
|
||||||
|
tempcaw = value.slice(0,6)
|
||||||
|
|
||||||
|
// if (/^[A-Za-z]/.test(value)) {
|
||||||
|
// // Kalau mula dengan huruf → ambil 3 char
|
||||||
|
// tempcaw = value.slice(0, 3);
|
||||||
|
// } else if (/^\d/.test(value)) {
|
||||||
|
// // Kalau mula dengan nombor → ambil 5 char
|
||||||
|
// tempcaw = value.slice(0, 5);
|
||||||
|
// }
|
||||||
|
|
||||||
|
kodcaw = await this.compareCawangan(tempcaw)
|
||||||
|
|
||||||
|
if(kodcaw) return kodcaw; else null;
|
||||||
|
|
||||||
|
// return null; // fallback kalau tak match
|
||||||
|
},
|
||||||
|
compareCawangan: function(kodcaw){
|
||||||
|
return this.axios.get('/api/check/cawangan')
|
||||||
|
.then(response => {
|
||||||
|
let cawanganlist = response.data;
|
||||||
|
let prefix = kodcaw;
|
||||||
|
let exactMatch = cawanganlist.find(item =>
|
||||||
|
item.kodcaw.toLowerCase() === prefix.toLowerCase()
|
||||||
|
);
|
||||||
|
|
||||||
|
// if (exactMatch) return { ...exactMatch, matchType: 'exact' };
|
||||||
|
if (exactMatch) return exactMatch.kodcaw;
|
||||||
|
|
||||||
|
|
||||||
|
// Contains match
|
||||||
|
let containsMatch = cawanganlist.find(item =>
|
||||||
|
item.kodcaw.toLowerCase().includes(prefix.toLowerCase()) ||
|
||||||
|
prefix.toLowerCase().includes(item.kodcaw.toLowerCase())
|
||||||
|
);
|
||||||
|
|
||||||
|
return containsMatch ? containsMatch.kodcaw : null;
|
||||||
|
// return containsMatch ? { ...containsMatch, matchType: 'contains' } : null;
|
||||||
|
})
|
||||||
|
.catch(error => {
|
||||||
|
console.error('Error fetching cawangan:', error);
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
},
|
||||||
|
async getData() {
|
||||||
|
let inputvalue = document.getElementById("frminput").value;
|
||||||
|
let kodcaw = await this.getPrefix(inputvalue);
|
||||||
|
|
||||||
|
this.tempcaw = kodcaw;
|
||||||
|
this.tempnorujukan = inputvalue;
|
||||||
|
|
||||||
|
if (inputvalue && /-/.test(inputvalue)) {
|
||||||
|
try {
|
||||||
|
let response = await this.axios.get(this.$hostname + '/admin/searchBySag', {
|
||||||
|
params: {
|
||||||
|
norujukan: inputvalue,
|
||||||
|
kodcaw: kodcaw
|
||||||
|
}
|
||||||
|
});
|
||||||
|
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 = []
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
},
|
||||||
|
Urlredirect: function(options) {
|
||||||
|
// const inputElement = document.getElementById('frminput');
|
||||||
|
// const value = inputElement.value;
|
||||||
|
// return window.route('pelanggan.detailssag', options.cust)
|
||||||
|
return window.route('pelanggan.detailssag', options.cust) + '?norujukan=' + this.tempnorujukan + '&kodcaw=' + this.tempcaw;
|
||||||
|
},
|
||||||
|
|
||||||
|
ClickUrl: function(e){
|
||||||
|
window.location.href = e.target.getAttribute('href');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
</script>
|
||||||
@@ -0,0 +1,194 @@
|
|||||||
|
<template>
|
||||||
|
<div class="container w-full max-w-7xl mx-auto mt-10 px-4 font-sans">
|
||||||
|
<div class="bg-white shadow rounded-lg">
|
||||||
|
<!-- Customer Info -->
|
||||||
|
<div v-if="customer" class="p-6 border-b">
|
||||||
|
<h2 class="text-lg font-bold mb-2">Maklumat Customer</h2>
|
||||||
|
<p><strong>Nama:</strong> {{ customer.nama }}</p>
|
||||||
|
<p><strong>No Telefon:</strong> {{ customer.telefon }}</p>
|
||||||
|
<p><strong>KP Baru:</strong> {{ customer.kpbaru }}</p>
|
||||||
|
<p><strong>No Rujukan:</strong> {{ gadaiItem.norujukan }}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Tab Title -->
|
||||||
|
<div class="border-b flex">
|
||||||
|
<a id="sag"
|
||||||
|
href="#"
|
||||||
|
class="px-6 py-3 font-semibold text-blue-600 border-b-2 border-blue-600">
|
||||||
|
Maklumat SAG
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="showSag" class="p-6">
|
||||||
|
<form @submit.prevent="submit" class="space-y-6">
|
||||||
|
<div class="grid grid-cols-2 gap-6" v-if="gadaiItem">
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-700">No Rujukan</label>
|
||||||
|
<input v-model="gadaiItem.norujukan" class="mt-1 block w-full rounded-md border-gray-00 shadow-sm" required />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-700">Tarikh</label>
|
||||||
|
<input v-model="gadaiItem.t_gadai" type="date" class="mt-1 block w-full rounded-md border-gray-500 shadow-sm" required />
|
||||||
|
</div>
|
||||||
|
<!-- <div>
|
||||||
|
<label class="block text-sm font-medium text-gray-700">Teller</label>
|
||||||
|
<input v-model="customer.teller" class="mt-1 block w-full rounded-md border-gray-500 shadow-sm" required />
|
||||||
|
</div> -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-700">Pinjaman (RM)</label>
|
||||||
|
<input v-model="gadaiItem.pinjaman" type="number" step="0.01" class="mt-1 block w-full rounded-md border-gray-500 shadow-sm" required />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-700">Nilai Marhun (RM)</label>
|
||||||
|
<input v-model="gadaiItem.nilaimarhun" type="number" step="0.01" class="mt-1 block w-full rounded-md border-gray-500 shadow-sm" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-700">JBG</label>
|
||||||
|
<input v-model="gadaiItem.jbg" class="mt-1 block w-full rounded-md border-gray-500 shadow-sm" />
|
||||||
|
</div>
|
||||||
|
<!-- <div>
|
||||||
|
<label class="block text-sm font-medium text-gray-700">Tunggakan (RM)</label>
|
||||||
|
<input v-model="gadaiItem.tunggakan" type="number" step="0.01" class="mt-1 block w-full rounded-md border-gray-500 shadow-sm" />
|
||||||
|
</div> -->
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-700">Keuntungan 1% (RM)</label>
|
||||||
|
<input v-model="gadaiItem.tunggakanonepercent" type="number" step="0.01" class="mt-1 block w-full rounded-md border-gray-500 shadow-sm" />
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label class="block text-sm font-medium text-gray-700">Lain-lain caj (RM)</label>
|
||||||
|
<input v-model="gadaiItem.tunggakanujrah" type="number" step="0.01" class="mt-1 block w-full rounded-md border-gray-500 shadow-sm" />
|
||||||
|
</div>
|
||||||
|
<!-- <div>
|
||||||
|
<label class="block text-sm font-medium text-gray-700">Nota</label>
|
||||||
|
<textarea v-model="gadaiItem.nota" class="mt-1 block w-full rounded-md border-gray-500 shadow-sm"></textarea>
|
||||||
|
</div> -->
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Buttons -->
|
||||||
|
<div class="flex justify-end space-x-2">
|
||||||
|
<button type="button"
|
||||||
|
@click="daftar"
|
||||||
|
class="px-4 py-2 bg-gray-600 text-white rounded-md shadow hover:bg-gray-700">
|
||||||
|
Daftar
|
||||||
|
</button>
|
||||||
|
|
||||||
|
<button type="submit"
|
||||||
|
class="px-4 py-2 bg-blue-600 text-white rounded-md shadow hover:bg-blue-700">
|
||||||
|
Kemaskini
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</form>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import Swal from 'sweetalert2'
|
||||||
|
import axios from 'axios'
|
||||||
|
|
||||||
|
export default {
|
||||||
|
props: {
|
||||||
|
kodcaw: { type: String, required: true },
|
||||||
|
customer: { type: Object, required: true },
|
||||||
|
gadai: { type: Object, default: () => ({}) }
|
||||||
|
},
|
||||||
|
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
gadaiItem: {
|
||||||
|
norujukan: '',
|
||||||
|
t_gadai: '',
|
||||||
|
pinjaman: '',
|
||||||
|
teller: '',
|
||||||
|
nilaimarhun: '',
|
||||||
|
jbg: '',
|
||||||
|
nota: '',
|
||||||
|
tunggakan: '',
|
||||||
|
tunggakanonepercent: '',
|
||||||
|
tunggakanujrah: ''
|
||||||
|
},
|
||||||
|
showSag: true,
|
||||||
|
loading: false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
mounted() {
|
||||||
|
console.log("Props diterima:", this.customer)
|
||||||
|
console.log('gadai Item:', this.gadai);
|
||||||
|
if (this.gadai && Object.keys(this.gadai).length > 0) {
|
||||||
|
this.gadaiItem = this.gadai
|
||||||
|
} else if (this.customer?.norujukan) {
|
||||||
|
this.fetchGadaiByNorujukan(this.customer.norujukan)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
methods: {
|
||||||
|
async fetchGadaiByNorujukan(norujukan) {
|
||||||
|
this.loading = true
|
||||||
|
try {
|
||||||
|
const url = this.$hostname + '/api/gadai/norujukan/' + this.customer.kodcaw + '/' + norujukan
|
||||||
|
const res = await axios.get(url)
|
||||||
|
this.gadaiItem = res.data || {}
|
||||||
|
} catch (e) {
|
||||||
|
console.error("Gagal fetch data gadai:", e)
|
||||||
|
} finally {
|
||||||
|
this.loading = false
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
async daftar() {
|
||||||
|
try {
|
||||||
|
console.log("Customer data:", this.customer)
|
||||||
|
console.log("Gadai Item:", this.gadaiItem)
|
||||||
|
console.log("kod caw:", this.kodcaw)
|
||||||
|
|
||||||
|
let response = await axios.post(this.$hostname + '/api/barangkes/store', {
|
||||||
|
...this.gadaiItem,
|
||||||
|
})
|
||||||
|
|
||||||
|
if (response.data.success) {
|
||||||
|
Swal.fire({ icon: 'success', title: 'Berjaya', text: response.data.message })
|
||||||
|
} else {
|
||||||
|
Swal.fire({ icon: 'error', title: 'Ralat', text: response.data.message })
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
console.error("Error daftar:", e)
|
||||||
|
Swal.fire({ icon: 'error', title: 'Server Error', text: 'dok jadi' })
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
//fungsi kemaskini (sedia ada)
|
||||||
|
async submit() {
|
||||||
|
try {
|
||||||
|
let response = await axios.put(this.$hostname + '/api/barangkes/update/' + this.gadaiItem.recno, {
|
||||||
|
...this.gadaiItem,
|
||||||
|
})
|
||||||
|
|
||||||
|
if (response.data.success) {
|
||||||
|
Swal.fire({ icon: 'success', title: 'Berjaya', text: response.data.message })
|
||||||
|
} else {
|
||||||
|
Swal.fire({ icon: 'error', title: 'Ralat', text: response.data.message })
|
||||||
|
}
|
||||||
|
} catch (e) {
|
||||||
|
Swal.fire({ icon: 'error', title: 'Server Error', text: 'data tak msk' })
|
||||||
|
}
|
||||||
|
},
|
||||||
|
|
||||||
|
resetForm() {
|
||||||
|
this.gadaiItem = {
|
||||||
|
norujukan: '',
|
||||||
|
tarikh: '',
|
||||||
|
pinjaman: '',
|
||||||
|
nilaimarhun: '',
|
||||||
|
jbg: '',
|
||||||
|
nota: '',
|
||||||
|
tunggakan: '',
|
||||||
|
tunggakanonepercent: '',
|
||||||
|
tunggakanujrah: ''
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
||||||
|
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
@extends('layouts.app')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="bg-gray-900 opacity-50 hidden fixed inset-0 z-10" id="sidebarBackdrop"></div>
|
||||||
|
<div id="main-content" class="h-full w-full bg-gray-50 relative overflow-y-auto">
|
||||||
|
<main>
|
||||||
|
|
||||||
|
<div class="pt-6 px-4">
|
||||||
|
|
||||||
|
<breadcrumb :items="[{ 'title' : 'Pelanggan', 'icon' : 'fas fa-users' },{ 'title' : 'Barangkes', 'icon' : 'fas fa-box' }]"></breadcrumb>
|
||||||
|
|
||||||
|
<searchbarangkes-component kodcaw="{{ Auth::user()->cawangan }}"></searchbarangkes-component>
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
@include('layouts.footer')
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
@@ -179,7 +179,18 @@
|
|||||||
</div>
|
</div>
|
||||||
</li>
|
</li>
|
||||||
</a>
|
</a>
|
||||||
|
<a href="{{ route('barangkes') }}"
|
||||||
|
class="rounded mb-2 mr-2 {{ Route::is('barangkes') || Route::is('barangkes.*') ? 'bg-gray-200 text-white-500' : 'hover:bg-yellow-300' }}">
|
||||||
|
<li class="flex w-full justify-between text-gray-600 hover:text-gray-500 cursor-pointer items-center ">
|
||||||
|
<div class="flex items-center">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="currentColor"
|
||||||
|
class="bi bi-box-seam" viewBox="0 0 16 16">
|
||||||
|
<path d="M3.5 0a.5.5 0 0 0-.5.5v1.086l-1.553.777A.5.5 0 0 0 1 2.8v10.4a.5.5 0 0 0 .276.447l6 3a.5.5 0 0 0 .448 0l6-3A.5.5 0 0 0 14 13.2V2.8a.5.5 0 0 0-.447-.447L12 1.586V.5a.5.5 0 0 0-.5-.5h-8zM2 3.515 7.5 6.309v7.918L2 11.433V3.515zm6 10.712V6.309L14 3.515v7.918l-6 3.294zM12 2v.5L8 4.691 4 2.5V2h8z"/>
|
||||||
|
</svg>
|
||||||
|
<span class="ml-2 text-lg">Barang Kes</span>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</a>
|
||||||
<a href="{{ route('lelong') }}" class="rounded mb-2 mr-2 {{ Route::is('lelong') || Route::is('lelong.*') ? 'bg-gray-200 rounded text-white-500' : 'hover:bg-yellow-300 ' }}">
|
<a href="{{ route('lelong') }}" class="rounded mb-2 mr-2 {{ Route::is('lelong') || Route::is('lelong.*') ? 'bg-gray-200 rounded text-white-500' : 'hover:bg-yellow-300 ' }}">
|
||||||
<li class="flex w-full justify-between text-gray-600 hover:text-gray-500 cursor-pointer items-center ">
|
<li class="flex w-full justify-between text-gray-600 hover:text-gray-500 cursor-pointer items-center ">
|
||||||
<div class="flex items-center">
|
<div class="flex items-center">
|
||||||
|
|||||||
@@ -0,0 +1,21 @@
|
|||||||
|
@extends('layouts.app')
|
||||||
|
|
||||||
|
@section('content')
|
||||||
|
<div class="bg-gray-900 opacity-50 hidden fixed inset-0 z-10" id="sidebarBackdrop"></div>
|
||||||
|
<div id="main-content" class="h-full w-full bg-gray-50 relative overflow-y-auto">
|
||||||
|
<main >
|
||||||
|
|
||||||
|
<div class="pt-6 px-4">
|
||||||
|
|
||||||
|
<breadcrumb :items="[{ 'title' : 'Pelanggan', 'icon' : 'fas fa-users' },{ 'title' : 'Butiran', 'icon' : 'fas fa-users' }]"></breadcrumb>
|
||||||
|
|
||||||
|
<details-sag :customer="{{ json_encode($customer_info) }}" :gadai="{{ json_encode($gadai) }}" kodcaw="{{ Auth::user()->cawangan }}"></details-sag>
|
||||||
|
{{-- <details-sag :customer="{{ json_encode($customer_info) }}" :gadai="{{ json_encode($gadai) }}" kodcaw="{{ Auth::user()->cawangan }}" norujukan="{{ $norujukan }}"></details-sag> --}}
|
||||||
|
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
@include('layouts.footer')
|
||||||
|
|
||||||
|
</div>
|
||||||
|
@endsection
|
||||||
|
|
||||||
@@ -68,6 +68,11 @@ Route::get('pelanggan',['as'=>'pelanggan','uses'=>'App\Http\Controllers\Pelangga
|
|||||||
Route::get('/pelanggan/{id}',['as'=>'pelanggan.detailspelanggan','uses'=>'App\Http\Controllers\PelangganController@DetailsPelanggan'])->middleware(['roleChecker:admin,null,null,null,callcenter']);
|
Route::get('/pelanggan/{id}',['as'=>'pelanggan.detailspelanggan','uses'=>'App\Http\Controllers\PelangganController@DetailsPelanggan'])->middleware(['roleChecker:admin,null,null,null,callcenter']);
|
||||||
Route::get('/blacklist',['as'=>'blacklist','uses'=>'App\Http\Controllers\PelangganController@DetailsBlacklist'])->middleware(['roleChecker:null,null,operasi,null,callcenter']);
|
Route::get('/blacklist',['as'=>'blacklist','uses'=>'App\Http\Controllers\PelangganController@DetailsBlacklist'])->middleware(['roleChecker:null,null,operasi,null,callcenter']);
|
||||||
|
|
||||||
|
//barangkes
|
||||||
|
Route::get('barangkes', ['as' => 'barangkes','uses' => 'App\Http\Controllers\BarangKesController@AdminBarangKes'])->middleware(['roleChecker:admin,null,operasi,null,callcenter']);
|
||||||
|
Route::get('/barangkes/{id}',['as'=>'pelanggan.detailssag','uses'=>'App\Http\Controllers\BarangkesController@Detailssag'])->middleware(['roleChecker:admin,null,operasi,null,callcenter']);
|
||||||
|
Route::post('/barangkes/store/{id}',['as'=>'barangkes.store','uses' => 'App\Http\Controllers\BarangkesController@store'])->middleware(['roleChecker:admin,null,operasi,null,callcenter']);
|
||||||
|
|
||||||
//Carian Pelanggan ARCC
|
//Carian Pelanggan ARCC
|
||||||
Route::get('pelanggan_arcc',['as'=>'pelanggan_arcc','uses'=>'App\Http\Controllers\PelangganController@AdminPelanggan'])->middleware(['roleChecker:admin,null,null,null,callcenter']);
|
Route::get('pelanggan_arcc',['as'=>'pelanggan_arcc','uses'=>'App\Http\Controllers\PelangganController@AdminPelanggan'])->middleware(['roleChecker:admin,null,null,null,callcenter']);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user