Feature: Schnellere Eingabe der Daten ist möglich
This commit is contained in:
@@ -3,6 +3,7 @@
|
||||
import IconifyIcon from '@iconify/svelte'
|
||||
import checkIcon from '@iconify-icons/oi/check'
|
||||
import xIcon from '@iconify-icons/oi/x'
|
||||
import {TimekeepingDate} from "../../components/TimekeepingDate.svelte"
|
||||
|
||||
export let activeRecord = null
|
||||
export let newRecord = false
|
||||
@@ -10,14 +11,19 @@
|
||||
'saveRecord': () => {
|
||||
if (newRecord === true) {
|
||||
WorkingHoursRepository.add(activeRecord).then(() => {
|
||||
Controller.cancelActiveRecord()
|
||||
Controller.nextDay()
|
||||
});
|
||||
} else {
|
||||
WorkingHoursRepository.update(activeRecord.workingDay, activeRecord).then(() => {
|
||||
Controller.cancelActiveRecord()
|
||||
Controller.nextDay()
|
||||
});
|
||||
}
|
||||
},
|
||||
'nextDay': () => {
|
||||
let actDate = new TimekeepingDate(activeRecord.workingDay)
|
||||
let nextDay = actDate.getNextDay()
|
||||
activeRecord = {workingTime: '00:00:00', workingDay: nextDay.getDateString()}
|
||||
},
|
||||
'cancelActiveRecord': () => {
|
||||
activeRecord = null;
|
||||
newRecord = false;
|
||||
@@ -39,7 +45,7 @@
|
||||
</div>
|
||||
</fieldset>
|
||||
<fieldset name="buttons">
|
||||
<button on:click={Controller.saveRecord} type="button">Übernehmen
|
||||
<button on:click={Controller.saveRecord} type="button">Übernehmen und Weiter
|
||||
<IconifyIcon icon={checkIcon} color="green"/>
|
||||
</button>
|
||||
<button on:click={Controller.cancelActiveRecord} type="button" class="sub-button">Abbrechen
|
||||
|
||||
Reference in New Issue
Block a user