浏览代码

图书管理二维码 未完成

新疆体育高职分支
ndbs 1年前
父节点
当前提交
fb576f2a28
共有 6 个文件被更改,包括 124 次插入9 次删除
  1. +25
    -5
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Controllers/BookInfoController.cs
  2. +4
    -4
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/BookInfo/Form.cshtml
  3. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/BookInfo/Index.cshtml
  4. +29
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/BookInfo/Index.js
  5. +64
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/BookInfo/QRCode.cshtml
  6. +1
    -0
      Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj

+ 25
- 5
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();
}
/// <summary>
/// 表单页
@@ -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<Book_infoEntity>();
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


+ 4
- 4
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/BookInfo/Form.cshtml 查看文件

@@ -7,6 +7,10 @@
<div class="lr-form-item-title">书籍名称<font face="宋体">*</font></div>
<input id="BookName" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-6 lr-form-item" data-table="Book_info">
<div class="lr-form-item-title">书籍编号<font face="宋体">*</font></div>
<input id="BookCode" type="text" class="form-control" isvalid="yes" checkexpession="NotNull" />
</div>
<div class="col-xs-6 lr-form-item" data-table="Book_info">
<div class="lr-form-item-title">书籍提要</div>
<input id="Collation" type="text" class="form-control" />
@@ -27,10 +31,6 @@
<div class="lr-form-item-title">书籍出版社</div>
<input id="Publisher" type="text" class="form-control" />
</div>
<div class="col-xs-6 lr-form-item" data-table="Book_info">
<div class="lr-form-item-title">书籍编号</div>
<input id="BookCode" type="text" class="form-control" />
</div>
<div class="col-xs-6 lr-form-item" data-table="Book_info">
<div class="lr-form-item-title">出版时间</div>
<input id="PublishTime" type="text" class="form-control lr-input-wdatepicker" onfocus="WdatePicker({ dateFmt: 'yyyy-MM-dd', onpicked: function() { $('#Birthday').trigger('change'); } })" />


+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/BookInfo/Index.cshtml 查看文件

@@ -38,6 +38,7 @@
<a id="lr_add" class="btn btn-default"><i class="fa fa-plus"></i>&nbsp;录入</a>
<a id="lr_edit" class="btn btn-default"><i class="fa fa-pencil-square-o"></i>&nbsp;修改</a>
<a id="lr_delete" class="btn btn-default"><i class="fa fa-trash-o"></i>&nbsp;删除</a>
<a id="lr_qrcode" class="btn btn-default"><i class="fa fa-linode"></i>&nbsp;生成二维码</a>
<a id="lr_print" class="btn btn-default"><i class="fa fa-print"></i>&nbsp;打印</a>
</div>
</div>


+ 29
- 0
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();


+ 64
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/EducationalAdministration/Views/BookInfo/QRCode.cshtml 查看文件

@@ -0,0 +1,64 @@
<!DOCTYPE html>


<html>

<head>
<meta name="viewport" content="width=device-width" />
<title>CardPrint</title>
@Html.AppendJsFile("/Content/jquery/jquery-1.10.2.min.js", "/Content/jquery/plugin/jqprint/jquery.jqprint-0.3.js")
<script src="/Content/js/qrcode.min.js"></script>
<script src="~/PhonePage/server.js"></script>
<link href="~/Content/cardprint/CardPrint.css" rel="stylesheet" />
<script>
function request(d) {
for (var c = location.search.slice(1).split("&"), a = 0; a < c.length; a++) {
var b = c[a].split("=");
if (b[0] == d)
if ("undefined" == unescape(b[1])) break;
else return unescape(b[1])
}
return ""
};
</script>
</head>

<body style="">
<div id="qrcodeBox" style="text-align:center;margin-top:20px;">
<div class="qrcodeBox" style="display:inline-block">
<div id="qrcode" style="margin:0 auto 5px;"></div>
<div class="qrcodeTxt" style="font-size:12px;"></div>
</div>

</div>
<!--<div id="btnprint" type="button" class="btns" value="打印">打印</div>-->
<script>
//标签打印
var qrcode = new QRCode(document.getElementById("qrcode"), {
width: 130,
height: 130
});
var keyValue = request('keyValue');//二维码
var EmpName = request('BookName');
var BookCode = request('BookCode');
$('.qrcodeTxt').html(unescape(EmpName, BookCode));
$(function () {
var url = currentUrl + '/EducationalAdministration/StuEnrollPhone/Link?EmpNo=' + keyValue;
qrcode.makeCode(url);
//$("#btnprint").on("click", function () {
// AddPrintContent3()
//});


});
// 打印表单
function AddPrintContent3() {
$('#btnprint').css('display', 'none')
window.print();
$('#btnprint').css('display', 'block')
}
</script>
</body>

</html>

+ 1
- 0
Learun.Framework.Ultimate V7/Learun.Application.Web/Learun.Application.Web.csproj 查看文件

@@ -8283,6 +8283,7 @@
<Content Include="Areas\AssetManagementSystem\Views\FundsApply\FormView.cshtml" />
<Content Include="Areas\AssetManagementSystem\Views\FundsApply\Index.cshtml" />
<Content Include="Areas\AssetManagementSystem\Views\FundsApply\StatsIndex.cshtml" />
<Content Include="Areas\EducationalAdministration\Views\BookInfo\QRCode.cshtml" />
<None Include="Properties\PublishProfiles\CustomProfile.pubxml" />
<None Include="Properties\PublishProfiles\FolderProfile.pubxml" />
<Content Include="Views\Login\Default-beifen.cshtml" />


正在加载...
取消
保存