572 lines
18 KiB
ObjectPascal
572 lines
18 KiB
ObjectPascal
|
|
unit U_GCFPHZList;
|
|||
|
|
|
|||
|
|
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, Menus, cxPC, MovePanel, cxLookAndFeels, cxLookAndFeelPainters,
|
|||
|
|
cxNavigator, dxBarBuiltInMenu;
|
|||
|
|
|
|||
|
|
type
|
|||
|
|
TfrmGCFPHZList = class(TForm)
|
|||
|
|
ToolBar1: TToolBar;
|
|||
|
|
TBRafresh: TToolButton;
|
|||
|
|
TBClose: TToolButton;
|
|||
|
|
ADOQueryTemp: TADOQuery;
|
|||
|
|
ADOQueryCmd: TADOQuery;
|
|||
|
|
Panel1: TPanel;
|
|||
|
|
ToolButton2: TToolButton;
|
|||
|
|
ADOQueryMain: TADOQuery;
|
|||
|
|
TBExport: TToolButton;
|
|||
|
|
RM1: TRMGridReport;
|
|||
|
|
RMDB_Main: TRMDBDataSet;
|
|||
|
|
Label2: TLabel;
|
|||
|
|
begdate: TDateTimePicker;
|
|||
|
|
Enddate: TDateTimePicker;
|
|||
|
|
cxGridPopupMenu2: TcxGridPopupMenu;
|
|||
|
|
DS_HZ: TDataSource;
|
|||
|
|
CDS_HZ: TClientDataSet;
|
|||
|
|
cxGrid1: TcxGrid;
|
|||
|
|
TV2: TcxGridDBTableView;
|
|||
|
|
cxFactoryName: TcxGridDBColumn;
|
|||
|
|
cSQQP: TcxGridDBColumn;
|
|||
|
|
cBQKP: TcxGridDBColumn;
|
|||
|
|
cxWKP: TcxGridDBColumn;
|
|||
|
|
cxGridLevel2: TcxGridLevel;
|
|||
|
|
V2BQXKPMoney: TcxGridDBColumn;
|
|||
|
|
V2WCStatus: TcxGridDBColumn;
|
|||
|
|
Label1: TLabel;
|
|||
|
|
V2Column1: TcxGridDBColumn;
|
|||
|
|
V2Column2: TcxGridDBColumn;
|
|||
|
|
V2Column3: TcxGridDBColumn;
|
|||
|
|
V2Column4: TcxGridDBColumn;
|
|||
|
|
V2Column5: TcxGridDBColumn;
|
|||
|
|
V2Column6: TcxGridDBColumn;
|
|||
|
|
V2Column7: TcxGridDBColumn;
|
|||
|
|
cxTabControl1: TcxTabControl;
|
|||
|
|
Label3: TLabel;
|
|||
|
|
KHName: TEdit;
|
|||
|
|
Label4: TLabel;
|
|||
|
|
GCName: TEdit;
|
|||
|
|
CheckBox1: TCheckBox;
|
|||
|
|
TBDataDel: TToolButton;
|
|||
|
|
V2Column8: TcxGridDBColumn;
|
|||
|
|
V2Column9: TcxGridDBColumn;
|
|||
|
|
V2Column10: TcxGridDBColumn;
|
|||
|
|
Panel2: TMovePanel;
|
|||
|
|
Label5: TLabel;
|
|||
|
|
TV2Column1: TcxGridDBColumn;
|
|||
|
|
CheckBox2: TCheckBox;
|
|||
|
|
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 GCNameChange(Sender: TObject);
|
|||
|
|
procedure TBExportClick(Sender: TObject);
|
|||
|
|
procedure V2Column1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
procedure V2Column3CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
procedure cSQQPCustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
procedure cBQKPCustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
procedure V2Column4CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
procedure V2BQXKPMoneyCustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
procedure cxWKPCustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
procedure V2Column5CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
procedure V2Column2CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
procedure V2WCStatusCustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
procedure V2Column6CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
procedure cxTabControl1Change(Sender: TObject);
|
|||
|
|
procedure TV2CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
procedure KHNameChange(Sender: TObject);
|
|||
|
|
procedure GCName10Change(Sender: TObject);
|
|||
|
|
procedure CheckBox1Click(Sender: TObject);
|
|||
|
|
procedure TBDataDelClick(Sender: TObject);
|
|||
|
|
procedure TV2StylesGetContentStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out AStyle: TcxStyle);
|
|||
|
|
private
|
|||
|
|
{ Private declarations }
|
|||
|
|
procedure InitGrid();
|
|||
|
|
public
|
|||
|
|
fDParameters1: string;
|
|||
|
|
{ Public declarations }
|
|||
|
|
RKFlag, FCYID: string;
|
|||
|
|
BFBegdate, BFEnddate, BFGCName: string;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
var
|
|||
|
|
frmGCFPHZList: TfrmGCFPHZList;
|
|||
|
|
|
|||
|
|
implementation
|
|||
|
|
|
|||
|
|
uses
|
|||
|
|
U_DataLink, U_RTFun, U_Fun, U_YSCRPBMggGCView, U_SKCRPBMggGCView,
|
|||
|
|
U_FPCRPBMggGCView;
|
|||
|
|
|
|||
|
|
{$R *.dfm}
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.InitGrid();
|
|||
|
|
var
|
|||
|
|
i: Integer;
|
|||
|
|
n: Integer;
|
|||
|
|
begin
|
|||
|
|
Panel2.Visible := True;
|
|||
|
|
Panel2.Refresh;
|
|||
|
|
if cxTabControl1.TabIndex = 0 then
|
|||
|
|
begin
|
|||
|
|
n := 0;
|
|||
|
|
end;
|
|||
|
|
if cxTabControl1.TabIndex = 1 then
|
|||
|
|
begin
|
|||
|
|
n := 2;
|
|||
|
|
end;
|
|||
|
|
try
|
|||
|
|
ADOQueryMain.DisableControls;
|
|||
|
|
with ADOQueryMain do
|
|||
|
|
begin
|
|||
|
|
Filtered := False;
|
|||
|
|
Close;
|
|||
|
|
SQL.Clear;
|
|||
|
|
sql.Add(' exec P_GC_GL_FPView :begdate,:enddate,:FPType,:HTStatus,:DataType,:DataType2 ');
|
|||
|
|
Parameters.ParamByName('begdate').Value := trim(FormatDateTime('yyyy-MM-dd', begdate.Date));
|
|||
|
|
Parameters.ParamByName('enddate').Value := trim(FormatDateTime('yyyy-MM-dd', enddate.Date + 1));
|
|||
|
|
Parameters.ParamByName('FPType').Value := 'ȫ<><C8AB>';
|
|||
|
|
Parameters.ParamByName('HTStatus').Value := n;
|
|||
|
|
if CheckBox1.Checked then
|
|||
|
|
begin
|
|||
|
|
Parameters.ParamByName('DataType').Value := '1';
|
|||
|
|
end
|
|||
|
|
else
|
|||
|
|
begin
|
|||
|
|
Parameters.ParamByName('DataType').Value := '';
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
|
|||
|
|
open;
|
|||
|
|
end;
|
|||
|
|
SCreateCDS20(ADOQueryMain, CDS_HZ);
|
|||
|
|
SInitCDSData20(ADOQueryMain, CDS_HZ);
|
|||
|
|
for i := 1 to 33 - CDS_HZ.RecordCount do
|
|||
|
|
begin
|
|||
|
|
with CDS_HZ do
|
|||
|
|
begin
|
|||
|
|
Append;
|
|||
|
|
post;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
;
|
|||
|
|
ADOQueryMain.EnableControls;
|
|||
|
|
end;
|
|||
|
|
Panel2.Visible := False;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.FormDestroy(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
frmGCFPHZList := nil;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.FormClose(Sender: TObject; var Action: TCloseAction);
|
|||
|
|
begin
|
|||
|
|
Action := caFree;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.TBCloseClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
WriteCxGrid('<27><><EFBFBD>̷<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>ͳ<EFBFBD>Ʋ<EFBFBD>ѯ1', Tv2, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
Close;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.FormShow(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
fsj: string;
|
|||
|
|
begin
|
|||
|
|
ReadCxGrid('<27><><EFBFBD>̷<EFBFBD>Ʊ<EFBFBD><C6B1><EFBFBD><EFBFBD>ͳ<EFBFBD>Ʋ<EFBFBD>ѯ1', Tv2, '<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
|
|||
|
|
Enddate.DateTime := SGetServerDate(ADOQueryTemp);
|
|||
|
|
begdate.DateTime := SGetServerDateMBeg(ADOQueryTemp);
|
|||
|
|
if Trim(DCode) <> 'ADMIN' then
|
|||
|
|
begin
|
|||
|
|
TBExport.Visible := False;
|
|||
|
|
TBDataDel.Visible := False;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.TBRafreshClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.ToolButton2Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if ADOQueryMain.Active = False then
|
|||
|
|
Exit;
|
|||
|
|
SDofilter(ADOQueryMain, Trim(SGetFilters(Panel1, 1, 2)));
|
|||
|
|
SCreateCDS20(ADOQueryMain, CDS_HZ);
|
|||
|
|
SInitCDSData20(ADOQueryMain, CDS_HZ);
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.GCNameChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ToolButton2.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.TBExportClick(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
if ADOQueryMain.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
SelExportData(Tv2, ADOQueryMain, '<27><><EFBFBD>̷<EFBFBD>Ʊͳ<C6B1><CDB3><EFBFBD>б<EFBFBD>');
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.V2Column1CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
var
|
|||
|
|
id: Integer;
|
|||
|
|
begin
|
|||
|
|
id := TV2.GetColumnByFieldName('SQXSMoney').Index; //;-TV1.GroupedItemCount;
|
|||
|
|
if id < 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] > 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] = 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] = Null then
|
|||
|
|
Exit;
|
|||
|
|
//ACanvas.Brush.Color:=clRed;
|
|||
|
|
ACanvas.Font.Color := clRed;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.V2Column3CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
var
|
|||
|
|
id: Integer;
|
|||
|
|
begin
|
|||
|
|
id := TV2.GetColumnByFieldName('SQSKMoney').Index; //;-TV1.GroupedItemCount;
|
|||
|
|
if id < 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] > 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] = 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] = Null then
|
|||
|
|
Exit;
|
|||
|
|
// ACanvas.Brush.Color:=clRed;
|
|||
|
|
ACanvas.Font.Color := clRed;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.cSQQPCustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
var
|
|||
|
|
id: Integer;
|
|||
|
|
begin
|
|||
|
|
id := TV2.GetColumnByFieldName('SQKPMoney').Index; //;-TV1.GroupedItemCount;
|
|||
|
|
if id < 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] > 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] = 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] = Null then
|
|||
|
|
Exit;
|
|||
|
|
//ACanvas.Brush.Color:=clRed;
|
|||
|
|
ACanvas.Font.Color := clRed;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.cBQKPCustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
var
|
|||
|
|
id: Integer;
|
|||
|
|
begin
|
|||
|
|
id := TV2.GetColumnByFieldName('BQXSMoney').Index; //;-TV1.GroupedItemCount;
|
|||
|
|
if id < 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] > 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] = 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] = Null then
|
|||
|
|
Exit;
|
|||
|
|
//ACanvas.Brush.Color:=clRed;
|
|||
|
|
ACanvas.Font.Color := clRed;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.V2Column4CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
var
|
|||
|
|
id: Integer;
|
|||
|
|
begin
|
|||
|
|
id := TV2.GetColumnByFieldName('BQSKMoney').Index; //;-TV1.GroupedItemCount;
|
|||
|
|
if id < 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] > 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] = 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] = Null then
|
|||
|
|
Exit;
|
|||
|
|
//ACanvas.Brush.Color:=clRed;
|
|||
|
|
ACanvas.Font.Color := clRed;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.V2BQXKPMoneyCustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
var
|
|||
|
|
id: Integer;
|
|||
|
|
begin
|
|||
|
|
id := TV2.GetColumnByFieldName('BQKPMoney').Index; //;-TV1.GroupedItemCount;
|
|||
|
|
if id < 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] > 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] = 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] = Null then
|
|||
|
|
Exit;
|
|||
|
|
//ACanvas.Brush.Color:=clRed;
|
|||
|
|
ACanvas.Font.Color := clRed;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.cxWKPCustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
var
|
|||
|
|
id: Integer;
|
|||
|
|
begin
|
|||
|
|
id := TV2.GetColumnByFieldName('HZXSMoney').Index; //;-TV1.GroupedItemCount;
|
|||
|
|
if id < 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] > 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] = 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] = Null then
|
|||
|
|
Exit;
|
|||
|
|
// ACanvas.Brush.Color:=clRed;
|
|||
|
|
ACanvas.Font.Color := clRed;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.V2Column5CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
var
|
|||
|
|
id: Integer;
|
|||
|
|
begin
|
|||
|
|
id := TV2.GetColumnByFieldName('HZSKMoney').Index; //;-TV1.GroupedItemCount;
|
|||
|
|
if id < 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] > 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] = 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] = Null then
|
|||
|
|
Exit;
|
|||
|
|
//ACanvas.Brush.Color:=clRed;
|
|||
|
|
ACanvas.Font.Color := clRed;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.V2Column2CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
var
|
|||
|
|
id: Integer;
|
|||
|
|
begin
|
|||
|
|
id := TV2.GetColumnByFieldName('HZKPMoney').Index; //;-TV1.GroupedItemCount;
|
|||
|
|
if id < 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] > 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] = 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] = Null then
|
|||
|
|
Exit;
|
|||
|
|
//ACanvas.Brush.Color:=clRed;
|
|||
|
|
ACanvas.Font.Color := clRed;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.V2WCStatusCustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
var
|
|||
|
|
id: Integer;
|
|||
|
|
begin
|
|||
|
|
id := TV2.GetColumnByFieldName('HZWKPMoney').Index; //;-TV1.GroupedItemCount;
|
|||
|
|
if id < 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] > 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] = 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] = Null then
|
|||
|
|
Exit;
|
|||
|
|
//ACanvas.Brush.Color:=clRed;
|
|||
|
|
ACanvas.Font.Color := clRed;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.V2Column6CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
|
|||
|
|
var
|
|||
|
|
id: Integer;
|
|||
|
|
begin
|
|||
|
|
id := TV2.GetColumnByFieldName('HZWSKMoney').Index; //;-TV1.GroupedItemCount;
|
|||
|
|
if id < 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] > 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] = 0 then
|
|||
|
|
Exit;
|
|||
|
|
if AViewInfo.GridRecord.Values[id] = Null then
|
|||
|
|
Exit;
|
|||
|
|
//ACanvas.Brush.Color:=clRed;
|
|||
|
|
ACanvas.Font.Color := clRed;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.cxTabControl1Change(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.TV2CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
|
|||
|
|
var
|
|||
|
|
FName: string;
|
|||
|
|
begin
|
|||
|
|
if CDS_HZ.IsEmpty then
|
|||
|
|
Exit;
|
|||
|
|
FName := TV2.Controller.FocusedColumn.DataBinding.FilterFieldName;
|
|||
|
|
BFGCName := Trim(CDS_HZ.fieldbyname('GCName').AsString);
|
|||
|
|
if (FName = 'SQXSMoney') or (FName = 'SQSKMoney') or (FName = 'SQKPMoney') then
|
|||
|
|
begin
|
|||
|
|
BFBegdate := '1900-01-01';
|
|||
|
|
BFEnddate := Trim(FormatDateTime('yyyy-MM-dd', begdate.Date - 1));
|
|||
|
|
end
|
|||
|
|
else if (FName = 'BQXSMoney') or (FName = 'BQSKMoney') or (FName = 'BQKPMoney') then
|
|||
|
|
begin
|
|||
|
|
BFBegdate := Trim(FormatDateTime('yyyy-MM-dd', begdate.Date));
|
|||
|
|
BFEnddate := Trim(FormatDateTime('yyyy-MM-dd', Enddate.Date));
|
|||
|
|
end
|
|||
|
|
else if (FName = 'HZXSMoney') or (FName = 'HZSKMoney') or (FName = 'HZKPMoney') then
|
|||
|
|
begin
|
|||
|
|
BFBegdate := '1900-01-01';
|
|||
|
|
BFEnddate := '2500-01-01';
|
|||
|
|
end;
|
|||
|
|
if (FName = 'SQXSMoney') or (FName = 'BQXSMoney') or (FName = 'HZXSMoney') then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmYSCRPBMggGCView := TfrmYSCRPBMggGCView.Create(Application);
|
|||
|
|
with frmYSCRPBMggGCView do
|
|||
|
|
begin
|
|||
|
|
FBegdate := Self.BFBegdate;
|
|||
|
|
FEndDate := Self.BFEnddate;
|
|||
|
|
FGCName := Self.BFGCName;
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmYSCRPBMggGCView.Free;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else if (FName = 'SQSKMoney') or (FName = 'BQSKMoney') or (FName = 'HZSKMoney') then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmSKCRPBMggGCView := TfrmSKCRPBMggGCView.Create(Application);
|
|||
|
|
with frmSKCRPBMggGCView do
|
|||
|
|
begin
|
|||
|
|
FBegdate := Self.BFBegdate;
|
|||
|
|
FEndDate := Self.BFEnddate;
|
|||
|
|
FGCName := Self.BFGCName;
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmSKCRPBMggGCView.Free;
|
|||
|
|
end;
|
|||
|
|
end
|
|||
|
|
else if (FName = 'SQKPMoney') or (FName = 'BQKPMoney') or (FName = 'HZKPMoney') then
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
frmFPCRPBMggGCView := TfrmFPCRPBMggGCView.Create(Application);
|
|||
|
|
with frmFPCRPBMggGCView do
|
|||
|
|
begin
|
|||
|
|
FBegdate := Self.BFBegdate;
|
|||
|
|
FEndDate := Self.BFEnddate;
|
|||
|
|
FGCName := Self.BFGCName;
|
|||
|
|
if ShowModal = 1 then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
finally
|
|||
|
|
frmFPCRPBMggGCView.Free;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.KHNameChange(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ToolButton2.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.GCName10Change(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
ToolButton2.Click;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.CheckBox1Click(Sender: TObject);
|
|||
|
|
begin
|
|||
|
|
InitGrid();
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.TBDataDelClick(Sender: TObject);
|
|||
|
|
var
|
|||
|
|
FConNO, FConMainid: string;
|
|||
|
|
begin
|
|||
|
|
if cxTabControl1.TabIndex <> 1 then
|
|||
|
|
Exit;
|
|||
|
|
if Application.MessageBox('ȷ<><C8B7>Ҫ<EFBFBD><D2AA><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><DEB7><EFBFBD><EFBFBD><EFBFBD>!', '', 32 + 4) <> IDYES then
|
|||
|
|
Exit;
|
|||
|
|
begin
|
|||
|
|
try
|
|||
|
|
ADOQueryCmd.Connection.BeginTrans;
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('select * from JYOrderCon_Main where CustomerNoName=''' + Trim(CDS_HZ.fieldbyname('KHName').AsString) + '''');
|
|||
|
|
sql.Add(' and GCName=''' + Trim(CDS_HZ.fieldbyname('GCName').AsString) + ''' and isnull(status,'''')=''3'' ');
|
|||
|
|
Open;
|
|||
|
|
end;
|
|||
|
|
if ADOQueryCmd.RecordCount > 1 then
|
|||
|
|
begin
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ظ<EFBFBD><D8B8><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ܲ<EFBFBD><DCB2><EFBFBD><EFBFBD><EFBFBD>', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
FConNO := Trim(ADOQueryCmd.fieldbyname('ConNo').AsString);
|
|||
|
|
FConMainid := Trim(ADOQueryCmd.fieldbyname('Mainid').AsString);
|
|||
|
|
with ADOQueryCmd do
|
|||
|
|
begin
|
|||
|
|
Close;
|
|||
|
|
sql.Clear;
|
|||
|
|
sql.Add('delete YF_Money_CR where isnull(ConNo,'''')=''' + Trim(FConNO) + ''' and isnull(CRFlag,'''')=''Ӧ<><D3A6><EFBFBD><EFBFBD>'' ');
|
|||
|
|
sql.Add('delete JYOrder_Main where isnull(ConNo,'''')=''' + Trim(FConNO) + '''');
|
|||
|
|
sql.Add('delete JYOrderCon_Main where isnull(ConNo,'''')=''' + Trim(FConNO) + '''');
|
|||
|
|
sql.Add('delete JYOrderCon_Sub where isnull(MainId,'''')=''' + Trim(FConMainid) + '''');
|
|||
|
|
sql.Add('delete CK_CP_CR where isnull(ConNo,'''')=''' + Trim(FConNO) + '''');
|
|||
|
|
ExecSQL;
|
|||
|
|
end;
|
|||
|
|
ADOQueryCmd.Connection.CommitTrans;
|
|||
|
|
CDS_HZ.Delete;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD>ɹ<EFBFBD>!', '<27><>ʾ', 0);
|
|||
|
|
except
|
|||
|
|
ADOQueryCmd.Connection.RollbackTrans;
|
|||
|
|
Application.MessageBox('<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʧ<EFBFBD><CAA7>!', '<27><>ʾ', 0);
|
|||
|
|
Exit;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
procedure TfrmGCFPHZList.TV2StylesGetContentStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out AStyle: TcxStyle);
|
|||
|
|
begin
|
|||
|
|
if CDS_HZ.FieldByName('Ssel').AsBoolean = True then
|
|||
|
|
begin
|
|||
|
|
|
|||
|
|
end;
|
|||
|
|
end;
|
|||
|
|
|
|||
|
|
end.
|
|||
|
|
|