CHANAGE_CLAIMS_MODULE_SRI
This commit is contained in:
parent
3bdf3f6bb5
commit
bfe5c2be2d
@ -114,8 +114,7 @@ class TicketController extends BaseController
|
|||||||
'((AUTO_QUERY_CONTENT))' => 'auto_query_content',
|
'((AUTO_QUERY_CONTENT))' => 'auto_query_content',
|
||||||
];
|
];
|
||||||
$this->extraFields = [
|
$this->extraFields = [
|
||||||
1 => ['non_id_reason'],
|
|
||||||
10 => ['pay_initiate_date'],
|
|
||||||
3 => ['raised_date'],
|
3 => ['raised_date'],
|
||||||
4 => ['raised_date'],
|
4 => ['raised_date'],
|
||||||
5 => ['claim_number', 'registration_date'],
|
5 => ['claim_number', 'registration_date'],
|
||||||
|
|||||||
@ -235,9 +235,44 @@ function showConfirmationModal(event) {
|
|||||||
console.log($('#ticket_form_data')[0])
|
console.log($('#ticket_form_data')[0])
|
||||||
submitClaimForm(event, $('#ticket_form_data')[0]); // Fixed selector
|
submitClaimForm(event, $('#ticket_form_data')[0]); // Fixed selector
|
||||||
} else if (result.isDenied) {
|
} else if (result.isDenied) {
|
||||||
$('#is_head_approved').val(2);
|
// Show second Swal for rejection reason
|
||||||
console.log($('#ticket_form_data')[0])
|
Swal.fire({
|
||||||
submitClaimForm(event, $('#ticket_form_data')[0]); // Fixed selector
|
title: "Rejection Reason",
|
||||||
|
text: "Please provide a reason for rejection",
|
||||||
|
input: "textarea",
|
||||||
|
inputPlaceholder: "Enter your reason here...",
|
||||||
|
icon: "info",
|
||||||
|
showCancelButton: true,
|
||||||
|
confirmButtonColor: "#3085d6",
|
||||||
|
cancelButtonColor: "#6c757d",
|
||||||
|
confirmButtonText: "Submit",
|
||||||
|
cancelButtonText: "Back"
|
||||||
|
}).then((reasonResult) => {
|
||||||
|
if (reasonResult.isConfirmed) {
|
||||||
|
// Check if reason is not empty
|
||||||
|
if (reasonResult.value && reasonResult.value.trim() !== "") {
|
||||||
|
$('#is_head_approved').val(2);
|
||||||
|
$('#rejection_reason').val(reasonResult.value.trim());
|
||||||
|
console.log($('#ticket_form_data')[0]);
|
||||||
|
$('#head_rejection_reason').val(reasonResult.value.trim());
|
||||||
|
submitClaimForm(event, $('#ticket_form_data')[0]);
|
||||||
|
} else {
|
||||||
|
// Alert if reason is empty
|
||||||
|
Swal.fire({
|
||||||
|
title: "Error",
|
||||||
|
text: "Rejection reason cannot be empty",
|
||||||
|
icon: "error",
|
||||||
|
confirmButtonColor: "#3085d6"
|
||||||
|
}).then(() => {
|
||||||
|
// Go back to the rejection reason dialog
|
||||||
|
showConfirmationModal(event);
|
||||||
|
});
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
// If canceled, go back to first Swal
|
||||||
|
showConfirmationModal(event);
|
||||||
|
}
|
||||||
|
});
|
||||||
} else {
|
} else {
|
||||||
$('#is_head_approved').val(0);
|
$('#is_head_approved').val(0);
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@ -2,18 +2,18 @@
|
|||||||
<div class="col-12">
|
<div class="col-12">
|
||||||
<div class="<?= !isset($ticket_data) ? "card" : "" ?>" style="margin-right: 23px;">
|
<div class="<?= !isset($ticket_data) ? "card" : "" ?>" style="margin-right: 23px;">
|
||||||
<div class="card-body">
|
<div class="card-body">
|
||||||
<?php if(!isset($ticket_data)){ ?>
|
<?php if (!isset($ticket_data)) { ?>
|
||||||
<!-- Header Section -->
|
<!-- Header Section -->
|
||||||
<div class="row mb-3">
|
<div class="row mb-3">
|
||||||
<div class="col-6 d-flex align-items-center">
|
<div class="col-6 d-flex align-items-center">
|
||||||
<h4 class="mb-0">Claim GMC</h4>
|
<h4 class="mb-0">Claim GMC</h4>
|
||||||
|
</div>
|
||||||
|
<div class="col-6 text-right">
|
||||||
|
<a href="<?= base_url('ticket/list'); ?>" aria-label="Back to ticket list">
|
||||||
|
<i class="fas fa-arrow-left" style="font-size: 17px;"></i>
|
||||||
|
</a>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="col-6 text-right">
|
|
||||||
<a href="<?= base_url('ticket/list'); ?>" aria-label="Back to ticket list">
|
|
||||||
<i class="fas fa-arrow-left" style="font-size: 17px;"></i>
|
|
||||||
</a>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<form role="form" class="parsley-examples" method="post" id="ticket_form_data" onsubmit="submitClaimForm(event, this)" enctype="multipart/form-data">
|
<form role="form" class="parsley-examples" method="post" id="ticket_form_data" onsubmit="submitClaimForm(event, this)" enctype="multipart/form-data">
|
||||||
|
|
||||||
@ -21,6 +21,7 @@
|
|||||||
<input type="hidden" id="ticket_master_id" name="ticket_master_id" value="<?= isset($ticket_data['id']) ? $ticket_data['id'] : '' ?>">
|
<input type="hidden" id="ticket_master_id" name="ticket_master_id" value="<?= isset($ticket_data['id']) ? $ticket_data['id'] : '' ?>">
|
||||||
<input type="hidden" id="is_head_approved" name="is_head_approved" value="<?= isset($ticket_data['is_head_approved']) ? $ticket_data['is_head_approved'] : '' ?>">
|
<input type="hidden" id="is_head_approved" name="is_head_approved" value="<?= isset($ticket_data['is_head_approved']) ? $ticket_data['is_head_approved'] : '' ?>">
|
||||||
<input type="hidden" id="extra_fields_array_for_validate" name="extra_fields_array_for_validate" value='<?= isset($extra_fields_array_for_validate) && !empty($extra_fields_array_for_validate) ? json_encode($extra_fields_array_for_validate) : "[]" ?>'>
|
<input type="hidden" id="extra_fields_array_for_validate" name="extra_fields_array_for_validate" value='<?= isset($extra_fields_array_for_validate) && !empty($extra_fields_array_for_validate) ? json_encode($extra_fields_array_for_validate) : "[]" ?>'>
|
||||||
|
<input type="hidden" id="head_rejection_reason" name="head_rejection_reason">
|
||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<div class="form-row">
|
<div class="form-row">
|
||||||
@ -30,12 +31,12 @@
|
|||||||
<select class="form-control" id="claim_status_id" name="claim_status_id">
|
<select class="form-control" id="claim_status_id" name="claim_status_id">
|
||||||
<!-- <option value="0">Select status</option> -->
|
<!-- <option value="0">Select status</option> -->
|
||||||
<?php
|
<?php
|
||||||
if (isset($claim_status) && count($claim_status)) {
|
if (isset($claim_status) && count($claim_status)) {
|
||||||
foreach ($claim_status as $key => $value) {
|
foreach ($claim_status as $key => $value) {
|
||||||
$selected = (isset($ticket_data) && $ticket_data['claim_status_id'] == $value['id']) ? 'selected' : '';
|
$selected = (isset($ticket_data) && $ticket_data['claim_status_id'] == $value['id']) ? 'selected' : '';
|
||||||
echo "<option value=" . $value['id'] . " $selected>" . $value['claim_status'] . "</option>";
|
echo "<option value=" . $value['id'] . " $selected>" . $value['claim_status'] . "</option>";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -45,12 +46,12 @@
|
|||||||
<select class="form-control" id="priority" name="priority">
|
<select class="form-control" id="priority" name="priority">
|
||||||
<!-- <option value="0">Select Priority</option> -->
|
<!-- <option value="0">Select Priority</option> -->
|
||||||
<?php
|
<?php
|
||||||
if (isset($priorityType) && count($priorityType)) {
|
if (isset($priorityType) && count($priorityType)) {
|
||||||
foreach ($priorityType as $key => $value) {
|
foreach ($priorityType as $key => $value) {
|
||||||
$selected = (isset($ticket_data) && $ticket_data['priority'] == $key) ? 'selected' : '';
|
$selected = (isset($ticket_data) && $ticket_data['priority'] == $key) ? 'selected' : '';
|
||||||
echo "<option value=" . $key . " $selected>" . $value . "</option>";
|
echo "<option value=" . $key . " $selected>" . $value . "</option>";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -60,12 +61,12 @@
|
|||||||
<select class="form-control" id="acm_id" name="acm_id">
|
<select class="form-control" id="acm_id" name="acm_id">
|
||||||
<!-- <option value="0">Select Account Manager</option> -->
|
<!-- <option value="0">Select Account Manager</option> -->
|
||||||
<?php
|
<?php
|
||||||
if (isset($acms) && count($acms)) {
|
if (isset($acms) && count($acms)) {
|
||||||
foreach ($acms as $key => $value) {
|
foreach ($acms as $key => $value) {
|
||||||
$selected = (isset($ticket_data) && $ticket_data['acm_id'] == $value['id']) ? 'selected' : '';
|
$selected = (isset($ticket_data) && $ticket_data['acm_id'] == $value['id']) ? 'selected' : '';
|
||||||
echo "<option value=" . $value['id'] . " $selected >" . $value['first_name'] . "</option>";
|
echo "<option value=" . $value['id'] . " $selected >" . $value['first_name'] . "</option>";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -74,7 +75,7 @@
|
|||||||
<label for="policy_no">Policy No<span class="text-danger"></span></label>
|
<label for="policy_no">Policy No<span class="text-danger"></span></label>
|
||||||
<input type="text" class="form-control" id="policy_no"
|
<input type="text" class="form-control" id="policy_no"
|
||||||
value="<?= isset($ticket_data['policy_no']) ? $ticket_data['policy_no'] : '' ?>"
|
value="<?= isset($ticket_data['policy_no']) ? $ticket_data['policy_no'] : '' ?>"
|
||||||
name="policy_no" placeholder="Policy Number" >
|
name="policy_no" placeholder="Policy Number">
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
@ -130,12 +131,12 @@
|
|||||||
<select class="form-control" id="relationship" name="relationship">
|
<select class="form-control" id="relationship" name="relationship">
|
||||||
<option value="0">Select Relationship</option>
|
<option value="0">Select Relationship</option>
|
||||||
<?php
|
<?php
|
||||||
if (isset($relationshipType) && count($relationshipType)) {
|
if (isset($relationshipType) && count($relationshipType)) {
|
||||||
foreach ($relationshipType as $key => $value) {
|
foreach ($relationshipType as $key => $value) {
|
||||||
$selected = (isset($ticket_data) && $ticket_data['relationship'] == $key) ? 'selected' : '';
|
$selected = (isset($ticket_data) && $ticket_data['relationship'] == $key) ? 'selected' : '';
|
||||||
echo "<option value='$key' $selected>$value</option>";
|
echo "<option value='$key' $selected>$value</option>";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -160,12 +161,12 @@
|
|||||||
<select class="form-control" id="mode_of_intimation" name="mode_of_intimation">
|
<select class="form-control" id="mode_of_intimation" name="mode_of_intimation">
|
||||||
<!-- <option value="0">Select Mode</option> -->
|
<!-- <option value="0">Select Mode</option> -->
|
||||||
<?php
|
<?php
|
||||||
if (isset($modeOFIntimate) && count($modeOFIntimate)) {
|
if (isset($modeOFIntimate) && count($modeOFIntimate)) {
|
||||||
foreach ($modeOFIntimate as $key => $value) {
|
foreach ($modeOFIntimate as $key => $value) {
|
||||||
$selected = (isset($ticket_data) && $ticket_data['mode_of_intimation'] == $key) ? 'selected' : '';
|
$selected = (isset($ticket_data) && $ticket_data['mode_of_intimation'] == $key) ? 'selected' : '';
|
||||||
echo "<option value='" . $key . "' $selected>" . $value . "</option>";
|
echo "<option value='" . $key . "' $selected>" . $value . "</option>";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -175,12 +176,12 @@
|
|||||||
<select class="form-control" id="claim_type" name="claim_type">
|
<select class="form-control" id="claim_type" name="claim_type">
|
||||||
<!-- <option value="0">Select claim Type</option> -->
|
<!-- <option value="0">Select claim Type</option> -->
|
||||||
<?php
|
<?php
|
||||||
if (isset($claim_type) && count($claim_type)) {
|
if (isset($claim_type) && count($claim_type)) {
|
||||||
foreach ($claim_type as $key => $value) {
|
foreach ($claim_type as $key => $value) {
|
||||||
$selected = (isset($ticket_data) && $ticket_data['claim_type'] == $key) ? 'selected' : '';
|
$selected = (isset($ticket_data) && $ticket_data['claim_type'] == $key) ? 'selected' : '';
|
||||||
echo "<option value='" . $key . "' $selected>" . $value . "</option>";
|
echo "<option value='" . $key . "' $selected>" . $value . "</option>";
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
?>
|
?>
|
||||||
</select>
|
</select>
|
||||||
</div>
|
</div>
|
||||||
@ -215,7 +216,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="form-group col-md-3">
|
<div class="form-group col-md-3">
|
||||||
<label for="pod_no">POD No<span class="text-danger"></span></label>
|
<label id="pod_no_label_1" for="pod_no">POD No<span id="pod_no_label_1_span" class="text-danger"></span></label>
|
||||||
<input type="text" class="form-control" id="pod_no" placeholder="Enter POD NO"
|
<input type="text" class="form-control" id="pod_no" placeholder="Enter POD NO"
|
||||||
value="<?= isset($ticket_data['pod_no']) ? $ticket_data['pod_no'] : '' ?>"
|
value="<?= isset($ticket_data['pod_no']) ? $ticket_data['pod_no'] : '' ?>"
|
||||||
name="pod_no">
|
name="pod_no">
|
||||||
@ -320,12 +321,12 @@
|
|||||||
<label for="non_id_reason">Non ID Reason</label>
|
<label for="non_id_reason">Non ID Reason</label>
|
||||||
<textarea class="form-control" id="non_id_reason" placeholder="Enter Cancel Remark" name="non_id_reason"><?= isset($ticket_data['non_id_reason']) ? $ticket_data['non_id_reason'] : '' ?></textarea>
|
<textarea class="form-control" id="non_id_reason" placeholder="Enter Cancel Remark" name="non_id_reason"><?= isset($ticket_data['non_id_reason']) ? $ticket_data['non_id_reason'] : '' ?></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="form-group col-md-12 text-right m-b-0" style="margin-top: 29px;">
|
<div class="form-group col-md-12 text-right m-b-0" style="margin-top: 29px;">
|
||||||
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnSubmit" >Submit</button>
|
<button type="submit" class="btn btn-primary waves-effect waves-light mr-1" id="btnSubmit">Submit</button>
|
||||||
<?php if(get_role_id() == 5 && isset($ticket_data) && $ticket_data['claim_status_id'] == 8) { ?>
|
<?php if (get_role_id() == 5 && isset($ticket_data) && $ticket_data['claim_status_id'] == 8) { ?>
|
||||||
<a class="btn btn-secondary waves-effect waves-light mr-1" onclick="showConfirmationModal(event)">Approve Claim Rejection</a>
|
<a class="btn btn-secondary waves-effect waves-light mr-1" onclick="showConfirmationModal(event)">Approve Claim Rejection</a>
|
||||||
<?php } ?>
|
<?php } ?>
|
||||||
<!-- <button type="button" class="btn btn-primary waves-effect waves-light mr-1" id="btnApprove" >Approve</button> -->
|
<!-- <button type="button" class="btn btn-primary waves-effect waves-light mr-1" id="btnApprove" >Approve</button> -->
|
||||||
@ -347,206 +348,299 @@
|
|||||||
|
|
||||||
// }
|
// }
|
||||||
// });
|
// });
|
||||||
|
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script>
|
<script>
|
||||||
|
let GlobelExtraFields = [];
|
||||||
|
|
||||||
let GlobelExtraFields = [];
|
$(document).ready(function() {
|
||||||
|
|
||||||
$(document).ready(function() {
|
var doa = flatpickr("#doa", {
|
||||||
|
dateFormat: "d/m/Y",
|
||||||
|
allowInput: false
|
||||||
|
});
|
||||||
|
|
||||||
var doa = flatpickr("#doa", {
|
var dod = flatpickr("#dod", {
|
||||||
dateFormat: "d/m/Y",
|
dateFormat: "d/m/Y",
|
||||||
allowInput: false
|
allowInput: false
|
||||||
});
|
});
|
||||||
|
|
||||||
var dod = flatpickr("#dod", {
|
flatpickr("#raised_date", {
|
||||||
dateFormat: "d/m/Y",
|
dateFormat: "d/m/Y",
|
||||||
allowInput: false
|
allowInput: false
|
||||||
});
|
});
|
||||||
|
flatpickr("#registration_date", {
|
||||||
|
dateFormat: "d/m/Y",
|
||||||
|
allowInput: false
|
||||||
|
});
|
||||||
|
flatpickr("#query_received_date", {
|
||||||
|
dateFormat: "d/m/Y",
|
||||||
|
allowInput: false
|
||||||
|
});
|
||||||
|
flatpickr("#denial_date", {
|
||||||
|
dateFormat: "d/m/Y",
|
||||||
|
allowInput: false
|
||||||
|
});
|
||||||
|
flatpickr("#approved_date", {
|
||||||
|
dateFormat: "d/m/Y",
|
||||||
|
allowInput: false
|
||||||
|
});
|
||||||
|
flatpickr("#settled_date", {
|
||||||
|
dateFormat: "d/m/Y",
|
||||||
|
allowInput: false
|
||||||
|
});
|
||||||
|
flatpickr("#pay_initiate_date", {
|
||||||
|
dateFormat: "d/m/Y",
|
||||||
|
allowInput: false
|
||||||
|
});
|
||||||
|
|
||||||
flatpickr("#raised_date", { dateFormat: "d/m/Y", allowInput: false });
|
// updateClaimStatusDisplay("<?= isset($ticket_data['claim_status_id']) ? $ticket_data['claim_status_id'] : 0 ?>")
|
||||||
flatpickr("#registration_date", { dateFormat: "d/m/Y", allowInput: false });
|
var extraFields = <?= json_encode(isset($extra_fields) ? $extra_fields : []); ?>;
|
||||||
flatpickr("#query_received_date", { dateFormat: "d/m/Y", allowInput: false });
|
GlobelExtraFields = extraFields;
|
||||||
flatpickr("#denial_date", { dateFormat: "d/m/Y", allowInput: false });
|
console.log("extraFields", extraFields);
|
||||||
flatpickr("#approved_date", { dateFormat: "d/m/Y", allowInput: false });
|
claimStatusFieldChanges(extraFields);
|
||||||
flatpickr("#settled_date", { dateFormat: "d/m/Y", allowInput: false });
|
|
||||||
flatpickr("#pay_initiate_date", { dateFormat: "d/m/Y", allowInput: false });
|
|
||||||
|
|
||||||
// updateClaimStatusDisplay("<?= isset($ticket_data['claim_status_id']) ? $ticket_data['claim_status_id'] : 0 ?>")
|
})
|
||||||
var extraFields = <?= json_encode(isset($extra_fields) ? $extra_fields : []); ?>;
|
|
||||||
GlobelExtraFields = extraFields;
|
|
||||||
console.log("extraFields", extraFields);
|
|
||||||
claimStatusFieldChanges(extraFields);
|
|
||||||
|
|
||||||
})
|
// function updateClaimStatusDisplay(value) {
|
||||||
|
// // Hide all sections first
|
||||||
|
// $('.cda_ir, .settled, .approved, .rejected, .up_qdr, .up_cnu, .canceled, .returned').hide();
|
||||||
|
// $('.cda_ir, .settled, .approved, .rejected, .up_qdr, .up_cnu, .canceled, .returned').hide().find('input, textarea').removeAttr('required');
|
||||||
|
|
||||||
// function updateClaimStatusDisplay(value) {
|
// // Show relevant section based on value
|
||||||
// // Hide all sections first
|
// if (value == 3 || value == 4) { // CDA & INFORMATION REQUIRED
|
||||||
// $('.cda_ir, .settled, .approved, .rejected, .up_qdr, .up_cnu, .canceled, .returned').hide();
|
// $('.cda_ir').show();
|
||||||
// $('.cda_ir, .settled, .approved, .rejected, .up_qdr, .up_cnu, .canceled, .returned').hide().find('input, textarea').removeAttr('required');
|
// $('.settled, .approved, .rejected, .up_qdr, .up_cnu, .canceled, .returned').find('input, textarea').removeAttr('required');
|
||||||
|
// } else if (value == 5) { // UNDER PROCESS - CLAIM NO. UPDATION
|
||||||
|
// $('.up_cnu').show();
|
||||||
|
// $('.cda_ir, .settled, .approved, .rejected, .up_qdr, .canceled, .returned').find('input, textarea').removeAttr('required');
|
||||||
|
// } else if (value == 7) { // UNDER PROCESS - QUERY DOCUMENT RECEIVED
|
||||||
|
// $('.up_qdr').show();
|
||||||
|
// $('.cda_ir, .settled, .approved, .rejected, .up_cnu, .canceled, .returned').find('input, textarea').removeAttr('required');
|
||||||
|
// } else if (value == 8) { // REJECTED
|
||||||
|
// $('.rejected').show();
|
||||||
|
// $('.cda_ir, .settled, .approved, .up_qdr, .up_cnu, .canceled, .returned').find('input, textarea').removeAttr('required');
|
||||||
|
// } else if (value == 9) { // APPROVED
|
||||||
|
// $('.approved').show();
|
||||||
|
// $('.cda_ir, .settled, .rejected, .up_qdr, .up_cnu, .canceled, .returned').find('input, textarea').removeAttr('required');
|
||||||
|
// } else if (value == 11) { // SETTLED
|
||||||
|
// $('.settled').show();
|
||||||
|
// $('.cda_ir, .approved, .rejected, .up_qdr, .up_cnu, .canceled, .returned').find('input, textarea').removeAttr('required');
|
||||||
|
// }else if (value == 13) { // CANCELLED
|
||||||
|
// $('.canceled').show();
|
||||||
|
// $('.cda_ir, .settled, .approved, .rejected, .up_qdr, .up_cnu, .returned').find('input, textarea').removeAttr('required');
|
||||||
|
// }else if (value == 14) { // RETURNED
|
||||||
|
// $('.returned').show();
|
||||||
|
// $('.cda_ir, .settled, .approved, .rejected, .up_qdr, .up_cnu, .canceled').find('input, textarea').removeAttr('required');
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
// // Show relevant section based on value
|
function updateClaimStatusDisplay(value) {
|
||||||
// if (value == 3 || value == 4) { // CDA & INFORMATION REQUIRED
|
|
||||||
// $('.cda_ir').show();
|
|
||||||
// $('.settled, .approved, .rejected, .up_qdr, .up_cnu, .canceled, .returned').find('input, textarea').removeAttr('required');
|
|
||||||
// } else if (value == 5) { // UNDER PROCESS - CLAIM NO. UPDATION
|
|
||||||
// $('.up_cnu').show();
|
|
||||||
// $('.cda_ir, .settled, .approved, .rejected, .up_qdr, .canceled, .returned').find('input, textarea').removeAttr('required');
|
|
||||||
// } else if (value == 7) { // UNDER PROCESS - QUERY DOCUMENT RECEIVED
|
|
||||||
// $('.up_qdr').show();
|
|
||||||
// $('.cda_ir, .settled, .approved, .rejected, .up_cnu, .canceled, .returned').find('input, textarea').removeAttr('required');
|
|
||||||
// } else if (value == 8) { // REJECTED
|
|
||||||
// $('.rejected').show();
|
|
||||||
// $('.cda_ir, .settled, .approved, .up_qdr, .up_cnu, .canceled, .returned').find('input, textarea').removeAttr('required');
|
|
||||||
// } else if (value == 9) { // APPROVED
|
|
||||||
// $('.approved').show();
|
|
||||||
// $('.cda_ir, .settled, .rejected, .up_qdr, .up_cnu, .canceled, .returned').find('input, textarea').removeAttr('required');
|
|
||||||
// } else if (value == 11) { // SETTLED
|
|
||||||
// $('.settled').show();
|
|
||||||
// $('.cda_ir, .approved, .rejected, .up_qdr, .up_cnu, .canceled, .returned').find('input, textarea').removeAttr('required');
|
|
||||||
// }else if (value == 13) { // CANCELLED
|
|
||||||
// $('.canceled').show();
|
|
||||||
// $('.cda_ir, .settled, .approved, .rejected, .up_qdr, .up_cnu, .returned').find('input, textarea').removeAttr('required');
|
|
||||||
// }else if (value == 14) { // RETURNED
|
|
||||||
// $('.returned').show();
|
|
||||||
// $('.cda_ir, .settled, .approved, .rejected, .up_qdr, .up_cnu, .canceled').find('input, textarea').removeAttr('required');
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
function updateClaimStatusDisplay(value) {
|
// Hide all sections and remove required attribute from their inputs and textareas
|
||||||
|
let sections = $('.cda_ir, .settled, .approved, .rejected, .up_qdr, .up_cnu, .canceled, .returned, .payment, .non_id');
|
||||||
|
sections.hide().find('input, textarea').removeAttr('required');
|
||||||
|
|
||||||
// Hide all sections and remove required attribute from their inputs and textareas
|
// Determine which section to show
|
||||||
let sections = $('.cda_ir, .settled, .approved, .rejected, .up_qdr, .up_cnu, .canceled, .returned, .payment, .non_id');
|
let showClass = '';
|
||||||
sections.hide().find('input, textarea').removeAttr('required');
|
if (value == 3 || value == 4) { // CDA & INFORMATION REQUIRED
|
||||||
|
showClass = '.cda_ir';
|
||||||
|
} else if (value == 5) { // UNDER PROCESS - CLAIM NO. UPDATION
|
||||||
|
showClass = '.up_cnu';
|
||||||
|
} else if (value == 7) { // UNDER PROCESS - QUERY DOCUMENT RECEIVED
|
||||||
|
showClass = '.up_qdr';
|
||||||
|
} else if (value == 8) { // REJECTED
|
||||||
|
showClass = '.rejected';
|
||||||
|
} else if (value == 9) { // APPROVED
|
||||||
|
showClass = '.approved';
|
||||||
|
} else if (value == 11) { // SETTLED
|
||||||
|
showClass = '.settled';
|
||||||
|
} else if (value == 13) { // CANCELLED
|
||||||
|
showClass = '.canceled';
|
||||||
|
} else if (value == 14) { // RETURNED
|
||||||
|
showClass = '.returned';
|
||||||
|
} else if (value == 1) { // NON ID
|
||||||
|
showClass = '.non_id';
|
||||||
|
} else if (value == 10) { // PAYMENT INITIATED
|
||||||
|
showClass = '.payment';
|
||||||
|
}
|
||||||
|
|
||||||
// Determine which section to show
|
// Show the relevant section and enable required attributes
|
||||||
let showClass = '';
|
if (showClass) {
|
||||||
if (value == 3 || value == 4) { // CDA & INFORMATION REQUIRED
|
// $(showClass).show().find('input, textarea').attr('required', true);
|
||||||
showClass = '.cda_ir';
|
$(showClass).show().find('input, textarea').attr('required', true).each(function() {
|
||||||
} else if (value == 5) { // UNDER PROCESS - CLAIM NO. UPDATION
|
var $label = $("label[for='" + $(this).attr('id') + "']");
|
||||||
showClass = '.up_cnu';
|
if ($label.length && !$label.find('.text-danger').length) {
|
||||||
} else if (value == 7) { // UNDER PROCESS - QUERY DOCUMENT RECEIVED
|
$label.append(' <span class="text-danger">*</span>');
|
||||||
showClass = '.up_qdr';
|
}
|
||||||
} else if (value == 8) { // REJECTED
|
});
|
||||||
showClass = '.rejected';
|
|
||||||
} else if (value == 9) { // APPROVED
|
}
|
||||||
showClass = '.approved';
|
|
||||||
} else if (value == 11) { // SETTLED
|
|
||||||
showClass = '.settled';
|
|
||||||
} else if (value == 13) { // CANCELLED
|
|
||||||
showClass = '.canceled';
|
|
||||||
} else if (value == 14) { // RETURNED
|
|
||||||
showClass = '.returned';
|
|
||||||
} else if (value == 1) { // NON ID
|
|
||||||
showClass = '.non_id';
|
|
||||||
} else if (value == 10) { // PAYMENT INITIATED
|
|
||||||
showClass = '.payment';
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Show the relevant section and enable required attributes
|
$('#claim_status_id').on('change', function() {
|
||||||
if (showClass) {
|
updateClaimStatusDisplay($(this).val());
|
||||||
// $(showClass).show().find('input, textarea').attr('required', true);
|
// claimStatusFieldChanges()
|
||||||
$(showClass).show().find('input, textarea').attr('required', true).each(function() {
|
});
|
||||||
var $label = $("label[for='" + $(this).attr('id') + "']");
|
|
||||||
|
function claimStatusFieldChanges(fields) {
|
||||||
|
|
||||||
|
fields.forEach(function(fieldId) {
|
||||||
|
var $field = $("#" + fieldId);
|
||||||
|
|
||||||
|
if ($field.length) {
|
||||||
|
// $field.prop('required', true);
|
||||||
|
|
||||||
|
var $parentDiv = $field.closest("div");
|
||||||
|
$parentDiv.show();
|
||||||
|
|
||||||
|
var $label = $parentDiv.find("label[for='" + fieldId + "']");
|
||||||
|
if ($label.length && !$label.find(".text-danger").length) {
|
||||||
|
// $label.append(' <span class="text-danger">*</span>');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
|
||||||
|
function claimStatusFieldRemoveREquired(fields, remove_or_add, thirdClass) {
|
||||||
|
|
||||||
|
console.log('--------------------------- claimStatusFieldRemoveREquired ---------------------------');
|
||||||
|
console.log('fields', fields);
|
||||||
|
console.log('remove_or_add', remove_or_add);
|
||||||
|
|
||||||
|
fields.forEach(function(fieldId) {
|
||||||
|
var $field = $("#" + fieldId);
|
||||||
|
|
||||||
|
if ($field.length) {
|
||||||
|
$field.prop('required', remove_or_add);
|
||||||
|
var $parentDiv = $field.closest("div");
|
||||||
|
console.log('parentDiv', $parentDiv);
|
||||||
|
var $label = $parentDiv.find("label[for='" + fieldId + "']");
|
||||||
|
// if(remove_or_add == false){
|
||||||
|
// $parentDiv.find("label[for='" + fieldId + "'] .text-danger").remove();
|
||||||
|
// // console.log('one', remove_or_add);
|
||||||
|
// }else{
|
||||||
|
// if ($label.length && !$label.find(".text-danger").length) {
|
||||||
|
// $label.append(' <span class="text-danger">*</span>');
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
$('.' + thirdClass).find('input, textarea').attr('required', true);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
$(document).on("input", function(event) {
|
||||||
|
|
||||||
|
let fields = GlobelExtraFields;
|
||||||
|
console.log('fields', fields);
|
||||||
|
let targetId = event.target.id;
|
||||||
|
console.log('targetId', targetId);
|
||||||
|
console.log('fields.includes(targetId)', fields.includes(targetId));
|
||||||
|
|
||||||
|
if (fields.includes(targetId)) {
|
||||||
|
|
||||||
|
let $field = $("#" + targetId);
|
||||||
|
console.log('$field id', $field);
|
||||||
|
let $parentDiv = $field.closest("div");
|
||||||
|
console.log('$parentDiv', $parentDiv);
|
||||||
|
|
||||||
|
if ($parentDiv.length) {
|
||||||
|
let thirdClass = $parentDiv.attr("class").split(" ")[2] || "";
|
||||||
|
console.log('thirdClass', thirdClass);
|
||||||
|
addRequiredFieldSymbolByClass(thirdClass);
|
||||||
|
// addRequiredFieldSymbol(targetId);
|
||||||
|
if (thirdClass) {
|
||||||
|
// console.log("fields",fields);
|
||||||
|
claimStatusFieldRemoveREquired(fields, false, thirdClass);
|
||||||
|
$(thirdClass).each(function() {
|
||||||
|
let $label = $(this).find("label");
|
||||||
|
$label.each(function() {
|
||||||
|
if (!$(this).find(".text-danger").length) {
|
||||||
|
$(this).append(' <span class="text-danger">*</span>');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
});
|
||||||
|
} else {
|
||||||
|
claimStatusFieldRemoveREquired($field, false, '');
|
||||||
|
console.log("In Else Condition");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
function addRequiredFieldSymbol(field_name) {
|
||||||
|
// Find the field with the given name
|
||||||
|
var $field = $(`[name="${field_name}"]`);
|
||||||
|
|
||||||
|
if ($field.length) {
|
||||||
|
// Find the parent div of this field
|
||||||
|
var $parentDiv = $field.closest('div');
|
||||||
|
|
||||||
|
if ($parentDiv.length) {
|
||||||
|
// Get the classes as an array
|
||||||
|
var classes = $parentDiv.attr('class') ? $parentDiv.attr('class').split(/\s+/) : [];
|
||||||
|
|
||||||
|
if (classes.length > 0) {
|
||||||
|
// Get the last class in the array
|
||||||
|
var lastClass = classes[classes.length - 1];
|
||||||
|
|
||||||
|
// Find all divs with this last class
|
||||||
|
var $allDivsWithClass = $(`.${lastClass}`);
|
||||||
|
|
||||||
|
// Add asterisk to all labels within these divs
|
||||||
|
$allDivsWithClass.each(function() {
|
||||||
|
var $label = $(this).find('label');
|
||||||
|
if ($label.length && !$label.find('.text-danger').length) {
|
||||||
|
$label.append(' <span class="text-danger">*</span>');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(`Added required symbol to ${$allDivsWithClass.length} labels with class "${lastClass}"`);
|
||||||
|
} else {
|
||||||
|
console.warn(`Parent div for field "${field_name}" has no classes`);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.warn(`No parent div found for field name="${field_name}"`);
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
console.warn(`No field found with name="${field_name}"`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
function addRequiredFieldSymbolByClass(className) {
|
||||||
|
// Find all divs with the specified class
|
||||||
|
var $divsWithClass = $(`.${className}`);
|
||||||
|
|
||||||
|
if ($divsWithClass.length) {
|
||||||
|
// Add asterisk to all labels within these divs
|
||||||
|
$divsWithClass.each(function() {
|
||||||
|
var $label = $(this).find('label');
|
||||||
if ($label.length && !$label.find('.text-danger').length) {
|
if ($label.length && !$label.find('.text-danger').length) {
|
||||||
$label.append(' <span class="text-danger">*</span>');
|
$label.append(' <span class="text-danger">*</span>');
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
console.log(`Added required symbol to ${$divsWithClass.length} labels with class "${className}"`);
|
||||||
|
} else {
|
||||||
|
console.warn(`No divs found with class="${className}"`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$('#claim_status_id').on('change', function() {
|
$('#mode_of_intimation').change(function(){
|
||||||
updateClaimStatusDisplay($(this).val());
|
console.log("function called");
|
||||||
// claimStatusFieldChanges()
|
var mode_of_intimation = $('#mode_of_intimation').val();
|
||||||
});
|
console.log('mode of ',mode_of_intimation);
|
||||||
|
|
||||||
|
if (mode_of_intimation == 2){
|
||||||
|
$('#pod_no').attr('required', 'required');
|
||||||
|
$('#pod_no_label_1_span').text("*");
|
||||||
|
}else{
|
||||||
|
$('#pod_no').removeAttr('required', false);
|
||||||
|
$('#pod_no_label_1_span').text("");
|
||||||
|
|
||||||
function claimStatusFieldChanges(fields) {
|
|
||||||
|
|
||||||
fields.forEach(function(fieldId) {
|
|
||||||
var $field = $("#" + fieldId);
|
|
||||||
|
|
||||||
if ($field.length) {
|
|
||||||
// $field.prop('required', true);
|
|
||||||
|
|
||||||
var $parentDiv = $field.closest("div");
|
|
||||||
$parentDiv.show();
|
|
||||||
|
|
||||||
var $label = $parentDiv.find("label[for='" + fieldId + "']");
|
|
||||||
if ($label.length && !$label.find(".text-danger").length) {
|
|
||||||
// $label.append(' <span class="text-danger">*</span>');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
function claimStatusFieldRemoveREquired(fields, remove_or_add, thirdClass) {
|
|
||||||
|
|
||||||
console.log('--------------------------- claimStatusFieldRemoveREquired ---------------------------');
|
|
||||||
console.log('fields', fields);
|
|
||||||
console.log('remove_or_add', remove_or_add);
|
|
||||||
|
|
||||||
fields.forEach(function(fieldId) {
|
|
||||||
var $field = $("#" + fieldId);
|
|
||||||
|
|
||||||
if ($field.length) {
|
|
||||||
$field.prop('required', remove_or_add);
|
|
||||||
var $parentDiv = $field.closest("div");
|
|
||||||
console.log('parentDiv', $parentDiv);
|
|
||||||
var $label = $parentDiv.find("label[for='" + fieldId + "']");
|
|
||||||
// if(remove_or_add == false){
|
|
||||||
// $parentDiv.find("label[for='" + fieldId + "'] .text-danger").remove();
|
|
||||||
// // console.log('one', remove_or_add);
|
|
||||||
// }else{
|
|
||||||
// if ($label.length && !$label.find(".text-danger").length) {
|
|
||||||
// $label.append(' <span class="text-danger">*</span>');
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
$('.'+thirdClass).find('input, textarea').attr('required', true);
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
$(document).on("input", function (event) {
|
|
||||||
|
|
||||||
let fields = GlobelExtraFields;
|
|
||||||
console.log('fields', fields);
|
|
||||||
let targetId = event.target.id;
|
|
||||||
console.log('targetId', targetId);
|
|
||||||
console.log('fields.includes(targetId)', fields.includes(targetId));
|
|
||||||
|
|
||||||
if (fields.includes(targetId)) {
|
|
||||||
|
|
||||||
let $field = $("#" + targetId);
|
|
||||||
console.log('$field id', $field);
|
|
||||||
let $parentDiv = $field.closest("div");
|
|
||||||
console.log('$parentDiv', $parentDiv);
|
|
||||||
|
|
||||||
if ($parentDiv.length) {
|
|
||||||
let thirdClass = $parentDiv.attr("class").split(" ")[2] || "";
|
|
||||||
console.log('thirdClass', thirdClass);
|
|
||||||
|
|
||||||
if (thirdClass) {
|
|
||||||
claimStatusFieldRemoveREquired(fields, false, thirdClass);
|
|
||||||
$(thirdClass).each(function() {
|
|
||||||
let $label = $(this).find("label");
|
|
||||||
$label.each(function() {
|
|
||||||
if (!$(this).find(".text-danger").length) {
|
|
||||||
$(this).append(' <span class="text-danger">*</span>');
|
|
||||||
}
|
|
||||||
});
|
|
||||||
});
|
|
||||||
} else {
|
|
||||||
claimStatusFieldRemoveREquired($field, false, '');
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
});
|
})
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
@ -399,9 +399,10 @@ console.log('fields', fields);
|
|||||||
console.log('$field id', $field);
|
console.log('$field id', $field);
|
||||||
let $parentDiv = $field.closest("div");
|
let $parentDiv = $field.closest("div");
|
||||||
console.log('$parentDiv', $parentDiv);
|
console.log('$parentDiv', $parentDiv);
|
||||||
|
// addRequiredFieldSymbol(targetId);
|
||||||
if ($parentDiv.length) {
|
if ($parentDiv.length) {
|
||||||
let thirdClass = $parentDiv.attr("class").split(" ")[2] || "";
|
let thirdClass = $parentDiv.attr("class").split(" ")[2] || "";
|
||||||
|
addRequiredFieldSymbolByClass(thirdClass);
|
||||||
console.log('thirdClass', thirdClass);
|
console.log('thirdClass', thirdClass);
|
||||||
|
|
||||||
if (thirdClass) {
|
if (thirdClass) {
|
||||||
@ -416,5 +417,61 @@ console.log('fields', fields);
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
// function addRequiredFieldSymbol(field_name) {
|
||||||
|
// // Find the field with the given name
|
||||||
|
// var $field = $(`[name="${field_name}"]`);
|
||||||
|
|
||||||
|
// if ($field.length) {
|
||||||
|
// // Find the parent div of this field
|
||||||
|
// var $parentDiv = $field.closest('div');
|
||||||
|
|
||||||
|
// if ($parentDiv.length) {
|
||||||
|
// // Get the classes as an array
|
||||||
|
// var classes = $parentDiv.attr('class') ? $parentDiv.attr('class').split(/\s+/) : [];
|
||||||
|
|
||||||
|
// if (classes.length > 0) {
|
||||||
|
// // Get the last class in the array
|
||||||
|
// var lastClass = classes[classes.length - 1];
|
||||||
|
|
||||||
|
// // Find all divs with this last class
|
||||||
|
// var $allDivsWithClass = $(`.${lastClass}`);
|
||||||
|
|
||||||
|
// // Add asterisk to all labels within these divs
|
||||||
|
// $allDivsWithClass.each(function() {
|
||||||
|
// var $label = $(this).find('label');
|
||||||
|
// if ($label.length && !$label.find('.text-danger').length) {
|
||||||
|
// $label.append(' <span class="text-danger">*</span>');
|
||||||
|
// }
|
||||||
|
// });
|
||||||
|
|
||||||
|
// console.log(`Added required symbol to ${$allDivsWithClass.length} labels with class "${lastClass}"`);
|
||||||
|
// } else {
|
||||||
|
// console.warn(`Parent div for field "${field_name}" has no classes`);
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// console.warn(`No parent div found for field name="${field_name}"`);
|
||||||
|
// }
|
||||||
|
// } else {
|
||||||
|
// console.warn(`No field found with name="${field_name}"`);
|
||||||
|
// }
|
||||||
|
// }
|
||||||
|
function addRequiredFieldSymbolByClass(className) {
|
||||||
|
// Find all divs with the specified class
|
||||||
|
var $divsWithClass = $(`.${className}`);
|
||||||
|
|
||||||
|
if ($divsWithClass.length) {
|
||||||
|
// Add asterisk to all labels within these divs
|
||||||
|
$divsWithClass.each(function() {
|
||||||
|
var $label = $(this).find('label');
|
||||||
|
if ($label.length && !$label.find('.text-danger').length) {
|
||||||
|
$label.append(' <span class="text-danger">*</span>');
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
console.log(`Added required symbol to ${$divsWithClass.length} labels with class "${className}"`);
|
||||||
|
} else {
|
||||||
|
console.warn(`No divs found with class="${className}"`);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
</script>
|
</script>
|
||||||
Loading…
Reference in New Issue
Block a user