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

📄 umakenotice.~pas

📁 是分布式粮库程序,是采用Delphi实现的
💻 ~PAS
📖 第 1 页 / 共 4 页
字号:

   edit11.Enabled:=true;
   kudianDBLookupComboBox.Enabled:=true;
//   changhaoDBLookupComboBox.Enabled:=true;
//   huoweidblookupcombobox.Enabled :=true;
   huowuDBLookupComboBox.Enabled:=true;
   fukuanDBLookupComboBox.Enabled:=true;
   chubeiDBLookupComboBox.Enabled:=true;
   guishuDBLookupComboBox.Enabled:=true;
   yewuDBLookupComboBox.Enabled:=true;
   edit5.Enabled:=true;

   if notelistquery.FieldByName('aaa').AsString ='入库单' then
   edit6.Enabled:=true;
//   edit7.Enabled:=true;
   memo2.Enabled:=true;

   edit11.SetFocus;
   edit11.Text:='';
   kudianDBLookupComboBox.keyvalue:=null;
   changhaoDBLookupComboBox.keyvalue:=null;
   huoweiDBLookupComboBox.KeyValue :=null;
   huowuDBLookupComboBox.keyvalue:=null;
   fukuanDBLookupComboBox.keyvalue:=null;
   chubeiDBLookupComboBox.keyvalue:=null;
   guishuDBLookupComboBox.keyvalue:=null;
   yewuDBLookupComboBox.keyvalue:=null;
   edit5.text:='';
   edit6.text:='0';
   edit7.text:='';
   memo2.text:='';

   additemflag:=1;

end;

procedure Tfmakenotice.exitBitBtnClick(Sender: TObject);
begin
  close;
end;

procedure Tfmakenotice.deleteitemBitBtnClick(Sender: TObject);
begin
   additemflag:=0;

   if notyitemlistquery.IsEmpty then
     begin
       application.MessageBox('通知细目表中没有通知细目可供删除!','删除通知细目时出错',MB_OK+MB_ICONEXCLAMATION);
       Exit;
     end;
   if MessageDlg('确实要删除这项通知细目?',mtInformation,[mbYes,mbNo],0)=mrYes then
                   begin
                       dtmdl.Database1.StartTransaction;
                       DeleteoneItemQuery.ParamByName('NotListId').AsInteger:=NotListId;
                       DeleteoneItemQuery.ParamByName('ItemlistId').asstring:=ItemlistId;
                       try
                         DeleteoneItemQuery.ExecSQL;
                       except
                         //Transaction uncompiete!
                         dtmdl.Database1.Rollback;
                         Application.MessageBox('删除通知项时出错!','系统错误',MB_OK+MB_ICONERROR);
                         Exit;
                       end;

                         //Transaction complete successfully!
                         dtmdl.Database1.Commit;
                         NotyitemlistQuery.Close;
                         NotyitemlistQuery.Open;
                   end;


end;



procedure Tfmakenotice.notyitemlistQueryAfterScroll(DataSet: TDataSet);
var sitemid:string;
begin
           NotListId:=DataSet.FieldByName('NOTY_ID').AsInteger;
           ItemlistId:=DataSet.fieldbyname('noty_item_id').AsString;
           notyitemquery.ParamByName('NotListId').AsInteger:=DataSet.FieldByName('NOTY_ID').AsInteger;
           notyitemquery.ParamByName('itemlistid').AsString:=dataset.fieldbyname('noty_item_id').AsString;
           NotyitemQuery.Close;
           NotyitemQuery.Open;

    sitemid:=notyitemquery.fieldbyname('noty_item_id').AsString;
    edit11.Text :=copy(sitemid ,pos('_',sitemid )+1,length(sitemid));

    kudiandblookupcombobox.KeyValue :=notyitemquery.fieldbyname('sitename').AsString;
    changhaodblookupcombobox.KeyValue:=notyitemquery.fieldbyname('depotname').AsString;
    huoweidblookupcombobox.KeyValue:=notyitemquery.fieldbyname('foodposition').AsString;

    huowudblookupcombobox.KeyValue:=notyitemquery.fieldbyname('food_type').AsString;
    fukuandblookupcombobox.KeyValue:=notyitemquery.fieldbyname('settlement').AsString;
    chubeidblookupcombobox.KeyValue:=notyitemquery.fieldbyname('attribute').AsString;
    guishudblookupcombobox.KeyValue:=notyitemquery.fieldbyname('attachment').AsString;
    yewudblookupcombobox.KeyValue:=notyitemquery.fieldbyname('business_type').AsString;
    edit5.Text:=notyitemquery.fieldbyname('quantity').AsString;
    edit6.Text:=notyitemquery.fieldbyname('price').AsString;
    if edit5.text='' then exit;
    if edit6.Text='' then exit
    else
     edit7.Text :=floattostr(strtofloat(edit5.Text)*strtofloat(edit6.Text));
    //    edit7.Text:=
    memo2.Text:=notyitemquery.fieldbyname('memo').AsString;
    additemflag:=0;

    changkuquery.ParamByName('unit_id').AsInteger :=unitdblookupcombobox.KeyValue ;
    changkuquery.ParamByName('site_name').AsString :=kudiandblookupcombobox.KeyValue ;
    changkuquery.Close;
    changkuquery.Open;
    huoweiquery.ParamByName('unit_id').AsInteger :=unitdblookupcombobox.KeyValue ;
    huoweiquery.ParamByName('site_name').AsString :=kudiandblookupcombobox.KeyValue ;
    huoweiquery.ParamByName('depot_name').AsString :=changhaodblookupcombobox.KeyValue ;
    huoweiquery.Close;
    huoweiquery.Open;
