+
+
+
+
+
+
+ @* {{ selectedItems.length }} Selected *@
+
+ Approve Selected
+
+
+ Reject Selected
+
+
+
+
-
+
+
+
+
+
+
{{ row.fullName }}
{{ formatDate(row.submitDate) }}
@@ -194,13 +220,14 @@
HoD: {{ row.hodStatus }}
Manager: {{ row.managerStatus }}
HR: {{ row.hrStatus }}
+
Rejected by a previous approver
-
-
+
+
Approve
@@ -213,15 +240,12 @@
Awaiting previous approval
-
-
-
View
- No {{ activeTab === 'pending' ? 'pending' : 'completed' }} actions found for your current filters.
+ No {{ activeTab === 'pending' ? 'pending' : 'completed' }} actions found for your current filters.
@@ -278,19 +302,32 @@
searchQuery: '',
currentPage: 1,
itemsPerPage: 10,
- overallPendingMonths: []
+ overallPendingMonths: [],
+ selectedItems: JSON.parse(sessionStorage.getItem('approvalSelectedItems')) || []
};
},
watch: {
activeTab() {
this.currentPage = 1;
this.searchQuery = '';
+ this.selectedItems = [];
},
searchQuery() {
this.currentPage = 1;
+ this.selectedItems = [];
},
itemsPerPage() {
this.currentPage = 1;
+ this.selectedItems = [];
+ },
+ currentPage() {
+ this.selectedItems = [];
+ },
+ selectedItems: {
+ handler(newVal) {
+ sessionStorage.setItem('approvalSelectedItems', JSON.stringify(newVal));
+ },
+ deep: true
}
},
computed: {
@@ -365,6 +402,28 @@
},
completedActionsCount() {
return this.otStatusList.filter(row => row.currentUserStatus === 'Approved' || row.currentUserStatus === 'Rejected').length;
+ },
+ selectAll: {
+ get() {
+ const approvableItems = this.paginatedData.filter(row => row.canApprove);
+ if (approvableItems.length === 0) return false;
+ return approvableItems.every(row => this.selectedItems.includes(row.statusId));
+ },
+ set(isChecked) {
+ const approvableItems = this.paginatedData.filter(row => row.canApprove);
+ if (isChecked) {
+
+ approvableItems.forEach(row => {
+ if (!this.selectedItems.includes(row.statusId)) {
+ this.selectedItems.push(row.statusId);
+ }
+ });
+ } else {
+
+ const approvableIds = approvableItems.map(row => row.statusId);
+ this.selectedItems = this.selectedItems.filter(id => !approvableIds.includes(id));
+ }
+ }
}
},
methods: {
@@ -443,6 +502,37 @@
this.sortDirection = 'asc';
}
this.currentPage = 1;
+ },
+ bulkUpdateStatus(decision) {
+ if (this.selectedItems.length === 0) return;
+
+ const actionText = decision === 'Approved' ? 'approve' : 'reject';
+ const confirmed = confirm(`Are you sure you want to ${actionText} ${this.selectedItems.length} selected requests?`);
+
+ if (!confirmed) return;
+
+ const apiCalls = this.selectedItems.map(statusId => {
+ return fetch('/OvertimeAPI/UpdateApprovalStatus', {
+ method: 'POST',
+ headers: { 'Content-Type': 'application/json' },
+ body: JSON.stringify({ statusId: statusId, decision: decision })
+ }).then(res => {
+ if (!res.ok) throw new Error("Failed to update status");
+ return res.json();
+ });
+ });
+
+ Promise.all(apiCalls)
+ .then(() => {
+ alert(`Successfully ${actionText}d ${this.selectedItems.length} requests.`);
+ this.selectedItems = [];
+ this.loadData();
+ })
+ .catch(err => {
+ console.error("Error updating bulk status:", err);
+ alert("An error occurred during bulk update. Some requests may not have saved properly. Refreshing data.");
+ this.loadData();
+ });
}
},
mounted() {
diff --git a/Areas/OTcalculate/Views/ApprovalDashboard/OtReview.cshtml b/Areas/OTcalculate/Views/ApprovalDashboard/OtReview.cshtml
index 44bfaf2..0736111 100644
--- a/Areas/OTcalculate/Views/ApprovalDashboard/OtReview.cshtml
+++ b/Areas/OTcalculate/Views/ApprovalDashboard/OtReview.cshtml
@@ -239,7 +239,8 @@
Save
Excel
+
+
Print No Salary
Save No Salary
Excel No Salary
diff --git a/Areas/OTcalculate/Views/Overtime/OtRegister.cshtml b/Areas/OTcalculate/Views/Overtime/OtRegister.cshtml
index 24eb502..0d3fd2d 100644
--- a/Areas/OTcalculate/Views/Overtime/OtRegister.cshtml
+++ b/Areas/OTcalculate/Views/Overtime/OtRegister.cshtml
@@ -75,25 +75,32 @@
Air Station *
-
- Select Air Station
-
- {{ station.stationName || 'Unnamed Station' }}
-
-
+
+
+
+ Select Air Station
+
+ {{ station.stationName || 'Unnamed Station' }}
+
+
+
*Only for PSTW AIR
Marine Station *
-
- Select Marine Station
-
- {{ station.stationName || 'Unnamed Station' }}
-
-
+
+
+
+ Select Marine Station
+
+ {{ station.stationName || 'Unnamed Station' }}
+
+
+
*Only for PSTW MARINE
+
Work Brief Description *
- Action Required: Your Flexi Hours, Approval Flow, Salary, or State settings have not been configured. Please contact the IT or HR department for assistance. You cannot save overtime until these are set.
+ Action Required: Your Flexi Hours, Approval Flow, or State settings have not been configured. Please contact the IT or HR department for assistance. You cannot save overtime until these are set.
@@ -381,7 +388,7 @@
this.areUserSettingsComplete = data.isComplete;
if (!this.areUserSettingsComplete) {
- alert("Action Required: Your Flexi Hours, Approval Flow, Salary, or State settings have not been configured. Please contact the IT or HR department for assistance.");
+ alert("Action Required: Your Flexi Hours, Approval Flow, or State settings have not been configured. Please contact the IT or HR department for assistance.");
}
} catch (error) {
console.error("Error checking user settings:", error);
diff --git a/Areas/OTcalculate/Views/Overtime/OtStatus.cshtml b/Areas/OTcalculate/Views/Overtime/OtStatus.cshtml
index 0b86a04..bf86063 100644
--- a/Areas/OTcalculate/Views/Overtime/OtStatus.cshtml
+++ b/Areas/OTcalculate/Views/Overtime/OtStatus.cshtml
@@ -128,9 +128,9 @@