diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Notice_TrainTeamController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Notice_TrainTeamController.cs index 374c88835..1271b3a7d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Notice_TrainTeamController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Notice_TrainTeamController.cs @@ -83,6 +83,15 @@ namespace Learun.Application.Web.Areas.Ask.Controllers { return View(); } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult FormView() + { + return View(); + } #endregion #region 获取数据 @@ -166,19 +175,19 @@ namespace Learun.Application.Web.Areas.Ask.Controllers /// 主键 /// 实体 /// - [HttpPost] - [ValidateAntiForgeryToken] - [AjaxOnly] - public ActionResult SaveForm(string keyValue, string strEntity) - { - Notice_Train_SportsEntity entity = strEntity.ToObject(); - entity.Type = "4"; - notice_Train_SportsIBLL.SaveEntity(keyValue,entity); - if (keyValue != null) - { - } - return Success("保存成功!"); - } + //[HttpPost] + //[ValidateAntiForgeryToken] + //[AjaxOnly] + //public ActionResult SaveForm(string keyValue, string strEntity) + //{ + // Notice_Train_SportsEntity entity = strEntity.ToObject(); + // entity.Type = "4"; + // notice_Train_SportsIBLL.SaveEntity(keyValue,entity); + // if (keyValue != null) + // { + // } + // return Success("保存成功!"); + //} #endregion #region 扩展数据 @@ -244,11 +253,27 @@ namespace Learun.Application.Web.Areas.Ask.Controllers #region 消息推送处理 + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// [HttpPost, ValidateAntiForgeryToken, AjaxOnly, ValidateInput(false)] - public ActionResult SaveFormAndSubmit(string keyValue, Notice_Train_SportsEntity entity) + public ActionResult SaveForm(string keyValue, Notice_Train_SportsEntity entity) + { + entity.Type = "4"; + entity.Status = 0; + notice_Train_SportsIBLL.SaveEntity(keyValue, entity); + if (keyValue != null) + { + } + return Success("保存成功!"); + } + public ActionResult SaveFormAndSubmit(string keyValue) { - entity.Type = "1"; - entity.T_Content = WebHelper.HtmlEncode(entity.T_Content); + Notice_Train_SportsEntity entity = notice_Train_SportsIBLL.GetNotice_Train_SportsEntity(keyValue); + entity.Status = 1; notice_Train_SportsIBLL.SaveEntity(keyValue, entity); //推送通知 //读取信息推送管理-通知公告推送(01)的配置 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Notice_Train_CoachController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Notice_Train_CoachController.cs index e72195072..f71ed1be2 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Notice_Train_CoachController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Notice_Train_CoachController.cs @@ -52,6 +52,15 @@ namespace Learun.Application.Web.Areas.Ask.Controllers { return View(); } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult FormView() + { + return View(); + } #endregion #region 获取数据 @@ -117,13 +126,11 @@ namespace Learun.Application.Web.Areas.Ask.Controllers /// 主键 /// 实体 /// - [HttpPost] - [ValidateAntiForgeryToken] - [AjaxOnly] - public ActionResult SaveForm(string keyValue, string strEntity) + [HttpPost, ValidateAntiForgeryToken, AjaxOnly, ValidateInput(false)] + public ActionResult SaveForm(string keyValue, Notice_Train_SportsEntity entity) { - Notice_Train_SportsEntity entity = strEntity.ToObject(); entity.Type = "2"; + entity.Status = 0; notice_Train_CoachIBLL.SaveEntity(keyValue,entity); if (keyValue != null) { @@ -132,11 +139,11 @@ namespace Learun.Application.Web.Areas.Ask.Controllers } #endregion - [HttpPost, ValidateAntiForgeryToken, AjaxOnly, ValidateInput(false)] - public ActionResult SaveFormAndSubmit(string keyValue, Notice_Train_SportsEntity entity) + + public ActionResult SaveFormAndSubmit(string keyValue) { - entity.Type = "2"; - entity.T_Content = WebHelper.HtmlEncode(entity.T_Content); + Notice_Train_SportsEntity entity = notice_Train_CoachIBLL.GetNotice_Train_SportsEntity(keyValue); + entity.Status = 1; notice_Train_CoachIBLL.SaveEntity(keyValue, entity); //推送通知 //读取信息推送管理-通知公告推送(01)的配置 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Notice_Train_SportsController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Notice_Train_SportsController.cs index 4fc09880b..19ffb7493 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Notice_Train_SportsController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Notice_Train_SportsController.cs @@ -83,6 +83,15 @@ namespace Learun.Application.Web.Areas.Ask.Controllers { return View(); } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult FormView() + { + return View(); + } #endregion #region 获取数据 @@ -166,19 +175,19 @@ namespace Learun.Application.Web.Areas.Ask.Controllers /// 主键 /// 实体 /// - [HttpPost] - [ValidateAntiForgeryToken] - [AjaxOnly] - public ActionResult SaveForm(string keyValue, string strEntity) - { - Notice_Train_SportsEntity entity = strEntity.ToObject(); - entity.Type = "1"; - notice_Train_SportsIBLL.SaveEntity(keyValue,entity); - if (keyValue != null) - { - } - return Success("保存成功!"); - } + //[HttpPost] + //[ValidateAntiForgeryToken] + //[AjaxOnly] + //public ActionResult SaveForm(string keyValue, string strEntity) + //{ + // Notice_Train_SportsEntity entity = strEntity.ToObject(); + // entity.Type = "1"; + // notice_Train_SportsIBLL.SaveEntity(keyValue,entity); + // if (keyValue != null) + // { + // } + // return Success("保存成功!"); + //} #endregion #region 扩展数据 @@ -244,11 +253,27 @@ namespace Learun.Application.Web.Areas.Ask.Controllers #region 消息推送处理 + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// [HttpPost, ValidateAntiForgeryToken, AjaxOnly, ValidateInput(false)] - public ActionResult SaveFormAndSubmit(string keyValue, Notice_Train_SportsEntity entity) + public ActionResult SaveForm(string keyValue, Notice_Train_SportsEntity entity) { entity.Type = "1"; - entity.T_Content = WebHelper.HtmlEncode(entity.T_Content); + entity.Status = 0; + notice_Train_SportsIBLL.SaveEntity(keyValue, entity); + if (keyValue != null) + { + } + return Success("保存成功!"); + } + public ActionResult SaveFormAndSubmit(string keyValue) + { + Notice_Train_SportsEntity entity = notice_Train_SportsIBLL.GetNotice_Train_SportsEntity(keyValue); + entity.Status = 1; notice_Train_SportsIBLL.SaveEntity(keyValue, entity); //推送通知 //读取信息推送管理-通知公告推送(01)的配置 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Notice_Train_SumController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Notice_Train_SumController.cs index a5d98aa98..4dff67d7c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Notice_Train_SumController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Notice_Train_SumController.cs @@ -37,6 +37,15 @@ namespace Learun.Application.Web.Areas.Ask.Controllers { return View(); } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult FormView() + { + return View(); + } #endregion #region 获取数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Notice_compare_TeamsController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Notice_compare_TeamsController.cs index 1513c6536..3705451c9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Notice_compare_TeamsController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Controllers/Notice_compare_TeamsController.cs @@ -52,6 +52,15 @@ namespace Learun.Application.Web.Areas.Ask.Controllers { return View(); } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult FormView() + { + return View(); + } #endregion #region 获取数据 @@ -117,13 +126,24 @@ namespace Learun.Application.Web.Areas.Ask.Controllers /// 主键 /// 实体 /// - [HttpPost] - [ValidateAntiForgeryToken] - [AjaxOnly] - public ActionResult SaveForm(string keyValue, string strEntity) + //[HttpPost] + //[ValidateAntiForgeryToken] + //[AjaxOnly] + //public ActionResult SaveForm(string keyValue, string strEntity) + //{ + // Notice_Train_SportsEntity entity = strEntity.ToObject(); + // notice_compare_TeamsIBLL.SaveEntity(keyValue,entity); + // if (keyValue != null) + // { + // } + // return Success("保存成功!"); + //} + [HttpPost, ValidateAntiForgeryToken, AjaxOnly, ValidateInput(false)] + public ActionResult SaveForm(string keyValue, Notice_Train_SportsEntity entity) { - Notice_Train_SportsEntity entity = strEntity.ToObject(); - notice_compare_TeamsIBLL.SaveEntity(keyValue,entity); + entity.Type = "3"; + entity.Status = 0; + notice_compare_TeamsIBLL.SaveEntity(keyValue, entity); if (keyValue != null) { } @@ -131,11 +151,10 @@ namespace Learun.Application.Web.Areas.Ask.Controllers } #endregion - [HttpPost, ValidateAntiForgeryToken, AjaxOnly, ValidateInput(false)] - public ActionResult SaveFormAndSubmit(string keyValue, Notice_Train_SportsEntity entity) + public ActionResult SaveFormAndSubmit(string keyValue) { - entity.Type = "3"; - entity.T_Content = WebHelper.HtmlEncode(entity.T_Content); + Notice_Train_SportsEntity entity = notice_compare_TeamsIBLL.GetNotice_Train_SportsEntity(keyValue); + entity.Status = 1; notice_compare_TeamsIBLL.SaveEntity(keyValue, entity); //推送通知 //读取信息推送管理-通知公告推送(01)的配置 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_TrainTeam/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_TrainTeam/Form.cshtml index 09585b9fc..a23859ef4 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_TrainTeam/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_TrainTeam/Form.cshtml @@ -50,4 +50,4 @@ *@ -@Html.AppendJsFile("/Areas/Ask/Views/Notice_Train_Sports/Form.js") +@Html.AppendJsFile("/Areas/Ask/Views/Notice_TrainTeam/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_TrainTeam/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_TrainTeam/Form.js index 6ea25be0d..8252317ee 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_TrainTeam/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_TrainTeam/Form.js @@ -18,7 +18,7 @@ // }, // initData: function () { // if (!!keyValue) { -// $.lrSetForm(top.$.rootUrl + '/Ask/Notice_Train_Sports/GetFormData?keyValue=' + keyValue, function (data) { +// $.lrSetForm(top.$.rootUrl + '/Ask/Notice_TrainTeam/GetFormData?keyValue=' + keyValue, function (data) { // for (var id in data) { // if (!!data[id].length && data[id].length > 0) { // $('#' + id ).jfGridSet('refreshdata', data[id]); @@ -39,7 +39,7 @@ // var postData = { // strEntity: JSON.stringify($('body').lrGetFormData()) // }; -// $.lrSaveForm(top.$.rootUrl + '/Ask/Notice_Train_Sports/SaveForm?keyValue=' + keyValue, postData, function (res) { +// $.lrSaveForm(top.$.rootUrl + '/Ask/Notice_TrainTeam/SaveForm?keyValue=' + keyValue, postData, function (res) { // // 保存成功后才回调 // if (!!callBack) { // callBack(); @@ -62,7 +62,7 @@ var bootstrap = function ($, learun) { bind: function () { //公告类别 $('#T_typename').lrDataItemSelect({ - code: 'Notice_Train_Sports', maxHeight: 230, select: function (item) { + code: 'Notice_Train_Teams', maxHeight: 230, select: function (item) { if (item != null && item != undefined) { $("#T_type").val(item.text); } @@ -79,7 +79,7 @@ var bootstrap = function ($, learun) { if (!!keyValue) { //$('#form').lrSetFormData(selectedRow); //$("#F_ReleaseTime").val(learun.formatDate(selectedRow.F_ReleaseTime, 'yyyy/MM/dd hh:mm')); - $.lrSetForm(top.$.rootUrl + '/Ask/Notice_Train_Sports/GetFormData?keyValue=' + keyValue, function (data) { + $.lrSetForm(top.$.rootUrl + '/Ask/Notice_TrainTeam/GetFormData?keyValue=' + keyValue, function (data) { $('#form').lrSetFormData(data); setTimeout(function () { ue.setContent(data.T_Content); @@ -94,7 +94,7 @@ var bootstrap = function ($, learun) { } learun.clientdata.getAsync('dataItem', { key: $("#T_typename").lrselectGet(), - code: 'Notice_Train_Sports', + code: 'Notice_Train_Teams', callback: function (_data) { $("#T_type").val(_data.text); @@ -103,7 +103,7 @@ var bootstrap = function ($, learun) { //var postData = {}; //postData.strEntity = $('#form').lrGetFormData(keyValue); - $.lrSaveForm(top.$.rootUrl + '/Ask/Notice_Train_Sports/SaveFormAndSubmit?keyValue=' + keyValue, postData, function (res) { + $.lrSaveForm(top.$.rootUrl + '/Ask/Notice_TrainTeam/SaveForm?keyValue=' + keyValue, postData, function (res) { // 保存成功后才回调 if (!!callBack) { callBack(); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_TrainTeam/FormView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_TrainTeam/FormView.cshtml new file mode 100644 index 000000000..b3430740f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_TrainTeam/FormView.cshtml @@ -0,0 +1,53 @@ +@{ + ViewBag.Title = "运动员集训安排"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +@*
+
+
标题*
+ +
+
*@ + +
+
+
公告标题*
+ +
+
+
公告类别*
+
+ +
+
+
发布时间*
+ +
+
+
信息来源
+ +
+
+
来源地址
+ +
+
+
接收部门
+
+
+
+
接收人
+
+
+
+
附件上传
+
+
+
+
公告内容
+
+ @**@ +
+
+@Html.AppendJsFile("/Areas/Ask/Views/Notice_TrainTeam/FormView.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_TrainTeam/FormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_TrainTeam/FormView.js new file mode 100644 index 000000000..1a825d995 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_TrainTeam/FormView.js @@ -0,0 +1,116 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-10-12 10:31 + * 描 述:运动员集训安排 + */ +//var acceptClick; +//var keyValue = request('keyValue'); +//var bootstrap = function ($, learun) { +// "use strict"; +// var page = { +// init: function () { +// $('.lr-form-wrap').lrscroll(); +// page.bind(); +// page.initData(); +// }, +// bind: function () { +// }, +// initData: function () { +// if (!!keyValue) { +// $.lrSetForm(top.$.rootUrl + '/Ask/Notice_TrainTeam/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]); +// } +// } +// }); +// } +// } +// }; +// // 保存数据 +// acceptClick = function (callBack) { +// if (!$('body').lrValidform()) { +// return false; +// } +// var postData = { +// strEntity: JSON.stringify($('body').lrGetFormData()) +// }; +// $.lrSaveForm(top.$.rootUrl + '/Ask/Notice_TrainTeam/SaveForm?keyValue=' + keyValue, postData, function (res) { +// // 保存成功后才回调 +// if (!!callBack) { +// callBack(); +// } +// }); +// }; +// page.init(); +//} + +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var ue; + var page = { + init: function () { + page.bind(); + page.initData(); + }, + bind: function () { + //公告类别 + $('#T_typename').lrDataItemSelect({ + code: 'Notice_Train_Teams', maxHeight: 230, select: function (item) { + if (item != null && item != undefined) { + $("#T_type").val(item.text); + } + } + }); + $('#Noticepeople').lrUserSelect(1); + $('#Files').lrUploader({ isUpload: false }); + $('#Noticedept').lrDepartmentSelect({ type: 'treemultiple' }); + $('#Noticepeople').lrDataItemSelect({ code: '' }); + //内容编辑器 + ue = UE.getEditor('editor'); + }, + initData: function () { + if (!!keyValue) { + //$('#form').lrSetFormData(selectedRow); + //$("#F_ReleaseTime").val(learun.formatDate(selectedRow.F_ReleaseTime, 'yyyy/MM/dd hh:mm')); + $.lrSetForm(top.$.rootUrl + '/Ask/Notice_TrainTeam/GetFormData?keyValue=' + keyValue, function (data) { + $('#form').lrSetFormData(data); + setTimeout(function () { + ue.setContent(data.T_Content); + }, 100); + }); + } + } + }; + acceptClick = function (callBack) { + if (!$('#form').lrValidform()) { + return false; + } + learun.clientdata.getAsync('dataItem', { + key: $("#T_typename").lrselectGet(), + code: 'Notice_Train_Teams', + callback: function (_data) { + $("#T_type").val(_data.text); + + var postData = $('#form').lrGetFormData(keyValue); + postData["T_Content"] = ue.getContent(null, null, true); + //var postData = {}; + //postData.strEntity = $('#form').lrGetFormData(keyValue); + + $.lrSaveForm(top.$.rootUrl + '/Ask/Notice_TrainTeam/SaveFormAndSubmit?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + } + }); + } + page.init(); +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_TrainTeam/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_TrainTeam/Index.cshtml index 1857032cc..59b84640b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_TrainTeam/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_TrainTeam/Index.cshtml @@ -18,10 +18,12 @@
- @@ -29,4 +31,4 @@ -@Html.AppendJsFile("/Areas/Ask/Views/Notice_Train_Sports/Index.js") +@Html.AppendJsFile("/Areas/Ask/Views/Notice_TrainTeam/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_TrainTeam/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_TrainTeam/Index.js index 03b77eb32..47472e4d0 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_TrainTeam/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_TrainTeam/Index.js @@ -5,6 +5,7 @@ * 描 述:运动员集训安排 */ var refreshGirdData; +var selectedRow; var bootstrap = function ($, learun) { "use strict"; var page = { @@ -27,7 +28,7 @@ var bootstrap = function ($, learun) { learun.layerForm({ id: 'form', title: '新增', - url: top.$.rootUrl + '/Ask/Notice_Train_Sports/Form', + url: top.$.rootUrl + '/Ask/Notice_TrainTeam/Form', width: 1000, height: 650, callBack: function (id) { @@ -38,11 +39,16 @@ var bootstrap = function ($, learun) { // 编辑 $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('T_id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); if (learun.checkrow(keyValue)) { + if (selectedRow[0].Status != 0) {//提交 + learun.alert.warning("当前记录已提交!"); + return false; + } learun.layerForm({ id: 'form', title: '编辑', - url: top.$.rootUrl + '/Ask/Notice_Train_Sports/Form?keyValue=' + keyValue, + url: top.$.rootUrl + '/Ask/Notice_TrainTeam/Form?keyValue=' + keyValue, width: 1000, height: 650, callBack: function (id) { @@ -54,21 +60,65 @@ var bootstrap = function ($, learun) { // 删除 $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('T_id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); if (learun.checkrow(keyValue)) { + if (selectedRow[0].Status != 0) {//提交 + learun.alert.warning("当前记录已提交!"); + return false; + } learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { - learun.deleteForm(top.$.rootUrl + '/Ask/Notice_Train_Sports/DeleteForm', { keyValue: keyValue}, function () { + learun.deleteForm(top.$.rootUrl + '/Ask/Notice_TrainTeam/DeleteForm', { keyValue: keyValue}, function () { refreshGirdData(); }); } }); } }); + // 提交 + $('#lr-sub').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('T_id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + if (selectedRow[0].Status > 0) { + learun.alert.warning("当前记录已提交!"); + return false; + } + learun.layerConfirm('是否确认提交该项!', function (res) { + if (res) { + //processId = learun.newGuid(); + learun.postForm(top.$.rootUrl + '/Ask/Notice_TrainTeam/SaveFormAndSubmit', { keyValue: keyValue, status: 1 }, function (res) { + //selectedRow.ProcessId = processId; + refreshGirdData(res, {}); + }); + } + }); + } + }); + // 查看 + $('#lr-look').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('T_id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + if (selectedRow[0].Status == 0) { + learun.alert.warning("当前记录未提交,请提交后再查看!"); + return false; + } + learun.layerForm({ + id: 'formview', + title: '查看', + url: top.$.rootUrl + '/Ask/Notice_TrainTeam/FormView?keyValue=' + keyValue, + width: 1000, + height: 600, + btn: null + }); + } + }); }, // 初始化列表 initGird: function () { $('#gridtable').jfGrid({ - url: top.$.rootUrl + '/Ask/Notice_Train_Sports/GetPageList', + url: top.$.rootUrl + '/Ask/Notice_TrainTeam/GetPageList', headData: [ { label: "标题", name: "T_title", width: 100, align: "left" }, { label: "类别", name: "T_type", width: 100, align: "left" }, @@ -91,6 +141,16 @@ var bootstrap = function ($, learun) { } } }, + { + label: "状态", name: "Status", width: 100, align: "left", + formatter: function (cellvalue, row) { + if (cellvalue == 1) { + return '已提交'; + } else { + return '草稿'; + } + } + }, //{ label: "附件上传", name: "Files", width: 100, align: "left"}, //{ label: "内容", name: "T_Content", width: 100, align: "left" }, ], diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Coach/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Coach/Form.js index 13a199380..f412b0fbb 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Coach/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Coach/Form.js @@ -102,7 +102,7 @@ var bootstrap = function ($, learun) { //var postData = {}; //postData.strEntity = $('#form').lrGetFormData(keyValue); - $.lrSaveForm(top.$.rootUrl + '/Ask/Notice_Train_Coach/SaveFormAndSubmit?keyValue=' + keyValue, postData, function (res) { + $.lrSaveForm(top.$.rootUrl + '/Ask/Notice_Train_Coach/SaveForm?keyValue=' + keyValue, postData, function (res) { // 保存成功后才回调 if (!!callBack) { callBack(); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Coach/FormView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Coach/FormView.cshtml new file mode 100644 index 000000000..23de936a6 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Coach/FormView.cshtml @@ -0,0 +1,53 @@ +@{ + ViewBag.Title = "教练员培训"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +@*
+
+
标题*
+ +
+
*@ + +
+
+
公告标题*
+ +
+
+
公告类别*
+
+ +
+
+
发布时间*
+ +
+
+
信息来源
+ +
+
+
来源地址
+ +
+
+
接收部门
+
+
+
+
接收人
+
+
+
+
附件上传
+
+
+
+
公告内容
+
+ @**@ +
+
+@Html.AppendJsFile("/Areas/Ask/Views/Notice_Train_Coach/FormView.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Coach/FormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Coach/FormView.js new file mode 100644 index 000000000..f2fcebe26 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Coach/FormView.js @@ -0,0 +1,115 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-10-12 04:42 + * 描 述:教练员培训 + */ +//var acceptClick; +//var keyValue = request('keyValue'); +//var bootstrap = function ($, learun) { +// "use strict"; +// var page = { +// init: function () { +// $('.lr-form-wrap').lrscroll(); +// page.bind(); +// page.initData(); +// }, +// bind: function () { +// }, +// initData: function () { +// if (!!keyValue) { +// $.lrSetForm(top.$.rootUrl + '/Ask/Notice_Train_Coach/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]); +// } +// } +// }); +// } +// } +// }; +// // 保存数据 +// acceptClick = function (callBack) { +// if (!$('body').lrValidform()) { +// return false; +// } +// var postData = { +// strEntity: JSON.stringify($('body').lrGetFormData()) +// }; +// $.lrSaveForm(top.$.rootUrl + '/Ask/Notice_Train_Coach/SaveForm?keyValue=' + keyValue, postData, function (res) { +// // 保存成功后才回调 +// if (!!callBack) { +// callBack(); +// } +// }); +// }; +// page.init(); +//} + +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var ue; + var page = { + init: function () { + page.bind(); + page.initData(); + }, + bind: function () { + //公告类别 + $('#T_typename').lrDataItemSelect({ + code: 'Notice_Train_Coach', maxHeight: 230, select: function (item) { + if (item != null && item != undefined) { + $("#T_type").val(item.text); + } + } + }); + $('#Noticepeople').lrUserSelect(1); + $('#Files').lrUploader({ isUpload: false }); + $('#Noticedept').lrDepartmentSelect({ type: 'treemultiple' }); + //内容编辑器jiushi + ue = UE.getEditor('editor'); + }, + initData: function () { + if (!!keyValue) { + //$('#form').lrSetFormData(selectedRow); + //$("#F_ReleaseTime").val(learun.formatDate(selectedRow.F_ReleaseTime, 'yyyy/MM/dd hh:mm')); + $.lrSetForm(top.$.rootUrl + '/Ask/Notice_Train_Coach/GetFormData?keyValue=' + keyValue, function (data) { + $('#form').lrSetFormData(data); + setTimeout(function () { + ue.setContent(data.T_Content); + }, 100); + }); + } + } + }; + acceptClick = function (callBack) { + if (!$('#form').lrValidform()) { + return false; + } + learun.clientdata.getAsync('dataItem', { + key: $("#T_typename").lrselectGet(), + code: 'Notice_Train_Coach', + callback: function (_data) { + $("#T_type").val(_data.text); + + var postData = $('#form').lrGetFormData(keyValue); + postData["T_Content"] = ue.getContent(null, null, true); + //var postData = {}; + //postData.strEntity = $('#form').lrGetFormData(keyValue); + + $.lrSaveForm(top.$.rootUrl + '/Ask/Notice_Train_Coach/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + } + }); + } + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Coach/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Coach/Index.cshtml index d12a71bfa..9de866f16 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Coach/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Coach/Index.cshtml @@ -18,10 +18,12 @@
- diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Coach/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Coach/Index.js index 707043b79..2fd4ac0da 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Coach/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Coach/Index.js @@ -5,6 +5,7 @@ * 描 述:教练员培训 */ var refreshGirdData; +var selectedRow; var bootstrap = function ($, learun) { "use strict"; var page = { @@ -38,7 +39,12 @@ var bootstrap = function ($, learun) { // 编辑 $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('T_id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); if (learun.checkrow(keyValue)) { + if (selectedRow[0].Status != 0) {//提交 + learun.alert.warning("当前记录已提交!"); + return false; + } learun.layerForm({ id: 'form', title: '编辑', @@ -54,7 +60,12 @@ var bootstrap = function ($, learun) { // 删除 $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('T_id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); if (learun.checkrow(keyValue)) { + if (selectedRow[0].Status != 0) {//提交 + learun.alert.warning("当前记录已提交!"); + return false; + } learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { learun.deleteForm(top.$.rootUrl + '/Ask/Notice_Train_Coach/DeleteForm', { keyValue: keyValue}, function () { @@ -64,6 +75,45 @@ var bootstrap = function ($, learun) { }); } }); + // 提交 + $('#lr-sub').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('T_id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + if (selectedRow[0].Status > 0) { + learun.alert.warning("当前记录已提交!"); + return false; + } + learun.layerConfirm('是否确认提交该项!', function (res) { + if (res) { + //processId = learun.newGuid(); + learun.postForm(top.$.rootUrl + '/Ask/Notice_Train_Coach/SaveFormAndSubmit', { keyValue: keyValue, status: 1 }, function (res) { + //selectedRow.ProcessId = processId; + refreshGirdData(res, {}); + }); + } + }); + } + }); + // 查看 + $('#lr-look').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('T_id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + if (selectedRow[0].Status == 0) { + learun.alert.warning("当前记录未提交,请提交后再查看!"); + return false; + } + learun.layerForm({ + id: 'formview', + title: '查看', + url: top.$.rootUrl + '/Ask/Notice_Train_Coach/FormView?keyValue=' + keyValue, + width: 1000, + height: 600, + btn: null + }); + } + }); }, // 初始化列表 initGird: function () { @@ -91,7 +141,16 @@ var bootstrap = function ($, learun) { } } }, - //{ label: "附件上传", name: "Files", width: 100, align: "left"}, + { + label: "状态", name: "Status", width: 100, align: "left", + formatter: function (cellvalue, row) { + if (cellvalue == 1) { + return '已提交'; + } else { + return '草稿'; + } + } + }, //{ label: "内容", name: "T_Content", width: 100, align: "left" }, ], mainId: 'T_id', diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sports/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sports/Form.js index 6ea25be0d..4f12cd603 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sports/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sports/Form.js @@ -103,7 +103,7 @@ var bootstrap = function ($, learun) { //var postData = {}; //postData.strEntity = $('#form').lrGetFormData(keyValue); - $.lrSaveForm(top.$.rootUrl + '/Ask/Notice_Train_Sports/SaveFormAndSubmit?keyValue=' + keyValue, postData, function (res) { + $.lrSaveForm(top.$.rootUrl + '/Ask/Notice_Train_Sports/SaveForm?keyValue=' + keyValue, postData, function (res) { // 保存成功后才回调 if (!!callBack) { callBack(); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sports/FormView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sports/FormView.cshtml new file mode 100644 index 000000000..6f19a9f2d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sports/FormView.cshtml @@ -0,0 +1,53 @@ +@{ + ViewBag.Title = "运动员集训安排"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +@*
+
+
标题*
+ +
+
*@ + +
+
+
公告标题*
+ +
+
+
公告类别*
+
+ +
+
+
发布时间*
+ +
+
+
信息来源
+ +
+
+
来源地址
+ +
+
+
接收部门
+
+
+
+
接收人
+
+
+
+
附件上传
+
+
+
+
公告内容
+
+ @**@ +
+
+@Html.AppendJsFile("/Areas/Ask/Views/Notice_Train_Sports/FormView.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sports/FormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sports/FormView.js new file mode 100644 index 000000000..e0a0e5871 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sports/FormView.js @@ -0,0 +1,116 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-10-12 10:31 + * 描 述:运动员集训安排 + */ +//var acceptClick; +//var keyValue = request('keyValue'); +//var bootstrap = function ($, learun) { +// "use strict"; +// var page = { +// init: function () { +// $('.lr-form-wrap').lrscroll(); +// page.bind(); +// page.initData(); +// }, +// bind: function () { +// }, +// initData: function () { +// if (!!keyValue) { +// $.lrSetForm(top.$.rootUrl + '/Ask/Notice_Train_Sports/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]); +// } +// } +// }); +// } +// } +// }; +// // 保存数据 +// acceptClick = function (callBack) { +// if (!$('body').lrValidform()) { +// return false; +// } +// var postData = { +// strEntity: JSON.stringify($('body').lrGetFormData()) +// }; +// $.lrSaveForm(top.$.rootUrl + '/Ask/Notice_Train_Sports/SaveForm?keyValue=' + keyValue, postData, function (res) { +// // 保存成功后才回调 +// if (!!callBack) { +// callBack(); +// } +// }); +// }; +// page.init(); +//} + +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var ue; + var page = { + init: function () { + page.bind(); + page.initData(); + }, + bind: function () { + //公告类别 + $('#T_typename').lrDataItemSelect({ + code: 'Notice_Train_Sports', maxHeight: 230, select: function (item) { + if (item != null && item != undefined) { + $("#T_type").val(item.text); + } + } + }); + $('#Noticepeople').lrUserSelect(1); + $('#Files').lrUploader({ isUpload: false }); + $('#Noticedept').lrDepartmentSelect({ type: 'treemultiple' }); + $('#Noticepeople').lrDataItemSelect({ code: '' }); + //内容编辑器 + ue = UE.getEditor('editor'); + }, + initData: function () { + if (!!keyValue) { + //$('#form').lrSetFormData(selectedRow); + //$("#F_ReleaseTime").val(learun.formatDate(selectedRow.F_ReleaseTime, 'yyyy/MM/dd hh:mm')); + $.lrSetForm(top.$.rootUrl + '/Ask/Notice_Train_Sports/GetFormData?keyValue=' + keyValue, function (data) { + $('#form').lrSetFormData(data); + setTimeout(function () { + ue.setContent(data.T_Content); + }, 100); + }); + } + } + }; + acceptClick = function (callBack) { + if (!$('#form').lrValidform()) { + return false; + } + learun.clientdata.getAsync('dataItem', { + key: $("#T_typename").lrselectGet(), + code: 'Notice_Train_Sports', + callback: function (_data) { + $("#T_type").val(_data.text); + + var postData = $('#form').lrGetFormData(keyValue); + postData["T_Content"] = ue.getContent(null, null, true); + //var postData = {}; + //postData.strEntity = $('#form').lrGetFormData(keyValue); + + $.lrSaveForm(top.$.rootUrl + '/Ask/Notice_Train_Sports/SaveFormAndSubmit?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + } + }); + } + page.init(); +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sports/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sports/Index.cshtml index 1857032cc..19d4f5827 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sports/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sports/Index.cshtml @@ -18,10 +18,12 @@
- diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sports/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sports/Index.js index 440c8af5a..96d781b49 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sports/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sports/Index.js @@ -5,6 +5,7 @@ * 描 述:运动员集训安排 */ var refreshGirdData; +var selectedRow; var bootstrap = function ($, learun) { "use strict"; var page = { @@ -38,7 +39,12 @@ var bootstrap = function ($, learun) { // 编辑 $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('T_id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); if (learun.checkrow(keyValue)) { + if (selectedRow[0].Status != 0) {//提交 + learun.alert.warning("当前记录已提交!"); + return false; + } learun.layerForm({ id: 'form', title: '编辑', @@ -54,7 +60,12 @@ var bootstrap = function ($, learun) { // 删除 $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('T_id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); if (learun.checkrow(keyValue)) { + if (selectedRow[0].Status != 0) {//提交 + learun.alert.warning("当前记录已提交!"); + return false; + } learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { learun.deleteForm(top.$.rootUrl + '/Ask/Notice_Train_Sports/DeleteForm', { keyValue: keyValue}, function () { @@ -64,6 +75,45 @@ var bootstrap = function ($, learun) { }); } }); + // 提交 + $('#lr-sub').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('T_id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + if (selectedRow[0].Status > 0) { + learun.alert.warning("当前记录已提交!"); + return false; + } + learun.layerConfirm('是否确认提交该项!', function (res) { + if (res) { + //processId = learun.newGuid(); + learun.postForm(top.$.rootUrl + '/Ask/Notice_Train_Sports/SaveFormAndSubmit', { keyValue: keyValue, status: 1 }, function (res) { + //selectedRow.ProcessId = processId; + refreshGirdData(res, {}); + }); + } + }); + } + }); + // 查看 + $('#lr-look').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('T_id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + if (selectedRow[0].Status == 0) { + learun.alert.warning("当前记录未提交,请提交后再查看!"); + return false; + } + learun.layerForm({ + id: 'formview', + title: '查看', + url: top.$.rootUrl + '/Ask/Notice_Train_Sports/FormView?keyValue=' + keyValue, + width: 1000, + height: 600, + btn: null + }); + } + }); }, // 初始化列表 initGird: function () { @@ -91,6 +141,16 @@ var bootstrap = function ($, learun) { } } }, + { + label: "状态", name: "Status", width: 100, align: "left", + formatter: function (cellvalue, row) { + if (cellvalue == 1) { + return '已提交'; + } else { + return '草稿'; + } + } + }, //{ label: "附件上传", name: "Files", width: 100, align: "left"}, //{ label: "内容", name: "T_Content", width: 100, align: "left" }, ], diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sum/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sum/Form.cshtml index f53873c56..331506065 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sum/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sum/Form.cshtml @@ -5,7 +5,7 @@
队伍
-
+
教练
@@ -24,4 +24,4 @@
-@Html.AppendJsFile("/Areas/Ask/Views/Notice_Train_Sum/Form.js") +@Html.AppendJsFile("/Areas/Ask/Views/Notice_Train_Sum/FormView.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sum/FormView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sum/FormView.cshtml new file mode 100644 index 000000000..f7ef3538b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sum/FormView.cshtml @@ -0,0 +1,27 @@ +@{ + ViewBag.Title = "比赛成绩汇总"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
队伍
+
+
+
+
教练
+
+
+
+
运动员
+
+
+
+
附件上传
+
+
+
+
简介
+
+
+
+@Html.AppendJsFile("/Areas/Ask/Views/Notice_Train_Sum/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sum/FormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sum/FormView.js new file mode 100644 index 000000000..73a78a433 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sum/FormView.js @@ -0,0 +1,75 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-10-17 16:18 + * 描 述:比赛成绩汇总 + */ +var acceptClick; +var keyValue = request('keyValue'); +var itemCode = request('itemCode'); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + //$('#Peoples').lrDataSourceSelect({ code: 'teacheruserdata',value: 'f_userid',text: 'f_realname' }); + $('#Files').lrUploader({ isUpload: false }); + var ContentsUE = UE.getEditor('Contents'); + $('#Coachs').lrUserSelect(1); + + //$('#Peoples').lrselect({ + // // 字段 + // value: "F_AreaCode", + // text: "F_AreaName", + // title: "F_AreaName", + // type: 'multiple', + // // 展开最大高度 + // maxHeight: 200, + // // 是否允许搜索 + // allowSearch: true, + // // 访问数据接口地址 + // url: top.$.rootUrl + '/LR_SystemModule/Area/Getlist', + // // 访问数据接口参数 + // param: { parentId: '' }, + //}); + $('#Peoples').lrDataSourceSelect({ code: 'StuInfoBasic', value: 'stuno', text: 'stuname', type: 'multiple' }); + //$('#Teamid').lrUserSelect(1); + $('#Teamid').lrDataSourceSelect({ code: 'Trainteam', value: 'name', text: 'name' }); + //$('#Peoples').lrDataItemSelect({ code: '' }); + $('#Contents')[0].ue = ContentsUE; }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/Ask/Notice_Train_Sum/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]); + } + } + }); + } + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + var postData = { + strEntity: JSON.stringify($('body').lrGetFormData()) + }; + $.lrSaveForm(top.$.rootUrl + '/Ask/Notice_Train_Sum/SaveForm?keyValue=' + keyValue +"&Typeid=" + itemCode, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sum/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sum/Index.cshtml index dd1309a49..de50dd9bb 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sum/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sum/Index.cshtml @@ -49,10 +49,11 @@
-
+
 项目分类 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sum/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sum/Index.js index c5f096309..5f6bd2435 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sum/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_Train_Sum/Index.js @@ -102,6 +102,7 @@ * 描 述:数据字典管理 */ var refreshGird; +var selectedRow; var bootstrap = function ($, learun) { "use strict"; var classify_itemCode = ''; @@ -174,6 +175,21 @@ var bootstrap = function ($, learun) { }); } }); + // 查看 + $('#lr-look').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'formview', + title: '查看', + url: top.$.rootUrl + '/Ask/Notice_Train_Sum/FormView?keyValue=' + keyValue, + width: 1000, + height: 600, + btn: null + }); + } + }); /*分类管理*/ $('#lr_category').on('click', function () { learun.layerForm({ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_compare_Teams/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_compare_Teams/Form.js index 35783fe14..c0d728f88 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_compare_Teams/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_compare_Teams/Form.js @@ -101,7 +101,7 @@ var bootstrap = function ($, learun) { //var postData = {}; //postData.strEntity = $('#form').lrGetFormData(keyValue); - $.lrSaveForm(top.$.rootUrl + '/Ask/Notice_compare_Teams/SaveFormAndSubmit?keyValue=' + keyValue, postData, function (res) { + $.lrSaveForm(top.$.rootUrl + '/Ask/Notice_compare_Teams/SaveForm?keyValue=' + keyValue, postData, function (res) { // 保存成功后才回调 if (!!callBack) { callBack(); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_compare_Teams/FormView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_compare_Teams/FormView.cshtml new file mode 100644 index 000000000..51cf480be --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_compare_Teams/FormView.cshtml @@ -0,0 +1,49 @@ +@{ + ViewBag.Title = "运动队比赛计划"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +@*
+
+
标题*
+ +
+
*@ + +
+
+
公告标题*
+ +
+
+
公告类别*
+
+ +
+
+
发布时间*
+ +
+
+
信息来源
+ +
+
+
来源地址
+ +
+
+
接收部门
+
+
+
+
附件上传
+
+
+
+
公告内容
+
+ @**@ +
+
+@Html.AppendJsFile("/Areas/Ask/Views/Notice_compare_Teams/FormView.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_compare_Teams/FormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_compare_Teams/FormView.js new file mode 100644 index 000000000..ec18da15e --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_compare_Teams/FormView.js @@ -0,0 +1,114 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2023-10-12 10:29 + * 描 述:运动队比赛计划 + */ +//var acceptClick; +//var keyValue = request('keyValue'); +//var bootstrap = function ($, learun) { +// "use strict"; +// var page = { +// init: function () { +// $('.lr-form-wrap').lrscroll(); +// page.bind(); +// page.initData(); +// }, +// bind: function () { +// }, +// initData: function () { +// if (!!keyValue) { +// $.lrSetForm(top.$.rootUrl + '/Ask/Notice_compare_Teams/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]); +// } +// } +// }); +// } +// } +// }; +// // 保存数据 +// acceptClick = function (callBack) { +// if (!$('body').lrValidform()) { +// return false; +// } +// var postData = { +// strEntity: JSON.stringify($('body').lrGetFormData()) +// }; +// $.lrSaveForm(top.$.rootUrl + '/Ask/Notice_compare_Teams/SaveForm?keyValue=' + keyValue, postData, function (res) { +// // 保存成功后才回调 +// if (!!callBack) { +// callBack(); +// } +// }); +// }; +// page.init(); +//} + +var acceptClick; +var keyValue = request('keyValue'); +var bootstrap = function ($, learun) { + "use strict"; + var ue; + var page = { + init: function () { + page.bind(); + page.initData(); + }, + bind: function () { + //公告类别 + $('#T_typename').lrDataItemSelect({ + code: 'Notice_compare_Teams', maxHeight: 230, select: function (item) { + if (item != null && item != undefined) { + $("#T_type").val(item.text); + } + } + }); + $('#Files').lrUploader({ isUpload: false }); + $('#Noticedept').lrDepartmentSelect({ type: 'treemultiple' }); + //内容编辑器 + ue = UE.getEditor('editor'); + }, + initData: function () { + if (!!keyValue) { + //$('#form').lrSetFormData(selectedRow); + //$("#F_ReleaseTime").val(learun.formatDate(selectedRow.F_ReleaseTime, 'yyyy/MM/dd hh:mm')); + $.lrSetForm(top.$.rootUrl + '/Ask/Notice_compare_Teams/GetFormData?keyValue=' + keyValue, function (data) { + $('#form').lrSetFormData(data); + setTimeout(function () { + ue.setContent(data.T_Content); + }, 100); + }); + } + } + }; + acceptClick = function (callBack) { + if (!$('#form').lrValidform()) { + return false; + } + learun.clientdata.getAsync('dataItem', { + key: $("#T_typename").lrselectGet(), + code: 'Notice_compare_Teams', + callback: function (_data) { + $("#T_type").val(_data.text); + + var postData = $('#form').lrGetFormData(keyValue); + postData["T_Content"] = ue.getContent(null, null, true); + //var postData = {}; + //postData.strEntity = $('#form').lrGetFormData(keyValue); + + $.lrSaveForm(top.$.rootUrl + '/Ask/Notice_compare_Teams/SaveFormAndSubmit?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + } + }); + } + page.init(); +} \ No newline at end of file diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_compare_Teams/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_compare_Teams/Index.cshtml index 3de9a07b8..fdd28b415 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_compare_Teams/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_compare_Teams/Index.cshtml @@ -18,10 +18,12 @@
-
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_compare_Teams/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_compare_Teams/Index.js index 1fb98d8b3..2d2665f20 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_compare_Teams/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/Ask/Views/Notice_compare_Teams/Index.js @@ -5,6 +5,7 @@ * 描 述:运动队比赛计划 */ var refreshGirdData; +var selectedRow; var bootstrap = function ($, learun) { "use strict"; var page = { @@ -38,7 +39,12 @@ var bootstrap = function ($, learun) { // 编辑 $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('T_id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); if (learun.checkrow(keyValue)) { + if (selectedRow[0].Status != 0) {//提交 + learun.alert.warning("当前记录已提交!"); + return false; + } learun.layerForm({ id: 'form', title: '编辑', @@ -54,7 +60,12 @@ var bootstrap = function ($, learun) { // 删除 $('#lr_delete').on('click', function () { var keyValue = $('#gridtable').jfGridValue('T_id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); if (learun.checkrow(keyValue)) { + if (selectedRow[0].Status != 0) {//提交 + learun.alert.warning("当前记录已提交!"); + return false; + } learun.layerConfirm('是否确认删除该项!', function (res) { if (res) { learun.deleteForm(top.$.rootUrl + '/Ask/Notice_compare_Teams/DeleteForm', { keyValue: keyValue}, function () { @@ -64,6 +75,45 @@ var bootstrap = function ($, learun) { }); } }); + // 提交 + $('#lr-sub').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('T_id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + if (selectedRow[0].Status > 0) { + learun.alert.warning("当前记录已提交!"); + return false; + } + learun.layerConfirm('是否确认提交该项!', function (res) { + if (res) { + //processId = learun.newGuid(); + learun.postForm(top.$.rootUrl + '/Ask/Notice_compare_Teams/SaveFormAndSubmit', { keyValue: keyValue, status: 1 }, function (res) { + //selectedRow.ProcessId = processId; + refreshGirdData(res, {}); + }); + } + }); + } + }); + // 查看 + $('#lr-look').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('T_id'); + selectedRow = $('#gridtable').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + if (selectedRow[0].Status == 0) { + learun.alert.warning("当前记录未提交,请提交后再查看!"); + return false; + } + learun.layerForm({ + id: 'formview', + title: '查看', + url: top.$.rootUrl + '/Ask/Notice_compare_Teams/FormView?keyValue=' + keyValue, + width: 1000, + height: 600, + btn: null + }); + } + }); }, // 初始化列表 initGird: function () { @@ -91,6 +141,16 @@ var bootstrap = function ($, learun) { } } }, + { + label: "状态", name: "Status", width: 100, align: "left", + formatter: function (cellvalue, row) { + if (cellvalue == 1) { + return '已提交'; + } else { + return '草稿'; + } + } + }, //{ label: "附件上传", name: "Files", width: 100, align: "left"}, //{ label: "内容", name: "T_Content", width: 100, align: "left" }, ], 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 acde77549..9e5ad4e54 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 @@ -931,11 +931,16 @@ + + + + + @@ -8358,6 +8363,11 @@ + + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Notice_Train_Sports/Notice_Train_SportsEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Notice_Train_Sports/Notice_Train_SportsEntity.cs index 6e640ef50..d4e6eb1d8 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Notice_Train_Sports/Notice_Train_SportsEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/Ask/Notice_Train_Sports/Notice_Train_SportsEntity.cs @@ -86,6 +86,10 @@ namespace Learun.Application.TwoDevelopment.Ask public int? Status { get; set; } /// /// Type + /// 1运动员集训安排 + /// 2教练员集训 + /// 3运动队比赛计划 + /// 4于东对集训安排 /// [Column("TYPE")] public string Type { get; set; }