Reports create page get dynamic field and save.

This commit is contained in:
Cüneyt Şentürk
2020-01-18 19:24:29 +03:00
parent 336e581ab7
commit 7efc4cf7b9
22 changed files with 192 additions and 128 deletions

View File

@ -28,28 +28,54 @@ const app = new Vue({
data: function () {
return {
form: new Form('report'),
bulk_action: new BulkAction('reports')
bulk_action: new BulkAction('reports'),
report_fields: '',
}
},
methods: {
onChangeClass(class_name) {
axios.get(url + '/common/reports/groups', {
axios.get(url + '/common/reports/fields', {
params: {
class: class_name
}
})
.then(response => {
let options = response.data.data;
let form = this.form;
let html = response.data.html;
this.$children.forEach(select => {
if (select.name == 'group') {
select.selectOptions = options;
}
this.report_fields = Vue.component('add-new-component', (resolve, reject) => {
resolve({
template : '<div id="report-fields" class="row col-md-12">' + html + '</div>',
mixins: [
Global
],
created: function() {
this.form = form;
},
data: function () {
return {
form: {},
}
},
watch: {
form: function (form) {
this.$emit("change", form);
}
},
})
});
})
.catch(error => {
});
},
onChangeReportFields(event) {
this.form = event;
}
}
});