Commit 3ac856d7 by guanzhenshan

增加固定资产明细页面

parent 2a102f76
using System;
using System.Collections.Generic;
using System.Text;
namespace Bailun.DC.Models
{
public class dc_fixed_assets_detail
{
public int id { get; set; }
/// <summary>
/// 统计日期
/// </summary>
public DateTime day { get; set; }
/// <summary>
/// 公司主体value
/// </summary>
public int company_value { get; set; }
/// <summary>
/// 采购公司
/// </summary>
public string company_name { get; set; }
/// <summary>
/// 期初金额
/// </summary>
public decimal start_amount { get; set; }
/// <summary>
/// 借方发生额
/// </summary>
public decimal debit_amount { get; set; }
/// <summary>
/// 贷方发生额
/// </summary>
public decimal credit_amount { get; set; }
/// <summary>
/// 期末金额
/// </summary>
public decimal end_amount { get; set; }
/// <summary>
/// 取数时间
/// </summary>
public DateTime update_time { get; set; }
}
}
...@@ -209,6 +209,24 @@ namespace Bailun.DC.Services ...@@ -209,6 +209,24 @@ namespace Bailun.DC.Services
} }
/// <summary>
/// 获取采购公司列表
/// </summary>
/// <returns></returns>
public static List<CompanyValue> ListCompanyValue()
{
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
{
if (cn.State == System.Data.ConnectionState.Closed)
{
cn.Open();
}
return cn.Query<CompanyValue>("select company_value,company_name from dc_fixed_assets_detail group by company_value,company_name").AsList();
}
}
} }
#region 汇率实体 ExchangeRate #region 汇率实体 ExchangeRate
...@@ -223,5 +241,15 @@ namespace Bailun.DC.Services ...@@ -223,5 +241,15 @@ namespace Bailun.DC.Services
} }
#endregion #endregion
/// <summary>
/// 采购公司
/// </summary>
public class CompanyValue
{
public int company_value { get; set; }
public string company_name { get; set; }
}
} }
...@@ -1026,6 +1026,44 @@ namespace Bailun.DC.Services ...@@ -1026,6 +1026,44 @@ namespace Bailun.DC.Services
} }
} }
/// <summary>
/// 固定资产列表
/// </summary>
/// <param name="request">分页信息</param>
/// <param name="date">统计日期</param>
/// <param name="paycompanyid">付款主体id</param>
/// <param name="total">符合条件的记录数</param>
/// <returns></returns>
public List<dc_fixed_assets_detail> ListFixedAssets(BtTableParameter request, DateTime date, int paycompanyid,int? companyvalue,ref int total)
{
var sql = "select * from dc_fixed_assets_detail where day='"+date.ToString("yyyy-MM-dd")+"'";
using (var cn = new MySqlConnection(Common.GlobalConfig.ConnectionString))
{
if (cn.State == ConnectionState.Closed)
{
cn.Open();
}
if (companyvalue.HasValue)
{
sql += " and company_value="+companyvalue.Value;
}
if (!string.IsNullOrEmpty(request.sort))
{
sql += " order by "+request.sort+" "+request.order;
}
var obj = cn.Page<dc_fixed_assets_detail>(request.pageIndex, request.limit, sql, ref total);
return obj.AsList();
}
}
#endregion #endregion
#region 付款主体 #region 付款主体
......
...@@ -1077,6 +1077,45 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -1077,6 +1077,45 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
return JsonConvert.SerializeObject(new { total = total, rows = list }); return JsonConvert.SerializeObject(new { total = total, rows = list });
} }
/// <summary>
/// 固定资产一级明细
/// </summary>
/// <returns></returns>
public ActionResult ListFixedAssets(DateTime date,int paycompanyid)
{
ViewBag.date = date;
ViewBag.paycompanyid = paycompanyid;
return View();
}
/// <summary>
/// 固定资产一级明细
/// </summary>
/// <param name="request"></param>
/// <param name="date"></param>
/// <param name="paycompanyid"></param>
/// <param name="companyvalue"></param>
/// <returns></returns>
public string ListFixedAssetsJson(BtTableParameter request, DateTime date, int paycompanyid,int? companyvalue)
{
var total = 0;
var obj = new Services.FinanceReportServices().ListFixedAssets(request, date, paycompanyid, companyvalue, ref total);
var list = obj.Select(a => new {
day = a.day.ToString("yyyy-MM-dd"),
a.company_name,
start_amount = a.start_amount.ToString("N2"),
debit_amount = a.debit_amount.ToString("N2"),
credit_amount = a.credit_amount.ToString("N2"),
end_amount = a.end_amount.ToString("N2"),
});
return JsonConvert.SerializeObject(new { total=total,rows = list});
}
#endregion #endregion
#region 平台余额 #region 平台余额
...@@ -1692,6 +1731,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -1692,6 +1731,7 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
#endregion #endregion
#region Common #region Common
/// <summary> /// <summary>
...@@ -1710,6 +1750,19 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers ...@@ -1710,6 +1750,19 @@ namespace Bailun.DC.Web.Areas.Reports.Controllers
return Json(list); return Json(list);
} }
/// <summary>
/// 获取采购公司列表(固定资产)
/// </summary>
/// <returns></returns>
[HttpPost]
public JsonResult ListCompanyValue()
{
var list = Services.CommonServices.ListCompanyValue();
return Json(list);
}
#endregion #endregion
} }
......
...@@ -974,6 +974,9 @@ ...@@ -974,6 +974,9 @@
case 'other_accounts_payable': case 'other_accounts_payable':
showdetail(title + ' 其他应付款明细', '@Url.Content("~/Reports/Finance/OtherPayable?date=")' + title + '&paycompanyid=' + paycompany); showdetail(title + ' 其他应付款明细', '@Url.Content("~/Reports/Finance/OtherPayable?date=")' + title + '&paycompanyid=' + paycompany);
return false; return false;
case 'fixed_assets':
showdetail(title + ' 固定资产明细', '@Url.Content("~/Reports/Finance/ListFixedAssets?date=")' + title + '&paycompanyid=' + paycompany);
return false;
} }
return false; return false;
......

