-Add new setting "Delete shift"
-Move "Shift" frontend to V1 module
This commit is contained in:
miroman-afk
2022-02-01 01:55:15 +03:00
parent 57949aa89a
commit 5497b611ef
29 changed files with 1359 additions and 3 deletions

View File

@@ -0,0 +1,34 @@
<div class="padding">
<div class="col-md-6">
<div class="row">
<h4 class="text-muted" style="margin-bottom: 40px;" ng-if="modules.length > 0">Доступные обновления модулей</h4>
<h4 class="text-muted" style="margin-bottom: 40px;" ng-if="modules.length === 0">Нет доступных обновлений</h4>
<div ng-if="modules.length > 0">
<div class="box">
<div class="table-responsive">
<table class="table">
<thead>
<tr>
<th><input type="checkbox" ng-click="toggleAll()" ng-model="isAllSelected"> Выбрать все</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="module in modules">
<td>
<input type="checkbox" ng-model="module.selected" ng-change="optionToggled()">
<strong>{{ module.name }}</strong>
<br> У вас установлена версия {{ module.version }}.
<strong>Обновите до {{ module.l_version }}</strong>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<button class="btn success pull-right" id="btn-download" ng-click="updateModules()">Обновить модули</button>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,17 @@
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h5 class="modal-title">Активация модуля {{ selectedModule.name }}</h5>
</div>
<div class="modal-body p-lg">
<div class="form-horizontal">
<div class="form-group">
<label class="form-control-label">Введите ключ</label>
<input type="text" class="form-control" placeholder="XXXX-XXXX-XXXX" ng-model="key" autofocus>
</div>
<button class="btn success p-x-md pull-right" id="btn-activated" ng-click="activateModule()">Активировать</button>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,29 @@
<div class="padding">
<h4 class="text-muted" style="margin-bottom: 40px;" ng-if="modules.length > 0">Дополнительные модули</h4>
<div class="row">
<div class="col-md-3" ng-if="modules.length > 0" ng-repeat="module in modules">
<div class="box">
<div class="item">
<img ng-src="{{ module.image }}" class="w-full" width="275" height="170">
</div>
<div class="p-a">
<div class="m-b">
<a class="_800">{{ module.name }}</a>
<div class="text-muted m-b-xs">
<span class="m-r">Автор: {{ module.author }}</span>
</div>
<p class="h-3x">{{ module.description }}</p>
</div>
<div>
<button class="btn success btn-block" ng-click="showModuleActivate(module.id)">Активировать</button>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="activate-module">
<div ui-include="'../views/modules/items/activate.html'"></div>
</div>

View File

@@ -0,0 +1,57 @@
<div class="padding">
<div class="box">
<div class="table-responsive">
<table class="table table-bordered m-a-0">
<thead>
<tr>
<th>Параметр</th>
<th>Значение</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="setting in settings">
<td>{{ setting.name }}</td>
<td>
<input type="text" class="form-control" ng-model="setting.value" ng-keyup="onSettingChange(setting)"
/>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="padding">
<div class="box">
<div class="box-header b-b">
<h3>Импорт реализации</h3>
</div>
<div class="box-body">
<div class="col-md-6">
<div class="form-group">
<label for="terminalKey">Terminal key</label>
<input type="number" class="form-control" ng-model="terminalKey">
</div>
</div>
<div class="col-md-6">
<div class="form-group">
<label for="menuCode">Menu</label>
<input type="number" class="form-control" ng-model="menuCode">
</div>
</div>
<button class="btn success p-x-md" ng-click="createBot()">Загрузить</button>
</div>
</div>
</div>
<div class="padding">
<div class="box">
<div class="box-header b-b">
<h3>Перенос кодов</h3>
</div>
<div class="box-body">
<button class="btn success p-x-md" ng-click="switchDishes()">Перенос блюд</button>
</div>
</div>
</div>

View File

