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

📄 uhzqd5.~pas

📁 相关的销售服务管理行业的一个软件
💻 ~PAS
字号:
unit Uhzqd5;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Grids, DBGridEh, StdCtrls, ExtCtrls, Db, ADODB, PrnDbgeh, ComCtrls,
  Buttons, ToolWin;

type
  Tfrmhzqd5 = class(TForm)
    ToolBar1: TToolBar;
    SpeedButton1: TSpeedButton;
    SpeedButton2: TSpeedButton;
    ToolButton1: TToolButton;
    SpeedButton3: TSpeedButton;
    SpeedButton6: TSpeedButton;
    ToolButton2: TToolButton;
    SpeedButton5: TSpeedButton;
    DataSource1: TDataSource;
    PrintDBGridEh1: TPrintDBGridEh;
    ADOStoredProc1: TADOStoredProc;
    Panel1: TPanel;
    Label1: TLabel;
    Label2: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Edit1: TEdit;
    DBGridEh1: TDBGridEh;
    procedure SpeedButton1Click(Sender: TObject);
    procedure SpeedButton2Click(Sender: TObject);
    procedure SpeedButton3Click(Sender: TObject);
    procedure SpeedButton6Click(Sender: TObject);
    procedure SpeedButton5Click(Sender: TObject);
    procedure FormActivate(Sender: TObject);
    procedure FormClose(Sender: TObject; var Action: TCloseAction);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  frmhzqd5: Tfrmhzqd5;

implementation

uses U_DM, Ufunction, Unxck, Uset, Umain;

{$R *.DFM}

procedure Tfrmhzqd5.SpeedButton1Click(Sender: TObject);
begin
  PrintDBGridEh1.PageHeader.CenterText.clear;
  PrintDBGridEh1.PageHeader.CenterText.Add('商场调拨出库统计表');
  PrintDBGridEh1.PageHeader.CenterText.Add('');
  PrintDBGridEh1.PageHeader.CenterText.Add('');


  PrintDBGridEh1.PageHeader.LeftText.Clear;
  PrintDBGridEh1.PageHeader.LeftText.add('');
    PrintDBGridEh1.PageHeader.LeftText.add('');
  PrintDBGridEh1.PageHeader.LeftText.add(label2.caption+' '+Label3.caption+''+label4.caption);
  PrintDBGridEh1.Preview ;
end;

procedure Tfrmhzqd5.SpeedButton2Click(Sender: TObject);
begin
PrintDBGridEh1.Print ;
end;

procedure Tfrmhzqd5.SpeedButton3Click(Sender: TObject);
begin
 if frmnxcx=nil then
 frmnxcx:=Tfrmnxcx.Create(nil);
  frmnxcx.Caption :='商场调拨出库';
 if frmnxcx.ADOQuery1.active=false then
   frmnxcx.ADOQuery1.open;
 frmnxcx.DBLookupComboBox1.Visible :=true;
 frmnxcx.Label1.Visible :=true;
 frmnxcx.ShowModal ;
 if frmnxcx.ModalResult =mrok then
 begin
    if (frmhzqd5=nil) then
        frmhzqd5:=Tfrmhzqd5.Create(nil);
    frmhzqd5.Label3.Caption :=frmnxcx.DBLookupComboBox1.text;
    frmhzqd5.Label4.Caption :='时间:' +datetostr(frmnxcx.DateTimePicker1.date)+ ' 到 '+datetostr(frmnxcx.DateTimePicker2.date);
    frmhzqd5.ADOStoredProc1.close;
    frmhzqd5.ADOStoredProc1.Parameters.ParamByName('@nckcode').value:=Trim(frmnxcx.DBEdit1.Text);
    frmhzqd5.ADOStoredProc1.Parameters.ParamByName('@nDate1').value:=datetostr(frmnxcx.DateTimePicker1.date);
    frmhzqd5.ADOStoredProc1.Parameters.ParamByName('@nDate2').value:=datetostr(frmnxcx.DateTimePicker2.date);
    frmhzqd5.ADOStoredProc1.open;
    //frmhzqd.adoquery1.open;
    frmhzqd5.Show;
 end;
end;

