jhyxxcx.pas

来自「一个仓库管理中的子系统--采购子系统」· PAS 代码 · 共 454 行 · 第 1/2 页

PAS
454
字号
unit jhyxxcx;

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Grids, DBGrids, ExtCtrls, StdCtrls, ComCtrls, Buttons,QuickRpt;

type
  TjhycxForm = class(TForm)
    BitBtn1: TBitBtn;
    PageControl1: TPageControl;
    TabSheet1: TTabSheet;
    Panel1: TPanel;
    rwmcLabel: TLabel;
    Label15: TLabel;
    Label16: TLabel;
    yxnxLabel: TLabel;
    Label18: TLabel;
    lshLabel: TLabel;
    Label20: TLabel;
    sqsjLabel: TLabel;
    bdidLabel: TLabel;
    Label23: TLabel;
    DBGrid1: TDBGrid;
    Panel2: TPanel;
    Label8: TLabel;
    Label44: TLabel;
    Label10: TLabel;
    Label11: TLabel;
    Label12: TLabel;
    Label13: TLabel;
    bzrLabel: TLabel;
    shrLabel: TLabel;
    pzrLabel: TLabel;
    xqqzrqLabel: TLabel;
    shrqLabel: TLabel;
    pzrqLabel: TLabel;
    TabSheet2: TTabSheet;
    TabSheet3: TTabSheet;
    Label5: TLabel;
    Panel5: TPanel;
    rwmcLabel2: TLabel;
    Label14: TLabel;
    Label17: TLabel;
    yxnxLabel2: TLabel;
    Label29: TLabel;
    lshLabel2: TLabel;
    Label31: TLabel;
    bzsjLabel2: TLabel;
    bdidLabel2: TLabel;
    Label34: TLabel;
    DBGrid3: TDBGrid;
    Panel6: TPanel;
    Label35: TLabel;
    Label36: TLabel;
    Label37: TLabel;
    Label38: TLabel;
    Label39: TLabel;
    Label40: TLabel;
    bzfzrLabel2: TLabel;
    shrLabel2: TLabel;
    pzrLabel2: TLabel;
    bzqzrqLabel2: TLabel;
    shrqLabel2: TLabel;
    pzrqLabel2: TLabel;
    Label2: TLabel;
    Panel3: TPanel;
    rwmcLabel1: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    yxnxLabel1: TLabel;
    Label9: TLabel;
    lshLabel1: TLabel;
    Label21: TLabel;
    bzsjLabel1: TLabel;
    bdidLabel1: TLabel;
    Label25: TLabel;
    DBGrid2: TDBGrid;
    Panel4: TPanel;
    Label26: TLabel;
    Label27: TLabel;
    Label48: TLabel;
    Label49: TLabel;
    Label50: TLabel;
    Label51: TLabel;
    bzfzrLabel1: TLabel;
    shrLabel1: TLabel;
    pzrLabel1: TLabel;
    bzqzrqLabel1: TLabel;
    shrqLabel1: TLabel;
    pzrqLabel1: TLabel;
    Label58: TLabel;
    sqdwLabel: TLabel;
    Label59: TLabel;
    xqfzrLabel: TLabel;
    Label60: TLabel;
    bzrqLabel: TLabel;
    SpeedButton1: TSpeedButton;
    procedure PageControl1Change(Sender: TObject);
    procedure FormActivate(Sender: TObject);
    procedure SpeedButton1Click(Sender: TObject);
  private
  FReport : TQuickRep;
  procedure SetReport(Value : TQuickRep);
    { Private declarations }
  public
  property Report : TQuickRep read FReport write SetReport;
    { Public declarations }
  end;

var
  jhycxForm: TjhycxForm;

implementation

uses Datamodule, sqbinput, sqbreport, ssbreport, bhgsqbreport;

{$R *.DFM}

procedure TjhycxForm.SetReport(Value : TQuickRep);
begin
  FReport:=Value;
end;

