|
|
|
@ -602,6 +602,8 @@ |
|
|
|
<tr> |
|
|
|
<th style="width: 40px;" class="text-center">S.No</th> |
|
|
|
<th>Work Order Detail</th> |
|
|
|
<th class="text-center" style="width: 120px;">Tendered Manpower Count</th> |
|
|
|
<th class="text-center" style="width: 120px;">OnRoll Count</th> |
|
|
|
<!-- <th class="text-center">Tender Count</th> |
|
|
|
<th class="text-center">Vacant Count</th> --> |
|
|
|
</tr> |
|
|
|
@ -1584,7 +1586,8 @@ |
|
|
|
designation: des.designation.trim(), |
|
|
|
tendered_manpower: des.tender_manpower_designation_wise !== null && des.tender_manpower_designation_wise !== undefined ? des.tender_manpower_designation_wise : '0', |
|
|
|
available_manpower: des.available_manpower || '0', |
|
|
|
vacant_count: vacant |
|
|
|
vacant_count: vacant, |
|
|
|
file_path: des.file_path |
|
|
|
}); |
|
|
|
} |
|
|
|
}); |
|
|
|
@ -1662,9 +1665,30 @@ |
|
|
|
|
|
|
|
details.forEach((item, index) => { |
|
|
|
const tr = document.createElement("tr"); |
|
|
|
|
|
|
|
let filePath = item.file_path; |
|
|
|
if (filePath) { |
|
|
|
filePath = filePath.trim(); |
|
|
|
} |
|
|
|
let desigCellHtml = ""; |
|
|
|
if (filePath && filePath !== '-' && filePath.trim() !== '') { |
|
|
|
if (!filePath.toLowerCase().endsWith('.pdf')) { |
|
|
|
filePath += '.pdf'; |
|
|
|
} |
|
|
|
const normalizedPath = filePath.startsWith('/') ? filePath.substring(1) : filePath; |
|
|
|
const fullUrl = contextPath + normalizedPath; |
|
|
|
desigCellHtml = ` |
|
|
|
<a href="${escapeHtml(fullUrl)}" target="_blank" class="fw-bold text-primary text-decoration-underline" title="Click to view PDF"> |
|
|
|
<i class="fa-solid fa-file-pdf text-danger me-1"></i> ${escapeHtml(item.designation)} |
|
|
|
</a> |
|
|
|
`; |
|
|
|
} else { |
|
|
|
desigCellHtml = `<span class="fw-bold text-dark">${escapeHtml(item.designation)}</span>`; |
|
|
|
} |
|
|
|
|
|
|
|
tr.innerHTML = ` |
|
|
|
<td class="text-center fw-bold text-secondary">${index + 1}</td> |
|
|
|
<td class="fw-bold text-dark">${escapeHtml(item.designation)}</td> |
|
|
|
<td>${desigCellHtml}</td> |
|
|
|
<td class="text-center fw-semibold text-secondary">${escapeHtml(item.tendered_manpower)}</td> |
|
|
|
<td class="text-center fw-semibold text-secondary">${escapeHtml(item.available_manpower)}</td> |
|
|
|
<td class="text-center"> |
|
|
|
@ -1929,6 +1953,9 @@ |
|
|
|
} |
|
|
|
noWoEl.style.display = "none"; |
|
|
|
|
|
|
|
let totalTender = 0; |
|
|
|
let totalOnroll = 0; |
|
|
|
|
|
|
|
designations.forEach((des, index) => { |
|
|
|
const tr = document.createElement("tr"); |
|
|
|
|
|
|
|
@ -1938,19 +1965,51 @@ |
|
|
|
detailText += " - " + fileNo; |
|
|
|
} |
|
|
|
|
|
|
|
const tender = des.available_manpower || '0'; |
|
|
|
const vacant = des.vacant_count || '0'; |
|
|
|
const tenderVal = des.tender_manpower_designation_wise !== null && des.tender_manpower_designation_wise !== undefined ? des.tender_manpower_designation_wise : '0'; |
|
|
|
const onrollVal = des.available_manpower || '0'; |
|
|
|
|
|
|
|
totalTender += parseInt(tenderVal) || 0; |
|
|
|
totalOnroll += parseInt(onrollVal) || 0; |
|
|
|
|
|
|
|
let filePath = des.file_path; |
|
|
|
if (filePath) { |
|
|
|
filePath = filePath.trim(); |
|
|
|
} |
|
|
|
let detailCellHtml = ""; |
|
|
|
if (filePath && filePath !== '-' && filePath.trim() !== '') { |
|
|
|
if (!filePath.toLowerCase().endsWith('.pdf')) { |
|
|
|
filePath += '.pdf'; |
|
|
|
} |
|
|
|
const normalizedPath = filePath.startsWith('/') ? filePath.substring(1) : filePath; |
|
|
|
const fullUrl = contextPath + normalizedPath; |
|
|
|
detailCellHtml = ` |
|
|
|
<a href="${escapeHtml(fullUrl)}" target="_blank" class="fw-bold text-primary text-decoration-underline" title="Click to view PDF"> |
|
|
|
<i class="fa-solid fa-file-pdf text-danger me-1"></i> ${escapeHtml(detailText)} |
|
|
|
</a> |
|
|
|
`; |
|
|
|
} else { |
|
|
|
detailCellHtml = `<span class="fw-bold text-dark">${escapeHtml(detailText)}</span>`; |
|
|
|
} |
|
|
|
|
|
|
|
tr.innerHTML = ` |
|
|
|
<td class="text-center fw-bold text-secondary">${index + 1}</td> |
|
|
|
<td class="fw-bold text-dark">${escapeHtml(detailText)}</td> |
|
|
|
|
|
|
|
<td>${detailCellHtml}</td> |
|
|
|
<td class="text-center fw-semibold text-primary">${escapeHtml(String(tenderVal))}</td> |
|
|
|
<td class="text-center fw-semibold text-primary">${escapeHtml(String(onrollVal))}</td> |
|
|
|
`; |
|
|
|
tbody.appendChild(tr); |
|
|
|
//<td class="text-center fw-semibold text-primary">${escapeHtml(tender)}</td> |
|
|
|
//<td class="text-center"><span class="badge bg-danger" style="font-size: 0.85rem; padding: 5px 10px; font-weight:700;">${escapeHtml(vacant)}</span></td> |
|
|
|
}); |
|
|
|
|
|
|
|
const totalTr = document.createElement("tr"); |
|
|
|
totalTr.className = "modal-table-total-row"; |
|
|
|
totalTr.innerHTML = ` |
|
|
|
<td class="text-center"></td> |
|
|
|
<td class="fw-bold text-end" style="color: #0f5c78; font-size: 0.95rem; letter-spacing: 0.5px;">TOTAL</td> |
|
|
|
<td class="text-center fw-bold text-primary" style="font-size: 0.95rem;">${totalTender}</td> |
|
|
|
<td class="text-center fw-bold text-primary" style="font-size: 0.95rem;">${totalOnroll}</td> |
|
|
|
`; |
|
|
|
tbody.appendChild(totalTr); |
|
|
|
|
|
|
|
const modal = bootstrap.Modal.getOrCreateInstance(document.getElementById("workOrderDetailsModal")); |
|
|
|
modal.show(); |
|
|
|
} |
|
|
|
|