فهرست منبع

Revive tickets functionality

Vijayakrishnan 3 سال پیش
والد
کامیت
9d672e4eea

+ 28 - 40
resources/views/app/patient/tickets.blade.php

@@ -52,24 +52,15 @@
     <link href="/select2/select2.min.css" rel="stylesheet" />
     <script src="/select2/select2.min.js"></script>
 
-    <div class="alert alert-warning border-warning">
-        <b>Deprecated:</b> 
-        This ERx / Orders feature has been deprecated, and is now read-only. For new prescriptions, please use
-        <a href="{{ route('patients.view.patient-prescriptions', ['patient' => $patient]) }}" class="font-weight-bold">ERx &amp; Orders</a>.
-    </div>
-
     <div id="ticketsApp" v-cloak>
         <div class="d-flex align-items-end pb-0">
-            <h4 class="font-weight-bold m-0 font-size-16">ERx / Orders</h4>
+            <h4 class="font-weight-bold m-0 font-size-16">Tickets
+                <span v-if="statusFilter === 'open'" class="text-secondary font-weight-normal">(@{{ otherNumOpen }} open)</span>
+                <span v-if="statusFilter === 'closed'" class="text-secondary font-weight-normal">(@{{ otherNumClosed }} closed)</span>
+                <span v-if="statusFilter === 'all'" class="text-secondary font-weight-normal">(@{{ otherNumOpen }} open, @{{ otherNumClosed }} closed)</span>
+            </h4>
+            <a class="mx-4 c-pointer font-weight-bold" v-on:click.prevent="otherShowPopup()">+ New</a>
             <select class="hide-inside-ticket-popup ml-auto max-width-200px form-control form-control-sm pr-2"
-                    onchange="return fastLoad('/patients/view/{{$patient->uid}}/tickets/' + this.value, true, false, false)">
-                <option value="" {{$type === '' ? 'selected' : ''}}>All</option>
-                <option value="erx" {{$type === 'erx' ? 'selected' : ''}}>ERx</option>
-                <option value="lab" {{$type === 'lab' ? 'selected' : ''}}>Lab Orders</option>
-                <option value="imaging" {{$type === 'imaging' ? 'selected' : ''}}>Imaging Orders</option>
-                <option value="other" {{$type === 'other' ? 'selected' : ''}}>Other Orders</option>
-            </select>
-            <select class="hide-inside-ticket-popup ml-2 max-width-200px form-control form-control-sm pr-2"
                     v-model="statusFilter">
                 <option value="open">Open tickets (@{{ numOpen }})</option>
                 <option value="closed">Closed tickets (@{{ numClosed }})</option>
@@ -77,18 +68,7 @@
             </select>
         </div>
 
-        @if($type === '' || $type === 'erx')
-            @include('app.patient.tickets.erx')
-        @endif
-        @if($type === '' || $type === 'lab')
-            @include('app.patient.tickets.lab')
-        @endif
-        @if($type === '' || $type === 'imaging')
-            @include('app.patient.tickets.imaging')
-        @endif
-        @if($type === '' || $type === 'other')
-            @include('app.patient.tickets.other')
-        @endif
+        @include('app.patient.tickets.other')
 
         @include('app.patient.tickets.ticket_send_fax_form')
     </div>
