You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

255 lines
8.1 KiB
Plaintext

unit u_rp_tai_airi;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, dxExEdtr, XPMenu, Menus, DB, ADODB, bsSkinCtrls, dxDBGrid,
dxDBTLCl, dxGrClms, dxTL, dxDBCtrl, dxCntner, ExtCtrls;
type
Tfrm_rp_tai_airi = class(TForm)
Panel1: TPanel;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column5: TdxDBGridMaskColumn;
dxDBGrid1Column3: TdxDBGridMaskColumn;
dxDBGrid1Column4: TdxDBGridMaskColumn;
dxDBGrid1Column6: TdxDBGridDateColumn;
dxDBGrid1Column7: TdxDBGridMaskColumn;
dxDBGrid1Column8: TdxDBGridMaskColumn;
dxDBGrid1Column9: TdxDBGridMaskColumn;
dxDBGrid1Column11: TdxDBGridMaskColumn;
dxDBGrid1Column21: TdxDBGridMaskColumn;
dxDBGrid1Column24: TdxDBGridMaskColumn;
dxDBGrid1Column26: TdxDBGridDateColumn;
dxDBGrid1Column29: TdxDBGridMaskColumn;
dxDBGrid1Column31: TdxDBGridMaskColumn;
dxDBGrid1Column51: TdxDBGridMaskColumn;
dxDBGrid1Column54: TdxDBGridMaskColumn;
dxDBGrid1Column56: TdxDBGridColumn;
dxDBGrid1Column89: TdxDBGridMaskColumn;
dxDBGrid1Column92: TdxDBGridMaskColumn;
dxDBGrid1Column83: TdxDBGridMaskColumn;
dxDBGrid1Column84: TdxDBGridDateColumn;
dxDBGrid1Column85: TdxDBGridMaskColumn;
dxDBGrid1Column87: TdxDBGridMaskColumn;
dxDBGrid1Column86: TdxDBGridMaskColumn;
dxDBGrid1USD: TdxDBGridColumn;
dxDBGrid1Column97: TdxDBGridColumn;
dxDBGrid1Column98: TdxDBGridColumn;
dxDBGrid1RMB: TdxDBGridColumn;
dxDBGrid1Column100: TdxDBGridColumn;
dxDBGrid1Column101: TdxDBGridColumn;
dxDBGrid1Column102: TdxDBGridColumn;
dxDBGrid1Column103: TdxDBGridColumn;
dxDBGrid1Column104: TdxDBGridColumn;
dxDBGrid1Column105: TdxDBGridColumn;
dxDBGrid1Column106: TdxDBGridColumn;
dxDBGrid1Column107: TdxDBGridColumn;
dxDBGrid1Column108: TdxDBGridColumn;
dxDBGrid1Column109: TdxDBGridColumn;
dxDBGrid1Column110: TdxDBGridColumn;
dxDBGrid1Column111: TdxDBGridColumn;
dxDBGrid1Column112: TdxDBGridColumn;
dxDBGrid1Column113: TdxDBGridColumn;
dxDBGrid1Column114: TdxDBGridColumn;
dxDBGrid1Column115: TdxDBGridColumn;
dxDBGrid1Column116: TdxDBGridColumn;
dxDBGrid1Column117: TdxDBGridMaskColumn;
bsSkinButton10: TbsSkinButton;
bsSkinButton9: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
p_query_table: TADOStoredProc;
p_query_table1: TDataSource;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
N5: TMenuItem;
XPMenu1: TXPMenu;
SaveDialog: TSaveDialog;
dxDBGrid1Column46: TdxDBGridColumn;
dxDBGrid1Column47: TdxDBGridColumn;
dxDBGrid1Column48: TdxDBGridColumn;
PopupMenu2: TPopupMenu;
N10: TMenuItem;
N11: TMenuItem;
N14: TMenuItem;
N13: TMenuItem;
N12: TMenuItem;
N15: TMenuItem;
N16: TMenuItem;
XPMenu2: TXPMenu;
procedure bsSkinButton5Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure bsSkinButton9Click(Sender: TObject);
procedure N1Click(Sender: TObject);
procedure N3Click(Sender: TObject);
procedure N5Click(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure dxDBGrid1Column4CustomDraw(Sender: TObject; ACanvas: TCanvas;
ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn;
const AText: String; AFont: TFont; var AColor: TColor; ASelected,
AFocused: Boolean; var ADone: Boolean);
procedure Panel1Resize(Sender: TObject);
procedure dxDBGrid1Column3CustomDraw(Sender: TObject; ACanvas: TCanvas;
ARect: TRect; ANode: TdxTreeListNode; AColumn: TdxDBTreeListColumn;
const AText: String; AFont: TFont; var AColor: TColor; ASelected,
AFocused: Boolean; var ADone: Boolean);
procedure N10Click(Sender: TObject);
procedure N14Click(Sender: TObject);
procedure N12Click(Sender: TObject);
procedure N16Click(Sender: TObject);
procedure dxDBGrid1ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
procedure dxDBGrid1Column116CustomDraw(Sender: TObject;
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
var AColor: TColor; ASelected, AFocused: Boolean;
var ADone: Boolean);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_rp_tai_airi: Tfrm_rp_tai_airi;
implementation
uses u_main, my_sys_function, u_data_share;
{$R *.dfm}
procedure Tfrm_rp_tai_airi.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_rp_tai_airi.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
savereggrid(dxdbgrid1,caption);
frm_rp_tai_airi.Hide;
frm_rp_tai_airi.ManualFloat(frm_rp_tai_airi.BoundsRect );
frm_main.freeTabs('frm_rp_tai_airi');
action:=cafree;
frm_rp_tai_airi:=nil;
end;
procedure Tfrm_rp_tai_airi.bsSkinButton9Click(Sender: TObject);
var
Pnt:Tpoint;
begin
Pnt:=bsSkinButton9.ClientToScreen(Point(0,bsSkinButton9.Height));
PopupMenu1.Popup(Pnt.x,Pnt.y);
end;
procedure Tfrm_rp_tai_airi.N1Click(Sender: TObject);
begin
sys_print('<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>̨<EFBFBD><CCA8>',1,nil,nil,nil,nil,p_query_table1,nil,nil,nil,nil,nil,nil);
end;
procedure Tfrm_rp_tai_airi.N3Click(Sender: TObject);
begin
sys_print('<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>̨<EFBFBD><CCA8>',2,nil,nil,nil,nil,p_query_table1,nil,nil,nil,nil,nil,nil);
end;
procedure Tfrm_rp_tai_airi.N5Click(Sender: TObject);
begin
with SaveDialog do
begin
DefaultExt :='xls';
Filter := '(*.xls)|*.xls';
if Execute then
dxDBGrid1.SaveToXLS(FileName,true);
end;
end;
procedure Tfrm_rp_tai_airi.bsSkinButton10Click(Sender: TObject);
begin
query_airi(5,'0031');
end;
procedure Tfrm_rp_tai_airi.FormShow(Sender: TObject);
begin
loadreggrid(dxdbgrid1,false,caption);
if frm_data_share.t_load_employee.FieldByName('Ӧ<><D3A6>').asboolean then
dxDBGrid1.Bands[2].Visible:=true
else
dxDBGrid1.Bands[2].Visible:=false;
if frm_data_share.t_load_employee.FieldByName('Ӧ<><D3A6>').asboolean then
dxDBGrid1.Bands[3].Visible:=true
else
dxDBGrid1.Bands[3].Visible:=false;
if frm_data_share.t_load_employee.FieldByName('<27><><EFBFBD><EFBFBD>').asboolean then
dxDBGrid1.Bands[4].Visible:=true
else
dxDBGrid1.Bands[4].Visible:=false;
end;
procedure Tfrm_rp_tai_airi.dxDBGrid1Column4CustomDraw(Sender: TObject;
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean);
begin
AColor:=dxgrid_color_fee(ANode.strings[dxDBGrid1Column4.Index]);
AFont.Color:=clblack;
end;
procedure Tfrm_rp_tai_airi.Panel1Resize(Sender: TObject);
begin
bsSkinButton10.Left:=Panel1.Width-3*bsSkinButton5.Width-18;
bsSkinButton9.Left:=Panel1.Width-2*bsSkinButton5.Width-12;
bsSkinButton5.Left:=Panel1.Width-bsSkinButton5.Width-6;
end;
procedure Tfrm_rp_tai_airi.dxDBGrid1Column3CustomDraw(Sender: TObject;
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean);
begin
AColor:=dxgrid_color('<27><><EFBFBD>˽<EFBFBD><CBBD><EFBFBD>',ANode.Strings[dxDBGrid1Column3.Index]);
AFont.Color:=clblack;
end;
procedure Tfrm_rp_tai_airi.N10Click(Sender: TObject);
begin
update_grid_view_no(dxdbgrid1);
end;
procedure Tfrm_rp_tai_airi.N14Click(Sender: TObject);
begin
update_grid_view_all(dxdbgrid1);
end;
procedure Tfrm_rp_tai_airi.N12Click(Sender: TObject);
begin
update_grid(dxdbgrid1,64);
end;
procedure Tfrm_rp_tai_airi.N16Click(Sender: TObject);
begin
grid_save_xls(dxdbgrid1);
end;
procedure Tfrm_rp_tai_airi.dxDBGrid1ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
begin
Column_sort_pro(Column,p_query_table,'ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_rp_tai_airi.dxDBGrid1Column116CustomDraw(Sender: TObject;
ACanvas: TCanvas; ARect: TRect; ANode: TdxTreeListNode;
AColumn: TdxDBTreeListColumn; const AText: String; AFont: TFont;
var AColor: TColor; ASelected, AFocused: Boolean; var ADone: Boolean);
begin
if strtofloatdef(AText,0)<=0 then
AColor:=clRed;
end;
end.