xinyb
2024-03-27 f87909326c2ff2c58da027163f64d9d8f9424b17
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
<%@page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@page import="com.yc.service.build.top.BuildTopIfc"%>
<%@page import="org.springframework.web.context.WebApplicationContext"%>
<%@page import="org.springframework.web.context.support.WebApplicationContextUtils"%>
<% 
  StringBuilder printLink = new StringBuilder();//打印下来按钮
  StringBuilder printButton = new StringBuilder();//打印button按钮
  StringBuilder funcLink = new StringBuilder();//链接下拉按钮
  StringBuilder funcLinkButton = new StringBuilder();//链接button按钮
  String _1 = "1".intern(); //标识1
    int isShowNewDocButton=[?isShowNewDocButton];
  boolean printHasExpression = [?printHasExpression];//是否有表达式
  if(printHasExpression){//有表达式拼装sql
          String reportSql = "[?getReportSQL]";
          reportSql = com.yc.utils.RequestParameterUtils.replaceRequestExpression(reportSql,request,session);
            List<Map<String,Object>> reportInfo =null;
             try{
                 com.yc.multiData.SpObserver.setDBtoInstance("_"+session.getAttribute(SessionKey.DATA_BASE_ID));
                 reportInfo=sqlQueryIfc.queryForList(reportSql,null);//打印链接信息
                 com.yc.service.build.top.PrintLinkSpellUtils.spellPrintLink(reportInfo,formId,formType,printLink,printButton);
            }catch(Exception e){
                 throw new Exception(e.getMessage().replace("'","\\'")+"-打印设置表达式有错误!");
              // out.println("<script>alert('"+e.getMessage().replace("'","\\'")+"-打印设置表达式有错误!')</script>");
              // return;
         }finally{
             com.yc.multiData.SpObserver.setDBtoInstance();
         }
  }
  String notExpressionFuncLink="[?notExpressionFuncLink]";
  String notExpressionFuncLinkButton="[?notExpressionFuncLinkButton]";
  WebApplicationContext wac = WebApplicationContextUtils.getWebApplicationContext(getServletContext());
  BuildTopIfc buildTopIfc = (BuildTopIfc)wac.getBean("BuildTopImpl");
  Map<String,Object> map =null;
  try{
        com.yc.multiData.SpObserver.setDBtoInstance("_"+session.getAttribute(SessionKey.DATA_BASE_ID));
        map=buildTopIfc.buildFuncLinkExpression(formId,formType,doccode,request,session,notExpressionFuncLink,notExpressionFuncLinkButton);
  }catch(Exception e){
        throw new Exception(e.getMessage().replace("'","\\'")+"-功能链接设置表达式有错误!");
       // out.println("<script>alert('"+e.getMessage().replace("'","\\'")+"-功能链接设置表达式有错误!')</script>");
       // return;
  }finally{
     com.yc.multiData.SpObserver.setDBtoInstance();
 }
%>
<script type="text/javascript">
var reportprompts="[?reportprompts]";
var dj="[?dj]";//控制报表的显示隐藏
</script>
<div id="func" style="width:170px;">
    <%if(map.size()>0){ %>
    <%=map.get("funcLink").toString() %>
    <%} %>
</div>
<div id="print" style="width:170px;">
    <%if(printHasExpression){ %>
        
      <%}else{ %>
    
    <%}if(_1==isSuperUser){%>
    <div id="otherFormats">其他格式</div>
    <%} %>
</div>
<script>
    var strkey="";