@{
ViewData["Title"] = "固定资产明细";
Layout = "~/Pages/Shared/_MainLayout.cshtml";
}
<div class="row">
<div class="col-sm-12">
<div class="ibox-content m-b-sm border-bottom">
<div class="form-inline" style="line-height:40px;">
<div class="form-group">
<label>采购公司</label>
<select id="companyvalue" name="companyvalue" class="form-control">
<option value="">请选择采购公司</option>
</select>
</div>
<div class="form-group">
<label>&nbsp;</label>
<button class="btn btn-primary" onclick="list()">查询</button>
</div>
</div>
</div>
<div class="ibox-content m-b-sm border-bottom">
<table id="roletable" style="table-layout:fixed;"></table>
</div>
</div>
</div>
@section css{
<style>
.mules {
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
</style>
}
@section scripts{
<script>
var tb;
$(document).ready(function () {
var height = document.body.clientHeight;
$("#roletable").attr("data-height", (height - 100));
list();
listCompany();
})
function list() {
var columns = [
{
field: 'company_name', title: '采购公司', width: '150', sortable: true, formatter: function (idx, data) {
return '<div class="mules" title="' + data.company_name + '">' + data.company_name + '</div>';
}
},
{ field: 'start_amount', title: '期初金额', width: '110', sortable: true },
{ field: 'debit_amount', title: '借方发生额', width: '110', sortable: false },
{ field: 'credit_amount', title: '贷方发生额', width: '110', sortable: false },
{ field: 'end_amount', title: '期末金额', width: '100', sortable: true },
{ field: 'day', title: '统计日期', width: '90', sortable: true }
];
var pvalue = $('#companyvalue').val();
var url = '@Url.Content("~/Reports/Finance/ListFixedAssetsJson")' + '?date=@(ViewBag.date)&paycompanyid=@(ViewBag.paycompanyid)&companyvalue=' + pvalue;
if (tb == undefined) {
tb = OnlyTable("roletable", columns, url, "");
}
else {
tb.bootstrapTable('refresh', { url: url });
}
}
function listCompany() {
$.submit({
type:'POST',
url: '@Url.Content("~/Reports/Finance/ListCompanyValue")',
paramData: '',
func: function (result) {
if (result != null && result != undefined) {
$('#companyvalue').html('<option value="">请选择采购公司</option>');
for (var i = 0; i < result.length; i++) {
$('#companyvalue').append('<option value="' + result[i].company_value + '">' + result[i].company_name + '</option>');
}
}
}
})
}
</script>
}
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