2018-06-03 22:26:41 +08:00

299 lines
13 KiB
Plaintext
Raw Permalink 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="org.apache.commons.validator.routines.DoubleValidator"%>
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%>
<%@include file="/Accounting/include_accounting.jspf"%>
<%
String PG_TITLE = "核算交易定义列表"; // 浏览器窗口标题 <title> PG_TITLE </title>
%>
<%@include file="/Common/WorkFlow/ApplyList.jsp"%>
<%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript" src="<%=sWebRootPath%>/Accounting/js/loan/common.js"></script>
<script language=javascript >
/*~[Describe=新增交易申请;InputParam=无;OutPutParam=无;]~*/
var tempTransCode = "";
function createTask(){
var transactionDate="";
<%
if(transactionFilter.indexOf("@")<0&&transactionFilter.trim().length()>0&&!transactionFilter.equalsIgnoreCase("All")){%>
var transactionCode = "<%=transactionFilter%>";
<%
} else{
%>
var paraString = "TransactionFilter,<%=transactionFilter%>,UserID,<%=CurUser.getUserID()%>";
var returnValue = setTransactionCodeValue(paraString,"",0,0,"");
if(typeof(returnValue) == "undefined" || returnValue == "" || returnValue == "_CANCEL_" || returnValue == "_CLEAR_")
return;
returnValue = returnValue.split("@");
var transactionCode = returnValue[0];
tempTransCode = transactionCode;
<%
}
%>
var relativeObjectNo = "";
var reverseSerialNo = "";
var transObjectSelector = AsControl.RunJavaMethod("com.amarsoft.app.base.config.impl.TransactionConfig","getTransactionConfig","transactionCode="+transactionCode+",attributeID=SelectCode");
var reverseTransactionCode = AsControl.RunJavaMethod("com.amarsoft.app.base.config.impl.TransactionConfig","getTransactionConfig","transactionCode="+transactionCode+",attributeID=ReverseTransactionCode");
var relativeObjectType = AsControl.RunJavaMethod("com.amarsoft.app.base.config.impl.TransactionConfig","getTransactionConfig","transactionCode="+transactionCode+",attributeID=RelativeObjectType");
if(typeof(transObjectSelector) == "undefined" || transObjectSelector.length == 0){
return;
}
else{
var returnValue = null;
var para = "<%=CurUser.getOrgID()%>%,"+reverseTransactionCode;
returnValue = AsDialog.SelectGridValue_2(transObjectSelector,para,"SERIALNO",null,false);
if(typeof(returnValue) == "undefined" || returnValue == "" || returnValue == "_CANCEL_" || returnValue == "_CLEAR_" || returnValue == null){
return;
}
if(typeof(reverseTransactionCode) == "undefined" || reverseTransactionCode.length == 0 || reverseTransactionCode == null)
{
relativeObjectNo = returnValue;
}
else
{
reverseSerialNo = returnValue;
}
}
// 控制交易申请但未执行成功的各种交易不能重复申请
var allowApplyFlag = RunJavaMethodSqlca("com.amarsoft.acct.accounting.web.GetAllowApplyFlag","getAllowApplyFlag","transactionCode="+transactionCode+",relativeObjectNo="+relativeObjectNo+",relativeObjectType="+relativeObjectType);
if(allowApplyFlag != "true")
{
alert("该业务已经存在一笔未生效的交易记录,不允许同时申请!");
return;
}
var objectType="<%=sApplyType%>";
//创建一笔交易,并返回交易的流水号
var returnValue = AsControl.RunJavaMethodTrans("com.amarsoft.acct.accounting.web.CreateTransaction","createTransaction","TransactionCode="+transactionCode+",RelativeObjectType="+relativeObjectType+",RelativeObjectNo="+relativeObjectNo+",ReverseSerialNo="+reverseSerialNo+",TransactionDate="+transactionDate+",UserID=<%=CurUser.getUserID()%>,OrgID=<%=CurUser.getOrgID()%>");
if(typeof(returnValue) == "undefined" || returnValue == null || returnValue.length ==0) return;
else(returnValue.split("@") !="true")
{
//var sReturn=AsCredit.doAction("0010");
var sParamString = "ObjectType=Transaction&ObjectNo="+returnValue.split("@")[1];//2015111600001002
AsControl.OpenObjectTab(sParamString);
}
reloadSelf();
}
/*~[Describe=交易编辑;InputParam=无;OutPutParam=无;]~*/
function editTask(){
//获得申请类型、申请流水号
var sObjectType = getItemValue(0,getRow(),"ObjectType");
var sObjectNo = getItemValue(0,getRow(),"ObjectNo");
if (typeof(sObjectNo)=="undefined" || sObjectNo.length==0){
alert(getHtmlMessage('1'));//请选择一条信息!
return;
}
var sParamString = "ObjectType=Transaction&ObjectNo="+sObjectNo;
AsControl.OpenObjectTab(sParamString);
reloadSelf();
}
/*~[Describe=交易详情;InputParam=无;OutPutParam=无;]~*/
function viewTask(){
//获得申请类型、申请流水号
var sObjectType = getItemValue(0,getRow(),"ObjectType");
var sObjectNo = getItemValue(0,getRow(),"ObjectNo");
if (typeof(sObjectNo)=="undefined" || sObjectNo.length==0){
alert(getHtmlMessage('1'));//请选择一条信息!
return;
}
var sParamString = "ObjectType=Transaction&ObjectNo="+sObjectNo+"&ViewID=002";
AsControl.OpenObjectTab(sParamString);
reloadSelf();
}
/*~[Describe=取消任务;InputParam=无;OutPutParam=无;]~*/
function cancelApply(){
//获得申请类型、申请流水号
var sObjectType = getItemValue(0,getRow(),"ObjectType");
var sObjectNo = getItemValue(0,getRow(),"ObjectNo");
if (typeof(sObjectNo)=="undefined" || sObjectNo.length==0){
alert(getHtmlMessage('1'));//请选择一条信息!
return;
}
if(confirm(getHtmlMessage('70'))){ //您真的想取消该信息吗?
var returnDeleteValue = RunJavaMethodTrans("com.amarsoft.acct.accounting.web.DeleteTransaction","deleteTransaction","serialno="+sObjectNo);
if(returnDeleteValue.split("@")[0]=="false") {
alert(returnDeleteValue.split("@")[1]);
return;
}
as_delete("myiframe0");
}
reloadSelf();//解决连续多次取消时报错
}
//交易执行
function runTransaction(){
var transactionSerialNo = getItemValue(0,getRow(),"ObjectNo");
if(typeof(transactionSerialNo)=="undefined"||transactionSerialNo.length==0){
alert(getHtmlMessage('1'));
return;
}
var sTransStatus = getItemValue(0,getRow(),"TransStatus");
if(sTransStatus =="1"){
alert("已经记账成功!");
return;
}
var sReturn = RunMethod("LoanAccount","RunTransaction2",transactionSerialNo+",<%=CurUser.getUserID()%>,Y");
if(typeof(sReturn)=="undefined"||sReturn.length==0){
alert("系统处理异常!");
return;
}
alert(sReturn.split("@")[1]);
reloadSelf();
}
/*~[Describe=提交;InputParam=无;OutPutParam=无;]~*/
function doSubmit(){
//add by hwang,新增获取参数sApplyType1申请类型
//获得申请类型、申请流水号、流程编号、阶段编号、申请类型
var sObjectType = getItemValue(0,getRow(),"ObjectType");
var sObjectNo = getItemValue(0,getRow(),"ObjectNo");
var sFlowNo = getItemValue(0,getRow(),"FlowNo");
var sPhaseNo = getItemValue(0,getRow(),"PhaseNo");
var sApplyType1 = "<%=sApplyType%>";
var sOccurType=getItemValue(0,getRow(),"OccurType");
var sTransCode = getItemValue(0,getRow(),"TransCode");
var transStatus = getItemValue(0,getRow(),"TransStatus");
if(typeof(transStatus)=="undefined"||transStatus.length==0 || transStatus !="0"){
alert("请先进行保存再提交");
return;
}
if (typeof(sObjectNo)=="undefined" || sObjectNo.length==0){
alert(getHtmlMessage('1'));//请选择一条信息!
return;
}
//检查该业务是否已经提交了(解决用户打开多个界面进行重复操作而产生的错误)
var sNewPhaseNo=RunJavaMethodTrans("com.amarsoft.app.als.loanafter.action.ClassifyApplyListAction","getPhaseNo","objectType="+sObjectType+",objectNo="+sObjectNo);
if(sNewPhaseNo != sPhaseNo) {
alert(getBusinessMessage('486'));//该申请已经提交了,不能再次提交!
reloadSelf();
return;
}
//获取任务流水号
var sTaskNo = RunJavaMethodTrans("com.amarsoft.app.als.flow.action.CreditAction","getUnfinishedTaskNo","ObjectType="+sObjectType+",ObjectNo="+sObjectNo+",FlowNo="+sFlowNo+",PhaseNo="+sPhaseNo+",UserID=<%=CurUser.getUserID()%>");
if(typeof(sTaskNo)=="undefined" || sTaskNo.length==0) {
alert(getBusinessMessage('500'));//该申请所对应的流程任务不存在,请核对!
return;
}
//检查是否签署意见
var sReturn = RunJavaMethodTrans("com.amarsoft.app.als.workflow.action.CheckOpinionAction","checkOpinion","SerialNo="+sTaskNo,"dialogWidth=0;dialogHeight=0;minimize:yes");
if(typeof(sReturn)=="undefined" || sReturn.length==0) {
alert(getBusinessMessage('501'));//该业务未签署意见,不能提交,请先签署意见!
return;
}
//弹出审批提交选择窗口
var sPhaseInfo = PopPage("/Common/FlowManage/FlowSubmitDialog.jsp?TaskNo="+sTaskNo,"","dialogWidth=580px;dialogHeight=420px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;");
if(typeof(sPhaseInfo)=="undefined" || sPhaseInfo=="" || sPhaseInfo==null || sPhaseInfo=="null" || sPhaseInfo=="_CANCEL_") return;
else if (sPhaseInfo == "success"){
alert(getHtmlMessage('18'));//提交成功!
reloadSelf();
}else if (sPhaseInfo == "Failure"){
alert(getHtmlMessage('9'));//提交失败!
return;
}else{
AsTask.doSubmit(sObjectNo,sObjectType,"<%=CurUser.getUserID()%>");
}
reloadSelf();
}
/*~[Describe=签署意见;InputParam=无;OutPutParam=无;]~*/
function signOpinion(){
var sObjectType = getItemValue(0,getRow(),"ObjectType");
var sSerialNo = getItemValue(0,getRow(),"ObjectNo");
var sFlowNo = getItemValue(0,getRow(),"FlowNo");
var sPhaseNo = getItemValue(0,getRow(),"PhaseNo");
if (typeof(sSerialNo)=="undefined" || sSerialNo.length==0){
alert(getHtmlMessage('1'));//请选择一条信息!
return;
}
//获取Flow_Task表中的任务流水号
var sTaskNo = RunJavaMethodTrans("com.amarsoft.app.als.flow.action.CreditAction","getUnfinishedTaskNo","ObjectType="+sObjectType+",ObjectNo="+sSerialNo+",FlowNo="+sFlowNo+",PhaseNo="+sPhaseNo+",UserID=<%=CurUser.getUserID()%>");
if(typeof(sTaskNo)=="undefined" || sTaskNo.length==0) {
alert(getBusinessMessage('500'));//该申请所对应的流程任务不存在,请核对!
return;
}
//签署意见
var returnValue = PopComp("SignClassifyOpinionInfo","/Common/WorkFlow/SignTaskOpinionInfo.jsp","TaskNo="+sTaskNo+"&ObjectType="+sObjectType+"&ObjectNo="+sSerialNo+"&PhaseNo="+sPhaseNo,"dialogWidth=600px;dialogHeight=450px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;");
if(returnValue=="SUCCESS") doSubmit();//返回值为“success”则弹出提交页面
}
/*~[Describe=查看审批意见;InputParam=无;OutPutParam=无;]~*/
function viewOpinions(){
//获得申请类型、申请流水号、流程编号、阶段编号
var sObjectType = getItemValue(0,getRow(),"ObjectType");
var sObjectNo = getItemValue(0,getRow(),"ObjectNo");
var sFlowNo = getItemValue(0,getRow(),"FlowNo");
var sPhaseNo = getItemValue(0,getRow(),"PhaseNo");
if (typeof(sObjectNo)=="undefined" || sObjectNo.length==0){
alert(getHtmlMessage('1'));//请选择一条信息!
return;
}
popComp("ViewFlowOpinions","/Common/WorkFlow/ViewFlowOpinions.jsp","FlowNo="+sFlowNo+"&PhaseNo=0010&ObjectType="+sObjectType+"&ObjectNo="+sObjectNo,"");
}
//收回
function takeBack(){
var sObjectNo = getItemValue(0,getRow(),"ObjectNo");
if (typeof(sObjectNo)=="undefined" || sObjectNo.length==0){
alert(getHtmlMessage('1'));//请选择一条信息!
return;
}
var sObjectType = getItemValue(0,getRow(),"ObjectType");
AsTask.takeBack(sObjectNo,sObjectType,"<%=CurUser.getUserID()%>");
}
/*~[Describe=打印交易单据;InputParam=无;OutPutParam=无;]~*/
function printBill(){
var transactionSerialNo = getItemValue(0,getRow(),"ObjectNo");
if(typeof(transactionSerialNo)=="undefined"||transactionSerialNo.length==0){
alert(getHtmlMessage('1'));//请选择一条信息!
return;
}
var rtn = RunMethod("BusinessManage","GenerateEDoc","GeneralLedger,"+transactionSerialNo+",KJPZ_1,<%=CurOrg.getOrgID()%>");
if(rtn=="true"){
var sReturn = RunMethod("Insure","CheckPrintSerialNo",transactionSerialNo+",GeneralLedger,KJPZ_1");
OpenComp("EDOCView","/Common/EDOC/EDocView.jsp","SerialNo="+sReturn,"_blank","");
}else{
alert("格式化文档生成失败");
}
}
//打印还款凭证
function printProof(){
var DocumentSerialNo=getItemValue(0,getRow(),"DocumentSerialNo");
var sDocumentType=getItemValue(0,getRow(),"DocumentType");
if(sDocumentType!="jbo.acct.ACCT_TRANS_PAYMENT"){
alert("只有交易名称为还款的才能打印还款凭证");
return;
}
if (typeof(DocumentSerialNo)=="undefined" || DocumentSerialNo.length==0)
{
alert(getHtmlMessage('1'));//请选择一条信息!
}else{
OpenComp("TransactionPrintProof","/Accounting/Transaction/TransactionPrintProof.jsp","DocumentSerialNo="+DocumentSerialNo,"_blank","");
}
}
//打印会计凭证
function printAccounting(){
var DocumentSerialNo=getItemValue(0,getRow(),"DocumentSerialNo");
var sDocumentType=getItemValue(0,getRow(),"DocumentType");
if (typeof(DocumentSerialNo)=="undefined" || DocumentSerialNo.length==0)
{
alert(getHtmlMessage('1'));//请选择一条信息!
return;
}
PopPage("/Accounting/PrintManage/PrintAccounting.jsp?DocumentType="+sDocumentType+"&TransSerialNo="+DocumentSerialNo,"","dialogWidth=730px;dialogHeight=500px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;");
}
</script>
<%@include file="/Frame/resources/include/include_end.jspf"%>