@@ -138,13 +138,12 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers | |||||
List<FundsApplyDetailEntity> detailList = fundsApplyDetailList.ToObject<List<FundsApplyDetailEntity>>(); | List<FundsApplyDetailEntity> detailList = fundsApplyDetailList.ToObject<List<FundsApplyDetailEntity>>(); | ||||
var code = entity.EnCode; | var code = entity.EnCode; | ||||
var savecode = fundsApplyIBLL.SaveCode(entity.EnCode, keyValue); | var savecode = fundsApplyIBLL.SaveCode(entity.EnCode, keyValue); | ||||
entity.EnCode = savecode; | |||||
var encode = savecode.Substring(13).ToInt(); | var encode = savecode.Substring(13).ToInt(); | ||||
if (encode > 99) | if (encode > 99) | ||||
{ | { | ||||
return Fail("保存失败,经费开支单今日数量已超上限,请您明日编辑!"); | return Fail("保存失败,经费开支单今日数量已超上限,请您明日编辑!"); | ||||
} | } | ||||
entity.EnCode = savecode; | |||||
if (code != entity.EnCode) | if (code != entity.EnCode) | ||||
{ | { | ||||
fundsApplyIBLL.SaveEntity(keyValue, entity, detailList); | fundsApplyIBLL.SaveEntity(keyValue, entity, detailList); | ||||
@@ -196,6 +196,12 @@ var bootstrap = function ($, learun) { | |||||
if (!$('body').lrValidform()) { | if (!$('body').lrValidform()) { | ||||
return false; | return false; | ||||
} | } | ||||
var datas = $('#FundsApplyDetail').jfGridGet('rowdatas'); | |||||
if (datas == null || datas.length == 0) { | |||||
learun.alert.warning("经费开支申报单未包含明细!请先新增明细!"); | |||||
return false; | |||||
} | |||||
return true; | |||||
return true; | return true; | ||||
}; | }; | ||||
// 保存数据 | // 保存数据 | ||||
@@ -131,13 +131,13 @@ namespace Learun.Application.WebApi | |||||
List<FundsApplyDetailEntity> detailList = parameter.fundsApplyDetailList.ToObject<List<FundsApplyDetailEntity>>(); | List<FundsApplyDetailEntity> detailList = parameter.fundsApplyDetailList.ToObject<List<FundsApplyDetailEntity>>(); | ||||
var code = entity.EnCode; | var code = entity.EnCode; | ||||
var savecode = fundsApplyIBLL.SaveCode(entity.EnCode, parameter.keyValue); | var savecode = fundsApplyIBLL.SaveCode(entity.EnCode, parameter.keyValue); | ||||
entity.EnCode = savecode; | |||||
var encode = savecode.Substring(13).ToInt(); | var encode = savecode.Substring(13).ToInt(); | ||||
if (encode > 99) | if (encode > 99) | ||||
{ | { | ||||
return Fail("保存失败,经费开支单今日数量已超上限,请您明日编辑!"); | return Fail("保存失败,经费开支单今日数量已超上限,请您明日编辑!"); | ||||
} | } | ||||
entity.EnCode = savecode; | |||||
if (code != entity.EnCode) | if (code != entity.EnCode) | ||||
{ | { | ||||
fundsApplyIBLL.SaveEntity(parameter.keyValue, entity, detailList); | fundsApplyIBLL.SaveEntity(parameter.keyValue, entity, detailList); | ||||
@@ -162,9 +162,9 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||||
} | } | ||||
public string SaveCode(string Code, string keyValue) | public string SaveCode(string Code, string keyValue) | ||||
{ | { | ||||
var result = ""; | |||||
var result = Code; | |||||
var strSql = new StringBuilder(); | 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<FundsApplyEntity>(strSql.ToString()).FirstOrDefault(); | var data = this.BaseRepository("CollegeMIS").FindList<FundsApplyEntity>(strSql.ToString()).FirstOrDefault(); | ||||
var Codes = "JFKZ_" + CommonHelper.StringTime(); | var Codes = "JFKZ_" + CommonHelper.StringTime(); | ||||
if (data != null && !string.IsNullOrEmpty(data.EnCode)) | if (data != null && !string.IsNullOrEmpty(data.EnCode)) | ||||
@@ -173,7 +173,7 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem | |||||
{ | { | ||||
if (data.Id == keyValue) | if (data.Id == keyValue) | ||||
{ | { | ||||
result = Code; | |||||
return result; | |||||
} | } | ||||
else if (data.Id != keyValue && Code != data.EnCode) | else if (data.Id != keyValue && Code != data.EnCode) | ||||
{ | { | ||||