D7DJkairan/合同管理2(ContractManagement.dll)/U_DHList.pas

102 lines
2.8 KiB
ObjectPascal
Raw Permalink Normal View History

2025-07-19 13:52:55 +08:00
unit U_DHList;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData, cxDataStorage,
cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView, cxGridTableView,
cxGridDBTableView, cxClasses, cxControls, cxGridCustomView, cxGrid, cxMemo,
cxRichEdit, ComCtrls, cxContainer, cxTextEdit, cxMaskEdit, cxButtonEdit,
StdCtrls, ToolWin, DBClient, ADODB, ExtCtrls, BtnEdit, cxCalendar, StrUtils,
cxDropDownEdit, cxGridCustomPopupMenu, cxGridPopupMenu, cxLookAndFeels,
cxLookAndFeelPainters, cxNavigator;
type
TfrmDHList = class(TForm)
ToolBar1: TToolBar;
TBClose: TToolButton;
cxGrid1: TcxGrid;
Tv1: TcxGridDBTableView;
cxGrid1Level1: TcxGridLevel;
ADOTemp: TADOQuery;
ADOCmd: TADOQuery;
DataSource1: TDataSource;
Order_Sub: TClientDataSet;
CDS_Type: TClientDataSet;
cxGridPopupMenu2: TcxGridPopupMenu;
Tv1Column1: TcxGridDBColumn;
Tv1Column2: TcxGridDBColumn;
Tv1Column3: TcxGridDBColumn;
procedure TBCloseClick(Sender: TObject);
procedure FormShow(Sender: TObject);
private
fuserName: string;
procedure InitData();
procedure ZDYHelp(FButn: TcxButtonEdit; LType: string);
{ Private declarations }
public
FConNo, FType: string;
{ Public declarations }
end;
var
frmDHList: TfrmDHList;
newh: hwnd;
implementation
uses
U_DataLink, U_Fun, U_ZDYHelp, U_ZDYHelpSel, U_CPManageFMSel, U_ZdyAttachment,
U_CPManagePBsel, U_ZdyAttachGYS, U_ProductOrderListSEL, U_CPManageselct;
{$R *.dfm}
procedure TfrmDHList.TBCloseClick(Sender: TObject);
begin
WriteCxGrid(trim(self.Caption), Tv1, '<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>');
Close;
end;
procedure TfrmDHList.InitData();
begin
//ˢ<>²<EFBFBD>Ʒ<EFBFBD><C6B7>Ϣ
with ADOTemp do
begin
Close;
SQL.Clear;
if FType = '<27>۽<EFBFBD><DBBD>ֿ<EFBFBD>' then
begin
sql.Add('select convert(varchar(10),X.crtime,120) as crtime,sum(PiQty) as PiQty,sum(Qty) as Qty ');
sql.Add('from CK_SXPB_CR X ');
sql.Add('where X.CGConNo=''' + trim(FConNo) + ''' and ckname=''<27><><EFBFBD>첼'' and crflag=''<27><><EFBFBD><EFBFBD>'' and CRType=''<27><>Ʒ<EFBFBD>ɹ<EFBFBD><C9B9><EFBFBD><EFBFBD><EFBFBD>'' ');
sql.Add('group by convert(varchar(10),X.crtime,120)');
end
else
begin
sql.Add('select convert(varchar(10),X.crtime,120) as crtime,sum(PiQty) as PiQty,sum(Qty) as Qty ');
sql.Add('from CK_GenDan_CR X ');
sql.Add('where X.conno=''' + trim(FConNo) + ''' and X.ckname=''<27><><EFBFBD><EFBFBD>'' and X.crflag=''<27><><EFBFBD><EFBFBD>''');
sql.Add('group by convert(varchar(10),X.crtime,120)');
end;
Open;
end;
SCreateCDS20(ADOTemp, Order_Sub);
SInitCDSData20(ADOTemp, Order_Sub);
end;
procedure TfrmDHList.ZDYHelp(FButn: TcxButtonEdit; LType: string);
begin
end;
procedure TfrmDHList.FormShow(Sender: TObject);
begin
readCxGrid(trim(self.Caption), Tv1, '<27><><EFBFBD><EFBFBD><EFBFBD>б<EFBFBD>');
InitData();
end;
end.