225 lines
5.6 KiB
ObjectPascal
225 lines
5.6 KiB
ObjectPascal
unit U_YSSKList;
|
||
|
||
interface
|
||
|
||
uses
|
||
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
|
||
Dialogs, cxGraphics, cxCustomData, cxStyles, cxTL, cxMaskEdit, DB, ADODB,
|
||
cxInplaceContainer, cxDBTL, cxControls, cxTLData, ComCtrls, ToolWin,
|
||
StdCtrls, cxFilter, cxData, cxDataStorage, cxEdit, cxDBData, DBClient,
|
||
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, ExtCtrls,
|
||
cxSplitter, cxGridLevel, cxClasses, cxGridCustomView, cxGrid,
|
||
cxGridCustomPopupMenu, cxGridPopupMenu, RM_Dataset, RM_System, RM_Common,
|
||
RM_Class, RM_GridReport, IdBaseComponent, IdComponent, IdTCPConnection,
|
||
IdTCPClient, IdFTP,ShellAPI,IniFiles, cxCheckBox, cxCalendar,
|
||
cxButtonEdit, cxTextEdit, cxLookAndFeels, cxLookAndFeelPainters,
|
||
cxNavigator;
|
||
|
||
type
|
||
TfrmYSSKList = class(TForm)
|
||
ToolBar1: TToolBar;
|
||
TBRafresh: TToolButton;
|
||
TBClose: TToolButton;
|
||
ADOQueryTemp: TADOQuery;
|
||
ADOQueryCmd: TADOQuery;
|
||
Panel1: TPanel;
|
||
ToolButton2: TToolButton;
|
||
ADOQueryMain: TADOQuery;
|
||
ToolButton1: TToolButton;
|
||
RM1: TRMGridReport;
|
||
RMDB_Main: TRMDBDataSet;
|
||
Label3: TLabel;
|
||
FactoryName: TEdit;
|
||
cxGrid2: TcxGrid;
|
||
Tv2: TcxGridDBTableView;
|
||
cxGridLevel1: TcxGridLevel;
|
||
Label2: TLabel;
|
||
Label6: TLabel;
|
||
begdate: TDateTimePicker;
|
||
Enddate: TDateTimePicker;
|
||
cxGridPopupMenu2: TcxGridPopupMenu;
|
||
DS_HZ: TDataSource;
|
||
CDS_HZ: TClientDataSet;
|
||
v2Column5: TcxGridDBColumn;
|
||
v2Column6: TcxGridDBColumn;
|
||
v2Column1: TcxGridDBColumn;
|
||
v2Column2: TcxGridDBColumn;
|
||
v2Column3: TcxGridDBColumn;
|
||
v2BQKP: TcxGridDBColumn;
|
||
v2WKP: TcxGridDBColumn;
|
||
v2Column4: TcxGridDBColumn;
|
||
v2Column7: TcxGridDBColumn;
|
||
v2Column8: TcxGridDBColumn;
|
||
v2Column9: TcxGridDBColumn;
|
||
Label1: TLabel;
|
||
ComTaiTou: TEdit;
|
||
v2JMmoney: TcxGridDBColumn;
|
||
v2FHAddress: TcxGridDBColumn;
|
||
v2Column11: TcxGridDBColumn;
|
||
Label4: TLabel;
|
||
FHAddress: TEdit;
|
||
Label5: TLabel;
|
||
FHdq: TEdit;
|
||
v2SYRName: TcxGridDBColumn;
|
||
CheckBox1: TCheckBox;
|
||
ywy: TEdit;
|
||
Label7: TLabel;
|
||
v2Column10: TcxGridDBColumn;
|
||
procedure FormDestroy(Sender: TObject);
|
||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||
procedure TBCloseClick(Sender: TObject);
|
||
procedure FormShow(Sender: TObject);
|
||
procedure TBRafreshClick(Sender: TObject);
|
||
procedure ToolButton2Click(Sender: TObject);
|
||
procedure FactoryNameChange(Sender: TObject);
|
||
procedure ToolButton1Click(Sender: TObject);
|
||
procedure CheckBox1Click(Sender: TObject);
|
||
private
|
||
{ Private declarations }
|
||
procedure InitGrid();
|
||
public
|
||
fDParameters1,fDParameters3:string;
|
||
fsyrName:string;
|
||
fstr2:string;
|
||
{ Public declarations }
|
||
RKFlag,FCYID:String;
|
||
|
||
end;
|
||
|
||
var
|
||
frmYSSKList: TfrmYSSKList;
|
||
|
||
implementation
|
||
uses
|
||
U_DataLink,U_Fun,U_ZDYHelp;
|
||
|
||
{$R *.dfm}
|
||
procedure TfrmYSSKList.InitGrid();
|
||
begin
|
||
try
|
||
ADOQueryMain.DisableControls;
|
||
with ADOQueryMain do
|
||
begin
|
||
|
||
Close;
|
||
Filtered:=False;
|
||
SQL.Clear;
|
||
if Trim(DParameters10)='' then
|
||
sql.Add(' exec P_YSSK_List :begdate,:Enddate,:syrName,:fstr2')
|
||
else
|
||
SQL.Add(' exec '+Trim(DParameters10)+' :begdate,:Enddate');
|
||
Parameters.ParamByName('begdate').Value:=Trim(FormatDateTime('yyyy-MM-dd',begdate.DateTime));
|
||
Parameters.ParamByName('Enddate').Value:=Trim(FormatDateTime('yyyy-MM-dd',Enddate.DateTime+1));
|
||
Parameters.ParamByName('syrName').Value:=Trim(fsyrName);
|
||
Parameters.ParamByName('fstr2').Value:=Trim(fstr2);
|
||
Open;
|
||
end;
|
||
SCreateCDS20(ADOQueryMain,CDS_HZ);
|
||
SInitCDSData20(ADOQueryMain,CDS_HZ);
|
||
finally
|
||
ADOQueryMain.EnableControls;
|
||
ToolButton2.Click;
|
||
end;
|
||
end;
|
||
|
||
|
||
procedure TfrmYSSKList.FormDestroy(Sender: TObject);
|
||
begin
|
||
frmYSSKList:=nil;
|
||
end;
|
||
|
||
procedure TfrmYSSKList.FormClose(Sender: TObject; var Action: TCloseAction);
|
||
begin
|
||
Action:=caFree;
|
||
end;
|
||
|
||
procedure TfrmYSSKList.TBCloseClick(Sender: TObject);
|
||
begin
|
||
WriteCxGrid('Ӧ<><D3A6><EFBFBD>տ<EFBFBD>ͳ<EFBFBD><CDB3>',Tv2,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
||
Close;
|
||
end;
|
||
procedure TfrmYSSKList.FormShow(Sender: TObject);
|
||
begin
|
||
ReadCxGrid('Ӧ<><D3A6><EFBFBD>տ<EFBFBD>ͳ<EFBFBD><CDB3>',Tv2,'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
||
Enddate.DateTime:=SGetServerDate(ADOQueryTemp);
|
||
begdate.DateTime:=Enddate.DateTime;
|
||
if Trim(DParameters5)='<27><>Ʊ' then
|
||
begin
|
||
v2BQKP.Hidden:=False;
|
||
v2BQKP.Visible:=True;
|
||
v2WKP.Hidden:=False;
|
||
v2WKP.Visible:=True;
|
||
end else
|
||
begin
|
||
v2BQKP.Hidden:=True;
|
||
v2BQKP.Visible:=False;
|
||
v2WKP.Hidden:=True;
|
||
v2WKP.Visible:=False;
|
||
end;
|
||
if Trim(DParameters9)='֧<><D6A7>̨ͷ' then
|
||
begin
|
||
|
||
Label1.Visible:=True;
|
||
ComTaiTou.Visible:=True;
|
||
end else
|
||
begin
|
||
Label1.Visible:=False;
|
||
ComTaiTou.Visible:=False;
|
||
end;
|
||
|
||
IF trim(fDParameters3)<>'' then
|
||
begin
|
||
factoryName.Text:=trim(fDParameters3);
|
||
factoryName.Enabled:=false;
|
||
end;
|
||
|
||
IF trim(fDParameters1)='ҵ<><D2B5>Ա<EFBFBD><D4B1>ѯ'then
|
||
begin
|
||
ywy.Text:=trim(DName);
|
||
ywy.Enabled:=false;
|
||
end;
|
||
|
||
InitGrid();
|
||
end;
|
||
|
||
procedure TfrmYSSKList.TBRafreshClick(Sender: TObject);
|
||
begin
|
||
InitGrid();
|
||
end;
|
||
|
||
procedure TfrmYSSKList.ToolButton2Click(Sender: TObject);
|
||
var
|
||
fsj:string;
|
||
begin
|
||
if ADOQueryMain.Active=False then Exit;
|
||
fsj:=Trim(SGetFilters(Panel1,1,2));
|
||
IF CheckBox1.Checked then
|
||
begin
|
||
If trim(fsj)<>'' then
|
||
fsj:=fsj+' and BQMoney>0 '
|
||
else
|
||
fsj:=fsj+' BQMoney>0 ';
|
||
end;
|
||
SDofilter(ADOQueryMain,fsj);
|
||
SCreateCDS20(ADOQueryMain,CDS_HZ);
|
||
SInitCDSData20(ADOQueryMain,CDS_HZ);
|
||
end;
|
||
|
||
procedure TfrmYSSKList.FactoryNameChange(Sender: TObject);
|
||
begin
|
||
ToolButton2.Click;
|
||
end;
|
||
|
||
procedure TfrmYSSKList.ToolButton1Click(Sender: TObject);
|
||
begin
|
||
if ADOQueryMain.IsEmpty then Exit;
|
||
SelExportData(Tv2,ADOQueryMain,'Ӧ<><D3A6><EFBFBD>տ<EFBFBD>ͳ<EFBFBD><CDB3><EFBFBD>б<EFBFBD>');
|
||
end;
|
||
|
||
procedure TfrmYSSKList.CheckBox1Click(Sender: TObject);
|
||
begin
|
||
ToolButton2.Click;
|
||
end;
|
||
|
||
end.
|