Explorar el Código

条码打印增加多选返回数据

金隅分支
liangkun hace 3 años
padre
commit
f42e5e6a87
Se han modificado 3 ficheros con 102 adiciones y 45 borrados
  1. +17
    -5
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AssetsInfoItemController.cs
  2. +85
    -39
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/QRPrint.cshtml
  3. +0
    -1
      Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsInfoItem/Ass_AssetsInfoItemIBLL.cs

+ 17
- 5
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Controllers/Ass_AssetsInfoItemController.cs Ver fichero

@@ -134,12 +134,24 @@ namespace Learun.Application.Web.Areas.AssetManagementSystem.Controllers
[AjaxOnly]
public ActionResult GetFormData(string keyValue)
{
var Ass_AssetsInfoItemData = ass_AssetsInfoItemIBLL.GetAss_AssetsInfoItemEntity(keyValue);
var jsonData = new
if (!keyValue.Contains(","))
{
Ass_AssetsInfoItem = Ass_AssetsInfoItemData,
};
return Success(jsonData);
var Ass_AssetsInfoItemData = ass_AssetsInfoItemIBLL.GetAss_AssetsInfoItemEntity(keyValue);
var jsonData = new
{
Ass_AssetsInfoItem = Ass_AssetsInfoItemData,
};
return Success(jsonData);
}
else
{
var Ass_AssetsInfoItemData = ass_AssetsInfoItemIBLL.GetDatas(keyValue);
var jsonData = new
{
Ass_AssetsInfoItem = Ass_AssetsInfoItemData,
};
return Success(jsonData);
}
}

/// <summary>


+ 85
- 39
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/QRPrint.cshtml Ver fichero

@@ -1,13 +1,11 @@
<!DOCTYPE html>


<html>

<head>
<meta name="viewport" content="width=device-width" />
<meta http-equiv="content-type" content="text/html; charset=UTF-8">
<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>
@Html.AppendJsFile("/Content/jquery/jquery-1.10.2.min.js", "/Content/jquery/plugin/jqprint/jquery.jqprint-0.3.js", "/Content/js/qrcode.min.js")
<link href="~/Content/cardprint/CardPrint.css" rel="stylesheet" />
<script>
function request(d) {
@@ -15,47 +13,98 @@
var b = c[a].split("=");
if (b[0] == d)
if ("undefined" == unescape(b[1])) break;
else return unescape(b[1])
else return unescape(b[1]);
}
return ""
return "";
};
</script>
<style>
body {
border: 0;
padding: 0;
margin: 0;
/* font-family: Arial, Helvetica, sans-serif!important; */
/* font-weight: bold; */
}

#qrcodeBox {
width: 390px;
margin: 0 auto;
}

.qrcodeBox {
padding: 18px 5px 0;
/* margin-top:20px; */
}

.qrcodeBox > div {
margin: 0 auto 5px;
}

#qrcode {
float: left;
font-size: 12px;
}

#roghtDiv {
margin-top: -2px;
margin-left: 70px;
text-align: left;
}

#roghtDiv div {
height: 20px;
line-height: 20px;
font-size: 13px;
}

#top {
overflow: hidden;
}

#bottom {
line-height: 24px;
font-size: 14x;
padding-top: 10px;
}

#bottom div {
height: 24px;
overflow: hidden;
}
</style>
</head>

<body style="">
<div id="qrcodeBox" style="text-align:center;margin-top:20px;">
<div class="qrcodeBox" style="display: inline-block">
<div style="margin: 0 auto 5px;">
<div id="qrcodeBox">
<div class="qrcodeBox" style="page-break-before: auto;page-break-after: always;">
<div style="">
<div id="top">
<div id="qrcode" style="float: left; font-size: 12px;"></div>
<div id="roghtDiv" style="float: right; line-height: 25px; padding: 5px;">
<div id="AIDepartment" style="height: 25px;"></div>
<div id="AIUsePeople" style="height: 25px;"></div>
<div id="AIIStorageAndRoom" style="height: 25px;"></div>
<div id="qrcode"></div>
<div id="roghtDiv" style="">
<div id="AIDepartment"></div>
<div id="AIUsePeople"></div>
<div id="AIIStorageAndRoom"></div>
</div>
</div>
<div id="bottom" style="line-height: 20px;">
<div id="bottom">
<div id="AICodeNumJY"></div>
<div id="AIASSName"></div>
</div>
</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: 80,
height: 80
width: 60,
height: 60
});
var keyValue = request('keyValue');//二维码
var keyValue = request('keyValue');
var aName = request('aName');
var AIId = request('AIId');
//$('.qrcodeTxt').html(unescape(aName));
$(function () {
qrcode.makeCode(keyValue);
//获取打印信息
$.ajax({
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItem/GetFormData?keyValue=' + AIId,
type: "GET",
@@ -63,37 +112,34 @@
async: true,
success: function (res) {
var data = res.data.Ass_AssetsInfoItem;
//部门
var AIDepartment = "";
console.log(data);
var AIDepartment = "部门:";
top.learun.clientdata.getAsync('department', {
key: data.AIDepartment,
callback: function (_data) {
AIDepartment = _data.name;
AIDepartment += _data.name;
}
});
//使用人
var AIUsePeople = "";
var AIUsePeople = "姓名:";
top.learun.clientdata.getAsync('custmerData',
{
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser',
key: data.AIUsePeople,
keyId: 'f_userid',
callback: function (_data) {
AIUsePeople = _data['f_realname'];
AIUsePeople += _data['f_realname'];
}
});
//楼宇名称
var AIIStorage = "";
var AIIStorage = "位置:";
top.learun.clientdata.getAsync('custmerData',
{
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_StorageData',
key: data.AIIStorageId,
keyId: 'sid',
callback: function (_data) {
AIIStorage = _data['sname'];
AIIStorage += _data['sname'];
}
});
//房间号
var AIIStoragePosition = "";
top.learun.clientdata.getAsync('custmerData',
{
@@ -111,24 +157,24 @@
} else {
$('#AIIStorageAndRoom').html(AIIStorage);
}
$('#AICodeNumJY').html(data.AICodeNumJY);
$('#AIASSName').html(data.AIASSName);
$('#AICodeNumJY').html("编号:"+data.AICodeNumJY);
$('#AIASSName').html("名称:"+data.AIASSName);

}
});

$("#btnprint").on("click", function () {
AddPrintContent3();
$('#qrcodeBox').jqprint();
});


});
// 打印表单

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


+ 0
- 1
Learun.Framework.Ultimate V7/Learun.Framework.Module/Learun.Application.Module/Learun.Application.TwoDevelopment/AssetManagementSystem/Ass_AssetsInfoItem/Ass_AssetsInfoItemIBLL.cs Ver fichero

@@ -61,6 +61,5 @@ namespace Learun.Application.TwoDevelopment.AssetManagementSystem
/// <returns></returns>
void SaveEntity(string keyValue, Ass_AssetsInfoItemEntity entity);
#endregion

}
}

Cargando…
Cancelar
Guardar