diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/SafetyCheckController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/SafetyCheckController.cs index 504ed0eb7..3eb7a8efe 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/SafetyCheckController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/SafetyCheckController.cs @@ -160,20 +160,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult DepartmentForm(string keyValue, string strEntity) { SafetyCheckEntity entity = strEntity.ToObject(); - if (entity.Status == 1) - { - entity.Status = 2; - } - else if (entity.Status == 2) - { - entity.Status = 3; - } - else - { - entity.Status = 0; - } - safetyCheckIBLL.SaveEntity(keyValue, entity); + safetyCheckIBLL.CheckEntity(keyValue, entity); return Success("操作成功!"); } + } } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SafetyCheck/FormCheck.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SafetyCheck/FormCheck.cshtml index f2d0b693d..d5201cf14 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SafetyCheck/FormCheck.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SafetyCheck/FormCheck.cshtml @@ -3,38 +3,40 @@ Layout = "~/Views/Shared/_Form.cshtml"; }
-
-
网络格员
- -
-
-
处室部门
- -
-
-
责任区域*
- -
-
-
排查时间*
- -
-
-
发现的隐患*
- -
-
-
整改措施及建议
- -
-
-
附件上传
-
-
-
-
备注
- -
+ @*
+
+
网络格员
+ +
+
+
处室部门
+ +
+
+
责任区域*
+ +
+
+
排查时间*
+ +
+
+
发现的隐患*
+ +
+
+
整改措施及建议
+ +
+
+
附件上传
+
+
+
+
备注
+ +
+
*@
继续上报*
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SafetyCheck/FormCheck.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SafetyCheck/FormCheck.js index 678c34ed9..7a6c4c389 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SafetyCheck/FormCheck.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SafetyCheck/FormCheck.js @@ -15,16 +15,16 @@ var bootstrap = function ($, learun) { page.initData(); }, bind: function () { - $('#Name')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; - $('#Name').val(learun.clientdata.get(['userinfo']).realName); - $('#Department')[0].lrvalue = learun.clientdata.get(['userinfo']).departmentId; - learun.clientdata.getAsync('department', { - key: learun.clientdata.get(['userinfo']).departmentId, - callback: function (_data) { - $('#名称').val(_data.name); - } - }); - $('#Path').lrUploader({ isUpload: false }); + //$('#Name')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; + //$('#Name').val(learun.clientdata.get(['userinfo']).realName); + //$('#Department')[0].lrvalue = learun.clientdata.get(['userinfo']).departmentId; + //learun.clientdata.getAsync('department', { + // key: learun.clientdata.get(['userinfo']).departmentId, + // callback: function (_data) { + // $('#名称').val(_data.name); + // } + //}); + //$('#Path').lrUploader({ isUpload: false }); $("#Status").lrselect({ data: [{ text: "继续上报", value: "1" }, { text: "退回", value: "0" }], text: "text", @@ -32,18 +32,18 @@ var bootstrap = function ($, learun) { }) }, initData: function () { - if (!!keyValue) { - $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/SafetyCheck/GetFormData?keyValue=' + keyValue, function (data) { - for (var id in data) { - if (!!data[id].length && data[id].length > 0) { - $('#' + id ).jfGridSet('refreshdata', data[id]); - } - else { - $('[data-table="' + id + '"]').lrSetFormData(data[id]); - } - } - }); - } + //if (!!keyValue) { + // $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/SafetyCheck/GetFormData?keyValue=' + keyValue, function (data) { + // for (var id in data) { + // if (!!data[id].length && data[id].length > 0) { + // $('#' + id ).jfGridSet('refreshdata', data[id]); + // } + // else { + // $('[data-table="' + id + '"]').lrSetFormData(data[id]); + // } + // } + // }); + //} } }; // 保存数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SafetyCheck/FormLeader.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SafetyCheck/FormLeader.cshtml index e5ef6c54a..e490150e5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SafetyCheck/FormLeader.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SafetyCheck/FormLeader.cshtml @@ -3,7 +3,7 @@ Layout = "~/Views/Shared/_Form.cshtml"; }
-
+ @*
网络格员
@@ -34,7 +34,7 @@
备注
-
+
*@
审验提醒
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SafetyCheck/FormLeader.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SafetyCheck/FormLeader.js index 276137594..24cfeec96 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SafetyCheck/FormLeader.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SafetyCheck/FormLeader.js @@ -15,16 +15,16 @@ var bootstrap = function ($, learun) { page.initData(); }, bind: function () { - $('#Name')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; - $('#Name').val(learun.clientdata.get(['userinfo']).realName); - $('#Department')[0].lrvalue = learun.clientdata.get(['userinfo']).departmentId; - learun.clientdata.getAsync('department', { - key: learun.clientdata.get(['userinfo']).departmentId, - callback: function (_data) { - $('#名称').val(_data.name); - } - }); - $('#Path').lrUploader({ isUpload: false }); + //$('#Name')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; + //$('#Name').val(learun.clientdata.get(['userinfo']).realName); + //$('#Department')[0].lrvalue = learun.clientdata.get(['userinfo']).departmentId; + //learun.clientdata.getAsync('department', { + // key: learun.clientdata.get(['userinfo']).departmentId, + // callback: function (_data) { + // $('#名称').val(_data.name); + // } + //}); + //$('#Path').lrUploader({ isUpload: false }); $("#Status").lrselect({ data: [{ text: "继续上报", value: "2" }, { text: "退回", value: "0" }], text: "text", @@ -32,18 +32,18 @@ var bootstrap = function ($, learun) { }) }, initData: function () { - if (!!keyValue) { - $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/SafetyCheck/GetFormData?keyValue=' + keyValue, function (data) { - for (var id in data) { - if (!!data[id].length && data[id].length > 0) { - $('#' + id ).jfGridSet('refreshdata', data[id]); - } - else { - $('[data-table="' + id + '"]').lrSetFormData(data[id]); - } - } - }); - } + //if (!!keyValue) { + // $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/SafetyCheck/GetFormData?keyValue=' + keyValue, function (data) { + // for (var id in data) { + // if (!!data[id].length && data[id].length > 0) { + // $('#' + id ).jfGridSet('refreshdata', data[id]); + // } + // else { + // $('[data-table="' + id + '"]').lrSetFormData(data[id]); + // } + // } + // }); + //} } }; // 保存数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SafetyCheck/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SafetyCheck/Index.js index a01cb2f2f..3c17819bc 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SafetyCheck/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/SafetyCheck/Index.js @@ -66,19 +66,23 @@ var bootstrap = function ($, learun) { }); // 编辑 $('#lr_edit').on('click', function () { - var CreateUser = $('#gridtable').jfGridValue('CreateUser'); - var user = learun.clientdata.get(['userinfo']).userId; - if (CreateUser != user) { - learun.alert.warning("当前项暂不可编辑!"); - return; - } - var Status = $('#gridtable').jfGridValue('Status'); - if (Status != 0) { - learun.alert.warning("当前项目已提交不能不能编辑!"); - return; - } var keyValue = $('#gridtable').jfGridValue('ID'); if (learun.checkrow(keyValue)) { + if (keyValue.indexOf(',') != -1) { + learun.alert.warning("只能选择一条记录进行编辑!"); + return; + } + var CreateUser = $('#gridtable').jfGridValue('CreateUser'); + var user = learun.clientdata.get(['userinfo']).userId; + if (CreateUser != user) { + learun.alert.warning("当前项暂不可编辑!"); + return; + } + var Status = $('#gridtable').jfGridValue('Status'); + if (Status != 0) { + learun.alert.warning("当前项目已提交!不能编辑!"); + return; + } learun.layerForm({ id: 'form', title: '编辑', @@ -93,20 +97,21 @@ var bootstrap = function ($, learun) { }); // 删除 $('#lr_delete').on('click', function () { - var CreateUser = $('#gridtable').jfGridValue('CreateUser'); - var user = learun.clientdata.get(['userinfo']).userId; - if (CreateUser != user) { - learun.alert.warning("当前项暂不可删除!"); - return; - } - var Status = $('#gridtable').jfGridValue('Status'); - if (Status != 0) { - learun.alert.warning("当前项目已提交不能不能删除!"); - return; - } var keyValue = $('#gridtable').jfGridValue('ID'); if (learun.checkrow(keyValue)) { - + var CheckMark = $('#gridtable').jfGridValue('Status'); + var CheckMarkArr = CheckMark.split(','); + if ($.inArray('1', CheckMarkArr) != -1 || $.inArray('2', CheckMarkArr) != -1 || $.inArray('3', CheckMarkArr) != -1) { + learun.alert.warning("选中记录中包含已提交项目!不可删除"); + return; + } + var CreateUser = $('#gridtable').jfGridValue('CreateUser'); + var user = learun.clientdata.get(['userinfo']).userId; + var CreateUserArr = CreateUser.split(','); + if (!CreateUserArr.every(item => item == user)) { + learun.alert.warning("选中项包含其他所属用户!暂不可删除!"); + return; + } learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/SafetyCheck/DeleteForm', { keyValue: keyValue }, function () { @@ -122,16 +127,21 @@ var bootstrap = function ($, learun) { }); //  提交 $('#lr_submit').on('click', function () { - var CreateUser = $('#gridtable').jfGridValue('CreateUser'); - var user = learun.clientdata.get(['userinfo']).userId; - if (CreateUser != user) { - learun.alert.warning("当前项暂不可提交!"); - return; - } var keyValue = $('#gridtable').jfGridValue('ID'); if (learun.checkrow(keyValue)) { + if (keyValue.indexOf(',') != -1) { + learun.alert.warning("只能选择一条记录!"); + return; + } + var CreateUser = $('#gridtable').jfGridValue('CreateUser'); + var user = learun.clientdata.get(['userinfo']).userId; + if (CreateUser != user) { + learun.alert.warning("当前项暂不可提交!"); + return; + } var Status = $('#gridtable').jfGridValue('Status'); - if (Status !== 0) { + console.log(Status) + if (Status != 0) { learun.alert.warning("当前项目已提交,请耐心等待审批!"); return; } @@ -147,6 +157,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: 'formSafetyCheck', @@ -162,12 +176,9 @@ var bootstrap = function ($, learun) { $('#lr_department').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); var Status = $('#gridtable').jfGridValue('Status'); - if (Status != 1) { - learun.alert.warning("当前项目操作项不允许!"); - return; - } - if (Status == 2) { - learun.alert.warning("当前项目操作项不允许!"); + var CheckMarkArr = Status.split(','); + if (!CheckMarkArr.every(item => item == 1)) { + learun.alert.warning("选中项当前操作不允许!"); return; } if (learun.checkrow(keyValue)) { @@ -175,8 +186,8 @@ var bootstrap = function ($, learun) { id: 'formformcheck', title: '部门审查', url: top.$.rootUrl + '/EducationalAdministration/SafetyCheck/FormCheck?keyValue=' + keyValue, - width: 600, - height: 680, + width: 400, + height: 300, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } @@ -186,12 +197,9 @@ var bootstrap = function ($, learun) { // 分管领导 $('#lr_leader').on('click', function () { var Status = $('#gridtable').jfGridValue('Status'); - if (Status != 2) { - learun.alert.warning("当前项目操作项不允许!"); - return; - } - if (Status == 3) { - learun.alert.warning("当前项目操作项不允许!"); + var CheckMarkArr = Status.split(','); + if (!CheckMarkArr.every(item => item == 2)) { + learun.alert.warning("选中项当前操作不允许!"); return; } var keyValue = $('#gridtable').jfGridValue('ID'); @@ -200,8 +208,8 @@ var bootstrap = function ($, learun) { id: 'formformleader', title: '分管领导', url: top.$.rootUrl + '/EducationalAdministration/SafetyCheck/FormLeader?keyValue=' + keyValue, - width: 600, - height: 680, + width: 400, + height: 300, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } @@ -260,6 +268,7 @@ var bootstrap = function ($, learun) { ], mainId: 'ID', isPage: true, + isMultiselect: true, sidx: 'CheckTime desc ', }); page.search(); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/SafetyCheck/SafetyCheckBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/SafetyCheck/SafetyCheckBLL.cs index c3e8017d6..8119b1df0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/SafetyCheck/SafetyCheckBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/SafetyCheck/SafetyCheckBLL.cs @@ -138,6 +138,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + public void CheckEntity(string keyValue, SafetyCheckEntity entity) + { + try + { + safetyCheckService.CheckEntity(keyValue, entity); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/SafetyCheck/SafetyCheckIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/SafetyCheck/SafetyCheckIBLL.cs index 7eca54f41..28a02388b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/SafetyCheck/SafetyCheckIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/SafetyCheck/SafetyCheckIBLL.cs @@ -47,6 +47,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// /// void SubmitEnity(string keyValue); + + void CheckEntity(string keyValue, SafetyCheckEntity entity); #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/SafetyCheck/SafetyCheckService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/SafetyCheck/SafetyCheckService.cs index 1f108ff27..991c7331b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/SafetyCheck/SafetyCheckService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/SafetyCheck/SafetyCheckService.cs @@ -158,12 +158,19 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 主键 public void DeleteEntity(string keyValue) { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); try { - this.BaseRepository("CollegeMIS").Delete(t => t.ID == keyValue); + var id = keyValue.Split(','); + foreach (var item in id) + { + db.Delete(item); + } + db.Commit(); } catch (Exception ex) { + db.Rollback(); if (ex is ExceptionEx) { throw; @@ -184,9 +191,14 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { + if (!string.IsNullOrEmpty(keyValue)) { - entity.Modify(keyValue); + var id = keyValue.Split(','); + foreach (var item in id) + { + entity.Modify(item); + } this.BaseRepository("CollegeMIS").Update(entity); } else @@ -214,19 +226,61 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// public void SubmitEnity(string keyValue) { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); try { - var entity = BaseRepository("CollegeMIS").FindEntity(keyValue); - if (entity.Status != null) + var id = keyValue.Split(','); + foreach (var item in id) { + var entity = db.FindEntity(item); entity.Status = 1; entity.ModifyUser = LoginUserInfo.Get().userId; entity.Modifytime = DateTime.Now; + db.Update(entity); + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + public void CheckEntity(string keyValue, SafetyCheckEntity entity) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + if (entity.Status == 1) + { + entity.Status = 2; + } + else if (entity.Status == 2) + { + entity.Status = 3; + } + var id = keyValue.Split(','); + foreach (var item in id) + { + var Newentity = db.FindEntity(item); + Newentity.Status = entity.Status; + Newentity.DepartmentRemark = entity.DepartmentRemark; + Newentity.ModifyUser = LoginUserInfo.Get().userId; + Newentity.Modifytime = DateTime.Now; + db.Update(Newentity); } - BaseRepository("CollegeMIS").Update(entity); + db.Commit(); } catch (Exception ex) { + db.Rollback(); if (ex is ExceptionEx) { throw;