<%@page import="com.sun.org.apache.xalan.internal.xsltc.DOM"%>
|
<%@page import="com.yc.service.impl.DBHelper"%>
|
<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
|
<%
|
Date now=new Date();
|
SimpleDateFormat formatDate=new SimpleDateFormat("yyyy-MM-dd");
|
String date=String.valueOf(now.getDate());
|
int isNewOpen=(isNew==null)?1:0;
|
int docstatePan=0;
|
String tableIs="@zhu@";
|
String tableIs2="@minxi@";
|
String sql = "";
|
SqlRowSet SRS =null;//3类型控件遍历下拉数据
|
String addUrl="";//添加传给grid的条件,需要分离
|
Map<String,Object> docMap=new HashMap<String,Object>();//查询获取到的数据信息Map集合
|
List<Map<String, Object>> listInfo=new ArrayList<Map<String, Object>>();//查询获取到的数据信息List集合
|
if((wherePan!=null&&!wherePan.equals(""))||grid!=null){
|
if(wherePan.indexOf("@G@")!=-1){
|
int inds=wherePan.indexOf("@G@");
|
String temp1=wherePan;
|
wherePan=temp1.substring(0,inds);
|
addUrl = " and "+temp1.substring(inds+3);
|
}
|
try{
|
sql="select top 1 @selectColAll@ from ";//只能查一条
|
if(sql.contains("&doccode&")){//by danaus 2011-1-25
|
if(doccode!=null)
|
sql=sql.replaceAll("&doccode&",doccode.replaceAll("'",""));
|
}
|
SpObserver.setDBtoInstance("_"+request.getSession().getAttribute(SessionKey.DATA_BASE_ID));
|
load.setSql(sql);
|
load.setSqlWhere(wherePan);
|
load.setTableName(tableIs);
|
//加载面板数据信息或复单时候加载
|
listInfo=PanelManageBo.getFormLoad(load);
|
if(listInfo.size()>0){
|
docMap.putAll(listInfo.get(0));
|
docstatePan=DBHelper.getValueInt(docMap,"docstatus");
|
}
|
}catch(Exception e){
|
throw e;
|
}finally{
|
SpObserver.setDBtoInstance();
|
}
|
}
|
if(!"".equalsIgnoreCase(doccode)&©==null){
|
//------------增加取消确认功能,从变量取得状态值(docstatePan),权限值(profile),到后台查询及生成相应的代码 by danaus 2014-5-27
|
String cancelDoc="@canceldocstatus@";//取消确认状态值
|
String excep="@sqlException@";//sql表达式
|
String cancel_html="<a id=\"tpCanel\" href=\"javascript:void(0)\" onclick=\"mygrid.iscanelProc=true;save(2);\" class=\"easyui-linkbutton\" plain=\"true\" iconCls=\"icon-cancel\">@CancelBtnName@</a>";//生成取消确认的html代码
|
int iscanel=@iscanel@;//是否设置了取消确认
|
if(iscanel==1){
|
StringBuilder sqlEx= new StringBuilder();
|
sqlEx.append("select case when ");
|
int ex=0;
|
boolean flg=false;
|
if(!"".equalsIgnoreCase(excep)){//存在sql表达式
|
sqlEx.append("("+excep+")");
|
flg=true;
|
}
|
if(!"".equalsIgnoreCase(cancelDoc)){ //存在有状态值
|
if(!"".equalsIgnoreCase(excep)){
|
sqlEx.append(" and (").append(" docstatus in (").append(cancelDoc.replaceAll(";",",")).append("))");
|
}else{
|
sqlEx.append(" docstatus in (").append(cancelDoc.replaceAll(";",",")).append(")");
|
flg=true;
|
}
|
}
|
sqlEx.append((flg?"":" 1=1 ")+" then 1 else 0 end cancelButton from ").append(tableIs);
|
try{
|
ex= PanelManageBo.getCancelButton(DBHelper.getRepAll(sqlEx.toString(),session,docMap,true)+" where doccode='"+doccode.replaceAll("'","")+"'");
|
}catch(DataAccessException ea){//这异常判断单据是否还存在 xin 2018-12-8 17:45:59
|
if(ea instanceof EmptyResultDataAccessException){
|
throw new Exception("该单据不存在!");
|
}else{throw ea;}
|
}catch(Exception e){
|
throw e;
|
}
|
if(ex==1){ //如果能显示,则用js把html代码写回到top页面。
|
%>
|
<script>
|
$("#spcan").html('<%=cancel_html%>');
|
</script>
|
<%
|
}
|
}
|
//------------增加撤回功能,从变量取得状态值(docstatePan),权限值(profile),到后台查询及生成相应的代码 by danaus 2016-11-21
|
String revokeDoc="@RevokeBtnEditStatus@";//状态值
|
String revokeexcep="@RevokeBtnExpression@";//sql表达式
|
String revoke_html="<a id=\"tpCanel\" href=\"javascript:void(0)\" onclick=\"mygrid.isrevokeProc=true;save(2);\" class=\"easyui-linkbutton\" plain=\"true\" iconCls=\"icon-cancel\">撤回</a>";//生成html代码
|
int isrevoke=@isrevoke@;//是否设置了取消确认
|
if(isrevoke==1){
|
StringBuilder sqlEx_revoke= new StringBuilder();
|
sqlEx_revoke.append("select case when ");
|
int ex=0;
|
boolean flg=false;
|
if(!"".equalsIgnoreCase(revokeexcep)){//存在sql表达式
|
sqlEx_revoke.append("("+revokeexcep+")");
|
flg=true;
|
}
|
if(!"".equalsIgnoreCase(revokeDoc)){ //存在有状态值
|
if(!"".equalsIgnoreCase(revokeexcep)){
|
sqlEx_revoke.append(" and (").append(" docstatus in (").append(revokeDoc.replaceAll(";",",")).append("))");
|
} else{
|
sqlEx_revoke.append(" docstatus in (").append(revokeDoc.replaceAll(";",",")).append(")");
|
flg=true;
|
}
|
}
|
sqlEx_revoke.append((flg?"":" 1=1 ")+" then 1 else 0 end cancelButton from ").append(tableIs);
|
try{
|
ex= PanelManageBo.getCancelButton(DBHelper.getRepAll(sqlEx_revoke.toString(),session,docMap,true)+" where doccode='"+doccode.replaceAll("'","")+"'");
|
}catch(DataAccessException ea){//这异常判断单据是否还存在 xin 2018-12-8 17:45:59
|
if(ea instanceof EmptyResultDataAccessException){
|
throw new Exception("该单据不存在!");
|
}else{throw ea;}
|
}catch(Exception e){
|
throw e;
|
}
|
if(ex==1){ //如果能显示,则用js把html代码写回到top页面。
|
%>
|
<script>
|
$("#sprevoke").html('<%=revoke_html%>');
|
</script>
|
<%
|
}
|
}
|
}
|
try{
|
String openDoc="@openDoc@";
|
SpObserver.setDBtoInstance("_"+request.getSession().getAttribute(SessionKey.DATA_BASE_ID));
|
sqlDBHelperIfc.execSql(DBHelper.getProcessAll(openDoc,session,docMap,true));
|
}catch(Exception e){
|
throw e;
|
}finally{
|
SpObserver.setDBtoInstance();
|
}
|
//-------
|
String userName=session.getAttribute(SessionKey.USERNAME)+"";
|
String dbid=session.getAttribute(SessionKey.DATA_BASE_ID)+"";
|
com.yc.app.v2.controller.APPController appController = (com.yc.app.v2.controller.APPController) FactoryBean.getBean("APPController");
|
appController.execRecentAccessFormid(new com.yc.action.grid.RecentAccessEntity(userCode,userName,formId,formType,com.yc.service.impl.DBHelper.replaceBr(com.yc.utils.EncodeUtil.base64Encode(queryString)),formName,doccode.replaceAll("'",""),dbid));
|
//----------
|
JSONObject jsonOldPanel = JSONObject.fromObject(docMap);
|
//下面的调用是执行OA审核按钮 xin 2021-1-30 09:54:54
|
// if(sqlDBHelperIfc.getOAVerifyMethod(docMap,userCode,docstatePan)){ %>
|
<script>
|
$(".OAVerify").html("<a href=\"javascript:OAVerifyMethod("+formId+",<%=docstatePan%>,'<%=DBHelper.getValue(docMap, "doccode")%>');\" id=\"OAVerify\" class=\"easyui-linkbutton\" plain=\"true\" iconCls=\"icon-oasht\" title=\"OA审核\">审核</a>");
|
$(".OAVerify").css("display","none");
|
</script>
|
<%//}%>
|
@linkscript@
|
<style type="text/css">
|
.posPan {
|
border: 0px solid #000000;
|
position: absolute;
|
height: @rowHei@px;
|
width: @kongJian@px;
|
font-size: 13px;
|
z-index: 0;
|
}
|
.miaoshu_pan {
|
height: auto;
|
@maoshuF@
|
padding-top : 5px;
|
width: @miaoShuo@px;
|
white-space: nowrap;
|
overflow: hidden;
|
text-overflow: ellipsis;
|
padding-right: 6px;
|
margin-top: -3px;
|
}
|
</style>
|
<span onclick="panIndex='@index@'" id="panIndex@index@">
|
<script type="text/javascript">
|
var docstatuPan=<%=docstatePan%>;
|
panIndex="@index@";//需要替换
|
qrCode='<%=DBHelper.getValue(docMap,"qrCode")%>';//单据二维码
|
maxCols[panIndex]="@maxCols@";//面板跨列数
|
panMain[panIndex]=clone(panPar);
|
@uploadEditStatusMap@
|
@panInfo@
|
@panelScript@
|
panMain[panIndex].upDoc='<%=DBHelper.getValue(docMap,"upDoc")%>';
|
panMain[panIndex].nextDoc='<%=DBHelper.getValue(docMap,"nextDoc")%>';
|
panMain[panIndex].controlUrl="panelControl@formId@.jsp";
|
panMain[panIndex].isNew=isNew;//是否是新单
|
</script>
|
<%@ include file="/public/template/0/showPan.txt"%>
|
<div class="panelControlDiv">@panelHtml@</div>
|
<div id="tplt-grid"><%@ include file="@formId@_grid.jsp"%></div>
|
<div class="panelControlDiv">@panelDownHtml@</div>
|
<script type="text/javascript">
|
@pansetInv@
|
panMain[panIndex].loadSet(<%=docstatePan%>);
|
panMain[panIndex].keyDown('123','null');
|
</script>
|
</span>
|