加码单

This commit is contained in:
DESKTOP-E401PHE\Administrator 2025-10-21 09:35:41 +08:00
parent b665aac497
commit 66a4194db9
3 changed files with 129 additions and 103 deletions

View File

@ -101,10 +101,14 @@ DebugSourceDirs=
UsePackages=0 UsePackages=0
[Parameters] [Parameters]
RunParams= RunParams=
HostApplication=D:\徐加艳项目代码\项目代码\亚鹭\检验管理\testDll.exe HostApplication=D:\Dp7Repo\项目代码\D7DJyalu\检验管理\testDll.exe
Launcher= Launcher=
UseLauncher=0 UseLauncher=0
DebugCWD= DebugCWD=
[Language]
ActiveLang=
ProjectLang=
RootDir=
[Version Info] [Version Info]
IncludeVerInfo=0 IncludeVerInfo=0
AutoIncBuild=0 AutoIncBuild=0

View File

@ -1,8 +1,8 @@
object frmJYOrderCDOne: TfrmJYOrderCDOne object frmJYOrderCDOne: TfrmJYOrderCDOne
Left = 230 Left = 385
Top = 202 Top = 202
Width = 1382 Width = 1227
Height = 533 Height = 689
Caption = #26816#39564#25253#21578 Caption = #26816#39564#25253#21578
Color = clBtnFace Color = clBtnFace
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
@ -21,7 +21,7 @@ object frmJYOrderCDOne: TfrmJYOrderCDOne
object ToolBar1: TToolBar object ToolBar1: TToolBar
Left = 0 Left = 0
Top = 0 Top = 0
Width = 1366 Width = 1211
Height = 62 Height = 62
AutoSize = True AutoSize = True
ButtonHeight = 30 ButtonHeight = 30
@ -234,9 +234,7 @@ object frmJYOrderCDOne: TfrmJYOrderCDOne
#26816#39564#30721#21333'('#38271#24230')' #26816#39564#30721#21333'('#38271#24230')'
#26816#39564#30721#21333'('#20928#37325')' #26816#39564#30721#21333'('#20928#37325')'
#26816#39564#30721#21333'('#20840')' #26816#39564#30721#21333'('#20840')'
'' #26816#39564#30721#21333'('#27454#21495')')
''
'')
end end
object ToolButton9: TToolButton object ToolButton9: TToolButton
Left = 945 Left = 945
@ -266,7 +264,7 @@ object frmJYOrderCDOne: TfrmJYOrderCDOne
object Panel1: TPanel object Panel1: TPanel
Left = 0 Left = 0
Top = 62 Top = 62
Width = 1366 Width = 1211
Height = 88 Height = 88
Align = alTop Align = alTop
BevelInner = bvRaised BevelInner = bvRaised
@ -795,8 +793,8 @@ object frmJYOrderCDOne: TfrmJYOrderCDOne
object cxGrid1: TcxGrid object cxGrid1: TcxGrid
Left = 0 Left = 0
Top = 150 Top = 150
Width = 1366 Width = 1211
Height = 344 Height = 500
Align = alClient Align = alClient
Font.Charset = GB2312_CHARSET Font.Charset = GB2312_CHARSET
Font.Color = clWindowText Font.Color = clWindowText
@ -1940,15 +1938,15 @@ object frmJYOrderCDOne: TfrmJYOrderCDOne
object RMDB_Main: TRMDBDataSet object RMDB_Main: TRMDBDataSet
Visible = True Visible = True
DataSet = ADOQueryPrint DataSet = ADOQueryPrint
Left = 696 Left = 712
Top = 280 Top = 440
end end
object ADOQueryPrint: TADOQuery object ADOQueryPrint: TADOQuery
Connection = DataLink_TradeManage.ADOLink Connection = DataLink_TradeManage.ADOLink
LockType = ltReadOnly LockType = ltReadOnly
Parameters = <> Parameters = <>
Left = 648 Left = 568
Top = 232 Top = 456
end end
object CDS_CD: TClientDataSet object CDS_CD: TClientDataSet
Aggregates = <> Aggregates = <>
@ -2060,4 +2058,17 @@ object frmJYOrderCDOne: TfrmJYOrderCDOne
Left = 376 Left = 376
Top = 264 Top = 264
end end
object RMDBD_Z: TRMDBDataSet
Visible = True
DataSet = ADOQuery1
Left = 656
Top = 448
end
object ADOQuery1: TADOQuery
Connection = DataLink_TradeManage.ADOLink
LockType = ltReadOnly
Parameters = <>
Left = 616
Top = 456
end
end end

