From 803eb9aaf13f6e3c455613de0227d5572e8e91b0 Mon Sep 17 00:00:00 2001 From: fzp <645608524@qq.com> Date: Thu, 10 Aug 2023 22:40:43 +0800 Subject: [PATCH] =?UTF-8?q?=E6=94=B6=E8=B4=B9=E9=A1=B9=E7=9B=AE=E6=98=8E?= =?UTF-8?q?=E7=BB=86=EF=BC=8C=E4=BD=9C=E5=BA=9F=EF=BC=8C=E6=81=A2=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../FinaChargeStuYearItemController.cs | 9 +- .../Views/FinaChargeStuYearItem/Index.cshtml | 10 +- .../Views/FinaChargeStuYearItem/Index.js | 110 +++++++++++------- .../Views/FinaChargeStudent/Index.js | 2 +- .../FinaChargeStuYearItemBLL.cs | 19 +++ .../FinaChargeStuYearItemIBLL.cs | 3 +- .../FinaChargeStuYearItemService.cs | 48 +++++++- 7 files changed, 149 insertions(+), 52 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FinaChargeStuYearItemController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FinaChargeStuYearItemController.cs index 82972775c..bc3c45880 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FinaChargeStuYearItemController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FinaChargeStuYearItemController.cs @@ -91,7 +91,14 @@ namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers public ActionResult DeleteForm(string keyValue) { finaChargeStuYearItemIBLL.DeleteEntity(keyValue); - return Success("删除成功!"); + return Success("操作成功!"); + } + [HttpPost] + [AjaxOnly] + public ActionResult UnDeleteForm(string keyValue) + { + finaChargeStuYearItemIBLL.UnDeleteEntity(keyValue); + return Success("操作成功!"); } /// /// 保存实体数据(新增、修改) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYearItem/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYearItem/Index.cshtml index 5535550f6..0726063de 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYearItem/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYearItem/Index.cshtml @@ -19,11 +19,11 @@
-
收费项目名称
+
项目名称
-
收费项目编号
+
项目编号
@@ -35,7 +35,7 @@
-
收费项目类型
+
项目类型
@@ -56,8 +56,8 @@
 新增 -  编辑 -  删除 +  恢复 +  作废
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYearItem/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYearItem/Index.js index d26a88866..8bf6da2ad 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYearItem/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStuYearItem/Index.js @@ -10,18 +10,24 @@ var bootstrap = function ($, learun) { "use strict"; var page = { init: function () { - page.initGird(); page.bind(); + setTimeout(function () { + page.initGird(); + }, 500);//延迟 + }, bind: function () { - $('#SYear').lrselect({ + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 300, 400); + $('#FSYear').lrselect({ url: top.$.rootUrl + '/EducationalAdministration/CdMajor/GenerateNearByYear', value: 'value', text: 'text' }); var now = new Date(); sYear = now.getFullYear(); - $('#SYear').lrselectSet(sYear); + $('#FSYear').lrselectSet(sYear); $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' }); $('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' }); $('#PayFeeStatus').lrDataItemSelect({ code: 'PayStatus' }); @@ -43,18 +49,20 @@ var bootstrap = function ($, learun) { } }); }); - // 编辑 - $('#lr_edit').on('click', function () { + // 恢复 + $('#lr_undelete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('FSYIId'); + var ChargeItemType = $('#gridtable').jfGridValue('F_DeleteMark'); if (learun.checkrow(keyValue)) { - learun.layerForm({ - id: 'form', - title: '编辑', - url: top.$.rootUrl + '/ReceiveSendFeeManagement/FinaChargeStuYearItem/Form?keyValue=' + keyValue, - width: 600, - height: 400, - callBack: function (id) { - return top[id].acceptClick(refreshGirdData); + if (ChargeItemType.indexOf('1') != -1) { + learun.alert.error("包含未作废项目,不能恢复"); + return; + } + learun.layerConfirm('是否确认恢复该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/ReceiveSendFeeManagement/FinaChargeStuYearItem/UnDeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); } }); } @@ -62,10 +70,20 @@ var bootstrap = function ($, learun) { // 作废 $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('FSYIId'); + var ChargeItemType = $('#gridtable').jfGridValue('ChargeItemType'); + var PayFeeStatus = $('#gridtable').jfGridValue('PayFeeStatus'); if (learun.checkrow(keyValue)) { + if (ChargeItemType.indexOf('1')!=-1) { + learun.alert.error("包含固定收费项目,不能作废"); + return; + } + if (PayFeeStatus.indexOf('1') != -1 || PayFeeStatus.indexOf('4') != -1) { + learun.alert.error("包含已缴费项目,不能作废"); + return; + } learun.layerConfirm('是否确认作废该项!', function (res) { if (res) { - learun.deleteForm(top.$.rootUrl + '/ReceiveSendFeeManagement/FinaChargeStuYearItem/DeleteForm', { keyValue: keyValue}, function () { + learun.deleteForm(top.$.rootUrl + '/ReceiveSendFeeManagement/FinaChargeStuYearItem/DeleteForm', { keyValue: keyValue }, function () { refreshGirdData(); }); } @@ -107,48 +125,56 @@ var bootstrap = function ($, learun) { } }, { label: "缴费年度", name: "FSYear", width: 100, align: "left" }, - { label: "收费项目编号", name: "ChargeItemCode", width: 100, align: "left"}, - { label: "收费项名称", name: "ChargeItemName", width: 100, align: "left"}, - { label: "收费项目类型", name: "ChargeItemType", width: 100, align: "left", - formatterAsync: function (callback, value, row, op,$cell) { - learun.clientdata.getAsync('dataItem', { - key: value, - code: 'ChargeItemType', - callback: function (_data) { - callback(_data.text); - } - }); - }}, - { label: "收费标准", name: "Standard", width: 100, align: "left"}, + { label: "收费项目编号", name: "ChargeItemCode", width: 100, align: "left" }, + { label: "收费项名称", name: "ChargeItemName", width: 100, align: "left" }, + { + label: "收费项目类型", name: "ChargeItemType", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'ChargeItemType', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { label: "收费标准", name: "Standard", width: 100, align: "left" }, { label: "实缴金额", name: "SJAmount", width: 100, align: "left" }, { label: "应缴余额", name: "FSBlance", width: 100, align: "left" }, - { label: "缴费状态", name: "PayFeeStatus", width: 100, align: "left", - formatterAsync: function (callback, value, row, op,$cell) { - learun.clientdata.getAsync('dataItem', { - key: value, - code: 'PayStatus', - callback: function (_data) { - callback(_data.text); - } - }); + { + label: "缴费状态", name: "PayFeeStatus", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'PayStatus', + callback: function (_data) { + callback(_data.text); + } + }); } }, { label: "是否作废", name: "F_DeleteMark", width: 100, align: "left", - formatter: function (cellvalue, rowObject) { - return cellvalue == "1" ? "" : ""; + formatter: function (cellvalue, row) { + if (cellvalue ===true) { + return '作废'; + } else{ + return '正常'; + } } } ], - mainId:'FSYIId', - isPage: true + mainId: 'FSYIId', + isPage: true, + isMultiselect: true }); page.search(); }, search: function (param) { param = param || {}; - param.SYear = sYear; - $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); + param.FSYear = $('#FSYear').lrselectGet(); + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; refreshGirdData = function () { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStudent/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStudent/Index.js index 87a3a5e72..54f5aaa67 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStudent/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FinaChargeStudent/Index.js @@ -15,7 +15,7 @@ var bootstrap = function ($, learun) { bind: function () { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { page.search(queryJson); - }, 220, 400); + }, 250, 400); $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' }); $('#ClassNo').lrDataSourceSelect({ code: 'bjsj', value: 'classno', text: 'classname' }); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuYearItem/FinaChargeStuYearItemBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuYearItem/FinaChargeStuYearItemBLL.cs index aad977cbe..466da349f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuYearItem/FinaChargeStuYearItemBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuYearItem/FinaChargeStuYearItemBLL.cs @@ -119,6 +119,25 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement } } + public void UnDeleteEntity(string keyValue) + { + try + { + FinaChargeStuYearItemService.UnDeleteEntity(keyValue); + } + 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/ReceiveSendFeeManagement/FinaChargeStuYearItem/FinaChargeStuYearItemIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuYearItem/FinaChargeStuYearItemIBLL.cs index 0193dd83c..f806f4990 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuYearItem/FinaChargeStuYearItemIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuYearItem/FinaChargeStuYearItemIBLL.cs @@ -43,6 +43,7 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement /// 实体 void SaveEntity(string keyValue, FinaChargeStuYearItemEntity entity); #endregion - + + void UnDeleteEntity(string keyValue); } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuYearItem/FinaChargeStuYearItemService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuYearItem/FinaChargeStuYearItemService.cs index b3b130db9..40dd7c690 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuYearItem/FinaChargeStuYearItemService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/ReceiveSendFeeManagement/FinaChargeStuYearItem/FinaChargeStuYearItemService.cs @@ -115,17 +115,61 @@ namespace Learun.Application.TwoDevelopment.ReceiveSendFeeManagement #region 提交数据 /// - /// 删除实体数据 + /// 作废 /// /// 主键 public void DeleteEntity(string keyValue) { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); try { - this.BaseRepository("CollegeMIS").Delete(t=>t.FSYIId == keyValue); + //单个启用 + //this.BaseRepository("CollegeMIS").ExecuteBySql("update ClassInfo set CheckMark=1 where ClassId='" + keyValue + "'"); + + //多个启用 + var keyValueArr = keyValue.Split(','); + foreach (var item in keyValueArr) + { + db.ExecuteBySql("update FinaChargeStuYearItem set F_DeleteMark=1 where FSYIId='" + item + "'"); + } + db.Commit(); + } + catch (Exception ex) + { + db.Rollback(); + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + /// + /// 恢复 + /// + /// + public void UnDeleteEntity(string keyValue) + { + var db = this.BaseRepository("CollegeMIS").BeginTrans(); + try + { + //单个启用 + //this.BaseRepository("CollegeMIS").ExecuteBySql("update ClassInfo set CheckMark=1 where ClassId='" + keyValue + "'"); + + //多个启用 + var keyValueArr = keyValue.Split(','); + foreach (var item in keyValueArr) + { + db.ExecuteBySql("update FinaChargeStuYearItem set F_DeleteMark=0 where FSYIId='" + item + "'"); + } + db.Commit(); } catch (Exception ex) { + db.Rollback(); if (ex is ExceptionEx) { throw;