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

📄 fhd_cx_search.pas

📁 省级集邮品管理ERP
💻 PAS
字号:

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

interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  FormBase, StdCtrls, Buttons, Mask, ToolEdit, ExtCtrls, FieldComboBox, 
  CurrEdit, RXDBCtrl, SQLStrings,Pub;

type
  TFrm_FHD_CX_Search = class(TFFormBase)
    Label1: TLabel;
    cmbCkxz: TFieldComboBox;
    cmbQXDW: TFieldComboBox;
    rdZTZT: TRadioGroup;
    Label4: TLabel;
    Label5: TLabel;
    rdFHZT: TRadioGroup;
    BitBtn1: TBitBtn;
    BitBtn2: TBitBtn;
    editFHDH: TEdit;
    Panel2: TPanel;
    Label6: TLabel;
    db1: TRxCalcEdit;
    GroupBox1: TGroupBox;
    Label7: TLabel;
    Label8: TLabel;
    d1: TDateEdit;
    d2: TDateEdit;
    Label2: TLabel;
    procedure FormCreate(Sender: TObject);
    procedure BitBtn1Click(Sender: TObject);
    procedure FormShow(Sender: TObject);
  private
    { Private declarations }
    s: string;
    io_Type: TIO_TYPE;
  public
    { Public declarations }
  end;

function Show_FHDCXTJ(var str: string; io_typ: TIO_TYPE): Boolean;
var
  Frm_FHD_CX_Search: TFrm_FHD_CX_Search;

implementation

uses datas;
{$R *.DFM}

function Show_FHDCXTJ(var str: string; io_typ: TIO_TYPE): Boolean;
begin
  if Frm_FHD_CX_Search = nil then
    Application.CreateForm(TFrm_FHD_CX_Search, Frm_FHD_CX_Search);
  with Frm_FHD_CX_Search do
  begin
    io_Type := io_typ;
    s := '';
    if io_typ = io_txp then
      GroupBox1.Visible := True
    else
      panel2.Visible := False;
    db1.Value := 0;
    result := ShowModal = MB_OK;
    str := s;
  end;
end;


procedure TFrm_FHD_CX_Search.FormCreate(Sender: TObject);
const
  CKXZSQL = 'SELECT RCKXZMC, RCKXZDM FROM TGS_JRCKXZDM WHERE TO_NUMBER(RCKXZDM) < 20';
var
  year, month, day: Word;
//  rq: TDateTime;
begin
  inherited;
  DecodeDate(GetSysDate, year, month, day);
  d1.Date := strToDate(Format('%u-%u-01', [year, month]));
  d2.Date := GetSysDate;
  initList(cmbCkxz.Items, CKXZSQL, cmbCkxz.FieldItems, True);
  if cmbCkxz.ItemIndex > 0 then cmbCkxz.ItemIndex := 0;
end;

procedure TFrm_FHD_CX_Search.BitBtn1Click(Sender: TObject);
begin
  inherited;
  s := '';
  if EditFHDH.Text <> '' then s := ' AND J.FHDH = ''' + EditFHDH.text + '''';
  if cmbCkxz.ItemIndex > 0 then
    s := s + ' AND CKXZ = ''' + cmbCkxz.FieldItems.Strings[cmbCkxz.ItemIndex] + '''';

  if cmbQXDW.ItemIndex > 0 then
    s := s + ' AND  QXDW = ''' + cmbQXDW.FieldItems.Strings[cmbQXDW.ItemIndex] + '''';

  if rdZTZT.ItemIndex > 0 then
    s := s + ' AND ZTZT = ''' + intTostr(rdZTZT.ItemIndex - 1) + '''';

//   if rdJSZT.ItemIndex > 0 then
//     s := s + ' AND JSZT = '''+ intTostr(rdJSZT.ItemIndex -1)+'''';

  if rdFHZT.ItemIndex > 0 then
    s := s + iif(rdFHZT.ItemIndex = 1, ' AND HDR is null ', ' AND not (HDR is null)');

  if db1.Value > 0 then s := s + Format(' AND Y.TPMZ = %f ', [db1.Value]);

  s := ' TO_CHAR(KDRQ, ''YYYYMMDD'') >= ''' + FormatDateTime('YYYYMMDD', d1.Date) + ''' AND TO_CHAR(KDRQ, ''YYYYMMDD'') <= ''' + FormatDateTime('YYYYMMDD', d2.Date) + '''' + s;
end;

procedure TFrm_FHD_CX_Search.FormShow(Sender: TObject);
const
  QXDWSQL = ' select DWJC DWMC,DWDM from TGS_GXDWSJB where FHDX=''1'' and %s=''1'' order by PXM';
begin
  inherited;
  case IO_TYPE of
    io_txp:
      InitList(cmbQXDW.items, format(QXDWSQL, ['TXYW']), cmbQXDW.FieldItems, True);
  else
    InitList(cmbQXDW.items, format(QXDWSQL, ['JYYW']), cmbQXDW.FieldItems, True);

  end;
  if cmbQXDW.ItemIndex > 0 then cmbQXDW.ItemIndex := 0;

end;

end.

⌨️ 快捷键说明

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