$(function() { findParentTypeList(); $("#baseForm").keydown(function(e) { keycode = e.which || e.keyCode; if (keycode == 13) { search(); } }); }); function findParentTypeList() { $.ajax({ url:bonuspath+'/backstage/applyDetails/findParentTypeList', data:{}, type:'post', dataType:'json', success:function(data){ var obj = data.obj; var list=obj.list; var html=''; $("#type").append(html); if(list.length>0){ for(var i=0;i'+list[i].name+''; } } $("#parentType").append(html); }, error:function(dats){ } }); } function findTypeList() { $("#type").empty(); var id=$("#parentType").val(); $.ajax({ url:bonuspath+'/backstage/applyDetails/findTypeList', data:{id:id}, type:'post', dataType:'json', success:function(data){ var obj = data.obj; var list=obj.list; var html=''; if(list.length>0){ for(var i=0;i'+list[i].name+''; } } $("#type").append(html); }, error:function(dats){ } }); } 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.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 += ""; 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: ['800px', '430px'], 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' }); }