diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookIndentController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookIndentController.cs index f613d8304..45cb1edfd 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookIndentController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/TextBookIndentController.cs @@ -57,7 +57,16 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers { return View(); } - + /// + /// 查看 + /// + /// + [HttpGet] + public ActionResult FormLook() + { + return View(); + } + #endregion #region 获取数据 diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Form.cshtml index a0f5518b7..7ec9dccb7 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Form.cshtml @@ -27,7 +27,7 @@
所选书籍*
-
+
书籍
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormLook.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormLook.cshtml new file mode 100644 index 000000000..faadce165 --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormLook.cshtml @@ -0,0 +1,74 @@ +@{ + ViewBag.Title = "教材订单管理"; + Layout = "~/Views/Shared/_Form.cshtml"; +} +@Html.AppendCssFile("/Views/LR_Content/plugin/layerselect/lr-layerselect.css") +@Html.AppendJsFile("/Views/LR_Content/plugin/layerselect/lr-layerselect.js") +
+
+
专业部*
+
+
+
+
专业*
+
+
+
+
课程*
+
+
+
+
学年*
+
+
+
+
学期*
+
+
+
+
所选书籍*
+
+
+
+
书籍
+ +
+
+
作者
+ +
+
+
其他作者
+ +
+
+
订购数量
+ +
+
+
备注
+ +
+ + + + @*
+
明细操作
+ + + +
*@ +
+
+
+
+@Html.AppendJsFile("/Areas/EducationalAdministration/Views/TextBookIndent/FormLook.js") diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormLook.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormLook.js new file mode 100644 index 000000000..6f0f00b3b --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/FormLook.js @@ -0,0 +1,270 @@ +/* * 版 本 Learun-ADMS V7.0.6 力软敏捷开发框架(http://www.learun.cn) + * Copyright (c) 2013-2020 力软信息技术(苏州)有限公司 + * 创建人:超级管理员 + * 日 期:2022-02-18 14:27 + * 描 述:教材订单管理 + */ +var acceptClick; +var keyValue = request('keyValue'); +// 设置权限 +var setAuthorize; +// 设置表单数据 +var setFormData; +// 验证数据是否填写完整 +var validForm; +// 保存数据 +var save; +var selectedRow; +var refreshGirdData; +var tempdatra = new Array(); +var order = 0; + +var bootstrap = function ($, learun) { + "use strict"; + // 设置权限 + setAuthorize = function (data) { + }; + var page = { + init: function () { + $('.lr-form-wrap').lrscroll(); + $("#detailadd").on('click', function () { + selectedRow = null; + learun.layerForm({ + id: 'formTextBookIndentDetail', + title: '新增明细', + url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/FormDetail', + width: 600, + height: 350, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + }); + $("#detailedit").on('click', function () { + var keyValue = $('#TextBookIndentDetail').jfGridValue('ID'); + selectedRow = $('#TextBookIndentDetail').jfGridGet('rowdata'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'formTextBookIndentDetail', + title: '编辑明细', + url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/FormDetail?keyValue=' + keyValue, + width: 600, + height: 350, + callBack: function (id) { + return top[id].acceptClick(refreshGirdData); + } + }); + } + }); + $("#detaildel").on('click', function () { + var keyValue = $('#TextBookIndentDetail').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerConfirm('是否确认删除该项!', function (res, index) { + if (res) { + order = 0; + $.each(tempdatra, function (key, val) { + if (tempdatra[key].ID === keyValue) { + // order -= tempdatra[key].TeachSum + tempdatra[key].StuSum; + tempdatra.splice(key, 1); + } else { + order += (parseInt(tempdatra[key].TeachSum) + parseInt(tempdatra[key].StuSum)); + } + }); + $("#OrderNum").val(order); + $('#TextBookIndentDetail').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); + top.layer.close(index); + } + }); + } + }); + page.bind(); + 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/EADateArrange/GetAcademicYearNo', + value: 'value', + text: 'text' + }); + //学期 + $('#Semester').lrselect({ + placeholder: "请选择学年", + allowSearch: true, + url: top.$.rootUrl + '/EducationalAdministration/EADateArrange/GetSemester', + value: 'value', + text: 'text' + }); + $('#TextBookIndentDetail').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, + }); + $('#TextBookName').lrGirdSelect({ + url: top.$.rootUrl + '/LR_SystemModule/DataSource/GetDataTable?code=TextBookInfo', + param: { strWhere: " IsDel = '0' and IsValid ='true' " }, + height: 800, + width: 1100, + selectWord: 'textbookname', + value: 'textbookname', + text: 'textbookname', + headData: + [ + { label: "教材号", name: "publishno", width: 150, align: "left" }, + { label: "教材名称", name: "textbookname", width: 150, align: "left" }, + { label: "作者", name: "firstauthor", width: 150, align: "left" }, + { label: "其他作者", name: "otherauthor", width: 100, align: "left" }, + { label: "出版社", name: "publisher", width: 100, align: "left" }, + { + label: "教材类型", name: "textbooktype", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'TextBookType', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { + label: "教材性质", name: "textbooknature", width: 100, align: "left", + formatterAsync: function (callback, value, row, op, $cell) { + learun.clientdata.getAsync('dataItem', { + key: value, + code: 'TextBookNature', + callback: function (_data) { + callback(_data.text); + } + }); + } + }, + { label: "价格", name: "price", width: 50, align: "left" }, + { label: "版次", name: "edition", width: 100, align: "left" }, + { label: "印次", name: "impression", width: 100, align: "left" }, + ], + select: function (item) { + ////赋值 + $("#PublishNo").val(item.publishno); + $("#FirstAuthor").val(item.firstauthor); + $("#TextBookName").val(item.textbookname); + $("#OtherAuthor").val(item.otherauthor); + } + }); + $('#Status').val(0); + $('#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) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookIndent/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]); + //if (data[id].AAPrice) { + // pricecount = data[id].AAPrice; + //} + } + } + }); + } + } + }; + 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); + } + //订购数量 + order = 0; + for (var i = 0; i < tempdatra.length; i++) { + order += (parseInt(tempdatra[i].TeachSum) + parseInt(tempdatra[i].StuSum)); + } + $("#OrderNum").val(order); + + $('#TextBookIndentDetail').jfGridSet('refreshdata', tempdatra.sort(sortNumber)); + }; + function sortNumber(a, b) { + return a.StuSum - b.StuSum; + } + // 设置表单数据 + setFormData = function (processId, param, callback) { + if (!!processId) { + $.lrSetForm(top.$.rootUrl + '/EducationalAdministration/TextBookIndent/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 == 'TextBookIndent' && data[id]) { + keyValue = data[id].ID; + } + $('[data-table="' + id + '"]').lrSetFormData(data[id]); + } + } + }); + } + } + // 验证数据是否填写完整 + validForm = function () { + if (!$('.lr-form-wrap').lrValidform()) { + return false; + } + var datas = $('#TextBookIndentDetail').jfGridGet('rowdatas'); + if (datas == null || datas.length == 0) { + learun.alert.warning("申请未包含明细!请先新增明细!"); + return false; + } + return true; + }; + // 保存数据 + save = function (processId, callBack, i) { + var postData = {}; + var formData = $('[data-table="TextBookIndent"]').lrGetFormData(); + if (!!processId) { + formData.processId = processId; + } + postData.strEntity = JSON.stringify(formData); + postData.strTextBookIndentDetailList = JSON.stringify($('#TextBookIndentDetail').jfGridGet('rowdatas')); + $.lrSaveForm(top.$.rootUrl + '/EducationalAdministration/TextBookIndent/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/TextBookIndent/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Index.cshtml index fbe2f4938..73542121d 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Index.cshtml @@ -50,6 +50,7 @@  编辑  删除   提交 +  查看
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Index.js index ada747980..586d10e3c 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Index.js @@ -85,7 +85,7 @@ var bootstrap = function ($, learun) { if (res) { //processId = learun.newGuid(); //res = top[id].save(processId, refreshGirdData); - res = top[id].save('', function () { + res = top[id].save('', function () { page.search(); }); } @@ -171,6 +171,22 @@ var bootstrap = function ($, learun) { }); } }); + + // 查看 + $('#lr_look').on('click', function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + if (learun.checkrow(keyValue)) { + learun.layerForm({ + id: 'formlook', + title: '查看', + url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/FormLook?keyValue=' + keyValue, + width: 800, + height: 600, + 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 37fb8cf71..ff8b7a00a 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 @@ -1171,6 +1171,7 @@ + @@ -7589,6 +7590,7 @@ +