@csmart/ngc-smart-victim 1.18.8 → 1.18.12
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/lib/caseNote/caseNote.component.css +2 -0
- package/src/lib/caseNote/caseNote.component.html +53 -53
- package/src/lib/common-dialog/common-dialog.component.html +9 -9
- package/src/lib/contact/contact.component.css +2 -0
- package/src/lib/contact/contact.component.html +39 -39
- package/src/lib/safetyPlan/serviceProvider.component.ts +18 -18
- package/src/lib/safetyPlan/victimSafetyPlan.component.css +1 -1
- package/src/lib/safetyPlan/victimSafetyPlan.component.html +17 -17
- package/src/lib/safetyPlan/victimSafetyPlanDetail.component.html +84 -84
- package/src/lib/smart-victim-detail/smart-victim-detail.component.html +20 -13
- package/src/lib/smart-victim-detail/smart-victim-detail.component.ts +99 -14
- package/src/lib/smart-victim.component.css +55 -2
- package/src/lib/smart-victim.component.html +101 -107
- package/src/lib/smart-victim.component.ts +9 -5
- package/src/lib/smart-victim.model.ts +14 -4
- package/src/lib/smart-victim.service.ts +20 -1
- package/src/lib/victim-routing.module.ts +9 -8
- package/src/lib/victimSearch/victimSearchForm.component.html +4 -4
- package/src/test.ts +0 -6
- package/tsconfig.lib.json +0 -1
@@ -1,69 +1,69 @@
|
|
1
1
|
<mat-card>
|
2
2
|
<mat-card-header>
|
3
|
-
|
3
|
+
|
4
4
|
</mat-card-header>
|
5
5
|
<mat-card-content>
|
6
6
|
<mat-toolbar color="primary">
|
7
7
|
<h4 class="card-header" style="display: inline-block;">Safety Plan</h4>
|
8
8
|
</mat-toolbar>
|
9
|
-
|
10
|
-
|
9
|
+
|
10
|
+
|
11
11
|
<div class='container'>
|
12
12
|
<form [formGroup]="spForm" #spDetailForm="ngForm" >
|
13
|
-
|
14
|
-
|
13
|
+
|
14
|
+
|
15
15
|
<div class="row" ><b>Victim Name:</b> {{victimName}} </div>
|
16
|
-
|
17
16
|
|
18
|
-
|
17
|
+
|
18
|
+
<div class="row" >
|
19
19
|
<mat-form-field >
|
20
20
|
<mat-label>Goal:</mat-label>
|
21
21
|
<input matInput formControlName="serviceGoal" [(ngModel)]="editSafetyPlan.goal" >
|
22
22
|
</mat-form-field>
|
23
|
-
|
23
|
+
|
24
24
|
</div>
|
25
|
-
|
26
|
-
<div class="row">
|
25
|
+
|
26
|
+
<div class="row">
|
27
27
|
<mat-form-field>
|
28
28
|
<mat-label>Goal Status:</mat-label>
|
29
29
|
<mat-select formControlName="goalStatus" [(ngModel)]="editSafetyPlan.victimServiceStatusId" >
|
30
30
|
<mat-option *ngFor=" let victimServiceStatu of victimServiceStatus" [value]="victimServiceStatu.victimServiceStatusId" >{{victimServiceStatu.name}}</mat-option>
|
31
|
-
</mat-select>
|
31
|
+
</mat-select>
|
32
32
|
</mat-form-field>
|
33
33
|
</div>
|
34
|
-
|
35
|
-
|
36
|
-
<div class="row">
|
37
|
-
|
34
|
+
|
35
|
+
|
36
|
+
<div class="row">
|
37
|
+
|
38
38
|
<mat-form-field>
|
39
39
|
<mat-label>Goal Status Date:</mat-label>
|
40
|
-
<input matInput
|
41
|
-
formControlName="goalStatusDate"
|
42
|
-
[matDatepicker]="goalStatusDate"
|
43
|
-
placeholder="Choose a date" [(ngModel)]="editSafetyPlan.startDate"
|
44
|
-
(click)="goalStatusDate.open()"
|
40
|
+
<input matInput
|
41
|
+
formControlName="goalStatusDate"
|
42
|
+
[matDatepicker]="goalStatusDate"
|
43
|
+
placeholder="Choose a date" [(ngModel)]="editSafetyPlan.startDate"
|
44
|
+
(click)="goalStatusDate.open()"
|
45
45
|
>
|
46
|
-
|
46
|
+
|
47
47
|
<mat-datepicker-toggle matSuffix [for]="goalStatusDate"></mat-datepicker-toggle>
|
48
|
-
<mat-datepicker #goalStatusDate></mat-datepicker>
|
49
|
-
</mat-form-field>
|
48
|
+
<mat-datepicker #goalStatusDate></mat-datepicker>
|
49
|
+
</mat-form-field>
|
50
50
|
|
51
51
|
|
52
|
-
<div class="help-block"
|
53
|
-
*ngIf="spForm.get('goalStatusDate').hasError('date')
|
52
|
+
<div class="help-block"
|
53
|
+
*ngIf="spForm.get('goalStatusDate').hasError('date')
|
54
54
|
&& (spForm.get('goalStatusDate').dirty || spForm.get('goalStatusDate').touched)">
|
55
55
|
<mat-error>Future Date is <strong>not allowed</strong> for goal status date</mat-error>
|
56
56
|
</div>
|
57
57
|
</div>
|
58
58
|
|
59
|
-
|
60
|
-
<div class="row" >
|
59
|
+
|
60
|
+
<div class="row" >
|
61
61
|
<!-- <mat-form-field style="width: 200px;"> -->
|
62
|
-
<!-- <mat-label>Comment:</mat-label>
|
63
|
-
<textarea mdInput
|
62
|
+
<!-- <mat-label>Comment:</mat-label>
|
63
|
+
<textarea mdInput
|
64
64
|
class="textarea-content"
|
65
65
|
[(ngModel)]="editSafetyPlan.comment"
|
66
|
-
formControlName="comment"
|
66
|
+
formControlName="comment"
|
67
67
|
cdkTextareaAutosize
|
68
68
|
#autosize="cdkTextareaAutosize"
|
69
69
|
cdkAutosizeMinRows="8"
|
@@ -76,136 +76,136 @@
|
|
76
76
|
|
77
77
|
<mat-form-field style="width: 400px;">
|
78
78
|
<mat-label>Comment:</mat-label>
|
79
|
-
<textarea
|
79
|
+
<textarea
|
80
80
|
class="textarea-content"
|
81
|
-
matInput
|
82
|
-
placeholder=""
|
83
|
-
formControlName="comment"
|
81
|
+
matInput
|
82
|
+
placeholder=""
|
83
|
+
formControlName="comment"
|
84
84
|
[(ngModel)]="editSafetyPlan.comment"
|
85
85
|
cdkTextareaAutosize
|
86
86
|
#autosize="cdkTextareaAutosize"
|
87
87
|
cdkAutosizeMinRows="8"
|
88
88
|
cdkAutosizeMaxRows="12">
|
89
|
-
</textarea>
|
89
|
+
</textarea>
|
90
|
+
|
90
91
|
|
91
|
-
|
92
92
|
</mat-form-field>
|
93
93
|
|
94
94
|
</div>
|
95
95
|
|
96
96
|
</form>
|
97
97
|
</div><!--end form-->
|
98
|
-
|
99
|
-
|
98
|
+
|
99
|
+
|
100
100
|
<br>
|
101
101
|
|
102
102
|
<div class="row"><b>Need and provider:</b><br> (click on a check box to select provider information)
|
103
|
-
|
103
|
+
|
104
104
|
<mat-list>
|
105
105
|
<mat-list-item *ngFor="let serviceType of victimServiceTypes; let i=index" >
|
106
106
|
<mat-checkbox class="example-margin" name="victimService" color ="primary" [checked]="evaluateSelection(serviceType.victimServiceTypeId)" (change)="isInArray(serviceType.victimServiceTypeId,serviceType.name, $event);" > {{serviceType.name}}</mat-checkbox>
|
107
107
|
<div> </div>
|
108
108
|
<div *ngFor="let provider of providerListCollection; let pi = index" >
|
109
109
|
<!-- <div *ngIf="provider.isDisplay && serviceType.victimServiceTypeId == provider.groupId " class="Row">
|
110
|
-
|
110
|
+
|
111
111
|
<div class="serviceSelect"> -->
|
112
112
|
<!-- <mat-form-field> -->
|
113
113
|
<!-- <mat-select name="provider" id="provider.groupId" [(ngModel)]="providerId" > -->
|
114
|
-
<!-- <mat-select name="provider" id="provider.groupId" [(value)]="providerId" >
|
114
|
+
<!-- <mat-select name="provider" id="provider.groupId" [(value)]="providerId" >
|
115
115
|
<mat-option *ngFor=" let providerOption of provider.collection" [value]="providerOption.victimProgramProviderId" >{{providerOption.victimProgramProvider}}</mat-option>
|
116
116
|
</mat-select> -->
|
117
117
|
<!-- </mat-form-field> -->
|
118
|
-
|
118
|
+
|
119
119
|
<!-- </div>
|
120
120
|
|
121
121
|
<div class="serviceButton">
|
122
|
-
<button mat-
|
122
|
+
<button mat-stroked-button color="primary" (click)="savePlanProvider(serviceType.victimServiceTypeId ,providerId)">Add Provider</button>
|
123
123
|
</div>
|
124
124
|
</div> -->
|
125
125
|
</div>
|
126
126
|
<div *ngFor=" let serviceprovider of editSafetyPlan.vVictimServiceDetails" >
|
127
|
-
|
127
|
+
|
128
128
|
<div *ngIf="serviceType.victimServiceTypeId===serviceprovider.victimServiceTypeId" class="Row" >
|
129
|
-
<!-- . {{ serviceprovider.victimProgramProvider}}<button mat-
|
129
|
+
<!-- . {{ serviceprovider.victimProgramProvider}}<button mat-stroked-button color="primary" (click)="deleteProvider(serviceprovider.victimServiceDetailId)">Delete</button> <br> -->
|
130
130
|
<div class="serviceSelect" >
|
131
131
|
. {{ serviceprovider.victimProgramProvider}}
|
132
132
|
</div>
|
133
133
|
<div class="serviceButton">
|
134
|
-
<button mat-
|
134
|
+
<button mat-stroked-button color="primary" (click)="deleteProvider(serviceprovider.victimServiceDetailId)">Delete</button>
|
135
135
|
</div>
|
136
|
-
|
136
|
+
|
137
137
|
</div>
|
138
|
-
|
138
|
+
|
139
139
|
</div>
|
140
|
-
|
141
|
-
</mat-list-item>
|
142
|
-
|
140
|
+
|
141
|
+
</mat-list-item>
|
142
|
+
|
143
143
|
</mat-list>
|
144
144
|
</div>
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
145
|
|
150
146
|
|
151
147
|
|
152
148
|
|
153
149
|
|
154
150
|
|
155
|
-
|
156
|
-
|
151
|
+
|
152
|
+
|
153
|
+
|
154
|
+
|
155
|
+
|
156
|
+
|
157
157
|
<!-- <div class='row' >
|
158
158
|
<div class='col-md-5 desc-label'><b>Victim Name:</b> {{victimName}} </div>
|
159
|
-
<div class='col-md-7'>
|
160
|
-
|
161
|
-
</div>
|
159
|
+
<div class='col-md-7'>
|
160
|
+
|
161
|
+
</div>
|
162
162
|
</div> -->
|
163
163
|
<!-- <div class='row' >
|
164
164
|
<div class='col-md-5 desc-label'><b>Goal:<font color="red">*</font></b></div>
|
165
|
-
<div class='col-md-7'>
|
165
|
+
<div class='col-md-7'>
|
166
166
|
<mat-form-field >
|
167
167
|
<input matInput name="serviceGoal" [(ngModel)]="editSafetyPlan.goal" required placeholder="">
|
168
168
|
</mat-form-field>
|
169
|
-
</div>
|
169
|
+
</div>
|
170
170
|
</div>
|
171
171
|
|
172
172
|
<div class='row' >
|
173
173
|
<div class='col-md-5 desc-label'><b>Goal Status:<font color="red">*</font></b></div>
|
174
|
-
<div class='col-md-7'>
|
174
|
+
<div class='col-md-7'>
|
175
175
|
<mat-select name="goalStatus" [style.width]="'50%'" [(ngModel)]="editSafetyPlan.victimServiceStatusId" required>
|
176
176
|
<mat-option *ngFor=" let victimServiceStatu of victimServiceStatus" [value]="victimServiceStatu.victimServiceStatusId" >{{victimServiceStatu.name}}</mat-option>
|
177
177
|
</mat-select>
|
178
|
-
</div>
|
178
|
+
</div>
|
179
179
|
</div>
|
180
|
-
|
180
|
+
|
181
181
|
<div class='row' >
|
182
182
|
<div class='col-md-5 desc-label'><b>Goal Status Date:<font color="red">*</font></b></div>
|
183
|
-
<div class='col-md-7'>
|
183
|
+
<div class='col-md-7'>
|
184
184
|
<input matInput name="goalStatusDate" [matDatepicker]="goalStatusDate" placeholder="Choose a date" [(ngModel)]="editSafetyPlan.startDate" required>
|
185
185
|
<mat-datepicker-toggle matSuffix [for]="goalStatusDate"></mat-datepicker-toggle>
|
186
|
-
<mat-datepicker #goalStatusDate></mat-datepicker>
|
187
|
-
</div>
|
186
|
+
<mat-datepicker #goalStatusDate></mat-datepicker>
|
187
|
+
</div>
|
188
188
|
</div>
|
189
|
-
|
189
|
+
|
190
190
|
<div class='row' >
|
191
191
|
<div class='col-md-5 desc-label'><b>Comment:</b></div>
|
192
|
-
<div class='col-md-7'>
|
193
|
-
<textarea mdInput placeholder="" rows="10" cols="50" name="comment" [(ngModel)]="editSafetyPlan.comment"></textarea>
|
194
|
-
</div>
|
192
|
+
<div class='col-md-7'>
|
193
|
+
<textarea mdInput placeholder="" rows="10" cols="50" name="comment" [(ngModel)]="editSafetyPlan.comment"></textarea>
|
194
|
+
</div>
|
195
195
|
</div> -->
|
196
196
|
|
197
|
-
|
197
|
+
|
198
198
|
<div class='row' >
|
199
199
|
<div class='col-md-12 text-center'>
|
200
200
|
<!-- <button type="button" class="btn btn-default btn-small" (click)="print()">Print</button> -->
|
201
|
-
<button mat-
|
202
|
-
<!-- <button mat-
|
203
|
-
<button mat-
|
204
|
-
</div>
|
205
|
-
</div>
|
201
|
+
<button mat-stroked-button color="primary" (click)="saveSafetyPlan()" [disabled]="!spForm.valid">Save</button>
|
202
|
+
<!-- <button mat-stroked-button color="primary" (click)="commondialogRef.close()">Cancel</button> -->
|
203
|
+
<button mat-stroked-button color="primary" (click)="back()">Back</button>
|
204
|
+
</div>
|
205
|
+
</div>
|
206
206
|
|
207
207
|
<!--status hisotry-->
|
208
|
-
|
208
|
+
|
209
209
|
<mat-table #table [dataSource]="victimServiceStatusHistoriesDataSource" class="example-table">
|
210
210
|
<ng-container matColumnDef="startDate">
|
211
211
|
<mat-header-cell *matHeaderCellDef class="example-header-cell">Start Date</mat-header-cell>
|
@@ -217,8 +217,8 @@
|
|
217
217
|
<mat-header-cell *matHeaderCellDef class="example-header-cell">Status</mat-header-cell>
|
218
218
|
<mat-cell *matCellDef="let row" class="example-cell"> {{row.victimServiceStatusId}} </mat-cell>
|
219
219
|
</ng-container>
|
220
|
-
|
221
|
-
|
220
|
+
|
221
|
+
|
222
222
|
<ng-container matColumnDef="comment">
|
223
223
|
<mat-header-cell *matHeaderCellDef class="example-header-cell">Comment</mat-header-cell>
|
224
224
|
<mat-cell *matCellDef="let row" class="example-cell"> {{row.comment}} </mat-cell>
|
@@ -227,8 +227,8 @@
|
|
227
227
|
<mat-row *matRowDef="let row; columns:[ 'startDate', 'victimServiceStatusId', 'comment'];" class="example-row"></mat-row>
|
228
228
|
</mat-table>
|
229
229
|
|
230
|
-
|
231
|
-
|
230
|
+
|
231
|
+
|
232
232
|
|
233
233
|
</mat-card-content>
|
234
|
-
</mat-card>
|
234
|
+
</mat-card>
|
@@ -51,12 +51,19 @@
|
|
51
51
|
|
52
52
|
|
53
53
|
<mat-form-field>
|
54
|
-
<mat-label>Relationship to Offender
|
55
|
-
|
56
|
-
|
54
|
+
<mat-label>Relationship to Offender:9</mat-label>
|
55
|
+
|
56
|
+
<mat-select #relationShipSel multiple formControlName="victimRelationships" [(ngModel)]="editVictim.victimOffenderRelationshipTypeId" >
|
57
|
+
<div (mouseleave)="relationShipSel.close()">
|
58
|
+
<mat-option color="primary" *ngFor="let item of relationshipTypes" [value]="item.relationshipTypeId">
|
59
|
+
{{item.name}}
|
60
|
+
</mat-option>
|
61
|
+
</div>
|
57
62
|
</mat-select>
|
58
|
-
|
59
|
-
|
63
|
+
|
64
|
+
|
65
|
+
<div class="help-block" *ngIf="victimForm.get('victimRelationships').errors
|
66
|
+
&& (victimForm.get('victimRelationships').dirty || victimForm.get('victimRelationships').touched)">
|
60
67
|
<mat-error>relationship is <strong>required</strong></mat-error>
|
61
68
|
</div>
|
62
69
|
</mat-form-field>
|
@@ -392,7 +399,7 @@
|
|
392
399
|
min="1"
|
393
400
|
max="10"
|
394
401
|
[(ngModel)]="editVictim.accessRisk"
|
395
|
-
|
402
|
+
><input matSliderThumb /></mat-slider>
|
396
403
|
|
397
404
|
</div>
|
398
405
|
|
@@ -749,8 +756,8 @@
|
|
749
756
|
<mat-error>Under supervision field is <strong>required</strong></mat-error>
|
750
757
|
</div>
|
751
758
|
|
752
|
-
<div class="help-block" *ngIf="victimForm.get('
|
753
|
-
&& (victimForm.get('
|
759
|
+
<div class="help-block" *ngIf="victimForm.get('victimRelationships').errors
|
760
|
+
&& (victimForm.get('victimRelationships').dirty || victimForm.get('victimRelationships').touched)">
|
754
761
|
<mat-error>Relationship is <strong>required</strong></mat-error>
|
755
762
|
</div>
|
756
763
|
|
@@ -799,18 +806,18 @@
|
|
799
806
|
</div>
|
800
807
|
|
801
808
|
<div class="inner">
|
802
|
-
<button mat-
|
809
|
+
<button mat-stroked-button color="primary" (click)="saveVictim()" [disabled]="!victimForm.valid" >Save </button>
|
803
810
|
</div>
|
804
811
|
|
805
812
|
<div *ngIf="showDelete" class="inner">
|
806
|
-
<button mat-
|
813
|
+
<button mat-stroked-button color="primary" (click)="deleteVictim()">Delete </button>
|
807
814
|
</div>
|
808
815
|
|
809
816
|
<div class="inner">
|
810
|
-
<button mat-
|
817
|
+
<button mat-stroked-button color="primary" (click)="cancel()">Clear </button>
|
811
818
|
</div>
|
812
819
|
|
813
|
-
<button mat-
|
820
|
+
<button mat-stroked-button color="primary" (click)="back()">Back</button>
|
814
821
|
|
815
822
|
</div>
|
816
823
|
|
@@ -819,7 +826,7 @@
|
|
819
826
|
<br>
|
820
827
|
|
821
828
|
<div align="right">
|
822
|
-
<button mat-
|
829
|
+
<button mat-stroked-button color="primary" (click)="addContact()" >Add victim contact</button>
|
823
830
|
</div>
|
824
831
|
|
825
832
|
<div>
|
@@ -1,7 +1,7 @@
|
|
1
1
|
import { Component, OnInit, OnChanges, Input, Output, EventEmitter, ViewChild } from '@angular/core';
|
2
2
|
import { UntypedFormBuilder, UntypedFormGroup, UntypedFormControl,Validators,ValidatorFn } from '@angular/forms';
|
3
3
|
import { MatRadioChange, MatRadioGroup } from '@angular/material/radio';
|
4
|
-
import { Victim,VictimDrugUse, Contact, VictimAdvocate,VictimGuardian,VictimWeaponUse,VictimSupport } from '../smart-victim.model';
|
4
|
+
import { Victim,VictimDrugUse, Contact, VictimAdvocate,VictimGuardian,VictimWeaponUse,VictimSupport,VictimRelationship } from '../smart-victim.model';
|
5
5
|
import { NgcSmartVictimService } from '../smart-victim.service';
|
6
6
|
import { Router, ActivatedRoute } from '@angular/router';
|
7
7
|
import { CommonDialogService} from '.././common-dialog/common-dialog.service';
|
@@ -124,7 +124,7 @@ export class SmartVictimDetailComponent implements OnInit, OnChanges {
|
|
124
124
|
weaponTypes: any;
|
125
125
|
flagOption: any;
|
126
126
|
selectedWeaponTypes: any;
|
127
|
-
selectedVictimSupportTypes: any;
|
127
|
+
//selectedVictimSupportTypes: any;
|
128
128
|
selectedDrugs: any;
|
129
129
|
id: any;
|
130
130
|
hidden: boolean=true;
|
@@ -201,7 +201,7 @@ export class SmartVictimDetailComponent implements OnInit, OnChanges {
|
|
201
201
|
|
202
202
|
this.victimForm = this.formBuilder.group({
|
203
203
|
underSupervisionFlag: new UntypedFormControl('', Validators.compose([ Validators.required])),
|
204
|
-
|
204
|
+
victimRelationships:new UntypedFormControl('', Validators.compose([ Validators.required])),
|
205
205
|
lastName: new UntypedFormControl('', Validators.compose([ Validators.required])),
|
206
206
|
firstName: new UntypedFormControl('', Validators.compose([ Validators.required])),
|
207
207
|
middleName: new UntypedFormControl('', ),
|
@@ -304,6 +304,13 @@ export class SmartVictimDetailComponent implements OnInit, OnChanges {
|
|
304
304
|
const victimSupportsControl = this.victimForm.get('victimSupports');
|
305
305
|
victimSupportsControl.setValue(supportsData);
|
306
306
|
|
307
|
+
|
308
|
+
var relationshipsData =[];
|
309
|
+
this.editVictim.victimRelationships.forEach( t=>{relationshipsData.push(t.victimRelationshipTypeId); } )
|
310
|
+
const victimOffenderRelationshipControl = this.victimForm.get('victimRelations');
|
311
|
+
victimOffenderRelationshipControl.setValue(relationshipsData);
|
312
|
+
|
313
|
+
|
307
314
|
var weaponUsesData =[];
|
308
315
|
var otherWeapon = "";
|
309
316
|
this.editVictim.victimWeaponUses.forEach( t=>{
|
@@ -596,13 +603,17 @@ export class SmartVictimDetailComponent implements OnInit, OnChanges {
|
|
596
603
|
);
|
597
604
|
this.victimService.getRelationshipTypes().subscribe(
|
598
605
|
(items: any) => {
|
599
|
-
|
600
|
-
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
+
|
607
|
+
this.relationshipTypes = items.filter( (y) => ((y.relationshipCategoryId === 'ST' || y.relationshipCategoryId === 'FM' )
|
608
|
+
&& y.relationship !== 'AY'
|
609
|
+
&& y.relationship !== 'VT'
|
610
|
+
&& y.relationship !== 'CME'
|
611
|
+
&& y.relationship !== 'HH'
|
612
|
+
&& y.relationship !== 'NC'
|
613
|
+
&& y.relationship !== 'CL'
|
614
|
+
&& y.relationship !== 'OP'
|
615
|
+
|
616
|
+
));
|
606
617
|
}
|
607
618
|
);
|
608
619
|
this.victimService.getSupportTypes().subscribe(
|
@@ -985,12 +996,58 @@ export class SmartVictimDetailComponent implements OnInit, OnChanges {
|
|
985
996
|
}
|
986
997
|
//data process
|
987
998
|
|
999
|
+
|
1000
|
+
var myVictimRelationships = [];
|
1001
|
+
|
1002
|
+
console.log('this.victimForm.value.victimRelationships'+this.victimForm.value.victimRelationships)
|
1003
|
+
if (this.victimForm.value.victimRelationships){
|
1004
|
+
console.log('this.victimForm.value.victimRelationships 1'+this.victimForm.value.victimRelationships)
|
1005
|
+
|
1006
|
+
this.victimForm.value.victimRelationships.forEach(element => {
|
1007
|
+
const victimRelationship= <VictimRelationship>{};
|
1008
|
+
victimRelationship.victimId= 0;
|
1009
|
+
victimRelationship.victimRelationshipTypeId= element;
|
1010
|
+
victimRelationship.modifiedBy= 2929;
|
1011
|
+
myVictimRelationships.push(victimRelationship);
|
1012
|
+
console.log('this.victimForm.value.victimRelationships 2'+this.victimForm.value.victimId)
|
1013
|
+
console.log('this.victimForm.value.victimRelationships 3'+this.staffId)
|
1014
|
+
console.log('this.victimForm.value.victimRelationships 4'+element)
|
1015
|
+
|
1016
|
+
});
|
1017
|
+
}
|
1018
|
+
|
1019
|
+
console.log('myVictimRelationships'+myVictimRelationships)
|
1020
|
+
|
1021
|
+
|
988
1022
|
console.log('this.phoneValidationFlag 1');
|
989
1023
|
console.log(this.phoneValidationFlag);
|
990
1024
|
if ( this.phoneValidationFlag === false){
|
991
1025
|
if (this.victimDetail === null){
|
1026
|
+
|
992
1027
|
//insert new victim
|
993
1028
|
|
1029
|
+
|
1030
|
+
var myVictimRelationships = [];
|
1031
|
+
|
1032
|
+
console.log('this.victimForm.value.victimRelationships'+this.victimForm.value.victimRelationships)
|
1033
|
+
if (this.victimForm.value.victimRelationships){
|
1034
|
+
console.log('this.victimForm.value.victimRelationships 1'+this.victimForm.value.victimRelationships)
|
1035
|
+
|
1036
|
+
this.victimForm.value.victimRelationships.forEach(element => {
|
1037
|
+
const victimRelationship= <VictimRelationship>{};
|
1038
|
+
victimRelationship.victimId= this.victimForm.value.victimId;
|
1039
|
+
victimRelationship.victimRelationshipTypeId= element;
|
1040
|
+
victimRelationship.modifiedBy= this.staffId;
|
1041
|
+
myVictimRelationships.push(victimRelationship);
|
1042
|
+
console.log('this.victimForm.value.victimRelationships 2'+this.victimForm.value.victimId)
|
1043
|
+
console.log('this.victimForm.value.victimRelationships 3'+this.staffId)
|
1044
|
+
console.log('this.victimForm.value.victimRelationships 4'+element)
|
1045
|
+
|
1046
|
+
});
|
1047
|
+
}
|
1048
|
+
|
1049
|
+
console.log('myVictimRelationships'+myVictimRelationships)
|
1050
|
+
|
994
1051
|
var myVictimSupports = [];
|
995
1052
|
if (this.victimForm.value.victimSupports){
|
996
1053
|
this.victimForm.value.victimSupports.forEach(element => {
|
@@ -1002,6 +1059,7 @@ export class SmartVictimDetailComponent implements OnInit, OnChanges {
|
|
1002
1059
|
});
|
1003
1060
|
}
|
1004
1061
|
|
1062
|
+
|
1005
1063
|
var myVictimDrugUses = [];
|
1006
1064
|
console.log('this.victimForm.value.victimDrugUses during save');
|
1007
1065
|
console.log(this.victimForm.value.victimDrugUses);
|
@@ -1050,8 +1108,8 @@ export class SmartVictimDetailComponent implements OnInit, OnChanges {
|
|
1050
1108
|
const newVictim = {
|
1051
1109
|
victimId: 0,
|
1052
1110
|
offenderId: this.offenderId,
|
1053
|
-
|
1054
|
-
|
1111
|
+
// victimOffenderRelationshipTypeId:
|
1112
|
+
// this.victimForm.value.victimOffenderRelationshipTypeId,
|
1055
1113
|
lastName: this.victimForm.value.lastName,
|
1056
1114
|
firstName: this.victimForm.value.firstName,
|
1057
1115
|
middleName: this.victimForm.value.middleName
|
@@ -1100,6 +1158,7 @@ export class SmartVictimDetailComponent implements OnInit, OnChanges {
|
|
1100
1158
|
vVictimGuardian: null,
|
1101
1159
|
victimDrugUses: myVictimDrugUses,
|
1102
1160
|
victimSupports: myVictimSupports,
|
1161
|
+
victimOffenderRelationships: myVictimRelationships,
|
1103
1162
|
victimWeaponUses: myVictimWeaponUses,
|
1104
1163
|
|
1105
1164
|
advocateFirstName: null,
|
@@ -1123,7 +1182,7 @@ export class SmartVictimDetailComponent implements OnInit, OnChanges {
|
|
1123
1182
|
guardianCellPhone: null,
|
1124
1183
|
guardianAddressId: null,
|
1125
1184
|
guardianBirthDate: null,
|
1126
|
-
relationship: null,
|
1185
|
+
//relationship: null,
|
1127
1186
|
//relationship: this.victimForm.value.victimOffenderRelationshipTypeId? this.victimForm.value.victimOffenderRelationshipTypeId : null,
|
1128
1187
|
allowCsosaContactFlag: this.victimForm.value.allowCsosaContactFlag
|
1129
1188
|
? this.victimForm.value.allowCsosaContactFlag
|
@@ -1210,7 +1269,7 @@ export class SmartVictimDetailComponent implements OnInit, OnChanges {
|
|
1210
1269
|
else {
|
1211
1270
|
//update victim
|
1212
1271
|
this.victimDetail.underSupervisionFlag = this.victimForm.value.underSupervisionFlag;
|
1213
|
-
this.victimDetail.victimOffenderRelationshipTypeId = this.victimForm.value.victimOffenderRelationshipTypeId;
|
1272
|
+
//this.victimDetail.victimOffenderRelationshipTypeId = this.victimForm.value.victimOffenderRelationshipTypeId;
|
1214
1273
|
this.victimDetail.lastName = this.victimForm.value.lastName;
|
1215
1274
|
this.victimDetail.firstName = this.victimForm.value.firstName;
|
1216
1275
|
this.victimDetail.middleName = this.victimForm.value.middleName;
|
@@ -1248,6 +1307,17 @@ export class SmartVictimDetailComponent implements OnInit, OnChanges {
|
|
1248
1307
|
this.victimDetail.victimSupports.push(victimSupport);
|
1249
1308
|
});
|
1250
1309
|
|
1310
|
+
|
1311
|
+
this.victimDetail.victimRelationships = [];
|
1312
|
+
this.victimForm.value.victimRelationships.forEach(element => {
|
1313
|
+
const victimRelationship= <VictimRelationship>{};
|
1314
|
+
victimRelationship.victimId= this.victimDetail.victimId;
|
1315
|
+
victimRelationship.victimRelationshipTypeId= element;
|
1316
|
+
victimRelationship.modifiedBy= this.staffId;
|
1317
|
+
this.victimDetail.victimRelationships.push(victimRelationship);
|
1318
|
+
});
|
1319
|
+
|
1320
|
+
|
1251
1321
|
this.victimDetail.victimDrugUses = [];
|
1252
1322
|
|
1253
1323
|
this.victimForm.value.victimDrugUses.forEach(element => {
|
@@ -1381,4 +1451,19 @@ export class SmartVictimDetailComponent implements OnInit, OnChanges {
|
|
1381
1451
|
}
|
1382
1452
|
|
1383
1453
|
|
1454
|
+
|
1455
|
+
update() {
|
1456
|
+
// this.task.update(task => {
|
1457
|
+
// if (index === undefined) {
|
1458
|
+
// task.completed = completed;
|
1459
|
+
// task.subtasks?.forEach(t => (t.completed = completed));
|
1460
|
+
// } else {
|
1461
|
+
// task.subtasks![index].completed = completed;
|
1462
|
+
// task.completed = task.subtasks?.every(t => t.completed) ?? true;
|
1463
|
+
// }
|
1464
|
+
// return {...task};
|
1465
|
+
// });
|
1466
|
+
}
|
1467
|
+
|
1468
|
+
|
1384
1469
|
}
|