unit u_ch_check; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, DB, ADODB, bsSkinCtrls, dxExEdtr, ComCtrls, bsSkinTabs, StdCtrls, DBCtrls, RxLookup, Mask, dxDBTLCl, dxGrClms, dxDBGrid, dxTL, dxDBCtrl, dxCntner, Menus, XPMenu; type Tfrm_ch_check = class(TForm) t_ch_check: TADOQuery; v_fee_do_seae: TADOQuery; v_fee_do_seae1: TDataSource; t_ch_check1: TDataSource; bsSkinPanel3: TbsSkinPanel; bsSkinButton21: TbsSkinButton; bsSkinButton23: TbsSkinButton; bsSkinButton24: TbsSkinButton; bsSkinButton25: TbsSkinButton; bsSkinButton26: TbsSkinButton; bsSkinButton30: TbsSkinButton; bsSkinButton28: TbsSkinButton; bsSkinButton29: TbsSkinButton; bsSkinNotebook1: TbsSkinNotebook; dxDBGrid1: TdxDBGrid; dxDBGrid1Column1: TdxDBGridMaskColumn; dxDBGrid1Column2: TdxDBGridMaskColumn; dxDBGrid1Column3: TdxDBGridMaskColumn; dxDBGrid1Column4: TdxDBGridMaskColumn; dxDBGrid1Column5: TdxDBGridMaskColumn; dxDBGrid1Column6: TdxDBGridColumn; dxDBGrid1Column7: TdxDBGridColumn; dxDBGrid1Column8: TdxDBGridColumn; dxDBGrid1Column9: TdxDBGridMaskColumn; dxDBGrid1Column10: TdxDBGridMaskColumn; dxDBGrid1Column11: TdxDBGridDateColumn; dxDBGrid1Column12: TdxDBGridMaskColumn; dxDBGrid1Column13: TdxDBGridDateColumn; dxDBGrid1Column14: TdxDBGridMaskColumn; dxDBGrid1Column15: TdxDBGridDateColumn; bsSkinPanel1: TbsSkinPanel; Label25: TLabel; Label17: TLabel; Label12: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label1: TLabel; Label5: TLabel; Label18: TLabel; Label10: TLabel; Label6: TLabel; Label7: TLabel; Label8: TLabel; Label9: TLabel; Label11: TLabel; DBEdit14: TDBEdit; DBEdit1: TDBEdit; RxDBLookupCombo1: TRxDBLookupCombo; RxDBLookupCombo2: TRxDBLookupCombo; DBEdit4: TDBEdit; DBEdit2: TDBEdit; DBEdit3: TDBEdit; DBEdit6: TDBEdit; DBEdit5: TDBEdit; DBMemo1: TDBMemo; DBEdit7: TDBEdit; DBEdit8: TDBEdit; DBEdit9: TDBEdit; DBEdit10: TDBEdit; DBMemo2: TDBMemo; bsSkinPanel2: TbsSkinPanel; bsSkinPageControl1: TbsSkinPageControl; bsSkinTabSheet1: TbsSkinTabSheet; dxDBGrid2: TdxDBGrid; dxDBGridMaskColumn1: TdxDBGridMaskColumn; dxDBGridMaskColumn2: TdxDBGridMaskColumn; dxDBGridMaskColumn3: TdxDBGridMaskColumn; dxDBGridMaskColumn4: TdxDBGridMaskColumn; dxDBGridMaskColumn5: TdxDBGridMaskColumn; dxDBGridColumn1: TdxDBGridColumn; dxDBGridColumn2: TdxDBGridColumn; dxDBGridMaskColumn6: TdxDBGridMaskColumn; dxDBGridDateColumn1: TdxDBGridDateColumn; dxDBGridDateColumn2: TdxDBGridDateColumn; dxDBGridMaskColumn7: TdxDBGridMaskColumn; dxDBGridMaskColumn8: TdxDBGridMaskColumn; dxDBGridMaskColumn9: TdxDBGridMaskColumn; dxDBGridMaskColumn10: TdxDBGridMaskColumn; dxDBGridMaskColumn11: TdxDBGridMaskColumn; dxDBGridColumn3: TdxDBGridColumn; dxDBGridColumn4: TdxDBGridColumn; dxDBGridMaskColumn12: TdxDBGridMaskColumn; dxDBGridMaskColumn13: TdxDBGridMaskColumn; dxDBGridMaskColumn14: TdxDBGridMaskColumn; dxDBGridMaskColumn15: TdxDBGridMaskColumn; bsSkinTabSheet2: TbsSkinTabSheet; bsSkinTabSheet3: TbsSkinTabSheet; bsSkinTabSheet4: TbsSkinTabSheet; dxDBGrid1Column16: TdxDBGridColumn; Label13: TLabel; DBEdit11: TDBEdit; v_fee_do_seai: TADOQuery; v_fee_do_seai1: TDataSource; dxDBGrid3: TdxDBGrid; dxDBGridMaskColumn16: TdxDBGridMaskColumn; dxDBGridMaskColumn17: TdxDBGridMaskColumn; dxDBGridMaskColumn18: TdxDBGridMaskColumn; dxDBGridMaskColumn19: TdxDBGridMaskColumn; dxDBGridMaskColumn20: TdxDBGridMaskColumn; dxDBGridColumn5: TdxDBGridColumn; dxDBGridColumn6: TdxDBGridColumn; dxDBGridMaskColumn21: TdxDBGridMaskColumn; dxDBGridDateColumn3: TdxDBGridDateColumn; dxDBGridDateColumn4: TdxDBGridDateColumn; dxDBGridMaskColumn22: TdxDBGridMaskColumn; dxDBGridMaskColumn23: TdxDBGridMaskColumn; dxDBGridMaskColumn24: TdxDBGridMaskColumn; dxDBGridMaskColumn25: TdxDBGridMaskColumn; dxDBGridMaskColumn26: TdxDBGridMaskColumn; dxDBGridColumn7: TdxDBGridColumn; dxDBGridColumn8: TdxDBGridColumn; dxDBGridMaskColumn27: TdxDBGridMaskColumn; dxDBGridMaskColumn28: TdxDBGridMaskColumn; dxDBGridMaskColumn29: TdxDBGridMaskColumn; dxDBGridMaskColumn30: TdxDBGridMaskColumn; v_fee_do_aire: TADOQuery; v_fee_do_aire1: TDataSource; v_fee_do_airi1: TDataSource; v_fee_do_airi: TADOQuery; dxDBGrid4: TdxDBGrid; dxDBGridMaskColumn31: TdxDBGridMaskColumn; dxDBGridMaskColumn32: TdxDBGridMaskColumn; dxDBGridMaskColumn33: TdxDBGridMaskColumn; dxDBGridMaskColumn34: TdxDBGridMaskColumn; dxDBGridMaskColumn35: TdxDBGridMaskColumn; dxDBGridColumn9: TdxDBGridColumn; dxDBGridColumn10: TdxDBGridColumn; dxDBGridMaskColumn36: TdxDBGridMaskColumn; dxDBGridDateColumn5: TdxDBGridDateColumn; dxDBGridDateColumn6: TdxDBGridDateColumn; dxDBGridMaskColumn37: TdxDBGridMaskColumn; dxDBGridMaskColumn38: TdxDBGridMaskColumn; dxDBGridMaskColumn39: TdxDBGridMaskColumn; dxDBGridColumn11: TdxDBGridColumn; dxDBGridColumn12: TdxDBGridColumn; dxDBGridMaskColumn40: TdxDBGridMaskColumn; dxDBGridMaskColumn41: TdxDBGridMaskColumn; dxDBGridMaskColumn42: TdxDBGridMaskColumn; dxDBGrid5: TdxDBGrid; dxDBGridMaskColumn43: TdxDBGridMaskColumn; dxDBGridMaskColumn44: TdxDBGridMaskColumn; dxDBGridMaskColumn45: TdxDBGridMaskColumn; dxDBGridMaskColumn46: TdxDBGridMaskColumn; dxDBGridMaskColumn47: TdxDBGridMaskColumn; dxDBGridColumn13: TdxDBGridColumn; dxDBGridColumn14: TdxDBGridColumn; dxDBGridMaskColumn48: TdxDBGridMaskColumn; dxDBGridDateColumn7: TdxDBGridDateColumn; dxDBGridDateColumn8: TdxDBGridDateColumn; dxDBGridMaskColumn49: TdxDBGridMaskColumn; dxDBGridMaskColumn50: TdxDBGridMaskColumn; dxDBGridMaskColumn51: TdxDBGridMaskColumn; dxDBGridColumn15: TdxDBGridColumn; dxDBGridColumn16: TdxDBGridColumn; dxDBGridMaskColumn52: TdxDBGridMaskColumn; dxDBGridMaskColumn53: TdxDBGridMaskColumn; dxDBGridMaskColumn54: TdxDBGridMaskColumn; XPMenu1: TXPMenu; PopupMenu2: TPopupMenu; N10: TMenuItem; N11: TMenuItem; N14: TMenuItem; N13: TMenuItem; N12: TMenuItem; N15: TMenuItem; N16: TMenuItem; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure bsSkinButton23Click(Sender: TObject); procedure bsSkinButton24Click(Sender: TObject); procedure FormShow(Sender: TObject); procedure bsSkinButton28Click(Sender: TObject); procedure bsSkinButton29Click(Sender: TObject); procedure bsSkinButton30Click(Sender: TObject); procedure bsSkinButton21Click(Sender: TObject); procedure FormResize(Sender: TObject); procedure DBEdit1Change(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 bsSkinButton25Click(Sender: TObject); procedure bsSkinButton26Click(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); private { Private declarations } public { Public declarations } end; var frm_ch_check: Tfrm_ch_check; implementation uses u_main, u_ch_shen_query, u_ch_check_do, my_sys_function, u_data_share; {$R *.dfm} procedure Tfrm_ch_check.FormClose(Sender: TObject; var Action: TCloseAction); begin savereggrid(dxdbgrid1,caption); frm_ch_check.Hide; frm_ch_check.ManualFloat(frm_ch_check.BoundsRect ); frm_main.freeTabs('frm_ch_check'); action:=cafree; frm_ch_check:=nil; end; procedure Tfrm_ch_check.bsSkinButton23Click(Sender: TObject); begin sys_print('业务支付申请',2,t_ch_check1,frm_data_share.t_code_ctn_de1,nil,nil,v_fee_do_seae1,v_fee_do_seai1,v_fee_do_aire1,v_fee_do_airi1,nil,nil,nil); end; procedure Tfrm_ch_check.bsSkinButton24Click(Sender: TObject); begin try frm_ch_shen_query:=tfrm_ch_shen_query.Create (self); shen_query_type:=6; shen_query_limited:='no'; shen_query_op_limited:='no'; frm_ch_shen_query.ShowModal; finally frm_ch_shen_query.Free; end; end; procedure Tfrm_ch_check.FormShow(Sender: TObject); begin t_ch_check.Open; v_fee_do_seae.open; v_fee_do_seai.open; v_fee_do_aire.open; v_fee_do_airi.open; loadreggrid(dxdbgrid1,false,caption); end; procedure Tfrm_ch_check.bsSkinButton28Click(Sender: TObject); begin table_Prior(t_ch_check); end; procedure Tfrm_ch_check.bsSkinButton29Click(Sender: TObject); begin table_next(t_ch_check); end; procedure Tfrm_ch_check.bsSkinButton30Click(Sender: TObject); begin if bsSkinButton30.Caption='详细内容' then begin if t_ch_check.IsEmpty then exit; bsSkinNotebook1.PageIndex:=1; bsSkinButton30.Caption:='返回列表'; end else begin bsSkinNotebook1.PageIndex:=0; bsSkinButton30.Caption:='详细内容'; end; end; procedure Tfrm_ch_check.bsSkinButton21Click(Sender: TObject); begin close; end; procedure Tfrm_ch_check.FormResize(Sender: TObject); var i:integer; begin i:=round(bsSkinPanel3.Width/8); bsSkinButton23.Width:=i; bsSkinButton24.Width:=i; bsSkinButton28.Width:=i; bsSkinButton29.Width:=i; bsSkinButton30.Width:=i; bsSkinButton25.Width:=i; bsSkinButton26.Width:=i; end; procedure Tfrm_ch_check.DBEdit1Change(Sender: TObject); begin if (DBEdit1.Text='') or (DBEdit1.Text='申请支付') or (DBEdit1.Text='批准修改')then DBEdit1.Color:=clwhite else if (DBEdit1.Text='提交申请') or (DBEdit1.Text='申请修改') then DBEdit1.Color:=clyellow else if (DBEdit1.Text='禁止修改') or (DBEdit1.Text='驳回申请') then DBEdit1.Color:=clred else if (DBEdit1.Text='批准支付') or (DBEdit1.Text='支付完毕') then DBEdit1.Color:=$00DDF21C; end; procedure Tfrm_ch_check.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 if (ANode.strings[dxDBGrid1Column2.Index]='申请支付')or (ANode.strings[dxDBGrid1Column2.Index]='批准修改') then AColor :=clwhite else if (ANode.strings[dxDBGrid1Column2.Index]='提交申请')or (ANode.strings[dxDBGrid1Column2.Index]='申请修改') then AColor :=clyellow else if (ANode.strings[dxDBGrid1Column2.Index]='禁止修改')or (ANode.strings[dxDBGrid1Column2.Index]='驳回申请')then AColor :=clred else if (ANode.strings[dxDBGrid1Column2.Index]='批准支付')or (ANode.strings[dxDBGrid1Column2.Index]='支付完毕') then AColor :=$00DDF21C; AFont.Color:=clblack; end; procedure Tfrm_ch_check.bsSkinButton25Click(Sender: TObject); begin if t_ch_check.IsEmpty then exit; if (t_ch_check.FieldByName('申请状态').asstring<>'批准支付') and (t_ch_check.FieldByName('申请状态').asstring<>'禁止修改') then begin showmessage('当前申请状态不能实现支付!!'); exit; end; try frm_ch_check_do:=tfrm_ch_check_do.Create (self); frm_ch_check_do.ShowModal; finally frm_ch_check_do.Free; end; end; procedure Tfrm_ch_check.bsSkinButton26Click(Sender: TObject); begin if t_ch_check.IsEmpty then exit; if (t_ch_check.FieldByName('申请状态').asstring<>'支付完毕') then begin showmessage('当前申请状态不能取消支付!!'); exit; end; if not if_open('039') then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if application.MessageBox('您确定要取消支付吗?','警告:',MB_OKCANCEL)=IDOK then begin t_ch_check.Edit; t_ch_check['申请状态']:='批准支付'; t_ch_check['开出人']:=''; t_ch_check['开出日期']:=null; t_ch_check['支付方式']:=''; t_ch_check['相关号码']:=''; t_ch_check.post; end; end; procedure Tfrm_ch_check.N10Click(Sender: TObject); begin update_grid_view_no(dxdbgrid1); end; procedure Tfrm_ch_check.N14Click(Sender: TObject); begin update_grid_view_all(dxdbgrid1); end; procedure Tfrm_ch_check.N12Click(Sender: TObject); begin update_grid(dxdbgrid1,4); end; procedure Tfrm_ch_check.N16Click(Sender: TObject); begin grid_save_xls(dxdbgrid1); end; procedure Tfrm_ch_check.dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin // Column_sort(Column,t_ch_check); end; end.