子表增行,打印标签

This commit is contained in:
DESKTOP-E401PHE\Administrator 2025-08-12 16:22:08 +08:00
parent c6d350af2b
commit 672bf06813
12 changed files with 281 additions and 242 deletions

View File

@ -1,6 +1,6 @@
object frmLabelPrint: TfrmLabelPrint object frmLabelPrint: TfrmLabelPrint
Left = 1104 Left = 880
Top = 424 Top = 409
Width = 277 Width = 277
Height = 181 Height = 181
Caption = #25253#34920#25171#21360 Caption = #25253#34920#25171#21360

View File

@ -1,6 +1,6 @@
object frmFHSQInPut: TfrmFHSQInPut object frmFHSQInPut: TfrmFHSQInPut
Left = 566 Left = 615
Top = 255 Top = 422
Width = 1113 Width = 1113
Height = 664 Height = 664
Caption = #21457#36135#30003#35831#24405#20837 Caption = #21457#36135#30003#35831#24405#20837

View File

@ -26,14 +26,14 @@ object frmKHList_CX: TfrmKHList_CX
ButtonWidth = 65 ButtonWidth = 65
Caption = 'ToolBar1' Caption = 'ToolBar1'
Color = clSkyBlue Color = clSkyBlue
DisabledImages = DataLink_DeliveryApplication.ThreeImgList DisabledImages = DataLink_YXYMT.ThreeImgList
Flat = True Flat = True
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
Font.Height = -15 Font.Height = -15
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [] Font.Style = []
Images = DataLink_DeliveryApplication.ThreeImgList Images = DataLink_YXYMT.ThreeImgList
List = True List = True
ParentColor = False ParentColor = False
ParentFont = False ParentFont = False
@ -323,11 +323,11 @@ object frmKHList_CX: TfrmKHList_CX
OptionsData.DeletingConfirmation = False OptionsData.DeletingConfirmation = False
OptionsView.Footer = True OptionsView.Footer = True
OptionsView.GroupByBox = False OptionsView.GroupByBox = False
Styles.Content = DataLink_DeliveryApplication.Default Styles.Content = DataLink_YXYMT.Default
Styles.Inactive = DataLink_DeliveryApplication.SHuangSe Styles.Inactive = DataLink_YXYMT.SHuangSe
Styles.IncSearch = DataLink_DeliveryApplication.SHuangSe Styles.IncSearch = DataLink_YXYMT.SHuangSe
Styles.Selection = DataLink_DeliveryApplication.SHuangSe Styles.Selection = DataLink_YXYMT.SHuangSe
Styles.Header = DataLink_DeliveryApplication.Default Styles.Header = DataLink_YXYMT.Default
object V1Column4: TcxGridDBColumn object V1Column4: TcxGridDBColumn
Caption = #36873#25321 Caption = #36873#25321
DataBinding.FieldName = 'Ssel' DataBinding.FieldName = 'Ssel'
@ -455,11 +455,11 @@ object frmKHList_CX: TfrmKHList_CX
OptionsData.DeletingConfirmation = False OptionsData.DeletingConfirmation = False
OptionsSelection.CellSelect = False OptionsSelection.CellSelect = False
OptionsView.GroupByBox = False OptionsView.GroupByBox = False
Styles.Content = DataLink_DeliveryApplication.Default Styles.Content = DataLink_YXYMT.Default
Styles.Inactive = DataLink_DeliveryApplication.SHuangSe Styles.Inactive = DataLink_YXYMT.SHuangSe
Styles.IncSearch = DataLink_DeliveryApplication.SHuangSe Styles.IncSearch = DataLink_YXYMT.SHuangSe
Styles.Selection = DataLink_DeliveryApplication.SHuangSe Styles.Selection = DataLink_YXYMT.SHuangSe
Styles.Header = DataLink_DeliveryApplication.Default Styles.Header = DataLink_YXYMT.Default
object V3Column2: TcxGridDBColumn object V3Column2: TcxGridDBColumn
Caption = #31867#22411 Caption = #31867#22411
DataBinding.FieldName = 'BankType' DataBinding.FieldName = 'BankType'
@ -504,62 +504,62 @@ object frmKHList_CX: TfrmKHList_CX
end end
end end
object ADOQueryTemp: TADOQuery object ADOQueryTemp: TADOQuery
Connection = DataLink_DeliveryApplication.ADOLink Connection = DataLink_YXYMT.ADOLink
LockType = ltReadOnly LockType = ltReadOnly
Parameters = <> Parameters = <>
Left = 786 Left = 593
Top = 112 Top = 274
end end
object ADOQueryCmd: TADOQuery object ADOQueryCmd: TADOQuery
Connection = DataLink_DeliveryApplication.ADOLink Connection = DataLink_YXYMT.ADOLink
Parameters = <> Parameters = <>
Left = 794 Left = 529
Top = 103 Top = 274
end end
object ADOQueryMain: TADOQuery object ADOQueryMain: TADOQuery
Connection = DataLink_DeliveryApplication.ADOLink Connection = DataLink_YXYMT.ADOLink
LockType = ltReadOnly LockType = ltReadOnly
Parameters = <> Parameters = <>
Left = 787 Left = 561
Top = 96 Top = 274
end end
object cxGridPopupMenu2: TcxGridPopupMenu object cxGridPopupMenu2: TcxGridPopupMenu
Grid = cxGrid1 Grid = cxGrid1
PopupMenus = <> PopupMenus = <>
Left = 780 Left = 529
Top = 145 Top = 306
end end
object DS_HZ: TDataSource object DS_HZ: TDataSource
DataSet = CDS_HZ DataSet = CDS_HZ
Left = 814 Left = 625
Top = 144 Top = 306
end end
object CDS_HZ: TClientDataSet object CDS_HZ: TClientDataSet
Aggregates = <> Aggregates = <>
Params = <> Params = <>
Left = 848 Left = 625
Top = 144 Top = 274
end end
object DS_HZ3: TDataSource object DS_HZ3: TDataSource
DataSet = CDS_HZ3 DataSet = CDS_HZ3
Left = 855 Left = 657
Top = 486 Top = 306
end end
object CDS_HZ3: TClientDataSet object CDS_HZ3: TClientDataSet
Aggregates = <> Aggregates = <>
Params = <> Params = <>
Left = 886 Left = 657
Top = 489 Top = 274
end end
object cxGridPopupMenu4: TcxGridPopupMenu object cxGridPopupMenu4: TcxGridPopupMenu
Grid = cxGrid3 Grid = cxGrid3
PopupMenus = <> PopupMenus = <>
Left = 918 Left = 561
Top = 491 Top = 306
end end
object PopupMenu1: TPopupMenu object PopupMenu1: TPopupMenu
Left = 750 Left = 529
Top = 144 Top = 338
object TBAddBank: TMenuItem object TBAddBank: TMenuItem
Caption = #22686#21152#36134#21495 Caption = #22686#21152#36134#21495
end end
@ -571,8 +571,8 @@ object frmKHList_CX: TfrmKHList_CX
end end
end end
object PopupMenu3: TPopupMenu object PopupMenu3: TPopupMenu
Left = 824 Left = 561
Top = 488 Top = 338
object BankEdit: TMenuItem object BankEdit: TMenuItem
Caption = #20462#25913#36134#21495 Caption = #20462#25913#36134#21495
end end
@ -592,6 +592,8 @@ object frmKHList_CX: TfrmKHList_CX
end end
end end
object cxStyleRepository1: TcxStyleRepository object cxStyleRepository1: TcxStyleRepository
Left = 593
Top = 306
PixelsPerInch = 96 PixelsPerInch = 96
object cxStyle1: TcxStyle object cxStyle1: TcxStyle
AssignedValues = [svFont] AssignedValues = [svFont]

View File

@ -33,7 +33,7 @@ object frmOrderSel: TfrmOrderSel
Font.Height = -18 Font.Height = -18
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [fsBold] Font.Style = [fsBold]
Images = DataLink_DeliveryApplication.ThreeImgList Images = DataLink_YXYMT.ThreeImgList
List = True List = True
ParentColor = False ParentColor = False
ParentFont = False ParentFont = False
@ -322,11 +322,11 @@ object frmOrderSel: TfrmOrderSel
OptionsCustomize.ColumnFiltering = False OptionsCustomize.ColumnFiltering = False
OptionsView.Footer = True OptionsView.Footer = True
OptionsView.GroupByBox = False OptionsView.GroupByBox = False
Styles.Content = DataLink_DeliveryApplication.Default Styles.Content = DataLink_YXYMT.Default
Styles.Inactive = DataLink_DeliveryApplication.SHuangSe Styles.Inactive = DataLink_YXYMT.SHuangSe
Styles.IncSearch = DataLink_DeliveryApplication.SHuangSe Styles.IncSearch = DataLink_YXYMT.SHuangSe
Styles.Selection = DataLink_DeliveryApplication.SHuangSe Styles.Selection = DataLink_YXYMT.SHuangSe
Styles.Header = DataLink_DeliveryApplication.Default Styles.Header = DataLink_YXYMT.Default
object v1Column2: TcxGridDBColumn object v1Column2: TcxGridDBColumn
Caption = #36873#25321 Caption = #36873#25321
DataBinding.FieldName = 'SSel' DataBinding.FieldName = 'SSel'
@ -409,43 +409,43 @@ object frmOrderSel: TfrmOrderSel
object cxGridPopupMenu1: TcxGridPopupMenu object cxGridPopupMenu1: TcxGridPopupMenu
Grid = cxGrid2 Grid = cxGrid2
PopupMenus = <> PopupMenus = <>
Left = 493 Left = 710
Top = 249 Top = 298
end end
object ADOQueryCmd: TADOQuery object ADOQueryCmd: TADOQuery
Connection = DataLink_DeliveryApplication.ADOLink Connection = DataLink_YXYMT.ADOLink
Parameters = <> Parameters = <>
Left = 393 Left = 582
Top = 240 Top = 298
end end
object ADOQueryMain: TADOQuery object ADOQueryMain: TADOQuery
Connection = DataLink_DeliveryApplication.ADOLink Connection = DataLink_YXYMT.ADOLink
LockType = ltReadOnly LockType = ltReadOnly
Parameters = <> Parameters = <>
Left = 305 Left = 614
Top = 232 Top = 298
end end
object ADOQueryTemp: TADOQuery object ADOQueryTemp: TADOQuery
Connection = DataLink_DeliveryApplication.ADOLink Connection = DataLink_YXYMT.ADOLink
LockType = ltReadOnly LockType = ltReadOnly
Parameters = <> Parameters = <>
Left = 240 Left = 646
Top = 255 Top = 298
end end
object DataSource1: TDataSource object DataSource1: TDataSource
DataSet = CDS_Main DataSet = CDS_Main
Left = 625 Left = 582
Top = 353 Top = 330
end end
object CDS_Main: TClientDataSet object CDS_Main: TClientDataSet
Aggregates = <> Aggregates = <>
Params = <> Params = <>
Left = 573 Left = 678
Top = 352 Top = 298
end end
object PopupMenu1: TPopupMenu object PopupMenu1: TPopupMenu
Left = 366 Left = 614
Top = 179 Top = 330
object N2: TMenuItem object N2: TMenuItem
Caption = #20840#36873 Caption = #20840#36873
OnClick = N2Click OnClick = N2Click

View File

@ -1,6 +1,6 @@
object frmYMTRKInPut: TfrmYMTRKInPut object frmYMTRKInPut: TfrmYMTRKInPut
Left = 397 Left = 513
Top = 607 Top = 336
Width = 1829 Width = 1829
Height = 623 Height = 623
Align = alClient Align = alClient
@ -222,7 +222,9 @@ object frmYMTRKInPut: TfrmYMTRKInPut
Tag = 2 Tag = 2
Caption = #21305#25968 Caption = #21305#25968
DataBinding.FieldName = 'PiQty' DataBinding.FieldName = 'PiQty'
PropertiesClassName = 'TcxTextEditProperties' PropertiesClassName = 'TcxCurrencyEditProperties'
Properties.DecimalPlaces = 0
Properties.DisplayFormat = '0;'
HeaderAlignmentHorz = taCenter HeaderAlignmentHorz = taCenter
Width = 67 Width = 67
end end
@ -528,51 +530,13 @@ object frmYMTRKInPut: TfrmYMTRKInPut
Align = alRight Align = alRight
Caption = 'Panel2' Caption = 'Panel2'
TabOrder = 3 TabOrder = 3
object ToolBar2: TToolBar
Left = 1
Top = 1
Width = 187
AutoSize = True
ButtonHeight = 30
ButtonWidth = 59
Caption = 'ToolBar1'
Color = clSkyBlue
Flat = True
Font.Charset = GB2312_CHARSET
Font.Color = clWindowText
Font.Height = -12
Font.Name = #23435#20307
Font.Style = []
Images = DataLink_YXYMT.ThreeImgList
List = True
ParentColor = False
ParentFont = False
ShowCaptions = True
TabOrder = 0
object ToolButton3: TToolButton
Left = 0
Top = 0
AutoSize = True
Caption = #22686#34892
ImageIndex = 57
OnClick = ToolButton3Click
end
object ToolButton4: TToolButton
Left = 63
Top = 0
AutoSize = True
Caption = #21024#38500
ImageIndex = 113
OnClick = ToolButton4Click
end
end
object cxGrid1: TcxGrid object cxGrid1: TcxGrid
Left = -9 Left = -9
Top = 33 Top = 1
Width = 197 Width = 197
Height = 525 Height = 557
Align = alRight Align = alRight
TabOrder = 1 TabOrder = 0
object TvMX: TcxGridDBTableView object TvMX: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <> Navigator.Buttons.CustomButtons = <>
Navigator.Buttons.Delete.Enabled = False Navigator.Buttons.Delete.Enabled = False

View File

