Преглед изворни кода

条码打印调整

金隅分支
liangkun пре 3 година
родитељ
комит
8b141ba5ad
1 измењених фајлова са 94 додато и 71 уклоњено
  1. +94
    -71
      Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/QRPrint.cshtml

+ 94
- 71
Learun.Framework.Ultimate V7/Learun.Application.Web/Areas/AssetManagementSystem/Views/Ass_AssetsInfoItem/QRPrint.cshtml Прегледај датотеку

@@ -21,7 +21,7 @@
<style>
body {
border: 0;
padding: 0;
padding: 0 0 0px 0;
margin: 0;
/* font-family: Arial, Helvetica, sans-serif!important; */
/* font-weight: bold; */
@@ -41,7 +41,7 @@
margin: 0 auto 5px;
}

#qrcode {
.qrcodes {
float: left;
font-size: 12px;
}
@@ -77,34 +77,15 @@

<body style="">
<div id="qrcodeBox">
<div class="qrcodeBox" style="page-break-before: auto;page-break-after: always;">
<div style="">
<div id="top">
<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">
<div id="AICodeNumJY"></div>
<div id="AIASSName"></div>
</div>
</div>
</div>
</div>
<div id="btnprint" type="button" class="btns" value="打印">打印</div>
<script>
var qrcode = new QRCode(document.getElementById("qrcode"), {
width: 60,
height: 60
});
var keyValue = request('keyValue');
var aName = request('aName');
var AIId = request('AIId');
$(function () {
qrcode.makeCode(keyValue);
$.ajax({
url: top.$.rootUrl + '/AssetManagementSystem/Ass_AssetsInfoItem/GetFormData?keyValue=' + AIId,
type: "GET",
@@ -112,54 +93,96 @@
async: true,
success: function (res) {
var data = res.data.Ass_AssetsInfoItem;
console.log(data);
var AIDepartment = "部门:";
top.learun.clientdata.getAsync('department', {
key: data.AIDepartment,
callback: function (_data) {
AIDepartment += _data.name;
}
});
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'];
}
});
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'];
}
});
var AIIStoragePosition = "";
top.learun.clientdata.getAsync('custmerData',
{
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_Storage_Room',
key: data.AIIStoragePosition,
keyId: 'rid',
callback: function (_data) {
AIIStoragePosition = _data['rcode'];
}
});
$('#AIDepartment').html(AIDepartment);
$('#AIUsePeople').html(AIUsePeople);
if (AIIStoragePosition) {
$('#AIIStorageAndRoom').html(AIIStorage + "-" + AIIStoragePosition);
} else {
$('#AIIStorageAndRoom').html(AIIStorage);
}
$('#AICodeNumJY').html("编号:"+data.AICodeNumJY);
$('#AIASSName').html("名称:"+data.AIASSName);

var arr = [];
if(!Array.isArray(data)){
arr.push(data)
}else{
arr = data
}
var html = '';

$.each(arr, function(i, n){
var AIDepartment = "部门:";
top.learun.clientdata.getAsync('department', {
key: n.AIDepartment,
callback: function (_data) {
AIDepartment += _data.name;
}
});
var AIUsePeople = "姓名:";
if (n.AIUsePeople) {
top.learun.clientdata.getAsync('custmerData',
{
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'BaseUser',
key: n.AIUsePeople,
keyId: 'f_userid',
callback: function(_data) {
AIUsePeople += _data['f_realname'];
}
});
} else
AIUsePeople += "暂无";
var AIIStorage = "位置:";
top.learun.clientdata.getAsync('custmerData',
{
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_StorageData',
key: n.AIIStorageId,
keyId: 'sid',
callback: function (_data) {
AIIStorage += _data['sname'];
}
});
var AIIStoragePosition = "";
top.learun.clientdata.getAsync('custmerData',
{
url: '/LR_SystemModule/DataSource/GetDataTable?code=' + 'Ass_Storage_Room',
key: n.AIIStoragePosition,
keyId: 'rid',
callback: function (_data) {
AIIStoragePosition = _data['rcode'];
}
});
var AIIStorageStr = ''
if (AIIStoragePosition) {
AIIStorageStr = AIIStorage + "-" + AIIStoragePosition;
} else {
AIIStorageStr = AIIStorage;
}
html += '<div class="qrcodeBox" style="page-break-before: auto;page-break-after: always;"><div style="">'+
'<div id="top">'+
'<div id="qrcode'+ i +'" class="qrcodes" val="'+ n.AICodeNumJY +'"></div>'+
'<div id="roghtDiv" style="">'+
'<div id="AIDepartment">'+ AIDepartment +'</div>'+
'<div id="AIUsePeople">'+ AIUsePeople +'</div>'+
'<div id="AIIStorageAndRoom">'+ AIIStorageStr +'</div>'+
'</div>'+
'</div>'+
'<div id="bottom">'+
'<div id="AICodeNumJY">编号:'+ n.AICodeNumJY +'</div>'+
'<div id="AIASSName">名称:'+ n.AIASSName +'</div>'+
'</div>'+
'</div></div>';
// $('#AIDepartment').html(AIDepartment);
// $('#AIUsePeople').html(AIUsePeople);
// if (AIIStoragePosition) {
// $('#AIIStorageAndRoom').html(AIIStorage + "-" + AIIStoragePosition);
// } else {
// $('#AIIStorageAndRoom').html(AIIStorage);
// }
// $('#AICodeNumJY').html("编号:"+data.AICodeNumJY);
// $('#AIASSName').html("名称:"+data.AIASSName);
})
$('#qrcodeBox').html(html);
$('.qrcodes').each(function(i, n){
var id = $(n).attr('id');
var val = $(n).attr('val')
var qrcode = new QRCode(document.getElementById(id), {
width: 60,
height: 60
});
qrcode.makeCode(val);
})
}
});



Loading…
Откажи
Сачувај