Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
D
DataCenter_Core2.1_20190520
Overview
Overview
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
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
bltdc
DataCenter_Core2.1_20190520
Commits
b27dde27
Commit
b27dde27
authored
Sep 22, 2020
by
guanzhenshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
平台利润统计报表增加导出功能
parent
0aad30ba
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
43 additions
and
1 deletion
+43
-1
PlatformProfitCount.cshtml
...Web/Areas/Reports/Views/Orders/PlatformProfitCount.cshtml
+42
-0
common.js
Bailun.DC.Web/wwwroot/js/common.js
+1
-1
No files found.
Bailun.DC.Web/Areas/Reports/Views/Orders/PlatformProfitCount.cshtml
View file @
b27dde27
...
@@ -96,6 +96,7 @@
...
@@ -96,6 +96,7 @@
<div class="form-group">
<div class="form-group">
<label> </label>
<label> </label>
<button type="button" class="btn btn-primary" onclick="list();"><i class="fa fa-search"></i> 查询</button>
<button type="button" class="btn btn-primary" onclick="list();"><i class="fa fa-search"></i> 查询</button>
<button type="button" class="btn btn-success" onclick="exportViewTable()">导出当前页面</button>
</div>
</div>
</div>
</div>
</form>
</form>
...
@@ -201,6 +202,7 @@
...
@@ -201,6 +202,7 @@
<script src="~/js/jquery.tablesorter.min.js" type="text/javascript"></script>
<script src="~/js/jquery.tablesorter.min.js" type="text/javascript"></script>
<script src="~/js/yselect/yselect.js"></script>
<script src="~/js/yselect/yselect.js"></script>
<script type="text/javascript">
<script type="text/javascript">
var objData;
var tb;
var tb;
$(document).ready(function () {
$(document).ready(function () {
laydate.render({ elem: '#start' });
laydate.render({ elem: '#start' });
...
@@ -275,6 +277,7 @@
...
@@ -275,6 +277,7 @@
func: function (result) {
func: function (result) {
layer.close(lindex);
layer.close(lindex);
if (result && result.length > 0) {
if (result && result.length > 0) {
objData = result;
$('#tb').html('');
$('#tb').html('');
$('#footer').html('');
$('#footer').html('');
for (var i = 0; i < result.length - 1; i++) {
for (var i = 0; i < result.length - 1; i++) {
...
@@ -440,6 +443,7 @@
...
@@ -440,6 +443,7 @@
}
}
else {
else {
objData = null;
$('#tb').html('');
$('#tb').html('');
$('#footer').html('');
$('#footer').html('');
layer.alert('没有找到相应数据!');
layer.alert('没有找到相应数据!');
...
@@ -633,6 +637,44 @@
...
@@ -633,6 +637,44 @@
layer_show(title + "的产品分类利润统计",'@Url.Content("~/Reports/Orders/SkuProfitCount?")'+urlparam,'95%','95%');
layer_show(title + "的产品分类利润统计",'@Url.Content("~/Reports/Orders/SkuProfitCount?")'+urlparam,'95%','95%');
}
}
function exportViewTable() {
var explorer = window.navigator.userAgent;
if (explorer.indexOf("MSIE") >= 0) {
alert('该功能仅支持谷歌浏览器');
return;
}
if (objData != null && objData != undefined) {
var str = '平台,订单数,销售额,产品成本,客单价,平台费,FBA费,PayPal费,头程费,尾程费,处理费,平台操作费,广告费,上架费,预收金额,预收订单数,利润,利润率%,退款,退款率%\n';
for (var i = 0; i < objData.length; i++) {
str += (objData[i].platform_type + ',' + objData[i].order_count.replace(',', '') + ',' + objData[i].amount_sales.replace(',', '') + ',' + objData[i].cost_product.replace(',', '') + ',' + objData[i].customerprice.replace(',', '') +
',' + objData[i].cost_platform_fee.replace(',', '') + ',' + objData[i].cost_fba_fee.replace(',', '') + ',' + objData[i].cost_paypal_fee.replace(',', '') + ',' + objData[i].cost_first.replace(',', '') + ',' + objData[i].cost_tail.replace(',', '') +
',' + objData[i].cost_handle_bailun.replace(',', '') + ',' + objData[i].cost_handle_platform.replace(',', '') + ',' + objData[i].adfee.replace(',', '') + ',' + objData[i].putawayfee.replace(',', '') + ',' + objData[i].amount_prepaid.replace(',', '') +
',' + objData[i].noshippingcount.replace(',', '') + ',' + objData[i].profit_total.replace(',', '') + ',' + objData[i].profit_rate.replace(',', '') + ',' + objData[i].amount_refund.replace(',', '') + ',' + objData[i].amount_refund_rate.replace(',', '')
);
str += '\n';
}
// encodeURIComponent解决中文乱码
var uri = 'data:text/csv;charset=utf-8,\ufeff' + encodeURIComponent(str)
// 通过创建a标签实现
var link = document.createElement('a')
link.href = uri
// 对下载的文件命名
link.download = '平台利润统计报表.csv';
document.body.appendChild(link)
link.click()
document.body.removeChild(link);
}
}
</script>
</script>
}
}
...
...
Bailun.DC.Web/wwwroot/js/common.js
View file @
b27dde27
var
baseUrl
=
'http://
localhost:59628/'
;
//'http://data.bailuntec.com';
//
var
baseUrl
=
'http://
data.bailuntec.com'
;
//'http://localhost:59628/';
//
var
globalOrderSort
=
''
;
var
globalOrderSort
=
''
;
var
globalOrderType
=
''
;
var
globalOrderType
=
''
;
...
...
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