164 lines
7.1 KiB
Plaintext
164 lines
7.1 KiB
Plaintext
<%@ page contentType="text/html; charset=GBK"%>
|
||
<%@ include file="/Frame/resources/include/include_begin_simplelist.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:
|
||
History Log:
|
||
*/
|
||
String flowunid = CurPage.getParameter("FlowUnid");
|
||
BizObject flow = GetFlowAction.getFlowBussinessObject(flowunid);
|
||
String projid = flow.getAttribute("proj_id").getString();
|
||
String contract_id = flow.getAttribute("contract_id").getString();
|
||
String ishistory = CurPage.getParameter("ishistory");
|
||
String nodeNo=CurPage.getParameter("NodeNo");
|
||
String RightType = CurPage.getParameter("RightType");
|
||
|
||
String sTempletNo = CurPage.getParameter("TempletNo");//模板号
|
||
sTempletNo = "AdjustmentNotice";
|
||
String userName = CurUser.getUserName();
|
||
|
||
String compClientID = request.getParameter("CompClientID");
|
||
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
|
||
doTemp.setVisible("ACTION", true);
|
||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,
|
||
request);
|
||
dwTemp.Style = "1"; //--设置为Grid风格--
|
||
dwTemp.ReadOnly = "1";
|
||
dwTemp.setPageSize(50);
|
||
dwTemp.genHTMLObjectWindow(flowunid);
|
||
|
||
//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","公司盖章","公司盖章","stamp()","","","",""},
|
||
};
|
||
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
|
||
<script type="text/javascript">
|
||
|
||
//在加载完表格后调用
|
||
function afterSearch(){
|
||
var ishistory = "<%=ishistory%>";
|
||
var RightType = "<%=RightType%>";
|
||
for(var i=0;i<getRowCount(0);i++){
|
||
var html="";
|
||
html+='<a onclick=downloadFile(\''+getItemValue(0,i,"V.attrid")+'\')><font color="blue">'+getObj(0,i,"FILENAME").innerHTML+'</font></a>';
|
||
getObj(0,i,"FILENAME").innerHTML=html;
|
||
};
|
||
for(var i=0;i<getRowCount(0);i++){
|
||
// html='<a class="btn_icon_detail" onclick="viewOffice()"> </a> ';
|
||
html='';
|
||
if((null ==RightType||RightType!="ReadOnly")&&(null==ishistory||ishistory!="true")){
|
||
// html+=' <a class="btn_icon_edit" onclick="editOffice()"> </a> <a class="btn_icon_delete"onclick="deleteFile()"> </a> ';
|
||
html+=' <a class="btn_icon_delete"onclick="deleteFile()"> </a> ';
|
||
}
|
||
getObj(0,i,"ACTION").innerHTML=html;
|
||
}
|
||
setColumnWidth(0,"ACTION",150);
|
||
}
|
||
|
||
|
||
function viewOffice(){
|
||
var id = getItemValue(0,getRow(),"V.attrid");
|
||
var filename = getItemValue(0,getRow(),"FILENAME");
|
||
var filetype=filename.substr(filename.indexOf(".")+1);
|
||
var 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 editOffice(){
|
||
var id = getItemValue(0,getRow(),"V.attrid");
|
||
var filename = getItemValue(0,getRow(),"FILENAME");
|
||
var filetype=filename.substr(filename.indexOf(".")+1);
|
||
var status=2;
|
||
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 deleteFile(){
|
||
var id = getItemValue(0,getRow(),"V.attrid");
|
||
var sParams="attId="+id;
|
||
var sReturnInfo = RunJavaMethodTrans("com.tenwa.doc.action.DocListAction","deleteFile",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");
|
||
}
|
||
function generateQuotation()
|
||
{
|
||
var param={};
|
||
var tempParam={};
|
||
var sparam="";
|
||
//模板号
|
||
// param["templateNo"]="e1fc3afacfbc46fea0a881ac20de23cc";
|
||
param["templateNo"]="e14dcf655fb14161be8b1ff7be472cd8";
|
||
//生成文件关联关系
|
||
tempParam["OBJECTTYPE"]="AdjustmentNotice";
|
||
tempParam["FLOW_UNID"]="<%=flowunid%>";
|
||
tempParam["PROJ_ID"]="<%=projid%>";
|
||
tempParam["CONTRACT_ID"]=getItemValue(0,getRow(),"ID");
|
||
tempParam["PAYMENT_NUMBER"]=getItemValue(0,getRow(0),"payment_number");
|
||
//生成模板固定参数
|
||
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","Tdeletequtation","plan_number="+getItemValue(0,getRow(),"ID"));
|
||
if(getItemValue(0,0,"id")==""){
|
||
alert("请生成调息记录!");
|
||
return;
|
||
}
|
||
var result=RunJavaMethodTrans("com.tenwa.officetempalte.action.CreateOfficeAction","createOfficeByTemplate",sparam);
|
||
//word转pdf
|
||
var id = RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","wordToPdfAnnex","FlowUnid=<%=flowunid%>,PLAN_LIST=AdjustmentNotice,contract_id="+getItemValue(0,getRow(),"ID"));
|
||
|
||
reloadSelf();
|
||
|
||
}
|
||
|
||
function stamp(){
|
||
var filename = getItemValue(0,getRow(),"FILENAME");
|
||
if(filename==""){
|
||
alert("请先生成租金调整通知书!!");
|
||
return;
|
||
};
|
||
var result=RunJavaMethodTrans("com.tenwa.channelportal.action.ContractSignAction","TcollectionSignA","FlowUnid=<%=flowunid%>,flagType=AdjustmentNotice,contract_id="+getItemValue(0,getRow(),"ID"));
|
||
if("success"==result){
|
||
alert("盖章成功!!");
|
||
}else{
|
||
alert("盖章失败!!");
|
||
}
|
||
}
|
||
</script>
|
||
<%@ include file="/Frame/resources/include/include_end.jspf"%> |