apzl_leasing/WebContent/Tenwa/Lease/App/AutoFiveGradeClassification/AutoFiveGradeClassificationListTraditional.jsp

149 lines
6.5 KiB
Plaintext

<%@page import="com.tenwa.comm.dataRightmanager.DataRightManager"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><%
String contractId = CurPage.getParameter("ContractId") != null ? CurPage.getParameter("ContractId") : "";
String isRemind = CurPage.getParameter("IsRemind") != null ? CurPage.getParameter("IsRemind") : "";
ASObjectModel doTemp = new ASObjectModel("LBFiveGradeClassificationListTra");
String appendSql = "";
if(!"".equals(contractId)){
appendSql += " and O.id = '"+contractId+"' and lccs.Is_Remind = '"+isRemind+"' AND v.DATEDIFF(v.NOW(),lccs.FIVE_GRADE_DATE) <= 3 ";
}else if(!"".equals(isRemind)){
appendSql += " and lccs.Is_Remind = '"+isRemind+"' AND v.DATEDIFF(v.NOW(),lccs.FIVE_GRADE_DATE) <= 3 ";
}
//String sCondtion=DataRightManager.getRightCondition(CurUser,"O", "contract");
String sCondtion="";
if(!"".equals(appendSql)) sCondtion += appendSql;
doTemp.appendJboWhere(sCondtion);
doTemp.setDefaultValue("IS_AUTO", "Y");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1"; //--设置为Grid风格--
dwTemp.ReadOnly = "1"; //只读模式
dwTemp.setPageSize(15);
dwTemp.genHTMLObjectWindow("");
String sButtons[][] =new String[][] {
{"true","","Button","设置自动分类","设置自动分类","setAutoClassification()","","","","btn_icon_set"},
{"true","","Button","取消自动分类","取消自动分类","cancelAutoClassification()","","","","btn_icon_delete"},
{"true","","Button","执行定时任务","执行定时任务","execute()","","","",""}
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
function execute(){
var Result = AsControl.RunJavaMethod("com.tenwa.lease.app.quartzmession.AutoFiveGradeClass", "execute","");
if(Result=='success'){
alert("执行成功!");
reloadSelf();
}else{
alert("执行失败!");
reloadSelf();
}
}
function setAutoClassification(){
var contractId = getItemValue(0,getRow(),"ID");
var paymentNumber = getItemValue(0,getRow(),"PAYMENT_NUMBER");
var isAuto = getItemValue(0,getRow(),"IS_AUTO");
if(isAuto=='Y'){
alert("您选择的投放目前是自动分类,无需设置!");
}else{
var Result = AsControl.RunJavaMethodTrans("com.tenwa.lease.app.fivegradeclassification.FiveGradeClassificationController", "changeFiveGradeAuto", "contractId="+contractId+",paymentNumber="+paymentNumber+",isAuto="+"Y");
if(Result=='success'){
alert("操作成功!");
reloadSelf();
}
}
}
function cancelAutoClassification(){
var contractId = getItemValue(0,getRow(),"ID");
var paymentNumber = getItemValue(0,getRow(),"PAYMENT_NUMBER");
var isAuto = getItemValue(0,getRow(),"IS_AUTO");
if(isAuto=='N'){
alert("您选择的投放目前不是自动分类,无需设置!");
}else{
var Result = AsControl.RunJavaMethodTrans("com.tenwa.lease.app.fivegradeclassification.FiveGradeClassificationController", "changeFiveGradeAuto", "contractId="+contractId+",paymentNumber="+paymentNumber+",isAuto="+"N");
if(Result=='success'){
alert("操作成功!");
reloadSelf();
}
}
}
function afterSearch(){
for(var i=0;i<getRowCount(0);i++){
getObj(0,i,"operation").innerHTML='<a class="box" onclick="upload(\''+getItemValue(0,i,"id")+'\')" style={color:#000;text-decoration:underline;}><font color="blue">上传</font></a>';
var filelist=getObj(0,i,"filelist").innerHTML;
var obj=eval('('+filelist+')');
var html="";
for(var file in obj){
//if(isReview!="true"&&sRightType!="ReadOnly"&&(sObjectType==obj[file]['objecttype'])&&username.replace(/\s+/g,"&nbsp;")==obj[file]['inputuser']){
// html+='<a class="btn_icon btn_icon_close" onclick="deleteFile(\''+obj[file]['id']+'\');">&nbsp;</a>';
//}
if(obj[file]['image']=="true"){
html+='<a class="btn_icon btn_icon_search" onclick="showImage(\''+obj[file]['id']+'\',\''+obj[file]['filename']+'\');">&nbsp;</a>';
}
if(obj[file]['word']=="true"){
html+='<a class="btn_icon btn_icon_search" onclick="showWord(\''+obj[file]['id']+'\',\''+obj[file]['filename']+'\');">&nbsp;</a>';
}
if(obj[file]['pdf']=="true"){
html+='<a class="btn_icon btn_icon_search" onclick="showPDF(\''+obj[file]['id']+'\',\''+obj[file]['filename']+'\');">&nbsp;</a>';
}
html+='<a onclick=downloadFile(\''+obj[file]['id']+'\')><font color="blue">'+obj[file]['filename']+'</font></a>';
html+='【上传时间:'+obj[file]['inputtime']+'】';
html+='【上传人:'+obj[file]['inputuser']+'】';
html+='【大小:'+Math.floor(obj[file]['FileSize']/1024*100)/100+'kb】';
html+='</br>';
}
getObj(0,i,"filelist").innerHTML=html;
getObj(0,i,"filelist").style["white-space"]="pre-wrap";
var height = getObj(0,i,"filelist").offsetHeight+1;
setItemStyle(0,i,"FULLNAME","height="+height+"px");
};
}
function upload(id){
var param="Library_id="+id;
var sUrl="/Tenwa/Apzl/FileUpload/AutoFiveAttachmentUpload.jsp";
AsDialog.PopView(sUrl,param,"dialogWidth=450px;dialogHeight=400px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;",function(message){
reloadSelf();
heping();
},"上传附件");
}
function heping(){
$("#TR_Right_myiframe0_0").attr("class","color_zebra0");
huanhang("Doc_Name");
}
function huanhang(col){
var tab=document.getElementById("myiframe0");
var a= getColIndex(0,col);
for(var i=0;i<tab.rows.length-1;i++){
$("#INPUT_myiframe0_"+col+"_"+i+"_"+a).parent().attr("style","white-space: pre-wrap;");
}
}
function showPDF(id,name){
var sUrl="/Tenwa/Comm/DocList/showPDF.jsp";
var param="attrid="+id;
AsControl.OpenPage(sUrl,param,"","");
}
function showWord(id,name){
var sUrl="/Tenwa/Comm/DocList/showWord.jsp";
var param="attrid="+id;
AsControl.OpenPage(sUrl,param,"","");
}
function showImage(id,name){
var sUrl="/Tenwa/Comm/DocList/showImage.jsp";
var param="attrid="+id;
AsDialog.PopView(sUrl,param,"dialogWidth=480px;dialogHeight=400px;",function(message){
},name);
}
function downloadFile(id){
if(!frames["downloadTemplate"]) $("<iframe name='downloadTemplate' style='display:none;'></iframe>").appendTo("body");
window.open(sWebRootPath+"/servlet/view/docDownloadServlet?CompClientID=<%=sCompClientID%>&sqlString=save@"+id, "downloadTemplate");
}
function deleteFile(id){
var sParams="attId="+id;
var sReturnInfo = RunJavaMethodTrans("com.tenwa.doc.action.DocListAction","deleteAttr",sParams);
reloadSelf();
heping();
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>