@@ -26,7 +26,7 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers | |||
[HttpGet] | |||
public ActionResult Index() | |||
{ | |||
return View(); | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 主页面 | |||
@@ -37,7 +37,7 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
/// <summary> | |||
@@ -45,7 +45,7 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers | |||
[HttpGet] | |||
public ActionResult Form() | |||
{ | |||
return View(); | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
@@ -56,7 +56,16 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers | |||
{ | |||
return View(); | |||
} | |||
/// <summary> | |||
/// 表单页 | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpGet] | |||
public ActionResult IndexTJ() | |||
{ | |||
return View(); | |||
} | |||
#endregion | |||
#region 获取数据 | |||
@@ -82,6 +91,28 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
[HttpGet] | |||
[AjaxOnly] | |||
public ActionResult GetPageListForTJ(string pagination) | |||
{ | |||
Pagination paginationobj = pagination.ToObject<Pagination>(); | |||
var data = vehicleCostIBLL.GetPageListForTJ(paginationobj); | |||
var jsonData = new | |||
{ | |||
rows = data, | |||
total = paginationobj.total, | |||
page = paginationobj.page, | |||
records = paginationobj.records | |||
}; | |||
return Success(jsonData); | |||
} | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
@@ -93,7 +124,7 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers | |||
public ActionResult GetList(string queryJson) | |||
{ | |||
var data = vehicleCostIBLL.GetList(queryJson); | |||
return Success(data); | |||
} | |||
@@ -121,8 +152,9 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers | |||
[AjaxOnly] | |||
public ActionResult GetFormData(string keyValue) | |||
{ | |||
var VehicleCostData = vehicleCostIBLL.GetVehicleCostEntity( keyValue ); | |||
var jsonData = new { | |||
var VehicleCostData = vehicleCostIBLL.GetVehicleCostEntity(keyValue); | |||
var jsonData = new | |||
{ | |||
VehicleCost = VehicleCostData, | |||
}; | |||
return Success(jsonData); | |||
@@ -155,7 +187,7 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers | |||
public ActionResult SaveForm(string keyValue, string strEntity) | |||
{ | |||
VehicleCostEntity entity = strEntity.ToObject<VehicleCostEntity>(); | |||
vehicleCostIBLL.SaveEntity(keyValue,entity); | |||
vehicleCostIBLL.SaveEntity(keyValue, entity); | |||
if (string.IsNullOrEmpty(keyValue)) | |||
{ | |||
} | |||
@@ -3,15 +3,15 @@ | |||
Layout = "~/Views/Shared/_Form.cshtml"; | |||
} | |||
<div class="lr-form-wrap" id="form"> | |||
<div class="col-xs-6 lr-form-item" data-table="VehicleCost" > | |||
<div class="lr-form-item-title">公务用车购置价款</div> | |||
<div class="col-xs-12 lr-form-item" data-table="VehicleCost" > | |||
<div class="lr-form-item-title">公车购置价款</div> | |||
<input id="BuyPrice" type="text" class="form-control" isvalid="yes" checkexpession="NumOrNull" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="VehicleCost" > | |||
<div class="col-xs-12 lr-form-item" data-table="VehicleCost" > | |||
<div class="lr-form-item-title">车辆购置税</div> | |||
<input id="BuyTax" type="text" class="form-control" isvalid="yes" checkexpession="NumOrNull" /> | |||
</div> | |||
<div class="col-xs-6 lr-form-item" data-table="VehicleCost" > | |||
<div class="col-xs-12 lr-form-item" data-table="VehicleCost" > | |||
<div class="lr-form-item-title">其他相关支出</div> | |||
<input id="BuyOther" type="text" class="form-control" isvalid="yes" checkexpession="NumOrNull" /> | |||
</div> | |||
@@ -36,7 +36,7 @@ var bootstrap = function ($, learun) { | |||
url = '/CustomFunction/VehicleCost/Form?VehicleId=' + VehicleId; | |||
} | |||
learun.layerForm({ | |||
id: 'form', | |||
id: 'form_add', | |||
title: '新增', | |||
url: top.$.rootUrl + url, | |||
width: 600, | |||
@@ -58,7 +58,7 @@ var bootstrap = function ($, learun) { | |||
} | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
id: 'form_add', | |||
title: '编辑', | |||
url: top.$.rootUrl + url, | |||
width: 600, | |||
@@ -0,0 +1,25 @@ | |||
@{ | |||
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> | |||
<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 class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i> 打印</a> | |||
</div> | |||
</div> | |||
</div> | |||
<div class="lr-layout-body" id="gridtable"></div> | |||
</div> | |||
</div> | |||
</div> | |||
@Html.AppendJsFile("/Areas/CustomFunction/Views/VehicleCost/IndexTJ.js") |
@@ -0,0 +1,48 @@ | |||
/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) | |||
* Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 | |||
* 创建人:超级管理员 | |||
* 日 期:2021-07-22 09:20 | |||
* 描 述:车辆费用信息 | |||
*/ | |||
var refreshGirdData; | |||
var bootstrap = function ($, learun) { | |||
"use strict"; | |||
var page = { | |||
init: function () { | |||
page.initGird(); | |||
page.bind(); | |||
}, | |||
bind: function () { | |||
// 刷新 | |||
$('#lr_refresh').on('click', function () { | |||
location.reload(); | |||
}); | |||
// 打印 | |||
$('#lr_print').on('click', function () { | |||
$('#gridtable').jqprintTable(); | |||
}); | |||
}, | |||
// 初始化列表 | |||
initGird: function () { | |||
$('#gridtable').jfGrid({ | |||
url: top.$.rootUrl + '/CustomFunction/VehicleCost/GetPageListForTJ', | |||
headData: [ | |||
{ label: "车辆识别码", name: "IdenCode", width: 100, align: "left" }, | |||
{ label: "公车购置费用", name: "sumBuyPrice", width: 100, align: "left" }, | |||
{ label: "使用费用", name: "sumUsePrice", width: 100, align: "left" } | |||
], | |||
mainId: 'Id', | |||
isPage: true | |||
}); | |||
page.search(); | |||
}, | |||
search: function (param) { | |||
param = param || {}; | |||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | |||
} | |||
}; | |||
refreshGirdData = function () { | |||
$('#gridtable').jfGridSet('reload'); | |||
}; | |||
page.init(); | |||
} |
@@ -992,6 +992,7 @@ | |||
<Content Include="Areas\CustomFunction\Views\OfficialSeal\Form.js" /> | |||
<Content Include="Areas\CustomFunction\Views\OfficialSeal\Index.js" /> | |||
<Content Include="Areas\CustomFunction\Views\VehicleCost\FormBuy.js" /> | |||
<Content Include="Areas\CustomFunction\Views\VehicleCost\IndexTJ.js" /> | |||
<Content Include="Areas\CustomFunction\Views\VehicleCost\IndexCost.js" /> | |||
<Content Include="Areas\CustomFunction\Views\VehicleInfo\FormBF.js" /> | |||
<Content Include="Areas\CustomFunction\Views\VehicleInfo\IndexBF.js" /> | |||
@@ -7513,6 +7514,7 @@ | |||
<Content Include="Areas\ReceiveSendFeeManagement\Views\FD_PayManage\PrintPublic.cshtml" /> | |||
<Content Include="Areas\ReceiveSendFeeManagement\Views\FD_PayManage\PrintSpecial.cshtml" /> | |||
<Content Include="Areas\CustomFunction\Views\CompetitionAward\IndexTJ.cshtml" /> | |||
<Content Include="Areas\CustomFunction\Views\VehicleCost\IndexTJ.cshtml" /> | |||
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" /> | |||
<Content Include="Areas\PersonnelManagement\Views\MeetingManagement\IndexOfMyJoin.cshtml" /> | |||
<Content Include="Areas\PersonnelManagement\Views\MeetingSignInRecord\IndexAttendance.cshtml" /> | |||
@@ -42,7 +42,30 @@ namespace Learun.Application.TwoDevelopment.CustomFunction | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
/// <param name="pagination">分页参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<VehicleCostEntity> GetPageListForTJ(Pagination pagination) | |||
{ | |||
try | |||
{ | |||
return vehicleCostService.GetPageListForTJ(pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||
@@ -1,6 +1,7 @@ | |||
using Learun.Util; | |||
using System; | |||
using System.ComponentModel.DataAnnotations.Schema; | |||
using LoginUserInfo = Learun.Util.LoginUserInfo; | |||
namespace Learun.Application.TwoDevelopment.CustomFunction | |||
{ | |||
@@ -11,7 +12,7 @@ namespace Learun.Application.TwoDevelopment.CustomFunction | |||
/// 日 期:2021-07-22 09:20 | |||
/// 描 述:车辆费用信息 | |||
/// </summary> | |||
public class VehicleCostEntity | |||
public class VehicleCostEntity | |||
{ | |||
#region 实体成员 | |||
/// <summary> | |||
@@ -108,6 +109,10 @@ namespace Learun.Application.TwoDevelopment.CustomFunction | |||
public void Create() | |||
{ | |||
this.Id = Guid.NewGuid().ToString(); | |||
this.CreateTime = DateTime.Now; | |||
var userinfo = LoginUserInfo.Get(); | |||
this.CreateUserId = userinfo.userId; | |||
this.CreateUserName = userinfo.realName; | |||
} | |||
/// <summary> | |||
/// 编辑调用 | |||
@@ -119,6 +124,13 @@ namespace Learun.Application.TwoDevelopment.CustomFunction | |||
} | |||
#endregion | |||
#region 扩展字段 | |||
[NotMapped] | |||
public decimal? sumBuyPrice { get; set; } | |||
[NotMapped] | |||
public decimal? sumUsePrice { get; set; } | |||
[NotMapped] | |||
public string IdenCode { get; set; } | |||
#endregion | |||
} | |||
} | |||
@@ -21,6 +21,7 @@ namespace Learun.Application.TwoDevelopment.CustomFunction | |||
/// <param name="queryJson">查询参数</param> | |||
/// <returns></returns> | |||
IEnumerable<VehicleCostEntity> GetPageList(Pagination pagination, string queryJson); | |||
IEnumerable<VehicleCostEntity> GetPageListForTJ(Pagination pagination); | |||
IEnumerable<VehicleCostEntity> GetList(string queryJson); | |||
/// <summary> | |||
/// 获取VehicleCost表实体数据 | |||
@@ -64,6 +64,36 @@ namespace Learun.Application.TwoDevelopment.CustomFunction | |||
} | |||
} | |||
/// <summary> | |||
/// 获取列表数据 | |||
/// </summary> | |||
/// <param name="pagination">查询参数</param> | |||
/// <returns></returns> | |||
public IEnumerable<VehicleCostEntity> GetPageListForTJ(Pagination pagination) | |||
{ | |||
try | |||
{ | |||
string sql = @"select t.*,a.IdenCode from ( | |||
select VehicleId,sum(isnull(BuyPrice,0)+isnull(BuyTax,0)+isnull(BuyOther,0)) as sumBuyPrice,sum(isnull(FuelCost,0)+isnull(RepairCost,0)+isnull(InsuranceCost,0)+isnull(PassingByCost,0)+isnull(ParkingRate,0)+isnull(UseOther,0)) as sumUsePrice from VehicleCost group by VehicleId | |||
) t | |||
join VehicleInfo a on a.Id=t.VehicleId | |||
"; | |||
// 虚拟参数 | |||
var dp = new DynamicParameters(new { }); | |||
return this.BaseRepository("CollegeMIS").FindList<VehicleCostEntity>(sql,dp, pagination); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 获取页面显示列表数据 | |||
/// </summary> | |||