@@ -46,6 +46,11 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
{ | |||
return View(); | |||
} | |||
public ActionResult StatsIndex() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
@@ -107,6 +112,22 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||
}; | |||
return Success(jsonData); | |||
} | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetStatsList(string pagination, string queryJson) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = fundsApplyIBLL.GetStatsList(paginationobj, queryJson); | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
total = paginationobj.total, | |||
page = paginationobj.page, | |||
records = paginationobj.records | |||
}; | |||
return Success(jsonData); | |||
} | |||
#endregion | |||
#region 提交数据 | |||
@@ -17,6 +17,18 @@ | |||
<div class="lr-form-item-title">申请人</div> | |||
<div id="ApplyUser"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">填报部门</div> | |||
<div id="DeclarationDept"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">填报人</div> | |||
<div id="Informant"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">申报类别</div> | |||
<div id="DeclarationType"></div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
@@ -47,6 +47,26 @@ var bootstrap = function ($, learun) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
$('#ApplyUser').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }); | |||
$('#DeclarationType').lrDataItemSelect({ code: 'DeclarationType' }); | |||
$('#DeclarationDept').lrselect({ | |||
type: 'tree', | |||
allowSearch: true, | |||
url: top.$.rootUrl + '/LR_OrganizationModule/Department/GetTreeNoCheck', | |||
param: {}, | |||
select: function (val) { | |||
var departmentId = ""; | |||
if (val) { | |||
departmentId = val.value; | |||
} | |||
$('#Informant').lrselectRefresh({ | |||
url: top.$.rootUrl + '/LR_OrganizationModule/User/GetListByDepartmentId?departmentId=' + departmentId, | |||
text: "F_RealName", | |||
value: "F_UserId" | |||
}) | |||
} | |||
}); | |||
//$('#Informant').lrDataSourceSelect({ allowSearch: true, text: 'F_RealName', value: 'F_UserId' }); | |||
$('#Informant').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
@@ -0,0 +1,43 @@ | |||
@{ | |||
ViewBag.Title = "经费开支申报"; | |||
Layout = "~/Views/Shared/_Index.cshtml"; | |||
} | |||
<div class="lr-layout " > | |||
<div class="lr-layout-center"> | |||
<div class="lr-layout-wrap lr-layout-wrap-notitle "> | |||
<div class="lr-layout-tool"> | |||
<div class="lr-layout-tool-left"> | |||
<div class="lr-layout-tool-item"> | |||
<div id="datesearch"></div> | |||
</div> | |||
<div class="lr-layout-tool-item"> | |||
<div id="multiple_condition_query"> | |||
<div class="lr-query-formcontent"> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">部门</div> | |||
<div id="DeclarationDept"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">类别</div> | |||
<div id="DeclarationType"></div> | |||
</div> | |||
<div class="col-xs-12 lr-form-item"> | |||
<div class="lr-form-item-title">资产</div> | |||
<div id="IsFixedAssets"></div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-tool-right"> | |||
<div class=" btn-group btn-group-sm"> | |||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/AssetManagementSystem/Views/FundsApply/StatsIndex.js") |
@@ -0,0 +1,162 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2022-11-07 14:25 | |||
* 描 述:经费开支申报 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var startTime; | |||
var endTime; | |||
var processId = ''; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
// 时间搜索框 | |||
$('#datesearch').lrdate({ | |||
dfdata: [ | |||
{ name: '今天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00') }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, | |||
{ name: '近7天', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'd', -6) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, | |||
{ name: '近1个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -1) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } }, | |||
{ name: '近3个月', begin: function () { return learun.getDate('yyyy-MM-dd 00:00:00', 'm', -3) }, end: function () { return learun.getDate('yyyy-MM-dd 23:59:59') } } | |||
], | |||
// 月 | |||
mShow: false, | |||
premShow: false, | |||
// 季度 | |||
jShow: false, | |||
prejShow: false, | |||
// 年 | |||
ysShow: false, | |||
yxShow: false, | |||
preyShow: false, | |||
yShow: false, | |||
// 默认 | |||
dfvalue: '3', | |||
selectfn: function (begin, end) { | |||
startTime = begin; | |||
endTime = end; | |||
page.search(); | |||
} | |||
}); | |||
$('#multiple_condition_query').lrMultipleQuery(function (queryJson) { | |||
page.search(queryJson); | |||
}, 220, 400); | |||
$('#DeclarationDept').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name' }); | |||
$('#DeclarationType').lrDataItemSelect({ code: 'DeclarationType' }); | |||
$('#IsFixedAssets').lrDataItemSelect({ code: 'YesOrNoInt' }); | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/AssetManagementSystem/FundsApply/GetStatsList', | |||
headData: [ | |||
{ label: "日期", name: "ApplyTime", width: 150, align: "left" }, | |||
{ | |||
label: "申报部门", name: "DeclarationDept", width: 200, align: "left", | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('department', { | |||
key: value, | |||
callback: function (_data) { | |||
callback(_data.name); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "申报类别", name: "DeclarationType", width: 200, align: "left" | |||
, formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'DeclarationType', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
}, | |||
{ label: "项目内容", name: "ProjectContent", width: 200, align: "left" }, | |||
{ label: "数量", name: "Number", width: 200, align: "left" }, | |||
{ | |||
label: '单位', name: 'Unit', width: 150, align: 'left', | |||
formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'sldw', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
}, | |||
{ | |||
label: "单价(元)", name: "Price", width: 200, align: "left", | |||
formatter: function (cellvalue) { | |||
return cellvalue != null && cellvalue != "" && cellvalue != undefined ? cellvalue.toFixed(2) : "0.00"; | |||
} | |||
}, | |||
{ | |||
label: "金额(元)", name: "Amount", width: 200, align: "left", statistics: true, | |||
formatter: function (cellvalue) { | |||
return cellvalue != null && cellvalue != "" && cellvalue != undefined ? cellvalue.toFixed(2) : "0.00"; | |||
} | |||
}, | |||
{ | |||
label: "固定资产", name: "IsFixedAssets", width: 100, align: "left" | |||
, formatterAsync: function (callback, value, row, op, $cell) { | |||
learun.clientdata.getAsync('dataItem', { | |||
key: value, | |||
code: 'YesOrNoInt', | |||
callback: function (_data) { | |||
callback(_data.text); | |||
} | |||
}); | |||
} | |||
}, | |||
], | |||
mainId: 'Id', | |||
isPage: true, | |||
sidx: 'ApplyTime desc' | |||
}); | |||
//page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
param.StartTime = startTime; | |||
param.EndTime = endTime; | |||
param.SqlParameter = ' AND Status = 2 '; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function (res, postData) { | |||
if (!!res) { | |||
if (res.code == 200) { | |||
// 发起流程 | |||
var postData = { | |||
schemeCode: 'LC_FundsApply',// 填写流程对应模板编号 | |||
processId: processId, | |||
level: '1', | |||
}; | |||
learun.httpAsync('Post', top.$.rootUrl + '/LR_NewWorkFlow/NWFProcess/CreateFlow', postData, function (data) { | |||
learun.loading(false); | |||
}); | |||
} | |||
page.search(); | |||
} | |||
}; | |||
page.init(); | |||
} |
@@ -1025,6 +1025,7 @@ | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_Warning\Form.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\Ass_Warning\Index.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\FundsApply\FormView.js" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\FundsApply\StatsIndex.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\ArrangeExamTermNew\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\ArrangeExamTermNew\Index.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\ArrangeExamTermNew\IndexForClass.js" /> | |||
@@ -1096,6 +1097,7 @@ | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ArrangeExamTermNew\TeachingQualityIndex.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ArrangeExamTermNew\IndexItem.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ArrangeExamTermNew\TeachingQualityIndex.cshtml" /> | |||
<Content Include="Areas\AssetManagementSystem\Views\FundsApply\StatsIndex.cshtml" /> | |||
<None Include="Areas\EducationalAdministration\Views\Exam_ArrangeExamTermNew\SeatForm.cshtml" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ExamLesson\Form.js" /> | |||
<Content Include="Areas\EducationalAdministration\Views\Exam_ExamLesson\FormExamTime.js" /> | |||
@@ -42,6 +42,24 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
} | |||
} | |||
} | |||
public IEnumerable<FundsApplyEntity> GetStatsList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
return fundsApplyService.GetStatsList(pagination, queryJson); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取FundsApply表实体数据 | |||
@@ -124,7 +142,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
{ | |||
try | |||
{ | |||
return fundsApplyService.SaveCode(Code,keyValue); | |||
return fundsApplyService.SaveCode(Code, keyValue); | |||
} | |||
catch (Exception ex) | |||
{ | |||
@@ -107,6 +107,16 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
} | |||
#endregion | |||
#region 扩展字段 | |||
[NotMapped] | |||
public string ProjectContent { get; set; } | |||
[NotMapped] | |||
public decimal? Number { get; set; } | |||
[NotMapped] | |||
public decimal? Price { get; set; } | |||
[NotMapped] | |||
public decimal? Amount { get; set; } | |||
[NotMapped] | |||
public string Unit { get; set; } | |||
#endregion | |||
} | |||
} | |||
@@ -22,6 +22,8 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<FundsApplyEntity> GetPageList(Pagination pagination, string queryJson); | |||
IEnumerable<FundsApplyEntity> GetStatsList(Pagination pagination, string queryJson); | |||
/// <summary> | |||
/// 获取FundsApply表实体数据 | |||
/// </summary> | |||
@@ -46,13 +46,28 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
dp.Add("endTime", queryParam["EndTime"].ToDate(), DbType.DateTime); | |||
strSql.Append(" AND ( t.ApplyTime >= @startTime AND t.ApplyTime <= @endTime ) "); | |||
} | |||
if (!queryParam["DeclarationDept"].IsEmpty()) | |||
{ | |||
dp.Add("DeclarationDept", queryParam["DeclarationDept"].ToString(), DbType.String); | |||
strSql.Append(" AND t.DeclarationDept = @DeclarationDept "); | |||
} | |||
if (!queryParam["Informant"].IsEmpty()) | |||
{ | |||
dp.Add("Informant", queryParam["Informant"].ToString(), DbType.String); | |||
strSql.Append(" AND t.Informant = @Informant "); | |||
} | |||
if (!queryParam["DeclarationType"].IsEmpty()) | |||
{ | |||
dp.Add("DeclarationType", queryParam["DeclarationType"].ToString(), DbType.String); | |||
strSql.Append(" AND t.DeclarationType = @DeclarationType "); | |||
} | |||
var userLogin = LoginUserInfo.Get(); | |||
//校长 | |||
var PrincipalRole = Config.GetValue("PrincipalRoleId"); | |||
//按角色查询是否有查看的权限 | |||
var FundsApplyRole = Config.GetValue("FundsApplyRoleId"); | |||
var loginInfoRoleIds = LoginUserInfo.Get().roleIds; | |||
if (!userLogin.Description.Contains("管理员") && !loginInfoRoleIds.Split(',').Contains(PrincipalRole)&& !loginInfoRoleIds.Split(',').Contains(FundsApplyRole)) | |||
if (!userLogin.Description.Contains("管理员") && !loginInfoRoleIds.Split(',').Contains(PrincipalRole) && !loginInfoRoleIds.Split(',').Contains(FundsApplyRole)) | |||
{ | |||
strSql.Append(" AND t.ApplyUser = '" + userLogin.userId + "' "); | |||
} | |||
@@ -79,6 +94,59 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||
} | |||
} | |||
public IEnumerable<FundsApplyEntity> GetStatsList(Pagination pagination, string queryJson) | |||
{ | |||
try | |||
{ | |||
var strSql = new StringBuilder(); | |||
strSql.Append("SELECT "); | |||
strSql.Append(@" ApplyTime, IsFixedAssets,DeclarationType,DeclarationDept,ProjectContent,Number,Price,Amount,Unit | |||
from FundsApply zb | |||
left join FundsApplyDetail fb on zb.ID= fb.applyid | |||
"); | |||
strSql.Append(" WHERE 1=1 "); | |||
var queryParam = queryJson.ToJObject(); | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
if (!queryParam["StartTime"].IsEmpty() && !queryParam["EndTime"].IsEmpty()) | |||
{ | |||
dp.Add("startTime", queryParam["StartTime"].ToDate(), DbType.DateTime); | |||
dp.Add("endTime", queryParam["EndTime"].ToDate(), DbType.DateTime); | |||
strSql.Append(" AND ( zb.ApplyTime >= @startTime AND zb.ApplyTime <= @endTime ) "); | |||
} | |||
if (!queryParam["SqlParameter"].IsEmpty()) | |||
{ | |||
strSql.Append(queryParam["SqlParameter"].ToString()); | |||
} | |||
if (!queryParam["DeclarationDept"].IsEmpty()) | |||
{ | |||
dp.Add("DeclarationDept", queryParam["DeclarationDept"].ToString(), DbType.String); | |||
strSql.Append(" AND zb.DeclarationDept = @DeclarationDept "); | |||
} | |||
if (!queryParam["IsFixedAssets"].IsEmpty()) | |||
{ | |||
dp.Add("IsFixedAssets", queryParam["IsFixedAssets"].ToString(), DbType.String); | |||
strSql.Append(" AND zb.IsFixedAssets = @IsFixedAssets "); | |||
} | |||
if (!queryParam["DeclarationType"].IsEmpty()) | |||
{ | |||
dp.Add("DeclarationType", queryParam["DeclarationType"].ToString(), DbType.String); | |||
strSql.Append(" AND zb.DeclarationType = @DeclarationType "); | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<FundsApplyEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取FundsApply表实体数据 | |||
/// </summary> | |||