Редактор карты зала
Электронные заказы
Отчет по удалениям
This commit is contained in:
miroman-afk
2022-09-22 16:34:02 +03:00
parent 1af2b267f5
commit dcd0e72d1f
43 changed files with 2481 additions and 727 deletions

View File

@@ -200,10 +200,25 @@
$scope.selectedMenuElement = {};
$scope.selectMenuNavigationStack = [];
$scope.enterCount = function(orderId, itemId) {
$('#edit-selectmenuitem').modal('hide');
$('#edit-item-count').modal('toggle');
$scope.itemId = itemId;
$scope.enterCount = function(item, orderId, itemId) {
$('#edit-item-count').modal('toggle');
$scope.itemId = item.id;
$scope.orderId = orderId;
console.log(item);
};
$scope.updateCount = function(item, count) {
item.item_count = parseFloat(count);
smartRequest.post('v1/orderitem', {
task: 'update',
id: $scope.itemId,
order_id: $scope.orderId,
item_count: item.item_count
}, function(data) {
$scope.update();
$scope.getOrder($scope.orderId);
});
};
$scope.getOrder = function(orderId, newOrder) {

View File

@@ -57,7 +57,7 @@
};
$scope.reportDelete = function() {
smartRequest.get('report/deleted?start_date=' + encodeURIComponent($scope.start_date) + '&end_date=' + encodeURIComponent($scope.end_date), function(data) {
smartRequest.get('v1/datareport?type=deleted&start_date=' + encodeURIComponent($scope.start_date) + '&end_date=' + encodeURIComponent($scope.end_date), function(data) {
$scope.report_delete = data.deleted;
$scope.report_delete.total_sum = data.total_sum;
$scope.report_delete.total_count = data.total_count;

235
web/controllers/roommap.js Normal file
View File

@@ -0,0 +1,235 @@
(function () {
'use strict';
angular
.module('app', ['angular.drag.resize', 'ng-context-menu'])
.controller('RoommapCtrl', RoommapCtrl);
RoommapCtrl.$inject = ['$scope', 'smartRequest', 'Notification', '$http'];
function RoommapCtrl($scope, smartRequest, Notification, $http) {
$scope.places = [];
$scope.tables = [];
$scope.newTables = [];
$scope.newTables2 = [];
$scope.roommap = [];
$scope.newElement = 0;
$('#create_table').hide();
$('#create_place').show();
$('#places').show();
$('#background').hide();
$('#save_tables').hide();
$('#save_places').hide();
$('#back').hide();
$scope.getRoomMap = function () {
smartRequest.get('v1/roommap?type=full', function (data) {
$('#back').hide();
$('#save_tables').hide();
$('#save_places').hide();
$scope.roommap = data.roommap;
Notification.success(data.status);
});
};
$scope.getRoomMap();
$scope.alignTables = function () {
$scope.tables.forEach(function (table) {
var newArr = [];
var goal = table.x;
$scope.tables.forEach(function (el) {
var middle = Math.abs(goal - el.x);
if (middle <= 15) {
newArr.push(el);
}
});
let xSum = 0;
const len = newArr.length;
let item = null;
for (let i = 0; i < len; i++) {
item = newArr[i];
xSum = item.x + xSum;
}
const averageX = Math.round(xSum / len);
newArr.forEach(function (el) {
$scope.tables.forEach((elem) => elem.id === el.id ? elem.x = averageX : elem.x = elem.x);
});
});
$scope.tables.forEach(function (table) {
var newArr = [];
var goal = table.y;
$scope.tables.forEach(function (el) {
var middle = Math.abs(goal - el.y);
if (middle <= 15) {
newArr.push(el);
}
});
let ySum = 0;
const len = newArr.length;
let item = null;
for (let i = 0; i < len; i++) {
item = newArr[i];
ySum = item.y + ySum;
}
const averageY = Math.round(ySum / len);
newArr.forEach(function (el) {
$scope.tables.forEach((elem) => elem.id === el.id ? elem.y = averageY : elem.y = elem.y);
});
});
$('#save_tables').show();
$('#back').show();
return $scope.tables;
};
$scope.getTables = function (place_id) {
$('#places').hide();
$('#background').show();
$('#create_table').show();
$('#create_place').hide();
$('#back').show();
$scope.maxWidth = 1024;
$scope.windowHeight = window.innerHeight - (document.getElementById('view').clientHeight - document.getElementById('tables').clientHeight);
$scope.screenHeight = screen.height;
$scope.windowWidth = window.innerWidth;
$scope.screenWidth = 69;
smartRequest.get('v1/roommap?type=place&id=' + place_id, function (data) {
$scope.place = data.place;
$scope.place_id = data.place_id;
Notification.success(data.status);
$scope.left = document.getElementById('tables').getBoundingClientRect().left;
$scope.top = parseInt(document.getElementById('view').clientHeight) - parseInt(document.getElementById('background_1').offsetHeight) - 2;
$scope.percentWidth = document.getElementById('tables').clientWidth / 1024;
$scope.percentHeight = document.getElementById('tables').clientHeight / 768;
$scope.tables = data.tables;
console.log($scope.tables);
});
};
$scope.getCoords = function ($event, $index, table_id, place) {
switch ($event.which) {
case 1:
var id = '#table_' + $index;
$scope.element = $(id);
$scope.parentOffset = $scope.element.offset();
var parentPos = document.getElementById('tables').getBoundingClientRect(),
childrenPos = document.getElementById('table_' + $index).getBoundingClientRect(),
relativePos = {};
relativePos.top = childrenPos.top - parentPos.top,
relativePos.right = childrenPos.right - parentPos.right,
relativePos.bottom = childrenPos.bottom - parentPos.bottom,
relativePos.left = childrenPos.left - parentPos.left;
$('#save_tables').show();
$scope.tables[$index].width = Math.round(document.getElementById('table_' + $index).offsetWidth / $scope.percentWidth),
$scope.tables[$index].height = Math.round(document.getElementById('table_' + $index).offsetHeight / $scope.percentHeight),
$scope.tables[$index].x = Math.round(relativePos.top / $scope.percentHeight),
$scope.tables[$index].y = Math.round(relativePos.left / $scope.percentWidth);
break;
}
};
$scope.deleteTable = function (table_id) {
delete $scope.tables.splice(table_id, 1);
$('#save_tables').show();
return $scope.tables;
};
$scope.duplicateTable = function (index, place) {
$scope.newTable = {};
$scope.lastEl = $scope.tables.length;
$scope.newTable.id = $scope.tables[$scope.lastEl - 1].id + 1,
$scope.newTable.place_id = $scope.tables[index].place_id,
$scope.newTable.table_id = $scope.tables[$scope.lastEl - 1].table_id + 1,
$scope.newTable.name = $scope.tables[index].name,
$scope.newTable.width = $scope.tables[index].width,
$scope.newTable.height = $scope.tables[index].height,
$scope.newTable.x = $scope.tables[index].x + 50,
$scope.newTable.y = $scope.tables[index].y + 50;
$scope.tables.push($scope.newTable);
$('#save_tables').show();
return $scope.tables;
};
$scope.editTable = function ($index, table) {
$('#table-edit').modal('show');
$scope.tableWidth = table.width;
$scope.tableHeight = table.height;
$scope.tableName = table.name;
$scope.tableId = table.table_id;
$scope.tableIndex = $index;
$('#save_tables').show();
return $scope.tables;
};
$scope.saveTable = function (index, id, name, width, height) {
$('#table-edit').modal('toggle');
$scope.tables[index].width = width,
$scope.tables[index].height = height,
$scope.tables[index].name = name,
$scope.tables[index].table_id = id;
$('#save_tables').show();
return $scope.tables;
};
$scope.back = function () {
$('#places').show();
$('#background').hide();
$('#create_table').hide();
$('#create_place').show();
$('#save_tables').hide();
$('#back').hide();
$scope.tables = [];
};
$scope.saveTables = function (place_id, tables) {
console.log(tables);
smartRequest.post('v1/roommap', {
type: 'table',
action: 'savetables',
place_id: place_id,
tables: JSON.stringify(tables),
}, function (data) {
$scope.tables = [];
Notification.success(data.message);
$scope.back();
});
};
$scope.deletePlace = function (index) {
console.log(index);
delete $scope.roommap.splice(index, 1);
$('#save_places').show();
return $scope.roommap;
};
$scope.editPlace = function (index) {
};
$scope.savePlace = function (index) {
};
$scope.savePlaces = function (places) {
console.log(places);
smartRequest.post('v1/roommap', {
type: 'place',
action: 'saveplaces',
places: JSON.stringify(places),
}, function (data) {
Notification.success(data.message);
/*$scope.getRoomMap();*/
});
};
}
})();

View File

@@ -111,7 +111,7 @@
};
$scope.reportDelete = function (shift) {
smartRequest.get('report/deleted?shift_id=' + shift.id, function (data) {
smartRequest.get('v1/datareport?type=deleted&shift_id=' + shift.id, function (data) {
$scope.report_delete = data.deleted;
$scope.report_delete.total_sum = data.total_sum;
$scope.report_delete.total_count = data.total_count;

View File

@@ -7,12 +7,19 @@ item: [
order: 0
},
{
name: 'Eorders',
acl: 'eorders',
name: 'Eorders (dev)',
acl: 'eorders',
url: 'app.orders',
icon: 'dashboard',
order: 0
},
{
name: 'RoomMap (dev)',
acl: 'roommap',
url: 'app.roommap',
icon: 'dashboard',
order: 0
},
{
name: 'Гости',
acl: 'clients',

View File

@@ -22,6 +22,14 @@
controller: 'OrdersCtrl',
resolve: ['scripts/controllers/orders.js']
},
{
code: 'app.roommap',
url: '/v1/roommap',
templateUrl: '../views/roommap/index.html',
data: { title : 'RoomMap' },
controller: 'RoommapCtrl',
resolve: ['scripts/controllers/roommap.js']
},
{
code: 'app.clients',
url: '/clients',

View File

@@ -7,16 +7,16 @@
<form role="form" class="ng-pristine ng-valid container">
<div class="form-group row">
<div class="col-sm-6">
<input placeholder="Имя" ng-model="client_name" class="form-control"></input>
<input placeholder="Имя" ng-model="client_name" class="form-control">
<p>
</div>
<div class="col-sm-6">
<input ng-model="inputSearch" class="form-control" ui-mask="+375 (99) 999-99-99"></input>
<input ng-model="inputSearch" class="form-control" ui-mask="+375 (99) 999-99-99">
<p>
</div>
<br>
<div class="col-sm-12">
<input placeholder="Адрес" ng-model="client_address" class="form-control"></input>
<input placeholder="Адрес" ng-model="client_address" class="form-control">
<p>
</div>
</div>

View File

@@ -56,7 +56,7 @@
<thead>
<tr>
<th>Наимен.</th>
<th style="width: 120px; text-align: center">Количество</th>
<th style="width: 125px; text-align: center">Количество</th>
<th style="width: 80px; text-align: center">Итог</th>
<th style="width: 20px; text-align: center">#</th>
</tr>
@@ -71,12 +71,15 @@
<td>
<div class="btn-group" role="group">
<button type="button" class="btn btn-secondary btn-sm" ng-click="inOrderDecrement(item, item.item_count)" ng-disabled="item.item_count<=1">-</button>
<button type="button" class="btn btn-secondary btn-sm" ng-model="item.item_count" disabled>{{item.item_count}}</button>
<button type="button" class="btn btn-secondary btn-sm" ng-click="inOrderIncrement(item, item.item_count)">+</button>
<button type="button" class="btn btn-secondary btn-sm" ng-click="inOrderDecrement(item, item.item_count)" ng-disabled="item.item_count<=1" ng-if="item.is_real == 0">-</button>
<button type="button" class="btn btn-secondary btn-sm" ng-click="inOrderDecrement(item, item.item_count)" ng-disabled="item.item_count<=1" ng-if="item.is_real == 1" hidden>-</button>
<button type="button" class="btn btn-secondary btn-sm" ng-model="item.item_count" ng-if="item.is_real == 1" ng-click="enterCount(item, orderId, item.item_id)">{{item.item_count}}</button>
<button type="button" class="btn btn-secondary btn-sm" ng-model="item.item_count" ng-if="item.is_real == 0" disabled>{{item.item_count}}</button>
<button type="button" class="btn btn-secondary btn-sm" ng-click="inOrderIncrement(item, item.item_count)" ng-if="item.is_real == 0">+</button>
<button type="button" class="btn btn-secondary btn-sm" ng-click="inOrderIncrement(item, item.item_count)" ng-if="item.is_real == 1" hidden>+</button>
</div>
</td>
<td>{{ item.item_price * item.item_count }} BYN</td>
<td>{{ (item.item_price * item.item_count) | curr }} BYN</td>
<td>
<button type="button" class="btn danger btn-sm" ng-model="item" ng-click="deleteItem(item)">
<i class="material-icons">&#xE872;</i>
@@ -90,7 +93,6 @@
</div>
</div>
<div class="form-group row">
<div ng-if="totalCount" class="col">Количество товаров: {{totalCount}}</div>
<div ng-if="totalPrice" class="col">Итоговая сумма заказа: {{totalPrice}} BYN</div>
</div>
</form>

View File

@@ -93,4 +93,7 @@
<div class="modal fade" id="edit-selectmenuitem" data-backdrop="true" style="z-index: 1052">
<div ui-include="'../views/orders/selectmenuitem.html'"></div>
</div>
<div class="modal fade" id="edit-item-count" data-backdrop="true" style="z-index: 1052">
<div ui-include="'../views/orders/selectitemcount.html'"></div>
</div>

View File

@@ -1,20 +1,28 @@
<div class="modal-dialog">
<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-6">
<input class="form-control" placeholder="Количество" type="text" ng-model="item.count">
</div>
<div class="row-col h-v">
<div class="row-cell v-m">
<div class="modal-dialog modal-sm">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Укажите количество</h5>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn success p-x-md" ng-model="itemId" ng-click="addItem(orderId, itemId, item.count)" data-dismiss="modal">Сохранить</button>
<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">
<div class="input-group m-b">
<input type="number" class="form-control" placeholder="Количество" ng-model="item.count">
</div>
</div>
</div>
</form>
</div>
<div class="modal-footer">
<button type="button" class="btn btn-secondary" data-dismiss="modal">Close</button>
<button type="button" class="btn success p-x-md" ng-model="itemId"
ng-click="updateCount(item, item.count)" data-dismiss="modal">Сохранить
</button>
</div>
</div><!-- /.modal-content -->
</div>
</div>
</div>

View File

@@ -1,104 +0,0 @@
<div class="modal-dialog modal-list">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Выбор элемента меню</h5>
</div>
<div class="modal-body p-lg">
<div ng-if="selectMenuItemParams.currentMenu > 0">
<div class="list-item pointer no_selection" ios-dblclick="upMenuItem()">
<div class="list-left">
<span class="w-30">
<i class="material-icons" style="font-size: 30px;">&#xE2C7;</i>
</span>
</div>
<div class="list-body" style="line-height: 30px">...</div>
</div>
</div>
<div ng-if="selectMenuItemParams.currentMenu == 0">
<div class="list inset" ng-repeat="menu in selectMenuItemParams.menus">
<div class="list-item pointer no_selection" ios-dblclick="openMenuItem(menu)"
sglclick="selectItem(menu.id, 'menu', menu.name)"
ng-class="menu.id == selectedElement.value && selectedElement.type == 'menu' ? 'active' : ''">
<div class="list-left">
<span class="w-30">
<i class="material-icons" style="font-size: 30px;">&#xE2C7;</i>
</span>
</div>
<div class="list-body" style="line-height: 30px">
{{ menu.name }}
</div>
</div>
</div>
</div>
<div ng-if="selectMenuItemParams.currentMenu > 0">
<div class="list inset" ng-repeat="folder in selectMenuItemParams.folders">
<div class="list-item pointer no_selection" ios-dblclick="openFolderItem(folder)"
sglclick="selectItem(folder.id, 'folder', folder.name)"
ng-class="folder.id == selectedElement.value && selectedElement.type == 'folder' ? 'active' : ''">
<div class="list-left">
<span class="w-30">
<i class="material-icons" style="font-size: 30px;">&#xE2C7;</i>
</span>
</div>
<div class="list-body" style="line-height: 30px">
{{ folder.name }}
</div>
</div>
</div>
</div>
<div ng-if="selectMenuItemParams.currentMenu > 0">
<div class="list inset" ng-repeat="item in selectMenuItemParams.items">
<li class="list-item pointer no_selection" ng-click="selectItem(item.id, 'item', item.name)">
<div class="list-left">
<span class="w-30">
<i class="material-icons" style="font-size: 30px;">&#xE893;</i>
</span>
</div>
<div class="list-body">
<div class="container">
<div class="row justify-content-around">
<div class="col-6 col-sm-3">
{{ item.name }} <span class="text-muted">#{{ item.code }}</span>
<small class="block text-muted">{{ item.cosht | curr }} BYN</small>
</div>
<div ng-if="item.realCount" class="col-6 col-sm-4">
<div class="btn-group" role="group">
<button type="button" class="btn btn-secondary" ng-click="decrement(item, item.realCount)" ng-disabled="realCount<=0">-</button>
<button type="button" class="btn btn-secondary" ng-model="item.realCount" disabled>{{item.realCount}}</button>
<button type="button" class="btn btn-secondary" ng-click="increment(item, item.realCount)">+</button>
</div>
</div>
<div ng-if="!item.realCount" class="col-6 col-sm-4">
<div class="btn-group" role="group">
<button type="button" class="btn btn-secondary" ng-click="decrement(item, defaultCount)" ng-disabled="defaultCount<=0">-</button>
<button type="button" class="btn btn-secondary" ng-model="defaultCount" disabled>{{defaultCount}}</button>
<button type="button" class="btn btn-secondary" ng-click="increment(item, defaultCount)">+</button>
</div>
</div>
<div class="col-6 col-sm-3">
<button ng-if="!item.realCount" type="button" class="btn btn btn-success p-x-md" ng-model="orderId" ng-click="addItem(orderId, item.code, defaultCount)">+</button>
<button ng-if="item.realCount" type="button" class="btn btn btn-success p-x-md" ng-model="orderId" ng-click="addItem(orderId, item.code, item.realCount)">+</button>
</div>
</div>
</div>
</div>
<hr>
</li>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn dark-white p-x-md" data-dismiss="modal">Закрыть</button>
</div>
</div>
</div>

View File

@@ -20,60 +20,69 @@
<div ng-if="selectMenuItemParams.currentMenu == 0">
<div class="list inset" ng-repeat="menu in selectMenuItemParams.menus">
<div class="list-item pointer no_selection" ios-dblclick="openMenuItem(menu)"
sglclick="selectItem(menu.id, 'menu', menu.name)"
ng-class="menu.id == selectedElement.value && selectedElement.type == 'menu' ? 'active' : ''">
<div class="list-left">
sglclick="selectItem(menu.id, 'menu', menu.name)"
ng-class="menu.id == selectedElement.value && selectedElement.type == 'menu' ? 'active' : ''">
<div class="list-left">
<span class="w-30">
<i class="material-icons" style="font-size: 30px;">&#xE2C7;</i>
</span>
</div>
</div>
<div class="list-body" style="line-height: 30px">
{{ menu.name }}
<div class="list-body" style="line-height: 30px">
{{ menu.name }}
</div>
</div>
</div>
</div>
</div>
<div ng-if="selectMenuItemParams.currentMenu > 0">
<div class="list inset" ng-repeat="folder in selectMenuItemParams.folders">
<div class="list-item pointer no_selection" ios-dblclick="openFolderItem(folder)"
sglclick="selectItem(folder.id, 'folder', folder.name)"
ng-class="folder.id == selectedElement.value && selectedElement.type == 'folder' ? 'active' : ''">
<div class="list-left">
<div ng-if="selectMenuItemParams.currentMenu > 0">
<div class="list inset" ng-repeat="folder in selectMenuItemParams.folders">
<div class="list-item pointer no_selection" ios-dblclick="openFolderItem(folder)"
sglclick="selectItem(folder.id, 'folder', folder.name)"
ng-class="folder.id == selectedElement.value && selectedElement.type == 'folder' ? 'active' : ''">
<div class="list-left">
<span class="w-30">
<i class="material-icons" style="font-size: 30px;">&#xE2C7;</i>
</span>
</div>
</div>
<div class="list-body" style="line-height: 30px">
{{ folder.name }}
<div class="list-body" style="line-height: 30px">
{{ folder.name }}
</div>
</div>
</div>
</div>
<div class="row m-b" ng-if="selectMenuItemParams.currentMenu > 0" >
<div class="col-sm-4 col-xs-4" ng-repeat="item in selectMenuItemParams.items">
<div class="box">
<div class="box-header primary">
<h3>{{ item.cosht | curr }} BYN</h3>
<div class="box-tool">
<ul class="nav">
<li class="nav-item inline">
<a class="nav-link" ng-if="!item.realCount" type="button" class="btn btn-secondary" ng-model="orderId"
ng-click="addItem(orderId, item.code, defaultCount)">
<i class="material-icons md-18">&#xe854;</i>
</a>
</li>
</ul>
</div>
</div>
<div class="box-body">
<p class="m-0 text-left text-break" style="word-break: break-word;">{{ item.name }}</p>
</div>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn dark-white p-x-md" data-dismiss="modal">Закрыть</button>
</div>
</div>
<div class="container">
<div class="row justify-content-center inset" ng-if="selectMenuItemParams.currentMenu > 0">
<div class="col-xs-6" ng-repeat="item in selectMenuItemParams.items">
<button ng-if="!item.realCount" type="button" class="btn btn-secondary" ng-model="orderId" ng-click="addItem(orderId, item.code, defaultCount)" style="width: 160px; height: 130px; white-space: unset;">
<p>
<div style="word-wrap: break-word;">{{ item.name }}</div>
</p>
<p>
<small class="block text-muted">{{ item.cosht | curr }} BYN</small>
</p>
</button>
<p> </p>
</div>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn dark-white p-x-md" data-dismiss="modal">Закрыть</button>
</div>
</div>
</div>

View File

@@ -13,7 +13,7 @@
<div class="table-responsive" ng-if="report_delete.length > 0">
<table class="table table-bordered" ng-repeat="report in report_delete">
<thead>
<th>Смена#{{ report.shift_id }} Заказ #{{ report.order_code }}. {{ report.time }}</th>
<th>Смена#{{ report.shift_id }} Заказ #{{ report.order_code }}</th>
</thead>
<tbody>
@@ -21,8 +21,10 @@
<td>
<h6>{{ item.dish_name }}
<small>
(<strong>{{ item.count }}</strong> на сумму
<strong>{{ item.sum | curr }} BYN</strong>)
<p>Время удаления: <strong>{{item.time}}</strong></p>
<p>Цена товара: <strong>{{item.price}} BYN</strong></p>
<p>Количество: <strong>{{item.count}} шт</strong></p>
<p>На сумму: <strong>{{item.sum}} BYN</strong></p>
</small>
</h6>
@@ -37,9 +39,10 @@
</td>
</tr>
</tbody>
<hr>
</table>
<hr/>
<hr>
<table class="table table-bordered">
<tbody>

View File

@@ -0,0 +1,126 @@
<div id="container-places" style="bottom: 20px; right: 20px; position: fixed;">
<div class="m-b">
<div class="btn-group">
<button id="create_place" type="button" class="btn info btn-outline b-info">Добавить зал</button>
<button id="back" type="button" class="btn info p-x-md pull-left" data-toggle="modal" data-target="#back_places">Назад</button>
<button id="create_table" type="button" class="btn info btn-outline b-info">Добавить стол</button>
<button id="save_tables" type="button" class="btn info btn-outline b-info" ng-click="saveTables(place_id, tables)">Сохранить</button>
<button id="save_places" type="button" class="btn info btn-outline b-info" ng-click="savePlaces(roommap)">Сохранить</button>
</div>
</div>
</div>
<div id="back_places" 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" ng-click="back()">Нет</button>
<button type="button" class="btn danger p-x-md" ng-model="tables" data-dismiss="modal" ng-click="saveTables(place_id, tables)">Да</button>
</div>
</div>
</div>
<div class="padding" id="places">
<div class="box">
<div class="padding">
<h4>Список залов
<ul class="nav pull-right">
<li class="nav-item ">
<span bs-tooltip="" title="FAQ" class="text-muted inline p-a-xs m-r-sm ng-scope">
<h5><i class="fa fa-question"></i></h5>
</span>
</li>
</ul>
</h4>
<hr/>
<div class="table-responsive">
<table class="table table-bordered m-a-0">
<thead>
<th ng-repeat="place in roommap">
<button type="button" class="btn info btn-block" sglclick="getTables(place.place_id)"
ios-dblclick="editPlace(place.place_id)" context-menu
data-target="place-{{ place.place_id }}">{{place.place_name}}
</button>
<div class="dropdown" id="place-{{ place.place_id }}" style="position: fixed; z-index: 2;">
<ul class="dropdown-menu" role="menu">
<li>
<a class="pointer" role="menuitem" tabindex="1"
ng-click="editPlace($index, place)">
Редактировать
</a>
<a class="pointer" role="menuitem" tabindex="1"
ng-click="deletePlace($index)">
Удалить
</a>
</li>
</ul>
</div>
</th>
</thead>
</table>
</div>
</div>
</div>
</div>
<div class="padding" id="background_1" ng-style="{'max-width':(maxWidth) + 'px', 'width':(screenWidth) + 'vw'}">
<div class="box">
<div class="padding" id="background" >
<!--<div id="tables" class="box" ng-style="{'height':(windowHeight) + 'px'}">-->
<div id="tables" class="box" ng-style="{'height':(windowHeight) + 'px'}" data-target="tables_editor" context-menu>
<div class="dropdown" id="tables_editor" style="position: fixed; z-index: 2;">
<ul class="dropdown-menu" role="menu">
<li>
<a class="pointer" role="menuitem" tabindex="1"
ng-click="alignTables()">
Выровнять по сетке
</a>
</li>
</ul>
</div>
<div ng-repeat="table in tables" ng-model="tables" context-menu>
<div id="{{ 'table_' + $index }}" class="demo-div" draggable resize context-menu
data-target="table-{{ $index }}"
ng-mouseup="getCoords($event, $index, table.table_id, table.place_id)"
ng-style="{'width':'' + table.width * percentWidth + 'px', 'height':'' + table.height * percentHeight + 'px', 'top':'calc(' + top + 'px + ' + table.x * percentHeight + 'px)', 'left': 'calc(' + left + 'px + ' + table.y * percentWidth + 'px)'}"
style="position: fixed;cursor: default;font-family: sans-serif;text-align: center;background-color: #FFFFFF;border: 2px solid #183147; z-index: 1;">
<span class="demo-text">
{{table.name}} {{table.table_id}}
</span>
</div>
<div class="dropdown" id="table-{{ $index }}" style="position: fixed; z-index: 2;">
<ul class="dropdown-menu" role="menu">
<li>
<a class="pointer" role="menuitem" tabindex="1"
ng-click="duplicateTable($index, table.place_id)">
Дублировать
</a>
<a class="pointer" role="menuitem" tabindex="2"
ng-click="editTable($index, table)">
Редактировать
</a>
<a class="pointer" role="menuitem" tabindex="3"
ng-click="deleteTable($index)">
Удалить
</a>
</li>
</ul>
</div>
</div>
</div>
</div>
</div>
</div>
<div class="modal fade" id="table-edit" data-backdrop="true">
<div ui-include="'../views/roommap/items/edit.html'"></div>
</div>
<script type="text/javascript" src="/libs/js/moment/locale/ru.js"></script>

View File

@@ -0,0 +1,70 @@
<div class="modal-dialog" id="animate" ui-class="fade-down-big">
<div class="modal-content">
<div class="modal-header">
<h5 class="modal-title">Редактирование стола</h5>
</div>
<div class="modal-body text-center p-lg">
<div class="box">
<div class="box-header">
<small>Номер стола должен отличаться от существующих.</small>
<small>Высота и ширина стола должны быть не меньше 80px.</small>
</div>
<div class="box-divider m-0"></div>
<div class="box-body">
<form role="form">
<div class="form-group row">
<label for="inputNumber" class="col-sm-2 form-control-label">Номер</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="inputNumber" placeholder="{{tableId}}"
ng-model="tableId"/>
</div>
</div>
<div class="form-group row">
<label for="inputName" class="col-sm-2 form-control-label">Имя</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="inputName"
ng-model="tableName"
placeholder="{{tableName}}"/>
</div>
</div>
<div class="form-group row">
<label for="inputWidth" class="col-sm-2 form-control-label">Ширина</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="inputWidth" placeholder="{{tableWidth}}"
ng-model="tableWidth"/>
</div>
</div>
<div class="form-group row">
<label for="inputHeight" class="col-sm-2 form-control-label">Высота</label>
<div class="col-sm-10">
<input type="text" class="form-control" id="inputHeight" placeholder="{{tableHeight}}"
ng-model="tableHeight"/>
</div>
</div>
<div class="form-group row">
<label for="inputType" class="col-sm-2 form-control-label">Вид стола</label>
<div class="col-sm-10">
<select class="form-control c-select">
<option>Прямоугольный</option>
<option>Круглый</option>
</select>
</div>
</div>
</form>
</div>
</div>
</div>
<div class="modal-footer">
<button type="button" class="btn dark-white p-x-md" data-dismiss="modal">Отмена</button>
<button type="button" class="btn danger p-x-md" data-dismiss="modal"
ng-click="saveTable(tableIndex, tableId, tableName, tableWidth, tableHeight)">Сохранить
</button>
</div>
</div><!-- /.modal-content -->
</div>
<script type="text/javascript" src="/libs/js/moment/locale/ru.js"></script>