This commit is contained in:
“ddf” 2025-01-20 13:05:39 +08:00
parent 344234cbdb
commit dfc94d2067
5 changed files with 52 additions and 19 deletions

View File

@ -641,15 +641,12 @@ inherited frmTradePlanInPut: TfrmTradePlanInPut
Properties.ActivePage = cxTabSheet2
Properties.CustomButtons.Buttons = <>
Properties.Style = 9
ExplicitTop = 392
ExplicitHeight = 453
ClientRectBottom = 443
ClientRectRight = 1722
ClientRectTop = 28
object cxTabSheet2: TcxTabSheet
Caption = ' '#20135#21697#35814#24773' '
ImageIndex = 1
ExplicitHeight = 425
object tlb2: TToolBar
Tag = 1
Left = 0
@ -744,8 +741,6 @@ inherited frmTradePlanInPut: TfrmTradePlanInPut
Align = alClient
PopupMenu = PM_1
TabOrder = 1
ExplicitLeft = 2
ExplicitTop = 28
object TV1: TcxGridDBTableView
OnMouseDown = TV1MouseDown
Navigator.Buttons.CustomButtons = <>
@ -979,7 +974,6 @@ inherited frmTradePlanInPut: TfrmTradePlanInPut
object cxTabSheet3: TcxTabSheet
Caption = ' '#21152#24037#35201#27714' '
ImageIndex = 3
ExplicitHeight = 425
object ScrollBox2: TScrollBox
Left = 0
Top = 30
@ -987,7 +981,6 @@ inherited frmTradePlanInPut: TfrmTradePlanInPut
Height = 385
Align = alClient
TabOrder = 0
ExplicitHeight = 395
object Label5: TLabel
Left = 30
Top = 62
@ -1500,14 +1493,11 @@ inherited frmTradePlanInPut: TfrmTradePlanInPut
object cxTabSheet4: TcxTabSheet
Caption = ' '#25216#26415#35201#27714' '
ImageIndex = 3
ExplicitTop = 0
ExplicitWidth = 0
ExplicitHeight = 0
object cxGrid2: TcxGrid
Left = 0
Top = 30
Width = 1722
Height = 395
Height = 385
Align = alClient
PopupMenu = PM_1
TabOrder = 0
@ -1667,7 +1657,6 @@ inherited frmTradePlanInPut: TfrmTradePlanInPut
object cxTabSheet1: TcxTabSheet
Caption = ' '#21462#26679#19982#21253#35013#35201#27714' '
ImageIndex = 2
ExplicitHeight = 425
object cxGroupBox3: TcxGroupBox
Left = 785
Top = 0
@ -1675,7 +1664,6 @@ inherited frmTradePlanInPut: TfrmTradePlanInPut
Caption = #21367#26631#31614
ParentFont = False
TabOrder = 0
ExplicitHeight = 425
Height = 415
Width = 937
object cxDBImage4: TcxDBImage
@ -1695,7 +1683,6 @@ inherited frmTradePlanInPut: TfrmTradePlanInPut
StyleHot.LookAndFeel.NativeStyle = True
TabOrder = 0
OnDblClick = cxDBImage1DblClick
ExplicitHeight = 394
Height = 384
Width = 929
end
@ -1707,7 +1694,6 @@ inherited frmTradePlanInPut: TfrmTradePlanInPut
Height = 415
Align = alLeft
TabOrder = 1
ExplicitHeight = 425
object lbl1: TLabel
Left = 29
Top = 410

View File

@ -962,7 +962,11 @@ begin
end;
EnableControls;
end;
if OrdUnit.Text = '' then
begin
Application.MessageBox('单位不能为空!', '提示', 0);
Exit;
end;
if OrdUnit.Text = '' then
begin
Application.MessageBox('单位不能为空!', '提示', 0);

View File

