Merge branch '746-resq-2-0-final' into 768-add-timer-in-jo-list-to-show-real-time-dispatch-time
# Conflicts: # templates/job-order/list.all.html.twig
This commit is contained in:
commit
e070d6df18
2 changed files with 86 additions and 78 deletions
|
|
@ -243,12 +243,20 @@ class ResqJobOrderHandler implements JobOrderHandlerInterface
|
|||
else
|
||||
$row['assignor'] = $orow->getAssignedBy()->getFullName();
|
||||
|
||||
// not removing this since this might be used by other pages since getRows is also used by other pages
|
||||
$hub_facilitated = $orow->getFacilitatedBy();
|
||||
if ($hub_facilitated == null)
|
||||
$row['hub_facilitated'] = '';
|
||||
else
|
||||
$row['hub_facilitated'] = $orow->getFacilitatedBy()->getName();
|
||||
|
||||
// get the assigned hub, if any
|
||||
$assigned_hub = $orow->getHub();
|
||||
if ($assigned_hub == null)
|
||||
$row['assigned_hub'] = '';
|
||||
else
|
||||
$row['assigned_hub'] = $orow->getHub()->getName();
|
||||
|
||||
$rows[] = $row;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -113,91 +113,91 @@
|
|||
},
|
||||
},
|
||||
columns: [
|
||||
{
|
||||
field: 'id',
|
||||
title: 'JO Number'
|
||||
},
|
||||
{
|
||||
field: 'plate_number',
|
||||
title: 'Plate #'
|
||||
},
|
||||
{
|
||||
field: 'customer_name',
|
||||
title: 'Customer'
|
||||
},
|
||||
{
|
||||
field: 'delivery_address',
|
||||
title: 'Customer Area'
|
||||
},
|
||||
{
|
||||
field: 'hub_facilitated',
|
||||
title: 'Battery Facilitated By'
|
||||
},
|
||||
{
|
||||
field: 'type',
|
||||
title: 'Schedule'
|
||||
},
|
||||
{
|
||||
field: 'date_schedule',
|
||||
title: 'Scheduled Date'
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: 'Status'
|
||||
},
|
||||
{
|
||||
field: 'processor',
|
||||
title: 'Dispatcher'
|
||||
},
|
||||
{
|
||||
field: '',
|
||||
title: 'Dispatch Time',
|
||||
sortable: false,
|
||||
searchable: false,
|
||||
textAlign: 'right',
|
||||
template: function (row, index, datatable) {
|
||||
let dateAssign;
|
||||
let dateEnd;
|
||||
let incrementing = false;
|
||||
{
|
||||
field: 'id',
|
||||
title: 'JO Number'
|
||||
},
|
||||
{
|
||||
field: 'plate_number',
|
||||
title: 'Plate #'
|
||||
},
|
||||
{
|
||||
field: 'customer_name',
|
||||
title: 'Customer'
|
||||
},
|
||||
{
|
||||
field: 'delivery_address',
|
||||
title: 'Customer Area'
|
||||
},
|
||||
{
|
||||
field: 'assigned_hub',
|
||||
title: 'Assigned Hub'
|
||||
},
|
||||
{
|
||||
field: 'service_type',
|
||||
title: 'Transaction Type'
|
||||
},
|
||||
{
|
||||
field: 'date_schedule',
|
||||
title: 'Scheduled Date'
|
||||
},
|
||||
{
|
||||
field: 'status',
|
||||
title: 'Status'
|
||||
},
|
||||
{
|
||||
field: 'processor',
|
||||
title: 'Dispatcher'
|
||||
},
|
||||
{
|
||||
field: '',
|
||||
title: 'Dispatch Time',
|
||||
sortable: false,
|
||||
searchable: false,
|
||||
textAlign: 'right',
|
||||
template: function (row, index, datatable) {
|
||||
let dateAssign;
|
||||
let dateEnd;
|
||||
let incrementing = false;
|
||||
|
||||
// only display timer for these statuses
|
||||
const statusesWithTimer = [
|
||||
'Assigned',
|
||||
'In Transit',
|
||||
'In Progress',
|
||||
'Completed', // NOTE: completed would be based off the fulfillment time
|
||||
];
|
||||
// only display timer for these statuses
|
||||
const statusesWithTimer = [
|
||||
'Assigned',
|
||||
'In Transit',
|
||||
'In Progress',
|
||||
'Completed', // NOTE: completed would be based off the fulfillment time
|
||||
];
|
||||
|
||||
if (row.date_assign && statusesWithTimer.includes(row.status)) {
|
||||
dateAssign = new moment(row.date_assign, moment.ISO_8601);
|
||||
if (row.date_assign && statusesWithTimer.includes(row.status)) {
|
||||
dateAssign = new moment(row.date_assign, moment.ISO_8601);
|
||||
|
||||
// on completed jos, use date_fulfill as end date and do not increment
|
||||
if (row.status == 'Completed') {
|
||||
if (row.date_fulfill) {
|
||||
dateEnd = new moment(row.date_fulfill, moment.ISO_8601);
|
||||
}
|
||||
} else {
|
||||
dateEnd = moment();
|
||||
incrementing = true;
|
||||
// on completed jos, use date_fulfill as end date and do not increment
|
||||
if (row.status == 'Completed') {
|
||||
if (row.date_fulfill) {
|
||||
dateEnd = new moment(row.date_fulfill, moment.ISO_8601);
|
||||
}
|
||||
} else {
|
||||
dateEnd = moment();
|
||||
incrementing = true;
|
||||
}
|
||||
|
||||
return dateEnd ? '<span class="m-badge m-badge--wide m--font-boldest ' + (incrementing ? 'm-badge--warning" data-incrementing="1"' : 'm-badge--success"') + '>' + timeDiff(dateAssign, dateEnd) + '</span>' : '-';
|
||||
}
|
||||
|
||||
return dateEnd ? '<span class="m-badge m-badge--wide m--font-boldest ' + (incrementing ? 'm-badge--warning" data-incrementing="1"' : 'm-badge--success"') + '>' + timeDiff(dateAssign, dateEnd) + '</span>' : '-';
|
||||
},
|
||||
{
|
||||
field: 'Actions',
|
||||
width: 110,
|
||||
title: 'Actions',
|
||||
sortable: false,
|
||||
overflow: 'visible',
|
||||
template: function (row, index, datatable) {
|
||||
var actions = '<a href="' + row.meta.update_url + '" class="m-portlet__nav-link btn m-btn m-btn--hover-accent m-btn--icon m-btn--icon-only m-btn--pill btn-edit" title="View"><i class="la la-edit"></i></a>';
|
||||
actions += '<a href="' + row.meta.pdf_url + '" class="m-portlet__nav-link btn m-btn m-btn--hover-accent m-btn--icon m-btn--icon-only m-btn--pill btn-edit" title="PDF" target="_blank"><i class="la la-file-o"></i></a>';
|
||||
|
||||
return actions;
|
||||
},
|
||||
}
|
||||
},
|
||||
{
|
||||
field: 'Actions',
|
||||
width: 110,
|
||||
title: 'Actions',
|
||||
sortable: false,
|
||||
overflow: 'visible',
|
||||
template: function (row, index, datatable) {
|
||||
var actions = '<a href="' + row.meta.update_url + '" class="m-portlet__nav-link btn m-btn m-btn--hover-accent m-btn--icon m-btn--icon-only m-btn--pill btn-edit" title="View"><i class="la la-edit"></i></a>';
|
||||
actions += '<a href="' + row.meta.pdf_url + '" class="m-portlet__nav-link btn m-btn m-btn--hover-accent m-btn--icon m-btn--icon-only m-btn--pill btn-edit" title="PDF" target="_blank"><i class="la la-file-o"></i></a>';
|
||||
|
||||
return actions;
|
||||
},
|
||||
},
|
||||
],
|
||||
search: {
|
||||
onEnter: false,
|
||||
|
|
|
|||
Loading…
Reference in a new issue