unit u_info_render_manager; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, dxExEdtr, DB, ADODB, bsSkinCtrls, ExtCtrls, StdCtrls, ComCtrls, DBCtrls, bsdbctrls, Mask, dxDBTLCl, dxGrClms, dxDBCtrl, dxDBGrid, dxTL, dxCntner; type Tfrm_info_render_manager = class(TForm) bsSkinPanel1: TbsSkinPanel; Panel1: TPanel; bsSkinButton10: TbsSkinButton; bsSkinButton2: TbsSkinButton; bsSkinButton5: TbsSkinButton; t_info_render: TADOQuery; t_info_render1: TDataSource; bsSkinButton1: TbsSkinButton; dxDBGrid1: TdxDBGrid; dxDBGrid1Column1: TdxDBGridMaskColumn; dxDBGrid1Column2: TdxDBGridMaskColumn; dxDBGrid1Column3: TdxDBGridMaskColumn; dxDBGrid1Column4: TdxDBGridDateColumn; dxDBGrid1Column5: TdxDBGridMaskColumn; dxDBGrid1Column6: TdxDBGridDateColumn; dxDBGrid1Column7: TdxDBGridMaskColumn; dxDBGrid1Column8: TdxDBGridDateColumn; bsSkinPanel2: TbsSkinPanel; Label1: TLabel; Label2: TLabel; Label3: TLabel; Label4: TLabel; Label5: TLabel; Label6: TLabel; Label7: TLabel; DBEdit1: TDBEdit; DBEdit2: TDBEdit; DBEdit3: TDBEdit; DBEdit4: TDBEdit; DBEdit5: TDBEdit; DBEdit6: TDBEdit; DBEdit7: TDBEdit; bsSkinGroupBox2: TbsSkinGroupBox; DBRichEdit1: TDBRichEdit; bsSkinGroupBox3: TbsSkinGroupBox; DBRichEdit3: TDBRichEdit; bsSkinGroupBox1: TbsSkinGroupBox; DBRichEdit2: TDBRichEdit; bsSkinButton3: TbsSkinButton; bsSkinButton7: TbsSkinButton; bsSkinButton8: TbsSkinButton; procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormShow(Sender: TObject); procedure bsSkinButton5Click(Sender: TObject); procedure bsSkinButton2Click(Sender: TObject); procedure bsSkinButton4Click(Sender: TObject); procedure bsSkinButton10Click(Sender: TObject); procedure FormResize(Sender: TObject); procedure dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); procedure dxDBGrid1Column1CustomDraw(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 bsSkinButton1Click(Sender: TObject); procedure bsSkinButton3Click(Sender: TObject); procedure bsSkinButton7Click(Sender: TObject); procedure bsSkinButton8Click(Sender: TObject); private { Private declarations } public { Public declarations } end; var frm_info_render_manager: Tfrm_info_render_manager; implementation uses u_main, u_info_render_query, my_sys_function, u_info_render_check; {$R *.dfm} procedure Tfrm_info_render_manager.FormClose(Sender: TObject; var Action: TCloseAction); begin frm_info_render_manager.Hide; frm_info_render_manager.ManualFloat(frm_info_render_manager.BoundsRect ); frm_main.freeTabs('frm_info_render_manager'); action:=cafree; frm_info_render_manager:=nil; end; procedure Tfrm_info_render_manager.FormShow(Sender: TObject); begin t_info_render.Close; t_info_render.sql.clear; t_info_render.sql.add('select * from t_info_render where ' +open_data('9002','汇报人','no','no','no','no') +' and 审核状态 in ('+''''+'提交审核'+''''+','+''''+'审核通过'+''''+')' +' order by 汇报日期'); t_info_render.open; end; procedure Tfrm_info_render_manager.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_info_render_manager.bsSkinButton2Click(Sender: TObject); begin if (not if_open('020')) then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if t_info_render.IsEmpty then exit; if t_info_render.FieldByName('审核状态').asstring<>'提交审核' then begin showmessage('工作报告当前状态不能审核!!'); exit; end; try frm_info_render_check:=tfrm_info_render_check.Create (self); frm_info_render_check.Hint:='1'; frm_info_render_check.Caption:='工作报告审核'; frm_info_render_check.bsSkinGroupBox1.Caption:='审核意见'; frm_info_render_check.ShowModal; finally frm_info_render_check.Free; frm_info_render_check:=nil; end; end; procedure Tfrm_info_render_manager.bsSkinButton4Click(Sender: TObject); begin if t_info_render.IsEmpty then exit; if not t_info_render.FieldByName('是否审核').asboolean then begin exit; end; t_info_render.Edit; t_info_render['是否审核']:=0; t_info_render.post; end; procedure Tfrm_info_render_manager.bsSkinButton10Click(Sender: TObject); begin try frm_info_render_query:=tfrm_info_render_query.Create (self); frm_info_render_query.Hint:='2'; frm_info_render_query.ShowModal; finally frm_info_render_query.Free; end; end; procedure Tfrm_info_render_manager.FormResize(Sender: TObject); var i:integer; begin i:=round(panel1.Width/7); bsSkinButton10.Width:=i; bsSkinButton7.Width:=i; bsSkinButton8.Width:=i; bsSkinButton2.Width:=i; bsSkinButton3.Width:=i; bsSkinButton1.Width:=i; end; procedure Tfrm_info_render_manager.dxDBGrid1ColumnSorting(Sender: TObject; Column: TdxDBTreeListColumn; var Allow: Boolean); begin Column_sort(Column,t_info_render,'报告题目'); end; procedure Tfrm_info_render_manager.dxDBGrid1Column1CustomDraw( 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[dxDBGrid1Column1.Index]='录入状态' then AColor:=clWhite; if ANode.Strings[dxDBGrid1Column1.Index]='提交审核' then AColor:=$0080FFFF; if ANode.Strings[dxDBGrid1Column1.Index]='审核通过' then AColor:=$0000FF80; if ANode.Strings[dxDBGrid1Column1.Index]='复核通过' then AColor:=clAqua; AFont.Color:=clblack; end; procedure Tfrm_info_render_manager.bsSkinButton1Click(Sender: TObject); begin sys_print('工作报告打印',2,t_info_render1,nil,nil,nil,nil,nil,nil,nil,nil,nil,nil); end; procedure Tfrm_info_render_manager.bsSkinButton3Click(Sender: TObject); begin if (not if_open('214')) then begin showmessage('对不起你没有此模块的操作权限!'); exit; end; if t_info_render.IsEmpty then exit; if (t_info_render.FieldByName('审核状态').asstring<>'提交审核') and(t_info_render.FieldByName('审核状态').asstring<>'审核通过') then begin showmessage('工作报告当前状态不能复核!!'); exit; end; try frm_info_render_check:=tfrm_info_render_check.Create (self); frm_info_render_check.Hint:='2'; frm_info_render_check.Caption:='工作报告复核'; frm_info_render_check.bsSkinGroupBox1.Caption:='复核意见'; frm_info_render_check.ShowModal; finally frm_info_render_check.Free; frm_info_render_check:=nil; end; end; procedure Tfrm_info_render_manager.bsSkinButton7Click(Sender: TObject); begin t_info_render.close; t_info_render.sql.clear; t_info_render.SQL.add('select * from t_info_render where ' +open_data('9002','汇报人','no','no','no','no')+ ' and 审核状态='+''''+'提交审核'+'''' +' order by 汇报日期'); t_info_render.open; end; procedure Tfrm_info_render_manager.bsSkinButton8Click(Sender: TObject); begin t_info_render.close; t_info_render.sql.clear; t_info_render.SQL.add('select * from t_info_render where ' +open_data('9002','汇报人','no','no','no','no')+ ' and 审核状态 in('+''''+'提交审核'+'''' +','+''''+'审核通过'+''''+')'+' order by 汇报日期'); t_info_render.open; end; end.