From b7ac738ec3a15b9d1ed13d4e5230d478603ce4db Mon Sep 17 00:00:00 2001 From: liangkun Date: Mon, 15 May 2023 09:18:56 +0800 Subject: [PATCH] =?UTF-8?q?=E8=AF=B7=E5=81=87=E5=A2=9E=E5=8A=A0=E6=89=B9?= =?UTF-8?q?=E9=87=8F=E5=AE=A1=E6=A0=B8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../StuLeaveManagementController.cs | 19 +++++++ .../Views/StuLeaveManagement/CheckIndex.js | 50 +++++++++++++------ 2 files changed, 54 insertions(+), 15 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuLeaveManagementController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuLeaveManagementController.cs index 222db3064..8c4377a69 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuLeaveManagementController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/StuLeaveManagementController.cs @@ -170,6 +170,25 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers stuLeaveManagementIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); } + + [HttpPost] + [AjaxOnly] + public ActionResult SaveCheckFormMultiple(string keyValue) + { + var loginInfo = LoginUserInfo.Get(); + foreach (var k in keyValue.Split(',')) + { + if (!string.IsNullOrEmpty(k)) + { + StuLeaveManagementEntity entity = stuLeaveManagementIBLL.GetStuLeaveManagementEntity(k); + entity.CheckUserId = loginInfo.userId; + entity.CheckUserNo = loginInfo.account; + entity.CheckTime = DateTime.Now; + stuLeaveManagementIBLL.SaveEntity(keyValue, entity); + } + } + return Success("操作成功!"); + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/CheckIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/CheckIndex.js index a54c5bb23..cb9903441 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/CheckIndex.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/StuLeaveManagement/CheckIndex.js @@ -25,23 +25,42 @@ var bootstrap = function ($, learun) { // 审核 $('#lr_check').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); + var day = $('#gridtable').jfGridValue('LeaveDay'); if (learun.checkrow(keyValue)) { - //判断是否可以审核:请假天数大于2天且登录用户不是系主任,提示无法审核; - var day = $('#gridtable').jfGridValue('LeaveDay'); - if (day > 2 && IsDeptDirector.toLowerCase() == "false") { - learun.alert.warning("该请假申请大于2天,需要由系主任审核!"); - return false; - } - learun.layerForm({ - id: 'checkform', - title: '审核', - url: top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/CheckForm?keyValue=' + keyValue, - width: 800, - height: 600, - callBack: function (id) { - return top[id].acceptClick(refreshGirdData); + var hastwo = false; + $(day.split(',')).each(function (e, i) { + //判断是否可以审核:请假天数大于2天且登录用户不是系主任,提示无法审核; + if (i > 2 && IsDeptDirector.toLowerCase() == "false") { + + hastwo = true; } }); + if (!hastwo) { + learun.layerConfirm('是否确认审核!', + function(res) { + if (res) { + learun.postForm( + top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/SaveCheckFormMultiple', + { keyValue: keyValue }, + function() { + refreshGirdData(); + }); + } + }); + } else { + learun.alert.warning("请假申请包含大于2天的记录,需要由系主任审核!"); + return false; + } + //learun.layerForm({ + // id: 'checkform', + // title: '审核', + // url: top.$.rootUrl + '/EducationalAdministration/StuLeaveManagement/CheckForm?keyValue=' + keyValue, + // width: 800, + // height: 600, + // callBack: function (id) { + // return top[id].acceptClick(refreshGirdData); + // } + //}); } }); }, @@ -166,7 +185,8 @@ var bootstrap = function ($, learun) { ], mainId: 'Id', isPage: true, - sord: 'CreateTime desc' + sord: 'CreateTime desc', + isMultiselect: true, }); page.search(); },