Changed notify duration

This commit is contained in:
Luca Haid
2024-11-27 13:17:49 +00:00
parent ef5e2b151e
commit 465509a0c6
5 changed files with 29 additions and 6 deletions

View File

@@ -240,8 +240,15 @@ class WarehouseShippingNoteController extends TTCrud {
$hoursEntries = json_decode($shippingNote->hoursEntries, true); $hoursEntries = json_decode($shippingNote->hoursEntries, true);
foreach ($hoursEntries as $hoursEntry) { foreach ($hoursEntries as $hoursEntry) {
// die(json_encode($hoursEntry)); // die(json_encode($hoursEntry));
$articleTitle = "Arbeitsstunden";
if (isset($hoursEntry['priceType']) && $hoursEntry['priceType'] == 50) {
$articleTitle = "Arbeitsstunden (50% Zuschlag)";
} elseif (isset($hoursEntry['priceType']) && $hoursEntry['priceType'] == 100) {
$articleTitle = "Arbeitsstunden (100% Zuschlag)";
}
$positions[] = [ $positions[] = [
'articleTitle' => "Arbeitsstunden", 'articleTitle' => $articleTitle,
'articleDescription' => "Datum: ". date("d.m.Y", strtotime($hoursEntry['date'])) . " | Mitarbeiter: " . UserModel::getOne($hoursEntry['userId'])->name, 'articleDescription' => "Datum: ". date("d.m.Y", strtotime($hoursEntry['date'])) . " | Mitarbeiter: " . UserModel::getOne($hoursEntry['userId'])->name,
'articleUnit' => 'Std.', 'articleUnit' => 'Std.',
'amount' => $hoursEntry['hourCount'], 'amount' => $hoursEntry['hourCount'],

View File

@@ -36,10 +36,19 @@
grid-gap: 10px; grid-gap: 10px;
} }
.warehouse-shipping-note-modal-positions-entry-actions, .warehouse-shipping-note-modal-hours-entry-actions { .warehouse-shipping-note-modal-positions-entry-actions {
grid-column: 2; grid-column: 2;
} }
.warehouse-shipping-note-modal-hours-entry-actions {
grid-column: 1 / span 2;
margin-bottom: 8px;
}
.modal .table.table-striped.table-sm button{
margin-bottom: 4px;
}
.signModal > div { .signModal > div {
margin: 0; margin: 0;
width: 100vw; width: 100vw;

View File

@@ -47,6 +47,7 @@ Vue.component('warehouse-shipping-note-modal-hours-entry', {
hourCount: '', hourCount: '',
kilometerCount: '', kilometerCount: '',
hourlyPrice: '', hourlyPrice: '',
priceType: 'normal',
} }
}, },
//language=Vue //language=Vue
@@ -55,6 +56,7 @@ Vue.component('warehouse-shipping-note-modal-hours-entry', {
<tt-autocomplete v-model="userId" :api-url="userApiUrl" label="Mitarbeiter" sm/> <tt-autocomplete v-model="userId" :api-url="userApiUrl" label="Mitarbeiter" sm/>
<tt-input v-model="date" label="Datum" type="date" sm/> <tt-input v-model="date" label="Datum" type="date" sm/>
<tt-input v-model="hourCount" label="Stunden" sm/> <tt-input v-model="hourCount" label="Stunden" sm/>
<tt-select v-model="priceType" label="Stundenart" sm :options="[{text: 'Normal', value: 'normal'}, {text: '+50%', value: '50'}, {text: '+100%', value: '100'}]"/>
<tt-autocomplete v-model="carId" :api-url="carApiUrl" label="Fahrzeug" sm/> <tt-autocomplete v-model="carId" :api-url="carApiUrl" label="Fahrzeug" sm/>
<tt-input v-model="hourlyPrice" label="Stundenlohn" type="number" sm v-if="showHourlyPrice"/> <tt-input v-model="hourlyPrice" label="Stundenlohn" type="number" sm v-if="showHourlyPrice"/>
<tt-input :disabled="carId === ''" v-model="kilometerCount" label="Kilometer" sm/> <tt-input :disabled="carId === ''" v-model="kilometerCount" label="Kilometer" sm/>
@@ -74,6 +76,7 @@ Vue.component('warehouse-shipping-note-modal-hours-entry', {
userId: this.userId, userId: this.userId,
date: this.date, date: this.date,
hourCount: this.hourCount, hourCount: this.hourCount,
priceType: this.priceType,
hourlyPrice: this.hourlyPrice || null, hourlyPrice: this.hourlyPrice || null,
carId: this.carId ? this.carId : null, carId: this.carId ? this.carId : null,
kilometerCount: this.carId ? this.kilometerCount : null kilometerCount: this.carId ? this.kilometerCount : null
@@ -103,7 +106,7 @@ Vue.component('warehouse-shipping-note-modal-hours-entry', {
if (!this.userId || this.carId) return; if (!this.userId || this.carId) return;
const response = await axios.get(window.TT_CONFIG["BASE_PATH"] + '/WarehouseShippingNote/timerecordingCarForUser?userId=' + this.userId); const response = await axios.get(window.TT_CONFIG["BASE_PATH"] + '/WarehouseShippingNote/timerecordingCarForUser?userId=' + this.userId);
if (response.data.status === 'USER_NO_CAR') { if (response.data.status === 'USER_NO_CAR') {
this.window.notify('info', 'Kein zugewiesenes Fahrzeug gefunden'); // this.window.notify('info', 'Kein zugewiesenes Fahrzeug gefunden');
this.carId = ''; this.carId = '';
return; return;
} }

View File

@@ -6,7 +6,7 @@ document.addEventListener('DOMContentLoaded', () => {
// @formatter:on // @formatter:on
const notyf = new Notyf({ const notyf = new Notyf({
duration: 10000, position: { duration: 6000, position: {
x: 'right', y: 'bottom', x: 'right', y: 'bottom',
}, ripple: true, dismissible: true, fontSize: '32px', }, ripple: true, dismissible: true, fontSize: '32px',
types: [{ types: [{

View File

@@ -44,14 +44,18 @@ Vue.component('tt-modal', {
this.$emit('submit') this.$emit('submit')
} }
} }
}, //language=Vue },
data() {
return {window: window, isMobile: navigator.userAgent.match(/(iPad)|(iPhone)|(iPod)|(android)|(webOS)/i) !== null}
},
//language=Vue
template: ` template: `
<div class="modal show d-block" <div class="modal show d-block"
role="dialog" role="dialog"
tabindex="-1" tabindex="-1"
style="background: rgba(0, 0, 0, 0.5);" style="background: rgba(0, 0, 0, 0.5);"
ref="modal" ref="modal"
@mousedown="$emit('update:show', false)" @mousedown="!isMobile ? $emit('update:show', false) : null"
@keydown.esc="$emit('update:show', false)" @keydown.esc="$emit('update:show', false)"
v-if="show"> v-if="show">
<div class="modal-dialog modal-lg modal-dialog-scrollable" role="document" @mousedown.stop> <div class="modal-dialog modal-lg modal-dialog-scrollable" role="document" @mousedown.stop>