tangguh lelong

This commit is contained in:
Amir
2022-07-26 13:38:22 +08:00
parent 7111af8bfa
commit 6a867e59f7
4 changed files with 130 additions and 23 deletions
+8 -4
View File
@@ -150,6 +150,10 @@ class MarhunController extends Controller
{
//
}
$marhun = LelongBidMarhun::where('lelongbid_id','=',$bid['id'])->get()->toArray();;
$lelongbid[$index1]['marhun'] = $marhun;
}
return view('marhun.senaraimarhun',compact('lelongbid','lelong_id', 'caw', 'sag', 'dalamproses', 'sdhdisemak', 'sdhdisahkan', 'sdhdisemaktangguhlel',
@@ -403,7 +407,7 @@ class MarhunController extends Controller
$lelongbid->status_semak = 1;
$lelongbid->save();
return redirect()->route('marhun.show',[ $lelongbid->id, $lelong_id ])
return redirect()->route('marhun.senaraimarhun',[ $lelong_id ])
->with('success','Semakan Marhun Berjaya');
}
@@ -844,9 +848,9 @@ class MarhunController extends Controller
$tangguhlelong->nota = $request->nota;}
$tangguhlelong->save();
$updategadai = Gadai::where('norujukan','=',$request->norujukan)->first();
$updategadai->taglel = 0;
$updategadai->update();
// $updategadai = Gadai::where('norujukan','=',$request->norujukan)->first();
// $updategadai->taglel = 0;
// $updategadai->update();
$marhundelete = LelongBid::where('id', $request->lelongbid_id)->delete();
}
+1 -14
View File
@@ -279,25 +279,12 @@
});
var tablemarhun = $('#marhun').DataTable( {
"columnDefs": [
{
"targets": 0,
"orderable": false
},
{
"targets": 9,
"orderable": false
}
],
order: [[1, 'asc']],
// "ordering": false,
"orderFixed": [ 0, 'asc' ],
"info": false,
"lengthChange": false,
"pageLength": 15,
dom: 'Bfrtip',
buttons: [
// 'copy', 'excel', 'pdf'
// { text: 'copy', className: 'btn btn-primary' },
{
className: 'btn btn-outline-success pl-4 pr-4 btn-sm addsim',
text: '<i class="fas fa-plus" id="test"></i>',
+106 -1
View File
@@ -17,7 +17,7 @@
<p><b>Keseluruhan : {{ sizeof($lelongbid) }}</b> </p>
{{-- <p><b>Belum Disemak : {{ sizeof($sag) }}</b></p> --}}
<p><b>Dalam Proses : {{ sizeof($dalamproses) }}</b></p>
<p><b>Sudah Disemak : {{ sizeof($sdhdisemak) }}</b></p>
{{-- <p><b>Sudah Disemak : {{ sizeof($sdhdisemak) }}</b></p> --}}
<p><b>Sudah Disahkan Oleh Operasi : {{ sizeof($sdhdisahkan) }}</b></p>
</div>
<div class="col-6 col-sm-4">
@@ -66,6 +66,7 @@
@endif
</td>
<td class="text-center">
<button type="button" class="btn btn-primary" onclick="kemaskini(this)" data-lelong="{{$bid->lelong_id}}" data-all="{{$bid}}" data-surat="{{$bid->id}}" data-marhun="{{ json_encode($bid->marhun) }}" data-toggle="modal" data-target="#noRujukanModal" ><i class="far fa-edit"></i></button>
<a href="{{ route('marhun.show', [$bid->id, $lelong_id]) }}" data-toggle="tooltip" data-placement="top" title="Senarai Marhun" ><i class="far fa-edit"></i></a>
</td>
</tr>
@@ -79,8 +80,112 @@
</div>
</div>
<div class="modal fade" id="noRujukanModal" data-backdrop="static" data-keyboard="false" tabindex="-1" aria-labelledby="noRujukanModalLabel" aria-hidden="true">
<div class="modal-dialog modal-xl modal-dialog-centered">
<div class="modal-content">
<form id="formsemak" action="" method="GET">
<div class="modal-header">
<h5 class="modal-title" id="titleHeader" value="titleHeader"></h5>
<button type="button" class="close" data-dismiss="modal" aria-label="Close">
<span aria-hidden="true">&times;</span>
</button>
</div>
<div class="modal-body">
<table class="table table-striped text-center table-xl" id="tablemarhun" style="width:100%">
<thead class="bg-primary text-white">
<tr>
<th>Barang</th>
<th>Marhun</th>
<th>Karat</th>
<th>Berat</th>
<th>Harga(RM)</th>
<th>Nilai Marhun</th>
<th>Harga Asas</th>
<th>Nota</th>
<th>Tindakan</th>
</tr>
</thead>
</table>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Tutup</button>
<button type="button" disabled id="semakButton" onclick="confirm()" class="btn btn-success">Semak Marhun <i class="far fa-check-circle"></i></button>
</div>
</form>
</div>
</div>
</div>
</div>
<script>
let all = [];
let surat = '0'
let lelongId = '0'
let marhun = '0'
function kemaskini(e) {
tablemarhun.clear().draw();
all = $(e).data('all');
document.getElementById("titleHeader").innerHTML = all.norujukan;
surat = $(e).data('surat');
lelongId = $(e).data('lelong');
marhun = $(e).data('marhun');
let statusSemak = $(e).data('all').status_semak;
console.log(statusSemak);
if (statusSemak == 1) {
$("#semakButton").prop('disabled', true);
} else if (statusSemak == 0) {
$("#semakButton").prop('disabled', false);
}
marhun.forEach((item, index) => {
var urlroute = '{{ route("marhun.show", [":id", ":id2"]) }}';
urlroute = urlroute.replace(':id', surat);
urlroute = urlroute.replace(':id2', lelongId);
tablemarhun.row.add([
index + 1,
item.marhun,
item.karat,
item.berat,
item.harga,
item.n_marhun,
item.hargaasas,
item.nota,
'<a href="' + urlroute + '" title="Kemaskini Marhun"><i class="far fa-edit"></i></a> ',
]).draw();
});
}
var tablemarhun = $('#tablemarhun').DataTable( {
"orderFixed": [ 0, 'asc' ],
})
function confirm() {
$.confirm({
title: 'Perhatian!',
content: 'Anda pasti telah membuat semakan untuk kesemua marhun?',
type: 'green',
typeAnimated: true,
buttons: {
Batal: {
btnClass: 'btn-default',
action: function () {}
},
Sahkan: {
btnClass: 'btn-success',
action: function () {
var urlroute = '{{ route("marhun.semak", [":id", ":id2"]) }}';
urlroute = urlroute.replace(':id', surat);
urlroute = urlroute.replace(':id2', lelongId);
console.log(urlroute);
$('#formsemak').attr('action', urlroute);
$("#formsemak").submit();
}
}
}
});
}
//Enable tooltips everywhere
$(function () {
$('[data-toggle="tooltip"]').tooltip()
@@ -137,19 +137,23 @@
<label for="message-text" class="col-form-label" style="font-color:red;* "><b>Sila Pilih Sebab Tangguh Lelong:</b></label>
<br>
<br>
<input type="radio" id="mutu" name="nota" value="Perubahan Mutu Tinggi">
<input type="radio" checked onclick="selectRugiBesar()" id="mutu" name="nota" value="Perubahan Mutu Tinggi">
<label for="mutu">Perubahan Mutu Tinggi</label><br>
<input type="radio" id="berat" name="nota" value="Perubahan Berat Besar">
<input type="radio" onclick="selectRugiBesar()" id="berat" name="nota" value="Perubahan Berat Besar">
<label for="berat">Perubahan Berat Besar</label><br>
<input type="radio" id="rugi" name="nota" value="Rugi Besar">
<input type="radio" onclick="selectRugiBesar()" id="rugi" name="nota" value="Rugi Besar">
<label for="rugi">Rugi Besar</label><br>
<input type="radio" name="nota" onclick="selectLain()">
<label for="lainlain">Lain-lain</label><br>
<textarea class="form-control" name="nota" disabled id="lainlain" style="width: 100%;" rows="3"></textarea>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-danger" style="width:15%;" data-dismiss="modal">Batal</button>
<button type="button" class="btn btn-danger" style="width:15%;" onclick="selectRugiBesar()" data-dismiss="modal">Batal</button>
<button type="button" class="btn btn-primary" style="width:15%;" onclick="submit(this)">Sahkan</button>
</div>
</div>
@@ -158,6 +162,13 @@
</div>
</div>
<script>
function selectLain() {
$("#lainlain").attr("disabled", false);
}
function selectRugiBesar() {
$("#lainlain").attr("disabled", true);
$("#lainlain").val("");
}
//Enable tooltips everywhere
$(function () {
$('[data-toggle="tooltip"]').tooltip()