Editor - Orders - Order list
In this view all existing orders are loaded, as there are many of them, it is recommended that they are listed and paged. It is also recommended that you add filters with angular to be able to search for orders with specific data. the variable with contains all these orders is filtered this already has a special function for filtering that will then be more detailed.
Utility Functions
filterByStatus(status)
: This function causes orders (filtered) to be filtered by grouped states
pending:
Orders with status 0.completed
: Orders with status 1 y 11.inProgress
: Orders with status 7, 8 y 9canceled
: Orders with status 2, 5, 6, 10 y 12.
applyFilters()
: This function makes filtered this filtering depending on the search model and its different attributes used to filter by several parameters.
search.id
: Field to filter order by idsearch.state
: Field to filter order by statussearch.business
: Field to filter depending on what business the order is.search.cphone
: Field to filter by a customer's phone numbersearch.email
: Field to filter by the customer's emailsearch.date.from
: Lower bound to filter orders by date, that is, from which datesearch.date.to
: Upper bound to filter by date, that is, until date.search.city
: Field used to filter orders by city
calcTotal()
: Calculate the total of all filtered orders taking into account everything.openDetails(order)
: this function is used to open theorder_details
modal with all
Example of base theme
- The tab for filter by status. the action works with click which run the function
filterByStatus(status)
and the selected tab style works with curTab. - The filters section includes all the possible filters in search model and adding a action for every change in each field with the function
applyFilters()
. - In this select are listed the business of the orders made, to list is used the following sentece data-
ng-repeat="state in status"
and the value select forsearch.state
isstate.id
- In this select are listed the cities of the orders made, to list is used the following sentence
data-ng-repeat="city in cities"
and the value selected forsearch.city
iscity.id
- In this select are listed the possible statuses for the current tab, to list is used the following sentence
data-ng-repeat="state in status"
and the value selected forsearch.state
isstate.id
- Section in which the orders with ng-repeat are listed using the argument
"order in filtered"
(All orders works with pagination). Clicking in one order will active the funcitionopenDetails(order)
with ng-click - This one is an utility to show the total of an order with the function
calcTotalOrder(order)
. - This show the total of all orders filters in the tab by using filterTotal
- Seccion used for pagination
Updated almost 6 years ago