Updated Shipping Note

This commit is contained in:
Luca Haid
2025-03-21 09:01:47 +01:00
parent d9a2ba1ef4
commit 027338f93d
2 changed files with 7 additions and 3 deletions

View File

@@ -120,6 +120,7 @@ Vue.component('warehouse-shipping-note-modal', {
:submit-loading="hoursLoading"
@updateField-userId="updateCarId"
@updateField-carId="updateKilometer"
@updateField-externalCar="updateKilometer"
:config="hoursConfig" v-model="shippingNote.hoursEntries" sm row/>
<hr>
@@ -194,7 +195,8 @@ Vue.component('warehouse-shipping-note-modal', {
this.hoursLoading = false;
},
async updateKilometer(carId) {
if (!carId) return this.$refs.hoursManager.updateField('kilometerCount', null);
console.log(carId);
if (!carId || carId === '0') return this.$refs.hoursManager.updateField('kilometerCount', null);
this.hoursLoading = true;
const delAddr = this.shippingNote.deliveryAddressLine + ' ' + this.shippingNote.deliveryAddressPLZ + ' ' + this.shippingNote.deliveryAddressCity;
const {data} = await axios.get(window.TT_CONFIG["BASE_PATH"] + '/WarehouseShippingNote/getDistance?from=Xinon%20GmbH&to=' + delAddr);

View File

@@ -171,7 +171,7 @@ Vue.component('tt-positions-manager',
},
checkEmitDisplayValueAutocomplete() {
for (const [key, field] of Object.entries(this.config.fields)) {
if (field.type === 'autocomplete' && field.emitDisplayValue && (isNaN(this.formData[key]) || !this.formData[key]) && this.$refs['autocomplete-' + key][0]) {
if (typeof field.showCondition === 'function' && field.showCondition(this.formData) === true && field.type === 'autocomplete' && field.emitDisplayValue && (isNaN(this.formData[key]) || !this.formData[key]) && this.$refs['autocomplete-' + key][0]) {
this.$set(this.formData, key + '_text', this.$refs['autocomplete-' + key][0].displayValue);
this.$delete(this.formData, key);
}
@@ -207,7 +207,9 @@ Vue.component('tt-positions-manager',
resetForm() {
this.formData = {};
for (const [key, field] of Object.entries(this.config.fields)) {
if (field.type === 'autocomplete' && field.emitDisplayValue && this.$refs['autocomplete-' + key][0]) {
if (
typeof field.showCondition === 'function' && field.showCondition(this.formData) === true &&
field.type === 'autocomplete' && field.emitDisplayValue && this.$refs['autocomplete-' + key][0]) {
this.$refs['autocomplete-' + key][0].displayValue = '';
}
if (field.inputType === 'date') {