fixes #5174 Refactor ticket weekly to use smartTable #1275
|
@ -562,15 +562,15 @@ export default {
|
||||||
payoutBank: '.vn-dialog vn-autocomplete[ng-model="$ctrl.bankFk"]',
|
payoutBank: '.vn-dialog vn-autocomplete[ng-model="$ctrl.bankFk"]',
|
||||||
payoutDescription: 'vn-textfield[ng-model="$ctrl.receipt.description"]',
|
payoutDescription: 'vn-textfield[ng-model="$ctrl.receipt.description"]',
|
||||||
submitPayout: '.vn-dialog button[response="accept"]',
|
submitPayout: '.vn-dialog button[response="accept"]',
|
||||||
searchWeeklyResult: 'vn-ticket-weekly-index vn-table vn-tbody > vn-tr',
|
searchWeeklyResult: 'vn-ticket-weekly-index vn-card smart-table slot-table table tbody tr',
|
||||||
searchResultDate: 'vn-ticket-summary [label=Landed] span',
|
searchResultDate: 'vn-ticket-summary [label=Landed] span',
|
||||||
topbarSearch: 'vn-searchbar',
|
topbarSearch: 'vn-searchbar',
|
||||||
moreMenu: 'vn-ticket-index vn-icon-button[icon=more_vert]',
|
moreMenu: 'vn-ticket-index vn-icon-button[icon=more_vert]',
|
||||||
fourthWeeklyTicket: 'vn-ticket-weekly-index vn-table vn-tbody vn-tr:nth-child(4)',
|
fourthWeeklyTicket: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(4)',
|
||||||
fiveWeeklyTicket: 'vn-ticket-weekly-index vn-table vn-tbody vn-tr:nth-child(5)',
|
fiveWeeklyTicket: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(5)',
|
||||||
weeklyTicket: 'vn-ticket-weekly-index vn-table > div > vn-tbody > vn-tr',
|
weeklyTicket: 'vn-ticket-weekly-index vn-card smart-table slot-table table tbody tr',
|
||||||
firstWeeklyTicketDeleteIcon: 'vn-ticket-weekly-index vn-tr:nth-child(1) vn-icon-button[icon="delete"]',
|
firstWeeklyTicketDeleteIcon: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(1) vn-icon-button[icon="delete"]',
|
||||||
firstWeeklyTicketAgency: 'vn-ticket-weekly-index vn-tr:nth-child(1) [ng-model="weekly.agencyModeFk"]',
|
firstWeeklyTicketAgency: 'vn-ticket-weekly-index vn-card smart-table slot-table tr:nth-child(1) [ng-model="weekly.agencyModeFk"]',
|
||||||
acceptDeleteTurn: '.vn-confirm.shown button[response="accept"]'
|
acceptDeleteTurn: '.vn-confirm.shown button[response="accept"]'
|
||||||
},
|
},
|
||||||
createTicketView: {
|
createTicketView: {
|
||||||
|
|
|
@ -17,43 +17,65 @@
|
||||||
model="model">
|
model="model">
|
||||||
</vn-searchbar>
|
</vn-searchbar>
|
||||||
</vn-portal>
|
</vn-portal>
|
||||||
<vn-data-viewer
|
|
||||||
model="model"
|
|
||||||
class="vn-w-xl">
|
|
||||||
<vn-card>
|
<vn-card>
|
||||||
<vn-table model="model">
|
<smart-table
|
||||||
<vn-thead>
|
model="model"
|
||||||
<vn-tr>
|
options="$ctrl.smartTableOptions"
|
||||||
<vn-th field="ticketFk" number>Ticket ID</vn-th>
|
view-config-id="ticketsMonitor"
|
||||||
<vn-th field="clientName">Client</vn-th>
|
expr-builder="$ctrl.exprBuilder(param, value)"
|
||||||
<vn-th>Shipment</vn-th>
|
>
|
||||||
<vn-th>Agency</vn-th>
|
<slot-actions>
|
||||||
<vn-th>Warehouse</vn-th>
|
<vn-check
|
||||||
<vn-th>Salesperson</vn-th>
|
label="Auto-refresh"
|
||||||
<vn-th shrink></vn-th>
|
vn-tooltip="Toggle auto-refresh every 2 minutes"
|
||||||
</vn-tr>
|
on-change="$ctrl.autoRefresh(value)">
|
||||||
</vn-thead>
|
</vn-check>
|
||||||
<vn-tbody>
|
</slot-actions>
|
||||||
<vn-tr
|
<slot-table>
|
||||||
|
<table>
|
||||||
|
<thead>
|
||||||
|
<tr>
|
||||||
|
<th field="ticketFk">
|
||||||
|
<span translate>Ticket ID</span>
|
||||||
|
</th>
|
||||||
|
<th field="clientName">
|
||||||
|
<span translate>Client</span>
|
||||||
|
</th>
|
||||||
|
<th field="weekDay">
|
||||||
|
<span translate>Shipment</span>
|
||||||
|
</th>
|
||||||
|
<th field="agencyModeFk">
|
||||||
|
<span translate>Agency</span>
|
||||||
|
</th>
|
||||||
|
<th field="warehouseFk">
|
||||||
|
<span translate>Warehouse</span>
|
||||||
|
</th>
|
||||||
|
<th field="nickName">
|
||||||
|
<span translate>Salesperson</span>
|
||||||
|
</th>
|
||||||
|
</tr>
|
||||||
|
</thead>
|
||||||
|
<tbody>
|
||||||
|
<tr
|
||||||
ng-repeat="weekly in weeklies"
|
ng-repeat="weekly in weeklies"
|
||||||
ui-sref="ticket.card.summary({id: {{::weekly.ticketFk}}})"
|
ui-sref="ticket.card.summary({id: {{::weekly.ticketFk}}})"
|
||||||
class="clickable">
|
class="clickable">
|
||||||
<vn-td number>
|
<td number>
|
||||||
<span
|
<span
|
||||||
vn-click-stop="ticketDescriptor.show($event, weekly.ticketFk)"
|
vn-click-stop="ticketDescriptor.show($event, weekly.ticketFk)"
|
||||||
class="link">
|
class="link">
|
||||||
{{weekly.ticketFk}}
|
{{weekly.ticketFk}}
|
||||||
</span>
|
</span>
|
||||||
</vn-td>
|
</td>
|
||||||
<vn-td>
|
<td>
|
||||||
<span
|
<span
|
||||||
vn-click-stop="clientDescriptor.show($event, weekly.clientFk)"
|
vn-click-stop="clientDescriptor.show($event, weekly.clientFk)"
|
||||||
title ="{{::weekly.clientName}}"
|
title ="{{::weekly.clientName}}"
|
||||||
class="link">
|
class="link">
|
||||||
{{::weekly.clientName}}
|
{{::weekly.clientName}}
|
||||||
</span>
|
</span>
|
||||||
</vn-td>
|
</td>
|
||||||
<vn-td vn-click-stop>
|
<td vn-click-stop>
|
||||||
<vn-autocomplete
|
<vn-autocomplete
|
||||||
vn-id="weekday"
|
vn-id="weekday"
|
||||||
ng-model="weekly.weekDay"
|
ng-model="weekly.weekDay"
|
||||||
|
@ -65,8 +87,8 @@
|
||||||
order="id"
|
order="id"
|
||||||
class="dense">
|
class="dense">
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
</vn-td>
|
</td>
|
||||||
<vn-td vn-click-stop>
|
<td vn-click-stop>
|
||||||
<vn-autocomplete
|
<vn-autocomplete
|
||||||
vn-id="agencyMode"
|
vn-id="agencyMode"
|
||||||
ng-model="weekly.agencyModeFk"
|
ng-model="weekly.agencyModeFk"
|
||||||
|
@ -77,27 +99,28 @@
|
||||||
order="name"
|
order="name"
|
||||||
class="dense">
|
class="dense">
|
||||||
</vn-autocomplete>
|
</vn-autocomplete>
|
||||||
</vn-td>
|
</td>
|
||||||
<vn-td>{{::weekly.warehouseName}}</vn-td>
|
<td vn-click-stop>{{weekly.warehouseName}}</td>
|
||||||
<vn-td>
|
<td>
|
||||||
<span
|
<span
|
||||||
vn-click-stop="workerDescriptor.show($event, weekly.workerFk)"
|
vn-click-stop="workerDescriptor.show($event, weekly.workerFk)"
|
||||||
class="link" >
|
class="link" >
|
||||||
{{::weekly.userName}}
|
{{::weekly.userName}}
|
||||||
</span>
|
</span>
|
||||||
</vn-td>
|
</td>
|
||||||
<vn-td shrink>
|
<td shrink>
|
||||||
<vn-icon-button
|
<vn-icon-button
|
||||||
icon="delete"
|
icon="delete"
|
||||||
vn-click-stop="deleteWeekly.show(weekly.ticketFk)"
|
vn-click-stop="deleteWeekly.show(weekly.ticketFk)"
|
||||||
vn-tooltip="Delete">
|
vn-tooltip="Delete">
|
||||||
</vn-icon-button>
|
</vn-icon-button>
|
||||||
</vn-td>
|
</td>
|
||||||
</vn-tr>
|
</tr>
|
||||||
</vn-tbody>
|
</tbody>
|
||||||
</vn-table>
|
</table>
|
||||||
|
</slot-table>
|
||||||
|
</smart-table>
|
||||||
</vn-card>
|
</vn-card>
|
||||||
</vn-data-viewer>
|
|
||||||
<vn-client-descriptor-popover
|
<vn-client-descriptor-popover
|
||||||
vn-id="clientDescriptor">
|
vn-id="clientDescriptor">
|
||||||
</vn-client-descriptor-popover>
|
</vn-client-descriptor-popover>
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
|
|
||||||
import ngModule from '../module';
|
import ngModule from '../module';
|
||||||
import Section from 'salix/components/section';
|
import Section from 'salix/components/section';
|
||||||
|
|
||||||
|
@ -15,6 +16,44 @@ export default class Controller extends Section {
|
||||||
{id: 5, name: 'Saturday'},
|
{id: 5, name: 'Saturday'},
|
||||||
{id: 6, name: 'Sunday'}
|
{id: 6, name: 'Sunday'}
|
||||||
];
|
];
|
||||||
|
|
||||||
|
this.smartTableOptions = {
|
||||||
|
activeButtons: {
|
||||||
|
search: true,
|
||||||
|
shownColumns: true,
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
field: 'ticketFk',
|
||||||
|
searchable: false
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'clientName',
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'weekDay',
|
||||||
|
searchable: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'agencyModeFk',
|
||||||
|
searchable: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'warehouseFk',
|
||||||
|
searchable: false,
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'nickname',
|
||||||
|
},
|
||||||
|
]
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
|
exprBuilder(param, value) {
|
||||||
|
switch (param) {
|
||||||
|
case 'clientName': return {'c.name': value};
|
||||||
|
case 'nickName': return {'u.name': value};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
onUpdate(ticketFk, field, value) {
|
onUpdate(ticketFk, field, value) {
|
||||||
|
|
Loading…
Reference in New Issue