Order history
Small fixes
This commit is contained in:
miroman-afk
2022-04-12 01:43:05 +03:00
parent 85fd6af04f
commit 53dfb77d7a
9 changed files with 286 additions and 70 deletions

View File

@@ -21,8 +21,8 @@
})
.controller('DashboardCtrl', DashboardCtrl);
DashboardCtrl.inject = ['$scope', 'smartRequest', '$interval', '$location'];
function DashboardCtrl($scope, smartRequest, $interval, $location) {
DashboardCtrl.inject = ['$scope', 'smartRequest', '$interval', '$location', 'Notification'];
function DashboardCtrl($scope, smartRequest, $interval, $location, Notification) {
$(document).ready(function() {
if (moment(moment().format('YYYY-MM-DD')).isAfter('2021-12-25')) {
if (moment(moment().format('YYYY-MM-DD')).isBefore('2022-01-10')) {
@@ -105,7 +105,7 @@
$scope.deleted_sum = 0;
$scope.discounts = 0;
$scope.discounts_sum = 0;
$scope.bill = 0;
$scope.personals = [];
$scope.dishes = [];
@@ -335,6 +335,13 @@
task: 'online',
terminal: $scope.terminalId,
}, function(data) {
$('#preload-modal').modal();
setTimeout(function() {
Notification.success('Данные синхронизируются. Обновите страницу через 5 минут.');
$('#preload-modal').modal('toggle');
}, 5000);
});
}
});
@@ -728,6 +735,7 @@
$scope.order = data;
smartRequest.get('v1/orderhistory?order_id=' + order.number, function (actions) {
$scope.actions = actions;
console.log(actions);
});
$('#items-total').modal('toggle');
});

View File

@@ -184,9 +184,8 @@
<div class="box-body b-t">
<h4 class="m-a-0 text-md" ng-if="namedGuests > 0">
<a>
{{namedGuests}}
<span class="text-sm">{{ GetCountNamedGuests(namedGuests) }}. Сумма заказов: </span>
{{sumNamedGuests | curr}}
<span class="text-sm lead"><strong>Сумма заказов: {{sumNamedGuests | curr}} BYN</strong></span>
</a>
</h4>
<span class="text-muted" ng-if="namedGuests == 0">Именованных гостей нет</h4>
@@ -612,4 +611,8 @@
<div class="modal fade" id="items-delete">
<div ui-include="'../views/dashboard/items/items-delete.html'"></div>
</div>
<div class="modal fade" id="preload-modal" data-backdrop="true">
<div ui-include="'../views/dashboard/preload.html'"></div>
</div>

View File

@@ -1,55 +0,0 @@
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-toggle="modal" data-target="#items-total" ng-click="returnModal('total')">
<i class="material-icons md-24">arrow_back</i>
</button>
<h5 class="modal-title" style="padding-bottom: 12px;">Подробнее о заказе № {{ order.title }}</h5>
<div class="row">
<div class="col-xs-6 col-md-3">
<p class="text-muted m-b-0">Открыт</p>
<p class="m-b-0">{{ order.who_open }}</p>
<p class="m-b-0">{{ order.opened }}</p>
</div>
<div class="col-xs-6 col-md-3">
<div ng-if="getClosedDate(order.closed) == NOT_CLOSED">
<p class="text-muted m-b-0">{{NOT_CLOSED}}</p>
</div>
<div ng-if="getClosedDate(order.closed) != NOT_CLOSED">
<p class="text-muted m-b-0">Закрыт</p>
<p class="m-b-0">{{ order.who_close }}</p>
<p class="m-b-0">{{ order.closed }}</p>
</div>
</div>
</div>
</div>
<div class="modal-body p-lg">
<div class="table-responsive">
<table class="table m-a-0">
<thead>
<tr>
<th>Блюдо</th>
<th>Количество</th>
<th class="text-right">Сумма, BYN</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in order.items">
<td>{{ item.name }}</td>
<td>{{ item.count }}</td>
<td class="text-right">{{ item.sale_price | curr }}</td>
</tr>
</tbody>
<thead>
<tr>
<th colspan="2"></th>
<th class="text-right">Итого: {{ order.total | curr }} BYN</th>
</tr>
</thead>
</table>
</div>
</div>
</div>
</div>

View File

@@ -21,6 +21,9 @@
<p class="m-b-0">{{ order.closed }}</p>
</div>
</div>
<div class="col-xs-6 col-md-3">
<p class="text-muted m-b-0">Распечатано предчеков: <span class="m-b-0">{{ actions.bill }}</span></p>
</div>
</div>
</div>
<div class="modal-body p-lg">
@@ -33,6 +36,12 @@
<li class="nav-item">
<a class="nav-link" href="" data-toggle="tab" data-target="#tab2" aria-expanded="false">Журнал заказа</a>
</li>
<li class="nav-item" ng-if="actions.slice_trigger == 1">
<a class="nav-link" href="" data-toggle="tab" data-target="#tab3" aria-expanded="false">История разбиения</a>
</li>
<li class="nav-item" ng-if="actions.merge_trigger == 1">
<a class="nav-link" href="" data-toggle="tab" data-target="#tab4" aria-expanded="false">История объединения</a>
</li>
</ul>
</div>
<div class="tab-content p-a m-b-md">
@@ -62,6 +71,7 @@
</table>
</div>
</div>
<!-- Журнал заказа -->
<div class="tab-pane animated fadeIn text-muted" id="tab2" aria-expanded="false">
<div class="table-responsive">
<table class="table m-a-0">
@@ -86,6 +96,52 @@
</table>
</div>
</div>
<!--Разбиение заказа-->
<div ng-if="actions.slice_trigger == 1" class="tab-pane animated fadeIn text-muted" id="tab3" aria-expanded="false">
<div ng-repeat="sliced_order_item in actions.sliced_order_items">
<p class="text-muted m-b-0">Товары перенесенные в заказ №<span class="m-b-0">{{ sliced_order_item.order }}</span></p>
<div class="table-responsive">
<table class="table m-a-0">
<thead>
<tr>
<th>Наименование</th>
<th>Количество</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in sliced_order_item.items">
<td>{{ item.name }}</td>
<td>{{ item.count }}</td>
</tr>
</tbody>
</table>
</div>
<hr>
</div>
</div>
<!--Объединение заказа-->
<div ng-if="actions.merge_trigger == 1" class="tab-pane animated fadeIn text-muted" id="tab4" aria-expanded="false">
<div ng-repeat="merged_order_item in actions.merged_order_items">
<p class="text-muted m-b-0">Товары перенесенные из заказа №<span class="m-b-0">{{ merged_order_item.order }}</span></p>
<div class="table-responsive">
<table class="table m-a-0">
<thead>
<tr>
<th>Наименование</th>
<th>Количество</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="item in merged_order_item.items">
<td>{{ item.name }}</td>
<td>{{ item.count }}</td>
</tr>
</tbody>
</table>
</div>
<hr>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,5 @@
<div class="ng-scope">
<div id="loader-wrapper">
<div id="loader"></div>
</div>
</div>