Files
hrm/app/components/debt/DebtCheckbox.vue
2026-04-06 15:53:14 +07:00

29 lines
791 B
Vue

<script setup>
const props = defineProps({
page: String, // Due/Overdue
paymentScheduleId: Number,
});
const { $store } = useNuxtApp();
$store.commit('selectedPaymentSchedulesForEmailInDue', []);
$store.commit('selectedPaymentSchedulesForEmailInOverdue', []);
const storeProp = `selectedPaymentSchedulesForEmailIn${props.page}`;
</script>
<template>
<input
type="checkbox"
:checked="$store[storeProp].includes(props.paymentScheduleId)"
@change="(e) => {
if (e.target.checked) {
$store.commit(
storeProp,
[ ...$store[storeProp], props.paymentScheduleId],
)
} else {
$store.commit(
storeProp,
$store[storeProp].filter(x => x !== props.paymentScheduleId),
)
}
}"
/>
</template>