function getList(page){ page = page || 1; var type = $("#type option:selected").val(); var pageSize = 10, data = { "platformName" : $("#platformName").val(), "type" : ( type == "" ? "" : type), "pageNo" : page, "pageSize" : pageSize }, html = ""; $("#page, #list,#count").empty(); ajax("ajax_program_schedule_list.do", data, function(res){ if (res.code == 1 && res.list.length > 0){ $.each(res.list, function(index, item){ html += ''+ ''+ ''+item.platformName+''+ ''+(item.updDate ? new Date(item.updDate.time).Format("yyyy年MM月dd日"):"")+''+ ''+ (item.type == 1 ? "剧编及备播" :item.type == 2 ? "剧排进程" : item.type == 3 ? "节目编排" : "-") + ''+ ''+(item.imgUrl ? '':' ')+''+ ''+(item.crtTime ? new Date(item.crtTime.time).Format("yyyy年MM月dd日 hh:mm"):"")+''+ ''+item.sortNum.toString().decode("","-",item.sortNum)+''+ ''+item.associatedFileName+''+ ''+item.crtUname.toString().decode("","-",item.crtUname)+''+ ''+ (update_flag == 1 ? '编辑  ' : '
') + (delete_flag == 1 ? '删除' : '
' ) + ''+ ''; }); $("#list").html(html); $.checkbox(); $("#count").text(res.count); $("#curPage").val(page); var newpage = new createPage(res.count, page, pageSize, 3); $("#page").html(newpage.pageHtml); } else { $("#list").info("暂无数据。"); } }); } pageGo = getList; // 删除单个 function delRecord(id){ confirm("确定删除该条记录吗?", function(){ ajax("delete_program_schedule.do", {"id" : id}, function(res){ if (res.code == 1){ alert("删除成功。", 1, function(){ window.location.href = "program_schedule_list.do"; }); } else { alert(res.msg); } }); }); } // 删除多个 function delRecordBatch(){ var arr = document.getElementsByName("chk"); var ids = ""; for (i=0; ioption:selected").val(); data.imgUrl = $("#imgUrl")[0].src; data.associatedFile = $("#associatedFile").val(); data.associatedFileName = $("#associatedFileName").val(); console.log(data); // 数据是否完整 if (data['type'].isEmpty()){ top.alert("请选择类型", 0, function(){ $("input[name='type']").focus(); }); return false; } if (data['imgUrl'].isEmpty() || data['imgUrl'].indexOf("ylcm_sys") > 1){ top.alert("请上传编排图"); return false; } if (data['platformName'].isEmpty()){ top.alert("请填写资源名称", 0, function(){ $("input[name='platformName']").focus(); }); return false; } if (data['updDate'].isEmpty()){ top.alert("请选择更新时间", 0, function(){ $("input[name='updDate']").focus(); }); return false; } if (data['sortNum'].isEmpty()){ top.alert("请填写排序号", 0, function(){ $("input[name='sortNum']").focus(); }); return false; } if(isNaN(data['sortNum'])){ top.alert("排序号请输入数字"); return false; } // 提交数据 top.ajax("save_program_schedule_info.do", data, function(res){ if (res.code == 1){ top.alert("保存成功。", 1, function(){ top.getList($("#curPage").val()); top.$.closeWindow(); }); } else { top.alert(res.msg); } }); } // 弹窗 function platformModfiy(act, title, id){ title = title || ""; id = id || ""; $.openWindow(act.decode("add","新增","edit","修改","")+title, "program_schedule_info.do?id="+id, 500, 470, true); } function showimg(imgurl){ var url = document.getElementById(imgurl).src; if(url!='' && url!='http://localhost:8080/ylcm_sys/static/img/noimg.jpg' && url != "http://121.41.17.212:8080/ylcm_sys/static/img/noimg.jpg"){ var newwin=window.open(); var w = document.documentElement.scrollWidth || document.body.scrollWidth ; var h = document.documentElement.scrollHeight || document.body.scrollHeight ; newwin.document.write(""); // var html = ''; // $.openWindow(" ",html,500,380,false); } } //确认覆盖 function confirmCallback(repeat, msg) { if (repeat == 1){ confirm(msg, function(){ top.$("#isSure").val("sure"); top.$("#fileForm").submit(); }); } }