This portal only for GCC Officers. Based on there roles and Group ID they can view there module`s Like PGR, QR Public Asset Feedback, Makkalai Thedi Mayor,etc...
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.

1023 lines
45 KiB

​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
​
  1. <!DOCTYPE html>
  2. <html lang="en" xmlns:th="http://www.thymeleaf.org">
  3. <head th:replace="~{fragments/modules/base/head :: head}">
  4. </head>
  5. <style>
  6. .required {
  7. color: red;
  8. }
  9. .card-box {
  10. box-shadow: rgba(0, 0, 0, 0.5) 0px 3px 8px;
  11. height: 140px;
  12. }
  13. @media ( max-width : 768px) {
  14. .card-box {
  15. text-align: center;
  16. }
  17. }
  18. .custom-width1 {
  19. width: 120px; /* Adjust the width as needed */
  20. }
  21. #modalBody h4 {
  22. font-weight: bold;
  23. margin-top: 15px;
  24. margin-bottom: 10px;
  25. }
  26. #modalBody p {
  27. margin: 5px 0;
  28. }
  29. #modalBody hr {
  30. margin: 15px 0;
  31. }
  32. .comment {
  33. margin-bottom: 20px;
  34. }
  35. .comment p {
  36. margin: 0;
  37. }
  38. hr {
  39. border: 1px solid #ccc;
  40. }
  41. .col-4 {
  42. font-weight: bold;
  43. text-align: right;
  44. }
  45. .col-8 {
  46. padding-left: 20px;
  47. }
  48. .comment {
  49. padding: 10px 0;
  50. }
  51. .comment .text-muted {
  52. font-size: 0.9em;
  53. color: #6c757d;
  54. }
  55. .comment hr {
  56. border-top: 1px solid #ccc;
  57. }
  58. .comment .btn-link {
  59. font-size: 0.9em;
  60. text-decoration: underline;
  61. color: #007bff;
  62. }
  63. /* Make the modal body scrollable */
  64. #detailsModal .modal-body {
  65. max-height: 70vh; /* Limit the height to 70% of the viewport */
  66. overflow-y: auto; /* Enable vertical scrolling */
  67. }
  68. </style>
  69. <body>
  70. <div class="wrapper">
  71. <!-- Header -->
  72. <header th:replace="~{fragments/modules/base/header :: header}"></header>
  73. <div class="page-wrap">
  74. <!-- Left Menu -->
  75. <div th:replace="~{fragments/modules/base/menu :: menu}"></div>
  76. <div class="main-content">
  77. <div class="container-fluid">
  78. <div class="page-header">
  79. <div class="row align-items-end">
  80. <div class="col-lg-6">
  81. <div class="page-header-title">
  82. <i class="ik ik-layers bg-blue"></i>
  83. <div class="d-inline">
  84. <h5>Agent's QAQC Calls</h5>
  85. <span>1913 QAQC Call List</span>
  86. </div>
  87. </div>
  88. </div>
  89. <div class="col-lg-6">
  90. <nav class="breadcrumb-container" aria-label="breadcrumb">
  91. <ol class="breadcrumb">
  92. <li class="breadcrumb-item"><a href="/gcc/index"><i
  93. class="ik ik-home"></i></a></li>
  94. <li class="breadcrumb-item" aria-current="page">1913 QAQC</li>
  95. <li class="breadcrumb-item" aria-current="page">Agents
  96. QAQC</li>
  97. <li class="breadcrumb-item active" aria-current="page">QAQC
  98. Calls</li>
  99. </ol>
  100. </nav>
  101. </div>
  102. </div>
  103. </div>
  104. <div class="row mt-4">
  105. <div class="col-md-12">
  106. <div class="card">
  107. <div class="card-body">
  108. <div class="page-header-title">
  109. <h5 style="margin: 0; font-weight: bold;">Today Assigned
  110. Calls</h5>
  111. </div>
  112. <div>
  113. <div class="row mt-2">
  114. <!-- Total Calls Assigned -->
  115. <div class="col-xl-3 col-md-6 col-sm-12">
  116. <div class="card card-box p-3 text-center mt-4">
  117. <h6 class="text-facebook mb-4">
  118. <b>Total Calls Assigned</b>
  119. </h6>
  120. <h4 class="text-twitter fw-700 mt-4"
  121. th:text="${details[0]?.Total_Calls_assigned}">
  122. <!-- Display Total Calls Assigned -->
  123. </h4>
  124. </div>
  125. </div>
  126. <!-- QA&QC Calls -->
  127. <div class="col-xl-3 col-md-6 col-sm-12"
  128. style="background-color: aqua;">
  129. <div class="card card-box p-3 text-center mt-4">
  130. <h6 class="text-facebook mb-4">
  131. <b>QA&QC Calls</b>
  132. </h6>
  133. <h4 class="text-twitter fw-700 mt-4"
  134. th:text=" ${details[0]?.Closed_Call_count}">
  135. <!-- Display Closed Calls Count -->
  136. </h4>
  137. </div>
  138. </div>
  139. <!-- In-progress Calls -->
  140. <div class="col-xl-2 col-md-6 col-sm-12">
  141. <div class="card card-box p-3 text-center mt-4 ">
  142. <h6 class="text-facebook mb-4">
  143. <b>In-progress Calls</b>
  144. </h6>
  145. <h4 class="text-twitter fw-700 mt-4"
  146. th:text="${details[0]?.Inprogress_Call_count}">
  147. <!-- Display In-progress Calls Count -->
  148. </h4>
  149. </div>
  150. </div>
  151. <!-- Follow-up Calls -->
  152. <div class="col-xl-2 col-md-6 col-sm-12">
  153. <div class="card card-box p-3 text-center mt-4">
  154. <h6 class="text-facebook mb-2">
  155. <b>Official Follow-up Calls</b>
  156. </h6>
  157. <h4 class="text-twitter fw-700 mt-3"
  158. th:text="${details[0]?.Followup_Call_count}">
  159. <!-- Display Follow-up Calls Count -->
  160. </h4>
  161. </div>
  162. </div>
  163. <div class="col-xl-2 col-md-6 col-sm-12">
  164. <div class="card card-box p-3 text-center mt-4">
  165. <h6 class="text-facebook mb-2">
  166. <b>Public Follow-up Calls</b>
  167. </h6>
  168. <h4 class="text-twitter fw-700 mt-3"
  169. th:text="${details[0]?.PublicFollowup_Call_count}">
  170. <!-- Display Follow-up Calls Count -->
  171. </h4>
  172. </div>
  173. </div>
  174. </div>
  175. <div class="row mt-2">
  176. <div class="col-md-12">
  177. <div class="card-header">
  178. <h3 style="font-weight: bold;font-size: large;"><span th:text="${userId}" style="display:none;" id="userIdSpan"></span><span th:text="${agent[0]['agent_name']}" style="font-weight: bold;font-size: large;"></span>'s QAQC Calls List</h3>
  179. </div>
  180. <div class="card-block">
  181. <div class="col-md-12">
  182. <div class="row">
  183. <button id="primaryButton" class="btn btn-success">Non-Processed
  184. Calls</button>
  185. <button id="secondaryButton"
  186. class="btn btn-secondary btn-custom ml-3">Processed
  187. Calls</button>
  188. </div>
  189. </div>
  190. </div>
  191. <div class="card-body">
  192. <div class="table-responsive" id="primaryTable"
  193. style="display: block;">
  194. <table id="QaqcDatatable"
  195. class="table table-striped table-bordered table-hover dataTable"
  196. role="grid">
  197. <thead class="thead-dark">
  198. <tr role="row">
  199. <th class="text-center">S.No</th>
  200. <th class="text-center">ID</th>
  201. <th class="text-center">Complaint Date</th>
  202. <th class="text-center">Public Name</th>
  203. <th class="text-center">Public PhoneNo</th>
  204. <th class="text-center">Complaint Type</th>
  205. <th class="text-center">View Details</th>
  206. <th class="text-center custom-width1">Actions</th>
  207. <th class="text-center">Remarks</th>
  208. <th class="text-center">Submit</th>
  209. </tr>
  210. </thead>
  211. <tbody>
  212. <!-- Thymeleaf loop for populating data -->
  213. <tr th:each="call, iterStat : ${qaqcCallsLists}">
  214. <td th:text="${iterStat.index + 1}" class="text-center"></td>
  215. <td th:text="${call['complaint_number']}"
  216. class="text-center complaint-select"></td>
  217. <td th:text="${call['complaint_date']}"
  218. class="text-center"></td>
  219. <td th:text="${call['complaint_person_name']}"
  220. class="text-center"></td>
  221. <td th:text="${call['complaint_mobilenumber']}"
  222. class="text-center"></td>
  223. <td th:text="${call['complaint_type']}"
  224. class="text-center"></td>
  225. <td class="text-center">
  226. <button type="button" class="btn btn-info"
  227. th:data-complaint-number="${call['complaint_number']}">
  228. View</button>
  229. </td>
  230. <td class="text-center"><select
  231. class="form-control form-control-sm action-select action-dropdown">
  232. <option value="" selected>Select</option>
  233. <option th:each="status : ${qaqcCallsActioin}"
  234. th:value="${status.call_status}"
  235. th:text="${status.call_status}"></option>
  236. </select>
  237. <div class="schedule-call d-none mt-2">
  238. <input type="date" class="date-picker form-control"
  239. name="remainderDate">
  240. </div>            </td>
  241. <td class="text-center"><input type="text"
  242. class="form-control form-control-sm "
  243. placeholder="Remarks"></td>
  244. <td class="text-center">
  245. <button class="btn btn-primary btn-sm submit-btn submitid"
  246. th:data-id="${call['data_id']}"
  247. th:complaint-select="${call['complaint_number']}"
  248. th:data-name="${call['complaint_person_name']}"
  249. th:data-number="${call['complaint_mobilenumber']}"
  250. th:data-complaint-type="${call['complaint_type']}"
  251. onclick="submitComplaint(this)" disabled="disabled">
  252. Submit</button>
  253. </td>
  254. </tr>
  255. </tbody>
  256. </table>
  257. </div>
  258. <div class="table-responsive" id="secondaryTable"
  259. style="display: none;">
  260. <table id="SecondaryDatatable"
  261. class="table table-striped table-bordered table-hover dataTable"
  262. role="grid">
  263. <thead class="thead-dark">
  264. <tr role="row">
  265. <th class="text-center">S.No</th>
  266. <th class="text-center">ID</th>
  267. <th class="text-center">Complaint Date</th>
  268. <th class="text-center">Public Name</th>
  269. <th class="text-center">Public PhoneNo</th>
  270. <th class="text-center">Complaint Type</th>
  271. <th class="text-center">View Details</th>
  272. <th class="text-center custom-width1">Actions</th>
  273. <th class="text-center">Remarks</th>
  274. </tr>
  275. </thead>
  276. <tbody>
  277. <tr th:each="call, iterStat : ${qaqcSubmitDetails}">
  278. <td th:text="${iterStat.index + 1}" class="text-center"></td>
  279. <td th:text="${call['complaint_number']}"
  280. class="text-center complaint-select"></td>
  281. <td th:text="${call['complaint_date']}"
  282. class="text-center"></td>
  283. <td th:text="${call['complaint_person_name']}"
  284. class="text-center"></td>
  285. <td th:text="${call['complaint_mobilenumber']}"
  286. class="text-center"></td>
  287. <td th:text="${call['complaint_type']}"
  288. class="text-center"></td>
  289. <td class="text-center">
  290. <button type="button" class="btn btn-info"
  291. th:data-complaint-number="${call['complaint_number']}">View</button>
  292. </td>
  293. <td th:text="${call['call_status']}" class="text-center"></td>
  294. <td th:text="${call['remarks']}" class="text-center"></td>
  295. </tr>
  296. </tbody>
  297. </table>
  298. </div>
  299. </div>
  300. </div>
  301. </div>
  302. </div>
  303. </div>
  304. </div>
  305. </div>
  306. </div>
  307. </div>
  308. </div>
  309. <footer th:replace="~{fragments/modules/base/footer :: footer}"></footer>
  310. </div>
  311. </div>
  312. <!-- Modal -->
  313. <div class="modal fade" id="detailsModal" tabindex="-1" role="dialog"
  314. aria-labelledby="detailsModalLabel" aria-hidden="true" data-backdrop="static" data-keyboard="false">
  315. <div class="modal-dialog modal-lg" role="document">
  316. <div class="modal-content">
  317. <div class="modal-header">
  318. <h5 class="modal-title" id="detailsModalLabel">Complaint
  319. Details</h5>
  320. <button type="button" class="close" data-dismiss="modal"
  321. aria-label="Close">
  322. <span aria-hidden="true">&times;</span>
  323. </button>
  324. </div>
  325. <div class="modal-body" id="modalBody">
  326. <!-- Details will be populated here -->
  327. </div>
  328. <div class="modal-footer">
  329. <button type="button" class="btn btn-secondary"
  330. data-dismiss="modal">Close</button>
  331. </div>
  332. </div>
  333. </div>
  334. </div>
  335. <!-- Include jQuery and Bootstrap JavaScript -->
  336. <script src="https://code.jquery.com/jquery-3.6.0.min.js"></script>
  337. <script
  338. src="https://maxcdn.bootstrapcdn.com/bootstrap/4.5.2/js/bootstrap.min.js"></script>
  339. <script th:replace="~{fragments/modules/base/script :: script}"></script>
  340. <!-- sweet alert -->
  341. <script src="https://cdn.jsdelivr.net/npm/sweetalert2@11"></script>
  342. <script type="text/javascript">
  343. $(document).ready(function () {
  344. $(document).on('click', '.btn-info', function () {
  345. // Retrieve the complaint number from the data attribute
  346. var complaintNumber = $(this).data('complaint-number');
  347. // Call the viewDetails function with the complaint number
  348. viewDetails(complaintNumber);
  349. });
  350. $('#primaryButton').addClass('btn-success').removeClass('btn-secondary');
  351. $('#secondaryButton').addClass('btn-secondary').removeClass('btn-success');
  352. // Toggle functionality for Primary and Secondary buttons
  353. $('#primaryButton').click(function () {
  354. $('#primaryTable').show();
  355. $('#secondaryTable').hide();
  356. $(this).addClass('btn-success').removeClass('btn-secondary');
  357. $('#secondaryButton').addClass('btn-secondary').removeClass('btn-success');
  358. $('#QaqcDatatable').DataTable().columns.adjust().draw();
  359. });
  360. $('#secondaryButton').click(function () {
  361. $('#primaryTable').hide();
  362. $('#secondaryTable').show();
  363. $(this).addClass('btn-success').removeClass('btn-secondary');
  364. $('#primaryButton').addClass('btn-secondary').removeClass('btn-success');
  365. $('#SecondaryDatatable').DataTable().columns.adjust().draw();
  366. });
  367. var table = $('#QaqcDatatable').DataTable({
  368. dom: 'Bftip',
  369. columnDefs: [
  370. { targets: 'no-sort', orderable: false }
  371. ],
  372. lengthMenu: [
  373. [50, 100, 200, 500, -1],
  374. ['50 rows', '100 rows', '200 rows', 'Show all']
  375. ],
  376. scrollY: '50vh',
  377. fixedColumns: {
  378. left: 1,
  379. right: 1
  380. },
  381. buttons: [
  382. {
  383. extend: 'pageLength',
  384. className: 'btn btn-warning'
  385. },
  386. {
  387. title: 'Data export',
  388. extend: 'copyHtml5',
  389. text: 'Copy',
  390. className: 'btn btn-secondary',
  391. id: 'copyBtn'
  392. },
  393. {
  394. extend: 'excelHtml5',
  395. text: 'Excel',
  396. className: 'btn btn-secondary',
  397. id: 'excelBtn'
  398. },
  399. {
  400. extend: 'csvHtml5',
  401. text: 'CSV',
  402. className: 'btn btn-secondary',
  403. id: 'csvBtn'
  404. },
  405. {
  406. extend: 'pdfHtml5',
  407. text: 'PDF',
  408. className: 'btn btn-secondary',
  409. id: 'pdfBtn'
  410. }
  411. ],
  412. fixedHeader: true,
  413. autoWidth: true,
  414. responsive: true,
  415. searching: true,
  416. select: false,
  417. processing: false
  418. });
  419. var table1 = $('#SecondaryDatatable').DataTable({
  420. dom: 'Bftip',
  421. columnDefs: [
  422. { targets: 'no-sort', orderable: false }
  423. ],
  424. lengthMenu: [
  425. [50, 100, 200, 500, -1],
  426. ['50 rows', '100 rows', '200 rows', 'Show all']
  427. ],
  428. scrollY: '50vh',
  429. fixedColumns: {
  430. left: 1,
  431. right: 1
  432. },
  433. buttons: [
  434. {
  435. extend: 'pageLength',
  436. className: 'btn btn-warning'
  437. },
  438. {
  439. title: 'Data export',
  440. extend: 'copyHtml5',
  441. text: 'Copy',
  442. className: 'btn btn-secondary',
  443. id: 'copyBtn'
  444. },
  445. {
  446. extend: 'excelHtml5',
  447. text: 'Excel',
  448. className: 'btn btn-secondary',
  449. id: 'excelBtn'
  450. },
  451. {
  452. extend: 'csvHtml5',
  453. text: 'CSV',
  454. className: 'btn btn-secondary',
  455. id: 'csvBtn'
  456. },
  457. {
  458. extend: 'pdfHtml5',
  459. text: 'PDF',
  460. className: 'btn btn-secondary',
  461. id: 'pdfBtn'
  462. }
  463. ],
  464. fixedHeader: true,
  465. autoWidth: true,
  466. responsive: true,
  467. searching: true,
  468. select: false,
  469. processing: false
  470. });
  471. // Event listeners for changes in dropdown, remarks, and date picker
  472. $(document).on('change', '.action-dropdown', function () {
  473. const parentRow = $(this).closest('tr');
  474. const schedulerDiv = parentRow.find('.schedule-call');
  475. schedulerDiv.toggleClass('d-none', $(this).val() !== 'FOLLOWUP');
  476. validateFields(parentRow);
  477. });
  478. $(document).on('input', 'input[type="text"]', function () {
  479. const parentRow = $(this).closest('tr');
  480. validateFields(parentRow);
  481. });
  482. $(document).on('change', '.date-picker', function () {
  483. const parentRow = $(this).closest('tr');
  484. validateFields(parentRow);
  485. });
  486. // Validate function to check conditions for enabling/disabling submit button
  487. function validateFields(row) {
  488. const actionSelect = row.find('.action-select');
  489. const remarksInput = row.find('input[type="text"]');
  490. const submitButton = row.find('.submit-btn');
  491. const actionValue = actionSelect.val().trim();
  492. const remarksFilled = remarksInput.val().trim() !== "";
  493. const followUpSelected = actionValue === "FOLLOWUP";
  494. const remainderDateFilled = row.find('.date-picker').val()?.trim() !== ""; // Check if date is selected
  495. // Enable submit button based on conditions
  496. if (
  497. (followUpSelected && remainderDateFilled && remarksFilled) || (actionValue !== "FOLLOWUP" && actionValue !=="Select")|| (actionValue === "MOBILE_NUM" && remarksFilled) // FOLLOWUP requires remainder date and remarks
  498. ) {
  499. submitButton.prop('disabled', false); // Enable submit button
  500. } else {
  501. submitButton.prop('disabled', true); // Disable submit button
  502. }
  503. }
  504. // Initial validation for all rows on page load
  505. $("#QaqcDatatable tbody tr").each(function () {
  506. const row = $(this);
  507. const submitButton = row.find('.submit-btn');
  508. submitButton.prop('disabled', true); // Ensure submit button is initially disabled
  509. validateFields(row); // Validate fields for further interaction
  510. });
  511. // Re-validate fields on input changes
  512. $("#QaqcDatatable").on('input change', '.action-select, input[type="text"], .date-picker', function () {
  513. const row = $(this).closest('tr');
  514. validateFields(row);
  515. });
  516. });
  517. function submitComplaint(button) {
  518. // Access the userId from the hidden span
  519. var userId = document.getElementById('userIdSpan').textContent;
  520. // Log userId to the console
  521. //console.log('Inside submit button UserId=====:', userId);
  522. const row = button.parentNode.parentNode;
  523. // Fetch the values from the corresponding cells in the row
  524. const dataId = row.querySelector('.submit-btn').getAttribute('data-id'); // Fetch the data_id
  525. const action = row.querySelector('.action-select').value.trim(); // Fetch the action value
  526. const complaintNumber = row.querySelector('.complaint-select').innerText.trim(); // Fetch complaint number
  527. const remarks = row.querySelector('input[type="text"]').value.trim(); // Fetch the remarks value
  528. const remainderDate = row.querySelector('.date-picker')?.value.trim(); // Fetch the remainder date (if any)
  529. //console.log(row);
  530. //console.log(dataId);
  531. //console.log(action);
  532. //console.log(complaintNumber);
  533. //console.log(remarks);
  534. //console.log(remainderDate);
  535. $('.submitid').prop('disabled', true).text('Submitting...');
  536. const name = button.getAttribute('data-name')?.trim() || "N/A";
  537. const cellnumber = button.getAttribute('data-number');
  538. const complaintTypeName = button.getAttribute('data-complaint-type');
  539. // Validation
  540. if (!dataId || !action || action === "Select") {
  541. Swal.fire("Error", "Action is required!", "error");
  542. $('.submitid').prop('disabled', false).text('Submit');
  543. return;
  544. }
  545. if (action !== 'COMPLETED' && remarks === "") {
  546. Swal.fire("Error", "Fill Remarks", "error");
  547. $('.submitid').prop('disabled', false).text('Submit');
  548. return;
  549. }
  550. if (action === 'FOLLOWUP' && remarks === "" && (!remainderDate || remainderDate === "")) {
  551. Swal.fire("Error", "Schedule Date is required for Follow-Up!", "error");
  552. $('.submitid').prop('disabled', false).text('Submit');
  553. return;
  554. }
  555. //console.log("outside ajax");
  556. // AJAX Request
  557. $.ajax({
  558. url: '/gcc/api/callcenterqaqc/agent/qaqccalls/update',
  559. type: 'POST',
  560. data: {
  561. dataId: dataId,
  562. complaintNumber: complaintNumber,
  563. action: action,
  564. remarks: remarks,
  565. remainderDate: remainderDate,
  566. userId:userId
  567. },
  568. success: function (response) {
  569. if (response === "Success") {
  570. //console.log("Success");
  571. //console.log("name:",name);
  572. //console.log("cellnumber:",cellnumber);
  573. //console.log("complaintTypeName:",complaintTypeName);
  574. //console.log("complaintNumber:",complaintNumber);
  575. //Validate cellnumber
  576. if (!isNaN(cellnumber) || !cellnumber.trim() === "") {
  577. //console.log("valid phone number");
  578. $('.submitid').prop('disabled', false).text('Submit');
  579. // Trigger WhatsApp message functions based on action
  580. if (action === "UNATTENDED") {
  581. //sendWhatsAppMessageUnattended(name, complaintNumber, cellnumber, complaintTypeName);
  582. } else if (action === "REOPEN") {
  583. sendWhatsAppMessageReopened(name, complaintNumber, cellnumber, complaintTypeName);
  584. }
  585. }
  586. else{
  587. console.log("not valid phone number,So message not sent");
  588. }
  589. Swal.fire({
  590. icon: 'success',
  591. title: 'Success',
  592. text: 'Complaint updated successfully!',
  593. allowOutsideClick: false, // Disable clicking outside the modal to close it
  594. allowEscapeKey: false, // Disable escape key to close the modal
  595. allowEnterKey: false, // Disable enter key to close the modal
  596. showConfirmButton: true, // Ensure the confirm button is visible
  597. }).then((result) => {
  598. if (result.isConfirmed) {
  599. console.log("ok button");
  600. $('.submitid').prop('disabled', false).text('Submit');
  601. const table = $('#QaqcDatatable').DataTable();
  602. // Remove the row
  603. table.row($(row)).remove();
  604. // Reorder S.No column
  605. table.rows().every(function (index) {
  606. const row = this.node();
  607. $(row).find('td:first-child').text(index + 1); // Update S.No
  608. });
  609. // Redraw the table
  610. table.draw(false);
  611. }
  612. });
  613. }
  614. else if (response === "error") {
  615. $('.submitid').prop('disabled', false).text('Submit');
  616. Swal.fire("Error", "Failed to update complaint. Please try again later.", "error");
  617. }
  618. else {
  619. $('.submitid').prop('disabled', false).text('Submit');
  620. Swal.fire("Error", "Failed to update complaint. Please try again.", "error");
  621. }
  622. },
  623. error: function (xhr, status, error) {
  624. $('.submitid').prop('disabled', false).text('Submit');
  625. Swal.fire("Error", `An error occurred: ${xhr.responseText || error}`, "error");
  626. }
  627. });
  628. //$('.submitid').prop('disabled', false).text('Submit');
  629. }
  630. function viewDetails(complaintNumber) {
  631. document.getElementById('modalBody').innerHTML = '<p style="text-align:center;">Please wait, loading data...</p>';
  632. $('#detailsModal').modal('show');
  633. // Fetch the main complaint details
  634. $.ajax({
  635. url: '/gcc/api/callcenterqaqc/agent/qaqccalls/getComplaintDetails',
  636. type: 'GET',
  637. data:{complaintNumber:complaintNumber},
  638. success: function (data) {
  639. //console.log('Complaint Data:', data);
  640. // Fetch agent response details
  641. $.ajax({
  642. url: '/gcc/api/callcenterqaqc/agent/attendedcomplaintshistory',
  643. type: 'GET',
  644. data: { complaintNumber },
  645. success: function (agentResponse) {
  646. //console.log('Agent Response:', agentResponse);
  647. // Use the logic for building complaint and agent details as HTML
  648. const detailsHtml = generateDetailsHtml(data, agentResponse);
  649. // Update modal content
  650. document.getElementById('modalBody').innerHTML = detailsHtml;
  651. },
  652. error: function () {
  653. document.getElementById('modalBody').innerHTML = '<p>Error loading agent details. Please try again later.</p>';
  654. }
  655. });
  656. },
  657. error: function () {
  658. document.getElementById('modalBody').innerHTML = '<p>Error loading complaint details. Please try again later.</p>';
  659. }
  660. });
  661. }
  662. // Function to generate complaint and agent details HTML
  663. function generateDetailsHtml(data, agentResponse) {
  664. // Helper function to format date to yyyy-mm-dd
  665. function formatDate(dateStr) {
  666. if (!dateStr) return 'N/A';
  667. const date = new Date(dateStr);
  668. return date.toISOString().split('T')[0]; // Formats to yyyy-mm-dd
  669. }
  670. // Format complaint messages
  671. let messagesHtml = '';
  672. if (data.comments && data.comments.length > 0) {
  673. data.comments.forEach((comment) => {
  674. const commentImageLink = comment.Comp_Image && comment.Comp_Image !== "No image available"
  675. ? `<a href="${comment.Comp_Image}" target="_blank" style="color: green; text-decoration: underline;">View Image</a>`
  676. : '<p style="color: red;">No image available for this comment.</p>';
  677. messagesHtml += `
  678. <div class="comment mb-4">
  679. <div class="row">
  680. <div class="col-2 text-center">
  681. <p class="text-muted">${comment.comment_date}</p>
  682. </div>
  683. <div class="col-10">
  684. <p><strong>${comment.user || 'N/A'}</strong> Says:</p>
  685. <p>${comment.message || 'No message available'}</p>
  686. <div class="user-image">${commentImageLink}</div>
  687. </div>
  688. </div>
  689. </div>
  690. `;
  691. });
  692. } else {
  693. messagesHtml = '<p>No comments available.</p>';
  694. }
  695. // Format agent responses
  696. let agentRepliedHtml = '';
  697. if (agentResponse.length > 0) {
  698. agentResponse.forEach((agentItem) => {
  699. agentRepliedHtml += `
  700. <div class="comment mb-4">
  701. <div class="row">
  702. <div class="col-2 text-center">
  703. <p class="text-muted"><strong>${formatDate(agentItem.created_date) || 'N/A'}</strong></p>
  704. </div>
  705. <div class="col-10">
  706. <p><strong>${agentItem.agent_name || 'N/A'}</strong>, Says: ${agentItem.call_status || 'N/A'}</p>
  707. <p><strong>Remarks: </strong>${agentItem.remarks || 'N/A'}</p>
  708. <p><strong>Remainder Date: </strong> ${formatDate(agentItem.remainder_date) || 'N/A'}</p>
  709. </div>
  710. </div>
  711. </div>
  712. `;
  713. });
  714. } else {
  715. agentRepliedHtml = '<p>No agent replied messages available.</p>';
  716. }
  717. // Check for user images
  718. const userImages = data.userimages && data.userimages.length > 0 ? data.userimages[0] : {};
  719. const imageLink = userImages.Comp_Image && userImages.Comp_Image !== "null" && userImages.Comp_Image !== ""
  720. ? `<a href="${userImages.Comp_Image}" target="_blank" style="color: green; text-decoration: underline;">UserImages: View Image</a>`
  721. : '<p style="color: red;">UserImages: No image available.</p>';
  722. // Combine all sections into the final HTML
  723. const detailsHtml = `
  724. <div class="row">
  725. <div class="col-md-12">
  726. <h4>Complaint Person's Details:</h4>
  727. <div class="row">
  728. <div class="col-6">
  729. <p><strong>Complaint Number:</strong> ${data.complaintid || 'N/A'}</p>
  730. </div>
  731. <div class="col-6">
  732. <p><strong>Complaint Date:</strong> ${data.complaintdate}</p>
  733. </div>
  734. </div>
  735. <div class="row">
  736. <div class="col-6">
  737. <p><strong>Complainant's Name:</strong> ${data.complainantName || 'N/A'}</p>
  738. </div>
  739. <div class="col-6">
  740. <p><strong>Phone Number:</strong> ${data.mobileNumber || 'N/A'}</p>
  741. </div>
  742. </div>
  743. <div class="row">
  744. <div class="col-6">
  745. <p><strong>Zone:</strong> ${data.Zone || 'N/A'}</p>
  746. </div>
  747. <div class="col-6">
  748. <p><strong>Division:</strong> ${data.Division || 'N/A'}</p>
  749. </div>
  750. </div>
  751. <div class="row">
  752. <div class="col-6">
  753. <p><strong>Gender:</strong> ${data.gender || 'N/A'}</p>
  754. </div>
  755. <div class="col-6">
  756. <p><strong>Complainant's Address:</strong> ${data.Street || 'N/A'}, ${data.Area || 'N/A'}, ${data.Landmark || 'N/A'}, ${data.Location || 'N/A'}</p>
  757. </div>
  758. </div>
  759. </div>
  760. </div>
  761. <hr>
  762. <h4>Complaint Details:</h4>
  763. <div class="row">
  764. <div class="col-6">
  765. <p><strong>Complaint Dept:</strong> ${data.deptname || 'N/A'}</p>
  766. </div>
  767. <div class="col-6">
  768. <p><strong>Complaint Mode:</strong> ${data.compmode || 'N/A'}</p>
  769. </div>
  770. </div>
  771. <div class="row">
  772. <div class="col-6">
  773. <p><strong>Complaint Type:</strong> ${data.complaintType || 'N/A'}</p>
  774. </div>
  775. <div class="col-6">
  776. <p><strong>Details of Complaint:</strong> ${data.description || 'N/A'}</p>
  777. </div>
  778. </div>
  779. <div class="row">
  780. <div class="col-6">
  781. <p><strong>Current Status:</strong> ${data.currentStatus || 'N/A'}</p>
  782. </div>
  783. <div class="col-6">
  784. <p><strong style="color:blue;">Official Mobile:</strong> ${data.OfficialMobile || 'N/A'}</p>
  785. </div>
  786. </div>
  787. <div class="row">
  788. <div class="col-6">
  789. <p><strong>Last Updated Date:</strong> ${data.greatestDate || 'N/A'}</p>
  790. </div>
  791. </div>
  792. <hr>
  793. <h4>Complaint Messages:</h4>
  794. ${messagesHtml}
  795. <hr>
  796. <h4>Agent Replied Messages:</h4>
  797. ${agentRepliedHtml}
  798. <hr>
  799. ${imageLink}
  800. `;
  801. return detailsHtml;
  802. }
  803. //whatsapp message function for REOPENED
  804. function sendWhatsAppMessageReopened(name,complaintNumber,cellnumber,complaintTypeName) {
  805. //console.log('whatsapp CustomerMobile:', cellnumber);
  806. //console.log('name:',name);
  807. //console.log('id:',complaintNumber);
  808. //console.log('complainttype',complaintTypeName)
  809. let viewstatus = "pgr" ;
  810. // Send the WhatsApp message pending
  811. let msgUrl = `https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to=${encodeURIComponent(cellnumber)}&v=1.1&format=json&msg_type=IMAGE&method=SENDMEDIAMESSAGE&caption=Dear+Mr%2FMs+${encodeURIComponent(name)}%2C%0A%0AYour+complaint+regarding+${encodeURIComponent(complaintTypeName)}+with+complaint+number+%2A${encodeURIComponent(complaintNumber)}%2A+has+been+reopened+based+on+your+feedback.%0AThe+relevant+department+is+working+to+resolve+the+issue%2C+and+updates+will+be+provided+on+the+progress.%0A%0AClick+the+button+below+to+view+your+complaint+status%F0%9F%91%87&media_url=https%3A%2F%2Ferp.chennaicorporation.gov.in%2Fpgr%2Fimages%2Fpgr_whatsapp_banner.jpg&isTemplate=true&footer=-Greater+Chennai+Corporation&buttonUrlParam=${encodeURIComponent(viewstatus)}`
  812. let tamilmsgUrl = `https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to=${encodeURIComponent(cellnumber)}&v=1.1&format=json&msg_type=IMAGE&method=SENDMEDIAMESSAGE&caption=%E0%AE%85%E0%AE%A9%E0%AF%8D%E0%AE%AA%E0%AE%BE%E0%AE%B0%E0%AF%8D%E0%AE%A8%E0%AF%8D%E0%AE%A4+%E0%AE%A4%E0%AE%BF%E0%AE%B0%E0%AF%81%2F%E0%AE%A4%E0%AE%BF%E0%AE%B0%E0%AF%81%E0%AE%AE%E0%AE%A4%E0%AE%BF+${encodeURIComponent(name)}%2C%0A%0A%E0%AE%89%E0%AE%99%E0%AF%8D%E0%AE%95%E0%AE%B3%E0%AF%8D+%2A${encodeURIComponent(compl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%E0%AE%B4%E0%AF%87+%E0%AE%89%E0%AE%B3%E0%AF%8D%E0%AE%B3+%E0%AE%AA%E0%AF%8A%E0%AE%A4%E0%AF%8D%E0%AE%A4%E0%AE%BE%E0%AE%A9%E0%AF%88%E0%AE%95%E0%AF%8D+%E0%AE%95%E0%AE%BF%E0%AE%B3%E0%AE%BF%E0%AE%95%E0%AF%8D+%E0%AE%9A%E0%AF%86%E0%AE%AF%E0%AF%8D%E0%AE%AF%E0%AE%B5%E0%AF%81%E0%AE%AE%E0%AF%8D%F0%9F%91%87&media_url=https%3A%2F%2Ferp.chennaicorporation.gov.in%2Fpgr%2Fimages%2Fpgr_whatsapp_banner.jpg&isTemplate=true&footer=-%E0%AE%AA%E0%AF%86%E0%AE%B0%E0%AF%81%E0%AE%A8%E0%AE%95%E0%AE%B0+%E0%AE%9A%E0%AF%86%E0%AE%A9%E0%AF%8D%E0%AE%A9%E0%AF%88+%E0%AE%AE%E0%AE%BE%E0%AE%A8%E0%AE%95%E0%AE%B0%E0%AE%BE%E0%AE%9F%E0%AF%8D%E0%AE%9A%E0%AE%BF.&buttonUrlParam=${encodeURIComponent(viewstatus)}`
  813. $.ajax({
  814. url: '/gcc/qaqc/api/whatsapp/send-whatsapp-message', // Replace with your service path
  815. type: 'POST',
  816. data: { msgUrl: msgUrl,
  817. tamilmsgUrl: tamilmsgUrl},
  818. success: function(response) {
  819. //console.log('WhatsApp message sent successfully', response);
  820. console.log('success');
  821. //alert('WhatsApp message sent!');
  822. },
  823. error: function(xhr, status, error) {
  824. console.error('Error sending WhatsApp message:', error);
  825. //alert('Failed to send WhatsApp message.');
  826. Swal.fire({
  827. title: 'Error!',
  828. text: 'Message Not sent!',
  829. icon: 'error',
  830. timer: 2000,
  831. showConfirmButton: false
  832. })
  833. }
  834. });
  835. }
  836. //whatsapp message function for unattended
  837. function sendWhatsAppMessageUnattended(name,complaintNumber,cellnumber,complaintTypeName) {
  838. console.log('whatsapp CustomerMobile:', cellnumber);
  839. console.log('name:',name);
  840. console.log('complaintNumber:',complaintNumber);
  841. console.log('complainttype',complaintTypeName)
  842. let viewstatus = "pgr" ;
  843. // Send the WhatsApp message pending
  844. let msgUrl = `https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to=${encodeURIComponent(cellnumber)}&v=1.1&format=json&msg_type=IMAGE&method=SENDMEDIAMESSAGE&caption=Dear+Mr%2FMs+${encodeURIComponent(name)}%2C%0A%0AAttempts+were+made+to+reach+you+by+phone+regarding+your+complaint+on+${encodeURIComponent(complaintTypeName)}+%28Complaint+ID%3A+%2A${encodeURIComponent(complaintNumber)}%2A%29+from+GCC%E2%80%99s+1913+helpline.+The+issue+has+been+addressed.+%0A%0AIf+you+are+satisfied+with+the+resolution%2C+please+reply+%2A%E2%80%98YES.%E2%80%99%2A+Otherwise%2C+reply+%2A%E2%80%98NO%2C%E2%80%99%2A+and+the+complaint+will+be+reopened.%0A%0AClick+the+button+below+to+view+your+complaint+status%F0%9F%91%87&media_url=https%3A%2F%2Ferp.chennaicorporation.gov.in%2Fpgr%2Fimages%2Fpgr_whatsapp_banner.jpg&isTemplate=true&footer=-Greater+Chennai+Corporation&buttonUrlParam=${encodeURIComponent(viewstatus)}`
  845. let tamilmsgUrl = `https://media.smsgupshup.com/GatewayAPI/rest?userid=2000233507&password=h2YjFNcJ&send_to=${encodeURIComponent(cellnumber)}&v=1.1&format=json&msg_type=IMAGE&method=SENDMEDIAMESSAGE&caption=%E0%AE%85%E0%AE%A9%E0%AF%8D%E0%AE%AA%E0%AE%BE%E0%AE%B0%E0%AF%8D%E0%AE%A8%E0%AF%8D%E0%AE%A4+%E0%AE%A4%E0%AE%BF%E0%AE%B0%E0%AF%81%2F%E0%AE%A4%E0%AE%BF%E0%AE%B0%E0%AF%81%E0%AE%AE%E0%AE%A4%E0%AE%BF+${encodeURIComponent(name)}%2C%0A%0A%E0%AE%89%E0%AE%99%E0%AF%8D%E0%AE%95%E0%AE%B3%E0%AF%8D+%E0%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3A%2F%2Ferp.chennaicorporation.gov.in%2Fpgr%2Fimages%2Fpgr_whatsapp_banner.jpg&isTemplate=true&footer=-%E0%AE%AA%E0%AF%86%E0%AE%B0%E0%AF%81%E0%AE%A8%E0%AE%95%E0%AE%B0+%E0%AE%9A%E0%AF%86%E0%AE%A9%E0%AF%8D%E0%AE%A9%E0%AF%88+%E0%AE%AE%E0%AE%BE%E0%AE%A8%E0%AE%95%E0%AE%B0%E0%AE%BE%E0%AE%9F%E0%AF%8D%E0%AE%9A%E0%AE%BF.&buttonUrlParam=${encodeURIComponent(viewstatus)}`
  846. $.ajax({
  847. url: '/gcc/qaqc/api/whatsapp/send-whatsapp-message', // Replace with your service path
  848. type: 'POST',
  849. data: { msgUrl: msgUrl,
  850. tamilmsgUrl: tamilmsgUrl},
  851. success: function(response) {
  852. console.log('WhatsApp message sent successfully', response);
  853. console.log('success');
  854. //alert('WhatsApp message sent!');
  855. },
  856. error: function(xhr, status, error) {
  857. console.error('Error sending WhatsApp message:', error);
  858. //alert('Failed to send WhatsApp message.');
  859. Swal.fire({
  860. title: 'Error!',
  861. text: 'Message Not sent!',
  862. icon: 'error',
  863. timer: 2000,
  864. showConfirmButton: false
  865. })
  866. }
  867. });
  868. }
  869. </script>
  870. <script>
  871. //Swal.fire("Success", "Complaint updated successfully!", "success");
  872. // Remove the row from the table dynamically
  873. /* const table = $('#QaqcDatatable').DataTable();
  874. table.row($(row)).remove().draw(false);
  875. location.reload(); */
  876. </script>
  877. </body>
  878. </html>