U_djdw.pas
上传用户:psxgmh
上传日期:2013-04-08
资源大小:15112k
文件大小:7k
- unit U_djdw;
- interface
- uses
- Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
- ExtCtrls, ComCtrls, StdCtrls, Mask, Buttons, Db, DBClient, Grids, DBGrids,
- DBCtrls;
- type
- TfrmDjdw = class(TForm)
- StatusBar1: TStatusBar;
- DataSource1: TDataSource;
- DataSource2: TDataSource;
- PageControl1: TPageControl;
- TabSheet1: TTabSheet;
- TabSheet2: TTabSheet;
- Panel1: TPanel;
- Label2: TLabel;
- Label3: TLabel;
- Label1: TLabel;
- Label6: TLabel;
- SpeedButton3: TSpeedButton;
- Label4: TLabel;
- ComboBox2: TComboBox;
- MaskEdit1: TMaskEdit;
- MaskEdit3: TMaskEdit;
- MaskEdit4: TMaskEdit;
- MaskEdit2: TMaskEdit;
- Panel2: TPanel;
- Panel3: TPanel;
- DBGrid2: TDBGrid;
- Splitter1: TSplitter;
- Panel4: TPanel;
- Label5: TLabel;
- SpeedButton1: TSpeedButton;
- SpeedButton2: TSpeedButton;
- Edit1: TEdit;
- DBGrid1: TDBGrid;
- DataSource4: TDataSource;
- DataSource5: TDataSource;
- Panel5: TPanel;
- Label7: TLabel;
- Label8: TLabel;
- Label9: TLabel;
- SpeedButton4: TSpeedButton;
- Label11: TLabel;
- ComboBox1: TComboBox;
- MaskEdit5: TMaskEdit;
- MaskEdit6: TMaskEdit;
- MaskEdit8: TMaskEdit;
- Panel6: TPanel;
- DBGrid3: TDBGrid;
- Panel7: TPanel;
- DBGrid4: TDBGrid;
- Panel8: TPanel;
- Label12: TLabel;
- SpeedButton5: TSpeedButton;
- SpeedButton6: TSpeedButton;
- Edit2: TEdit;
- Splitter2: TSplitter;
- RadioButton1: TRadioButton;
- RadioButton2: TRadioButton;
- RadioButton3: TRadioButton;
- RadioButton4: TRadioButton;
- RadioButton5: TRadioButton;
- RadioButton6: TRadioButton;
- procedure FormShow(Sender: TObject);
- procedure DBGrid1CellClick(Column: TColumn);
- procedure SpeedButton1Click(Sender: TObject);
- procedure SpeedButton2Click(Sender: TObject);
- procedure SpeedButton3Click(Sender: TObject);
- procedure SpeedButton4Click(Sender: TObject);
- procedure SpeedButton5Click(Sender: TObject);
- procedure SpeedButton6Click(Sender: TObject);
- procedure DBGrid3CellClick(Column: TColumn);
- procedure FormClose(Sender: TObject; var Action: TCloseAction);
- private
- { Private declarations }
- public
- { Public declarations }
- end;
- var
- frmDjdw: TfrmDjdw;
- implementation
- uses U_mainform, U_djsh, WzglDB;
- {$R *.DFM}
- procedure TfrmDjdw.FormShow(Sender: TObject);
- var
- s_ckmc: string;
- begin
- DM.CDS_CKXX_INDEX.Close;
- DM.CDS_CKXX.Open;
- DM.CDS_CKXX_INDEX.Open;
- DM.CDS_CKXX_INDEX.first;
- combobox2.items.clear;
- while not DM.CDS_CKXX_INDEX.eof do
- begin
- s_ckmc := DM.CDS_CKXX_INDEX.fieldbyname('仓库名称').asstring;
- combobox2.Items.Add(s_ckmc);
- DM.CDS_CKXX_INDEX.next;
- end;
- combobox1.items := combobox2.Items;
- end;
- procedure TfrmDjdw.DBGrid1CellClick(Column: TColumn);
- begin
- edit1.text := DM.CDS_CLSLD.fieldbyname('收料字号').asstring;
- end;
- procedure TfrmDjdw.SpeedButton1Click(Sender: TObject);
- var
- s_slzh: string;
- begin
- s_slzh := DM.CDS_CLSLD.FieldByName('收料字号').asstring;
- DM.CDS_CLSLD_INDEX.IndexFieldNames := '收料字号';
- DM.CDS_CLSLD_INDEX.FindKey([s_slzh]);
- frmDjsh.PageControl1.ActivePageIndex := 0;
- close;
- end;
- procedure TfrmDjdw.SpeedButton2Click(Sender: TObject);
- begin
- frmDjsh.PageControl1.ActivePageIndex := 0;
- close;
- end;
- procedure TfrmDjdw.SpeedButton3Click(Sender: TObject);
- var
- s_filter: string;
- begin
- if radiobutton1.Checked = true then
- begin
- s_filter := 'select * from cl_cllld_main where 仓库名称 like ' + '''%' + trim(combobox2.text)
- + '%'' and 收料字号 like ' + '''%' + maskedit1.text + '%'''
- + ' and 供应厂家 like ' + '''%' + maskedit3.text + '%'''
- + ' and 合同编号 like ' + '''%' + maskedit4.text + '%'''
- + ' and 制单日期 like ' + '''%' + maskedit2.text + '%''';
- end;
- if radiobutton2.Checked = true then
- begin
- s_filter := 'select * from cl_cllld_main where 仓库名称 like ' + '''%' + trim(combobox2.text)
- + '%'' and 收料字号 like ' + '''%' + maskedit1.text + '%'''
- + ' and 供应厂家 like ' + '''%' + maskedit3.text + '%'''
- + ' and 合同编号 like ' + '''%' + maskedit4.text + '%'''
- + ' and 制单日期 like ' + '''%' + maskedit2.text + '%'''
- + ' and 是否审核=1';
- end;
- if radiobutton3.Checked = true then
- begin
- s_filter := 'select * from cl_cllld_main where 仓库名称 like ' + '''%' + trim(combobox2.text)
- + '%'' and 收料字号 like ' + '''%' + maskedit1.text + '%'''
- + ' and 供应厂家 like ' + '''%' + maskedit3.text + '%'''
- + ' and 合同编号 like ' + '''%' + maskedit4.text + '%'''
- + ' and 制单日期 like ' + '''%' + maskedit2.text + '%'''
- + ' and (是否审核=0)';
- end;
- DM.CDS_CLSLD.close;
- DM.CDS_CLSLD.CommandText := s_filter;
- DM.CDS_CLSLD.Open;
- end;
- procedure TfrmDjdw.SpeedButton4Click(Sender: TObject);
- var
- s_filter: string;
- begin
- if radiobutton4.checked = true then
- begin
- s_filter := 'select * from cl_bmlld_main where 仓库名称 like ' + '''%' + trim(combobox1.text)
- + '%'' and 领料字号 like ' + '''%' + maskedit5.text + '%'''
- + ' and 领料单位 like ' + '''%' + maskedit6.text + '%'''
- + ' and 制单日期 like ' + '''%' + maskedit8.text + '%''';
- end;
- if radiobutton5.checked = true then
- begin
- s_filter := 'select * from cl_bmlld_main where 仓库名称 like ' + '''%' + trim(combobox1.text)
- + '%'' and 领料字号 like ' + '''%' + maskedit5.text + '%'''
- + ' and 领料单位 like ' + '''%' + maskedit6.text + '%'''
- + ' and 制单日期 like ' + '''%' + maskedit8.text + '%'''
- + ' and 是否审核=1';
- end;
- if radiobutton6.checked = true then
- begin
- s_filter := 'select * from cl_bmlld_main where 仓库名称 like ' + '''%' + trim(combobox1.text)
- + '%'' and 领料字号 like ' + '''%' + maskedit5.text + '%'''
- + ' and 领料单位 like ' + '''%' + maskedit6.text + '%'''
- + ' and 制单日期 like ' + '''%' + maskedit8.text + '%'''
- + ' and (是否审核=0)';
- end;
- DM.CDS_BMLLD.close;
- DM.CDS_BMLLD.CommandText := s_filter;
- DM.CDS_BMLLD.Open;
- end;
- procedure TfrmDjdw.SpeedButton5Click(Sender: TObject);
- var
- s_llzh: string;
- begin
- s_llzh := DM.CDS_BMLLD.FieldByName('领料字号').asstring;
- DM.CDS_BMLLD.IndexFieldNames := '领料字号';
- DM.CDS_BMLLD.FindKey([s_llzh]);
- frmDjsh.PageControl1.ActivePageIndex := 1;
- close;
- end;
- procedure TfrmDjdw.SpeedButton6Click(Sender: TObject);
- begin
- frmDjsh.PageControl1.ActivePageIndex := 1;
- close;
- end;
- procedure TfrmDjdw.DBGrid3CellClick(Column: TColumn);
- begin
- edit2.text := DM.CDS_BMLLD.fieldbyname('领料字号').asstring;
- end;
- procedure TfrmDjdw.FormClose(Sender: TObject; var Action: TCloseAction);
- begin
- frmDjsh.PageControl1.ActivePageIndex := PageControl1.ActivePageIndex;
- end;
- end.