From e580c3312b7307fdca8334be01f218eceaa8c7ad Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Tue, 7 Sep 2021 17:41:53 +0800 Subject: [PATCH] =?UTF-8?q?=E8=B4=A8=E9=87=8F=E7=9B=AE=E6=A0=87=E7=AE=A1?= =?UTF-8?q?=E7=90=86=E5=8A=A0=E6=89=B9=E9=87=8F=E6=93=8D=E4=BD=9C?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/FillinFromController.cs | 42 ++++----- .../Views/FillinFrom/FormIndex.js | 1 + .../Views/FillinFrom/Index.cshtml | 6 +- .../Views/FillinFrom/Index.js | 86 +++++++++++-------- .../Views/QualityReport/IndexReport.cshtml | 20 ++++- .../Views/QualityReport/IndexReport.js | 17 +++- .../FillinFrom/FillinFromBLL.cs | 18 ++++ .../FillinFrom/FillinFromIBLL.cs | 2 + .../FillinFrom/FillinFromService.cs | 35 ++++++++ .../QualityReportMainService.cs | 16 ++++ 10 files changed, 183 insertions(+), 60 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FillinFromController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FillinFromController.cs index f56feaac5..c9ed1c26d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FillinFromController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FillinFromController.cs @@ -138,13 +138,13 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [AjaxOnly] public ActionResult DeleteForm(string keyValue) { - var Model = fillinFromIBLL.GetFillInNo(keyValue); - if (Model != null) + var Models = fillinFromIBLL.GetListByIds(keyValue); + foreach (var Model in Models) { Model.State = -1; - qualityReportMainIBLL.DelProjectByFId(keyValue); + qualityReportMainIBLL.DelProjectByFId(Model.Id); + fillinFromIBLL.SaveEntity(Model.Id, Model); } - fillinFromIBLL.SaveEntity(keyValue, Model); return Success("作废成功!"); } @@ -203,13 +203,12 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [AjaxOnly] public ActionResult Submit(string keyValue) { - var Model = fillinFromIBLL.GetFillInNo(keyValue); - if (Model != null) + var Models = fillinFromIBLL.GetListByIds(keyValue); + foreach (var Model in Models) { - //重新填写 Model.State = 1; + fillinFromIBLL.SaveEntity(Model.Id, Model); } - fillinFromIBLL.SaveEntity(keyValue, Model); return Success("保存成功!"); } @@ -222,8 +221,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [AjaxOnly] public ActionResult HideList(string keyValue) { - var Model = fillinFromIBLL.GetFillInNo(keyValue); - if (Model != null) + var Models = fillinFromIBLL.GetListByIds(keyValue); + foreach (var Model in Models) { if (Model.IsFlag == 0) { @@ -233,8 +232,8 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { Model.IsFlag = 0; } + fillinFromIBLL.SaveEntity(Model.Id, Model); } - fillinFromIBLL.SaveEntity(keyValue, Model); return Success("保存成功!"); } @@ -247,15 +246,16 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [AjaxOnly] public ActionResult DoCanCel(string keyValue) { - var Model = fillinFromIBLL.GetFillInNo(keyValue); - if (Model != null) + var Models = fillinFromIBLL.GetListByIds(keyValue); + foreach (var Model in Models) { //重新填写 Model.State = 0; Model.FillingPeople = ""; + qualityReportMainIBLL.EditProjectByFId(Model.Id); + fillinFromIBLL.SaveEntity(Model.Id, Model); } - qualityReportMainIBLL.EditProjectByFId(keyValue); - fillinFromIBLL.SaveEntity(keyValue, Model); + return Success("保存成功!"); } @@ -266,10 +266,10 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers /// public ActionResult IsFile(string keyValue) { - var Model = fillinFromIBLL.GetFillInNo(keyValue); - if (Model != null) + var Models = fillinFromIBLL.GetListByIds(keyValue); + foreach (var Model in Models) { - var ModeList = qualityReportMainIBLL.IsFinish(keyValue); + var ModeList = qualityReportMainIBLL.IsFinish(Model.Id); if (ModeList != null) { if (ModeList.Status == 1) @@ -278,15 +278,15 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers } else { - return Success("归档失败!"); + return Success("选中项未上报,归档失败!"); } } else { - return Success("归档失败!"); + return Success("选中项未上报,归档失败!"); } + fillinFromIBLL.SaveEntity(Model.Id, Model); } - fillinFromIBLL.SaveEntity(keyValue, Model); return Success("归档成功!"); } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormIndex.js index 513d89b4c..4d2f7aa7d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormIndex.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormIndex.js @@ -218,6 +218,7 @@ var bootstrap = function ($, learun) { param.IsFlag = 0; param.isSystem = isSystem; param.departmentId = departmentId; + param.SqlParameter = ' and t.State=1'; $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.cshtml index 9d4cd2414..8e6fc49a7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.cshtml @@ -21,6 +21,10 @@
项目名称
+
+
填报部门
+
+
填报周期
@@ -44,7 +48,7 @@
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.js index fec50d28e..27e079008 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.js @@ -17,7 +17,7 @@ var bootstrap = function ($, learun) { page.search(queryJson); }, 220, 400); $('#FillingCycle').lrDataItemSelect({ code: 'ThisCycle' }); - //$('#FillingPeople').lrDataSourceSelect({ code: 'teacheruserdata', value: 'f_userid', text: 'f_realname' }); + $('#FillingDept').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name', maxHeight: '150px' }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); @@ -35,39 +35,17 @@ var bootstrap = function ($, learun) { } }); }); - // 提交 - $('#lr_submit').on('click', function () { - var keyValue = $('#gridtable').jfGridValue('Id'); - if (learun.checkrow(keyValue)) { - var State = $('#gridtable').jfGridValue('State'); - var IsFlag = $('#gridtable').jfGridValue('IsFlag'); - if (State >= 1) { - learun.alert.warning("当前项已提交,请勿重复提交!"); - return false; - } else if (State == -1) { - learun.alert.warning("当前项已作废,不能提交!"); - return false; - } - if (IsFlag == 1) { - learun.alert.warning("当前项已隐藏,不能提交!"); - return false; - } - } - learun.layerConfirm('是否确认提交该项!', function (res) { - if (res) { - learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/Submit', { keyValue: keyValue }, function () { - refreshGirdData(); - }); - } - }); - }); // 编辑 $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { + if (keyValue.indexOf(",") != -1) { + learun.alert.warning("只能选择一条记录进行操作!"); + return false; + } var State = $('#gridtable').jfGridValue('State'); if (State !== 0) { - learun.alert.warning("当前项不能修改!"); + learun.alert.warning("只有草稿状态可以修改!"); return; } learun.layerConfirm('是否确认修改该项,修改成后会影响数据!', function (res) { @@ -90,13 +68,42 @@ var bootstrap = function ($, learun) { }) } }); + + // 提交 + $('#lr_submit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var States = $('#gridtable').jfGridValue('State'); + var IsFlags = $('#gridtable').jfGridValue('IsFlag'); + + if (States.indexOf('1') != -1) { + learun.alert.warning("选中记录中包含已提交项目,不可重复提交!"); + return false; + } else if (States.indexOf('-1') != -1) { + learun.alert.warning("选中记录中包含已作废项目,不能提交!"); + return false; + } + if (IsFlags.indexOf('1') != -1) { + learun.alert.warning("选中记录中包含已隐藏项目,不能提交!"); + return false; + } + + learun.layerConfirm('是否确认提交该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/Submit', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); //作废 $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { - var State = $('#gridtable').jfGridValue('State'); - if (State == -1) { - learun.alert.warning("当前项已作废,请勿重复操作 !"); + var States = $('#gridtable').jfGridValue('State'); + if (States.indexOf('-1') != -1) { + learun.alert.warning("选中记录包含已作废项目,请勿重复操作 !"); return false; } learun.layerConfirm('是否确认作废该项,此操作将改变数据!', function (res) { @@ -112,8 +119,8 @@ var bootstrap = function ($, learun) { $('#lr_cancel').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { - var State = $('#gridtable').jfGridValue('State'); - if (State <= 0) { + var States = $('#gridtable').jfGridValue('State'); + if (States.indexOf('-1') != -1) { learun.alert.warning("当前项已撤回或作废,请勿重复操作!"); return; } @@ -152,6 +159,10 @@ var bootstrap = function ($, learun) { $('#lr_hide').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { + if (keyValue.indexOf(",") != -1) { + learun.alert.warning("只能选择一条记录进行操作!"); + return false; + } learun.layerConfirm('是否确认隐藏/显示该项!', function (res) { if (res) { learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/HideList', { keyValue: keyValue }, function () { @@ -165,8 +176,12 @@ var bootstrap = function ($, learun) { $('#lr_file').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { + if (keyValue.indexOf(",") != -1) { + learun.alert.warning("只能选择一条记录进行操作!"); + return false; + } var Status = $('#gridtable').jfGridValue('State'); - if (Status !== 2) { + if (Status != 2) { learun.alert.warning("当前项未执行到此处,暂不能归档!"); return false; } @@ -299,7 +314,8 @@ var bootstrap = function ($, learun) { }, ], mainId: 'Id', - isPage: true + isPage: true, + isMultiselect: true }); page.search(); }, diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/IndexReport.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/IndexReport.cshtml index 2f885f811..935da7276 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/IndexReport.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/IndexReport.cshtml @@ -28,8 +28,24 @@
-
名称
- +
工作模块
+ +
+
+
项目名称
+ +
+
+
填报部门
+
+
+
+
填报年份
+
+
+
+
填报月份
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/IndexReport.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/IndexReport.js index 1a79697fc..7bae1c11e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/IndexReport.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LR_Desktop/Views/QualityReport/IndexReport.js @@ -17,7 +17,22 @@ var bootstrap = function ($, learun) { bind: function () { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); - }, 220, 400); + }, 250, 400); + + //年份 + $('#ReportYear').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/PersonnelManagement/MP_ManagementPlan/GetAcademicYear', + value: 'value', + text: 'text' + }); + //月份 + $('#ReportMouth').lrDataItemSelect({ + code: 'CycleTime' + }); + + $('#FillingDept').lrDataSourceSelect({ code: 'classdata', value: 'id', text: 'name', maxHeight: '150px' }); + // 刷新 $('#lr_refresh').on('click', function () { location.reload(); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromBLL.cs index 21ab5aacf..d3e14d5c6 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromBLL.cs @@ -43,6 +43,24 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + public IEnumerable GetListByIds(string keyValue) + { + try + { + return fillinFromService.GetListByIds(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } /// /// 获取页面显示列表数据--数据上报用 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromIBLL.cs index 77e498333..4f413e0db 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromIBLL.cs @@ -21,6 +21,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 查询参数 /// IEnumerable GetPageList(Pagination pagination, string queryJson); + + IEnumerable GetListByIds(string keyValue); /// /// 获取页面显示列表数据--数据上报用 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromService.cs index ab36f8ac2..607bfe2c3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromService.cs @@ -73,6 +73,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration dp.Add("FillingPeople", queryParam["FillingPeople"].ToString(), DbType.String); strSql.Append(" AND t.FillingPeople = @FillingPeople "); } + if (!queryParam["FillingDept"].IsEmpty()) + { + dp.Add("FillingDept", queryParam["FillingDept"].ToString(), DbType.String); + strSql.Append(" AND t.FillingDept = @FillingDept "); + } + if (!queryParam["IsFlag"].IsEmpty()) { dp.Add("IsFlag", queryParam["IsFlag"].ToString(), DbType.String); @@ -103,6 +109,35 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + /// + /// 根据Id获取数据 + /// + /// + /// + public IEnumerable GetListByIds(string keyValue) + { + try + { + if (keyValue.Contains(",")) + { + keyValue = string.Join("','",keyValue.Split(',')); + } + + string sql = $" select * from FillinFrom where Id in ('{keyValue}')"; + return this.BaseRepository("CollegeMIS").FindList(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } /// /// 获取页面显示列表数据--数据上报用 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainService.cs index 718023e1b..ebd0da5b8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/LR_Desktop/QualityReportMain/QualityReportMainService.cs @@ -50,6 +50,22 @@ namespace Learun.Application.TwoDevelopment.LR_Desktop { strSql.Append($" AND b.FillingDept='{queryParam["FillingDept"].ToString()}' "); } + if (!queryParam["WorderModule"].IsEmpty()) + { + strSql.Append($" AND b.WorderModule like '%{queryParam["WorderModule"].ToString()}%' "); + } + if (!queryParam["ProjectName"].IsEmpty()) + { + strSql.Append($" AND b.ProjectName like '%{queryParam["ProjectName"].ToString()}%' "); + } + if (!queryParam["ReportYear"].IsEmpty()) + { + strSql.Append($" AND Year(a.ReportTime)='{queryParam["ReportYear"].ToString()}' "); + } + if (!queryParam["ReportMouth"].IsEmpty()) + { + strSql.Append($" AND month(a.ReportTime)='{queryParam["ReportMouth"].ToString()}' "); + } return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); }