Add view all job orders tier #26
This commit is contained in:
parent
2de5344288
commit
ab116d35ce
7 changed files with 332 additions and 36 deletions
|
|
@ -197,6 +197,8 @@ access_keys:
|
||||||
label: Fulfillment
|
label: Fulfillment
|
||||||
- id: jo_open.list
|
- id: jo_open.list
|
||||||
label: Open
|
label: Open
|
||||||
|
- id: jo_all.list
|
||||||
|
label: View All
|
||||||
- id: joborder.cancel
|
- id: joborder.cancel
|
||||||
label: Cancel
|
label: Cancel
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -101,6 +101,10 @@ main_menu:
|
||||||
acl: jo_open.list
|
acl: jo_open.list
|
||||||
label: Open
|
label: Open
|
||||||
parent: joborder
|
parent: joborder
|
||||||
|
- id: jo_all
|
||||||
|
acl: jo_all.list
|
||||||
|
label: View All
|
||||||
|
parent: joborder
|
||||||
|
|
||||||
- id: support
|
- id: support
|
||||||
acl: support.menu
|
acl: support.menu
|
||||||
|
|
|
||||||
|
|
@ -132,3 +132,20 @@ jo_assign_unlock:
|
||||||
path: /job-order/{id}/unlock/assignor
|
path: /job-order/{id}/unlock/assignor
|
||||||
controller: App\Controller\JobOrderController::unlockAssignor
|
controller: App\Controller\JobOrderController::unlockAssignor
|
||||||
methods: [GET]
|
methods: [GET]
|
||||||
|
|
||||||
|
jo_all:
|
||||||
|
path: /job-order/all
|
||||||
|
controller: App\Controller\JobOrderController::listAll
|
||||||
|
methods: [GET]
|
||||||
|
|
||||||
|
jo_all_rows:
|
||||||
|
path: /job-order/all-rows
|
||||||
|
controller: App\Controller\JobOrderController::getRows
|
||||||
|
methods: [POST]
|
||||||
|
defaults:
|
||||||
|
tier: "all"
|
||||||
|
|
||||||
|
jo_all_form:
|
||||||
|
path: /job-order/all/{id}
|
||||||
|
controller: App\Controller\JobOrderController::allForm
|
||||||
|
methods: [GET]
|
||||||
|
|
|
||||||
|
|
@ -166,6 +166,25 @@ span.has-danger,
|
||||||
margin-left: 4px;
|
margin-left: 4px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.m-timeline-2 .m-timeline-2__items .m-timeline-2__item .m-timeline-2__item-cricle {
|
||||||
|
left: 6.1rem;
|
||||||
|
top: 0.3rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.m-timeline-2 .m-timeline-2__items .m-timeline-2__item .m-timeline-2__item-text {
|
||||||
|
padding-left: 7rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.m-timeline-2:before {
|
||||||
|
left: 7.95rem;
|
||||||
|
}
|
||||||
|
|
||||||
|
.m-timeline-2 .m-timeline-2__items .m-timeline-2__item .m-timeline-2__item-time {
|
||||||
|
line-height: 1rem;
|
||||||
|
padding-top: 0;
|
||||||
|
top: -0.45rem;
|
||||||
|
}
|
||||||
|
|
||||||
@media (min-width: 995px) {
|
@media (min-width: 995px) {
|
||||||
.modal-lg {
|
.modal-lg {
|
||||||
max-width: 1024px;
|
max-width: 1024px;
|
||||||
|
|
|
||||||
|
|
@ -304,7 +304,7 @@ class JobOrderController extends BaseController
|
||||||
$tier_key = 'jo_open';
|
$tier_key = 'jo_open';
|
||||||
$tier_name = 'Open';
|
$tier_name = 'Open';
|
||||||
$rows_route = 'jo_open_rows';
|
$rows_route = 'jo_open_rows';
|
||||||
$edit_route = false;
|
$edit_route = '';
|
||||||
$unlock_route = '';
|
$unlock_route = '';
|
||||||
$jo_status = [
|
$jo_status = [
|
||||||
JOStatus::PENDING,
|
JOStatus::PENDING,
|
||||||
|
|
@ -313,6 +313,14 @@ class JobOrderController extends BaseController
|
||||||
JOStatus::IN_PROGRESS
|
JOStatus::IN_PROGRESS
|
||||||
];
|
];
|
||||||
break;
|
break;
|
||||||
|
case 'all':
|
||||||
|
$tier_key = 'jo_open';
|
||||||
|
$tier_name = 'Open';
|
||||||
|
$rows_route = 'jo_open_rows';
|
||||||
|
$edit_route = 'jo_all_form';
|
||||||
|
$unlock_route = '';
|
||||||
|
$jo_status = '';
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
$exception = $this->createAccessDeniedException('No access.');
|
$exception = $this->createAccessDeniedException('No access.');
|
||||||
throw $exception;
|
throw $exception;
|
||||||
|
|
@ -360,6 +368,15 @@ class JobOrderController extends BaseController
|
||||||
return $this->render('job-order/list.open.html.twig', $params);
|
return $this->render('job-order/list.open.html.twig', $params);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function listAll()
|
||||||
|
{
|
||||||
|
$params = $this->initParameters('jo_all');
|
||||||
|
|
||||||
|
$params['table_refresh_rate'] = $this->container->getParameter('job_order_refresh_interval');
|
||||||
|
|
||||||
|
return $this->render('job-order/list.all.html.twig', $params);
|
||||||
|
}
|
||||||
|
|
||||||
public function listRows($tier)
|
public function listRows($tier)
|
||||||
{
|
{
|
||||||
// check which job order tier is being called for and confirm access
|
// check which job order tier is being called for and confirm access
|
||||||
|
|
@ -1212,6 +1229,68 @@ class JobOrderController extends BaseController
|
||||||
]);
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function allForm($id)
|
||||||
|
{
|
||||||
|
$this->denyAccessUnlessGranted('jo_all.list', null, 'No access.');
|
||||||
|
|
||||||
|
$em = $this->getDoctrine()->getManager();
|
||||||
|
|
||||||
|
$params = $this->initParameters('jo_all');
|
||||||
|
$params['mode'] = 'update-all';
|
||||||
|
|
||||||
|
// get row data
|
||||||
|
$obj = $em->getRepository(JobOrder::class)->find($id);
|
||||||
|
|
||||||
|
// make sure this row exists
|
||||||
|
if (empty($obj))
|
||||||
|
throw $this->createNotFoundException('The job order does not exist');
|
||||||
|
|
||||||
|
// get parent associations
|
||||||
|
$params['bmfgs'] = $em->getRepository(BatteryManufacturer::class)->findAll();
|
||||||
|
$params['customers'] = $em->getRepository(Customer::class)->findAll();
|
||||||
|
$params['service_types'] = ServiceType::getCollection();
|
||||||
|
$params['warranty_classes'] = WarrantyClass::getCollection();
|
||||||
|
$params['statuses'] = JOStatus::getCollection();
|
||||||
|
$params['promos'] = $em->getRepository(Promo::class)->findAll();
|
||||||
|
$params['discount_apply'] = DiscountApply::getCollection();
|
||||||
|
$params['trade_in_types'] = TradeInType::getCollection();
|
||||||
|
|
||||||
|
$params['obj'] = $obj;
|
||||||
|
$params['return_url'] = $this->generateUrl('jo_all');
|
||||||
|
$params['submit_url'] = '';
|
||||||
|
|
||||||
|
// timeline stuff (descending by time)
|
||||||
|
$params['timeline'] = [
|
||||||
|
[
|
||||||
|
'date' => date("M j"),
|
||||||
|
'time' => date("H:i A"),
|
||||||
|
'event' => "Event 4",
|
||||||
|
'color' => "#f4516c"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'date' => date("M j"),
|
||||||
|
'time' => date("H:i A"),
|
||||||
|
'event' => "Event 3",
|
||||||
|
'color' => "#34bfa3"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'date' => date("M j"),
|
||||||
|
'time' => date("H:i A"),
|
||||||
|
'event' => "Event 2",
|
||||||
|
'color' => "#716aca"
|
||||||
|
],
|
||||||
|
[
|
||||||
|
'date' => date("M j"),
|
||||||
|
'time' => date("H:i A"),
|
||||||
|
'event' => "Event 1",
|
||||||
|
'color' => "#ffb822"
|
||||||
|
],
|
||||||
|
];
|
||||||
|
|
||||||
|
// response
|
||||||
|
return $this->render('job-order/form.html.twig', $params);
|
||||||
|
}
|
||||||
|
|
||||||
public function cancelJobOrder(Request $req, $id)
|
public function cancelJobOrder(Request $req, $id)
|
||||||
{
|
{
|
||||||
$this->denyAccessUnlessGranted('joborder.cancel', null, 'No access.');
|
$this->denyAccessUnlessGranted('joborder.cancel', null, 'No access.');
|
||||||
|
|
@ -1258,6 +1337,8 @@ class JobOrderController extends BaseController
|
||||||
$query->where('q.status IN (:statuses)')
|
$query->where('q.status IN (:statuses)')
|
||||||
->setParameter('statuses', $status, Connection::PARAM_STR_ARRAY);
|
->setParameter('statuses', $status, Connection::PARAM_STR_ARRAY);
|
||||||
break;
|
break;
|
||||||
|
case 'all':
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
$query->where('q.status = :status')
|
$query->where('q.status = :status')
|
||||||
->setParameter('status', $status);
|
->setParameter('status', $status);
|
||||||
|
|
|
||||||
|
|
@ -34,6 +34,9 @@
|
||||||
{% elseif mode == 'update-reassign-rider' %}
|
{% elseif mode == 'update-reassign-rider' %}
|
||||||
Re-assign Rider
|
Re-assign Rider
|
||||||
<small>{{ obj.getID() }}</small>
|
<small>{{ obj.getID() }}</small>
|
||||||
|
{% elseif mode == 'update-all' %}
|
||||||
|
Viewing
|
||||||
|
<small>{{ obj.getID() }}</small>
|
||||||
{% else %}
|
{% else %}
|
||||||
Incoming
|
Incoming
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
@ -454,7 +457,7 @@
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if mode in ['update-assigning', 'update-fulfillment', 'update-reassign-rider'] %}
|
{% if mode in ['update-assigning', 'update-fulfillment', 'update-reassign-rider', 'update-all'] %}
|
||||||
<div class="m-form__seperator m-form__seperator--dashed"></div>
|
<div class="m-form__seperator m-form__seperator--dashed"></div>
|
||||||
{% if obj.getHub %}
|
{% if obj.getHub %}
|
||||||
<div class="m-form__section">
|
<div class="m-form__section">
|
||||||
|
|
@ -553,7 +556,8 @@
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
||||||
{% if mode == 'update-fulfillment' %}
|
{% if mode in ['update-fulfillment', 'update-all'] %}
|
||||||
|
{% if obj.getRider %}
|
||||||
<div class="m-form__section">
|
<div class="m-form__section">
|
||||||
<div class="m-form__heading">
|
<div class="m-form__heading">
|
||||||
<h3 class="m-form__heading-title">
|
<h3 class="m-form__heading-title">
|
||||||
|
|
@ -593,6 +597,41 @@
|
||||||
</div>
|
</div>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
|
{% if mode == 'update-all' %}
|
||||||
|
<div class="m-form__seperator m-form__seperator--dashed"></div>
|
||||||
|
|
||||||
|
<div class="m-form__section">
|
||||||
|
<div class="m-form__heading">
|
||||||
|
<h3 class="m-form__heading-title">
|
||||||
|
Timeline
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
<div class="form-group m-form__group row">
|
||||||
|
<div class="col-lg-12">
|
||||||
|
<div class="m-timeline-2">
|
||||||
|
<div class="m-timeline-2__items m--padding-top-25 m--padding-bottom-25">
|
||||||
|
{% for item in timeline %}
|
||||||
|
<div class="m-timeline-2__item{{ loop.index > 1 ? ' m--margin-top-40' }}">
|
||||||
|
<span class="m-timeline-2__item-time">
|
||||||
|
<small>{{ item.date }}</small>
|
||||||
|
<div>{{ item.time }}</div>
|
||||||
|
</span>
|
||||||
|
<div class="m-timeline-2__item-cricle">
|
||||||
|
<i class="fa fa-genderless" style="color: {{ item.color }};"></i>
|
||||||
|
</div>
|
||||||
|
<div class="m-timeline-2__item-text m--padding-top-5">
|
||||||
|
{{ item.event }}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endfor %}
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endif %}
|
||||||
|
|
||||||
{% if mode != 'create' %}
|
{% if mode != 'create' %}
|
||||||
<div class="m-form__seperator m-form__seperator--dashed"></div>
|
<div class="m-form__seperator m-form__seperator--dashed"></div>
|
||||||
|
|
@ -621,7 +660,9 @@
|
||||||
<div class="m-form__actions m-form__actions--solid m-form__actions--right">
|
<div class="m-form__actions m-form__actions--solid m-form__actions--right">
|
||||||
<div class="row">
|
<div class="row">
|
||||||
<div class="col-lg-12">
|
<div class="col-lg-12">
|
||||||
|
{% if mode != 'update-all' %}
|
||||||
<button type="submit" class="btn btn-success">{{ mode == 'update-fulfillment' ? 'Fulfill' : 'Submit' }}</button>
|
<button type="submit" class="btn btn-success">{{ mode == 'update-fulfillment' ? 'Fulfill' : 'Submit' }}</button>
|
||||||
|
{% endif %}
|
||||||
{% if mode != 'create' and is_granted('joborder.cancel') %}
|
{% if mode != 'create' and is_granted('joborder.cancel') %}
|
||||||
<a href="{{ url('jo_cancel', {'id': obj.getID}) }}" class="btn btn-danger btn-cancel-job-order">Cancel Job Order</button>
|
<a href="{{ url('jo_cancel', {'id': obj.getID}) }}" class="btn btn-danger btn-cancel-job-order">Cancel Job Order</button>
|
||||||
{% endif %}
|
{% endif %}
|
||||||
|
|
|
||||||
132
templates/job-order/list.all.html.twig
Normal file
132
templates/job-order/list.all.html.twig
Normal file
|
|
@ -0,0 +1,132 @@
|
||||||
|
{% extends 'base.html.twig' %}
|
||||||
|
|
||||||
|
{% block body %}
|
||||||
|
<!-- BEGIN: Subheader -->
|
||||||
|
<div class="m-subheader">
|
||||||
|
<div class="d-flex align-items-center">
|
||||||
|
<div class="mr-auto">
|
||||||
|
<h3 class="m-subheader__title">
|
||||||
|
Job Orders (All)
|
||||||
|
</h3>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- END: Subheader -->
|
||||||
|
<div class="m-content">
|
||||||
|
<!--Begin::Section-->
|
||||||
|
<div class="row">
|
||||||
|
<div class="col-xl-12">
|
||||||
|
<div class="m-portlet m-portlet--mobile">
|
||||||
|
<div class="m-portlet__body">
|
||||||
|
<div class="m-form m-form--label-align-right m--margin-top-20 m--margin-bottom-30">
|
||||||
|
<div class="row align-items-center">
|
||||||
|
<div class="col-xl-12">
|
||||||
|
<div class="form-group m-form__group row align-items-center">
|
||||||
|
<div class="col-md-4">
|
||||||
|
<div class="m-input-icon m-input-icon--left">
|
||||||
|
<input type="text" class="form-control m-input m-input--solid" placeholder="Search..." id="data-rows-search">
|
||||||
|
<span class="m-input-icon__icon m-input-icon__icon--left">
|
||||||
|
<span><i class="la la-search"></i></span>
|
||||||
|
</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!--begin: Datatable -->
|
||||||
|
<div id="data-rows"></div>
|
||||||
|
<!--end: Datatable -->
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
{% endblock %}
|
||||||
|
|
||||||
|
{% block scripts %}
|
||||||
|
<script>
|
||||||
|
$(function() {
|
||||||
|
var options = {
|
||||||
|
data: {
|
||||||
|
type: 'remote',
|
||||||
|
source: {
|
||||||
|
read: {
|
||||||
|
url: '{{ url('jo_all_rows') }}',
|
||||||
|
method: 'POST'
|
||||||
|
}
|
||||||
|
},
|
||||||
|
saveState: {
|
||||||
|
cookie: false,
|
||||||
|
webstorage: false
|
||||||
|
},
|
||||||
|
pageSize: 10,
|
||||||
|
serverPaging: true,
|
||||||
|
serverFiltering: true,
|
||||||
|
serverSorting: true
|
||||||
|
},
|
||||||
|
rows: {
|
||||||
|
beforeTemplate: function (row, data, index) {
|
||||||
|
if (data.flag_advance) {
|
||||||
|
$(row).addClass('m-table__row--danger');
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
columns: [
|
||||||
|
{
|
||||||
|
field: 'id',
|
||||||
|
title: 'JO Number'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'delivery_address',
|
||||||
|
title: 'Customer Area'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'service_type',
|
||||||
|
title: 'Type of Transaction'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'date_schedule',
|
||||||
|
title: 'Scheduled Date'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'status',
|
||||||
|
title: 'Status'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'processor',
|
||||||
|
title: 'Processor'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
field: 'assignor',
|
||||||
|
title: 'Assignor'
|
||||||
|
},
|
||||||
|
{
|
||||||
|
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>';
|
||||||
|
|
||||||
|
return actions;
|
||||||
|
},
|
||||||
|
}
|
||||||
|
],
|
||||||
|
search: {
|
||||||
|
onEnter: false,
|
||||||
|
input: $('#data-rows-search'),
|
||||||
|
delay: 400
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
|
var table = $("#data-rows").mDatatable(options);
|
||||||
|
|
||||||
|
// auto refresh table
|
||||||
|
setInterval(function() {
|
||||||
|
table.reload();
|
||||||
|
}, {{ table_refresh_rate }});
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
{% endblock %}
|
||||||
Loading…
Reference in a new issue