hiding prices on shipping note for now on

This commit is contained in:
Luca Haid
2024-12-10 08:06:30 +01:00
parent 9c8c57561a
commit 4130e33153
2 changed files with 11 additions and 4 deletions

View File

@@ -4,6 +4,10 @@
grid-gap: 10px;
}
.warehouse-shipping-note-modal-positions-entry-container.hidePrice {
grid-template-columns: 2fr 1fr 1fr;
}
.warehouse-shipping-note-modal-positions-entry-actions, .warehouse-shipping-note-modal-hours-entry-actions {
display: flex;
flex-direction: column;

View File

@@ -257,6 +257,7 @@ Vue.component('warehouse-shipping-note-modal-positions-entry', {
data() {
return {
window: window,
isAdmin: false,
articleApiUrl: window.TT_CONFIG['BASE_PATH'] + '/WarehouseArticle/autoComplete',
articlePacketApiUrl: window.TT_CONFIG['BASE_PATH'] + '/WarehouseArticlePacket/autoComplete',
articleId: '',
@@ -267,11 +268,11 @@ Vue.component('warehouse-shipping-note-modal-positions-entry', {
},
//language=Vue
template: `
<div class="warehouse-shipping-note-modal-positions-entry-container">
<div class="warehouse-shipping-note-modal-positions-entry-container" :class="{ 'hidePrice': !isAdmin }">
<tt-autocomplete v-model="articleId" :api-url="articleApiUrl" label="Artikel" sm ref="article"/>
<!-- <tt-autocomplete v-model="articlePacketId" :api-url="articlePacketApiUrl" label="Artikel Packet" sm/>-->
<tt-input v-model="amount" label="Menge" sm/>
<tt-input v-model="price" label="Preis" type="number" sm/>
<tt-input v-show="isAdmin" v-model="price" label="Preis" type="number" sm/>
<div class="warehouse-shipping-note-modal-positions-entry-actions">
<button @click="createOrUpdate" class="btn btn-sm btn-primary">Speichern</button>
</div>
@@ -285,6 +286,7 @@ Vue.component('warehouse-shipping-note-modal-positions-entry', {
amount: this.amount,
price: parseFloat(this.price) ?? ''
}
if (isNaN(data.price)) data.price = '';
if (!this.articleId && this.$refs.article.displayValue) {
data.articleText = this.$refs.article.displayValue;
} else if (this.articleId) {
@@ -320,6 +322,7 @@ Vue.component('warehouse-shipping-note-modal-positions-view', {
data() {
return {
window: window,
isAdmin: false,
articleNames: {},
articlePacketNames: {},
}
@@ -332,7 +335,7 @@ Vue.component('warehouse-shipping-note-modal-positions-view', {
<tr>
<th>Artikel</th>
<th>Menge</th>
<th>Preis</th>
<th v-if="isAdmin">Preis</th>
<th>Aktionen</th>
</tr>
</thead>
@@ -345,7 +348,7 @@ Vue.component('warehouse-shipping-note-modal-positions-view', {
position.articleText }}
</td>
<td>{{ position.amount }}</td>
<td>{{ (position.price?.toFixed(2)) }} €</td>
<td v-if="isAdmin">{{ (position.price?.toFixed(2)) }} €</td>
<td>
<button class="btn btn-sm btn-danger" @click="$emit('delete', position)">Löschen</button>
<button class="btn btn-sm btn-primary" @click="$emit('edit', position)">Bearbeiten</button>