保险清单

This commit is contained in:
linxiaoping 2018-06-04 20:32:52 +08:00
parent 7594c30c17
commit a57802ea23
4 changed files with 249 additions and 28 deletions

View File

@ -5,22 +5,24 @@
Content: 示例详情页面
History Log:
*/
String sPrevUrl = CurPage.getParameter("PrevUrl");
String contract_number = CurPage.getParameter("contract_number");
String sPrevUrl = CurPage.getParameter("ID");
if(sPrevUrl == null) sPrevUrl = "";
String sTempletNo = "LBInsuranceInfoDetail";//--模板号--
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
dwTemp.Style = "2";//freeform
dwTemp.genHTMLObjectWindow(CurPage.getParameter("id"));
dwTemp.genHTMLObjectWindow(CurPage.getParameter("ID"));
String sButtons[][] = {
{"true","All","Button","保存","保存所有修改","saveRecord()","","","","btn_icon_save"},
{"true","","Button","·µ»Ø","·µ»ØÁбíÒ³Ãæ","goBack()","","","","btn_icon_return"}
{"true","All","Button","·µ»Ø","·µ»ØÁбíÒ³Ãæ","goBack()","","","","btn_icon_return"}
};
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
<script type="text/javascript">
function goBack(){
AsControl.OpenView("/Tenwa/Lease/App/BussinessOperation/InsuranceInfo/InsuranceInfoList.jsp", "","_self","");
var sPara = "<%=contract_number%>";
AsControl.OpenView("/Tenwa/Lease/App/BussinessOperation/InsuranceInfo/LBInsuranceInfoList.jsp", "contract_number="+sPara,"_self","");
}
function saveRecord(){
as_save("myiframe0");

View File

@ -15,36 +15,23 @@
dwTemp.ReadOnly = "1"; //Ö»¶Áģʽ
dwTemp.setPageSize(10);
dwTemp.genHTMLObjectWindow("");
String sButtons[][] = {
{"true","All","Button","新增","新增","newRecord()","","","","btn_icon_add"},
String sButtons[][] = {
/* {"true","All","Button","ÐÂÔö","ÐÂÔö","newRecord()","","","","btn_icon_add"},
{"true","","Button","ÐÞ¸Ä","ÐÞ¸Ä","viewAndEdit()","","","","btn_icon_detail"},
{"true","","Button","删除","删除","deleteRecord()","","","","btn_icon_delete"}
{"true","","Button","ɾ³ý","ɾ³ý","deleteRecord()","","","","btn_icon_delete"} */
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
function deleteRecord(){
var sPara = getItemValue(0,getRow(0),'ID');
if(typeof(sPara)=="undefined" || sPara.length==0 ){
alert("请选择一条数据!");
return ;
}
if(confirm('确实要删除吗?'))
as_delete(0);
function showNext(){
var param = getItemValue(0,getRow(0),'CONTRACT_NUMBER');
var SUrl = "/Tenwa/Lease/App/BussinessOperation/InsuranceInfo/LBInsuranceInfoList.jsp";
AsControl.OpenView(SUrl,'contract_number=' +param ,'_self','');
}
function newRecord(){
var sUrl = "/Tenwa/Lease/App/BussinessOperation/InsuranceInfo/InsuranceInfoDetail.jsp";
AsControl.OpenView(sUrl,'','_self','');
}
function viewAndEdit(){
var sUrl = "/Tenwa/Lease/App/BussinessOperation/InsuranceInfo/InsuranceInfoDetail.jsp";
var sPara = getItemValue(0,getRow(0),'ID');
if(typeof(sPara)=="undefined" || sPara.length==0 ){
alert("请选择一条数据!");
return ;
function afterSearch(){
for(var i=0;i<getRowCount(0);i++){
getObj(0,i,"CONTRACT_NUMBER").innerHTML='<a class="box" onclick="javascript:showNext()" style={color:#000;text-decoration:underline;}><font color="blue">'+getObj(0,i,"CONTRACT_NUMBER").innerHTML+'</font></a>';
}
AsControl.OpenView(sUrl,'id=' +sPara ,'_self','');
}
afterSearch();
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -0,0 +1,103 @@
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_info.jspf"%><%
/*
Author: undefined 2018-05-31
Content: 示例详情页面
History Log:
*/
String Library_id = CurPage.getParameter("Library_id");
//定义变量
String sObjectNo = "";//--对象编号
//获得组件参数
String flowNo=CurPage.getParameter("FlowNo");
String sPrevUrl = CurPage.getParameter("PrevUrl");
//if(sPrevUrl == null) sPrevUrl = "/Tenwa/Lease/FamilyVisit/fieldSurvey/FieldSurveyList.jsp";
String sTempletNo = "InsureAttachmentUpload";//--模板号--
ASObjectModel doTemp = new ASObjectModel(sTempletNo);
ASObjectWindow dwTemp = new ASObjectWindow(CurPage, doTemp,request);
dwTemp.Style = "2";//freeform
//dwTemp.ReadOnly = "-2";//只读模式
dwTemp.genHTMLObjectWindow(Library_id);
String sButtons[][] = {
{"true","","Button","保存","保存所有修改","importRecord()","","","",""},
{"true","All","Button","取消","返回列表","pull()","","","","btn_icon_close"}
};
/* sButtonPosition = "south"; */
%><%@ include file="/Frame/resources/include/ui/include_info.jspf"%>
<script type="text/javascript">
$(function() {
$("#FILE2").attr("type","file");
$("#myiframe0").attr("enctype","multipart/form-data");
var params={};
params["OBJECTTYPE"]="<%=flowNo%>";
var sparma="";
for(var key in params){
sparma=sparma+"<input type=\"text\" name=\""+key+"\" value=\""+params[key]+"\">"
}
$("#FILE2").append(sparma);
$("#myiframe0").attr("action","<%=sWebRootPath%>/Tenwa/Comm/DocList/DocListUploadTwo.jsp?CompClientID=<%=CurComp.getClientID()%>");
$("#myiframe0").attr("method","post");
});
var lock = false;
function importRecord(){
var o = document.forms["myiframe0"];
var sFileName = o.FILE2.value;
var nameArr = sFileName.split("\\");
setItemValue(0,0,"FileName",encodeURI(nameArr[nameArr.length-1]));
if (typeof(sFileName) == "undefined" || sFileName==""){
alert("请选上传的附件!");
return false;
}
if(/[!@'"#$%&\^*]/.test(nameArr[nameArr.length-1])){
alert("文件名不合法");
return;
}
var flag=CheckStr(nameArr[nameArr.length-1]);
/* if(flag!="true"){
alert("只能上传后缀名为"+flag+"的文件");
return ;
} */
var fileSize;
if(typeof(ActiveXObject) == "function"){ // IE
var fso = new ActiveXObject("Scripting.FileSystemObject");
var f1 = fso.GetFile(sFileName);
fileSize = f1.size;
}else{
fileSize = o.FILE2.files[0].size;
}
if(fileSize > 50*1024*1024){
alert("文件大于50MB不能上传");
return false;
}
if(lock){
//锁已经开启,在提交只会被阻断
AsDebug.showMessage('提醒:','请勿重复点击','','',true);
return false;
}else {
//锁开启,锁关闭只能是数据被处理完毕或者刷新页面,文档重新加载
lock = true;
}
return o.submit();
}
function CheckStr(filename){
var s="jpg,jpeg,png,bmp,gif,pdf,doc,docx,xls,xlsx,txt";
var flag="false";
var s2=s.split(",");
var filenamelast = filename.lastIndexOf(".");
var fileimage = filename.substr(filenamelast+1).toLowerCase();
for(var i=0;i<s2.length;i++){
if(fileimage==s2[i]){
return "true";
}
}
return s;
}
function pull(){
parent.AsDialog.ClosePage("_CANCEL_");
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>

View File

@ -0,0 +1,129 @@
<%@ page contentType="text/html; charset=GBK"%>
<%@ include file="/Frame/resources/include/include_begin_list.jspf"%><%
/*
Author: undefined 2018-06-03
Content:
History Log:
*/
String contract_number = CurPage.getParameter("contract_number");
ASObjectModel doTemp = new ASObjectModel("LBInsuranceInfoTwoList");
if (""!=contract_number || null==contract_number){
doTemp.appendJboWhere("lci.CONTRACT_NUMBER='"+contract_number+"'");
}
ASObjectWindow dwTemp = new ASObjectWindow(CurPage,doTemp,request);
dwTemp.Style="1"; //--设置为Grid风格--
dwTemp.ReadOnly = "1"; //只读模式
dwTemp.setPageSize(10);
dwTemp.genHTMLObjectWindow("");
//0、是否展示 1、 权限控制 2、 展示类型 3、按钮显示名称 4、按钮解释文字 5、按钮触发事件代码 6、 7、 8、 9、图标CSS层叠样式 10、风格
String sButtons[][] = {
{"true","All","Button","新增","新增","newRecord()","","","","btn_icon_add",""},
{"true","","Button","详情","详情","viewAndEdit()","","","","btn_icon_detail",""},
{"true","","Button","删除","删除","if(confirm('确实要删除吗?'))as_delete(0,'alert(getRowCount(0))')","","","","btn_icon_delete",""},
{"true","","Button","返回","返回","returnList()","","","","btn_icon_return",""},
};
%><%@include file="/Frame/resources/include/ui/include_list.jspf"%>
<script type="text/javascript">
function newRecord(){
var sUrl = "/Tenwa/Lease/App/BussinessOperation/InsuranceInfo/InsuranceInfoDetail.jsp";
var contractnumber = "<%=contract_number%>";
AsControl.OpenView(sUrl,'contract_number=' +contractnumber,'_self','');
}
function viewAndEdit(){
var sUrl = "/Tenwa/Lease/App/BussinessOperation/InsuranceInfo/InsuranceInfoDetail.jsp";
var sPara = getItemValue(0,getRow(0),'ID');
var sPara2 = getItemValue(0,getRow(0),'contract_number');
if(typeof(sPara)=="undefined" || sPara.length==0 ){
alert("参数不能为空!");
return ;
}
AsControl.OpenView(sUrl,'ID=' +sPara+'&contract_number='+sPara2,'_self','');
}
function returnList(){
AsControl.OpenView("/Tenwa/Lease/App/BussinessOperation/InsuranceInfo/InsuranceInfoList.jsp",'','_self','');
}
//在加载完表格后调用
function afterSearch(){
for(var i=0;i<getRowCount(0);i++){
getObj(0,i,"operation").innerHTML='<a class="box" onclick="upload(\''+getItemValue(0,i,"id")+'\')" style={color:#000;text-decoration:underline;}><font color="blue">上传</font></a>';
var filelist=getObj(0,i,"filelist").innerHTML;
var obj=eval('('+filelist+')');
var html="";
for(var file in obj){
//if(isReview!="true"&&sRightType!="ReadOnly"&&(sObjectType==obj[file]['objecttype'])&&username.replace(/\s+/g,"&nbsp;")==obj[file]['inputuser']){
// html+='<a class="btn_icon btn_icon_close" onclick="deleteFile(\''+obj[file]['id']+'\');">&nbsp;</a>';
//}
if(obj[file]['image']=="true"){
html+='<a class="btn_icon btn_icon_search" onclick="showImage(\''+obj[file]['id']+'\',\''+obj[file]['filename']+'\');">&nbsp;</a>';
}
if(obj[file]['word']=="true"){
html+='<a class="btn_icon btn_icon_search" onclick="showWord(\''+obj[file]['id']+'\',\''+obj[file]['filename']+'\');">&nbsp;</a>';
}
if(obj[file]['pdf']=="true"){
html+='<a class="btn_icon btn_icon_search" onclick="showPDF(\''+obj[file]['id']+'\',\''+obj[file]['filename']+'\');">&nbsp;</a>';
}
html+='<a onclick=downloadFile(\''+obj[file]['id']+'\')><font color="blue">'+obj[file]['filename']+'</font></a>';
html+='【上传时间:'+obj[file]['inputtime']+'】';
html+='【上传人:'+obj[file]['inputuser']+'】';
html+='【大小:'+Math.floor(obj[file]['FileSize']/1024*100)/100+'kb】';
html+='</br>';
}
getObj(0,i,"filelist").innerHTML=html;
getObj(0,i,"filelist").style["white-space"]="pre-wrap";
var height = getObj(0,i,"filelist").offsetHeight+1;
setItemStyle(0,i,"CONTRACT_NUMBER","height="+height+"px");
};
}
function upload(id){
var param="Library_id="+id;
var sUrl="/Tenwa/Lease/App/BussinessOperation/InsuranceInfo/InsureAttachmentUpload.jsp";
AsDialog.PopView(sUrl,param,"dialogWidth=450px;dialogHeight=400px;resizable=no;scrollbars=no;status:yes;maximize:no;help:no;",function(message){
reloadSelf();
heping();
},"上传附件");
}
function heping(){
$("#TR_Right_myiframe0_0").attr("class","color_zebra0");
huanhang("Doc_Name");
}
function huanhang(col){
var tab=document.getElementById("myiframe0");
var a= getColIndex(0,col);
for(var i=0;i<tab.rows.length-1;i++){
$("#INPUT_myiframe0_"+col+"_"+i+"_"+a).parent().attr("style","white-space: pre-wrap;");
}
}
function showPDF(id,name){
var sUrl="/Tenwa/Comm/DocList/showPDF.jsp";
var param="attrid="+id;
AsControl.OpenPage(sUrl,param,"","");
}
function showWord(id,name){
var sUrl="/Tenwa/Comm/DocList/showWord.jsp";
var param="attrid="+id;
AsControl.OpenPage(sUrl,param,"","");
}
function showImage(id,name){
var sUrl="/Tenwa/Comm/DocList/showImage.jsp";
var param="attrid="+id;
AsDialog.PopView(sUrl,param,"dialogWidth=480px;dialogHeight=400px;",function(message){
},name);
}
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 deleteFile(id){
var sParams="attId="+id;
var sReturnInfo = RunJavaMethodTrans("com.tenwa.doc.action.DocListAction","deleteAttr",sParams);
reloadSelf();
heping();
}
</script>
<%@ include file="/Frame/resources/include/include_end.jspf"%>