$(function() {
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/apply/findByPage',
{
keyWord: keyWord
},
function(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.code) + " | ";
html += ""+ JY.Object.notEmpty(l.mtName) + " | ";
html += ""+ JY.Object.notEmpty(l.creator) + " | ";
html += ""+ JY.Object.notEmpty(l.createTime) + " | ";
html += ""+ JY.Object.notEmpty(l.applyRemark) + " | ";
html += ""+ JY.Object.notEmpty(l.status) + " | ";
// html += rowFunction(l.id);
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();
});
}
function rowFunction(isApproval,id,isActive) {
var h = "";
h += "";
h += "";
if (isApproval == "" || isApproval == null || isActive ==0 ) {
}else{
h += " ";
}
h += " ";
h += "";
h += " | ";
return h;
}
function search() {
$("#searchBtn").trigger("click");
}
function addData() {
layer.open({
type: 2,
title:['报废申请明细','background-color: #438EB9;color:#fff'],
shadeClose:true,
shade:false,
maxmin: true,
area: ['1600px', '800px'],
content: bonuspath+'/backstage/apply/addApply'
});
}
//附件图片上传、查看
function updAgreeListPic(id){
localStorage.setItem("updAgreeId",id);
localStorage.setItem("bonuspath",bonuspath);
//iframe层-父子操作
layer.open({
type: 2,
title:['附件图片上传','background-color: #438EB9;color:#fff'],
shadeClose:true,
shade:false,
maxmin: true,
area: ['800px', '430px'],
content: bonuspath+'/backstage/agreement/updAgreeListPic'
});
}