📄 sfc_wipbomopen_d.pas
字号:
unit Sfc_WipBomOpen_D;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Dialog, Db, AdODB, StdCtrls, Base_Detail, ExtCtrls;
Type
TFrm_Sfc_WipBomOpen_D = Class(TFrm_Base_Detail)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
lbl_Itemfather: TLabel;
lbl_Itemson: TLabel;
edt_fatherQty: TEdit;
edt_Bomqty: TEdit;
edt_qty: TEdit;
edt_BomScrAp: TEdit;
procedure edt_BomqtyExit(Sender: TObject);
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
selfParam1,selfParam2,selfParam3:string;
public
procedure SetformParam(Param1,Param2,Param3,Param4,Param5,Param6:string);Override;
procedure InitControls; Override;
procedure SaveData; Override;
{ Public declarations }
end;
var
Frm_Sfc_WipBomOpen_D: TFrm_Sfc_WipBomOpen_D;
implementation
uses Sfc_WipBomopen,Sys_Global;
{$R *.DFM}
procedure TFrm_Sfc_WipBomOpen_D.SetformParam(Param1,Param2,Param3,Param4,Param5,Param6:string);
begin
inherited;
selfParam1:=Param1;
selfParam2:=Param2;
selfParam3:=Param3;
end;
procedure TFrm_Sfc_WipBomOpen_D.InitControls ;
begin
inherited;
lbl_Itemfather.Caption :=selfParam1;
edt_fatherqty.Text :=selfParam3;
with AdoQry_Maintain do
begin
lbl_Itemson.Caption :=fieldbyname('ItemDESC').asstring;
edt_Bomqty.Text :=fieldbyname('Bomqty').asstring;
edt_BomScrAp.Text :=fieldbyname('BomScrAp_Percent').asstring;
edt_qty.Text :=fieldbyname('sonqty').asstring;
end;
if (copy(AdoQry_Maintain.fieldbyname('ItemDESC').asstring,1,1)='+') or
(copy(AdoQry_Maintain.fieldbyname('ItemDESC').asstring,1,1)='-') then
begin
edt_Bomqty.OnExit:=nil;
edt_BomScrAp.OnExit :=nil;
edt_Bomqty.Enabled :=False;
edt_BomScrAp.Enabled :=False;
end
else
begin
edt_Bomqty.Enabled :=True;
edt_BomScrAp.Enabled :=True;
edt_Bomqty.OnExit:=edt_BomqtyExit;
edt_BomScrAp.OnExit :=edt_BomqtyExit;
end;
end;
procedure TFrm_Sfc_WipBomOpen_D.edt_BomqtyExit(Sender: TObject);
begin
inherited;
floatcheck(sender);
edt_qty.Text:=floattostr(strtofloat(edt_fatherqty.Text)*strtofloat(edt_Bomqty.text)*(1+strtofloat(edt_BomScrAp.text)/100.00));
end;
procedure TFrm_Sfc_WipBomOpen_D.FormActivate(Sender: TObject);
begin
inherited;
if edt_Bomqty.CanFocus then
edt_Bomqty.SetFocus ;
end;
procedure TFrm_Sfc_WipBomopen_D.SaveData;
begin
inherited;
with AdoQry_Maintain do
begin
fieldbyname('Bomqty').asstring:=edt_Bomqty.text;
fieldbyname('BomScrAp_Percent').AsString:=edt_BomScrAp.text;
fieldbyname('sonQty').AsString:=edt_qty.Text;
Post;
end;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -