<!DOCTYPE html>
|
<html>
|
<head>
|
<meta charset="utf-8">
|
<title></title>
|
<style type="text/css">
|
@page{
|
size: auto;
|
margin: 0 10px 0 10px;
|
}
|
body{
|
font-family: SimSun;
|
font-size: 12px;
|
}
|
.trHeight50{
|
height: 50px;
|
}
|
.trHeight30{
|
height: 30px;
|
}
|
.thBorder{
|
border-left: 1px solid;
|
border-top: 1px solid;
|
border-bottom: 1px solid;
|
}
|
.thBorder2{
|
border-left: 1px solid;
|
border-top: 1px solid;
|
border-bottom: 1px solid;
|
border-right: 1px solid;
|
}
|
.tdPadding{
|
padding: 2px;
|
}
|
</style>
|
</head>
|
<body>
|
<div id="divPrint" style="width: 800px;">
|
<div>
|
<img id="imgBar" />
|
</div>
|
<div style="font-size: 21px;font-weight: 800;text-align: center;">
|
入库单
|
</div>
|
<table width="100%" style="">
|
<tr class="trHeight50">
|
<td width="35%">
|
订单号:<span id="billCode"></span>
|
</td>
|
<td width="40%">
|
备注:<span id="remark"></span>
|
</td>
|
<td width="25%">
|
创建人:<span id="createUser"></span>
|
</td>
|
</tr>
|
<tr>
|
<td>
|
批次号:<span id="batchCode"></span>
|
</td>
|
<td></td>
|
<td>
|
创建时间:<span id="createTime"></span>
|
</td>
|
</tr>
|
</table>
|
<table id="tbData" width="100%" cellspacing="0" style="margin-top: 20px;">
|
<thead>
|
<tr class="trHeight30">
|
<th class="thBorder">物品编号</th>
|
<th class="thBorder">物品名称</th>
|
<th class="thBorder">物品规格</th>
|
<th class="thBorder">生产日期</th>
|
<th class="thBorder">物品状态</th>
|
<th class="thBorder">物品单位</th>
|
<th class="thBorder">计划数量</th>
|
<th class="thBorder">已下发数量</th>
|
<th class="thBorder2">完成数量</th>
|
</tr>
|
</thead>
|
<tbody>
|
</tbody>
|
</table>
|
</div>
|
<script src="../../../layuiadmin/layui/layui.js"></script>
|
<script src="../../../js/public.js"></script>
|
<script src="../../../js/jquery-3.5.1.min.js"></script>
|
<script src="../../../js/jquery.cookie.js"></script>
|
<script src="../../../js/jquery.print.js"></script>
|
<script>
|
layui.config({
|
base: '../../../layuiadmin/' //静态资源所在路径
|
}).extend({
|
index: 'lib/index' //主入口模块
|
}).use(['index', 'table', 'laypage', 'layer'], function() {
|
var table = layui.table,
|
form = layui.form,
|
laypage = layui.laypage,
|
layer = layui.layer;
|
//
|
var code = getQueryString("id");
|
getPrintData();
|
//
|
function getPrintData(){
|
var param = {
|
Id: code
|
};
|
sendData(IP + "/Import/GetImportBillPrintData", param, 'post', function(res) {
|
if (res.code == 1) { //成功
|
setData(res.data);
|
print();
|
} else { //不成功
|
layer.msg('获取图片失败!', {
|
icon: 2,
|
time: 2000 //2秒关闭(如果不配置,默认是3秒)
|
}, function() {});
|
}
|
});
|
|
}
|
function setData(data){
|
var list = data.dataList;
|
$("#imgBar").attr("src", data.code);
|
$("#billCode").html(list[0].ImportBillCode);
|
$("#remark").html(list[0].ImportRemark);
|
$("#createUser").html(list[0].CreateUserName);
|
$("#batchCode").html(list[0].ImportLotNo);
|
$("#createTime").html(formatDate(list[0].ImportDate));
|
//
|
var html;
|
for(var i = 0; i < data.dataList.length; i++){
|
html += "<tr>";
|
html += "<td class ='tdPadding'>" + list[i].GoodsCode + "</td>";
|
html += "<td class ='tdPadding'>" + list[i].GoodsName + "</td>";
|
html += "<td class ='tdPadding'>" + list[i].GoodsStandard + "</td>";
|
html += "<td class ='tdPadding'>" + formatDate(list[i].ImportProductionDate) + "</td>";
|
html += "<td class ='tdPadding'>" + list[i].ImportGoodsStatus + "</td>";
|
html += "<td class ='tdPadding'>" + list[i].GoodsUnit + "</td>";
|
html += "<td class ='tdPadding'>" + list[i].ImportQuantity + "</td>";
|
html += "<td class ='tdPadding'>" + list[i].ImportFactQuantity + "</td>";
|
html += "<td class ='tdPadding'>" + list[i].ImportCompleteQuantity + "</td>";
|
html += "</tr>";
|
}
|
$("#tbData tbody").html(html);
|
}
|
function print(){
|
$("#divPrint").print();
|
//closeThis();
|
}
|
//获取浏览器参数
|
function getQueryString(name) {
|
var reg = new RegExp("(^|&)" + name + "=([^&]*)(&|$)", "i");
|
var r = window.location.search.substr(1).match(reg);
|
if (r != null) return unescape(r[2]);
|
return null;
|
}
|
//
|
function closeThis(){
|
if (navigator.userAgent.indexOf("Firefox") != -1 || navigator.userAgent.indexOf("Chrome") != -1) {
|
window.location.href = "about:blank";
|
window.close();
|
}
|
else{
|
window.opener = null;
|
window.open("", "_self");
|
window.close();
|
}
|
}
|
});
|
</script>
|
</body>
|
</html>
|