@@ -59,6 +59,7 @@
<a class="dropdown-item" ng-click="reportPay(shift)">По отделам</a>
<a class="dropdown-item" ng-click="reportOut(shift)">По внешним заказам</a>
<a class="dropdown-item" ng-click="restoreShift(shift)">Восстановить смену</a>
<a class="dropdown-item" ng-if="delete_shift_value > 0" ng-click="deleteShift(shift)">Удалить смену</a>
</div>
</div>
</td>

View File

@@ -0,0 +1,50 @@
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h5 class="modal-title">Управление синхронизацией</h5>
</div>
<div class="modal-body p-lg">
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<th>Задача</th>
<th>Период</th>
<th style="width: 70px">Статус</th>
<th style="width: 70px"><i class="material-icons">&#xE3E7;</i></th>
</thead>
<tbody>
<tr ng-repeat="task in active_tasks">
<td>{{ task.name }} <span class="label primary m-r-xs left5">{{ task.code }}</span></td>
<td><input type="number" class="form-control" ng-model="task.period" ng-change="changePeriod(task)" /></td>
<td>
<label class="ui-switch ui-switch-md m-t-xs">
<input type="checkbox" checked="checked" ng-change="changeTask(task)" ng-model="task.active" />
<i></i>
</label>
</td>
<td>
<button class="btn btn-sm white" ng-click="runTask(task)"><i class="material-icons">&#xE037;</i></button>
</td>
</tr>
<tr ng-repeat="task in all_tasks" ng-if="isTaskActive(task)">
<td>{{ task.name }} <span class="label primary m-r-xs left5">{{ task.code }}</span></td>
<td><input type="number" class="form-control" ng-model="task.period" ng-change="changePeriod(task)" /></td>
<td>
<label class="ui-switch ui-switch-md m-t-xs">
<input type="checkbox" ng-change="changeTask(task)" ng-model="task.active" />
<i></i>
</label>
</td>
<td>
<button class="btn btn-sm white" ng-click="runTask(task)"><i class="material-icons">&#xE037;</i></button>
</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,118 @@
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h5 class="modal-title">Принтеры</h5>
</div>
<div class="modal-body p-lg">
<div class="col-sm-12">
<div class="b-b b-primary nav-active-primary">
<ul class="nav nav-tabs">
<li ng-repeat="printer in printers" class="nav-item">
<a class="nav-link" href="" data-toggle="tab" data-target="#p{{printer.id}}" aria-expanded="false">Принтер: {{printer.name}}</a>
</li>
</ul>
</div>
<div class="tab-content p-a m-b-md">
<div ng-repeat="printer in printers" class="tab-pane animated fadeIn text-muted" id="p{{printer.id}}" aria-expanded="false">
<div class="form-horizontal">
<div ng-if="objectHasProperty(printer, 'type')" class="form-group row">
<label class="col-sm-3 form-control-label">Тип</label>
<div class="col-sm-9">
<select name="size" class="form-control input-c" ng-model="printer.type" ng-options="type for type in settings.types"></select>
</div>
</div>
<div ng-if="objectHasProperty(printer, 'ip') && printer.type == 'LAN'" class="form-group row">
<label class="col-sm-3 form-control-label">IP</label>
<div class="col-sm-9">
<input ng-model="printer.ip" type="text" class="form-control">
</div>
</div>
<div ng-if="objectHasProperty(printer, 'port') && printer.type == 'LAN'" class="form-group row">
<label class="col-sm-3 form-control-label">Порт</label>
<div class="col-sm-9">
<input ng-model="printer.port" type="number" class="form-control">
</div>
</div>
<div ng-if="objectHasProperty(printer, 'com_port') && printer.type == 'COM'" class="form-group row">
<label for="" class="col-sm-3 form-control-label">COM Порт</label>
<div class="col-sm-9">
<select name="speed" class="form-control input-c" ng-model="printer.com_port" ng-options="com_port for com_port in settings.com_ports"></select>
</div>
</div>
<div class="form-group row">
<label class="col-sm-3 form-control-label">Бумага</label>
<div class="col-sm-9">
<select name="size" class="form-control input-c" ng-model="printer.size" ng-options="size for size in settings.sizes"></select>
</div>
</div>
<div ng-if="objectHasProperty(printer, 'speed') && printer.type == 'COM'" class="form-group row">
<label class="col-sm-3 form-control-label">Скорость</label>
<div class="col-sm-9">
<select name="speed" class="form-control input-c" ng-model="printer.speed" ng-options="speed for speed in settings.speeds"></select>
</div>
</div>
<div ng-if="objectHasProperty(printer, 'codepage')" class="form-group row">
<label for="" class="col-sm-3 form-control-label">Кодовая страница</label>
<div class="col-sm-9">
<select name="codepage" ng-model="printer.codepage" class="form-control input-c">
<option value="EPSON">EPSON</option>
<option value="WINCOR">WINCOR</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-sm-3 form-control-label">Группа</label>
<div class="col-sm-9">
<select name="codepage" ng-model="printer.printer_group" class="form-control input-c">
<option ng-repeat="group in groups" value={{group.code}}>{{group.name}}</option>
</select>
</div>
</div>
<div class="form-group row">
<label class="col-sm-3 form-control-label">Шаблон</label>
<div class="col-sm-9">
<select name="template" ng-model="printer.template" class="form-control input-c">
<option value="Epson">Epson</option>
<option value="Posbank">Posbank</option>
<option value="Wincor">Wincor</option>
<option value="Spark">Spark</option>
</select>
</div>
</div>
<div ng-if="objectHasProperty(printer, 'driver') && printer.type == 'Windows'" class="form-group row">
<label class="col-sm-3 form-control-label">Драйвер</label>
<div class="col-sm-9">
<input ng-model="printer.driver" type="text" class="form-control">
</div>
</div>
<div class="form-group row">
<label class="col-sm-3 form-control-label">Дополнительный текст</label>
<div class="col-sm-9">
<textarea class="form-control" ng-model="printer.more"></textarea>
</div>
</div>
<div class="row">
<div class="col-sm-12">
<button class="btn btn-fw primary pull-right" ng-click="updateEquipment(printer)">Сохранить
изменения
</button>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,74 @@
<div id="container-floating">
<div class="nd1 nds" data-toggle="tooltip" data-placement="left" title="Обновить" ng-click="update()" style="background-color: #d3a411"
onmouseenter="$(this).tooltip('show')">
<i class="material-icons">&#xE5D5;</i>
</div>
<div id="floating-button" data-toggle="tooltip" data-placement="left" title="Действия" onmouseenter="$(this).tooltip('show')">
<p class="plus">
<i class="material-icons">&#xE5D2;</i>
</p>
<p class="edit">
<i class="material-icons">&#xE5CD;</i>
</p>
</div>
</div>
<div class="padding">
<div class="box">
<!-- <div class="table-responsive"> -->
<table class="table table-striped m-a-0">
<thead>
<tr>
<th>ID</th>
<th>Тип</th>
<th>Код рабочей группы</th>
<th>Код рабочего места</th>
<th>Статус</th>
<th>Последняя активность</th>
<th style="width: 70px"><i class="material-icons">&#xE3E7;</i></th>
</tr>
</thead>
<tbody>
<tr ng-repeat="terminal in terminals">
<td><strong>{{ terminal.key }}</strong></td>
<td><strong>{{ terminal.soft }}</strong></td>
<td>{{ terminal.work_group }}</td>
<td>{{ terminal.work_code }}</td>
<td>
<label class="ui-switch ui-switch-md m-t-xs">
<input type="checkbox" ng-model="terminal.is_active" ng-change="onLicence(terminal.key, terminal.is_active)">
<i></i>
</label>
</td>
<td><span ng-if="terminal.last_activity != '0'">{{ terminal.last_activity }}</span></td>
<td>
<div class="dropdown inline">
<button class="btn btn-sm white dropdown-toggle" data-toggle="dropdown">
<i class="material-icons">&#xE5D2;</i>
</button>
<div class="dropdown-menu pull-right dropdown-menu-scale">
<a class="dropdown-item" ng-click="editTerminal(terminal.key)">Управление синхронизацией</a>
<a class="dropdown-item" ng-click="getEquipment(terminal.key)">Принтеры</a>
<a class="dropdown-item" ng-click="showLogs(terminal.key)">Журнал</a>
</div>
</div>
</td>
</tr>
</tbody>
</table>
<!-- </div> -->
</div>
</div>
<div class="modal fade" id="edit-terminal" data-backdrop="true">
<div ui-include="'../views/terminals/edit.html'"></div>
</div>
<div class="modal fade" id="equipment" data-backdrop="true">
<div ui-include="'../views/terminals/equipment.html'"></div>
</div>
<div class="modal fade" id="logs" data-backdrop="true">
<div ui-include="'../views/terminals/logs.html'"></div>
</div>