procedure Tfrmhzqd5.SpeedButton6Click(Sender: TObject);
var i:integer;
begin
   Frmset:= TFrmset.Create(nil);
   frmset.Caption :='项目设置';
   Frmset.Tag:=1;
  //s:=Trim(frmckcon.DBEdit1.text);
   readset(Frmset.LstSet,'s_qrdetail','11','   location='''+'d'+'''  and  kc_cktag=  '+''''+'0001'+'''');
   Frmset.Label1.Caption:='显示项目';
   Frmset.ShowModal;
   //con:='   kc_cktag=  '+''''+ss+'''';
   if   (Frmset.ModalResult=mrOk) then
   begin
      reset(Frmset.LstSet,'s_qrdetail','11','   location='''+'d'+'''  and  kc_cktag=  '+''''+'0001'+'''');
      dbgrideh1.DataSource :=nil;
      Seek(DBGridEh1,'s_qrdetail', '11','Sys_Cust_view','   location='''+'d'+'''  and  kc_cktag=  '+''''+'0001'+'''');
      dbgrideh1.DataSource :=datasource1;
         for i:=0 to dbgrideh1.Columns.Count-1 do
      begin
        if  dbgrideh1.Columns.Items[i].FieldName='nFsJine' then
        begin
         // DBGridEh1.Columns.Items[i].Footer.FieldName:='nFsCount';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='nFsCount' then
        begin
         // DBGridEh1.Columns.Items[i].Footer.FieldName:='nFsCount';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus1' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus1';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus2' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus2';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus3' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus3';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus4' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus4';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus5' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus5';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus6' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus6';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
                if  dbgrideh1.Columns.Items[i].FieldName='ncus6' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus6';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus7' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus7';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus8' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus8';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus9' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus9';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus10' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus10';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus11' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus11';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus12' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus12';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus13' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus13';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus14' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus14';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus15' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus15';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
         if  dbgrideh1.Columns.Items[i].FieldName='nGoodName' then
        begin
          //DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus15';
          dbgrideh1.columns.items[i].Footer.Value:='合计';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtStaticText;

        end;
      end;
      if (dbgrideh1.sumlist.active=false) then
      dbgrideh1.SumList.Active :=true;
   end;
   Frmset.free;
end;

procedure Tfrmhzqd5.SpeedButton5Click(Sender: TObject);
begin
   close;
end;

procedure Tfrmhzqd5.FormActivate(Sender: TObject);
begin
  frmmain.Outlook1.Visible:=False;
  frmmain.Panel1.Visible:=true;
  frmmain.Panel2.Visible:=false;
end;

procedure Tfrmhzqd5.FormClose(Sender: TObject; var Action: TCloseAction);
begin
      frmhzqd5:=nil;
      action:=cafree;
      Frmmain.Outlook1.Visible :=true;
     frmmain.Panel1.Visible:=true;
     Frmmain.Panel2.Visible:=True;
end;

procedure Tfrmhzqd5.FormShow(Sender: TObject);
var
    s:string;
    I:integer;
begin
      s:=Trim(frmnxcx.DBEdit1.text);
      Seek(DBGridEh1,'s_qrdetail', '11','xs_rbd',' location='''+'d'+'''  and  kc_cktag=  '+''''+s+'''');
         for i:=0 to dbgrideh1.Columns.Count-1 do
      begin
        if  dbgrideh1.Columns.Items[i].FieldName='nFsJine' then
        begin
         // DBGridEh1.Columns.Items[i].Footer.FieldName:='nFsCount';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='nFsCount' then
        begin
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;

        if  dbgrideh1.Columns.Items[i].FieldName='ncus1' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus1';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus2' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus2';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus3' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus3';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus4' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus4';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus5' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus5';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus6' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus6';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
                if  dbgrideh1.Columns.Items[i].FieldName='ncus6' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus6';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus7' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus7';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus8' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus8';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus9' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus9';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus10' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus10';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus11' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus11';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus12' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus12';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus13' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus13';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus14' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus14';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
        if  dbgrideh1.Columns.Items[i].FieldName='ncus15' then
        begin
          DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus15';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtsum;
        end;
         if  dbgrideh1.Columns.Items[i].FieldName='nGoodName' then
        begin
          //DBGridEh1.Columns.Items[i].Footer.FieldName:='ncus15';
          dbgrideh1.columns.items[i].Footer.Value:='合计';
          dbgrideh1.columns.items[i].Footer.ValueType :=fvtStaticText;

        end;
      end;
      if (dbgrideh1.sumlist.active=false) then
      dbgrideh1.SumList.Active :=true;
end;


end.

⌨️ 快捷键说明

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