67
67
</div >
68
68
<v-skeleton-loader :loading =" isEmpty(afs)" type =" table-tbody" >
69
69
<v-container fluid class =" pa-0" >
70
- <v-card elevation =" 2" class =" pa-4" >
71
- <div class =" mb-2" >
72
- Please select one of the following options regarding the approvable fee schedule:
73
- </div >
74
- <v-radio-group v-model =" afs.afsStatus" :rules =" rules.required" :disabled =" isReadOnly" color =" primary" >
75
- <v-radio label =" I accept" :value =" AFS_STATUSES.ACCEPT" />
76
- <div v-if =" afs?.afsStatus === AFS_STATUSES.ACCEPT" class =" text-body-2 pl-2" >
77
- After submission please wait to receive notification confirming your approval to participate in
78
- CCFRI.
79
- </div >
80
- <v-radio label =" I want to upload supporting documents" :value =" AFS_STATUSES.UPLOAD_DOCUMENTS" />
81
- <v-radio label =" I decline" :value =" AFS_STATUSES.DECLINE" />
82
- <div v-if =" afs?.afsStatus === AFS_STATUSES.DECLINE" class =" text-body-2 pl-2" >
83
- After submission please wait to receive confirmation from the ministry on the results of your CCFRI
84
- application.
85
- </div >
86
- </v-radio-group >
87
- </v-card >
70
+ <AfsDecisionCard v-model =" afs.afsStatus" />
88
71
<AppDocumentUpload
89
72
v-if =" afs?.afsStatus === AFS_STATUSES.UPLOAD_DOCUMENTS"
90
73
:loading =" isLoading"
91
74
:uploaded-documents =" filteredUploadedDocuments"
92
75
:document-type =" DOCUMENT_TYPES.APPLICATION_AFS"
76
+ :show-error-message =" showErrorMessage && !isSupportingDocumentsUploaded"
93
77
title =" Upload Supporting Documents (for example receipts, quotes, invoices and/or budget/finance documents here)."
94
78
class =" mt-8"
95
79
@update-documents-to-upload =" updateDocumentsToUpload"
118
102
import { mapState , mapActions } from ' pinia' ;
119
103
import { isEmpty , cloneDeep } from ' lodash' ;
120
104
105
+ import AfsDecisionCard from ' @/components/ccfriApplication/AFS/AfsDecisionCard.vue' ;
121
106
import ApprovableParentFeesCards from ' @/components/ccfriApplication/AFS/ApprovableParentFeesCards.vue' ;
122
107
import FacilityHeader from ' @/components/guiComponents/FacilityHeader.vue' ;
123
108
import AppDocumentUpload from ' @/components/util/AppDocumentUpload.vue' ;
@@ -136,33 +121,20 @@ import rules from '@/utils/rules.js';
136
121
137
122
export default {
138
123
name: ' ApprovableFeeSchedule' ,
139
- components: { AppDocumentUpload, ApprovableParentFeesCards, FacilityHeader, NavButton },
124
+ components: { AppDocumentUpload, AfsDecisionCard, ApprovableParentFeesCards, FacilityHeader, NavButton },
140
125
mixins: [alertMixin],
141
126
async beforeRouteLeave (_to , _from , next ) {
142
127
await this .save (false );
143
128
next ();
144
129
},
145
- props: {
146
- readonly: {
147
- type: Boolean ,
148
- default: false ,
149
- },
150
- ccfriApplicationId: {
151
- type: String ,
152
- default: ' ' ,
153
- },
154
- facilityId: {
155
- type: String ,
156
- default: ' ' ,
157
- },
158
- },
159
130
data () {
160
131
return {
161
132
afs: {},
162
133
documentsToUpload: [],
163
134
uploadedDocumentsToDelete: [],
164
135
isValidForm: false ,
165
136
processing: false ,
137
+ showErrorMessage: false ,
166
138
};
167
139
},
168
140
computed: {
@@ -177,9 +149,7 @@ export default {
177
149
... mapState (useCcfriAppStore, [' approvableFeeSchedules' ]),
178
150
... mapState (useNavBarStore, [' navBarList' , ' nextPath' , ' previousPath' ]),
179
151
currentFacility () {
180
- return this .facilityId
181
- ? this .navBarList ? .find ((el ) => el .facilityId === this .facilityId )
182
- : this .navBarList ? .find ((el ) => el .ccfriApplicationId === this .$route .params .urlGuid );
152
+ return this .navBarList ? .find ((el ) => el .ccfriApplicationId === this .$route .params .urlGuid );
183
153
},
184
154
filteredUploadedDocuments () {
185
155
return this .applicationUploadedDocuments ? .filter (
@@ -193,7 +163,7 @@ export default {
193
163
},
194
164
// Note: CCFRI-3752 - AFS for change request is not in scope at this time.
195
165
isReadOnly () {
196
- return this .readonly || this . isLoading || (this .isApplicationSubmitted && ! this .currentFacility ? .unlockAfs );
166
+ return this .isLoading || (this .isApplicationSubmitted && ! this .currentFacility ? .unlockAfs );
197
167
},
198
168
isSupportingDocumentsUploaded () {
199
169
return this .filteredUploadedDocuments ? .length + this .documentsToUpload ? .length > 0 ;
@@ -214,6 +184,7 @@ export default {
214
184
' $route.params.urlGuid' : {
215
185
handler () {
216
186
this .reloadAfs ();
187
+ this .$refs .form ? .validate ();
217
188
},
218
189
},
219
190
},
@@ -230,15 +201,14 @@ export default {
230
201
... mapActions (useSupportingDocumentUploadStore, [' saveUploadedDocuments' ]),
231
202
isEmpty,
232
203
reloadAfs () {
233
- this .afs = this .ccfriApplicationId
234
- ? this .approvableFeeSchedules ? .find ((item ) => item .ccfriApplicationId === this .ccfriApplicationId )
235
- : this .approvableFeeSchedules ? .find ((item ) => item .ccfriApplicationId === this .$route .params .urlGuid );
204
+ this .afs = this .approvableFeeSchedules ? .find ((item ) => item .ccfriApplicationId === this .$route .params .urlGuid );
236
205
},
237
206
next () {
238
207
this .$router .push (this .nextPath );
239
208
},
240
209
validateForm () {
241
210
this .$refs .form ? .validate ();
211
+ this .showErrorMessage = true ;
242
212
},
243
213
back () {
244
214
this .$router .push (this .previousPath );
@@ -251,9 +221,11 @@ export default {
251
221
const payload = {
252
222
afsStatus: this .afs ? .afsStatus ,
253
223
};
254
- await this .updateApplicationCCFRI (this .$route .params .urlGuid , payload);
255
- await this .processDocumentsToUpload ();
256
- await DocumentService .deleteDocuments (this .uploadedDocumentsToDelete );
224
+ await Promise .all ([
225
+ this .updateApplicationCCFRI (this .$route .params .urlGuid , payload),
226
+ this .processDocumentsToUpload (),
227
+ DocumentService .deleteDocuments (this .uploadedDocumentsToDelete ),
228
+ ]);
257
229
await this .getApplicationUploadedDocuments ();
258
230
this .setNavBarAfsComplete ({ ccfriId: this .$route .params .urlGuid , complete: this .isFormComplete });
259
231
if (showMessage) {
0 commit comments