⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sy_zfhzcx.pas

📁 省级集邮品管理ERP
💻 PAS
📖 第 1 页 / 共 2 页
字号:

{*******************************************************}
{                                                       }
{                     总分汇总查询                      }
{                                                       }
{            中软金马公司版权所有。2002.12前            }
{                                                       }
{               编制:中软金马项目开发组                }
{                                                       }
{                                                       }
{*******************************************************}
(*
本模块在省级集邮票管理、省级市场购入票管理、省级集邮品管理、省级零枚票管理、省级综合查询、
地市集邮票管理、地市集邮品管理、地市市场购入票管理 八个模块调用
*)
unit SY_ZFHZCX;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  SY_SearchBase, Db, DBTables, Grids, DBGrids, StdCtrls, Buttons, ExtCtrls,
  ComCtrls, Spin, DBCtrls, RXCtrls, SqlStrings, RxQuery, Qrctrls, QuickRpt,
  Menus, DBGridExport;

type
  //关系单位
  PGXDW = ^TGXDW;
  TGXDW = Record
    DWDM,DWMC:string;
    BJ,ZJXJ:Char;
  end;
  //查看状态
  TSearchState = (ssFHZ,ssFHZMX);

  TfrmY_ZFHZCX = class(TfrmY_SearchBase)
    Label4: TLabel;
    Label5: TLabel;
    Dso_Detail: TDataSource;
    cBo_GXDW: TComboBox;
    DBG_Detail: TDBGrid;
    Qry_Detail: TQuery;
    Qry_DetailDWDM: TStringField;
    Qry_DetailCRKDH: TStringField;
    Qry_DetailZI: TStringField;
    Qry_DetailRQ: TDateTimeField;
    Qry_DetailSL: TFloatField;
    Qry_DetailJZSJ: TDateTimeField;
    Qry_DetailZBR: TStringField;
    Qry_DetailSDATE: TDateTimeField;
    Label1: TLabel;
    SED_Year: TSpinEdit;
    Qry_DetailPPDM: TStringField;
    Qry_DetailTMC: TStringField;
    Qry_DetailJJ: TFloatField;
    Qry_DetailXJ: TFloatField;
    SqlStrings1: TSqlStrings;
    RGr_Base: TRadioGroup;
    Qry_Print: TRxQuery;
    QRe_jypfhz: TQuickRep;
    PageHeaderBand1: TQRBand;
    QRLabel38: TQRLabel;
    QRShape49: TQRShape;
    QRShape50: TQRShape;
    QRShape51: TQRShape;
    QRShape52: TQRShape;
    QRShape53: TQRShape;
    QRShape54: TQRShape;
    QRLabel39: TQRLabel;
    QRShape56: TQRShape;
    QRShape57: TQRShape;
    QRLabel40: TQRLabel;
    QRLabel41: TQRLabel;
    QRLabel42: TQRLabel;
    QRLabel43: TQRLabel;
    QRLabel44: TQRLabel;
    QRLabel45: TQRLabel;
    QRLabel46: TQRLabel;
    QRLabel47: TQRLabel;
    QRLabel51: TQRLabel;
    QRL_fh_wlhm: TQRLabel;
    QRL_fh_nd: TQRLabel;
    QRShape1: TQRShape;
    QRShape3: TQRShape;
    QRShape4: TQRShape;
    QRLabel2: TQRLabel;
    QRSysData2: TQRSysData;
    DetailBand1: TQRBand;
    QRShape59: TQRShape;
    QRShape60: TQRShape;
    QRShape61: TQRShape;
    QRShape62: TQRShape;
    QRShape63: TQRShape;
    QRShape64: TQRShape;
    QRShape2: TQRShape;
    QRRichText1: TQRRichText;
    QRRichText2: TQRRichText;
    QRRichText3: TQRRichText;
    QRRichText4: TQRRichText;
    QRRichText5: TQRRichText;
    QRRichText6: TQRRichText;
    QRRichText7: TQRRichText;
    QRShape5: TQRShape;
    QRShape6: TQRShape;
    PageFooterBand1: TQRBand;
    QRShape15: TQRShape;
    QRShape16: TQRShape;
    QRShape17: TQRShape;
    QRShape18: TQRShape;
    QRShape19: TQRShape;
    QRShape20: TQRShape;
    QRShape21: TQRShape;
    QRShape22: TQRShape;
    QRShape23: TQRShape;
    QRShape24: TQRShape;
    QRShape25: TQRShape;
    QRLabel3: TQRLabel;
    ColumnHeaderBand1: TQRBand;
    QRShape7: TQRShape;
    QRShape8: TQRShape;
    QRShape9: TQRShape;
    QRShape10: TQRShape;
    QRShape11: TQRShape;
    QRShape12: TQRShape;
    QRShape13: TQRShape;
    QRShape14: TQRShape;
    QRLabel1: TQRLabel;
    procedure SED_YearChange(Sender: TObject);
    procedure Qry_SearchAfterOpen(DataSet: TDataSet);
    procedure BBt_PrintClick(Sender: TObject);
    procedure Qry_DetailAfterOpen(DataSet: TDataSet);
    procedure RGr_BaseClick(Sender: TObject);
    procedure QRe_jypfhzNeedData(Sender: TObject; var MoreData: Boolean);
    procedure QRe_jypfhzStartPage(Sender: TCustomQuickRep);
    procedure QRe_jypfhzBeforePrint(Sender: TCustomQuickRep;
      var PrintReport: Boolean);
  private
    { Private declarations }
    FSearchState:TSearchState;
    //获取关系单位信息
    procedure YP_GetGxdwXX;
    procedure Set_SearchState(Value:TSearchState);
  protected
    property SearchState:TSearchState Read FSearchState Write Set_SearchState Default ssFHZ;
    procedure Init;override;
    procedure Search;override;
  public
    LineCount,RI,TotalPageCount:Integer;
    ZY_temp:string;
    Tao_Print_Flag:Boolean;
  end;

