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.

312 lines
10 KiB
Plaintext

11 months ago
unit u_rp_tai_seae_pin;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, bsSkinCtrls, DB, ADODB,Grids, DBGrids, dxExEdtr, dxDBTLCl, dxGrClms, dxTL,
dxDBCtrl, dxDBGrid, dxCntner, wwdbdatetimepicker, StdCtrls, wwdblook,
RxLookup, Menus, XPMenu;
type
Tfrm_rp_tai_seae_pin = class(TForm)
bsSkinPanel1: TbsSkinPanel;
p_seae_pin1: TDataSource;
dxDBGrid1: TdxDBGrid;
p_seae_pin: TADOStoredProc;
dxDBGrid1Column5: TdxDBGridColumn;
dxDBGrid1Column3: TdxDBGridColumn;
dxDBGrid1Column4: TdxDBGridColumn;
dxDBGrid1Column6: TdxDBGridColumn;
dxDBGrid1Column7: TdxDBGridColumn;
dxDBGrid1Column8: TdxDBGridColumn;
dxDBGrid1Column9: TdxDBGridColumn;
dxDBGrid1Column10: TdxDBGridColumn;
dxDBGrid1Column11: TdxDBGridColumn;
dxDBGrid1Column12: TdxDBGridColumn;
dxDBGrid1Column19: TdxDBGridColumn;
dxDBGrid1Column21: TdxDBGridColumn;
dxDBGrid1Column22: TdxDBGridColumn;
dxDBGrid1Column23: TdxDBGridColumn;
dxDBGrid1Column24: TdxDBGridColumn;
dxDBGrid1Column25: TdxDBGridColumn;
dxDBGrid1Column26: TdxDBGridColumn;
dxDBGrid1Column28: TdxDBGridColumn;
dxDBGrid1Column30: TdxDBGridColumn;
dxDBGrid1Column32: TdxDBGridColumn;
dxDBGrid1Column33: TdxDBGridColumn;
dxDBGrid1Column34: TdxDBGridColumn;
dxDBGrid1Column35: TdxDBGridColumn;
dxDBGrid1Column40: TdxDBGridColumn;
dxDBGrid1Column43: TdxDBGridColumn;
dxDBGrid1Column54: TdxDBGridColumn;
dxDBGrid1Column55: TdxDBGridColumn;
dxDBGrid1Column56: TdxDBGridColumn;
dxDBGrid1Column57: TdxDBGridColumn;
dxDBGrid11: TdxDBGridColumn;
dxDBGrid12: TdxDBGridColumn;
dxDBGrid13: TdxDBGridColumn;
dxDBGrid14: TdxDBGridColumn;
dxDBGrid15: TdxDBGridColumn;
dxDBGrid16: TdxDBGridColumn;
dxDBGrid17: TdxDBGridColumn;
dxDBGrid18: TdxDBGridColumn;
dxDBGrid19: TdxDBGridColumn;
dxDBGrid110: TdxDBGridColumn;
dxDBGrid1Column80: TdxDBGridColumn;
dxDBGrid1TEU: TdxDBGridColumn;
dxDBGrid1Column82: TdxDBGridColumn;
dxDBGrid1Column83: TdxDBGridColumn;
dxDBGrid1Column84: TdxDBGridColumn;
dxDBGrid1Column85: TdxDBGridColumn;
dxDBGrid1Column86: TdxDBGridColumn;
dxDBGrid1Column87: TdxDBGridColumn;
dxDBGrid1Column88: TdxDBGridColumn;
dxDBGrid1Column89: TdxDBGridColumn;
dxDBGrid1Column90: TdxDBGridColumn;
dxDBGrid1Column92: TdxDBGridColumn;
dxDBGrid1Column93: TdxDBGridColumn;
dxDBGrid1Column101: TdxDBGridColumn;
dxDBGrid1Column102: TdxDBGridColumn;
dxDBGrid1Column103: TdxDBGridColumn;
dxDBGrid1Column104: TdxDBGridColumn;
dxDBGrid1Column105: TdxDBGridColumn;
dxDBGrid1Column106: TdxDBGridColumn;
dxDBGrid1Column107: TdxDBGridColumn;
dxDBGrid1Column108: TdxDBGridColumn;
dxDBGrid1Column111: TdxDBGridColumn;
dxDBGrid1Column113: TdxDBGridColumn;
dxDBGrid1Column122: TdxDBGridColumn;
dxDBGrid1Column124: TdxDBGridColumn;
dxDBGrid1Column125: TdxDBGridColumn;
dxDBGrid1Column127: TdxDBGridColumn;
dxDBGrid1Column110: TdxDBGridCheckColumn;
dxDBGrid1Column112: TdxDBGridCheckColumn;
dxDBGrid1Column96: TdxDBGridCheckColumn;
dxDBGrid1Column97: TdxDBGridCheckColumn;
dxDBGrid1Column98: TdxDBGridCheckColumn;
dxDBGrid1Column99: TdxDBGridCheckColumn;
dxDBGrid1Column100: TdxDBGridCheckColumn;
Label6: TLabel;
Edit1: TEdit;
Label3: TLabel;
Edit4: TEdit;
Label1: TLabel;
Edit2: TEdit;
Edit3: TEdit;
Label2: TLabel;
Label10: TLabel;
wwDBDateTimePicker1: TwwDBDateTimePicker;
Label5: TLabel;
wwDBDateTimePicker2: TwwDBDateTimePicker;
Label8: TLabel;
wwDBDateTimePicker3: TwwDBDateTimePicker;
Label11: TLabel;
wwDBDateTimePicker4: TwwDBDateTimePicker;
Label9: TLabel;
RxDBLookupCombo2: TRxDBLookupCombo;
Label125: TLabel;
wwDBLookupCombo49: TwwDBLookupCombo;
Label30: TLabel;
Edit7: TEdit;
Label20: TLabel;
wwDBLookupCombo3: TwwDBLookupCombo;
Label124: TLabel;
wwDBLookupCombo52: TwwDBLookupCombo;
Label14: TLabel;
RxDBLookupCombo3: TRxDBLookupCombo;
RxDBLookupCombo6: TRxDBLookupCombo;
Label16: TLabel;
bsSkinCheckGroup1: TbsSkinCheckGroup;
bsSkinButton1: TbsSkinButton;
bsSkinButton10: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
bsSkinButton9: TbsSkinButton;
dxDBGrid1Column91: TdxDBGridColumn;
PopupMenu2: TPopupMenu;
N10: TMenuItem;
N11: TMenuItem;
N14: TMenuItem;
N13: TMenuItem;
N12: TMenuItem;
N15: TMenuItem;
N16: TMenuItem;
N39: TMenuItem;
XPMenu1: TXPMenu;
Label40: TLabel;
RxDBLookupCombo16: TRxDBLookupCombo;
Label21: TLabel;
RxDBLookupCombo20: TRxDBLookupCombo;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure bsSkinButton5Click(Sender: TObject);
procedure bsSkinButton10Click(Sender: TObject);
procedure bsSkinButton1Click(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure N10Click(Sender: TObject);
procedure N16Click(Sender: TObject);
procedure dxDBGrid1ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
procedure N14Click(Sender: TObject);
procedure N12Click(Sender: TObject);
procedure bsSkinButton9Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_rp_tai_seae_pin: Tfrm_rp_tai_seae_pin;
implementation
uses u_main, my_sys_function;
{$R *.dfm}
procedure Tfrm_rp_tai_seae_pin.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
savereggrid(dxdbgrid1,caption);
frm_rp_tai_seae_pin.Hide;
frm_rp_tai_seae_pin.ManualFloat(frm_rp_tai_seae_pin.BoundsRect );
frm_main.freeTabs('frm_rp_tai_seae_pin');
action:=cafree;
frm_rp_tai_seae_pin:=nil;
end;
procedure Tfrm_rp_tai_seae_pin.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_rp_tai_seae_pin.bsSkinButton10Click(Sender: TObject);
begin
Edit1.text:='';
Edit4.text:='';
Edit2.text:='';
Edit3.text:='';
wwDBDateTimePicker1.text:='';
wwDBDateTimePicker2.text:='';
RxDBLookupCombo2.ClearValue;
wwDBDateTimePicker3.text:='';
wwDBDateTimePicker4.text:='';
wwDBLookupCombo49.text:='';
Edit7.text:='';
wwDBLookupCombo3.text:='';
wwDBLookupCombo52.text:='';
RxDBLookupCombo6.ClearValue;
RxDBLookupCombo3.ClearValue;
end;
procedure Tfrm_rp_tai_seae_pin.bsSkinButton1Click(Sender: TObject);
var
str:widestring;
pin_str:string;
begin
str:='where װ<>˷<EFBFBD>ʽ like '+''''+'ƴ<><C6B4>%'+'''';
if bsSkinCheckGroup1.ItemIndex=0 then
pin_str:='װ<>˷<EFBFBD>ʽ in('+''''+'ƴ<><C6B4><EFBFBD><EFBFBD>Ʊ'+'''';
if bsSkinCheckGroup1.ItemIndex=1 then
begin
if pin_str=''then
pin_str:='װ<>˷<EFBFBD>ʽ in('+''''+'ƴ<><C6B4><EFBFBD><EFBFBD>Ʊ'+''''
else
pin_str:=pin_str+','+''''+'ƴ<><C6B4><EFBFBD><EFBFBD>Ʊ'+'''';
end;
if bsSkinCheckGroup1.ItemIndex=2 then
begin
if pin_str=''then
pin_str:='װ<>˷<EFBFBD>ʽ in('+''''+'ƴ<>䵥Ʊ'+''''
else
pin_str:=pin_str+','+''''+'ƴ<>䵥Ʊ'+'''';
end;
if pin_str<>''then
begin
pin_str:=pin_str+')';
str:=str+' and '+pin_str;
end;
if Edit1.text<>''then
str:=str+' and ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> like '+''''+'%'+Edit1.text+'%'+'''';
if Edit4.text<>''then
str:=str+' and ί<>б<EFBFBD><D0B1><EFBFBD> like '+''''+'%'+Edit4.text+'%'+'''';
if Edit2.text<>''then
str:=str+' and <20><><EFBFBD><EFBFBD><E1B5A5> like '+''''+'%'+Edit2.text+'%'+'''';
if Edit3.text<>''then
str:=str+' and <20><><EFBFBD><EFBFBD><E1B5A5> like '+''''+'%'+Edit3.text+'%'+'''';
if wwDBDateTimePicker1.text<>''then
str:=str+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>>='+''''+wwDBDateTimePicker1.text+'''';
if wwDBDateTimePicker2.text<>''then
str:=str+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><='+''''+wwDBDateTimePicker2.text+'''';
if wwDBDateTimePicker3.text<>''then
str:=str+' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD>>='+''''+wwDBDateTimePicker3.text+'''';
if wwDBDateTimePicker4.text<>''then
str:=str+' and <20><><EFBFBD><EFBFBD><EFBFBD>ڼ<EFBFBD><='+''''+wwDBDateTimePicker4.text+'''';
if RxDBLookupCombo2.DisplayValues[1]<>''then
str:=str+' and ί<>е<EFBFBD>λ='+''''+RxDBLookupCombo2.DisplayValues[1]+'''';
if RxDBLookupCombo6.DisplayValues[1]<>''then
str:=str+' and <20><><EFBFBD><EFBFBD>Ա='+''''+RxDBLookupCombo6.DisplayValues[1]+'''';
if RxDBLookupCombo3.DisplayValues[1]<>''then
str:=str+' and <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo3.DisplayValues[1]+'''';
if wwDBLookupCombo49.text<>''then
str:=str+' and <20><><EFBFBD><EFBFBD> like '+''''+'%'+wwDBLookupCombo49.text+'%'+'''';
if Edit7.text<>''then
str:=str+' and <20><><EFBFBD><EFBFBD> like '+''''+'%'+Edit7.text+'%'+'''';
if wwDBLookupCombo3.text<>''then
str:=str+' and װ<><D7B0><EFBFBD><EFBFBD> like '+''''+'%'+wwDBLookupCombo3.text+'%'+'''';
if wwDBLookupCombo52.text<>''then
str:=str+' and ж<><D0B6><EFBFBD><EFBFBD> like '+''''+'%'+wwDBLookupCombo52.text+'%'+'''';
if RxDBLookupCombo16.DisplayValues[0]<>''then
str:=str+' and ҵ<><D2B5><EFBFBD><EFBFBD>Դ='+''''+RxDBLookupCombo16.DisplayValues[0]+'''';
if RxDBLookupCombo20.DisplayValues[1]<>''then
str:=str+' and <20><><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo20.DisplayValues[1]+'''';
str:='select *,(case when isnull((CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 ELSE <20><><EFBFBD><EFBFBD> END), 0)>1 then isnull((CASE WHEN <20><><EFBFBD><EFBFBD> / 1000 > <20><><EFBFBD><EFBFBD> THEN <20><><EFBFBD><EFBFBD> / 1000 ELSE <20><><EFBFBD><EFBFBD> END), 0) else 1 end) as <20>ƷѶ<C6B7> from t_op_seae '+str+default_sort(53,'t_op_seae','','');
p_seae_pin.close;
p_seae_pin.Parameters.ParamByName('SQLStr').Value:=str;
p_seae_pin.open;
end;
procedure Tfrm_rp_tai_seae_pin.FormShow(Sender: TObject);
begin
bsSkinCheckGroup1.ItemIndex:=0;
bsSkinCheckGroup1.ItemIndex:=1;
bsSkinCheckGroup1.ItemIndex:=2;
loadreggrid(dxdbgrid1,true,caption);
end;
procedure Tfrm_rp_tai_seae_pin.N10Click(Sender: TObject);
begin
update_grid_view_no(dxdbgrid1);
end;
procedure Tfrm_rp_tai_seae_pin.N16Click(Sender: TObject);
begin
grid_save_xls(dxdbgrid1);
end;
procedure Tfrm_rp_tai_seae_pin.dxDBGrid1ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
begin
Column_sort_pro(Column,p_seae_pin,'ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
end;
procedure Tfrm_rp_tai_seae_pin.N14Click(Sender: TObject);
begin
update_grid_view_all(dxdbgrid1);
end;
procedure Tfrm_rp_tai_seae_pin.N12Click(Sender: TObject);
begin
update_grid(dxdbgrid1,1);
end;
procedure Tfrm_rp_tai_seae_pin.bsSkinButton9Click(Sender: TObject);
begin
sys_print('<27><><EFBFBD><EFBFBD>ƴ<EFBFBD><C6B4>̨<EFBFBD><CCA8>',2,nil,nil,nil,nil,p_seae_pin1,nil,nil,nil,nil,nil,nil);
end;
end.