|
@@ -1,7 +1,8 @@
|
|
|
@extends ('layouts/template')
|
|
|
|
|
|
@section('content')
|
|
|
-
|
|
|
+<link href="/select2/select2.min.css" rel="stylesheet" />
|
|
|
+<script src="/select2/select2.min.js"></script>
|
|
|
<style>
|
|
|
#hcp-note-activity-filters label {
|
|
|
font-weight: bold;
|
|
@@ -42,11 +43,17 @@
|
|
|
<div class="card-body p-0 border-0 table-responsive">
|
|
|
<div class="m-2">
|
|
|
|
|
|
- <form id="hcp-note-activity-filters" method="GET" action="{{ route('practice-management.hcp-note-activity') }}" class="filter-container" v-cloak>
|
|
|
- <div class="sm-section">
|
|
|
+ <form id="hcp-note-activity-filters" method="GET" action="{{ route('practice-management.hcp-note-activity') }}" class="filter-container" v-cloak>
|
|
|
+ <div class="sm-section" style="width: 250px !important;">
|
|
|
<div class="form-group">
|
|
|
- <label>Name:</label>
|
|
|
- <input name="name" class="form-control input-sm" v-model="filters.name">
|
|
|
+ <label>Pros:</label>
|
|
|
+ <select multiple name="pros_ids[]" class="form-control input-sm" v-model="filters.pros_ids">
|
|
|
+ @if(@$filters['pros_ids'])
|
|
|
+ @foreach($rows as $p)
|
|
|
+ <option value="{{ $p->id }}" selected>{{$p->name_first}} {{$p->name_last}}</option>
|
|
|
+ @endforeach
|
|
|
+ @endif
|
|
|
+ </select>
|
|
|
</div>
|
|
|
</div>
|
|
|
|
|
@@ -111,7 +118,7 @@
|
|
|
<?php
|
|
|
$loadedFilters = $filters;
|
|
|
$allFilterKeys = [
|
|
|
- 'name',
|
|
|
+ 'pros_ids',
|
|
|
'from_date',
|
|
|
'to_date'
|
|
|
];
|
|
@@ -131,8 +138,36 @@ for ($i = 0; $i < count($allFilterKeys); $i++) {
|
|
|
filters: <?= json_encode($loadedFilters) ?>
|
|
|
},
|
|
|
methods: {
|
|
|
+ initSelect2: function(){
|
|
|
+ var select2 = $("select[multiple]").select2({
|
|
|
+ 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
|
|
|
+ }
|
|
|
+ })
|
|
|
+ };
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ },
|
|
|
init: function() {
|
|
|
-
|
|
|
+ this.initSelect2();
|
|
|
},
|
|
|
doSubmit: function() {
|
|
|
fastLoad('{{ route("practice-management.hcp-note-activity") }}?' + $('#hcp-note-activity-filters').serialize());
|