@@ -123,6 +123,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
if (string.IsNullOrEmpty(keyValue)) | if (string.IsNullOrEmpty(keyValue)) | ||||
{ | { | ||||
entity.IsDel = 0; | entity.IsDel = 0; | ||||
entity.IsSubmit = 0; | |||||
entity.FinallyNum = 0; | entity.FinallyNum = 0; | ||||
entity.CreateTime = DateTime.Now; | entity.CreateTime = DateTime.Now; | ||||
entity.CrateUserID = loginUserInfo.userId; | entity.CrateUserID = loginUserInfo.userId; | ||||
@@ -135,6 +136,19 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers | |||||
textbookInOutIBLL.SaveEntity(keyValue, entity); | textbookInOutIBLL.SaveEntity(keyValue, entity); | ||||
return Success("保存成功!"); | return Success("保存成功!"); | ||||
} | } | ||||
/// <summary> | |||||
/// 提交 | |||||
/// </summary> | |||||
/// <param name="keyValue"></param> | |||||
/// <returns></returns> | |||||
[HttpPost] | |||||
[AjaxOnly] | |||||
public ActionResult SubmitForm(string keyValue) | |||||
{ | |||||
textbookInOutIBLL.SubmitEntity(keyValue); | |||||
return Success("删除成功!"); | |||||
} | |||||
#endregion | #endregion | ||||
} | } | ||||
@@ -20,7 +20,7 @@ | |||||
</div> | </div> | ||||
<div class="col-xs-12 lr-form-item" data-table="BC_ShopPurchaseRecord"> | <div class="col-xs-12 lr-form-item" data-table="BC_ShopPurchaseRecord"> | ||||
<div class="lr-form-item-title">创建时间<font face="宋体">*</font></div> | <div class="lr-form-item-title">创建时间<font face="宋体">*</font></div> | ||||
<input id="CreateTime" type="text" class="form-control lr-input-wdatepicker" isvalid="yes" checkexpession="isDateTime" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss',onpicked: function () { $('#CreateTime').trigger('change'); } })" /> | |||||
<input id="CreateTime" type="text" class="form-control lr-input-wdatepicker" isvalid="yes" checkexpession="DateTime" onfocus="WdatePicker({ dateFmt:'yyyy-MM-dd HH:mm:ss',onpicked: function () { $('#CreateTime').trigger('change'); } })" /> | |||||
</div> | </div> | ||||
<div class="col-xs-12 lr-form-item"> | <div class="col-xs-12 lr-form-item"> | ||||
<div class="lr-form-item-title">备注</div> | <div class="lr-form-item-title">备注</div> | ||||
@@ -89,6 +89,7 @@ var bootstrap = function ($, learun) { | |||||
}, | }, | ||||
search: function (param) { | search: function (param) { | ||||
param = param || {}; | param = param || {}; | ||||
param.SqlParameter = ' and IsSubmit =1 '; | |||||
$('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); | $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); | ||||
} | } | ||||
}; | }; | ||||
@@ -8,15 +8,15 @@ | |||||
<div class="lr-form-wrap" id="form"> | <div class="lr-form-wrap" id="form"> | ||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | <div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | ||||
<div class="lr-form-item-title">库存编码<font face="宋体">*</font></div> | <div class="lr-form-item-title">库存编码<font face="宋体">*</font></div> | ||||
<input id="BookCode" type="text" class="form-control" isvalid="yes" checkexpession="NotNull " readonly /> | |||||
<input id="BookCode" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" readonly /> | |||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | <div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | ||||
<div class="lr-form-item-title">课程<font face="宋体">*</font></div> | <div class="lr-form-item-title">课程<font face="宋体">*</font></div> | ||||
<div id="LessonNo" isvalid="yes" checkexpession="NotNull"></div> | <div id="LessonNo" isvalid="yes" checkexpession="NotNull"></div> | ||||
</div> | </div> | ||||
<div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | <div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | ||||
<div class="lr-form-item-title">教材</div> | |||||
<input id="TextBookName" type="text" class="form-control" /> | |||||
<div class="lr-form-item-title">教材<font face="宋体">*</font></div> | |||||
<input id="TextBookName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull"/> | |||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | <div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | ||||
<div class="lr-form-item-title">教材号</div> | <div class="lr-form-item-title">教材号</div> | ||||
@@ -44,7 +44,11 @@ | |||||
</div> | </div> | ||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | <div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | ||||
<div class="lr-form-item-title">印次</div> | <div class="lr-form-item-title">印次</div> | ||||
<input id="Impression" type="text" class="form-control" /> | |||||
<input id="Impression" type="text" class="form-control" readonly /> | |||||
</div> | |||||
<div class="col-xs-6 lr-form-item" data-table="TextBookInOut"> | |||||
<div class="lr-form-item-title">数量<font face="宋体">*</font></div> | |||||
<input id="FinallyNum" type="number" class="form-control" isvalid="yes" checkexpession="PositiveInteger" /> | |||||
</div> | </div> | ||||
<div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | <div class="col-xs-12 lr-form-item" data-table="TextBookInOut"> | ||||
<div class="lr-form-item-title">备注</div> | <div class="lr-form-item-title">备注</div> | ||||
@@ -22,7 +22,7 @@ | |||||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | <a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | ||||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | <a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | ||||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | <a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | ||||
</div> | |||||
<a id="lr_submit" class="btn btn-default"><i class="fa fa-plus"></i> 提交</a> </div> | |||||
</div> | </div> | ||||
</div> | </div> | ||||
<div class="lr-layout-body" id="gridtable"></div> | <div class="lr-layout-body" id="gridtable"></div> | ||||
@@ -10,6 +10,7 @@ var bootstrap = function ($, learun) { | |||||
var page = { | var page = { | ||||
init: function () { | init: function () { | ||||
page.initGird(); | page.initGird(); | ||||
console.log(223223223); | |||||
page.bind(); | page.bind(); | ||||
}, | }, | ||||
bind: function () { | bind: function () { | ||||
@@ -40,6 +41,11 @@ var bootstrap = function ($, learun) { | |||||
$('#lr_edit').on('click', function () { | $('#lr_edit').on('click', function () { | ||||
var keyValue = $('#gridtable').jfGridValue('ID'); | var keyValue = $('#gridtable').jfGridValue('ID'); | ||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
var IsSubmit = $('#gridtable').jfGridValue('IsSubmit'); | |||||
if (IsSubmit == 1) { | |||||
learun.alert.warning("当前项目已提交,不可编辑!"); | |||||
return; | |||||
} | |||||
learun.layerForm({ | learun.layerForm({ | ||||
id: 'form', | id: 'form', | ||||
title: '编辑', | title: '编辑', | ||||
@@ -56,6 +62,11 @@ var bootstrap = function ($, learun) { | |||||
$('#lr_delete').on('click', function () { | $('#lr_delete').on('click', function () { | ||||
var keyValue = $('#gridtable').jfGridValue('ID'); | var keyValue = $('#gridtable').jfGridValue('ID'); | ||||
if (learun.checkrow(keyValue)) { | if (learun.checkrow(keyValue)) { | ||||
var IsSubmit = $('#gridtable').jfGridValue('IsSubmit'); | |||||
if (IsSubmit == 1) { | |||||
learun.alert.warning("当前项目已提交,不可删除!"); | |||||
return; | |||||
} | |||||
learun.layerConfirm('是否确认删除该项!', function (res) { | learun.layerConfirm('是否确认删除该项!', function (res) { | ||||
if (res) { | if (res) { | ||||
learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookInOut/DeleteForm', { keyValue: keyValue }, function () { | learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookInOut/DeleteForm', { keyValue: keyValue }, function () { | ||||
@@ -64,6 +75,23 @@ var bootstrap = function ($, learun) { | |||||
}); | }); | ||||
} | } | ||||
}); | }); | ||||
$('#lr_submit').on('click', function () { | |||||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||||
if (learun.checkrow(keyValue)) { | |||||
var IsSubmit = $('#gridtable').jfGridValue('IsSubmit'); | |||||
if (IsSubmit == 1) { | |||||
learun.alert.warning("当前项目已提交,请勿重复提交!"); | |||||
return; | |||||
} | |||||
learun.layerConfirm('是否确认提交该项!', function (res) { | |||||
if (res) { | |||||
learun.postForm(top.$.rootUrl + '/EducationalAdministration/TextBookInOut/SubmitForm', { keyValue: keyValue }, function (res) { | |||||
refreshGirdData(res, {}); | |||||
}); | |||||
} | |||||
}); | |||||
} | |||||
}); | |||||
}, | }, | ||||
initGird: function () { | initGird: function () { | ||||
$('#gridtable').lrAuthorizeJfGrid({ | $('#gridtable').lrAuthorizeJfGrid({ | ||||
@@ -108,6 +136,7 @@ var bootstrap = function ($, learun) { | |||||
}, | }, | ||||
search: function (param) { | search: function (param) { | ||||
param = param || {}; | param = param || {}; | ||||
param.SqlParameter = 'and IsDel = 0 '; | |||||
$('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); | ||||
} | } | ||||
}; | }; | ||||
@@ -841,7 +841,7 @@ | |||||
<Compile Include="Areas\EducationalAdministration\Controllers\TextBookIndentDetailController.cs" /> | <Compile Include="Areas\EducationalAdministration\Controllers\TextBookIndentDetailController.cs" /> | ||||
<Compile Include="Areas\EducationalAdministration\Controllers\TextBookSolSubController.cs" /> | <Compile Include="Areas\EducationalAdministration\Controllers\TextBookSolSubController.cs" /> | ||||
<Compile Include="Areas\EducationalAdministration\Controllers\TextBookSolSubDetailController.cs" /> | <Compile Include="Areas\EducationalAdministration\Controllers\TextBookSolSubDetailController.cs" /> | ||||
<Compile Include="Areas\EducationalAdministration\Controllers\TextbookInOutController.cs" /> | |||||
<Compile Include="Areas\EducationalAdministration\Controllers\TextBookInOutController.cs" /> | |||||
<Compile Include="Areas\EducationalAdministration\Controllers\TextBookInController.cs" /> | <Compile Include="Areas\EducationalAdministration\Controllers\TextBookInController.cs" /> | ||||
</ItemGroup> | </ItemGroup> | ||||
<ItemGroup> | <ItemGroup> | ||||
@@ -32,12 +32,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | { | ||||
var strSql = new StringBuilder(); | var strSql = new StringBuilder(); | ||||
strSql.Append("SELECT "); | strSql.Append("SELECT "); | ||||
strSql.Append(@" | |||||
t.ID, | |||||
t.TextBookName, | |||||
t.CreateTime, | |||||
t.CrateUserID | |||||
"); | |||||
strSql.Append(@" * "); | |||||
strSql.Append(" FROM TextBookIn t "); | strSql.Append(" FROM TextBookIn t "); | ||||
strSql.Append(" WHERE 1=1 "); | strSql.Append(" WHERE 1=1 "); | ||||
var queryParam = queryJson.ToJObject(); | var queryParam = queryJson.ToJObject(); | ||||
@@ -166,6 +166,28 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 删除实体数据 | |||||
/// </summary> | |||||
/// <param name="keyValue">主键</param> | |||||
public void SubmitEntity(string keyValue) | |||||
{ | |||||
try | |||||
{ | |||||
textbookInOutService.SubmitEntity(keyValue); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowBusinessException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
} | } | ||||
@@ -140,6 +140,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// <returns></returns> | /// <returns></returns> | ||||
[Column("ISDEL")] | [Column("ISDEL")] | ||||
public int? IsDel { get; set; } | public int? IsDel { get; set; } | ||||
/// <summary> | |||||
/// ISSUBMIT | |||||
/// </summary> | |||||
/// <returns></returns> | |||||
[Column("ISSUBMIT")] | |||||
public int? IsSubmit { get; set; } | |||||
#endregion | #endregion | ||||
@@ -55,6 +55,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
/// <param name="keyValue">主键</param> | /// <param name="keyValue">主键</param> | ||||
/// <param name="entity">实体</param> | /// <param name="entity">实体</param> | ||||
void SaveEntity(string keyValue, TextbookInOutEntity entity); | void SaveEntity(string keyValue, TextbookInOutEntity entity); | ||||
/// <summary> | |||||
/// 提交 | |||||
/// </summary> | |||||
/// <param name="keyValue"></param> | |||||
void SubmitEntity(string keyValue); | |||||
#endregion | #endregion | ||||
} | } | ||||
@@ -63,9 +63,14 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
{ | { | ||||
var strSql = new StringBuilder(); | var strSql = new StringBuilder(); | ||||
strSql.Append("SELECT *"); | strSql.Append("SELECT *"); | ||||
strSql.Append(" FROM TextbookInOut t where 1=1 and IsDel = 0 "); | |||||
strSql.Append(" FROM TextbookInOut t where 1=1 "); | |||||
var queryParam = queryJson.ToJObject(); | var queryParam = queryJson.ToJObject(); | ||||
var dp = new DynamicParameters(new { }); | var dp = new DynamicParameters(new { }); | ||||
if (!queryParam["SqlParameter"].IsEmpty()) | |||||
{ | |||||
string SqlParameter = queryParam["SqlParameter"].ToString(); | |||||
strSql.Append(SqlParameter); | |||||
} | |||||
if (!queryParam["keyword"].IsEmpty()) | if (!queryParam["keyword"].IsEmpty()) | ||||
{ | { | ||||
strSql.Append(" and ( t.TextBookNo like @keyword or t.TextBookName like @keyword or t.FirstAuthor like @keyword )"); | strSql.Append(" and ( t.TextBookNo like @keyword or t.TextBookName like @keyword or t.FirstAuthor like @keyword )"); | ||||
@@ -184,6 +189,37 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration | |||||
} | } | ||||
} | } | ||||
/// <summary> | |||||
/// 提交 | |||||
/// </summary> | |||||
/// <param name="keyValue"></param> | |||||
public void SubmitEntity(string keyValue) | |||||
{ | |||||
var db = this.BaseRepository("CollegeMIS").BeginTrans(); | |||||
try | |||||
{ | |||||
var keyValueArr = keyValue.Split(','); | |||||
foreach (var item in keyValueArr) | |||||
{ | |||||
var entity = BaseRepository("CollegeMIS").FindEntity<TextbookInOutEntity>(x => x.ID == item); | |||||
entity.IsSubmit = 1; | |||||
db.Update(entity); | |||||
} | |||||
db.Commit(); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
db.Rollback(); | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
#endregion | #endregion | ||||
} | } | ||||