implemented inventur and changed warehousearticle/category
This commit is contained in:
@@ -1,3 +1,13 @@
|
||||
/* Main card margin */
|
||||
#app > .card {
|
||||
margin-top: 1rem;
|
||||
}
|
||||
|
||||
/* Reduce button margin */
|
||||
#app > .card > .card-body > .mb-3 {
|
||||
margin-bottom: 0.5rem !important;
|
||||
}
|
||||
|
||||
/* End of Life Row Highlighting */
|
||||
.end-of-life {
|
||||
background-color: #f8d7da !important;
|
||||
@@ -6,8 +16,62 @@
|
||||
/*
|
||||
* Modal Layout
|
||||
*/
|
||||
.modal-body {
|
||||
.modal-dialog.modal-xl .modal-body {
|
||||
overflow-x: hidden;
|
||||
overflow-y: auto;
|
||||
max-height: calc(100vh - 200px);
|
||||
}
|
||||
|
||||
.modal-dialog.modal-xl .modal-content {
|
||||
max-height: calc(100vh - 50px);
|
||||
}
|
||||
|
||||
/* Disabled checkbox styling */
|
||||
.wa-checkbox-item.disabled {
|
||||
opacity: 0.6;
|
||||
cursor: not-allowed;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* Disabled form controls styling */
|
||||
.wa-modal-content .form-control:disabled,
|
||||
.wa-modal-content .form-control[disabled],
|
||||
.wa-modal-content textarea:disabled,
|
||||
.wa-modal-content textarea[disabled] {
|
||||
background-color: #e9ecef !important;
|
||||
cursor: not-allowed !important;
|
||||
opacity: 0.7;
|
||||
}
|
||||
|
||||
.wa-modal-content .tt-select-modern.disabled .tt-select-trigger,
|
||||
.wa-modal-content .tt-select-trigger[disabled],
|
||||
.wa-modal-content .tt-select-trigger.disabled {
|
||||
background-color: #e9ecef !important;
|
||||
cursor: not-allowed !important;
|
||||
opacity: 0.7;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
.wa-modal-content .form-group.disabled {
|
||||
opacity: 0.7;
|
||||
pointer-events: none;
|
||||
}
|
||||
|
||||
/* Disabled field styling */
|
||||
.wa-field-disabled {
|
||||
opacity: 0.5;
|
||||
position: relative;
|
||||
}
|
||||
|
||||
.wa-field-disabled::after {
|
||||
content: "";
|
||||
position: absolute;
|
||||
top: 0;
|
||||
left: 0;
|
||||
right: 0;
|
||||
bottom: 0;
|
||||
cursor: not-allowed;
|
||||
z-index: 5;
|
||||
}
|
||||
|
||||
.wa-modal-content {
|
||||
|
||||
@@ -331,7 +331,7 @@ Vue.component('warehouse-article-modal', {
|
||||
<!-- Basic Information -->
|
||||
<div class="wa-section">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-12" :class="{ 'wa-field-disabled': !isEditMode && !formData.category_id }">
|
||||
<tt-input
|
||||
label="Titel"
|
||||
v-model="formData.title"
|
||||
@@ -339,7 +339,7 @@ Vue.component('warehouse-article-modal', {
|
||||
required
|
||||
sm/>
|
||||
</div>
|
||||
<div class="col-md-12">
|
||||
<div class="col-md-12" :class="{ 'wa-field-disabled': !isEditMode && !formData.category_id }">
|
||||
<tt-textarea
|
||||
label="Beschreibung"
|
||||
v-model="formData.description"
|
||||
@@ -351,6 +351,7 @@ Vue.component('warehouse-article-modal', {
|
||||
label="Kategorie"
|
||||
v-model="formData.category_id"
|
||||
:options="categoryOptions"
|
||||
@input="onCategoryChange"
|
||||
required
|
||||
sm/>
|
||||
</div>
|
||||
@@ -358,12 +359,13 @@ Vue.component('warehouse-article-modal', {
|
||||
<tt-input
|
||||
label="Artikel-Nummer"
|
||||
v-model="formData.articleNumber"
|
||||
placeholder="z.B. 1234"
|
||||
placeholder="Wird automatisch generiert"
|
||||
required
|
||||
disabled
|
||||
form-label
|
||||
sm/>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="col-md-2" :class="{ 'wa-field-disabled': !isEditMode && !formData.category_id }">
|
||||
<tt-select
|
||||
label="Einheit"
|
||||
v-model="formData.unit"
|
||||
@@ -371,7 +373,7 @@ Vue.component('warehouse-article-modal', {
|
||||
required
|
||||
sm/>
|
||||
</div>
|
||||
<div class="col-md-2">
|
||||
<div class="col-md-2" :class="{ 'wa-field-disabled': !isEditMode && !formData.category_id }">
|
||||
<tt-select
|
||||
label="Erlöskonto"
|
||||
v-model="formData.revenueAccount"
|
||||
@@ -389,7 +391,7 @@ Vue.component('warehouse-article-modal', {
|
||||
<warehouse-article-distributor v-if="isEditMode" :id="Number(id)"/>
|
||||
|
||||
<!-- Additional Attributes -->
|
||||
<div class="wa-section">
|
||||
<div class="wa-section" :class="{ 'wa-field-disabled': !isEditMode && !formData.category_id }">
|
||||
<h5 class="wa-section-title"><i class="fas fa-cog mr-2"></i>Zusätzliche Artikel Attribute</h5>
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
@@ -571,6 +573,19 @@ Vue.component('warehouse-article-modal', {
|
||||
isSbidiShopHide: false
|
||||
};
|
||||
},
|
||||
async onCategoryChange(categoryId) {
|
||||
if (!categoryId || this.isEditMode) return;
|
||||
try {
|
||||
const res = await axios.get(`${window.TT_CONFIG.BASE_PATH}/WarehouseArticle/getNextArticleNumber`, {
|
||||
params: { categoryId: categoryId }
|
||||
});
|
||||
if (res.data.success) {
|
||||
this.formData.articleNumber = res.data.articleNumber;
|
||||
}
|
||||
} catch (e) {
|
||||
console.error('Failed to get next article number:', e);
|
||||
}
|
||||
},
|
||||
async save() {
|
||||
if (!this.isValid) return;
|
||||
this.saving = true;
|
||||
@@ -618,10 +633,17 @@ Vue.component('warehouse-article', {
|
||||
|
||||
<warehouse-history-modal :show.sync="historyModal" :id="historyModalId"/>
|
||||
|
||||
<div class="mb-3" v-if="window.TT_CONFIG.WAREHOUSE_ADMIN">
|
||||
<button @click="articleModalId = 'create'" class="btn btn-primary">
|
||||
<i class="fas fa-plus me-1"></i>Artikel erstellen
|
||||
</button>
|
||||
</div>
|
||||
|
||||
<tt-table-crud
|
||||
ref="table"
|
||||
emit-edit
|
||||
@openHistory="historyModalId = $event.id; historyModal = true"
|
||||
@printLabel="printLabel($event)"
|
||||
@edit="articleModalId = $event.id">
|
||||
<template v-slot:cheapestsellprice="{ row }">
|
||||
<template v-for="price in JSON.parse(row.cheapestSellPrice || '[]')">
|
||||
@@ -661,5 +683,11 @@ Vue.component('warehouse-article', {
|
||||
if (Object.keys(table.filters).length === 0) table.filters = {};
|
||||
table.refreshTable();
|
||||
}
|
||||
},
|
||||
methods: {
|
||||
printLabel(event) {
|
||||
const url = window.TT_CONFIG.BASE_PATH + "/WarehouseArticle/printLabel?id=" + event.id;
|
||||
window.open(url, '_blank');
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user