@ -516,6 +516,13 @@ inherited frmTradeClothTotalInInput1: TfrmTradeClothTotalInInput1
ImageIndex = 16
OnClick = ToolButton1Click
end
object btn2: TToolButton
Left = 276
Top = 0
Caption = 'btn2'
ImageIndex = 17
OnClick = btn2Click
end
end
object pnl2: TPanel
Left = 1

View File

@ -12,7 +12,7 @@ uses
cxTextEdit, StdCtrls, ExtCtrls, cxLookAndFeels, cxLookAndFeelPainters,
cxNavigator, dxDateRanges, dxBarBuiltInMenu, U_BaseInput, System.ImageList,
Vcl.ImgList, ComObj, dxScrollbarAnnotations, cxContainer, dxCore, cxDateUtils,
cxMaskEdit, cxImageList, cxCurrencyEdit, Vcl.Menus;
cxMaskEdit, cxImageList, cxCurrencyEdit, Vcl.Menus, Clipbrd;
type
TfrmTradeClothTotalInInput1 = class(TfrmBaseInput)
@ -86,6 +86,7 @@ type
btndaoru: TToolButton;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
btn2: TToolButton;
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure TBAddClick(Sender: TObject);
procedure TBCloseClick(Sender: TObject);
@ -108,6 +109,7 @@ type
procedure StkCoNamePropertiesButtonClick(Sender: TObject; AButtonIndex: Integer);
procedure btndaoruClick(Sender: TObject);
procedure N1Click(Sender: TObject);
procedure btn2Click(Sender: TObject);
private
{ Private declarations }
function SaveCKData(): Boolean;
@ -307,6 +309,40 @@ begin
end;
procedure TfrmTradeClothTotalInInput1.btn2Click(Sender: TObject);
var
RowData: TArray<string>;
rowColData: TArray<string>;
RowIndex, ColIndex, i: Integer;
clipboardText, rowStr: string;
lRect: TRect;
begin
if Clipboard.HasFormat(CF_TEXT) then
begin
clipboardText := Clipboard.AsText;
RowData := clipboardText.Split([#13#10]); // 根据换行符拆分行数据
// 遍历行数据
for RowIndex := Low(RowData) to High(RowData) do
begin
rowStr := RowData[RowIndex];
if trim(rowStr) = '' then
continue;
rowColData := rowStr.Split([#9]);
ShowMessage(rowStr);
// lRect := FGrid.Selection;
// ColIndex := 0;
// for i := lRect.Left to lRect.Right do
// begin
// if lRect.Top + RowIndex < FGrid.RowCount then
// begin
// FGrid.Cells[i, lRect.Top + RowIndex].Text := trim(rowColData[ColIndex]);
// ColIndex := ColIndex + 1;
// end;
// end;
end;
end;
end;
procedure TfrmTradeClothTotalInInput1.btndaoruClick(Sender: TObject);
var
excelApp, WorkBook: Variant;

View File

@ -195,8 +195,8 @@ begin
SqlStr := ' select A.* ,Pieceint=CEILING(A.Piece)';
SqlStr := SqlStr + ',FJFlag=CAST((CASE WHEN (SELECT COUNT(X.FileName) FROM FJ_File X where X.TFType=''贸易汇总布'' and X.WBID=A.BCIOID)>0 THEN 1 ELSE 0 END) AS BIT) ';
SqlStr := SqlStr + 'from BS_Cloth_IO A';
SqlStr := SqlStr + 'where A.IOTime>=''' + Trim(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.BegDate.Date)) + '''';
SqlStr := SqlStr + ' from BS_Cloth_IO A';
SqlStr := SqlStr + ' where A.IOTime>=''' + Trim(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.BegDate.Date)) + '''';
SqlStr := SqlStr + ' and A.IOTime<''' + Trim(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.enddate.Date + 1)) + '''';
SqlStr := SqlStr + ' and isnull(stkName,'''')=''' + Trim(FstkName) + '''';
SqlStr := SqlStr + ' and ioFlag=''出库'' ';