@@ -151,6 +151,19 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers | |||
researchResultIBLL.SubmitEntity(keyValue); | |||
return Success("提交成功!"); | |||
} | |||
/// <summary> | |||
/// 提交数据 | |||
/// <param name="keyValue">主键</param> | |||
/// <summary> | |||
/// <returns></returns> | |||
[HttpPost] | |||
[AjaxOnly] | |||
public ActionResult EnableDisableForm(string keyValue, int? status) | |||
{ | |||
researchResultIBLL.EnableDisable(keyValue, status); | |||
return Success("操作成功!"); | |||
} | |||
#endregion | |||
} | |||
@@ -50,8 +50,9 @@ | |||
<a id="lr_view" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 查看</a> | |||
</div> | |||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | |||
<a id="lr_submit" class="btn btn-default"><i class="fa fa-plus"></i> 提交</a> | |||
<a id="lr_check" class="btn btn-default"><i class="fa fa-plus"></i> 审核</a> | |||
@*<a id="lr_submit" class="btn btn-default"><i class="fa fa-plus"></i> 提交</a>*@ | |||
<a id="lr_check" class="btn btn-default"><i class="fa fa-unlock"></i> 提交</a> | |||
<a id="lr_uncheck" class="btn btn-default"><i class="fa fa-plus"></i> 去审</a> | |||
</div> | |||
</div> | |||
</div> | |||
@@ -52,6 +52,10 @@ var bootstrap = function ($, learun) { | |||
learun.alert.warning("当前项目已提交,不可编辑!"); | |||
return; | |||
} | |||
if (keyValue.indexOf(',') != -1) { | |||
learun.alert.warning("只能选择一条记录进行编辑!"); | |||
return; | |||
} | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'form', | |||
@@ -69,8 +73,8 @@ var bootstrap = function ($, learun) { | |||
$('#lr_delete').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
var Status = $('#gridtable').jfGridValue('StatusMark'); | |||
if (Status != 0) { | |||
learun.alert.warning("当前项目已提交,不可删除!"); | |||
if (Status.indexOf('1') != -1) { | |||
learun.alert.warning("选中项包含已提交项,不可删除!"); | |||
return; | |||
} | |||
if (learun.checkrow(keyValue)) { | |||
@@ -86,6 +90,10 @@ var bootstrap = function ($, learun) { | |||
//查看 | |||
$('#lr_view').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (keyValue.indexOf(',') != -1) { | |||
learun.alert.warning("只能选择一条记录进行查看!"); | |||
return; | |||
} | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'FormView', | |||
@@ -105,40 +113,56 @@ var bootstrap = function ($, learun) { | |||
// $('#gridtable').jqprintTable(); | |||
//}); | |||
// 提交 | |||
$('#lr_submit').on('click', function () { | |||
//$('#lr_submit').on('click', function () { | |||
// var keyValue = $('#gridtable').jfGridValue('ID'); | |||
// if (learun.checkrow(keyValue)) { | |||
// var Status = $('#gridtable').jfGridValue('StatusMark'); | |||
// if (Status != 0) { | |||
// learun.alert.warning("当前项目已提交请勿进行重复提交!"); | |||
// return; | |||
// } | |||
// learun.layerConfirm('是否确认提交该项!', function (res) { | |||
// if (res) { | |||
// learun.postForm(top.$.rootUrl + '/PersonnelManagement/ResearchResult/SubmitForm', { keyValue: keyValue }, function () { | |||
// refreshGirdData(); | |||
// }); | |||
// } | |||
// }); | |||
// } | |||
//}); | |||
//提交 | |||
$('#lr_check').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
if (learun.checkrow(keyValue)) { | |||
var Status = $('#gridtable').jfGridValue('StatusMark'); | |||
if (Status != 0) { | |||
learun.alert.warning("当前项目已提交请勿进行重复提交!"); | |||
var StatusMark = $('#gridtable').jfGridValue('StatusMark'); | |||
if (StatusMark.indexOf('1') != -1) { | |||
learun.alert.warning("选中记录中包含已提交项目!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认提交该项!', function (res) { | |||
learun.layerConfirm('是否确认提交该项?', function (res) { | |||
if (res) { | |||
learun.postForm(top.$.rootUrl + '/PersonnelManagement/ResearchResult/SubmitForm', { keyValue: keyValue }, function () { | |||
learun.postForm(top.$.rootUrl + '/PersonnelManagement/ResearchResult/EnableDisableForm', { keyValue: keyValue, status: "1" }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
}); | |||
// 审核 | |||
$('#lr_check').on('click', function () { | |||
//去审 | |||
$('#lr_uncheck').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('ID'); | |||
var Status = $('#gridtable').jfGridValue('StatusMark'); | |||
if (Status != 1) { | |||
learun.alert.warning("当前项目已通过审核!"); | |||
return; | |||
} | |||
if (learun.checkrow(keyValue)) { | |||
learun.layerForm({ | |||
id: 'FormCheck', | |||
title: '查看', | |||
url: top.$.rootUrl + '/PersonnelManagement/ResearchResult/FormCheck?keyValue=' + keyValue, | |||
width: 600, | |||
height: 660, | |||
callBack: function (id) { | |||
return top[id].acceptClick(refreshGirdData); | |||
var StatusMark = $('#gridtable').jfGridValue('StatusMark'); | |||
var StatusMarkArr = StatusMark.split(','); | |||
if ($.inArray('0', StatusMarkArr) != -1 ) { | |||
learun.alert.warning("选中记录中未包含提交项!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认取消提交该项?', function (res) { | |||
if (res) { | |||
learun.postForm(top.$.rootUrl + '/PersonnelManagement/ResearchResult/EnableDisableForm', { keyValue: keyValue, status: "0" }, function () { | |||
refreshGirdData(); | |||
}); | |||
} | |||
}); | |||
} | |||
@@ -153,9 +177,7 @@ var bootstrap = function ($, learun) { | |||
label: "状态", name: "StatusMark", width: 80, align: "left", | |||
formatter: function (cellvalue, row) { | |||
if (cellvalue == "1") { | |||
return '<span class=\"label label-warning\">审批中</span>'; | |||
} else if (cellvalue == "2") { | |||
return '<span class=\"label label-success\">通过</span>'; | |||
return '<span class=\"label label-warning\">已提交</span>'; | |||
} else { | |||
return '<span class=\"label label-default\" >草稿</span>'; | |||
} | |||
@@ -237,7 +259,7 @@ var bootstrap = function ($, learun) { | |||
} | |||
}); | |||
} | |||
}, | |||
}, | |||
{ label: "发证单位(主管单位)", name: "CompetentUnit", width: 100, align: "left" }, | |||
{ | |||
label: "年度", name: "Year", width: 50, align: "left", | |||
@@ -253,7 +275,8 @@ var bootstrap = function ($, learun) { | |||
mainId: 'ID', | |||
isPage: true, | |||
sidx: " Createdate ,StatusMark", | |||
sord: 'desc' | |||
sord: 'desc', | |||
isMultiselect: true, | |||
}); | |||
page.search(); | |||
}, | |||
@@ -47,7 +47,7 @@ | |||
<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_view" class="btn btn-default"><i class="fa fa-search-minus"></i> 查看</a> | |||
<a id="lr_check" class="btn btn-default"><i class="fa fa-lock"></i> 审核</a> | |||
<a id="lr_check" class="btn btn-default"><i class="fa fa-lock"></i> 提交</a> | |||
<a id="lr_uncheck" class="btn btn-default"><i class="fa fa-unlock"></i> 去审</a> | |||
</div> | |||
</div> | |||
@@ -45,7 +45,7 @@ var bootstrap = function ($, learun) { | |||
} | |||
var State = $('#gridtable').jfGridValue('State'); | |||
if (State === "1") { | |||
learun.alert.warning("当前项目已审核不能编辑!"); | |||
learun.alert.warning("当前项目已提交不可编辑!"); | |||
return; | |||
} | |||
learun.layerForm({ | |||
@@ -65,7 +65,7 @@ var bootstrap = function ($, learun) { | |||
var keyValue = $('#gridtable').jfGridValue('TTID'); | |||
var State = $('#gridtable').jfGridValue('State'); | |||
if (State.indexOf('1') != -1) { | |||
learun.alert.warning("选中记录中包含已审核项目,已审核不能删除!"); | |||
learun.alert.warning("选中记录中包含已提交项目,已提交项目不可删除!"); | |||
return; | |||
} | |||
if (learun.checkrow(keyValue)) { | |||
@@ -99,16 +99,16 @@ var bootstrap = function ($, learun) { | |||
}); | |||
} | |||
}); | |||
//审核 | |||
//提交 | |||
$('#lr_check').on('click', function () { | |||
var keyValue = $('#gridtable').jfGridValue('TTID'); | |||
if (learun.checkrow(keyValue)) { | |||
var State = $('#gridtable').jfGridValue('State'); | |||
if (State.indexOf('1') != -1) { | |||
learun.alert.warning("选中记录中包含已审核项目!"); | |||
learun.alert.warning("选中记录中包含已提交项目!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认审核该项?', function (res) { | |||
learun.layerConfirm('是否确认提交该项?', function (res) { | |||
if (res) { | |||
learun.postForm(top.$.rootUrl + '/PersonnelManagement/TeacherTrain/EnableDisableForm', { keyValue: keyValue, status: "1" }, function () { | |||
refreshGirdData(); | |||
@@ -124,10 +124,10 @@ var bootstrap = function ($, learun) { | |||
var State = $('#gridtable').jfGridValue('State'); | |||
var StateArr = State.split(','); | |||
if ($.inArray('0', StateArr) != -1 || $.inArray('', StateArr) != -1) { | |||
learun.alert.warning("选中记录中包含未审核项目!"); | |||
learun.alert.warning("选中记录中包含提交项目!"); | |||
return; | |||
} | |||
learun.layerConfirm('是否确认取消审核该项?', function (res) { | |||
learun.layerConfirm('是否确认取消提交该项?', function (res) { | |||
if (res) { | |||
learun.postForm(top.$.rootUrl + '/PersonnelManagement/TeacherTrain/EnableDisableForm', { keyValue: keyValue, status: "0"}, function () { | |||
refreshGirdData(); | |||
@@ -162,6 +162,30 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 审核去审 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
/// <param name="status"></param> | |||
public void EnableDisable(string keyValue, int? status) | |||
{ | |||
try | |||
{ | |||
researchResultService.EnableDisable(keyValue, status); | |||
} | |||
catch (Exception ex) | |||
{ | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowBusinessException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
@@ -45,7 +45,12 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||
void SubmitEntity(string keyValue); | |||
void CheckEntity(string keyValue,int? StatusMark); | |||
/// <summary> | |||
/// 审核去审 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
/// <param name="status"></param> | |||
void EnableDisable(string keyValue, int? status); | |||
#endregion | |||
} | |||
@@ -4,6 +4,7 @@ using Learun.Util; | |||
using System; | |||
using System.Collections.Generic; | |||
using System.Data; | |||
using System.Linq; | |||
using System.Text; | |||
namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||
@@ -76,8 +77,16 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||
} | |||
else | |||
{ | |||
strSql.Append(" AND (StatusMark ='1' or StatusMark='2' ) or CreateUser ='" + log.userId + "'"); | |||
if (!queryParam["ProductPerson"].IsEmpty()) | |||
{ | |||
strSql.Append(" AND (StatusMark ='1' or StatusMark='2' )"); | |||
} | |||
else | |||
{ | |||
strSql.Append(" AND (StatusMark ='1' or StatusMark='2' ) or CreateUser ='" + log.userId + "'"); | |||
} | |||
} | |||
} | |||
return this.BaseRepository("CollegeMIS").FindList<ResearchResultEntity>(strSql.ToString(), dp, pagination); | |||
} | |||
@@ -239,6 +248,46 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||
} | |||
} | |||
} | |||
/// <summary> | |||
/// 审核去审 | |||
/// </summary> | |||
/// <param name="keyValue"></param> | |||
/// <param name="status"></param> | |||
public void EnableDisable(string keyValue, int? status) | |||
{ | |||
var db = BaseRepository("CollegeMIS").BeginTrans(); | |||
try | |||
{ | |||
List<string> Ids = keyValue.Split(',').ToList(); | |||
List<ResearchResultEntity> Entity = new List<ResearchResultEntity>(); | |||
foreach (var item in Ids) | |||
{ | |||
var list = db.FindEntity<ResearchResultEntity>(x => x.ID == item); | |||
if (list != null) | |||
{ | |||
list.StatusMark = status; | |||
Entity.Add(list); | |||
} | |||
} | |||
db.Update(Entity); | |||
db.Commit(); | |||
} | |||
catch (Exception ex) | |||
{ | |||
db.Rollback(); | |||
if (ex is ExceptionEx) | |||
{ | |||
throw; | |||
} | |||
else | |||
{ | |||
throw ExceptionEx.ThrowServiceException(ex); | |||
} | |||
} | |||
} | |||
#endregion | |||
} | |||
@@ -65,9 +65,23 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||
strSql.Append(" AND t.TTLevel = @TTLevel "); | |||
} | |||
var user = LoginUserInfo.Get(); | |||
if (!user.isSystem && !user.roleIds.Contains("e945769f-0db0-4ee7-8fc1-d343d4fe473b")) | |||
if (!user.isSystem) | |||
{ | |||
strSql.Append(" AND t.EID = '" + user.userId + "' "); | |||
if (!user.roleIds.Contains("ecfc5e9b-2de2-4bfe-8ff1-f349d7766bef")) | |||
{ | |||
strSql.Append(" AND CreateUser ='" + user.userId + "'"); | |||
} | |||
else | |||
{ | |||
if (!queryParam["ProductPerson"].IsEmpty()) | |||
{ | |||
strSql.Append(" AND (StatusMark ='1' or StatusMark='2' )"); | |||
} | |||
else | |||
{ | |||
strSql.Append(" AND (StatusMark ='1' or StatusMark='2' ) or CreateUser ='" + user.userId + "'"); | |||
} | |||
} | |||
} | |||
return this.BaseRepository().FindList<TeacherTrainEntity>(strSql.ToString(), dp, pagination); | |||
@@ -218,7 +232,7 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||
List<TeacherTrainEntity> Entity = new List<TeacherTrainEntity>(); | |||
foreach (var item in Ids) | |||
{ | |||
var list = this.BaseRepository().FindEntity<TeacherTrainEntity>(x => x.TTID == item); | |||
var list = db.FindEntity<TeacherTrainEntity>(x => x.TTID == item); | |||
if (list != null) | |||
{ | |||
list.State = status; | |||