warehouse layers [switchable]

This commit is contained in:
Thanakorn S
2026-05-04 13:43:32 +07:00
parent a90975d9f1
commit 414f1cd81d
26 changed files with 2022 additions and 584 deletions
+37 -8
View File
@@ -51,9 +51,9 @@
<th>Lot Number</th>
<th>Serial Number</th>
<th>Quantity</th>
<th>Zone</th>
<th>Aisle</th>
<th>Rack</th>
<th class="th_loc_zone">Zone</th>
<th class="th_loc_aisle">Aisle</th>
<th class="th_loc_rack">Rack</th>
<th>Status</th>
<th>Action</th>
</tr>
@@ -78,6 +78,31 @@
<?php require "../include_ending.php";?>
<script>
var advanced = false;
var label_rack = 'Location';
var label_zone = 'Zone';
var label_aisle = 'Aisle';
function apply_location_labels() {
if (advanced) {
$('.th_loc_zone').text(label_zone).show();
$('.th_loc_aisle').text(label_aisle).show();
$('.th_loc_rack').text(label_rack);
} else {
$('.th_loc_zone, .th_loc_aisle').hide();
$('.th_loc_rack').text(label_rack);
}
}
function location_cells(item) {
if (advanced) {
return `<td class="py-3">${item['zone'] || ''}</td>
<td class="py-3">${item['aisle'] || ''}</td>
<td class="py-3">${item['rack'] || ''}</td>`;
}
return `<td class="py-3">${item['rack'] || ''}</td>`;
}
function retrieve_stock_out() {
return ajax_request({
@@ -129,9 +154,7 @@
<td class="py-3">${item['lot_number'] || '<span class="text-muted">—</span>'}</td>
<td class="py-3">${item['serial_number'] || '<span class="text-muted">—</span>'}</td>
<td class="py-3">${item['quantity']}</td>
<td class="py-3">${item['zone']}</td>
<td class="py-3">${item['aisle']}</td>
<td class="py-3">${item['rack']}</td>
${location_cells(item)}
<td class="py-3">
${item['status'] == 1 ? '<span class="badge bg-success">Approved</span>' : '<span class="badge bg-warning text-dark">Draft</span>'}
</td>
@@ -213,7 +236,13 @@
checkRequired: 0,
action: 'read',
onSuccess: function(res) {
auto_approve = res.output.default_stock_status == 1;
var s = res.output || {};
auto_approve = s.default_stock_status == 1;
advanced = s.advanced_location == 1;
label_rack = s.location_label_rack || (advanced ? 'Rack' : 'Location');
label_zone = s.location_label_zone || 'Zone';
label_aisle = s.location_label_aisle || 'Aisle';
apply_location_labels();
}
});
}
@@ -244,4 +273,4 @@
</body>
</html>
</html>