end;

procedure Tfmakenotice.modifyitemBitBtnClick(Sender: TObject);
begin
   newnotice:=5;
   okbitbtn.Enabled:=true;

//   edit11.Enabled  :=true;
   kudianDBLookupComboBox.Enabled:=true;
//   changhaoDBLookupComboBox.Enabled:=true;
//   huoweidblookupcombobox.Enabled :=true;
   huowuDBLookupComboBox.Enabled:=true;
   fukuanDBLookupComboBox.Enabled:=true;
   chubeiDBLookupComboBox.Enabled:=true;
   guishuDBLookupComboBox.Enabled:=true;
   yewuDBLookupComboBox.Enabled:=true;
   edit5.Enabled:=true;
   if notelistquery.FieldByName('aaa').AsString='入库单' then
   edit6.Enabled:=true;
//   edit7.Enabled:=true;
   memo2.Enabled:=true;

   huowudblookupcombobox.SetFocus;
{   edit11.Text:='';
   kudianDBLookupComboBox.keyvalue:=null;
   changhaoDBLookupComboBox.keyvalue:=null;
   huowuDBLookupComboBox.keyvalue:=null;
   fukuanDBLookupComboBox.keyvalue:=null;
   chubeiDBLookupComboBox.keyvalue:=null;
   guishuDBLookupComboBox.keyvalue:=null;
   yewuDBLookupComboBox.keyvalue:=null;
   edit5.text:='';
   edit6.text:='';
   edit7.text:='';
   memo2.text:='';
}
  if notyitemlistquery.IsEmpty then
   Begin
    edit11.Enabled:=false;
    kudianDBlookupCombobox.Enabled:=false;
    changhaoDBlookupCombobox.Enabled:=false;
    huowuDBlookupCombobox.Enabled:=false;
    fukuanDBlookupCombobox.Enabled:=false;
    chubeiDBlookupCombobox.Enabled:=false;
    guishuDBlookupCombobox.Enabled:=false;
    yewuDBlookupCombobox.Enabled:=false;
    edit5.Enabled:=false;
    edit6.Enabled:=false;
    edit7.Enabled:=false;
    memo2.Enabled:=false;
   end;
end;

procedure Tfmakenotice.cancelitemBitBtnClick(Sender: TObject);
begin
   additemflag:=0;
   if newnotice=4 then
   begin
   edit11.Text:='';
   kudianDBLookupComboBox.keyvalue:=null;
   changhaoDBLookupComboBox.keyvalue:=null;
   huoweidblookupcombobox.KeyValue :=null;
   huowuDBLookupComboBox.keyvalue:=null;
   fukuanDBLookupComboBox.keyvalue:=null;
   chubeiDBLookupComboBox.keyvalue:=null;
   guishuDBLookupComboBox.keyvalue:=null;
   yewuDBLookupComboBox.keyvalue:=null;
   edit5.text:='';
   edit6.text:='0';
   edit7.text:='';
   memo2.text:='';
   end;
   
    okbitbtn.Enabled :=false;
    edit11.Enabled:=false;
    kudianDBlookupCombobox.Enabled:=false;
    changhaoDBlookupCombobox.Enabled:=false;
    huoweidblookupcombobox.Enabled :=false;
    huowuDBlookupCombobox.Enabled:=false;
    fukuanDBlookupCombobox.Enabled:=false;
    chubeiDBlookupCombobox.Enabled:=false;
    guishuDBlookupCombobox.Enabled:=false;
    yewuDBlookupCombobox.Enabled:=false;
    edit5.Enabled:=false;
    edit6.Enabled:=false;
    edit7.Enabled:=false;
    memo2.Enabled:=false;

    notyitemlistquery.Close;
    notyitemlistquery.Open;
end;


