From c35392361c420c23017852e91ea05f77e05f3f31 Mon Sep 17 00:00:00 2001 From: ndbs Date: Fri, 4 Mar 2022 16:33:09 +0800 Subject: [PATCH] =?UTF-8?q?=E6=95=99=E6=9D=90=E5=85=A5=E5=BA=93=E6=98=8E?= =?UTF-8?q?=E7=BB=86=E6=9F=A5=E7=9C=8B?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../Controllers/TextBookInController.cs | 14 ++- .../Views/TextBookIn/FormView.cshtml | 50 ++++++++ .../Views/TextBookIn/FormView.js | 117 ++++++++++++++++++ .../Views/TextBookIn/Index.cshtml | 1 + .../Views/TextBookIn/Index.js | 16 ++- .../Learun.Application.Web.csproj | 2 + 6 files changed, 197 insertions(+), 3 deletions(-) create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/FormView.cshtml create mode 100644 Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/FormView.js diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookInController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookInController.cs index af0e99ca0..5f756e976 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookInController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookInController.cs @@ -49,6 +49,16 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers ViewBag.BookCode = "RK" + DateTime.Now.ToString("yyyyMMddHHmmss"); return View(); } + /// + /// 明细查看 + /// + /// + [HttpGet] + public ActionResult FormView() + { + return View(); + } + #endregion #region 获取数据 @@ -84,12 +94,12 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult GetFormData(string keyValue) { var TextBookInOutData = textBookInOutIBLL.GetKCEntity(keyValue); - //var TextBookInData = textBookInIBLL.GetInEntity(TextBookInOutData.BookCode); + var TextBookInData = textBookInIBLL.GetInEntity(TextBookInOutData.BookCode); var jsonData = new { TextBookInOut = TextBookInOutData, - //TextBookIn = TextBookInData, + TextBookIn = TextBookInData, }; return Success(jsonData); } diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/FormView.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/FormView.cshtml new file mode 100644 index 000000000..13e3cba93 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/FormView.cshtml @@ -0,0 +1,50 @@ +@{ + ViewBag.Title = "教材库存表"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +
+
+
库存单
+ +
+
+
课程
+
+
+
+
所选书籍
+ +
+
+
出版号
+ +
+
+
作者
+ +
+
+
其他作者
+ +
+
+
出版社
+ +
+
+
版次
+ +
+
+
当前库存
+ +
+
+
备注
+ +
+
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookIn/FormView.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/FormView.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/FormView.js new file mode 100644 index 000000000..05a7074ae --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/FormView.js @@ -0,0 +1,117 @@ +/* * 版 本 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"; + // 设置权限 + setAuthorize = function (data) { + }; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + page.bind(); + page.initData(); + }, + bind: function () { + $('#LessonNo').lrDataSourceSelect({ code: 'LessonInfo', value: 'lessonno', text: 'lessonname' }); + $('#TextBookIn').jfGrid({ + headData: [ + { 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/TextBookIn/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]); + } + } + }); + } + } + }; + refreshGirdData = function (temprow) { + var ifnewrow = true; + $.each(tempdatra, function (key, val) { + if (tempdatra[key].BookCode === temprow.InOutBook) { + tempdatra[key] = temprow; + ifnewrow = false; + } + }); + if (ifnewrow) { + tempdatra.push(temprow); + } + + $('#TextBookIn').jfGridSet('refreshdata', tempdatra); + }; + // 设置表单数据 + setFormData = function (processId, param, callback) { + if (!!processId) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookIn/GetFormDataByProcessId?processId=' + processId, function (data) { + for (var id in data) { + if (!!data[id] && data[id].length > 0) { + $('#' + id).jfGridSet('refreshdata', data[id]); + } + else { + if (id == 'TextBookIn' && data[id]) { + keyValue = data[id].ID; + } + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + } + // 验证数据是否填写完整 + validForm = function () { + var datas = $('#TextBookIn').jfGridGet('rowdatas'); + if (datas == null || datas.length == 0) { + learun.alert.warning("申请未包含入库申请!请先添加入库申请!"); + return false; + } + return true; + }; + // 保存数据 + save = function (callBack) { + var postData = {}; + var formData = $('[data-table="TextBookInOut"]').lrGetFormData(); + postData.strEntity = JSON.stringify(formData); + postData.strTextBookInList = JSON.stringify($('#TextBookIn').jfGridGet('rowdatas')); + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TextBookIn/SaveForm?keyValue=' + keyValue, postData, function (res) { + // 保存成功后才回调 + if (!!callBack) { + callBack(); + } + }); + }; + page.init(); +} diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/Index.cshtml index 6b7d635ab..ac1e680f3 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/Index.cshtml @@ -24,6 +24,7 @@ diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/Index.js index 02e4d8de3..8a2490d8a 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIn/Index.js @@ -20,7 +20,7 @@ var bootstrap = function ($, learun) { $('#lr_refresh').on('click', function () { location.reload(); }); - // 编辑 + // 入库 $('#lr_edit').on('click', function () { var keyValue = $('#gridtable').jfGridValue('ID'); if (learun.checkrow(keyValue)) { @@ -45,6 +45,20 @@ var bootstrap = function ($, learun) { }); } }); + // 查看 + $('#lr_view').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'formview', + title: '查看', + url: top.$.rootUrl + '/EducationalAdministration/TextBookIn/FormView?keyValue=' + keyValue, + width: 1000, + height: 700, + btn: null, + }); + } + }); }, // 初始化列表 initGird: function () { 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 c0ecb02a2..a6dc13ab8 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 @@ -1178,6 +1178,7 @@ + @@ -7613,6 +7614,7 @@ +