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

📄 mrp_qry_analyzercapacity1_c_new.pas

📁 一个MRPII系统源代码版本
💻 PAS
字号:
unit Mrp_Qry_AnalyzerCapacity1_C_New;

Interface

uses
  Windows, Messages, SysUtils, Classes, Graphics, Controls, Forms, Dialogs,
  Base_Condition, Db, AdODB, StdCtrls, Mask;

Type
  TFrm_Mrp_Qry_AnalyzerCapacity1_C_New = Class(TFrm_Base_Condition)
    Label1: TLabel;
    Label3: TLabel;
    Label4: TLabel;
    Label5: TLabel;
    Label7: TLabel;
    Label8: TLabel;
    Label9: TLabel;
    Label10: TLabel;
    edtwcCodes: TEdit;
    medts: TMaskEdit;
    medte: TMaskEdit;
    edtwcCodee: TEdit;
    edtocrates: TEdit;
    edtocratee: TEdit;
    edtmonos: TEdit;
    edtmonoe: TEdit;
    procedure FormCreate(Sender: TObject);
    procedure btn_okClick(Sender: TObject);
  private
    { Private declarations }
  public
    { Public declarations }
  end;

var
  Frm_Mrp_Qry_AnalyzerCapacity1_C_New: TFrm_Mrp_Qry_AnalyzerCapacity1_C_New;

implementation
  uses  Mrp_Qry_AnalyzerCapacity1_New,Sys_Global;
{$R *.DFM}

procedure TFrm_Mrp_Qry_AnalyzerCapacity1_C_New.FormCreate(Sender: TObject);
begin
  inherited;
     medts.Text:=formatdatetime('yyyy.mm.dd',now);
     medte.Text:=formatdatetime('yyyy.mm.dd',now+30);
     edtwcCodes.Text:='0';
//     edtmonos.Text:='0';
     edtwcCodee.Text:='ZZZZZ';
     edtmonoe.Text:='ZZZZZ';
     edtocrates.Text:='-100';
     edtocratee.Text:='1000';

end;

procedure TFrm_Mrp_Qry_AnalyzerCapacity1_C_New.btn_okClick(Sender: TObject);
var sqltext:string;
begin
  inherited;
{
   sqltext:='Select    CAp.WcCode,'+
                      'cAp.mono,'+
                      'cAp.MoLineno,'+
                      'cAp.modate,'+
                      'cAp.moqty,'+
                      'cAp.mohours,'+
                      'it1.Capacityhours,'+
                      'cAp.MpsType,'+
                      'It1.ItemName As WCName,'+
                      'wcflag=cAp.wcCode+'' ''+it1.ItemName,'+
                      'Itemflag=cAp.ItemCode+'' ''+it1.ItemName,'+
                      'cAp.ItemCode,'+
                      'It1.ItemName,'+
                      'OverCapacity=cAp.mohours-it1.Capacityhours,'+
                      'OverCapacityrate=substring(cast((case it1.Capacityhours'+
                                           ' when 0 then 100'+
                                           ' else (cAp.mohours-it1.Capacityhours)*100/it1.Capacityhours'+
                                           ' end) as varchAr ),1,6)+''%'''+
              ' From Item it1(nolock) '+
              '   left join Capacity CAp(nolock) on it1.ItemCode=cAp.wcCode'+
              '   left join Capacity CAp1(nolock)  on it1.ItemCode=cAp1.ItemCode'+
             ' where  cAp.mono between '''+edtmonos.Text+''''+' and '''+edtmonoe.Text+''''+
             ' and  cAp.modate between '''+medts.Text+''''+' and '''+medte.Text+' 23:59:59'+''''+
             ' and  cAp.WCCode between '''+edtwcCodes.Text+''''+' and '''+edtwcCodee.Text+''''+
             ' and  convert(float,case it1.Capacityhours'+
                              ' when 0 then 100'+
                            ' else (cAp.mohours-it1.Capacityhours)*100/it1.Capacityhours'+
                           ' end ) between '+edtocrates.Text+' and '+edtocratee.Text+
                           '  Order by cAp.wcCode';}
  sqltext:='exec sp_Capacitygathe_New '''+medts.text+''','''+medte.text+''', ' +
           ''''+edtwcCodes.text+''','''+edtwcCodee.text+''', '+
           ''''+edtmonos.text+''','''+edtmonoe.text+''', '+
           ''''+edtocrates.text+''','''+edtocratee.text+''' ';
  with  Frm_Mrp_Qry_AnalyzerCapacity1_New.AdoQry_Main do
  begin
    Close;
    sql.clear;
    sql.Add(sqltext);
    open;
    if recordCount=0 then
    begin
      DispInfo('无符合条件的数据!',3);
      medts.SetFocus;
      exit;
    end;
  end;
  ConditionHint:='工作日期从 '+medts.Text+'到'+medte.Text+' / 工作中心代码从 '+EdtwcCodes.Text+'到'+EdtwcCodee.Text+' / 订单编号从 '+Edtmonos.Text+'到'+Edtmonoe.Text+' / 负荷率从 '+Edtocrates.Text+'%'+'到'+Edtocratee.Text+'%';
  self.ModalResult:=mrOk;
end;

end.

⌨️ 快捷键说明

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