procedure TjhycxForm.PageControl1Change(Sender: TObject);
begin
   if pageControl1.activePage=Tabsheet2 then
    begin
    with dataModule1.PublicQuery1 do
    begin
    close;
    sql.Clear;
    sql.Add('select * From dbo.a_cgsszb');
    sql.Add('where sqbid='+''''+bdidlabel.caption+'''');
    prepare;
    open;
    rwmcLabel1.Caption:=FielDByName('rwmc').asstring;
    yxnxlabel1.Caption:=FieldBYname('yxnx').asstring;
    lshLabel1.Caption:=FieldByName('lsh').asstring;
    bdidLabel1.Caption:=FieldByName('sqbid').asstring;
    bzsjlabel1.Caption:=sqinputForm.ShowMeDate(FieldByname('bzsj').asstring);
    bzfzrLabel1.Caption:=FieldByname('bzfzr').asstring;
    shrlabel1.Caption:=FieldByname('shr').asstring;
    pzrlabel1.Caption:=FieldByname('pzr').asstring;
    bzqzrqLabel1.Caption:=sqinputForm.ShowMeDate(FieldByName('bzqzrq').asstring);
    shrqLabel1.Caption:=sqinputForm.ShowMeDate(FieldByName('shrq').asstring);
    pzrqLabel1.Caption:=sqinputForm.ShowMeDate(FieldByName('pzrq').asstring);
    close;
    end;
    end;
    if pageControl1.activePage=Tabsheet3 then
    begin
    with dataModule1.PublicQuery1 do
    begin
    close;
    sql.Clear;
    sql.Add('select * From dbo.a_cgsszb');
    sql.Add('where sqbid='+''''+bdidlabel.caption+'''');
    prepare;
    open;
    rwmcLabel2.Caption:=FielDByName('rwmc').asstring;
    yxnxlabel2.Caption:=FieldBYname('yxnx').asstring;
    lshLabel2.Caption:=FieldByName('lsh').asstring;
    bdidLabel2.Caption:=FieldByName('sqbid').asstring;
    bzsjlabel2.Caption:=sqinputForm.ShowMeDate(FieldByname('bzsj').asstring);
    bzfzrLabel2.Caption:=FieldByname('bzfzr').asstring;
    shrlabel2.Caption:=FieldByname('shr').asstring;
    pzrlabel2.Caption:=FieldByname('pzr').asstring;
    bzqzrqLabel2.Caption:=sqinputForm.ShowMeDate(FieldByName('bzqzrq').asstring);
    shrqLabel2.Caption:=sqinputForm.ShowMeDate(FieldByName('shrq').asstring);
    pzrqLabel2.Caption:=sqinputForm.ShowMeDate(FieldByName('pzrq').asstring);
    close;
    end;
    end;
end;

procedure TjhycxForm.FormActivate(Sender: TObject);
begin
    pageControl1.ActivePage:=Tabsheet1;
    with datamodule1.sqxbQuery do
    begin
    close;
    sql.Clear;
    sql.Add('select jhy as 计划员,cpbh as 产品编号,cpmc as 产品名称,xhgg as 型号规格,jldw as 计量单位,sbsl as 申请数量,sccj as 生产厂家,gjje as 估计金额,yyhrw as 用于何任务,sjyq as 时间要求,bz as 备注 from dbo.a_cgsqxb');
    sql.Add('where sqbid='+''''+bdidLabel.caption+'''');
    prepare;
    open;
    end;
    with Datamodule1.ssbxbQuery do
    begin
    close;
    sql.Clear;
    sql.Add('select cpbh as 产品编号,cpmc as 产品名称,xhgg as 型号规格,jhy as 计划员,');
    sql.Add('jldw as 计量单位,sbsl as 申报数量,sbrq as 申报日期,kcsl as 库存数量,');
    sql.Add('xcgsl as 需采购数量,ycdhsj as 预测到货时间,xqdw as 需求单位,cgslhs as 采购数量核实,bz as 备注');
    sql.add('From dbo.a_cgssxb');
    sql.Add('where sqbid='+''''+bdidLabel.caption+'''');
    prepare;
    open;
    end;
    with datamodule1.PublicQuery1 do
    begin
    close;
    sql.Clear;
    sql.Add('select * from dbo.a_cghzglb');
    sql.Add('where sqbid='+''''+bdidLabel.caption+''''+' and hg_flag='+''''+'0'+'''');
    prepare;
    open;
    if recordCount=0 then
    begin
    close;
    label2.Visible:=True;
    dbGrid3.Visible:=false;
    exit;
    end
    else
    begin
    with datamodule1.bhgsqbquery do
    begin
    sql.Clear;
    sql.Add('select dbo.a_cgsqxb.cpbh as 产品编号,dbo.a_cgsqxb.cpmc as 产品名称,dbo.a_cgsqxb.xhgg as 型号规格,dbo.a_cgsqxb.jldw as 计量单位,');
    sql.Add('dbo.a_cgsqxb.sbsl as 申请数量,dbo.a_cgsqxb.sccj as 生产厂家,dbo.a_cgsqxb.gjje as 估计金额,dbo.a_cgsqxb.yyhrw as 用于何任务,dbo.a_cgsqxb.sjyq as 时间要求,dbo.a_bhgsqxb.ly as 理由');
    sql.Add(' from dbo.a_cgsqxb,dbo.a_bhgsqxb where dbo.a_cgsqxb.sqbid=dbo.a_bhgsqxb.sqbid and dbo.a_cgsqxb.cpbh=dbo.a_bhgsqxb.cpbh and dbo.a_bhgsqxb.sqbid='+''''+bdidLabel.caption+'''');
    prepare;
    open;
    end;

⌨️ 快捷键说明

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