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.
DONGSHENG6/费用模块/u_ch_fee_check_ctndetail.pas

417 lines
14 KiB
Plaintext

unit u_ch_fee_check_ctndetail;
interface
uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, dxExEdtr, DB, ADODB, dxDBTLCl, dxGrClms, StdCtrls, DBCtrls,
RxLookup, wwdbdatetimepicker, bsSkinCtrls, Mask, u_fee_check, ComCtrls,
bsSkinTabs, dxDBGrid, dxTL, dxDBCtrl, dxCntner, XPMenu, Menus, wwdblook,
wwdbedit, Wwdotdot, Wwdbcomb;
type
Tfrm_ch_fee_check_ctndetail = class(TForm)
bsSkinPanel1: TbsSkinPanel;
bsSkinPanel2: TbsSkinPanel;
t_op_state: TADOQuery;
t_op_state1: TDataSource;
t_op_airtruck1: TDataSource;
bsSkinPageControl1: TbsSkinPageControl;
bsSkinTabSheet1: TbsSkinTabSheet;
fra_fee_check1: Tfra_fee_check;
bsSkinButton7: TbsSkinButton;
bsSkinButton5: TbsSkinButton;
PopupMenu2: TPopupMenu;
N10: TMenuItem;
N11: TMenuItem;
N14: TMenuItem;
N13: TMenuItem;
N12: TMenuItem;
N15: TMenuItem;
N16: TMenuItem;
XPMenu1: TXPMenu;
bsSkinButton1: TbsSkinButton;
PopupMenu3: TPopupMenu;
N17: TMenuItem;
N18: TMenuItem;
N34: TMenuItem;
N35: TMenuItem;
N36: TMenuItem;
N1: TMenuItem;
N2: TMenuItem;
N3: TMenuItem;
N4: TMenuItem;
N5: TMenuItem;
N6: TMenuItem;
N7: TMenuItem;
N8: TMenuItem;
dxDBGrid1: TdxDBGrid;
dxDBGrid1Column1: TdxDBGridColumn;
dxDBGrid1Column2: TdxDBGridColumn;
dxDBGrid1Column3: TdxDBGridColumn;
dxDBGrid1Column8: TdxDBGridColumn;
dxDBGrid1Column9: TdxDBGridColumn;
dxDBGrid1Column10: TdxDBGridColumn;
dxDBGrid1Column11: TdxDBGridColumn;
dxDBGrid1Column25: TdxDBGridColumn;
dxDBGrid1Column26: TdxDBGridColumn;
t_op_airtruck: TADOQuery;
bsSkinPanel3: TbsSkinPanel;
Label6: TLabel;
Label11: TLabel;
Label12: TLabel;
Label3: TLabel;
Label1: TLabel;
Label13: TLabel;
Label2: TLabel;
Edit1: TEdit;
wwDBDateTimePicker3: TwwDBDateTimePicker;
wwDBDateTimePicker4: TwwDBDateTimePicker;
RxDBLookupCombo1: TRxDBLookupCombo;
Edit2: TEdit;
RxDBLookupCombo4: TRxDBLookupCombo;
Memo1: TMemo;
wwDBComboBox3: TwwDBComboBox;
bsSkinButton10: TbsSkinButton;
t_code_ctn_status: TADOQuery;
t_code_ctn_status1: TDataSource;
procedure FormShow(Sender: TObject);
procedure bsSkinButton5Click(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure bsSkinButton10Click(Sender: TObject);
procedure dxDBGrid1Column2CustomDraw(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 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 bsSkinButton7Click(Sender: TObject);
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 bsSkinButton1Click(Sender: TObject);
procedure N17Click(Sender: TObject);
procedure N34Click(Sender: TObject);
procedure N36Click(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure N4Click(Sender: TObject);
procedure N5Click(Sender: TObject);
procedure N8Click(Sender: TObject);
procedure dxDBGrid1Column25CustomDraw(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 Edit1KeyPress(Sender: TObject; var Key: Char);
procedure fra_fee_check1bsSkinButton4Click(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
frm_ch_fee_check_ctndetail: Tfrm_ch_fee_check_ctndetail;
implementation
uses u_main, my_sys_function;
{$R *.dfm}
procedure Tfrm_ch_fee_check_ctndetail.FormShow(Sender: TObject);
begin
t_op_airtruck.Close;
t_op_airtruck.SQL.Text:='select t_op_ctnmg_detail.*,t_op_ctnmg_detail.<2E><><EFBFBD><EFBFBD> as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>,t_op_addctn.¼<><C2BC><EFBFBD><EFBFBD>,t_op_addctn.¼<><C2BC><EFBFBD><EFBFBD> as <20><><EFBFBD><EFBFBD>Ա,t_op_addctn.¼<><C2BC><EFBFBD><EFBFBD> as <20>ͷ<EFBFBD>Ա,t_op_addctn.¼<><C2BC><EFBFBD><EFBFBD> as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_op_ctnmg_detail '
+' left join t_op_addctn on (t_op_addctn.id=t_op_ctnmg_detail.addctnid) where 1=1'
+' and <20><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from v_fee_check_ctndetail) '
+' order by ctnid ';
t_op_airtruck.open;
loadreggrid(dxdbgrid1,false,caption);
loadwwgrid(fra_fee_check1.wwDBGrid1,'<27><><EFBFBD>ܾ<EFBFBD><DCBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6>');
loadwwgrid(fra_fee_check1.wwDBGrid2,'<27><><EFBFBD>ܾ<EFBFBD><DCBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6>');
bsSkinPageControl1.Align:=alClient;
fra_fee_check1.limited_str.text:='0008';
fra_fee_check1.chk_accept.Text:='FALSE';
fra_fee_check1.chk_pay.text:='FALSE';
fra_fee_check1.ywlb.Text:='<27><><EFBFBD><EFBFBD>' ;
if if_open('380') then
begin
fra_fee_check1.t_ch_accept.DataSource:=t_op_airtruck1;
fra_fee_check1.t_ch_accept.open;
fra_fee_check1.a_shen_delete.open;
fra_fee_check1.a_shen_modify_old.open;
fra_fee_check1.a_shen_modify_new.open;
fra_fee_check1.bsSkinPanel3.visible:=true;
end
else
begin
fra_fee_check1.bsSkinPanel3.visible:=false;
end;
if if_open('381') then
begin
fra_fee_check1.t_ch_pay.DataSource:=t_op_airtruck1;
fra_fee_check1.t_ch_pay.open;
fra_fee_check1.p_shen_delete.open;
fra_fee_check1.p_shen_modify_old.open;
fra_fee_check1.p_shen_modify_new.open;
fra_fee_check1.bsSkinPanel5.visible:=true;
end
else
begin
fra_fee_check1.bsSkinPanel5.visible:=false;
end;
if fra_fee_check1.bsSkinPanel3.visible and
fra_fee_check1.bsSkinPanel5.visible then
begin
fra_fee_check1.Panel3.Visible:=true;
fra_fee_check1.t_op_gain.DataSource:=t_op_airtruck1;
fra_fee_check1.t_op_gain.open;
fra_fee_check1.bsSkinPanel9.Visible:=false;
fra_fee_check1.Panel3.Height:=20;
end
else
begin
fra_fee_check1.Panel3.Visible:=false;
end;
if strtobool(get_parameters_value(150,'false')) then
fra_fee_check1.bsSkinPanel10.Visible:=true
else fra_fee_check1.bsSkinPanel10.Visible:=False;
end;
procedure Tfrm_ch_fee_check_ctndetail.bsSkinButton5Click(Sender: TObject);
begin
close;
end;
procedure Tfrm_ch_fee_check_ctndetail.FormClose(Sender: TObject;
var Action: TCloseAction);
begin
savereggrid(dxdbgrid1,caption);
savewwgrid(fra_fee_check1.wwDBGrid2,'<27><><EFBFBD>ܾ<EFBFBD><DCBE><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>Ӧ<EFBFBD><D3A6>');
frm_ch_fee_check_ctndetail.Hide;
frm_ch_fee_check_ctndetail.ManualFloat(frm_ch_fee_check_ctndetail.BoundsRect );
frm_main.freeTabs('frm_ch_fee_check_ctndetail');
action:=cafree;
frm_ch_fee_check_ctndetail:=nil;
end;
procedure Tfrm_ch_fee_check_ctndetail.bsSkinButton10Click(Sender: TObject);
var
ctnstr:string;
i:integer;
begin
t_code_ctn_status.Open;
t_op_airtruck.close;
t_op_airtruck.SQL.clear;
t_op_airtruck.SQL.add(' select t_op_ctnmg_detail.*,t_op_ctnmg_detail.<2E><><EFBFBD><EFBFBD> as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
t_op_airtruck.SQL.add(',t_op_addctn.¼<><C2BC><EFBFBD><EFBFBD>,t_op_addctn.¼<><C2BC><EFBFBD><EFBFBD> as <20><><EFBFBD><EFBFBD>Ա,t_op_addctn.¼<><C2BC><EFBFBD><EFBFBD> as <20>ͷ<EFBFBD>Ա,t_op_addctn.¼<><C2BC><EFBFBD><EFBFBD> as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>');
t_op_airtruck.SQL.add(' from t_op_ctnmg_detail left join t_op_addctn on (t_op_addctn.id=t_op_ctnmg_detail.addctnid) where 1=1 ' );
if Edit2.Text<>'' then
t_op_airtruck.SQL.add(' and t_op_addctn.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><E4B5A5>='+''''+edit2.text+'''');
if RxDBLookupCombo4.DisplayValues[1]<>'' then
t_op_airtruck.SQL.add(' and t_op_ctnmg_detail.<2E><><EFBFBD><EFBFBD>='+''''+RxDBLookupCombo4.DisplayValues[1]+'''');
if wwDBDateTimePicker3.text<>''then
t_op_airtruck.SQL.add(' and t_op_addctn.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1>>='+''''+wwDBDateTimePicker3.text+'''');
if wwDBDateTimePicker4.text<>''then
t_op_airtruck.SQL.add(' and t_op_addctn.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD>ʱ<EFBFBD><CAB1><='+''''+wwDBDateTimePicker4.text+'''');
if Edit1.Text<>'' then
t_op_airtruck.SQL.add(' and t_op_ctnmg_detail.<2E><><EFBFBD><EFBFBD>='+''''+edit1.Text+'''');
if RxDBLookupCombo1.DisplayValue<>'' then
t_op_airtruck.SQL.add(' and t_op_ctnmg_detail.<2E><>ǰ<EFBFBD><C7B0>̬='+''''+RxDBLookupCombo1.DisplayValue+'''');
if wwDBComboBox3.Text<>'' then
t_op_airtruck.SQL.add(' and t_op_addctn.<2E><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>='+''''+wwDBComboBox3.Text+'''');
if Memo1.Lines.Count<>0 then begin
ctnstr:=ctnstr+'and (';
for i:=0 to Memo1.Lines.Count-1 do begin
if i=0 then
ctnstr:=ctnstr+' t_op_ctnmg_detail.<2E><><EFBFBD><EFBFBD>='+''''+Trim(Memo1.Lines.Strings[i])+''''
else
ctnstr:=ctnstr+' or t_op_ctnmg_detail.<2E><><EFBFBD><EFBFBD>='+''''+Trim(Memo1.Lines.Strings[i])+'''';
end;
ctnstr:=ctnstr+') ';
end else begin
if Edit1.Text<>'' then
ctnstr:=' and t_op_ctnmg_detail.<2E><><EFBFBD><EFBFBD>='+''''+Trim(Edit1.Text)+'''';
end;
if ctnstr<>'' then
t_op_airtruck.SQL.add(ctnstr);
t_op_airtruck.SQL.add(' order by t_op_ctnmg_detail.ctnid');
t_op_airtruck.open;
end;
procedure Tfrm_ch_fee_check_ctndetail.dxDBGrid1Column2CustomDraw(
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><CBB3><EFBFBD>',ANode.Strings[dxDBGrid1Column2.Index]);
AFont.Color:=clblack;
end;
procedure Tfrm_ch_fee_check_ctndetail.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_fee(ANode.strings[dxDBGrid1Column3.Index]);
AFont.Color:=clblack;
end;
procedure Tfrm_ch_fee_check_ctndetail.bsSkinButton7Click(Sender: TObject);
begin
t_op_airtruck.Close;
t_op_airtruck.SQL.text:='select t_op_ctnmg_detail.*,t_op_ctnmg_detail.<2E><><EFBFBD><EFBFBD>,t_op_addctn.¼<><C2BC><EFBFBD><EFBFBD>,t_op_addctn.¼<><C2BC><EFBFBD><EFBFBD> as <20><><EFBFBD><EFBFBD>Ա,'
+' t_op_addctn.¼<><C2BC><EFBFBD><EFBFBD> as <20>ͷ<EFBFBD>Ա,t_op_addctn.¼<><C2BC><EFBFBD><EFBFBD> as <20><><EFBFBD><EFBFBD><EFBFBD><EFBFBD> as ҵ<><D2B5><EFBFBD><EFBFBD><EFBFBD><EFBFBD> from t_op_ctnmg_detail'
+' left join t_op_addctn on (t_op_addctn.id=t_op_ctnmg_detail.addctnid) where 1=1 '
+' and <20><><EFBFBD><EFBFBD> in (select <20><><EFBFBD><EFBFBD> from v_fee_check_ctndetail) ';
t_op_airtruck.open;
end;
procedure Tfrm_ch_fee_check_ctndetail.N10Click(Sender: TObject);
begin
update_grid_view_no(dxdbgrid1);
end;
procedure Tfrm_ch_fee_check_ctndetail.N14Click(Sender: TObject);
begin
update_grid_view_all(dxdbgrid1);
end;
procedure Tfrm_ch_fee_check_ctndetail.N12Click(Sender: TObject);
begin
update_grid(dxdbgrid1,61);
end;
procedure Tfrm_ch_fee_check_ctndetail.N16Click(Sender: TObject);
begin
grid_save_xls(dxdbgrid1);
end;
procedure Tfrm_ch_fee_check_ctndetail.dxDBGrid1ColumnSorting(Sender: TObject;
Column: TdxDBTreeListColumn; var Allow: Boolean);
begin
// Column_sort_pro(Column,t_op_airtruck,'<27><><EFBFBD><EFBFBD>');
end;
procedure Tfrm_ch_fee_check_ctndetail.bsSkinButton1Click(Sender: TObject);
var
Pnt:Tpoint;
begin
Pnt:=bsSkinButton1.ClientToScreen(Point(0,bsSkinButton1.Height));
PopupMenu3.Popup(Pnt.x,Pnt.y);
end;
procedure Tfrm_ch_fee_check_ctndetail.N17Click(Sender: TObject);
begin
t_op_airtruck.Close;
t_op_airtruck.SQL.text:='select * from t_op_ctnmg_detail where 1=1 '
+' and <20><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from t_ch_fee where <20><><EFBFBD><EFBFBD>״̬='
+''''+'¼<><C2BC>״̬'+''''+') ';
t_op_airtruck.open
end;
procedure Tfrm_ch_fee_check_ctndetail.N34Click(Sender: TObject);
begin
t_op_airtruck.Close;
t_op_airtruck.SQL.text:='select * from t_op_ctnmg_detail where 1=1'
+' and <20><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from t_ch_fee where <20><><EFBFBD><EFBFBD>״̬ in ('
+''''+'<27><><EFBFBD><EFBFBD><EFBFBD>ύ'+''''+','+''''+'<27><>ֹ<EFBFBD>޸<EFBFBD>'+''''+','+''''+'<27><>ֹɾ<D6B9><C9BE>'+''''+')) ';
t_op_airtruck.open;
end;
procedure Tfrm_ch_fee_check_ctndetail.N36Click(Sender: TObject);
begin
t_op_airtruck.Close;
t_op_airtruck.SQL.text:='select * from t_op_ctnmg_detail where 1=1'
+' and <20><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from t_ch_fee where <20><><EFBFBD><EFBFBD>״̬ in ('
+''''+'<27><EFBFBD><E1BDBB><EFBFBD><EFBFBD>'+''''+','+''''+'<27><><EFBFBD><EFBFBD><EFBFBD>޸<EFBFBD>'+''''+','+''''+'<27><><EFBFBD><EFBFBD>ɾ<EFBFBD><C9BE>'+''''+')) ';
t_op_airtruck.open;
end;
procedure Tfrm_ch_fee_check_ctndetail.N2Click(Sender: TObject);
begin
t_op_airtruck.Close;
t_op_airtruck.SQL.text:='select * from t_op_ctnmg_detail where 1=1'
+' and <20><><EFBFBD><EFBFBD>״̬<>'+''''+'<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>'+''''
+' and <20><><EFBFBD><EFBFBD> not in (select distinct <20><><EFBFBD><EFBFBD> from t_ch_fee where <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''+')';
t_op_airtruck.open;
end;
procedure Tfrm_ch_fee_check_ctndetail.N4Click(Sender: TObject);
begin
t_op_airtruck.Close;
t_op_airtruck.SQL.text:='select * from t_op_ctnmg_detail where 1=1'
+' and <20><><EFBFBD><EFBFBD>״̬<>'+''''+'<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>'+''''
+' and <20><><EFBFBD><EFBFBD> not in (select distinct <20><><EFBFBD><EFBFBD> from t_ch_fee where <20><><EFBFBD><EFBFBD>='+''''+'<27><>'+''''+')';
t_op_airtruck.open;
end;
procedure Tfrm_ch_fee_check_ctndetail.N5Click(Sender: TObject);
begin
t_op_airtruck.Close;
t_op_airtruck.SQL.text:='select * from t_op_ctnmg_detail where 1=1'
+' and <20><><EFBFBD><EFBFBD>״̬<>'+''''+'<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>'+''''
+' and <20><><EFBFBD><EFBFBD> not in (select distinct <20><><EFBFBD><EFBFBD> from t_ch_fee )';
t_op_airtruck.open;
end;
procedure Tfrm_ch_fee_check_ctndetail.N8Click(Sender: TObject);
begin
t_op_airtruck.Close;
t_op_airtruck.SQL.text:='select * from t_op_ctnmg_detail where 1=1'
+' and <20><><EFBFBD><EFBFBD>״̬<>'+''''+'<27><><EFBFBD>÷<EFBFBD><C3B7><EFBFBD>'+''''
+' and <20><><EFBFBD><EFBFBD> in (select distinct <20><><EFBFBD><EFBFBD> from t_ch_fee where <20><><EFBFBD><EFBFBD>״̬<>'+''''+'<27><><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>'+''''+')';
t_op_airtruck.open;
end;
procedure Tfrm_ch_fee_check_ctndetail.dxDBGrid1Column25CustomDraw(
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[dxDBGrid1Column25.Index]);
AFont.Color:=clblack;
end;
procedure Tfrm_ch_fee_check_ctndetail.Edit1KeyPress(Sender: TObject;
var Key: Char);
begin
if Key<>#13 then exit;
if (Trim(Edit1.Text)<>'') then begin
Memo1.Lines.Add(Trim(Edit1.Text));
Edit1.Text:='';
end;
end;
procedure Tfrm_ch_fee_check_ctndetail.fra_fee_check1bsSkinButton4Click(
Sender: TObject);
begin
fra_fee_check1.bsSkinButton4Click(Sender);
end;
end.