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

📄 qc_checkresultqry.pas

📁 一个MRPII系统源代码版本
💻 PAS
字号:

unit Qc_CheckResultQry;

Interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Base_Qry, Menus, ExtPrintReport, Db, ActnList, AdODB, Grids, DBGridEh,
  StdCtrls, ExtCtrls, ComCtrls, ToolWin, DBCtrls;

Type
  TFrm_Qc_CheckResultQry = Class(TFrm_Base_Qry)
    Label1: TLabel;
    DBText1: TDBText;
    Label2: TLabel;
    DBText2: TDBText;
    AdoQry_MainItemCode: TStringField;
    AdoQry_MainItemName: TStringField;
    AdoQry_MainUomName: TStringField;
    AdoQry_MainItemflag: TStringField;
    AdoQry_MainonCheckBillNo: TStringField;
    AdoQry_Mainoncheckdate: TDateTimeField;
    AdoQry_MainPoNo: TStringField;
    AdoQry_MainPoLineNo: TIntegerField;
    AdoQry_MaInvendorflag: TStringField;
    AdoQry_MainoncheckQty: TFloatField;
    AdoQry_MainEmployee: TStringField;
    AdoQry_Mainoncheckstatus: TStringField;
    AdoQry_MainReceivedQty: TFloatField;
    AdoQry_MaInBillTypeCode: TStringField;
    AdoQry_MainExplain: TStringField;
    AdoQry_MainQcBatchNo: TStringField;
    AdoQry_MainQcLevel: TStringField;
    AdoQry_MainQcReMArk: TStringField;
    AdoQry_MainQcEmployeeCode: TStringField;
    AdoQry_MainQcstatus: TIntegerField;
  private
    { Private declarations }
  public
    showFlag:Boolean;
    procedure InitForm(AdOConnection:TAdOConnection;ShowExtendColumn:Boolean);Override;
    { Public declarations }
  end;

var
  Frm_Qc_CheckResultQry: TFrm_Qc_CheckResultQry;

implementation

uses Qc_CheckResultQry_C, Sys_Global;
{$R *.DFM}

procedure TFrm_Qc_CheckResultQry.InitForm(AdOConnection:TAdOConnection;ShowExtendColumn:Boolean);

begin
  inherited;
  ShowFlag:=Not ShowExtendColumn;
  SelectFromSQL:='Select OnCheckBillLine.ItemCode,Item.ItemName,'
                 +'      OnCheckBillLine.ItemCode+''  ''+Item.ItemName as Itemflag,Uom.UomName, '
                 +'      OnCheckBill.onCheckBillNo,OnCheckBill.oncheckdate,'
                 +'      OnCheckBillLine.oncheckQty,   '
                 +'      OnCheckBill.BillTypeCode,      '
                 +'      OnCheckBill.pono,'
                 +'      OnCheckBillLine.QcBatchNo,'
                 +'      onCheckBillLine.QcEmployeeCode+'' ''+E2.EmployeeName QcEmployeeCode,'
                 +'      OnCheckBillLine.QcLevel,'
                 +'      OnCheckBillLine.PolineNo,'
                 +'      OnCheckBill.VendorCode+'' ''+Vendor.VendorName as Vendorflag,'
                 +'      OnCheckBill.EmployeeCode+'' ''+Employee.EmployeeName as Employee,'
                 +'      OnCheckBillLine.OnCheckRemArk as Explain,'
                 +'      OnCheckBillLine.QcReMArk,'
                 +'      case when OnCheckBillLine.oncheckstatus=''0'' then ''打开''  '
                 +'           when OnCheckBillLine.oncheckstatus=''1'' then ''关闭'' '
                 +'      end  oncheckstatus, '
                 +'      OnCheckBillLine.ReceivedQty, '
{                 +'      case when  OnCheckBillLine.Qcstatus=1 then  ''1 正常'' '
                 +'           when  OnCheckBillLine.Qcstatus=0 then  ''0 未处理 '' '
                 +'           when  OnCheckBillLine.Qcstatus=2 then  ''2 拒收'' '
                 +'           when  OnCheckBillLine.Qcstatus=3 then  ''3 让步'' '
                 +'           when  OnCheckBillLine.Qcstatus=4 then  ''4 挑选'' '
                 +'           when  OnCheckBillLine.Qcstatus=5 then  ''5 试用'' '
                 +'           when  OnCheckBillLine.Qcstatus=6 then  ''6 特采'' '
                 +'      end  Qcstatus '}
                 +'      OnCheckBillLine.Qcstatus '
                 +'      From OnCheckBillLine   '
                 +'      JOIN oncheckBill  on OnCheckBillLine.OnCheckBillId=OnCheckBill.OnCheckBillId '
                 +'      JOIN Item ON OnCheckBillLine.ItemCode=Item.ItemCode  '
                 +'      Left JOIN Employee on OnCheckBill.EmployeeCode=Employee.EmployeeCode'
                 +'      JOIN Uom  on Item.UomCode=Uom.UomCode   '
                 +'      Left Join Employee E2 on OncheckBillLine.QcEmployeeCode=E2.EmployeeCode '
                 +'      join Vendor on Vendor.VendorCode=oncheckBill.VendorCode';

  OrderByFields:='OnCheckDate,ItemCode';
  Frm_Sys_Condition:=TFrm_Qc_CheckResultQry_C.Create(Application);
  Act_Filter.Execute ;
  if not ShowExtendColumn then
  begin
    DBGridEh.Columns.Delete(17);
    DBGridEh.Columns.Delete(14);
    DBGridEh.Columns.Delete(13);
    DBGridEh.Columns.Delete(11);
    DBGridEh.Columns.Delete(10);
    DBGridEh.Columns.Delete(9);
    DBGridEh.Columns.Delete(8);
    DBGridEh.Columns.Delete(3);    
    Pnl_Title.Caption:='未处理待检单据列表查询';
    Frm_Qc_CheckResultQry.Caption:='未处理待检单据列表查询';
    DBGridEh.Columns[0].Width:=160;
    DBGridEh.Columns[1].Width:=240;
    DBGridEh.Columns[3].Width:=64;
    DBGridEh.refresh;
  end
  else
  begin
    Pnl_Title.Caption:='待检物料质检结果查询';
    Frm_Qc_CheckResultQry.Caption:='待检物料质检结果查询';
    DBGridEh.Columns[0].Width:=112;
    DBGridEh.Columns[1].Width:=184;
    dBGridEh.Columns[3].Width:=64;
    DBGridEh.refresh;
  end;
end;


end.

⌨️ 快捷键说明

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