📄 mrp_qry_analyzermo1_c.pas
字号:
unit Mrp_Qry_AnalyzerMo1_C;
//加入订单性质筛选功能
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Condition, Mask, StdCtrls, Db, AdODB;
Type
TFrm_Mrp_Qry_AnalyzerMo1_C = Class(TFrm_Base_Condition)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Label7: TLabel;
Label8: TLabel;
Label9: TLabel;
Label10: TLabel;
Label11: TLabel;
Label12: TLabel;
edtDeptCodes: TEdit;
medts: TMaskEdit;
medte: TMaskEdit;
edtDeptCodee: TEdit;
edtItemCodes: TEdit;
edtItemCodee: TEdit;
edtFinishrates: TEdit;
edtFinishratee: TEdit;
edtmonos: TEdit;
edtmonoe: TEdit;
edtlinestatuss: TEdit;
edtlinestatuse: TEdit;
Label13: TLabel;
cmbMoSpecial: TComboBox;
procedure FormCreate(Sender: TObject);
procedure btn_okClick(Sender: TObject);
procedure edtItemCodesKeyDown(Sender: TObject; var Key: Word;
Shift: TShiftState);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Frm_Mrp_Qry_AnalyzerMo1_C: TFrm_Mrp_Qry_AnalyzerMo1_C;
implementation
uses Sys_Global;
{$R *.DFM}
procedure TFrm_Mrp_Qry_AnalyzerMo1_C.FormCreate(Sender: TObject);
begin
inherited;
medts.Text:=formatdatetime('yyyy.mm.dd',now-30);
medte.Text:=formatdatetime('yyyy.mm.dd',now);
edtDeptCodes.Text:='0';
edtmonos.Text:='0';
edtItemCodes.Text:='0';
edtDeptCodee.Text:='ZZZZZ';
edtmonoe.Text:='ZZZZZ';
edtItemCodee.Text:='ZZZZZ';
edtFinishrates.Text:='0';
edtFinishratee.Text:='100';
edtlinestatuss.Text:='6';
edtlinestatuse.Text:='6';
cmbMoSpecial.ItemIndex:=0;
end;
procedure TFrm_Mrp_Qry_AnalyzerMo1_C.btn_okClick(Sender: TObject);
var linestatus1,linestatus2:string;
Special:integer;
begin
inherited;
Special:=999;
case cmbMoSpecial.Itemindex of
0: Special:=255;
1: Special:=1;
2: Special:=0;
end;
condition:='MoLine.moqty>0';
condition:=condition+' and '+' MoLine.MoLinedate between '''+medts.Text+''''+' and '''+medte.Text+'''';
condition:=condition+' and ((Mo.MoSpecial='+inttostr(Special)+') or ('+inttostr(Special)+'=''255''))';
condition:=condition+' and '+'mo.DeptCode between '''+edtDeptCodes.Text+''''+' and '''+edtDeptCodee.Text+'''';
condition:=condition+' and '+'MoLine.mono between '''+edtmonos.Text+''''+' and '''+edtmonoe.Text+'''';
condition:=condition+' and '+'MoLine.ItemCode between '''+edtItemCodes.Text+''''+' and '''+edtItemCodee.Text+'''';
condition:=condition+' and '+'MoLine.MoLinestatus between '+edtlinestatuss.Text+' and '+edtlinestatuse.Text;
condition:=condition+' and case MoLine.moqty when 0 then 0 else Convert(decimal(10,2),(MoLine.MoQty- MoLine.MoNoFinishqty)*100/MoLine.MoQty) end between '+edtFinishrates.Text+' and '+edtFinishratee.Text;
//showmessage(condition);
if edtlinestatuss.Text='5' then
linestatus1:='5 准备'
else if edtlinestatuss.Text='6' then
linestatus1:='6 下达'
else if edtlinestatuss.Text='7' then
linestatus1:='7 关闭';
if edtlinestatuse.Text='5' then
linestatus2:='5 准备'
else if edtlinestatuse.Text='6' then
linestatus2:='6 下达'
else if edtlinestatuse.Text='7' then
linestatus2:='7 关闭';
// end;
ConditionHint:='约定交货日从 '+medts.Text+' 到 '+medte.Text+' / 订单性质: '+cmbMoSpecial.Text+' / 受单部门代码从 '+EdtDeptCodes.Text+' 到 '+EdtDeptCodee.Text+' / 生产订单号从 '+Edtmonos.Text+' 到 '+Edtmonoe.Text+#13+'物料代码从 '+EdtItemCodes.Text+' 到 '+EdtItemCodee.Text+' / 行状态从 '+linestatus1+' 到 '+linestatus2+' / 完成率从 '+EdtFinishrates.Text+'%'+' 到 '+EdtFinishratee.Text+'%';
self.ModalResult:=mrOk;
end;
procedure TFrm_Mrp_Qry_AnalyzerMo1_C.edtItemCodesKeyDown(Sender: TObject;
var Key: Word; Shift: TShiftState);
begin
inherited;
If key=120 Then
CommOnHint(Sender,AdoQry_Tmp,'ItemName','物料描述','ItemCode',
'物料代码',' Item ',' PmCode In (0,3) and ItemUsable=1 ');
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -