form barang bawaan teknisi dan fix bug draft item
This commit is contained in:
@@ -416,7 +416,7 @@ body {
|
||||
<th>Kode Karyawan</th>
|
||||
<th>Departemen</th>
|
||||
<th style="width:100px">Jumlah Item</th>
|
||||
<th style="width:80px">Aksi</th>
|
||||
<th style="width:140px">Aksi</th>
|
||||
</tr>
|
||||
</thead>
|
||||
</table>
|
||||
@@ -494,7 +494,67 @@ body {
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- ============================================================ -->
|
||||
<!-- MODAL FORM BARANG BAWAAN TEKNISI -->
|
||||
<!-- ============================================================ -->
|
||||
<div class="modal fade tech-modal" id="modalFormBarangBawaan" tabindex="-1" data-bs-backdrop="static">
|
||||
<div class="modal-dialog modal-xl modal-dialog-scrollable">
|
||||
<div class="modal-content">
|
||||
<div class="modal-header">
|
||||
<h5 class="modal-title"><i class="bi bi-file-earmark-text me-2"></i> Form Barang Bawaan Teknisi</h5>
|
||||
<button type="button" class="btn-close btn-close-white" data-bs-dismiss="modal"></button>
|
||||
</div>
|
||||
<div class="modal-body">
|
||||
|
||||
<!-- Header Info -->
|
||||
<div class="row g-2 mb-3" id="formBarangInfo">
|
||||
<div class="col-md-12">
|
||||
<div class="teknisi-badge">
|
||||
<div class="row">
|
||||
<div class="col-md-4">
|
||||
<small class="text-muted">No. Faktur</small><br>
|
||||
<strong id="fbNoFaktur">-</strong>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<small class="text-muted">Tanggal</small><br>
|
||||
<strong id="fbTanggal">-</strong>
|
||||
</div>
|
||||
<div class="col-md-4">
|
||||
<small class="text-muted">Teknisi</small><br>
|
||||
<strong id="fbTeknisi">-</strong>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<!-- Data table -->
|
||||
<h6 class="fw-bold mb-2"><i class="bi bi-box me-1"></i> Barang Bawaan</h6>
|
||||
<div class="table-responsive">
|
||||
<table id="tableFormBarang" class="table table-tech table-hover table-striped align-middle w-100">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width:50px">No</th>
|
||||
<th>Barcode</th>
|
||||
<th>Nama Barang</th>
|
||||
<th>Serial Number</th>
|
||||
<th style="width:20px">Jumlah</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody></tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
</div>
|
||||
<div class="modal-footer">
|
||||
<button type="button" class="btn btn-danger" id="btnCetakPDF">
|
||||
<i class="bi bi-file-pdf me-1"></i> PDF
|
||||
</button>
|
||||
<button type="button" class="btn btn-secondary" data-bs-dismiss="modal">Tutup</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script>
|
||||
let kembalikanData = [];
|
||||
@@ -688,6 +748,63 @@ $(function(){
|
||||
$('#modalDetailTeknisi').modal('show');
|
||||
}
|
||||
|
||||
// =============================================================
|
||||
// FORM BARANG BAWAAN TEKNISI
|
||||
// =============================================================
|
||||
|
||||
let dtFormBarang;
|
||||
let _formBarangUserId = null;
|
||||
|
||||
$(document).on('click', '.btn-form-barang-bawaan', function(){
|
||||
let userId = $(this).data('id');
|
||||
let nama = $(this).data('nama');
|
||||
_formBarangUserId = userId;
|
||||
|
||||
$('#fbNoFaktur').text('Memuat...');
|
||||
$('#fbTanggal').text('-');
|
||||
$('#fbTeknisi').text(nama);
|
||||
|
||||
$.get("<?= base_url('teknisi/get_form_barang_bawaan_data'); ?>", {user_id: userId}, function(r){
|
||||
if (!r.status) {
|
||||
Swal.fire({icon:'error', text:r.message});
|
||||
return;
|
||||
}
|
||||
|
||||
let d = r.data;
|
||||
$('#fbNoFaktur').text(d.no_faktur);
|
||||
$('#fbTanggal').text(d.tanggal);
|
||||
$('#fbTeknisi').text(d.teknisi);
|
||||
|
||||
if (dtFormBarang) {
|
||||
dtFormBarang.destroy();
|
||||
}
|
||||
|
||||
dtFormBarang = $('#tableFormBarang').DataTable({
|
||||
data: d.items,
|
||||
columns: [
|
||||
{ data: 'no' },
|
||||
{ data: 'barcode' },
|
||||
{ data: 'nama_barang' },
|
||||
{ data: 'serial_number' },
|
||||
{ data: 'jumlah', className: 'text-center' }
|
||||
],
|
||||
language: { url: "//cdn.datatables.net/plug-ins/1.13.6/i18n/id.json" },
|
||||
pageLength: 10,
|
||||
lengthMenu: [[10, 25, 50, -1], [10, 25, 50, 'All']],
|
||||
order: []
|
||||
});
|
||||
}, 'json');
|
||||
|
||||
$('#modalFormBarangBawaan').modal('show');
|
||||
});
|
||||
|
||||
$('#btnCetakPDF').click(function(){
|
||||
if (_formBarangUserId) {
|
||||
let url = "<?= base_url('teknisi/generate_pdf_barang_bawaan/'); ?>" + _formBarangUserId;
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
});
|
||||
|
||||
// =============================================================
|
||||
// SCAN: MODE KEMBALIKAN
|
||||
// =============================================================
|
||||
@@ -992,7 +1109,7 @@ $(function(){
|
||||
|
||||
Swal.fire({
|
||||
title: 'Konfirmasi Transfer',
|
||||
text: barcodes.length + ' barang akan ditransfer',
|
||||
html: barcodes.length + ' barang akan ditransfer ke teknisi<br>' + ($('#teknisiTo option:selected').text() || ''),
|
||||
icon: 'question',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#007bff',
|
||||
@@ -1066,7 +1183,7 @@ $(function(){
|
||||
|
||||
Swal.fire({
|
||||
title: 'Konfirmasi Penugasan',
|
||||
text: dibawaData.length + ' barang akan ditugaskan ke teknisi terpilih',
|
||||
html: dibawaData.length + ' barang akan ditugaskan ke teknisi<br>' + ($('#teknisiDibawa option:selected').text() || ''),
|
||||
icon: 'question',
|
||||
showCancelButton: true,
|
||||
confirmButtonColor: '#28a745',
|
||||
|
||||
Reference in New Issue
Block a user