procedure Tfmakenotice.Edit5KeyPress(Sender: TObject; var Key: Char);
begin
     if (Key<>'0') and (Key<>'1') and (Key<>'2') and (Key<>'3') and (Key<>'4')and (Key<>'.') and
        (Key<>'5') and (Key<>'6') and (Key<>'7') and (Key<>'8') and (Key<>'9') and (ord(Key)<>8)   then
       Key:=chr(0);
end;

procedure Tfmakenotice.Edit6KeyPress(Sender: TObject; var Key: Char);
begin
     if (Key<>'0') and (Key<>'1') and (Key<>'2') and (Key<>'3') and (Key<>'4')and (Key<>'.') and
        (Key<>'5') and (Key<>'6') and (Key<>'7') and (Key<>'8') and (Key<>'9') and (ord(Key)<>8)   then
       Key:=chr(0);
end;


procedure Tfmakenotice.SpeedButton2Click(Sender: TObject);
begin
    fplanid:=Tfplanid.create(self);
    fplanid.showmodal;
    fplanid.release;
end;


procedure Tfmakenotice.Edit5Change(Sender: TObject);
begin
   if edit5.text='' then exit;
   if edit6.Text='' then exit
   else
     edit7.Text :=floattostr(strtofloat(edit5.Text)*strtofloat(edit6.Text));
end;

procedure Tfmakenotice.Edit6Change(Sender: TObject);
begin
   if edit5.text='' then exit;
   if edit6.Text='' then exit
   else
     edit7.Text :=floattostr(strtofloat(edit5.Text)*strtofloat(edit6.Text));
end;

procedure Tfmakenotice.unitDBLookupComboBoxCloseUp(Sender: TObject);
begin
       if  unitdblookupcombobox.Text <>'' then
       begin
       kudianquery.ParamByName('unit_id').AsInteger :=unitdblookupcombobox.KeyValue ;
       kudianquery.Close;
       kudianquery.Open;
       kudiandblookupcombobox.Enabled :=true;
       
       changkuquery.Close;
       huoweiquery.Close;
       changhaodblookupcombobox.Enabled :=false;
       huoweidblookupcombobox.Enabled :=false;
       end;
end;

procedure Tfmakenotice.kudianDBLookupComboBoxCloseUp(Sender: TObject);
begin
       if  kudiandblookupcombobox.Text <>'' then
       begin
       changkuquery.ParamByName('unit_id').AsInteger :=unitdblookupcombobox.KeyValue ;
       changkuquery.ParamByName('site_name').AsString :=kudiandblookupcombobox.KeyValue ;
       changkuquery.Close;
       changkuquery.Open;
       changhaodblookupcombobox.Enabled :=true;

       huoweiquery.Close;
       huoweidblookupcombobox.Enabled :=false;

       end;
end;

procedure Tfmakenotice.changhaoDBLookupComboBoxCloseUp(Sender: TObject);
begin
       if  changhaodblookupcombobox.Text <>'' then
       begin
       huoweiquery.ParamByName('unit_id').AsInteger :=unitdblookupcombobox.KeyValue ;
       huoweiquery.ParamByName('site_name').AsString :=kudiandblookupcombobox.KeyValue ;
       huoweiquery.ParamByName('depot_name').AsString :=changhaodblookupcombobox.KeyValue ;
       huoweiquery.Close;
       huoweiquery.Open;
       huoweidblookupcombobox.Enabled :=true;
       end;
end;

{function checkstatus;
begin

end;
}

procedure Tfmakenotice.BitBtnallClick(Sender: TObject);
begin
    notelistquery.Close;
    notelistquery.SQL.Clear ;
    notelistquery.SQL.Add(notelistquerystr);
    
    notelistquery.SQL.Add(' order by NOTY_ID desc ');
    notelistquery.Open;
end;

procedure Tfmakenotice.BitBtnnoneClick(Sender: TObject);
begin
    notelistquery.Close;
    notelistquery.SQL.Clear ;
    notelistquery.SQL.Add(notelistquerystr);
    notelistquery.SQL.Add(' where status=0 ');
    notelistquery.SQL.Add(' order by NOTY_ID desc ');
    notelistquery.Open;
end;

procedure Tfmakenotice.BitBtnfewClick(Sender: TObject);
begin
    notelistquery.Close;
    notelistquery.SQL.Clear ;
    notelistquery.SQL.Add(notelistquerystr);
    notelistquery.SQL.Add(' where status=1 ');
    notelistquery.SQL.Add(' order by NOTY_ID desc ');
    notelistquery.Open;
end;

procedure Tfmakenotice.BitBtndoneClick(Sender: TObject);
begin
    notelistquery.Close;
    notelistquery.SQL.Clear ;
    notelistquery.SQL.Add(notelistquerystr);
    notelistquery.SQL.Add(' where status=2 ');
    notelistquery.SQL.Add(' order by NOTY_ID desc ');
    notelistquery.Open;
end;

end.

⌨️ 快捷键说明

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