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.

1189 lines
50 KiB

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