2018-07-10 10:34:12 +08:00

251 lines
10 KiB
Plaintext

<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%>
<%
String orgid=CurUser.getOrgID();
String userid=CurUser.getUserID();
ASObjectModel doTemp = new ASObjectModel("LB_CAR_LICENSE_PLATE_LIST");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1";
dwTemp.ReadOnly = "1";
dwTemp.setPageSize(20);
dwTemp.genHTMLObjectWindow("");
String sButtons[][] = {
{"true","All","Button","新增","新增","newRecord()","","","",""},
{"true","All","Button","修改","修改","viewAndEdit()","","","","btn_icon_edit"},
{"true","","Button","删除","删除","if(confirm('确实要删除吗?'))as_delete(0)","","","","btn_icon_delete",""},
{"true","All","Button","导入Excel","导入Excel","importExcel()","","","","btn_icon_import"},
{"true","","Button","牌照模版下载","牌照模版下载","LicensePlateDownload()","","","","btn_icon_down",""},
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<iframe name="MyAtt" src="<%=com.amarsoft.awe.util.Escape.getBlankJsp(sWebRootPath,"正在下载附件,请稍候...")%>" style="background-color: blue" width=100% height=100% frameborder=0 hspace=0 vspace=0 marginwidth=0 marginheight=0 scrolling="no">
</iframe>
<form name=form1 method=post action="<%=sWebRootPath%>/servlet/view/fileTemplateView?CompClientID=<%=sCompClientID%>" target=MyAtt>
<div style="display:none">
<input id="sqlString" name=sqlString value="">
</div>
</form>
<script type="text/javascript">
/*~[Describe=新增记录;InputParam=无;OutPutParam=无;]~*/
function newRecord(){
var sUrl = "/Tenwa/Comm/DocList/LbCarLicensePlateInfo.jsp";
AsControl.OpenView(sUrl,'','_self','');
}
function viewAndEdit(){
var sUrl = "/Tenwa/Comm/DocList/LbCarLicensePlateInfo.jsp";
var sPara = getItemValue(0,getRow(0),'ID');
if(typeof(sPara)=="undefined" || sPara.length==0 ){
alert("参数不能为空!");
return ;
}
AsControl.OpenView(sUrl,'ID=' +sPara ,'_self','');
}
function LicensePlateDownload(){
var sId="4c559680c16242c497816604aedce292";
if (typeof(sId)=="undefined" || sId.length==0){
return;
}else{
$("#sqlString").val("save@"+sId);
form1.submit();
}
}
function importExcel(){
var importCondition={};//导入配置
importCondition["templateNo"]="4c559680c16242c497816604aedce292";//导入的模板编号必填s
//增加其他配置参数
importCondition["inputuserid"]="<%=CurUser.getUserID()%>";
importCondition["inputorgid"]="<%=CurUser.getOrgID()%>";
var sparam=JSON.stringify(importCondition).replace(/,/g,"@");//生成模板的参数据
AsDialog.PopView("/Tenwa/Core/OfficeTemplate/TemplateManager/BFTemplateTest/uploadExcel.jsp","importparam="+sparam,
{width:"350px",height:"40px",title:"上传牌照管理数据"},function(){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,"CONTRACT_NUMBER","height="+height+"px");
};
}
function upload(id){
var param="Library_id="+id;
var sUrl="/Tenwa/Comm/DocList/PlateAttachmentUpload.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();
}
<%-- function newRecord(){
AsDialog.OpenSelector("SelectContractCarPhoto","","dialogWidth=" + parseInt(window.screen.width * 0.8) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",function(sReturn){
if(!sReturn||sReturn=="_CANCEL_"||sReturn=="_NONE_"){
//alert(getHtmlMessage('1'));//请选择一条信息!
return;
}
sReturn = sReturn.split("@");
var id=sReturn[0];
AsDialog.OpenSelector("SelectEquipmentCar","ContractId,"+id,"dialogWidth=" + parseInt(window.screen.width * 0.8) + "px dialogHeight=" + parseInt(window.screen.height * 0.6) + "px",function(sReturn){
if(!sReturn||sReturn=="_CANCEL_"||sReturn=="_NONE_"){
//alert(getHtmlMessage('1'));//请选择一条信息!
return;
}
sReturn = sReturn.split("@");
var car_id=sReturn[0];
var param="contract_id="+id+",car_id="+car_id+",inputorgid="+'<%=orgid%>'+",inputuserid="+'<%=userid%>';
var sresult=RunJavaMethodTrans("com.tenwa.channelmanage.CarPhoto", "carPhoto", param);
if(sresult=="false"){
AsDebug.showMessage("提示信息:","该车牌已存在","","",true, 5000);
return;
}else{
var sUrl = "/Tenwa/ChannelPortal/BusinessHanding/CarPhoto/LBCarPhotoDocumentInfo.jsp";
// AsControl.OpenView(sUrl,'','_self','');
var cparam="contract_id="+id+"&car_id="+car_id;
AsDialog.PopView(sUrl,cparam,"dialogWidth=800px;dialogHeight=480px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;",function(){
reloadSelf();
},"新增车牌号");
}
},"请选择车辆");
},"请选择合同");
} --%>
/* function upload(){
var param="contract_id="+getItemValue(0,getRow(0),'id');//主键保存在合同编号里
param+="&ObjectType=CarPhoto";
var sUrl="/Tenwa/ChannelPortal/BusinessHanding/CarPhoto/LBCarPhotoDocumentInfo.jsp";
AsDialog.PopView(sUrl,param,"dialogWidth=480px;dialogHeight=400px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;",function(message){
reloadSelf();
},"上传附件");
} */
/* function do_delete(){
as_delete(0);
}
*/
/* function edit(){
var sUrl = "/Tenwa/ChannelPortal/BusinessHanding/CarPhoto/LBCarPhotoDocumentInfo.jsp";
// AsControl.OpenView(sUrl,'','_self','');
var id=getItemValue(0, getRow(0), "contract_id");
//var car_id=getItemValue(0, getRow(0), "car_id");
//var cparam="contract_id="+id+"&car_id="+car_id;
var cparam="contract_id="+id;
AsDialog.PopView(sUrl,cparam,"dialogWidth=800px;dialogHeight=480px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;",function(){
reloadSelf();
},"修改车牌号");
} */
<%-- function exportExcel(){
var param={};
var tempParam={};
var sparam="";
//模板号
param["templateNo"]="";
//生成文件关联关系
tempParam["OBJECTTYPE"]="牌照管理导出";
tempParam["FLOW_UNID"]="<%=new java.util.Date().getTime()%>";
//生成模板固定参数
tempParam["CurUserId"]="<%=CurUser.getUserID()%>";
tempParam["CurOrgId"]="<%=CurUser.getOrgID()%>";
tempParam["fileSavePath"]="<%=CurConfig.getConfigure("FileSavePath")%>";
param["templateParam"]=JSON.stringify(tempParam).replace(/,/g,"@");//生成模板的参数据
for(var key in param){
if(sparam.length>0){sparam+=",";}
sparam+=key+"="+param[key];
}
var result=RunJavaMethodTrans("com.tenwa.officetempalte.action.CreateOfficeAction","createOfficeByTemplate",sparam);
if(result == "success"){
var attributeID = AsControl.RunJsp("/Tenwa/Lease/Flow/Rent/BatchIncome/GetLBDocAttributeID.jsp",
"FLOW_UNID="+tempParam["FLOW_UNID"]+"&OBJECTTYPE="+tempParam["OBJECTTYPE"]);
downloadFile(attributeID);
}else{
alert("导出失败!");sr
}
}
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");
}
--%>
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>