diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/FundsApplyController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/FundsApplyController.cs index 49615b7a5..62a9369da 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/FundsApplyController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/FundsApplyController.cs @@ -138,13 +138,12 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers List detailList = fundsApplyDetailList.ToObject>(); var code = entity.EnCode; var savecode = fundsApplyIBLL.SaveCode(entity.EnCode, keyValue); - + entity.EnCode = savecode; var encode = savecode.Substring(13).ToInt(); if (encode > 99) { return Fail("保存失败,经费开支单今日数量已超上限,请您明日编辑!"); } - entity.EnCode = savecode; if (code != entity.EnCode) { fundsApplyIBLL.SaveEntity(keyValue, entity, detailList); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/FundsApply/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/FundsApply/Form.js index afe703ac6..e47f12806 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/FundsApply/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/FundsApply/Form.js @@ -196,6 +196,12 @@ var bootstrap = function ($, learun) { if (!$('body').lrValidform()) { return false; } + var datas = $('#FundsApplyDetail').jfGridGet('rowdatas'); + if (datas == null || datas.length == 0) { + learun.alert.warning("经费开支申报单未包含明细!请先新增明细!"); + return false; + } + return true; return true; }; // 保存数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/FundsApplyApi.cs b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/FundsApplyApi.cs index b8d9c7e6c..35e9c16bc 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/FundsApplyApi.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.WebApi/Modules/FundsApplyApi.cs @@ -131,13 +131,13 @@ namespace Learun.Application.WebApi List detailList = parameter.fundsApplyDetailList.ToObject>(); var code = entity.EnCode; var savecode = fundsApplyIBLL.SaveCode(entity.EnCode, parameter.keyValue); + entity.EnCode = savecode; var encode = savecode.Substring(13).ToInt(); if (encode > 99) { return Fail("保存失败,经费开支单今日数量已超上限,请您明日编辑!"); } - entity.EnCode = savecode; if (code != entity.EnCode) { fundsApplyIBLL.SaveEntity(parameter.keyValue, entity, detailList); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/FundsApply/FundsApplyService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/FundsApply/FundsApplyService.cs index 38205d571..fe2c7fb7a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/FundsApply/FundsApplyService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/FundsApply/FundsApplyService.cs @@ -162,9 +162,9 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem } public string SaveCode(string Code, string keyValue) { - var result = ""; + var result = Code; var strSql = new StringBuilder(); - strSql.Append(@"select * from FundsApply where 1= 1 and ApplyTime >= '" + DateTime.Now.Date + " and Encode = '" + Code + "''"); + strSql.Append(@"select * from FundsApply where 1= 1 and ApplyTime >= '" + DateTime.Now.Date + "' and Encode = '" + Code + "'"); var data = this.BaseRepository("CollegeMIS").FindList(strSql.ToString()).FirstOrDefault(); var Codes = "JFKZ_" + CommonHelper.StringTime(); if (data != null && !string.IsNullOrEmpty(data.EnCode)) @@ -173,7 +173,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem { if (data.Id == keyValue) { - result = Code; + return result; } else if (data.Id != keyValue && Code != data.EnCode) {