Order index #418
This commit is contained in:
parent
51e96d0bbf
commit
b4ecb82ce3
|
@ -11,11 +11,25 @@
|
||||||
"component": "ui-view",
|
"component": "ui-view",
|
||||||
"acl": ["developer"]
|
"acl": ["developer"]
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"url": "/index?q",
|
||||||
|
"state": "order.index",
|
||||||
|
"component": "vn-order-index"
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"url": "/:id",
|
"url": "/:id",
|
||||||
"state": "order.card",
|
"state": "order.card",
|
||||||
|
"abstract": true,
|
||||||
"component": "vn-order-card"
|
"component": "vn-order-card"
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
"url": "/summary",
|
||||||
|
"state": "order.card.summary",
|
||||||
|
"component": "vn-order-summary",
|
||||||
|
"params": {
|
||||||
|
"order": "$ctrl.order"
|
||||||
|
}
|
||||||
|
},
|
||||||
{
|
{
|
||||||
"url": "/create",
|
"url": "/create",
|
||||||
"state": "order.create",
|
"state": "order.create",
|
||||||
|
|
|
@ -1,5 +1,6 @@
|
||||||
export * from './module';
|
export * from './module';
|
||||||
|
|
||||||
import './descriptor';
|
import './descriptor';
|
||||||
import './index';
|
import './index/';
|
||||||
import './card';
|
import './card';
|
||||||
|
import './summary';
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
<vn-crud-model
|
||||||
|
vn-id="model"
|
||||||
|
url="/order/api/Orders"
|
||||||
|
filter="::$ctrl.filter"
|
||||||
|
limit="20"
|
||||||
|
data="orders">
|
||||||
|
</vn-crud-model>
|
||||||
|
<div margin-medium>
|
||||||
|
<vn-card margin-medium-v pad-medium>
|
||||||
|
<vn-table model="model">
|
||||||
|
<vn-thead>
|
||||||
|
<vn-tr>
|
||||||
|
<vn-th field="id">Id</vn-th>
|
||||||
|
<vn-th field="clientFk">Client</vn-th>
|
||||||
|
<vn-th field="companyFk">Company</vn-th>
|
||||||
|
<vn-th field="created" default-order="DESC">Created</vn-th>
|
||||||
|
</vn-tr>
|
||||||
|
</vn-thead>
|
||||||
|
<vn-tbody>
|
||||||
|
<vn-tr ng-repeat="order in orders" class="clickable"
|
||||||
|
ui-sref="order.card.summary({id: {{::order.id}}})">
|
||||||
|
<vn-td>{{::order.id}}</vn-td>
|
||||||
|
<vn-td>{{::order.clientFk}}</vn-td>
|
||||||
|
<vn-td>{{::order.companyFk}}</vn-td>
|
||||||
|
<vn-td>{{::order.created}}</vn-td>
|
||||||
|
</vn-tr>
|
||||||
|
</vn-tbody>
|
||||||
|
<vn-empty-rows ng-if="model.data.length === 0" translate>
|
||||||
|
No results
|
||||||
|
</vn-empty-rows>
|
||||||
|
</vn-table>
|
||||||
|
</vn-card>
|
||||||
|
<vn-pagination
|
||||||
|
model="model"
|
||||||
|
scroll-selector="ui-view">
|
||||||
|
</vn-pagination>
|
||||||
|
</div>
|
||||||
|
<!-- <a ui-sref="ticket.create" vn-bind="+" fixed-bottom-right>
|
||||||
|
<vn-float-button icon="add"></vn-float-button>
|
||||||
|
</a>
|
||||||
|
<vn-dialog class="dialog-summary"
|
||||||
|
vn-id="dialog-summary-ticket">
|
||||||
|
<tpl-body>
|
||||||
|
<vn-ticket-summary ticket="$ctrl.ticketSelected"></vn-ticket-summary>
|
||||||
|
</tpl-body>
|
||||||
|
</vn-dialog> -->
|
|
@ -0,0 +1,48 @@
|
||||||
|
import ngModule from '../module';
|
||||||
|
|
||||||
|
export default class Controller {
|
||||||
|
constructor($scope) {
|
||||||
|
this.$ = $scope;
|
||||||
|
this.ticketSelected = null;
|
||||||
|
|
||||||
|
this.filter = {
|
||||||
|
include: [
|
||||||
|
],
|
||||||
|
order: 'shipped DESC'
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
/* exprBuilder(param, value) {
|
||||||
|
switch (param) {
|
||||||
|
case 'search':
|
||||||
|
return /^\d+$/.test(value)
|
||||||
|
? {id: value}
|
||||||
|
: {nickname: {regexp: value}};
|
||||||
|
case 'from':
|
||||||
|
return {shipped: {gte: value}};
|
||||||
|
case 'to':
|
||||||
|
return {shipped: {lte: value}};
|
||||||
|
case 'nickname':
|
||||||
|
return {[param]: {regexp: value}};
|
||||||
|
case 'id':
|
||||||
|
case 'clientFk':
|
||||||
|
case 'agencyModeFk':
|
||||||
|
case 'warehouseFk':
|
||||||
|
return {[param]: value};
|
||||||
|
}
|
||||||
|
} */
|
||||||
|
|
||||||
|
preview(event, ticket) {
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopImmediatePropagation();
|
||||||
|
this.$.dialogSummaryTicket.show();
|
||||||
|
this.ticketSelected = ticket;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Controller.$inject = ['$scope'];
|
||||||
|
|
||||||
|
ngModule.component('vnOrderIndex', {
|
||||||
|
template: require('./index.html'),
|
||||||
|
controller: Controller
|
||||||
|
});
|
|
@ -0,0 +1,9 @@
|
||||||
|
<vn-vertical vn-one>
|
||||||
|
<vn-card class="summary" pad-medium>
|
||||||
|
<vn-vertical margin-medium>
|
||||||
|
<vn-auto>
|
||||||
|
<h5 text-center pad-small-v class="title">Order</h5>
|
||||||
|
</vn-auto>
|
||||||
|
</vn-vertical>
|
||||||
|
</vn-card>
|
||||||
|
</vn-vertical>
|
|
@ -0,0 +1,17 @@
|
||||||
|
import ngModule from '../module';
|
||||||
|
|
||||||
|
class Controller {
|
||||||
|
constructor($http) {
|
||||||
|
this.$http = $http;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Controller.$inject = ['$http'];
|
||||||
|
|
||||||
|
ngModule.component('vnOrderSummary', {
|
||||||
|
template: require('./index.html'),
|
||||||
|
controller: Controller,
|
||||||
|
bindings: {
|
||||||
|
order: '<'
|
||||||
|
}
|
||||||
|
});
|
Loading…
Reference in New Issue