Updated Shipping Note
This commit is contained in:
@@ -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);
|
||||
|
||||
@@ -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') {
|
||||
|
||||
Reference in New Issue
Block a user