@@ -66,8 +70,10 @@
outlined
readonly
stack-label
- class="col q-px-xs"
color="primary"
+ class="col q-px-xs"
+ input-class="text-weight-medium"
+ input-style="font-size: 1.2em;"
:label="$t('timesheet.expense.date')"
>
@@ -103,8 +115,8 @@
standout="bg-blue-grey-9"
dense
emit-value
- map-options
hide-dropdown-icon
+ label-slot
class="col q-px-xs"
color="primary"
:label="$t('timesheet.expense.type')"
@@ -115,7 +127,26 @@
popup-content-style="border: 2px solid var(--q-accent)"
:rules="[rules.typeRequired]"
:option-label="label => $t(`timesheet.expense.types.${label}`)"
- />
+ >
+
@@ -207,6 +238,12 @@
color="primary"
/>
+
+
+
+ {{ $t('timesheet.expense.hints.attach_file') }}
+
+
diff --git a/src/modules/timesheets/components/expense-dialog-list-item.vue b/src/modules/timesheets/components/expense-dialog-list-item.vue
index 83f85c8..59f7398 100644
--- a/src/modules/timesheets/components/expense-dialog-list-item.vue
+++ b/src/modules/timesheets/components/expense-dialog-list-item.vue
@@ -12,6 +12,7 @@
import { useAuthStore } from 'src/stores/auth-store';
import { CAN_APPROVE_PAY_PERIODS } from 'src/modules/shared/models/user.models';
import { Expense } from 'src/modules/timesheets/models/expense.models';
+ import ExpenseDialogForm from 'src/modules/timesheets/components/expense-dialog-form.vue';
const { expense, horizontal = false } = defineProps<{
expense: Expense;
@@ -29,6 +30,7 @@
const background_style = computed(() => deepEqual(expense, expenses_store.current_expense) ? 'border: 3px solid var(--q-accent);' : '');
const approved_class = computed(() => expense.is_approved ? ' bg-accent text-white' : '')
const is_authorized_to_approve = computed(() => CAN_APPROVE_PAY_PERIODS.includes(auth_store.user?.role ?? 'GUEST'))
+ const is_showing_update_form = ref(false);
const requestExpenseDeletion = async () => {
await expenses_api.deleteExpenseById(expense.id);
@@ -45,28 +47,27 @@
if (deepEqual(expense, expenses_store.current_expense)) {
expenses_store.mode = 'create';
expenses_store.current_expense = new Expense(date.formatDate(new Date(), 'YYYY-MM-DD'));
+ is_showing_update_form.value = false;
return;
}
expenses_store.mode = 'update';
expenses_store.current_expense = expense;
expenses_store.initial_expense = unwrapAndClone(expense);
+ is_showing_update_form.value = true;
}
-
-
+
-
-
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/modules/timesheets/components/expense-dialog-list.vue b/src/modules/timesheets/components/expense-dialog-list.vue
index 34c7047..2d0b364 100644
--- a/src/modules/timesheets/components/expense-dialog-list.vue
+++ b/src/modules/timesheets/components/expense-dialog-list.vue
@@ -14,9 +14,10 @@
const expenses_list = computed(() => {
if (timesheet_store.timesheets !== undefined) {
- return timesheet_store.timesheets.flatMap(week => week.days).flatMap(day => day.expenses);
+ const current_expenses = timesheet_store.timesheets.flatMap(week => week.days).flatMap(day => day.expenses);
+ console.log('current expenses: ', current_expenses);
+ return current_expenses;
}
-
return [];
})
@@ -29,10 +30,12 @@
:class="horizontal ? 'row flex-center' : ''"
>
+
{{ $t('timesheet.expense.empty_list') }}
+
-
-
-
-
+
+
+
diff --git a/src/modules/timesheets/components/shift-crud-dialog-add-update-shift.vue b/src/modules/timesheets/components/shift-crud-dialog-add-update-shift.vue
deleted file mode 100644
index db04be3..0000000
--- a/src/modules/timesheets/components/shift-crud-dialog-add-update-shift.vue
+++ /dev/null
@@ -1,81 +0,0 @@
-
-
-
-
-
-
- {{ $t('timesheet.shift.types.REMOTE') }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
\ No newline at end of file
diff --git a/src/modules/timesheets/components/shift-list-day-row.vue b/src/modules/timesheets/components/shift-list-day-row.vue
index a9c8ccb..ffe3e08 100644
--- a/src/modules/timesheets/components/shift-list-day-row.vue
+++ b/src/modules/timesheets/components/shift-list-day-row.vue
@@ -14,9 +14,9 @@
const ui_store = useUiStore();
interface ShiftOption {
- label: string;
+ label: string;
value: ShiftType;
- icon: string;
+ icon: string;
icon_color: string;
}
@@ -85,7 +85,8 @@
slideDeleteShift(details.reset)"
>
-
-
-
-
shift.type = option.value"
- >
-
-
-
- {{ scope.opt.label }}
-
-
-
-
-
-
-
- {{ $t('shared.misc.in') }}
-
-
-
-
-
-
- {{ $t('shared.misc.out') }}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- {{ 280 - (scope.value?.length ?? 0) }}
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ 280 - (scope.value?.length ?? 0) }}
+
+
+
+
+
+
+
+
shift.type = option.value"
+ >
+
+
+
+ {{ scope.opt.label }}
+
+
+
+
+
+
+
+
+
+ {{ $t('shared.misc.in') }}
+
+
+
+
+
+
+ {{ $t('shared.misc.out') }}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ {{ 280 - (scope.value?.length ?? 0) }}
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/modules/timesheets/components/shift-list-day.vue b/src/modules/timesheets/components/shift-list-day.vue
index 2d926eb..49d95cf 100644
--- a/src/modules/timesheets/components/shift-list-day.vue
+++ b/src/modules/timesheets/components/shift-list-day.vue
@@ -31,7 +31,7 @@
-
+
-
-
+
+
- {{ $d(extractDate(day.date, 'YYYY-MM-DD'), {
- weekday: 'long', day: 'numeric', month:
- 'long'
- }) }}
+ {{ $d(extractDate(day.date, 'YYYY-MM-DD'), {
+ weekday: 'long', day: 'numeric', month:
+ 'long'
+ }) }}
+ >
{
console.log('sent shifts: ', existing_shifts)
const response = await api.patch(`/shift/update`, existing_shifts);
- console.log('API response to existing shifts: ', response.data);
return response;
}
};
\ No newline at end of file
diff --git a/src/modules/timesheets/services/timesheet-service.ts b/src/modules/timesheets/services/timesheet-service.ts
index 422c726..5810788 100644
--- a/src/modules/timesheets/services/timesheet-service.ts
+++ b/src/modules/timesheets/services/timesheet-service.ts
@@ -20,7 +20,7 @@ export const timesheetService = {
},
getTimesheetsByPayPeriod: async (year: number, period_number: number): Promise => {
- const response = await api.get('timesheets', { params: { year, period_number } });
- return response.data;
+ const response = await api.get(`timesheets/${year}/${period_number}`);
+ return response.data.data;
},
};
\ No newline at end of file
diff --git a/src/stores/expense-store.ts b/src/stores/expense-store.ts
index af8ec5f..86019dc 100644
--- a/src/stores/expense-store.ts
+++ b/src/stores/expense-store.ts
@@ -1,22 +1,25 @@
import { ref } from "vue";
import { defineStore } from "pinia";
+import { useTimesheetStore } from "src/stores/timesheet-store";
import { Expense } from "src/modules/timesheets/models/expense.models";
import { ExpenseService } from "src/modules/timesheets/services/expense-service";
import { date } from "quasar";
-
-
export const useExpensesStore = defineStore('expenses', () => {
+ const timesheet_store = useTimesheetStore();
const is_open = ref(false);
const is_loading = ref(false);
+ const is_hiding_create_form = ref(false);
const mode = ref<'create' | 'update' | 'delete'>('create');
const current_expense = ref(new Expense(date.formatDate(new Date(), 'YYYY-MM-DD')));
const initial_expense = ref(new Expense(date.formatDate(new Date(), 'YYYY-MM-DD')));
const open = (): void => {
is_open.value = true;
- current_expense.value = new Expense(date.formatDate(new Date(), 'YYYY-MM-DD'));
- initial_expense.value = new Expense(date.formatDate(new Date(), 'YYYY-MM-DD'));
+ if (timesheet_store.pay_period !== undefined) {
+ current_expense.value = new Expense(timesheet_store.pay_period.period_start);
+ initial_expense.value = new Expense(timesheet_store.pay_period.period_start);
+ }
mode.value = 'create';
}
@@ -45,6 +48,7 @@ export const useExpensesStore = defineStore('expenses', () => {
return {
is_open,
is_loading,
+ is_hiding_create_form,
mode,
current_expense,
initial_expense,