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
79b937ed
Commit
79b937ed
authored
Apr 23, 2019
by
guanzhenshan
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
资产负债表增加导出功能
parent
48f4b4b0
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
62 additions
and
1 deletion
+62
-1
dc_balance_sheet.cs
Bailun.DC.Models/dc_balance_sheet.cs
+0
-0
FinanceController.cs
Bailun.DC.Web/Areas/Reports/Controllers/FinanceController.cs
+44
-1
Index.cshtml
Bailun.DC.Web/Areas/Reports/Views/Finance/Index.cshtml
+9
-0
Index2.cshtml
Bailun.DC.Web/Areas/Reports/Views/Finance/Index2.cshtml
+9
-0
No files found.
Bailun.DC.Models/dc_balance_sheet.cs
View file @
79b937ed
This diff is collapsed.
Click to expand it.
Bailun.DC.Web/Areas/Reports/Controllers/FinanceController.cs
View file @
79b937ed
using
System
;
using
System.Collections.Generic
;
using
System.ComponentModel
;
using
System.Data
;
using
System.Linq
;
using
System.Threading.Tasks
;
...
...
@@ -261,8 +262,50 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
m
.
count_liabilities_and_oe
=
m
.
count_liabilities
+
m
.
oe_count
;
}
var
colNames
=
new
List
<
string
>()
{
"数值"
};
colNames
.
AddRange
(
list
.
Select
(
p
=>
p
.
statistical_time
.
ToString
(
"yyyy-MM-dd"
)));
var
listresult
=
new
List
<
string
>();
return
View
();
for
(
var
i
=
0
;
i
<
list
.
Count
;
i
++)
{
var
m0
=
list
[
i
];
var
listProperties
=
m0
.
GetType
().
GetProperties
();
var
rowindex
=
0
;
for
(
var
o
=
0
;
o
<
listProperties
.
Length
;
o
++)
{
var
descriptionName
=
""
;
var
v
=
(
DescriptionAttribute
[])
listProperties
[
o
].
GetCustomAttributes
(
typeof
(
DescriptionAttribute
),
false
);
if
(
v
.
Length
>
0
)
{
descriptionName
=
v
[
0
].
Description
;
}
if
(
descriptionName
==
""
)
{
continue
;
}
var
value
=
listProperties
[
o
].
GetValue
(
m0
,
null
).
ToString
();
if
(
i
==
0
)
//添加字段名称
{
listresult
.
Add
(
descriptionName
);
}
var
temp
=
listresult
[
rowindex
]
+
"|"
+
value
;
listresult
[
rowindex
]
=
temp
;
rowindex
++;
}
}
var
filename
=
"资产负债表 "
+
DateTime
.
Now
.
ToString
(
"yyyyMMddHHmmss"
);
var
filepath
=
_hostingEnvironment
.
WebRootPath
+
"\\Files\\Report\\"
+
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
)
+
"\\"
;
ToCSV
(
listresult
,
colNames
,
filename
,
filepath
);
return
File
(
"~/Files/Report/"
+
DateTime
.
Now
.
ToString
(
"yyyy-MM-dd"
)
+
"/"
+
filename
+
".csv"
,
"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"
,
filename
+
".csv"
);
}
/// <summary>
...
...
Bailun.DC.Web/Areas/Reports/Views/Finance/Index.cshtml
View file @
79b937ed
...
...
@@ -27,6 +27,7 @@
<option value="2" selected>香港百伦科技有限公司</option>*@
</select>
<button type="button" class="btn btn-sm btn-primary" onclick="GetData();"><i class="fa fa-search"></i> 查询</button>
<button type="button" class="btn btn-sm btn-success" onclick="ExportXsl()">导出</button>
</div>
</div>
</form>
...
...
@@ -998,6 +999,14 @@
})
return res;
}
function ExportXsl() {
var type = $('#timetype').val();
var day = $('#day').val();
var paycompany = $('#sel_paycompany').val();
window.open('@Url.Content("~/Reports/Finance/ExportIndex?")' + 'type=' + type + '&day=' + day + '&paycompanyvalue=' + paycompany, '_blank');
}
</script>
}
...
...
Bailun.DC.Web/Areas/Reports/Views/Finance/Index2.cshtml
View file @
79b937ed
...
...
@@ -27,6 +27,7 @@
<option value="2" selected>香港百伦科技有限公司</option>*@
</select>
<button type="button" class="btn btn-sm btn-primary" onclick="GetData();"><i class="fa fa-search"></i> 查询</button>
<button type="button" class="btn btn-sm btn-success" onclick="ExportXsl();">导出</button>
</div>
</div>
</form>
...
...
@@ -1446,6 +1447,14 @@
}
function ExportXsl() {
var type = $('#timetype').val();
var day = $('#day').val();
var paycompany = $('#sel_paycompany').val();
window.open('@Url.Content("~/Reports/Finance/ExportIndex?")' + 'type=' + type + '&day=' + day + '&paycompanyvalue=' + paycompany, '_blank');
}
</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