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
72452de9
Commit
72452de9
authored
Jan 30, 2021
by
guanzhenshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
月销售利润报表增加查看管理成本明细和导出
parent
680d1800
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
279 additions
and
15 deletions
+279
-15
FinanceReportServices.cs
Bailun.DC.Services/FinanceReportServices.cs
+13
-4
FinanceController.cs
Bailun.DC.Web/Areas/Reports/Controllers/FinanceController.cs
+83
-5
ListAdministrativeCost.cshtml
...Areas/Reports/Views/Finance/ListAdministrativeCost.cshtml
+2
-2
MonthSaleProfitNew.cshtml
...Web/Areas/Reports/Views/Finance/MonthSaleProfitNew.cshtml
+54
-4
MonthSaleProfitNew_FeeOrderDetail.cshtml
...ts/Views/Finance/MonthSaleProfitNew_FeeOrderDetail.cshtml
+127
-0
No files found.
Bailun.DC.Services/FinanceReportServices.cs
View file @
72452de9
...
...
@@ -6414,13 +6414,13 @@ group by currency";
}
/// <summary>
///
///
获取月销售利润报表的管理成本订单明细
/// </summary>
/// <param name="start"></param>
/// <param name="end"></param>
/// <param name="col"></param>
/// <returns></returns>
public
List
<
dc_base_finance_
fee
>
ListMonthProfitFeeOrderDetail
(
BtTableParameter
parameter
,
DateTime
start
,
DateTime
end
,
string
col
,
ref
int
total
)
public
List
<
dc_base_finance_
managecost
>
ListMonthProfitFeeOrderDetail
(
BtTableParameter
parameter
,
DateTime
start
,
DateTime
end
,
string
col
,
ref
int
total
)
{
var
sql
=
$"select * from dc_base_finance_managecost where pay_time>='
{
start
.
ToString
(
"yyyy-MM-dd"
)}
' and pay_time<'
{
end
.
ToString
(
"yyyy-MM-dd"
)}
' "
;
...
...
@@ -6484,9 +6484,18 @@ group by currency";
cn
.
Open
();
}
var
obj
=
cn
.
Page
<
dc_base_finance_fee
>(
parameter
.
pageIndex
,
parameter
.
limit
,
sql
,
ref
total
);
if
(
parameter
.
limit
>
0
)
{
var
obj
=
cn
.
Page
<
dc_base_finance_managecost
>(
parameter
.
pageIndex
,
parameter
.
limit
,
sql
,
ref
total
);
return
obj
.
ToList
();
return
obj
.
ToList
();
}
else
{
var
obj
=
cn
.
Query
<
dc_base_finance_managecost
>(
sql
);
return
obj
.
ToList
();
}
}
}
...
...
Bailun.DC.Web/Areas/Reports/Controllers/FinanceController.cs
View file @
72452de9
...
...
@@ -2012,7 +2012,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
amount_rmb
=
obj
.
Sum
(
a
=>
a
.
amount_rmb
),
currency
=
""
,
department_name
=
""
,
fee_sub_typ
e
=
""
,
accounting_subject_nam
e
=
""
,
fee_super_type
=
"合计"
,
};
...
...
@@ -2026,6 +2026,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
a
.
currency
,
departmentName
=
a
.
department_name
,
feeSubType
=
a
.
fee_sub_type
,
a
.
accounting_subject_name
,
feeSuperType
=
a
.
fee_super_type
,
a
.
no
,
manageCostType
=
a
.
manage_cost_type
,
...
...
@@ -6385,9 +6386,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
msg
=
(
json
[
"cost"
][
"cashierDownloadPath"
].
ToString
()
!=
""
?
""
:
"该费用单没有找到出纳凭证文件。"
),
data
=
json
[
"cost"
][
"cashierDownloadPath"
].
ToString
()
});
}
}
#
endregion
...
...
@@ -9559,10 +9558,88 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
/// <param name="month">月份</param>
/// <param name="col">字段类型</param>
/// <returns></returns>
[
BailunAuthentication
(
LoginMode
.
Enforce
)]
public
string
MonthSaleProfitNew_FeeOrderDetailJson
(
BtTableParameter
parameter
,
string
month
,
string
col
)
{
var
total
=
0
;
return
""
;
var
start
=
DateTime
.
Parse
(
month
+
"-1"
);
var
end
=
start
.
AddMonths
(
1
);
var
obj
=
new
Services
.
FinanceReportServices
().
ListMonthProfitFeeOrderDetail
(
parameter
,
start
,
end
,
col
,
ref
total
);
var
list
=
obj
.
Select
(
a
=>
new
{
amount
=
a
.
amount
.
ToString
(
"###,###.##"
),
amountRmb
=
a
.
amount_rmb
.
ToString
(
"###,###.##"
),
companyName
=
a
.
company_name
,
a
.
currency
,
departmentName
=
a
.
department_name
,
feeSubType
=
a
.
fee_sub_type
,
a
.
accounting_subject_name
,
feeSuperType
=
a
.
fee_super_type
,
a
.
no
,
manageCostType
=
a
.
manage_cost_type
,
receiveUnit
=
a
.
receive_unit
,
a
.
reason
,
payTime
=
a
.
pay_time
.
HasValue
?
a
.
pay_time
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
:
""
}).
ToList
();
return
JsonConvert
.
SerializeObject
(
new
{
total
=
list
.
Count
,
rows
=
list
,
isexport
=
Services
.
UserAuthorityServices
.
checkUserExportAuthority
(
"ExportAdministrativeCost"
,
HttpContextHelper
.
Current
.
User
.
GetUserName
()),
});
}
/// <summary>
/// 导出分类管理成品明细
/// </summary>
/// <param name="start"></param>
/// <param name="end"></param>
/// <param name="paycompanyid"></param>
/// <param name="headname"></param>
/// <param name="categoryname"></param>
/// <param name="type"></param>
/// <param name="issub"></param>
/// <returns></returns>
public
ActionResult
ExportMonthSaleProfitNewFeeOrderDetail
(
string
month
,
string
col
)
{
var
total
=
0
;
var
start
=
DateTime
.
Parse
(
month
+
"-1"
);
var
end
=
start
.
AddMonths
(
1
);
var
obj
=
new
Services
.
FinanceReportServices
().
ListMonthProfitFeeOrderDetail
(
new
BtTableParameter
{
offset
=
1
,
limit
=
0
},
start
,
end
,
col
,
ref
total
);
var
colNames
=
new
List
<
string
>
{
"费用单号"
,
"一级部门"
,
"付款主体名称"
,
"费用类别"
,
"会计科目"
,
"金额"
,
"币种"
,
"人民币金额"
,
"收款单位"
,
"收款理由"
,
"付款时间"
,
"备注"
};
var
list
=
new
List
<
string
>();
foreach
(
var
item
in
obj
)
{
list
.
Add
(
item
.
no
+
"|"
+
item
.
department_name
+
"|"
+
item
.
company_name
+
"|"
+
item
.
fee_super_type
+
"|"
+
item
.
accounting_subject_name
+
"|"
+
item
.
amount
+
"|"
+
item
.
currency
+
"|"
+
item
.
amount_rmb
+
"|"
+
item
.
receive_unit
+
"|"
+
item
.
reason
+
"|"
+
item
.
pay_time
.
Value
.
ToString
(
"yyyy-MM-dd HH:mm:ss"
)
);
}
var
guid
=
Guid
.
NewGuid
().
ToString
();
var
filename
=
" 管理成本明细"
+
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmss"
);
var
filepath
=
_hostingEnvironment
.
WebRootPath
+
"\\Files\\Report\\"
+
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
)
+
"\\"
;
ToCSV
(
list
,
colNames
,
guid
,
filepath
);
var
ms
=
new
System
.
IO
.
MemoryStream
();
using
(
var
f
=
new
System
.
IO
.
FileStream
(
filepath
+
guid
+
".csv"
,
System
.
IO
.
FileMode
.
Open
))
{
f
.
CopyTo
(
ms
);
}
ms
.
Position
=
0
;
return
File
(
ms
,
"text/csv"
,
filename
+
".csv"
);
}
...
...
@@ -9684,7 +9761,6 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
#
endregion
#
region
进销存不合理报告分析
public
ActionResult
UnReasonable
()
...
...
@@ -10124,6 +10200,8 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
#
endregion
}
class
mHappenAmount
{
...
...
Bailun.DC.Web/Areas/Reports/Views/Finance/ListAdministrativeCost.cshtml
View file @
72452de9
...
...
@@ -57,8 +57,8 @@
},
{ field: 'departmentName', title: '部门名称' },
{ field: 'companyName', title: '付款主体名称', },
{ field: 'feeSuperType', title: '
父级分类
' },
{ field: '
feeSubType', title: '子分类
' },
{ field: 'feeSuperType', title: '
费用类别
' },
{ field: '
accounting_subject_name', title: '会计科目
' },
{ field: 'amount',title: '金额' },
{ field: 'currency', title: '币种' },
{ field: 'amountRmb', title: '人民币金额' },
...
...
Bailun.DC.Web/Areas/Reports/Views/Finance/MonthSaleProfitNew.cshtml
View file @
72452de9
...
...
@@ -100,7 +100,7 @@
for (var a in objData) {
if (a == col.item2) {
row += '<td>' + objData[a] + '</td>';
row += '<td
class="showitem ' + col.item2 + '" val="' + objData['month'] + '" valname="' + col.item1 + '"
>' + objData[a] + '</td>';
count = parseFloat(objData[a].replace(/,/g, ''));
continue;
}
...
...
@@ -150,7 +150,7 @@
row += '<td>0</td>';
}
}
row += '</tr>';
...
...
@@ -158,8 +158,54 @@
}
$('#tb').find('tbody').append(rows);
//增加点击事件
$('.showitem').each(function () {
var _this = $(this);
if ($(this).hasClass('managecost_bl_gz')) { //广州百伦
_this.css('cursor', 'pointer');
_this.click(function () {
ShowFeeDetail(_this.attr('val'), _this.attr('valname'), 'managecost_bl_gz');
})
}
else if (_this.hasClass('managecost_meijia')) {
_this.css('cursor', 'pointer');
_this.click(function () {
ShowFeeDetail(_this.attr('val'), _this.attr('valname'), 'managecost_meijia');
})
}
else if (_this.hasClass('managercost_yangshan')) {
_this.css('cursor', 'pointer');
_this.click(function () {
ShowFeeDetail(_this.attr('val'), _this.attr('valname'), 'managercost_yangshan');
})
}
else if (_this.hasClass('managercost_chengpincang')) {
_this.css('cursor', 'pointer');
_this.click(function () {
ShowFeeDetail(_this.attr('val'), _this.attr('valname'), 'managercost_chengpincang');
})
}
else if (_this.hasClass('managercost_xinhuilan')) {
_this.css('cursor', 'pointer');
_this.click(function () {
ShowFeeDetail(_this.attr('val'), _this.attr('valname'), 'managercost_xinhuilan');
})
}
else if (_this.hasClass('managercost_dizhi')) {
_this.css('cursor', 'pointer');
_this.click(function () {
ShowFeeDetail(_this.attr('val'), _this.attr('valname'), 'managercost_dizhi');
})
}
else if (_this.hasClass('managercost_meijiashengchan')) {
_this.css('cursor', 'pointer');
_this.click(function () {
ShowFeeDetail(_this.attr('val'), _this.attr('valname'), 'managercost_meijiashengchan');
})
}
})
}
else {
layer.msg('没有' + $('#month').val()+'月份的销售利润数据。');
...
...
@@ -240,6 +286,10 @@
window.open('@Url.Content("~/Reports/Finance/ExportMonthSaleProfitNew?month=")' + mon, '_blank');
}
function ShowFeeDetail(month, name ,col) {
layer_show(month + ' ' + name + "的明细", '@Url.Content("~/Reports/Finance/MonthSaleProfitNew_FeeOrderDetail")' + '?month=' + month + '&col=' + col, '95%', '95%');
}
function clearHtml(s) {
// 去除 富文本格式
s = s.replace(/(\n)/g, "");
...
...
Bailun.DC.Web/Areas/Reports/Views/Finance/MonthSaleProfitNew_FeeOrderDetail.cshtml
0 → 100644
View file @
72452de9
@{
ViewData["Title"] = "管理成本明细";
Layout = "~/Pages/Shared/_MainLayout.cshtml";
}
<div class="row">
<div class="col-sm-12">
<div class="ibox-content m-b-sm border-bottom">
<form id="toolbar">
<div class="form-inline" style="line-height:40px;">
<div class="form-group">
<label>月份</label>
<input id="month" name="month" class="form-control" style="width:130px;" placeholder="年.月" value="@(ViewBag.month)" />
</div>
<div class="form-group">
<label> </label>
<button type="button" class="btn btn-primary" onclick="list();"><i class="fa fa-search"></i> 查询</button>
<button id="btnexport" style="display:none;" type="button" class="btn btn-success" onclick="ExportCSV()">导出</button>
</div>
</div>
</form>
</div>
<div class="ibox-content m-b-sm border-bottom">
<table id="roletable" style="table-layout:fixed;"></table>
</div>
</div>
</div>
@section scripts{
<script type="text/javascript">
var tb;
$(document).ready(function () {
laydate.render({ elem: '#month', type: 'month' });
list();
})
function list() {
var month = $('#month').val();
var columns = [
{
field: 'no', title: '费用单号', formatter: function (idx, data) {
//return '<div class="mules" title="' + data.no + '">' + data.no + '</div>';
return '<a href="http://fee.bailuntec.com/#/manage_cost?manageCostType=' + data.manageCostType + '&no=' + data.no + '" target="_blank">' + data.no + '</a>' + (data.no==""?"":'<a style="margin-left:5px;color:#aaa;" onclick="showAttachment(\''+data.no+'\');">出纳凭证</a>');
}
},
{ field: 'departmentName', title: '部门名称' },
{ field: 'companyName', title: '付款主体名称', },
{ field: 'feeSuperType', title: '费用类别' },
{ field: 'accounting_subject_name', title: '会计科目' },
{ field: 'amount',title: '金额' },
{ field: 'currency', title: '币种' },
{ field: 'amountRmb', title: '人民币金额' },
{ field: 'receiveUnit', title: '收款单位' },
{ field: 'reason', title: '付款理由' },
{ field: 'payTime', title: '付款时间' },
];
var url = '@Url.Content("~/Reports/Finance/MonthSaleProfitNew_FeeOrderDetailJson")' + '?month=' + month +'&col=@(ViewBag.col)';
if (tb == undefined) {
tb = OnlyTable("roletable", columns, url, "", {
loadsuccess: function (d) {
if (d.isexport == 1) {
$('#btnexport').show();
}
}
});
}
else {
tb.bootstrapTable('refresh', { url: url });
}
}
function ExportCSV() {
var month = $('#month').val();
window.open('@Url.Content("~/Reports/Finance/ExportMonthSaleProfitNewFeeOrderDetail")' + '?month=' + month + '&col=@(ViewBag.col)', '_blank');
}
function showAttachment(no) {
$.submit({
type:'POST',
url: '@Url.Content("~/Reports/Finance/GetFeeCashAttachment")',
paramData: 'no='+no,
func: function (result) {
if (result.success) {
//alert(result.data);
if (result.data.indexOf('.png') > 0 || result.data.indexOf('.jpg') > 0 || result.data.indexOf('.gif') > 0) {
layer.open({
type: 1,
title: false,
closeBtn: 1,
area: ['auto'],
skin: 'layui-layer-nobg', //没有背景色
shadeClose: true,
content: '<img src="' + result.data + '" style="width:800px;height:540px;" />'
});
}
else {
layer.open({
type: 1,
title: false,
closeBtn: 0,
shadeClose: true,
skin: 'yourclass',
content: '<div style="padding:30px 60px;"><a href="'+result.data+'" target="_blank" >'+下载附件+'</a><div>'
});
}
}
else {
alert(result.msg);
}
}
})
}
</script>
}
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