fix table searching issues
parent
4c01a5ee1a
commit
4a94cac214
|
@ -768,6 +768,7 @@ public class ReportingService {
|
||||||
List<CuttingJobCardItemWrapper> wrappers = jobCardItems.stream().map(item -> {
|
List<CuttingJobCardItemWrapper> wrappers = jobCardItems.stream().map(item -> {
|
||||||
CuttingJobCardItemWrapper wrapper = new CuttingJobCardItemWrapper();
|
CuttingJobCardItemWrapper wrapper = new CuttingJobCardItemWrapper();
|
||||||
wrapper.setArticleName(jobCard.getArticleName());
|
wrapper.setArticleName(jobCard.getArticleName());
|
||||||
|
wrapper.setJobCardId(jobCard.getId());
|
||||||
wrapper.setJobCardCode(jobCard.getCode());
|
wrapper.setJobCardCode(jobCard.getCode());
|
||||||
wrapper.setSku(item.getSku());
|
wrapper.setSku(item.getSku());
|
||||||
wrapper.setPoName(jobCard.getPurchaseOrderId());
|
wrapper.setPoName(jobCard.getPurchaseOrderId());
|
||||||
|
@ -781,9 +782,6 @@ public class ReportingService {
|
||||||
jobCardItemsStitchingDetailsMap.computeIfAbsent(accountId, k -> new ArrayList<>()).addAll(wrappers);
|
jobCardItemsStitchingDetailsMap.computeIfAbsent(accountId, k -> new ArrayList<>()).addAll(wrappers);
|
||||||
}
|
}
|
||||||
|
|
||||||
System.out.println(jobCardItemsStitchingDetailsMap);
|
|
||||||
System.out.println(totalStitchingBasedOnAccountID);
|
|
||||||
|
|
||||||
stitchingDetails.put("totalStitchingBasedOnAccountID", totalStitchingBasedOnAccountID);
|
stitchingDetails.put("totalStitchingBasedOnAccountID", totalStitchingBasedOnAccountID);
|
||||||
stitchingDetails.put("jobCardItemsStitchingDetailsMap", jobCardItemsStitchingDetailsMap);
|
stitchingDetails.put("jobCardItemsStitchingDetailsMap", jobCardItemsStitchingDetailsMap);
|
||||||
stitchingDetails.put("Date Wise Stitching", dateWiseProduction);
|
stitchingDetails.put("Date Wise Stitching", dateWiseProduction);
|
||||||
|
|
|
@ -23,7 +23,7 @@
|
||||||
<div class="container">
|
<div class="container">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-sm-12">
|
<div class="col-sm-12">
|
||||||
<table th:if="${#lists.size(transactions) != 0 && #lists != null }" class="table table-bordered font-sm">
|
<table th:if="${#lists.size(transactions) != 0 && #lists != null }" class="table table-bordered font-sm mb-4" data-account-tables>
|
||||||
<thead>
|
<thead>
|
||||||
<tr>
|
<tr>
|
||||||
<th>ID</th>
|
<th>ID</th>
|
||||||
|
@ -62,25 +62,51 @@
|
||||||
</div>
|
</div>
|
||||||
<div th:replace="_fragments :: page-footer-scripts"></div>
|
<div th:replace="_fragments :: page-footer-scripts"></div>
|
||||||
<script th:inline="javascript">
|
<script th:inline="javascript">
|
||||||
(async function () {
|
|
||||||
const $selectAllCheckBox = $('[data-checkbox-all]');
|
|
||||||
|
|
||||||
$selectAllCheckBox.change(function () {
|
// Initialize DataTables for each individual table
|
||||||
if ($selectAllCheckBox.prop('checked')) {
|
$('table[data-account-tables]').each(function () {
|
||||||
// When parent checkbox is checked, check all child checkboxes
|
const $table = $(this);
|
||||||
$('[name="parent-doc-type-ids"]').each(function () {
|
|
||||||
let $this = $(this);
|
// Prevent reinitializing if already done
|
||||||
$this.prop('checked', true);
|
if (!$.fn.DataTable.isDataTable($table)) {
|
||||||
});
|
$table.DataTable({
|
||||||
} else {
|
pageLength: 5,
|
||||||
// When parent checkbox is unchecked, uncheck all child checkboxes
|
searching: true,
|
||||||
$('[name="parent-doc-type-ids"]').each(function () {
|
lengthChange: false,
|
||||||
let $this = $(this);
|
processing: false,
|
||||||
$this.prop('checked', false);
|
dom: `
|
||||||
});
|
<'row'<'col-sm-5'B><'col-sm-7'f>>
|
||||||
}
|
<'row'<'col-sm-12't>>
|
||||||
});
|
<'row'<'col-sm-5'i><'col-sm-7'p>>`,
|
||||||
})(jQuery)
|
buttons: [{
|
||||||
|
extend: 'excel',
|
||||||
|
text: '',
|
||||||
|
className: 'bi bi-file-earmark-spreadsheet btn-sm d-none' // Keep it hidden
|
||||||
|
}]
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
|
||||||
|
(async function () {
|
||||||
|
const $selectAllCheckBox = $('[data-checkbox-all]');
|
||||||
|
|
||||||
|
$selectAllCheckBox.change(function () {
|
||||||
|
if ($selectAllCheckBox.prop('checked')) {
|
||||||
|
// When parent checkbox is checked, check all child checkboxes
|
||||||
|
$('[name="parent-doc-type-ids"]').each(function () {
|
||||||
|
let $this = $(this);
|
||||||
|
$this.prop('checked', true);
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
// When parent checkbox is unchecked, uncheck all child checkboxes
|
||||||
|
$('[name="parent-doc-type-ids"]').each(function () {
|
||||||
|
let $this = $(this);
|
||||||
|
$this.prop('checked', false);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
});
|
||||||
|
})(jQuery)
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
</body>
|
</body>
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml"
|
<html lang="en" xmlns:th="http://www.thymeleaf.org" xmlns:sec="http://www.w3.org/1999/xhtml"
|
||||||
xmlns:ctp="http://www.w3.org/1999/xhtml">
|
xmlns:ctp="http://www.w3.org/1999/xhtml">
|
||||||
|
|
||||||
<head th:replace="_fragments :: head('Cutting Report')"></head>
|
<head th:replace="_fragments :: head('Stitching Report')"></head>
|
||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="container-fluid">
|
<div class="container-fluid">
|
||||||
|
@ -28,7 +28,7 @@
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="mt-3" th:if="${stitching.get('stitchingAccount') != null}"
|
<div class="mt-3" th:if="${stitching.get('stitchingAccount') != null && stitching.get('jobCardItemsStitchingDetailsMap').get(stitchingAccount.id) != null}"
|
||||||
th:each="stitchingAccount, index : ${stitching.get('stitchingAccount')}">
|
th:each="stitchingAccount, index : ${stitching.get('stitchingAccount')}">
|
||||||
<div class="bg-dark text-white py-2 px-3 fs-5 fw-bold text-center mb-2"
|
<div class="bg-dark text-white py-2 px-3 fs-5 fw-bold text-center mb-2"
|
||||||
th:text="${stitchingAccount.title}"></div>
|
th:text="${stitchingAccount.title}"></div>
|
||||||
|
@ -56,7 +56,7 @@
|
||||||
title="Transactions">
|
title="Transactions">
|
||||||
<span data-dropdown-icon-transactions class="bi bi-caret-right-fill"></span>
|
<span data-dropdown-icon-transactions class="bi bi-caret-right-fill"></span>
|
||||||
</td>
|
</td>
|
||||||
<td th:text="${wrap.jobCardId}"></td>
|
<td th:text="${wrap.jobCardCode}"></td>
|
||||||
<td th:text="${wrap.poName}"></td>
|
<td th:text="${wrap.poName}"></td>
|
||||||
<td th:text="${wrap.sku}"></td>
|
<td th:text="${wrap.sku}"></td>
|
||||||
<td th:text="${wrap.articleName}"></td>
|
<td th:text="${wrap.articleName}"></td>
|
||||||
|
@ -69,17 +69,15 @@
|
||||||
</div>
|
</div>
|
||||||
</main>
|
</main>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div th:replace="_fragments :: page-footer-scripts"></div>
|
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
const $body = $('body');
|
const $body = $('body');
|
||||||
|
|
||||||
// Initialize DataTables for each individual table
|
// Initialize DataTables for each individual table
|
||||||
$('table[data-account-table]').each(function () {
|
$('table[data-account-table]').each(function () {
|
||||||
$(this).DataTable({
|
$(this).DataTable({
|
||||||
|
paging: false,
|
||||||
pageLength: 100,
|
pageLength: 100,
|
||||||
searching: true,
|
searching: false,
|
||||||
lengthChange: false,
|
lengthChange: false,
|
||||||
processing: false,
|
processing: false,
|
||||||
dom: `
|
dom: `
|
||||||
|
@ -89,7 +87,7 @@
|
||||||
buttons: [{
|
buttons: [{
|
||||||
extend: 'excel',
|
extend: 'excel',
|
||||||
text: '',
|
text: '',
|
||||||
className: 'bi bi-file-earmark-spreadsheet btn-sm'
|
className: 'bi bi-file-earmark-spreadsheet btn-sm d-none'
|
||||||
}]
|
}]
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue