复制excel
This commit is contained in:
parent
913f33e99a
commit
70f4648450
|
|
@ -5,6 +5,7 @@ inherited frmEmployeeList: TfrmEmployeeList
|
|||
ClientWidth = 1523
|
||||
Font.Height = -16
|
||||
FormStyle = fsMDIChild
|
||||
Visible = True
|
||||
ExplicitWidth = 1539
|
||||
ExplicitHeight = 548
|
||||
PixelsPerInch = 96
|
||||
|
|
@ -145,10 +146,18 @@ inherited frmEmployeeList: TfrmEmployeeList
|
|||
ImageIndex = 20
|
||||
OnClick = TBExportClick
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
object ToolButton1: TToolButton
|
||||
Left = 833
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20445#23384#26684#24335
|
||||
ImageIndex = 16
|
||||
OnClick = ToolButton1Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 920
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
ImageIndex = 7
|
||||
OnClick = TBCloseClick
|
||||
|
|
|
|||
|
|
@ -82,6 +82,7 @@ type
|
|||
Tv1Column4: TcxGridDBColumn;
|
||||
Tv1Column5: TcxGridDBColumn;
|
||||
Tv1Column6: TcxGridDBColumn;
|
||||
ToolButton1: TToolButton;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
|
|
@ -107,6 +108,7 @@ type
|
|||
procedure TLZClick(Sender: TObject);
|
||||
procedure TCXLZClick(Sender: TObject);
|
||||
procedure ToolButton2Click(Sender: TObject);
|
||||
procedure ToolButton1Click(Sender: TObject);
|
||||
private
|
||||
canshu1: string;
|
||||
DQdate: TDateTime;
|
||||
|
|
@ -155,7 +157,7 @@ end;
|
|||
procedure TfrmEmployeeList.TBCloseClick(Sender: TObject);
|
||||
begin
|
||||
Close;
|
||||
WriteCxGrid('员工档案列表2', Tv1, 'OA管理');
|
||||
|
||||
end;
|
||||
|
||||
procedure TfrmEmployeeList.InitGrid();
|
||||
|
|
@ -556,6 +558,11 @@ begin
|
|||
|
||||
end;
|
||||
|
||||
procedure TfrmEmployeeList.ToolButton1Click(Sender: TObject);
|
||||
begin
|
||||
WriteCxGrid('员工档案列表2', Tv1, 'OA管理');
|
||||
end;
|
||||
|
||||
procedure TfrmEmployeeList.ToolButton2Click(Sender: TObject);
|
||||
var
|
||||
FDPID, FName: string;
|
||||
|
|
|
|||
|
|
@ -186,7 +186,6 @@ procedure TfrmPositionList.ToolButton1Click(Sender: TObject);
|
|||
begin
|
||||
if ADOQueryMain.IsEmpty then
|
||||
Exit;
|
||||
// SelExportData(Tv2, ADOQueryMain, trim(Self.Caption));
|
||||
TcxGridToExcel(self.Caption, cxgrid2);
|
||||
end;
|
||||
|
||||
|
|
@ -309,6 +308,7 @@ procedure TfrmPositionList.ToolButton6Click(Sender: TObject);
|
|||
begin
|
||||
if CDS_HZ.IsEmpty then
|
||||
Exit;
|
||||
|
||||
try
|
||||
frmPositionInPut := TfrmPositionInPut.Create(Application);
|
||||
with frmPositionInPut do
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@ inherited frmItemizedListInPut: TfrmItemizedListInPut
|
|||
List = True
|
||||
ShowCaptions = True
|
||||
TabOrder = 0
|
||||
ExplicitWidth = 938
|
||||
object TBSave: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
|
|
@ -36,16 +35,24 @@ inherited frmItemizedListInPut: TfrmItemizedListInPut
|
|||
ImageIndex = 16
|
||||
OnClick = TBSaveClick
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
object ToolButton5: TToolButton
|
||||
Left = 71
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #26412#21333#25171#21360
|
||||
ImageIndex = 21
|
||||
OnClick = ToolButton5Click
|
||||
end
|
||||
object ToolButton3: TToolButton
|
||||
Left = 174
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20445#23384#26684#24335
|
||||
ImageIndex = 16
|
||||
OnClick = ToolButton3Click
|
||||
end
|
||||
object TBClose: TToolButton
|
||||
Left = 174
|
||||
Left = 277
|
||||
Top = 0
|
||||
AutoSize = True
|
||||
Caption = #20851#38381
|
||||
|
|
@ -68,7 +75,6 @@ inherited frmItemizedListInPut: TfrmItemizedListInPut
|
|||
List = True
|
||||
ShowCaptions = True
|
||||
TabOrder = 1
|
||||
ExplicitWidth = 938
|
||||
object ToolButton1: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
|
|
@ -103,7 +109,6 @@ inherited frmItemizedListInPut: TfrmItemizedListInPut
|
|||
Align = alClient
|
||||
Caption = 'Panel2'
|
||||
TabOrder = 2
|
||||
ExplicitWidth = 938
|
||||
object Panel3: TPanel
|
||||
Left = 1
|
||||
Top = 1
|
||||
|
|
@ -112,7 +117,6 @@ inherited frmItemizedListInPut: TfrmItemizedListInPut
|
|||
Align = alClient
|
||||
Caption = 'Panel2'
|
||||
TabOrder = 0
|
||||
ExplicitWidth = 936
|
||||
object cxGrid1: TcxGrid
|
||||
Left = 1
|
||||
Top = 1
|
||||
|
|
@ -121,7 +125,6 @@ inherited frmItemizedListInPut: TfrmItemizedListInPut
|
|||
Align = alClient
|
||||
PopupMenu = PopupMenu2
|
||||
TabOrder = 0
|
||||
ExplicitWidth = 934
|
||||
object Tv1: TcxGridDBTableView
|
||||
OnDblClick = Tv1DblClick
|
||||
OnMouseDown = Tv1MouseDown
|
||||
|
|
@ -317,7 +320,6 @@ inherited frmItemizedListInPut: TfrmItemizedListInPut
|
|||
Ctl3D = False
|
||||
ParentCtl3D = False
|
||||
TabOrder = 3
|
||||
ExplicitWidth = 938
|
||||
object Label3: TLabel
|
||||
Left = 377
|
||||
Top = 11
|
||||
|
|
|
|||
|
|
@ -79,6 +79,7 @@ type
|
|||
ADO_PM: TADOQuery;
|
||||
ADO_YS: TADOQuery;
|
||||
DS_YS: TDataSource;
|
||||
ToolButton5: TToolButton;
|
||||
procedure TBCloseClick(Sender: TObject);
|
||||
procedure FormShow(Sender: TObject);
|
||||
procedure TBSaveClick(Sender: TObject);
|
||||
|
|
@ -104,6 +105,7 @@ type
|
|||
procedure Tv1Column7PropertiesEditValueChanged(Sender: TObject);
|
||||
procedure Tv1MouseDown(Sender: TObject; Button: TMouseButton; Shift: TShiftState; X, Y: Integer);
|
||||
procedure Tv1Column5PropertiesEditValueChanged(Sender: TObject);
|
||||
procedure ToolButton5Click(Sender: TObject);
|
||||
private
|
||||
FSCXDH: string;
|
||||
procedure InitData();
|
||||
|
|
@ -131,8 +133,8 @@ var
|
|||
implementation
|
||||
|
||||
uses
|
||||
U_DataLink, U_ZDYHelp, U_CustomFun, U_RTFun, U_CompanySel, U_ClothInfoSel,
|
||||
U_ItemizedListQtyInPut;
|
||||
U_DataLink, U_ZDYHelp, U_RPFun, U_CustomFun, U_RTFun, U_CompanySel,
|
||||
U_ClothInfoSel, U_ItemizedListQtyInPut;
|
||||
|
||||
|
||||
{$R *.dfm}
|
||||
|
|
@ -365,6 +367,7 @@ begin
|
|||
///////////////////// 保存子表 ///////////////////////////
|
||||
with CDS_1 do
|
||||
begin
|
||||
DisableControls;
|
||||
First;
|
||||
while not Eof do
|
||||
begin
|
||||
|
|
@ -430,23 +433,16 @@ begin
|
|||
raise Exception.Create(pchar(trim(ADOCmd.FieldByName('ShowMsg').AsString)));
|
||||
|
||||
ADOCmd.Connection.CommitTrans;
|
||||
|
||||
FTIMID := Trim(maxno);
|
||||
initGrid1(FTIMID);
|
||||
|
||||
CDS_1.EnableControls;
|
||||
Result := True;
|
||||
except
|
||||
Result := False;
|
||||
ADOCmd.Connection.RollbackTrans;
|
||||
Result := False;
|
||||
CDS_1.EnableControls;
|
||||
application.MessageBox(PChar(Exception(ExceptObject).Message), '提示信息', 0);
|
||||
|
||||
if pos('KEY 约束', Exception(ExceptObject).Message) > 0 then
|
||||
begin
|
||||
if GetLSNo(ADOCmd, Smaxno, 'JS', 'Trade_ItemizedList_Sub', 4, 1) = False then
|
||||
begin
|
||||
Application.MessageBox('重新取子流水号失败!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
end;
|
||||
|
||||
|
|
@ -497,9 +493,10 @@ end;
|
|||
procedure TfrmItemizedListInPut.ToolButton1Click(Sender: TObject);
|
||||
var
|
||||
Smaxno: string;
|
||||
MSerialNo: Double;
|
||||
begin
|
||||
|
||||
CopyAddRow(Tv1, cds_1);
|
||||
// CopyAddRow(Tv1, cds_1);
|
||||
|
||||
if GetLSNo(ADOCmd, Smaxno, 'JS', 'Trade_ItemizedList_Sub', 4, 1) = False then
|
||||
begin
|
||||
|
|
@ -509,9 +506,13 @@ begin
|
|||
|
||||
with cds_1 do
|
||||
begin
|
||||
Edit;
|
||||
FieldByName('SerialNo').Value := FieldByName('SerialNo').AsFloat + 0.1;
|
||||
MSerialNo := FieldByName('SerialNo').AsFloat + 0.1;
|
||||
Append;
|
||||
FieldByName('SerialNo').Value := MSerialNo;
|
||||
FieldByName('TISId').Value := Smaxno;
|
||||
FieldByName('Price').Value := 0;
|
||||
FieldByName('TISPiece').Value := 0;
|
||||
FieldByName('TISQty').Value := 0;
|
||||
FieldByName('TISUnit').Value := 'M';
|
||||
Post;
|
||||
end;
|
||||
|
|
@ -678,6 +679,36 @@ begin
|
|||
|
||||
end;
|
||||
|
||||
procedure TfrmItemizedListInPut.ToolButton5Click(Sender: TObject);
|
||||
var
|
||||
MFiltration: string;
|
||||
MPrintJson: string;
|
||||
begin
|
||||
if FTIMID = '' then
|
||||
Exit;
|
||||
|
||||
with ADOQueryBaseTemp do
|
||||
begin
|
||||
close;
|
||||
sql.Clear;
|
||||
sql.Add(' select Filtration= SUBSTRING(CAST((select distinct '','' +A.BCIOID from BS_Cloth_IO A ');
|
||||
sql.Add(' where A.IOFlag=''Èë¿â'' and TIMID= ' + quotedstr(Trim(FTIMID)));
|
||||
sql.Add(' for xml path('''') ) AS VARCHAR(1000)) , 2, 1000)');
|
||||
open;
|
||||
end;
|
||||
|
||||
MFiltration := Trim(ADOQueryBaseTemp.FieldByName('Filtration').AsString);
|
||||
|
||||
MPrintJson := ' {"LMType": "TradeFinishClothInPrt1" ';
|
||||
MPrintJson := MPrintJson + ' ,"PreviewPrint": true ';
|
||||
MPrintJson := MPrintJson + ' ,"PrtArgs": [ { "IsSql": false, "Filtration":" ' + MFiltration + '" }, ';
|
||||
MPrintJson := MPrintJson + ' { "IsSql": false, "Filtration":" ' + MFiltration + '" }, ';
|
||||
MPrintJson := MPrintJson + ' { "IsSql": false, "Filtration":" ' + MFiltration + '" }, ';
|
||||
MPrintJson := MPrintJson + ' { "IsSql": false, "Filtration":" ' + MFiltration + '" }, ';
|
||||
MPrintJson := MPrintJson + ' { "IsSql": false, "Filtration":" ' + MFiltration + '" } ] } ';
|
||||
FromPrintFr3(Application, PChar(DConString), PChar(MPrintJson));
|
||||
end;
|
||||
|
||||
procedure TfrmItemizedListInPut.TechnicsBtnDnClick(Sender: TObject);
|
||||
begin
|
||||
TcxButtonEdit(Sender).Text := '';
|
||||
|
|
@ -971,12 +1002,16 @@ begin
|
|||
end;
|
||||
|
||||
procedure TfrmItemizedListInPut.Tv1DblClick(Sender: TObject);
|
||||
var
|
||||
MTISId, MQtyUnit: string;
|
||||
begin
|
||||
if Trim(CDS_1.FieldByName('TISUnit').AsString) = '' then
|
||||
begin
|
||||
Application.MessageBox('单位不能为空!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
MTISId := Trim(Self.CDS_1.FieldByName('TISId').AsString);
|
||||
MQtyUnit := Trim(Self.CDS_1.FieldByName('TISUnit').AsString);
|
||||
if SaveData() then
|
||||
begin
|
||||
|
||||
|
|
@ -985,8 +1020,8 @@ begin
|
|||
with frmItemizedListQtyInPut do
|
||||
begin
|
||||
FTIMId := Self.FTIMId;
|
||||
FTISId := Trim(CDS_1.FieldByName('TISId').AsString);
|
||||
FQtyUnit := Trim(CDS_1.FieldByName('TISUnit').AsString);
|
||||
FTISId := MTISId;
|
||||
FQtyUnit := MQtyUnit;
|
||||
if ShowModal = 1 then
|
||||
begin
|
||||
Self.initGrid1(Self.FTIMID);
|
||||
|
|
|
|||
|
|
@ -3,13 +3,13 @@ inherited frmItemizedListList: TfrmItemizedListList
|
|||
Top = 13
|
||||
Caption = #29983#20135#35745#21010#21333#31649#29702
|
||||
ClientHeight = 736
|
||||
ClientWidth = 1411
|
||||
ClientWidth = 1773
|
||||
Color = clBtnFace
|
||||
Font.Height = -16
|
||||
FormStyle = fsMDIChild
|
||||
Position = poScreenCenter
|
||||
Visible = True
|
||||
ExplicitWidth = 1427
|
||||
ExplicitWidth = 1789
|
||||
ExplicitHeight = 775
|
||||
PixelsPerInch = 96
|
||||
TextHeight = 21
|
||||
|
|
@ -17,7 +17,7 @@ inherited frmItemizedListList: TfrmItemizedListList
|
|||
Tag = 1
|
||||
Left = 0
|
||||
Top = 0
|
||||
Width = 1411
|
||||
Width = 1773
|
||||
Height = 30
|
||||
AutoSize = True
|
||||
ButtonHeight = 30
|
||||
|
|
@ -27,6 +27,7 @@ inherited frmItemizedListList: TfrmItemizedListList
|
|||
List = True
|
||||
ShowCaptions = True
|
||||
TabOrder = 3
|
||||
ExplicitWidth = 1411
|
||||
object TBRafresh: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
|
|
@ -127,13 +128,14 @@ inherited frmItemizedListList: TfrmItemizedListList
|
|||
object Panel1: TPanel [1]
|
||||
Left = 0
|
||||
Top = 30
|
||||
Width = 1411
|
||||
Width = 1773
|
||||
Height = 91
|
||||
Align = alTop
|
||||
BevelInner = bvRaised
|
||||
BevelOuter = bvLowered
|
||||
ParentBackground = False
|
||||
TabOrder = 4
|
||||
ExplicitWidth = 1411
|
||||
object Label3: TLabel
|
||||
Left = 24
|
||||
Top = 51
|
||||
|
|
@ -167,7 +169,7 @@ inherited frmItemizedListList: TfrmItemizedListList
|
|||
inline frmFrameDateSel1: TfrmFrameDateSel
|
||||
Left = 2
|
||||
Top = 2
|
||||
Width = 1407
|
||||
Width = 1769
|
||||
Height = 37
|
||||
Align = alTop
|
||||
Color = clWhite
|
||||
|
|
@ -189,7 +191,7 @@ inherited frmItemizedListList: TfrmItemizedListList
|
|||
object cxTabControl1: TcxTabControl [2]
|
||||
Left = 0
|
||||
Top = 121
|
||||
Width = 1411
|
||||
Width = 1773
|
||||
Height = 31
|
||||
Align = alTop
|
||||
TabOrder = 2
|
||||
|
|
@ -201,8 +203,9 @@ inherited frmItemizedListList: TfrmItemizedListList
|
|||
' '#24050#23457#26680' '
|
||||
' '#20840#37096' ')
|
||||
OnChange = cxTabControl1Change
|
||||
ExplicitWidth = 1411
|
||||
ClientRectBottom = 31
|
||||
ClientRectRight = 1411
|
||||
ClientRectRight = 1773
|
||||
ClientRectTop = 28
|
||||
end
|
||||
inherited loadProcess: TPanel
|
||||
|
|
@ -223,10 +226,11 @@ inherited frmItemizedListList: TfrmItemizedListList
|
|||
object cxGrid1: TcxGrid [5]
|
||||
Left = 0
|
||||
Top = 152
|
||||
Width = 1411
|
||||
Width = 1773
|
||||
Height = 584
|
||||
Align = alClient
|
||||
TabOrder = 5
|
||||
ExplicitTop = 158
|
||||
object TV1: TcxGridDBTableView
|
||||
Navigator.Buttons.CustomButtons = <>
|
||||
ScrollbarAnnotations.CustomAnnotations = <>
|
||||
|
|
@ -278,6 +282,38 @@ inherited frmItemizedListList: TfrmItemizedListList
|
|||
HeaderAlignmentHorz = taCenter
|
||||
Width = 66
|
||||
end
|
||||
object TV1Column1: TcxGridDBColumn
|
||||
Caption = #30721#21333#21495
|
||||
DataBinding.FieldName = 'TIMNo'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 88
|
||||
end
|
||||
object TV1Column2: TcxGridDBColumn
|
||||
Caption = #30721#21333#31867#22411
|
||||
DataBinding.FieldName = 'TIMType'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 98
|
||||
end
|
||||
object TV1Column3: TcxGridDBColumn
|
||||
Caption = #30721#21333#26085#26399
|
||||
DataBinding.FieldName = 'TIMDate'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 106
|
||||
end
|
||||
object TV1Column4: TcxGridDBColumn
|
||||
Caption = #23545#26041#21333#20301
|
||||
DataBinding.FieldName = 'OOPCoName'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 120
|
||||
end
|
||||
object cxGridDBColumn2: TcxGridDBColumn
|
||||
Caption = #24207#21495
|
||||
DataBinding.FieldName = 'SerialNo'
|
||||
|
|
@ -331,6 +367,14 @@ inherited frmItemizedListList: TfrmItemizedListList
|
|||
Options.Editing = False
|
||||
Width = 80
|
||||
end
|
||||
object TV1Column13: TcxGridDBColumn
|
||||
Caption = #33394#21495
|
||||
DataBinding.FieldName = 'C_ColorNo'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 110
|
||||
end
|
||||
object cxGridDBColumn5: TcxGridDBColumn
|
||||
Caption = #38376#24133
|
||||
DataBinding.FieldName = 'C_Width'
|
||||
|
|
@ -385,6 +429,12 @@ inherited frmItemizedListList: TfrmItemizedListList
|
|||
Options.Editing = False
|
||||
Width = 58
|
||||
end
|
||||
object TV1Column6: TcxGridDBColumn
|
||||
Caption = #37329#39069
|
||||
DataBinding.FieldName = 'JSAmmount'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
end
|
||||
object cxGridDBColumn9: TcxGridDBColumn
|
||||
Caption = #22791#27880
|
||||
DataBinding.FieldName = 'OrdSNote'
|
||||
|
|
@ -393,33 +443,33 @@ inherited frmItemizedListList: TfrmItemizedListList
|
|||
Options.Editing = False
|
||||
Width = 157
|
||||
end
|
||||
object TV1Column1: TcxGridDBColumn
|
||||
Caption = #30721#21333#21495
|
||||
DataBinding.FieldName = 'TIMNo'
|
||||
object TV1Column9: TcxGridDBColumn
|
||||
Caption = #21019#24314#26102#38388
|
||||
DataBinding.FieldName = 'filltime'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 66
|
||||
end
|
||||
object TV1Column2: TcxGridDBColumn
|
||||
Caption = #30721#21333#31867#22411
|
||||
DataBinding.FieldName = 'TIMType'
|
||||
object TV1Column10: TcxGridDBColumn
|
||||
Caption = #23457#26680#20154
|
||||
DataBinding.FieldName = 'chker'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 66
|
||||
end
|
||||
object TV1Column3: TcxGridDBColumn
|
||||
Caption = #30721#21333#26085#26399
|
||||
DataBinding.FieldName = 'TIMDate'
|
||||
object TV1Column11: TcxGridDBColumn
|
||||
Caption = #23457#26680#26102#38388
|
||||
DataBinding.FieldName = 'Chktime'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
Width = 66
|
||||
end
|
||||
object TV1Column4: TcxGridDBColumn
|
||||
Caption = #23545#26041#21333#20301
|
||||
DataBinding.FieldName = 'OOPCoName'
|
||||
object TV1Column12: TcxGridDBColumn
|
||||
Caption = #21333#25454#29366#24577
|
||||
DataBinding.FieldName = 'status'
|
||||
DataBinding.IsNullValueType = True
|
||||
HeaderAlignmentHorz = taCenter
|
||||
Options.Editing = False
|
||||
|
|
|
|||
|
|
@ -77,6 +77,12 @@ type
|
|||
cxGridLevel1: TcxGridLevel;
|
||||
TV1Column5: TcxGridDBColumn;
|
||||
ToolButton1: TToolButton;
|
||||
TV1Column6: TcxGridDBColumn;
|
||||
TV1Column9: TcxGridDBColumn;
|
||||
TV1Column10: TcxGridDBColumn;
|
||||
TV1Column11: TcxGridDBColumn;
|
||||
TV1Column12: TcxGridDBColumn;
|
||||
TV1Column13: TcxGridDBColumn;
|
||||
procedure FormDestroy(Sender: TObject);
|
||||
procedure FormClose(Sender: TObject; var Action: TCloseAction);
|
||||
procedure FormCreate(Sender: TObject);
|
||||
|
|
@ -213,7 +219,7 @@ var
|
|||
SqlStr: string;
|
||||
begin
|
||||
|
||||
SqlStr := ' select * from Trade_ItemizedList_Main A inner join Trade_ItemizedList_Sub B on A.TIMId=B.TIMId ';
|
||||
SqlStr := ' select *,JSAmmount=Price*TISQty from Trade_ItemizedList_Main A inner join Trade_ItemizedList_Sub B on A.TIMId=B.TIMId ';
|
||||
|
||||
SqlStr := SqlStr + ' where A.TIMDate>=' + quotedstr(Trim(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.BegDate.Date)));
|
||||
SqlStr := SqlStr + ' and A.TIMDate<' + quotedstr(Trim(FormatDateTime('yyyy-MM-dd', frmFrameDateSel1.enddate.Date + 1)));
|
||||
|
|
@ -299,11 +305,11 @@ begin
|
|||
if Order_Main.IsEmpty then
|
||||
Exit;
|
||||
|
||||
if Trim(Order_Main.fieldbyname('Filler').AsString) <> Trim(DName) then
|
||||
begin
|
||||
Application.MessageBox('不能操作他人的数据!', '提示', 0);
|
||||
Exit;
|
||||
end;
|
||||
// if Trim(Order_Main.fieldbyname('Filler').AsString) <> Trim(DName) then
|
||||
// begin
|
||||
// Application.MessageBox('不能操作他人的数据!', '提示', 0);
|
||||
// Exit;
|
||||
// end;
|
||||
|
||||
try
|
||||
frmItemizedListInPut := TfrmItemizedListInPut.Create(Application);
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@ inherited frmItemizedListQtyInPut: TfrmItemizedListQtyInPut
|
|||
Align = alClient
|
||||
Caption = 'pnl1'
|
||||
TabOrder = 0
|
||||
ExplicitTop = 2
|
||||
object cxGrid1: TcxGrid
|
||||
Tag = 2
|
||||
Left = 1
|
||||
|
|
@ -30,7 +29,6 @@ inherited frmItemizedListQtyInPut: TfrmItemizedListQtyInPut
|
|||
Align = alClient
|
||||
PopupMenu = PopupMenu1
|
||||
TabOrder = 0
|
||||
ExplicitWidth = 627
|
||||
object Tv1: TcxGridDBTableView
|
||||
OnKeyDown = Tv1KeyDown
|
||||
Navigator.Buttons.CustomButtons = <>
|
||||
|
|
@ -131,8 +129,6 @@ inherited frmItemizedListQtyInPut: TfrmItemizedListQtyInPut
|
|||
ParentFont = False
|
||||
ShowCaptions = True
|
||||
TabOrder = 1
|
||||
ExplicitWidth = 627
|
||||
ExplicitHeight = 60
|
||||
object TBSave: TToolButton
|
||||
Left = 0
|
||||
Top = 0
|
||||
|
|
@ -196,7 +192,6 @@ inherited frmItemizedListQtyInPut: TfrmItemizedListQtyInPut
|
|||
Height = 41
|
||||
Align = alTop
|
||||
TabOrder = 2
|
||||
ExplicitWidth = 627
|
||||
object Label9: TLabel
|
||||
Left = 33
|
||||
Top = 7
|
||||
|
|
|
|||
|
|
@ -671,69 +671,12 @@ begin
|
|||
end;
|
||||
|
||||
procedure TfrmItemizedListQtyInPut.Tv1KeyDown(Sender: TObject; var Key: Word; Shift: TShiftState);
|
||||
var
|
||||
SelectedCount: Integer;
|
||||
ClipboardText: string;
|
||||
StringList: TStringList;
|
||||
RowData: TStringDynArray;
|
||||
i, j: Integer;
|
||||
begin
|
||||
|
||||
// 检测是否按下 Ctrl+V
|
||||
if (Key = Ord('V')) and (Shift = [ssCtrl]) then
|
||||
begin
|
||||
// ToolButton1.Click;
|
||||
|
||||
// SelectedCount := TV1.DataController.GetSelectedCount;
|
||||
// ShowMessage('选中的行数: ' + IntToStr(SelectedCount));
|
||||
|
||||
|
||||
// 检查剪贴板是否包含文本格式
|
||||
if not Clipboard.HasFormat(CF_TEXT) then
|
||||
begin
|
||||
ShowMessage('剪贴板中没有文本内容!');
|
||||
Exit;
|
||||
end;
|
||||
|
||||
// 获取剪贴板中的文本
|
||||
ClipboardText := Clipboard.AsText;
|
||||
|
||||
// 将文本按行拆分
|
||||
StringList := TStringList.Create;
|
||||
try
|
||||
StringList.Text := ClipboardText;
|
||||
|
||||
// 遍历每一行
|
||||
for i := 0 to StringList.Count - 1 do
|
||||
begin
|
||||
// 将每行按制表符(或其他分隔符)拆分为单元格数据
|
||||
RowData := Split(StringList[i], #9); // 假设使用制表符作为分隔符
|
||||
|
||||
// 遍历每一列,并将数据填充到cxGrid
|
||||
for j := 0 to Length(RowData) - 1 do
|
||||
begin
|
||||
// 假设cxGrid已经初始化,且有足够的行和列
|
||||
Tv1.Controller.FocusedRow := Tv1.Controller.SelectedRows[i];
|
||||
TV1.DataController.Values[i, j] := RowData[j];
|
||||
|
||||
// if Tv1.DataController.DataSet.State in [dsInsert, dsEdit] then
|
||||
// begin
|
||||
// Tv1.DataController.DataSet.FieldByName(Tv1.Columns[j].DataBinding.FieldName).AsString := RowData[j];
|
||||
// end
|
||||
// else
|
||||
begin
|
||||
Tv1.DataController.DataSet.Edit;
|
||||
Tv1.DataController.DataSet.FieldByName(Tv1.Columns[j].DataBinding.FieldName).AsString := RowData[j];
|
||||
Tv1.DataController.DataSet.Post;
|
||||
end;
|
||||
|
||||
TV1.Controller.EditingController.ShowEdit;
|
||||
end;
|
||||
|
||||
end;
|
||||
finally
|
||||
StringList.Free;
|
||||
end;
|
||||
pasteDatatTocxGrid(Tv1);
|
||||
|
||||
end;
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user