From 1c3baa7a209919596f38ac6c2d4ea44d998196a3 Mon Sep 17 00:00:00 2001 From: zhangli <1109134334@qq.com> Date: Thu, 3 Mar 2022 14:16:37 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E6=9D=90=E5=BE=81=E8=AE=A2=E7=AE=A1?= =?UTF-8?q?=E7=90=86?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/TextBookSolSubController.cs | 14 ++- .../Views/TextBookSolSub/Form.cshtml | 79 +++++++++++- .../Views/TextBookSolSub/Form.js | 49 ++++++++ .../Views/TextBookSolSub/Index.cshtml | 32 ++++- .../Views/TextBookSolSub/Index.js | 118 +++++++++++++++--- .../TextBookSolSub/TextBookSolSubService.cs | 3 +- .../TextBookSolSubDetailBLL.cs | 19 +++ .../TextBookSolSubDetailIBLL.cs | 5 + .../TextBookSolSubDetailService.cs | 23 +++- 9 files changed, 311 insertions(+), 31 deletions(-) diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookSolSubController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookSolSubController.cs index 45af6f617..afb09a1f3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookSolSubController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookSolSubController.cs @@ -16,6 +16,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public class TextBookSolSubController : MvcControllerBase { private TextBookSolSubIBLL textBookSolSubIBLL = new TextBookSolSubBLL(); + private TextBookSolSubDetailIBLL textBookSolSubDetailIBLL = new TextBookSolSubDetailBLL(); #region 视图功能 @@ -26,7 +27,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult Index() { - return View(); + return View(); } /// /// 表单页 @@ -35,7 +36,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult Form() { - return View(); + return View(); } #endregion @@ -71,9 +72,12 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [AjaxOnly] public ActionResult GetFormData(string keyValue) { - var TextBookSolSubData = textBookSolSubIBLL.GetTextBookSolSubEntity( keyValue ); - var jsonData = new { + var TextBookSolSubData = textBookSolSubIBLL.GetTextBookSolSubEntity(keyValue); + var textBookSolSubDetailData = textBookSolSubDetailIBLL.GetListBySolSubId(TextBookSolSubData.ID); + var jsonData = new + { TextBookSolSub = TextBookSolSubData, + TextBookSolSubDetail = textBookSolSubDetailData }; return Success(jsonData); } @@ -105,7 +109,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { TextBookSolSubEntity entity = strEntity.ToObject(); - textBookSolSubIBLL.SaveEntity(keyValue,entity); + textBookSolSubIBLL.SaveEntity(keyValue, entity); if (string.IsNullOrEmpty(keyValue)) { } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookSolSub/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookSolSub/Form.cshtml index 1dfce774e..4f80507f9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookSolSub/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookSolSub/Form.cshtml @@ -3,9 +3,82 @@ Layout = "~/Views/Shared/_Form.cshtml"; }
-
-
文本框
- +
+
专业部
+
+
+
+
专业
+
+
+
+
课程
+
+
+
+
学年
+
+
+
+
学期
+
+
+
+
所选书籍
+ +
+
+
书籍
+ +
+
+
单价
+ +
+
+
作者
+ +
+
+
其他作者
+ +
+
+
出版社
+ +
+
+
版次
+ +
+
+
订购数量
+ +
+
+
备注
+ +
+ + + + @*
+
明细操作
+ + + +
*@ +
+
@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookSolSub/Form.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookSolSub/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookSolSub/Form.js index e020d1994..a9d612627 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookSolSub/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookSolSub/Form.js @@ -15,6 +15,55 @@ var bootstrap = function ($, learun) { page.initData(); }, bind: function () { + $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); + $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorname', text: 'majorname' }); + $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); + $('#AcademicYearNo').lrselect({ + placeholder: "请选择学年", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/GetAcademicYear', + value: 'value', + text: 'text' + }); + //学期 + $('#Semester').lrselect({ + placeholder: "请选择学期", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', + value: 'value', + text: 'text' + }); + $('#TextBookSolSubDetail').jfGrid({ + headData: [ + { + label: "班级", name: "ClassNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'bjsj', + key: value, + keyId: 'classno', + callback: function (_data) { + callback(_data['classname']); + } + }); + } + }, + { label: '教师人数', name: 'TeachSum', width: 80, align: 'left' }, + { label: '学生人数', name: 'StuSum', width: 80, align: 'left' }, + { label: '备注', name: 'Remark', width: 100, align: 'left' }, + ], + height: 400, + mainId: 'ID,IndentID', + reloadSelected: false, + }); + + $('#CreateTime').val(learun.formatDate(new Date(), 'yyyy-MM-dd hh:mm:ss')); + $('#CreateUserID')[0].lrvalue = learun.clientdata.get(['userinfo']).userId; + $('#CreateUserID').val(learun.clientdata.get(['userinfo']).realName); + + + + }, initData: function () { if (!!keyValue) { diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookSolSub/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookSolSub/Index.cshtml index 5ace2861e..8ff3803be 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookSolSub/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookSolSub/Index.cshtml @@ -7,13 +7,43 @@
+
+
+
+
+
专业部
+
+
+
+
专业
+
+
+
+
课程
+
+
+
+
学年
+
+
+
+
学期
+
+
+
+
书籍
+ +
+
+
+
-  新增 + @* 新增*@  编辑  删除  打印 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookSolSub/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookSolSub/Index.js index b918a3e4d..4e4dc36df 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookSolSub/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookSolSub/Index.js @@ -13,23 +13,30 @@ var bootstrap = function ($, learun) { page.bind(); }, bind: function () { + $('#DeptNo').lrDataSourceSelect({ code: 'CdDeptInfo', value: 'deptno', text: 'deptname' }); + $('#MajorNo').lrDataSourceSelect({ code: 'CdMajorInfo', value: 'majorname', text: 'majorname' }); + $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); + $('#ClassNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); + $('#AcademicYearNo').lrselect({ + placeholder: "请选择学年", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetAcademicYearNo', + value: 'value', + text: 'text' + }); + //学期 + $('#Semester').lrselect({ + placeholder: "请选择学年", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', + value: 'value', + text: 'text' + }); // 刷新 $('#lr_refresh').on('click', function () { location.reload(); }); - // 新增 - $('#lr_add').on('click', function () { - learun.layerForm({ - id: 'form', - title: '新增', - url: top.$.rootUrl + '/EducationalAdministration/TextBookSolSub/Form', - width: 600, - height: 400, - callBack: function (id) { - return top[id].acceptClick(refreshGirdData); - } - }); - }); + // 编辑 $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); @@ -38,8 +45,8 @@ var bootstrap = function ($, learun) { id: 'form', title: '编辑', url: top.$.rootUrl + '/EducationalAdministration/TextBookSolSub/Form?keyValue=' + keyValue, - width: 600, - height: 400, + width: 1000, + height: 700, callBack: function (id) { return top[id].acceptClick(refreshGirdData); } @@ -66,12 +73,87 @@ var bootstrap = function ($, learun) { }, // 初始化列表 initGird: function () { - $('#gridtable').lrAuthorizeJfGrid({ + $('#gridtable').jfGrid({ url: top.$.rootUrl + '/EducationalAdministration/TextBookSolSub/GetPageList', headData: [ - { label: "文本框", name: "DeptNo", width: 100, align: "left"}, + //{ label: "主键", name: "ID", width: 200, align: "left" }, + { + label: "专业部", name: "DeptNo", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdDeptInfo', + key: value, + keyId: 'deptno', + callback: function (_data) { + callback(_data['deptname']); + } + }); + } + }, + { + label: "专业", name: "MajorNo", width: 120, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('custmerData', { + url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'CdMajorInfo', + key: value, + keyId: 'majorname', + callback: function (_data) { + callback(_data['majorname']); + } + }); + } + }, + { + label: "课程", name: "LessonNo", width: 150, 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: "AcademicYearNo", width: 100, align: "left" }, + { label: "学期", name: "Semester", width: 100, align: "left" }, + { label: "教材名称", name: "TextBookName", width: 200, align: "left" }, + { label: "书号(物料号)", name: "PublishNo", width: 150, align: "left" }, + { label: "作者", name: "FirstAuthor", width: 100, align: "left" }, + { label: "其他作者", name: "OtherAuthor", width: 150, align: "left" }, + { label: "出版社", name: "Publisher", width: 100, align: "left" }, + { label: "版次", name: "Edition", width: 100, align: "left" }, + { label: "单价", name: "Price", width: 100, align: "left" }, + { label: "订购数量", name: "OrderNum", width: 100, align: "left" }, + { label: "备注", name: "Remark", width: 200, align: "left" }, + //{ + // label: "状态", name: "Status", width: 100, align: "left", + // formatter: function (cellvalue) { + // if (cellvalue == '0') { + // return '草稿'; + // } else if (cellvalue == '1') { + // return '审批中'; + // } else if (cellvalue == '2') { + // return '审批通过'; + // } + // } + //}, + { label: "录入时间", name: "CreateTime", width: 100, align: "left" }, + { + label: "创建用户", name: "CreateUserID", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('user', { + key: value, + callback: function (_data) { + callback(_data.name); + } + }); + } + }, ], - mainId:'ID', + mainId: 'ID', + sidx: 'CreateTime desc,Status desc', isPage: true }); page.search(); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSub/TextBookSolSubService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSub/TextBookSolSubService.cs index 34faa40a4..5d6480400 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSub/TextBookSolSubService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSub/TextBookSolSubService.cs @@ -32,8 +32,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration var strSql = new StringBuilder(); strSql.Append("SELECT "); strSql.Append(@" - t.ID, - t.DeptNo + t.* "); strSql.Append(" FROM TextBookSolSub t "); strSql.Append(" WHERE 1=1 "); diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSubDetail/TextBookSolSubDetailBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSubDetail/TextBookSolSubDetailBLL.cs index 2a0dc6893..8ce3bb23f 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSubDetail/TextBookSolSubDetailBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSubDetail/TextBookSolSubDetailBLL.cs @@ -43,6 +43,25 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } + public IEnumerable GetListBySolSubId(string SolSubId) + { + try + { + return textBookSolSubDetailService.GetListBySolSubId(SolSubId); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } + /// /// 获取TextBookSolSubDetail表实体数据 /// diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSubDetail/TextBookSolSubDetailIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSubDetail/TextBookSolSubDetailIBLL.cs index b5eedb38d..b014fe3a3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSubDetail/TextBookSolSubDetailIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSubDetail/TextBookSolSubDetailIBLL.cs @@ -22,6 +22,11 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// IEnumerable GetPageList(Pagination pagination, string queryJson); /// + /// 获取页面显示列表数据 + /// + /// + IEnumerable GetListBySolSubId(string SolSubId); + /// /// 获取TextBookSolSubDetail表实体数据 /// /// 主键 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSubDetail/TextBookSolSubDetailService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSubDetail/TextBookSolSubDetailService.cs index b4cfa8704..dd488890b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSubDetail/TextBookSolSubDetailService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookSolSubDetail/TextBookSolSubDetailService.cs @@ -40,7 +40,26 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration var queryParam = queryJson.ToJObject(); // 虚拟参数 var dp = new DynamicParameters(new { }); - return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(),dp, pagination); + return this.BaseRepository("CollegeMIS").FindList(strSql.ToString(), dp, pagination); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } + + public IEnumerable GetListBySolSubId(string SolSubId) + { + try + { + return this.BaseRepository("CollegeMIS").FindList(x => x.SolSubId == SolSubId); } catch (Exception ex) { @@ -91,7 +110,7 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration { try { - this.BaseRepository("CollegeMIS").Delete(t=>t.ID == keyValue); + this.BaseRepository("CollegeMIS").Delete(t => t.ID == keyValue); } catch (Exception ex) {