打包 码单

This commit is contained in:
DESKTOP-E401PHE\Administrator 2026-02-05 17:27:52 +08:00
parent 4db9a1e184
commit b4e34880a9
11 changed files with 4598 additions and 897 deletions

View File

@ -2,49 +2,49 @@
Default=1
ShowNotifications=1
Enabled=1
dxSkinBlack=0
dxSkinBlue=0
dxSkinBlueprint=0
dxSkinCaramel=0
dxSkinCoffee=0
dxSkinDarkRoom=0
dxSkinDarkSide=0
dxSkinDevExpressDarkStyle=0
dxSkinDevExpressStyle=0
dxSkinFoggy=0
dxSkinGlassOceans=0
dxSkinHighContrast=0
dxSkiniMaginary=0
dxSkinLilian=0
dxSkinLiquidSky=0
dxSkinLondonLiquidSky=0
dxSkinMcSkin=0
dxSkinMetropolis=0
dxSkinMetropolisDark=0
dxSkinMoneyTwins=0
dxSkinOffice2007Black=0
dxSkinOffice2007Blue=0
dxSkinOffice2007Green=0
dxSkinOffice2007Pink=0
dxSkinOffice2007Silver=0
dxSkinOffice2010Black=0
dxSkinOffice2010Blue=0
dxSkinOffice2010Silver=0
dxSkinOffice2013DarkGray=0
dxSkinOffice2013LightGray=0
dxSkinOffice2013White=0
dxSkinPumpkin=0
dxSkinSeven=0
dxSkinSevenClassic=0
dxSkinSharp=0
dxSkinSharpPlus=0
dxSkinSilver=0
dxSkinSpringTime=0
dxSkinStardust=0
dxSkinSummer2008=0
dxSkinTheAsphaltWorld=0
dxSkinBlack=1
dxSkinBlue=1
dxSkinBlueprint=1
dxSkinCaramel=1
dxSkinCoffee=1
dxSkinDarkRoom=1
dxSkinDarkSide=1
dxSkinDevExpressDarkStyle=1
dxSkinDevExpressStyle=1
dxSkinFoggy=1
dxSkinGlassOceans=1
dxSkinHighContrast=1
dxSkiniMaginary=1
dxSkinLilian=1
dxSkinLiquidSky=1
dxSkinLondonLiquidSky=1
dxSkinMcSkin=1
dxSkinMetropolis=1
dxSkinMetropolisDark=1
dxSkinMoneyTwins=1
dxSkinOffice2007Black=1
dxSkinOffice2007Blue=1
dxSkinOffice2007Green=1
dxSkinOffice2007Pink=1
dxSkinOffice2007Silver=1
dxSkinOffice2010Black=1
dxSkinOffice2010Blue=1
dxSkinOffice2010Silver=1
dxSkinOffice2013DarkGray=1
dxSkinOffice2013LightGray=1
dxSkinOffice2013White=1
dxSkinPumpkin=1
dxSkinSeven=1
dxSkinSevenClassic=1
dxSkinSharp=1
dxSkinSharpPlus=1
dxSkinSilver=1
dxSkinSpringTime=1
dxSkinStardust=1
dxSkinSummer2008=1
dxSkinTheAsphaltWorld=1
dxSkinsDefaultPainters=1
dxSkinValentine=0
dxSkinVS2010=0
dxSkinWhiteprint=0
dxSkinXmas2008Blue=0
dxSkinValentine=1
dxSkinVS2010=1
dxSkinWhiteprint=1
dxSkinXmas2008Blue=1

View File

@ -1,9 +1,8 @@
object frmCPDBao: TfrmCPDBao
Left = 19
Top = 72
Width = 1382
Height = 753
VertScrollBar.Position = 2
Left = 324
Top = 149
Width = 1551
Height = 742
Caption = #25171#21253#31383#21475
Color = clBtnFace
Font.Charset = GB2312_CHARSET
@ -21,8 +20,8 @@ object frmCPDBao: TfrmCPDBao
TextHeight = 12
object ToolBar1: TToolBar
Left = 0
Top = -2
Width = 1533
Top = 0
Width = 1535
Height = 33
ButtonHeight = 30
ButtonWidth = 59
@ -54,8 +53,8 @@ object frmCPDBao: TfrmCPDBao
end
object Panel1: TPanel
Left = 0
Top = 31
Width = 1533
Top = 33
Width = 1535
Height = 76
Align = alTop
BevelInner = bvRaised
@ -486,10 +485,27 @@ object frmCPDBao: TfrmCPDBao
'24'
'25')
end
object cxButton8: TcxButton
Left = 984
Top = 40
Width = 77
Height = 33
Hint = 'Filesother'
Caption = #37325#25171#21253#26631#31614
Font.Charset = GB2312_CHARSET
Font.Color = clRed
Font.Height = -12
Font.Name = #23435#20307
Font.Style = [fsBold]
ParentFont = False
TabOrder = 20
OnClick = cxButton8Click
LookAndFeel.Kind = lfOffice11
end
end
object Panel2: TPanel
Left = 400
Top = 139
Top = 141
Width = 1133
Height = 560
Caption = 'Panel2'
@ -508,7 +524,7 @@ object frmCPDBao: TfrmCPDBao
ParentFont = False
TabOrder = 0
object TV2: TcxGridDBTableView
NavigatorButtons.ConfirmDelete = False
Navigator.Buttons.CustomButtons = <>
OnCustomDrawCell = TV2CustomDrawCell
DataController.DataSource = DataSource2
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
@ -666,9 +682,10 @@ object frmCPDBao: TfrmCPDBao
Width = 1131
Height = 292
Align = alClient
PopupMenu = PopupMenu1
TabOrder = 1
object TV4: TcxGridDBTableView
NavigatorButtons.ConfirmDelete = False
Navigator.Buttons.CustomButtons = <>
DataController.DataSource = DSSEL
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
DataController.Summary.DefaultGroupSummaryItems = <
@ -832,7 +849,7 @@ object frmCPDBao: TfrmCPDBao
end
object Panel3: TPanel
Left = 999
Top = 225
Top = 227
Width = 290
Height = 286
BevelInner = bvRaised
@ -1027,9 +1044,9 @@ object frmCPDBao: TfrmCPDBao
end
object Panel4: TPanel
Left = 0
Top = 107
Top = 109
Width = 553
Height = 592
Height = 594
Align = alLeft
BevelInner = bvRaised
BevelOuter = bvLowered
@ -1039,11 +1056,11 @@ object frmCPDBao: TfrmCPDBao
Left = 2
Top = 89
Width = 549
Height = 501
Height = 503
Align = alClient
TabOrder = 0
object Tv3: TcxGridDBTableView
NavigatorButtons.ConfirmDelete = False
Navigator.Buttons.CustomButtons = <>
DataController.DataSource = DSTm
DataController.Options = [dcoAssignGroupingValues, dcoAssignMasterDetailKeys, dcoSaveExpanding, dcoImmediatePost]
DataController.Summary.DefaultGroupSummaryItems = <>
@ -1355,8 +1372,8 @@ object frmCPDBao: TfrmCPDBao
end
end
object MovePanel1: TMovePanel
Left = 506
Top = 274
Left = 198
Top = 208
Width = 715
Height = 327
BevelInner = bvLowered
@ -1435,6 +1452,7 @@ object frmCPDBao: TfrmCPDBao
object cxStyleRepository1: TcxStyleRepository
Left = 317
Top = 306
PixelsPerInch = 96
object cxStyle1: TcxStyle
AssignedValues = [svColor, svFont]
Color = clInactiveCaption
@ -1648,4 +1666,16 @@ object frmCPDBao: TfrmCPDBao
Left = 332
Top = 420
end
object PopupMenu1: TPopupMenu
Left = 948
Top = 568
object N1: TMenuItem
Caption = #20840#36873
OnClick = N1Click
end
object N2: TMenuItem
Caption = #20840#24323
OnClick = N2Click
end
end
end

View File

