diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/Gz_AmountsController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/Gz_AmountsController.cs index 3d143780a..f13655841 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/Gz_AmountsController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Controllers/Gz_AmountsController.cs @@ -1,6 +1,7 @@ using Learun.Application.Base.SystemModule; using Learun.Application.TwoDevelopment.PersonnelManagement; using Learun.Util; +using System; using System.Collections.Generic; using System.Data; using System.Linq; @@ -152,7 +153,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers [HttpGet] [AjaxOnly] - public ActionResult GetDetail(string userNo,int year,int month) + public ActionResult GetDetail(string userNo, int year, int month) { var data = gz_AmountsIBLL.GetAmountsDetail(userNo, year, month, 0); return Success(data); @@ -166,11 +167,11 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers /// /// 主键 /// - [HttpPost] + [HttpGet] [AjaxOnly] - public ActionResult DeleteForm(string keyValue) + public ActionResult DeleteForm(string userNo, string year, string month) { - gz_AmountsIBLL.DeleteEntity(keyValue); + gz_AmountsIBLL.DeleteEntity(userNo, Convert.ToInt32(year), Convert.ToInt32(month)); return Success("删除成功!"); } /// @@ -216,7 +217,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers var items = gz_ItemsIBLL.SyncColumn(useCol); - var res = gz_AmountsIBLL.ExecuteImportExcel(dt,ignoreCol,useCol,items, fileGuid); + var res = gz_AmountsIBLL.ExecuteImportExcel(dt, ignoreCol, useCol, items, fileGuid); var data = new { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Gz_Amounts/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Gz_Amounts/Index.cshtml index e7fdab1c7..7fdba00a1 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Gz_Amounts/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Gz_Amounts/Index.cshtml @@ -39,8 +39,8 @@ 查看 + 删除 导入 - @*删除*@
@@ -241,17 +241,21 @@ }, // 删除 del() { - let ids = this.multipleSelection.map(e => e.id).toString() - if (!ids) { - this.$message.warning('请选择需要删除的数据!') + if (this.multipleSelection.length != 1) { + this.$message.warning('请选择一条数据进行删除!') return } + //let ids = this.multipleSelection.map(e => e.id).toString() + //if (!ids) { + // this.$message.warning('请选择需要删除的数据!') + // return + //} this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { confirmButtonText: '确定', cancelButtonText: '取消', type: 'warning' }).then(async () => { - let res = await this.NetRequest('/PersonnelManagement/Gz_Amounts/DeleteForm', { keyValue: ids }) + let res = await this.NetRequest('/PersonnelManagement/Gz_Amounts/DeleteForm', $.param({ userNo: this.multipleSelection[0].UserNo, year: this.multipleSelection[0].Year, month: this.multipleSelection[0].Month }), 'get') if (res) { this.$message.success('删除成功!') } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Gz_Items/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Gz_Items/Index.cshtml index 0fd1374dc..2c7d55957 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Gz_Items/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/PersonnelManagement/Views/Gz_Items/Index.cshtml @@ -26,9 +26,9 @@
-  新增 + @* 新增*@  编辑 -  删除 + @* 删除*@  展示/取消
diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsBLL.cs index c39e3bd0f..213287d7f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsBLL.cs @@ -228,6 +228,25 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } } + + public void DeleteEntity(string userNo, int year, int month) + { + try + { + gz_AmountsService.DeleteEntity(userNo, year, month); + } + 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/PersonnelManagement/Gz_Amounts/Gz_AmountsIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsIBLL.cs index 1bd82c9e6..29eb8b1da 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsIBLL.cs @@ -45,6 +45,8 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement ///
/// 主键 void DeleteEntity(string keyValue); + + void DeleteEntity(string userNo, int year, int month); /// /// 保存实体数据(新增、修改) /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsService.cs index be5158694..a36875779 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/PersonnelManagement/Gz_Amounts/Gz_AmountsService.cs @@ -160,7 +160,24 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement } } } - + public void DeleteEntity(string userNo, int year, int month) + { + try + { + this.BaseRepository("CollegeMIS").Delete(t => t.UserNo == userNo && t.Year == year && t.Month == month); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } /// /// 保存实体数据(新增、修改) /// 主键