Merge branch 'feature/hide-warehouse-price' into 'master'
hiding prices on shipping note for now on See merge request fronk/thetool!793
This commit is contained in:
@@ -4,6 +4,10 @@
|
|||||||
grid-gap: 10px;
|
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 {
|
.warehouse-shipping-note-modal-positions-entry-actions, .warehouse-shipping-note-modal-hours-entry-actions {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|||||||
@@ -257,6 +257,7 @@ Vue.component('warehouse-shipping-note-modal-positions-entry', {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
window: window,
|
window: window,
|
||||||
|
isAdmin: false,
|
||||||
articleApiUrl: window.TT_CONFIG['BASE_PATH'] + '/WarehouseArticle/autoComplete',
|
articleApiUrl: window.TT_CONFIG['BASE_PATH'] + '/WarehouseArticle/autoComplete',
|
||||||
articlePacketApiUrl: window.TT_CONFIG['BASE_PATH'] + '/WarehouseArticlePacket/autoComplete',
|
articlePacketApiUrl: window.TT_CONFIG['BASE_PATH'] + '/WarehouseArticlePacket/autoComplete',
|
||||||
articleId: '',
|
articleId: '',
|
||||||
@@ -267,11 +268,11 @@ Vue.component('warehouse-shipping-note-modal-positions-entry', {
|
|||||||
},
|
},
|
||||||
//language=Vue
|
//language=Vue
|
||||||
template: `
|
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="articleId" :api-url="articleApiUrl" label="Artikel" sm ref="article"/>
|
||||||
<!-- <tt-autocomplete v-model="articlePacketId" :api-url="articlePacketApiUrl" label="Artikel Packet" sm/>-->
|
<!-- <tt-autocomplete v-model="articlePacketId" :api-url="articlePacketApiUrl" label="Artikel Packet" sm/>-->
|
||||||
<tt-input v-model="amount" label="Menge" 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">
|
<div class="warehouse-shipping-note-modal-positions-entry-actions">
|
||||||
<button @click="createOrUpdate" class="btn btn-sm btn-primary">Speichern</button>
|
<button @click="createOrUpdate" class="btn btn-sm btn-primary">Speichern</button>
|
||||||
</div>
|
</div>
|
||||||
@@ -285,6 +286,7 @@ Vue.component('warehouse-shipping-note-modal-positions-entry', {
|
|||||||
amount: this.amount,
|
amount: this.amount,
|
||||||
price: parseFloat(this.price) ?? ''
|
price: parseFloat(this.price) ?? ''
|
||||||
}
|
}
|
||||||
|
if (isNaN(data.price)) data.price = '';
|
||||||
if (!this.articleId && this.$refs.article.displayValue) {
|
if (!this.articleId && this.$refs.article.displayValue) {
|
||||||
data.articleText = this.$refs.article.displayValue;
|
data.articleText = this.$refs.article.displayValue;
|
||||||
} else if (this.articleId) {
|
} else if (this.articleId) {
|
||||||
@@ -320,6 +322,7 @@ Vue.component('warehouse-shipping-note-modal-positions-view', {
|
|||||||
data() {
|
data() {
|
||||||
return {
|
return {
|
||||||
window: window,
|
window: window,
|
||||||
|
isAdmin: false,
|
||||||
articleNames: {},
|
articleNames: {},
|
||||||
articlePacketNames: {},
|
articlePacketNames: {},
|
||||||
}
|
}
|
||||||
@@ -332,7 +335,7 @@ Vue.component('warehouse-shipping-note-modal-positions-view', {
|
|||||||
<tr>
|
<tr>
|
||||||
<th>Artikel</th>
|
<th>Artikel</th>
|
||||||
<th>Menge</th>
|
<th>Menge</th>
|
||||||
<th>Preis</th>
|
<th v-if="isAdmin">Preis</th>
|
||||||
<th>Aktionen</th>
|
<th>Aktionen</th>
|
||||||
</tr>
|
</tr>
|
||||||
</thead>
|
</thead>
|
||||||
@@ -345,7 +348,7 @@ Vue.component('warehouse-shipping-note-modal-positions-view', {
|
|||||||
position.articleText }}
|
position.articleText }}
|
||||||
</td>
|
</td>
|
||||||
<td>{{ position.amount }}</td>
|
<td>{{ position.amount }}</td>
|
||||||
<td>{{ (position.price?.toFixed(2)) }} €</td>
|
<td v-if="isAdmin">{{ (position.price?.toFixed(2)) }} €</td>
|
||||||
<td>
|
<td>
|
||||||
<button class="btn btn-sm btn-danger" @click="$emit('delete', position)">Löschen</button>
|
<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>
|
<button class="btn btn-sm btn-primary" @click="$emit('edit', position)">Bearbeiten</button>
|
||||||
|
|||||||
Reference in New Issue
Block a user