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

📄 inv_mnlistaudit_h.pas

📁 一个MRPII系统源代码版本
💻 PAS
字号:
unit Inv_MnListAudit_H;
   
Interface
                         
uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Base_Entry_Head, Menus, Db, ActnList, AdODB, Grids, DBGridEh, StdCtrls,
  ExtCtrls, ComCtrls, ToolWin, DBCtrls, jpeg, ExtPrintReport;

Type
    TFrm_Inv_MnListAudit_H = Class(TFrm_Base_Entry_Head)
    AdoQry_Headmono: TStringField;
    AdoQry_HeadMoLineno: TIntegerField;
    AdoQry_HeadItemCode: TStringField;
    AdoQry_HeadItemName: TStringField;
    AdoQry_Headmoqty: TFloatField;
    AdoQry_HeadmostArtworkdate: TDateTimeField;
    AdoQry_HeadMoLinedate: TDateTimeField;
    Label1: TLabel;
    DBText1: TDBText;
    AdoQry_HeadMoLinestatus: TIntegerField;
    AdoQry_HeadmoSpecial: TIntegerField;
    procedure Act_NewExecute(Sender: TObject);
    procedure AdoQry_HeadBeforeInsert(DataSet: TDataSet);
    procedure DBGridEhDblClick(Sender: TObject);
    procedure Act_ModifyExecute(Sender: TObject);
  private
    { Private declarations }
  public
    tmp_MoRequestshift:string;
    tmp_DeptCode,tmp_WhCode,tmp_WhPosition:string;
    procedure SetFormParam(FrmParam1,FrmParam2,FrmParam3,FrmParam4,FrmParam5,FrmParam6:String);Override;
    procedure InitForm(AdOConnection:TAdOConnection;ReadOnly:Boolean);Override;
    { Public declarations }
  end;

var
  Frm_Inv_MnListAudit_H: TFrm_Inv_MnListAudit_H;

implementation

uses  Inv_MnListAudit_B,Sys_Global,Inv_MnListAudit_C;

{$R *.DFM}

procedure TFrm_Inv_MnListAudit_H.InitForm(AdOConnection:TAdOConnection;ReadOnly:Boolean);
begin
  inherited;
  //设置表头SQL
  SelectFromSQL:='select distinct '+
                    'l.mono,'+
                    'l.MoLineno,'+
                    'l.ItemCode,'+
                    'i.ItemName,'+
                    'l.moqty,'+
                    'l.mostArtworkdate,'+
                    'l.MoLinedate,'+
                    'l.MoLinestatus,'+
                    'm.moSpecial'+
                  ' from MoLine l left join Item i on l.ItemCode=i.ItemCode '+
                  '               left join mo m on l.mono=m.mono '+
                  ' left join (select b.mono,b.MoLineno '+
                  '            from mnListRequest a,mnItemList b'+
                  '            where a.ItemListid=b.ItemListid) ItemList '+
                  ' on l.mono=ItemList.mono';

  //设置排序字段信息
  OrderByFields:='mono,MoLineno';
  ConditionUserDefine:='(l.BackFlush<>1 and l.MOQty<>0) and l.mArk=1 and l.MoLinestatus=6 ';

  Caption:='车间清单领料仓库核定';
  pnl_title.Caption:='车间清单领料仓库核定';
  Frm_Entry_Body:=TFrm_Inv_MnListAudit_B.Create(Self);
 // Frm_Entry_Body.forminit(AdOConnection);
  Frm_Sys_Condition:=TFrm_Inv_MnListAudit_C.Create(Application);
  Act_Filter.Execute;
end;

procedure TFrm_Inv_MnListAudit_H.Act_NewExecute(Sender: TObject);
var
  tmp_locateid:string;
begin
  if not AdoQry_Head.IsEmpty then
  begin
  if AdoQry_Head.fieldbyname('MoLinestatus').asinteger=6 then
  begin
    tmp_locateid:=AdoQry_Head.fieldbyname('mono').asstring;
    inherited;
    getdata;
    AdoQry_Head.Locate('mono',tmp_locateid,[]);
  end
  else
  begin
    DispInfo('该订单行还未下达,不能请领料',1);
    abort;
  end;
  end;
end;

procedure TFrm_Inv_MnListAudit_H.AdoQry_HeadBeforeInsert(DataSet: TDataSet);
begin
  inherited;
  abort;
end;

procedure TFrm_Inv_MnListAudit_H.SetFormParam(FrmParam1,FrmParam2,FrmParam3,FrmParam4,FrmParam5,FrmParam6:String);
begin
  inherited;
  //把参数从CONDITION窗体中传过来
  tmp_MoRequestshift:=FrmParam1;
  tmp_DeptCode:=FrmParam2+' '+frmParam4;
  tmp_WhCode:=frmParam3;
  tmp_WhPosition:=frmParam5;
end;

procedure TFrm_Inv_MnListAudit_H.DBGridEhDblClick(Sender: TObject);
begin
  inherited;
//
end;

procedure TFrm_Inv_MnListAudit_H.Act_ModifyExecute(Sender: TObject);
begin
  if(Frm_Entry_Body<>nil)and(not AdoQry_Head.IsEmpty)then
  begin
    Frm_Entry_Body.SetUserParam(Param1,'0201',Param3,Param4,Param5,Param6);
    Frm_Entry_Body.SetSysParam(UserCode,ModuleCode,MenuId,LoginDate);
    Frm_Entry_Body.InitForm(DBConnect,'Edit',AdoQry_Head);
    Frm_Entry_Body.ShowModal;
  end;
end;

end.

⌨️ 快捷键说明

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