repairModeForm.jsp
13.6 KB
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
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
<%@ page language="java" contentType="text/html; charset=UTF-8" %>
<%@ include file="/systeminfo/init_wev8.jsp" %>
<%@ taglib uri="/WEB-INF/weaver.tld" prefix="wea"%>
<%@ page import="weaver.general.Util" %>
<jsp:useBean id="FormManager" class="weaver.workflow.form.FormManager" scope="session"/>
<jsp:useBean id="CheckSubCompanyRight" class="weaver.systeminfo.systemright.CheckSubCompanyRight" scope="page" />
<jsp:useBean id="SubCompanyComInfo" class="weaver.hrm.company.SubCompanyComInfo" scope="page" />
<jsp:useBean id="RecordSet" class="weaver.conn.RecordSet" scope="page"/>
<jsp:useBean id="ModeSetUtil" class="weaver.formmode.setup.ModeSetUtil" scope="page" />
<html>
<HEAD>
<link type="text/css" href="/js/tabs/css/e8tabs1_wev8.css" rel="stylesheet" />
<script src="/js/tabs/jquery.tabs.extend_wev8.js"></script>
<link rel="stylesheet" href="/css/ecology8/request/searchInput_wev8.css" type="text/css" />
<link href="/mobilemode/css/mec/handler/Navigation_wev8.css" type="text/css" rel="stylesheet" />
<script type="text/javascript" src="/js/ecology8/request/searchInput_wev8.js"></script>
<style type="text/css">
.tablenameCheckLoading{
background: url('/images/messageimages/loading_wev8.gif') no-repeat;
padding-left: 18px;
}
.tablenameCheckSuccess{
background: url('/images/BacoCheck_wev8.gif') no-repeat;
padding-left: 18px;
background-position: left 2px;
}
.tablenameCheckError{
background: url('/images/BacoCross_wev8.gif') no-repeat;
padding-left: 18px;
color: red;
background-position: left 2px;
}
</style>
<style type="text/css">
.checkSuccess{
background: url('/images/BacoCheck_wev8.gif') no-repeat;
padding-left: 20px;
background-position: left 2px;
}
</style>
<%
if(!HrmUserVarify.checkUserRight("FormManage:All", user))
{
response.sendRedirect("/notice/noright.jsp");
return;
}
String navName = SystemEnv.getHtmlLabelName(82191,user.getLanguage());//表单字段修复
%>
<script type="text/javascript">
var parentWin = null;
var dialog = null;
try{
parentWin = parent.getParentWindow(window);
dialog = parent.getDialog(window);
}catch(e){}
$(function(){
$('.e8_box').Tabs({
getLine:1,
mouldID:"<%= MouldIDConst.getID("formmode")%>",
iframe:"tabcontentframe",
staticOnLoad:true,
objName:"<%=navName%>"
});
});
</script>
</head>
<%
int formid = Util.getIntValue(request.getParameter("formid"),-1);
String dialog = Util.null2String(request.getParameter("dialog"),"1");
List<Integer> notExistFieldList = ModeSetUtil.getDatabaseNotExistField(formid);
String fieldIdsForSQL = "";
for(int i = 0; i < notExistFieldList.size(); i++){
fieldIdsForSQL += "'" + notExistFieldList.get(i) + "'";
if(i != (notExistFieldList.size() - 1)){
fieldIdsForSQL += ",";
}
}
%>
<body>
<div class="e8_box demo2" style="overflow:auto;">
<div class="e8_boxhead">
<div class="div_e8_xtree" id="div_e8_xtree"></div>
<div class="e8_tablogo" id="e8_tablogo"></div>
<div class="e8_ultab">
<div class="e8_navtab" id="e8_navtab">
<span id="objName"></span>
</div>
<div>
<ul class="tab_menu">
</ul>
<div id="rightBox" class="e8_rightBox">
</div>
</div>
</div>
</div>
<div class="table" align="center" style="border-top:1px solid #DADADA;">
<table class="ListStyle" cellspacing="1" style="width: 98%;">
<thead>
<tr class="HeaderForXtalbe">
<th width="15%" style="height: 38px;"><%=SystemEnv.getHtmlLabelName(685,user.getLanguage())%><!-- 字段名称 --> </th>
<th width="15%" style="height: 38px;"><%=SystemEnv.getHtmlLabelName(15456,user.getLanguage())%><!-- 字段显示名 --> </th>
<th width="14%" style="height: 38px;"><%=SystemEnv.getHtmlLabelName(17997,user.getLanguage())%><!-- 字段位置 --> </th>
<th width="14%" style="height: 38px;"><%=SystemEnv.getHtmlLabelName(687,user.getLanguage())%><!-- 表现形式 --> </th>
<th width="15%" style="height: 38px;"><%=SystemEnv.getHtmlLabelName(686,user.getLanguage())%><!-- 字段类型 --> </th>
<th width="15%" style="height: 38px;"><%=SystemEnv.getHtmlLabelName(82255,user.getLanguage())%><!-- 问题原因 --> </th>
<th width="12%" style="height: 38px;"><%=SystemEnv.getHtmlLabelName(104,user.getLanguage())%><!-- 操作 --> </th>
</tr>
</thead>
<tbody>
<%
FormFieldTransMethod formFieldTransMethod = new FormFieldTransMethod();
String sql = "select * from workflow_billfield where id in ("+fieldIdsForSQL+") order by viewtype,dsporder,id";
RecordSet.executeSql(sql);
int i = 1;
while(RecordSet.next()){
String fieldid = RecordSet.getString("id");
String fieldlabel = RecordSet.getString("fieldlabel");
String viewtype = RecordSet.getString("viewtype");
String fieldhtmltype = RecordSet.getString("fieldhtmltype");
String type = RecordSet.getString("type");
%>
<tr class="<%if(i%2 == 0){%>DataDark<%}else{%>DataLight<%} %>" style="vertical-align: middle;">
<td align="left" style="height: 38px;"><%=RecordSet.getString("fieldname") %></td>
<td align="left" style="height: 38px;"><%=formFieldTransMethod.getFieldname(fieldlabel, String.valueOf(user.getLanguage())) %></td>
<td align="left" style="height: 38px;"><%=formFieldTransMethod.getViewType(viewtype, String.valueOf(user.getLanguage())) %></td>
<td align="left" style="height: 38px;"><%=formFieldTransMethod.getHTMLType(fieldhtmltype, String.valueOf(user.getLanguage())) %></td>
<td align="left" style="height: 38px;"><%=formFieldTransMethod.getFieldType(type, fieldhtmltype + "+" + fieldid + "+" + String.valueOf(user.getLanguage())) %></td>
<td align="left" style="height: 38px;"><%=SystemEnv.getHtmlLabelName(82256,user.getLanguage())%><!-- 数据库表中不存在此列 --></td>
<td align="left" style="height: 38px;">
<%-- <button id="addFieldToDBBtn_<%=fieldid %>" class="btn" accesskey="N" onclick="javascript:addFieldToDB(<%=fieldid %>);" type="button"><u>N</u>-创建</button> --%>
<div id="addFieldToDBBtn_<%=fieldid %>" class="MADN_SaveBtn"accesskey="N" onclick="javascript:addFieldToDB(<%=fieldid %>);" style="margin-left:0px;left;0;width:104px;position:relative;float:left;"><%=SystemEnv.getHtmlLabelName(125,user.getLanguage())%><!-- 创建 --></div>
<span id="optSpan_<%=fieldid %>"></span>
</td>
</tr>
<%
i++;
}
%>
</tbody>
</table>
</div>
</div>
<%if("1".equals(dialog)){%>
<div id="zDialog_div_bottom" class="zDialog_div_bottom" style="padding:0!important;">
<div style="padding: 5px 0;">
<wea:layout needImportDefaultJsAndCss="false">
<wea:group context="" attributes="{\"groupDisplay\":\"none\"}">
<wea:item type="toolbar"><!-- 关闭 -->
<input type="button" value="<%=SystemEnv.getHtmlLabelName(309,user.getLanguage())%>" id="zd_btn_cancle" class="zd_btn_cancle" onclick="dialog.closeByHand()" style="width: 60px!important;">
</wea:item>
</wea:group>
</wea:layout>
</div>
</div>
<style type="text/css">
.tab_box {
bottom:30px;
}
</style>
<%}%>
<script language="javascript">
function ajaxinit(){
var ajax=false;
try {
ajax = new ActiveXObject("Msxml2.XMLHTTP");
} catch (e) {
try {
ajax = new ActiveXObject("Microsoft.XMLHTTP");
} catch (E) {
ajax = false;
}
}
if (!ajax && typeof XMLHttpRequest!='undefined') {
ajax = new XMLHttpRequest();
}
return ajax;
}
function addFieldToDB(fieldid){
var btn = document.getElementById("addFieldToDBBtn_"+fieldid);
btn.innerHTML = "<%=SystemEnv.getHtmlLabelName(82257,user.getLanguage())%>";//正在创建...
btn.disabled=true;
var optSpan = document.getElementById("optSpan_"+fieldid);
optSpan.innerHTML = "";
var ajax=ajaxinit();
ajax.open("POST", "repairModeFormXml.jsp", true);
ajax.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
ajax.send("src=addFieldToDB&fieldid="+fieldid);
ajax.onreadystatechange = function() {
if (ajax.readyState == 4 && ajax.status == 200) {
try{
if(ajax.responseText == "success"){
btn.parentNode.innerHTML = "<div class=\"checkSuccess\"><%=SystemEnv.getHtmlLabelName(82258,user.getLanguage())%></div>";//已修复
}else if(ajax.responseText == "error"){
btn.innerHTML = "<u>N</u>-<%=SystemEnv.getHtmlLabelName(125,user.getLanguage())%>";//创建
btn.disabled=false;
optSpan.innerHTML = "<br/><font color='red'><%=SystemEnv.getHtmlLabelName(82259,user.getLanguage())%></font>";//创建失败
}else{
btn.innerHTML = "<u>N</u>-<%=SystemEnv.getHtmlLabelName(125,user.getLanguage())%>";//创建
btn.disabled=false;
}
}catch(e){}
}
}
}
var helpURL = "workflow/form/editform.jsp";
function setHelpURL(url){
helpURL = url;
}
function showHelp()
{
var pathKey = helpURL;
//alert(pathKey);
var operationPage = "http://help.e-cology.com.cn/help/RemoteHelp.jsp";
var screenWidth = window.screen.width*1;
var screenHeight = window.screen.height*1;
window.open(operationPage+"?pathKey="+pathKey,"_blank","top=0,left="+(screenWidth-800)/2+",height="+(screenHeight-90)+",width=800,status=no,scrollbars=yes,toolbar=yes,menubar=no,location=no");
}
jQuery(document).ready(function(){
})
jQuery(document).ready(function(){
jQuery(window).resize();
})
</script>
<SCRIPT language="javascript">
function viewSourceUrl(){
prompt("",location);
}
function addformtabsubmit0(obj){
if(check_form(addformtabspecial,'formname,subcompanyid')){
obj.disabled=true;
doPost(addformtabspecial,tab1);
}
}
function deleteform(){
if(isdel()){
addformtabspecial.action = "/workflow/form/delforms.jsp";
addformtabspecial.ajax.value="0";
addformtabspecial.submit();
}
}
var fieldid = new Array();
var fieldlable = new Array();
var curindex = 0;
var currowcalexp = "";
var groups="";
function clearexp(){
currowcalexp = "";
groups="";
curindex=0;
fieldid = new Array();
fieldlable = new Array();
$G("rowcalexp").innerHTML="";
$G("curindex").value=curindex;
}
function deleteRowcal(obj){
//alert(obj.parentElement.parentElement.parentElement.rowIndex);
top.Dialog.confirm("<%=SystemEnv.getHtmlLabelName(18688,user.getLanguage())%>", function (){
allcalexp.deleteRow(jQuery(obj).parent().parent().parent()[0].rowIndex);
}, function () {}, 320, 90,true);
//if(confirm('<%=SystemEnv.getHtmlLabelName(18688,user.getLanguage())%>')){
// allcalexp.deleteRow(jQuery(obj).parent().parent().parent()[0].rowIndex);
//}
}
function rowsaveRole(){
doPost(rowcalfrm,tab4);
}
function rowsaveRole1(){
clearexp();
rowsaveRole();
}
function colsaveRole(){
doPost(colcalfrm,tab5);
}
function setChange(fieldid){
$G("checkitems").value += "field_"+fieldid+"_CN,"
var changefieldids = $G("changefieldids").value;
if(changefieldids.indexOf(fieldid)<0)
$G("changefieldids").value = changefieldids + fieldid + ",";
}
function fieldlablesall(){
if(document.fieldlabelfrm.fieldSize.value!="0")
document.fieldlabelfrm.formfieldlabels.value=document.fieldlabelfrm.selectlangids.value;
doPost(fieldlabelfrm,tab3);
}
function fieldlablesall0(){
var checks = $G("checkitems").value;
if(check_form(fieldlabelfrm,checks)){
doPost(fieldlabelfrm,tab3);
}else{
return;
}
}
var helpURL = "workflow/form/editform.jsp";
function setHelpURL(url){
helpURL = url;
}
function showHelp()
{
var pathKey = helpURL;
//alert(pathKey);
var operationPage = "http://help.e-cology.com.cn/help/RemoteHelp.jsp";
var screenWidth = window.screen.width*1;
var screenHeight = window.screen.height*1;
window.open(operationPage+"?pathKey="+pathKey,"_blank","top=0,left="+(screenWidth-800)/2+",height="+(screenHeight-90)+",width=800,status=no,scrollbars=yes,toolbar=yes,menubar=no,location=no");
}
function fieldlabeldelRow()
{
if (isdel()){
var selectlangids = document.fieldlabelfrm.selectlangids.value;
len = document.fieldlabelfrm.elements.length;
rownum=parseInt(document.fieldlabelfrm.rownum.value);
var i=0;
var temps="";;
var rowsum1 = 0;
for(i=len-1; i >= 0;i--) {
if (document.fieldlabelfrm.elements[i].name=='check_lang')
rowsum1 += 1;
}
for(i=len-1; i >= 0;i--) {
if (document.fieldlabelfrm.elements[i].name=='check_lang'){
if(document.fieldlabelfrm.elements[i].checked==true) {
// if(document.fieldlabelfrm.elements[i].value!='0')
// delids +=","+ document.fieldlabelfrm.elements[i].value;
var tmp = document.fieldlabelfrm.elements[i].value + ',';
if (temps!="")
temps= temps+","+document.fieldlabelfrm.elements[i].value;
else
temps= document.fieldlabelfrm.elements[i].value;
selectlangids=selectlangids.replace(tmp, '');
//alert(selectlangids+" "+tmp+" "+selectlangids);
}
rowsum1 -=1;
}
}
if (temps!="")
{
temparray=temps.split(",");
for (l=0;l<temparray.length;l++)
{
var m=0;
var tempss=temparray[l];
if(oTable.rows[0].cells.length>1)
{
for (k=0;k<oTable.rows[0].cells.length;k++)
{
if (oTable.rows[0].cells[k].innerHTML.indexOf(tempss)>0&&oTable.rows[0].cells[k].innerHTML.indexOf("checkbox")>0)
{
m=k;
}
}
}
for(j=0;j<oTable.rows.length;j++)
{
if(oTable.rows[j].cells.length>1)
{
oTable.rows[j].deleteCell(m);
}
}
}
}
document.fieldlabelfrm.selectlangids.value=selectlangids;
}
}
jQuery(document).ready(function(){
})
jQuery(document).ready(function(){
jQuery(window).resize();
})
</script>
</body>
</html>