diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookOutController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookOutController.cs index def172da9..b97f9e4b9 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookOutController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookOutController.cs @@ -46,7 +46,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult FormOut() { - ViewBag.BookCode = "RK" + DateTime.Now.ToString("yyyyMMddHHmmss"); + ViewBag.BookCode = "CK" + DateTime.Now.ToString("yyyyMMddHHmmss"); return View(); } /// diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextbookInOutController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextbookInOutController.cs index 4909ea45e..06aa8120d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextbookInOutController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextbookInOutController.cs @@ -38,6 +38,24 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers ViewBag.BookCode = "KC" + DateTime.Now.ToString("yyyyMMddHHmmss"); return View(); } + /// + /// 表单页 + /// + /// + [HttpGet] + public ActionResult FormUse() + { + return View(); + } + /// + /// 主页面 + /// + /// + [HttpGet] + public ActionResult IndexInOut() + { + return View(); + } #endregion #region 获取数据 @@ -91,6 +109,25 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers }; return Success(jsonData); } + + /// + /// 获取表单数据 + /// + /// 主键 + /// + [HttpGet] + [AjaxOnly] + public ActionResult GetFormUseData(string keyValue) + { + var TextBookInOutData = textbookInOutIBLL.GetEntity(keyValue); + var TextBookInOutDetailData = textbookInOutIBLL.GetInOrOutEntity(TextBookInOutData.BookCode); + var jsonData = new + { + TextBookInOut = TextBookInOutData, + TextBookInOrOut = TextBookInOutDetailData, + }; + return Success(jsonData); + } #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/FormDelete.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/FormDelete.js index 68bb22f01..d6a277dca 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/FormDelete.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/FormDelete.js @@ -51,7 +51,6 @@ var bootstrap = function ($, learun) { if (res) { learun.deleteForm(top.$.rootUrl + '/EducationalAdministration/TextBookIn/DeleteForm', { keyValue: NewkeyValue }, function () { refreshGirdData(); - learun.layerClose(window.name); }); } }); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookOut/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookOut/Form.js index af6dc2ae5..786bf7c40 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookOut/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookOut/Form.js @@ -50,6 +50,7 @@ var bootstrap = function ($, learun) { } }); $('#TextBookOut').jfGridSet('refreshdata', tempdatra); + learun.layerClose(window.name); top.layer.close(index); } }); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/FormUse.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/FormUse.cshtml new file mode 100644 index 000000000..556f5ccbe --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/FormUse.cshtml @@ -0,0 +1,51 @@ +@{ + ViewBag.Title = "教材库存表"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
库存单
+ +
+
+
课程
+
+
+
+
所选书籍
+ +
+
+
出版号
+ +
+
+
作者
+ +
+
+
其他作者
+ +
+
+
出版社
+ +
+
+
版次
+ +
+
+
当前库存
+ +
+
+
备注
+ +
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookInOut/FormUse.js") + diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/FormUse.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/FormUse.js new file mode 100644 index 000000000..f9d146cb1 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/FormUse.js @@ -0,0 +1,97 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-03-02 10:37 + * 描 述:教材库存表 + */ +var acceptClick; +var keyValue = request('keyValue'); +// 设置权限 +var setAuthorize; +// 设置表单数据 +var setFormData; +// 验证数据是否填写完整 +var validForm; +// 保存数据 +var save; +var selectedRow; +var refreshGirdData; +var tempdatra = new Array(); + +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); + $('#TextBookInOrOut').jfGrid({ + headData: [ + { label: '出/入库', name: 'CKORRK', width: 180, align: 'left' }, + { label: '库存单', name: 'InorOut', width: 180, align: 'left' }, + { label: '出库单', name: 'BookCode', width: 180, align: 'left' }, + { label: '出/入库数量', name: 'variate', width: 100, align: 'left' }, + { label: '出库时间', name: 'CreateTime', width: 200, align: 'left' }, + { label: '出库用户', name: 'CrateUserID', width: 100, align: 'left' }, + { label: '备注', name: 'Remark', width: 100, align: 'left' }, + ], + height: 400, + mainId: 'CreateTime desc', + reloadSelected: false, + }); + }, + initData: function () { + if (!!keyValue) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookInOut/GetFormUseData?keyValue=' + keyValue, function (data) { + console.log(data,123123) + 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); + } + + $('#TextBookInOrOut').jfGridSet('refreshdata', tempdatra); + }; + // 设置表单数据 + setFormData = function (processId, param, callback) { + if (!!processId) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookOut/GetFormData?processId=' + processId, function (data) { + for (var id in data) { + if (!!data[id] && data[id].length > 0) { + $('#' + id).jfGridSet('refreshdata', data[id]); + } + else { + if (id == 'TextBookInOrOut' && data[id]) { + keyValue = data[id].ID; + } + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + callback && callback(); + } + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/IndexInOut.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/IndexInOut.cshtml new file mode 100644 index 000000000..319b8018f --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/IndexInOut.cshtml @@ -0,0 +1,30 @@ +@{ + ViewBag.Title = "教材库存表"; + Layout = "~/Views/Shared/_Index.cshtml"; +} +
+
+
+
+
+
+ +
+
+  查询 +
+
+
+
+ +
+ +
+
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookInOut/IndexInOut.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/IndexInOut.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/IndexInOut.js new file mode 100644 index 000000000..5675d2c7d --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextbookInOut/IndexInOut.js @@ -0,0 +1,92 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-03-02 10:37 + * 描 述:教材库存表 + */ +var refreshGirdData; +var bootstrap = function ($, learun) { + "use strict"; + var page = { + init: function () { + page.initGird(); + page.bind(); + }, + bind: function () { + // 查询 + $('#btn_Search').on('click', function () { + var keyword = $('#txt_Keyword').val(); + page.search({ keyword: keyword }); + }); + $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); + // 刷新 + $('#lr_refresh').on('click', function () { + location.reload(); + }); + // 查看 + $('#lr_view').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'formview', + title: '查看', + url: top.$.rootUrl + '/EducationalAdministration/TextBookInOut/FormUse?keyValue=' + keyValue, + width: 1000, + height: 700, + btn: null, + }); + } + }); + }, + initGird: function () { + $('#gridtable').lrAuthorizeJfGrid({ + url: top.$.rootUrl + '/EducationalAdministration/TextBookInOut/GetPageList', + headData: [ + { label: '库存单号', name: 'BookCode', width: 200, align: "left" }, + { + 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: 'TextBookName', width: 200, align: "left" }, + { label: '教材号', name: 'TextBookNo', width: 200, align: "left" }, + { label: '出版号', name: 'PublishNo', width: 200, align: "left" }, + { label: '第一作者', name: 'FirstAuthor', width: 200, align: "left" }, + { label: '其他作者', name: 'OtherAuthor', width: 200, align: "left" }, + //{ label: '出版日期', name: 'Pubdate', width: 200, align: "left" }, + { label: '出版社', name: 'Publisher', width: 200, align: "left" }, + { label: '版次', name: 'Edition', width: 200, align: "left" }, + { label: '印次', name: 'Impression', width: 200, align: "left" }, + { label: '创建人', name: 'CreateTime', width: 200, align: "left" }, + { label: '创建用户', name: 'CrateUserID', width: 200, align: "left" }, + { label: '修改人', name: 'UpTime', width: 200, align: "left" }, + { label: '修改用户', name: 'UpUserID', width: 200, align: "left" }, + { label: '当前数量', name: 'FinallyNum', width: 200, align: "left" }, + { label: '备注', name: 'Remark', width: 200, align: "left" }, + + ], + mainId: 'ID', + isPage: true, + sidx: 'CreateTime desc' + }); + page.search(); + }, + search: function (param) { + param = param || {}; + param.SqlParameter = 'and IsDel = 0 '; + $('#gridtable').jfGridSet('reload', { queryJson: JSON.stringify(param) }); + } + }; + refreshGirdData = function () { + $('#gridtable').jfGridSet('reload'); + }; + 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 6713a49cf..0a4e53fd2 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 @@ -1179,6 +1179,8 @@ + + @@ -7628,6 +7630,8 @@ + + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutBLL.cs index 6549fa0d3..1569dea65 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutBLL.cs @@ -114,7 +114,29 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - + /// + /// 获取KC实体数据 + /// + /// 主键 + /// + public IEnumerable GetInOrOutEntity(string keyValue) + { + try + { + return textbookInOutService.GetInOrOutEntity(keyValue); + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowBusinessException(ex); + } + } + } #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutEntity.cs index 8374b2990..645228264 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutEntity.cs @@ -146,7 +146,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// [Column("ISSUBMIT")] public int? IsSubmit { get; set; } - + + /// + /// 出库货入库 + /// + [NotMapped] + public string CKORRK { get; set; } #endregion #region 扩展操作 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutIBLL.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutIBLL.cs index 270cb4693..41509ec3b 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutIBLL.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutIBLL.cs @@ -40,6 +40,12 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// 主键 /// TextbookInOutEntity GetKCEntity(string keyValue); + /// + /// 使用明细 + /// + /// + /// + IEnumerable GetInOrOutEntity(string keyValue); #endregion #region 提交数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutService.cs index 82c4f37a2..320211875 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextbookInOut/TextbookInOutService.cs @@ -4,6 +4,7 @@ using Learun.Util; using System; using System.Collections.Generic; using System.Data; +using System.Linq; using System.Text; namespace Learun.Application.TwoDevelopment.EducationalAdministration @@ -125,7 +126,59 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration } } } - + /// + /// 获取实体数据 + /// + /// 主键 + /// + public IEnumerable GetInOrOutEntity(string keyValue) + { + try + { + List returnList = new List(); + TextbookInOutEntity InOutList = new TextbookInOutEntity(); + List InEntity = this.BaseRepository("CollegeMIS").FindList(x => x.InOutCode == keyValue).ToList(); + List OutEntity = this.BaseRepository("CollegeMIS").FindList(x => x.InOutCode == keyValue).ToList(); + if (InEntity.Count() > 0 || OutEntity.Count() > 0) + { + for (int i = 0; i < InEntity.Count(); i++) + { + InOutList.CKORRK = "入库"; + InOutList.InorOut = InEntity[i].InOutCode; + InOutList.BookCode = InEntity[i].BookCode; + InOutList.variate = InEntity[i].variate; + InOutList.CreateTime = InEntity[i].CreateTime; + InOutList.CrateUserID = InEntity[i].CrateUserID; + InOutList.Remark = InEntity[i].Remark; + returnList.Add(InOutList); + } + for (int j = 0; j < OutEntity.Count(); j++) + { + InOutList.CKORRK = "出库"; + InOutList.InorOut = OutEntity[j].InOutCode; + InOutList.BookCode = OutEntity[j].BookCode; + InOutList.variate = OutEntity[j].Variate; + InOutList.CreateTime = InEntity[j].CreateTime; + InOutList.CrateUserID = InEntity[j].CrateUserID; + InOutList.Remark = OutEntity[j].Remark; + returnList.Add(InOutList); + } + returnList.OrderBy(x => x.CreateTime); + } + return returnList; + } + catch (Exception ex) + { + if (ex is ExceptionEx) + { + throw; + } + else + { + throw ExceptionEx.ThrowServiceException(ex); + } + } + } #endregion #region 提交数据