fix styling opnames and mutations same with stock audit
This commit is contained in:
@@ -182,6 +182,94 @@ use Illuminate\Support\Facades\Auth;
|
||||
.alert ul li {
|
||||
margin-bottom: 0.25rem;
|
||||
}
|
||||
|
||||
/* Select2 styling for mutasi form */
|
||||
.select2-container {
|
||||
width: 100% !important;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single {
|
||||
height: 38px;
|
||||
border: 1px solid #e2e5ec;
|
||||
border-radius: 4px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
padding: 0;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single .select2-selection__rendered {
|
||||
line-height: 36px;
|
||||
padding-left: 12px;
|
||||
padding-right: 30px;
|
||||
color: #74788d;
|
||||
display: block;
|
||||
overflow: hidden;
|
||||
text-overflow: ellipsis;
|
||||
white-space: nowrap;
|
||||
max-width: calc(100% - 30px);
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single .select2-selection__placeholder {
|
||||
color: #74788d;
|
||||
line-height: 36px;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow {
|
||||
height: 36px;
|
||||
right: 8px;
|
||||
top: 1px;
|
||||
width: 20px;
|
||||
display: flex;
|
||||
align-items: center;
|
||||
justify-content: center;
|
||||
}
|
||||
|
||||
.select2-container--default .select2-selection--single .select2-selection__arrow b {
|
||||
border-color: #74788d transparent transparent transparent;
|
||||
border-style: solid;
|
||||
border-width: 5px 4px 0 4px;
|
||||
height: 0;
|
||||
left: 50%;
|
||||
margin-left: -4px;
|
||||
margin-top: -2px;
|
||||
position: absolute;
|
||||
top: 50%;
|
||||
width: 0;
|
||||
}
|
||||
|
||||
/* Hide clear button completely */
|
||||
.select2-container--default .select2-selection--single .select2-selection__clear {
|
||||
display: none !important;
|
||||
}
|
||||
|
||||
.select2-dropdown {
|
||||
border: 1px solid #e2e5ec;
|
||||
border-radius: 4px;
|
||||
z-index: 9999 !important;
|
||||
box-shadow: 0 2px 8px rgba(0,0,0,0.15);
|
||||
}
|
||||
|
||||
.select2-results__option {
|
||||
padding: 8px 12px;
|
||||
line-height: 1.4;
|
||||
}
|
||||
|
||||
.select2-results__option--highlighted {
|
||||
background-color: #5d78ff;
|
||||
color: white;
|
||||
}
|
||||
|
||||
.select2-container--default.select2-container--focus .select2-selection--single {
|
||||
border-color: #5d78ff;
|
||||
outline: 0;
|
||||
box-shadow: 0 0 0 0.2rem rgba(93, 120, 255, 0.25);
|
||||
}
|
||||
|
||||
/* Select2 for table cells - adjust width */
|
||||
#products-table-mutasi .select2-container {
|
||||
width: 100% !important;
|
||||
max-width: 100%;
|
||||
}
|
||||
</style>
|
||||
@endsection
|
||||
|
||||
@@ -1318,6 +1406,9 @@ use Illuminate\Support\Facades\Auth;
|
||||
// Initialize mutasi form
|
||||
updateRemoveButtonsMutasi();
|
||||
|
||||
// Initialize select2 for mutasi form
|
||||
initMutasiSelect2();
|
||||
|
||||
// Check if we should show specific tab (after form submission)
|
||||
@if(session('success') || session('error') || $errors->any())
|
||||
@if(session('active_tab') == 'opname')
|
||||
@@ -1412,6 +1503,12 @@ use Illuminate\Support\Facades\Auth;
|
||||
`);
|
||||
productIndexMutasi = 0;
|
||||
updateRemoveButtonsMutasi();
|
||||
|
||||
// Reinitialize select2
|
||||
setTimeout(function() {
|
||||
initMutasiSelect2();
|
||||
}, 100);
|
||||
|
||||
$("#btn-save-mutasi").attr("disabled", false);
|
||||
$("#btn-save-mutasi").removeClass("disabled");
|
||||
$("#btn-save-mutasi").html('Kirim Mutasi');
|
||||
@@ -1604,6 +1701,22 @@ use Illuminate\Support\Facades\Auth;
|
||||
`;
|
||||
|
||||
$('#products-tbody-mutasi').append(newRow);
|
||||
|
||||
// Initialize select2 for the new product select
|
||||
var newSelect = $(`select[name="products[${productIndexMutasi}][product_id]"]`);
|
||||
newSelect.select2({
|
||||
placeholder: 'Pilih Produk',
|
||||
width: '100%',
|
||||
language: {
|
||||
noResults: function() {
|
||||
return "Tidak ada hasil ditemukan";
|
||||
},
|
||||
searching: function() {
|
||||
return "Mencari...";
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
updateRemoveButtonsMutasi();
|
||||
});
|
||||
|
||||
@@ -1652,6 +1765,13 @@ use Illuminate\Support\Facades\Auth;
|
||||
stockSpan.removeClass('text-info').addClass('text-muted');
|
||||
}
|
||||
});
|
||||
|
||||
// Initialize select2 when mutasi tab is shown
|
||||
$('a[href="#mutasi"]').on('shown.bs.tab', function (e) {
|
||||
setTimeout(function() {
|
||||
initMutasiSelect2();
|
||||
}, 100);
|
||||
});
|
||||
|
||||
// Validate quantity against available stock for mutasi
|
||||
$(document).on('input', '.quantity-input-mutasi', function() {
|
||||
@@ -1687,6 +1807,43 @@ use Illuminate\Support\Facades\Auth;
|
||||
|
||||
|
||||
|
||||
// Initialize Select2 for mutasi form
|
||||
function initMutasiSelect2() {
|
||||
// Initialize select2 for dealer tujuan
|
||||
if ($('#to_dealer_id').length && !$('#to_dealer_id').hasClass('select2-hidden-accessible')) {
|
||||
$('#to_dealer_id').select2({
|
||||
placeholder: 'Pilih Dealer Tujuan',
|
||||
width: '100%',
|
||||
language: {
|
||||
noResults: function() {
|
||||
return "Tidak ada hasil ditemukan";
|
||||
},
|
||||
searching: function() {
|
||||
return "Mencari...";
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Initialize select2 for all product selects
|
||||
$('.product-select-mutasi').each(function() {
|
||||
if (!$(this).hasClass('select2-hidden-accessible')) {
|
||||
$(this).select2({
|
||||
placeholder: 'Pilih Produk',
|
||||
width: '100%',
|
||||
language: {
|
||||
noResults: function() {
|
||||
return "Tidak ada hasil ditemukan";
|
||||
},
|
||||
searching: function() {
|
||||
return "Mencari...";
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
});
|
||||
}
|
||||
|
||||
// Initialize DataTable for receive mutations
|
||||
var receiveMutationsTable;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user