browser_wev8.js
8.91 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
//设计器 value span 浏览框 点击事件 @author wcc @modifier Dracula 2014-7-30
function onShowBrowser(id, url, linkurl, type1, ismand, targetObj, btn) {
if (!!!targetObj) {
targetObj = jQuery(btn).parent().parent().find("select[name=browsertype]");
}
var selectedOption = $(targetObj).find("option:selected");
url = $(selectedOption).attr("_url");
linkurl = "";//$(selectedOption).attr("_linkurl");
type1 = $(selectedOption).val();
var spanId = id + "span";
var inputId = id;
var id1 = null;
if (type1 == 224 || type1 == 225 || type1 == 226 || type1 == 227) {
if (id.split("_")[1]) {
//zzl-拼接行号
url += "_" + id.split("_")[1];
}
}
if (type1 != 162 && type1 != 171 && type1 != 152 && type1 != 142 && type1 != 135 && type1 != 17 && type1 != 18 && type1 != 27 && type1 != 37 && type1 != 56 && type1 != 57 && type1 != 65 && type1 != 165 && type1 != 166 && type1 != 167 && type1 != 168 && type1 != 4 && type1 != 167 && type1 != 164 && type1 != 169 && type1 != 170 && type1 != 194) {
if (type1 == 161) {
id1 = window.showModalDialog(url + "|" + id, window, "dialogWidth=550px;dialogHeight=550px");
} else {
id1 = window.showModalDialog(url, window, "dialogWidth=550px;dialogHeight=550px");
}
} else {
if (type1 == 135) {
tmpids = $GetEle(inputId).value;
id1 = window.showModalDialog(url + "?projectids=" + tmpids, "", "dialogWidth=550px;dialogHeight=550px");
} else {
if (type1 == 4 || type1 == 164 || type1 == 169 || type1 == 170 || type1 == 194) {
tmpids = $GetEle(inputId).value;
id1 = window.showModalDialog(url + "?selectedids=" + tmpids, "", "dialogWidth=550px;dialogHeight=550px");
} else {
if (type1 == 37) {
tmpids = $GetEle(inputId).value;
id1 = window.showModalDialog(url + "?documentids=" + tmpids, "", "dialogWidth=550px;dialogHeight=550px");
} else {
if (type1 == 142) {
tmpids = $GetEle(inputId).value;
id1 = window.showModalDialog(url + "?receiveUnitIds=" + tmpids, "", "dialogWidth=550px;dialogHeight=550px");
} else {
if (type1 == 162) {
tmpids = $GetEle(inputId).value;
if (wuiUtil.isNotNull(funFlag) && funFlag == 3) {
url = url + "&beanids=" + tmpids;
url = url.substring(0, url.indexOf("url=") + 4) + escape(url.substr(url.indexOf("url=") + 4));
id1 = window.showModalDialog(url, "", "dialogWidth=550px;dialogHeight=550px");
} else {
url = url + "|" + id + "&beanids=" + tmpids;
url = url.substring(0, url.indexOf("url=") + 4) + escape(url.substr(url.indexOf("url=") + 4));
id1 = window.showModalDialog(url, window, "dialogWidth=550px;dialogHeight=550px");
}
} else {
if (type1 == 165 || type1 == 166 || type1 == 167 || type1 == 168) {
index = (id + "").indexOf("_");
if (index != -1) {
//tmpids = uescape("?isdetail=1&isbill=<%=isbill%>&fieldid=" + id.substring(0, index) + "&resourceids=" + $GetEle(inputId).value + "&selectedids=" + $GetEle(inputId).value);
tmpids = uescape("?isdetail=1&isbill=&fieldid=" + id.substring(0, index) + "&resourceids=" + $GetEle(inputId).value + "&selectedids=" + $GetEle(inputId).value);
id1 = window.showModalDialog(url + tmpids, "", "dialogWidth=550px;dialogHeight=550px");
} else {
//tmpids = uescape("?fieldid=" + id + "&isbill=<%=isbill%>&resourceids=" + $GetEle(inputId).value + "&selectedids=" + $GetEle(inputId).value);
tmpids = uescape("?fieldid=" + id + "&isbill=&resourceids=" + $GetEle(inputId).value + "&selectedids=" + $GetEle(inputId).value);
id1 = window.showModalDialog(url + tmpids, "", "dialogWidth=550px;dialogHeight=550px");
}
} else {
tmpids = $GetEle(inputId).value;
if (tmpids == "NULL" || tmpids == "Null" || tmpids == "null") {
tmpids = "";
}
id1 = window.showModalDialog(url + "?resourceids=" + tmpids, "", "dialogWidth=550px;dialogHeight=550px");
}
}
}
}
}
}
}
if (id1 != undefined && id1 != null) {
if (type1 == 171 || type1 == 152 || type1 == 142 || type1 == 135 || type1 == 17 || type1 == 18 || type1 == 27 || type1 == 37 || type1 == 56 || type1 == 57 || type1 == 65 || type1 == 166 || type1 == 168 || type1 == 170 || type1 == 194) {
if (wuiUtil.getJsonValueByIndex(id1, 0) != "" && wuiUtil.getJsonValueByIndex(id1, 0) != "0") {
var resourceids = wuiUtil.getJsonValueByIndex(id1, 0);
var resourcename = wuiUtil.getJsonValueByIndex(id1, 1);
var sHtml = "";
resourceids = resourceids.substr(1);
resourcename = resourcename.substr(1);
var tlinkurl = linkurl;
var resourceIdArray = resourceids.split(",");
var resourceNameArray = resourcename.split(",");
for (var _i = 0; _i < resourceIdArray.length; _i++) {
var curid = resourceIdArray[_i];
var curname = resourceNameArray[_i];
if (type1 == 171 || type1 == 152) {
linkno = getWFLinknum("slink" + id + "_rq" + curid);
if (linkno > 0) {
curid = curid + "&wflinkno=" + linkno;
} else {
tlinkurl = linkurl.substring(0, linkurl.indexOf("?") + 1) + "requestid=";
}
}
if (tlinkurl == "/hrm/resource/HrmResource.jsp?id=") {
sHtml += "<a href=javaScript:openhrm(" + curid + "); onclick='pointerXY(event);'>" + curname + "</a> ";
} else {
sHtml += "<a href=" + tlinkurl + curid + " target=_new>" + curname + "</a> ";
}
}
$GetEle(spanId).innerHTML = sHtml;
$GetEle(inputId).value = resourceids;
} else {
if (ismand == 0) {
$GetEle(spanId).innerHTML = "";
} else {
$GetEle(spanId).innerHTML = "<img src='/images/BacoError_wev8.gif' align=absmiddle>";
}
$GetEle(inputId).value = "";
}
} else {
if (wuiUtil.getJsonValueByIndex(id1, 0) != "" && wuiUtil.getJsonValueByIndex(id1, 0) != "0") {
if (type1 == 162) {
var ids = wuiUtil.getJsonValueByIndex(id1, 0);
var names = wuiUtil.getJsonValueByIndex(id1, 1);
var descs = wuiUtil.getJsonValueByIndex(id1, 2);
var href = wuiUtil.getJsonValueByIndex(id1, 3);
sHtml = "";
ids = ids.substr(1);
$GetEle(inputId).value = ids;
names = names.substr(1);
descs = descs.substr(1);
var idArray = ids.split(",");
var nameArray = names.split(",");
var descArray = descs.split(",");
for (var _i = 0; _i < idArray.length; _i++) {
var curid = idArray[_i];
var curname = nameArray[_i];
var curdesc = descArray[_i];
//sHtml += "<a title='" + curdesc + "' >" + curname + "</a> ";
if (href == "") {
sHtml += "<a title='" + curdesc + "' >" + curname + "</a> ";
} else {
sHtml += "<a title='" + curdesc + "' href='" + href + curid + "' target='_blank'>" + curname + "</a> ";
}
}
$GetEle(spanId).innerHTML = sHtml;
return;
}
if (type1 == 161) {
var ids = wuiUtil.getJsonValueByIndex(id1, 0);
var names = wuiUtil.getJsonValueByIndex(id1, 1);
var descs = wuiUtil.getJsonValueByIndex(id1, 2);
var href = wuiUtil.getJsonValueByIndex(id1, 3);
$GetEle(inputId).value = ids;
//sHtml = "<a title='" + descs + "'>" + names + "</a> ";
if (href == "") {
sHtml = "<a title='" + descs + "'>" + names + "</a> ";
} else {
sHtml = "<a title='" + descs + "' href='" + href + ids + "' target='_blank'>" + names + "</a> ";
}
$GetEle(spanId).innerHTML = sHtml;
return;
}
if (type1 == 16) {
curid = wuiUtil.getJsonValueByIndex(id1, 0);
linkno = getWFLinknum("slink" + id + "_rq" + curid);
if (linkno > 0) {
curid = curid + "&wflinkno=" + linkno;
} else {
linkurl = linkurl.substring(0, linkurl.indexOf("?") + 1) + "requestid=";
}
$GetEle(inputId).value = wuiUtil.getJsonValueByIndex(id1, 0);
if (linkurl == "/hrm/resource/HrmResource.jsp?id=") {
$GetEle(spanId).innerHTML = "<a href=javaScript:openhrm(" + curid + "); onclick='pointerXY(e);'>" + wuiUtil.getJsonValueByIndex(id1, 1) + "</a> ";
} else {
$GetEle(spanId).innerHTML = "<a href=" + linkurl + curid + " target='_new'>" + wuiUtil.getJsonValueByIndex(id1, 1) + "</a>";
}
return;
}
if (linkurl == "") {
$GetEle(spanId).innerHTML = "<a href='#1' >"+wuiUtil.getJsonValueByIndex(id1, 1)+"</a>";
} else {
if (linkurl == "/hrm/resource/HrmResource.jsp?id=") {
$GetEle(spanId).innerHTML = "<a href=javaScript:openhrm(" + wuiUtil.getJsonValueByIndex(id1, 0) + "); onclick='pointerXY(event);'>" + wuiUtil.getJsonValueByIndex(id1, 1) + "</a> ";
} else {
$GetEle(spanId).innerHTML = "<a href=" + linkurl + wuiUtil.getJsonValueByIndex(id1, 0) + " target='_new'>" + wuiUtil.getJsonValueByIndex(id1, 1) + "</a>";
}
}
$GetEle(inputId).value = wuiUtil.getJsonValueByIndex(id1, 0);
} else {
if (ismand == 0) {
$GetEle(spanId).innerHTML = "";
} else {
$GetEle(spanId).innerHTML = "<img src='/images/BacoError_wev8.gif' align=absmiddle>";
}
$GetEle(inputId).value = "";
}
}
}
}