@@ -241,15 +221,15 @@
                         <?php } ?>
                     },
                     watch: {
-{{--                        <?php for ($i=0; $i<count($categories); $i++) { ?>--}}
-{{--                            {{ $categories[$i] }}CurrentItemData: { // ex: erxCurrentItemData, labCurrentItemData, etc.--}}
-{{--                                handler: function(val, oldVal) {--}}
-{{--                                    if (this.{{ $categories[$i] }}PopupMode !== 'edit' || !this.currentItemUid || this.reloading) return;--}}
-{{--                                    this.{{ $categories[$i] }}AutoSave();--}}
-{{--                                },--}}
-{{--                                deep: true--}}
-{{--                            },--}}
-{{--                        <?php } ?>--}}
+                        <?php for ($i=0; $i<count($categories); $i++) { ?>
+                            {{ $categories[$i] }}CurrentItemData: { // ex: erxCurrentItemData, labCurrentItemData, etc.
+                                handler: function(val, oldVal) {
+                                    if (this.{{ $categories[$i] }}PopupMode !== 'edit' || !this.currentItemUid || this.reloading) return;
+                                    this.{{ $categories[$i] }}AutoSave();
+                                },
+                                deep: true
+                            },
+                        <?php } ?>
                     },
                     methods: {
 
@@ -600,7 +580,11 @@
                                 this.otherPopupItem.data.comments = [];
                             }
                             this.otherPopupItem.data.comments.push(comment);
+                            this.comment = '';
                             this.otherSavePopupItem(true);
+                            Vue.nextTick(() => {
+                                $('[stag-popup-key="other-popup"]>form').scrollTop(10000);
+                            });
                         },
 
                         // common
@@ -630,14 +614,16 @@
                             $.post('/api/ticket/close', {
                                 uid: _item.uid
                             }, (_data) => {
-                                this.reloadPopupItem(this.currentCategory, true);
+                                // this.reloadPopupItem(this.currentCategory, true);
+                                fastLoad('/patients/view/{{$patient->uid}}/tickets/' + this.currentCategory + '/' + this.currentItemUid);
                             }, 'json');
                         },
                         openItem: function(_item) {
                             $.post('/api/ticket/open', {
                                 uid: _item.uid
                             }, (_data) => {
-                                this.reloadPopupItem(this.currentCategory);
+                                // this.reloadPopupItem(this.currentCategory);
+                                fastLoad('/patients/view/{{$patient->uid}}/tickets/' + this.currentCategory + '/' + this.currentItemUid);
                             }, 'json');
                         },
                         showSendFaxPopup: function() {
@@ -718,14 +704,16 @@
                             $.post('/api/ticket/signAsOrderingPro', {
                                 uid: _item.uid
                             }, (_data) => {
-                                this.reloadPopupItem(this.currentCategory);
+                                // this.reloadPopupItem(this.currentCategory);
+                                fastLoad('/patients/view/{{$patient->uid}}/tickets/' + this.currentCategory + '/' + this.currentItemUid);
                             }, 'json');
                         },
                         undoSignAsOrderingPro: function(_item) {
                             $.post('/api/ticket/undoSignAsOrderingPro', {
                                 uid: _item.uid
                             }, (_data) => {
-                                this.reloadPopupItem(this.currentCategory);
+                                // this.reloadPopupItem(this.currentCategory);
+                                fastLoad('/patients/view/{{$patient->uid}}/tickets/' + this.currentCategory + '/' + this.currentItemUid);
                             }, 'json');
                         },
                         toggleAddingReport: function() {

+ 7 - 3
resources/views/app/patient/tickets/common-fields.blade.php

@@ -48,8 +48,12 @@
                                class="form-control form-control-sm mr-2"
                                :value="[<?=$category?>PopupItem.ordering_pro.name_last, <?=$category?>PopupItem.ordering_pro.name_first].filter(Boolean).join(', ')">
                     </div>
-                    <div v-if="<?=$category?>PopupItem.has_ordering_pro_signed" class="text-success text-nowrap">
-                        <i class="fa fa-check mr-1"></i>Signed
+                    <div v-if="<?=$category?>PopupItem.has_ordering_pro_signed" class="d-flex align-items-baseline">
+                        <span class="text-success text-nowrap"><i class="fa fa-check mr-1"></i>Signed</span>
+                        <span class="text-primary c-pointer text-nowrap ml-2"
+                              v-on:click.prevent="undoSignAsOrderingPro(<?=$category?>PopupItem)">
+                            <i class="fa fa-undo mr-1"></i>
+                        </span>
                     </div>
                     <div v-if="<?=$category?>PopupItem.ordering_pro_id === <?=$pro->id?>" class="ml-2 text-nowrap">
                         <span v-if="!<?=$category?>PopupItem.has_ordering_pro_signed"
@@ -86,7 +90,7 @@
         </div>
     </div>
 
-    <div v-if="<?=$category?>PopupMode === 'edit'" class="row">
+    <div v-if="'<?=$category?>' !== 'other' && <?=$category?>PopupMode === 'edit'" class="row">
         <div class="col-3 d-inline-flex align-items-center">
             <label class="text-secondary m-0">Ticket PDF</label>
         </div>

+ 2 - 2
resources/views/app/patient/tickets/header-end.blade.php

@@ -1,5 +1,5 @@
 <div v-if="<?=$category?>PopupMode === 'edit'" class="ml-auto mr-3">
-    <!--<a v-if="<?=$category?>PopupItem.is_open" href="#"
+    <a v-if="<?=$category?>PopupItem.is_open" href="#"
        class="btn btn-sm btn-default border bg-white text-dark text-nowrap shadow-none"
        v-on:click.prevent="closeItem(<?=$category?>PopupItem)">
         <i class="fa fa-check text-success mr-2"></i>Mark Complete
@@ -8,6 +8,6 @@
        class="btn btn-sm btn-success text-nowrap text-white shadow-none"
        v-on:click.prevent="openItem(<?=$category?>PopupItem)">
         <i class="fa fa-check mr-2"></i>Complete
-    </a>-->
+    </a>
 </div>
 <a href="#" class="text-secondary" onclick="return closeStagPopup()"><i class="fa fa-chevron-right"></i></a>

+ 4 - 23
resources/views/app/patient/tickets/other.blade.php

@@ -1,23 +1,4 @@
 <div class="my-4">
-    <div class="d-flex align-items-end mb-3">
-        <h4 class="font-weight-bold m-0 text-secondary font-size-16">Other
-            <span v-if="statusFilter === 'open'" class="text-secondary font-weight-normal">(@{{ otherNumOpen }} open)</span>
-            <span v-if="statusFilter === 'closed'" class="text-secondary font-weight-normal">(@{{ otherNumClosed }} closed)</span>
-            <span v-if="statusFilter === 'all'" class="text-secondary font-weight-normal">(@{{ otherNumOpen }} open, @{{ otherNumClosed }} closed)</span>
-        </h4>
-        <!--<a class="px-3 c-pointer font-weight-bold"
-           v-on:click.prevent="otherShowPopup()">+ New</a>-->
-        <a class="py-0 font-weight-normal c-pointer flex-grow-1 text-right pr-2"
-           v-if="!otherCollapsed"
-           v-on:click.prevent="otherCollapsed = true">
-            <i class="text-secondary fa fa-chevron-up"></i>
-        </a>
-        <a class="py-0 font-weight-normal c-pointer flex-grow-1 text-right pr-2"
-           v-if="otherCollapsed"
-           v-on:click.prevent="otherCollapsed = false">
-            <i class="text-secondary fa fa-chevron-down"></i>
-        </a>
-    </div>
     <div class="ticket-section" :class="otherCollapsed ? 'ticket-section-collapsed' : ''">
         <table class="table table-sm tickets-table mb-0 border-bottom">
             <tbody>
@@ -96,19 +77,19 @@
             </div>
 
             <!-- attachments -->
-            @include('app.patient.tickets.attachments', ['category' => 'other'])
+            {{--@include('app.patient.tickets.attachments', ['category' => 'other'])--}}
 
             <!-- bills -->
-            <div class="px-3 py-3 border-top" v-if="otherPopupMode !== 'add'">
+            <!--<div class="px-3 py-3 border-top" v-if="otherPopupMode !== 'add'">
                 <a class="mb-0 font-weight-normal font-size-16 d-flex align-items-center"
                    native target="_blank"
                    open-in-stag-popup
                    popup-style="tall"
                    title="Admin. Bills"
-                   :href="'/generic-bill-view/Ticket/' + otherPopupMode.uid">
+                   :href="'/generic-bill-view/Ticket/' + otherPopupItem.uid">
                     Admin. Bills
                 </a>
-            </div>
+            </div>-->
 
             <!-- comments -->
             @include('app.patient.tickets.comments', ['category' => 'other'])

+ 1 - 1
resources/views/app/ticket/other.blade.php

@@ -28,7 +28,7 @@
 </section>
 
 <?php $otherData = json_decode($ticket->data); ?>
-<div style="margin: 1.5rem 0 1rem; font-weight: bold; opacity: 0.5"><span style="font-size: 24px">R</span><span style="font-size: 16px">x</span></div>
+<div style="margin: 1.5rem 0 1rem; font-weight: bold; opacity: 0.5">&nbsp;</div>
 <section style="font-size: 15px;">
     <table cellpadding="0" cellspacing="0" border="0" style="width: 100%">
         <tr>

+ 4 - 0
resources/views/layouts/patient.blade.php

@@ -148,6 +148,10 @@ $isOldClient = (date_diff(date_create(config('app.point_impl_date')), date_creat
 							</ul>
 							*/ ?>
 						</li>
+						<li class="nav-item">
+							<a class="nav-link {{ strpos($routeName, 'patients.view.patient-tickets') === 0 && @$type === '' ? 'active' : '' }}"
+							   href="{{ route('patients.view.patient-tickets', ['patient' => $patient, 'type' => '']) }}">Tickets</a>
+						</li>
 						@if($isOldClient)
 						<li class="nav-item">
 							<a class="nav-link {{ strpos($routeName, 'patients.view.patient-tickets') === 0 ? 'active' : '' }}"