149 lines
6.0 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<%@page import="jbo.app.tenwa.calc.LC_CALC_CONDITION_TEMP"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%>
<%@ page import="com.tenwa.doc.action.DocListInitAction" %>
<%@ page import="com.amarsoft.app.lc.workflow.action.GetFlowAction" %>
<%@ page import="com.amarsoft.app.util.*" %>
<%
/*
Author: undefined 2016-09-01
Content: 催收服务委托书 AttorneyLetter.jsp
History Log:
*/
String userId = CurUser.getUserID();
String orgId =CurUser.getOrgID();
System.out.print(orgId);
String falg = "true";
String compClientID = request.getParameter("CompClientID");
ASObjectModel doTemp = new ASObjectModel("AttorneyLetter");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1"; //--设置为Grid风格--
dwTemp.ReadOnly = "1";
dwTemp.setPageSize(pageSize==null?50:Integer.parseInt(pageSize));
dwTemp.MultiSelect = true;
dwTemp.genHTMLObjectWindow(userId);
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标CSS层叠样式 10、风格
String sButtons[][] =null;
sButtons=new String[][]{
{"true","All","Button","生成催收服务委托书","生成催收服务委托书","generateQuotation()","","","","btn_icon_generate"},
{"true","All","Button","批量下载","批量下载","lotdown()","","","","btn_icon_down"},
{"false","All","Button","公司盖章","公司盖章","stamp()","","","",""},
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
//在加载完表格后调用
function afterSearch(){
for(var i=0;i<getRowCount(0);i++){
var html="";
html+='<a onclick=downloadFile(\''+getItemValue(0,i,"attrid")+'\')><font color="blue">'+"下载&nbsp&nbsp&nbsp&nbsp&nbsp"+'</font></a>';
getObj(0,i,"FILENAME").innerHTML=html+'<font >'+getObj(0,i,"FILENAME").innerHTML+'</font>';
};
}
function downloadFile(id){
if(typeof(id)==undefined || id=='') {
alert("请先生成催收服务委托书再下载!");
return;
}
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 generateQuotation(){
var projectId=getItemValueArray(0,"PROJECT_ID");
//var contractNos=getItemValueArray(0,"CONTRACT_NUMBER");
// var subjectIds=getItemValueArray(0,"SUBJECTID");
var number = 0;
if(typeof(projectId)=="undefined"||projectId==null||projectId==""){alert("请选择数据");return;}
for(var i=0;i<projectId.length;i++){
var param={};
var tempParam={};
var sparam="";
param["templateNo"]="69f0423f984a46128292fbd8768f557f";
//生成文件关联关系
tempParam["OBJECTTYPE"]="AttorneyLetter";
tempParam["PROJECTID"]=projectId[i];
tempParam["PROJ_ID"]=projectId[i];
//生成模板固定参数
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 deleteresult=RunJavaMethodTrans("com.tenwa.officetempalte.controller.RentNotinyDeleteAction","deletequtation","projectId="+projectId[i]+",objecttype=AttorneyLetter");
var result=RunJavaMethodTrans("com.tenwa.officetempalte.action.CreateOfficeAction","createOfficeByTemplate",sparam);
number++;
}
if(projectId.length==0){
alert("请先选择数据!!!");
return;
}else if(number==0){
alert("生成失败!!!");
}else if(number==projectId.length){
alert("生成成功!!!");
}else{
alert("部分生成成功!!!");
}
reloadSelf();
}
function lotdown(){
var attrids=getItemValueArray(0,"attrid");
if(typeof(attrids)=="undefined"||attrids==null||attrids==""){alert("请选择");return;}
for( var i=0;i<attrids.length;i++){
if(typeof(attrids[i])=="undefined"||attrids[i]==null||attrids[i]==""){
alert("请先生成催收服务委托书再下载!");
return;
}
}
lotdownloadFile(attrids);
}
function lotdownloadFile(id){
if(!frames["downloadTemplate"]) $("<iframe name='downloadTemplate' style='display:none;'></iframe>").appendTo("body");
window.open(sWebRootPath+"/servlet/view/DownloadZipServlet?CompClientID=<%=sCompClientID%>&id="+id, "downloadTemplate");
}
function stamp(){
var flie = getItemValue(0,getRow(0),"FILENAME");
if(typeof(flie)=="undefined"||flie==null||flie==""){
alert("请先生成催收服务委托书!");
return;
}
var number = 0;
var projectIds=getItemValueArray(0,"ID");
for(var i=0;i<projectIds.length;i++){
var projectId=projectIds[i];
var result=RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","TcollectionSignA","ProjectId="+projectId+",flagType=AttorneyLetter");
if("success"==result){
number++;
}
}
if(projectIds.length==0){
alert("请先选择数据!!!");
return;
}else if(number==0){
alert("盖章失败!!!");
}else if(number==projectIds.length){
alert("盖章成功!!!");
}else{
alert("部分盖章成功!!!");
}
location.reload();
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>