unit u_ch_piliang_seai; interface uses Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms, Dialogs, dxExEdtr, ADODB, DB, BusinessSkinForm, dxDBTLCl, dxGrClms, bsSkinCtrls, dxTL, dxDBCtrl, dxDBGrid, dxCntner; type Tfrm_ch_piliang_seai = class(TForm) bsSkinPanel1: TbsSkinPanel; dxDBGrid2: TdxDBGrid; dxDBGridMaskColumn1: TdxDBGridMaskColumn; dxDBGrid1Column2: TdxDBGridCheckColumn; bsBusinessSkinForm1: TbsBusinessSkinForm; t_op_seai1: TDataSource; t_ch_accept: TADOQuery; t_ch_accept1: TDataSource; t_ch_pay: TADOQuery; t_ch_pay1: TDataSource; t_sys_report: TADOQuery; t_sys_report1: TDataSource; t_op_seai: TADOStoredProc; t_op_gain: TADOQuery; t_op_gain1: TDataSource; dxDBGrid1: TdxDBGrid; dxDBGrid1Column1: TdxDBGridMaskColumn; dxDBGrid1Column4: TdxDBGridMaskColumn; dxDBGrid1Column5: TdxDBGridMaskColumn; dxDBGrid1Column62: TdxDBGridColumn; dxDBGrid1Column6: TdxDBGridMaskColumn; dxDBGrid1Column9: TdxDBGridDateColumn; dxDBGrid1Column11: TdxDBGridMaskColumn; dxDBGrid1Column13: TdxDBGridMaskColumn; dxDBGrid1Column14: TdxDBGridMaskColumn; dxDBGrid1Column15: TdxDBGridMaskColumn; dxDBGrid1Column16: TdxDBGridMaskColumn; dxDBGrid1Column17: TdxDBGridMaskColumn; dxDBGrid1TEU: TdxDBGridMaskColumn; dxDBGrid1Column41: TdxDBGridMaskColumn; dxDBGrid1Column47: TdxDBGridMaskColumn; dxDBGrid1Column48: TdxDBGridDateColumn; dxDBGrid1Column49: TdxDBGridMaskColumn; dxDBGrid1Column50: TdxDBGridMaskColumn; bsSkinButton8: TbsSkinButton; bsSkinButton5: TbsSkinButton; procedure bsSkinButton5Click(Sender: TObject); procedure bsSkinButton8Click(Sender: TObject); procedure FormShow(Sender: TObject); private { Private declarations } public { Public declarations } end; var frm_ch_piliang_seai: Tfrm_ch_piliang_seai; implementation uses my_sys_function; {$R *.dfm} procedure Tfrm_ch_piliang_seai.bsSkinButton5Click(Sender: TObject); begin close; end; procedure Tfrm_ch_piliang_seai.bsSkinButton8Click(Sender: TObject); begin if t_sys_report.IsEmpty then begin showmessage('没有利润单格式,无法打印!!'); exit; end; if strtobool(get_parameters_value(2,'false'))then begin t_op_seai.first; while not t_op_seai.eof do begin t_ch_accept.first; while not t_ch_accept.eof do begin if (t_ch_accept.FieldByName('费用状态').asstring='录入状态') or(t_ch_accept.FieldByName('费用状态').asstring='提交审核') or(t_ch_accept.FieldByName('费用状态').asstring='申请修改') or(t_ch_accept.FieldByName('费用状态').asstring='申请删除') then begin showmessage('费用必须在审核通过后方可以打印利润单!!'); exit; end; t_ch_accept.next; end; t_ch_pay.first; while not t_ch_pay.eof do begin if (t_ch_pay.FieldByName('费用状态').asstring='录入状态') or(t_ch_pay.FieldByName('费用状态').asstring='提交审核') or(t_ch_pay.FieldByName('费用状态').asstring='申请修改') or(t_ch_pay.FieldByName('费用状态').asstring='申请删除') then begin showmessage('费用必须在审核通过后方可以打印利润单!!'); exit; end; t_ch_pay.next; end; t_op_seai.next; end; end; sys_print_piliang('海运进口利润单',t_sys_report.fieldbyname('报表名称').asstring,t_op_seai,t_op_seai1,t_op_gain1,nil,nil,t_ch_accept1,t_ch_pay1,nil,nil,nil,nil,nil,t_sys_report.fieldbyname('CH_ID').asinteger); end; procedure Tfrm_ch_piliang_seai.FormShow(Sender: TObject); begin t_sys_report.Parameters[0].value:='海运进口利润单'; t_sys_report.open; t_ch_accept.open; t_ch_pay.open; t_op_gain.open; end; end.