?? default.asp
字號:
<!-- #include virtual="/eB3KTransaction.asp" -->
<!-- #include virtual="/Server/ebo.asp" -->
<!-- #include virtual="/Server/cblib.asp" -->
<!-- #include file="../Common.asp" -->
<!-- #include virtual="/Server/SqlReport.asp" -->
<!-- #include virtual="/Server/ReportBD.asp" -->
<!-- #include virtual="/Server/rawdata.asp" -->
<HTML><HEAD><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><LINK REL=stylesheet HREF="/Client/All.css" TYPE="text/css"><script src="/Client/ebComm.js"></script><title></title></HEAD>
<script src="/client/ebo.js"></script>
<script src="/client/Request.js"></script>
<script src="/client/IClient.js"></script>
<script src="/client/grid.js"></script>
<script src="/client/cblib.js"></script>
<script src="/client/print.js"></script>
<%
dim iListWidth,szFrom,szSQL,szSQL1,szSQL2
dim ciCount,datefrom,dateto,memo,eboRegiCount, sRadio
eboRegiCount=0
ciCount=CLng(GetForm("ChildDetail_rows"))
datefrom=GetForm("DateFrom")
dateto=GetForm("DateTo")
memo=(GetForm("Memo"))
sRadio=CLng(GetForm("RadioCheck"))
if IsDate(datefrom) then
datefrom=DateSerial(year(datefrom), month(datefrom), day(datefrom))
else
err.Raise 10000, "BuyPlanReport", "請輸入正確的起始日期!"
end if
if IsDate(dateto) then
dateto=DateSerial(year(DateTo), month(DateTo), day(DateTo))
elseif dateto="" then
dateto=DateSerial(year(Now()), month(Now()), day(Now()))
else
err.Raise 10000, "BuyPlanReport", "請輸入正確的起始日期!"
end if
dateto=DateADD("d",1,dateto)
dim SQLString
function SQLWhereOR(szField,szServerSideName,iTotalCount)
dim i, szWhere
szWhere = " "
for i = 0 to iTotalCount-1
if i > 0 then szWhere = szWhere & " OR "
szWhere = szWhere & szField & "=" & GetForm(szServerSideName & i)
next
SQLWhereOR=szWhere
end function
dim szWhere
if ciCount=0 then
if sRadio=1 then
szWhere="AND [vt].[AccountID] IN (SELECT [biCorperation].[ID] FROM [bdUserArea] AS [vt],[bdUserAreaList] AS [vl],biCorperation,biArea WHERE [vt].[ID]=[vl].[ID] AND [vl].[int2]=2 AND [biArea].[ID]=[vl].[ProductID] AND [biCorperation].[BigInt1]=[biArea].[ID] AND [vt].[bigint1]=" & Owner &")"
else
szWhere="AND [vt].[AccountID] IN (SELECT [biCorperation].[ID] FROM [bdUserArea] AS [vt],[bdUserAreaList] AS [vl],biCorperation,biSection WHERE [vt].[ID]=[vl].[ID] AND [vl].[int2]=1 AND [biSection].[ID]=[vl].[ProductID] AND [biCorperation].[BigInt2]=[biSection].[ID] AND [vt].[bigint1]=" & Owner &")"
end if
else
szWhere=SQLWhereOR("[vt].[AccountID]","childDetail_0_",ciCount)
szWhere="AND (" & szWhere & ")"
end if
szSQL1="SELECT " & "'"& datefrom &"'"& " AS [STARTTIME], "&"'"& dateto &"'"&" AS [ENDTIME], [bic].[Title] AS [CORPERATION], [bip].[Title] AS [PRODUCTNAME], [bip].[nvarchar1] AS [PREC], SUM([vl].[Quantity]) AS [PLANNUM], 0 AS [NUM] " &_
" FROM [BillDocument] AS [vt], [BillDocumentList] AS [vl], [biCorperation] AS [bic], [biProduct] AS [bip]" &_
" WHERE [vt].[ID]=[vl].[ID] AND [bic].[ID]=[vt].[AccountID] AND [bip].[ID]= [vl].[ProductID] AND [vt].[BillType]=6 AND [vt].[DateTime1]>="&"'"& datefrom &"'"&" AND [vt].[DateTime2]<"&"'"& dateto &"'"&" "& szWhere &_
" GROUP BY [bic].[Title], [bip].[Title], [bip].[nvarchar1]"
szSQL2="SELECT "&"'"& datefrom &"'"&" AS [STARTTIME], "&"'"& dateto &"'"&" AS [ENDTIME], [bic].[Title] AS [CORPERATION], [bip].[Title] AS [PRODUCTNAME], [bip].[nvarchar1] AS [PREC], 0 AS [PLANNUM], SUM([vl].[Quantity]) AS [NUM] " &_
" FROM [BillDocument] AS [vt], [BillDocumentList] AS [vl],[biCorperation] AS [bic],[biProduct] AS [bip] " &_
" WHERE [vt].[ID]=[vl].[ID] AND [bic].[ID]=[vt].[AccountID] AND [bip].[ID]=[vl].[ProductID] AND [vt].[BillType]=15 AND [vt].[AuditID]<>0 AND [vt].[UpdateDate]>="&"'"& datefrom &"'"&" AND [vt].[UpdateDate]<"&"'"& dateto &"'"&" "& szWhere &_
" GROUP BY [bic].[Title], [bip].[Title], [bip].[nvarchar1]"
szSQL="SELECT "&"'"& datefrom &"'"&" AS [計劃時間], "&"'"& dateto &"'"&" AS [結束時間], [NV].[CORPERATION] AS [子公司], [NV].[PRODUCTNAME] AS [品名], [NV].[PREC] AS [規格],SUM([NV].[PLANNUM]) AS [采購數量],SUM([NV].[NUM]) AS [完成數量] " &_
" FROM ( "& szSQL1 &" UNION "& szSQL2 &" ) AS [nv]" &_
" GROUP BY [NV].[STARTTIME], [NV].[ENDTIME], [NV].[CORPERATION], [NV].[PRODUCTNAME], [NV].[PREC]" &_
" ORDER BY [采購數量] DESC"
eboReg 1, "gridCols", "iCols", "", "cbLocalVariable"
eboReg 2, "gridTilte_", "szTitle", "", "cbLocalVariable"
dim iCols, szTitle, szValue
dim i,rs
Response.Write "<script>" & VBCrLf
Set rs = Server.CreateObject("ADODB.RecordSet")rs.open szSQL,Conn,1,1
IData2d 0,1iCols=rs.Fields.Count
eboGet 1, nothing, nothingIData2d 1,2for i=0 to rs.Fields.Count-1
szTitle=rs.Fields.Item(i).Name eboGet 2, nothing, nothing
next
rawGet rs
Set rs = Nothing
Response.Write "</script>" & VBCrLf
%>
<LINK REL=stylesheet HREF="/Client/All.css" TYPE="text/css"><script src="/Client/ebComm.js"></script><BODY>
<Table>
<tr><td><div align=center id=sTitle><font size=4><b><u>采 購 計 劃 完 成 情 況 表</u></b></font></div></td></tr>
<tr><td><div id=sTime>查詢時間:<%=FormatDatetime(DateFrom,1)%> — <%=FormatDatetime(DateAdd("d",-1,DateTo),1)%></div></td></tr>
<tr><td><div id=SelectArea></div></td></tr>
</Table>
<div> <input type=button value="預覽" onClick=displayPrint(sTitle,sTime,40,1)> <input type=button value="打印" onClick=displayPrint(sTitle,sTime,40,0)></div>
</BODY>
<script>
function ecbDetail(eo,szEvent,x,y){
if (szEvent=='MOUSECLICK'){
}
}
function getGridWidth(titleText){
switch(titleText){
case '計劃時間':
return 50;
break;
case '完成時間':
return 50;
break;
case '子公司':
return 100;
break;
case '品名':
return 160;
break;
case '規格':
return 100;
break;
default:
return 80;
}
}
function getGridNumeric(titleText){
switch(titleText){
case '采購數量':
return 1;
break;
case '完成數量':
return 1;
break;
default:
return 0;
}
}
function getGridAlign(titleText){
switch(titleText){
case '期初庫存':
return 'right';
break;
case '完成數量':
return 'right';
break;
default:
return '';
}
}
function getGridTotal(titleText){
switch(titleText){
case '采購數量':
return 1;
break;
case '完成數量':
return 1;
break;
default:
return 0;
}
}
function makeGrid(indata){
var gridCols=parseInt(indata.item('gridCols'));
var gDetail = new ZYDGRID(new ZYDGRIDFORIEBUG(),SelectArea,20,gridCols,'100%','',1,testUndefine,IRAWDataEnd(),ecbDetail);
gDetail.title[0].text='№';
for (var i=0;i<gridCols;i++){
gDetail.title[i+1].text=indata.item('gridTilte_'+i);
gDetail.title[i+1].width=getGridWidth(indata.item('gridTilte_'+i));
gDetail.title[i+1].isNumeric=getGridNumeric(indata.item('gridTilte_'+i));
gDetail.title[i+1].formAlign=getGridAlign(indata.item('gridTilte_'+i));
gDetail.title[i+1].isTotal=getGridTotal(indata.item('gridTilte_'+i));
}
gDetail.calcTotal();
gDetail.refreshAll();
return gDetail
}
var gDetail=makeGrid(IDataEnd());
</script>
</HTML>
?? 快捷鍵說明
復制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -