物料仓库

This commit is contained in:
funa 2026-07-21 16:30:05 +08:00
parent a86f6847c4
commit 6b8282a435
5 changed files with 44 additions and 27 deletions

View File

@ -162,7 +162,7 @@ end;
procedure TfrmBSPrtInList.TBRafreshClick(Sender: TObject);
begin
BegDate.SetFocus;
toolbar1.SetFocus;
InitGrid();
end;

View File

@ -217,7 +217,6 @@ inherited frmBSPrtOutList: TfrmBSPrtOutList
Height = 438
Align = alClient
TabOrder = 2
ExplicitTop = 107
object Tv1: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>

View File

@ -150,7 +150,7 @@ end;
procedure TfrmBSPrtOutList.TBRafreshClick(Sender: TObject);
begin
BegDate.SetFocus;
toolbar1.SetFocus;
InitGrid();
end;

View File

@ -85,65 +85,62 @@ inherited frmBSPrtStkSummary: TfrmBSPrtStkSummary
Color = clWhite
ParentBackground = False
TabOrder = 3
Visible = False
object Label1: TLabel
Left = 732
Top = 6
Left = 12
Top = 14
Width = 64
Height = 21
Caption = #26597#35810#26102#38388
Visible = False
end
object Label2: TLabel
Left = 940
Top = 10
Left = 220
Top = 14
Width = 16
Height = 21
Caption = #33267
Visible = False
end
object Label3: TLabel
Left = 288
Top = 11
Left = 664
Top = 14
Width = 64
Height = 21
Caption = #20135#21697#21517#31216
end
object Label8: TLabel
Left = 34
Top = 10
Left = 409
Top = 14
Width = 64
Height = 21
Caption = #20135#21697#32534#21495
end
object P_Name: TcxTextEdit
Tag = 2
Left = 378
Left = 734
Top = 6
TabOrder = 0
OnKeyPress = P_CodeKeyPress
Width = 150
end
object P_Code: TcxTextEdit
Tag = 2
Left = 112
Left = 479
Top = 6
TabOrder = 1
OnKeyPress = P_CodeKeyPress
Width = 150
end
object BegDate: TcxDateEdit
Left = 790
Left = 82
Top = 6
Properties.ShowTime = False
TabOrder = 2
Visible = False
Width = 120
end
object EndDate: TcxDateEdit
Left = 974
Left = 254
Top = 6
Properties.ShowTime = False
TabOrder = 3
Visible = False
Width = 120
end
end
@ -161,8 +158,6 @@ inherited frmBSPrtStkSummary: TfrmBSPrtStkSummary
Height = 463
Align = alClient
TabOrder = 4
ExplicitTop = 107
ExplicitHeight = 438
object tv1: TcxGridDBBandedTableView
Navigator.Buttons.CustomButtons = <>
ScrollbarAnnotations.CustomAnnotations = <>
@ -244,7 +239,7 @@ inherited frmBSPrtStkSummary: TfrmBSPrtStkSummary
Position.RowIndex = 0
end
object tv1BQRKQty: TcxGridDBBandedColumn
Caption = #26412#26376#20837#24211
Caption = #26412#26399#20837#24211
DataBinding.FieldName = 'BQRKQty'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter
@ -255,7 +250,7 @@ inherited frmBSPrtStkSummary: TfrmBSPrtStkSummary
Position.RowIndex = 0
end
object tv1BQCKQty: TcxGridDBBandedColumn
Caption = #26412#26376#20986#24211
Caption = #26412#26399#20986#24211
DataBinding.FieldName = 'BQCKQty'
DataBinding.IsNullValueType = True
HeaderAlignmentHorz = taCenter

View File

@ -73,6 +73,7 @@ type
procedure P_specChange(Sender: TObject);
procedure cxTabControl1Change(Sender: TObject);
procedure ToolButton1Click(Sender: TObject);
procedure P_CodeKeyPress(Sender: TObject; var Key: Char);
private
procedure InitGrid();
{ Private declarations }
@ -102,20 +103,33 @@ begin
FStkName := Trim(self.fParameters2);
canshu3 := Trim(self.fParameters3);
EndDate.Date := SGetServerDate(ADOQueryTemp);
BegDate.Date := EndDate.Date - 90;
BegDate.Date := EndDate.Date - 30;
end;
procedure TfrmBSPrtStkSummary.InitGrid();
var
sBeg, sEnd: string;
begin
if VarIsNull(BegDate.Date) or VarIsNull(EndDate.Date) then
begin
EndDate.Date := SGetServerDate(ADOQueryTemp);
BegDate.Date := EndDate.Date - 30;
end;
sBeg := QuotedStr(FormatDateTime('yyyy-mm-dd', BegDate.Date));
sEnd := QuotedStr(FormatDateTime('yyyy-mm-dd', EndDate.Date));
try
ADOQueryMain.DisableControls;
with ADOQueryMain do
begin
Filtered := False;
Close;
sql.Clear;
SQL.Clear;
SQL.Add('exec P_BS_PrtStkSummary ');
SQL.Add(' @stkname=' + QuotedStr(Trim(FStkName)));
SQL.Add(', @begdate=' + sBeg);
SQL.Add(', @enddate=' + sEnd);
Open;
end;
SCreateCDS(ADOQueryMain, CDS_Main);
@ -127,7 +141,7 @@ end;
procedure TfrmBSPrtStkSummary.TBRafreshClick(Sender: TObject);
begin
// BegDate.SetFocus;
toolbar1.SetFocus;
InitGrid();
end;
@ -195,6 +209,15 @@ begin
SelOKNo(CDS_Main, False);
end;
procedure TfrmBSPrtStkSummary.P_CodeKeyPress(Sender: TObject; var Key: Char);
begin
inherited;
if Key = #13 then
begin
TBFind.Click;
end;
end;
procedure TfrmBSPrtStkSummary.P_specChange(Sender: TObject);
begin
TBFind.Click;