</script>
<div id="tool">        
        <%if((profile&FormOpUtil.saveRecord)>0){%>
    <a id="tpSave" href="javascript:void(0)" title='快捷键:Alt+S' onclick="save(5)" class="easyui-linkbutton" plain="true"
       iconCls="icon-save">保存</a>
    <script>
        strkey += "if((eCode==83)&&(e.altKey)){save(5);} ";
    </script>
    <%}%>
        <% if((profile&FormOpUtil.confirmDocument)>0){%>
        <a href="javascript:void(0);" id="tpConfirm" title='快捷键:Alt+P' class="easyui-linkbutton" plain="true" iconCls="icon-ok"
           ft="[?ft]" fk="[?fk]" ftformtype="[?ftformtype]" checker="[?checker]" checkername="[?checkername]"
           seekgroupid="[?seekgroupid]" spremissfield="[?spremissfield]" dpremissfield="[?dpremissfield]"
           fkefilter="[?fkefilter]" isshowpwdedit="[?isshowpwdedit]" ftformtype="[?ftformtype]"
           isshowonlinepaymentbutton="[?isshowonlinepaymentbutton]">确定</a>
        <script>
            strkey+="if((eCode==80)&&(e.altKey)){save(3);} ";
        </script>
        <%}%>
        <% if((profile&FormOpUtil.cancelConfirmation)>0){%>
   <span id="spcan"></span>
  <%}%>
   <% if((profile&FormOpUtil.revokeConfirmation)>0){%>
   <span id="sprevoke"></span>
  <%}%>
        <%if(isShowNewDocButton==1&&(profile&FormOpUtil.newDocument)>0){%>
        <a href="javascript:void(0);" id="tpNewDoc" title='快捷键:Alt+N' docType="16" class="easyui-linkbutton" plain="true" iconCls="icon-newDoc">新单</a>
    <script>
            strkey+="if((eCode==78)&&(e.altKey)){openNewDoc();} ";
        </script>
        <%}%>
<script>
 document.onkeydown = keys;
 function keys(event){
        var e=window.event||event;
        var eCode=e.keyCode;
        if(((parent&&parent.userType==="1"))&&(eCode==65)&&(e.ctrlKey)&&(e.shiftKey)){        
              open2_9802('');
        }else if((parent&&parent.userType==="1")&&(eCode==83)&&(e.ctrlKey)&&(e.shiftKey)){    
              open2_9802('s');
        }else if((eCode==82)&&(e.altKey)){        //alt+r ˢ��
              refresh();
        }
        eval(strkey);
 }
</script>        
        <img height="29px" src="/images/space.jpg" align="top"/>        
        <a class="easyui-linkbutton" id="showRestmenuDiv"  onclick="showrestmenu();"  iconCls="icon-down" onblur="restmenuclose();" plain="true">更多</a>
        
        <a id="bhelp" href="javascript:openHelpPage('[?title]');"  class="easyui-linkbutton"  plain="true" iconCls="icon-help">帮助</a>
        
        <%
        ////打印链接
        if((profile&FormOpUtil.printButton)>0){
        if(printHasExpression){ %>
            <%=printButton %>
          <%}else{ %>
            [?printButton]
        <%}
        }        
        ////////功能链接
        %>
            <%if(map.get("funcLinkButton").toString().length()>0){ %>
          <%=map.get("funcLinkButton") %>
          <%} %>
    <%
        if(isshowoutserialbtn==1 || isshowinserialbtn==1 || isShowCycleCountSerialBtn==1){//序列号出库,入库,盘点扫码控制
        String name="",status="",labetype="";
        if(isshowoutserialbtn==1){
        name="序列号扫码出库";
        status=outserialbtneditstatus;
        labetype="out";
        }else if(isshowinserialbtn==1){
        name="序列号扫码入库";
        status=inserialbtneditstatus;
        labetype="in";
        }else{
        name="序列号盘点扫码";
        status=cycleCountSerialBtnEditStatus;
        labetype="cyc";
        }
    %>
    <span>
         <a href="javascript:codeScanning('<%=status%>',<%=formId%>,<%=formType%>,'<%=labetype%>');"  class="easyui-linkbutton"><%=name%></a>
    </span>
    <%
        }
    %>
        <span id="docStatuInfo"></span>
        <span class="OAVerify"></span>
    <%
        Integer selectNextDocumentWhenApproved = 0;
        try{
        selectNextDocumentWhenApproved=(Integer) session.getAttribute(SessionKey.SELECTNEXTDOCUMENTWHENAPPROVED);
        if(selectNextDocumentWhenApproved == null){
        selectNextDocumentWhenApproved=0;
        }
        }catch(Exception e){
        selectNextDocumentWhenApproved= 0;
        }
        if(selectNextDocumentWhenApproved==1 || selectNextDocumentWhenApproved==2){
    %>
    <span class="nextDocIco"><a class="easyui-linkbutton" plain="true" iconCls="icon-nextDoc" title="审核下一单">下一单</a></span>
    <%
        }
    %>
        <div id="tpUpDownDoc">
            <a href="javascript:void(0);" id="Traces" class="easyui-linkbutton" style="display:none" plain="true" title='物流信息' iconCls="icon-kuaid"></a>
            <a href="javascript:void(0);" id="tpqrCodeDoc" class="easyui-linkbutton" plain="true" iconCls="icon-qrbill"></a>
            <a href="javascript:showInfo();" id="tpinfoDoc" class="easyui-linkbutton" plain="true" iconCls="icon-info" title="信息"></a>
            <a href="javascript:void(0);" id="tpFirstDoc" class="easyui-linkbutton" plain="true" iconCls="icon-first" title="第一张单"></a>
            <a href="javascript:void(0);" id="tpUpDoc" class="easyui-linkbutton" plain="true" iconCls="icon-prev" title="上一张单"></a>
            <a href="javascript:void(0);" id="tpDownDoc" class="easyui-linkbutton " plain="true" iconCls="icon-next" title="下一张单"></a>
            <a href="javascript:void(0);" id="tpLastDoc" class="easyui-linkbutton" plain="true" iconCls="icon-last" title="最后一张单"></a>
            <a href="javascript:editCustomControl();" class="easyui-linkbutton first" plain="true" title='自定义控件布局' iconCls="icon-scok">布局</a>
            <a href="javascript:refresh();"  class="easyui-linkbutton" plain="true" title='刷新(Alt+R)' iconCls="icon-reload">刷新</a>
        </div>