@ -3,14 +3,27 @@ unit U_CPDBAO;
interface
uses
Windows, Messages, strutils,SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
Windows, Messages, strutils, SysUtils, Variants, Classes, Graphics, Controls,
Forms, Dialogs, cxStyles, cxCustomData, cxGraphics, cxFilter, cxData,
cxDataStorage, cxEdit, DB, cxDBData, cxGridLevel, cxGridCustomTableView,
cxGridTableView, cxGridDBTableView, cxClasses, cxControls,
cxGridCustomView, cxGrid, StdCtrls, cxContainer, cxTextEdit,
cxCurrencyEdit, BtnEdit, ExtCtrls, ComCtrls, ToolWin, DBClient, ADODB,
MovePanel, Buttons, Menus, cxLookAndFeelPainters, cxButtons, RM_Common,
RM_Class, RM_GridReport, RM_System, RM_Dataset, cxCheckBox,MMSystem;
cxGridTableView, cxGridDBTableView, cxClasses, cxControls, cxGridCustomView,
cxGrid, StdCtrls, cxContainer, cxTextEdit, cxCurrencyEdit, BtnEdit, ExtCtrls,
ComCtrls, ToolWin, DBClient, ADODB, MovePanel, Buttons, Menus,
cxLookAndFeelPainters, cxButtons, RM_Common, RM_Class, RM_GridReport,
RM_System, RM_Dataset, cxCheckBox, MMSystem, cxLookAndFeels, cxNavigator,
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;
type
TfrmCPDBao = class(TForm)
@ -160,16 +173,17 @@ type
ComboBox4: TComboBox;
Label12: TLabel;
ADOQuery2: TADOQuery;
PopupMenu1: TPopupMenu;
N1: TMenuItem;
N2: TMenuItem;
cxButton8: TcxButton;
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure TBCloseClick(Sender: TObject);
procedure FormCreate(Sender: TObject);
procedure SmNOKeyPress(Sender: TObject; var Key: Char);
procedure FormShow(Sender: TObject);
procedure TV2CustomDrawCell(Sender: TcxCustomGridTableView;
ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
var ADone: Boolean);
procedure TV2CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
procedure kcKwBtnClick(Sender: TObject);
procedure Button4Click(Sender: TObject);
procedure baoNoKeyPress(Sender: TObject; var Key: Char);
@ -189,28 +203,36 @@ type
procedure cxButton5Click(Sender: TObject);
procedure cxButton6Click(Sender: TObject);
procedure cxButton7Click(Sender: TObject);
procedure N1Click(Sender: TObject);
procedure N2Click(Sender: TObject);
procedure cxButton8Click(Sender: TObject);
private
Rolls: integer;
procedure InitGrid();
procedure InitMJID();
function SaveRK(): Boolean;
Procedure QueryRk();
Procedure QueryTM();
procedure QueryRk();
procedure QueryTM();
{ Private declarations }
public
{ Public declarations }
end;
var
frmCPDBao: TfrmCPDBao;
newh: hwnd;
implementation
uses
U_DataLink, U_Fun, U_ZDYHelp, U_OrderSelRK;
{$R *.dfm}
Procedure TfrmCPDBao.QueryTm();
procedure TfrmCPDBao.QueryTm();
var
FBaoID: string;
begin
with ADOQueryTM do
begin
close;
@ -219,18 +241,55 @@ begin
sql.Add('from WFB_MJJY A ');
sql.Add('inner join JYOrder_sub B on B.subID=A.subID ');
sql.Add('inner join JYOrder_main C on C.mainID=A.MainID ');
sql.Add('and A.mjstr2=''灌흙욋'' and C.orderNo='+quotedstr(trim(BtnEditA1.Text)));
sql.Add('and isnull(A.BAOID,'''')='''' and A.mjstr2=''未入库'' and C.orderNo=' + quotedstr(trim(BtnEditA1.Text)));
open;
end;
SCreateCDS20(ADOQueryTM, CDSTM);
SInitCDSData20(ADOQueryTM, CDSTM);
//if CDSMJID.IsEmpty then
// exit;
// if CDSMJID.fieldByName('SDefNote').AsString <> '' then
// begin
// application.MessageBox('已打包,不能删除!', '提示信息', 0);
// exit;
// end
if not CDSMJID.IsEmpty then
begin
Rolls := 0;
with CDSMJID do
begin
DisableControls;
first;
while not eof do
begin
Rolls := Rolls + 1;
next;
end;
EnableControls;
end;
end
else
SCreateCDS20(ADOQueryTM, CDSMJID);
// SInitCDSData20(ADOQueryMain, CDSMJID);
SCreateCDS20(ADOQueryTM,CDSSEL);
// SInitCDSData20(ADOQueryMain,CDSSEL);
IF not CDSTM.IsEmpty then
with ADOQueryMain do
begin
close;
sql.Clear;
sql.Add('select A.*,B.* ,MPrtCodeName,C.orderNo as OrderNoM');
sql.Add('from WFB_MJJY A ');
sql.Add('inner join JYOrder_sub B on B.subID=A.subID ');
sql.Add('inner join JYOrder_main C on C.mainID=A.MainID ');
sql.Add('and isnull(A.BAOID,'''')<>'''' and A.mjstr2=''未入库'' and C.orderNo=' + quotedstr(trim(BtnEditA1.Text)));
SQL.Add('order by [dbo].[Get_ShuZi](BaoNo)');
open;
end;
SCreateCDS20(ADOQueryMain, CDSSEL);
SInitCDSData20(ADOQueryMain, CDSSEL);
if not CDSTM.IsEmpty then
begin
with ADOQuery1 do
begin
@ -240,20 +299,60 @@ begin
sql.Add('where mainID=' + quotedstr(trim(CDSTM.fieldbyname('MainID').AsString)));
open;
end;
baoNo.text:=ADOQuery1.fieldbyname('MaxBaoNo').AsString;
// baoNo.text := ADOQuery1.fieldbyname('MaxBaoNo').AsString;
if GetLSNo(ADOQueryTmp, FBaoID, 'BI', 'WFB_MJJY', 4, 1) = False then
begin
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox('取包条码最大号失败!', '提示', 0);
Exit;
end;
BaoID.Text:=trim(FBaoid);
BaoID.Text := trim(FBaoID);
end;
SMNO.SetFocus;
// with ADOQueryTM do
// begin
// close;
// sql.Clear;
// sql.Add('select A.*,B.*,C.MPrtCodeName,C.orderNo as OrderNoM');
// sql.Add('from WFB_MJJY A ');
// sql.Add('inner join JYOrder_sub B on B.subID=A.subID ');
// sql.Add('inner join JYOrder_main C on C.mainID=A.MainID ');
// sql.Add('and A.mjstr2=''未入库'' and C.orderNo=' + quotedstr(trim(BtnEditA1.Text)));
// open;
// end;
// SCreateCDS20(ADOQueryTM, CDSTM);
// SInitCDSData20(ADOQueryTM, CDSTM);
//
// SCreateCDS20(ADOQueryTM, CDSMJID);
//// SInitCDSData20(ADOQueryMain,CDSMJID);
// SCreateCDS20(ADOQueryTM, CDSSEL);
//// SInitCDSData20(ADOQueryMain,CDSSEL);
//
// if not CDSTM.IsEmpty then
// begin
// with ADOQuery1 do
// begin
// close;
// sql.clear;
// sql.add('select isnull(max(cast(baoNo as int)),0)+1 as MaxBaoNo from WFB_MJJY ');
// sql.Add('where mainID=' + quotedstr(trim(CDSTM.fieldbyname('MainID').AsString)));
// open;
// end;
// baoNo.text := ADOQuery1.fieldbyname('MaxBaoNo').AsString;
// if GetLSNo(ADOQueryTmp, FBaoID, 'BI', 'WFB_MJJY', 4, 1) = False then
// begin
// ADOQueryCmd.Connection.RollbackTrans;
// Application.MessageBox('取包条码最大号失败!', '提示', 0);
// Exit;
// end;
// BaoID.Text := trim(FBaoID);
// end;
//
// SMNO.SetFocus;
end;
Procedure TfrmCPDBao.QueryRk();
procedure TfrmCPDBao.QueryRk();
begin
with ADOQuery1 do
begin
@ -272,9 +371,9 @@ end;
function TfrmCPDBao.SaveRK(): Boolean;
var
maxno:String;
maxno: string;
CRID: Integer;
MaxCkNo,MaxCkSubNo:String;
MaxCkNo, MaxCkSubNo: string;
MhcTime: TdateTime;
begin
Result := false;
@ -405,7 +504,6 @@ procedure TfrmCPDBao.InitMJID();
begin
MovePanel1.Visible := false;
with ADOQueryMain do
begin
Close;
@ -417,7 +515,7 @@ begin
Open;
if not IsEmpty then
begin
IF trim(Fieldbyname('MJstr2').AsString)='綠흙욋' then
if trim(Fieldbyname('MJstr2').AsString) = '已入库' then
begin
CDSMJID.Append;
CDSMJID.FieldByName('SDefNote').Value := '此条码已入库';
@ -458,25 +556,25 @@ begin
CDSMJID.Post;
end;
end;
IF trim(CDSMJID.FieldByName('SDefNote').AsString)<>'댔관냥묘' then
if trim(CDSMJID.FieldByName('SDefNote').AsString) <> '打包成功' then
begin
MovePanel1.Visible := true;
Edit2.Text := SmNO.Text;
Label2.Caption := trim(CDSMJID.FieldByName('SDefNote').AsString);
IF FileExists(PChar(ExtractFilePath(Application.ExeName)+'wav\댔관댄轎.wav')) then
if FileExists(PChar(ExtractFilePath(Application.ExeName) + 'wav\打包错误.wav')) then
PlaySound(PChar(ExtractFilePath(Application.ExeName) + 'wav\打包错误.wav'), 0, SND_ASYNC);
CDSMJID.delete;
end;
If CDSTM.Locate('MJID',trim(smno.Text),[]) then
if CDSTM.Locate('MJID', trim(smno.Text), []) then
begin
// application.MessageBox('AAAA','AAAAAAAA',0);
CDSTM.Delete;
tv2.Controller.EditingController.ShowEdit();
tv3.Controller.EditingController.ShowEdit();
end;
IF CheckBox1.Checked then
if CheckBox1.Checked = true then
begin
IF (Rolls=strtointdef(trim(ComboBox3.Text),0)) and (strtointdef(trim(ComboBox3.Text),0)>0) then
if (Rolls = strtointdef(trim(ComboBox3.Text), 0)) and (strtointdef(trim(ComboBox3.Text), 0) > 0) then
begin
FileName.Click;
end;
@ -488,8 +586,7 @@ begin
frmCPDBao := nil;
end;
procedure TfrmCPDBao.FormClose(Sender: TObject;
var Action: TCloseAction);
procedure TfrmCPDBao.FormClose(Sender: TObject; var Action: TCloseAction);
begin
//writeCxGrid(self.Caption+tv1.Name,Tv1,'成品仓库');
writeCxGrid(self.Caption + Tv2.Name, Tv2, '成品仓库');
@ -515,7 +612,7 @@ end;
procedure TfrmCPDBao.SmNOKeyPress(Sender: TObject; var Key: Char);
begin
IF key=#13 then
if Key = #13 then
begin
if combobox4.Text = '按颜色' then
begin
@ -556,20 +653,22 @@ begin
application.MessageBox('包条码不能为空', '提示');
exit;
end;
IF CDSTM.IsEmpty then exit;
if trim(smno.Text)='' then exit;
IF CDSMJID.Locate('MJID',trim(smno.Text),[]) then
if CDSTM.IsEmpty then
exit;
if trim(smno.Text) = '' then
exit;
if CDSMJID.Locate('MJID', trim(smno.Text), []) then
begin
MovePanel1.Visible := true;
Edit2.Text := SmNO.Text;
Label2.Caption := '此卷号重复扫描!';
IF FileExists(PChar(ExtractFilePath(Application.ExeName)+'wav\路릿<E8B7AF>.wav')) then
if FileExists(PChar(ExtractFilePath(Application.ExeName) + 'wav\重复扫描.wav')) then
PlaySound(PChar(ExtractFilePath(Application.ExeName) + 'wav\重复扫描.wav'), 0, SND_ASYNC);
smno.Text := '';
smno.SetFocus;
exit;
end;
If not CDSTM.Locate('MJID',trim(smno.Text),[]) then
if not CDSTM.Locate('MJID', trim(smno.Text), []) then
begin
with ADOQuery1 do
begin
@ -580,27 +679,27 @@ begin
sql.add('inner join JYOrder_Main C on C.maiNID=A.mainID');
sql.Add('where MJID=' + quotedstr(trim(SmNO.Text)));
Open;
IF isempty then
if isempty then
begin
MovePanel1.Visible := true;
Edit2.Text := SmNO.Text;
Label2.Caption := '此卷号错误!';
IF FileExists(PChar(ExtractFilePath(Application.ExeName)+'wav\<5C>췄댄轎.wav')) then
if FileExists(PChar(ExtractFilePath(Application.ExeName) + 'wav\扫描错误.wav')) then
PlaySound(PChar(ExtractFilePath(Application.ExeName) + 'wav\扫描错误.wav'), 0, SND_ASYNC);
end
else
begin
If not CDSTM.Locate('orderNoM',trim(fieldbyname('OrderNoM').AsString),[]) then
if not CDSTM.Locate('orderNoM', trim(fieldbyname('OrderNoM').AsString), []) then
begin
MovePanel1.Visible := true;
Edit2.Text := SmNO.Text;
Label2.Caption := '此卷不属于当前订单!';
IF FileExists(PChar(ExtractFilePath(Application.ExeName)+'wav\<5C>췄댄轎.wav')) then
if FileExists(PChar(ExtractFilePath(Application.ExeName) + 'wav\扫描错误.wav')) then
PlaySound(PChar(ExtractFilePath(Application.ExeName) + 'wav\扫描错误.wav'), 0, SND_ASYNC);
end
else
begin
IF Fieldbyname('MJstr2').AsString<>'灌흙욋' then
if Fieldbyname('MJstr2').AsString <> '未入库' then
begin
MovePanel1.Visible := true;
Edit2.Text := SmNO.Text;
@ -643,9 +742,7 @@ begin
// InitGrid();
end;
procedure TfrmCPDBao.TV2CustomDrawCell(Sender: TcxCustomGridTableView;
ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
var ADone: Boolean);
procedure TfrmCPDBao.TV2CustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
var
i: integer;
begin
@ -683,7 +780,8 @@ begin
end;
procedure TfrmCPDBao.baoNoKeyPress(Sender: TObject; var Key: Char);
var FBaoID: string;
var
FBaoID: string;
begin
end;
@ -710,7 +808,8 @@ var
fsj: string;
begin
fsj := Trim(TSpeedButton(Sender).Hint);
if Trim(fsj)='' then Exit;
if Trim(fsj) = '' then
Exit;
fsj := Trim(TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text);
TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text := fsj + Trim(TSpeedButton(Sender).Caption);
TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).SelectAll;
@ -721,15 +820,17 @@ var
fsj: string;
begin
fsj := Trim(TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text);
if Trim(fsj)='' then Exit;
if Trim(fsj) = '' then
Exit;
TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Text := Copy(fsj, 1, Length(fsj) - 1);
TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).SelectAll;
end;
procedure TfrmCPDBao.SpeedButton49Click(Sender: TObject);
var
FBaoID: string;
begin
IF trim(TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Hint)<>'' then
if trim(TEdit(FindComponent(Trim(TSpeedButton(Sender).Hint))).Hint) <> '' then
begin
if GetLSNo(ADOQueryTmp, FBaoID, 'BI', 'WFB_MJJY', 4, 1) = False then
begin
@ -737,13 +838,14 @@ begin
Application.MessageBox('取包条码最大号失败!', '提示', 0);
Exit;
end;
BaoID.Text:=trim(FBaoid);
BaoID.Text := trim(FBaoID);
end;
Panel3.Visible := False;
end;
procedure TfrmCPDBao.FileNameClick(Sender: TObject);
var fPrintFile: string;
var
fPrintFile: string;
Txt, fImagePath: string;
Moudle: THandle;
Makebar: TMakebar;
@ -756,7 +858,8 @@ begin
application.MessageBox('包条码不能未空', '提示');
exit;
end;
IF CDSMJID.IsEmpty then exit;
if CDSMJID.IsEmpty then
exit;
with ADOQueryPrint do
begin
@ -767,7 +870,7 @@ begin
sql.Add(' inner join JYOrder_Main D on D.MainID=A.MainID');
SQL.Add('where MJID=''' + Trim(CDSMJID.fieldbyname('MJID').AsString) + '''');
Open;
IF not ADOQueryPrint.IsEmpty then
if not ADOQueryPrint.IsEmpty then
begin
if Trim(ADOQueryPrint.fieldbyname('NLBName').AsString) = '' then
begin
@ -801,11 +904,11 @@ begin
EnableControls;
end;
ADOQueryCmd.Connection.CommitTrans;
IF FileExists(PChar(ExtractFilePath(Application.ExeName)+'wav\攣횅.wav')) then
if FileExists(PChar(ExtractFilePath(Application.ExeName) + 'wav\正确.wav')) then
PlaySound(PChar(ExtractFilePath(Application.ExeName) + 'wav\正确.wav'), 0, SND_ASYNC);
except
ADOQueryCmd.Connection.RollbackTrans;
IF FileExists(PChar(ExtractFilePath(Application.ExeName)+'wav\댔관댄轎.wav')) then
if FileExists(PChar(ExtractFilePath(Application.ExeName) + 'wav\打包错误.wav')) then
PlaySound(PChar(ExtractFilePath(Application.ExeName) + 'wav\打包错误.wav'), 0, SND_ASYNC);
application.MessageBox('数据修改失败!', '提示信息', 0);
exit;
@ -841,19 +944,18 @@ begin
if ADOQueryPrint.RecordCount > 1 then
begin
Application.MessageBox('打包错误,请重新打包!', '提示', 0);
IF FileExists(PChar(ExtractFilePath(Application.ExeName)+'wav\댔관댄轎.wav')) then
if FileExists(PChar(ExtractFilePath(Application.ExeName) + 'wav\打包错误.wav')) then
PlaySound(PChar(ExtractFilePath(Application.ExeName) + 'wav\打包错误.wav'), 0, SND_ASYNC);
Exit;
end;
if ADOQueryPrint.RecordCount < 1 then
begin
Application.MessageBox('此包号还未被保存,请保存数据,在打印条码!', '提示', 0);
IF FileExists(PChar(ExtractFilePath(Application.ExeName)+'wav\댔관댄轎.wav')) then
if FileExists(PChar(ExtractFilePath(Application.ExeName) + 'wav\打包错误.wav')) then
PlaySound(PChar(ExtractFilePath(Application.ExeName) + 'wav\打包错误.wav'), 0, SND_ASYNC);
Exit;
end;
try
Moudle := LoadLibrary('MakeQRBarcode.dll');
@Makebar := GetProcAddress(Moudle, 'Make');
@ -862,7 +964,8 @@ begin
fImagePath := ExtractFilePath(Application.ExeName) + 'image\temp.bmp';
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName) + 'image')) then
CreateDirectory(pchar(ExtractFilePath(Application.ExeName) + 'image'), nil);
if FileExists(fImagePath) then DeleteFile(fImagePath);
if FileExists(fImagePath) then
DeleteFile(fImagePath);
Makebar(pchar(Txt), Length(Txt), 3, 3, 0, PChar(fImagePath), 3);
except
application.MessageBox('条形码生成失败!', '提示信息', MB_ICONERROR);
@ -876,7 +979,7 @@ begin
Application.MessageBox('取包条码最大号失败!', '提示', 0);
Exit;
end;
BaoID.Text:=trim(FBaoid);
BaoID.Text := trim(FBaoID);
CDSsel.Last;
with CDSMJID do
begin
@ -896,13 +999,14 @@ begin
end;
CDSMJID.EmptyDataSet;
IF check_bz.Checked then
if check_bz.Checked then
begin
if Trim(ADOQueryPrint.fieldbyname('NLBName').AsString) <> '' then
fPrintFile:= ExtractFilePath(Application.ExeName) + 'Report\'+Trim(ADOQueryPrint.fieldbyname('NLBName').AsString)+'.rmf'
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + Trim(ADOQueryPrint.fieldbyname('NLBName').AsString) + '.rmf'// fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + Trim(ADOQueryPrint.fieldbyname('NLBName').AsString)
else
fPrintFile:=ExtractFilePath(Application.ExeName)+'Report\관깃푯.rmf';
IF Not FileExists(fPrintFile) then
// fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\包标签.rmf';
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\包标签';
if not FileExists(fPrintFile) then
begin
Application.MessageBox(PChar('没有找' + fPrintFile), '提示', 0);
Exit;
@ -951,7 +1055,7 @@ procedure TfrmCPDBao.baoNoExit(Sender: TObject);
var
FBaoID: string;
begin
IF baoNo.Text<>'' then
if baoNo.Text <> '' then
begin
if GetLSNo(ADOQueryTmp, FBaoID, 'BI', 'WFB_MJJY', 4, 1) = False then
begin
@ -959,7 +1063,7 @@ begin
Application.MessageBox('取包条码最大号失败!', '提示', 0);
Exit;
end;
BaoID.Text:=trim(FBaoid);
BaoID.Text := trim(FBaoID);
end
else
BaoID.Text := '';
@ -995,8 +1099,9 @@ procedure TfrmCPDBao.cxButton3Click(Sender: TObject);
var
i: integer;
begin
IF CDSMJID.IsEmpty then exit;
IF CDSMJID.fieldByName('Sflag').AsString='2' then
if CDSMJID.IsEmpty then
exit;
if CDSMJID.fieldByName('Sflag').AsString = '2' then
begin
application.MessageBox('已打包,不能删除!', '提示信息', 0);
exit;
@ -1015,12 +1120,14 @@ begin
CDSTM.Post;
end;
CDSMJID.Delete;
Rolls := Rolls - 1;
end;
end;
procedure TfrmCPDBao.cxButton2Click(Sender: TObject);
begin
IF CDSMJID.IsEmpty then exit;
if CDSMJID.IsEmpty then
exit;
ADOQueryCmd.Connection.BeginTrans;
try
with CDSMJID do
@ -1057,7 +1164,9 @@ procedure TfrmCPDBao.cxButton4Click(Sender: TObject);
var
FBaoid: string;
begin
if CDSSEL.IsEmpty then Exit;
if CDSSEL.IsEmpty then
Exit;
if CDSSEL.Locate('SSel', True, []) = False then
begin
Application.MessageBox('没有选择数据!', '提示', 0);
@ -1068,8 +1177,8 @@ begin
// ADOQueryCmd.Connection.BeginTrans;
with CDSSEL do
begin
First;
while FieldByName('SSel').AsBoolean do
// First;
while CDSSEL.Locate('SSel', True, []) do
begin
with ADOQueryCmd do
begin
@ -1080,7 +1189,9 @@ begin
ExecSQL;
end;
delete;
end;
end;
// ADOQueryCmd.Connection.CommitTrans;
CDSSEL.EnableControls;
@ -1100,7 +1211,7 @@ begin
SCreateCDS20(ADOQueryTM, CDSTM);
SInitCDSData20(ADOQueryTM, CDSTM);
IF not CDSTM.IsEmpty then
if not CDSTM.IsEmpty then
begin
with ADOQuery1 do
begin
@ -1111,7 +1222,7 @@ begin
open;
end;
baoNo.text := ADOQuery1.fieldbyname('MaxBaoNo').AsString;
if GetLSNo(ADOQueryTmp,FBaoID,'BI','WFB_MJJY',4,1)=False then
if GetLSNo(ADOQueryTmp, FBaoid, 'BI', 'WFB_MJJY', 4, 1) = False then
begin
ADOQueryCmd.Connection.RollbackTrans;
Application.MessageBox('取包条码最大号失败!', '提示', 0);
@ -1121,12 +1232,84 @@ begin
end;
SMNO.SetFocus;
cxButton5.Click;
exit;
except
// ADOQueryCmd.Connection.RollbackTrans;
CDSSEL.EnableControls;
application.MessageBox('数据撤销失败!', '提示信息', 0);
end;
// if CDSSEL.IsEmpty then
// Exit;
// if CDSSEL.Locate('SSel', True, []) = False then
// begin
// Application.MessageBox('没有选择数据!', '提示', 0);
// Exit;
// end;
// try
// CDSSEL.DisableControls;
// // ADOQueryCmd.Connection.BeginTrans;
// with CDSSEL do
// begin
// First;
// while FieldByName('SSel').AsBoolean do
// begin
// with ADOQueryCmd do
// begin
// Close;
// sql.Clear;
// sql.Add('Update WFB_MJJY Set baoID='''',baoNo='''' ');
// sql.Add('where MJID=''' + Trim(CDSSEL.fieldbyname('MJID').AsString) + '''');
// ExecSQL;
// end;
// delete;
// end;
// end;
// // ADOQueryCmd.Connection.CommitTrans;
// CDSSEL.EnableControls;
// application.MessageBox('数据撤销成功!', '提示信息');
//
// with ADOQueryTM do
// begin
// close;
// sql.Clear;
// sql.Add('select A.*,B.*,C.MPrtCodeName,C.orderNo as OrderNoM');
// sql.Add('from WFB_MJJY A ');
// sql.Add('inner join JYOrder_sub B on B.subID=A.subID ');
// sql.Add('inner join JYOrder_main C on C.mainID=A.MainID ');
// sql.Add('and A.mjstr2=''未入库'' and C.orderNo=' + quotedstr(trim(BtnEditA1.Text)));
// open;
// end;
// SCreateCDS20(ADOQueryTM, CDSTM);
// SInitCDSData20(ADOQueryTM, CDSTM);
//
// if not CDSTM.IsEmpty then
// begin
// with ADOQuery1 do
// begin
// close;
// sql.clear;
// sql.add('select isnull(max(cast(baoNo as int)),0)+1 as MaxBaoNo from WFB_MJJY ');
// sql.Add('where mainID=' + quotedstr(trim(CDSTM.fieldbyname('MainID').AsString)));
// open;
// end;
// baoNo.text := ADOQuery1.fieldbyname('MaxBaoNo').AsString;
// if GetLSNo(ADOQueryTmp, FBaoid, 'BI', 'WFB_MJJY', 4, 1) = False then
// begin
// ADOQueryCmd.Connection.RollbackTrans;
// Application.MessageBox('取包条码最大号失败!', '提示', 0);
// Exit;
// end;
// BaoID.Text := trim(FBaoid);
// end;
//
// SMNO.SetFocus;
// exit;
// except
// // ADOQueryCmd.Connection.RollbackTrans;
// CDSSEL.EnableControls;
// application.MessageBox('数据撤销失败!', '提示信息', 0);
// end;
end;
procedure TfrmCPDBao.FbqBtnClick(Sender: TObject);
@ -1149,17 +1332,12 @@ end;
procedure TfrmCPDBao.BaoBqBtnClick(Sender: TObject);
type
TMyFunc = function(App:Tapplication; FormH:hwnd; FormID:integer;
Language: integer; WinStyle:integer;
GCode: Pchar; GName: Pchar; DataBase:Pchar;Title:PChar;
Parameters1:PChar;Parameters2:PChar;Parameters3:PChar;Parameters4:PChar;
Parameters5:PChar;Parameters6:PChar;Parameters7:PChar;Parameters8:PChar;
Parameters9:PChar;Parameters10:PChar;DataBaseStr:PChar):hwnd;stdcall;
TMyFunc = function(App: Tapplication; FormH: hwnd; FormID: integer; Language: integer; WinStyle: integer; GCode: Pchar; GName: Pchar; DataBase: Pchar; Title: PChar; Parameters1: PChar; Parameters2: PChar; Parameters3: PChar; Parameters4: PChar; Parameters5: PChar; Parameters6: PChar; Parameters7: PChar; Parameters8: PChar; Parameters9: PChar; Parameters10: PChar; DataBaseStr: PChar): hwnd; stdcall;
var
Tf: TMyFunc;
Tp: TFarProc;
Th: Thandle;
LabInt,labname:String;
LabInt, labname: string;
begin
//if PPInt=2 then Exit;
Ddatabase := StringOfChar(' ', 32);
@ -1171,15 +1349,7 @@ begin
if Tp <> nil then
begin
Tf := TMyFunc(Tp);
newh:=Tf(Application,0,2,0,0,
PChar(DCode),
PChar(DName),
PChar(Ddatabase),
PChar('깃푯친경<ECB99C>零'),
PChar(''),
PChar(''),
'','','','','','','','',PChar(DConString)
);
newh := Tf(Application, 0, 2, 0, 0, PChar(DCode), PChar(DName), PChar(Ddatabase), PChar('标签模版设置'), PChar(''), PChar(''), '', '', '', '', '', '', '', '', PChar(DConString));
if Trim(PChar(Ddatabase)) <> '' then
begin
Ddatabase := Trim(PChar(Ddatabase));
@ -1209,7 +1379,8 @@ end;
procedure TfrmCPDBao.cxButton6Click(Sender: TObject);
begin
IF CDSTM.IsEmpty then exit;
if CDSTM.IsEmpty then
exit;
if trim(BaoNo.Text) = '' then
begin
application.MessageBox('包号不能为空', '提示');
@ -1258,7 +1429,7 @@ begin
baoNo.text := ADOQuery2.fieldbyname('MaxBaoNo').AsString;
end;
IF CDSMJID.Locate('MJID',trim(CDSTM.fieldbyname('MJID').AsString),[]) then
if CDSMJID.Locate('MJID', trim(CDSTM.fieldbyname('MJID').AsString), []) then
begin
MovePanel1.Visible := true;
Edit2.Text := SmNO.Text;
@ -1306,4 +1477,124 @@ begin
SInitCDSData20(ADOQueryTM, CDSTM);
end;
procedure TfrmCPDBao.N1Click(Sender: TObject);
begin
SelOKNoFiler(Tv4, True);
end;
procedure TfrmCPDBao.N2Click(Sender: TObject);
begin
SelOKNoFiler(Tv4, False);
end;
procedure TfrmCPDBao.cxButton8Click(Sender: TObject);
var
fPrintFile: string;
Txt, fImagePath: string;
Moudle: THandle;
Makebar: TMakebar;
Mixtext: TMixtext;
FBaoID: string;
i: Integer;
begin
if CDSSEL.IsEmpty then
exit;
with ADOQueryPrint do
begin
Close;
SQL.Clear;
sql.Add(' SELECT D.LBName,D.NLBName');
sql.Add(' from WFB_MJJY A');
sql.Add(' inner join JYOrder_Main D on D.MainID=A.MainID');
SQL.Add('where MJID=''' + Trim(CDSSEL.fieldbyname('MJID').AsString) + '''');
Open;
if not ADOQueryPrint.IsEmpty then
begin
if Trim(ADOQueryPrint.fieldbyname('NLBName').AsString) = '' then
begin
application.MessageBox('没有设置包标签,不能打包!', '提示信息', 0);
exit;
end;
end;
end;
with ADOQueryPrint do
begin
Close;
SQL.Clear;
sql.Add('select A.Baoid,A.BaoNo,A.MJTypeOther as QtyUnit,D.OrderNo,D.conNo,D.customerNoName,D.MprtCodeName,D.Mprtspec,D.OrdPerson1,D.MPRTKuanNO,D.LBName,D.NLBName,');
sql.Add('PRTColor=DBO.F_Get_Order_SubStr(BaoID,''BNColor''),SOrddefstr1=DBO.F_Get_Order_SubStr(BaoID,''BNSOrddefstr1''),');
sql.Add('SOrddefstr4=DBO.F_Get_Order_SubStr(BaoID,''BNSOrddefstr4''),PRtHX=DBO.F_Get_Order_SubStr(BaoID,''BNPRtHX''), ');
sql.Add('Mjstr4=DBO.F_Get_Order_SubStr(BaoID,''BNGangNo''), ');
sql.Add('BNMJLENLIST=DBO.F_Get_Order_SubStr(BaoID,''BNMJLENLIST''), ');
sql.Add('PRTkuanNo=DBO.F_Get_Order_SubStr(BaoID,''BNPrtkuanno''),');
sql.Add('khConNo=(select top 1 khConNo from JYOrderCon_Main X where X.ConNO=D.conNO), ');
sql.Add('MprtCodeNameEng=(select top 1 Note from KH_Zdy X where X.zdyName=D.MprtCodeName), ');
SQL.ADD('count(A.MJID) as JSl,sum(A.MJMaoZ) MJMAOZ,sum(MJQty3) as MJQty3,sum(MJQty4) as MJQty4,SUM(A.MJLen)as MJLen');
sql.Add('from WFB_MJJY A');
sql.Add(' inner join JYOrder_Sub C on C.SubID=A.SubID');
sql.Add(' inner join JYOrder_Main D on D.MainID=A.MainID');
SQL.Add('where A.BaoID=''' + Trim(CDSSEL.fieldbyname('BaoID').AsString) + '''');
SQL.ADD('group by A.Baoid,A.BaoNo,A.MJTypeOther,D.OrderNo,D.conNo,D.customerNoName,D.MprtCodeName,D.Mprtspec,D.OrdPerson1,D.MPRTKuanNO,D.LBName,D.NLBName');
Open;
end;
if ADOQueryPrint.RecordCount > 1 then
begin
Application.MessageBox('打包错误,请重新打包!', '提示', 0);
if FileExists(PChar(ExtractFilePath(Application.ExeName) + 'wav\打包错误.wav')) then
PlaySound(PChar(ExtractFilePath(Application.ExeName) + 'wav\打包错误.wav'), 0, SND_ASYNC);
Exit;
end;
if ADOQueryPrint.RecordCount < 1 then
begin
Application.MessageBox('此包号还未被保存,请保存数据,在打印条码!', '提示', 0);
if FileExists(PChar(ExtractFilePath(Application.ExeName) + 'wav\打包错误.wav')) then
PlaySound(PChar(ExtractFilePath(Application.ExeName) + 'wav\打包错误.wav'), 0, SND_ASYNC);
Exit;
end;
try
Moudle := LoadLibrary('MakeQRBarcode.dll');
@Makebar := GetProcAddress(Moudle, 'Make');
@Mixtext := GetProcAddress(Moudle, 'MixText');
Txt := trim(BaoID.Text);
fImagePath := ExtractFilePath(Application.ExeName) + 'image\temp.bmp';
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName) + 'image')) then
CreateDirectory(pchar(ExtractFilePath(Application.ExeName) + 'image'), nil);
if FileExists(fImagePath) then
DeleteFile(fImagePath);
Makebar(pchar(Txt), Length(Txt), 3, 3, 0, PChar(fImagePath), 3);
except
application.MessageBox('条形码生成失败!', '提示信息', MB_ICONERROR);
exit;
end;
if check_bz.Checked then
begin
if Trim(ADOQueryPrint.fieldbyname('NLBName').AsString) <> '' then
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + Trim(ADOQueryPrint.fieldbyname('NLBName').AsString) + '.rmf' // fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + Trim(ADOQueryPrint.fieldbyname('NLBName').AsString)
else
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\包标签.rmf';
if not FileExists(fPrintFile) then
begin
Application.MessageBox(PChar('没有找' + fPrintFile), '提示', 0);
Exit;
end;
if FileExists(fPrintFile) then
begin
RMVariables['QRBARCODE'] := fImagePath;
RM2.LoadFromFile(fPrintFile);
RM2.DefaultCopies := strtointdef(trim(ComboBox1.Text), 1);
//RM2.ShowReport;
RM2.printReport;
end;
end;
end;
end.

1652
检验管理/U_CPDBAO_S.dfm Normal file

File diff suppressed because it is too large Load Diff

1324
检验管理/U_CPDBAO_S.pas Normal file

File diff suppressed because it is too large Load Diff

View File

@ -20,7 +20,7 @@ object frmJYOrderCDOne: TfrmJYOrderCDOne
object ToolBar1: TToolBar
Left = 0
Top = 0
Width = 1370
Width = 1362
Height = 62
AutoSize = True
ButtonHeight = 30
@ -173,7 +173,7 @@ object frmJYOrderCDOne: TfrmJYOrderCDOne
end
object ComboBox1: TComboBox
Left = 515
Top = 30
Top = 33
Width = 149
Height = 24
Style = csDropDownList
@ -183,8 +183,10 @@ object frmJYOrderCDOne: TfrmJYOrderCDOne
Font.Name = #23435#20307
Font.Style = []
ItemHeight = 16
ItemIndex = 0
ParentFont = False
TabOrder = 0
Text = #38144#21806#30721#21333'(1'#21015')'
Items.Strings = (
#38144#21806#30721#21333'(1'#21015')'
#33521#25991#30721#21333
@ -199,7 +201,9 @@ object frmJYOrderCDOne: TfrmJYOrderCDOne
#38024#32455#24067#21333#21367#21333#21253#35013#31665#21333
#25191#20565#30721#21333
#25191#20565#30721#21333'('#20844#26020')'
#25191#20565#30721#21333'(5'#21015')')
#25191#20565#30721#21333'(5'#21015')'
#24378#20852#30721#21333
#25171#21253#30721#21333)
end
object TBAftChkHX: TToolButton
Left = 664
@ -230,7 +234,7 @@ object frmJYOrderCDOne: TfrmJYOrderCDOne
object Panel1: TPanel
Left = 0
Top = 62
Width = 1370
Width = 1362
Height = 67
Align = alTop
BevelInner = bvRaised
@ -677,8 +681,8 @@ object frmJYOrderCDOne: TfrmJYOrderCDOne
object cxGrid1: TcxGrid
Left = 0
Top = 129
Width = 1370
Height = 594
Width = 1362
Height = 586
Align = alClient
PopupMenu = PopupMenu1
TabOrder = 3

View File

@ -1466,32 +1466,6 @@ begin
ADOQueryCmd.Connection.RollbackTrans;
end;
Order_Main.EnableControls;
// if trim(ComboBox1.Text) = 'ÏúÊÛÂëµ¥(2ÁÐ)' then
// begin
// with ADOQueryTemp do
// begin
// Close;
// sql.Clear;
// sql.add('exec P_Print_CKMDYDLS ');
// sql.add('@DName=' + quotedstr(Trim(DCode)));
// Open;
// end;
// SCreateCDS20(ADOQueryTemp, CDS_HZ);
// SInitCDSData20(ADOQueryTemp, CDS_HZ);
//
// 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=''2'' ');
// Open;
// end;
//// SCreateCDS20(ADOQueryTemp, CDS_PRT);
//// SInitCDSData20(ADOQueryTemp, CDS_PRT);
// end;
if (trim(ComboBox1.Text) = '饋簡쯤데(1죗)') or (trim(ComboBox1.Text) = '饋簡쯤데(2죗)') or (trim(ComboBox1.Text) = '亶匡쯤데') then
begin
@ -1516,8 +1490,6 @@ begin
sql.add(',@flag=''2'' ');
Open;
end;
// SCreateCDS20(ADOQueryTemp, CDS_PRT);
// SInitCDSData20(ADOQueryTemp, CDS_PRT);
end;
if (trim(ComboBox1.Text) = '쇱駱쯤데(陋芎)') then
@ -1692,7 +1664,54 @@ begin
Open;
end;
end;
if trim(ComboBox1.Text) = '´ò°üÂëµ¥' then
begin
with ADOQueryTemp do
begin
Close;
sql.Clear;
sql.add('exec P_Print_CKMDYDL_DB ');
sql.add('@DName=' + quotedstr(Trim(DCode)));
Open;
end;
SCreateCDS20(ADOQueryTemp, CDS_HZ);
SInitCDSData20(ADOQueryTemp, CDS_HZ);
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;
end;
if trim(ComboBox1.Text) = 'Ç¿ÐËÂëµ¥' then
begin
with ADOQueryTemp do
begin
Close;
sql.Clear;
sql.add('exec P_Print_CKMDYDL_QXMD ');
sql.add('@DName=' + quotedstr(Trim(DCode)));
Open;
end;
SCreateCDS20(ADOQueryTemp, CDS_HZ);
SInitCDSData20(ADOQueryTemp, CDS_HZ);
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;
end;
if (trim(ComboBox1.Text) = '쇱駱쯤데(횡<>)') or (trim(ComboBox1.Text) = '쇱駱쯤데(댔얩)') then
begin
with ADOQueryTemp do

View File

@ -21,7 +21,7 @@ object frmMJManageNewFDNewSF: TfrmMJManageNewFDNewSF
Left = 0
Top = 105
Width = 237
Height = 741
Height = 733
Align = alLeft
TabOrder = 1
object Tv3: TcxGridDBTableView
@ -123,8 +123,8 @@ object frmMJManageNewFDNewSF: TfrmMJManageNewFDNewSF
object ScrollBox1: TScrollBox
Left = 649
Top = 105
Width = 645
Height = 741
Width = 637
Height = 733
Align = alClient
TabOrder = 4
object SpeedButton13: TSpeedButton
@ -1002,7 +1002,7 @@ object frmMJManageNewFDNewSF: TfrmMJManageNewFDNewSF
Left = 445
Top = 105
Width = 204
Height = 741
Height = 733
Align = alLeft
BevelInner = bvRaised
BevelOuter = bvLowered
@ -1724,7 +1724,7 @@ object frmMJManageNewFDNewSF: TfrmMJManageNewFDNewSF
object Panel4: TPanel
Left = 0
Top = 0
Width = 1294
Width = 1286
Height = 105
Align = alTop
BevelInner = bvRaised
@ -1733,14 +1733,14 @@ object frmMJManageNewFDNewSF: TfrmMJManageNewFDNewSF
object Panel5: TPanel
Left = 2
Top = 2
Width = 1290
Width = 1282
Height = 101
Align = alClient
TabOrder = 0
object Panel6: TPanel
Left = 1
Top = 31
Width = 1288
Width = 1280
Height = 74
Align = alTop
BevelInner = bvRaised
@ -2035,7 +2035,7 @@ object frmMJManageNewFDNewSF: TfrmMJManageNewFDNewSF
object ToolBar1: TToolBar
Left = 1
Top = 1
Width = 1288
Width = 1280
Height = 30
ButtonHeight = 30
ButtonWidth = 83
@ -2352,7 +2352,7 @@ object frmMJManageNewFDNewSF: TfrmMJManageNewFDNewSF
Left = 237
Top = 105
Width = 208
Height = 741
Height = 733
Align = alLeft
BevelInner = bvRaised
BevelOuter = bvLowered
@ -2361,7 +2361,7 @@ object frmMJManageNewFDNewSF: TfrmMJManageNewFDNewSF
Left = 2
Top = 2
Width = 204
Height = 415
Height = 407
Align = alClient
TabOrder = 0
object Tv2: TcxGridDBTableView
@ -2470,7 +2470,7 @@ object frmMJManageNewFDNewSF: TfrmMJManageNewFDNewSF
end
object Panel8: TPanel
Left = 2
Top = 417
Top = 409
Width = 204
Height = 29
Align = alBottom
@ -2485,7 +2485,7 @@ object frmMJManageNewFDNewSF: TfrmMJManageNewFDNewSF
end
object AOrdDefNote1: TRichEdit
Left = 2
Top = 446
Top = 438
Width = 204
Height = 293
Align = alBottom

View File

@ -319,7 +319,7 @@ type
FInt, PState, PrintInt, SCInitGrid, FState, FCK: Integer;
FColumn, FBanZu, FAPID, FMainId, FSubId, FFFMJID: string;
FJZ, FJC: Double;
fRollType, fRollType1: string;
fRollType, fRollType1, fbaotype, fbaosx: string;
isCommopen, IsJsMessage: boolean;
MValue, FCDName: string;
fxsws, fxsws1: string;
@ -334,6 +334,7 @@ type
procedure AddCDNew(Fbtn: TSpeedButton);
procedure SavedataCK();
procedure PrtData(FMJID: string);
procedure PrtBaoData(FBaoid: string);
procedure OpenCom(DllName: string);
procedure CloseCom(DllName: string);
procedure On1201(var Message: Tmessage); message 1201;
@ -1076,6 +1077,11 @@ begin
FieldByName('MJTypeOther').Value := Trim(Label9.Caption);
FieldByName('note').Value := Trim(note.Text);
if trim(fbaotype) = '手动打包' then
begin
FieldByName('baoNO').Value := Trim(baono.text);
FieldByName('baoID').Value := Trim(baoID.Text);
end;
// FieldByName('baoNO').Value:=Trim(baono.text);
// FieldByName('baoID').Value:=Trim(baoID.Text);
Post;
@ -1214,7 +1220,32 @@ begin
sql.Add('where MJID=''' + Trim(FMJID) + ''' ');
execsql;
end;
if (fbaotype = '手动打包') or (fbaotype = '') or (PState = 2) then
begin
end
else
begin
with ADOCmd do
begin
Close;
sql.Clear;
sql.Add('exec P_Update_Bao ''' + trim(FMJID) + ''' ');
if fbaotype = '单卷单包' then
begin
sql.Add(',1 ');
end
else if fbaotype = '多卷单色' then
begin
sql.Add(',2 ');
end
else if fbaotype = '多卷混色' then
begin
sql.Add(',3 ');
end;
execsql;
end;
end;
//SavedataCK();
ADOCmd.Connection.CommitTrans;
Result := True;
@ -1430,7 +1461,42 @@ begin
PrtData(FFFMJID);
//end;
end;
if Trim(Edit6.Text) = '√' then
begin
if (fbaotype = '手动打包') or (fbaotype = '') then
begin
end
else
begin
with ADOCmd do
begin
Close;
sql.Clear;
sql.Add('exec P_View_Baoid ''' + trim(FFFMJID) + ''' ');
sql.Add(',''' + trim(FMainId) + ''' ,''' + trim(FSubId) + ''' ');
if fbaotype = '单卷单包' then
begin
sql.Add(' ,1 ');
end;
if fbaotype = '多卷单色' then
begin
sql.Add(' ,2 ');
end;
if fbaotype = '多卷混色' then
begin
sql.Add(' ,3 ');
end;
Open;
end;
if trim(ADOCmd.FieldByName('baoid').AsString) <> '' then
begin
PrtBaoData(ADOCmd.fieldbyname('baoid').AsString);
end;
end;
end;
Label16.Caption := '';
BTAdd.Click;
MJMaoZ.SetFocus;
@ -2189,6 +2255,8 @@ begin
FSubId := Trim(ADOTmp.fieldbyname('SubId').AsString);
FJZ := ADOTmp.fieldbyname('jiazhong').AsFloat;
FJC := ADOTmp.fieldbyname('jiachang').AsFloat;
fbaotype := Trim(ADOTmp.fieldbyname('baotype').AsString);
fbaosx := Trim(ADOTmp.fieldbyname('baosx').AsString);
AOrdDefNote1.Text := '°ü×°ÒªÇó:' + #13 + Trim(ADOTmp.fieldbyname('MPRTBZNote').AsString) + #13 //+'·âÌõ:'+Trim(ADOTmp.fieldbyname('MPRTYaoFeng').AsString)+#13
//+'Ì̽ð:'+Trim(ADOTmp.fieldbyname('MPRTTangJin').AsString)+#13
//+'¿ª¼ô:'+Trim(ADOTmp.fieldbyname('MPRTKaiJian').AsString)+#13
@ -2539,6 +2607,93 @@ begin
InitCDGridID();
end;
procedure TfrmMJManageNewFDNewSF.PrtBaoData(FBaoid: string);
var
fPrintFile: string;
Txt, fImagePath: string;
Moudle: THandle;
Makebar: TMakebar;
Mixtext: TMixtext;
i: Integer;
begin
if CDS_MJID.IsEmpty then
exit;
CDS_MJID.First;
with ADOQueryPrint do
begin
Close;
SQL.Clear;
sql.Add('select A.Baoid,A.BaoNo,A.MJTypeOther as QtyUnit,D.OrderNo,D.conNo,D.customerNoName,D.MprtCodeName,D.Mprtspec,D.OrdPerson1,D.MPRTKuanNO,D.LBName,D.NLBName,');
sql.Add('PRTColor=DBO.F_Get_Order_SubStr(BaoID,''BNColor''),SOrddefstr1=DBO.F_Get_Order_SubStr(BaoID,''BNSOrddefstr1''),');
sql.Add('SOrddefstr4=DBO.F_Get_Order_SubStr(BaoID,''BNSOrddefstr4''),PRtHX=DBO.F_Get_Order_SubStr(BaoID,''BNPRtHX''), ');
sql.Add('Mjstr4=DBO.F_Get_Order_SubStr(BaoID,''BNGangNo''), ');
sql.Add('MJXH=DBO.F_Get_Order_SubStr(BaoID,''BNMJXH''), ');
sql.Add('BNMJLENLIST=DBO.F_Get_Order_SubStr(BaoID,''BNMJLENLIST''), ');
sql.Add('PRTkuanNo=DBO.F_Get_Order_SubStr(BaoID,''BNPrtkuanno''),');
sql.Add('khConNo=(select top 1 khConNo from JYOrderCon_Main X where X.ConNO=D.conNO), ');
sql.Add('MprtCodeNameEng=(select top 1 Note from KH_Zdy X where X.zdyName=D.MprtCodeName), ');
SQL.ADD('count(A.MJID) as JSl,sum(A.MJMaoZ) MJMAOZ,sum(MJQty3) as MJQty3,sum(MJQty4) as MJQty4,SUM(A.MJLen)as MJLen');
sql.Add('from WFB_MJJY A');
sql.Add('inner join JYOrder_Sub C on C.SubID=A.SubID');
sql.Add('inner join JYOrder_Main D on D.MainID=A.MainID');
SQL.Add('where A.BaoID=''' + Trim(FBaoid) + '''');
SQL.ADD('group by A.Baoid,A.BaoNo,A.MJTypeOther,D.OrderNo,D.conNo,D.customerNoName,D.MprtCodeName,D.Mprtspec,D.OrdPerson1,D.MPRTKuanNO,D.LBName,D.NLBName');
Open;
end;
if ADOQueryPrint.RecordCount > 1 then
begin
Application.MessageBox('打包错误,请重新打包!', '提示', 0);
Exit;
end;
if ADOQueryPrint.RecordCount < 1 then
begin
Application.MessageBox('此包号还未被保存,请保存数据,在打印条码!', '提示', 0);
Exit;
end;
try
Moudle := LoadLibrary('MakeQRBarcode.dll');
@Makebar := GetProcAddress(Moudle, 'Make');
@Mixtext := GetProcAddress(Moudle, 'MixText');
Txt := trim(FBaoid);
fImagePath := ExtractFilePath(Application.ExeName) + 'image\temp.bmp';
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName) + 'image')) then
CreateDirectory(pchar(ExtractFilePath(Application.ExeName) + 'image'), nil);
if FileExists(fImagePath) then
DeleteFile(fImagePath);
Makebar(pchar(Txt), Length(Txt), 3, 3, 0, PChar(fImagePath), 3);
except
application.MessageBox('条形码生成失败!', '提示信息', MB_ICONERROR);
exit;
end;
if Trim(ADOQueryPrint.fieldbyname('NLBName').AsString) <> '' then
begin
ExportFtErpFile(Trim(ADOQueryPrint.fieldbyname('NLBName').AsString), ADOCmd);
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + Trim(ADOQueryPrint.fieldbyname('NLBName').AsString)
end
else
begin
ExportFtErpFile('包标签.rmf', ADOCmd);
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\包标签.rmf';
end;
if not FileExists(fPrintFile) then
begin
Application.MessageBox(PChar('没有找' + fPrintFile), '提示', 0);
Exit;
end;
if FileExists(fPrintFile) then
begin
RMVariables['QRBARCODE'] := fImagePath;
RM2.LoadFromFile(fPrintFile);
RM2.DefaultCopies := 1;
//RM2.ShowReport;
RM2.printReport;
end;
end;
procedure TfrmMJManageNewFDNewSF.Button7Click(Sender: TObject);
var
fPrintFile: string;

View File

@ -1,6 +1,6 @@
object frmProductOrderLBNameSet: TfrmProductOrderLBNameSet
Left = 170
Top = 95
Left = 182
Top = 249
Width = 1378
Height = 754
Caption = #26631#31614#35774#32622
@ -20,7 +20,8 @@ object frmProductOrderLBNameSet: TfrmProductOrderLBNameSet
object ToolBar1: TToolBar
Left = 0
Top = 0
Width = 1370
Width = 1362
Height = 62
AutoSize = True
ButtonHeight = 30
ButtonWidth = 107
@ -79,16 +80,8 @@ object frmProductOrderLBNameSet: TfrmProductOrderLBNameSet
ImageIndex = 60
OnClick = ToolButton2Click
end
object ToolButton4: TToolButton
Left = 339
Top = 0
AutoSize = True
Caption = #21253#26631#31614#35774#32622
ImageIndex = 60
OnClick = ToolButton4Click
end
object ToolButton3: TToolButton
Left = 438
Left = 339
Top = 0
AutoSize = True
Caption = #30382#37325#35774#32622'(Kg)'
@ -96,64 +89,89 @@ object frmProductOrderLBNameSet: TfrmProductOrderLBNameSet
OnClick = ToolButton3Click
end
object ToolButton10: TToolButton
Left = 549
Left = 450
Top = 0
AutoSize = True
Caption = #21152#37325#35774#32622
ImageIndex = 60
Wrap = True
OnClick = ToolButton10Click
end
object ToolButton11: TToolButton
Left = 636
Top = 0
Left = 0
Top = 30
AutoSize = True
Caption = #21152#38271#35774#32622
ImageIndex = 60
OnClick = ToolButton11Click
end
object ToolButton5: TToolButton
Left = 723
Top = 0
Left = 87
Top = 30
AutoSize = True
Caption = #25442#31639#31995#25968
ImageIndex = 60
OnClick = ToolButton5Click
end
object ToolButton6: TToolButton
Left = 810
Top = 0
Left = 174
Top = 30
AutoSize = True
Caption = #38271#24230#20301#25968
ImageIndex = 60
OnClick = ToolButton6Click
end
object ToolButton9: TToolButton
Left = 897
Top = 0
Left = 261
Top = 30
AutoSize = True
Caption = #37325#37327#20301#25968
ImageIndex = 60
OnClick = ToolButton9Click
end
object ToolButton12: TToolButton
Left = 348
Top = 30
AutoSize = True
Caption = #27599#21253#21367#25968
ImageIndex = 60
OnClick = ToolButton12Click
end
object ToolButton13: TToolButton
Left = 435
Top = 30
AutoSize = True
Caption = #27599#21367#38271#24230
ImageIndex = 60
OnClick = ToolButton13Click
end
object ToolButton4: TToolButton
Left = 522
Top = 30
AutoSize = True
Caption = #21253#26631#31614#35774#32622
ImageIndex = 60
OnClick = ToolButton4Click
end
object ToolButton7: TToolButton
Left = 984
Top = 0
Left = 621
Top = 30
AutoSize = True
Caption = #39044#35272#21367#26631#31614
ImageIndex = 12
OnClick = ToolButton7Click
end
object ToolButton8: TToolButton
Left = 1083
Top = 0
Left = 720
Top = 30
AutoSize = True
Caption = #39044#35272#21253#26631#31614
ImageIndex = 12
OnClick = ToolButton8Click
end
object PiZhong: TEdit
Left = 1182
Top = 0
Left = 819
Top = 30
Width = 121
Height = 30
Font.Charset = GB2312_CHARSET
@ -165,8 +183,8 @@ object frmProductOrderLBNameSet: TfrmProductOrderLBNameSet
TabOrder = 0
end
object TBClose: TToolButton
Left = 1303
Top = 0
Left = 940
Top = 30
AutoSize = True
Caption = #20851#38381
ImageIndex = 55
@ -175,8 +193,8 @@ object frmProductOrderLBNameSet: TfrmProductOrderLBNameSet
end
object Panel1: TPanel
Left = 0
Top = 32
Width = 1370
Top = 62
Width = 1362
Height = 62
Align = alTop
BevelInner = bvRaised
@ -413,8 +431,8 @@ object frmProductOrderLBNameSet: TfrmProductOrderLBNameSet
end
object cxGrid1: TcxGrid
Left = 0
Top = 94
Width = 1370
Top = 124
Width = 1362
Height = 545
Align = alTop
TabOrder = 2
@ -614,6 +632,41 @@ object frmProductOrderLBNameSet: TfrmProductOrderLBNameSet
HeaderAlignmentHorz = taCenter
Width = 80
end
object Tv1Column2: TcxGridDBColumn
Caption = #25171#21253#26041#24335
DataBinding.FieldName = 'baotype'
PropertiesClassName = 'TcxComboBoxProperties'
Properties.Items.Strings = (
''
#21333#21367#21333#21253
#25163#21160#25171#21253
#22810#21367#21333#33394)
Properties.OnEditValueChanged = Tv1Column2PropertiesEditValueChanged
HeaderAlignmentHorz = taCenter
Width = 60
end
object Tv1Column3: TcxGridDBColumn
Caption = #27599#21253#21367#25968
DataBinding.FieldName = 'JS'
HeaderAlignmentHorz = taCenter
Width = 60
end
object Tv1Column4: TcxGridDBColumn
Caption = #21253#21495#39034#24207
DataBinding.FieldName = 'baosx'
PropertiesClassName = 'TcxComboBoxProperties'
Properties.Items.Strings = (
#25353#39068#33394#29983#25104
#25353#35746#21333#29983#25104
#25353#32568#21495#29983#25104)
Properties.OnEditValueChanged = Tv1Column4PropertiesEditValueChanged
HeaderAlignmentHorz = taCenter
Width = 60
end
object Tv1Column5: TcxGridDBColumn
Caption = #27599#21253#38271#24230
DataBinding.FieldName = 'PRTDC'
end
end
object cxGrid1Level1: TcxGridLevel
GridView = Tv1

View File

@ -6,25 +6,24 @@ uses
Windows, Messages, SysUtils, Variants, Classes, Graphics, Controls, Forms,
Dialogs, StdCtrls, ExtCtrls, ComCtrls, ToolWin, cxStyles, cxCustomData,
cxGraphics, cxFilter, cxData, cxDataStorage, cxEdit, DB, cxDBData, ADODB,
cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses,
cxControls, cxGridCustomView, cxGridCustomTableView, cxGridTableView,
cxGridDBTableView, cxGrid, DBClient, cxCheckBox, cxCalendar, cxSplitter,
RM_Dataset, RM_System, RM_Common, RM_Class, RM_GridReport, RM_e_Xls,StrUtils,
Menus, cxDropDownEdit,cxTextEdit, cxLookAndFeels, cxLookAndFeelPainters,
cxNavigator, 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;
cxGridCustomPopupMenu, cxGridPopupMenu, cxGridLevel, cxClasses, cxControls,
cxGridCustomView, cxGridCustomTableView, cxGridTableView, cxGridDBTableView,
cxGrid, DBClient, cxCheckBox, cxCalendar, cxSplitter, RM_Dataset, RM_System,
RM_Common, RM_Class, RM_GridReport, RM_e_Xls, StrUtils, Menus, cxDropDownEdit,
cxTextEdit, cxLookAndFeels, cxLookAndFeelPainters, cxNavigator, 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;
type
TfrmProductOrderLBNameSet = class(TForm)
@ -112,6 +111,12 @@ type
v1Column8: TcxGridDBColumn;
ToolButton11: TToolButton;
Tv1Column1: TcxGridDBColumn;
Tv1Column2: TcxGridDBColumn;
Tv1Column3: TcxGridDBColumn;
Tv1Column4: TcxGridDBColumn;
Tv1Column5: TcxGridDBColumn;
ToolButton12: TToolButton;
ToolButton13: TToolButton;
procedure FormDestroy(Sender: TObject);
procedure FormClose(Sender: TObject; var Action: TCloseAction);
procedure FormCreate(Sender: TObject);
@ -121,20 +126,13 @@ type
procedure TBRafreshClick(Sender: TObject);
procedure OrderNoChange(Sender: TObject);
procedure FormShow(Sender: TObject);
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView;
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
AShift: TShiftState; var AHandled: Boolean);
procedure Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
procedure CheckBox2Click(Sender: TObject);
procedure Tv1StylesGetContentStyle(Sender: TcxCustomGridTableView;
ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem;
out AStyle: TcxStyle);
procedure v1DeliveryDateCustomDrawCell(Sender: TcxCustomGridTableView;
ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo;
var ADone: Boolean);
procedure Tv1StylesGetContentStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out AStyle: TcxStyle);
procedure v1DeliveryDateCustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
procedure ToolButton1Click(Sender: TObject);
procedure OrderNoKeyPress(Sender: TObject; var Key: Char);
procedure Panel10MouseMove(Sender: TObject; Shift: TShiftState; X,
Y: Integer);
procedure Panel10MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
procedure Button1Click(Sender: TObject);
procedure Image2Click(Sender: TObject);
procedure ToolButton2Click(Sender: TObject);
@ -149,6 +147,10 @@ type
procedure ToolButton9Click(Sender: TObject);
procedure ToolButton10Click(Sender: TObject);
procedure ToolButton11Click(Sender: TObject);
procedure ToolButton12Click(Sender: TObject);
procedure ToolButton13Click(Sender: TObject);
procedure Tv1Column2PropertiesEditValueChanged(Sender: TObject);
procedure Tv1Column4PropertiesEditValueChanged(Sender: TObject);
private
DQdate: TDateTime;
procedure InitGrid();
@ -164,7 +166,9 @@ type
var
frmProductOrderLBNameSet: TfrmProductOrderLBNameSet;
newh: hwnd;
implementation
uses
U_DataLink, U_OrderInPut, U_Fun;
@ -175,8 +179,7 @@ begin
frmProductOrderLBNameSet := nil;
end;
procedure TfrmProductOrderLBNameSet.FormClose(Sender: TObject;
var Action: TCloseAction);
procedure TfrmProductOrderLBNameSet.FormClose(Sender: TObject; var Action: TCloseAction);
begin
Action := caFree;
end;
@ -216,7 +219,6 @@ begin
end;
end;
procedure TfrmProductOrderLBNameSet.InitForm();
begin
ReadCxGrid('标签设置1', Tv1, '生产指示单管理');
@ -227,11 +229,13 @@ end;
procedure TfrmProductOrderLBNameSet.TBFindClick(Sender: TObject);
begin
if ADOQueryMain.Active=False then Exit;
if ADOQueryMain.Active = False then
Exit;
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
SCreateCDS20(ADOQueryMain, Order_Main);
SInitCDSData20(ADOQueryMain, Order_Main);
end;
procedure TfrmProductOrderLBNameSet.TBPrintClick(Sender: TObject);
begin
Panel4.Visible := True;
@ -259,7 +263,8 @@ end;
procedure TfrmProductOrderLBNameSet.OrderNoChange(Sender: TObject);
begin
if ADOQueryMain.Active=False then Exit;
if ADOQueryMain.Active = False then
Exit;
SDofilter(ADOQueryMain, SGetFilters(Panel1, 1, 2));
SCreateCDS20(ADOQueryMain, Order_Main);
SInitCDSData20(ADOQueryMain, Order_Main);
@ -270,12 +275,10 @@ begin
InitForm();
end;
procedure TfrmProductOrderLBNameSet.Tv1CellDblClick(
Sender: TcxCustomGridTableView;
ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton;
AShift: TShiftState; var AHandled: Boolean);
procedure TfrmProductOrderLBNameSet.Tv1CellDblClick(Sender: TcxCustomGridTableView; ACellViewInfo: TcxGridTableDataCellViewInfo; AButton: TMouseButton; AShift: TShiftState; var AHandled: Boolean);
begin
if ToolButton1.Visible=False then Exit;
if ToolButton1.Visible = False then
Exit;
ToolButton1.Click;
end;
@ -284,9 +287,7 @@ begin
TBRafresh.Click;
end;
procedure TfrmProductOrderLBNameSet.Tv1StylesGetContentStyle(
Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord;
AItem: TcxCustomGridTableItem; out AStyle: TcxStyle);
procedure TfrmProductOrderLBNameSet.Tv1StylesGetContentStyle(Sender: TcxCustomGridTableView; ARecord: TcxCustomGridRecord; AItem: TcxCustomGridTableItem; out AStyle: TcxStyle);
var
id, id10: Integer;
begin
@ -314,9 +315,7 @@ begin
end; }
end;
procedure TfrmProductOrderLBNameSet.v1DeliveryDateCustomDrawCell(
Sender: TcxCustomGridTableView; ACanvas: TcxCanvas;
AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
procedure TfrmProductOrderLBNameSet.v1DeliveryDateCustomDrawCell(Sender: TcxCustomGridTableView; ACanvas: TcxCanvas; AViewInfo: TcxGridTableDataCellViewInfo; var ADone: Boolean);
begin
{ Id:=TV1.GetColumnByFieldName('DeliveryDate').Index;//;-TV1.GroupedItemCount;
Id10:=TV1.GetColumnByFieldName('SubStatus').Index;
@ -353,7 +352,8 @@ end;
procedure TfrmProductOrderLBNameSet.ToolButton1Click(Sender: TObject);
begin
if Order_Main.IsEmpty then Exit;
if Order_Main.IsEmpty then
Exit;
try
frmOrderInPut := TfrmOrderInPut.Create(Application);
with frmOrderInPut do
@ -374,12 +374,12 @@ begin
end;
end;
procedure TfrmProductOrderLBNameSet.OrderNoKeyPress(Sender: TObject;
var Key: Char);
procedure TfrmProductOrderLBNameSet.OrderNoKeyPress(Sender: TObject; var Key: Char);
begin
if Key = #13 then
begin
if Length(OrderNo.Text)<3 then Exit;
if Length(OrderNo.Text) < 3 then
Exit;
try
ADOQueryMain.DisableControls;
with ADOQueryMain do
@ -401,8 +401,7 @@ begin
end;
end;
procedure TfrmProductOrderLBNameSet.Panel10MouseMove(Sender: TObject;
Shift: TShiftState; X, Y: Integer);
procedure TfrmProductOrderLBNameSet.Panel10MouseMove(Sender: TObject; Shift: TShiftState; X, Y: Integer);
begin
ReleaseCapture;
TWinControl(Panel4).Perform(WM_SYSCOMMAND, $F012, 0);
@ -415,7 +414,8 @@ var
i, j: Integer;
OrderKg: Double;
begin
if Order_Main.IsEmpty then Exit;
if Order_Main.IsEmpty then
Exit;
LBName := RadioGroup1.Items.Strings[RadioGroup1.ItemIndex];
fPrintFile := ExtractFilePath(Application.ExeName) + 'Report\' + Trim(LBName) + '.rmf';
if RadioGroup1.ItemIndex = 0 then
@ -436,7 +436,8 @@ begin
Open;
end;
end else
end
else
begin
with ADOQueryPrint do
begin
@ -483,7 +484,8 @@ begin
else
RMVariables['OrderKg'] := '';
RM1.ShowReport;
end else
end
else
begin
Application.MessageBox(PChar('没有找' + ExtractFilePath(Application.ExeName) + 'Report\' + Trim(LBName) + '.rmf'), '提示', 0);
end;
@ -496,22 +498,18 @@ end;
procedure TfrmProductOrderLBNameSet.ToolButton2Click(Sender: TObject);
type
TMyFunc = function(App:Tapplication; FormH:hwnd; FormID:integer;
Language: integer; WinStyle:integer;
GCode: Pchar; GName: Pchar; DataBase:Pchar;Title:PChar;
Parameters1:PChar;Parameters2:PChar;Parameters3:PChar;Parameters4:PChar;
Parameters5:PChar;Parameters6:PChar;Parameters7:PChar;Parameters8:PChar;
Parameters9:PChar;Parameters10:PChar;DataBaseStr:PChar):hwnd;stdcall;
TMyFunc = function(App: Tapplication; FormH: hwnd; FormID: integer; Language: integer; WinStyle: integer; GCode: Pchar; GName: Pchar; DataBase: Pchar; Title: PChar; Parameters1: PChar; Parameters2: PChar; Parameters3: PChar; Parameters4: PChar; Parameters5: PChar; Parameters6: PChar; Parameters7: PChar; Parameters8: PChar; Parameters9: PChar; Parameters10: PChar; DataBaseStr: PChar): hwnd; stdcall;
var
Tf: TMyFunc;
Tp: TFarProc;
Th: Thandle;
LabInt,labname:String;
LabInt, labname: string;
OpenDiaLog: TOpenDialog;
fFileName: string;
fFilePath: string;
begin
IF Order_Main.IsEmpty then exit;
if Order_Main.IsEmpty then
exit;
if Order_Main.Locate('SSel', True, []) = False then
begin
Application.MessageBox('没有选择数据!', '提示', 0);
@ -528,13 +526,14 @@ begin
end;
finally
end;
IF trim(fFileName)='' then exit;
if trim(fFileName) = '' then
exit;
with order_Main do
begin
first;
While not Eof do
while not Eof do
begin
If FieldByName('Ssel').AsBoolean=true then
if FieldByName('Ssel').AsBoolean = true then
begin
with ADOQueryCmd do
begin
@ -551,8 +550,6 @@ begin
end;
end;
with Order_Main do
begin
DisableControls;
@ -574,7 +571,8 @@ var
FPiZhong: string;
FReal: Double;
begin
IF Order_Main.IsEmpty then exit;
if Order_Main.IsEmpty then
exit;
if Order_Main.Locate('SSel', True, []) = False then
begin
Application.MessageBox('没有选择数据!', '提示', 0);
@ -593,7 +591,7 @@ begin
with order_Main do
begin
first;
While not Eof do
while not Eof do
begin
if order_Main.FieldByName('Ssel').AsBoolean = true then
begin
@ -652,19 +650,15 @@ end;
procedure TfrmProductOrderLBNameSet.ToolButton4Click(Sender: TObject);
type
TMyFunc = function(App:Tapplication; FormH:hwnd; FormID:integer;
Language: integer; WinStyle:integer;
GCode: Pchar; GName: Pchar; DataBase:Pchar;Title:PChar;
Parameters1:PChar;Parameters2:PChar;Parameters3:PChar;Parameters4:PChar;
Parameters5:PChar;Parameters6:PChar;Parameters7:PChar;Parameters8:PChar;
Parameters9:PChar;Parameters10:PChar;DataBaseStr:PChar):hwnd;stdcall;
TMyFunc = function(App: Tapplication; FormH: hwnd; FormID: integer; Language: integer; WinStyle: integer; GCode: Pchar; GName: Pchar; DataBase: Pchar; Title: PChar; Parameters1: PChar; Parameters2: PChar; Parameters3: PChar; Parameters4: PChar; Parameters5: PChar; Parameters6: PChar; Parameters7: PChar; Parameters8: PChar; Parameters9: PChar; Parameters10: PChar; DataBaseStr: PChar): hwnd; stdcall;
var
Tf: TMyFunc;
Tp: TFarProc;
Th: Thandle;
LabInt,labname:String;
LabInt, labname: string;
begin
IF Order_Main.IsEmpty then exit;
if Order_Main.IsEmpty then
exit;
if Order_Main.Locate('SSel', True, []) = False then
begin
Application.MessageBox('没有选择数据!', '提示', 0);
@ -679,15 +673,7 @@ begin
if Tp <> nil then
begin
Tf := TMyFunc(Tp);
newh:=Tf(Application,0,2,0,0,
PChar(DCode),
PChar(DName),
PChar(Ddatabase),
PChar('±êǩģ°æÉèÖÃ'),
PChar(''),
PChar(''),
'','','','','','','','',PChar(DConString)
);
newh := Tf(Application, 0, 2, 0, 0, PChar(DCode), PChar(DName), PChar(Ddatabase), PChar('标签模版设置'), PChar(''), PChar(''), '', '', '', '', '', '', '', '', PChar(DConString));
if Trim(PChar(Ddatabase)) <> '' then
begin
Ddatabase := Trim(PChar(Ddatabase));
@ -696,7 +682,7 @@ begin
with order_Main do
begin
first;
While not Eof do
while not Eof do
begin
if order_Main.FieldByName('Ssel').AsBoolean = true then
begin
@ -748,8 +734,7 @@ begin
end;
end;
procedure TfrmProductOrderLBNameSet.v1Column2PropertiesEditValueChanged(
Sender: TObject);
procedure TfrmProductOrderLBNameSet.v1Column2PropertiesEditValueChanged(Sender: TObject);
var
mvalues: string;
begin
@ -779,7 +764,8 @@ var
FPiZhong: string;
FReal: Double;
begin
IF Order_Main.IsEmpty then exit;
if Order_Main.IsEmpty then
exit;
if Order_Main.Locate('SSel', True, []) = False then
begin
Application.MessageBox('没有选择数据!', '提示', 0);
@ -798,7 +784,7 @@ begin
with order_Main do
begin
first;
While not Eof do
while not Eof do
begin
if order_Main.FieldByName('Ssel').AsBoolean = true then
begin
@ -843,7 +829,8 @@ var
FPiZhong: string;
FReal: Double;
begin
IF Order_Main.IsEmpty then exit;
if Order_Main.IsEmpty then
exit;
if Order_Main.Locate('SSel', True, []) = False then
begin
Application.MessageBox('没有选择数据!', '提示', 0);
@ -862,7 +849,7 @@ begin
with order_Main do
begin
first;
While not Eof do
while not Eof do
begin
if order_Main.FieldByName('Ssel').AsBoolean = true then
begin
@ -904,14 +891,16 @@ end;
procedure TfrmProductOrderLBNameSet.ToolButton7Click(Sender: TObject);
var
fPrintFile:String;
fPrintFile: string;
Txt, fImagePath: string;
Moudle: THandle;
Makebar: TMakebar;
Mixtext: TMixtext;
begin
IF Order_Main.IsEmpty then exit;
IF trim(Order_Main.fieldbyname('SLbName').AsString)='' then exit;
if Order_Main.IsEmpty then
exit;
if trim(Order_Main.fieldbyname('SLbName').AsString) = '' then
exit;
with ADOQueryPrint do
begin
@ -929,7 +918,8 @@ begin
fImagePath := ExtractFilePath(Application.ExeName) + 'image\temp.bmp';
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName) + 'image')) then
CreateDirectory(pchar(ExtractFilePath(Application.ExeName) + 'image'), nil);
if FileExists(fImagePath) then DeleteFile(fImagePath);
if FileExists(fImagePath) then
DeleteFile(fImagePath);
Makebar(pchar(Txt), Length(Txt), 3, 3, 0, PChar(fImagePath), 3);
except
application.MessageBox('条形码生成失败!', '提示信息', MB_ICONERROR);
@ -948,19 +938,20 @@ begin
Application.MessageBox(PChar('没有找到' + trim(fPrintFile)), '提示信息', 0);
end;
end;
procedure TfrmProductOrderLBNameSet.ToolButton8Click(Sender: TObject);
var
fPrintFile:String;
fPrintFile: string;
Txt, fImagePath: string;
Moudle: THandle;
Makebar: TMakebar;
Mixtext: TMixtext;
begin
IF Order_Main.IsEmpty then exit;
IF trim(Order_Main.fieldbyname('NLBName').AsString)='' then exit;
if Order_Main.IsEmpty then
exit;
if trim(Order_Main.fieldbyname('NLBName').AsString) = '' then
exit;
with ADOQueryPrint do
begin
Close;
@ -977,7 +968,8 @@ begin
fImagePath := ExtractFilePath(Application.ExeName) + 'image\temp.bmp';
if not DirectoryExists(pchar(ExtractFilePath(Application.ExeName) + 'image')) then
CreateDirectory(pchar(ExtractFilePath(Application.ExeName) + 'image'), nil);
if FileExists(fImagePath) then DeleteFile(fImagePath);
if FileExists(fImagePath) then
DeleteFile(fImagePath);
Makebar(pchar(Txt), Length(Txt), 3, 3, 0, PChar(fImagePath), 3);
except
application.MessageBox('条形码生成失败!', '提示信息', MB_ICONERROR);
@ -1003,7 +995,8 @@ var
FPiZhong: string;
FReal: Double;
begin
IF Order_Main.IsEmpty then exit;
if Order_Main.IsEmpty then
exit;
if Order_Main.Locate('SSel', True, []) = False then
begin
Application.MessageBox('没有选择数据!', '提示', 0);
@ -1022,7 +1015,7 @@ begin
with order_Main do
begin
first;
While not Eof do
while not Eof do
begin
if order_Main.FieldByName('Ssel').AsBoolean = true then
begin
@ -1067,7 +1060,8 @@ var
FPiZhong: string;
FReal: Double;
begin
IF Order_Main.IsEmpty then exit;
if Order_Main.IsEmpty then
exit;
if Order_Main.Locate('SSel', True, []) = False then
begin
Application.MessageBox('没有选择数据!', '提示', 0);
@ -1086,7 +1080,7 @@ begin
with order_Main do
begin
first;
While not Eof do
while not Eof do
begin
if order_Main.FieldByName('Ssel').AsBoolean = true then
begin
@ -1130,7 +1124,8 @@ var
FPiZhong: string;
FReal: Double;
begin
IF Order_Main.IsEmpty then exit;
if Order_Main.IsEmpty then
exit;
if Order_Main.Locate('SSel', True, []) = False then
begin
Application.MessageBox('没有选择数据!', '提示', 0);
@ -1149,7 +1144,7 @@ begin
with order_Main do
begin
first;
While not Eof do
while not Eof do
begin
if order_Main.FieldByName('Ssel').AsBoolean = true then
begin
@ -1188,4 +1183,182 @@ begin
end;
end;
procedure TfrmProductOrderLBNameSet.ToolButton12Click(Sender: TObject);
var
FPiZhong: string;
FReal: Double;
begin
if Order_Main.IsEmpty then
exit;
if Order_Main.Locate('SSel', True, []) = False then
begin
Application.MessageBox('没有选择数据!', '提示', 0);
Exit;
end;
if Trim(PiZhong.Text) = '' then
begin
Application.MessageBox('每包卷数不能为空!', '提示', 0);
Exit;
end;
if TryStrToFloat(PiZhong.Text, FReal) = False then
begin
Application.MessageBox('每包卷数非法数字!', '提示', 0);
Exit;
end;
with order_Main do
begin
first;
while not Eof do
begin
if order_Main.FieldByName('Ssel').AsBoolean = true then
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('Update JYOrder_Sub Set JS=' + Trim(PiZhong.Text));
sql.Add(' where Subid=''' + Trim(Order_Main.fieldbyname('Subid').AsString) + '''');
ExecSQL;
end;
with Order_Main do
begin
Edit;
FieldByName('JS').Value := PiZhong.Text;
Post;
end;
end;
next;
end;
end;
CheckBox1.Checked := False;
with Order_Main do
begin
DisableControls;
first;
while not Eof do
begin
edit;
fieldbyname('Ssel').AsBoolean := False;
post;
next;
end;
first;
EnableControls;
end;
end;
procedure TfrmProductOrderLBNameSet.ToolButton13Click(Sender: TObject);
var
FPiZhong: string;
FReal: Double;
begin
if Order_Main.IsEmpty then
exit;
if Order_Main.Locate('SSel', True, []) = False then
begin
Application.MessageBox('没有选择数据!', '提示', 0);
Exit;
end;
if Trim(PiZhong.Text) = '' then
begin
Application.MessageBox('每卷长度不能为空!', '提示', 0);
Exit;
end;
if TryStrToFloat(PiZhong.Text, FReal) = False then
begin
Application.MessageBox('每卷长度非法数字!', '提示', 0);
Exit;
end;
with order_Main do
begin
first;
while not Eof do
begin
if order_Main.FieldByName('Ssel').AsBoolean = true then
begin
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('Update JYOrder_Sub Set PRTDC=' + Trim(PiZhong.Text));
sql.Add(' where Subid=''' + Trim(Order_Main.fieldbyname('Subid').AsString) + '''');
ExecSQL;
end;
with Order_Main do
begin
Edit;
FieldByName('PRTDC').Value := PiZhong.Text;
Post;
end;
end;
next;
end;
end;
CheckBox1.Checked := False;
with Order_Main do
begin
DisableControls;
first;
while not Eof do
begin
edit;
fieldbyname('Ssel').AsBoolean := False;
post;
next;
end;
first;
EnableControls;
end;
end;
procedure TfrmProductOrderLBNameSet.Tv1Column2PropertiesEditValueChanged(Sender: TObject);
var
mvalues: string;
begin
mvalues := TCXTextEdit(Sender).Text;
with Order_Main do
begin
edit;
fieldbyname('baotype').Value := mvalues;
post;
end;
tv1.Controller.EditingController.ShowEdit();
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('Update JYOrder_Main Set baotype=''' + trim(mvalues) + ''' ');
sql.Add('where Mainid=''' + Trim(Order_Main.fieldbyname('Mainid').AsString) + '''');
ExecSQL;
end;
end;
procedure TfrmProductOrderLBNameSet.Tv1Column4PropertiesEditValueChanged(Sender: TObject);
var
mvalues: string;
begin
mvalues := TCXTextEdit(Sender).Text;
with Order_Main do
begin
edit;
fieldbyname('baosx').Value := mvalues;
post;
end;
tv1.Controller.EditingController.ShowEdit();
with ADOQueryCmd do
begin
Close;
sql.Clear;
sql.Add('Update JYOrder_Main Set baosx=''' + trim(mvalues) + ''' ');
sql.Add('where Mainid=''' + Trim(Order_Main.fieldbyname('Mainid').AsString) + '''');
ExecSQL;
end;
end;
end.