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.

1185 lines
50 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
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
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. #sec1 .col-md-4,.col-md-12{
  86. padding-top: 1%;
  87. }
  88. .col-md-4 .form-check{
  89. width: 25%;
  90. }
  91. .col-md-6 .form-check{
  92. width: 25%;
  93. }
  94. </style>
  95. <body>
  96. <!--[if lt IE 8]>
  97. <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>
  98. <![endif]-->
  99. <div class="wrapper">
  100. <!-- header top menu Start -->
  101. <header th:replace="~{fragments/modules/base/header :: header}"></header>
  102. <!-- header top menu end -->
  103. <div class="page-wrap">
  104. <!--=============== Left Menu side Start ================-->
  105. <div th:replace="~{fragments/modules/base/menu :: menu}"></div>
  106. <!--=============== Left side End ================-->
  107. <div class="main-content">
  108. <div class="container-fluid">
  109. <div class="page-header mb-2">
  110. <div class="row align-items-end">
  111. <div class="col-lg-8">
  112. <div class="page-header-title">
  113. <i class="fa fa-list-alt bg-blue"></i>
  114. <div class="d-inline">
  115. <h5>Pendency</h5>
  116. <span>Department Entries</span>
  117. </div>
  118. </div>
  119. </div>
  120. <div class="col-lg-4">
  121. <nav class="breadcrumb-container" aria-label="breadcrumb">
  122. <ol class="breadcrumb">
  123. <li class="breadcrumb-item"><a href="/gcc/index"><i class="ik ik-home"></i></a></li>
  124. <li class="breadcrumb-item" aria-current="page">Department Entries</li>
  125. <li class="breadcrumb-item" aria-current="page">Partially Completed</li>
  126. <li class="breadcrumb-item active" aria-current="page">Pendency</li>
  127. </ol>
  128. </nav>
  129. </div>
  130. </div>
  131. </div>
  132. <div class="row mt-4">
  133. <div class="col-md-12">
  134. <div class="card">
  135. <div class="card-block">
  136. <h5 style="font-weight:bold;"> <span th:text="${deptname}" id="deptname"></span>&nbsp;Department</h5>
  137. <h5 style="font-weight:bold;">Partially Completed - Pendency</h5>
  138. <h5 style="font-weight:bold;"><span th:text="${deptId}" id="deptId" style="display:none"></span></h5>
  139. <span th:text="${userId}" id="userId" style="display:none"></span>
  140. <div id="audittable">
  141. <table id="AuditDatatable" class="table table-striped table-bordered table-hover dataTable" role="grid">
  142. <thead class="thead-dark">
  143. <tr role="row">
  144. <th class="text-center">S.No</th>
  145. <th class="text-center">Employee Code</th>
  146. <th class="text-center">Name </th>
  147. <th class="text-center">Department</th>
  148. <th class="text-center">Designation</th>
  149. <th class="text-center">File Sent Date</th>
  150. <th class="text-center">File Type</th>
  151. <th class="text-center">View</th>
  152. </tr>
  153. </thead>
  154. <tbody style="text-align:center;">
  155. <!-- Thymeleaf loop to populate data -->
  156. <tr th:each="audit, iterStat : ${auditlist}">
  157. <td th:text="${iterStat.index + 1}" class="text-center"></td>
  158. <td th:text="${audit['emp_no']}" class="text-center"></td>
  159. <td th:text="${audit['emp_name']}" class="text-center"></td>
  160. <td th:text="${audit['dept_name']}" class="text-center"></td>
  161. <td th:text="${audit['designation']}" class="text-center"></td>
  162. <td th:text="${audit['file_moved_date'] != null ? #dates.format(audit['file_moved_date'], 'dd-MM-yyyy') : 'N/A'}" class="text-center"></td>
  163. <td th:text="${audit['file_entry_type']}" class="text-center"></td>
  164. <td class="text-center">
  165. <button class="btn btn-primary btn-sm view-btn" th:attr="data-id=${audit['emp_no']}, data-temp-id=${audit['temp_id']}">
  166. View
  167. </button>
  168. </td>
  169. </tr>
  170. </tbody>
  171. </table>
  172. </div>
  173. </div>
  174. </div>
  175. </div>
  176. </div>
  177. </div>
  178. </div>
  179. <!-- page loader-->
  180. <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;">
  181. <div style="position: relative; top: 50%; transform: translateY(-50%);">
  182. <div class="spinner-border text-primary" role="status" style="width: 3rem; height: 3rem;">
  183. <span class="sr-only">Loading...</span>
  184. </div>
  185. <!-- Add the 'Please wait' text below the spinner -->
  186. <p style="margin-top: 1rem; font-size: 1.2rem; color: #007bff;">Please wait...</p>
  187. </div>
  188. </div>
  189. <footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
  190. </div>
  191. </div>
  192. <!-- Modal Box -->
  193. <div class="modal fade" id="returnretrieddetailsModal" tabindex="-1" role="dialog" aria-labelledby="detailsModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">
  194. <div class="modal-dialog modal-xl" role="document">
  195. <div class="modal-content">
  196. <div class="modal-header">
  197. <h5 class="modal-title" id="detailsModalLabel">
  198. Partially Completed - Pendency (<span id="modalEmployeeCode"></span>)
  199. </h5>
  200. <button type="button" class="close" data-dismiss="modal" aria-label="Close">
  201. <span aria-hidden="true">&times;</span>
  202. </button>
  203. </div>
  204. <div class="modal-body">
  205. <div class="row" id="sec1">
  206. <!-- Employee No -->
  207. <div class="col-md-4">
  208. <label for="employeenomodel" class="form-label fw-bold">Employee No </label>
  209. <input type="number" id="employeenomodel" class="form-control" readonly>
  210. </div>
  211. <!-- Employee Name -->
  212. <div class="col-md-4">
  213. <label for="employeename" class="form-label fw-bold">Employee Name </label>
  214. <input type="text" id="employeename" class="form-control" readonly>
  215. </div>
  216. <!-- Department -->
  217. <div class="col-md-4">
  218. <label for="department" class="form-label fw-bold">Department </label>
  219. <input type="text" id="department" class="form-control" readonly>
  220. </div>
  221. <!-- Designation -->
  222. <div class="col-md-4">
  223. <label for="designation" class="form-label fw-bold">Designation </label>
  224. <input type="text" id="designation" class="form-control" readonly>
  225. </div>
  226. <div class="col-md-4">
  227. <label for="classes" class="form-label fw-bold">Class</label>
  228. <input type="text" id="classes" class="form-control" readonly>
  229. </div>
  230. <div class="col-md-4">
  231. <label for="retirementdate" class="form-label fw-bold">Retirement Date </label>
  232. <input type="date" id="retirementdate" class="form-control" readonly>
  233. </div>
  234. <div class="col-md-4">
  235. <label for="pendingDuration" class="form-label fw-bold">
  236. Pending Duration
  237. </label>
  238. <div class="d-flex align-items-center">
  239. <div class="form-check" style="padding-right:10px;">
  240. <input type="radio" id="yes" name="pendingDuration" value="yes"class="form-check-input" disabled>
  241. <label for="yes" class="form-check-label">Yes</label>
  242. </div>
  243. <div class="form-check">
  244. <input type="radio" id="no" name="pendingDuration" value="no"class="form-check-input" disabled>
  245. <label for="no" class="form-check-label">No</label>
  246. </div>
  247. </div>
  248. <div class="text" id="pendingDurationInputContainer" style="display: none; margin-top: 10px;">
  249. <input type="text" id="pendingDurationInput" name="pendingDurationValue" class="form-control" placeholder="Enter details for pending duration" readonly>
  250. </div>
  251. </div>
  252. <!-- Type of Retirement -->
  253. <div class="col-md-4">
  254. <label for="typeofretirement" class="form-label fw-bold">Type of Retirement </label>
  255. <input type="text" id="typeofretirement" class="form-control" readonly>
  256. </div>
  257. <!-- Date File Sent to Audit -->
  258. <div class="col-md-4">
  259. <label for="datefile_modal" class="form-label fw-bold">Date File Received From Department </label>
  260. <input type="date" id="datefile_modal" class="form-control" readonly>
  261. </div>
  262. <!-- Remarks -->
  263. <div class="col-md-12">
  264. <label for="remarks_modal" class="form-label fw-bold">Comments/Remarks </label>
  265. <textarea id="remarks_modal" class="form-control" rows="4" readonly></textarea>
  266. </div>
  267. <!-- new -->
  268. <div class="col-md-12 mt-4">
  269. <h5>File History</h5>
  270. <div id="fileHistoryContainer" class="file-history-list">
  271. <!-- File History will be dynamically loaded here -->
  272. </div>
  273. </div>
  274. </div>
  275. <div class="row mb-2 mt-2">
  276. <div class="col-md-12 d-flex justify-content-center">
  277. <button type="button" class="btn btn-primary mx-2" id="submitbutton">Edit Benefits</button>
  278. <button type="button" class="btn btn-secondary" data-dismiss="modal" id="back">Back</button>
  279. </div>
  280. </div>
  281. <div style="display :none" id="receivedcard">
  282. <p style="font-weight: bold;font-size: medium;text-decoration: underline;">Department Benefits</p>
  283. <div class="row mt-2" id="sec2">
  284. <!-- GPF -->
  285. <div class="col-md-4 mb-2">
  286. <label class="form-label fw-bold">GPF<span class="text-danger">*</span></label>
  287. <div class="d-flex align-items-center gap-5">
  288. <div class="form-check">
  289. <input class="form-check-input" type="radio" id="gpfYes" name="gpf" value="yes">
  290. <label class="form-check-label" for="gpfYes">Yes</label>
  291. </div>
  292. <div class="form-check">
  293. <input class="form-check-input" type="radio" id="gpfNo" name="gpf" value="no">
  294. <label class="form-check-label" for="gpfNo">No</label>
  295. </div>
  296. <div class="form-check">
  297. <input class="form-check-input" type="radio" id="gpf50" name="gpf" value="90">
  298. <label class="form-check-label" for="gpf50">90%</label>
  299. </div>
  300. </div>
  301. <!-- Placeholder for dynamically added input -->
  302. <div id="gpfAmountDiv" class="mt-3" style="display: none;">
  303. <label for="gpfAmount" class="form-label">Enter GPF Amount<span class="text-danger">*</span></label>
  304. <input type="number" id="gpfAmount" class="form-control" placeholder="Enter GPF amount" min="1" oninput="validatePositiveNumber(this)">
  305. </div>
  306. </div>
  307. <!-- Earned Leave & Leave on Private Affairs -->
  308. <div class="col-md-4 mb-2">
  309. <label class="form-label fw-bold">Earned Leave & Leave on Private Affairs<span class="text-danger">*</span></label>
  310. <div class="d-flex align-items-center gap-5">
  311. <div class="form-check">
  312. <input class="form-check-input" type="radio" id="earnedleaveYes" name="earnedleave" value="yes">
  313. <label class="form-check-label" for="earnedleaveYes">Yes</label>
  314. </div>
  315. <div class="form-check">
  316. <input class="form-check-input" type="radio" id="earnedleaveNo" name="earnedleave" value="no">
  317. <label class="form-check-label" for="earnedleaveNo">No</label>
  318. </div>
  319. </div>
  320. <!-- Placeholder for dynamically added input -->
  321. <div id="earnedleaveAmountDiv" class="mt-3" style="display: none;">
  322. <label for="earnedleaveAmount" class="form-label">Enter EL and LPA Amount<span class="text-danger">*</span></label>
  323. <input type="number" id="earnedleaveAmount" class="form-control" placeholder="Enter Amount" min="1" oninput="validatePositiveNumber(this)">
  324. </div>
  325. </div>
  326. <!-- SPFGS -->
  327. <div class="col-md-4 mb-2">
  328. <label class="form-label fw-bold">SPFGS<span class="text-danger">*</span></label>
  329. <div class="d-flex align-items-center gap-5">
  330. <div class="form-check">
  331. <input class="form-check-input" type="radio" id="spfgsYes" name="spfgs" value="yes">
  332. <label class="form-check-label" for="spfgsYes">Yes</label>
  333. </div>
  334. <div class="form-check">
  335. <input class="form-check-input" type="radio" id="spfgsNo" name="spfgs" value="no">
  336. <label class="form-check-label" for="spfgsNo">No</label>
  337. </div>
  338. </div>
  339. <!-- Placeholder for dynamically added input -->
  340. <div id="spfgsAmountDiv" class="mt-3" style="display: none;">
  341. <label for="spfgsAmount" class="form-label">Enter SPFGS Amount<span class="text-danger">*</span></label>
  342. <input type="number" id="spfgsAmount" class="form-control" placeholder="Enter spfgs Amount" min="1" oninput="validatePositiveNumber(this)">
  343. </div>
  344. </div>
  345. <div class="col-md-4 mb-2">
  346. <label for="recoveryemployeevalue" class="form-label fw-bold">Recovery From Employee</label>
  347. <input type="text" id="recoveryemployeevalue" class="form-control" placeholder="Enter Recovery From Employee">
  348. </div>
  349. <!-- DCRF File is Ready -->
  350. <div class="col-md-4">
  351. <label class="form-label fw-bold">DCRG File is Ready<span class="text-danger">*</span></label>
  352. <div class="d-flex align-items-center gap-5">
  353. <div class="form-check">
  354. <input class="form-check-input" type="radio" id="dcrgYes" name="dcrg" value="yes">
  355. <label class="form-check-label" for="dcrgYes">Yes</label>
  356. </div>
  357. <div class="form-check">
  358. <input class="form-check-input" type="radio" id="dcrgNo" name="dcrg" value="no">
  359. <label class="form-check-label" for="dcrgNo">No</label>
  360. </div>
  361. </div>
  362. </div>
  363. </div>
  364. <hr>
  365. <p style="font-weight: bold;font-size: medium;text-decoration: underline;">Pension Benefits</p>
  366. <div class="row" id="sec3">
  367. <div class="col-md-4 mt-2 mb-2">
  368. <label for="pensionNumber" class="form-label">Pension Number</label>
  369. <input type="number" id="pensionNumber" class="form-control" placeholder="Enter Employee Pension Number">
  370. </div>
  371. <div class="col-md-4 mt-2 mb-2">
  372. <label for="ledgerNumber" class="form-label">Ledger Number</label>
  373. <input type="text" id="ledgerNumber" class="form-control" placeholder="Enter Ledger Number">
  374. </div>
  375. </div>
  376. <div class="row mt-2">
  377. <div class="col-md-4 mb-2">
  378. <label class="form-label fw-bold">Sanctions Pensions Benefit-Pension</label>
  379. <div class="d-flex align-items-center gap-5">
  380. <div class="form-check">
  381. <input class="form-check-input" type="radio" id="bpYes" name="benefit_pension" value="yes">
  382. <label class="form-check-label" for="bpYes">Yes</label>
  383. </div>
  384. <div class="form-check">
  385. <input class="form-check-input" type="radio" id="bpNo" name="benefit_pension" value="no">
  386. <label class="form-check-label" for="bpNo">No</label>
  387. </div>
  388. </div>
  389. <!-- Placeholder for dynamically added input -->
  390. <div id="PbAmountDiv" class="mt-3" style="display: none;">
  391. <label for="benefit_pension_amount" class="form-label">Enter Pensions Benefit Amount</label>
  392. <input type="number" id="benefit_pension_amount" class="form-control" placeholder="Enter Pensions Benefit Amount" min="1" oninput="validatePositiveNumber(this)">
  393. </div>
  394. </div>
  395. <div class="col-md-4 mb-2" id="dcrgCard" style="display: none;">
  396. <label class="form-label fw-bold">Sanctions Pensions Benefit-DCRG</label>
  397. <div class="d-flex align-items-center gap-5">
  398. <div class="form-check">
  399. <input class="form-check-input" type="radio" id="DcrgYes" name="benefit_dcrg" value="yes">
  400. <label class="form-check-label" for="DcrgYes">Yes</label>
  401. </div>
  402. <div class="form-check">
  403. <input class="form-check-input" type="radio" id="DcrgNo" name="benefit_dcrg" value="no">
  404. <label class="form-check-label" for="DcrgNo">No</label>
  405. </div>
  406. </div>
  407. <!-- Placeholder for dynamically added input -->
  408. <div id="dcrgAmountDiv" class="mt-3" style="display: none;">
  409. <label for="benefit_dcrg_amount" class="form-label">Enter Benefit DCRG Amount</label>
  410. <input type="number" id="benefit_dcrg_amount" class="form-control" placeholder="Enter Pensions Benefit DCRG Amount" min="1" oninput="validatePositiveNumber(this)">
  411. </div>
  412. </div>
  413. <div class="col-md-4 mb-2">
  414. <label class="form-label fw-bold">Sanctions Pensions Benefit-Commutation</label>
  415. <div class="d-flex align-items-center gap-5">
  416. <div class="form-check">
  417. <input class="form-check-input" type="radio" id="commutationYes" name="benefit_commutation" value="yes">
  418. <label class="form-check-label" for="commutationYes">Yes</label>
  419. </div>
  420. <div class="form-check">
  421. <input class="form-check-input" type="radio" id="commutationNo" name="benefit_commutation" value="no">
  422. <label class="form-check-label" for="commutationNo">No</label>
  423. </div>
  424. </div>
  425. <!-- Placeholder for dynamically added input -->
  426. <div id="CommutationAmountDiv" class="mt-3" style="display: none;">
  427. <label for="benefit_commutation_amount" class="form-label">Enter Benefit Commutation Amount</label>
  428. <input type="number" id="benefit_commutation_amount" class="form-control" placeholder="Enter Pensions Benefit Commutation Amount" min="1" oninput="validatePositiveNumber(this)">
  429. </div>
  430. </div>
  431. </div>
  432. <hr>
  433. <div class="row">
  434. <div class="col-md-6">
  435. <label for="datefile " class="form-label fw-bold">Date File Completed <span class="text-danger">*</span></label>
  436. <input type="text" id="datefile" class="form-control" readonly>
  437. </div>
  438. <div class="col-md-12">
  439. <label for="remarks" class="form-label fw-bold">Comments/Remarks<span class="text-danger">*</span></label>
  440. <textarea id="remarks" class="form-control" rows="4" placeholder="Enter your remarks here"></textarea>
  441. </div>
  442. </div>
  443. <div class="row mb-2 mt-2">
  444. <div class="col-md-12 d-flex justify-content-center">
  445. <button type="button" class="btn btn-primary" id="auditsubmit">Mark as Completed</button>
  446. </div>
  447. </div>
  448. </div>
  449. </div>
  450. </div>
  451. </div>
  452. </div>
  453. <div th:replace="~{fragments/modules/base/app_module_menu_box :: div}"></div>
  454. <script th:replace="~{fragments/modules/base/script :: script}"></script>
  455. <script src="node_modules/tempusdominus-bootstrap-4/build/js/tempusdominus-bootstrap-4.min.js"></script>
  456. <!-- Bootstrap 5 JS -->
  457. <script src="https://cdn.jsdelivr.net/npm/bootstrap@5.3.0-alpha1/dist/js/bootstrap.bundle.min.js"></script>
  458. <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
  459. <script>
  460. $(document).ready(function () {
  461. // Initialize the DataTable
  462. const dataTable = $('#AuditDatatable').DataTable({
  463. dom: 'Bftip',
  464. columnDefs: [
  465. { targets: 'no-sort', orderable: false }
  466. ],
  467. lengthMenu: [
  468. [50, 100, 200, 500, -1],
  469. ['50 rows', '100 rows', '200 rows', 'Show all']
  470. ],
  471. scrollY: '50vh',
  472. buttons: [
  473. { extend: 'pageLength', className: 'btn btn-warning' },
  474. { title: 'Data export', extend: 'copyHtml5', text: 'Copy', className: 'btn btn-secondary' },
  475. { extend: 'excelHtml5', text: 'Excel', className: 'btn btn-secondary' },
  476. { extend: 'csvHtml5', text: 'CSV', className: 'btn btn-secondary' },
  477. { extend: 'pdfHtml5', text: 'PDF', className: 'btn btn-secondary' }
  478. ],
  479. fixedHeader: true,
  480. autoWidth: true,
  481. responsive: true,
  482. searching: true,
  483. paging: true,
  484. info: true,
  485. ordering: false,
  486. });
  487. });
  488. document.addEventListener("DOMContentLoaded", function() {
  489. // Get today's date
  490. const today = new Date();
  491. // Format the date as DD-MM-YYYY for display
  492. const day = String(today.getDate()).padStart(2, '0');
  493. const month = String(today.getMonth() + 1).padStart(2, '0'); // Months are 0-based
  494. const year = today.getFullYear();
  495. // Combine into DD-MM-YYYY format for display
  496. const formattedDateDisplay = `${day}-${month}-${year}`;
  497. // Set the value of the input field to the current date (in DD-MM-YYYY format for display)
  498. document.getElementById("datefile").value = formattedDateDisplay;
  499. });
  500. function convertDateFormat(dateString) {
  501. if (!dateString) return '';
  502. let [day, month, year] = dateString.split('-');
  503. return `${year}-${month}-${day}`;
  504. }
  505. document.getElementById("submitbutton").addEventListener("click", function () {
  506. // Clear the inputs in the receivedcard section
  507. //$('#datefile').val('');
  508. $('#remarks').val('');
  509. // Make the receivedcard section visible
  510. document.getElementById("receivedcard").style.display = "block";
  511. // Scroll the receivedcard section into view
  512. document.getElementById("receivedcard").scrollIntoView({
  513. behavior: "smooth", // Smooth scrolling effect
  514. block: "center" // Aligns the element to the center of the viewport
  515. });
  516. });
  517. //model function
  518. function fetchEmployeeDetails(tempId) {
  519. $.ajax({
  520. url: '/gcc/api/department/audit/getpartialdetails', // API to fetch employee details
  521. type: 'GET',
  522. data: { tempId: tempId }, // Pass EMPLOYEE_CODE as a parameter
  523. success: function (response) {
  524. if (response && response.length > 0) {
  525. let employeeDetails = response[0]; // Access the first object in the array
  526. console.log("response:",response);
  527. // Populate modal fields
  528. $('#employeenomodel').val(employeeDetails.emp_no);
  529. $('#employeename').val(employeeDetails.emp_name);
  530. $('#department').val(employeeDetails.dept_name);
  531. $('#designation').val(employeeDetails.designation);
  532. $('#typeofretirement').val(employeeDetails.type_of_retirement);
  533. $('#classes').val(employeeDetails.retirement_class);
  534. $('#datefile_modal').val(employeeDetails.file_moved_date);
  535. $('#remarks_modal').val(employeeDetails.remarks);
  536. $('#retirementdate').val(employeeDetails.retirement_date);
  537. let pendingDuration = employeeDetails.pending_duration; // Assuming this comes from the response
  538. let pendingReason = employeeDetails.reason_for_pending; // Assuming this comes from the response
  539. if (pendingDuration === "yes") {
  540. $('#pendingDurationInputContainer').show(); // Show the text box
  541. $('#pendingDurationInput').val(pendingReason); // Populate the input field
  542. } else {
  543. $('#pendingDurationInputContainer').hide(); // Hide the text box
  544. }
  545. // Update radio button selection
  546. if (pendingDuration === "yes") {
  547. $('#yes').prop('checked', true);
  548. } else {
  549. $('#no').prop('checked', true);
  550. }
  551. // Update the modal title with the employee code
  552. $('#modalEmployeeCode').text(employeeDetails.emp_no);
  553. // Show the modal
  554. $('#returnretrieddetailsModal').modal('show');
  555. //additional card display function
  556. document.getElementById("submitbutton").addEventListener("click", function() {
  557. $('input[name="gpf"][value="' + employeeDetails.gpf + '"]').prop('checked', true);
  558. if (employeeDetails.gpf === "yes" || employeeDetails.gpf === "90") {
  559. $('#gpfAmountDiv').show();
  560. $('#gpfAmount').val(employeeDetails.gpf_amount);
  561. } else {
  562. $('#gpfAmountDiv').hide();
  563. }
  564. // Earned Leave & Leave on Private Affairs
  565. $('input[name="earnedleave"][value="' + employeeDetails.private_affairs + '"]').prop('checked', true);
  566. if (employeeDetails.private_affairs === "yes") {
  567. $('#earnedleaveAmountDiv').show();
  568. $('#earnedleaveAmount').val(employeeDetails.private_affairs_amount);
  569. } else {
  570. $('#earnedleaveAmountDiv').hide();
  571. }
  572. // SPFGS
  573. $('input[name="spfgs"][value="' + employeeDetails.spfgs + '"]').prop('checked', true);
  574. if (employeeDetails.spfgs === "yes") {
  575. $('#spfgsAmountDiv').show();
  576. $('#spfgsAmount').val(employeeDetails.spfgs_amount);
  577. } else {
  578. $('#spfgsAmountDiv').hide();
  579. }
  580. // DCRG File
  581. $('input[name="dcrg"][value="' + employeeDetails.dcrg + '"]').prop('checked', true);
  582. if(employeeDetails.dcrg ==="yes"){
  583. $('#dcrgCard').show();
  584. }else{
  585. $('#dcrgCard').hide();
  586. }
  587. $('#pensionNumber').val(employeeDetails.pension_number).prop('readonly',true);
  588. $('#ledgerNumber').val(employeeDetails.ledger_number).prop('readonly',true);
  589. $('input[name="benefit_pension"][value="' + employeeDetails.benefit_pension + '"]').prop('checked', true);
  590. if (employeeDetails.benefit_pension === "yes") {
  591. $('#PbAmountDiv').show();
  592. $('#benefit_pension_amount').val(employeeDetails.benefit_pension_amount).prop('readonly',true);
  593. // bpYes bpNo PbAmountDiv benefit_pension_amount
  594. $('#bpYes').prop('checked', true);
  595. $('#bpNo').prop('disabled', true);
  596. } else {
  597. $('#PbAmountDiv').hide();
  598. $('#bpNo').prop('checked', true);
  599. $('#bpYes').prop('disabled', true);
  600. }
  601. $('input[name="benefit_dcrg"][value="' + employeeDetails.benefit_dcrg + '"]').prop('checked', true);
  602. if (employeeDetails.benefit_dcrg === "yes") {
  603. $('#dcrgAmountDiv').show();
  604. $('#benefit_dcrg_amount').val(employeeDetails.benefit_dcrg_amount).prop('readonly',true);
  605. // DcrgYes DcrgNo dcrgAmountDiv benefit_dcrg_amount
  606. $('#DcrgYes').prop('checked', true);
  607. $('#DcrgNo').prop('disabled', true);
  608. } else {
  609. $('#dcrgAmountDiv').hide();
  610. $('#DcrgNo').prop('checked', true);
  611. $('#DcrgYes').prop('disabled', true);
  612. }
  613. $('input[name="benefit_commutation"][value="' + employeeDetails.benefit_commutation + '"]').prop('checked', true);
  614. if (employeeDetails.benefit_commutation === "yes") {
  615. $('#CommutationAmountDiv').show();
  616. $('#benefit_commutation_amount').val(employeeDetails.benefit_commutation_amount).prop('readonly',true);
  617. // commutationYes commutationNo CommutationAmountDiv benefit_commutation_amount
  618. $('#commutationYes').prop('checked', true);
  619. $('#commutationNo').prop('disabled', true);
  620. } else {
  621. $('#CommutationAmountDiv').hide();
  622. $('#commutationNo').prop('checked', true);
  623. $('#commutationYes').prop('disabled', true);
  624. }
  625. //$('#datefile').val('');
  626. //$('#remarks').val('');
  627. document.getElementById("receivedcard").style.display = "block";
  628. });
  629. /* document.getElementById('auditsubmit').addEventListener('click', function () {
  630. let employeeNo = $('#employeenomodel').val(); // Using jQuery to get the value
  631. // Trigger the save function and pass the value
  632. saveEntryDetails(tempId,employeeNo);
  633. }); */
  634. $('#auditsubmit').off('click').on('click', function () {
  635. let employeeNo = $('#employeenomodel').val(); // Get the employee number
  636. saveEntryDetails(tempId, employeeNo); // Call function with parameters
  637. });
  638. } else {
  639. Swal.fire({
  640. icon: 'info',
  641. title: 'No Data',
  642. text: 'No details found for the selected employee.',
  643. confirmButtonText: 'OK',
  644. });
  645. }
  646. },
  647. error: function () {
  648. Swal.fire({
  649. icon: 'error',
  650. title: 'Error',
  651. text: 'Failed to fetch employee details. Please try again.',
  652. confirmButtonText: 'OK',
  653. });
  654. },
  655. });
  656. }
  657. $(document).ready(function () {
  658. $(document).on('click', '.view-btn', function () {
  659. const empCode = $(this).data('id'); // Fetch `data-id` value
  660. const tempId = $(this).data('temp-id'); // Fetch `data-temp-id` value
  661. console.log("empCode====="+empCode);
  662. // Hide the receivedcard section before showing the modal
  663. $("#receivedcard").hide();
  664. fetchEmployeeDetails(tempId); // Call the function to fetch employee details
  665. loadFileHistory(tempId); // Load the file history for the selected employee
  666. });
  667. // Initialize the modal with static backdrop and disabled keyboard closing
  668. $('#returnretrieddetailsModal').modal({
  669. backdrop: 'static',
  670. keyboard: false,
  671. show: false // Ensure it doesn't auto-show on page load
  672. });
  673. // Handle close button click
  674. $('#back').click(function () {
  675. $('#returnretrieddetailsModal').modal('hide');
  676. });
  677. $('.close').click(function () {
  678. $('#returnretrieddetailsModal').modal('hide');
  679. });
  680. // Listen for changes on the GPF radio buttons
  681. document.querySelectorAll('input[name="gpf"]').forEach(radio => {
  682. radio.addEventListener('change', function () {
  683. const gpfAmountDiv = document.getElementById('gpfAmountDiv');
  684. if (this.value === 'yes' || this.value === '90') {
  685. gpfAmountDiv.style.display = 'block'; // Show the input field
  686. } else {
  687. gpfAmountDiv.style.display = 'none'; // Hide the input field
  688. document.getElementById('gpfAmount').value = ''; // Clear the input field
  689. }
  690. });
  691. });
  692. // Listen for changes on the private affaires radio buttons
  693. document.querySelectorAll('input[name="earnedleave"]').forEach(radio => {
  694. radio.addEventListener('change', function () {
  695. const earnedleaveAmountDiv = document.getElementById('earnedleaveAmountDiv');
  696. if (this.value === 'yes') {
  697. earnedleaveAmountDiv.style.display = 'block'; // Show the input field
  698. } else {
  699. earnedleaveAmountDiv.style.display = 'none'; // Hide the input field
  700. document.getElementById('earnedleaveAmount').value = ''; // Clear the input field
  701. }
  702. });
  703. });
  704. // Listen for changes on the spfgs radio buttons
  705. document.querySelectorAll('input[name="spfgs"]').forEach(radio => {
  706. radio.addEventListener('change', function () {
  707. const spfgsAmountDiv = document.getElementById('spfgsAmountDiv');
  708. if (this.value === 'yes') {
  709. spfgsAmountDiv.style.display = 'block'; // Show the input field
  710. } else {
  711. spfgsAmountDiv.style.display = 'none'; // Hide the input field
  712. document.getElementById('spfgsAmount').value = ''; // Clear the input field
  713. }
  714. });
  715. });
  716. document.querySelectorAll('input[name="benefit_pension"]').forEach(radio => {
  717. radio.addEventListener('change', function () {
  718. const PbAmountDiv = document.getElementById('PbAmountDiv');
  719. if (this.value === 'yes') {
  720. PbAmountDiv.style.display = 'block'; // Show the input field
  721. } else {
  722. PbAmountDiv.style.display = 'none'; // Hide the input field
  723. document.getElementById('benefit_pension_amount').value = ''; // Clear the input field
  724. }
  725. });
  726. });
  727. document.querySelectorAll('input[name="benefit_dcrg"]').forEach(radio => {
  728. radio.addEventListener('change', function () {
  729. const dcrgAmountDiv = document.getElementById('dcrgAmountDiv');
  730. if (this.value === 'yes') {
  731. dcrgAmountDiv.style.display = 'block'; // Show the input field
  732. } else {
  733. dcrgAmountDiv.style.display = 'none'; // Hide the input field
  734. document.getElementById('benefit_dcrg_amount').value = ''; // Clear the input field
  735. }
  736. });
  737. });
  738. document.querySelectorAll('input[name="benefit_commutation"]').forEach(radio => {
  739. radio.addEventListener('change', function () {
  740. const CommutationAmountDiv = document.getElementById('CommutationAmountDiv');
  741. if (this.value === 'yes') {
  742. CommutationAmountDiv.style.display = 'block'; // Show the input field
  743. } else {
  744. CommutationAmountDiv.style.display = 'none'; // Hide the input field
  745. document.getElementById('benefit_commutation_amount').value = ''; // Clear the input field
  746. }
  747. });
  748. });
  749. });
  750. function loadFileHistory(tempId) {
  751. $.ajax({
  752. url: '/gcc/api/department/audit/fileMovementhistory', // API endpoint
  753. type: 'GET',
  754. data: { tempId: tempId }, // Pass empCode as a parameter
  755. success: function (response) {
  756. if (response.length > 0) {
  757. let historyHtml = '';
  758. response.forEach(item => {
  759. historyHtml += `
  760. <div class="file-history-item">
  761. <div class="file-history-date">${formatDateTime(item.fileMovedDateHistory)}</div>
  762. <div class="file-history-content">
  763. <div class="file-history-status">${item.fileStatusHistory}</div>
  764. <div class="file-history-remarks">Comments/Remarks: ${item.remarksHistory || 'N/A'}</div>
  765. </div>
  766. </div>
  767. `;
  768. });
  769. $('#fileHistoryContainer').html(historyHtml);
  770. } else {
  771. $('#fileHistoryContainer').html('<p>No file history available.</p>');
  772. }
  773. },
  774. error: function () {
  775. $('#fileHistoryContainer').html('<p>Failed to load file history. Please try again later.</p>');
  776. }
  777. });
  778. }
  779. // Function to format date and time
  780. function formatDateTime(dateString) {
  781. const options = {
  782. day: '2-digit',
  783. month: '2-digit',
  784. year: 'numeric',
  785. };
  786. return new Date(dateString).toLocaleDateString('en-GB', options); // Formats as dd-mm-yyyy
  787. }
  788. function saveEntryDetails(tempId,empNo) {
  789. //console.log("emp_no inside=="+empCode);
  790. let selectedGpfValue = $('input[name="gpf"]:checked').val(); // Get the selected radio button value
  791. let gpfAmount = null;
  792. // Check if GPF Amount input is visible and get its value
  793. if (selectedGpfValue === 'yes' || selectedGpfValue === '90') {
  794. gpfAmount = $('#gpfAmount').val(); // Retrieve the amount if available, else null
  795. if (!gpfAmount) {
  796. Swal.fire({
  797. icon: 'warning',
  798. title: 'Validation Error',
  799. text: 'Please Enter GPF Amount',
  800. confirmButtonText: 'OK'
  801. });
  802. return; // Stop further execution if validation fails
  803. }
  804. }
  805. let selectedElValue = $('input[name="earnedleave"]:checked').val();
  806. let earnedleaveAmount=null;
  807. if (selectedElValue === 'yes') {
  808. earnedleaveAmount = $('#earnedleaveAmount').val(); // Retrieve the amount if available, else null
  809. if (!earnedleaveAmount) {
  810. Swal.fire({
  811. icon: 'warning',
  812. title: 'Validation Error',
  813. text: 'Please Enter EL/LPA Amount',
  814. confirmButtonText: 'OK'
  815. });
  816. return; // Stop further execution if validation fails
  817. }
  818. }
  819. let selectedspfgsValue = $('input[name="spfgs"]:checked').val();
  820. let spfgsAmount=null;
  821. if (selectedspfgsValue === 'yes') {
  822. spfgsAmount = $('#spfgsAmount').val(); // Retrieve the amount if available, else null
  823. if (!spfgsAmount) {
  824. Swal.fire({
  825. icon: 'warning',
  826. title: 'Validation Error',
  827. text: 'Please Enter SPFGS Amount',
  828. confirmButtonText: 'OK'
  829. });
  830. return; // Stop further execution if validation fails
  831. }
  832. }
  833. //dcrf
  834. let selecteddcrgValue = $('input[name="dcrg"]:checked').val();
  835. let selectedPd = $('input[name="benefit_pension"]:checked').val();
  836. let selectedPdAmount=null;
  837. if (selectedPd === 'yes') {
  838. selectedPdAmount = $('#benefit_pension_amount').val();
  839. if (!selectedPdAmount) {
  840. Swal.fire({
  841. icon: 'warning',
  842. title: 'Validation Error',
  843. text: 'Please Enter Pension Benefit Amount',
  844. confirmButtonText: 'OK'
  845. });
  846. return; // Stop further execution if validation fails
  847. }
  848. }
  849. let selecteddcrg = $('input[name="benefit_dcrg"]:checked').val();
  850. let seldcrgAmount=null;
  851. if (selecteddcrg === 'yes') {
  852. seldcrgAmount = $('#benefit_dcrg_amount').val();
  853. if (!seldcrgAmount) {
  854. Swal.fire({
  855. icon: 'warning',
  856. title: 'Validation Error',
  857. text: 'Please Enter DCRG Benefit Amount',
  858. confirmButtonText: 'OK'
  859. });
  860. return; // Stop further execution if validation fails
  861. }
  862. }
  863. let selectedcom = $('input[name="benefit_commutation"]:checked').val();
  864. let selectedcomAmount=null;
  865. if (selectedcom === 'yes') {
  866. selectedcomAmount = $('#benefit_commutation_amount').val();
  867. if (!selectedcomAmount) {
  868. Swal.fire({
  869. icon: 'warning',
  870. title: 'Validation Error',
  871. text: 'Please Enter Commutation Benefit Amount',
  872. confirmButtonText: 'OK'
  873. });
  874. return; // Stop further execution if validation fails
  875. }
  876. }
  877. let entryDetails = {
  878. empNo:empNo,
  879. tempId: tempId, // Pass the stored tempId value
  880. dateToAudit: convertDateFormat($('#datefile').val()?.trim()),
  881. remarks: $('#remarks').val(),
  882. deptId:$('#deptId').text().trim(),
  883. filemovedby:$('#userId').text().trim(),
  884. gpf: selectedGpfValue, // Add GPF value (null if none selected)
  885. gpfAmount: gpfAmount, // Include the GPF amount
  886. private_affairs:selectedElValue,
  887. private_affairs_amount:earnedleaveAmount,
  888. spfgs:selectedspfgsValue,
  889. spfgs_amount:spfgsAmount,
  890. recovery_emp:$('#recoveryemployeevalue').val()|| null,
  891. dcrg:selecteddcrgValue,
  892. pension_number:$('#pensionNumber').val(),
  893. ledger_number:$('#ledgerNumber').val(),
  894. benefit_pension:selectedPd,
  895. benefit_dcrg:selecteddcrg,
  896. benefit_commutation:selectedcom,
  897. benefit_pension_amount:selectedPdAmount,
  898. benefit_dcrg_amount:seldcrgAmount,
  899. benefit_commutation_amount:selectedcomAmount
  900. };
  901. console.log("entryDetails:",entryDetails);
  902. if (!entryDetails.dcrg) {
  903. Swal.fire({
  904. icon: 'warning',
  905. title: 'Validation Error!',
  906. text: 'DCRG are required.',
  907. confirmButtonText: 'OK'
  908. });
  909. return;
  910. }
  911. if (!entryDetails.spfgs) {
  912. Swal.fire({
  913. icon: 'warning',
  914. title: 'Validation Error!',
  915. text: 'SPFGS are required.',
  916. confirmButtonText: 'OK'
  917. });
  918. return;
  919. }
  920. if (!entryDetails.private_affairs) {
  921. Swal.fire({
  922. icon: 'warning',
  923. title: 'Validation Error!',
  924. text: 'Private affairs are required.',
  925. confirmButtonText: 'OK'
  926. });
  927. return;
  928. }
  929. if (!entryDetails.gpf) {
  930. Swal.fire({
  931. icon: 'warning',
  932. title: 'Validation Error!',
  933. text: 'GPF are required.',
  934. confirmButtonText: 'OK'
  935. });
  936. return;
  937. }
  938. if (!entryDetails.remarks) {
  939. Swal.fire({
  940. icon: 'warning',
  941. title: 'Validation Error!',
  942. text: 'Remarks are required.',
  943. confirmButtonText: 'OK'
  944. });
  945. return;
  946. }
  947. // Disable the button to prevent multiple submissions
  948. $('#auditsubmit').prop('disabled', true).text('Processing...');
  949. $.ajax({
  950. url: '/gcc/api/department/partial/updateEmployeeDetails',
  951. type: 'POST',
  952. contentType: 'application/json',
  953. data: JSON.stringify(entryDetails),
  954. success: function (response) {
  955. $('#auditsubmit').prop('disabled', false).text('Mark as Completed');
  956. Swal.fire({
  957. icon: 'success',
  958. title: 'Success',
  959. text: response,
  960. allowOutsideClick: false,
  961. allowEscapeKey: false,
  962. allowEnterKey: false,
  963. confirmButtonText: 'OK'
  964. }).then((result) => {
  965. if (result.isConfirmed) {
  966. $('#auditsubmit').prop('disabled', false).text('Mark as Completed');
  967. window.location.href = "/gcc/department/partial/pendency";
  968. console.log("Continue clicked");
  969. }
  970. });
  971. },
  972. error: function (xhr, status, error) {
  973. $('#auditsubmit').prop('disabled', false).text('Mark as Completed');
  974. Swal.fire({
  975. icon: 'error',
  976. title: 'Error',
  977. text: 'Failed to save details. Please try again.',
  978. confirmButtonText: 'OK'
  979. });
  980. console.error('Error:', xhr.responseText);
  981. }
  982. });
  983. }
  984. //amount field validation
  985. function validatePositiveNumber(input) {
  986. if (input.value < 1) {
  987. input.value = "";
  988. }
  989. }
  990. </script>
  991. </body>
  992. </html>