diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/BookInfoController.cs b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/BookInfoController.cs index f65a5a691..a7ec15075 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/BookInfoController.cs +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/BookInfoController.cs @@ -26,7 +26,7 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult Index() { - return View(); + return View(); } /// /// 表单页 @@ -35,7 +35,11 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [HttpGet] public ActionResult Form() { - return View(); + return View(); + } + public ActionResult QRCode() + { + return View(); } #endregion @@ -69,8 +73,9 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers [AjaxOnly] public ActionResult GetFormData(string keyValue) { - var Book_infoData = bookInfoIBLL.GetBook_infoEntity( keyValue ); - var jsonData = new { + var Book_infoData = bookInfoIBLL.GetBook_infoEntity(keyValue); + var jsonData = new + { Book_info = Book_infoData, }; return Success(jsonData); @@ -102,7 +107,22 @@ namespace Learun.Application.Web.Areas.EducationalAdministration.Controllers public ActionResult SaveForm(string keyValue, string strEntity) { Book_infoEntity entity = strEntity.ToObject(); - bookInfoIBLL.SaveEntity(keyValue,entity); + var model = empInfoIBLL.GetEmpInfoEntityByEmpNo(entity.EmpNo); + if (string.IsNullOrEmpty(keyValue)) + { + if (model != null) + { + return Fail("职工编号已存在!"); + } + } + else + { + if (model != null && model.EmpId != keyValue) + { + return Fail("职工编号已存在!"); + } + } + bookInfoIBLL.SaveEntity(keyValue, entity); return Success("保存成功!"); } #endregion diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/BookInfo/Form.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/BookInfo/Form.cshtml index 76fe6638d..8c3f16721 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/BookInfo/Form.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/BookInfo/Form.cshtml @@ -7,6 +7,10 @@
书籍名称*
+
+
书籍编号*
+ +
书籍提要
@@ -27,10 +31,6 @@
书籍出版社
-
-
书籍编号
- -
出版时间
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/BookInfo/Index.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/BookInfo/Index.cshtml index e2bdc7563..054038f5e 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/BookInfo/Index.cshtml +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/BookInfo/Index.cshtml @@ -38,6 +38,7 @@  录入  修改  删除 +  生成二维码  打印
diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/BookInfo/Index.js b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/BookInfo/Index.js index d16cb59d1..439cf90f5 100644 --- a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/BookInfo/Index.js +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/BookInfo/Index.js @@ -62,6 +62,35 @@ var bootstrap = function ($, learun) { }); } }); + //生成二维码 + $("#lr_qrcode").on('click', + function () { + var keyValue = $('#gridtable').jfGridValue('ID'); + var BookName = $('#gridtable').jfGridValue('BookName'); + var BookCode = $('#gridtable').jfGridValue('BookCode'); + //console.log(keyValue, EmpName); + if (learun.checkrow(keyValue)) { + if (keyValue.indexOf(',') != -1) { + learun.alert.warning("只能选择一条记录生成!"); + return; + } + learun.layerForm({ + id: 'formcard', + title: '二维码', + url: top.$.rootUrl + + '/EducationalAdministration/BookInfo/QRCode?keyValue=' + + keyValue + + '&BookName=' + + '&BookCode=' + + escape(BookName, BookCode), + width: 700, + height: 300, + btn: null, + end: function () { refreshGirdData(); } + }); + } + + }); // 打印 $('#lr_print').on('click', function () { $('#gridtable').jqprintTable(); diff --git a/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/BookInfo/QRCode.cshtml b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/BookInfo/QRCode.cshtml new file mode 100644 index 000000000..a36c917bf --- /dev/null +++ b/Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/BookInfo/QRCode.cshtml @@ -0,0 +1,64 @@ + + + + + + + + CardPrint + @Html.AppendJsFile("/Content/jquery/jquery-1.10.2.min.js", "/Content/jquery/plugin/jqprint/jquery.jqprint-0.3.js") + + + + + + + +
+
+
+
+
+ +
+ + + + + \ No newline at end of file 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 3e3d17e55..4370f32da 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 @@ -8283,6 +8283,7 @@ +