From c7a02def1c4e84bf99472137244adab7dfe1e867 Mon Sep 17 00:00:00 2001 From: "DESKTOP-E401PHE\\Administrator" Date: Thu, 26 Feb 2026 15:36:49 +0800 Subject: [PATCH] fugong --- 纱线仓库/U_ShaOutList.dfm | 6 +- 纱线仓库/U_ShaOutList.pas | 144 ++++++++++++++++++++++++++++++++------ 纱线仓库/U_ShaRKList.dfm | 8 +-- 3 files changed, 129 insertions(+), 29 deletions(-) diff --git a/纱线仓库/U_ShaOutList.dfm b/纱线仓库/U_ShaOutList.dfm index f08755c..479e283 100644 --- a/纱线仓库/U_ShaOutList.dfm +++ b/纱线仓库/U_ShaOutList.dfm @@ -1,6 +1,6 @@ object frmShaOutList: TfrmShaOutList - Left = 245 - Top = 178 + Left = 219 + Top = 147 Width = 1356 Height = 884 Caption = #32433#32447#20986#24211#21015#34920 @@ -649,7 +649,7 @@ object frmShaOutList: TfrmShaOutList end object RMDBMain: TRMDBDataSet Visible = True - DataSet = CDS_Main + DataSet = CDS_PRT Left = 424 Top = 232 end diff --git a/纱线仓库/U_ShaOutList.pas b/纱线仓库/U_ShaOutList.pas index 9d4140f..536229a 100644 --- a/纱线仓库/U_ShaOutList.pas +++ b/纱线仓库/U_ShaOutList.pas @@ -213,6 +213,7 @@ end; procedure TfrmShaOutList.TBCloseClick(Sender: TObject); begin WriteCxGrid('É´Ïß³ö¿âÁбí121', Tv1, 'É´Ïß²Ö¿â'); + //ReadCxGrid('É´Ïß³ö¿âÁбí121', Tv1, 'É´Ïß²Ö¿â'); Close; end; @@ -231,7 +232,7 @@ begin TBEdit.Visible := False; cxTabControl1.Visible := False; end; - //ReadCxGrid('É´Ïß³ö¿âÁбí121', Tv1, 'É´Ïß²Ö¿â'); + ReadCxGrid('É´Ïß³ö¿âÁбí121', Tv1, 'É´Ïß²Ö¿â'); if Trim(FFY_ID) <> '' then begin TBAdd.Visible := False; @@ -661,6 +662,101 @@ end; // end; //end; +//procedure TfrmShaOutList.ToolButton1Click(Sender: TObject); +//var +// fPrintFile, Txt, fImagePath, YIDSql: string; +// Moudle: THandle; +// Makebar: TMakebar; +// Mixtext: TMixtext; +// SelectedCount: Integer; +//begin +// if CDS_Main.IsEmpty then +// Exit; +// +// if CDS_Main.Locate('SSel', True, []) = False then +// begin +// Application.MessageBox('ûÓÐÑ¡ÔñÊý¾Ý!', 'Ìáʾ', 0); +// Exit; +// end; +// +// SelectedCount := 0; +// YIDSql := ''; +// CDS_Main.DisableControls; +// +// try +// with CDS_Main do +// begin +// First; +// //while Locate('SSel', True, [loCaseInsensitive]) do +// while Locate('SSel', True, []) do +// begin +// // ¹¹½¨Y_IDµÄINÌõ¼þ +// if YIDSql <> '' then +// YIDSql := YIDSql + ',' + QuotedStr(Trim(FieldByName('Y_ID').AsString)) +// else +// YIDSql := QuotedStr(Trim(FieldByName('Y_ID').AsString)); +// +// Inc(SelectedCount); +// +// Edit; +// FieldByName('SSel').Value := False; +// Post; +// end; +// end; +// finally +// CDS_Main.EnableControls; +// end; +// +// if YIDSql = '' then +// begin +// Application.MessageBox('δѡÔñÈκÎÊý¾Ý!', 'Ìáʾ', 0); +// Exit; +// end; +// +// with ADOQueryCmd do +// begin +// Close; +// SQL.Clear; +// +// sql.Add(' select A.* '); +// sql.Add(' from CK_Yarn_CR A'); +// sql.Add(' where isnull(CKName,'''')=''É´Ïß'''); +// SQL.Add(' and CRFlag=''³ö¿â'''); +// +// // Ìí¼ÓÈÕÆÚ·¶Î§Ìõ¼þ£¨¸ù¾ÝÄúµÄÐèÇó¿ÉÑ¡£© +// // sql.Add(' and A.CRTime>=''' + FormatDateTime('yyyy-MM-dd', begdate.Date) + ''''); +// // sql.Add(' and A.CRTime<''' + FormatDateTime('yyyy-MM-dd', enddate.Date + 1) + ''''); +// +// // Ìí¼Ó¹´Ñ¡Êý¾ÝÌõ¼þ +// SQL.Add(' and A.Y_ID in (' + YIDSql + ')'); +// +// SQL.Add(' order by CRTime desc'); +// Open; +// end; +// +// if ADOQueryCmd.IsEmpty then +// begin +// Application.MessageBox('δÕÒµ½¶ÔÓ¦µÄÉ´Ïß³ö¿âÊý¾Ý£¡', 'ÌáʾÐÅÏ¢', MB_ICONINFORMATION); +// Exit; +// end; +// +// SCreateCDS20(ADOQueryCmd, CDS_PRT); // ʹÓÃCDS_PRT¶ø²»ÊÇCDS_Main +// SInitCDSData20(ADOQueryCmd, CDS_PRT); +// +// fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\É´Ïß³ö¿â±¨±í.rmf'; +// ExportFtErpFile('É´Ïß³ö¿â±¨±í.rmf', ADOQueryTemp); +// +// if FileExists(fPrintFile) then +// begin +// RM1.LoadFromFile(fPrintFile); +// RM1.ShowReport; +// end +// else +// begin +// Application.MessageBox(PChar('δÕÒµ½±¨±íÎļþ£º' + #13#10 + fPrintFile), 'Ìáʾ', MB_ICONWARNING); +// end; +//end; + procedure TfrmShaOutList.ToolButton1Click(Sender: TObject); var fPrintFile, Txt, fImagePath, YIDSql: string; @@ -686,31 +782,36 @@ begin with CDS_Main do begin First; - while Locate('SSel', True, [loCaseInsensitive]) do + while not Eof do begin - // ¹¹½¨Y_IDµÄINÌõ¼þ - if YIDSql <> '' then - YIDSql := YIDSql + ',' + QuotedStr(Trim(FieldByName('Y_ID').AsString)) - else - YIDSql := QuotedStr(Trim(FieldByName('Y_ID').AsString)); - - Inc(SelectedCount); - - Edit; - FieldByName('SSel').Value := False; - Post; + if FieldByName('SSel').AsBoolean then + begin + if YIDSql <> '' then + YIDSql := YIDSql + ',' + QuotedStr(Trim(FieldByName('Y_ID').AsString)) + else + YIDSql := QuotedStr(Trim(FieldByName('Y_ID').AsString)); + + Inc(SelectedCount); + end; + Next; end; end; finally CDS_Main.EnableControls; end; - + if YIDSql = '' then begin Application.MessageBox('δѡÔñÈκÎÊý¾Ý!', 'Ìáʾ', 0); Exit; end; + if SelectedCount = 0 then + begin + Application.MessageBox('δѡÔñÈκÎÊý¾Ý!', 'Ìáʾ', 0); + Exit; + end; + with ADOQueryCmd do begin Close; @@ -720,15 +821,11 @@ begin sql.Add(' from CK_Yarn_CR A'); sql.Add(' where isnull(CKName,'''')=''É´Ïß'''); SQL.Add(' and CRFlag=''³ö¿â'''); - - // Ìí¼ÓÈÕÆÚ·¶Î§Ìõ¼þ£¨¸ù¾ÝÄúµÄÐèÇó¿ÉÑ¡£© - // sql.Add(' and A.CRTime>=''' + FormatDateTime('yyyy-MM-dd', begdate.Date) + ''''); - // sql.Add(' and A.CRTime<''' + FormatDateTime('yyyy-MM-dd', enddate.Date + 1) + ''''); - - // Ìí¼Ó¹´Ñ¡Êý¾ÝÌõ¼þ + SQL.Add(' and A.Y_ID in (' + YIDSql + ')'); SQL.Add(' order by CRTime desc'); + //ShowMessage(sql.text); Open; end; @@ -738,21 +835,24 @@ begin Exit; end; - SCreateCDS20(ADOQueryCmd, CDS_PRT); // ʹÓÃCDS_PRT¶ø²»ÊÇCDS_Main + SCreateCDS20(ADOQueryCmd, CDS_PRT); SInitCDSData20(ADOQueryCmd, CDS_PRT); fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\É´Ïß³ö¿â±¨±í.rmf'; - ExportFtErpFile('É´Ïß³ö¿â±¨±í.rmf', ADOQueryTemp); + if FileExists(fPrintFile) then begin RM1.LoadFromFile(fPrintFile); + + RM1.ShowReport; end else begin Application.MessageBox(PChar('δÕÒµ½±¨±íÎļþ£º' + #13#10 + fPrintFile), 'Ìáʾ', MB_ICONWARNING); end; + InitGrid(); end; diff --git a/纱线仓库/U_ShaRKList.dfm b/纱线仓库/U_ShaRKList.dfm index 35ca3ed..66b0054 100644 --- a/纱线仓库/U_ShaRKList.dfm +++ b/纱线仓库/U_ShaRKList.dfm @@ -1,8 +1,8 @@ object frmShaRKList: TfrmShaRKList - Left = 646 - Top = 283 + Left = 429 + Top = 403 Width = 1396 - Height = 649 + Height = 668 Caption = #32433#32447#20837#24211#21015#34920 Color = clBtnFace Font.Charset = GB2312_CHARSET @@ -308,7 +308,7 @@ object frmShaRKList: TfrmShaRKList Left = 0 Top = 125 Width = 1380 - Height = 485 + Height = 504 Align = alClient TabOrder = 2 object Tv1: TcxGridDBTableView