子表增行,打印标签

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
Left = 1104
Top = 424
Left = 880
Top = 409
Width = 277
Height = 181
Caption = #25253#34920#25171#21360

View File

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

View File

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

View File

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

View File

@ -1,6 +1,6 @@
object frmYMTRKInPut: TfrmYMTRKInPut
Left = 397
Top = 607
Left = 513
Top = 336
Width = 1829
Height = 623
Align = alClient
@ -222,7 +222,9 @@ object frmYMTRKInPut: TfrmYMTRKInPut
Tag = 2
Caption = #21305#25968
DataBinding.FieldName = 'PiQty'
PropertiesClassName = 'TcxTextEditProperties'
PropertiesClassName = 'TcxCurrencyEditProperties'
Properties.DecimalPlaces = 0
Properties.DisplayFormat = '0;'
HeaderAlignmentHorz = taCenter
Width = 67
end
@ -528,51 +530,13 @@ object frmYMTRKInPut: TfrmYMTRKInPut
Align = alRight
Caption = 'Panel2'
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
Left = -9
Top = 33
Top = 1
Width = 197
Height = 525
Height = 557
Align = alRight
TabOrder = 1
TabOrder = 0
object TvMX: TcxGridDBTableView
Navigator.Buttons.CustomButtons = <>
Navigator.Buttons.Delete.Enabled = False

View File

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

View File

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

View File

@ -24,7 +24,7 @@ uses
dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver,
dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, dxSkinTheAsphaltWorld,
dxSkinsDefaultPainters, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint,
dxSkinXmas2008Blue, dxSkinscxPCPainter, cxNavigator;
dxSkinXmas2008Blue, dxSkinscxPCPainter, cxNavigator, cxCurrencyEdit;
type
TfrmYMTRKList = class(TForm)
@ -450,31 +450,58 @@ end;
procedure TfrmYMTRKList.ToolButton1Click(Sender: TObject);
var
FPrintJson, JsonResult: string;
FPrintJson, JsonResult, MFiltration: string;
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;
procedure TfrmYMTRKList.ToolButton2Click(Sender: TObject);
var
MPrintJson, JsonResult: string;
MPrintJson, JsonResult, MFiltration: string;
begin
MPrintJson := '{ "LBName": "²âÊÔ","DConString": "' + DConString + '","DCode": "' + DCode + '","DName": "' + DName + '","IsPreview": true,"printerIndex": 0,"ExportFileType": "", "PrtArgs": [ {"SqlStr": "EXEC p_test ''22'' " }] }';
ShowMessage(FunPrint(Application, PChar(MPrintJson)));
if CDS_Main.IsEmpty then
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;
procedure TfrmYMTRKList.TbAddRowClick(Sender: TObject);
var
MaxNo, MMXID, SPID: string;
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
Append;
FieldByName('MXID').Value := '';
FieldByName('MXQty').Value := 0;
Post;
Application.MessageBox('取最大号失败!', '提示', 0);
Exit;
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;
procedure TfrmYMTRKList.TbDeleteRowClick(Sender: TObject);
@ -492,6 +519,13 @@ begin
// 记录当前行,删除后尝试回到附近位置
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
CDS_MX.Delete;
finally
@ -505,17 +539,38 @@ end;
procedure TfrmYMTRKList.Button1Click(Sender: TObject);
var
Num, i: Integer;
MaxNo, MMXID, SPID: string;
begin
Num := StrToInt(Trim(AddNum.Text));
SPID := Trim(CDS_Main.fieldbyname('SPID').AsString);
try
ADOQueryCmd.Connection.BeginTrans;
for i := 1 to Num do
begin
with CDS_MX do
if GetLSNo(ADOQueryTemp, MaxNo, 'MCM', 'YMT_CK_MX', 3, 1) = False then
begin
Append;
FieldByName('MXID').Value := '';
FieldByName('MXQty').Value := 0;
Post;
Application.MessageBox('取最大号失败!', '提示', 0);
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;
ADOQueryCmd.Connection.CommitTrans;
InitMXGrid(SPID);
except
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox('添加失败!', '提示', 0);
end;
end;

View File

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

View File

@ -9,7 +9,22 @@ uses
cxGridCustomTableView, cxGridTableView, cxGridDBTableView, cxGridLevel,
cxClasses, cxControls, cxGridCustomView, cxGrid, DBClient, ADODB, ImgList,
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
TfrmZDYHelp = class(TForm)

View File

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

View File

@ -487,17 +487,6 @@ begin
Exit;
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
begin
Application.MessageBox('棉花单价不能为空!', '提示', 0);