@ -22,7 +22,7 @@ uses
dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust,
dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters,
dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue,
dxSkinscxPCPainter, cxNavigator; dxSkinscxPCPainter, cxNavigator, cxCurrencyEdit;
type type
TfrmYMTRKInPut = class(TForm) TfrmYMTRKInPut = class(TForm)
@ -80,9 +80,6 @@ type
CheckBox9: TCheckBox; CheckBox9: TCheckBox;
Button2: TButton; Button2: TButton;
Panel2: TPanel; Panel2: TPanel;
ToolBar2: TToolBar;
ToolButton3: TToolButton;
ToolButton4: TToolButton;
CDS_MX: TClientDataSet; CDS_MX: TClientDataSet;
DS_MX: TDataSource; DS_MX: TDataSource;
cxGrid1: TcxGrid; cxGrid1: TcxGrid;
@ -117,8 +114,8 @@ type
{ Private declarations } { Private declarations }
function SaveCKData(): Boolean; function SaveCKData(): Boolean;
procedure InitMXGrid(SPID: string); procedure InitMXGrid(SPID: string);
procedure TfrmYMTRKInPut.InitGrid(); procedure InitGrid();
procedure TfrmYMTRKInPut.AddRows(MaxNo: string; SPID: string; PiQty: Integer); procedure AddRows();
public public
{ Public declarations } { Public declarations }
FBCId: string; FBCId: string;
@ -147,16 +144,26 @@ begin
SInitCDSData20(ADOQueryTemp, CDS_MX); SInitCDSData20(ADOQueryTemp, CDS_MX);
end; end;
procedure TfrmYMTRKInPut.AddRows(MaxNo: string; SPID: string; PiQty: Integer); procedure TfrmYMTRKInPut.AddRows();
var var
i: Integer; i, PiQty: Integer;
MMXID: string; MaxNo, MMXID, SPID: string;
begin begin
if CDS_Sub.IsEmpty then
Exit;
SPID := Trim(CDS_Sub.fieldbyname('SPID').AsString);
PiQty := CDS_Sub.fieldbyname('PiQty').AsInteger;
try try
ADOQueryCmd.Connection.BeginTrans;
for i := 1 to PiQty do for i := 1 to PiQty do
begin begin
MMXID := Trim(MaxNo) + '-' + Format('%.3d', [i]); if GetLSNo(ADOQueryTemp, MaxNo, 'MCM', 'YMT_CK_MX', 3, 1) = False then
begin
Application.MessageBox('取最大号失败!', '提示', 0);
Exit;
end;
MMXID := Trim(MaxNo);
with ADOQueryCmd do with ADOQueryCmd do
begin begin
Close; Close;
@ -169,28 +176,24 @@ begin
ExecSQL; ExecSQL;
end; end;
end; end;
ADOQueryCmd.Connection.CommitTrans;
// Result := True;
InitMXGrid(SPID); InitMXGrid(SPID);
except except
// Result := False;
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox('添加失败!', '提示', 0); Application.MessageBox('添加失败!', '提示', 0);
end; end;
end; end;
procedure TfrmYMTRKInPut.InitGrid(); procedure TfrmYMTRKInPut.InitGrid();
begin begin
with ADOQueryTemp do // with ADOQueryTemp do
begin // begin
Close; //// Close;
sql.Clear; //// sql.Clear;
sql.Add('select * from YMT_CK_MX where SPID=' + quotedstr(Trim(MCRNO))); //// sql.Add('select * from YMT_CK_MX where SPID=' + quotedstr(Trim(MCRNO)));
sql.Add(' order by MXID'); //// sql.Add(' order by MXID');
Open; //// Open;
end; // end;
SCreateCDS20(ADOQueryTemp, CDS_MX); // SCreateCDS20(ADOQueryTemp, CDS_MX);
SInitCDSData20(ADOQueryTemp, CDS_MX); // SInitCDSData20(ADOQueryTemp, CDS_MX);
end; end;
procedure TfrmYMTRKInPut.FormClose(Sender: TObject; var Action: TCloseAction); procedure TfrmYMTRKInPut.FormClose(Sender: TObject; var Action: TCloseAction);
@ -272,6 +275,7 @@ begin
sql.Add('select * from YMT_CK_CR where SPID=''' + Trim(Maxno) + ''''); sql.Add('select * from YMT_CK_CR where SPID=''' + Trim(Maxno) + '''');
Open; Open;
end; end;
with ADOQueryCmd do with ADOQueryCmd do
begin begin
if Trim(FFSPID) = '' then if Trim(FFSPID) = '' then
@ -282,6 +286,7 @@ begin
begin begin
Edit; Edit;
end; end;
FieldByName('SPID').Value := Trim(Maxno); FieldByName('SPID').Value := Trim(Maxno);
FieldByName('FZSPID').Value := Trim(Maxno); FieldByName('FZSPID').Value := Trim(Maxno);
FieldByName('CKName').Value := '待检布'; FieldByName('CKName').Value := '待检布';
@ -293,7 +298,9 @@ begin
FieldByName('CRFlag').Value := '入库'; FieldByName('CRFlag').Value := '入库';
FieldByName('CRQtyFlag').Value := 1; FieldByName('CRQtyFlag').Value := 1;
//FieldByName('CRID').Value:=FCRID; //FieldByName('CRID').Value:=FCRID;
RTSetSaveDataCDS(ADOQueryCmd, Tv1, CDS_Sub, 'YMT_CK_CR', 2); RTSetSaveDataCDS(ADOQueryCmd, Tv1, CDS_Sub, 'YMT_CK_CR', 2);
if Trim(FFSPID) = '' then if Trim(FFSPID) = '' then
FieldByName('Filler').Value := Trim(DName) FieldByName('Filler').Value := Trim(DName)
else else
@ -301,12 +308,15 @@ begin
FieldByName('Editer').Value := Trim(DName); FieldByName('Editer').Value := Trim(DName);
FieldByName('EditTime').Value := SGetServerDate(ADOQueryTemp); FieldByName('EditTime').Value := SGetServerDate(ADOQueryTemp);
end; end;
if Trim(CDS_Sub.fieldbyname('OrderNo').AsString) <> '' then if Trim(CDS_Sub.fieldbyname('OrderNo').AsString) <> '' then
begin begin
FieldByName('QCOrderNo').Value := Trim(CDS_Sub.fieldbyname('OrderNo').AsString); FieldByName('QCOrderNo').Value := Trim(CDS_Sub.fieldbyname('OrderNo').AsString);
end; end;
Post; Post;
end; end;
with ADOQueryCmd do with ADOQueryCmd do
begin begin
Close; Close;
@ -316,6 +326,7 @@ begin
sql.Add(' where SPID=''' + Trim(Maxno) + ''''); sql.Add(' where SPID=''' + Trim(Maxno) + '''');
ExecSQL; ExecSQL;
end; end;
with ADOQueryTemp do with ADOQueryTemp do
begin begin
Close; Close;
@ -323,6 +334,7 @@ begin
sql.Add('select * from YMT_CK_CR where SPID=''' + Trim(Maxno) + ''''); sql.Add('select * from YMT_CK_CR where SPID=''' + Trim(Maxno) + '''');
Open; Open;
end; end;
if ADOQueryTemp.FieldByName('MXKCQty').Value < 0 then if ADOQueryTemp.FieldByName('MXKCQty').Value < 0 then
begin begin
CDS_Sub.DisableControls; CDS_Sub.DisableControls;
@ -346,6 +358,7 @@ begin
// end; // end;
// end; // end;
AddRows();
Next; Next;
end; end;
end; end;
@ -468,59 +481,59 @@ procedure TfrmYMTRKInPut.TBSaveClick(Sender: TObject);
begin begin
if CDS_Sub.IsEmpty then if CDS_Sub.IsEmpty then
Exit; Exit;
if CDS_Sub.Locate('CRTime', null, []) = True then // if CDS_Sub.Locate('CRTime', null, []) = True then
begin // begin
Application.MessageBox('入库时间不能为空!', '提示', 0); // Application.MessageBox('入库时间不能为空!', '提示', 0);
Exit; // Exit;
end; // end;
if CDS_Sub.Locate('CRType', null, []) = True then // if CDS_Sub.Locate('CRType', null, []) = True then
begin // begin
Application.MessageBox('入库类型不能为空!', '提示', 0); // Application.MessageBox('入库类型不能为空!', '提示', 0);
Exit; // Exit;
end; // end;
if CDS_Sub.Locate('SPName', null, []) = True then // if CDS_Sub.Locate('SPName', null, []) = True then
begin // begin
Application.MessageBox('品名不能为空!', '提示', 0); // Application.MessageBox('品名不能为空!', '提示', 0);
Exit; // Exit;
end; // end;
if CDS_Sub.Locate('OrderNo', null, []) = True then // if CDS_Sub.Locate('OrderNo', null, []) = True then
begin // begin
Application.MessageBox('订单号不能为空!', '提示', 0); // Application.MessageBox('订单号不能为空!', '提示', 0);
Exit; // Exit;
end; // end;
if CDS_Sub.Locate('ToFactoryName', null, []) = True then // if CDS_Sub.Locate('ToFactoryName', null, []) = True then
begin // begin
Application.MessageBox('存放工厂不能为空!', '提示', 0); // Application.MessageBox('存放工厂不能为空!', '提示', 0);
Exit; // Exit;
end; // end;
if trim(CDS_Sub.fieldbyname('CRType').AsString) <> '客户退货' then // if trim(CDS_Sub.fieldbyname('CRType').AsString) <> '客户退货' then
begin // begin
if CDS_Sub.Locate('FactoryName', null, []) = True then // if CDS_Sub.Locate('FactoryName', null, []) = True then
begin // begin
Application.MessageBox('加工厂不能为空!', '提示', 0); // Application.MessageBox('加工厂不能为空!', '提示', 0);
Exit; // Exit;
end; // end;
end; // end;
if CDS_Sub.Locate('PiQty', null, []) = True then // if CDS_Sub.Locate('PiQty', null, []) = True then
begin // begin
Application.MessageBox('匹数不能为空!', '提示', 0); // Application.MessageBox('匹数不能为空!', '提示', 0);
Exit; // Exit;
end; // end;
if CDS_Sub.Locate('Qty', null, []) = True then // if CDS_Sub.Locate('Qty', null, []) = True then
begin // begin
Application.MessageBox('数量不能为空!', '提示', 0); // Application.MessageBox('数量不能为空!', '提示', 0);
Exit; // Exit;
end; // end;
if CDS_Sub.Locate('QtyUnit', null, []) = True then // if CDS_Sub.Locate('QtyUnit', null, []) = True then
begin // begin
Application.MessageBox('数量单位不能为空!', '提示', 0); // Application.MessageBox('数量单位不能为空!', '提示', 0);
Exit; // Exit;
end; // end;
if CDS_Sub.Locate('CRType;FromFactoryName', VarArrayOf(['生产退回', Null]), [loPartialKey]) = True then // if CDS_Sub.Locate('CRType;FromFactoryName', VarArrayOf(['生产退回', Null]), [loPartialKey]) = True then
begin // begin
Application.MessageBox('生产退回的数据,来自工厂不能为空!', '提示', 0); // Application.MessageBox('生产退回的数据,来自工厂不能为空!', '提示', 0);
Exit; // Exit;
end; // end;
if SaveCKData() then if SaveCKData() then
begin begin
Application.MessageBox('保存成功!', '提示', 0); Application.MessageBox('保存成功!', '提示', 0);
@ -771,19 +784,18 @@ var
MaxNo, MMXID, SPID: string; MaxNo, MMXID, SPID: string;
begin begin
SPID := Trim(CDS_Sub.fieldbyname('SPID').AsString); SPID := Trim(CDS_Sub.fieldbyname('SPID').AsString);
PiQty := Trim(CDS_Sub.fieldbyname('PiQty').AsString); PiQty := StrToInt(Trim(CDS_Sub.fieldbyname('PiQty').AsString));
if GetLSNo(ADOQueryTemp, MaxNo, 'MCM', 'YMT_CK_MX', 3, 1) = False then if GetLSNo(ADOQueryTemp, MaxNo, 'MCM', 'YMT_CK_MX', 3, 1) = False then
begin begin
Application.MessageBox('取最大号失败!', '提示', 0); Application.MessageBox('取最大号失败!', '提示', 0);
Exit; Exit;
end; end;
AddRows(MaxNo, SPID, PiQty);
try try
ADOQueryCmd.Connection.BeginTrans; ADOQueryCmd.Connection.BeginTrans;
for i := 1 to PiQty do for i := 0 to PiQty - 1 do
begin begin
MMXID := Trim(MaxNo) + '-' + Format('%.3d', [i]); MMXID := Trim(MaxNo);
with ADOQueryCmd do with ADOQueryCmd do
begin begin
Close; Close;

View File

@ -1,6 +1,6 @@
object frmYMTRKList: TfrmYMTRKList object frmYMTRKList: TfrmYMTRKList
Left = 794 Left = 557
Top = 440 Top = 418
Width = 1370 Width = 1370
Height = 750 Height = 750
Caption = #38754#26009#22238#20179#30331#35760 Caption = #38754#26009#22238#20179#30331#35760
@ -23,7 +23,7 @@ object frmYMTRKList: TfrmYMTRKList
Width = 1362 Width = 1362
Height = 33 Height = 33
ButtonHeight = 30 ButtonHeight = 30
ButtonWidth = 101 ButtonWidth = 83
Caption = 'ToolBar1' Caption = 'ToolBar1'
Color = clSkyBlue Color = clSkyBlue
Flat = True Flat = True
@ -97,15 +97,15 @@ object frmYMTRKList: TfrmYMTRKList
object ToolButton1: TToolButton object ToolButton1: TToolButton
Left = 441 Left = 441
Top = 0 Top = 0
Caption = 'ToolButton1' Caption = #39044#35272#25171#21360
ImageIndex = 22 ImageIndex = 4
OnClick = ToolButton1Click OnClick = ToolButton1Click
end end
object ToolButton2: TToolButton object ToolButton2: TToolButton
Left = 542 Left = 524
Top = 0 Top = 0
Caption = 'ToolButton2' Caption = #24555#36895#25171#21360
ImageIndex = 23 ImageIndex = 4
OnClick = ToolButton2Click OnClick = ToolButton2Click
end end
end end
@ -602,7 +602,9 @@ object frmYMTRKList: TfrmYMTRKList
Tag = 2 Tag = 2
Caption = #21305#25968 Caption = #21305#25968
DataBinding.FieldName = 'PiQty' DataBinding.FieldName = 'PiQty'
PropertiesClassName = 'TcxTextEditProperties' PropertiesClassName = 'TcxCurrencyEditProperties'
Properties.DecimalPlaces = 0
Properties.DisplayFormat = '0.00;'
HeaderAlignmentHorz = taCenter HeaderAlignmentHorz = taCenter
Options.Editing = False Options.Editing = False
Width = 67 Width = 67

View File

@ -24,7 +24,7 @@ uses
dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver,
dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld,
dxSkinsDefaultPainters, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinsDefaultPainters, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint,
dxSkinXmas2008Blue, dxSkinscxPCPainter, cxNavigator; dxSkinXmas2008Blue, dxSkinscxPCPainter, cxNavigator, cxCurrencyEdit;
type type
TfrmYMTRKList = class(TForm) TfrmYMTRKList = class(TForm)
@ -450,31 +450,58 @@ end;
procedure TfrmYMTRKList.ToolButton1Click(Sender: TObject); procedure TfrmYMTRKList.ToolButton1Click(Sender: TObject);
var var
FPrintJson, JsonResult: string; FPrintJson, JsonResult, MFiltration: string;
begin begin
FPrintJson := '{ "LMType": "LMType","PreviewPrint": true,"DConString": "' + DConString + '","DCode": "' + DCode + '","DName": "' + DName + '", "PrtArgs": [ { "IsSql": true, "Filtration": "Filtration1" }] }'; if CDS_Main.IsEmpty then
Exit;
MFiltration := Trim(CDS_Main.fieldbyname('SPID').AsString);
FPrintJson := '{ "LMType": "LMType","PreviewPrint": true,"DConString": "' + DConString + '","DCode": "' + DCode + '","DName": "' + DName + '", "PrtArgs": [ { "IsSql": true, "Filtration": " ' + MFiltration + '" }] }';
ShowMessage(FormPrint(Application, PChar(FPrintJson))); FormPrint(Application, PChar(FPrintJson));
end; end;
procedure TfrmYMTRKList.ToolButton2Click(Sender: TObject); procedure TfrmYMTRKList.ToolButton2Click(Sender: TObject);
var var
MPrintJson, JsonResult: string; MPrintJson, JsonResult, MFiltration: string;
begin begin
MPrintJson := '{ "LBName": "测试","DConString": "' + DConString + '","DCode": "' + DCode + '","DName": "' + DName + '","IsPreview": true,"printerIndex": 0,"ExportFileType": "", "PrtArgs": [ {"SqlStr": "EXEC p_test ''22'' " }] }'; if CDS_Main.IsEmpty then
ShowMessage(FunPrint(Application, PChar(MPrintJson))); Exit;
MFiltration := Trim(CDS_Main.fieldbyname('SPID').AsString);
MPrintJson := '{ "LBName": "标签打印","DConString": "' + DConString + '","DCode": "' + DCode + '","DName": "' + DName + '","IsPreview": true,"printerIndex": 0,"ExportFileType": "", "PrtArgs": [ {"SqlStr": "EXEC P_YMT_CK_MX_Prt1 '' ' + MFiltration + ''' " }] }';
FunPrint(Application, PChar(MPrintJson));
end; end;
procedure TfrmYMTRKList.TbAddRowClick(Sender: TObject); procedure TfrmYMTRKList.TbAddRowClick(Sender: TObject);
var
MaxNo, MMXID, SPID: string;
begin begin
with CDS_MX do // with CDS_MX do
// begin
// Append;
// FieldByName('MXID').Value := '';
// FieldByName('MXQty').Value := 0;
// Post;
// end;
if GetLSNo(ADOQueryTemp, MaxNo, 'MCM', 'YMT_CK_MX', 3, 1) = False then
begin begin
Append; Application.MessageBox('取最大号失败!', '提示', 0);
FieldByName('MXID').Value := ''; Exit;
FieldByName('MXQty').Value := 0;
Post;
end; end;
MMXID := Trim(MaxNo);
SPID := Trim(CDS_Main.fieldbyname('SPID').AsString);
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('insert into YMT_CK_MX (MXID,SPID,MXQty)');
sql.Add('values(' + quotedstr(MMXID));
sql.Add(',' + quotedstr(Trim(SPID)));
sql.Add(',0');
sql.Add(')');
ExecSQL;
end;
InitMXGrid(SPID);
end; end;
procedure TfrmYMTRKList.TbDeleteRowClick(Sender: TObject); procedure TfrmYMTRKList.TbDeleteRowClick(Sender: TObject);
@ -490,8 +517,15 @@ begin
if Application.MessageBox('确定要删除当前行吗?', '确认删除', MB_ICONQUESTION + MB_YESNO) <> IDYES then if Application.MessageBox('确定要删除当前行吗?', '确认删除', MB_ICONQUESTION + MB_YESNO) <> IDYES then
Exit; Exit;
// 记录当前行,删除后尝试回到附近位置 // 记录当前行,删除后尝试回到附近位置
Bookmark := CDS_MX.GetBookmark; Bookmark := CDS_MX.GetBookmark;
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('delete YMT_CK_MX where MXID=' + quotedstr(Trim(CDS_MX.FieldByName('MXID').AsString)));
ExecSQL;
end;
try try
CDS_MX.Delete; CDS_MX.Delete;
finally finally
@ -505,17 +539,38 @@ end;
procedure TfrmYMTRKList.Button1Click(Sender: TObject); procedure TfrmYMTRKList.Button1Click(Sender: TObject);
var var
Num, i: Integer; Num, i: Integer;
MaxNo, MMXID, SPID: string;
begin begin
Num := StrToInt(Trim(AddNum.Text)); Num := StrToInt(Trim(AddNum.Text));
for i := 1 to Num do SPID := Trim(CDS_Main.fieldbyname('SPID').AsString);
begin
with CDS_MX do try
ADOQueryCmd.Connection.BeginTrans;
for i := 1 to Num do
begin begin
Append; if GetLSNo(ADOQueryTemp, MaxNo, 'MCM', 'YMT_CK_MX', 3, 1) = False then
FieldByName('MXID').Value := ''; begin
FieldByName('MXQty').Value := 0; Application.MessageBox('取最大号失败!', '提示', 0);
Post; Exit;
end;
MMXID := Trim(MaxNo);
with ADOQueryCmd do
begin
Close;
SQL.Clear;
sql.Add('insert into YMT_CK_MX (MXID,SPID,MXQty)');
sql.Add('values(' + quotedstr(MMXID));
sql.Add(',' + quotedstr(Trim(SPID)));
sql.Add(',0');
sql.Add(')');
ExecSQL;
end;
end; end;
ADOQueryCmd.Connection.CommitTrans;
InitMXGrid(SPID);
except
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox('添加失败!', '提示', 0);
end; end;
end; end;

View File

@ -20,12 +20,12 @@ object frmZDYHelp: TfrmZDYHelp
object cxGrid1: TcxGrid object cxGrid1: TcxGrid
Left = 0 Left = 0
Top = 73 Top = 73
Width = 449 Width = 457
Height = 416 Height = 424
Align = alClient Align = alClient
TabOrder = 0 TabOrder = 0
object TV1: TcxGridDBTableView object TV1: TcxGridDBTableView
NavigatorButtons.ConfirmDelete = False Navigator.Buttons.CustomButtons = <>
OnCellDblClick = TV1CellDblClick OnCellDblClick = TV1CellDblClick
DataController.DataSource = DataSource1 DataController.DataSource = DataSource1
DataController.Summary.DefaultGroupSummaryItems = <> DataController.Summary.DefaultGroupSummaryItems = <>
@ -134,7 +134,7 @@ object frmZDYHelp: TfrmZDYHelp
object ToolBar1: TToolBar object ToolBar1: TToolBar
Left = 0 Left = 0
Top = 0 Top = 0
Width = 449 Width = 457
Height = 29 Height = 29
ButtonHeight = 30 ButtonHeight = 30
ButtonWidth = 59 ButtonWidth = 59
@ -145,7 +145,7 @@ object frmZDYHelp: TfrmZDYHelp
Font.Height = -12 Font.Height = -12
Font.Name = #23435#20307 Font.Name = #23435#20307
Font.Style = [] Font.Style = []
Images = DataLink_PBMDDJ.ThreeImgList Images = DataLink_YXYMT.ThreeImgList
List = True List = True
ParentFont = False ParentFont = False
ShowCaptions = True ShowCaptions = True
@ -197,7 +197,7 @@ object frmZDYHelp: TfrmZDYHelp
object Panel1: TPanel object Panel1: TPanel
Left = 0 Left = 0
Top = 29 Top = 29
Width = 449 Width = 457
Height = 44 Height = 44
Align = alTop Align = alTop
BevelInner = bvRaised BevelInner = bvRaised
@ -236,21 +236,21 @@ object frmZDYHelp: TfrmZDYHelp
end end
end end
object ADOQueryMain: TADOQuery object ADOQueryMain: TADOQuery
Connection = DataLink_PBMDDJ.ADOLink Connection = DataLink_YXYMT.ADOLink
LockType = ltReadOnly LockType = ltReadOnly
Parameters = <> Parameters = <>
Left = 48 Left = 48
Top = 136 Top = 136
end end
object ADOQueryTemp: TADOQuery object ADOQueryTemp: TADOQuery
Connection = DataLink_PBMDDJ.ADOLink Connection = DataLink_YXYMT.ADOLink
LockType = ltReadOnly LockType = ltReadOnly
Parameters = <> Parameters = <>
Left = 80 Left = 80
Top = 144 Top = 144
end end
object ADOQueryCmd: TADOQuery object ADOQueryCmd: TADOQuery
Connection = DataLink_PBMDDJ.ADOLink Connection = DataLink_YXYMT.ADOLink
Parameters = <> Parameters = <>
Left = 112 Left = 112
Top = 152 Top = 152

View File

@ -9,7 +9,22 @@ uses
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel, cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel,
cxClasses, cxControls, cxGridCustomView, cxGrid, DBClient, ADODB, ImgList, cxClasses, cxControls, cxGridCustomView, cxGrid, DBClient, ADODB, ImgList,
StdCtrls, ExtCtrls, cxTextEdit, cxGridCustomPopupMenu, cxGridPopupMenu, StdCtrls, ExtCtrls, cxTextEdit, cxGridCustomPopupMenu, cxGridPopupMenu,
cxTimeEdit; cxTimeEdit, cxLookAndFeels, cxLookAndFeelPainters, dxSkinsCore,
dxSkinBlack, dxSkinBlue, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee,
dxSkinDarkRoom, dxSkinDarkSide, dxSkinDevExpressDarkStyle,
dxSkinDevExpressStyle, dxSkinFoggy, dxSkinGlassOceans,
dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian, dxSkinLiquidSky,
dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
dxSkinOffice2010Silver, dxSkinOffice2013DarkGray,
dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin,
dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus,
dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008,
dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, dxSkinValentine,
dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, dxSkinscxPCPainter,
cxNavigator;
type type
TfrmZDYHelp = class(TForm) TfrmZDYHelp = class(TForm)

View File

@ -101,7 +101,7 @@ DebugSourceDirs=
UsePackages=0 UsePackages=0
[Parameters] [Parameters]
RunParams= RunParams=
HostApplication=E:\项目资料\00_重点客户\云翔\D7myYunxiang\云翔生产管理(MYSC.dll)\testDll.exe HostApplication=D:\Project\D7myYunxiang\云翔生产管理(MYSC.dll)\testDll.exe
Launcher= Launcher=
UseLauncher=0 UseLauncher=0
DebugCWD= DebugCWD=

View File

@ -487,17 +487,6 @@ begin
Exit; Exit;
end; end;
if Trim(ZhongJianC.Text) = '' then
begin
Application.MessageBox('中间层编号不能为空!', '提示', 0);
Exit;
end;
if Trim(ZhongJianCName.Text) = '' then
begin
Application.MessageBox('中间层名称不能为空!', '提示', 0);
Exit;
end;
if Trim(MHDJ.Text) = '' then if Trim(MHDJ.Text) = '' then
begin begin
Application.MessageBox('棉花单价不能为空!', '提示', 0); Application.MessageBox('棉花单价不能为空!', '提示', 0);