|
@@ -217,6 +217,16 @@ parentSegment.find('.frm-edit-{{$label}}')
|
|
|
value: planContent
|
|
|
})
|
|
|
}
|
|
|
+ // if added/removed during-visit, require plan
|
|
|
+ if(form.find('[name="isRemovedDueToEntryError"]:checked').val() !== '1' &&
|
|
|
+ ((form.find('[name="isRemoved"]:checked').val() === '0' && form.find('[name="additionReasonCategory"]:checked').val() === 'DURING_VISIT') ||
|
|
|
+ (form.find('[name="isRemoved"]:checked').val() === '1' && form.find('[name="removalReasonCategory"]:checked').val() === 'DURING_VISIT'))
|
|
|
+ ) {
|
|
|
+ if(!planContent) {
|
|
|
+ alert('Updates during visit require an accompanying plan!');
|
|
|
+ return false;
|
|
|
+ }
|
|
|
+ }
|
|
|
@endif
|
|
|
|
|
|
$.post(form.attr('url'), payload, _data => {
|