Update api requests
This commit is contained in:
25
web/controllers/reimport.js
Normal file
25
web/controllers/reimport.js
Normal file
@@ -0,0 +1,25 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
angular
|
||||
.module('app')
|
||||
.controller('ReImportCtrl', ReImportCtrl);
|
||||
|
||||
TestHelloCtrl.$inject = ['$scope', 'smartRequest', '$location', 'Notification'];
|
||||
function TestHelloCtrl($scope, smartRequest, $location, Notification) {
|
||||
$scope.orders = [];
|
||||
$scope.total = [];
|
||||
|
||||
$scope.getOrders = function () {
|
||||
smartRequest.get('v1/hello?start_date=' + encodeURIComponent($scope.start_date) + '&end_date=' + encodeURIComponent($scope.end_date), function (data) {
|
||||
$scope.orders = data.orders;
|
||||
$scope.total = data.total;
|
||||
});
|
||||
};
|
||||
|
||||
$scope.update = function () {
|
||||
$scope.getOrders();
|
||||
};
|
||||
|
||||
$scope.update();
|
||||
}
|
||||
})();
|
||||
@@ -1,23 +0,0 @@
|
||||
(function () {
|
||||
'use strict';
|
||||
angular
|
||||
.module('app')
|
||||
.controller('TestHelloCtrl', TestHelloCtrl);
|
||||
|
||||
TestHelloCtrl.$inject = ['$scope', 'smartRequest', '$location', 'Notification'];
|
||||
function TestHelloCtrl($scope, smartRequest, $location, Notification) {
|
||||
$scope.users = [];
|
||||
|
||||
$scope.getUsers = function () {
|
||||
smartRequest.get('php/hello', function (data) {
|
||||
$scope.users = data.users;
|
||||
});
|
||||
};
|
||||
|
||||
$scope.update = function () {
|
||||
$scope.getUsers();
|
||||
};
|
||||
|
||||
$scope.update();
|
||||
}
|
||||
})();
|
||||
@@ -1,19 +0,0 @@
|
||||
group_name: 'Разработка',
|
||||
item: [
|
||||
{
|
||||
name: 'Тест',
|
||||
acl: 'test',
|
||||
icon: 'code',
|
||||
order: 0,
|
||||
items: [
|
||||
{
|
||||
name: 'Hello',
|
||||
acl: 'test',
|
||||
url: 'app.test.hello',
|
||||
icon: 'line_style',
|
||||
count: 0,
|
||||
order: 1
|
||||
}
|
||||
]
|
||||
}
|
||||
];
|
||||
@@ -1,8 +1,8 @@
|
||||
{
|
||||
code: 'app.test.hello',
|
||||
url: '/test/hello',
|
||||
templateUrl: '../views/test_hello.html',
|
||||
data: { title : 'Hello' },
|
||||
controller: 'TestHelloCtrl',
|
||||
resolve: ['scripts/controllers/test_hello.js']
|
||||
code: 'app.v1.reimport',
|
||||
url: '/v1/reimport',
|
||||
templateUrl: '../views/reimport.html',
|
||||
data: { title : 'Повторная выгрузка' },
|
||||
controller: 'ReImportCtrl',
|
||||
resolve: ['scripts/controllers/reimport.js']
|
||||
}
|
||||
51
web/views/out.html
Normal file
51
web/views/out.html
Normal file
@@ -0,0 +1,51 @@
|
||||
<div class="modal-dialog modal-lg">
|
||||
<div class="modal-content" id="reportOut">
|
||||
<div class="modal-header">
|
||||
<button type="button" class="close" data-dismiss="modal">×</button>
|
||||
<button class="btn btn-icon white" ng-click="printElem('#reportOut')">
|
||||
<i class="fa fa-print"></i>
|
||||
</button>
|
||||
<h4 class="modal-title">{{globals.currentUser.organization.name}}</h4>
|
||||
<h5 class="modal-title">Отчет по внешним заказам</h5>
|
||||
<span class="text-muted">{{start_date}} - {{end_date}}</span>
|
||||
</div>
|
||||
<div class="modal-body p-lg">
|
||||
<div class="box">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered table-hover m-a-0">
|
||||
<thead>
|
||||
<tr>
|
||||
<th style="width: 10%;vertical-align : middle;text-align:center;" rowspan="2">Номер заказа</th>
|
||||
<th style="width: 80%;vertical-align : middle;text-align:center;" colspan="4">Товар</th>
|
||||
<th style="width: 10%;vertical-align : middle;text-align:center;" rowspan="2">Общ. итог</th>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Наим.</th>
|
||||
<th>Кол-во</th>
|
||||
<th>Цена</th>
|
||||
<th>Итог</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody ng-repeat="order in orders">
|
||||
<tr ng-repeat="item in order.items">
|
||||
<td ng-if="$index == 0" style="vertical-align : middle;text-align:center;" rowspan={{order.items_count}}>{{item.id}}</td>
|
||||
<td>{{item.name}}</td>
|
||||
<td>{{item.count}}</td>
|
||||
<td>{{item.price}}</td>
|
||||
<td>{{item.full_price}} </td>
|
||||
<td ng-if="$index == 0" style="vertical-align : middle;text-align:center;" rowspan={{order.items_count}}> {{order.price}} </td>
|
||||
</tr>
|
||||
</tbody>
|
||||
|
||||
<thead>
|
||||
<th colspan="6">Всего заказов: {{total.total_count}}</th>
|
||||
</thead>
|
||||
<thead>
|
||||
<th colspan="6">Итого: {{total.total_price | curr}} BYN</th>
|
||||
</thead>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
80
web/views/reimport.html
Normal file
80
web/views/reimport.html
Normal file
@@ -0,0 +1,80 @@
|
||||
<div class="padding">
|
||||
<div class="box">
|
||||
<div class="padding">
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<div class="form-group">
|
||||
<label for="single">Выберите даты для повторной выгрузки реализаций</label>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label>С</label>
|
||||
<div class='input-group date' ui-jp="datetimepicker" ui-options="{
|
||||
format: 'DD.MM.YYYY',
|
||||
icons: {
|
||||
time: 'fa fa-clock-o',
|
||||
date: 'fa fa-calendar',
|
||||
up: 'fa fa-chevron-up',
|
||||
down: 'fa fa-chevron-down',
|
||||
previous: 'fa fa-chevron-left',
|
||||
next: 'fa fa-chevron-right',
|
||||
today: 'fa fa-screenshot',
|
||||
clear: 'fa fa-trash',
|
||||
close: 'fa fa-remove'
|
||||
}
|
||||
}">
|
||||
<input type='text' class="form-control" ng-model="start_date" />
|
||||
<span class="input-group-addon">
|
||||
<i class="material-icons"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="col-md-6">
|
||||
<div class="form-group">
|
||||
<label>По</label>
|
||||
<div class='input-group date' ui-jp="datetimepicker" ui-options="{
|
||||
format: 'DD.MM.YYYY',
|
||||
icons: {
|
||||
time: 'fa fa-clock-o',
|
||||
date: 'fa fa-calendar',
|
||||
up: 'fa fa-chevron-up',
|
||||
down: 'fa fa-chevron-down',
|
||||
previous: 'fa fa-chevron-left',
|
||||
next: 'fa fa-chevron-right',
|
||||
today: 'fa fa-screenshot',
|
||||
clear: 'fa fa-trash',
|
||||
close: 'fa fa-remove'
|
||||
}
|
||||
}">
|
||||
<input type='text' class="form-control" ng-model="end_date" />
|
||||
<span class="input-group-addon">
|
||||
<i class="material-icons"></i>
|
||||
</span>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="row">
|
||||
<div class="col-md-12">
|
||||
<button class="btn info btn-block" ng-click="createReport()">Выполнить повторную выгрузку
|
||||
</button>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<script type="text/javascript" src="/libs/js/moment/locale/ru.js"></script>
|
||||
|
||||
<script type="text/javascript">
|
||||
$('.date').on('dp.change', function () {
|
||||
$(this).find('input').trigger('change');
|
||||
});
|
||||
</script>
|
||||
@@ -1,35 +0,0 @@
|
||||
<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"></i>
|
||||
</div>
|
||||
|
||||
<div id="floating-button" data-toggle="tooltip" data-placement="left" title="Действия" onmouseenter="$(this).tooltip('show')">
|
||||
<p class="plus">
|
||||
<i class="material-icons"></i>
|
||||
</p>
|
||||
<p class="edit">
|
||||
<i class="material-icons"></i>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="padding">
|
||||
<div class="box">
|
||||
<div class="table-responsive">
|
||||
<table class="table table-bordered m-a-0">
|
||||
<thead>
|
||||
<th style="width: 20%">#</th>
|
||||
<th style="width: 80%">Имя</th>
|
||||
</thead>
|
||||
|
||||
<tbody>
|
||||
<tr ng-repeat="user in users">
|
||||
<td>{{ user.id }}</td>
|
||||
<td>{{ user.name }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
Reference in New Issue
Block a user