sf-i-events 1.0.803 → 1.0.804
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dev/index.html +12 -2
- package/package.json +1 -1
- package/sf-i-events.d.ts +3 -2
- package/sf-i-events.js +219 -148
- package/src/sf-i-events.ts +231 -162
package/src/sf-i-events.ts
CHANGED
|
@@ -116,6 +116,7 @@ export class SfIEvents extends LitElement {
|
|
|
116
116
|
COLOR_NOT_COMPLIED = "#C80036";
|
|
117
117
|
COLOR_PARTIALLY_COMPLIED = "#F79256";
|
|
118
118
|
COLOR_COMPLIED = "#50cf01";
|
|
119
|
+
COLOR_COMPLIED_WITH_EXCEPTION = "#ffe505";
|
|
119
120
|
STATUS_NOT_STARTED = "not-started";
|
|
120
121
|
STATUS_PENDING_APPROVAL = "pending-approval";
|
|
121
122
|
STATUS_REJECTED = "rejected";
|
|
@@ -431,6 +432,9 @@ export class SfIEvents extends LitElement {
|
|
|
431
432
|
.color-complied {
|
|
432
433
|
color: #50cf01;
|
|
433
434
|
}
|
|
435
|
+
.color-complied-with-exception {
|
|
436
|
+
color: #ffe505;
|
|
437
|
+
}
|
|
434
438
|
.color-scheduled {
|
|
435
439
|
color: #888888;
|
|
436
440
|
}
|
|
@@ -637,6 +641,9 @@ export class SfIEvents extends LitElement {
|
|
|
637
641
|
.color-complied {
|
|
638
642
|
color: #50cf01;
|
|
639
643
|
}
|
|
644
|
+
.color-complied-with-exception {
|
|
645
|
+
color: #ffe505;
|
|
646
|
+
}
|
|
640
647
|
.color-scheduled {
|
|
641
648
|
color: #888888;
|
|
642
649
|
}
|
|
@@ -2121,6 +2128,9 @@ export class SfIEvents extends LitElement {
|
|
|
2121
2128
|
.color-complied {
|
|
2122
2129
|
color: #50cf01;
|
|
2123
2130
|
}
|
|
2131
|
+
.color-complied-with-exception {
|
|
2132
|
+
color: #ffe505;
|
|
2133
|
+
}
|
|
2124
2134
|
.color-scheduled {
|
|
2125
2135
|
color: #888888;
|
|
2126
2136
|
}
|
|
@@ -3896,6 +3906,9 @@ export class SfIEvents extends LitElement {
|
|
|
3896
3906
|
if(arrComplianceData[name]["complied"] == null) {
|
|
3897
3907
|
arrComplianceData[name]["complied"] = 0;
|
|
3898
3908
|
}
|
|
3909
|
+
if(arrComplianceData[name]["complied-with-exception"] == null) {
|
|
3910
|
+
arrComplianceData[name]["complied-with-exception"] = 0;
|
|
3911
|
+
}
|
|
3899
3912
|
|
|
3900
3913
|
arrComplianceData[name][complianceStatus]++;
|
|
3901
3914
|
|
|
@@ -4190,7 +4203,7 @@ export class SfIEvents extends LitElement {
|
|
|
4190
4203
|
|
|
4191
4204
|
}
|
|
4192
4205
|
|
|
4193
|
-
getComplianceStatus = (completeness: string, timeliness: string) => {
|
|
4206
|
+
getComplianceStatus = (completeness: string, timeliness: string, percentage?: string) => {
|
|
4194
4207
|
|
|
4195
4208
|
if(completeness == "not-started") {
|
|
4196
4209
|
|
|
@@ -4221,7 +4234,11 @@ export class SfIEvents extends LitElement {
|
|
|
4221
4234
|
} else {
|
|
4222
4235
|
|
|
4223
4236
|
if(timeliness == "in-time" || timeliness == "late-reported" || timeliness == "late-approved") {
|
|
4224
|
-
|
|
4237
|
+
if(percentage != null && parseInt(percentage) < 100){
|
|
4238
|
+
return "complied-with-exception"
|
|
4239
|
+
}else{
|
|
4240
|
+
return "complied";
|
|
4241
|
+
}
|
|
4225
4242
|
} else {
|
|
4226
4243
|
return "not-complied";
|
|
4227
4244
|
}
|
|
@@ -4406,6 +4423,7 @@ export class SfIEvents extends LitElement {
|
|
|
4406
4423
|
html += '<div part="badge-dashboard" id="chip-compliance-1" class="chip stat-compliance justify-center align-center mr-10 mb-10 no-shrink compliance-statuses"><span class="material-icons color-not-complied">disabled_by_default</span> <span>Not Complied:</span> <span id="graph-not-complied">DASHBOARD_NOT_COMPLIED</span></div>';
|
|
4407
4424
|
html += '<div part="badge-dashboard" id="chip-compliance-2" class="chip stat-compliance justify-center align-center mr-10 mb-10 no-shrink compliance-statuses"><span class="material-icons color-partially-complied">rule</span> <span>Partially Complied:</span> <span id="graph-partially-complied">DASHBOARD_PARTIALLY_COMPLIED</span></div>';
|
|
4408
4425
|
html += '<div part="badge-dashboard" id="chip-compliance-3" class="chip stat-compliance justify-center align-center mr-10 mb-10 no-shrink compliance-statuses"><span class="material-symbols-outlined color-complied">sweep</span> <span>Complied:</span> <span id="graph-complied">DASHBOARD_COMPLIED</span></div>';
|
|
4426
|
+
html += '<div part="badge-dashboard" id="chip-compliance-4" class="chip stat-compliance justify-center align-center mr-10 mb-10 no-shrink compliance-statuses"><span class="material-symbols-outlined color-complied-with-exception">rule</span> <span>Complied With Exception:</span> <span id="graph-complied-with-exception">DASHBOARD_COMPLIED_WITH_EXCEPTION</span></div>';
|
|
4409
4427
|
html += '</div>';
|
|
4410
4428
|
|
|
4411
4429
|
html += '<div id="stream-event-filter" part="stream-event-total" class="d-flex flex-wrap"></div>';
|
|
@@ -4433,6 +4451,7 @@ export class SfIEvents extends LitElement {
|
|
|
4433
4451
|
html += '<div part="badge-dashboard" id="chip-compliance-1" class="chip stat-compliance justify-center align-center mr-10 mb-10 no-shrink compliance-statuses"><span class="material-icons color-not-complied">disabled_by_default</span> <span>Not Complied:</span> <span id="graph-not-complied">DASHBOARD_NOT_COMPLIED</span></div>';
|
|
4434
4452
|
html += '<div part="badge-dashboard" id="chip-compliance-2" class="chip stat-compliance justify-center align-center mr-10 mb-10 no-shrink compliance-statuses"><span class="material-icons color-partially-complied">rule</span> <span>Partially Complied:</span> <span id="graph-partially-complied">DASHBOARD_PARTIALLY_COMPLIED</span></div>';
|
|
4435
4453
|
html += '<div part="badge-dashboard" id="chip-compliance-3" class="chip stat-compliance justify-center align-center mr-10 mb-10 no-shrink compliance-statuses"><span class="material-symbols-outlined color-complied">sweep</span> <span>Complied:</span> <span id="graph-complied">DASHBOARD_COMPLIED</span></div>';
|
|
4454
|
+
html += '<div part="badge-dashboard" id="chip-compliance-4" class="chip stat-compliance justify-center align-center mr-10 mb-10 no-shrink compliance-statuses"><span class="material-symbols-outlined color-complied-with-exception">rule</span> <span>Complied With Exception:</span> <span id="graph-complied-with-exception">DASHBOARD_COMPLIED_WITH_EXCEPTION</span></div>';
|
|
4436
4455
|
html += '</div>';
|
|
4437
4456
|
|
|
4438
4457
|
html += '<div id="stream-event-filter" part="stream-event-total" class="d-flex flex-wrap"></div>';
|
|
@@ -4826,6 +4845,7 @@ export class SfIEvents extends LitElement {
|
|
|
4826
4845
|
html += (complianceStatus == "not-complied" ? '<span class="material-symbols-outlined color-not-complied color-not-complied-item color-not-complied-item-'+i+'">disabled_by_default</span>' : '');
|
|
4827
4846
|
html += (complianceStatus == "partially-complied" ? '<span class="material-symbols-outlined color-partially-complied color-partially-complied-item color-partially-complied-item-'+i+'">rule</span>' : '');
|
|
4828
4847
|
html += (complianceStatus == "complied" ? '<span class="material-symbols-outlined color-complied color-complied-item color-complied-item-'+i+'">sweep</span>' : '');
|
|
4848
|
+
html += (complianceStatus == "complied-with-exception" ? '<span class="material-symbols-outlined color-complied-with-exception color-complied-with-exception-item color-complied-with-exception-item-'+i+'">rule</span>' : '');
|
|
4829
4849
|
|
|
4830
4850
|
html += (partStatus == "not-started" ? '<span class="material-symbols-outlined color-not-started color-not-started-item color-not-started-item-'+i+'">schedule</span>' : '');
|
|
4831
4851
|
html += (partStatus == "pending-approval" ? '<span class="material-symbols-outlined color-pending color-pending-item color-pending-item-'+i+'">pending</span>' : '');
|
|
@@ -4899,7 +4919,7 @@ export class SfIEvents extends LitElement {
|
|
|
4899
4919
|
}
|
|
4900
4920
|
|
|
4901
4921
|
renderEvents = (_firstDay: any, _endDay: any, iInit: number, iLast: number, showGraph: boolean, index: number, month: number, period: string, firstDate: any = null, parametersTitle: string, showBackgroundButton: boolean) => {
|
|
4902
|
-
var total = 0, notStarted = 0, approved = 0, pendingApproval = 0, rejected = 0, inTime = 0, pastDueDate = 0, lateExecuted = 0, lateApproved = 0, lateReported = 0, scheduled = 0, partiallyComplied = 0, notComplied = 0, complied = 0;
|
|
4922
|
+
var total = 0, notStarted = 0, approved = 0, pendingApproval = 0, rejected = 0, inTime = 0, pastDueDate = 0, lateExecuted = 0, lateApproved = 0, lateReported = 0, scheduled = 0, partiallyComplied = 0, notComplied = 0, complied = 0, compliedWithException = 0;
|
|
4903
4923
|
var html = '';
|
|
4904
4924
|
this.selectedItemIds = [];
|
|
4905
4925
|
this.selectedItems = [];
|
|
@@ -4973,7 +4993,7 @@ export class SfIEvents extends LitElement {
|
|
|
4973
4993
|
|
|
4974
4994
|
partStatus = this.getCompletenessStatus(JSON.parse(JSON.stringify(this.events[mmdd][j])));
|
|
4975
4995
|
lateStatus = this.getTimelinessStatus(mmdd, JSON.parse(JSON.stringify(this.events[mmdd][j])), partStatus);
|
|
4976
|
-
complianceStatus = this.getComplianceStatus(partStatus, lateStatus);
|
|
4996
|
+
complianceStatus = this.getComplianceStatus(partStatus, lateStatus, JSON.parse(JSON.stringify(this.events[mmdd][j])).percentage);
|
|
4977
4997
|
if(this.flowGraph == this.FLOW_GRAPH_TIMELINESS){
|
|
4978
4998
|
bgStatus += lateStatus
|
|
4979
4999
|
}else if(this.flowGraph == this.FLOW_GRAPH_COMPLIANCE){
|
|
@@ -4997,6 +5017,7 @@ export class SfIEvents extends LitElement {
|
|
|
4997
5017
|
partiallyComplied = partiallyComplied + (complianceStatus == "partially-complied" ? 1 : 0);
|
|
4998
5018
|
notComplied = notComplied + (complianceStatus == "not-complied" ? 1 : 0);
|
|
4999
5019
|
complied = complied + (complianceStatus == "complied" ? 1 : 0);
|
|
5020
|
+
compliedWithException = compliedWithException + (complianceStatus == "complied-with-exception" ? 1 : 0);
|
|
5000
5021
|
|
|
5001
5022
|
this.events[mmdd][j][this.FLOW_GRAPH_COMPLETENESS] = partStatus;
|
|
5002
5023
|
this.events[mmdd][j][this.FLOW_GRAPH_TIMELINESS] = lateStatus;
|
|
@@ -5137,6 +5158,7 @@ export class SfIEvents extends LitElement {
|
|
|
5137
5158
|
html = html.replace("DASHBOARD_NOT_COMPLIED", notComplied+"");
|
|
5138
5159
|
html = html.replace("DASHBOARD_PARTIALLY_COMPLIED", partiallyComplied+"");
|
|
5139
5160
|
html = html.replace("DASHBOARD_COMPLIED", complied+"");
|
|
5161
|
+
html = html.replace("DASHBOARD_COMPLIED_WITH_EXCEPTION", compliedWithException+"");
|
|
5140
5162
|
|
|
5141
5163
|
this.csvDataStats = 'Period,Total,Not Started,Approved,Pending Approval,Rejected,Past Due Date,Late Reported,Late Executed,Late Approved,Scheduled,Not Complied,Partially Complied,Complied\n';
|
|
5142
5164
|
this.csvDataStats += this.period + "," + total + "," + notStarted + "," + approved + "," + pendingApproval + "," + rejected + "," + pastDueDate + "," + lateReported + "," + lateExecuted + "," + lateApproved + "," + scheduled + "," + notComplied + "," + partiallyComplied + "," + complied;
|
|
@@ -5397,13 +5419,16 @@ export class SfIEvents extends LitElement {
|
|
|
5397
5419
|
return html;
|
|
5398
5420
|
}
|
|
5399
5421
|
renderReporting = (event: any, mmddyyyy: any) => {
|
|
5422
|
+
|
|
5400
5423
|
let html = '';
|
|
5401
5424
|
let completeness = this.getCompletenessStatus(event);
|
|
5402
5425
|
let docs = event['documents'] == null ? [] : event['documents'];
|
|
5403
5426
|
let approved = event['approved'] == null ? false : event['approved'];
|
|
5404
5427
|
let dateOfCompletion = event['dateofcompletion'] == null ? '' : event['dateofcompletion'];
|
|
5428
|
+
let percentage = event['percentage'] == null ? '100' : event['percentage'];
|
|
5405
5429
|
let makercheckers = event['makercheckers'] == null ? [] : event['makercheckers'];
|
|
5406
5430
|
let docsOptional = event['docs'] == null ? [] : event['docs'];
|
|
5431
|
+
console.log('rendering reporting', event, percentage)
|
|
5407
5432
|
if(this.selectedItemIds.length > 0){
|
|
5408
5433
|
html += `<div class="d-flex justify-between ">
|
|
5409
5434
|
<h4 class="m-0 bulk-upload-label" part="bulk-upload-label">${this.selectedItemIds.length - 1} other ` + ((this.selectedItemIds.length - 1) === 1 ? `item` : `items`) + ` also selected</h4>
|
|
@@ -5434,6 +5459,8 @@ export class SfIEvents extends LitElement {
|
|
|
5434
5459
|
html += '<input id="input-approver-comments" type="text" part="input" value=""/><br />';
|
|
5435
5460
|
html += '<label part="input-label">Date of Completion*</label>';
|
|
5436
5461
|
html += '<input id="input-approver-doc" part="input" type="date" value="'+(dateOfCompletion == "" ? dateOfCompletion : new Date(parseInt(dateOfCompletion)).toISOString().substring(0,10))+'" disabled/><br />';
|
|
5462
|
+
html += '<label part="input-label">Percentage</label>';
|
|
5463
|
+
html += '<input id="input-reporter-percentage" part="input" type="number" max="100" min="0" step="1" value="' + percentage + '" disabled/><br />';
|
|
5437
5464
|
html += '<div>'
|
|
5438
5465
|
html += '<label part="input-label">Approve?*</label><br />';
|
|
5439
5466
|
html += '<div class="mt-5">'
|
|
@@ -5486,6 +5513,8 @@ export class SfIEvents extends LitElement {
|
|
|
5486
5513
|
html += '<input id="input-reporter-comments" type="text" part="input" value=""/><br />';
|
|
5487
5514
|
html += '<label part="input-label">Date of Completion*</label>';
|
|
5488
5515
|
html += '<input id="input-reporter-doc" part="input" type="date" value="'+(dateOfCompletion == "" ? dateOfCompletion : new Date(parseInt(dateOfCompletion)).toISOString().substring(0,10))+'" max="'+(new Date().toISOString().substring(0, 10))+'"/><br />';
|
|
5516
|
+
html += '<label part="input-label">Completion Percentage*</label>';
|
|
5517
|
+
html += '<input id="input-reporter-percentage" part="input" type="number" value="' + percentage + '" max="100" min="0" step="1"/><br />';
|
|
5489
5518
|
// if(docsOptional.length === 0) {
|
|
5490
5519
|
html += '<label part="input-label">Supporting Documents' + ((docsOptional.length > 0) ? '' : '*') + '</label>';
|
|
5491
5520
|
|
|
@@ -5531,6 +5560,8 @@ export class SfIEvents extends LitElement {
|
|
|
5531
5560
|
html += '<input id="input-auditor-comments" type="text" part="input" value=""/><br />';
|
|
5532
5561
|
html += '<label part="input-label">Date of Completion</label>';
|
|
5533
5562
|
html += '<input id="input-auditor-doc" part="input" type="date" value="'+(dateOfCompletion == "" ? dateOfCompletion : new Date(parseInt(dateOfCompletion)).toISOString().substring(0,10))+'" max="'+(new Date().toISOString().substring(0, 10))+'" readonly/><br />';
|
|
5563
|
+
html += '<label part="input-label">Percentage</label>';
|
|
5564
|
+
html += '<input id="input-reporter-percentage" part="input" type="number" max="100" min="0" step="1" value="' + percentage + '" disabled/><br />';
|
|
5534
5565
|
html += '<div>'
|
|
5535
5566
|
html += '<label part="input-label">Approve?</label><br />';
|
|
5536
5567
|
html += '<div class="mt-5">'
|
|
@@ -5940,8 +5971,10 @@ export class SfIEvents extends LitElement {
|
|
|
5940
5971
|
reportformatvalues = JSON.stringify((this._SfReporting[0].querySelector('#reporting-format') as SfIReporting)!.selectedValues()) ?? "";
|
|
5941
5972
|
reportformatschema = (this._SfReporting[0].querySelector('#reporting-format') as SfIReporting)!.configjson ?? "";
|
|
5942
5973
|
}
|
|
5943
|
-
|
|
5944
|
-
|
|
5974
|
+
let percentage: string = "100";
|
|
5975
|
+
if((listReportingContainer.querySelector('#input-reporter-percentage') as HTMLInputElement) != null){
|
|
5976
|
+
percentage = (listReportingContainer.querySelector('#input-reporter-percentage') as HTMLInputElement).value
|
|
5977
|
+
}
|
|
5945
5978
|
if(docs.length == 0 && event.docsOptional != null && event.docsOptional.length === 0) {
|
|
5946
5979
|
|
|
5947
5980
|
//console.log('reporter comments 3', reportercomments);
|
|
@@ -5952,182 +5985,193 @@ export class SfIEvents extends LitElement {
|
|
|
5952
5985
|
}, 3000);
|
|
5953
5986
|
|
|
5954
5987
|
} else {
|
|
5988
|
+
if(docs.length == 0 && event.docsOptional != null && event.docsOptional.length === 0) {
|
|
5955
5989
|
|
|
5956
|
-
|
|
5957
|
-
|
|
5958
|
-
if(reporterdoc.length === 0) {
|
|
5990
|
+
//console.log('reporter comments 3', reportercomments);
|
|
5959
5991
|
buttonClick.innerHTML = "Save"
|
|
5960
|
-
this.setError('
|
|
5992
|
+
this.setError('No documents uploaded!');
|
|
5961
5993
|
setTimeout(() => {
|
|
5962
5994
|
this.clearMessages();
|
|
5963
5995
|
}, 3000);
|
|
5964
5996
|
|
|
5965
5997
|
} else {
|
|
5966
5998
|
|
|
5967
|
-
//console.log('
|
|
5999
|
+
//console.log('reporterdoc', reporterdoc);
|
|
5968
6000
|
|
|
5969
|
-
if(
|
|
6001
|
+
if(reporterdoc.length === 0) {
|
|
5970
6002
|
buttonClick.innerHTML = "Save"
|
|
5971
|
-
this.setError('
|
|
6003
|
+
this.setError('Date of completion not selected!');
|
|
5972
6004
|
setTimeout(() => {
|
|
5973
6005
|
this.clearMessages();
|
|
5974
6006
|
}, 3000);
|
|
5975
6007
|
|
|
5976
6008
|
} else {
|
|
5977
|
-
let flagBulk = false;
|
|
5978
|
-
if(this.selectedItemIds.length == 0){
|
|
5979
|
-
|
|
5980
|
-
await this.uploadReport(event.entityid, event.locationid, mmddyyyy, event["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, event.isnotice != null ? "notices" : "events")
|
|
5981
|
-
|
|
5982
|
-
console.log('this.events', this.events);
|
|
5983
|
-
for( var p = 0 ; p < this.events[mmdd].length; p ++){
|
|
5984
|
-
if(this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == event.locationid && this.events[mmdd][p].entityid == event.entityid){
|
|
5985
|
-
this.events[mmdd][p].documents = docs
|
|
5986
|
-
this.events[mmdd][p].comments.push({'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toString()})
|
|
5987
|
-
this.events[mmdd][p].lastupdated = new Date().toString()
|
|
5988
|
-
}
|
|
5989
|
-
}
|
|
5990
|
-
|
|
5991
|
-
if(event.makercheckers.length > 0) {
|
|
5992
6009
|
|
|
5993
|
-
|
|
6010
|
+
//console.log('makerscheckers 1', reportercomments);
|
|
6011
|
+
|
|
6012
|
+
if(reportercomments.trim().length === 0) {
|
|
6013
|
+
buttonClick.innerHTML = "Save"
|
|
6014
|
+
this.setError('Comments cannot be blank!');
|
|
6015
|
+
setTimeout(() => {
|
|
6016
|
+
this.clearMessages();
|
|
6017
|
+
}, 3000);
|
|
6018
|
+
|
|
6019
|
+
} else {
|
|
6020
|
+
let flagBulk = false;
|
|
6021
|
+
if(this.selectedItemIds.length == 0){
|
|
6022
|
+
|
|
6023
|
+
await this.uploadReport(event.entityid, event.locationid, mmddyyyy, event["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, event.isnotice != null ? "notices" : "events", percentage)
|
|
6024
|
+
|
|
6025
|
+
console.log('this.events', this.events);
|
|
5994
6026
|
for( var p = 0 ; p < this.events[mmdd].length; p ++){
|
|
5995
6027
|
if(this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == event.locationid && this.events[mmdd][p].entityid == event.entityid){
|
|
5996
|
-
this.events[mmdd][p].
|
|
5997
|
-
|
|
5998
|
-
this.events[mmdd][p].comments.push({'author': 'Approver', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toString()})
|
|
6028
|
+
this.events[mmdd][p].documents = docs
|
|
6029
|
+
this.events[mmdd][p].comments.push({'author': 'Reporter', 'comment': reportercomments + ` (Documents Saved: ${docs.length}})`, 'timestamp': new Date().toString()})
|
|
5999
6030
|
this.events[mmdd][p].lastupdated = new Date().toString()
|
|
6000
6031
|
}
|
|
6001
6032
|
}
|
|
6002
|
-
}
|
|
6003
|
-
if(this.recentlyReported[mmdd] == null){
|
|
6004
|
-
this.recentlyReported[mmdd] = []
|
|
6005
|
-
}
|
|
6006
|
-
this.recentlyReported[mmdd].push(event)
|
|
6007
|
-
console.log('recently reported', this.recentlyReported)
|
|
6008
|
-
}else{
|
|
6009
|
-
let bulkBody = []
|
|
6010
|
-
let bulkBodyReview = []
|
|
6011
|
-
for(var k = 0; k < this.selectedItemIds.length; k++) {
|
|
6012
6033
|
|
|
6013
|
-
|
|
6014
|
-
|
|
6015
|
-
|
|
6016
|
-
|
|
6017
|
-
|
|
6018
|
-
|
|
6019
|
-
|
|
6020
|
-
|
|
6034
|
+
if(event.makercheckers.length > 0) {
|
|
6035
|
+
|
|
6036
|
+
await this.uploadReview(event.entityid, event.locationid, mmddyyyy, event["id"], "Auto approved", true, event.isnotice != null ? "notices" : "events");
|
|
6037
|
+
for( var p = 0 ; p < this.events[mmdd].length; p ++){
|
|
6038
|
+
if(this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == event.locationid && this.events[mmdd][p].entityid == event.entityid){
|
|
6039
|
+
this.events[mmdd][p].approved = true
|
|
6040
|
+
// this.events[mmdd][p].documents = docs
|
|
6041
|
+
this.events[mmdd][p].comments.push({'author': 'Approver', 'comment': `Auto approved (Approved: Yes})`, 'timestamp': new Date().toString()})
|
|
6042
|
+
this.events[mmdd][p].lastupdated = new Date().toString()
|
|
6043
|
+
}
|
|
6044
|
+
}
|
|
6045
|
+
}
|
|
6046
|
+
if(this.recentlyReported[mmdd] == null){
|
|
6047
|
+
this.recentlyReported[mmdd] = []
|
|
6048
|
+
}
|
|
6049
|
+
this.recentlyReported[mmdd].push(event)
|
|
6050
|
+
console.log('recently reported', this.recentlyReported)
|
|
6051
|
+
}else{
|
|
6052
|
+
let bulkBody = []
|
|
6053
|
+
let bulkBodyReview = []
|
|
6054
|
+
for(var k = 0; k < this.selectedItemIds.length; k++) {
|
|
6055
|
+
|
|
6056
|
+
const selectedId = this.selectedItemIds[k];
|
|
6057
|
+
//console.log('selectedid', selectedId);
|
|
6021
6058
|
|
|
6022
|
-
|
|
6023
|
-
|
|
6024
|
-
|
|
6025
|
-
|
|
6026
|
-
|
|
6027
|
-
"mmddyyyy": mmddyyyy,
|
|
6028
|
-
"projectid": this.projectId,
|
|
6029
|
-
"type": "report",
|
|
6030
|
-
"eventid": eventId,
|
|
6031
|
-
"comments": reportercomments,
|
|
6032
|
-
"dateofcompletion": reporterdoc,
|
|
6033
|
-
"entityid": entityId,
|
|
6034
|
-
"locationid": locationId,
|
|
6035
|
-
"event": null,
|
|
6036
|
-
"docs": JSON.stringify(docs),
|
|
6037
|
-
"approved": true,
|
|
6038
|
-
"username": this.userName,
|
|
6039
|
-
"reportformatvalues": reportformatvalues,
|
|
6040
|
-
"reportformatschema": reportformatschema,
|
|
6041
|
-
"userid": this.userProfileId,
|
|
6042
|
-
"userrole": this.myRole,
|
|
6043
|
-
"year": this.calendarStartYYYY,
|
|
6044
|
-
"module": event.isnotice != null ? "notices" : "events"
|
|
6045
|
-
} )
|
|
6046
|
-
// await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
|
|
6059
|
+
const makercheckersL = selectedId.split('-')[5];
|
|
6060
|
+
let entityId = selectedId.split('-')[7].replace(/_/g, '-');
|
|
6061
|
+
let locationId = selectedId.split('-')[8].replace(/_/g, '-');
|
|
6062
|
+
const eventId = selectedId.split('-')[9].replace(/_/g, '-');
|
|
6063
|
+
mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
|
|
6047
6064
|
|
|
6048
|
-
|
|
6049
|
-
|
|
6050
|
-
|
|
6051
|
-
|
|
6052
|
-
|
|
6053
|
-
|
|
6054
|
-
|
|
6055
|
-
|
|
6056
|
-
|
|
6057
|
-
|
|
6058
|
-
|
|
6059
|
-
|
|
6060
|
-
|
|
6061
|
-
|
|
6062
|
-
|
|
6063
|
-
|
|
6064
|
-
|
|
6065
|
-
|
|
6066
|
-
|
|
6067
|
-
|
|
6068
|
-
|
|
6065
|
+
//console.log(entityId, locationId, eventId, mmddyyyy);
|
|
6066
|
+
|
|
6067
|
+
// await this.uploadReport(entityId, locationId, mmddyyyy, eventId, reportercomments, reporterdoc, docs, null)
|
|
6068
|
+
if(parseInt(makercheckersL) > 0) {
|
|
6069
|
+
bulkBodyReview.push({
|
|
6070
|
+
"mmddyyyy": mmddyyyy,
|
|
6071
|
+
"projectid": this.projectId,
|
|
6072
|
+
"type": "report",
|
|
6073
|
+
"eventid": eventId,
|
|
6074
|
+
"comments": reportercomments,
|
|
6075
|
+
"dateofcompletion": reporterdoc,
|
|
6076
|
+
"percentage": percentage,
|
|
6077
|
+
"entityid": entityId,
|
|
6078
|
+
"locationid": locationId,
|
|
6079
|
+
"event": null,
|
|
6080
|
+
"docs": JSON.stringify(docs),
|
|
6081
|
+
"approved": true,
|
|
6082
|
+
"username": this.userName,
|
|
6083
|
+
"reportformatvalues": reportformatvalues,
|
|
6084
|
+
"reportformatschema": reportformatschema,
|
|
6085
|
+
"userid": this.userProfileId,
|
|
6086
|
+
"userrole": this.myRole,
|
|
6087
|
+
"year": this.calendarStartYYYY,
|
|
6088
|
+
"module": event.isnotice != null ? "notices" : "events"
|
|
6089
|
+
} )
|
|
6090
|
+
// await this.uploadReview(entityId, locationId, mmddyyyy, eventId, "Auto approved", true);
|
|
6091
|
+
|
|
6092
|
+
}else{
|
|
6093
|
+
bulkBody.push({
|
|
6094
|
+
"mmddyyyy": mmddyyyy,
|
|
6095
|
+
"projectid": this.projectId,
|
|
6096
|
+
"type": "report",
|
|
6097
|
+
"eventid": eventId,
|
|
6098
|
+
"comments": reportercomments,
|
|
6099
|
+
"dateofcompletion": reporterdoc,
|
|
6100
|
+
"percentage": percentage,
|
|
6101
|
+
"entityid": entityId,
|
|
6102
|
+
"locationid": locationId,
|
|
6103
|
+
"event": null,
|
|
6104
|
+
"docs": JSON.stringify(docs),
|
|
6105
|
+
"username": this.userName,
|
|
6106
|
+
"reportformatvalues": reportformatvalues,
|
|
6107
|
+
"reportformatschema": reportformatschema,
|
|
6108
|
+
"userid": this.userProfileId,
|
|
6109
|
+
"userrole": this.myRole,
|
|
6110
|
+
"year": this.calendarStartYYYY,
|
|
6111
|
+
"module": event.isnotice != null ? "notices" : "events"
|
|
6112
|
+
})
|
|
6113
|
+
}
|
|
6069
6114
|
|
|
6070
|
-
|
|
6071
|
-
|
|
6072
|
-
|
|
6115
|
+
// this.setSuccess("Updating " + (k + 1) + "/" + this.selectedItemIds.length + ", please wait...");
|
|
6116
|
+
// await this.sleep(2000);
|
|
6117
|
+
// this.clearMessages();
|
|
6073
6118
|
|
|
6074
|
-
|
|
6075
|
-
|
|
6076
|
-
|
|
6077
|
-
|
|
6078
|
-
|
|
6079
|
-
|
|
6080
|
-
|
|
6081
|
-
|
|
6082
|
-
|
|
6083
|
-
|
|
6084
|
-
|
|
6085
|
-
|
|
6086
|
-
|
|
6087
|
-
|
|
6088
|
-
|
|
6089
|
-
|
|
6090
|
-
|
|
6091
|
-
|
|
6092
|
-
|
|
6093
|
-
|
|
6094
|
-
|
|
6095
|
-
|
|
6096
|
-
|
|
6097
|
-
|
|
6098
|
-
|
|
6099
|
-
|
|
6119
|
+
}
|
|
6120
|
+
// await this.uploadReportsBulk(bulkBody);
|
|
6121
|
+
|
|
6122
|
+
// await this.fetchBulkReportingData();
|
|
6123
|
+
if(bulkBody.length > 0){
|
|
6124
|
+
await this.uploadReportsBulk(bulkBody, bulkBodyReview.length == 0);
|
|
6125
|
+
}
|
|
6126
|
+
|
|
6127
|
+
if(bulkBodyReview.length > 0){
|
|
6128
|
+
await this.uploadReportsReviewsBulk(bulkBodyReview)
|
|
6129
|
+
}
|
|
6130
|
+
for(var k = 0; k < this.selectedItemIds.length; k++) {
|
|
6131
|
+
|
|
6132
|
+
const selectedId = this.selectedItemIds[k];
|
|
6133
|
+
//console.log('selectedid', selectedId);
|
|
6134
|
+
let entityId = selectedId.split('-')[7].replace(/_/g, '-');
|
|
6135
|
+
let locationId = selectedId.split('-')[8].replace(/_/g, '-');
|
|
6136
|
+
const eventId = selectedId.split('-')[9].replace(/_/g, '-');
|
|
6137
|
+
mmddyyyy = selectedId.split('-')[10] + '/' + selectedId.split('-')[11] + '/' + selectedId.split('-')[12];
|
|
6138
|
+
let mmdd = mmddyyyy.split('/')[0] + '/' + mmddyyyy.split('/')[1]
|
|
6139
|
+
for( var p = 0 ; p < this.events[mmdd].length; p ++){
|
|
6140
|
+
if(this.events[mmdd][p].id == eventId && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
|
|
6141
|
+
flagBulk = true;
|
|
6142
|
+
this.events[mmdd][p].isbulk = true
|
|
6143
|
+
if(this.recentlyReported[mmdd] == null){
|
|
6144
|
+
this.recentlyReported[mmdd] = []
|
|
6145
|
+
}
|
|
6146
|
+
this.recentlyReported[mmdd].push(this.events[mmdd][p])
|
|
6100
6147
|
}
|
|
6101
|
-
this.recentlyReported[mmdd].push(this.events[mmdd][p])
|
|
6102
6148
|
}
|
|
6103
6149
|
}
|
|
6104
6150
|
}
|
|
6105
|
-
}
|
|
6106
6151
|
|
|
6107
|
-
|
|
6108
|
-
|
|
6109
|
-
|
|
6110
|
-
|
|
6111
|
-
|
|
6112
|
-
|
|
6113
|
-
|
|
6114
|
-
|
|
6115
|
-
|
|
6116
|
-
|
|
6117
|
-
|
|
6118
|
-
|
|
6152
|
+
if(this.mode == "next"){
|
|
6153
|
+
this.fetchNext(this.nextPage, this.nextTabRole, this.nextTabStatus)
|
|
6154
|
+
}else{
|
|
6155
|
+
// if(this.getCurrentTab() == this.TAB_CUSTOM) {
|
|
6156
|
+
// this.processDateSelection((this._SfCustomContainer as HTMLDivElement));
|
|
6157
|
+
// } else
|
|
6158
|
+
if(this.getCurrentTab() == this.TAB_FIND) {
|
|
6159
|
+
const searchString = ((this._SfFindContainer as HTMLDivElement).querySelector('#stream-search') as HTMLInputElement).value;
|
|
6160
|
+
this.processFindSelection((this._SfFindContainer as HTMLDivElement), searchString);
|
|
6161
|
+
} else {
|
|
6162
|
+
if(this.selectedItemIds.length > 0) {
|
|
6163
|
+
await this.fetchBulkReportingData();
|
|
6164
|
+
}
|
|
6165
|
+
this.renderAppropriateStream(this.sdate,this.edate,true, flagBulk)
|
|
6166
|
+
// if(currentColumnButton != null) {
|
|
6167
|
+
// currentColumnButton.click();
|
|
6168
|
+
// }
|
|
6119
6169
|
}
|
|
6120
|
-
this.renderAppropriateStream(this.sdate,this.edate,true, flagBulk)
|
|
6121
|
-
// if(currentColumnButton != null) {
|
|
6122
|
-
// currentColumnButton.click();
|
|
6123
|
-
// }
|
|
6124
6170
|
}
|
|
6125
6171
|
}
|
|
6126
|
-
|
|
6127
6172
|
}
|
|
6128
6173
|
}
|
|
6129
6174
|
}
|
|
6130
|
-
|
|
6131
6175
|
});
|
|
6132
6176
|
|
|
6133
6177
|
}
|
|
@@ -11696,6 +11740,7 @@ export class SfIEvents extends LitElement {
|
|
|
11696
11740
|
var dataScheduled = (divContainer.querySelector('#graph-scheduled') as HTMLSpanElement).innerHTML;
|
|
11697
11741
|
var dataPartiallyComplied = (divContainer.querySelector('#graph-partially-complied') as HTMLSpanElement).innerHTML;
|
|
11698
11742
|
var dataComplied = (divContainer.querySelector('#graph-complied') as HTMLSpanElement).innerHTML;
|
|
11743
|
+
var dataCompliedWithException = (divContainer.querySelector('#graph-complied-with-exception') as HTMLSpanElement).innerHTML;
|
|
11699
11744
|
|
|
11700
11745
|
const ctx = divContainer.querySelector('#myChart') as ChartItem;
|
|
11701
11746
|
this.showGraph(divContainer, 1);
|
|
@@ -11704,22 +11749,23 @@ export class SfIEvents extends LitElement {
|
|
|
11704
11749
|
this.clearGraph(divContainer, 4);
|
|
11705
11750
|
|
|
11706
11751
|
const data = {
|
|
11707
|
-
labels: ['Scheduled', 'Not Complied', 'Partially Complied', 'Complied'],
|
|
11752
|
+
labels: ['Scheduled', 'Not Complied', 'Partially Complied', 'Complied', 'Complied With Exception'],
|
|
11708
11753
|
datasets: [{
|
|
11709
11754
|
label: 'Compliances',
|
|
11710
|
-
data: [dataScheduled, dataNotComplied, dataPartiallyComplied, dataComplied],
|
|
11755
|
+
data: [dataScheduled, dataNotComplied, dataPartiallyComplied, dataComplied, dataCompliedWithException],
|
|
11711
11756
|
borderWidth: 1,
|
|
11712
11757
|
backgroundColor: [
|
|
11713
11758
|
this.COLOR_SCHEDULED,
|
|
11714
11759
|
this.COLOR_NOT_COMPLIED,
|
|
11715
11760
|
this.COLOR_PARTIALLY_COMPLIED,
|
|
11716
|
-
this.COLOR_COMPLIED
|
|
11761
|
+
this.COLOR_COMPLIED,
|
|
11762
|
+
this.COLOR_COMPLIED_WITH_EXCEPTION
|
|
11717
11763
|
]
|
|
11718
11764
|
}]
|
|
11719
11765
|
}
|
|
11720
11766
|
|
|
11721
|
-
this.csvGraphStats += 'Compliance,Scheduled,Not Complied,Partially Complied,Complied,Total\n';
|
|
11722
|
-
this.csvGraphStats += 'Count,'+parseInt(dataScheduled)+','+parseInt(dataNotComplied)+','+parseInt(dataPartiallyComplied)+','+parseInt(dataComplied)+','+parseInt(dataTotal)+'\n';
|
|
11767
|
+
this.csvGraphStats += 'Compliance,Scheduled,Not Complied,Partially Complied,Complied,Complied With Exception,Total\n';
|
|
11768
|
+
this.csvGraphStats += 'Count,'+parseInt(dataScheduled)+','+parseInt(dataNotComplied)+','+parseInt(dataPartiallyComplied)+','+parseInt(dataComplied)+','+parseInt(dataCompliedWithException)+','+parseInt(dataTotal)+'\n';
|
|
11723
11769
|
|
|
11724
11770
|
//console.log('rendering timeliness graph', this.csvGraphStats);
|
|
11725
11771
|
|
|
@@ -12015,6 +12061,13 @@ export class SfIEvents extends LitElement {
|
|
|
12015
12061
|
}
|
|
12016
12062
|
dataBar2['datasets'][3]['backgroundColor'] = this.COLOR_COMPLIED;
|
|
12017
12063
|
|
|
12064
|
+
dataBar2['datasets'][3]['label'] = 'Complied With Exception';
|
|
12065
|
+
dataBar2['datasets'][3]['data'] = [];
|
|
12066
|
+
for(i = 0; i < Object.keys(complianceData).length; i++) {
|
|
12067
|
+
dataBar2['datasets'][3]['data'].push(complianceData[Object.keys(complianceData)[i]]['complied-with-exception']);
|
|
12068
|
+
}
|
|
12069
|
+
dataBar2['datasets'][3]['backgroundColor'] = this.COLOR_COMPLIED_WITH_EXCEPTION;
|
|
12070
|
+
|
|
12018
12071
|
return dataBar2;
|
|
12019
12072
|
|
|
12020
12073
|
}
|
|
@@ -12797,6 +12850,10 @@ export class SfIEvents extends LitElement {
|
|
|
12797
12850
|
reportformatschema = (this._SfReporting[0].querySelector('#reporting-format') as SfIReporting)!.configjson ?? "";
|
|
12798
12851
|
}
|
|
12799
12852
|
|
|
12853
|
+
let percentage: string = "100";
|
|
12854
|
+
if(((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-percentage') as HTMLInputElement) != null){
|
|
12855
|
+
percentage = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-percentage') as HTMLInputElement).value
|
|
12856
|
+
}
|
|
12800
12857
|
|
|
12801
12858
|
if(docs.length === 0 && docsOptional.length === 0) {
|
|
12802
12859
|
|
|
@@ -12842,7 +12899,7 @@ export class SfIEvents extends LitElement {
|
|
|
12842
12899
|
let flagBulk = false;
|
|
12843
12900
|
if(this.selectedItemIds.length === 0) {
|
|
12844
12901
|
|
|
12845
|
-
await this.uploadReport(entityId, locationId, mmddyyyy, listEvent["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, "notices")
|
|
12902
|
+
await this.uploadReport(entityId, locationId, mmddyyyy, listEvent["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, "notices", percentage)
|
|
12846
12903
|
console.log('this.events', this.events);
|
|
12847
12904
|
for( var p = 0 ; p < this.events[mmdd].length; p ++){
|
|
12848
12905
|
if(this.events[mmdd][p].id == listEvent.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
|
|
@@ -12895,6 +12952,7 @@ export class SfIEvents extends LitElement {
|
|
|
12895
12952
|
"eventid": eventId,
|
|
12896
12953
|
"comments": reportercomments,
|
|
12897
12954
|
"dateofcompletion": reporterdoc,
|
|
12955
|
+
"percentage": percentage,
|
|
12898
12956
|
"entityid": entityId,
|
|
12899
12957
|
"locationid": locationId,
|
|
12900
12958
|
"event": null,
|
|
@@ -12918,6 +12976,7 @@ export class SfIEvents extends LitElement {
|
|
|
12918
12976
|
"eventid": eventId,
|
|
12919
12977
|
"comments": reportercomments,
|
|
12920
12978
|
"dateofcompletion": reporterdoc,
|
|
12979
|
+
"percentage": percentage,
|
|
12921
12980
|
"entityid": entityId,
|
|
12922
12981
|
"locationid": locationId,
|
|
12923
12982
|
"event": null,
|
|
@@ -13101,7 +13160,7 @@ export class SfIEvents extends LitElement {
|
|
|
13101
13160
|
|
|
13102
13161
|
fetchEventDetails = async (listEvent: any, mmddyyyy: any, currentColumnButton: HTMLButtonElement | null, eventsContainer: HTMLDivElement) => {
|
|
13103
13162
|
console.log('listEvent', listEvent, listEvent.id)
|
|
13104
|
-
let url = "https://"+this.apiId+"/
|
|
13163
|
+
let url = "https://"+this.apiId+"/getalleventdetails1";
|
|
13105
13164
|
|
|
13106
13165
|
//console.log('fetch calendar url', url);
|
|
13107
13166
|
let urlBody :any = {"projectid": this.projectId, "userprofileid": this.userProfileId, "role": this.myRole, "eventid": listEvent.id, "entityid": listEvent.entityid, "locationid": listEvent.locationid, "mmddyyyy": mmddyyyy, "year": this.calendarStartYYYY};
|
|
@@ -14099,7 +14158,10 @@ export class SfIEvents extends LitElement {
|
|
|
14099
14158
|
reportformatschema = (this._SfReporting[0].querySelector('#reporting-format') as SfIReporting)!.configjson ?? "";
|
|
14100
14159
|
}
|
|
14101
14160
|
|
|
14102
|
-
|
|
14161
|
+
let percentage: string = "100";
|
|
14162
|
+
if(((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-percentage') as HTMLInputElement) != null){
|
|
14163
|
+
percentage = ((this._SfDetailContainer as HTMLDivElement).querySelector('#input-reporter-percentage') as HTMLInputElement).value
|
|
14164
|
+
}
|
|
14103
14165
|
if(docs.length === 0 && docsOptional.length === 0) {
|
|
14104
14166
|
|
|
14105
14167
|
//console.log('reporter comments 3', reportercomments);
|
|
@@ -14147,7 +14209,7 @@ export class SfIEvents extends LitElement {
|
|
|
14147
14209
|
//console.log('makerscheckers', makercheckers, reportercomments);
|
|
14148
14210
|
// console.log('reportformatvalues', reportformatvalues)
|
|
14149
14211
|
// console.log('reportformatschema',reportformatschema)
|
|
14150
|
-
await this.uploadReport(entityId, locationId, mmddyyyy, event["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, event.isnotice != null ? "notices" : "events")
|
|
14212
|
+
await this.uploadReport(entityId, locationId, mmddyyyy, event["id"], reportercomments, reporterdoc, docs, event, reportformatvalues, reportformatschema, event.isnotice != null ? "notices" : "events", percentage)
|
|
14151
14213
|
console.log('this.events', this.events);
|
|
14152
14214
|
for( var p = 0 ; p < this.events[mmdd].length; p ++){
|
|
14153
14215
|
if(this.events[mmdd][p].id == event.id && this.events[mmdd][p].locationid == locationId && this.events[mmdd][p].entityid == entityId){
|
|
@@ -14216,6 +14278,7 @@ export class SfIEvents extends LitElement {
|
|
|
14216
14278
|
"eventid": eventId,
|
|
14217
14279
|
"comments": reportercomments,
|
|
14218
14280
|
"dateofcompletion": reporterdoc,
|
|
14281
|
+
"percentage": percentage,
|
|
14219
14282
|
"entityid": entityId,
|
|
14220
14283
|
"locationid": locationId,
|
|
14221
14284
|
"event": null,
|
|
@@ -14239,6 +14302,7 @@ export class SfIEvents extends LitElement {
|
|
|
14239
14302
|
"eventid": eventId,
|
|
14240
14303
|
"comments": reportercomments,
|
|
14241
14304
|
"dateofcompletion": reporterdoc,
|
|
14305
|
+
"percentage": percentage,
|
|
14242
14306
|
"entityid": entityId,
|
|
14243
14307
|
"locationid": locationId,
|
|
14244
14308
|
"event": null,
|
|
@@ -19364,6 +19428,9 @@ export class SfIEvents extends LitElement {
|
|
|
19364
19428
|
.color-complied {
|
|
19365
19429
|
color: #50cf01;
|
|
19366
19430
|
}
|
|
19431
|
+
.color-complied-with-exception {
|
|
19432
|
+
color: #ffe505;
|
|
19433
|
+
}
|
|
19367
19434
|
.color-scheduled {
|
|
19368
19435
|
color: #888888;
|
|
19369
19436
|
}
|
|
@@ -22391,7 +22458,7 @@ export class SfIEvents extends LitElement {
|
|
|
22391
22458
|
}
|
|
22392
22459
|
}
|
|
22393
22460
|
uploadReportsReviewsBulk = async (bulkBody: any) => {
|
|
22394
|
-
let url = "https://"+this.apiId+"/
|
|
22461
|
+
let url = "https://"+this.apiId+"/uploadreportsreviewsbulk2";
|
|
22395
22462
|
|
|
22396
22463
|
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
22397
22464
|
const xhr : any = (await this.prepareXhr(bulkBody, url, this._SfLoader, authorization)) as any;
|
|
@@ -22431,8 +22498,8 @@ export class SfIEvents extends LitElement {
|
|
|
22431
22498
|
}
|
|
22432
22499
|
}
|
|
22433
22500
|
|
|
22434
|
-
uploadReport = async (entityId: string, locationId: string, mmddyyyy: string, eventid: string, comments: string, doc: string, docs: any, event: any, reportformatvalues: string = "", reportformatschema: string = "", module: string = "events") => {
|
|
22435
|
-
let url = "https://"+this.apiId+"/
|
|
22501
|
+
uploadReport = async (entityId: string, locationId: string, mmddyyyy: string, eventid: string, comments: string, doc: string, docs: any, event: any, reportformatvalues: string = "", reportformatschema: string = "", module: string = "events", percentage: string = "100") => {
|
|
22502
|
+
let url = "https://"+this.apiId+"/uploadreport2";
|
|
22436
22503
|
|
|
22437
22504
|
let body = {
|
|
22438
22505
|
"mmddyyyy": mmddyyyy,
|
|
@@ -22441,6 +22508,7 @@ export class SfIEvents extends LitElement {
|
|
|
22441
22508
|
"eventid": eventid,
|
|
22442
22509
|
"comments": comments,
|
|
22443
22510
|
"dateofcompletion": doc,
|
|
22511
|
+
"percentage": percentage,
|
|
22444
22512
|
"entityid": entityId,
|
|
22445
22513
|
"locationid": locationId,
|
|
22446
22514
|
"event": event == null ? null : JSON.stringify(event),
|
|
@@ -22485,7 +22553,7 @@ export class SfIEvents extends LitElement {
|
|
|
22485
22553
|
}
|
|
22486
22554
|
|
|
22487
22555
|
uploadReportsBulk = async (bulkBody: any, showSuccess: boolean = true) => {
|
|
22488
|
-
let url = "https://"+this.apiId+"/
|
|
22556
|
+
let url = "https://"+this.apiId+"/uploadreportsbulk2"
|
|
22489
22557
|
|
|
22490
22558
|
const authorization = btoa(Util.readCookie('email') + ":" + Util.readCookie('accessToken'));
|
|
22491
22559
|
const xhr : any = (await this.prepareXhr(bulkBody, url, this._SfLoader, authorization)) as any;
|
|
@@ -24258,7 +24326,7 @@ export class SfIEvents extends LitElement {
|
|
|
24258
24326
|
view = "entity";
|
|
24259
24327
|
}
|
|
24260
24328
|
|
|
24261
|
-
path = "
|
|
24329
|
+
path = "getallcountryevents3";
|
|
24262
24330
|
|
|
24263
24331
|
let sDate = "";
|
|
24264
24332
|
let eDate = "";
|
|
@@ -25301,7 +25369,7 @@ export class SfIEvents extends LitElement {
|
|
|
25301
25369
|
console.log('eventsData', eventsData)
|
|
25302
25370
|
console.log('role', role)
|
|
25303
25371
|
// if(Object.keys(eventsData[role]).length > 0){
|
|
25304
|
-
var notStarted = 0, approved = 0, pendingApproval = 0, rejected = 0, inTime = 0, pastDueDate = 0, lateExecuted = 0, lateApproved = 0, lateReported = 0, scheduled = 0, partiallyComplied = 0, notComplied = 0, complied = 0;
|
|
25372
|
+
var notStarted = 0, approved = 0, pendingApproval = 0, rejected = 0, inTime = 0, pastDueDate = 0, lateExecuted = 0, lateApproved = 0, lateReported = 0, scheduled = 0, partiallyComplied = 0, notComplied = 0, complied = 0, compliedWithException = 0;
|
|
25305
25373
|
var html = '';
|
|
25306
25374
|
this.selectedItemIds = [];
|
|
25307
25375
|
this.selectedStatus = "";
|
|
@@ -25334,7 +25402,7 @@ export class SfIEvents extends LitElement {
|
|
|
25334
25402
|
var complianceStatus = "";
|
|
25335
25403
|
partStatus = this.getCompletenessStatus(JSON.parse(JSON.stringify(eventsData[role][mmdd][j])));
|
|
25336
25404
|
lateStatus = this.getTimelinessStatus(mmdd, JSON.parse(JSON.stringify(eventsData[role][mmdd][j])), partStatus);
|
|
25337
|
-
complianceStatus = this.getComplianceStatus(partStatus, lateStatus);
|
|
25405
|
+
complianceStatus = this.getComplianceStatus(partStatus, lateStatus, JSON.parse(JSON.stringify(eventsData[role][mmdd][j])).percentage);
|
|
25338
25406
|
notStarted = notStarted + (partStatus == "not-started" ? 1 : 0);
|
|
25339
25407
|
pendingApproval = pendingApproval + (partStatus == "pending-approval" ? 1 : 0);
|
|
25340
25408
|
rejected = rejected + (partStatus == "rejected" ? 1 : 0);
|
|
@@ -25348,6 +25416,7 @@ export class SfIEvents extends LitElement {
|
|
|
25348
25416
|
partiallyComplied = partiallyComplied + (complianceStatus == "partially-complied" ? 1 : 0);
|
|
25349
25417
|
notComplied = notComplied + (complianceStatus == "not-complied" ? 1 : 0);
|
|
25350
25418
|
complied = complied + (complianceStatus == "complied" ? 1 : 0);
|
|
25419
|
+
compliedWithException = compliedWithException + (complianceStatus == "complied-with-exception" ? 1 : 0);
|
|
25351
25420
|
|
|
25352
25421
|
eventsData[role][mmdd][j][this.FLOW_GRAPH_COMPLETENESS] = partStatus;
|
|
25353
25422
|
eventsData[role][mmdd][j][this.FLOW_GRAPH_TIMELINESS] = lateStatus;
|
|
@@ -25907,7 +25976,7 @@ export class SfIEvents extends LitElement {
|
|
|
25907
25976
|
partStatus = this.getCompletenessStatus(JSON.parse(JSON.stringify(eventsData[mmdd][j])));
|
|
25908
25977
|
if(partStatus != "not-started"){ continue; }
|
|
25909
25978
|
lateStatus = this.getTimelinessStatus(mmdd, JSON.parse(JSON.stringify(eventsData[mmdd][j])), partStatus);
|
|
25910
|
-
complianceStatus = this.getComplianceStatus(partStatus, lateStatus);
|
|
25979
|
+
complianceStatus = this.getComplianceStatus(partStatus, lateStatus, JSON.parse(JSON.stringify(eventsData[mmdd][j])).percentage);
|
|
25911
25980
|
// notStarted = notStarted + (partStatus == "not-started" ? 1 : 0);
|
|
25912
25981
|
// pendingApproval = pendingApproval + (partStatus == "pending-approval" ? 1 : 0);
|
|
25913
25982
|
// rejected = rejected + (partStatus == "rejected" ? 1 : 0);
|