order client descriptor #609
This commit is contained in:
parent
660310693f
commit
cee940f4fa
|
@ -21,7 +21,6 @@
|
||||||
<vn-thead>
|
<vn-thead>
|
||||||
<vn-tr>
|
<vn-tr>
|
||||||
<vn-th field="id" number>Id</vn-th>
|
<vn-th field="id" number>Id</vn-th>
|
||||||
<vn-th field="clientFk" number>Client Id</vn-th>
|
|
||||||
<vn-th field="clientFk">Client</vn-th>
|
<vn-th field="clientFk">Client</vn-th>
|
||||||
<vn-th field="created">Created</vn-th>
|
<vn-th field="created">Created</vn-th>
|
||||||
<vn-th field="workerFk">Worker</vn-th>
|
<vn-th field="workerFk">Worker</vn-th>
|
||||||
|
@ -32,8 +31,11 @@
|
||||||
<vn-tbody>
|
<vn-tbody>
|
||||||
<vn-tr ng-repeat="claim in claims" ui-sref="claim.card.summary({id: claim.id})" class=clickable>
|
<vn-tr ng-repeat="claim in claims" ui-sref="claim.card.summary({id: claim.id})" class=clickable>
|
||||||
<vn-td number>{{::claim.id}}</vn-td>
|
<vn-td number>{{::claim.id}}</vn-td>
|
||||||
<vn-td number><span class="link" ng-click="$ctrl.showDescriptor($event, claim.client.id)">{{::claim.client.id}}</span></vn-td>
|
<vn-td>
|
||||||
<vn-td>{{::claim.client.name}}</vn-td>
|
<span class="link" ng-click="$ctrl.showDescriptor($event, claim.client.id)">
|
||||||
|
{{::claim.client.name}}
|
||||||
|
</span>
|
||||||
|
</vn-td>
|
||||||
<vn-td>{{::claim.created | date:'dd/MM/yyyy'}}</vn-td>
|
<vn-td>{{::claim.created | date:'dd/MM/yyyy'}}</vn-td>
|
||||||
<vn-td>{{::claim.worker.firstName}} {{::claim.worker.name}}</vn-td>
|
<vn-td>{{::claim.worker.firstName}} {{::claim.worker.name}}</vn-td>
|
||||||
<vn-td>{{::claim.claimState.description}}</vn-td>
|
<vn-td>{{::claim.claimState.description}}</vn-td>
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
<vn-crud-model
|
<vn-crud-model
|
||||||
vn-id="model"
|
vn-id="model"
|
||||||
url="/order/api/Orders"
|
url="/order/api/Orders"
|
||||||
filter="{}"
|
filter="::$ctrl.filter"
|
||||||
limit="20"
|
limit="20"
|
||||||
data="orders">
|
data="orders">
|
||||||
</vn-crud-model>
|
</vn-crud-model>
|
||||||
|
@ -10,18 +10,22 @@
|
||||||
<vn-table model="model">
|
<vn-table model="model">
|
||||||
<vn-thead>
|
<vn-thead>
|
||||||
<vn-tr>
|
<vn-tr>
|
||||||
<vn-th field="id">Id</vn-th>
|
<vn-th field="id" default-order="DESC">Id</vn-th>
|
||||||
<vn-th field="clientFk">Client</vn-th>
|
<vn-th field="clientFk">Client</vn-th>
|
||||||
<vn-th field="companyFk">Company</vn-th>
|
<vn-th field="companyFk">Company</vn-th>
|
||||||
<vn-th field="created" default-order="DESC">Created</vn-th>
|
<vn-th field="created">Created</vn-th>
|
||||||
</vn-tr>
|
</vn-tr>
|
||||||
</vn-thead>
|
</vn-thead>
|
||||||
<vn-tbody>
|
<vn-tbody>
|
||||||
<vn-tr ng-repeat="order in orders" class="clickable"
|
<vn-tr ng-repeat="order in orders" class="clickable"
|
||||||
ui-sref="order.card.catalog({id: {{::order.id}}})">
|
ui-sref="order.card.catalog({id: {{::order.id}}})">
|
||||||
<vn-td>{{::order.id}}</vn-td>
|
<vn-td>{{::order.id}}</vn-td>
|
||||||
<vn-td>{{::order.clientFk}}</vn-td>
|
<vn-td>
|
||||||
<vn-td>{{::order.companyFk}}</vn-td>
|
<span class="link" ng-click="$ctrl.showDescriptor($event, order.clientFk)">
|
||||||
|
{{::order.client.name}}
|
||||||
|
</span>
|
||||||
|
</vn-td>
|
||||||
|
<vn-td>{{::order.company.code}}</vn-td>
|
||||||
<vn-td>{{::order.created | date:'dd/MM/yyyy'}}</vn-td>
|
<vn-td>{{::order.created | date:'dd/MM/yyyy'}}</vn-td>
|
||||||
</vn-tr>
|
</vn-tr>
|
||||||
</vn-tbody>
|
</vn-tbody>
|
||||||
|
@ -38,10 +42,4 @@
|
||||||
<a ui-sref="order.create" vn-bind="+" vn-tooltip="New order" fixed-bottom-right>
|
<a ui-sref="order.create" vn-bind="+" vn-tooltip="New order" fixed-bottom-right>
|
||||||
<vn-float-button icon="add"></vn-float-button>
|
<vn-float-button icon="add"></vn-float-button>
|
||||||
</a>
|
</a>
|
||||||
<!--
|
<vn-client-descriptor-popover vn-id="descriptor"></vn-client-descriptor-popover>
|
||||||
<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> -->
|
|
|
@ -2,8 +2,20 @@ import ngModule from '../module';
|
||||||
|
|
||||||
export default class Controller {
|
export default class Controller {
|
||||||
constructor($scope) {
|
constructor($scope) {
|
||||||
this.$ = $scope;
|
this.$scope = $scope;
|
||||||
this.ticketSelected = null;
|
this.ticketSelected = null;
|
||||||
|
this.filter = {
|
||||||
|
include: [
|
||||||
|
{
|
||||||
|
relation: 'client',
|
||||||
|
fields: ['name']
|
||||||
|
},
|
||||||
|
{
|
||||||
|
relation: 'company',
|
||||||
|
fields: ['code']
|
||||||
|
}
|
||||||
|
]
|
||||||
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
/* exprBuilder(param, value) {
|
/* exprBuilder(param, value) {
|
||||||
|
@ -26,10 +38,22 @@ export default class Controller {
|
||||||
}
|
}
|
||||||
} */
|
} */
|
||||||
|
|
||||||
|
showDescriptor(event, clientFk) {
|
||||||
|
this.$scope.descriptor.clientFk = clientFk;
|
||||||
|
this.$scope.descriptor.parent = event.target;
|
||||||
|
this.$scope.descriptor.show();
|
||||||
|
event.preventDefault();
|
||||||
|
event.stopImmediatePropagation();
|
||||||
|
}
|
||||||
|
|
||||||
|
onDescriptorLoad() {
|
||||||
|
this.$scope.popover.relocate();
|
||||||
|
}
|
||||||
|
|
||||||
preview(event, ticket) {
|
preview(event, ticket) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
||||||
event.stopImmediatePropagation();
|
event.stopImmediatePropagation();
|
||||||
this.$.dialogSummaryTicket.show();
|
this.$scope.dialogSummaryTicket.show();
|
||||||
this.ticketSelected = ticket;
|
this.ticketSelected = ticket;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -90,6 +90,11 @@
|
||||||
"type": "hasMany",
|
"type": "hasMany",
|
||||||
"model": "OrderRow",
|
"model": "OrderRow",
|
||||||
"foreignKey": "orderFk"
|
"foreignKey": "orderFk"
|
||||||
|
},
|
||||||
|
"company": {
|
||||||
|
"type": "belongsTo",
|
||||||
|
"model": "Company",
|
||||||
|
"foreignKey": "company_id"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue