diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.js index c2917124b..01f588234 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/LogisticsManagement/Views/Accommodation/Index.js @@ -161,6 +161,7 @@ var bootstrap = function ($, learun) { //$("#gridtable").empty(); //$("#gridtable")[0].dfop = undefined; + console.log('selectedParent.ChildType=', selectedParent.ChildType); if (selectedParent.ChildType == "5") { $('#gridtable').lrAuthorizeJfGridLei({ url: top.$.rootUrl + '/LogisticsManagement/Accommodation/GetPageList', diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FD_BudgetBasicsController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FD_BudgetBasicsController.cs index 4f720e9b1..c2615cc9b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FD_BudgetBasicsController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FD_BudgetBasicsController.cs @@ -4,6 +4,7 @@ using System.Data; using Learun.Application.TwoDevelopment.ReceiveSendFeeManagement; using System.Web.Mvc; using System.Collections.Generic; +using Learun.Application.Organization; namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers { @@ -17,6 +18,7 @@ namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers public class FD_BudgetBasicsController : MvcControllerBase { private FD_BudgetBasicsIBLL fD_BudgetBasicsIBLL = new FD_BudgetBasicsBLL(); + private DepartmentIBLL departmentIBLL = new DepartmentBLL(); #region 视图功能 @@ -27,7 +29,7 @@ namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers [HttpGet] public ActionResult Index() { - return View(); + return View(); } /// /// 表单页 @@ -36,7 +38,12 @@ namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers [HttpGet] public ActionResult Form() { - return View(); + var userInfo = LoginUserInfo.Get(); + ViewBag.Name = userInfo.realName; + var dept = departmentIBLL.GetEntity(userInfo.departmentId); + ViewBag.Dept = dept == null ? "" : dept.F_FullName; + ViewBag.Date = DateTime.Now; + return View(); } #endregion @@ -72,8 +79,9 @@ namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers [AjaxOnly] public ActionResult GetFormData(string keyValue) { - var FD_BudgetBasicsData = fD_BudgetBasicsIBLL.GetFD_BudgetBasicsEntity( keyValue ); - var jsonData = new { + var FD_BudgetBasicsData = fD_BudgetBasicsIBLL.GetFD_BudgetBasicsEntity(keyValue); + var jsonData = new + { FD_BudgetBasics = FD_BudgetBasicsData, }; return Success(jsonData); @@ -94,7 +102,7 @@ namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers }; return Success(jsonData); } - + #endregion #region 提交数据 @@ -110,7 +118,7 @@ namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers { var entity = fD_BudgetBasicsIBLL.GetFD_BudgetBasicsEntity(keyValue); entity.BIsDelete = true; - entity.BDeleteTime=DateTime.Now; + entity.BDeleteTime = DateTime.Now; entity.BDeleteUser = LoginUserInfo.Get().userId; fD_BudgetBasicsIBLL.SaveEntity(keyValue, entity); return Success("删除成功!"); @@ -127,7 +135,7 @@ namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { FD_BudgetBasicsEntity entity = strEntity.ToObject(); - fD_BudgetBasicsIBLL.SaveEntity(keyValue,entity); + fD_BudgetBasicsIBLL.SaveEntity(keyValue, entity); if (string.IsNullOrEmpty(keyValue)) { } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FD_IncomeManageController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FD_IncomeManageController.cs index 90774f5c9..dba042f67 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FD_IncomeManageController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FD_IncomeManageController.cs @@ -38,6 +38,24 @@ namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers { return View(); } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form2() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form3() + { + return View(); + } #endregion #region 获取数据 @@ -79,6 +97,21 @@ namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers }; return Success(jsonData); } + + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetTree() + { + var data = fD_IncomeManageIBLL.GetTree(); + + return Success(data); + } + #endregion #region 提交数据 @@ -113,8 +146,18 @@ namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers FD_IncomeManageEntity entity = strEntity.ToObject(); if (entity.IAmount <= 0) return Fail("金额必须大于0!"); - entity.IUseAmount = 0; - entity.ISurplusAmount = entity.IAmount; + if (string.IsNullOrEmpty(keyValue)) + { + entity.IUseAmount = 0; + entity.ISurplusAmount = entity.IAmount; + } + else + { + var FD_IncomeManageData = fD_IncomeManageIBLL.GetFD_IncomeManageEntity(keyValue); + entity.IUseAmount = FD_IncomeManageData.IUseAmount; + entity.ISurplusAmount = entity.IAmount - FD_IncomeManageData.IUseAmount; + } + fD_IncomeManageIBLL.SaveEntity(keyValue, entity); if (string.IsNullOrEmpty(keyValue)) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FD_PayManageController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FD_PayManageController.cs index e963ddc40..129249729 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FD_PayManageController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Controllers/FD_PayManageController.cs @@ -3,6 +3,7 @@ using System.Data; using Learun.Application.TwoDevelopment.ReceiveSendFeeManagement; using System.Web.Mvc; using System.Collections.Generic; +using System.Linq; using Learun.Application.WorkFlow; namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers @@ -57,10 +58,32 @@ namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers { return View(); } - + + /// + /// 表单(基本承包经费支出) + /// + /// + [HttpGet] + public ActionResult FormPublic() + { + return View(); + } #endregion #region 获取数据 + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPTypeTree(string keyValue) + { + var data = fD_PayManageIBLL.GetTree(); + + return Success(data); + } /// /// 获取页面显示列表数据 @@ -106,14 +129,14 @@ namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers /// [HttpGet] [AjaxOnly] - public ActionResult GetPrintData(string keyValue,string processId) + public ActionResult GetPrintData(string keyValue, string processId) { var FD_PayManageData = fD_PayManageIBLL.GetFD_PayManageEntity(keyValue); - var TaskLogList = (List) nWFTaskIBLL.GetLogList(processId); + var TaskLogList = (List)nWFTaskIBLL.GetLogList(processId); var jsonData = new { FD_PayManage = FD_PayManageData, - TaskLogList= TaskLogList + TaskLogList = TaskLogList }; return Success(jsonData); } @@ -184,6 +207,40 @@ namespace Learun.Application.Web.Areas.ReceiveSendFeeManagement.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { FD_PayManageEntity entity = strEntity.ToObject(); + //判断资金支出来源对应的收入预算是否存在 + var ITopType = ""; + var ISecondType = ""; + if ((entity.PTopSource == "1" || entity.PTopSource == "2") || entity.PType == "2") + { + //学校经费 部门专项经费对应公用经费 + ITopType = "0"; + ISecondType = "1"; + } + else if (entity.PTopSource == "3") + { + //财政专项经费 + ITopType = "0"; + ISecondType = "2"; + } + else if (entity.PTopSource == "4") + { + //培训收入 + ITopType = "2"; + } + + var incomlist = fD_IncomeManageIBLL.GetIncomeList(ITopType, ISecondType); + if (incomlist.Count() <= 0) + return Fail("请先添加对应的收入预算!"); + + if (entity.PTopSource == "3" && string.IsNullOrEmpty(entity.PIncomeId)) + { + //财政专项经费 + return Fail("请选择财政专项名称!"); + } + else + { + entity.PIncomeId = incomlist.Select(x => x.IId).FirstOrDefault(); + } fD_PayManageIBLL.SaveEntity(keyValue, entity); if (string.IsNullOrEmpty(keyValue)) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_BudgetBasics/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_BudgetBasics/Form.cshtml index f9d5412a2..1d1ba45b3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_BudgetBasics/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_BudgetBasics/Form.cshtml @@ -3,13 +3,25 @@ Layout = "~/Views/Shared/_Form.cshtml"; }
-
+
+
姓名
+ +
+
+
部门
+ +
+
+
当前时间
+ +
+
附件上传
-
+
-
+
备注
- +
@Html.AppendJsFile("/Areas/ReceiveSendFeeManagement/Views/FD_BudgetBasics/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Form.cshtml index 27c1c415f..f8bb6ee63 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Form.cshtml @@ -2,23 +2,21 @@ ViewBag.Title = "收入预算管理"; Layout = "~/Views/Shared/_Form.cshtml"; } +@*财政预算-人员经费、公用经费*@
-
-
项目编号
- -
+
项目名称*
-
+ @*
预算类型*
预算科目
-
+
*@
人数
@@ -31,10 +29,7 @@
金额*
- +
备注
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Form.js index 66432f37a..c469aede7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Form.js @@ -6,6 +6,8 @@ */ var acceptClick; var keyValue = request('keyValue'); +var ITopType = request('ITopType'); +var ISecondType = request('ISecondType'); var bootstrap = function ($, learun) { "use strict"; var page = { @@ -15,42 +17,42 @@ var bootstrap = function ($, learun) { page.initData(); }, bind: function () { - $('#ITopType').lrDataItemSelect({ - code: 'BudgetType', select: function (item) { - if (item) { - if (item.id == '0' || item.text == '财政预算') { - $('#ISecondType').removeAttr("readonly"); - $('#idIQuota').html('定额*'); - document.getElementById("divIActual").style.display = "none"; - } else { - $('#IPeopleNum').attr('readonly', 'readonly'); - $('#ISecondType').lrDataItemSelect({ code: 'financeBudgetType' }); - $('#ISecondType').attr('readonly', 'readonly'); - $('#idIQuota').html('年度预计收入*'); - document.getElementById("divIActual").style.display = ""; - $('#idIAmount').html('金额*'); - } - } - } - }); - $('#ISecondType').lrDataItemSelect({ code: 'financeBudgetType', select: function(item) { - if (item) { - if (item.text == '人员经费') { - $('#IPeopleNum').removeAttr("readonly"); - } else { - $('#IPeopleNum').val(''); - $('#IPeopleNum').attr('readonly', 'readonly'); - } - if (item.text == '财政专项') { - $('#idIQuota').html('申报金额*'); - $('#idIAmount').html('批复金额*'); - } else { - $('#spanIQuota').text('定额*'); - $('#idIAmount').html('金额*'); - } - } + //$('#ITopType').lrDataItemSelect({ + // code: 'BudgetType', select: function (item) { + // if (item) { + // if (item.id == '0' || item.text == '财政预算') { + // $('#ISecondType').removeAttr("readonly"); + // $('#idIQuota').html('定额*'); + // document.getElementById("divIActual").style.display = "none"; + // } else { + // $('#IPeopleNum').attr('readonly', 'readonly'); + // $('#ISecondType').lrDataItemSelect({ code: 'financeBudgetType' }); + // $('#ISecondType').attr('readonly', 'readonly'); + // $('#idIQuota').html('年度预计收入*'); + // document.getElementById("divIActual").style.display = ""; + // $('#idIAmount').html('金额*'); + // } + // } + // } + //}); + //$('#ISecondType').lrDataItemSelect({ code: 'financeBudgetType', select: function(item) { + // if (item) { + // if (item.text == '人员经费') { + // $('#IPeopleNum').removeAttr("readonly"); + // } else { + // $('#IPeopleNum').val(''); + // $('#IPeopleNum').attr('readonly', 'readonly'); + // } + // if (item.text == '财政专项') { + // $('#idIQuota').html('申报金额*'); + // $('#idIAmount').html('批复金额*'); + // } else { + // $('#spanIQuota').text('定额*'); + // $('#idIAmount').html('金额*'); + // } + // } - } }); + //} }); }, initData: function () { if (!!keyValue) { @@ -72,8 +74,11 @@ var bootstrap = function ($, learun) { if (!$('body').lrValidform()) { return false; } + var strEntity = $('body').lrGetFormData(); + strEntity.ITopType = ITopType; + strEntity.ISecondType = ISecondType; var postData = { - strEntity: JSON.stringify($('body').lrGetFormData()) + strEntity: JSON.stringify(strEntity) }; $.lrSaveForm(top.$.rootUrl + '/ReceiveSendFeeManagement/FD_IncomeManage/SaveForm?keyValue=' + keyValue, postData, function (res) { // 保存成功后才回调 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Form2.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Form2.cshtml new file mode 100644 index 000000000..2ee9585f4 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Form2.cshtml @@ -0,0 +1,37 @@ +@{ + ViewBag.Title = "收入预算管理"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +@*事业收入、培训收入*@ +
+
+
项目名称*
+ +
+ @*
+
预算类型*
+
+
+
+
预算科目
+
+
*@ + +
+
年度实际收入*
+ +
+
+
年度预计收入*
+ +
+
+
金额*
+ +
+
+
备注
+ +
+
+@Html.AppendJsFile("/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Form3.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Form3.cshtml new file mode 100644 index 000000000..d18d5f34f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Form3.cshtml @@ -0,0 +1,38 @@ +@{ + ViewBag.Title = "收入预算管理"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +@*财政预算-财政专项*@ +
+
+
项目编号*
+ +
+
+
项目名称*
+ +
+ @*
+
预算类型*
+
+
+
+
预算科目
+
+
*@ + +
+
申报金额*
+ +
+
+
批复金额*
+ +
+ +
+
备注
+ +
+
+@Html.AppendJsFile("/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Index.cshtml index 37d43c9a8..d277e508e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Index.cshtml @@ -2,7 +2,13 @@ ViewBag.Title = "收入预算管理"; Layout = "~/Views/Shared/_Index.cshtml"; } -
+
+
+
+
类型
+
+
+
@@ -43,10 +49,10 @@
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Index.js index a27e10c07..ee4c5b229 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_IncomeManage/Index.js @@ -5,12 +5,15 @@ * 描 述:收入预算管理 */ var refreshGirdData; +var ITopType; +var ISecondType; var bootstrap = function ($, learun) { "use strict"; var page = { init: function () { - page.initGird(); + //page.initGird(); page.bind(); + page.initTree(); }, bind: function () { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { @@ -38,10 +41,28 @@ var bootstrap = function ($, learun) { }); // 新增 $('#lr_add').on('click', function () { + if (!ITopType) { + learun.alert.warning('请选择类型!'); + return; + } + if (ITopType == '0' && !ISecondType) { + learun.alert.warning('请选择二级类型!'); + return; + } + var url = ''; + if (ITopType == '1' || ITopType == '2') { + //事业收入、培训收入 + url = '/ReceiveSendFeeManagement/FD_IncomeManage/Form2'; + } else if (ITopType == '0' && ISecondType == '2') { + //财政预算 + url = '/ReceiveSendFeeManagement/FD_IncomeManage/Form3'; + } else { + url = '/ReceiveSendFeeManagement/FD_IncomeManage/Form'; + } learun.layerForm({ id: 'form', title: '新增', - url: top.$.rootUrl + '/ReceiveSendFeeManagement/FD_IncomeManage/Form', + url: top.$.rootUrl + url + '?ITopType=' + ITopType + '&ISecondType=' + ISecondType, width: 600, height: 400, callBack: function (id) { @@ -53,10 +74,20 @@ var bootstrap = function ($, learun) { $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('IId'); if (learun.checkrow(keyValue)) { + var url = ''; + if (ITopType == '1' || ITopType == '2') { + //事业收入、培训收入 + url = '/ReceiveSendFeeManagement/FD_IncomeManage/Form2'; + } else if (ITopType == '0' && ISecondType == '2') { + //财政预算 + url = '/ReceiveSendFeeManagement/FD_IncomeManage/Form3'; + } else { + url = '/ReceiveSendFeeManagement/FD_IncomeManage/Form'; + } learun.layerForm({ id: 'form', title: '编辑', - url: top.$.rootUrl + '/ReceiveSendFeeManagement/FD_IncomeManage/Form?keyValue=' + keyValue, + url: top.$.rootUrl + url + '?keyValue=' + keyValue + '&ITopType=' + ITopType + '&ISecondType=' + ISecondType, width: 600, height: 400, callBack: function (id) { @@ -83,50 +114,156 @@ var bootstrap = function ($, learun) { $('#gridtable').jqprintTable(); }); }, + initTree: function () { + $('#dataTree').lrtree({ + url: top.$.rootUrl + '/ReceiveSendFeeManagement/FD_IncomeManage/GetTree', + nodeClick: function (item) { + if (item.parent) { + ISecondType = item.value; + ITopType = item.parent.value; + } else { + ITopType = item.value; + ISecondType = ''; + } + page.initGird(); + page.search({ ITopType: ITopType, ISecondType: ISecondType }); + } + }); + }, // 初始化列表 initGird: function () { - $('#gridtable').jfGrid({ - url: top.$.rootUrl + '/ReceiveSendFeeManagement/FD_IncomeManage/GetPageList', - headData: [ - { label: "项目编号", name: "IEnCode", width: 100, align: "left" }, - { label: "项目名称", name: "IName", width: 100, align: "left" }, - { - label: "预算类型", name: "ITopType", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('dataItem', { - key: value, - code: 'BudgetType', - callback: function (_data) { - callback(_data.text); - } - }); - } - }, - { - label: "预算科目", name: "ISecondType", width: 100, align: "left", - formatterAsync: function (callback, value, row, op, $cell) { - learun.clientdata.getAsync('dataItem', { - key: value, - code: 'financeBudgetType', - callback: function (_data) { - callback(_data.text); - } - }); - } - }, - { label: "人数", name: "IPeopleNum", width: 100, align: "left" }, - { label: "定额/申报金额", name: "IQuota", width: 150, align: "left" }, - { label: "年度预计收入", name: "IQuota", width: 150, align: "left" }, - { label: "年度实际收入", name: "IActual", width: 100, align: "left" }, - { label: "金额/批复金额", name: "IAmount", width: 150, align: "left" }, - { label: "使用金额", name: "IUseAmount", width: 150, align: "left" }, - { label: "剩余金额", name: "ISurplusAmount", width: 150, align: "left" }, - { label: "备注", name: "IRemarks", width: 100, align: "left" }, - ], - mainId: 'IId', - isPage: true - }); - page.search(); + $("#gridtable").empty(); + $("#gridtable")[0].dfop = undefined; + if (ITopType == '1' || ITopType == '2') { + //事业收入、培训收入 + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/ReceiveSendFeeManagement/FD_IncomeManage/GetPageList', + headData: [ + { + label: "预算类型", name: "ITopType", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'BudgetType', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + //{ label: "项目编号", name: "IEnCode", width: 100, align: "left" }, + { label: "项目名称", name: "IName", width: 100, align: "left" }, + { label: "年度实际收入", name: "IActual", width: 100, align: "left" }, + { label: "年度预计收入", name: "IQuota", width: 150, align: "left" }, + { label: "金额", name: "IAmount", width: 150, align: "left" }, + { label: "使用金额", name: "IUseAmount", width: 150, align: "left" }, + { label: "剩余金额", name: "ISurplusAmount", width: 150, align: "left" }, + { label: "备注", name: "IRemarks", width: 100, align: "left" }, + ], + mainId: 'IId', + isPage: true + }); + + } else if (ITopType == '0' && ISecondType == '2') { + //财政预算-财政专项 + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/ReceiveSendFeeManagement/FD_IncomeManage/GetPageList', + headData: [ + { + label: "预算类型", + name: "ITopType", + width: 100, + align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', + { + key: value, + code: 'BudgetType', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: "预算科目", + name: "ISecondType", + width: 100, + align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', + { + key: value, + code: 'financeBudgetType', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { label: "项目编号", name: "IEnCode", width: 100, align: "left" }, + { label: "项目名称", name: "IName", width: 100, align: "left" }, + { label: "申报金额", name: "IQuota", width: 150, align: "left" }, + { label: "批复金额", name: "IAmount", width: 150, align: "left" }, + { label: "使用金额", name: "IUseAmount", width: 150, align: "left" }, + { label: "剩余金额", name: "ISurplusAmount", width: 150, align: "left" }, + { label: "备注", name: "IRemarks", width: 100, align: "left" } + ], + mainId: 'IId', + isPage: true + }); + } + else { + //财政预算-人员经费、公用经费 + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/ReceiveSendFeeManagement/FD_IncomeManage/GetPageList', + headData: [ + { + label: "预算类型", + name: "ITopType", + width: 100, + align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', + { + key: value, + code: 'BudgetType', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: "预算科目", + name: "ISecondType", + width: 100, + align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', + { + key: value, + code: 'financeBudgetType', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + //{ label: "项目编号", name: "IEnCode", width: 100, align: "left" }, + { label: "项目名称", name: "IName", width: 100, align: "left" }, + { label: "人数", name: "IPeopleNum", width: 100, align: "left" }, + { label: "定额", name: "IQuota", width: 150, align: "left" }, + { label: "金额", name: "IAmount", width: 150, align: "left" }, + { label: "使用金额", name: "IUseAmount", width: 150, align: "left" }, + { label: "剩余金额", name: "ISurplusAmount", width: 150, align: "left" }, + { label: "备注", name: "IRemarks", width: 100, align: "left" }, + ], + mainId: 'IId', + isPage: true + }); + } + //page.search(); }, search: function (param) { param = param || {}; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/Form.cshtml index 964d0facf..b754e2956 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/Form.cshtml @@ -3,11 +3,11 @@ Layout = "~/Views/Shared/_Form.cshtml"; }
-
-
报销类型
-
+ -
+
付款方式*
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/Form.js index 86c1cd6b6..22cb027d2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/Form.js @@ -6,6 +6,8 @@ */ var acceptClick; var keyValue = request('keyValue'); +//报销类型 +var ptype = request('ptype'); // 设置权限 var setAuthorize; // 设置表单数据 @@ -23,22 +25,42 @@ var bootstrap = function ($, learun) { page.initData(); }, bind: function () { - $('#PType').lrDataItemSelect({ code: 'payReimburseType' }); + $('#PType').lrDataItemSelect({ + code: 'payReimburseType', select: function (item) { + if (item) { + if (item.id == '1') { + //基本承包经费外支出 + $('#PTopSource').removeAttr("readonly"); + $('#PIncomeId').removeAttr("readonly"); + } else { + //基本承包经费支出不需要选择资金支出来源 + //$('#PTopSource').html(''); + //$('#PIncomeId').html(''); + $('#PTopSource').attr('readonly', 'readonly'); + $('#PIncomeId').attr('readonly', 'readonly'); + } + } + } + }); $('#PPayType').lrDataItemSelect({ code: 'fdPayType' }); $('#PTopSource').lrDataItemSelect({ code: 'fdPaySource', select: function (item) { var budgetType = ''; var financeBudgetType = ''; if (item) { - if (item.text == '学校经费' || item.text == '部门专项经费') { + if (item.id == '1' || item.id == '2') { + //学校经费 部门专项经费,都走公用经费 budgetType = '0'; financeBudgetType = '1'; - } else if (item.text == '财政专项经费') { + } else if (item.id == '3') { + //财政专项经费 budgetType = '0'; financeBudgetType = '2'; - } else { + } else if (item.id == '4') { + //培训收入 budgetType = '2'; } + } //财政专项名称 @@ -49,6 +71,13 @@ var bootstrap = function ($, learun) { value: 'value', text: 'text' }); + //if (item) { + // if (item.id == '3') { + // $('#PIncomeId').removeAttr("readonly"); + // } else { + // $('#PIncomeId').attr('readonly', 'readonly'); + // } + //} } }); @@ -104,7 +133,7 @@ var bootstrap = function ($, learun) { }; // 保存数据 save = function (processId, callBack, i) { - console.log('保存'); + if (!$('body').lrValidform()) { return false; } @@ -113,9 +142,11 @@ var bootstrap = function ($, learun) { if (!!processId) { strEntity.PProcessId = processId; } + strEntity.PType = ptype; postData.strEntity = JSON.stringify(strEntity); $.lrSaveForm(top.$.rootUrl + '/ReceiveSendFeeManagement/FD_PayManage/SaveForm?keyValue=' + keyValue, postData, function (res) { + console.log('aaaaa'); if (!!processId) { var res = {}; res.code = 200; diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/FormPublic.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/FormPublic.cshtml new file mode 100644 index 000000000..66705a592 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/FormPublic.cshtml @@ -0,0 +1,63 @@ +@{ + ViewBag.Title = "基本承包经费支出"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+ +
+
付款方式*
+
+
+
+
收款单位
+ +
+
+
开户银行
+ +
+
+
银行账号
+ +
+
+
收款人
+ +
+
+
开卡银行
+ +
+
+
卡号
+ +
+
+
开卡银行
+ +
+
+
卡号
+ +
+
+
资金支出用途
+ +
+ @*
+
资金支出来源
+
+
+
+
财政专项名称
+
+
*@ +
+
报销金额*
+ +
+
+@Html.AppendJsFile("/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/FormPublic.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/FormPublic.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/FormPublic.js new file mode 100644 index 000000000..22cb027d2 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/FormPublic.js @@ -0,0 +1,167 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-05-28 14:18 + * 描 述:支出预算管理 + */ +var acceptClick; +var keyValue = request('keyValue'); +//报销类型 +var ptype = request('ptype'); +// 设置权限 +var setAuthorize; +// 设置表单数据 +var setFormData; +// 验证数据是否填写完整 +var validForm; +// 保存数据 +var save; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#PType').lrDataItemSelect({ + code: 'payReimburseType', select: function (item) { + if (item) { + if (item.id == '1') { + //基本承包经费外支出 + $('#PTopSource').removeAttr("readonly"); + $('#PIncomeId').removeAttr("readonly"); + } else { + //基本承包经费支出不需要选择资金支出来源 + //$('#PTopSource').html(''); + //$('#PIncomeId').html(''); + $('#PTopSource').attr('readonly', 'readonly'); + $('#PIncomeId').attr('readonly', 'readonly'); + } + } + } + }); + $('#PPayType').lrDataItemSelect({ code: 'fdPayType' }); + $('#PTopSource').lrDataItemSelect({ + code: 'fdPaySource', select: function (item) { + var budgetType = ''; + var financeBudgetType = ''; + if (item) { + if (item.id == '1' || item.id == '2') { + //学校经费 部门专项经费,都走公用经费 + budgetType = '0'; + financeBudgetType = '1'; + } else if (item.id == '3') { + //财政专项经费 + budgetType = '0'; + financeBudgetType = '2'; + } else if (item.id == '4') { + //培训收入 + budgetType = '2'; + } + + } + + //财政专项名称 + $('#PIncomeId').lrselectRefresh({ + placeholder: "请选择财政专项名称", + allowSearch: true, + url: top.$.rootUrl + '/ReceiveSendFeeManagement/FD_PayManage/GetIncomeList?budgetType=' + budgetType + '&financeBudgetType=' + financeBudgetType, + value: 'value', + text: 'text' + }); + //if (item) { + // if (item.id == '3') { + // $('#PIncomeId').removeAttr("readonly"); + // } else { + // $('#PIncomeId').attr('readonly', 'readonly'); + // } + //} + } + }); + + //财政专项名称 + $('#PIncomeId').lrselect({ + placeholder: "请选择财政专项名称", + allowSearch: true, + url: top.$.rootUrl + '/ReceiveSendFeeManagement/FD_PayManage/GetIncomeList?budgetType=&financeBudgetType=', + value: 'value', + text: 'text' + }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/ReceiveSendFeeManagement/FD_PayManage/GetFormData?keyValue=' + keyValue, function (data) { + for (var id in data) { + if (!!data[id].length && data[id].length > 0) { + $('#' + id).jfGridSet('refreshdata', data[id]); + } + else { + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + } + }; + // 设置表单数据 + setFormData = function (processId, param, callback) { + if (!!processId) { + $.lrSetForm(top.$.rootUrl + '/ReceiveSendFeeManagement/FD_PayManage/GetFormDataByProcessId?processId=' + processId, function (data) { + for (var id in data) { + if (!!data[id] && data[id].length > 0) { + $('#' + id).jfGridSet('refreshdata', data[id]); + } + else { + if (id == 'FD_PayManage' && data[id]) { + keyValue = data[id].PId; + } + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + callback && callback(); + } + // 验证数据是否填写完整 + validForm = function () { + if (!$('body').lrValidform()) { + return false; + } + return true; + }; + // 保存数据 + save = function (processId, callBack, i) { + + if (!$('body').lrValidform()) { + return false; + } + var postData = {}; + var strEntity = $('body').lrGetFormData(); + if (!!processId) { + strEntity.PProcessId = processId; + } + strEntity.PType = ptype; + postData.strEntity = JSON.stringify(strEntity); + + $.lrSaveForm(top.$.rootUrl + '/ReceiveSendFeeManagement/FD_PayManage/SaveForm?keyValue=' + keyValue, postData, function (res) { + console.log('aaaaa'); + if (!!processId) { + var res = {}; + res.code = 200; + if (!!callBack) { + callBack(res, i); + } + + } else { + // 保存成功后才回调 + if (!!callBack) { + callBack(res, strEntity, i); + } + } + }); + }; + + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/Index.cshtml index 0de72c822..00bd7c2b2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/Index.cshtml @@ -2,7 +2,13 @@ ViewBag.Title = "支出预算管理"; Layout = "~/Views/Shared/_Index.cshtml"; } -
+
+
+
+
类型
+
+
+
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/Index.js index a19d47ada..c9315d11b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/Index.js @@ -6,12 +6,15 @@ */ var refreshGirdData; var processId = ''; +var ptype = ''; +var url = ''; var bootstrap = function ($, learun) { "use strict"; var page = { init: function () { page.initGird(); page.bind(); + page.initTree(); }, bind: function () { $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { @@ -22,19 +25,22 @@ var bootstrap = function ($, learun) { $('#PTopSource').lrDataItemSelect({ code: 'fdPaySource' }); // 刷新 $('#lr_refresh').on('click', function () { - location.reload(); + refreshGirdData(); }); // 新增 $('#lr_add').on('click', function () { + if (!ptype) { + learun.alert.warning("请选择类型!"); + return; + } learun.layerForm({ id: 'form', title: '新增', - url: top.$.rootUrl + '/ReceiveSendFeeManagement/FD_PayManage/Form', + url: top.$.rootUrl + url + '?ptype=' + ptype, width: 800, height: 600, callBack: function (id) { - top[id].save(); - return location.reload(); + return top[id].save('', refreshGirdData()); } }); }); @@ -43,19 +49,18 @@ var bootstrap = function ($, learun) { var keyValue = $('#gridtable').jfGridValue('PId'); var status = $('#gridtable').jfGridValue('PStatus'); if (status != 0) { - learun.alert.warning("当前项目已提交,不可修改!"); + learun.alert.warning("当前项目已提交,不可编辑!"); return; } if (learun.checkrow(keyValue)) { learun.layerForm({ id: 'form', title: '编辑', - url: top.$.rootUrl + '/ReceiveSendFeeManagement/FD_PayManage/Form?keyValue=' + keyValue, + url: top.$.rootUrl + url + '?keyValue=' + keyValue + '&ptype=' + ptype, width: 800, height: 600, callBack: function (id) { - top[id].save(); - return refreshGirdData('', '', ''); + return top[id].save('', refreshGirdData()); } }); } @@ -83,7 +88,11 @@ var bootstrap = function ($, learun) { //$('#gridtable').jqprintTable(); var keyValue = $('#gridtable').jfGridValue('PId'); var processId = $('#gridtable').jfGridValue('PProcessId'); - + var status = $('#gridtable').jfGridValue('PStatus'); + if (status == '0') { + learun.alert.warning("请先提交当前项目!"); + return; + } if (learun.checkrow(keyValue)) { var type = $('#gridtable').jfGridValue('PType'); //PType 1:基本承包经费外支出--专用经费报销流程; 2:基本承包经费支出--公用经费报销流程 @@ -106,7 +115,7 @@ var bootstrap = function ($, learun) { return; } var PType = $('#gridtable').jfGridValue('PType'); - + learun.layerConfirm('是否确认提交该项!', function (res) { if (res) { processId = learun.newGuid(); @@ -118,6 +127,20 @@ var bootstrap = function ($, learun) { } }); }, + initTree: function () { + $('#dataTree').lrtree({ + url: top.$.rootUrl + '/ReceiveSendFeeManagement/FD_PayManage/GetPTypeTree', + nodeClick: function (item) { + ptype = item.value; + url = '/ReceiveSendFeeManagement/FD_PayManage/Form'; + if (ptype == '2') { + //基本承包经费外支出 + url = '/ReceiveSendFeeManagement/FD_PayManage/FormPublic'; + } + page.search({ PType: ptype }); + } + }); + }, // 初始化列表 initGird: function () { $('#gridtable').jfGrid({ @@ -139,6 +162,23 @@ var bootstrap = function ($, learun) { }); } }, + { + label: "报销部门", + name: "PDept", + width: 100, + align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'classdata', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['name']); + } + }); + } + }, + { label: '报销时间', name: 'PTime', width: 200, align: "left" }, { label: "付款方式", name: "PPayType", diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/PrintPublic.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/PrintPublic.cshtml index 6b3b549fb..b02cfd654 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/PrintPublic.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/ReceiveSendFeeManagement/Views/FD_PayManage/PrintPublic.cshtml @@ -1,5 +1,5 @@ @{ - ViewBag.Title = "支出预算管理"; + ViewBag.Title = "基本承包经费支出打印"; Layout = "~/Views/Shared/_SimpleForm.cshtml"; }