unit u_ch_check_check; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, bsSkinCtrls, dxExEdtr, dxDBTLCl, dxGrClms, dxDBGrid, dxTL, dxDBCtrl, dxCntner, DB, ADODB, StdCtrls, DBCtrls, bsdbctrls, RxLookup, Mask, ComCtrls, bsSkinTabs, Menus, XPMenu; type Tfrm_ch_check_check = class(TForm) bsSkinPanel2: TbsSkinPanel; bsSkinButton5: TbsSkinButton; bsSkinButton8: TbsSkinButton; bsSkinButton9: TbsSkinButton; bsSkinButton10: TbsSkinButton; bsSkinButton11: TbsSkinButton; bsSkinButton6: TbsSkinButton; bsSkinButton1: TbsSkinButton; bsSkinButton7: TbsSkinButton; bsSkinButton2: TbsSkinButton; bsSkinButton3: 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; t_ch_check: TADOQuery; t_ch_check1: TDataSource; v_fee_do_seae: TADOQuery; v_fee_do_seae1: TDataSource; Label25: TLabel; DBEdit14: TDBEdit; Label17: TLabel; DBEdit1: TDBEdit; Label12: TLabel; RxDBLookupCombo1: TRxDBLookupCombo; Label2: TLabel; RxDBLookupCombo2: TRxDBLookupCombo; Label3: TLabel; DBEdit4: TDBEdit; Label4: TLabel; DBEdit2: TDBEdit; DBEdit3: TDBEdit; Label1: TLabel; Label5: TLabel; DBEdit6: TDBEdit; Label18: TLabel; DBEdit5: TDBEdit; Label10: TLabel; DBMemo1: TDBMemo; Label6: TLabel; DBEdit7: TDBEdit; Label7: TLabel; DBEdit8: TDBEdit; Label8: TLabel; DBEdit9: TDBEdit; Label9: TLabel; DBEdit10: TDBEdit; Label11: TLabel; DBMemo2: TDBMemo; bsSkinPanel3: TbsSkinPanel; dxDBGrid1Column16: TdxDBGridColumn; Label13: TLabel; DBEdit11: TDBEdit; v_fee_do_seai: TADOQuery; v_fee_do_seai1: TDataSource; v_fee_do_aire: TADOQuery; v_fee_do_airi: TADOQuery; v_fee_do_airi1: TDataSource; v_fee_do_aire1: TDataSource; XPMenu1: TXPMenu; PopupMenu2: TPopupMenu; N10: TMenuItem; N11: TMenuItem; N14: TMenuItem; N13: TMenuItem; N12: TMenuItem; N15: TMenuItem; N16: TMenuItem; bsSkinButton12: TbsSkinButton; PopupMenu3: TPopupMenu; N17: TMenuItem; N18: TMenuItem; N34: TMenuItem; N35: TMenuItem; N36: TMenuItem; N1: TMenuItem; N6: TMenuItem; N5: TMenuItem; N4: TMenuItem; v_fee_do_seae_sum: TADOQuery; v_fee_do_seae_sum1: TDataSource; v_fee_do_seai_sum: TADOQuery; v_fee_do_seai_sum1: TDataSource; v_fee_do_aire_sum: TADOQuery; v_fee_do_aire_sum1: TDataSource; v_fee_do_airi_sum: TADOQuery; v_fee_do_airi_sum1: TDataSource; bsSkinPageControl2: TbsSkinPageControl; bsSkinTabSheet3: TbsSkinTabSheet; dxDBGrid6: TdxDBGrid; dxDBGridMaskColumn55: TdxDBGridMaskColumn; dxDBGridMaskColumn56: TdxDBGridMaskColumn; dxDBGridMaskColumn57: TdxDBGridMaskColumn; dxDBGridMaskColumn58: TdxDBGridMaskColumn; dxDBGridMaskColumn59: TdxDBGridMaskColumn; dxDBGridColumn17: TdxDBGridColumn; dxDBGridColumn18: TdxDBGridColumn; dxDBGridMaskColumn60: TdxDBGridMaskColumn; dxDBGrid6Column22: TdxDBGridColumn; dxDBGridDateColumn9: TdxDBGridDateColumn; dxDBGridDateColumn10: TdxDBGridDateColumn; dxDBGridMaskColumn4: TdxDBGridMaskColumn; dxDBGridMaskColumn6: TdxDBGridMaskColumn; dxDBGridMaskColumn9: TdxDBGridMaskColumn; dxDBGridMaskColumn10: TdxDBGridMaskColumn; dxDBGridMaskColumn11: TdxDBGridMaskColumn; dxDBGridColumn19: TdxDBGridColumn; dxDBGridColumn4: TdxDBGridColumn; dxDBGridMaskColumn12: TdxDBGridMaskColumn; dxDBGridMaskColumn13: TdxDBGridMaskColumn; dxDBGridMaskColumn14: TdxDBGridMaskColumn; dxDBGridMaskColumn15: TdxDBGridMaskColumn; dxDBGrid11: TdxDBGrid; dxDBGrid5Column4: TdxDBGridColumn; dxDBGrid5Column1: TdxDBGridMaskColumn; dxDBGrid5Column2: TdxDBGridColumn; dxDBGrid5Column5: TdxDBGridColumn; dxDBGrid5Column6: TdxDBGridColumn; dxDBGrid5Column3: TdxDBGridColumn; bsSkinTabSheet4: TbsSkinTabSheet; dxDBGrid3: TdxDBGrid; dxDBGridMaskColumn16: TdxDBGridMaskColumn; dxDBGridMaskColumn17: TdxDBGridMaskColumn; dxDBGridMaskColumn18: TdxDBGridMaskColumn; dxDBGridMaskColumn19: TdxDBGridMaskColumn; dxDBGridMaskColumn20: TdxDBGridMaskColumn; dxDBGridColumn5: TdxDBGridColumn; dxDBGridColumn6: TdxDBGridColumn; dxDBGridMaskColumn21: TdxDBGridMaskColumn; dxDBGridColumn7: TdxDBGridColumn; dxDBGridDateColumn3: TdxDBGridDateColumn; dxDBGridDateColumn4: TdxDBGridDateColumn; dxDBGridMaskColumn22: TdxDBGridMaskColumn; dxDBGridMaskColumn23: TdxDBGridMaskColumn; dxDBGridMaskColumn24: TdxDBGridMaskColumn; dxDBGridMaskColumn25: TdxDBGridMaskColumn; dxDBGridMaskColumn26: TdxDBGridMaskColumn; dxDBGridColumn8: TdxDBGridColumn; dxDBGridColumn9: TdxDBGridColumn; dxDBGridMaskColumn27: TdxDBGridMaskColumn; dxDBGridMaskColumn28: TdxDBGridMaskColumn; dxDBGridMaskColumn29: TdxDBGridMaskColumn; dxDBGridMaskColumn30: TdxDBGridMaskColumn; dxDBGrid12: TdxDBGrid; dxDBGrid6Column4: TdxDBGridColumn; dxDBGridMaskColumn31: TdxDBGridMaskColumn; dxDBGridColumn36: TdxDBGridColumn; dxDBGrid6Column5: TdxDBGridColumn; dxDBGrid6Column6: TdxDBGridColumn; dxDBGridColumn43: TdxDBGridColumn; bsSkinTabSheet5: TbsSkinTabSheet; dxDBGrid4: TdxDBGrid; dxDBGridMaskColumn32: TdxDBGridMaskColumn; dxDBGridMaskColumn33: TdxDBGridMaskColumn; dxDBGridMaskColumn34: TdxDBGridMaskColumn; dxDBGridMaskColumn35: TdxDBGridMaskColumn; dxDBGridMaskColumn36: TdxDBGridMaskColumn; dxDBGridColumn10: TdxDBGridColumn; dxDBGridColumn11: TdxDBGridColumn; dxDBGridMaskColumn37: TdxDBGridMaskColumn; dxDBGrid8Column19: TdxDBGridColumn; dxDBGridDateColumn5: TdxDBGridDateColumn; dxDBGridDateColumn6: TdxDBGridDateColumn; dxDBGridMaskColumn38: TdxDBGridMaskColumn; dxDBGridMaskColumn39: TdxDBGridMaskColumn; dxDBGridMaskColumn40: TdxDBGridMaskColumn; dxDBGridColumn12: TdxDBGridColumn; dxDBGridColumn13: TdxDBGridColumn; dxDBGridMaskColumn41: TdxDBGridMaskColumn; dxDBGridMaskColumn42: TdxDBGridMaskColumn; dxDBGridMaskColumn43: TdxDBGridMaskColumn; dxDBGrid13: TdxDBGrid; dxDBGrid7Column4: TdxDBGridColumn; dxDBGridMaskColumn44: TdxDBGridMaskColumn; dxDBGridColumn37: TdxDBGridColumn; dxDBGrid7Column5: TdxDBGridColumn; dxDBGrid7Column6: TdxDBGridColumn; dxDBGridColumn44: TdxDBGridColumn; bsSkinTabSheet6: TbsSkinTabSheet; dxDBGrid5: TdxDBGrid; dxDBGridMaskColumn45: TdxDBGridMaskColumn; dxDBGridMaskColumn46: TdxDBGridMaskColumn; dxDBGridMaskColumn47: TdxDBGridMaskColumn; dxDBGridMaskColumn48: TdxDBGridMaskColumn; dxDBGridMaskColumn49: TdxDBGridMaskColumn; dxDBGridColumn14: TdxDBGridColumn; dxDBGridColumn15: TdxDBGridColumn; dxDBGridMaskColumn50: TdxDBGridMaskColumn; dxDBGridColumn16: TdxDBGridColumn; dxDBGridDateColumn7: TdxDBGridDateColumn; dxDBGridDateColumn8: TdxDBGridDateColumn; dxDBGridMaskColumn51: TdxDBGridMaskColumn; dxDBGridMaskColumn52: TdxDBGridMaskColumn; dxDBGridMaskColumn53: TdxDBGridMaskColumn; dxDBGridColumn38: TdxDBGridColumn; dxDBGridColumn45: TdxDBGridColumn; dxDBGridMaskColumn54: TdxDBGridMaskColumn; dxDBGridMaskColumn115: TdxDBGridMaskColumn; dxDBGridMaskColumn116: TdxDBGridMaskColumn; dxDBGrid14: TdxDBGrid; dxDBGrid8Column4: TdxDBGridColumn; dxDBGridMaskColumn117: TdxDBGridMaskColumn; dxDBGridColumn46: TdxDBGridColumn; dxDBGrid8Column5: TdxDBGridColumn; dxDBGrid8Column6: TdxDBGridColumn; dxDBGridColumn47: TdxDBGridColumn; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure bsSkinButton3Click(Sender: TObject); procedure bsSkinButton5Click(Sender: TObject); procedure bsSkinButton7Click(Sender: TObject); procedure bsSkinButton2Click(Sender: TObject); procedure bsSkinButton9Click(Sender: TObject); procedure FormShow(Sender: TObject); procedure bsSkinButton11Click(Sender: TObject); procedure bsSkinButton6Click(Sender: TObject); procedure bsSkinButton1Click(Sender: TObject); procedure bsSkinButton8Click(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 bsSkinButton10Click(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 bsSkinPanel2Resize(Sender: TObject); procedure bsSkinButton12Click(Sender: TObject); procedure N17Click(Sender: TObject); procedure N34Click(Sender: TObject); procedure N36Click(Sender: TObject); procedure N6Click(Sender: TObject); procedure N4Click(Sender: TObject); procedure dxDBGrid6DblClick(Sender: TObject); procedure dxDBGrid3DblClick(Sender: TObject); procedure dxDBGrid4DblClick(Sender: TObject); procedure dxDBGrid5DblClick(Sender: TObject); private { Private declarations } public { Public declarations } end; var frm_ch_check_check: Tfrm_ch_check_check; implementation uses u_main, u_ch_shen_query, my_sys_function, u_data_share, my_sys_chat; {$R *.dfm} procedure Tfrm_ch_check_check.FormClose(Sender: TObject; var Action: TCloseAction); begin savereggrid(dxdbgrid1,caption); frm_ch_check_check.Hide; frm_ch_check_check.ManualFloat(frm_ch_check_check.BoundsRect ); frm_main.freeTabs('frm_ch_check_check'); action:=cafree; frm_ch_check_check:=nil; end; procedure Tfrm_ch_check_check.bsSkinButton3Click(Sender: TObject); begin if bsSkinButton3.Caption='详细内容' then begin if t_ch_check.IsEmpty then exit; bsSkinNotebook1.PageIndex:=1; bsSkinButton3.Caption:='返回列表'; end else begin bsSkinNotebook1.PageIndex:=0; bsSkinButton3.Caption:='详细内容'; end; end; procedure Tfrm_ch_check_check.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_ch_check_check.bsSkinButton7Click(Sender: TObject); begin table_Prior(t_ch_check); end; procedure Tfrm_ch_check_check.bsSkinButton2Click(Sender: TObject); begin table_next(t_ch_check); end; procedure Tfrm_ch_check_check.bsSkinButton9Click(Sender: TObject); begin sys_print('业务支付申请',2,t_ch_check1,nil,nil,nil,v_fee_do_seae1,v_fee_do_seai1,v_fee_do_aire1,v_fee_do_airi1,t_ch_check1,nil,nil); end; procedure Tfrm_ch_check_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; v_fee_do_seae_sum.Open; v_fee_do_seai_sum.open; v_fee_do_aire_sum.open; v_fee_do_airi_sum.open; loadreggrid(dxdbgrid1,false,caption); end; procedure Tfrm_ch_check_check.bsSkinButton11Click(Sender: TObject); begin if t_ch_check.IsEmpty then exit; if (t_ch_check.FieldByName('申请状态').asstring='提交申请')or (t_ch_check.FieldByName('申请状态').asstring='驳回申请')then begin if (t_ch_check.FieldByName('支付方式').asstring='现金') then begin if not if_open('177') then begin showmessage('对不起你没有现金审批的权限!'); exit; end; end; t_ch_check.Edit; t_ch_check['申请状态']:='批准支付'; t_ch_check['审核人']:=employee; t_ch_check['审核日期']:=now; t_ch_check.post; t_ch_check.Refresh; Send_invocie_check_shen('批准支付费用,申请编号:'+t_ch_check.fieldbyname('申请编号').asstring +',客户:'+t_ch_check.fieldbyname('客户名称').asstring,'034','20'); Send_invocie_check_check('批准支付费用,申请编号:'+t_ch_check.fieldbyname('申请编号').asstring +',客户:'+t_ch_check.fieldbyname('客户名称').asstring,t_ch_check.fieldbyname('申请人').asstring,'26') end else begin showmessage('当前业务状态不能批准支付!!'); end; end; procedure Tfrm_ch_check_check.bsSkinButton6Click(Sender: TObject); var str:string; begin if t_ch_check.IsEmpty then exit; if (t_ch_check.FieldByName('申请状态').asstring='批准支付')or (t_ch_check.FieldByName('申请状态').asstring='提交申请')then begin str:=trim(InputBox('请输入驳回原因', '驳回原因:', '')); if str=''then begin showmessage('驳回原因不能为空,驳回失败!!'); exit; end; t_ch_check.Edit; t_ch_check['申请状态']:='驳回申请'; t_ch_check['审核人']:=employee; t_ch_check['审核日期']:=now; t_ch_check['申请原因']:=str; t_ch_check.post; t_ch_check.Refresh; Send_invocie_check_check('驳回申请支付,申请编号:'+t_ch_check.fieldbyname('申请编号').asstring +',客户:'+t_ch_check.fieldbyname('客户名称').asstring,t_ch_check.fieldbyname('申请人').asstring,'27') end else begin showmessage('当前业务状态不能驳回!!'); end; end; procedure Tfrm_ch_check_check.bsSkinButton1Click(Sender: TObject); begin shen_modify_ok(t_ch_check); end; procedure Tfrm_ch_check_check.bsSkinButton8Click(Sender: TObject); begin shen_modify_back(t_ch_check); end; procedure Tfrm_ch_check_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_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_check.bsSkinButton10Click(Sender: TObject); begin try frm_ch_shen_query:=tfrm_ch_shen_query.Create (self); shen_query_type:=5; 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_check.N10Click(Sender: TObject); begin update_grid_view_no(dxdbgrid1); end; procedure Tfrm_ch_check_check.N14Click(Sender: TObject); begin update_grid_view_all(dxdbgrid1); end; procedure Tfrm_ch_check_check.N12Click(Sender: TObject); begin update_grid(dxdbgrid1,5); end; procedure Tfrm_ch_check_check.N16Click(Sender: TObject); begin grid_save_xls(dxdbgrid1); end; procedure Tfrm_ch_check_check.dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort(Column,t_ch_check,'申请编号'); end; procedure Tfrm_ch_check_check.bsSkinPanel2Resize(Sender: TObject); var i:integer; begin i:=round(bsSkinPanel2.Width/10); bsSkinButton7.Width:=i; bsSkinButton2.Width:=i; bsSkinButton9.Width:=i; bsSkinButton10.Width:=i; bsSkinButton3.Width:=i; bsSkinButton11.Width:=i; bsSkinButton6.Width:=i; bsSkinButton1.Width:=i; bsSkinButton8.Width:=i; bsSkinButton12.Left:=bsSkinPanel2.Width-bsSkinButton12.Width-20; end; procedure Tfrm_ch_check_check.bsSkinButton12Click(Sender: TObject); var Pnt:Tpoint; begin Pnt:=bsSkinButton12.ClientToScreen(Point(0,bsSkinButton12.Height)); PopupMenu3.Popup(Pnt.x,Pnt.y); end; procedure Tfrm_ch_check_check.N17Click(Sender: TObject); begin t_ch_check.Close; t_ch_check.SQL.clear; t_ch_check.SQL.Add('select * from t_ch_check where 申请状态 in ('+''''+'申请支付'+'''' +') ' +'order by 申请编号 desc'); t_ch_check.open; end; procedure Tfrm_ch_check_check.N34Click(Sender: TObject); begin t_ch_check.Close; t_ch_check.SQL.clear; t_ch_check.SQL.Add('select * from t_ch_check where 申请状态 in ('+''''+'驳回申请'+'''' +','+''''+'禁止修改'+''''+') ' +'order by 申请编号 desc'); t_ch_check.open; end; procedure Tfrm_ch_check_check.N36Click(Sender: TObject); begin t_ch_check.Close; t_ch_check.SQL.clear; t_ch_check.SQL.Add('select * from t_ch_check where 申请状态 in ('+''''+'提交申请'+'''' +','+''''+'申请修改'+''''+') ' +'order by 申请编号 desc'); t_ch_check.open; end; procedure Tfrm_ch_check_check.N6Click(Sender: TObject); begin t_ch_check.Close; t_ch_check.SQL.clear; t_ch_check.SQL.Add('select * from t_ch_check where 申请状态 in ('+''''+'批准支付'+'''' +','+''''+'禁止修改'+''''+') ' +'order by 申请编号 desc'); t_ch_check.open; end; procedure Tfrm_ch_check_check.N4Click(Sender: TObject); begin t_ch_check.Close; t_ch_check.SQL.clear; t_ch_check.SQL.Add('select * from t_ch_check where 申请状态 in ('+''''+'支付完毕'+''''+') ' +'order by 申请编号 desc'); t_ch_check.open; end; procedure Tfrm_ch_check_check.dxDBGrid6DblClick(Sender: TObject); begin fee_view(v_fee_do_seae.fieldbyname('编号').asstring); end; procedure Tfrm_ch_check_check.dxDBGrid3DblClick(Sender: TObject); begin fee_view(v_fee_do_seai.fieldbyname('编号').asstring); end; procedure Tfrm_ch_check_check.dxDBGrid4DblClick(Sender: TObject); begin fee_view(v_fee_do_aire.fieldbyname('编号').asstring); end; procedure Tfrm_ch_check_check.dxDBGrid5DblClick(Sender: TObject); begin fee_view(v_fee_do_airi.fieldbyname('编号').asstring); end; end.