ReportDetailStatus.jsp
12.2 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
<%@ page import="weaver.general.Util" %>
<%@ page import="weaver.conn.*" %>
<%@ page language="java" contentType="text/html; charset=GBK" %> <%@ include file="/systeminfo/init.jsp" %>
<jsp:useBean id="rs" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="rs1" class="weaver.conn.RecordSet" scope="page" />
<jsp:useBean id="CustomerInfoComInfo" class="weaver.crm.Maint.CustomerInfoComInfo" scope="page" />
<HTML><HEAD>
<LINK href="/css/Weaver.css" type=text/css rel=STYLESHEET>
</head>
<%
String inprepid = Util.null2String(request.getParameter("inprepid"));
rs.executeProc("T_InputReport_SelectByInprepid",""+inprepid);
rs.next() ;
String inprepname = Util.toScreenToEdit(rs.getString("inprepname"),user.getLanguage()) ;
String inpreptablename = Util.null2String(rs.getString("inpreptablename")) ;
String inprepbugtablename = Util.null2String(rs.getString("inprepbugtablename")) ;
String inprepfrequence = Util.null2String(rs.getString("inprepfrequence")) ;
String inprepbudget = Util.null2String(rs.getString("inprepbudget")) ;
String inprepforecast = Util.null2String(rs.getString("inprepforecast")) ;
String sql = "" ;
String inprepbudgetrq = Util.null2String(request.getParameter("inprepbudgetrq")) ;
if( inprepbudgetrq.equals("")) inprepbudgetrq = "0" ;
if( inprepbudgetrq.equals("1") ) inpreptablename = inpreptablename + "_buget" ;
else if( inprepbudgetrq.equals("2") ) inpreptablename = inpreptablename + "_forecast" ;
String currentdate = Util.null2String(request.getParameter("date")) ;
String currentyear = Util.null2String(request.getParameter("year")) ;
String currentmonth = Util.null2String(request.getParameter("month")) ;
String currentday = Util.null2String(request.getParameter("day")) ;
String thedate = "" ;
if( currentdate.equals("") && inprepfrequence.equals("5")) {
Calendar today = Calendar.getInstance();
today.add(Calendar.DATE, -1) ;
currentyear = Util.add0(today.get(Calendar.YEAR), 4) ;
currentmonth = Util.add0(today.get(Calendar.MONTH) + 1, 2) ;
currentday = Util.add0(today.get(Calendar.DAY_OF_MONTH), 2) ;
currentdate = currentyear + "-" + currentmonth + "-" + currentday ;
}
if( currentyear.equals("") && !inprepfrequence.equals("5")) {
Calendar today = Calendar.getInstance();
currentyear = Util.add0(today.get(Calendar.YEAR), 4) ;
currentmonth = Util.add0(today.get(Calendar.MONTH) + 1, 2) ;
currentday = Util.add0(today.get(Calendar.DAY_OF_MONTH), 2) ;
}
if(!inprepfrequence.equals("0")) {
switch (Util.getIntValue(inprepfrequence)) {
case 1:
thedate = currentyear + "-01-15" ;
break ;
case 2:
thedate = currentyear + "-"+currentmonth+"-15" ;
break ;
case 3:
thedate = currentyear + "-"+currentmonth+"-"+currentday ;
break ;
case 5:
thedate = currentdate ;
break ;
}
}
String imagefilename = "/images/hdHRM.gif";
String titlename = Util.toScreen("输入报表审核",user.getLanguage(),"0") + inprepname ;
String needfav ="1";
String needhelp ="";
%>
<BODY>
<%@ include file="/systeminfo/TopTitle.jsp" %>
<FORM id=weaver name=frmmain method=post action="ReportDetailStatus.jsp">
<input type=hidden name="inprepid" value="<%=inprepid%>">
<input type=hidden name="thedate" value="<%=thedate%>">
<input type=hidden name="thetable" value="<%=inpreptablename%>">
<input type="hidden" name="operation" value="check">
<DIV class=HdrProps></DIV>
<div>
<BUTTON class=btnRefresh accessKey=R type="submit"><U>R</U>-刷新</BUTTON>
<BUTTON class=btnSave accessKey=C type="button" onClick="doConfirm();"><U>C</U>-审核确认</BUTTON>
<BUTTON class=btnSave accessKey=S type="button" onClick="location.href='ReportDetailCheck.jsp?inprepid=<%=inprepid%>&thetable=<%=inpreptablename%>'"><U>S</U>-审核状态</BUTTON>
<BUTTON class=BtnNew id=button2 accessKey=N name=button2 onclick="location.href='/datacenter/input/InputReportDate.jsp?inprepid=<%=inprepid%>&fromcheck=1'"><U>N</U>-<%=SystemEnv.getHtmlLabelName(82,user.getLanguage())%></BUTTON>
<% if(!inprepfrequence.equals("0")) {%>
<BUTTON class=Btn id=button1 accessKey=M name=button1 onclick="location.href='/datacenter/maintenance/reportstatus/ModDate.jsp?type=1&inprepid=<%=inprepid%>'"><U>M</U>-月修正</BUTTON>
<BUTTON class=Btn id=button3 accessKey=Y name=button3 onclick="location.href='/datacenter/maintenance/reportstatus/ModDate.jsp?type=2&inprepid=<%=inprepid%>'"><U>Y</U>-年修正</BUTTON>
<%}%>
</div>
<br>
<table class=viewform>
<COLGROUP><COL width="10%"><COL width="39%"><COL width="2%"><COL width="10%"><COL width="39%">
<TBODY>
<TR class=title colspan=5>
<TH>条件</TH>
</TR>
<TR class=spacing>
<TD class=line1 colspan=5></TD>
</TR>
<TR>
<TD>报表日期</TD>
<TD class=Field>
<% if(!inprepfrequence.equals("5")) { %>
年:<select name="year">
<% for(int i=2 ; i>-3;i--) {
int tempyear = Util.getIntValue(currentyear) - i ;
String selected = "" ;
if( i==0) selected = "selected" ;
%>
<option value="<%=tempyear%>" <%=selected%>><%=tempyear%></option>
<%}%>
</select>
<% if(!inprepfrequence.equals("1")) { %>
月:<select name="month">
<option value="01" <%if(currentmonth.equals("01")) {%>selected<%}%>>1</option>
<option value="02" <%if(currentmonth.equals("02")) {%>selected<%}%>>2</option>
<option value="03" <%if(currentmonth.equals("03")) {%>selected<%}%>>3</option>
<option value="04" <%if(currentmonth.equals("04")) {%>selected<%}%>>4</option>
<option value="05" <%if(currentmonth.equals("05")) {%>selected<%}%>>5</option>
<option value="06" <%if(currentmonth.equals("06")) {%>selected<%}%>>6</option>
<option value="07" <%if(currentmonth.equals("07")) {%>selected<%}%>>7</option>
<option value="08" <%if(currentmonth.equals("08")) {%>selected<%}%>>8</option>
<option value="09" <%if(currentmonth.equals("09")) {%>selected<%}%>>9</option>
<option value="10" <%if(currentmonth.equals("10")) {%>selected<%}%>>10</option>
<option value="11" <%if(currentmonth.equals("11")) {%>selected<%}%>>11</option>
<option value="12" <%if(currentmonth.equals("12")) {%>selected<%}%>>12</option>
</select>
<%}%>
<% if(inprepfrequence.equals("3")) { %>
旬:<select name="day">
<option value="05" <%if(currentday.compareTo("10") < 0 ) {%>selected<%}%>>上旬</option>
<option value="15" <%if(currentmonth.compareTo("10")>=0 && currentmonth.compareTo("20")<0) {%>selected<%}%>>中旬</option>
<option value="25" <%if(currentmonth.compareTo("20") >=0 ) {%>selected<%}%>>下旬</option>
</select>
<%}%>
<%} else {%>
<BUTTON class=Calendar onclick="getDate()"></BUTTON>
<SPAN id=datespan style="FONT-SIZE: x-small"><%=currentdate%></SPAN>
<input type="hidden" name="date" id="date" value="<%=currentdate%>">
<%}%>
</TD>
<TD> </TD>
<TD>类型</TD>
<TD class=field>
<input type="radio" name="inprepbudgetrq" value="0" <%if(inprepbudgetrq.equals("0")) {%>checked <%}%>>实际
<%if(inprepbudget.equals("1")) {%><input type="radio" name="inprepbudgetrq" value="1" <%if(inprepbudgetrq.equals("1")) {%>checked <%}%>>预算<%}%>
<%if(inprepforecast.equals("1")) {%><input type="radio" name="inprepbudgetrq" value="2" <%if(inprepbudgetrq.equals("2")) {%>checked <%}%>>预测<%}%>
</TD>
</TR>
</TBODY>
</table>
<%
int crmcount = 0 ;
int reportcount = 0 ;
int confirmcount = 0 ;
int noreportcount = 0 ;
sql = "select count(*) from " + inpreptablename + " where modtype='0' and reportdate ='" + thedate + "' " ;
rs.executeSql(sql);
if(rs.next()){
reportcount = Util.getIntValue( rs.getString(1) , 0 ) ;
}
sql = "select count(crmid) from T_InputReportCrm where inprepid = " + inprepid ;
rs.executeSql(sql);
if(rs.next()){
crmcount = Util.getIntValue( rs.getString(1) , 0 ) ;
}
sql = "select count(*) from " + inpreptablename + " where modtype='0' and reportdate ='" + thedate + "' and inputstatus != '0' " ;
rs.executeSql(sql);
if(rs.next()){
confirmcount = Util.getIntValue( rs.getString(1) , 0 ) ;
}
noreportcount = crmcount - reportcount ;
%>
<br>
<TABLE class=liststyle cellspacing=1 >
<COLGROUP>
<COL width="40%">
<COL width="20%">
<COL width="20%">
<COL width="20%">
<TBODY>
<TR class=title>
<TH colSpan=2>报表填报状态
(未填报:<IMG SRC="\images\BacoDelete.gif" BORDER="0" HEIGHT="16px" WIDTH="16px"> 已填报:<IMG SRC="\images\iedit.gif" BORDER="0" HEIGHT="16px" WIDTH="16px"> 已确认:<IMG SRC="\images\BacoCheck.gif" BORDER="0" HEIGHT="16px" WIDTH="16px"> 已审核:<IMG SRC="\images\BacoCheckName.gif" BORDER="0" HEIGHT="16px" WIDTH="16px">)
</TH>
<TH colSpan=2 style="TEXT-ALIGN: right">报表填报状态
(应填报:<%=crmcount%> 未填报:<%=noreportcount%> 已填报:<%=reportcount%> 已确认:<%=confirmcount%> )
</TH>
</TR>
<TR class=spacing>
<TD class=line1 colSpan=4 ></TD></TR>
<TR class=Header>
<TD>填报单位</TD>
<TD>填报日期</TD>
<TD>填报状态</TD>
<TD>状态详细</TD>
</TR>
<%
ArrayList inputids = new ArrayList() ;
ArrayList crmids = new ArrayList() ;
ArrayList inputdates = new ArrayList() ;
ArrayList inputstatuss = new ArrayList() ;
boolean hasnocheck = false ;
sql = "select inputid , crmid ,inputdate ,inputstatus from " + inpreptablename + " where modtype='0' and reportdate ='" + thedate + "' " ;
rs.executeSql(sql);
while(rs.next()){
String inputid = Util.null2String(rs.getString("inputid")) ;
String crmid = Util.null2String(rs.getString("crmid")) ;
String inputdate = Util.null2String(rs.getString("inputdate")) ;
String inputstatus = Util.null2String(rs.getString("inputstatus")) ;
inputids.add(inputid) ;
crmids.add(crmid) ;
inputdates.add(inputdate) ;
inputstatuss.add(inputstatus) ;
}
int needchange = 0;
sql = "select crmid from T_InputReportCrm where inprepid = " + inprepid ;
rs.executeSql(sql);
while(rs.next()){
String crmid = Util.null2String(rs.getString("crmid")) ;
int crmidindex = crmids.indexOf( crmid ) ;
String inputid = "" ;
String inputdate = "" ;
String inputstatus = "" ;
if( crmidindex != -1 ) {
inputid = (String)inputids.get( crmidindex ) ;
inputdate = (String)inputdates.get( crmidindex ) ;
inputstatus = (String)inputstatuss.get( crmidindex ) ;
if(inputstatus.equals("0")) hasnocheck = true ;
}
else hasnocheck = true ;
if(needchange ==0){
needchange = 1;
%>
<TR class=datalight>
<%
}else{
needchange=0;
%><TR class=datadark>
<% }%>
<TD><% if( crmidindex != -1) { %><a href='ReportConfirmDetail.jsp?thetable=<%=inpreptablename%>&inputid=<%=inputid%>&inprepid=<%=inprepid%>'><%}%><%=CustomerInfoComInfo.getCustomerInfoname(crmid)%><% if( crmidindex != -1) { %></a><%}%>
</TD>
<TD><%=inputdate%></TD>
<TD>
<% if( crmidindex == -1) { %><IMG SRC="\images\BacoDelete.gif" BORDER="0" HEIGHT="16px" WIDTH="16px">
<% } else if( inputstatus.equals("0") ) {%><IMG SRC="\images\iedit.gif" BORDER="0" HEIGHT="16px" WIDTH="16px">
<% } else if( inputstatus.equals("1") ) {%><IMG SRC="\images\BacoCheck.gif" BORDER="0" HEIGHT="16px" WIDTH="16px">
<% } else if( inputstatus.equals("2") ) {%><IMG SRC="\images\BacoCheckName.gif" BORDER="0" HEIGHT="16px" WIDTH="16px"><%}%>
</TD>
<TD><a href='ReportDetailCrm.jsp?thetable=<%=inpreptablename%>&crmid=<%=crmid%>&inprepid=<%=inprepid%>'>详细</a></TD>
</TR>
<%}%>
</tbody>
</table>
<input type=hidden name="hasnocheck" <% if(hasnocheck) {%>value="1" <%}%>>
</form>
<script language=vbs>
sub getDate()
returndate = window.showModalDialog("/systeminfo/Calendar.jsp",,"dialogHeight:320px;dialogwidth:275px")
if returndate <> "" then
window.document.frmMain.date.value= returndate
datespan.innerHtml = returndate
end if
end sub
</script>
<script language=javascript>
function doConfirm() {
if(document.frmmain.hasnocheck.value=="1") {
alert("还有未填报的单位或为确认的单位,不能审核确认!") ;
}
else {
document.frmmain.action = "ReportConfirmOperation.jsp" ;
document.frmmain.submit() ;
}
}
</script>
</BODY></HTML>