diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeachingPlanController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeachingPlanController.cs new file mode 100644 index 000000000..3665ef9ee --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeachingPlanController.cs @@ -0,0 +1,178 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-10-14 10:09 + /// 描 述:教学计划 + /// + public class TeachingPlanController : MvcControllerBase + { + private TeachingPlanIBLL teachingPlanIBLL = new TeachingPlanBLL(); + private TeachingPlanItemIBLL teachingPlanItemIBLL = new TeachingPlanItemBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + /// + /// 教学计划和课程设置--列表 + /// + /// + [HttpGet] + public ActionResult IndexManage() + { + return View(); + } + /// + /// 教学计划和课程设置--编辑 + /// + /// + [HttpGet] + public ActionResult FormManage() + { + return View(); + } + /// + /// 教学计划和课程设置--查看 + /// + /// + [HttpGet] + public ActionResult FormManageView() + { + return View(); + } + + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = teachingPlanIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageListForManage(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = teachingPlanIBLL.GetPageListForManage(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var TeachingPlanData = teachingPlanIBLL.GetTeachingPlanEntity(keyValue); + var TeachingPlanItemData = teachingPlanItemIBLL.GetListByPlanId(TeachingPlanData.Id); + + var jsonData = new + { + TeachingPlan = TeachingPlanData, + TeachingPlanItem = TeachingPlanItemData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + teachingPlanIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity,string TeachingPlanItemList) + { + TeachingPlanEntity entity = strEntity.ToObject(); + List teachingPlanItemList = new List(); + if (!string.IsNullOrEmpty(TeachingPlanItemList)) + { + teachingPlanItemList = TeachingPlanItemList.ToObject>(); + } + + teachingPlanIBLL.SaveEntity(keyValue, entity, teachingPlanItemList); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeachingPlanItemController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeachingPlanItemController.cs new file mode 100644 index 000000000..6f68f6951 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TeachingPlanItemController.cs @@ -0,0 +1,117 @@ +using Learun.Util; +using System.Data; +using Learun.Application.TwoDevelopment.EducationalAdministration; +using System.Web.Mvc; +using System.Collections.Generic; + +namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers +{ + /// + /// 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架 + /// Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + /// 创 建:超级管理员 + /// 日 期:2021-10-15 10:08 + /// 描 述:教学计划--课程子表 + /// + public class TeachingPlanItemController : MvcControllerBase + { + private TeachingPlanItemIBLL teachingPlanItemIBLL = new TeachingPlanItemBLL(); + + #region 视图功能 + + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult Index() + { + return View(); + } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult Form() + { + return View(); + } + #endregion + + #region 获取数据 + + /// + /// 获取页面显示列表数据 + /// + /// 分页参数 + /// 查询参数 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetPageList(string pagination, string queryJson) + { + Pagination paginationobj = pagination.ToObject(); + var data = teachingPlanItemIBLL.GetPageList(paginationobj, queryJson); + var jsonData = new + { + rows = data, + total = paginationobj.total, + page = paginationobj.page, + records = paginationobj.records + }; + return Success(jsonData); + } + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormData(string keyValue) + { + var TeachingPlanItemData = teachingPlanItemIBLL.GetTeachingPlanItemEntity( keyValue ); + var jsonData = new { + TeachingPlanItem = TeachingPlanItemData, + }; + return Success(jsonData); + } + #endregion + + #region 提交数据 + + /// + /// 删除实体数据 + /// + /// 主键 + /// + [HttpPost] + [AjaxOnly] + public ActionResult DeleteForm(string keyValue) + { + teachingPlanItemIBLL.DeleteEntity(keyValue); + return Success("删除成功!"); + } + /// + /// 保存实体数据(新增、修改) + /// + /// 主键 + /// 实体 + /// + [HttpPost] + [ValidateAntiForgeryToken] + [AjaxOnly] + public ActionResult SaveForm(string keyValue, string strEntity) + { + TeachingPlanItemEntity entity = strEntity.ToObject(); + teachingPlanItemIBLL.SaveEntity(keyValue,entity); + if (string.IsNullOrEmpty(keyValue)) + { + } + return Success("保存成功!"); + } + #endregion + + } +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/Form.cshtml new file mode 100644 index 000000000..209487325 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/Form.cshtml @@ -0,0 +1,35 @@ +@{ + ViewBag.Title = "教学计划"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
名称*
+ +
+
+
年级
+
+
+
+
专业
+
+
+
+
学制
+ +
+
+
总学分
+ +
+
+
启用
+
+
+
+
备注
+ +
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TeachingPlan/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/Form.js new file mode 100644 index 000000000..55eccfa94 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/Form.js @@ -0,0 +1,63 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-10-14 10:09 + * 描 述:教学计划 + */ +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 () { + //年级 + $('#Grade').lrselect({ + url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear', + value: 'value', + text: 'text', + maxHeight: 200 + }); + + $('#Major').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno',text: 'majorname' }); + $('#Enabled').lrRadioCheckbox({ + type: 'radio', + code: 'YesOrNoBit', + }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TeachingPlan/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 + '/EducationalAdministration/TeachingPlan/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/FormManage.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/FormManage.cshtml new file mode 100644 index 000000000..f01bfbe15 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/FormManage.cshtml @@ -0,0 +1,42 @@ +@{ + ViewBag.Title = "教学计划"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
名称*
+ +
+
+
年级
+
+
+
+
专业
+
+
+
+
学制
+ +
+
+
总学分
+ +
+
+
启用
+
+
+
+
备注
+ +
+
+
明细操作
+ +
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TeachingPlan/FormManage.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/FormManage.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/FormManage.js new file mode 100644 index 000000000..4ef2c76d7 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/FormManage.js @@ -0,0 +1,165 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-10-14 10:09 + * 描 述:教学计划 + */ +var acceptClick; +var keyValue = request('keyValue'); +// 设置表单数据 +var setFormData; +// 验证数据是否填写完整 +var validForm; +// 保存数据 +var save; +var refreshGirdData; +var selectedRow; +var tempdatra = new Array(); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + $("#detailedit").on('click', function () { + var keyValue = $('#TeachingPlanItem').jfGridValue('Id'); + selectedRow = $('#TeachingPlanItem').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form_TeachingPlanItem', + title: '编辑明细', + url: top.$.rootUrl + '/EducationalAdministration/TeachingPlanItem/Form?keyValue=' + keyValue, + width: 650, + height: 430, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + page.bind(); + page.initData(); + }, + bind: function () { + //年级 + $('#Grade').lrselect({ + url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear', + value: 'value', + text: 'text', + maxHeight: 200 + }); + + $('#Major').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' }); + $('#Enabled').lrRadioCheckbox({ + type: 'radio', + code: 'YesOrNoBit', + }); + $('#TeachingPlanItem').jfGrid({ + headData: [ + { + label: '课程名称', name: 'LessonNo', width: 100, align: 'left', + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', + key: value, + keyId: 'lessonno', + callback: function (_data) { + callback(_data['lessonname']); + } + }); + } + }, + { + label: '课程学时', name: 'LessonTime', width: 100, align: 'left' + }, + { + label: '执行学期', name: 'Semester', width: 100, align: 'left' + }, + { + label: '周节次', name: 'WeeklyFestival', width: 100, align: 'left' + }, + { + label: '开课起始周', name: 'WeeklyStart', width: 150, align: 'left' + }, + { + label: '开课结束周', name: 'WeeklyEnd', width: 150, align: 'left' + }, + ], + height: 270, + mainId: 'Id' + }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TeachingPlan/GetFormData?keyValue=' + keyValue, function (data) { + for (var id in data) { + if (!!data[id].length && data[id].length > 0) { + $('#' + id).jfGridSet('refreshdata', data[id]); + tempdatra = data[id]; + } + else { + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + } + }; + refreshGirdData = function (temprow) { + + var ifnewrow = true; + $.each(tempdatra, function (key, val) { + if (tempdatra[key].Id === temprow.Id) { + tempdatra[key] = temprow; + ifnewrow = false; + } + }); + if (ifnewrow) { + tempdatra.push(temprow); + } + $('#TeachingPlanItem').jfGridSet('refreshdata', tempdatra); + + }; + + // 验证数据是否填写完整 + validForm = function () { + if (!$('.lr-form-wrap').lrValidform()) { + return false; + } + //var datas = $('#TeachingPlanItem').jfGridGet('rowdatas'); + //if (datas == null || datas.length == 0) { + // learun.alert.warning("申请未包含明细!请先新增明细!"); + // return false; + //} + return true; + }; + //// 保存数据 + //acceptClick = function (callBack) { + // if (!$('body').lrValidform()) { + // return false; + // } + // var postData = { + // strEntity: JSON.stringify($('body').lrGetFormData()) + // }; + // $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TeachingPlan/SaveForm?keyValue=' + keyValue, postData, function (res) { + // // 保存成功后才回调 + // if (!!callBack) { + // callBack(); + // } + // }); + //}; + // 保存数据 + save = function (callBack, i) { + var postData = {}; + var formData = $('[data-table="TeachingPlan"]').lrGetFormData(); + + postData.strEntity = JSON.stringify(formData); + postData.TeachingPlanItemList = JSON.stringify($('#TeachingPlanItem').jfGridGet('rowdatas')); + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TeachingPlan/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(res, formData, i); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/FormManageView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/FormManageView.cshtml new file mode 100644 index 000000000..c6a2c9082 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/FormManageView.cshtml @@ -0,0 +1,38 @@ +@{ + ViewBag.Title = "教学计划"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
名称*
+ +
+
+
年级
+
+
+
+
专业
+
+
+
+
学制
+ +
+
+
总学分
+ +
+
+
启用
+
+
+
+
备注
+ +
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TeachingPlan/FormManageView.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/FormManageView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/FormManageView.js new file mode 100644 index 000000000..4ef2c76d7 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/FormManageView.js @@ -0,0 +1,165 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-10-14 10:09 + * 描 述:教学计划 + */ +var acceptClick; +var keyValue = request('keyValue'); +// 设置表单数据 +var setFormData; +// 验证数据是否填写完整 +var validForm; +// 保存数据 +var save; +var refreshGirdData; +var selectedRow; +var tempdatra = new Array(); +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + $("#detailedit").on('click', function () { + var keyValue = $('#TeachingPlanItem').jfGridValue('Id'); + selectedRow = $('#TeachingPlanItem').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form_TeachingPlanItem', + title: '编辑明细', + url: top.$.rootUrl + '/EducationalAdministration/TeachingPlanItem/Form?keyValue=' + keyValue, + width: 650, + height: 430, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + page.bind(); + page.initData(); + }, + bind: function () { + //年级 + $('#Grade').lrselect({ + url: top.$.rootUrl + '/EducationalAdministration/ClassInfo/GenerateNearByYear', + value: 'value', + text: 'text', + maxHeight: 200 + }); + + $('#Major').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorno', text: 'majorname' }); + $('#Enabled').lrRadioCheckbox({ + type: 'radio', + code: 'YesOrNoBit', + }); + $('#TeachingPlanItem').jfGrid({ + headData: [ + { + label: '课程名称', name: 'LessonNo', width: 100, align: 'left', + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', + key: value, + keyId: 'lessonno', + callback: function (_data) { + callback(_data['lessonname']); + } + }); + } + }, + { + label: '课程学时', name: 'LessonTime', width: 100, align: 'left' + }, + { + label: '执行学期', name: 'Semester', width: 100, align: 'left' + }, + { + label: '周节次', name: 'WeeklyFestival', width: 100, align: 'left' + }, + { + label: '开课起始周', name: 'WeeklyStart', width: 150, align: 'left' + }, + { + label: '开课结束周', name: 'WeeklyEnd', width: 150, align: 'left' + }, + ], + height: 270, + mainId: 'Id' + }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TeachingPlan/GetFormData?keyValue=' + keyValue, function (data) { + for (var id in data) { + if (!!data[id].length && data[id].length > 0) { + $('#' + id).jfGridSet('refreshdata', data[id]); + tempdatra = data[id]; + } + else { + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + } + }; + refreshGirdData = function (temprow) { + + var ifnewrow = true; + $.each(tempdatra, function (key, val) { + if (tempdatra[key].Id === temprow.Id) { + tempdatra[key] = temprow; + ifnewrow = false; + } + }); + if (ifnewrow) { + tempdatra.push(temprow); + } + $('#TeachingPlanItem').jfGridSet('refreshdata', tempdatra); + + }; + + // 验证数据是否填写完整 + validForm = function () { + if (!$('.lr-form-wrap').lrValidform()) { + return false; + } + //var datas = $('#TeachingPlanItem').jfGridGet('rowdatas'); + //if (datas == null || datas.length == 0) { + // learun.alert.warning("申请未包含明细!请先新增明细!"); + // return false; + //} + return true; + }; + //// 保存数据 + //acceptClick = function (callBack) { + // if (!$('body').lrValidform()) { + // return false; + // } + // var postData = { + // strEntity: JSON.stringify($('body').lrGetFormData()) + // }; + // $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TeachingPlan/SaveForm?keyValue=' + keyValue, postData, function (res) { + // // 保存成功后才回调 + // if (!!callBack) { + // callBack(); + // } + // }); + //}; + // 保存数据 + save = function (callBack, i) { + var postData = {}; + var formData = $('[data-table="TeachingPlan"]').lrGetFormData(); + + postData.strEntity = JSON.stringify(formData); + postData.TeachingPlanItemList = JSON.stringify($('#TeachingPlanItem').jfGridGet('rowdatas')); + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TeachingPlan/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(res, formData, i); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/Index.cshtml new file mode 100644 index 000000000..3de085ccb --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/Index.cshtml @@ -0,0 +1,37 @@ +@{ + ViewBag.Title = "教学计划"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
名称
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TeachingPlan/Index.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/Index.js new file mode 100644 index 000000000..743306daa --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/Index.js @@ -0,0 +1,116 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-10-14 10:09 + * 描 述:教学计划 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 新增 + $('#lr_add').on('click', function () { + learun.layerForm({ + id: 'form', + title: '新增', + url: top.$.rootUrl + '/EducationalAdministration/TeachingPlan/Form', + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form', + title: '编辑', + url: top.$.rootUrl + '/EducationalAdministration/TeachingPlan/Form?keyValue=' + keyValue, + width: 600, + height: 400, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 删除 + $('#lr_delete').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res) { + if (res) { + learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TeachingPlan/DeleteForm', { keyValue: keyValue }, function () { + refreshGirdData(); + }); + } + }); + } + }); + // 打印 + $('#lr_print').on('click', function () { + $('#gridtable').jqprintTable(); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/TeachingPlan/GetPageList', + headData: [ + { label: "名称", name: "Name", width: 100, align: "left" }, + { label: "年级", name: "Grade", width: 100, align: "left" }, + { + label: "专业", name: "Major", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + key: value, + keyId: 'majorno', + callback: function (_data) { + callback(_data['majorname']); + } + }); + } + }, + { label: "学制", name: "SchoolSystem", width: 100, align: "left" }, + { label: "总学分", name: "Credit", width: 100, align: "left" }, + { + label: "状态", name: "Enabled", width: 100, align: "left", + formatter: function (value, row) { + return value == 1 + ? "启用" + : "禁用"; + } + }, + { label: "备注", name: "Remark", width: 100, align: "left" }, + ], + mainId: 'Id', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/IndexManage.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/IndexManage.cshtml new file mode 100644 index 000000000..256f5edc4 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/IndexManage.cshtml @@ -0,0 +1,36 @@ +@{ + ViewBag.Title = "教学计划"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+
+
+
+
名称
+ +
+
+
+
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TeachingPlan/IndexManage.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/IndexManage.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/IndexManage.js new file mode 100644 index 000000000..b18b65fa6 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlan/IndexManage.js @@ -0,0 +1,107 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-10-14 10:09 + * 描 述:教学计划 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + $('#multiple_condition_query').lrMultipleQuery(function (queryJson) { + page.search(queryJson); + }, 220, 400); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + //查看 + $('#lr_look').on('click', function () { + learun.layerForm({ + id: 'form', + title: '查看', + url: top.$.rootUrl + '/EducationalAdministration/TeachingPlan/FormManageView', + width: 600, + height: 400, + btn: null, + callBack: function (id) { + //return top[id].acceptClick(refreshGirdData); + } + }); + }); + // 编辑 + $('#lr_edit').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('Id'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'form_FormManage', + title: '编辑', + url: top.$.rootUrl + '/EducationalAdministration/TeachingPlan/FormManage?keyValue=' + keyValue, + width: 1100, + height: 700, + callBack: function (id) { + var res = false; + // 验证数据 + res = top[id].validForm(); + // 保存数据 + if (res) { + res = top[id].save(function () { + page.search(); + }); + } + return res; + //return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + // 打印 + $('#lr_print').on('click', function () { + $('#gridtable').jqprintTable(); + }); + }, + // 初始化列表 + initGird: function () { + $('#gridtable').jfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/TeachingPlan/GetPageListForManage', + headData: [ + { label: "名称", name: "Name", width: 100, align: "left" }, + { label: "年级", name: "Grade", width: 100, align: "left" }, + { + label: "专业", name: "Major", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + key: value, + keyId: 'majorno', + callback: function (_data) { + callback(_data['majorname']); + } + }); + } + }, + { label: "学制", name: "SchoolSystem", width: 100, align: "left" }, + { label: "总学分", name: "Credit", width: 100, align: "left" }, + { label: "公开课", name: "Zyknum", width: 100, align: "left" }, + { label: "专业课", name: "Ggknum", width: 100, align: "left" }, + ], + mainId: 'Id', + isPage: true + }); + page.search(); + }, + search: function (param) { + param = param || {}; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlanItem/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlanItem/Form.cshtml new file mode 100644 index 000000000..328228ab3 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlanItem/Form.cshtml @@ -0,0 +1,32 @@ +@{ + ViewBag.Title = "教学计划--课程子表"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
课程名称
+ + +
+
+
课程学时
+ +
+
+
执行学期
+ +
+
+
周节次
+ +
+
+
开课起始周
+ +
+
+
开课结束周
+ +
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TeachingPlanItem/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlanItem/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlanItem/Form.js new file mode 100644 index 000000000..9be1356dc --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TeachingPlanItem/Form.js @@ -0,0 +1,85 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2021-10-15 10:08 + * 描 述:教学计划--课程子表 + */ +var acceptClick; +var keyValue = request('keyValue'); +var selectedRow; +var bootstrap = function ($, learun) { + "use strict"; + selectedRow = top["layer_form_FormManage"].selectedRow; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#LessonNo').hide(); + }, + initData: function () { + //if (!!keyValue) { + // $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TeachingPlanItem/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]); + // } + // } + // }); + //} + + if (!!keyValue) { + if (!!selectedRow) { + $('#form').lrSetFormData(selectedRow); + + if (!!selectedRow.LessonNo) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'LessonInfo', + key: selectedRow.LessonNo, + keyId: 'lessonno', + callback: function (_data) { + $('#LessonName').val(_data['lessonname']); + } + }); + } + } + } + } + }; + // 保存数据 + acceptClick = function (callBack) { + if (!$('body').lrValidform()) { + return false; + } + //var postData = { + // strEntity: JSON.stringify($('body').lrGetFormData()) + //}; + //$.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TeachingPlanItem/SaveForm?keyValue=' + keyValue, postData, function (res) { + // // 保存成功后才回调 + // if (!!callBack) { + // callBack(); + // } + //}); + + + var postData = $('body').lrGetFormData(); + if (!!keyValue) { + if (!!selectedRow) { + postData.Id = selectedRow.Id; + } + } else { + postData.Id = learun.newGuid(); + } + if (!!callBack) { + callBack(postData); + return true; + } + + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj b/Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj index 3c4192dc4..1e84d69e5 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 @@ -334,6 +334,8 @@ + + @@ -1083,6 +1085,12 @@ + + + + + + @@ -7404,6 +7412,12 @@ + + + + + + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/database.config b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/database.config index 9bf9ddc7d..e8ec2112c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/database.config +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/XmlConfig/database.config @@ -20,13 +20,13 @@ --> - + + + - +