Monitor smart-table ammends

This commit is contained in:
Joan Sanchez 2021-11-15 08:45:21 +01:00
parent b83f0fb52f
commit e62e57bcde
5 changed files with 53 additions and 54 deletions

View File

@ -7,7 +7,7 @@
ng-click="smartTableColumns.show($event)" ng-click="smartTableColumns.show($event)"
vn-tooltip="Shown columns"> vn-tooltip="Shown columns">
</vn-button> </vn-button>
<div ng-transclude="actions"></div> <!-- transcluded actions --> <div ng-transclude="actions"></div>
</div> </div>
<div class="actions-right"> <div class="actions-right">
<div class="totalRows" ng-if="$ctrl.model.data"> <div class="totalRows" ng-if="$ctrl.model.data">

View File

@ -33,7 +33,7 @@
check-field="$checked"> <!-- Change $checked as default prop --> check-field="$checked"> <!-- Change $checked as default prop -->
</vn-multi-check> </vn-multi-check>
</th> </th>
<th>Picture</th> <th translate>Picture</th>
<th field="id"> <th field="id">
<span translate>Identifier</span> <span translate>Identifier</span>
</th> </th>

View File

@ -9,5 +9,6 @@ Minimize/Maximize: Minimizar/Maximizar
Problems: Problemas Problems: Problemas
Theoretical: Teórica Theoretical: Teórica
Practical: Práctica Practical: Práctica
Preparation: Preparación
Auto-refresh: Auto-refresco Auto-refresh: Auto-refresco
Toggle auto-refresh every 2 minutes: Conmuta el refresco automático cada 2 minutos Toggle auto-refresh every 2 minutes: Conmuta el refresco automático cada 2 minutos

View File

@ -20,18 +20,6 @@
<vn-one translate> <vn-one translate>
Tickets monitor Tickets monitor
</vn-one> </vn-one>
<vn-none>
<vn-check
label="Auto-refresh"
vn-tooltip="Toggle auto-refresh every 2 minutes"
on-change="$ctrl.autoRefresh(value)">
</vn-check>
<vn-icon
icon="refresh"
vn-tooltip="Refresh"
ng-click="model.refresh()">
</vn-icon>
</vn-none>
</vn-horizontal> </vn-horizontal>
<vn-card> <vn-card>
<smart-table <smart-table
@ -39,6 +27,11 @@
view-config-id="ticketsMonitor" view-config-id="ticketsMonitor"
options="$ctrl.smartTableOptions" options="$ctrl.smartTableOptions"
expr-builder="$ctrl.exprBuilder(param, value)"> expr-builder="$ctrl.exprBuilder(param, value)">
<slot-actions><vn-check
label="Auto-refresh"
vn-tooltip="Toggle auto-refresh every 2 minutes"
on-change="$ctrl.autoRefresh(value)">
</vn-check></slot-actions>
<slot-table> <slot-table>
<table> <table>
<thead> <thead>
@ -58,15 +51,15 @@
<th field="shipped" shrink-date> <th field="shipped" shrink-date>
<span translate>Date</span> <span translate>Date</span>
</th> </th>
<th field="preparationHour" filter-enabled="false">
<span translate>Preparation</span>
</th>
<th field="theoreticalHour"> <th field="theoreticalHour">
<span translate>Theoretical</span> <span translate>Theoretical</span>
</th> </th>
<th field="practicalHour"> <th field="practicalHour">
<span translate>Practical</span> <span translate>Practical</span>
</th> </th>
<th field="preparationHour" filter-enabled="false">
<span translate>Preparation</span>
</th>
<th field="provinceFk"> <th field="provinceFk">
<span translate>Province</span> <span translate>Province</span>
</th> </th>
@ -156,9 +149,9 @@
{{::ticket.shipped | date: 'dd/MM/yyyy'}} {{::ticket.shipped | date: 'dd/MM/yyyy'}}
</span> </span>
</td> </td>
<td centered>{{::ticket.shipped | date: 'HH:mm'}}</td> <td>{{::ticket.zoneLanding | date: 'HH:mm'}}</td>
<td centered>{{::ticket.zoneLanding | date: 'HH:mm'}}</td> <td>{{::ticket.practicalHour | date: 'HH:mm'}}</td>
<td centered>{{::ticket.practicalHour | date: 'HH:mm'}}</td> <td>{{::ticket.shipped | date: 'HH:mm'}}</td>
<td>{{::ticket.province}}</td> <td>{{::ticket.province}}</td>
<td> <td>
<span <span
@ -224,7 +217,7 @@
model="model"> model="model">
</vn-ticket-summary> </vn-ticket-summary>
</vn-popup> </vn-popup>
<vn-contextmenu vn-id="contextmenu" targets="['vn-monitor-sales-tickets smart-tablea']" model="model" <vn-contextmenu vn-id="contextmenu" targets="['vn-monitor-sales-tickets smart-table']" model="model"
expr-builder="$ctrl.exprBuilder(param, value)"> expr-builder="$ctrl.exprBuilder(param, value)">
<slot-menu> <slot-menu>
<vn-item translate <vn-item translate

View File

@ -14,52 +14,55 @@ export default class Controller extends Section {
}, },
columns: [ columns: [
{ {
field: 'category', field: 'totalProblems',
autocomplete: { searchable: false
url: 'ItemCategories',
valueField: 'name',
}
}, },
{ {
field: 'origin', field: 'salesPersonFk',
autocomplete: { autocomplete: {
url: 'Origins', url: 'Workers/activeWithInheritedRole',
showField: 'code', where: `{role: 'salesPerson'}`,
valueField: 'code'
}
},
{
field: 'typeFk',
autocomplete: {
url: 'ItemTypes',
}
},
{
field: 'intrastat',
autocomplete: {
url: 'Intrastats',
showField: 'description',
valueField: 'description'
}
},
{
field: 'buyerFk',
autocomplete: {
url: 'Workers/activeWithRole',
where: `{role: {inq: ['logistic', 'buyer']}}`,
searchFunction: '{firstName: $search}', searchFunction: '{firstName: $search}',
showField: 'nickname', showField: 'nickname',
valueField: 'id', valueField: 'id',
} }
}, },
{ {
field: 'active', field: 'provinceFk',
autocomplete: {
url: 'Provinces',
}
},
{
field: 'stateFk',
autocomplete: {
url: 'States',
}
},
{
field: 'zoneFk',
autocomplete: {
url: 'Zones',
}
},
{
field: 'warehouseFk',
autocomplete: {
url: 'Warehouses',
}
},
{
field: 'shipped',
searchable: false searchable: false
}, },
{ {
field: 'landed', field: 'theoreticalHour',
searchable: false searchable: false
}, },
{
field: 'preparationHour',
searchable: false
}
] ]
}; };
} }
@ -148,8 +151,10 @@ export default class Controller extends Section {
return {'t.shipped': { return {'t.shipped': {
between: this.dateRange(value)} between: this.dateRange(value)}
}; };
case 'zoneFk':
case 'nickname': case 'nickname':
return {[`t.nickname`]: {like: `%${value}%`}};
case 'zoneFk':
case 'totalWithVat':
return {[`t.${param}`]: value}; return {[`t.${param}`]: value};
} }
} }