📄 frm_mainfareseek.pas
字号:
unit Frm_MainFareSeek;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, Frm_Cargo, StdCtrls, ComCtrls, Buttons, ExtCtrls, XPMenu;
type
TFrmMainFareSeek = class(TFrmCargo)
Label10: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label1: TLabel;
Label2: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label11: TLabel;
Label13: TLabel;
Label14: TLabel;
Label15: TLabel;
Label16: TLabel;
Label12: TLabel;
Label17: TLabel;
Panel1: TPanel;
BitBtn2: TBitBtn;
BitBtn1: TBitBtn;
GoDate: TDateTimePicker;
DGoDate: TDateTimePicker;
EdtVoyage: TEdit;
EdtMawb: TEdit;
ComCompany: TComboBox;
ChkDiscard: TCheckBox;
ChkOut: TCheckBox;
ChkIn: TCheckBox;
EdtFileNo: TEdit;
ChkFinish: TCheckBox;
ChkNotFinish: TCheckBox;
ChkConfirm: TCheckBox;
ChkNotConfirm: TCheckBox;
ComCusCode: TComboBox;
ComYWY: TComboBox;
ComConsign: TComboBox;
EdtCusCodeName: TEdit;
EdtConsignName: TEdit;
ComLoad: TComboBox;
ComAgent: TComboBox;
ComTrustType: TComboBox;
ComTrustSource: TComboBox;
Comyctrans: TComboBox;
ChkWt: TCheckBox;
ChkCY: TCheckBox;
StartDate: TDateTimePicker;
EndDate: TDateTimePicker;
procedure FormActivate(Sender: TObject);
procedure BitBtn2Click(Sender: TObject);
procedure ComCusCodeExit(Sender: TObject);
procedure ComConsignExit(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
FrmMainFareSeek: TFrmMainFareSeek;
implementation
uses Frm_Main, Frm_MainFeeGrid;
{$R *.dfm}
procedure TFrmMainFareSeek.FormActivate(Sender: TObject);
var
sqlstr:string;
begin
inherited;
GoDate.date:=Date;
Dgodate.date:=date;
StartDate.date:=Date;
EndDate.date:=date;
sqlstr:='Select PlaneCompanyCode,PlaneCompanyCName from PlaneCompanyInfo';
FrmMain.Full_FilterCombobox(comcompany,sqlstr,'PlaneCompanyCode','PlaneCompanyCName');
SqlStr:='Select CusCode,CusCName From CustomerInfo';
FrmMain.Full_FilterCombobox(comcuscode,SqlStr,'CusCode','CusCName');
FrmMain.Full_FilterCombobox(comconsign,SqlStr,'CusCode','CusCName');
SqlStr :=
'Select CusCode,CusCName From CustomerInfo where CharIndex(''目的港代理'',CusTypeDesc)>0 ';
FrmMain.Full_FilterCombobox(comAgent, SqlStr, 'cuscode', 'CusCName');
{港口代码}
Sqlstr:='Select PortCode,PortCName From PortInfo';
FrmMain.Full_FilterCombobox(comload,SQLStr,'portcode','PortCName');
FrmMain.Full_ComboBox(comYWY,'Bussinessman','code','name');
{委托来源}
SqlStr := 'Select CusCode,CusCName From CustomerInfo';
FrmMain.Full_FilterCombobox(Comtrustsource, SqlStr, 'cuscode', 'CusCName');
{委托类型}
FrmMain.Full_ComboBox(comTrusttype, 'TrustTypeInfo', 'Code', 'CName');
end;
procedure TFrmMainFareSeek.BitBtn2Click(Sender: TObject);
var
sTmp:String;
Flag:integer;
i:integer;
SqlText:string;
begin
inherited;
shortDateFormat := 'yyyy-mm-dd';
SQLtext:='select a.FileCode,a.fileno,a.maincode,b.shipcomcname,'+
'a.inout,a.Dexecdate,a.keydown from '+
'FileTable a,shipcompany b '+
' where b.shipcomcode=*a.Carrier and '+
' substring(a.filecode,1,1)=''K''';
Stmp:=edtfileno.text;
if sTmp <> '' then
sqltext:=sqltext+'And a.fileno like ''%'+sTmp+'%'' ';
stmp:=edtmawb.text;
if sTmp <> '' then
sqltext:=sqltext+'And a.maincode like ''%'+sTmp+'%'' ';
Stmp:=edtVoyage.text;
if sTmp <> '' then
sqltext:=sqltext+'And a.BY1 = '''+sTmp+''' ';
Stmp:=FrmMain.getfieldtext(comcompany.text);
if sTmp <> '' then
sqltext:=sqltext+'And a.carrier = '''+sTmp+''' ';
stmp:=edtcuscodename.text;
if sTmp <> '' then
sqltext:=sqltext+' And a.CusCodename='''+sTmp+''' ';
stmp:=edtconsignname.text;
if sTmp <> '' then
sqltext:=sqltext+' And a.consignname='''+sTmp+''' ';
stmp:=FrmMain.getfieldtext(comload.text);
if sTmp <> '' then
sqltext:=sqltext+' And a.airport='''+sTmp+''' ';
stmp:=FrmMain.getfieldtext(comagent.text);
if sTmp <> '' then
sqltext:=sqltext+' And a.agentcode='''+sTmp+''' ';
stmp:=FrmMain.getfieldtext(comywy.text);
if sTmp <> '' then
sqltext:=sqltext+' And a.Bussiness='''+sTmp+''' ';
stmp:=FrmMain.getfieldtext(comTrustsource.text);
if sTmp <> '' then
sqltext:=sqltext+' And a.trustsource='''+sTmp+''' ';
stmp:=FrmMain.getfieldtext(comTrusttype.text);
if sTmp <> '' then
sqltext:=sqltext+' And a.trusttype='''+sTmp+''' ';
if chkdiscard.Checked then
sqltext:=sqltext+' And a.ifdiscard=1 ';
stmp:=comyctrans.text;
if sTmp <> '' then
begin
if stmp='空空' then
sqltext:=sqltext+' And a.filecode not in (select filecode from fileocean) '
else
sqltext:=sqltext+' And a.filecode in (select filecode from fileocean where truckocean='''+sTmp+''') ';
end;
if (chkout.Checked) and (chkin.checked ) then
else
begin
if chkout.Checked then
sqltext:=sqltext+' And a.inout=1 ';
if chkin.Checked then
sqltext:=sqltext+' And a.inout=0 ';
end;
if (chkfinish.Checked) and (chknotfinish.checked ) then
else
begin
if chkfinish.Checked then
sqltext:=sqltext+' And a.befinish=1 ';
if chknotfinish.Checked then
sqltext:=sqltext+' And a.befinish=0 ';
end;
if (chkconfirm.Checked) and (chknotconfirm.checked ) then
else
begin
if chkconfirm.Checked then
sqltext:=sqltext+' And a.keydown=1 ';
if chknotconfirm.Checked then
sqltext:=sqltext+' And a.keydown=0 ';
end;
if (chkwt.checked) and (chkcy.checked) then
sqltext:=sqltext+' And a.Dexecdate>='''+datetimetostr(int(godate.date))+''' '+
' and a.Dexecdate<='''+datetimetostr(int(dgodate.date))+''' '+
' And a.fdate1>='''+datetimetostr(int(startdate.date))+''' '+
' and a.fdate1<='''+datetimetostr(int(enddate.date))+''' '
else
begin
if Chkwt.Checked then
sqltext:=sqltext+' And a.Dexecdate>='''+datetimetostr(int(godate.date))+''' '+
' and a.Dexecdate<='''+datetimetostr(int(dgodate.date))+'''';
if Chkcy.Checked then
sqltext:=sqltext+' And a.fdate1>='''+datetimetostr(int(startdate.date))+''' '+
' and a.fdate1<='''+datetimetostr(int(enddate.date))+'''';
end;
FrmMainFeeGrid.QryFare.close;
FrmMainFeeGrid.QryFare.SQL.Text:=SqlText;
FrmMainFeeGrid.QryFare.open;
if (FrmMainFeeGrid.QryFare.RecordCount=0) then
Begin
ShowMessage('没有符合条件的记录,请继续!');
Exit;
End
Else
Begin
FrmMainFeeGrid.LV.Items.Clear;
FrmMainFeeGrid.LV2.Items.Clear;
FrmMainFeeGrid.LblFareNo.Visible :=false;
FrmMain.AddData(FrmMainFeeGrid.lv,FrmMainFeeGrid.QryFare);
FrmMainFeeGrid.LBLMAIN.Caption:='主单的数量为 '+inttostr(FrmMainFeeGrid.lv.items.count);
end;
close;
end;
procedure TFrmMainFareSeek.ComCusCodeExit(Sender: TObject);
begin
inherited;
ComCusCode.Text:=FrmMain.CheckComboBox(ComCusCode);
if comcuscode.text='' then
EdtCuscodename.Text:=FrmMain.GetFieldText(comcuscode.text,0);
end;
procedure TFrmMainFareSeek.ComConsignExit(Sender: TObject);
begin
inherited;
Comconsign.Text:=FrmMain.CheckComboBox(Comconsign);
if comconsign.text='' then
Edtconsignname.Text:=FrmMain.GetFieldText(comconsign.text);
end;
procedure TFrmMainFareSeek.BitBtn1Click(Sender: TObject);
begin
inherited;
Close;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -