|
@@ -34,20 +34,20 @@
|
|
|
<div id="hcp-note-activity" class="p-3 mcp-theme-1">
|
|
|
<div class="card">
|
|
|
|
|
|
- <div class="card-header px-2 py-1 d-flex align-items-center">
|
|
|
+ <div class="card-header p-2 d-flex align-items-center">
|
|
|
<strong class="mr-4">
|
|
|
<i class="fas fa-user"></i>
|
|
|
HCP Note Activity
|
|
|
</strong>
|
|
|
</div>
|
|
|
<div class="card-body p-0 border-0 table-responsive">
|
|
|
- <div class="m-2">
|
|
|
+ <div class="p-3">
|
|
|
|
|
|
- <form id="hcp-note-activity-filters" method="GET" action="{{ route('practice-management.hcp-note-activity') }}" class="filter-container" v-cloak>
|
|
|
+ <form id="hcp-note-activity-filters" method="GET" action="{{ route('practice-management.hcp-note-activity') }}" class="filter-container">
|
|
|
<div class="sm-section" style="width: 250px !important;">
|
|
|
- <div class="form-group">
|
|
|
- <label>Pros:</label>
|
|
|
- <select id="searchForProInput" multiple name="pros_ids[]" class="form-control input-sm" v-model="filters.pros_ids">
|
|
|
+ <div class="">
|
|
|
+ <label class="mb-1 text-secondary">Pros:</label>
|
|
|
+ <select id="searchForProInput" multiple name="pros_ids[]" class="form-control input-sm">
|
|
|
@if(@$filters['pros_ids'])
|
|
|
@foreach($rows as $p)
|
|
|
<option value="{{ $p->id }}" selected>{{$p->name_first}} {{$p->name_last}}</option>
|
|
@@ -58,25 +58,25 @@
|
|
|
</div>
|
|
|
|
|
|
<div class="sm-section">
|
|
|
- <div class="form-group">
|
|
|
- <label>From Date:</label>
|
|
|
- <input type="date" name="from_date" class="form-control input-sm" v-model="filters.from_date">
|
|
|
+ <div class="">
|
|
|
+ <label class="mb-1 text-secondary">From Date:</label>
|
|
|
+ <input type="date" name="from_date" class="form-control input-sm" value="{{request()->input('from_date')}}">
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div class="sm-section">
|
|
|
- <div class="form-group">
|
|
|
- <label>To Date:</label>
|
|
|
- <input type="date" name="to_date" class="form-control input-sm" v-model="filters.to_date">
|
|
|
+ <div class="">
|
|
|
+ <label class="mb-1 text-secondary">To Date:</label>
|
|
|
+ <input type="date" name="to_date" class="form-control input-sm" value="{{request()->input('to_date')}}">
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
|
<div>
|
|
|
- <div class="form-group">
|
|
|
+ <div class="">
|
|
|
<label> </label>
|
|
|
<div class=" d-flex">
|
|
|
- <button type="button" v-on:click.prevent="doSubmit()" class="btn btn-primary btn-sm mr-2"><i class="fas fa-filter"></i> Filter</button>
|
|
|
- <a href="#" v-on:click.prevent="fastLoad('{{route('practice-management.hcp-note-activity')}}')" class="btn btn-link btn-sm text-danger">Clear Filters</a>
|
|
|
+ <button type="button" onclick="return fastLoad('{{ route("practice-management.hcp-note-activity") }}?' + $('#hcp-note-activity-filters').serialize());" class="btn btn-primary btn-sm mr-2"><i class="fas fa-filter"></i> Filter</button>
|
|
|
+ <a href="#" onclick="return fastLoad('{{ route("practice-management.hcp-note-activity") }}');" class="btn btn-link btn-sm text-danger">Clear Filters</a>
|
|
|
</div>
|
|
|
</div>
|
|
|
</div>
|
|
@@ -85,11 +85,13 @@
|
|
|
<table class="table table-sm table-striped border-0 p-0 m-0 text-nowrap">
|
|
|
<thead class="bg-light">
|
|
|
<tr>
|
|
|
- <th>First Name</th>
|
|
|
- <th>Last Name</th>
|
|
|
- <th>Last Note Created At</th>
|
|
|
- <th># Notes This Month</th>
|
|
|
- <th># Notes In the Period</th>
|
|
|
+ <th>@include('app.practice-management._sort_header', ['label' => 'First Name', 'key' => 'name_first'])</th>
|
|
|
+ <th>@include('app.practice-management._sort_header', ['label' => 'Last Name', 'key' => 'name_last'])</th>
|
|
|
+ <th>@include('app.practice-management._sort_header', ['label' => 'Last Note Created At', 'key' => 'last_note_created_at'])</th>
|
|
|
+ <th>@include('app.practice-management._sort_header', ['label' => '# Notes This Month', 'key' => 'notes_this_month'])</th>
|
|
|
+ @if(request()->input('from_date') && request()->input('from_date'))
|
|
|
+ <th>@include('app.practice-management._sort_header', ['label' => '# Notes In the Period', 'key' => 'notes_this_period'])</th>
|
|
|
+ @endif
|
|
|
</tr>
|
|
|
</thead>
|
|
|
<tbody>
|
|
@@ -101,7 +103,9 @@
|
|
|
<td>{{$row->name_last}}</td>
|
|
|
<td>{{friendly_date_time($row->last_note_created_at)}}</td>
|
|
|
<td>{{$row->notes_this_month}}</td>
|
|
|
- <td>{{$row->notes_this_period}}</td>
|
|
|
+ @if(request()->input('from_date') && request()->input('from_date'))
|
|
|
+ <td>{{$row->notes_this_period}}</td>
|
|
|
+ @endif
|
|
|
</tr>
|
|
|
@endforeach
|
|
|
</tbody>
|
|
@@ -115,75 +119,38 @@
|
|
|
|
|
|
</div>
|
|
|
|
|
|
-<?php
|
|
|
-$loadedFilters = $filters;
|
|
|
-$allFilterKeys = [
|
|
|
- 'pros_ids',
|
|
|
- 'from_date',
|
|
|
- 'to_date'
|
|
|
-];
|
|
|
-for ($i = 0; $i < count($allFilterKeys); $i++) {
|
|
|
- if (!isset($loadedFilters[$allFilterKeys[$i]]) || !$loadedFilters[$allFilterKeys[$i]]) {
|
|
|
- $loadedFilters[$allFilterKeys[$i]] = '';
|
|
|
- }
|
|
|
-}
|
|
|
-?>
|
|
|
<script>
|
|
|
- (function() {
|
|
|
- function init() {
|
|
|
- new Vue({
|
|
|
- el: '#hcp-note-activity',
|
|
|
- delimiters: ['@{{', '}}'],
|
|
|
- data: {
|
|
|
- filters: <?= json_encode($loadedFilters) ?>
|
|
|
- },
|
|
|
- methods: {
|
|
|
- initSelect2: function(){
|
|
|
- var select2 = $("#searchForProInput").select2({
|
|
|
- placeholder: "Search Pro(s) by Name",
|
|
|
- minimumInputLength: 2,
|
|
|
- ajax: {
|
|
|
- url: '/pro-suggest',
|
|
|
- dataType: 'json',
|
|
|
- type: "GET",
|
|
|
- quietMillis: 50,
|
|
|
- data: function (params) {
|
|
|
- return {
|
|
|
- term: params.term,
|
|
|
- json: true
|
|
|
- };
|
|
|
- },
|
|
|
- results: function (data) {
|
|
|
- return {
|
|
|
- results: $.map(data, function (item) {
|
|
|
- return {
|
|
|
- text: item.completeName,
|
|
|
- slug: item.slug,
|
|
|
- id: item.id
|
|
|
- }
|
|
|
- })
|
|
|
- };
|
|
|
- }
|
|
|
- }
|
|
|
- });
|
|
|
+ (function() {
|
|
|
+ function init() {
|
|
|
+ var select2 = $("#searchForProInput").select2({
|
|
|
+ placeholder: "Search Pro(s) by Name",
|
|
|
+ minimumInputLength: 2,
|
|
|
+ ajax: {
|
|
|
+ url: '/pro-suggest',
|
|
|
+ dataType: 'json',
|
|
|
+ type: "GET",
|
|
|
+ quietMillis: 50,
|
|
|
+ data: function (params) {
|
|
|
+ return {
|
|
|
+ term: params.term,
|
|
|
+ json: true
|
|
|
+ };
|
|
|
},
|
|
|
- init: function() {
|
|
|
- this.initSelect2();
|
|
|
- },
|
|
|
- doSubmit: function() {
|
|
|
- fastLoad('{{ route("practice-management.hcp-note-activity") }}?' + $('#hcp-note-activity-filters').serialize());
|
|
|
- return false;
|
|
|
- }
|
|
|
- },
|
|
|
- mounted: function() {
|
|
|
- console.log(this.filters);
|
|
|
- this.init();
|
|
|
- },
|
|
|
- });
|
|
|
-
|
|
|
-
|
|
|
- }
|
|
|
- addMCInitializer('hcp-note-activity', init, '#hcp-note-activity');
|
|
|
- })();
|
|
|
+ results: function (data) {
|
|
|
+ return {
|
|
|
+ results: $.map(data, function (item) {
|
|
|
+ return {
|
|
|
+ text: item.completeName,
|
|
|
+ slug: item.slug,
|
|
|
+ id: item.id
|
|
|
+ }
|
|
|
+ })
|
|
|
+ };
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+ addMCInitializer('hcp-note-activity', init, '#hcp-note-activity');
|
|
|
+ }).call(window);
|
|
|
</script>
|
|
|
@endsection
|