Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
A
addcpm-json
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Александр Чаплыгин
addcpm-json
Commits
418073a7
Commit
418073a7
authored
May 28, 2019
by
Александр Чаплыгин
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Логика выгрузки в excel по статусу заказов
parent
29e56390
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
7 deletions
+28
-7
script-feeds-stat-table.js
src/public/js/script-feeds-stat-table.js
+2
-2
script-feeds-stat.js
src/public/js/script-feeds-stat.js
+23
-5
cabinet-feed.phtml
src/templates/app/user/cabinet-feed.phtml
+3
-0
No files found.
src/public/js/script-feeds-stat-table.js
View file @
418073a7
...
@@ -258,7 +258,7 @@ $(document).ready(function(){
...
@@ -258,7 +258,7 @@ $(document).ready(function(){
$row
.
append
(
$
(
'<td>'
));
$row
.
append
(
$
(
'<td>'
));
$row
.
append
(
$
(
'<td>'
).
html
(
"Всего заказов: "
+
dataPeriod
.
length
));
$row
.
append
(
$
(
'<td>'
).
html
(
"Всего заказов: "
+
dataPeriod
.
length
));
$rowExcel
=
$
(
'<tr>'
);
$rowExcel
=
$
(
'<tr
class="total-all"
>'
);
$rowExcel
.
append
(
$
(
'<td>'
).
html
(
"<b>Всего заказов: "
+
dataPeriod
.
length
+
'</b>'
));
$rowExcel
.
append
(
$
(
'<td>'
).
html
(
"<b>Всего заказов: "
+
dataPeriod
.
length
+
'</b>'
));
activeLines
.
forEach
(
function
(
item
){
activeLines
.
forEach
(
function
(
item
){
...
@@ -364,7 +364,7 @@ $(document).ready(function(){
...
@@ -364,7 +364,7 @@ $(document).ready(function(){
totalValue
+=
parseFloat
(
$
(
'td.'
+
activeLine
,
$this
).
html
().
replace
(
','
,
''
));
totalValue
+=
parseFloat
(
$
(
'td.'
+
activeLine
,
$this
).
html
().
replace
(
','
,
''
));
});
});
$
(
'td.'
+
activeLine
,
$trTotalStatus
).
html
(
valueFormat
(
totalValue
));
$
(
'td.'
+
activeLine
,
$trTotalStatus
).
html
(
valueFormat
(
totalValue
));
$
(
'td.'
+
activeLine
,
$trTotalStatusToExcel
).
html
(
valueFormat
(
totalValue
)
);
$
(
'td.'
+
activeLine
,
$trTotalStatusToExcel
).
html
(
'<b>'
+
valueFormat
(
totalValue
)
+
'</b>'
);
}
}
});
});
...
...
src/public/js/script-feeds-stat.js
View file @
418073a7
...
@@ -278,14 +278,32 @@ $(document).ready(function(){
...
@@ -278,14 +278,32 @@ $(document).ready(function(){
// Выгрузка таблицы в Excel
// Выгрузка таблицы в Excel
$exportExcelButton
.
click
(
function
(){
$exportExcelButton
.
click
(
function
(){
console
.
log
(
'AAA exportExcel'
);
return
false
;
var
$tableToExcel
=
$
(
"#table2excel"
);
var
$tableToExcel
.
table2excel
({
$tableToExcel
=
$
(
"#table2excel"
),
$tableToExcelCopy
=
$tableToExcel
.
clone
(),
activeStatus
=
$
(
'.b-filter__switch.category-orders .b-filter__switch-item.m-filter__switch-item_active'
).
data
(
'order-category'
);
console
.
log
(
'AAA exportExcel activeStatus = '
,
activeStatus
);
if
(
activeStatus
==
'all'
)
{
$
(
'thead tr.orders-title.confirmed, thead tr.orders-title.rejected'
,
$tableToExcelCopy
).
remove
();
$
(
'tbody tr.total-orders'
,
$tableToExcelCopy
).
remove
();
}
if
(
activeStatus
==
'confirmed'
)
{
$
(
'thead tr.orders-title.all, thead tr.orders-title.rejected'
,
$tableToExcelCopy
).
remove
();
$
(
'tbody tr.rejected'
,
$tableToExcelCopy
).
remove
();
$
(
'tbody tr.total-all, tbody tr.total-orders.approved, tbody tr.total-orders.rejected'
,
$tableToExcelCopy
).
remove
();
}
if
(
activeStatus
==
'rejected'
)
{
$
(
'thead tr.orders-title.all, thead tr.orders-title.confirmed'
,
$tableToExcelCopy
).
remove
();
$
(
'tbody tr.confirmed'
,
$tableToExcelCopy
).
remove
();
$
(
'tbody tr.total-all, tbody tr.total-orders.approved, tbody tr.total-orders.confirmed'
,
$tableToExcelCopy
).
remove
();
}
$tableToExcelCopy
.
table2excel
({
exclude
:
".noExl"
,
exclude
:
".noExl"
,
name
:
"Worksheet Name"
,
name
:
"Worksheet Name"
,
filename
:
$tableToExcel
.
data
(
'content'
)
+
'.xls'
filename
:
$tableToExcel
Copy
.
data
(
'content'
)
+
'.xls'
});
});
});
});
...
...
src/templates/app/user/cabinet-feed.phtml
View file @
418073a7
...
@@ -233,6 +233,9 @@ if (!$error) {
...
@@ -233,6 +233,9 @@ if (!$error) {
<?php
if
(
$current_report
==
'transactions'
)
:
?>
<?php
if
(
$current_report
==
'transactions'
)
:
?>
<table
id=
"table2excel"
data-content=
"shop-
<?=
$shop_title
?>
"
width=
"100%"
>
<table
id=
"table2excel"
data-content=
"shop-
<?=
$shop_title
?>
"
width=
"100%"
>
<thead>
<thead>
<tr
class=
"orders-title all"
><th
colspan=
"4"
>
Все заказы
</th></tr>
<tr
class=
"orders-title confirmed"
><th
colspan=
"4"
>
Подтвержденные заказы
</th></tr>
<tr
class=
"orders-title rejected"
><th
colspan=
"4"
>
Отклонённые заказы
</th></tr>
<tr>
<tr>
<th>
<th>
<b>
<?=
_t
(
$main_cat
[
'title'
])
?>
</b>
<b>
<?=
_t
(
$main_cat
[
'title'
])
?>
</b>
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment