changed shipping note
This commit is contained in:
@@ -21,6 +21,10 @@
|
||||
grid-template-columns: 2fr 1fr 1fr 1fr 2fr 1fr 1fr;
|
||||
}
|
||||
|
||||
.warehouse-shipping-note-modal-hours-entry-container.hideHourlyPrice.hideKilometer {
|
||||
grid-template-columns: 2fr 1fr 1fr 1fr 2fr 1fr;
|
||||
}
|
||||
|
||||
@media (min-width: 992px) {
|
||||
.modal-lg, .modal-xl {
|
||||
/*max width either 90% or 1120px*/
|
||||
|
||||
@@ -52,14 +52,14 @@ Vue.component('warehouse-shipping-note-modal-hours-entry', {
|
||||
},
|
||||
//language=Vue
|
||||
template: `
|
||||
<div class="warehouse-shipping-note-modal-hours-entry-container" v-bind:class="{ 'hideHourlyPrice': !showHourlyPrice }">
|
||||
<div class="warehouse-shipping-note-modal-hours-entry-container" v-bind:class="{ 'hideHourlyPrice': !showHourlyPrice, 'hideKilometer': window.TT_CONFIG['WAREHOUSE_ADMIN'] != true }">
|
||||
<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="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-input v-model="hourlyPrice" label="Stundenlohn" type="number" sm v-if="showHourlyPrice"/>
|
||||
<tt-input :disabled="carId === ''" v-model="kilometerCount" label="Kilometer" sm/>
|
||||
<tt-input v-show="window.TT_CONFIG['WAREHOUSE_ADMIN'] == true" :disabled="carId === ''" v-model="kilometerCount" label="Kilometer" sm/>
|
||||
<div class="warehouse-shipping-note-modal-hours-entry-actions">
|
||||
<button @click="createOrUpdate" class="btn btn-sm btn-primary">Speichern</button>
|
||||
</div>
|
||||
@@ -168,7 +168,7 @@ Vue.component('warehouse-shipping-note-modal-hours-view', {
|
||||
<td>{{ userNames[entry.userId] }}</td>
|
||||
<td>{{ window.moment(entry.date).format('DD.MM.YYYY') }}</td>
|
||||
<td>{{ entry.hourCount }}</td>
|
||||
<td>{{ entry.kilometerCount }}</td>
|
||||
<td v-show="window.TT_CONFIG['WAREHOUSE_ADMIN'] == true">{{ entry.kilometerCount }}</td>
|
||||
<td v-if="showHourlyPrice">{{ entry.hourlyPrice }}</td>
|
||||
<td>
|
||||
<button class="btn btn-sm btn-danger" @click="$emit('delete', entry)">Löschen</button>
|
||||
@@ -500,13 +500,13 @@ Vue.component('warehouse-shipping-note-modal', {
|
||||
</div>
|
||||
<!-- TODO: fix these buttons-->
|
||||
<template v-slot:footer-prepend v-if="id !== 'create'">
|
||||
<button v-if="window.TT_CONFIG['WAREHOUSE_ADMIN'] == true && status === 'new'" class="btn btn-warning" @click="alert('In Bearbeitung')">In
|
||||
<button v-if="window.TT_CONFIG['WAREHOUSE_ADMIN'] == true && status === 'new'" class="btn btn-warning" @click="changeStatus('in_progress')">In
|
||||
Bearbeitung
|
||||
</button>
|
||||
<button v-if="window.TT_CONFIG['WAREHOUSE_ADMIN'] == true && (status === 'new' || status === 'in_progress')" class="btn btn-success"
|
||||
@click="alert('Accepted')">Akzeptieren
|
||||
@click="changeStatus('accepted')">Akzeptieren
|
||||
</button>
|
||||
<button v-if="window.TT_CONFIG['WAREHOUSE_ADMIN'] == true && status === 'accepted'" class="btn btn-info" @click="alert('Invoiced')">
|
||||
<button v-if="window.TT_CONFIG['WAREHOUSE_ADMIN'] == true && status === 'accepted'" class="btn btn-info" @click="changeStatus('invoiced')">
|
||||
Verrechnet
|
||||
</button>
|
||||
<button class="btn btn-info" @click="$emit('open-signing-modal', id)">Unterschreiben</button>
|
||||
@@ -547,6 +547,16 @@ Vue.component('warehouse-shipping-note-modal', {
|
||||
this.window.notify('error', response.data.message || 'Ein Fehler ist aufgetreten');
|
||||
}
|
||||
},
|
||||
async changeStatus(newStatus) {
|
||||
const response = await axios.post(window.TT_CONFIG.BASE_PATH + '/WarehouseShippingNote/changeStatus', {id: this.id, status: newStatus});
|
||||
if (response.data.success) {
|
||||
this.window.notify('success', response.data.message || 'Erfolgreich aktualisiert');
|
||||
this.status = newStatus;
|
||||
this.$emit('close');
|
||||
} else {
|
||||
this.window.notify('error', response.data.message || 'Ein Fehler ist aufgetreten');
|
||||
}
|
||||
},
|
||||
async submit() {
|
||||
const data = {
|
||||
billingAddressId: this.billAddrId,
|
||||
|
||||
Reference in New Issue
Block a user