</div>
 
<div class="restmenuDiv" id="restmenuDiv"
    onmouseover="showrestmenu();" onmouseout="restmenuclose();">
<table width="520px">
<%if(map.get("funcLink").toString().length()>0){  %>
<tr >
    <td width="80px;"><strong>功能链接:</strong></td>
    <td>
    <%=map.get("funcLink") %>
    </td>
    
</tr>
<%} %>
<tr>
    <td width="80px"><strong>操作选项:</strong></td>
    
    <td>
            <% if(((profile&FormOpUtil.listDoc)>0)){%>
        <a href="javascript:void(0);" id="tpDocList" docType="17"  plain="true" >单据列表</a>&nbsp;&nbsp;
    <%} if(((profile&FormOpUtil.copydoc)>0)){%>
        <a  id="tpCopy"  href="javascript:void(0);" onclick="clearDoc();"plain="true" >复单</a>&nbsp;&nbsp;
        <%}%>
    <% if((profile&FormOpUtil.deleteDocument)>0){%>
    
        <a  href="javascript:void(0);" id="tpDel"plain="true" >删单</a>&nbsp;&nbsp;
        
        <%}%>
        <!--<a  href="javascript:void(0);" id="tpZuoFei"  plain="true" >作废</a>--></td>
</tr>
<% if(((profile&FormOpUtil.printButton)>0&&[?printLinkLength]>0)||printLink.length()>0||_1==isSuperUser){%>
<tr>
    <td width="80px"><strong>打印格式:</strong></td>
    <td>
        <%if(printHasExpression){ %>
                <%=printLink %>
          <%}else{ %>
            [?printLink]
        <%}if(_1==isSuperUser){%>
            <div style="width:80px;display:inline;cursor:pointer" id="otherFormat">其他格式</div>
        <%} %>
    </td>
</tr>
<%} 
  com.yc.service.commons.GfieldIfc gfieldIfc = (com.yc.service.commons.GfieldIfc)com.yc.factory.FactoryBean.getBean("GfieldImpl");
  List<Map<String, Object>> exportList =null;
  StringBuilder sb1 = new StringBuilder();
  try{
        com.yc.multiData.SpObserver.setDBtoInstance("_"+session.getAttribute(SessionKey.DATA_BASE_ID));
        exportList=gfieldIfc.getExportInfo(formId);        
        com.yc.service.build.top.ExportSpellUtils.spellLink(exportList, sb1,profile);
  }catch(Exception e){
      throw e;
        //out.println("<script>alert('"+e.getMessage().replace("'","\\'")+"')</script>");
  }finally{
        com.yc.multiData.SpObserver.setDBtoInstance();
  }        
if(sb1.length()>0){ %>
<tr>
    <td width="80px"><strong>导入导出:<strong></td>
    <td><%out.print(sb1.toString());%></td>
</tr>
<%} %>
</table>
</div>
<%_1 = null;
printLink=null;
printButton=null;
funcLink=null;
funcLinkButton=null;
%>