225 lines
9.2 KiB
Plaintext
225 lines
9.2 KiB
Plaintext
<%@ page contentType="text/html; charset=GBK"%>
|
||
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%>
|
||
<%@ page import="com.amarsoft.app.lc.workflow.action.GetFlowAction" %>
|
||
<%
|
||
/*
|
||
Author: undefined 2017-05-12
|
||
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 ProductId=CurPage.getParameter("ProductId");//产品编号
|
||
String calType = CurPage.getParameter("calType");
|
||
String sRightType= CurPage.getParameter("RightType");
|
||
String compClientID = CurPage.getParameter("CompClientID");
|
||
String ishistory = CurPage.getParameter("IsHistory");
|
||
String nodeNo=CurPage.getParameter("NodeNo");
|
||
if(sRightType==null){
|
||
sRightType="";
|
||
}
|
||
|
||
String planCName="PROJECT_PLAN_NUMBER";
|
||
if("proj_process".equals(calType)){
|
||
planCName="PROJECT_PLAN_NUMBER";
|
||
}else if("pay_process".equals(calType)){
|
||
planCName="PAYMENT_NUMBER";
|
||
}else{
|
||
planCName="CONTRACT_PLAN_NUMBER";
|
||
}
|
||
|
||
ASObjectModel doTemp = new ASObjectModel("LCCalcPlanTempList");
|
||
doTemp.setVisible(planCName, true);
|
||
if(null!=ishistory&&ishistory.equals("true"))
|
||
{
|
||
doTemp.setDataQueryClass("com.tenwa.lease.flow.flowarchive.calcarchive.CalcListArachiveShow");
|
||
}
|
||
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
|
||
dwTemp.Style="1"; //--设置为Grid风格--
|
||
dwTemp.ReadOnly = "1"; //只读模式
|
||
dwTemp.setPageSize(10);
|
||
dwTemp.genHTMLObjectWindow(flowunid);
|
||
|
||
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标,CSS层叠样式 10、风格
|
||
String sButtons[][] =null;
|
||
if("ContractOnhireChangeFlow".equals(CurPage.getParameter("FlowNo"))){
|
||
sButtons=new String[][] {
|
||
{"true","","Button","详情","详情","viewAndEdit()","","","","btn_icon_edit"},
|
||
};
|
||
}else{
|
||
sButtons=new String[][]{
|
||
{"true","All","Button","新增","新增","newRecord()","","","","btn_icon_add",""},
|
||
{"true","All","Button","复制方案","新增","copyCalc()","","","","btn_icon_add",""},
|
||
{"true","","Button","详情","详情","viewAndEdit()","","","","btn_icon_detail",""},
|
||
{"true","All","Button","删除","删除","if(confirm('确实要删除吗?'))deletePlan()","","","","btn_icon_delete",""},
|
||
{"true","All","Button","生成报价单","生成报价单","generateQuotation()","","","",""},
|
||
};
|
||
}
|
||
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
|
||
<script type="text/javascript">
|
||
function copyCalc(){
|
||
var sPara = getItemValue(0,getRow(0),'ID');
|
||
if(typeof(sPara)=="undefined" || sPara.length==0 ){
|
||
alert("请选择一条记录!");
|
||
return ;
|
||
}
|
||
var sParam="conditionid="+getItemValue(0,getRow(0),"id")+",calType=<%=calType%>";
|
||
var result=RunJavaMethodTrans("com.tenwa.flow.fund.paymentplan.PaymentPlanAction","copyTempCondition",sParam);
|
||
alert(result);
|
||
reloadSelf();
|
||
}
|
||
function newRecord(){
|
||
var sUrl = "/Accounting/LoanSimulation/LoanBasicInfo.jsp";
|
||
var sParam="FlowUnid=<%=flowunid%>&ProductId=<%=ProductId%>&calType=<%=calType%>"
|
||
AsControl.OpenView(sUrl,sParam,'_self','');
|
||
}
|
||
function viewAndEdit(){
|
||
var sUrl = "/Accounting/LoanSimulation/LoanBasicInfo.jsp";
|
||
var sPara = getItemValue(0,getRow(0),'ID');
|
||
var flowunid = getItemValue(0,getRow(0),'FLOWUNID');
|
||
var plannumber = getItemValue(0,getRow(0),'<%=planCName%>');
|
||
if(typeof(sPara)=="undefined" || sPara.length==0 ){
|
||
alert("参数不能为空!");
|
||
return ;
|
||
}
|
||
|
||
var sParam="ID="+sPara+"&FlowUnid="+flowunid+"&plannumber="+plannumber+"&RightType=<%=sRightType%>&ProductId=<%=ProductId%>&calType=<%=calType%>";
|
||
sParam+="&NodeNo=<%=nodeNo%>";
|
||
AsControl.OpenView(sUrl,sParam,'_self','');
|
||
}
|
||
|
||
function deletePlan(){
|
||
var flowunid = getItemValue(0,getRow(0),'FLOWUNID');
|
||
var planCName="<%=planCName%>";
|
||
var plannumber = getItemValue(0,getRow(0),'<%=planCName%>');
|
||
var sParam="flowunid="+flowunid+",plannumber="+plannumber+",planCName="+planCName;
|
||
var result=RunJavaMethodTrans("com.tenwa.reckon.executor.CreateTransactionExecutor","deletePlan",sParam);
|
||
alert(result);
|
||
reloadSelf();
|
||
}
|
||
function generateQuotation()
|
||
{
|
||
var param={};
|
||
var tempParam={};
|
||
var sparam="";
|
||
var sPara = getItemValue(0,getRow(0),'ID');
|
||
var PROJECT_PLAN_NUMBER=getItemValue(0,getRow(0),'PROJECT_PLAN_NUMBER');
|
||
var CONTRACT_PLAN_NUMBER=getItemValue(0,getRow(0),'CONTRACT_PLAN_NUMBER');
|
||
var PAYMENT_NUMBER=getItemValue(0,getRow(0),'PAYMENT_NUMBER');
|
||
if(typeof(sPara)=="undefined" || sPara.length==0 ){
|
||
alert("请选择一条信息!");
|
||
return ;
|
||
}
|
||
//模板号
|
||
param["templateNo"]="2017052300000001";
|
||
//生成文件关联关系
|
||
tempParam["OBJECTTYPE"]="报价单";
|
||
tempParam["FLOW_UNID"]="<%=flowunid%>";
|
||
tempParam["PROJ_ID"]="<%=projid%>";
|
||
if("<%=contract_id%>".length>0)
|
||
{
|
||
tempParam["CONTRACT_ID"]="<%=contract_id%>";
|
||
}
|
||
tempParam["contract_id"]="<%=contract_id%>";
|
||
tempParam["PROJ_PLAN_NUMBER"]=getItemValue(0,getRow(0),'<%=planCName%>');
|
||
tempParam["CONTRACT_PLAN_NUMBER"]=getItemValue(0,getRow(0),'<%=planCName%>');
|
||
tempParam["PLAN_NUMBER"]=getItemValue(0,getRow(0),'<%=planCName%>');
|
||
//生成模板固定参数
|
||
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 deleteparam="";
|
||
if('<%=planCName%>'=='PROJECT_PLAN_NUMBER'){
|
||
deleteparam="PROJECT_PLAN_NUMBER="+PROJECT_PLAN_NUMBER;
|
||
}else if('<%=planCName%>'=='CONTRACT_PLAN_NUMBER'){
|
||
deleteparam="CONTRACT_PLAN_NUMBER="+CONTRACT_PLAN_NUMBER;
|
||
}else{
|
||
deleteparam="CONTRACT_PLAN_NUMBER="+PAYMENT_NUMBER;
|
||
}
|
||
|
||
var deleteresult=RunJavaMethodTrans("com.tenwa.officetempalte.controller.QutationAction","deletequtation",deleteparam);
|
||
var result=RunJavaMethodTrans("com.tenwa.officetempalte.action.CreateOfficeAction","createOfficeByTemplate",sparam);
|
||
if("success"==result){
|
||
alert("生成成功!");
|
||
}
|
||
reloadSelf();
|
||
|
||
}
|
||
//在加载完表格后调用
|
||
function afterSearch(){
|
||
var RightType = "<%=sRightType%>";
|
||
var ishistory = "<%=ishistory%>";
|
||
for(var i=0;i<getRowCount(0);i++){
|
||
var html="";
|
||
html+='<a onclick=downloadFile(\''+getItemValue(0,i,"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> ';
|
||
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> ';
|
||
}
|
||
getObj(0,i,"ACTION").innerHTML=html;
|
||
}
|
||
setColumnWidth(0,"ACTION",150);
|
||
}
|
||
|
||
|
||
function viewOffice(){
|
||
var id = getItemValue(0,getRow(),"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(),"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(),"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");
|
||
}
|
||
</script>
|
||
<%@ include file="/Frame/resources/include/include_end.jspf"%>
|