diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FillinFromController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FillinFromController.cs index ca947e236..56872406c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FillinFromController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/FillinFromController.cs @@ -137,9 +137,17 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [AjaxOnly] public ActionResult DeleteForm(string keyValue) { - fillinFromIBLL.DeleteEntity(keyValue); - return Success("删除成功!"); + var Model = fillinFromIBLL.GetFillInNo(keyValue); + if (Model != null) + { + //重新填写 + Model.IsDel = 1; + } + + fillinFromIBLL.SaveEntity(keyValue, Model); + return Success("作废成功!"); } + /// /// 保存实体数据(新增、修改) /// @@ -159,24 +167,36 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { entity.State = 2; } - else if (entity.State == 2) - { - entity.State = 3; - } #endregion } - else - { - entity.State = 1; - } fillinFromIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); } #endregion #region 扩展数据 + + /// + /// 提交 + /// + /// + /// + [HttpPost] + [AjaxOnly] + public ActionResult Submit(string keyValue) + { + var Model = fillinFromIBLL.GetFillInNo(keyValue); + if (Model != null) + { + //重新填写 + Model.State = 2; + } + fillinFromIBLL.SaveEntity(keyValue, Model); + return Success("保存成功!"); + } + /// - /// 隐藏/撤下 + /// 隐藏/显示 /// /// /// @@ -187,8 +207,14 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers var Model = fillinFromIBLL.GetFillInNo(keyValue); if (Model != null) { - //隐藏 - Model.IsFlag = 1; + if (Model.IsFlag == 0) + { + Model.IsFlag = 1; + } + else + { + Model.IsFlag = 0; + } } fillinFromIBLL.SaveEntity(keyValue, Model); return Success("保存成功!"); @@ -212,6 +238,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers fillinFromIBLL.SaveEntity(keyValue, Model); return Success("保存成功!"); } + #endregion } } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Form.cshtml index d2a75cf93..00d205c31 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Form.cshtml @@ -27,10 +27,10 @@
填报时间
- @*
-
填报人*
-
-
*@ +
+
公      式*
+
+
备      注
@@ -48,8 +48,12 @@
+ @Html.AppendJsFile("/Areas/EducationalAdministration/Views/FillinFrom/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Form.js index fcd418319..1daf31626 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Form.js @@ -15,6 +15,20 @@ var bootstrap = function ($, learun) { page.initData(); }, bind: function () { + $('#Formula').lrDataSourceSelect({ code: 'FormulaMain', value: 'id', text: 'name' }); + $('#Formula').lrGirdSelect({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=FormulaMain', + selectWord: 'name', + value: 'id', + text: 'name', + headData: + [ + { label: "公式", name: "result", width: 300, align: "left" }, + { label: "公式名称", name: "name", width: 300, align: "left" } + ], + select: function (item) { + } + }); $('#lrPeople')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; $('#lrPeople').val(learun.clientdata.get(['userinfo']).realName); $('#lrTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); @@ -49,6 +63,7 @@ var bootstrap = function ($, learun) { } $('#State').val('0'); $('#IsFlag').val('0'); + $('#IsDel').val('0'); } }; // 保存数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormIndex.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormIndex.js index ae64207f0..5e4d30951 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormIndex.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormIndex.js @@ -113,24 +113,24 @@ var bootstrap = function ($, learun) { }); } }); - //隐藏撤下 - $('#lr_hide').on('click', function () { - var keyValue = $('#gridtable').jfGridValue('Id'); - if (learun.checkrow(keyValue)) { - var RStatus = $('#gridtable').jfGridValue('State'); - if (RStatus == 1) { - learun.alert.warning("已提交!"); - return false; - } - learun.layerConfirm('是否确认提交该项!', function (res) { - if (res) { - learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Repair/DoSubmit', { keyValue: keyValue }, function () { - refreshGirdData(); - }); - } - }); - } - }); + ////隐藏显示 + //$('#lr_hide').on('click', function () { + // var keyValue = $('#gridtable').jfGridValue('Id'); + // if (learun.checkrow(keyValue)) { + // var RStatus = $('#gridtable').jfGridValue('State'); + // if (RStatus == 1) { + // learun.alert.warning("已提交!"); + // return false; + // } + // learun.layerConfirm('是否确认提交该项!', function (res) { + // if (res) { + // learun.deleteForm(top.$.rootUrl + '/AssetManagementSystem/Ass_Repair/DoSubmit', { keyValue: keyValue }, function () { + // refreshGirdData(); + // }); + // } + // }); + // } + //}); }, // 初始化列表 initGird: function () { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormulaIndex.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormulaIndex.cshtml index 5efed7c1f..ee19c338f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormulaIndex.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/FormulaIndex.cshtml @@ -48,7 +48,7 @@ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.cshtml index 52f3620c4..ac0e39e77 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.cshtml @@ -37,17 +37,17 @@
 添加  编辑 -  删除 +  作废 +  提交
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.js index 42d9cc2bd..53389e82a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/FillinFrom/Index.js @@ -35,6 +35,24 @@ var bootstrap = function ($, learun) { } }); }); + //提交 + $('#lr_submit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + var State = $('#gridtable').jfGridValue('State'); + if (State == 0) { + learun.alert.warning("当前项已提交,不能重复提交!"); + return false; + } + learun.layerConfirm('是否确认提交该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/Submit', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); // 编辑 $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); @@ -56,7 +74,7 @@ var bootstrap = function ($, learun) { }); } }); - // 删除 + //作废 $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { @@ -92,27 +110,6 @@ var bootstrap = function ($, learun) { }); } }); - //设置公式 - $('#lr_formula').on('click', function () { - var keyValue = $('#gridtable').jfGridValue('Id'); - if (learun.checkrow(keyValue)) { - var State = $('#gridtable').jfGridValue('State'); - if (State !== 2) { - learun.alert.warning("当前项不能设置公式!"); - return false; - } - learun.layerForm({ - id: 'form', - title: '设置公式', - url: top.$.rootUrl + '/EducationalAdministration/FillinFrom/Formula?keyValue=' + keyValue, - width: 600, - height: 400, - callBack: function (id) { - return top[id].acceptClick(refreshGirdData); - } - }); - } - }); //设置填报人 $('#lr_people').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); @@ -134,11 +131,11 @@ var bootstrap = function ($, learun) { }); } }); - //隐藏撤下 + //隐藏显示 $('#lr_hide').on('click', function () { var keyValue = $('#gridtable').jfGridValue('Id'); if (learun.checkrow(keyValue)) { - learun.layerConfirm('是否确认隐藏该项!', function (res) { + learun.layerConfirm('是否确认隐藏/显示该项!', function (res) { if (res) { learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/FillinFrom/HideList', { keyValue: keyValue }, function () { refreshGirdData(); @@ -153,9 +150,9 @@ var bootstrap = function ($, learun) { $('#gridtable').lrAuthorizeJfGrid({ url: top.$.rootUrl + '/EducationalAdministration/FillinFrom/GetPageList', headData: [ - { label: "核心工作模块", name: "WorderModule", width: 300, align: "center" }, + { label: "核心工作模块", name: "WorderModule", width: 250, align: "center" }, { label: "序号", name: "SerialNo", width: 100, align: "center" }, - { label: "项目名称", name: "ProjectName", width: 300, align: "center" }, + { label: "项目名称", name: "ProjectName", width: 250, align: "center" }, { label: "填报周期", name: "FillingCycle", width: 100, align: "center", formatterAsync: function (callback, value, row, op, $cell) { @@ -169,7 +166,20 @@ var bootstrap = function ($, learun) { } }, { - label: "填报时间", name: "FillingTime", width: 100, align: "left", + label: "公式", name: "Formula", width: 200, align: "center", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'FormulaMain', + key: value, + keyId: 'id', + callback: function (_data) { + callback(_data['name']); + } + }); + } + }, + { + label: "填报时间", name: "FillingTime", width: 80, align: "center", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('dataItem', { key: value, @@ -194,7 +204,7 @@ var bootstrap = function ($, learun) { } }, { - label: "填报人", name: "FillingPeople", width: 150, align: "center", + label: "填报人", name: "FillingPeople", width: 100, align: "center", formatterAsync: function (callback, value, row, op, $cell) { learun.clientdata.getAsync('custmerData', { url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'teacheruserdata', @@ -222,18 +232,17 @@ var bootstrap = function ($, learun) { } } }, - { label: "备注", name: "Demo", width: 300, align: "center" }, + { label: "备注", name: "Demo", width: 250, align: "center" }, { - label: "隐藏/撤下", name: "IsFlag", width: 150, align: "center", + label: "隐藏/显示", name: "IsFlag", width: 150, align: "center", formatter: function (cellvalue) { if (cellvalue === 0) { return '显示'; } else if (cellvalue === 1) { return '隐藏'; - } + } } }, - ], mainId: 'Id', isPage: true 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 079bda745..38348eff5 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 @@ -957,8 +957,6 @@ - - @@ -7333,8 +7331,6 @@ - - diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromEntity.cs index bfc1be637..04042f691 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromEntity.cs @@ -85,10 +85,15 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [Column("DEMO")] public string Demo { get; set; } /// - /// 隐藏/撤下 + /// 隐藏/显示 /// [Column("ISFLAG")] public int? IsFlag { get; set; } + /// + /// 是否作废 0 否 1 是 + /// + [Column("ISDEL")] + public int? IsDel { get; set; } #endregion #region 扩展操作 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromService.cs index a788f41df..909bf927e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/FillinFrom/FillinFromService.cs @@ -46,7 +46,8 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration t.State, t.lrPeople, t.lrTime, - t.IsFlag + t.IsFlag, + t.IsDel "); strSql.Append(" FROM FillinFrom t "); strSql.Append(" WHERE 1=1 ");