diff --git a/resources/assets/js/components/AkauntingSearch.vue b/resources/assets/js/components/AkauntingSearch.vue index fdbd0efe5..8b115990e 100644 --- a/resources/assets/js/components/AkauntingSearch.vue +++ b/resources/assets/js/components/AkauntingSearch.vue @@ -304,7 +304,7 @@ export default { onInput(evt) { this.search = evt.target.value; - let option_url = this.selected_options.length > 0 ? this.selected_options[this.filter_index].url : ''; + let option_url = this.selected_options.length > 0 && this.selected_options[this.filter_index] !== undefined ? this.selected_options[this.filter_index].url : ''; if (this.search) { if (option_url.indexOf('?') === -1) { diff --git a/resources/assets/js/components/AkauntingSelect.vue b/resources/assets/js/components/AkauntingSelect.vue index d78450d4d..cf9482775 100644 --- a/resources/assets/js/components/AkauntingSelect.vue +++ b/resources/assets/js/components/AkauntingSelect.vue @@ -362,7 +362,7 @@ export default { mounted() { // Check Here.. this.selected = this.value; - + if (this.model.length) { try { if (eval(this.model) !== undefined) { @@ -939,29 +939,30 @@ export default { }, value: function (selected) { - if (!this.multiple) { - this.selected = selected.toString(); - } else { - if (Array.isArray(this.selected) && !this.selected.length) { - this.selected = selected; - } else { - let is_string = false; - let pre_value = []; + // we tested this function works with post a form and after the selected function so put in the comment line + // if (!this.multiple) { + // this.selected = selected.toString(); + // } else { + // if (Array.isArray(this.selected) && !this.selected.length) { + // this.selected = selected; + // } else { + // let is_string = false; + // let pre_value = []; - selected.forEach(item => { - if (typeof item != 'string') { - is_string = true; - pre_value.push(item.toString()); - } - }); + // selected.forEach(item => { + // if (typeof item != 'string') { + // is_string = true; + // pre_value.push(item.toString()); + // } + // }); - if (is_string) { - this.selected = pre_value; - } - } - } + // if (is_string) { + // this.selected = pre_value; + // } + // } + // } - this.change(); + // this.change(); }, model: function (selected) { diff --git a/resources/assets/js/components/AkauntingSelectRemote.vue b/resources/assets/js/components/AkauntingSelectRemote.vue index 581d3fd96..3e43c045d 100644 --- a/resources/assets/js/components/AkauntingSelectRemote.vue +++ b/resources/assets/js/components/AkauntingSelectRemote.vue @@ -1147,29 +1147,30 @@ export default { }, value: function (selected) { - if (!this.multiple) { - this.selected = selected.toString(); - } else { - if (Array.isArray(this.selected) && !this.selected.length) { - this.selected = selected; - } else { - let is_string = false; - let pre_value = []; + // we tested this function works with post a form and after the selected function so put in the comment line + // if (!this.multiple) { + // this.selected = selected.toString(); + // } else { + // if (Array.isArray(this.selected) && !this.selected.length) { + // this.selected = selected; + // } else { + // let is_string = false; + // let pre_value = []; - selected.forEach(item => { - if (typeof item != 'string') { - is_string = true; - pre_value.push(item.toString()); - } - }); + // selected.forEach(item => { + // if (typeof item != 'string') { + // is_string = true; + // pre_value.push(item.toString()); + // } + // }); - if (is_string) { - this.selected = pre_value; - } - } - } + // if (is_string) { + // this.selected = pre_value; + // } + // } + // } - this.change(); + // this.change(); }, model: function (selected) {