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, kbmMemTable, wwdbdatetimepicker; 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; dxDBGrid1Column17: TdxDBGridColumn; dxDBGrid1Column18: TdxDBGridColumn; bsSkinPanel4: TbsSkinPanel; Label14: TLabel; Label15: TLabel; Label16: TLabel; Label19: TLabel; Label20: TLabel; Label21: TLabel; Label22: TLabel; Label23: TLabel; Label24: TLabel; Label26: TLabel; Label27: TLabel; Label28: TLabel; Label29: TLabel; Label30: TLabel; Label31: TLabel; Label32: TLabel; DBEdit12: TDBEdit; DBEdit13: TDBEdit; RxDBLookupCombo3: TRxDBLookupCombo; RxDBLookupCombo4: TRxDBLookupCombo; DBEdit15: TDBEdit; DBEdit16: TDBEdit; DBEdit17: TDBEdit; DBEdit18: TDBEdit; DBEdit19: TDBEdit; DBMemo3: TDBMemo; DBEdit20: TDBEdit; DBEdit21: TDBEdit; DBEdit22: TDBEdit; DBEdit23: TDBEdit; DBMemo4: TDBMemo; DBEdit24: TDBEdit; t_ch_checkDSDesigner: TStringField; t_ch_checkDSDesigner2: TStringField; t_ch_checkDSDesigner3: TStringField; t_ch_checkDSDesigner4: TStringField; t_ch_checkDSDesigner5: TStringField; t_ch_checkDSDesigner6: TBCDField; t_ch_checkDSDesigner7: TBCDField; t_ch_checkDSDesigner8: TBCDField; t_ch_checkDSDesigner9: TStringField; t_ch_checkDSDesigner10: TBooleanField; t_ch_checkDSDesigner11: TStringField; t_ch_checkDSDesigner12: TDateTimeField; t_ch_checkDSDesigner13: TStringField; t_ch_checkDSDesigner14: TDateTimeField; t_ch_checkDSDesigner15: TStringField; t_ch_checkDSDesigner16: TDateTimeField; t_ch_checkDSDesigner17: TStringField; t_ch_checkDSDesigner18: TStringField; t_ch_checkDSDesigner19: TStringField; t_ch_checkDSDesigner20: TStringField; t_ch_checkDSDesigner21: TDateTimeField; t_ch_checkDSDesigner22: TBCDField; t_ch_checkDSDesigner23: TBCDField; t_ch_checkField: TFloatField; t_ch_checkField2: TFloatField; dxDBGrid1Column19: TdxDBGridColumn; dxDBGrid1Column20: TdxDBGridColumn; t_ch_checkDSDesigner24: TBooleanField; bsSkinButton38: TbsSkinButton; memtblprint: TkbmMemTable; memtblprint1: TDataSource; t_ch_checkDSDesigner25: TDateTimeField; dxDBGrid1Column21: TdxDBGridColumn; dxDBGrid1Column22: TdxDBGridColumn; t_ch_checkDSDesigner26: TSmallintField; bsSkinButton4: TbsSkinButton; dxDBGrid1Column23: TdxDBGridColumn; v_fee_do_airtruck: TADOQuery; v_fee_do_airtruck1: TDataSource; v_fee_do_airtruck_sum: TADOQuery; v_fee_do_airtruck_sum1: TDataSource; bsSkinTabSheet7: TbsSkinTabSheet; dxDBGrid2: TdxDBGrid; dxDBGridColumn1: TdxDBGridColumn; dxDBGridMaskColumn1: TdxDBGridMaskColumn; dxDBGridColumn2: TdxDBGridColumn; dxDBGridColumn3: TdxDBGridColumn; dxDBGridColumn20: TdxDBGridColumn; dxDBGridColumn21: TdxDBGridColumn; dxDBGrid7: TdxDBGrid; dxDBGridMaskColumn2: TdxDBGridMaskColumn; dxDBGridMaskColumn3: TdxDBGridMaskColumn; dxDBGridMaskColumn5: TdxDBGridMaskColumn; dxDBGridMaskColumn7: TdxDBGridMaskColumn; dxDBGridMaskColumn8: TdxDBGridMaskColumn; dxDBGridColumn22: TdxDBGridColumn; dxDBGridColumn23: TdxDBGridColumn; dxDBGridMaskColumn61: TdxDBGridMaskColumn; dxDBGridColumn24: TdxDBGridColumn; dxDBGridDateColumn1: TdxDBGridDateColumn; dxDBGridMaskColumn63: TdxDBGridMaskColumn; dxDBGridMaskColumn64: TdxDBGridMaskColumn; dxDBGridColumn26: TdxDBGridColumn; dxDBGridMaskColumn65: TdxDBGridMaskColumn; dxDBGridMaskColumn66: TdxDBGridMaskColumn; dxDBGridMaskColumn67: TdxDBGridMaskColumn; bsSkinTabSheet8: TbsSkinTabSheet; dxDBGrid8: TdxDBGrid; dxDBGridColumn25: TdxDBGridColumn; dxDBGridMaskColumn62: TdxDBGridMaskColumn; dxDBGridColumn27: TdxDBGridColumn; dxDBGridColumn28: TdxDBGridColumn; dxDBGridColumn29: TdxDBGridColumn; dxDBGridColumn30: TdxDBGridColumn; dxDBGrid9: TdxDBGrid; dxDBGridMaskColumn68: TdxDBGridMaskColumn; dxDBGridMaskColumn69: TdxDBGridMaskColumn; dxDBGridMaskColumn70: TdxDBGridMaskColumn; dxDBGridMaskColumn71: TdxDBGridMaskColumn; dxDBGridMaskColumn72: TdxDBGridMaskColumn; dxDBGridColumn31: TdxDBGridColumn; dxDBGridColumn32: TdxDBGridColumn; dxDBGridMaskColumn73: TdxDBGridMaskColumn; dxDBGridColumn33: TdxDBGridColumn; dxDBGridDateColumn2: TdxDBGridDateColumn; dxDBGridMaskColumn74: TdxDBGridMaskColumn; dxDBGridMaskColumn75: TdxDBGridMaskColumn; dxDBGridColumn34: TdxDBGridColumn; dxDBGridMaskColumn76: TdxDBGridMaskColumn; dxDBGridMaskColumn77: TdxDBGridMaskColumn; dxDBGridMaskColumn78: TdxDBGridMaskColumn; v_fee_do_railway: TADOQuery; v_fee_do_railway1: TDataSource; v_fee_do_railway_sum: TADOQuery; v_fee_do_railway_sum1: TDataSource; Label121: TLabel; DBEdit88: TDBEdit; Label122: TLabel; wwDBDateTimePicker4: TwwDBDateTimePicker; DBEdit87: TDBEdit; Label120: TLabel; t_ch_checkDSDesigner27: TDateTimeField; t_ch_checkDSDesigner28: TStringField; t_ch_checkDSDesigner29: TStringField; Label33: TLabel; Label34: TLabel; Label35: TLabel; DBEdit25: TDBEdit; wwDBDateTimePicker1: TwwDBDateTimePicker; DBEdit26: TDBEdit; dxDBGrid1Column24: TdxDBGridColumn; dxDBGrid1Column25: TdxDBGridColumn; dxdbgrdclmndxDBGrid1Column26: TdxDBGridColumn; dxDBGrid6Column23: TdxDBGridColumn; dxDBGrid6Column24: TdxDBGridColumn; dxDBGrid3Column23: TdxDBGridColumn; dxDBGrid3Column24: 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); procedure t_ch_checkCalcFields(DataSet: TDataSet); procedure bsSkinButton38Click(Sender: TObject); procedure bsSkinNotebook1PageChanged(Sender: TObject); procedure bsSkinButton4Click(Sender: TObject); procedure dxDBGrid7DblClick(Sender: TObject); private { Private declarations } public { Public declarations } end; var ch_check_check:boolean; frm_ch_check_check: Tfrm_ch_check_check; implementation uses u_main, u_ch_shen_query, my_sys_function, u_data_share; {$R *.dfm} procedure Tfrm_ch_check_check.FormClose(Sender: TObject; var Action: TCloseAction); begin ch_check_check:=false; 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); var aQuery:TAdoQuery; strbs,strwt,strmb:WideString; begin //打印生成编号列表 memtblprint.close; memtblprint.Open; aQuery:=CreateAdoQuery; try with aQuery do begin Close;SQL.Clear; sql.Add('select distinct 委托编号,业务编号,主提单号 from v_op_bscard where 编号 in (select 业务编号 from t_ch_fee_do where 工作编号='''+t_ch_check['申请编号']+''')'); Open; first; while not eof do begin if strwt='' then strwt:=fieldbyname('委托编号').AsString else strwt:=strwt+'/'+fieldbyname('委托编号').AsString; if strbs='' then strbs:=fieldbyname('业务编号').AsString else strbs:=strbs+'/'+fieldbyname('业务编号').AsString; if strmb='' then strmb:=fieldbyname('主提单号').AsString else strmb:=strmb+'/'+fieldbyname('主提单号').AsString; Next; end; memtblprint.Edit; memtblprint.fieldbyname('bsno').AsString:=strbs; memtblprint.fieldbyname('wtno').AsString:=strwt; memtblprint.fieldbyname('mblno').AsString:=strmb; memtblprint.post; end; finally FreeAndNil(aQuery); end; sys_print('业务支付申请',2,t_ch_check1,memtblprint1,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 bsSkinNotebook1.PageIndex:=0; t_ch_check.close; t_ch_check.sql.Clear; t_ch_check.sql.Add('select * from t_ch_check where 申请状态 in (''提交申请'',''申请修改'') '); t_ch_check.sql.Add(' and '+open_data('1003','申请人','no','no','no','no')); t_ch_check.sql.Add('order by 申请编号'); t_ch_check.open; ch_check_check:=true; loadreggrid(dxdbgrid1,false,caption); dxdbgrid1.ShowSummaryFooter:=true; if StrToBool(get_parameters_value(83,'false')) then begin bsSkinPanel4.Visible:=true; dxdbgrid1.ColumnByFieldName('申请金额').Visible:=False; dxdbgrid1.ColumnByFieldName('实际金额').Visible:=false; dxdbgrid1.ColumnByFieldName('虚开金额').Visible:=False; dxdbgrid1.ColumnByFieldName('美元申请金额').Visible:=false; dxdbgrid1.ColumnByFieldName('人民币申请金额').Visible:=false; dxdbgrid1.ColumnByFieldName('美元金额').Visible:=True; dxdbgrid1.ColumnByFieldName('人民币金额').Visible:=True; end else begin bsSkinPanel4.Visible:=False; dxdbgrid1.ColumnByFieldName('申请金额').Visible:=True; dxdbgrid1.ColumnByFieldName('实际金额').Visible:=True; dxdbgrid1.ColumnByFieldName('虚开金额').Visible:=True; dxdbgrid1.ColumnByFieldName('美元申请金额').Visible:=True; dxdbgrid1.ColumnByFieldName('人民币申请金额').Visible:=True; dxdbgrid1.ColumnByFieldName('美元金额').Visible:=False; dxdbgrid1.ColumnByFieldName('人民币金额').Visible:=False; end; if not if_open('343') then begin bsSkinButton4.Visible:=false; end; 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',t_ch_check.fieldbyname('申请编号').asstring); // 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['是否打印']:=0; 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 if t_ch_check.IsEmpty then exit; if (t_ch_check.FieldByName('申请状态').asstring='申请修改')or (t_ch_check.FieldByName('申请状态').asstring='禁止修改')then begin t_ch_check.Edit; t_ch_check['申请状态']:='批准修改'; t_ch_check['审核人']:=employee; t_ch_check['审核日期']:=now; t_ch_check['是否打印']:=0; t_ch_check.post; t_ch_check.Refresh; // Send_invocie_check_check('批准修改支付,申请编号:'+t_ch_check.fieldbyname('申请编号').asstring // ,t_ch_check.fieldbyname('申请人').asstring,'28'); end else begin showmessage('当前业务状态不能批准修改!!'); end; 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:='1003'; shen_query_op_limited:='no'; frm_ch_shen_query.ShowModal; bsSkinNotebook1.PageIndex:=0; 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/12); 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; bsSkinButton4.Width:=i; bsSkinButton38.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 ('+''''+'申请支付'+'''' +') ' +' and '+open_data('1003','申请人','no','no','no','no') +'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 ('+''''+'驳回申请'+'''' +','+''''+'禁止修改'+''''+') ' +' and '+open_data('1003','申请人','no','no','no','no') +'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 ('+''''+'提交申请'+'''' +','+''''+'申请修改'+''''+') ' +' and '+open_data('1003','申请人','no','no','no','no') +'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 ('+''''+'批准支付'+'''' +','+''''+'禁止修改'+''''+') ' +' and '+open_data('1003','申请人','no','no','no','no') +'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 ('+''''+'支付完毕'+''''+') ' +' and '+open_data('1003','申请人','no','no','no','no') +'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; procedure Tfrm_ch_check_check.t_ch_checkCalcFields(DataSet: TDataSet); begin if dataset.FieldByName('币别').AsString='USD' then begin dataset.FieldByName('美元申请金额').AsFloat:=dataset.fieldbyname('申请金额').AsFloat; dataset.FieldByName('人民币申请金额').AsFloat:=0; end else begin dataset.FieldByName('人民币申请金额').AsFloat:=dataset.fieldbyname('申请金额').AsFloat; dataset.FieldByName('美元申请金额').AsFloat:=0; end; end; procedure Tfrm_ch_check_check.bsSkinButton38Click(Sender: TObject); var book1:Tbookmark; begin // if t_ch_check.IsEmpty then // exit; book1:=t_ch_check.GetBookmark; t_ch_check.Requery; t_ch_check.GotoBookmark(book1); end; procedure Tfrm_ch_check_check.bsSkinNotebook1PageChanged(Sender: TObject); begin if not ch_check_check then exit; if bsSkinNotebook1.PageIndex<>1 then exit; v_fee_do_seae.open; v_fee_do_seai.open; v_fee_do_aire.open; v_fee_do_airi.open; v_fee_do_airtruck.open; v_fee_do_railway.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; v_fee_do_airtruck_sum.open; v_fee_do_railway_sum.open; end; procedure Tfrm_ch_check_check.bsSkinButton4Click(Sender: TObject); begin try t_ch_check.Edit; t_ch_check['是否打印']:=0; t_ch_check.FieldByName('打印次数').AsInteger:=0; t_ch_check.post; finally end; end; procedure Tfrm_ch_check_check.dxDBGrid7DblClick(Sender: TObject); begin fee_view(v_fee_do_airtruck.fieldbyname('编号').asstring); end; end.