View File

@@ -0,0 +1,27 @@
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h5 class="modal-title">Логи терминала</h5>
</div>
<div class="modal-body p-lg">
<div class="table-responsive">
<table class="table table-bordered">
<thead>
<tr>
<th>Log</th>
<th>Time</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="log in terminalLogs">
<td>{{log.value}}</td>
<td>{{log.time}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,35 @@
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<button type="button" class="close" data-dismiss="modal">&times;</button>
<h5 class="modal-title">Отчет по удалениям</h5>
</div>
<div class="modal-body p-lg">
<div class="table-responsive" ng-if="report_delete.length > 0">
<table class="table table-bordered m-a-" ng-repeat="report in report_delete">
<thead>
<th>Заказ #{{ report.order_code }}</th>
</thead>
<tbody>
<tr ng-repeat="item in report.items">
<td>
<h6>{{ item.dish_name }} <small>(<strong>{{ item.count }}</strong> на сумму <strong>{{ item.sum }} BYN</strong>)</small></h6>
<p>
Удалил: <strong>{{ item.who }}</strong><br/>
Подтвердил: <strong>{{ item.approved }}</strong><br/>
Причина: <strong>{{ item.reason }}</strong>
</p>
</td>
</tr>
</tbody>
</table>
</div>
<div ng-if="report_delete.length == 0">
<p>Удаления отсутствуют</p>
</div>
</div>
</div>
</div>

View File

@@ -0,0 +1,27 @@
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Создание пользователя</h5>
</div>
<div class="modal-body text-center p-lg">
<form role="form" class="ng-pristine ng-valid container">
<div class="form-group row">
<div class="col-sm-12"><input class="form-control" id="new-login" placeholder="Логин" type="text" ng-model="newUser.login"></div>
</div>
<div class="form-group row">
<div class="col-sm-12"><input class="form-control" id="new-name" placeholder="Имя" type="text" ng-model="newUser.name"></div>
</div>
<div class="form-group row">
<div class="col-sm-12"><input class="form-control" id="new-password" placeholder="Пароль" type="password" ng-model="newUser.password"></div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn dark-white p-x-md" data-dismiss="modal">Отмена</button>
<button type="button" class="btn success p-x-md" ng-click="create()">Создать</button>
</div>
</div>
</div>

51
web/views/users/edit.html Normal file
View File

@@ -0,0 +1,51 @@
<div class="modal-dialog modal-lg">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Редактирование пользователя</h5>
</div>
<div class="modal-body p-lg">
<form role="form" class="ng-pristine ng-valid container">
<div class="form-group row">
<div class="col-sm-12"><input class="form-control" id="current-login" placeholder="Логин" type="text" ng-model="currentUser.login"></div>
</div>
<div class="form-group row">
<div class="col-sm-12"><input class="form-control" id="current-name" placeholder="Имя" type="text" ng-model="currentUser.name"></div>
</div>
<div class="form-group row">
<div class="col-sm-12"><input class="form-control" id="current-password" placeholder="Пароль" type="password" ng-model="currentUser.password"></div>
</div>
</form>
<hr />
<div class="table-responsive">
<table class="table table-bordered table-hover">
<thead>
<th>Право</th>
<th>Статус</th>
</thead>
<tbody>
<tr ng-repeat="right in currentUser.rights">
<td>{{ right.name }}</td>
<td style="width: 90px">
<label class="ui-switch ui-switch-md m-t-xs">
<input type="checkbox" ng-model="right.is_active" ng-change="onRight(right.code)">
<i></i>
</label>
</td>
</tr>
</tbody>
</table>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn danger p-x-md pull-left" data-toggle="modal" data-target="#edit-user-confirm-delete"><i class="material-icons">&#xE872;</i></button>
<button type="button" class="btn dark-white p-x-md" data-dismiss="modal">Отмена</button>
<button type="button" class="btn success p-x-md" ng-click="save()">Сохранить</button>
</div>
</div>
</div>

View File

@@ -0,0 +1,58 @@
<div id="container-floating">
<div class="nd3 nds" data-toggle="tooltip" data-placement="left" title="Создать" ng-click="add()" style="background-color: #3c80f6" onmouseenter="$(this).tooltip('show')">
<i class="material-icons">&#xE145;</i>
</div>
<div class="nd1 nds" data-toggle="tooltip" data-placement="left" title="Обновить" ng-click="update()" style="background-color: #d3a411" onmouseenter="$(this).tooltip('show')">
<i class="material-icons">&#xE5D5;</i>
</div>
<div id="floating-button" data-toggle="tooltip" data-placement="left" title="Действия" onmouseenter="$(this).tooltip('show')">
<p class="plus"><i class="material-icons">&#xE5D2;</i></p>
<p class="edit"><i class="material-icons">&#xE5CD;</i></p>
</div>
</div>
<div class="padding">
<div class="box">
<div class="table-responsive">
<table class="table table-bordered m-a-0 table-hover">
<thead>
<tr>
<th>ID</th>
<th>Логин</th>
<th>Имя</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="user in users" ng-click="edit(user)">
<td>{{ user.id }}</td>
<td>{{ user.login }}</td>
<td>{{ user.name }}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div class="modal fade" id="edit-user" data-backdrop="true">
<div ui-include="'../views/users/edit.html'"></div>
</div>
<div class="modal fade" id="new-user" data-backdrop="true">
<div ui-include="'../views/users/create.html'"></div>
</div>
<div id="edit-user-confirm-delete" class="modal confirm-box" data-backdrop="true" style="z-index: 1052">
<div class="bottom white b-b" style="height: 90px">
<div class="confirm-box-body p-lg">
<p>Вы действительно хотите удалить пользователя?</p>
</div>
<div class="confirm-box-footer">
<button type="button" class="btn dark-white p-x-md" data-dismiss="modal">Нет</button>
<button type="button" class="btn danger p-x-md" ng-click="delete()">Да</button>
</div>
</div>
</div>

33
web/views/users/logs.html Normal file
View File

@@ -0,0 +1,33 @@
<div class="padding">
<div class="box">
<div class="table-responsive">
<table class="table table-bordered m-a-0">
<thead>
<tr>
<th>Log ID</th>
<th>User</th>
<th>Module</th>
<th>Action type</th>
<th>Action</th>
<th>Old value</th>
<th>New value</th>
<th>Время</th>
</tr>
</thead>
<tbody>
<tr ng-repeat="log in logs">
<td>{{log.id}}</td>
<td>{{log.user}}</td>
<td>{{log.module}}</td>
<td>{{log.action_type}}</td>
<td>{{log.action}}</td>
<td>{{log.old_value}}</td>
<td>{{log.new_value}}</td>
<td>{{log.time}}</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>