📄 pm_pclinehistory_c.pas
字号:
unit Pm_PcLineHistory_C;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Condition, Db, AdODB, StdCtrls, ExtEdit, Mask;
Type
TFrm_Pm_PcLineHistory_C = Class(TFrm_Base_Condition)
Label1: TLabel;
ExtEdt_PcCode_Fm: TExtEdit;
ExtEdt_OperatorCode_Fm: TExtEdit;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
ExtEdt_PcCode_To: TEdit;
Label5: TLabel;
Label6: TLabel;
Medt_OperatorTime_Fm: TMaskEdit;
Medt_OperatorTime_To: TMaskEdit;
Lbl_Operator_Name_Fm: TLabel;
Lbl_Operator_Name_To: TLabel;
ExtEdt_OperatorCode_To: TExtEdit;
Label7: TLabel;
Label8: TLabel;
lbl_ItemCode_fm: TLabel;
lbl_ItemCode_to: TLabel;
Extedt_ItemCode_fm: TExtEdit;
Extedt_ItemCode_to: TExtEdit;
procedure btn_okClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure ExtEdt_PcCode_ToExit(Sender: TObject);
procedure ExtEdt_OperatorCode_ToExit(Sender: TObject);
procedure Extedt_ItemCode_toExit(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Frm_Pm_PcLineHistory_C: TFrm_Pm_PcLineHistory_C;
implementation
uses Sys_Global;
{$R *.DFM}
procedure TFrm_Pm_PcLineHistory_C.btn_okClick(Sender: TObject);
var
date_to:string;
begin
inherited;
date_to:=Medt_OperatorTime_To.text+' '+formatdatetime('hh:mm:dd',now());
Condition:='';
ConditionHint:='';
if Extedt_PcCode_fm.text='' then
Condition:=' PcLineHistory.PCno between ''0'''
else
Condition:=' PcLineHistory.PCno between '''+ExtEdt_PcCode_Fm.Text+'''';
ConditionHint:='采购价格单号从'+ExtEdt_PcCode_Fm.Text;
if ExtEdt_PcCode_TO.Text<>'' then
begin
Condition:=Condition+' and '''+ExtEdt_PcCode_To.Text+'''';
ConditionHint:=ConditionHint+'\采购价格单号到'+ExtEdt_PcCode_To.Text;
end;
if Extedt_ItemCode_fm.text='' then
Condition:=Condition+' and PcLineHistory.ItemCode between ''0'''
else
Condition:=Condition+' and PcLineHistory.ItemCode between '''+Extedt_ItemCode_fm.Text+'''';
if Extedt_ItemCode_to.Text<>'' then
begin
Condition:=Condition+' and '''+Extedt_ItemCode_to.Text+'''';
end;
if ExtEdt_OperatorCode_Fm.text='' then
Condition:=Condition+' AND PcLineHistory.ChgEmployeeCode between ''0'''
else
Condition:=Condition+' AND PcLineHistory.ChgEmployeeCode between '''+ExtEdt_OperatorCode_Fm.Text+'''';
if ExtEdt_OperatorCode_To.Text<>'' then
begin
Condition:=Condition+' AND '''+ExtEdt_OperatorCode_To.Text+'''';
end;
if Length(Trim(Medt_OperatorTime_Fm.Text))<>4 then
begin
Condition:=Condition+' AND PcLineHistory.ChgTime between cast('''+Medt_OperatorTime_Fm.Text+''' as datetime)';
ConditionHint:=ConditionHint+'\操作时间从'+Medt_OperatorTime_Fm.Text;
end;
if Length(Trim(Medt_OperatorTime_To.Text))<>4 then
begin
Condition:=Condition+' AND cast('''+date_to+''' as datetime) ';
ConditionHint:=ConditionHint+'\操作时间到'+Medt_OperatorTime_To.Text;
end;
ModalResult:=mrOk;
end;
procedure TFrm_Pm_PcLineHistory_C.FormCreate(Sender: TObject);
begin
inherited;
ExtEdt_PcCode_Fm.Text:='';
ExtEdt_PcCode_TO.Text:='ZZZZZ';
ExtEdt_ItemCode_Fm.Text:='';
ExtEdt_ItemCode_TO.Text:='ZZZZZ';
ExtEdt_OperatorCode_Fm.Text:='';
ExtEdt_OperatorCode_To.Text:='ZZZZZ';
Medt_OperatorTime_Fm.Text:=formatdatetime('yyyy.mm.dd',now-30);
Medt_OperatorTime_To.Text:=formatdatetime('yyyy.mm.dd',now);
end;
procedure TFrm_Pm_PcLineHistory_C.ExtEdt_PcCode_ToExit(Sender: TObject);
begin
NotNullTextCheck(sender,'采购价格单号');
end;
procedure TFrm_Pm_PcLineHistory_C.ExtEdt_OperatorCode_ToExit(Sender: TObject);
begin
NotNullTextCheck(sender,'操作员代码');
end;
procedure TFrm_Pm_PcLineHistory_C.Extedt_ItemCode_toExit(Sender: TObject);
begin
NotNullTextCheck(sender,'物料代码');
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -