diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/FundsManageMainController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/FundsManageMainController.cs index 15e68c3b6..aff6eb14c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/FundsManageMainController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Controllers/FundsManageMainController.cs @@ -38,6 +38,16 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers { return View(); } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult IndexCheck() + { + return View(); + } + #endregion #region 获取数据 @@ -115,6 +125,19 @@ namespace Learun.Application.Web.Areas.CustomFunction.Controllers return Success("保存成功!"); } + + /// + /// 修改状态 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult UpdateStatus(string keyValue,int Status) + { + fundsManageMainIBLL.UpdateStatus(keyValue, Status); + return Success("保存成功!"); + } #endregion } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/FundsManageMain/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/FundsManageMain/Index.cshtml index 0a4c1b63f..e30579a01 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/FundsManageMain/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/FundsManageMain/Index.cshtml @@ -27,6 +27,7 @@  新增  编辑  删除 +  提交  打印 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/FundsManageMain/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/FundsManageMain/Index.js index 2003803a1..2af428809 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/FundsManageMain/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/FundsManageMain/Index.js @@ -40,7 +40,7 @@ var bootstrap = function ($, learun) { res = top[id].validForm(); // 保存数据 if (res) { - res = top[id].save( function () { + res = top[id].save(function () { page.search(); }); } @@ -64,7 +64,7 @@ var bootstrap = function ($, learun) { res = top[id].validForm(); // 保存数据 if (res) { - res = top[id].save( function () { + res = top[id].save(function () { page.search(); }); } @@ -74,13 +74,40 @@ var bootstrap = function ($, learun) { }); } }); + //查看 + $('#lr_look').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form_FundsManageMain', + title: '查看', + url: top.$.rootUrl + '/CustomFunction/FundsManageMain/Form?keyValue=' + keyValue, + width: 900, + height: 650, + btn: null + }); + } + }); // 删除 $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); if (learun.checkrow(keyValue)) { learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { - learun.deleteForm(top.$.rootUrl + '/CustomFunction/FundsManageMain/DeleteForm', { keyValue: keyValue}, function () { + learun.deleteForm(top.$.rootUrl + '/CustomFunction/FundsManageMain/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //提交 + $('#lr_submit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认提交该项!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/CustomFunction/FundsManageMain/UpdateStatus', { keyValue: keyValue, Status: 1 }, function () { refreshGirdData(); }); } @@ -94,41 +121,49 @@ var bootstrap = function ($, learun) { }, // 初始化列表 initGird: function () { - $('#gridtable').lrAuthorizeJfGrid({ + $('#gridtable').jfGrid({ url: top.$.rootUrl + '/CustomFunction/FundsManageMain/GetPageList', headData: [ - { label: "项目编号", name: "SRProjectBasicId", width: 100, align: "left", - formatterAsync: function (callback, value, row, op,$cell) { - learun.clientdata.getAsync('custmerData', { - url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CommunityInfo', - key: value, - keyId: 'id', - callback: function (_data) { - callback(_data['communityname']); - } - }); - }}, - { label: "总预算", name: "FundsSum", width: 100, align: "left"}, - { label: "申请时间", name: "CreateTime", width: 100, align: "left"}, - { label: "申请人", name: "CreateUserId", width: 100, align: "left", - formatterAsync: function (callback, value, row, op,$cell) { - learun.clientdata.getAsync('user', { - key: value, - callback: function (_data) { - callback(_data.name); - } - }); - }}, - { label: "备注", name: "Remark", width: 100, align: "left"}, + { + label: "项目编号", name: "SRProjectBasicCode", width: 100, align: "left" + }, + { label: "总预算", name: "FundsSum", width: 100, align: "left" }, + { label: "申请时间", name: "CreateTime", width: 100, align: "left" }, + { + label: "申请人", name: "CreateUserId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('user', { + key: value, + callback: function (_data) { + callback(_data.name); + } + }); + } + }, + { label: "备注", name: "Remark", width: 100, align: "left" }, + { + label: "状态", name: "Status", width: 100, align: "left" , + formatter: function(cellvalue, row) { + if (cellvalue == 0) { + return "草稿"; + } else if (cellvalue == 1){ + return "已提交"; + } else if (cellvalue == 2) { + return "审核通过"; + } else if (cellvalue == 3) { + return "审核未通过"; + } + } + }, ], - mainId:'ID', + mainId: 'ID', isPage: true }); page.search(); }, search: function (param) { param = param || {}; - $('#gridtable').jfGridSet('reload',{ queryJson: JSON.stringify(param) }); + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); } }; refreshGirdData = function () { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/FundsManageMain/IndexCheck.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/FundsManageMain/IndexCheck.cshtml new file mode 100644 index 000000000..0eb2b1d53 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/FundsManageMain/IndexCheck.cshtml @@ -0,0 +1,36 @@ +@{ + ViewBag.Title = "经费预算管理"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
项目编号
+
+
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/CustomFunction/Views/FundsManageMain/IndexCheck.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/FundsManageMain/IndexCheck.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/FundsManageMain/IndexCheck.js new file mode 100644 index 000000000..b926f1b6c --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/CustomFunction/Views/FundsManageMain/IndexCheck.js @@ -0,0 +1,116 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-09-27 11:38 + * 描 述:经费预算管理 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + $('#SRProjectBasicId').lrselect({ + allowSearch: true, + url: top.$.rootUrl + '/CustomFunction/SRProjectBasic/GetList', + value: "ID", + text: "EnCode" + }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + //通过 + $('#lr_success').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + var Status = $('#gridtable').jfGridValue('Status'); + if (Status != 1) { + return learun.alert.warning('请先提交选中记录!'); + } + learun.layerConfirm('是否确认审核通过该项!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/CustomFunction/FundsManageMain/UpdateStatus', { keyValue: keyValue, Status: 2 }, function () { + refreshGirdData(); + }); + } + }); + } + }); + //未通过 + $('#lr_fail').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认未通过该项!', function (res) { + if (res) { + learun.postForm(top.$.rootUrl + '/CustomFunction/FundsManageMain/UpdateStatus', { keyValue: keyValue, Status: 3 }, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 打印 + $('#lr_print').on('click', function () { + $('#gridtable').jqprintTable(); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/CustomFunction/FundsManageMain/GetPageList', + headData: [ + { + label: "项目编号", name: "SRProjectBasicCode", width: 100, align: "left" + }, + { label: "总预算", name: "FundsSum", width: 100, align: "left" }, + { label: "申请时间", name: "CreateTime", width: 100, align: "left" }, + { + label: "申请人", name: "CreateUserId", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('user', { + key: value, + callback: function (_data) { + callback(_data.name); + } + }); + } + }, + { label: "备注", name: "Remark", width: 100, align: "left" }, + { + label: "状态", name: "Status", width: 100, align: "left" , + formatter: function(cellvalue, row) { + if (cellvalue == 0) { + return "草稿"; + } else if (cellvalue == 1){ + return "已提交"; + } else if (cellvalue == 2) { + return "审核通过"; + } else if (cellvalue == 3) { + return "审核未通过"; + } + } + }, + ], + mainId: 'ID', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.SqlParameter = ' and Status<>0 '; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index 2e0221fb4..266595ca2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj @@ -942,6 +942,7 @@ + @@ -7376,6 +7377,7 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/FundsManageMain/FundsManageMainBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/FundsManageMain/FundsManageMainBLL.cs index d8b2cf5c3..3ef84e954 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/FundsManageMain/FundsManageMainBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/FundsManageMain/FundsManageMainBLL.cs @@ -94,6 +94,25 @@ namespace Learun.Application.TwoDevelopment.CustomFunction } } + public void UpdateStatus(string keyValue, int Status) + { + try + { + fundsManageMainService.UpdateStatus(keyValue, Status); + } + 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/CustomFunction/FundsManageMain/FundsManageMainEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/FundsManageMain/FundsManageMainEntity.cs index 4e96bc5a8..74dca4c9d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/FundsManageMain/FundsManageMainEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/FundsManageMain/FundsManageMainEntity.cs @@ -79,6 +79,9 @@ namespace Learun.Application.TwoDevelopment.CustomFunction } #endregion #region 扩展字段 + [NotMapped] + public string SRProjectBasicCode { get; set; } + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/FundsManageMain/FundsManageMainIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/FundsManageMain/FundsManageMainIBLL.cs index cd74a5185..efee3557c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/FundsManageMain/FundsManageMainIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/FundsManageMain/FundsManageMainIBLL.cs @@ -36,6 +36,7 @@ namespace Learun.Application.TwoDevelopment.CustomFunction ///
/// 主键 void DeleteEntity(string keyValue); + void UpdateStatus(string keyValue, int Status); /// /// 保存实体数据(新增、修改) /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/FundsManageMain/FundsManageMainService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/FundsManageMain/FundsManageMainService.cs index b618d78fd..a1e5199e9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/FundsManageMain/FundsManageMainService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/CustomFunction/FundsManageMain/FundsManageMainService.cs @@ -37,9 +37,10 @@ namespace Learun.Application.TwoDevelopment.CustomFunction t.FundsSum, t.CreateTime, t.CreateUserId, - t.Remark + t.Remark,t.Status,s.EnCode as SRProjectBasicCode "); strSql.Append(" FROM FundsManageMain t "); + strSql.Append(" join SRProjectBasic s on t.SRProjectBasicId=s.id "); strSql.Append(" WHERE 1=1 "); var queryParam = queryJson.ToJObject(); // 虚拟参数 @@ -49,6 +50,11 @@ namespace Learun.Application.TwoDevelopment.CustomFunction dp.Add("SRProjectBasicId",queryParam["SRProjectBasicId"].ToString(), DbType.String); strSql.Append(" AND t.SRProjectBasicId = @SRProjectBasicId "); } + if (!queryParam["SqlParameter"].IsEmpty()) + { + strSql.Append(queryParam["SqlParameter"].ToString()); + } + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); } catch (Exception ex) @@ -115,6 +121,27 @@ namespace Learun.Application.TwoDevelopment.CustomFunction } } + public void UpdateStatus(string keyValue, int Status) + { + try + { + string sql = $"update FundsManageMain set Status={Status} where ID='{keyValue}'"; + this.BaseRepository("CollegeMIS").ExecuteBySql(sql); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + /// /// 保存实体数据(新增、修改) ///