diff --git a/resources/assets/js/components/AkauntingSelect.vue b/resources/assets/js/components/AkauntingSelect.vue index 92d4d09c7..0f713f714 100644 --- a/resources/assets/js/components/AkauntingSelect.vue +++ b/resources/assets/js/components/AkauntingSelect.vue @@ -381,7 +381,7 @@ {{ new_text }} diff --git a/resources/assets/js/components/AkauntingSelectRemote.vue b/resources/assets/js/components/AkauntingSelectRemote.vue index 7d66a1765..61b21d504 100644 --- a/resources/assets/js/components/AkauntingSelectRemote.vue +++ b/resources/assets/js/components/AkauntingSelectRemote.vue @@ -305,8 +305,8 @@ - + {{ new_text }} @@ -370,8 +370,8 @@ :key="option.id" :label="option.name" :value="option.id"> - {{ label }} - {{ new_text }}{{ option.name }} + {{ new_text }} { if (response.data.success) { + this.selectOptions[response.data.data.id] = response.data.data['name']; + this.new_options[response.data.data.id] = response.data.data['name']; + this.real_model = response.data.data.id; + /* this.selectOptions = []; this.selectOptions.push(response.data.data); this.new_options[response.data.data.id] = response.data.data.id; this.real_model = response.data.data.id; - + */ this.change(); if (this.title) { @@ -788,7 +792,7 @@ export default { if (response.data.success) { this.selectOptions[response.data.data.id] = response.data.data['name']; this.new_options[response.data.data.id] = response.data.data['name']; - this.real_model = response.data.data.id.toString(); + this.real_model = response.data.data.id; this.change(); @@ -821,7 +825,15 @@ export default { watch: { options: function (options) { // update options - //this.selectOptions = options; + this.selectOptions = options; + + if (Object.keys(this.new_options).length) { + for (let [key, value] of Object.entries(this.new_options)) { + if (!this.selectOptions[key]) { + this.selectOptions[key] = value; + } + } + } }, value: function (value) { diff --git a/resources/views/sales/invoices/item.blade.php b/resources/views/sales/invoices/item.blade.php index 8a25cb83b..a282d879d 100644 --- a/resources/views/sales/invoices/item.blade.php +++ b/resources/views/sales/invoices/item.blade.php @@ -30,6 +30,7 @@ 'path' => route('modals.items.store'), 'type' => 'inline', 'field' => 'name', + 'new_text' => trans('modules.new'), ])}}" @interface="row.item_id = $event" @label="row.name = $event"