Selectbox add new and validation message.
This commit is contained in:
		@@ -393,6 +393,7 @@ import { Select, Option, OptionGroup, ColorPicker } from 'element-ui';
 | 
			
		||||
 | 
			
		||||
import AkauntingModalAddNew from './AkauntingModalAddNew';
 | 
			
		||||
import AkauntingModal from './AkauntingModal';
 | 
			
		||||
import AkauntingMoney from './AkauntingMoney';
 | 
			
		||||
import AkauntingRadioGroup from './forms/AkauntingRadioGroup';
 | 
			
		||||
import AkauntingSelect from './AkauntingSelect';
 | 
			
		||||
import AkauntingDate from './AkauntingDate';
 | 
			
		||||
@@ -412,6 +413,7 @@ export default {
 | 
			
		||||
        AkauntingRadioGroup,
 | 
			
		||||
        AkauntingSelect,
 | 
			
		||||
        AkauntingModal,
 | 
			
		||||
        AkauntingMoney,
 | 
			
		||||
        AkauntingDate,
 | 
			
		||||
        AkauntingRecurring,
 | 
			
		||||
    },
 | 
			
		||||
@@ -584,6 +586,7 @@ export default {
 | 
			
		||||
                            AkauntingRadioGroup,
 | 
			
		||||
                            AkauntingSelect,
 | 
			
		||||
                            AkauntingModal,
 | 
			
		||||
                            AkauntingMoney,
 | 
			
		||||
                            AkauntingDate,
 | 
			
		||||
                            AkauntingRecurring,
 | 
			
		||||
                            [ColorPicker.name]: ColorPicker,
 | 
			
		||||
@@ -618,7 +621,41 @@ export default {
 | 
			
		||||
        onSubmit(event) {
 | 
			
		||||
            this.form = event;
 | 
			
		||||
 | 
			
		||||
            axios.post(this.form.action, this.form.data())
 | 
			
		||||
            this.loading = true;
 | 
			
		||||
 | 
			
		||||
            let data = this.form.data();
 | 
			
		||||
 | 
			
		||||
            FormData.prototype.appendRecursive = function(data, wrapper = null) {  
 | 
			
		||||
                for(var name in data) {
 | 
			
		||||
                    if (wrapper) {
 | 
			
		||||
                        if ((typeof data[name] == 'object' || data[name].constructor === Array) && ((data[name] instanceof File != true ) && (data[name] instanceof Blob != true))) {
 | 
			
		||||
                            this.appendRecursive(data[name], wrapper + '[' + name + ']');
 | 
			
		||||
                        } else {
 | 
			
		||||
                            this.append(wrapper + '[' + name + ']', data[name]);
 | 
			
		||||
                        }
 | 
			
		||||
                    } else {
 | 
			
		||||
                        if ((typeof data[name] == 'object' || data[name].constructor === Array) && ((data[name] instanceof File != true ) && (data[name] instanceof Blob != true))) {
 | 
			
		||||
                            this.appendRecursive(data[name], name);
 | 
			
		||||
                        } else {
 | 
			
		||||
                            this.append(name, data[name]);
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            let form_data = new FormData();
 | 
			
		||||
            form_data.appendRecursive(data);
 | 
			
		||||
 | 
			
		||||
            window.axios({
 | 
			
		||||
                method: this.form.method,
 | 
			
		||||
                url: this.form.action,
 | 
			
		||||
                data: form_data,
 | 
			
		||||
                headers: {
 | 
			
		||||
                    'X-CSRF-TOKEN': window.Laravel.csrfToken,
 | 
			
		||||
                    'X-Requested-With': 'XMLHttpRequest',
 | 
			
		||||
                    'Content-Type': 'multipart/form-data'
 | 
			
		||||
                }
 | 
			
		||||
            })
 | 
			
		||||
            .then(response => {
 | 
			
		||||
                this.form.loading = false;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
@@ -681,7 +681,39 @@ export default {
 | 
			
		||||
        onSubmit(event) {
 | 
			
		||||
            this.form = event;
 | 
			
		||||
 | 
			
		||||
            axios.post(this.form.action, this.form.data())
 | 
			
		||||
            let data = this.form.data();
 | 
			
		||||
 | 
			
		||||
            FormData.prototype.appendRecursive = function(data, wrapper = null) {  
 | 
			
		||||
                for(var name in data) {
 | 
			
		||||
                    if (wrapper) {
 | 
			
		||||
                        if ((typeof data[name] == 'object' || data[name].constructor === Array) && ((data[name] instanceof File != true ) && (data[name] instanceof Blob != true))) {
 | 
			
		||||
                            this.appendRecursive(data[name], wrapper + '[' + name + ']');
 | 
			
		||||
                        } else {
 | 
			
		||||
                            this.append(wrapper + '[' + name + ']', data[name]);
 | 
			
		||||
                        }
 | 
			
		||||
                    } else {
 | 
			
		||||
                        if ((typeof data[name] == 'object' || data[name].constructor === Array) && ((data[name] instanceof File != true ) && (data[name] instanceof Blob != true))) {
 | 
			
		||||
                            this.appendRecursive(data[name], name);
 | 
			
		||||
                        } else {
 | 
			
		||||
                            this.append(name, data[name]);
 | 
			
		||||
                        }
 | 
			
		||||
                    }
 | 
			
		||||
                }
 | 
			
		||||
            };
 | 
			
		||||
 | 
			
		||||
            let form_data = new FormData();
 | 
			
		||||
            form_data.appendRecursive(data);
 | 
			
		||||
 | 
			
		||||
            window.axios({
 | 
			
		||||
                method: this.form.method,
 | 
			
		||||
                url: this.form.action,
 | 
			
		||||
                data: form_data,
 | 
			
		||||
                headers: {
 | 
			
		||||
                    'X-CSRF-TOKEN': window.Laravel.csrfToken,
 | 
			
		||||
                    'X-Requested-With': 'XMLHttpRequest',
 | 
			
		||||
                    'Content-Type': 'multipart/form-data'
 | 
			
		||||
                }
 | 
			
		||||
            })
 | 
			
		||||
            .then(response => {
 | 
			
		||||
                this.form.loading = false;
 | 
			
		||||
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user