js创建页面代码
function CreateHTML(_data) {
var inTime=getInTimeDate(gPurchaseTime)
var rowdata = _data;
var _index = 1;
var content = "";
content+="<div class=\"div_print_info_portait PageNext\">";
content+="<h1 align=\"center\"></h1>";
content+="<form id=\"ff\" method=\"post\" style=\"width:100%;\">";
content+="<table cellspacing=\"4\" id=\"head\" style=\"margin-top: 10px;margin-left: 0px;margin-bottom: 0px;\">";
content+="<tr>";
content+="<th>订单编号:</th>";
content+="<th colspan=\"7\"><input type=\"text\" name=\"ORDER_NO\" value='";content+= orderNo;
content+="' + class=\"print_text_style\" /></th>";
content+="</tr>";
content+="<tr>";
content+="<th>采购员:</th>";
content+="<th colspan=\"7\"><input type=\"text\" name=\"ORDER_NO\" value='"; content+= puchaseName;
content+="' class=\"print_text_style\" /></th>";
content+="<th>采购时间:</th>";
content+="<th colspan=\"7\"><input type=\"text\" name=\"ORDER_NO\" value='"; content+= inTime;
content+="'class=\"print_text_style\" /></th>";
content+="</tr>";
content+="</table>";
content+="<table id=\"OrderInforTable\" class=\"altrowstable printtable\" style=\"margin-top: 0px;\">";
content+="<tr>";
content+="<th id=\"type\"><div>序号</div></th>";
content+="<th id=\"name\"><div>商品名</div></th>";
content+="<th id=\"unit\"><div>单位</div></th>";
content+="<th id=\"count\"><div>数量</div></th>";
content+="<th id=\"house\"><div>仓库</div></th>";
content+="<th id=\"remarks\"><div>备注</div></th></tr>";
content+="</table>";
content+="<table id=\"footer\" class=\"altrowstable printtable\" style=\"margin-top: 0px;\">"
content+="<tr>";
content+="<th >供应商(签字) </th>";
content+="<td colspan=\"2\"> ";
content+="<input class=\"print_text_style\" >";
content+="</td>";
content+="<th >库管员(签字) </th>";
content+="<td colspan=\"2\"> ";
content+="<input class=\"print_text_style\" >";
content+="</td>";
content+="<td colspan=\"2\"> ";
content+="第";
content+=content_indx;
content+="页";
content+="</td>";
content+="<td colspan=\"2\"> ";
content+="共";
content+=gPageNum;
content+="页";
content+="</td>";
content+="</tr>";
content+="</table>";
content+="</form>";
content+="</div>";
$("#printContent").append(content);
content_indx = content_indx + 1;
$("#OrderInforTable").attr("id", "OrderInforTable" + content_indx);
var newTd = new Array();
var s = document.getElementById("OrderInforTable" + content_indx);
for(var j = 0; j < rowdata.length; j++) {
var newTr = s.insertRow();
newTd[0] = newTr.insertCell()
newTd[0].innerText = _index++;
newTd[1] = newTr.insertCell();
if(rowdata[j].goodsName != undefined)
newTd[1].innerText = rowdata[j].goodsName;
newTd[2] = newTr.insertCell();
if(rowdata[j].unitName != undefined)
newTd[2].innerText = rowdata[j].unitName;
newTd[3] = newTr.insertCell();
if(rowdata[j].amount != undefined)
newTd[3].innerText = rowdata[j].amount;
newTd[4] = newTr.insertCell();
if(rowdata[j].storeName != undefined)
newTd[4].innerText = rowdata[j].storeName;
newTd[6] = newTr.insertCell();
}
}