function ShowZFHZCX(p_typ: TIO_TYPE): Boolean;
var
  frmY_ZFHZCX: TfrmY_ZFHZCX;

implementation
uses datas,pub,SJ_DialogAfterPrint ;
{$R *.DFM}

var l_typ: TIO_TYPE;

function ShowZFHZCX(p_typ: TIO_TYPE): Boolean;
begin
  l_Typ := p_typ;
  Application.CreateForm(TfrmY_ZFHZCX, frmY_ZFHZCX);
  with frmY_ZFHZCX do
  begin
    Caption := '邮资票品管理信息系统——' + pCaption[integer(l_typ)] + '业务';
    QRLabel38.Caption := pCaption[integer(l_typ)] + '分户帐';
    panel1.Caption := pCaption[integer(l_typ)] +'分户帐查询';
    Qry_Search.SQL := SqlStrings.FSqlText[l_typ];
    QRe_jypfhz.Visible := False;
    result := ShowModal = MB_OK;
    Free;
  end;
end;

procedure TfrmY_ZFHZCX.YP_GetGxdwXX;
var
  Vl_GXDW:PGXDW;
begin
  cBo_GXDW.Items.Clear;
  With Qry_Any do
  begin
    Close;
    Sql.Clear;
    Sql.Add('Select DWDM,DWJC DWMC,BJ,ZJXJ from TGS_GXDWSJB Where FHDX=''1''');
    case l_typ of
      io_txp:
        SQL.Add('and TXYW=''1''');
      else
        SQL.Add('and JYYW=''1''');
    end;
    SQL.Add('order by PXM');

    Open;
    While Not Eof do
    begin
      New(vl_GXDW);
      vl_GXDW^.DWDM:=FieldByName('DWDM').AsString;
      vl_GXDW^.DWMC:=FieldByName('DWMC').AsString;
      vl_GXDW^.BJ:=(FieldByName('BJ').AsString+'0')[1];
      vl_GXDW^.ZJXJ:=(FieldByName('ZJXJ').AsString+'0')[1];
      cBo_GXDW.Items.AddObject(vl_GXDW^.DWMC,TObject(vl_GXDW));
      Next;
    end;
    Close;
  end;
  if cBo_GXDW.Items.Count > 0 then cBo_GXDW.ItemIndex := 0;
end;

procedure TfrmY_ZFHZCX.Init;
begin
  Inherited Init;
  SED_Year.Value:=CurYear;
  Qry_Detail.SQL := SqlStrings1.FSqlText[l_typ];

  YP_GetGxdwXX;
  cBo_GXDW.ItemIndex:=0;
  SearchState:=ssFHZ;
end;

procedure TfrmY_ZFHZCX.Set_SearchState(Value:TSearchState);
begin
  FSearchState:=Value;
  Case Value of
    ssFHZ: //总分户帐
    begin
      RGr_base.ItemIndex := 0;
      DBG_Detail.Visible:=False;
      DBG_Result.Align:=alClient;
      DBG_Result.Visible:=True;
    end;
    ssFHZMX://总分户帐明细
    begin
      RGr_base.ItemIndex := 1;
      DBG_Result.Visible:=False;
      DBG_Detail.Align:=alClient;
      DBG_Detail.Visible:=True;
    end;
  end;
end;

procedure TfrmY_ZFHZCX.SED_YearChange(Sender: TObject);
begin
  inherited;
  CurYear:=SED_Year.Value;
  CMB_End.ItemIndex := CurMonth -1;
end;

procedure TfrmY_ZFHZCX.Search;
begin
  With Qry_Search do
  begin
    Close;
    Params.ParamByName('DWDM').AsString:=PGXDW(cBo_GXDW.Items.Objects[cBo_GXDW.ItemIndex])^.DWDM;
    Params.ParamByName('RQFrom').Asstring:=SED_Year.Text + cmb_From.Text;
    Params.ParamByName('RQEnd').Asstring:=Sed_Year.Text + cmb_End.Text;
    Open;
  end;
  With Qry_Detail do
  begin
    Close;
    Params.ParamByName('DWDM').AsString:=PGXDW(cBo_GXDW.Items.Objects[cBo_GXDW.ItemIndex])^.DWDM;
    Params.ParamByName('RQFrom').Asstring:=SED_Year.Text + cmb_From.Text;

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -