169 lines
7.0 KiB
Plaintext
169 lines
7.0 KiB
Plaintext
<%@ page contentType="text/html; charset=GBK"%>
|
||
<%@ include file="/Frame/resources/include/include_begin_simplelist.jspf"%>
|
||
<%@ page import="com.tenwa.doc.action.DocListInitAction" %>
|
||
<%
|
||
/*
|
||
Author: undefined 2016-09-01
|
||
Content:
|
||
History Log:
|
||
*/
|
||
String custid=CurPage.getParameter("customerid");//客户ID
|
||
String mainType= CurPage.getParameter("mainType");
|
||
String docClassItemno="";
|
||
if("Customer".equals(mainType)){
|
||
docClassItemno="001001";
|
||
}else if("Guarantee".equals(mainType)){
|
||
docClassItemno="001002";
|
||
}
|
||
String compClientID = request.getParameter("CompClientID");
|
||
BizObject ent=JBOFactory.createBizObjectQuery("jbo.app.tenwa.customer.CUSTOMER_COMPANY","CUSTOMERID=:customerid").setParameter("customerid", custid).getSingleResult(false);
|
||
BizObject person=JBOFactory.createBizObjectQuery("jbo.app.tenwa.customer.CUSTOMER_PERSON","CUSTOMERID=:customerid").setParameter("customerid", custid).getSingleResult(false);
|
||
if(ent!=null){
|
||
docClassItemno+="001";
|
||
}else if(person!=null){
|
||
docClassItemno+="002";
|
||
}
|
||
Map<String,String> docParam=new HashMap<String,String>();
|
||
Map<String,String> other=new HashMap<String,String>();
|
||
docParam.put("ObjectType","Customer");
|
||
docParam.put("cust_id",custid);
|
||
|
||
//判断是否存在,不存在就从配置表倒到临时表
|
||
DocListInitAction.initDocList(docParam,other,docClassItemno,CurConfig);
|
||
|
||
String sRightType= CurPage.getParameter("RightType");
|
||
|
||
ASObjectModel doTemp = new ASObjectModel("CustomerDocList");
|
||
doTemp.appendJboWhere(" and O.doc_Class_Itemno='"+docClassItemno+"' and rela.cust_id='"+custid+"' and rela.ObjectType='Customer'");
|
||
doTemp.setLockCount(2);
|
||
if("ReadOnly".equals(sRightType)){
|
||
doTemp.setVisible("operation", false);
|
||
}
|
||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
|
||
dwTemp.Style="1"; //--设置为Grid风格--
|
||
dwTemp.ReadOnly = "0";
|
||
dwTemp.setPageSize(50);
|
||
dwTemp.genHTMLObjectWindow("");
|
||
|
||
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标,CSS层叠样式 10、风格
|
||
String sButtons[][] =null;
|
||
|
||
sButtons=new String[][]{
|
||
/* {"true","All","Button","新增","新增","newRecord()","","","",""},
|
||
{"true","All","Button","修改","修改","viewAndEdit()","","","","btn_icon_edit"},
|
||
{"true","","Button","删除","删除","if(confirm('确实要删除吗?'))as_delete(0)","","","","btn_icon_delete",""}, */
|
||
};
|
||
|
||
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
|
||
<script type="text/javascript">
|
||
window.onload=function(){
|
||
$("#DWTD").width( document.body.offsetWidth - 10);
|
||
$("#DWTD").width( document.body.offsetHeight - 20);
|
||
document.getElementById('DWTD').innerHTML = '<div style="width:'+(document.body.offsetWidth - 10)+'px;height:'+(document.body.offsetHeight - 40)+'px;overflow: scroll;">'+document.getElementById('DWTD').innerHTML+'</div>';
|
||
}
|
||
function newRecord(){
|
||
var sUrl = "/Tenwa/Comm/CustomerDoc/CustomerDoc_Info.jsp";
|
||
AsControl.OpenView(sUrl,'','_self','');<%-- "docClassItemno="+<%=docClassItemno%>+"&custid="+<%=custid%> --%>
|
||
}
|
||
function viewAndEdit(){
|
||
var sUrl = "/Tenwa/Comm/CustomerDoc/CustomerDoc_Info.jsp";
|
||
var sPara = getItemValue(0,getRow(0),'ID');
|
||
if(typeof(sPara)=="undefined" || sPara.length==0 ){
|
||
alert("参数不能为空!");
|
||
return ;
|
||
}
|
||
AsControl.OpenView(sUrl,'ID=' +sPara ,'_self','');
|
||
}
|
||
//在加载完表格后调用
|
||
function afterSearch(){
|
||
var sRightType="<%=sRightType%>";
|
||
for(var i=0;i<getRowCount(0);i++){
|
||
if(sRightType!="ReadOnly"){
|
||
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){
|
||
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】<a class="btn_icon_detail" onclick="editOffice(\''+obj[file]['id']+'\',\''+obj[file]['filename']+'\',\''+sRightType+'\')"> </a> ';
|
||
if(sRightType!="ReadOnly"){
|
||
html+='<a class="btn_icon btn_icon_close" onclick="deleteFile(\''+obj[file]['id']+'\');"> </a>'
|
||
}
|
||
if(obj[file]['image']=="true"){
|
||
html+='<a class="btn_icon btn_icon_search" onclick="showImage(\''+obj[file]['id']+'\',\''+obj[file]['filename']+'\');"> </a>';
|
||
}
|
||
if(obj[file]['word']=="true"){
|
||
html+='<a class="btn_icon btn_icon_search" onclick="showWord(\''+obj[file]['id']+'\',\''+obj[file]['filename']+'\');"> </a>';
|
||
}
|
||
if(obj[file]['pdf']=="true"){
|
||
html+='<a class="btn_icon btn_icon_search" onclick="showPDF(\''+obj[file]['id']+'\',\''+obj[file]['filename']+'\');"> </a>';
|
||
}
|
||
html+='</br>';
|
||
}
|
||
getObj(0,i,"filelist").innerHTML=html;
|
||
getObj(0,i,"filelist").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 editOffice(id,filename,sRightType){
|
||
var filetype=filename.substr(filename.indexOf(".")+1);
|
||
var status=2;
|
||
if(sRightType=="ReadOnly"){
|
||
status=1;
|
||
}
|
||
AsDialog.PopView("/Tenwa/Core/OfficeTemplate/OnlineOperation/online/editOfficeOnLine.jsp","filetype="+filetype+"&status="+status+"&id="+id+"&CompClientID=<%=compClientID%>","dialogWidth=1024px;dialogHeight=1000px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;",function(sPhaseInfo){
|
||
if(typeof(sPhaseInfo)=="undefined" || sPhaseInfo=="" || sPhaseInfo==null || sPhaseInfo=="null" || sPhaseInfo=="_CANCEL_") {
|
||
return;
|
||
}else if(sPhaseInfo == "Success" || sPhaseInfo == "success"){
|
||
alert("提交成功!");
|
||
reloadSelf();
|
||
}else{
|
||
alert("提交失败!");
|
||
}
|
||
},"编辑文档");
|
||
} --%>
|
||
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 upload(){
|
||
var id=getItemValue(0,getRow(),"id");
|
||
|
||
var param="Library_id="+id;
|
||
var sUrl="/Tenwa/Comm/DocList/DocListInfo.jsp";
|
||
AsDialog.PopView(sUrl,param,"dialogWidth=480px;dialogHeight=400px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;",function(message){
|
||
|
||
reloadSelf();
|
||
},"上传附件");
|
||
}
|
||
//删除
|
||
function deleteFile(id){
|
||
var sParams="attId="+id;
|
||
var sReturnInfo = RunJavaMethodTrans("com.tenwa.doc.action.DocListAction","deleteAttr",sParams);
|
||
reloadSelf();
|
||
}
|
||
|
||
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"%> |