apzl_leasing/WebContent/Tenwa/Lease/voucher/voucherass_detail.jsp
2021-04-08 10:55:32 +08:00

252 lines
8.9 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 contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><%
/*
Author: undefined 2016-11-10
Content:
History Log:
*/
String sFileSaveMode = CurConfig.getConfigure("FileSaveMode");
String sFileSavePath = CurConfig.getConfigure("FileSavePath");
String sFileNameType = CurConfig.getConfigure("FileNameType");
ASObjectModel doTemp = new ASObjectModel("VOUCHER_V8");
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1"; //--设置为Grid风格--
dwTemp.ReadOnly = "1"; //只读模式
dwTemp.MultiSelect = false; //
dwTemp.setPageSize(pageSize==null?50:Integer.parseInt(pageSize));
dwTemp.genHTMLObjectWindow("");
dwTemp.MultiSelect = true;
doTemp.setLockCount(2);
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标CSS层叠样式 10、风格
String sButtons[][] = {
{"true","","Button","导出凭证","导出凭证","createContractByTemplate()","","","","btn_icon_up",""},
{"false","","Button","1.传输经销商信息入NC","1.传输经销商信息入NC","DistributorToNCInterface()","","","","btn_icon_up",""},
{"true","","Button","1.NC客户传输","1.NC客户传输","CustomerToNCInterface()","","","","btn_icon_up",""},
{"true","","Button","2.NC合同传输","2.NC合同传输","ContractToNCInterface()","","","","btn_icon_up",""},
{"true","","Button","3.NC凭证传输","3.NC凭证传输","VoucherToNCInterface()","","","","btn_icon_up",""},
{"false","","Button","凭证测试","凭证测试","createVoucherTest()","","","","btn_icon_save",""},
//{"true","","Button","刷新辅助账编码","刷新辅助账编码","synVoucherCode()","","","","btn_icon_save",""},
//{"true","","Button","明细","明细","showContractInsurance()","","","","btn_icon_detail",""},
//{"true","","Button","导入金蝶系统","导入金蝶系统","importFK()","","","","btn_icon_up",""},
//{String.valueOf("099".equals(CurUser.getRoleTable().get(0))),"","Button","开启凭证生成","凭证生成开关","voucher_create('open')","","","","btn_icon_submit",""},
//{String.valueOf("099".equals(CurUser.getRoleTable().get(0))),"","Button","关闭凭证生成","凭证生成开关","voucher_create('close')","","","","btn_icon_close",""},
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
function createVoucherTest(){
var mes = RunJavaMethodTrans("com.tenwa.voucher.serviceImp.VoucherTest","test", "userid="+"<%=CurUser.getUserID()%>")
if(mes=="true"){
alert("凭证生成完成 ");
}
}
/**
* 传输经销商信息入NC
*/
function DistributorToNCInterface(){
var res = RunJavaMethodTrans("com.tenwa.voucher.serviceImp.VoucherToNCforDistributor","sendDistriturorData","");
if(res=="true"){
alert("传输成功 !");
}else{
alert("传输失败 !");
}
}
/**
* 传输客户信息入NC
*/
function CustomerToNCInterface(){
var res = RunJavaMethodTrans("com.tenwa.voucher.serviceImp.VoucherToNCforCustomer","sendCustomerData","");
if(res=="true"){
alert("传输成功 !");
}else{
alert("传输失败 !");
}
}
/**
* 传输合同信息入NC
*/
function ContractToNCInterface(){
var res = RunJavaMethodTrans("com.tenwa.voucher.serviceImp.VoucherToNCforAssistContract","sendContractData","");
if(res=="true"){
alert("传输成功 !");
}else{
alert("传输失败 !");
}
}
/**
* 传输凭证信息入NC
*/
function VoucherToNCInterface(){
var res = RunJavaMethodTrans("com.tenwa.voucher.serviceImp.VoucherToNCforVoucherPZ","sendVoucherData","");
if(res=="true"){
alert("传输成功 !");
}else{
alert("传输失败 !");
}
}
function synVoucherCode(){
var ids=getItemValue(0,'f3')+"";
if(ids==""){
layer.alert("请先选择凭证信息!",{icon:7},function(index){
layer.close(index);
});
return;
}
ids = ids.replace(/,/g,"@");
var mes = RunJavaMethodTrans("com.tenwa.leasing.serviceImpl.voucher.VoucherAction","synVoucherCode", "ids="+ids)
layer.alert(mes,{title:"操作信息:",area:'520px'})
}
//是否生成凭证控制
function voucher_create(param){
var return_ = RunJavaMethodTrans("com.tenwa.leasing.serviceImpl.voucher.VoucherAction", "controlCreate", "control_="+param);
if(return_=="success"){
if(param=="open"){
layer.msg("开启成功!",{icon:1,time:500})
}else if(param=="close"){
layer.msg("关闭成功!",{icon:1,time:500})
}
}else{
layer.msg("操作失败,请重试!",{icon:7,time:500})
}
}
function importFK(){
var ids=getItemValueArray(0,'f3')+"";
if(ids==""){
layer.alert("请先选择凭证信息!",{icon:7},function(index){
layer.close(index);
});
return;
}
var flags=getItemValueArray(0,'v8_flag')+"";
var flag=flags.split(",");
var sPara=ids.split(",");
for(var y=0;y<flag.length;y++)
{
if("1"==flag[y])
{
layer.alert("凭证号 "+sPara[y]+"已导出,不能导出!",{icon:7},function(index){
layer.close(index);
});
return;
}
}
var f3=ids.split(",");
for(i=0;i<ids.length;i++){
RunJavaMethodTrans("com.ajax.ImportFK","importFK","f3="+f3[i]);
RunJavaMethodTrans("com.tenwa.leasing.serviceImpl.voucher.VoucherAction","updateVoucherStatus","f3="+f3[i]);
}
layer.alert("导入成功!",{icon:1},function(index){
layer.close(index);
});
}
//导出凭证
function createContractByTemplate(){
//var id=getItemValue(0,getRow(),'f3');
var id = getItemValueArray(0,'f3');
if(id.length == 0){
AsDebug.showMessage("提示:", "请选择一条凭证信息!");
}
var idStr = "";
for(var i=0;i<id.length;i++){
if(i==0) idStr+="";
idStr+="'"+id[i]+"'";
if(i==id.length-1) {
idStr+="";
}else {
idStr+=",";}
}
//var voucher_number=getItemValue(0,0,'voucher_number');
//var flags=getItemValueArray(0,'v8_flag');
/* if(typeof(id)=="undefined" || id.length==0 ){
alert("请选择数据!");
return ;
} */
//导出限制
/* for(var y=0;y<flag.length;y++)
{
if("1"==flag[y])
{
alert("凭证号 "+sPara[y]+"已导出,不能导出!");
return;
}
} */
var param={};
var tempParam={};
var sparam="";
param["templateNo"]="f7ebb9b08fbe4006aeefe51323609e0c";//选择的模板ID
tempParam["Ff3"]=idStr;
tempParam["OBJECTTYPE"]="导出凭证信息";
tempParam["FLOW_UNID"]=new Date().Format("yyyyMMddhhmmssSS");
tempParam["CurUserId"]="<%=CurUser.getUserID()%>"
tempParam["backtype"]="";
//tempParam["voucher_code"]=voucher_number;
tempParam["fileSaveMode"]="<%=sFileSaveMode%>";
tempParam["fileSavePath"]="<%=sFileSavePath%>";
tempParam["fileNameType"]="<%=sFileNameType%>";
param["templateParam"]=JSON.stringify(tempParam).replace(/,/g,"@");//生成模板的参数据
for(var key in param){
if(sparam.length>0){sparam+=",";}
sparam+=key+"="+param[key];
}
/* var sReturn = RunJavaMethodTrans("com.tenwa.file.TemplateManage.FileTemplateUtil","createOfficeByTemplate",sparam);
sparam="f3="+idlist;
var sReturn = RunJavaMethodTrans("com.tenwa.leasing.serviceImpl.voucher.VoucherAction","updateVoucherStatus",sparam); */
// sparam="f3="+idlist;
//return;
//for(i=0;i<1;i++){//f3.length
//alert(sparam.length+"\n"+sparam.substring(0,sparam.length-1)+"@\"voucher_code\":\""+ voucher_number+"\"}");
//sparam = "templateNo=2017041500000002,templateParam={"#f3#":"'41292859828476'@'39985397181043'"@"OBJECTTYPE":"FunctionCreate"@"OBJECTNO":"20170510111204579S"@"CurUserId":"admin"@"backtype":""@"fileSaveMode":"Disk"@"fileSavePath":"d:/tmp/als/Upload"@"fileNameType":"SRC"}"
//拼接凭证号到sparam参数的最后 用replace方法把最后一个 } 替换成 @"voucher_code":"voucher_number"}
var result=RunJavaMethodTrans("com.tenwa.officetempalte.action.CreateOfficeAction","createOfficeByTemplate",sparam);
if(result!="success"){
alert("生成文件失败!");
return;
}else{
var attributeID = AsControl.RunJsp("/Tenwa/Lease/Flow/Rent/BatchIncome/GetLBDocAttributeID.jsp",
"FLOW_UNID="+tempParam["FLOW_UNID"]+"&OBJECTTYPE="+tempParam["OBJECTTYPE"]);
downloadFile(attributeID);
reloadSelf();
/* AsDialog.PopView("/AppConfig/Document/AttachmentFiles.jsp",'AttributeID='+attributeID,"",function(){
reloadSelf();
},"下载文件"); */
}
/* for(i=0;i<id.length;i++){
RunJavaMethodTrans("com.tenwa.leasing.serviceImpl.voucher.VoucherAction","updateVoucherStatus","f3="+id);
} */
}
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 showContractInsurance()
{
var sPara = getItemValue(0,getRow(0),'f3');
var sUrl = "/Tenwa/Lease/voucher/voucherass_info_detail.jsp";
AsControl.OpenTab(sUrl, 'f3='+sPara, {title:sPara+'凭证明细'});
}
//在加载完表格后调用
function afterSearch(){
for(var i=0;i<getRowCount(0);i++){
getObj(0,i,"detail").innerHTML='<a class="box" onclick="javascript:showContractInsurance()" style={color:#000;text-decoration:underline;}><font color="blue">明细</font></a>';
}
}
afterSearch();
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>