Правка для смены статуса заказа в excel таблице

parent 23190c6b
...@@ -196,7 +196,7 @@ $(document).ready(function(){ ...@@ -196,7 +196,7 @@ $(document).ready(function(){
} }
}))); })));
$rowExcel = $('<tr class="order-item ' + trClass + '">'); $rowExcel = $('<tr class="order-item ' + trClass + '" data-feed-id="' + item['ViewID'][0] + '" data-order-id="' + item['period'] + '">');
$rowExcel.append($('<td>').html(item['period'])); $rowExcel.append($('<td>').html(item['period']));
} else { } else {
...@@ -260,7 +260,7 @@ $(document).ready(function(){ ...@@ -260,7 +260,7 @@ $(document).ready(function(){
$row.append($('<td>').html("Всего заказов: " + dataPeriod.length)); $row.append($('<td>').html("Всего заказов: " + dataPeriod.length));
$rowExcel = $('<tr class="total-all">'); $rowExcel = $('<tr class="total-all">');
$rowExcel.append($('<td>').html("<b>Всего заказов: " + dataPeriod.length + '</b>')); $rowExcel.append($('<td class="count">').html("<b>Всего заказов: " + dataPeriod.length + '</b>'));
activeLines.forEach(function(item){ activeLines.forEach(function(item){
currentActiveLine = item; currentActiveLine = item;
......
...@@ -298,9 +298,9 @@ $(document).ready(function(){ ...@@ -298,9 +298,9 @@ $(document).ready(function(){
if ($this.hasClass('confirmed')) orderStatusTitle = 'Подтверждён'; if ($this.hasClass('confirmed')) orderStatusTitle = 'Подтверждён';
if ($this.hasClass('rejected')) orderStatusTitle = 'Отклонён'; if ($this.hasClass('rejected')) orderStatusTitle = 'Отклонён';
$('td.Timestamp', $this).after('<th>' + orderStatusTitle + '</th>'); $('td.Timestamp', $this).after('<td>' + orderStatusTitle + '</td>');
}); });
$('tbody tr.total-all td.count', $tableToExcelCopy).after('<td></td>');
} }
if (activeStatus == 'confirmed') { if (activeStatus == 'confirmed') {
$('thead tr.orders-title.all, thead tr.orders-title.rejected', $tableToExcelCopy).remove(); $('thead tr.orders-title.all, thead tr.orders-title.rejected', $tableToExcelCopy).remove();
...@@ -355,7 +355,9 @@ $(document).ready(function(){ ...@@ -355,7 +355,9 @@ $(document).ready(function(){
'confirmed': $this.prop( "checked" ) ? 1 : 0, 'confirmed': $this.prop( "checked" ) ? 1 : 0,
'feedId': $spanWrap.data('feed-id'), 'feedId': $spanWrap.data('feed-id'),
'orderId': $spanWrap.data('order-id'), 'orderId': $spanWrap.data('order-id'),
}; },
$tableToExcel = $("#table2excel"),
$orderTrExcel = $('tbody tr.order-item[data-feed-id="' + $spanWrap.data('feed-id') + '"][data-order-id="' + $spanWrap.data('order-id') + '"]', $tableToExcel);
$this.prop("disabled", true); $this.prop("disabled", true);
...@@ -367,6 +369,10 @@ $(document).ready(function(){ ...@@ -367,6 +369,10 @@ $(document).ready(function(){
if (data.result) { if (data.result) {
$orderTr.removeClass('confirmed').removeClass('rejected'); $orderTr.removeClass('confirmed').removeClass('rejected');
$orderTr.addClass((data.confirmed) ? 'confirmed' : 'rejected'); $orderTr.addClass((data.confirmed) ? 'confirmed' : 'rejected');
$orderTrExcel.removeClass('confirmed').removeClass('rejected');
$orderTrExcel.addClass((data.confirmed) ? 'confirmed' : 'rejected');
} else { } else {
$this.prop("checked", !$this.prop( "checked" )) $this.prop("checked", !$this.prop( "checked" ))
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment