📄 mrp_qry_analyzermo4_f.pas
字号:
unit Mrp_Qry_AnalyzerMo4_F;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Condition, Db, AdODB, StdCtrls, Mask;
Type
TFrm_Mrp_Qry_AnalyzerMo4_F = Class(TFrm_Base_Condition)
Label1: TLabel;
Label2: TLabel;
Label3: TLabel;
Label4: TLabel;
Label5: TLabel;
Label6: TLabel;
Edit1: TEdit;
Edit2: TEdit;
Edit3: TEdit;
Edit4: TEdit;
MaskEdit1: TMaskEdit;
MaskEdit2: TMaskEdit;
procedure btn_okClick(Sender: TObject);
procedure FormDestroy(Sender: TObject);
procedure FormShow(Sender: TObject);
private
{ Private declarations }
public
{ Public declarations }
end;
var
Frm_Mrp_Qry_AnalyzerMo4_F: TFrm_Mrp_Qry_AnalyzerMo4_F;
implementation
uses Mrp_Qry_AnalyzerMo4;
{$R *.DFM}
procedure TFrm_Mrp_Qry_AnalyzerMo4_F.btn_okClick(Sender: TObject);
var StrCondition:String;
StrSQLText:String;
begin
{ inherited;}
StrCondition:=' And ';
If (Trim(Edit1.Text)<>'') and (Trim(Edit2.Text)<>'')Then
StrCondition:=StrCondition+' Item.Pla_EmployeeCode Between '+Quotedstr(Edit1.Text)+' and '+Quotedstr(Edit2.Text)+' And ';
If (Trim(Edit3.Text)<>'') and (Trim(Edit4.Text)<>'') Then
StrCondition:=StrCondition+' MoLine.ItemCode Between '+Quotedstr(Edit3.text)+' and '+Quotedstr(Edit4.Text)+' And ';
If (Maskedit1.Text<>' . . ') and (Maskedit2.Text<>' . . ')Then
StrCondition:=StrCondition+' Mo.MoDate Between '+quotedstr(Maskedit1.text)+' and '+quotedstr(Maskedit2.Text)+' And ';
with Frm_Mrp_Qry_AnalyzerMo4.AdoQry_Main do
begin
Close;
SQL.clear;
StrSQlText:='Select Mo.MoNo,mo.modate,Employee.EmployeeName, MoLine.MoLineNo,MoLine.MoLinedate,Dept.DeptName,'+
' MoLine.ItemCode,(Mo.MoDate+Item.MNLDTime) As FinishDate,'+
' MoLine.MoQty,(MoLine.MoQty-MoLine.MoNoFinishQty)As FinishQty,'+
' MoLine.MoNoFinishQty,Item.ItemName,Item.Pla_EmployeeCode, MoLine.MoLineStatus'+
' Into #TmPMoLine'+
' From MoLine'+
' Join Mo On MoLine.MoNo=Mo.MoNo'+
' join Dept on mo.DeptCode=Dept.DeptCode'+
' Join Item On MoLine.ItemCode=Item.ItemCode'+
' join Employee on Item.Pla_EmployeeCode =Employee.EmployeeCode where 1=1 '+StrCondition+ ' 1=1 ';
SQl.Add(StrSQlText);
Prepared;
ExecSQL;
Close;
SQL.clear;
SQL.Add('Select Pla_EmployeeCode,EmployeeName, DeptName,ItemCode,ItemName,'+
' Sum(MoQty) As MoQty,'+
' Sum(FinishQty) As FinishQty,'+
' Sum(MoNoFinishQty) As MoNoFinishQty,'+
' convert(varchAr,Sum(FinishQty)/Sum(MoQty)*100)+''%'' as Finishrate'+
' From #TmPMoLine'+
' Group By Pla_EmployeeCode,EmployeeName, DeptName,ItemCode,ItemName');
open();
end;
with Frm_Mrp_Qry_AnalyzerMo4.AdoQry_Tmp do
begin
Connection:= Frm_Mrp_Qry_AnalyzerMo4.AdoQry_Main.Connection;
Close;
SQl.clear;
SQL.Add('Drop table #tmPMoLine');
Prepared;
ExecSQL;
end;
end;
procedure TFrm_Mrp_Qry_AnalyzerMo4_F.FormDestroy(Sender: TObject);
begin
inherited;
Frm_Mrp_Qry_AnalyzerMo4_F:=nil;
end;
procedure TFrm_Mrp_Qry_AnalyzerMo4_F.FormShow(Sender: TObject);
begin
inherited;
maskedit1.Text:=formatdatetime('yyyy.mm.dd',date-15);
maskedit2.Text:=formatdatetime('yyyy.mm.dd',date);
edit1.Text:='0';
edit2.Text:='zzzz';
edit3.Text:='0';
edit4.Text:='zzzz';
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -