📄 sfc_mnrequest_c1.pas
字号:
unit Sfc_MnRequest_C1;
Interface
uses
Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
Base_Condition, Db, AdODB, StdCtrls, ExtEdit;
Type
TFrm_Sfc_MnRequest_C1 = Class(TFrm_Base_Condition)
Label1: TLabel;
Label3: TLabel;
cmbbx_Shift: TComboBox;
cmbbx_DeptCode: TComboBox;
cmbbx_Status: TComboBox;
Label2: TLabel;
cmbbx_PoType: TComboBox;
Label4: TLabel;
procedure btn_okClick(Sender: TObject);
procedure FormActivate(Sender: TObject);
private
{ Private declarations }
procedure initcmbbx_DeptCode(tmp_userCode:string);
public
{ Public declarations }
end;
var
Frm_Sfc_MnRequest_C1: TFrm_Sfc_MnRequest_C1;
implementation
uses Sys_Global;
{$R *.DFM}
procedure TFrm_Sfc_MnRequest_C1.initcmbbx_DeptCode(tmp_userCode:string);
var
DeptCode:string;
begin
if CmBbx_DeptCode.Items.Count=0 then
begin
AdoQry_Tmp.Close;
AdoQry_Tmp.SQL.Text:='Select DeptCode From Employee'
+' Where EmployeeCode='''+UserCode+'''';
AdoQry_Tmp.Open;
DeptCode:=AdoQry_Tmp.fieldbyname('DeptCode').AsString;
AdoQry_Tmp.Close;
AdoQry_Tmp.SQL.Text:='Select DeptCode+'' ''+DeptName As DeptCodeName'
+' From Dept'
+' Where DeptCode Like '''+DeptCode+'%''';
AdoQry_Tmp.Open;
while not AdoQry_Tmp.Eof do
begin
CmBbx_DeptCode.Items.Add(AdoQry_Tmp.fieldbyname('DeptCodeName').AsString);
AdoQry_Tmp.Next;
end;
CmBbx_DeptCode.ItemIndex:=0;
end;
end;
procedure TFrm_Sfc_MnRequest_C1.btn_okClick(Sender: TObject);
begin
inherited;
if cmbbx_Status.text='全部' then
Condition:='(m.DeptCode in ('''+getCode(cmbbx_DeptCode.text)+''','''+copy(getCode(cmbbx_DeptCode.text),1,length(getCode(cmbbx_DeptCode.text))-2)+''')) and (l.MoLineStatus=5 or l.MoLineStatus=6) '
else
begin
if cmbbx_Status.text='准备' then
Condition:='(m.DeptCode in ('''+getCode(cmbbx_DeptCode.text)+''','''+copy(getCode(cmbbx_DeptCode.text),1,length(getCode(cmbbx_DeptCode.text))-2)+''')) and (l.MoLineStatus=5 ) '
else
Condition:='(m.DeptCode in ('''+getCode(cmbbx_DeptCode.text)+''','''+copy(getCode(cmbbx_DeptCode.text),1,length(getCode(cmbbx_DeptCode.text))-2)+''')) and (l.MoLineStatus=6 ) ';
end;
ConditionHint:='领料部门:'+cmbbx_DeptCode.text+',订单状态:'+cmbbx_Status.text;
if cmbbx_PoType.Text='普通订单' then
begin
Condition:=condition+' and moSpecial=0 ';
ConditionHint:=ConditionHint+',订单类型:普通订单';
end
else
begin
if cmbbx_PoType.Text='独立订单' then
begin
Condition:=condition+' and moSpecial=1 ';
ConditionHint:=ConditionHint+',订单类型:独立订单';
end
else
begin
ConditionHint:=ConditionHint+',订单类型:全部';
end;
end;
FatherForm.SetFormParam(cmbbx_Shift.text,cmbbx_DeptCode.text,'cmbbx_Status.text','','','');
modalResult:=mrok;
end;
procedure TFrm_Sfc_MnRequest_C1.FormActivate(Sender: TObject);
begin
inherited;
InitShiftCmBx(AdoQry_tmp,cmbbx_Shift,True);
initcmbbx_DeptCode(userCode);
cmbbx_Status.ItemIndex:=0;
cmbbx_PoType.Itemindex:=0;
end;
end.
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -