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..6fd550f3c 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 @@ -13,34 +13,46 @@
专业*
-
+
课程*
-
+
学年*
-
+
学期*
所选书籍*
-
+
-
+
书籍
-
+
+
单价
+ +
+
作者
-
+
其他作者
+
+
出版社
+ +
+
+
版次
+ +
订购数量
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Form.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Form.js index 6f0f00b3b..746b58194 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Form.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/TextBookIndent/Form.js @@ -167,10 +167,13 @@ var bootstrap = function ($, learun) { ], select: function (item) { ////赋值 + $("#Price").val(item.price); $("#PublishNo").val(item.publishno); $("#FirstAuthor").val(item.firstauthor); $("#TextBookName").val(item.textbookname); $("#OtherAuthor").val(item.otherauthor); + $("#Publisher").val(item.publisher); + $("#Edition").val(item.edition); } }); $('#Status').val(0); 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..bd54b77ea 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 @@ -75,8 +75,8 @@ var bootstrap = function ($, learun) { id: 'formTextBookIndent', title: '新增', url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/Form', - width: 800, - height: 600, + width: 1000, + height: 700, callBack: function (id) { var res = false; // 验证数据 @@ -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(); }); } @@ -106,8 +106,8 @@ var bootstrap = function ($, learun) { id: 'formTextBookIndent', title: '编辑', url: top.$.rootUrl + '/EducationalAdministration/TextBookIndent/Form?keyValue=' + keyValue, - width: 800, - height: 600, + width: 1000, + height: 700, callBack: function (id) { var res = false; // 验证数据 @@ -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: 1000, + height: 700, + btn: null, + }); + } + }); + }, // 初始化列表 initGird: function () { @@ -222,21 +238,12 @@ var bootstrap = function ($, learun) { { 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: 200, 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: "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); - } - }); - } - }, { label: "状态", name: "Status", width: 100, align: "left", formatter: function (cellvalue) { @@ -249,6 +256,18 @@ var bootstrap = function ($, learun) { } } }, + { 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', sidx: 'CreateTime desc,Status desc', 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 @@ + diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndent/TextBookIndentEntity.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndent/TextBookIndentEntity.cs index 9ac8b4349..376512551 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndent/TextBookIndentEntity.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndent/TextBookIndentEntity.cs @@ -91,6 +91,21 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration [Column("REMARK")] public string Remark { get; set; } /// + ///出版社 + /// + [Column("PUBLISHER")] + public string Publisher { get; set; } + /// + /// 版次 + /// + [Column("EDITION")] + public string Edition { get; set; } + /// + /// 单价 + /// + [Column("PRICE")] + public decimal? Price { get; set; } + /// /// Status /// [Column("STATUS")] diff --git a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndent/TextBookIndentService.cs b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndent/TextBookIndentService.cs index dbc6e4b1c..518fb5c73 100644 --- a/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndent/TextBookIndentService.cs +++ b/Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/EducationalAdministration/TextBookIndent/TextBookIndentService.cs @@ -271,14 +271,23 @@ namespace Learun.Application.TwoDevelopment.EducationalAdministration /// public void ChangeStatusByProcessId(int pastatus, string processId) { + var db = this.BaseRepository("CollegeMIS"); try { + db.BeginTrans(); var entity = this.BaseRepository("CollegeMIS").FindEntity(a => a.processId == processId); entity.Status = pastatus; - this.BaseRepository("CollegeMIS").Update(entity); + db.Update(entity); + + if (pastatus == 2) + { + //审核通过,添加征订数据 + } + db.Commit(); } catch (Exception e) { + db.Rollback(); if (e is ExceptionEx) { throw;