var supId = localStorage.getItem("supId");
var maModelId = localStorage.getItem("maModelId");
$(function() {
// agreementInfo();
getbaseList();
$("#baseForm").keydown(function(e) {
keycode = e.which || e.keyCode;
if (keycode == 13) {
search();
}
});
});
function getbaseList(init) {
var keyWord = $("#keyWord").val();
if (init == 1)
$(".pageNum").val(1);
JY.Model.loading();
JY.Ajax.doRequest("baseForm",bonuspath + '/backstage/puttask/findBackCode',
{
supId: supId,
maModelId: maModelId,
keyWord: keyWord
},
function(data) {
//alert("data="+JSON.stringify(data));
$("#baseTable tbody").empty();
var obj = data.obj;
var list = obj.list;
var results = list.results;
var permitBtn = obj.permitBtn;
var pageNum = list.pageNum, pageSize = list.pageSize, totalRecord = list.totalRecord;
var html = "";
if (results != null && results.length > 0) {
var leng = (pageNum - 1) * pageSize;
for (var i = 0; i < results.length; i++) {
var l = results[i];
html += "
";
html += "| " + (i + leng + 1) + " | ";
html += ""+ JY.Object.notEmpty(l.machineName) + " | ";
html += ""+ JY.Object.notEmpty(l.machineModel) + " | ";
html += ""+ JY.Object.notEmpty(l.deviceCode) + " | ";
if(l.machineStatus == '' || l.machineStatus == null){
html += " | ";
}else if(l.machineStatus == 1 || l.machineStatus =='1'){
html += "待通知 | ";
}else if(l.machineStatus == 2 || l.machineStatus =='2'){
html += " | ";
html += "待采购检验 | ";
}else if(l.machineStatus == 3 || l.machineStatus =='3'){
// html += "打印 | ";
html += "待打印 | ";
}else if(l.machineStatus == 4 || l.machineStatus =='4'){
html += "待入库 | ";
}else if(l.machineStatus == 5 || l.machineStatus =='5'){
html += "在库 | ";
}else if(l.machineStatus == 6 || l.machineStatus =='6'){
html += "在用 | ";
}else if(l.machineStatus == 7 || l.machineStatus =='7'){
html += "在修 | ";
}else if(l.machineStatus == 8 || l.machineStatus =='8'){
html += "已检验 | ";
}else if(l.machineStatus == 9 || l.machineStatus =='9'){
html += "修试后待入库 | ";
}else if(l.machineStatus == 10 || l.machineStatus =='10'){
html += "待报废 | ";
}else if(l.machineStatus == 11 || l.machineStatus =='11'){
if(l.isScrap == 1 || l.isScrap == '1'){
html += "已报废 | ";
}else{
html += "待报废入库 | ";
}
}else if(l.machineStatus == 12 || l.machineStatus =='12'){
if(l.isScrap == 1 || l.isScrap =='1'){
html += "已封存 | ";
}else{
html += "待封存入库 | ";
}
}else if(l.machineStatus == 13 || l.machineStatus =='13'){
html += "在检 | ";
}else if(l.machineStatus == 14 || l.machineStatus =='14'){
html += "出库待审 | ";
}else if(l.machineStatus == 15 || l.machineStatus =='15'){
html += "出库待批准 | ";
}else if(l.machineStatus == 16 || l.machineStatus =='16'){
html += "待批准 | ";
}else if(l.machineStatus == 17 || l.machineStatus =='17'){
html += "退料检验 | ";
}else if(l.machineStatus == 18 || l.machineStatus =='18'){
html += "入库待审 | ";
}else if(l.machineStatus == 19 || l.machineStatus =='19'){
html += "维修合格 | ";
}else if(l.machineStatus == 20 || l.machineStatus =='20'){
html += "已拆分 | ";
}else if(l.machineStatus == 21 || l.machineStatus =='21'){
html += "组装 | ";
}else if(l.machineStatus == 22 || l.machineStatus =='22'){
html += "检验报废 | ";
}else if(l.machineStatus == 23 || l.machineStatus =='23'){
html += "检验未通过 | ";
}else{
html += " | ";
}
html += ""+ JY.Object.notEmpty(l.putInTime) + " | ";
html += "
";
}
$("#baseTable tbody").append(html);
JY.Page.setPage("baseForm", "pageing", pageSize,pageNum, totalRecord, "getbaseList");
} else {
html += "| 没有相关数据 |
";
$("#baseTable tbody").append(html);
$("#pageing ul").empty();// 清空分页
}
JY.Model.loadingClose();
});
}