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)"
vn-tooltip="Shown columns">
</vn-button>
<div ng-transclude="actions"></div> <!-- transcluded actions -->
<div ng-transclude="actions"></div>
</div>
<div class="actions-right">
<div class="totalRows" ng-if="$ctrl.model.data">

View File

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

View File

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

View File

@ -20,18 +20,6 @@
<vn-one translate>
Tickets monitor
</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-card>
<smart-table
@ -39,6 +27,11 @@
view-config-id="ticketsMonitor"
options="$ctrl.smartTableOptions"
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>
<table>
<thead>
@ -58,15 +51,15 @@
<th field="shipped" shrink-date>
<span translate>Date</span>
</th>
<th field="preparationHour" filter-enabled="false">
<span translate>Preparation</span>
</th>
<th field="theoreticalHour">
<span translate>Theoretical</span>
</th>
<th field="practicalHour">
<span translate>Practical</span>
</th>
<th field="preparationHour" filter-enabled="false">
<span translate>Preparation</span>
</th>
<th field="provinceFk">
<span translate>Province</span>
</th>
@ -156,9 +149,9 @@
{{::ticket.shipped | date: 'dd/MM/yyyy'}}
</span>
</td>
<td centered>{{::ticket.shipped | date: 'HH:mm'}}</td>
<td centered>{{::ticket.zoneLanding | date: 'HH:mm'}}</td>
<td centered>{{::ticket.practicalHour | date: 'HH:mm'}}</td>
<td>{{::ticket.zoneLanding | date: 'HH:mm'}}</td>
<td>{{::ticket.practicalHour | date: 'HH:mm'}}</td>
<td>{{::ticket.shipped | date: 'HH:mm'}}</td>
<td>{{::ticket.province}}</td>
<td>
<span
@ -224,7 +217,7 @@
model="model">
</vn-ticket-summary>
</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)">
<slot-menu>
<vn-item translate

View File

@ -14,52 +14,55 @@ export default class Controller extends Section {
},
columns: [
{
field: 'category',
autocomplete: {
url: 'ItemCategories',
valueField: 'name',
}
field: 'totalProblems',
searchable: false
},
{
field: 'origin',
field: 'salesPersonFk',
autocomplete: {
url: 'Origins',
showField: 'code',
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']}}`,
url: 'Workers/activeWithInheritedRole',
where: `{role: 'salesPerson'}`,
searchFunction: '{firstName: $search}',
showField: 'nickname',
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
},
{
field: 'landed',
field: 'theoreticalHour',
searchable: false
},
{
field: 'preparationHour',
searchable: false
}
]
};
}
@ -148,8 +151,10 @@ export default class Controller extends Section {
return {'t.shipped': {
between: this.dateRange(value)}
};
case 'zoneFk':
case 'nickname':
return {[`t.nickname`]: {like: `%${value}%`}};
case 'zoneFk':
case 'totalWithVat':
return {[`t.${param}`]: value};
}
}