卡扣导入模板下载

This commit is contained in:
liuzhao 2018-07-27 19:34:11 +08:00
parent a9a4128e80
commit ad5e6010d2
2 changed files with 62 additions and 1 deletions

View File

@ -17,6 +17,7 @@
{"true","All","Button","新增","新增","newRecord()","","","","btn_icon_add",""},
{"true","","Button","详情","详情","viewAndEdit()","","","","btn_icon_detail",""},
{"true","","Button","删除","删除","if(confirm('确实要删除吗?'))as_delete(0)","","","","btn_icon_delete",""},
{"true","","Button","导出科目信息","导出科目信息","exportExcel()","","","","btn_icon_up",""}
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
@ -33,5 +34,43 @@
}
AsControl.OpenView(sUrl,'id=' +sPara ,'_self','');
}
//导出excel
function exportExcel(){
var param={};
var tempParam={};
var sparam="";
//模板号
param["templateNo"]="cb0050f219014b948d2bf2f4aae040a7";
//生成文件关联关系
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("导出失败!");
}
}
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"%>

View File

@ -16,10 +16,32 @@
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标CSS层叠样式 10、风格
String sButtons[][] = {
{"true","All","Button","删除","删除","doDelete()","","","","btn_icon_delete",""},
{"true","","Button","卡扣数据上传","卡扣数据上传","importExcel()","","","","btn_icon_importNew",""}
{"true","","Button","卡扣数据上传","卡扣数据上传","importExcel()","","","","btn_icon_importNew",""},
{"true","","Button","卡扣模版下载","卡扣模版下载","CardDownload()","","","","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">
function CardDownload(){
var sId="5605a63d456d454a81b368dbc765474f";
if (typeof(sId)=="undefined" || sId.length==0){
return;
}else{
$("#sqlString").val("save@"+sId);
form1.submit();
}
}
$(function(){
TableFactory.afterSearch = function(){
setCheckBoxEvent();//搜索页面和排序后执行