vue file updates selectGroup and form.js

This commit is contained in:
Cüneyt Şentürk 2020-02-17 17:32:30 +03:00
parent d36b6a55e9
commit a3ba91f75e
6 changed files with 26 additions and 7 deletions

View File

@ -420,14 +420,14 @@ export default {
}, },
value: { value: {
type: [String, Number, Array], type: [String, Number, Array],
default: null, default: '',
description: "Selectbox selected value" description: "Selectbox selected value"
}, },
options: null, options: null,
model: { model: {
type: [String, Number], type: [String, Number],
default: null, default: '',
description: "Selectbox selected model" description: "Selectbox selected model"
}, },

View File

@ -710,14 +710,15 @@ export default {
if (this.multiple) { if (this.multiple) {
this.real_model = value; this.real_model = value;
} else { } else {
this.real_model = value.toString(); //this.real_model = value.toString();
this.real_model = value;
} }
}, },
model: function (value) { model: function (value) {
if (this.multiple) { if (this.multiple) {
this.real_model = value; this.real_model = value;
} else { } else {
this.real_model = value.toString(); this.real_model = value;
} }
} }
}, },

View File

@ -229,11 +229,27 @@ export default class Form {
submit() { submit() {
this.loading = true; this.loading = true;
axios({
method: this.method,
url: this.action,
data: this.data()
})
.then(this.onSuccess.bind(this))
.catch(this.onFail.bind(this));
}
submitTest() {
this.loading = true;
let data = this.data(); let data = this.data();
let form_data = new FormData(); let form_data = new FormData();
for (let key in data) { for (let key in data) {
form_data.append(key, data[key]); if ((typeof data[key] != 'object') && (typeof data[key] != 'array') ) {
form_data.append(key, data[key]);
} else {
form_data.append(key, JSON.stringify(data[key]));
}
} }
axios({ axios({

View File

@ -297,6 +297,8 @@ const app = new Vue({
this.form.discount = discount; this.form.discount = discount;
this.discount = false; this.discount = false;
this.onCalculateTotal();
}, },
onPayment() { onPayment() {

View File

@ -298,6 +298,8 @@ const app = new Vue({
this.form.discount = discount; this.form.discount = discount;
this.discount = false; this.discount = false;
this.onCalculateTotal();
}, },
onPayment() { onPayment() {

View File

@ -68,5 +68,3 @@
@import 'custom/components'; @import 'custom/components';
@import 'custom/utilities'; @import 'custom/utilities';
@import 'custom/vendors'; @import 'custom/vendors';