📄 default.asp
字号:
<!-- #include virtual="/eB3KTransaction.asp" -->
<!-- #include virtual="/Server/ebo.asp" -->
<!-- #include virtual="/Server/cblib.asp" -->
<!-- #include virtual="/Server/SqlReport.asp" -->
<!-- #include virtual="/Server/ReportBD.asp" -->
<!-- #include virtual="/Server/rawdata.asp" -->
<!-- #include virtual="/Server/common.asp" -->
<HTML><HEAD><meta http-equiv="Content-Type" content="text/html; charset=gb2312"><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>
<script src="/client/clipboard.js"></script>
<%
dim eBP,y
Set eBP = Server.CreateObject("NaFine.Privilege")
y=eBP.PrivilegeTest(0,1019,8,me)
if CStr(y)<>"0" then err.raise 10000,"MoveStock.Open", eBP.GetLastError()
dim defaultPrintRows
defaultPrintRows = 40
function GetPrintRows(iRows,defaultPrintRows)
if iRows > defaultPrintRows then
GetPrintRows = defaultPrintRows
else
GetPrintRows = iRows
end if
end function
dim szSQL,iListWidth,szSelect,szFrom,szWhere,szGroupBy,TableName
dim siCount,ciCount,sc,cc,pc,datefrom,dateto,memo,memotext,eboRegiCount
eboRegiCount=0
TableName="BdDirectSale"
sc=CLng(GetForm("stockCheck"))
cc=CLng(GetForm("codeCheck"))
pc=CLng(GetForm("productCheck"))
siCount=CLng(GetForm("sDetail_rows"))
ciCount=CLng(GetForm("cDetail_rows"))
dim startNumber,endNumber,searchCode
startNumber=cint(GetForm("startNumber"))
endNumber=cint(GetForm("endNumber"))
searchCode = GetForm("searchCode")
datefrom=GetForm("DateFrom")
dateto=GetForm("DateTo")
if len(datefrom)>0 then datefrom = DateSerial(year(datefrom), month(datefrom), day(datefrom))
if len(dateto)=0 then
dateto=now()
end if
dateto = DateSerial(year(dateto), month(dateto), day(dateto))
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
szWhere = szWhere & ")"
SQLWhereOR=szWhere
end function
'=============================================================
szFrom = " FROM ["&TableName&"] AS [vt], ["&TableName&"List] AS [vl]"
szWhere = " WHERE [vt].[BillType]=40 AND [vt].[ID]=[vl].[ID] AND [vt].[IsDeleted]=0 AND [vt].[AccountID]=" & session("AccountID")
RptMoveStock1 nothing, szFrom, szWhere, nothing
RptMoveProduct nothing, szFrom, szWhere, nothing
if sc=1 or siCount>0 then
if sc=1 then
RptMoveStock1 szSelect, nothing, nothing, szGroupBy
end if
if siCount>0 then
if siCount>0 then SqlWhereAdd szWhere, SQLWhereOR("[vt].[Stock]","sDetail_0_",siCount)
end if
end if
if pc=1 then
RptMoveProduct szSelect, nothing, nothing, szGroupBy
end if
if cc=1 or ciCount>0 then
if cc=0 then
RptGoodsCode nothing, szFrom, szWhere, nothing
else
RptGoodsCode szSelect, szFrom, szWhere, szGroupBy
if pc=0 then
SqlSelectAdd szSelect,"biProduct.Title as 品名"
SqlGroupByAdd szGroupBy,"biProduct.Title"
end if
end if
if ciCount>0 then SqlWhereAdd szWhere, SQLWhereOR("[biProduct].[ProductID]","cDetail_0_",ciCount)
end if
dim startWildCard14,endStartCard14
dim startWildCard15,endStartCard15
dim endCount
if searchCode<>"" then
While startNumber>1
startWildCard14=startWildCard14+"_"
startWildCard15=startWildCard15+"_"
startNumber=startNumber-1
wend
endCount=14-endNumber
while endCount>0
endStartCard14=endStartCard14+"_"
endCount=endCount-1
wend
endCount=15-endNumber
while endCount>0
endStartCard15=endStartCard15+"_"
endCount=endCount-1
wend
dim search14,search15
search14=startWildCard14 & searchCode & endStartCard14
search15=startWildCard15 & searchCode & endStartCard15
szWhere = szWhere & " AND (([biProduct].[Code] Like '" & search14 & "' AND len([biProduct].[Code])=14) or ([biProduct].[Code] like '" & search15 & "' AND len([biProduct].[Code])=15))"
end if
SqlSelectAdd szSelect, "SUM([vl].[Quantity]) AS 数量, SUM([vl].[TaxAmount]) AS 金额"
if isDate(datefrom) then SqlWhereAdd szWhere, "[vt].[BillDate] >='"&GetDateString(datefrom)&"'"
if isDate(dateto) then SqlWhereAdd szWhere, "[vt].[BillDate] <='"&GetDateString(dateto)&"'"
szSQL="SELECT DISTINCT " & szSelect & szFrom & szWhere
if len(szGroupBy)>0 then szSQL=szSQL & " GROUP BY " & szGroupBy
eboReg 1, "gridCols", "iCols", "", "cbLocalVariable"
eboReg 1, "gridRows", "iRows", "", "cbLocalVariable"
eboReg 2, "gridTilte_", "szTitle", "", "cbLocalVariable"
dim iCols,iRows,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.CountiRows=rs.RecordCount defaultPrintRows=GetPrintRows(iRows,defaultPrintRows)
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 = NothingResponse.Write "</script>" & VBCrLf
%>
<LINK REL=stylesheet HREF="/Client/All.css" TYPE="text/css"><script src="/Client/ebComm.js"></script><BODY>
<div id=sTitle align=center><font size=5><b><u>直 销 报 表</u></b></font></div>
<div id=sTime>查询时间:<%if len(datefrom)=0 then Response.Write "系统启用" else Response.Write FormatDateTime(datefrom,1)%>—<%=FormatDateTime(DateAdd("d",-1,dateto),1)%></div>
<div id=SelectArea></div>
<div id=PageCtrlArea></div>
<div> <input type=button value="预览" onClick=displayPrint(sTitle,sTime,<%=defaultPrintRows%>,1) ID="Button1" NAME="Button1"> <input type=button value="打印" onClick=displayPrint(sTitle,sTime,<%=defaultPrintRows%>,0) ID="Button2" NAME="Button2"> <input type=button value="Excel" onclick="excelClick()" ID="Button3" NAME="Button1"></div>
</BODY>
<script title=User>
function excelClick(){
arrayToClipboard(gDetail.data,gDetail.title);
PasteToExcel('',true);
}
function ecbDetail(eo,szEvent,x,y){
if (szEvent=='MOUSECLICK'){
}
}
</script>
<script>
function getGridWidth(titleText){
switch(titleText){
case '编号':
return 170;
break;
case '品名':
return 130;
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,40,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 + -