View File

@ -12,19 +12,19 @@ uses
RM_Common, RM_Class, RM_GridReport, RM_e_Xls, Menus, MovePanel, cxTextEdit, RM_Common, RM_Class, RM_GridReport, RM_e_Xls, Menus, MovePanel, cxTextEdit,
cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, cxContainer, ShellAPI, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, cxContainer, ShellAPI,
cxCurrencyEdit, MMSystem, dxSkinsCore, dxSkinBlack, dxSkinBlue, cxCurrencyEdit, MMSystem, dxSkinsCore, dxSkinBlack, dxSkinBlue,
dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom, dxSkinBlueprint, dxSkinCaramel, dxSkinCoffee, dxSkinDarkRoom, dxSkinDarkSide,
dxSkinDarkSide, dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinDevExpressDarkStyle, dxSkinDevExpressStyle, dxSkinFoggy,
dxSkinFoggy, dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinGlassOceans, dxSkinHighContrast, dxSkiniMaginary, dxSkinLilian,
dxSkinLilian, dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinLiquidSky, dxSkinLondonLiquidSky, dxSkinMcSkin, dxSkinMetropolis,
dxSkinMetropolis, dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinMetropolisDark, dxSkinMoneyTwins, dxSkinOffice2007Black,
dxSkinOffice2007Black, dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Blue, dxSkinOffice2007Green, dxSkinOffice2007Pink,
dxSkinOffice2007Pink, dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2007Silver, dxSkinOffice2010Black, dxSkinOffice2010Blue,
dxSkinOffice2010Blue, dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2010Silver, dxSkinOffice2013DarkGray, dxSkinOffice2013LightGray,
dxSkinOffice2013LightGray, dxSkinOffice2013White, dxSkinPumpkin, dxSkinOffice2013White, dxSkinPumpkin, dxSkinSeven, dxSkinSevenClassic,
dxSkinSeven, dxSkinSevenClassic, dxSkinSharp, dxSkinSharpPlus, dxSkinSharp, dxSkinSharpPlus, dxSkinSilver, dxSkinSpringTime, dxSkinStardust,
dxSkinSilver, dxSkinSpringTime, dxSkinStardust, dxSkinSummer2008, dxSkinSummer2008, dxSkinTheAsphaltWorld, dxSkinsDefaultPainters,
dxSkinTheAsphaltWorld, dxSkinsDefaultPainters, dxSkinValentine, dxSkinValentine, dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue,
dxSkinVS2010, dxSkinWhiteprint, dxSkinXmas2008Blue, dxSkinscxPCPainter; dxSkinscxPCPainter;
type type
TfrmJYOrderCDOne = class(TForm) TfrmJYOrderCDOne = class(TForm)
@ -219,6 +219,8 @@ type
ToolButton4: TToolButton; ToolButton4: TToolButton;
Label36: TLabel; Label36: TLabel;
ComboBox2: TComboBox; ComboBox2: TComboBox;
RMDBD_Z: TRMDBDataSet;
ADOQuery1: TADOQuery;
procedure FormDestroy(Sender: TObject); procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction); procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject); procedure FormCreate(Sender: TObject);
@ -753,9 +755,9 @@ var
fPrintFile: string; fPrintFile: string;
Txt, fImagePath: string; Txt, fImagePath: string;
Moudle: THandle; Moudle: THandle;
Makebar: TMakebar; Makebar: TMakebar;
Mixtext: TMixtext; Mixtext: TMixtext;
begin begin
if Order_Main.IsEmpty then if Order_Main.IsEmpty then
Exit; Exit;
if Order_Main.Locate('SSel', True, []) = False then if Order_Main.Locate('SSel', True, []) = False then
@ -763,7 +765,7 @@ begin
Application.MessageBox('没有选择数据!', '提示', 0); Application.MessageBox('没有选择数据!', '提示', 0);
Exit; Exit;
end; end;
with ADOQueryCmd do with ADOQueryCmd do
begin begin
Close; Close;
sql.Clear; sql.Clear;
@ -782,7 +784,7 @@ begin
try try
ADOQueryCmd.Connection.BeginTrans; ADOQueryCmd.Connection.BeginTrans;
with Order_Main do with Order_Main do
begin begin
First; First;
while not Eof do while not Eof do
begin begin
@ -803,8 +805,8 @@ begin
ADOQueryCmd.Connection.RollbackTrans; ADOQueryCmd.Connection.RollbackTrans;
end; end;
Order_Main.EnableControls; Order_Main.EnableControls;
with ADOQueryTemp do with ADOQueryTemp do
begin begin
Close; Close;
sql.Clear; sql.Clear;
@ -812,75 +814,75 @@ begin
// showmessage(sql.text); // showmessage(sql.text);
Open; Open;
end; end;
Order_Main.DisableControls; Order_Main.DisableControls;
with ADOQueryTemp do with ADOQueryTemp do
begin begin
First; First;
while not Eof do while not Eof do
begin begin
// if Order_Main.FieldByName('SSel').AsBoolean = True then // if Order_Main.FieldByName('SSel').AsBoolean = True then
// begin // begin
with ADOQueryCmd do with ADOQueryCmd do
begin begin
Close; Close;
sql.Clear; sql.Clear;
sql.Add('Update WFB_MJJY Set PrtAgnFlag=1,PrtAgnDate=getdate(),PrtAgnPerson=''' + Trim(DName) + ''''); sql.Add('Update WFB_MJJY Set PrtAgnFlag=1,PrtAgnDate=getdate(),PrtAgnPerson=''' + Trim(DName) + '''');
sql.Add(' where MJID=''' + Trim(ADOQueryTemp.fieldbyname('MJID').AsString) + ''''); sql.Add(' where MJID=''' + Trim(ADOQueryTemp.fieldbyname('MJID').AsString) + '''');
ExecSQL; ExecSQL;
end; end;
try try
Moudle := LoadLibrary('MakeQRBarcode.dll'); Moudle := LoadLibrary('MakeQRBarcode.dll');
@Makebar := GetProcAddress(Moudle, 'Make'); @Makebar := GetProcAddress(Moudle, 'Make');
@Mixtext := GetProcAddress(Moudle, 'MixText'); @Mixtext := GetProcAddress(Moudle, 'MixText');
Txt := Trim(ADOQueryTemp.fieldbyname('MJID').AsString); Txt := Trim(ADOQueryTemp.fieldbyname('MJID').AsString);
fImagePath := ExtractFilePath(Application.ExeName) + 'image\temp.bmp'; fImagePath := ExtractFilePath(Application.ExeName) + 'image\temp.bmp';
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName) + 'image')) then if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName) + 'image')) then
CreateDirectory(pchar(ExtractFilePath(Application.ExeName) + 'image'), nil); CreateDirectory(pchar(ExtractFilePath(Application.ExeName) + 'image'), nil);
if FileExists(fImagePath) then if FileExists(fImagePath) then
DeleteFile(fImagePath); DeleteFile(fImagePath);
Makebar(pchar(Txt), Length(Txt), 3, 3, 0, PChar(fImagePath), 3); Makebar(pchar(Txt), Length(Txt), 3, 3, 0, PChar(fImagePath), 3);
except except
application.MessageBox('条形码生成失败!', '提示信息', MB_ICONERROR); application.MessageBox('条形码生成失败!', '提示信息', MB_ICONERROR);
Order_Main.EnableControls; Order_Main.EnableControls;
exit; exit;
end; end;
with ADOQueryPrint do with ADOQueryPrint do
begin begin
Close; Close;
SQL.Clear; SQL.Clear;
sql.Add('select A.MJID,A.mjstr3,QtyUnit=A.MJTypeOther,B.orderNo,B.conNo,B.customerNoName,B.LBName '); sql.Add('select A.MJID,A.mjstr3,QtyUnit=A.MJTypeOther,B.orderNo,B.conNo,B.customerNoName,B.LBName ');
sql.Add(',EngColor=(select max(Note) from KH_Zdy X where X.ZDYName=C.PRTColor and X.Type=''OrdColor'' ) '); sql.Add(',EngColor=(select max(Note) from KH_Zdy X where X.ZDYName=C.PRTColor and X.Type=''OrdColor'' ) ');
sql.Add(',B.MPRTCF,C.*,A.* '); sql.Add(',B.MPRTCF,C.*,A.* ');
sql.Add(' from WFB_MJJY A'); sql.Add(' from WFB_MJJY A');
sql.Add(' inner join JYOrder_Main B On A.Mainid=B.Mainid'); sql.Add(' inner join JYOrder_Main B On A.Mainid=B.Mainid');
sql.Add(' inner join JYOrder_Sub C on A.SubId=C.SubId'); sql.Add(' inner join JYOrder_Sub C on A.SubId=C.SubId');
SQL.Add(' where A.MJID=''' + Trim(ADOQueryTemp.fieldbyname('MJID').AsString) + ''''); SQL.Add(' where A.MJID=''' + Trim(ADOQueryTemp.fieldbyname('MJID').AsString) + '''');
Open; Open;
end; end;
if Trim(ADOQueryPrint.fieldbyname('SLbName').AsString) <> '' then if Trim(ADOQueryPrint.fieldbyname('SLbName').AsString) <> '' then
begin begin
ExportFtErpFile(Trim(ADOQueryPrint.fieldbyname('SLbName').AsString), ADOQueryCmd); ExportFtErpFile(Trim(ADOQueryPrint.fieldbyname('SLbName').AsString), ADOQueryCmd);
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + Trim(ADOQueryPrint.fieldbyname('SLbName').AsString); fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + Trim(ADOQueryPrint.fieldbyname('SLbName').AsString);
end end
else else
begin begin
ExportFtErpFile('通用标签.rmf', ADOQueryCmd); ExportFtErpFile('通用标签.rmf', ADOQueryCmd);
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\通用标签.rmf'; fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\通用标签.rmf';
end; end;
if FileExists(fPrintFile) then if FileExists(fPrintFile) then
begin begin
RMVariables['QRBARCODE'] := fImagePath; RMVariables['QRBARCODE'] := fImagePath;
RM2.LoadFromFile(fPrintFile); RM2.LoadFromFile(fPrintFile);
Rm2.DefaultCopies := strtointdef(trim(ComboBox2.Text), 1); Rm2.DefaultCopies := strtointdef(trim(ComboBox2.Text), 1);
RM2.PrintReport; RM2.PrintReport;
end end
else else
begin begin
Order_Main.EnableControls; Order_Main.EnableControls;
Application.MessageBox(PChar('没有找到' + ExtractFilePath(Application.ExeName) + 'Report\卷标签.rmf'), '提示', 0); Application.MessageBox(PChar('没有找到' + ExtractFilePath(Application.ExeName) + 'Report\卷标签.rmf'), '提示', 0);
Exit; Exit;
end; end;
// end; // end;
Next; Next;
end; end;
@ -1658,32 +1660,41 @@ begin
Open; Open;
end; end;
end; end;
{
if (trim(ComboBox1.Text) = '检验码单(染色)') OR (trim(ComboBox1.Text) = '检验码单(印花)') then if (trim(ComboBox1.Text) = '检验码单(款号)') then
begin begin
with ADOQueryTemp do with ADOQueryTemp do
begin begin
Close; Close;
sql.Clear; sql.Clear;
sql.add('exec P_Print_CKMD '); sql.add('exec P_Print_CKMDHAEIL ');
sql.add('@mainID=' + quotedstr(Trim(''))); sql.add('@DName=' + quotedstr(Trim(DCode)));
sql.add(',@DName=' + quotedstr(Trim(DCode)));
Open; Open;
end; end;
SCreateCDS20(ADOQueryTemp, CDS_HZ); SCreateCDS20(ADOQueryTemp, CDS_HZ);
SInitCDSData20(ADOQueryTemp, CDS_HZ); SInitCDSData20(ADOQueryTemp, CDS_HZ);
with ADOQueryPrint do with ADOQueryPrint do
begin
Close;
sql.Clear;
sql.add('exec P_Do_PrintMd_HZ ');
sql.add('@mainID=' + quotedstr(Trim('')));
sql.add(',@DName=' + quotedstr(Trim(DCode)));
sql.add(',@flag=''22'' ');
Open;
end;
with ADOQuery1 do //RMDBD_Z
begin begin
Close; Close;
sql.Clear; sql.Clear;
sql.add('exec P_Do_PrintMd_HZ '); sql.add('exec P_Do_PrintMd_HZ ');
sql.add('@mainID=' + quotedstr(Trim(''))); sql.add('@mainID=' + quotedstr(Trim('')));
sql.add(',@DName=' + quotedstr(Trim(DCode))); sql.add(',@DName=' + quotedstr(Trim(DCode)));
sql.add(',@flag=''2'' '); sql.add(',@flag=''23'' ');
Open; Open;
end; end;
end; } end;
if (trim(ComboBox1.Text) = '检验码单(染色米数)') or (trim(ComboBox1.Text) = '检验码单(印花米数)') then if (trim(ComboBox1.Text) = '检验码单(染色米数)') or (trim(ComboBox1.Text) = '检验码单(印花米数)') then
begin begin
with ADOQueryTemp do with ADOQueryTemp do