You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

645 lines
25 KiB

2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
2 years ago
2 years ago
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html lang="en" dir="">
  3. <html xmlns:th="http://www.thymeleaf.org">
  4. <head th:replace="~{fragments/modules/base/head :: head}"></head>
  5. <style>
  6. .required{
  7. color: red;
  8. }
  9. #modalBody p {
  10. margin: 5px 0;
  11. }
  12. #modalBody hr {
  13. margin: 15px 0;
  14. }
  15. hr {
  16. border: 1px solid #ccc;
  17. margin-top: 20px;
  18. margin-bottom: 20px;
  19. }
  20. h5 {
  21. font-size: bold;
  22. }
  23. #returnretrieddetailsModal .modal-body{
  24. max-height:80vh;
  25. overflow-y:auto;
  26. }
  27. #returnretrieddetailsModal .col-md-6{
  28. padding-bottom: 10px;
  29. }
  30. .file-history-list {
  31. margin-top: 10px;
  32. padding-left: 0;
  33. }
  34. .file-history-item {
  35. display: flex;
  36. padding: 5px 10px;
  37. font-family: Arial, sans-serif;
  38. align-items: flex-start;
  39. position: relative; /* For vertical line positioning */
  40. margin-bottom: 1px; /* Add space between items */
  41. }
  42. .file-history-item::before {
  43. content: '';
  44. position: absolute;
  45. top: 0;
  46. bottom: 0;
  47. left: 120px; /* Position of the vertical line */
  48. width: 1px;
  49. background-color: #ddd;
  50. }
  51. .file-history-date {
  52. margin-top: 10px;
  53. flex: 0 0 100px;
  54. font-weight: bold;
  55. font-size: 0.8rem;
  56. color: #333;
  57. text-align: center;
  58. white-space: nowrap; /* Prevent wrapping */
  59. }
  60. .file-history-content {
  61. flex: 5;
  62. padding-left: 20px; /* Adds space after the vertical line */
  63. display: flex;
  64. flex-direction: column;
  65. gap: 5px; /* Adds spacing between status and remarks */
  66. white-space: pre-wrap; /* Prevents wrapping */
  67. overflow: visible; /* Prevents content overflow */
  68. text-overflow: ellipsis; /* Adds ellipsis if content exceeds container width */
  69. }
  70. .file-history-status {
  71. font-size: 0.8rem;
  72. font-weight: bold;
  73. color: #555;
  74. white-space:pre-wrap; /* Prevent wrapping */
  75. overflow: visible;
  76. text-overflow: ellipsis;
  77. }
  78. .file-history-remarks {
  79. font-size: 0.8rem;
  80. color: #777;
  81. white-space: pre-wrap; /* Prevent wrapping */
  82. overflow: visible;
  83. text-overflow: ellipsis;
  84. }
  85. </style>
  86. <body>
  87. <!--[if lt IE 8]>
  88. <p class="browserupgrade">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> to improve your experience.</p>
  89. <![endif]-->
  90. <div class="wrapper">
  91. <!-- header top menu Start -->
  92. <header th:replace="~{fragments/modules/base/header :: header}"></header>
  93. <!-- header top menu end -->
  94. <div class="page-wrap">
  95. <!--=============== Left Menu side Start ================-->
  96. <div th:replace="~{fragments/modules/base/menu :: menu}"></div>
  97. <!--=============== Left side End ================-->
  98. <div class="main-content">
  99. <div class="container-fluid">
  100. <div class="page-header mb-2">
  101. <div class="row align-items-end">
  102. <div class="col-lg-8">
  103. <div class="page-header-title">
  104. <i class="fa fa-list-alt bg-blue"></i>
  105. <div class="d-inline">
  106. <h5>Retirement</h5>
  107. <span>Department Entries</span>
  108. </div>
  109. </div>
  110. </div>
  111. <div class="col-lg-4">
  112. <nav class="breadcrumb-container" aria-label="breadcrumb">
  113. <ol class="breadcrumb">
  114. <li class="breadcrumb-item"><a href="/gcc/index"><i class="ik ik-home"></i></a></li>
  115. <li class="breadcrumb-item" aria-current="page">Department Entries</li>
  116. <li class="breadcrumb-item" aria-current="page">Audit</li>
  117. <li class="breadcrumb-item active" aria-current="page">Retirement</li>
  118. </ol>
  119. </nav>
  120. </div>
  121. </div>
  122. </div>
  123. <div class="row mt-4">
  124. <div class="col-md-12">
  125. <div class="card">
  126. <div class="card-block">
  127. <h5 style="font-weight:bold;"> <span th:text="${deptname}" id="deptname"></span>&nbsp;Department</h5><span th:text="${filecategory}" id="filecategory" style="display:none"></span>
  128. <h5 style="font-weight:bold;">Audit- Retirement</h5>
  129. <h5 style="font-weight:bold;"><span th:text="${deptId}" id="deptId" style="display:none"></span></h5>
  130. <span th:text="${userId}" id="userId" style="display:none"></span>
  131. <div id="audittable">
  132. <table id="AuditDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid">
  133. <thead class="thead-dark">
  134. <tr role="row">
  135. <th class="text-center">S.No</th>
  136. <th class="text-center">Employee Code</th>
  137. <th class="text-center">Name </th>
  138. <th class="text-center">Department</th>
  139. <th class="text-center">Designation</th>
  140. <th class="text-center">File Sent Date</th>
  141. <th class="text-center">File Type</th>
  142. <th class="text-center">View</th>
  143. </tr>
  144. </thead>
  145. <tbody style="text-align:center;">
  146. <!-- Thymeleaf loop to populate data -->
  147. <tr th:each="audit, iterStat : ${auditlist}">
  148. <td th:text="${iterStat.index + 1}" class="text-center"></td>
  149. <td th:text="${audit['emp_no']}" class="text-center"></td>
  150. <td th:text="${audit['emp_name']}" class="text-center"></td>
  151. <td th:text="${audit['dept_name']}" class="text-center"></td>
  152. <td th:text="${audit['designation']}" class="text-center"></td>
  153. <td th:text="${audit['file_moved_date'] != null ? #dates.format(audit['file_moved_date'], 'dd-MM-yyyy') : 'N/A'}" class="text-center"></td>
  154. <td th:text="${audit['file_entry_type']}" class="text-center"></td>
  155. <td class="text-center">
  156. <button class="btn btn-primary btn-sm view-btn" th:attr="data-id=${audit['emp_no']}, data-temp-id=${audit['temp_id']}">
  157. View
  158. </button>
  159. </td>
  160. </tr>
  161. </tbody>
  162. </table>
  163. </div>
  164. </div>
  165. </div>
  166. </div>
  167. </div>
  168. </div>
  169. </div>
  170. <!-- page loader-->
  171. <div id="pageLoader" style="display: none; position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(255, 255, 255, 0.8); z-index: 9999; text-align: center;">
  172. <div style="position: relative; top: 50%; transform: translateY(-50%);">
  173. <div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;">
  174. <span class="sr-only">Loading...</span>
  175. </div>
  176. <!-- Add the 'Please wait' text below the spinner -->
  177. <p style="margin-top: 1rem; font-size: 1.2rem; color: #007bff;">Please wait...</p>
  178. </div>
  179. </div>
  180. <footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
  181. </div>
  182. </div>
  183. <!-- Modal Box -->
  184. <div class="modal fade" id="returnretrieddetailsModal" tabindex="-1" role="dialog" aria-labelledby="detailsModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">
  185. <div class="modal-dialog modal-lg" role="document">
  186. <div class="modal-content">
  187. <div class="modal-header">
  188. <h5 class="modal-title" id="detailsModalLabel">
  189. Audit - Retirement (<span id="modalEmployeeCode"></span>)
  190. </h5>
  191. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  192. <span aria-hidden="true">&times;</span>
  193. </button>
  194. </div>
  195. <div class="modal-body">
  196. <div class="row">
  197. <!-- Employee No -->
  198. <div class="col-md-6">
  199. <label for="employeenomodel" class="form-label fw-bold">Employee No </label>
  200. <input type="number" id="employeenomodel" class="form-control" readonly>
  201. </div>
  202. <!-- Employee Name -->
  203. <div class="col-md-6">
  204. <label for="employeename" class="form-label fw-bold">Employee Name </label>
  205. <input type="text" id="employeename" class="form-control" readonly>
  206. </div>
  207. <!-- Department -->
  208. <div class="col-md-6">
  209. <label for="department" class="form-label fw-bold">Department </label>
  210. <input type="text" id="department" class="form-control" readonly>
  211. </div>
  212. <!-- Designation -->
  213. <div class="col-md-6">
  214. <label for="designation" class="form-label fw-bold">Designation </label>
  215. <input type="text" id="designation" class="form-control" readonly>
  216. </div>
  217. <div class="col-md-6">
  218. <label for="retirementdate" class="form-label fw-bold">Retirement Date </label>
  219. <input type="date" id="retirementdate" class="form-control" readonly>
  220. </div>
  221. <!-- Class -->
  222. <div class="col-md-6">
  223. <label for="classes" class="form-label fw-bold">Class </label>
  224. <input type="text" id="classes" class="form-control" readonly>
  225. </div>
  226. <!-- Type of Retirement -->
  227. <div class="col-md-6">
  228. <label for="typeofretirement" class="form-label fw-bold">Type of Retirement <span class="text-danger">*</span></label>
  229. <input type="text" id="typeofretirement" class="form-control" readonly>
  230. </div>
  231. <!-- Date File Sent to Audit -->
  232. <div class="col-md-6">
  233. <label for="datefile_modal" class="form-label fw-bold">Date File Sent to Audit <span class="text-danger">*</span></label>
  234. <input type="date" id="datefile_modal" class="form-control" readonly>
  235. </div>
  236. <!-- Remarks -->
  237. <div class="col-md-12">
  238. <label for="remarks_modal" class="form-label fw-bold">Comments/Remarks <span class="text-danger">*</span></label>
  239. <textarea id="remarks_modal" class="form-control" rows="4" readonly></textarea>
  240. </div>
  241. <!-- new -->
  242. <div class="col-md-12 mt-4">
  243. <h5>File History</h5>
  244. <div id="fileHistoryContainer" class="file-history-list">
  245. <!-- File History will be dynamically loaded here -->
  246. </div>
  247. </div>
  248. </div>
  249. <div class="row mb-2 mt-2">
  250. <div class="col-md-12 d-flex justify-content-center">
  251. <button type="button" class="btn btn-primary mx-2" id="submitbutton">Mark As Returned From Audit</button>
  252. <button type="button" class="btn btn-secondary" data-dismiss="modal" id="back">Back</button>
  253. </div>
  254. </div>
  255. <div style="display :none" id="receivedcard">
  256. <div class="row">
  257. <div class="col-md-6">
  258. <label for="datefile " class="form-label fw-bold">Date File Received From Audit <span class="text-danger">*</span></label>
  259. <input type="text" id="datefile" class="form-control" readonly>
  260. </div>
  261. <div class="col-md-12">
  262. <label for="remarks" class="form-label fw-bold">Comments/Remarks<span class="text-danger">*</span></label>
  263. <textarea id="remarks" class="form-control" rows="4" placeholder="Enter your remarks here"></textarea>
  264. </div>
  265. </div>
  266. <div class="row mb-2 mt-2">
  267. <div class="col-md-12 d-flex justify-content-center">
  268. <button type="button" class="btn btn-primary" id="auditsubmit">Submit</button>
  269. </div>
  270. </div>
  271. </div>
  272. </div>
  273. </div>
  274. </div>
  275. </div>
  276. <div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
  277. <script th:replace="~{fragments/modules/base/script :: script}"></script>
  278. <script src="node_modules/tempusdominus-bootstrap-4/build/js/tempusdominus-bootstrap-4.min.js"></script>
  279. <!-- Bootstrap 5 JS -->
  280. <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
  281. <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
  282. <script>
  283. $(document).ready(function () {
  284. // Initialize the DataTable
  285. const dataTable = $('#AuditDatatable').DataTable({
  286. dom: 'Bftip',
  287. columnDefs: [
  288. { targets: 'no-sort', orderable: false }
  289. ],
  290. lengthMenu: [
  291. [50, 100, 200, 500, -1],
  292. ['50 rows', '100 rows', '200 rows', 'Show all']
  293. ],
  294. scrollY: '50vh',
  295. buttons: [
  296. { extend: 'pageLength', className: 'btn btn-warning' },
  297. { title: 'Data export', extend: 'copyHtml5', text: 'Copy', className: 'btn btn-secondary' },
  298. { extend: 'excelHtml5', text: 'Excel', className: 'btn btn-secondary' },
  299. { extend: 'csvHtml5', text: 'CSV', className: 'btn btn-secondary' },
  300. { extend: 'pdfHtml5', text: 'PDF', className: 'btn btn-secondary' }
  301. ],
  302. fixedHeader: true,
  303. autoWidth: true,
  304. responsive: true,
  305. searching: true,
  306. paging: true,
  307. info: true,
  308. ordering: false,
  309. });
  310. });
  311. document.getElementById("submitbutton").addEventListener("click", function () {
  312. // Clear the inputs in the receivedcard section
  313. //$('#datefile').val('');
  314. //$('#remarks').val('');
  315. // Make the receivedcard section visible
  316. document.getElementById("receivedcard").style.display = "block";
  317. // Scroll the receivedcard section into view
  318. document.getElementById("receivedcard").scrollIntoView({
  319. behavior: "smooth", // Smooth scrolling effect
  320. block: "center" // Aligns the element to the center of the viewport
  321. });
  322. });
  323. document.addEventListener("DOMContentLoaded", function() {
  324. // Get today's date
  325. const today = new Date();
  326. // Format the date as DD-MM-YYYY for display
  327. const day = String(today.getDate()).padStart(2, '0');
  328. const month = String(today.getMonth() + 1).padStart(2, '0'); // Months are 0-based
  329. const year = today.getFullYear();
  330. // Combine into DD-MM-YYYY format for display
  331. const formattedDateDisplay = `${day}-${month}-${year}`;
  332. // Set the value of the input field to the current date (in DD-MM-YYYY format for display)
  333. document.getElementById("datefile").value = formattedDateDisplay;
  334. });
  335. function convertDateFormat(dateString) {
  336. if (!dateString) return '';
  337. let [day, month, year] = dateString.split('-');
  338. return `${year}-${month}-${day}`;
  339. }
  340. //model function
  341. function fetchEmployeeDetails(tempId) {
  342. $.ajax({
  343. url: '/gcc/api/department/audit/getemployeedetails', // API to fetch employee details
  344. type: 'GET',
  345. data: { tempId: tempId }, // Pass EMPLOYEE_CODE as a parameter
  346. success: function (response) {
  347. if (response && response.length > 0) {
  348. let employeeDetails = response[0]; // Access the first object in the array
  349. console.log("response:",response);
  350. // Populate modal fields
  351. $('#employeenomodel').val(employeeDetails.emp_no);
  352. $('#employeename').val(employeeDetails.emp_name);
  353. $('#department').val(employeeDetails.dept_name);
  354. $('#designation').val(employeeDetails.designation);
  355. $('#typeofretirement').val(employeeDetails.type_of_retirement);
  356. $('#classes').val(employeeDetails.retirement_class);
  357. $('#datefile_modal').val(employeeDetails.file_moved_date);
  358. $('#remarks_modal').val(employeeDetails.remarks);
  359. $('#retirementdate').val(employeeDetails.retirement_date);
  360. // Update the modal title with the employee code
  361. $('#modalEmployeeCode').text(employeeDetails.emp_no);
  362. // Show the modal
  363. $('#returnretrieddetailsModal').modal('show');
  364. //additional card display function
  365. document.getElementById("submitbutton").addEventListener("click", function() {
  366. // $('#datefile').val('');
  367. $('#remarks').val('');
  368. document.getElementById("receivedcard").style.display = "block";
  369. });
  370. /* document.getElementById('auditsubmit').addEventListener('click', function () {
  371. let employeeNo = $('#employeenomodel').val(); // Using jQuery to get the value
  372. // Trigger the save function and pass the value
  373. saveEntryDetails(tempId,employeeNo);
  374. }); */
  375. $('#auditsubmit').off('click').on('click', function () {
  376. let employeeNo = $('#employeenomodel').val(); // Get the employee number
  377. saveEntryDetails(tempId, employeeNo); // Call function with parameters
  378. });
  379. } else {
  380. Swal.fire({
  381. icon: 'info',
  382. title: 'No Data',
  383. text: 'No details found for the selected employee.',
  384. confirmButtonText: 'OK',
  385. });
  386. }
  387. },
  388. error: function () {
  389. Swal.fire({
  390. icon: 'error',
  391. title: 'Error',
  392. text: 'Failed to fetch employee details. Please try again.',
  393. confirmButtonText: 'OK',
  394. });
  395. },
  396. });
  397. }
  398. $(document).ready(function () {
  399. $(document).on('click', '.view-btn', function () {
  400. const empCode = $(this).data('id'); // Fetch `data-id` value
  401. const tempId = $(this).data('temp-id'); // Fetch `data-temp-id` value
  402. console.log("empCode====="+empCode);
  403. // Hide the receivedcard section before showing the modal
  404. $("#receivedcard").hide();
  405. fetchEmployeeDetails(tempId); // Call the function to fetch employee details
  406. loadFileHistory(tempId); // Load the file history for the selected employee
  407. });
  408. // Initialize the modal with static backdrop and disabled keyboard closing
  409. $('#returnretrieddetailsModal').modal({
  410. backdrop: 'static',
  411. keyboard: false,
  412. show: false // Ensure it doesn't auto-show on page load
  413. });
  414. // Handle close button click
  415. $('#back').click(function () {
  416. $('#returnretrieddetailsModal').modal('hide');
  417. });
  418. $('.close').click(function () {
  419. $('#returnretrieddetailsModal').modal('hide');
  420. });
  421. });
  422. function loadFileHistory(tempId) {
  423. $.ajax({
  424. url: '/gcc/api/department/audit/fileMovementhistory', // API endpoint
  425. type: 'GET',
  426. data: { tempId: tempId }, // Pass empCode as a parameter
  427. success: function (response) {
  428. if (response.length > 0) {
  429. let historyHtml = '';
  430. response.forEach(item => {
  431. historyHtml += `
  432. <div class="file-history-item">
  433. <div class="file-history-date">${formatDateTime(item.fileMovedDateHistory)}</div>
  434. <div class="file-history-content">
  435. <div class="file-history-status">${item.fileStatusHistory}</div>
  436. <div class="file-history-remarks">Comments/Remarks: ${item.remarksHistory || 'N/A'}</div>
  437. </div>
  438. </div>
  439. `;
  440. });
  441. $('#fileHistoryContainer').html(historyHtml);
  442. } else {
  443. $('#fileHistoryContainer').html('<p>No file history available.</p>');
  444. }
  445. },
  446. error: function () {
  447. $('#fileHistoryContainer').html('<p>Failed to load file history. Please try again later.</p>');
  448. }
  449. });
  450. }
  451. // Function to format date and time
  452. function formatDateTime(dateString) {
  453. const options = {
  454. day: '2-digit',
  455. month: '2-digit',
  456. year: 'numeric',
  457. };
  458. return new Date(dateString).toLocaleDateString('en-GB', options); // Formats as dd-mm-yyyy
  459. }
  460. function saveEntryDetails(tempId,empNo) {
  461. //console.log("emp_no inside=="+empCode);
  462. let entryDetails = {
  463. empNo:empNo,
  464. tempId: tempId, // Pass the stored tempId value
  465. dateToAudit: convertDateFormat($('#datefile').val()?.trim()),
  466. remarks: $('#remarks').val(),
  467. deptId:$('#deptId').text().trim(),
  468. filemovedby:$('#userId').text().trim()
  469. };
  470. console.log("entryDetails:",entryDetails);
  471. if (!entryDetails.remarks) {
  472. Swal.fire({
  473. icon: 'warning',
  474. title: 'Validation Error!',
  475. text: 'Remarks are required.',
  476. confirmButtonText: 'OK'
  477. });
  478. return;
  479. }
  480. // Disable the button to prevent multiple submissions
  481. $('#auditsubmit').prop('disabled', true).text('Processing...');
  482. $.ajax({
  483. url: '/gcc/api/department/audit/updateEmployeeDetails',
  484. type: 'POST',
  485. contentType: 'application/json',
  486. data: JSON.stringify(entryDetails),
  487. success: function (response) {
  488. $('#auditsubmit').prop('disabled', false).text('Submit');
  489. Swal.fire({
  490. icon: 'success',
  491. title: 'Success',
  492. text: response,
  493. allowOutsideClick: false,
  494. allowEscapeKey: false,
  495. allowEnterKey: false,
  496. confirmButtonText: 'OK'
  497. }).then((result) => {
  498. if (result.isConfirmed) {
  499. $('#auditsubmit').prop('disabled', false).text('Submit');
  500. window.location.href = "/gcc/department/audit/retirement";
  501. console.log("Continue clicked");
  502. }
  503. });
  504. },
  505. error: function (xhr, status, error) {
  506. $('#auditsubmit').prop('disabled', false).text('Submit');
  507. Swal.fire({
  508. icon: 'error',
  509. title: 'Error',
  510. text: 'Failed to save details. Please try again.',
  511. confirmButtonText: 'OK'
  512. });
  513. console.error('Error:', xhr.responseText);
  514. }
  515. });
  516. }
  517. </script>
  518. </body>
  519. </html>