From f0a9c18ccbcad06e868f62d83ea8d09bd67a654b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=BCneyt=20=C5=9Eent=C3=BCrk?= Date: Mon, 20 Jan 2020 17:48:46 +0300 Subject: [PATCH] refs #1147 Invoice item selectbox style. --- app/Http/Controllers/Common/Items.php | 8 +- app/Providers/Form.php | 8 +- .../js/components/AkauntingSelectRemote.vue | 680 ++++++++++++++++++ resources/assets/js/mixins/global.js | 2 + resources/lang/en-GB/general.php | 1 + .../views/partials/form/alias_group.blade.php | 30 - .../partials/form/select_group.blade.php | 23 +- .../form/select_remote_group.blade.php | 45 ++ resources/views/sales/invoices/item.blade.php | 40 +- 9 files changed, 793 insertions(+), 44 deletions(-) create mode 100644 resources/assets/js/components/AkauntingSelectRemote.vue delete mode 100644 resources/views/partials/form/alias_group.blade.php create mode 100644 resources/views/partials/form/select_remote_group.blade.php diff --git a/app/Http/Controllers/Common/Items.php b/app/Http/Controllers/Common/Items.php index 66636856f..cfc211a73 100644 --- a/app/Http/Controllers/Common/Items.php +++ b/app/Http/Controllers/Common/Items.php @@ -278,7 +278,13 @@ class Items extends Controller } } - return response()->json($items); + return response()->json([ + 'success' => true, + 'message' => 'Get all items.', + 'errors' => [], + 'count' => $items->count(), + 'data' => ($items->count()) ? $items : null, + ]); } public function total(TotalRequest $request) diff --git a/app/Providers/Form.php b/app/Providers/Form.php index 829ee6a44..75dd3b827 100644 --- a/app/Providers/Form.php +++ b/app/Providers/Form.php @@ -15,10 +15,6 @@ class Form extends Provider public function boot() { // Form components - Facade::component('aliasGroup', 'partials.form.alias_group', [ - 'original', 'name', 'text', 'icon', 'attributes' => ['required' => 'required'], 'value' => null, 'col' => 'col-md-6', 'group_class' => null - ]); - Facade::component('moneyGroup', 'partials.form.money_group', [ 'name', 'text', 'icon', 'attributes' => ['required' => 'required'], 'value' => null, 'col' => 'col-md-6', 'group_class' => null ]); @@ -67,6 +63,10 @@ class Form extends Provider 'name', 'text', 'icon', 'values', 'selected' => null, 'attributes' => ['required' => 'required'], 'col' => 'col-md-6', 'group_class' => null ]); + Facade::component('selectRemoteGroup', 'partials.form.select_remote_group', [ + 'name', 'text', 'icon', 'values', 'selected' => null, 'attributes' => ['required' => 'required'], 'col' => 'col-md-6', 'group_class' => null + ]); + Facade::component('textareaGroup', 'partials.form.textarea_group', [ 'name', 'text', 'icon', 'value' => null, 'attributes' => ['rows' => '3'], 'col' => 'col-md-12', 'group_class' => null ]); diff --git a/resources/assets/js/components/AkauntingSelectRemote.vue b/resources/assets/js/components/AkauntingSelectRemote.vue new file mode 100644 index 000000000..65cd977ac --- /dev/null +++ b/resources/assets/js/components/AkauntingSelectRemote.vue @@ -0,0 +1,680 @@ + + + + + diff --git a/resources/assets/js/mixins/global.js b/resources/assets/js/mixins/global.js index d5f6ee34b..034a242bf 100644 --- a/resources/assets/js/mixins/global.js +++ b/resources/assets/js/mixins/global.js @@ -4,6 +4,7 @@ import AkauntingSearch from './../components/AkauntingSearch'; import AkauntingModal from './../components/AkauntingModal'; import AkauntingRadioGroup from './../components/forms/AkauntingRadioGroup'; import AkauntingSelect from './../components/AkauntingSelect'; +import AkauntingSelectRemote from './../components/AkauntingSelectRemote'; import AkauntingDate from './../components/AkauntingDate'; import AkauntingRecurring from './../components/AkauntingRecurring'; @@ -19,6 +20,7 @@ export default { AkauntingSearch, AkauntingRadioGroup, AkauntingSelect, + AkauntingSelectRemote, AkauntingModal, AkauntingDate, AkauntingRecurring, diff --git a/resources/lang/en-GB/general.php b/resources/lang/en-GB/general.php index 5de97ce66..b2aaa8885 100644 --- a/resources/lang/en-GB/general.php +++ b/resources/lang/en-GB/general.php @@ -149,6 +149,7 @@ return [ 'month' => 'Month', 'year' => 'Year', + 'type_item_name' => 'Type an item name', 'no_data' => 'No data', 'no_matching_data' => 'No matching data', diff --git a/resources/views/partials/form/alias_group.blade.php b/resources/views/partials/form/alias_group.blade.php deleted file mode 100644 index d3235d7c6..000000000 --- a/resources/views/partials/form/alias_group.blade.php +++ /dev/null @@ -1,30 +0,0 @@ -@stack($name . '_input_start') - -
- {!! Form::label($name, $text, ['class' => 'form-control-label'])!!} - -
-
- - - -
- - - {!! Form::text($name, $value, array_merge([ - 'class' => 'form-control', - "slot-scope" => "{inputBidding}", - "v-bind" => "inputBidding" - ], $attributes)) !!} - -
- -
-
-
- -@stack($name . '_input_end') diff --git a/resources/views/partials/form/select_group.blade.php b/resources/views/partials/form/select_group.blade.php index 5d29ba994..e06c7fbd0 100644 --- a/resources/views/partials/form/select_group.blade.php +++ b/resources/views/partials/form/select_group.blade.php @@ -2,25 +2,42 @@ diff --git a/resources/views/partials/form/select_remote_group.blade.php b/resources/views/partials/form/select_remote_group.blade.php new file mode 100644 index 000000000..8e5032538 --- /dev/null +++ b/resources/views/partials/form/select_remote_group.blade.php @@ -0,0 +1,45 @@ +@stack($name . '_input_start') + + + +@stack($name . '_input_end') diff --git a/resources/views/sales/invoices/item.blade.php b/resources/views/sales/invoices/item.blade.php index 5158cc446..e92a9d67c 100644 --- a/resources/views/sales/invoices/item.blade.php +++ b/resources/views/sales/invoices/item.blade.php @@ -16,15 +16,43 @@ @stack('name_td_start') @stack('name_input_start') - + - {!! $errors->first('item.name', '

:message

') !!} + name="item[][name]"> + {!! $errors->first('item.name', '

:message

') !!} @stack('name_input_end') @stack('name_td_end')