FIX_CLIENT_POLICY_EDIT_HIDE_AND_SHOW_ISSUE : RV
This commit is contained in:
parent
eadd03c45b
commit
0c6be0aaeb
@ -549,26 +549,39 @@
|
||||
// appendPolicyFormFields(2);
|
||||
// }
|
||||
|
||||
if (dataId == 3) {
|
||||
if($('#policy_type').val() == 1){
|
||||
|
||||
var displayStatus = $('#base_policy_id').css('display');
|
||||
$('#base_policy_id').show();
|
||||
$('#base_policy').prop('required', true);
|
||||
console.log('step 1')
|
||||
|
||||
if (displayStatus === 'none') {
|
||||
$('#base_policy').val('').change();
|
||||
}
|
||||
if (dataId == 3) {
|
||||
|
||||
// $('#base_policy').find('option[data-id="3"]').hide();
|
||||
console.log('step 2')
|
||||
|
||||
} else {
|
||||
var displayStatus = $('#base_policy_id').css('display');
|
||||
$('#base_policy_id').show();
|
||||
$('#base_policy').prop('required', true);
|
||||
|
||||
var displayStatus = $('#base_policy_id').css('display');
|
||||
$('#base_policy_id').hide();
|
||||
$('#base_policy').prop('required', false);
|
||||
if (displayStatus === 'none') {
|
||||
console.log('step 2.1')
|
||||
|
||||
if (displayStatus === 'none') {
|
||||
$('#base_policy').val('').change();
|
||||
$('#base_policy').val('').change();
|
||||
}
|
||||
|
||||
// $('#base_policy').find('option[data-id="3"]').hide();
|
||||
|
||||
} else {
|
||||
|
||||
console.log('step 3')
|
||||
|
||||
var displayStatus = $('#base_policy_id').css('display');
|
||||
$('#base_policy_id').hide();
|
||||
$('#base_policy').prop('required', false);
|
||||
|
||||
if (displayStatus === 'none') {
|
||||
console.log('step 3.1')
|
||||
|
||||
$('#base_policy').val('').change();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@ -648,7 +661,28 @@
|
||||
$('#base_policy').prop('required', false);
|
||||
}
|
||||
|
||||
|
||||
if(res.data.is_addon == 1 && res.data.base_policy > 0){
|
||||
|
||||
// $("#insurer").next(".select2-container").css({
|
||||
// 'pointer-events': 'none',
|
||||
// });
|
||||
// $('#select2-insurer-container').css({
|
||||
// 'background-color': '#ebebe0',
|
||||
// });
|
||||
|
||||
// $("#tpa").next(".select2-container").css({
|
||||
// 'pointer-events': 'none',
|
||||
// });
|
||||
// $('#select2-tpa-container').css({
|
||||
// 'background-color': '#ebebe0',
|
||||
// });
|
||||
|
||||
}
|
||||
|
||||
|
||||
if (res.data.is_addon == 2 || res.data.is_addon == 3) {
|
||||
|
||||
$("#insurer").next(".select2-container").css({
|
||||
'pointer-events': 'none',
|
||||
});
|
||||
@ -693,14 +727,17 @@
|
||||
$.each(res.client_policy_list, function(index, item) {
|
||||
OptionsHTML += '<option data-id="' + item.policy_type_id +
|
||||
'" value="' + item.id + '" ' + (res.data.base_policy === item.id ?
|
||||
'selected="selected"' : '') + '>' + item.name + '</option>';
|
||||
'selected="selected"' : '') + '>' + item.name + '( ' + item.policy_type + ' )</option>';
|
||||
});
|
||||
$('#base_policy').html(OptionsHTML);
|
||||
|
||||
setTimeout(function() {
|
||||
$('#policy').val(res.data.policy_id).change();
|
||||
$('#base_policy').val(res.data.base_policy);
|
||||
$('#base_policy').change();
|
||||
}, 3000);
|
||||
|
||||
|
||||
},
|
||||
error: function(xhr, status, error) {
|
||||
console.error(xhr.responseText);
|
||||
|
||||
Loading…
Reference in New Issue
Block a user