📄 uz_gtsp.pas
字号:
unit uz_gtsp;
interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Menus, Grids, DBGrids, StdCtrls, ComCtrls, ExtCtrls, ToolWin, Buttons,u_main,
ImgList, DBTables, Db;
type
Tz_gtsp = class(TForm)
StatusBar1: TStatusBar;
CoolBar1: TCoolBar;
ToolBar1: TToolBar;
rg: TToolButton;
ye: TToolButton;
dy: TToolButton;
yl: TToolButton;
bz: TToolButton;
tc: TToolButton;
MainMenu1: TMainMenu;
MenuItem11: TMenuItem;
MenuItem12: TMenuItem;
MenuItem13: TMenuItem;
N2: TMenuItem;
MenuItem14: TMenuItem;
MenuItem18: TMenuItem;
MenuItem19: TMenuItem;
MenuItem20: TMenuItem;
MenuItem73: TMenuItem;
MenuItem74: TMenuItem;
MenuItem75: TMenuItem;
MenuItem76: TMenuItem;
ScrollBox1: TScrollBox;
spbm: TEdit;
Image1: TImage;
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Shape1: TShape;
Shape2: TShape;
Label8: TLabel;
Shape3: TShape;
Shape4: TShape;
Shape5: TShape;
Shape6: TShape;
Shape8: TShape;
Shape9: TShape;
Shape10: TShape;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Image3: TImage;
Label14: TLabel;
Label15: TLabel;
Shape17: TShape;
Shape18: TShape;
Label16: TLabel;
Shape19: TShape;
Label23: TLabel;
Label12: TLabel;
Label13: TLabel;
Shape7: TShape;
Shape13: TShape;
Shape14: TShape;
spmc: TLabel;
spgg: TLabel;
sx: TToolButton;
Label17: TLabel;
Label18: TLabel;
Label19: TLabel;
Label20: TLabel;
Label21: TLabel;
Label22: TLabel;
ImageList1: TImageList;
fg1: TToolButton;
fg2: TToolButton;
fg3: TToolButton;
fg4: TToolButton;
N1: TMenuItem;
N3: TMenuItem;
gtch: TTable;
gtchChbh: TStringField;
gtchQrq: TDateTimeField;
gtchZrq: TDateTimeField;
gtchFdbh: TStringField;
gtchGtbh: TStringField;
gtchSPBM: TStringField;
gtchSpmc: TStringField;
gtchSPGG: TStringField;
gtchDW: TStringField;
gtchDj: TFloatField;
gtchSL: TFloatField;
gtchYydw: TStringField;
gtchZhgx: TFloatField;
gtchBz: TStringField;
d_gtch: TDataSource;
gtsp: TTable;
gtspYwbh: TStringField;
gtspGtbh: TStringField;
gtspFdbh: TStringField;
gtspYwrq: TDateField;
gtspSpbm: TStringField;
gtspSpmc: TStringField;
gtspSPGG: TStringField;
gtspJDW: TStringField;
gtspJDj: TFloatField;
gtspJSL: TFloatField;
gtspCdw: TStringField;
gtspCdj: TFloatField;
gtspCsl: TFloatField;
gtspYdw: TStringField;
gtspYdj: TFloatField;
gtspYsl: TFloatField;
gtspYydw: TStringField;
gtspZhgx: TFloatField;
gtspKj: TStringField;
gtspJl: TStringField;
gtspJsr: TStringField;
gtspCzyh: TStringField;
gtspShr: TStringField;
gtspBz: TStringField;
d_gtsp: TDataSource;
q_gtye: TQuery;
q_gtyespbm: TStringField;
q_gtyespmc: TStringField;
q_gtyeydw: TStringField;
q_gtyeysl: TFloatField;
q_gtyeydj: TFloatField;
q_gtyeydjysl: TFloatField;
q_gtyebz: TStringField;
d_q_gtye: TDataSource;
q_sp_cx: TQuery;
q_sp_cxspbm: TStringField;
q_sp_cxspmc: TStringField;
q_sp_cxspgg: TStringField;
q_sp_cxywdw: TStringField;
q_sp_cxyydw: TStringField;
q_sp_cxhsgx: TFloatField;
dq_sp_cx: TDataSource;
q_gtsp: TQuery;
q_gtspYwbh: TStringField;
q_gtspGtbh: TStringField;
q_gtspFdbh: TStringField;
q_gtspYwrq: TDateField;
q_gtspspbm: TStringField;
q_gtspSpmc: TStringField;
q_gtspSPGG: TStringField;
q_gtspJDW: TStringField;
q_gtspJDj: TFloatField;
q_gtspJSL: TFloatField;
q_gtspCdw: TStringField;
q_gtspCdj: TFloatField;
q_gtspCsl: TFloatField;
q_gtspYdw: TStringField;
q_gtspYdj: TFloatField;
q_gtspYsl: TFloatField;
q_gtspYydw: TStringField;
q_gtspZhgx: TFloatField;
q_gtspKj: TStringField;
q_gtspJl: TStringField;
q_gtspJsr: TStringField;
q_gtspCzyh: TStringField;
q_gtspShr: TStringField;
q_gtspBz: TStringField;
dq_gtsp: TDataSource;
gtspsx: TTable;
gtspsxSpbm: TStringField;
gtspsxSPMC: TStringField;
gtspsxSPGG: TStringField;
gtspsxYWDW: TStringField;
gtspsxYYDW: TStringField;
gtspsxHSGX: TFloatField;
gtspsxXSJG: TFloatField;
d_gtspsx: TDataSource;
rgzy: TTable;
rgzyBh: TStringField;
rgzyZy: TStringField;
d_rgzy: TDataSource;
dw: TTable;
dwBh: TStringField;
dwDw: TStringField;
d_dw: TDataSource;
glry: TTable;
glryRybh: TStringField;
glryRyxm: TStringField;
glryZw: TStringField;
d_glry: TDataSource;
procedure tcClick(Sender: TObject);
procedure yeClick(Sender: TObject);
procedure BitBtn1Click(Sender: TObject);
procedure rgClick(Sender: TObject);
procedure spbmKeyPress(Sender: TObject; var Key: Char);
procedure sxClick(Sender: TObject);
procedure spbmKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
procedure MenuItem76Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
private
{ Private declarations }
public
{ Public declarations }
end;
var
z_gtsp: Tz_gtsp;
implementation
uses uz_gtsp_ye, uz_gtsp_rg, uz_sp_cx,
uz_gtsp_sx, uabout, uz_gtspsx_xz, uz_sp_cx_rg, uzp_gtsp, ug_wait;
{$R *.DFM}
procedure Tz_gtsp.tcClick(Sender: TObject);
begin
close;
end;
procedure Tz_gtsp.yeClick(Sender: TObject);
begin
z_gtsp_ye.showmodal;
end;
procedure Tz_gtsp.BitBtn1Click(Sender: TObject);
begin
gtsp.edit;
gtsp.post;
end;
procedure Tz_gtsp.rgClick(Sender: TObject);
begin
z_gtsp_rg.showmodal;
end;
procedure Tz_gtsp.spbmKeyPress(Sender: TObject; var Key: Char);
//var
// i,ii:integer;
begin
{
if key=#13 then
begin
z_sp_cx.showmodal;
if esc_enter=1 then
begin
spbm.Text:=dm.q_sp_cxspbm.asstring;
spmc.caption:=dm.q_sp_cxspmc.asstring;
spgg.caption:=dm.q_sp_cxspgg.asstring;
//各网格初始化
sg1.RowCount:=20;
sg2.RowCount:=20;
sg3.RowCount:=20;
for i:=0 to 19 do
begin
for ii:=0 to 4 do
sg1.cells[ii,i]:='';
for ii:=0 to 1 do
sg2.cells[ii,i]:='';
for ii:=0 to 1 do
sg3.cells[ii,i]:='';
end;
//各网格初始化
if dm.q_gtsp.RecordCount>20 then
begin
sg1.RowCount:=dm.q_gtsp.RecordCount;
sg2.RowCount:=dm.q_gtsp.RecordCount;
sg3.RowCount:=dm.q_gtsp.RecordCount;
end;
dm.q_gtsp.first;
for i:=0 to dm.q_gtsp.RecordCount-1 do
begin
if length(formatdatetime('yyyymmdd',dm.q_gtspywrq.asdatetime))<>0 then
begin
sg1.cells[0,i]:=copy(formatdatetime('yyyymmdd',dm.q_gtspywrq.asdatetime),5,2);
sg1.cells[1,i]:=copy(formatdatetime('yyyymmdd',dm.q_gtspywrq.asdatetime),7,2);
end;
sg1.cells[2,i]:=dm.q_gtspbz.asstring;
sg1.cells[3,i]:=dm.q_gtspjsl.asstring;
sg1.cells[4,i]:=format('%*.*f',[8,2,dm.q_gtspjdj.value]);
sg2.cells[0,i]:=dm.q_gtspcsl.asstring;
sg2.cells[1,i]:=format('%*.*f',[8,2,dm.q_gtspcdj.value]);
sg3.cells[0,i]:=dm.q_gtspysl.asstring;
sg3.cells[1,i]:=format('%*.*f',[8,2,dm.q_gtspydj.value]);
dm.q_gtsp.next;
end; //for
end; //if esc_enter
end; //if key
}
end;
procedure Tz_gtsp.sxClick(Sender: TObject);
begin
z_gtsp_sx.showmodal;
end;
procedure Tz_gtsp.spbmKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
begin
if ((key<=57) and (key>=48)) or ((key<=105) and (key>=90))
or ((key>=65) and (key<=90)) then
begin
esc_enter:=0;
z_sp_cx.showmodal;
if esc_enter=0 then exit;
spbm.Text:=q_sp_cxspbm.asstring;
spmc.caption:=q_sp_cxspmc.asstring;
spgg.caption:=q_sp_cxspgg.asstring;
end;
end;
procedure Tz_gtsp.MenuItem76Click(Sender: TObject);
begin
if about=NIL then about:=Tabout.Create(self);
about.showmodal;
end;
procedure Tz_gtsp.FormShow(Sender: TObject);
begin
if not glry.Active then glry.Active:=true;
if not dw.Active then dw.Active:=true;
if not rgzy.Active then rgzy.Active:=true;
if not gtspsx.Active then gtspsx.Active:=true;
if not gtch.Active then gtch.Active:=true;
if not gtsp.Active then gtsp.Active:=true;
if z_gtsp_rg=NIL then z_gtsp_rg:=Tz_gtsp_rg.Create(Application);
if z_gtsp_ye=NIL then z_gtsp_ye:=Tz_gtsp_ye.Create(Application);
if z_gtsp_sx=NIL then z_gtsp_sx:=Tz_gtsp_sx.Create(Application);
if z_gtspsx_xz=NIL then z_gtspsx_xz:=Tz_gtspsx_xz.Create(Application);
if z_sp_cx=NIL then z_sp_cx:=Tz_sp_cx.Create(Application);
if z_sp_cx_rg=NIL then z_sp_cx_rg:=Tz_sp_cx_rg.Create(Application);
if zp_gtsp=NIL then zp_gtsp:=Tzp_gtsp.Create(Application);
g_wait.close;
end;
procedure Tz_gtsp.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Release;
z_gtsp:=NIL;
z_gtsp_rg.Release;
z_gtsp_rg:=NIL;
z_gtsp_ye.Release;
z_gtsp_ye:=NIL;
z_gtsp_sx.Release;
z_gtsp_sx:=NIL;
z_gtspsx_xz.Release;
z_gtspsx_xz:=NIL;
z_sp_cx.Release;
z_sp_cx:=NIL;
z_sp_cx_rg.Release;
z_sp_cx_rg:=NIL;
zp_gtsp.Release;
zp_gtsp:=NIL;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -