@@ -1,6 +1,7 @@ | |||||
using Learun.Application.Base.SystemModule; | using Learun.Application.Base.SystemModule; | ||||
using Learun.Application.TwoDevelopment.PersonnelManagement; | using Learun.Application.TwoDevelopment.PersonnelManagement; | ||||
using Learun.Util; | using Learun.Util; | ||||
using System; | |||||
using System.Collections.Generic; | using System.Collections.Generic; | ||||
using System.Data; | using System.Data; | ||||
using System.Linq; | using System.Linq; | ||||
@@ -152,7 +153,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers | |||||
[HttpGet] | [HttpGet] | ||||
[AjaxOnly] | [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); | var data = gz_AmountsIBLL.GetAmountsDetail(userNo, year, month, 0); | ||||
return Success(data); | return Success(data); | ||||
@@ -166,11 +167,11 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers | |||||
/// </summary> | /// </summary> | ||||
/// <param name="keyValue">主键</param> | /// <param name="keyValue">主键</param> | ||||
/// <returns></returns> | /// <returns></returns> | ||||
[HttpPost] | |||||
[HttpGet] | |||||
[AjaxOnly] | [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("删除成功!"); | return Success("删除成功!"); | ||||
} | } | ||||
/// <summary> | /// <summary> | ||||
@@ -216,7 +217,7 @@ namespace Learun.Application.Web.Areas.PersonnelManagement.Controllers | |||||
var items = gz_ItemsIBLL.SyncColumn(useCol); | 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 | var data = new | ||||
{ | { | ||||
@@ -39,8 +39,8 @@ | |||||
<el-col :span="10" style="display: flex;justify-content: right;"> | <el-col :span="10" style="display: flex;justify-content: right;"> | ||||
<a v-on:click="refresh" class="btn btn-default" style="margin-right:8px;font-size:14px"><i class="el-icon-refresh"></i></a> | <a v-on:click="refresh" class="btn btn-default" style="margin-right:8px;font-size:14px"><i class="el-icon-refresh"></i></a> | ||||
<a class="btn btn-default" v-on:click="detailShow"><i class="el-icon-edit-outline" style="margin-right:4px"></i>查看</a> | <a class="btn btn-default" v-on:click="detailShow"><i class="el-icon-edit-outline" style="margin-right:4px"></i>查看</a> | ||||
<a class="btn btn-default" v-on:click="del"><i class="el-icon-delete" style="margin-right:4px"></i>删除</a> | |||||
<a class="btn btn-default" id="lr_import"><i class="el-icon-download" style="margin-right:4px"></i>导入</a> | <a class="btn btn-default" id="lr_import"><i class="el-icon-download" style="margin-right:4px"></i>导入</a> | ||||
@*<a class="btn btn-default" v-on:click="del"><i class="el-icon-delete" style="margin-right:4px"></i>删除</a>*@ | |||||
</el-col> | </el-col> | ||||
</el-row> | </el-row> | ||||
<div style="height:calc(100% - 80px)"> | <div style="height:calc(100% - 80px)"> | ||||
@@ -236,17 +236,21 @@ | |||||
}, | }, | ||||
// 删除 | // 删除 | ||||
del() { | del() { | ||||
let ids = this.multipleSelection.map(e => e.id).toString() | |||||
if (!ids) { | |||||
this.$message.warning('请选择需要删除的数据!') | |||||
if (this.multipleSelection.length != 1) { | |||||
this.$message.warning('请选择一条数据进行删除!') | |||||
return | return | ||||
} | } | ||||
//let ids = this.multipleSelection.map(e => e.id).toString() | |||||
//if (!ids) { | |||||
// this.$message.warning('请选择需要删除的数据!') | |||||
// return | |||||
//} | |||||
this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { | this.$confirm('此操作将永久删除该数据, 是否继续?', '提示', { | ||||
confirmButtonText: '确定', | confirmButtonText: '确定', | ||||
cancelButtonText: '取消', | cancelButtonText: '取消', | ||||
type: 'warning' | type: 'warning' | ||||
}).then(async () => { | }).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) { | if (res) { | ||||
this.$message.success('删除成功!') | this.$message.success('删除成功!') | ||||
} | } | ||||
@@ -26,9 +26,9 @@ | |||||
<a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | <a id="lr_refresh" class="btn btn-default"><i class="fa fa-refresh"></i></a> | ||||
</div> | </div> | ||||
<div class=" btn-group btn-group-sm" learun-authorize="yes"> | <div class=" btn-group btn-group-sm" learun-authorize="yes"> | ||||
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a> | |||||
@*<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i> 新增</a>*@ | |||||
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | <a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 编辑</a> | ||||
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a> | |||||
@*<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i> 删除</a>*@ | |||||
<a id="lr_show" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 展示/取消</a> | <a id="lr_show" class="btn btn-default"><i class="fa fa-pencil-square-o"></i> 展示/取消</a> | ||||
</div> | </div> | ||||
</div> | </div> | ||||
@@ -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 | #endregion | ||||
} | } | ||||
@@ -45,6 +45,8 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||||
/// </summary> | /// </summary> | ||||
/// <param name="keyValue">主键</param> | /// <param name="keyValue">主键</param> | ||||
void DeleteEntity(string keyValue); | void DeleteEntity(string keyValue); | ||||
void DeleteEntity(string userNo, int year, int month); | |||||
/// <summary> | /// <summary> | ||||
/// 保存实体数据(新增、修改) | /// 保存实体数据(新增、修改) | ||||
/// </summary> | /// </summary> | ||||
@@ -160,7 +160,24 @@ namespace Learun.Application.TwoDevelopment.PersonnelManagement | |||||
} | } | ||||
} | } | ||||
} | } | ||||
public void DeleteEntity(string userNo, int year, int month) | |||||
{ | |||||
try | |||||
{ | |||||
this.BaseRepository("CollegeMIS").Delete<Gz_AmountsEntity>(t => t.UserNo == userNo && t.Year == year && t.Month == month); | |||||
} | |||||
catch (Exception ex) | |||||
{ | |||||
if (ex is ExceptionEx) | |||||
{ | |||||
throw; | |||||
} | |||||
else | |||||
{ | |||||
throw ExceptionEx.ThrowServiceException(ex); | |||||
} | |||||
} | |||||
} | |||||
/// <summary> | /// <summary> | ||||
/// 保存实体数据(新增、修改) | /// 保存实体数据(新增、修改) | ||||
/// <param name="keyValue">主键</param> | /// <param name="keyValue">主键</param> | ||||